\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]"));function A(e){for(var _=0,t=0;t
\n '.concat(c.title,'\n \n
\n\n'),i.slice(i.indexOf(c)+1).slice(0,3).forEach(function(e){n+='\n\n '.concat(e.title," \n
\n")})}var h=i.filter(function(e){return e.threshold>o&&e.threshold".concat(O("gameOver.test_run"),"
"):"","\n").concat(_,"
\n").concat(O("gameOver.cumulative_total",{startTs:o,endTs:l}),"
\n ").concat(n," \n "),actions:[{value:null,text:O("gameOver.restart"),help:""}],textAfterButtons:'\n'.concat(O("gameOver.upgrades_picked"),"
\n").concat(ec(_M),"
\n ").concat(function(){var e="";try{var _=JSON.parse(localStorage.getItem("breakout_71_runs_history")||"[]");_.sort(function(e,_){return e.score-_.score}).reverse(),(_=_.slice(0,100)).push(W(k({},_M.runStatistics),{perks:_M.perks,appVersion:V})),_M.isCreativeModeRun||localStorage.setItem("breakout_71_runs_history",JSON.stringify(_,null,2));var t=function(e,t,r){var a,s,n,l=_.map(function(e){return t(e)||0}),o=(a=Math).min.apply(a,f(l)),i=(s=Math).max.apply(s,f(l));if(o===i)return"";i-o<10&&(o=Math.max(0,i-10),i=Math.max(i,o+10));var u=Math.min(l.length,10);if(u<3)return"";for(var c=[],p=[],d=0;d1?"s":""," between ").concat(Math.floor(o+_*m)," and ").concat(Math.floor(o+(_+1)*m)).concat(r,'"\n >').concat(!e&&" "||_==v&&b+r||Math.round(p[_]/e)+r,"")}).join("");return'".concat(O("gameOver.stats.intro",{count:_.length-1}),"
")+e)}catch(e){console.warn(e)}return e}()," \n ")}).then(function(){return _B({levelToAvoid:ep(_M).name})})}}function eN(e,_){e.running&&e.levelTime>500&&e.perks.passive_income&&Math.abs(_-e.puckPosition)>3&&e$(e,_,e.gameZoneHeight-e.puckHeight),e.puckPosition=_,e.needsRender=!0}function eY(e){return+!e.perks.concave_puck*(Math.random()>.5?e.baseSpeed:-e.baseSpeed)}function eJ(e){var _,t=1+((null===(_=e.perks)||void 0===_?void 0:_.multiball)||0),r=e.puckWidth/(t+1);e.balls=[],e.ballsColor="#FFF",(e.perks.picky_eater||e.perks.pierce_color)&&(e.ballsColor=function(e){var _,t,r={};e.forEach(function(e){return r[e]=(r[e]||0)+1});var a=(t=Math).max.apply(t,f(Object.keys(r).map(function(e){return r[e]})));return(_=Object.keys(r).filter(function(e){return r[e]==a}))[Math.floor(_.length*Math.random())]}(e.bricks.filter(function(e){return e}))||"#FFF");for(var a=0;a".concat(O("level_up.after_buttons",{level:e.currentLevel+1,max:eu(e)}),"
\n").concat(ec(e),'
\n \n \n '),u=a&&s&&l&&n&&O("level_up.compliment_perfect")||(a||s||l||n)&&O("level_up.compliment_good")||O("level_up.compliment_advice"),[4,eI({title:O("level_up.pick_upgrade_title")+(t?" ("+(t+1)+")":""),actions:o,text:"".concat(O("level_up.before_buttons",{score:e.score-e.levelStartScore,catchGain:s,levelSpawnedCoins:e.levelSpawnedCoins,time:Math.round(e.levelTime/1e3),timeGain:a,levelMisses:e.levelMisses,missesGain:l,levelWallBounces:e.levelWallBounces,wallHitsGain:n,compliment:u}),"\n
"),allowClose:!1,textAfterButtons:i})];case 2:return c=p.sent(),e.perks[c]++,"instant_upgrade"===c&&(t+=2),e.runStatistics.upgrades_picked++,[3,1];case 3:return[2]}})})).apply(this,arguments)}function _m(e,_){return eo(_M,Math.floor(_/_M.brickWidth),Math.floor((e-_M.offsetX)/_M.brickWidth))}function _h(e){if(_M.bricks[e])return e}function _g(e,_,t){var r,a,s;return null!==(s=null!==(a=null!==(r=_h(_m(e-t,_-t)))&&void 0!==r?r:_h(_m(e+t,_-t)))&&void 0!==a?a:_h(_m(e+t,_+t)))&&void 0!==s?s:_h(_m(e-t,_+t))}function _b(){return _v.apply(this,arguments)}function _v(){return(_v=(0,g._)(function(){var e;return(0,y.__generator)(this,function(_){switch(_.label){case 0:return _c(!0),[4,eI({title:O("score_panel.title",{score:_M.score,level:_M.currentLevel+1,max:eu(_M)}),text:"\n ".concat(_M.isCreativeModeRun?"".concat(O("score_panel.test_run"),"
"):"","\n").concat(O("score_panel.upgrades_picked"),"
\n").concat(ec(_M),"
\n "),allowClose:!0,actions:[{text:O("score_panel.resume"),help:O("score_panel.resume_help"),value:function(){}},{text:O("score_panel.restart"),help:O("score_panel.restart_help"),value:function(){_B({levelToAvoid:ep(_M).name})}}]})];case 1:return(e=_.sent())&&e(),[2]}})})).apply(this,arguments)}function _f(){return _y.apply(this,arguments)}function _y(){return(_y=(0,g._)(function(){var e,_,t,r,a,s,n,l,o,i;return(0,y.__generator)(this,function(u){switch(u.label){case 0:_c(!0),_=[],t=!0,r=!1,a=void 0;try{for(s=function(){var e=l.value;U[e]&&_.push({icon:N(e)?I["icon:checkmark_checked"]:I["icon:checkmark_unchecked"],text:U[e].name,help:U[e].help,value:function(){H("breakout-settings-enable-"+e,!N(e)),"mobile-mode"===e&&_p(),_f()}})},n=Object.keys(U)[Symbol.iterator]();!(t=(l=n.next()).done);t=!0)s()}catch(e){r=!0,a=e}finally{try{t||null==n.return||n.return()}finally{if(r)throw a}}return o=(e=Math).max.apply(e,f(F.map(function(e){return e.threshold}))),(document.fullscreenEnabled||document.webkitFullscreenEnabled)&&(null!==document.fullscreenElement?_.push({text:O("main_menu.fullscreen_exit"),help:O("main_menu.fullscreen_exit_help"),icon:I["icon:exit_fullscreen"],value:function(){_x()}}):_.push({text:O("main_menu.fullscreen"),help:O("main_menu.fullscreen_help"),icon:I["icon:fullscreen"],value:function(){_x()}})),_.push({text:O("main_menu.resume"),help:O("main_menu.resume_help"),value:function(){}}),_.push({text:O("main_menu.unlocks"),help:O("main_menu.unlocks_help"),value:function(){(function(){_k.apply(this,arguments)})()}}),_.push({text:O("sandbox.title"),help:G()".concat(O("unlocks.intro",{ts:e}),"\n ").concat(t<100?O("unlocks.greyed_out_help"):"","
\n "),textAfterButtons:"\nYour high score is ".concat(_M.highScore,". \nClick an item above to start a run with it.\n
"),actions:_,allowClose:!0})];case 1:if(!(r=a.sent()))return[3,3];return[4,_W()];case 2:a.sent()&&_B(r),a.label=3;case 3:return[2]}})})).apply(this,arguments)}function _W(){return _w.apply(this,arguments)}function _w(){return(_w=(0,g._)(function(){return(0,y.__generator)(this,function(e){return _M.currentLevel?[2,eI({title:O("confirmRestart.title"),text:O("confirmRestart.text"),actions:[{value:!0,text:O("confirmRestart.yes")},{value:!1,text:O("confirmRestart.no")}]})]:[2,!0]})})).apply(this,arguments)}function _x(){try{if(null!==document.fullscreenElement)document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen();else{var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()}}catch(e){console.warn(e)}}window.addEventListener("resize",_p),window.addEventListener("fullscreenchange",_p),setInterval(function(){var e=eW.getBoundingClientRect(),_=e.width,t=e.height;(_!==_M.canvasWidth||t!==_M.canvasHeight)&&_p()},1e3),eW.addEventListener("mouseup",function(e){0===e.button&&(_M.running?_c(!0):(_u(),N("pointerLock")&&eW.requestPointerLock&&eW.requestPointerLock().then()))}),eW.addEventListener("mousemove",function(e){document.pointerLockElement===eW?eN(_M,_M.puckPosition+e.movementX):eN(_M,e.x)}),eW.addEventListener("touchstart",function(e){var _;e.preventDefault(),(null===(_=e.touches)||void 0===_?void 0:_.length)&&(eN(_M,e.touches[0].pageX),eK(_M),_u())}),eW.addEventListener("touchend",function(e){e.preventDefault(),_c(!0)}),eW.addEventListener("touchcancel",function(e){e.preventDefault(),_c(!0)}),eW.addEventListener("touchmove",function(e){var _;(null===(_=e.touches)||void 0===_?void 0:_.length)&&eN(_M,e.touches[0].pageX)}),window.addEventListener("visibilitychange",function(){document.hidden&&_c(!0)}),eC.addEventListener("click",function(e){e.preventDefault(),eE||_b()}),document.addEventListener("visibilitychange",function(){document.hidden&&_c(!0)}),document.getElementById("menu").addEventListener("click",function(e){e.preventDefault(),eE||_f()});var _S={ArrowLeft:0,ArrowRight:0,Shift:0};function _z(e,_){_S[e]=_,_M.keyboardPuckSpeed=(_S.ArrowRight-_S.ArrowLeft)*(1+2*_S.Shift)*_M.gameZoneWidth/50}document.addEventListener("keydown",function(e){"f"!==e.key.toLowerCase()||e.ctrlKey||e.metaKey?e.key in _S&&_z(e.key,1):_x()," "===e.key&&!eE&&(_M.running?_c(!0):_u(),e.preventDefault())}),document.addEventListener("keyup",(t=(0,g._)(function(e){var _,t,r,a,s;return(0,y.__generator)(this,function(n){switch(n.label){case 0:if(s=document.querySelector("button:focus"),!(e.key in _S))return[3,1];return _z(e.key,0),[3,10];case 1:if("ArrowDown"!==e.key||(null==s?void 0:null===(_=s.nextElementSibling)||void 0===_?void 0:_.tagName)!=="BUTTON")return[3,2];return null==s||null===(t=s.nextElementSibling)||void 0===t||t.focus(),[3,10];case 2:if("ArrowUp"!==e.key||(null==s?void 0:null===(r=s.previousElementSibling)||void 0===r?void 0:r.tagName)!=="BUTTON")return[3,3];return null==s||null===(a=s.previousElementSibling)||void 0===a||a.focus(),[3,10];case 3:if(!("Escape"===e.key&&ej))return[3,4];return ej(),[3,10];case 4:if(!("Escape"===e.key&&_M.running))return[3,5];return _c(!0),[3,10];case 5:if(!("m"===e.key.toLowerCase()&&!eE))return[3,6];return _f().then(),[3,10];case 6:if(!("s"===e.key.toLowerCase()&&!eE))return[3,7];return _b().then(),[3,10];case 7:if(!("r"===e.key.toLowerCase()&&!eE))return[3,9];return[4,_W()];case 8:return n.sent()&&_B({levelToAvoid:ep(_M).name}),[3,10];case 9:return[2];case 10:return e.preventDefault(),[2]}})}),function(e){return t.apply(this,arguments)}));var _M=_i({});function _B(e){Object.assign(_M,_i(e)),eT(),e6(_M,0)}_B({}),_p(),function e(){var _=performance.now(),t=_-_M.lastTick;_M.lastTick=_;var r=Math.min(4,t/(1e3/60));_M.keyboardPuckSpeed&&eN(_M,_M.puckPosition+_M.keyboardPuckSpeed),eK(_M),_M.running&&(_M.levelTime+=t,_M.runStatistics.runTime+=t,function(e){var _=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;e.runStatistics.max_combo=Math.max(e.runStatistics.max_combo,e.combo),e.balls=e.balls.filter(function(e){return!e.destroyed});var t=e.bricks.filter(function(e){return e&&"black"!==e}).length;e.levelTime>e.lastTickDown+1e3&&e.perks.hot_start&&(e.lastTickDown=e.levelTime,e0(e,e.perks.hot_start,e.puckPosition,e.gameZoneHeight-2*e.puckHeight)),t<=e.perks.skip_last&&!e.autoCleanUses&&(e.bricks.forEach(function(_,t){_&&e4(e,t,e.balls[0],!0)}),e.autoCleanUses++);var r=e.perks.respawn&&e.balls.find(function(e){return e.hitItem.length>1});if(!e.running||t||r?e.winAt=0:e.winAt||(e.winAt=e.levelTime+5e3),e.winAt&&e.levelTime>e.winAt||e.running&&e.levelTime&&!t&&!_n(e.coins))e.currentLevel+1