\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]"));function T(e){for(var t=0,_=0;_
\n '.concat(c.title,'\n \n
\n\n'),i.slice(i.indexOf(c)+1).slice(0,3).forEach(function(e){s+='\n\n '.concat(e.title," \n
\n")})}var h=i.filter(function(e){return e.threshold>o&&e.threshold".concat(H("gameOver.test_run"),"
"):"","\n").concat(t,"
\n").concat(H("gameOver.cumulative_total",{startTs:o,endTs:l}),"
\n ").concat(s," \n "),actions:[{value:null,text:H("gameOver.restart"),help:""}],textAfterButtons:'\n '.concat(function(){var e="";try{var t=JSON.parse(localStorage.getItem("breakout_71_runs_history")||"[]");t.sort(function(e,t){return e.score-t.score}).reverse(),(t=t.slice(0,100)).push(k(y({},td.runStatistics),{perks:td.perks,appVersion:j})),td.isCreativeModeRun||localStorage.setItem("breakout_71_runs_history",JSON.stringify(t,null,2));var _=function(e,_,r){var a,n,s,l=t.map(function(e){return _(e)||0}),o=(a=Math).min.apply(a,v(l)),i=(n=Math).max.apply(n,v(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+t*m)," and ").concat(Math.floor(o+(t+1)*m)).concat(r,'"\n >').concat(!e&&" "||t==f&&b+r||Math.round(p[t]/e)+r,"")}).join("");return'".concat(H("gameOver.stats.intro",{count:t.length-1}),"
")+e)}catch(e){console.warn(e)}return e}()," \n ")}).then(function(){return tm({levelToAvoid:ec(td).name})})}}function eP(e,t){e.puckPosition=t,e.needsRender=!0}function eT(e){return+!e.perks.concave_puck*(Math.random()>.5?e.baseSpeed:-e.baseSpeed)}function eA(e){var t,_=1+((null===(t=e.perks)||void 0===t?void 0:t.multiball)||0),r=e.puckWidth/(_+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=(_=Math).max.apply(_,v(Object.keys(r).map(function(e){return r[e]})));return(t=Object.keys(r).filter(function(e){return r[e]==a}))[Math.floor(t.length*Math.random())]}(e.bricks.filter(function(e){return e}))||"#FFF");for(var a=0;a<_;a++){var n=e.puckPosition-e.puckWidth/2+r*(a+1),s=eT(e);e.balls.push({x:n,previousX:n,y:e.gameZoneHeight-1.5*e.ballSize,previousY:e.gameZoneHeight-1.5*e.ballSize,vx:s,previousVX:s,vy:-e.baseSpeed,previousVY:-e.baseSpeed,sx:0,sy:0,piercedSinceBounce:0,hitSinceBounce:0,hitItem:[],sapperUses:0})}e.ballStickToPuck=!0}function eE(e){e.baseSpeed=Math.max(3,e.gameZoneWidth/12/10+e.currentLevel/3+e.levelTime/3e4-2*e.perks.slow_down),e.puckWidth=e.gameZoneWidth/12*(3-e.perks.smaller_puck+e.perks.bigger_puck),e.puckPosition".concat(H("level_up.after_buttons",{level:e.currentLevel+1,max:ei(e)}),"
\n").concat(eu(e),'
\n \n \n '),u=a&&n&&l&&s&&H("level_up.compliment_perfect")||(a||n||l||s)&&H("level_up.compliment_good")||H("level_up.compliment_advice"),[4,eO({title:H("level_up.pick_upgrade_title")+(_?" ("+(_+1)+")":""),actions:o,text:"".concat(H("level_up.before_buttons",{score:e.score-e.levelStartScore,catchGain:n,levelSpawnedCoins:e.levelSpawnedCoins,time:Math.round(e.levelTime/1e3),timeGain:a,levelMisses:e.levelMisses,missesGain:l,levelWallBounces:e.levelWallBounces,wallHitsGain:s,compliment:u}),"\n
"),allowClose:!1,textAfterButtons:i})];case 2:return c=p.sent(),e.perks[c]++,"instant_upgrade"===c&&(_+=2),e.runStatistics.upgrades_picked++,[3,1];case 3:return[2]}})})).apply(this,arguments)}function e9(e,t){return el(td,Math.floor(t/td.brickWidth),Math.floor((e-td.offsetX)/td.brickWidth))}function te(e){if(td.bricks[e])return e}function tt(e,t,_){var r,a,n;return null!==(n=null!==(a=null!==(r=te(e9(e-_,t-_)))&&void 0!==r?r:te(e9(e+_,t-_)))&&void 0!==a?a:te(e9(e+_,t+_)))&&void 0!==n?n:te(e9(e-_,t+_))}function t_(e,t,_){if(!e.destroyed){e.previousX=e.x,e.previousY=e.y,e.x+=e.vx*_,e.y+=e.vy*_,e.sx||(e.sx=0),e.sy||(e.sy=0),e.sx+=e.previousX-e.x,e.sy+=e.previousY-e.y,e.sx*=.9,e.sy*=.9,td.perks.wind&&(e.vx+=(td.puckPosition-(td.offsetX+td.gameZoneWidth/2))/td.gameZoneWidth*td.perks.wind*.5);var r=0,a=0;return e.x${t('score_panel.test_run}
":"","\n").concat(H("score_panel.upgrades_picked"),"
\n").concat(eu(td),"
\n "),allowClose:!0,actions:[{text:H("score_panel.resume"),help:H("score_panel.resume_help"),value:function(){}},{text:H("score_panel.restart"),help:H("score_panel.restart_help"),value:function(){tm({levelToAvoid:ec(td).name})}}]})];case 1:return(e=t.sent())&&e(),[2]}})})).apply(this,arguments)}function tn(){return ts.apply(this,arguments)}function ts(){return(ts=h(function(){var e,t,_,r,a,n,s,l,o,i;return f(this,function(u){switch(u.label){case 0:e6(!0),t=[{text:H("main_menu.resume"),help:H("main_menu.resume_help"),value:function(){}},{text:H("main_menu.unlocks"),help:H("main_menu.unlocks_help"),value:function(){(function(){tl.apply(this,arguments)})()}}],_=!0,r=!1,a=void 0;try{for(n=function(){var e=l.value;F[e]&&t.push({icon:N(e)?V["icon:checkmark_checked"]:V["icon:checkmark_unchecked"],text:F[e].name,help:F[e].help,value:function(){B("breakout-settings-enable-"+e,!N(e)),"mobile-mode"===e&&e7(),tn()}})},s=Object.keys(F)[Symbol.iterator]();!(_=(l=s.next()).done);_=!0)n()}catch(e){r=!0,a=e}finally{try{_||null==s.return||s.return()}finally{if(r)throw a}}return o=(e=Math).max.apply(e,v(X.map(function(e){return e.threshold}))),(document.fullscreenEnabled||document.webkitFullscreenEnabled)&&(null!==document.fullscreenElement?t.push({text:H("main_menu.fullscreen_exit"),help:H("main_menu.fullscreen_exit_help"),icon:V["icon:exit_fullscreen"],value:function(){tu()}}):t.push({text:H("main_menu.fullscreen"),help:H("main_menu.fullscreen_help"),icon:V["icon:fullscreen"],value:function(){tu()}})),t.push({text:H("sandbox.title"),help:G()".concat(H("unlocks.intro",{ts:e}),"\n ").concat(_<100?H("unlocks.greyed_out_help"):"","
\n "),textAfterButtons:"\nYour high score is ".concat(td.highScore,". \nClick an item above to start a run with it.\n
"),actions:t,allowClose:!0})];case 1:if(!(r=a.sent()))return[3,3];return[4,to()];case 2:a.sent()&&tm(r),a.label=3;case 3:return[2]}})})).apply(this,arguments)}function to(){return ti.apply(this,arguments)}function ti(){return(ti=h(function(){return f(this,function(e){return td.currentLevel?[2,eO({title:H("confirmRestart.title"),text:H("confirmRestart.text"),actions:[{value:!0,text:H("confirmRestart.yes")},{value:!1,text:H("confirmRestart.no")}]})]:[2,!0]})})).apply(this,arguments)}function tu(){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",e7),window.addEventListener("fullscreenchange",e7),setInterval(function(){var e=eh.getBoundingClientRect(),t=e.width,_=e.height;(t!==td.canvasWidth||_!==td.canvasHeight)&&e7()},1e3),eh.addEventListener("mouseup",function(e){0===e.button&&(td.running?e6(!0):(e3(),N("pointerLock")&&eh.requestPointerLock&&eh.requestPointerLock().then()))}),eh.addEventListener("mousemove",function(e){document.pointerLockElement===eh?eP(td,td.puckPosition+e.movementX):eP(td,e.x)}),eh.addEventListener("touchstart",function(e){var t;e.preventDefault(),(null===(t=e.touches)||void 0===t?void 0:t.length)&&(eP(td,e.touches[0].pageX),eE(td),e3())}),eh.addEventListener("touchend",function(e){e.preventDefault(),e6(!0)}),eh.addEventListener("touchcancel",function(e){e.preventDefault(),e6(!0)}),eh.addEventListener("touchmove",function(e){var t;(null===(t=e.touches)||void 0===t?void 0:t.length)&&eP(td,e.touches[0].pageX)}),window.addEventListener("visibilitychange",function(){document.hidden&&e6(!0)}),eR.addEventListener("click",function(e){e.preventDefault(),tr()}),document.addEventListener("visibilitychange",function(){document.hidden&&e6(!0)}),document.getElementById("menu").addEventListener("click",function(e){e.preventDefault(),tn()});var tc={ArrowLeft:0,ArrowRight:0,Shift:0};function tp(e,t){tc[e]=t,td.keyboardPuckSpeed=(tc.ArrowRight-tc.ArrowLeft)*(1+2*tc.Shift)*td.gameZoneWidth/50}document.addEventListener("keydown",function(e){"f"!==e.key.toLowerCase()||e.ctrlKey||e.metaKey?e.key in tc&&tp(e.key,1):tu()," "===e.key&&!eL&&(td.running?e6(!0):e3(),e.preventDefault())}),document.addEventListener("keyup",(t=h(function(e){var t,_,r,a,n;return f(this,function(s){switch(s.label){case 0:if(n=document.querySelector("button:focus"),!(e.key in tc))return[3,1];return tp(e.key,0),[3,10];case 1:if("ArrowDown"!==e.key||(null==n?void 0:null===(t=n.nextElementSibling)||void 0===t?void 0:t.tagName)!=="BUTTON")return[3,2];return null==n||null===(_=n.nextElementSibling)||void 0===_||_.focus(),[3,10];case 2:if("ArrowUp"!==e.key||(null==n?void 0:null===(r=n.previousElementSibling)||void 0===r?void 0:r.tagName)!=="BUTTON")return[3,3];return null==n||null===(a=n.previousElementSibling)||void 0===a||a.focus(),[3,10];case 3:if(!("Escape"===e.key&&eH))return[3,4];return eH(),[3,10];case 4:if(!("Escape"===e.key&&td.running))return[3,5];return e6(!0),[3,10];case 5:if(!("m"===e.key.toLowerCase()&&!eL))return[3,6];return tn().then(),[3,10];case 6:if(!("s"===e.key.toLowerCase()&&!eL))return[3,7];return tr().then(),[3,10];case 7:if(!("r"===e.key.toLowerCase()&&!eL))return[3,9];return[4,to()];case 8:return s.sent()&&tm({levelToAvoid:ec(td).name}),[3,10];case 9:return[2];case 10:return e.preventDefault(),[2]}})}),function(e){return t.apply(this,arguments)}));var td=e5({});function tm(e){Object.assign(td,e5(e)),eG(),eF(td,0)}tm({}),e7(),function e(){var t=performance.now(),_=t-td.lastTick;td.lastTick=t;var r=Math.min(4,_/(1e3/60));td.keyboardPuckSpeed&&eP(td,td.puckPosition+td.keyboardPuckSpeed),eE(td),td.running&&(td.levelTime+=_,td.runStatistics.runTime+=_,function(e){var t,_,r,a,n,s=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 l=e.bricks.filter(function(e){return e&&"black"!==e}).length;if(e.levelTime>e.lastTickDown+1e3&&e.perks.hot_start&&(e.lastTickDown=e.levelTime,t=e.perks.hot_start,_=e.puckPosition,r=e.gameZoneHeight-2*e.puckHeight,a=e.combo,e.combo=Math.max(eD(e),e.combo-t),(n=Math.max(0,a-e.combo))&&(eX(e,"comboDecrease",_,1),void 0!==_&&void 0!==r&&eK(e,_,r,"red","-"+n,20,300))),l<=e.perks.skip_last&&!e.autoCleanUses&&(e.bricks.forEach(function(t,_){t&&eV(e,_,e.balls[0],!0)}),e.autoCleanUses++),l||e1(e.coins)){if(e.running||e.levelTime){var o=Math.round(e.coinSize/2);if(e4(e.coins,function(t,_){if(e.perks.coin_magnet){var r,a=s*(e.puckPosition-t.x)/(100+Math.pow(t.y-e.gameZoneHeight,2)+Math.pow(t.x-e.puckPosition,2))*e.perks.coin_magnet*100;t.vx+=a,t.sa-=a/10}var n=1-(.03*e.perks.viscosity+.005)*s;t.vy*=n,t.vx*=n,t.vx>7*e.baseSpeed&&(t.vx=7*e.baseSpeed),t.vx<-7*e.baseSpeed&&(t.vx=-7*e.baseSpeed),t.vy>7*e.baseSpeed&&(t.vy=7*e.baseSpeed),t.vy<-7*e.baseSpeed&&(t.vy=-7*e.baseSpeed),t.a+=t.sa,t.vy+=s*t.weight*.8;var l=Math.abs(t.sx)+Math.abs(t.sx),i=t_(t,t.size/2,s);t.y>e.gameZoneHeight-o-e.puckHeight&&t.y