\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]"));function U(e){for(var _=0,t=0;t \n ").concat(_.name,"\n ").concat(_.help(Math.max(1,e.perks[_.id])),"\n ".concat(j("score_panel.upgrades_picked")," ".concat(j("score_panel.upcoming_levels")," ").concat(_,"
\n '.concat(c.title,'\n \n
\n\n'),i.slice(i.indexOf(c)+1).slice(0,3).forEach(function(e){l+='\n\n '.concat(e.title," \n
\n")})}var g=i.filter(function(e){return e.threshold>s&&e.threshold".concat(_,"
\n").concat(j("gameOver.cumulative_total",{startTs:s,endTs:o}),"
\n ").concat(l," \n "),{value:null,text:j("gameOver.restart"),help:""},' \n '.concat(eW(_K),"\n ").concat(function(e){var _="";try{var t=JSON.parse(localStorage.getItem("breakout_71_runs_history")||"[]");t.sort(function(e,_){return e.score-_.score}).reverse(),(t=t.slice(0,100)).push(w(W({},e.runStatistics),{perks:e.perks,mode:e.mode,appVersion:$})),localStorage.setItem("breakout_71_runs_history",JSON.stringify(t,null,2));var r=function(_,r,a){var n,l,o,s=t.filter(function(_){return(_.mode||"short")===e.mode}).map(function(e){return r(e)||0}),i=(n=Math).min.apply(n,S(s)),u=(l=Math).max.apply(l,S(s));if(i===u)return"";u-i<10&&(i=Math.max(0,u-10),u=Math.max(u,i+10));var c=Math.min(s.length,10);if(c<3)return"";for(var p=[],d=[],m=0;m".concat(j("gameOver.stats.intro",{count:t.length-1}),"
")+_)}catch(e){console.warn(e)}return _}(_K)," \n ")]}).then(function(){return _Q({levelToAvoid:ex(_K).name})})}}function _t(e){var _=C(),t=(u=(null==e?void 0:e.level)?e_.filter(function(_){return _.name===(null==e?void 0:e.level)}):[],c=e_.filter(function(e){return _>=e.threshold}).filter(function(_){return _.name!==(null==e?void 0:e.level)}).filter(function(_){return _.name!==(null==e?void 0:e.levelToAvoid)}).sort(function(){return Math.random()-.5}),u.concat(c.slice(0,10).sort(function(e,_){return e.sortKey-_.sortKey}))),r=W({},eh(et),(null==e?void 0:e.perks)||{}),a=w(W({runLevels:t,level:t[0],currentLevel:0,upgradesOfferedFor:-1,perks:r,bannedPerks:eh(et),puckWidth:200,baseSpeed:12,combo:1,gridSize:12,running:!1,isGameOver:!1,ballStickToPuck:!0,puckPosition:400,lastPuckPosition:400,lastPuckMove:0,pauseTimeout:null,canvasWidth:0,canvasHeight:0,offsetX:0,offsetXRoundedDown:0,gameZoneWidth:0,gameZoneWidthRoundedUp:0,gameZoneHeight:0,brickWidth:0,score:0,lastScoreIncrease:-1e3,lastExplosion:-1e3,lastBrickBroken:0,highScore:parseFloat(localStorage.getItem("breakout-3-hsbreakout-3-hs-"+(null==e?void 0:e.mode))||"0"),balls:[],ballsColor:"white",bricks:[],brickHP:[],lights:{indexMin:0,total:0,list:[]},particles:{indexMin:0,total:0,list:[]},texts:{indexMin:0,total:0,list:[]},coins:{indexMin:0,total:0,list:[]},respawns:{indexMin:0,total:0,list:[]},levelStartScore:0,levelMisses:0,levelSpawnedCoins:0,puckColor:"#FFF",ballSize:20,coinSize:14,puckHeight:20,totalScoreAtRunStart:_,pauseUsesDuringRun:0,keyboardPuckSpeed:0,lastTick:performance.now(),lastTickDown:0,runStatistics:{started:Date.now(),levelsPlayed:0,runTime:0,coins_spawned:0,score:0,best_level_score:-1,worst_level_score:-1,bricks_broken:0,misses:0,balls_lost:0,puck_bounces:0,wall_bounces:0,upgrades_picked:1,max_combo:1,max_level:0},lastOffered:{},levelTime:0,winAt:0,levelWallBounces:0,needsRender:!0,autoCleanUses:0},{aboutToPlaySound:{wallBeep:{vol:0,x:0},comboIncreaseMaybe:{vol:0,x:0},comboDecrease:{vol:0,x:0},coinBounce:{vol:0,x:0},explode:{vol:0,x:0},lifeLost:{vol:0,x:0},coinCatch:{vol:0,x:0},colorChange:{vol:0,x:0}}}),{rerolls:0,loop:0,baseCombo:1,mode:(null==e?void 0:e.mode)||"short",readyToRender:!0});if(_n(a),!((p=a.perks)&&(null===(d=Object.values(p))||void 0===d?void 0:d.reduce(function(e,_){return e+_},0)))){var n=ey(a).filter(function(e){return e.giftable}),l=ea("easy")&&"slow_down"||n[Math.floor(Math.random()*n.length)].id;r[l]=1,_d(a,l)}var o=!0,s=!1,i=void 0;try{for(var u,c,p,d,m,g=et[Symbol.iterator]();!(o=(m=g.next()).done);o=!0){var h=m.value;a.perks[h.id]&&_d(a,h.id)}}catch(e){s=!0,i=e}finally{try{o||null==g.return||g.return()}finally{if(s)throw i}}return a}var y=v("5mG9B"),z=v("6QuVk");function _r(){return(_r=(0,y._)(function(e,_){var t,r,a;return(0,z.__generator)(this,function(n){switch(n.label){case 0:e.readyToRender=!1,t=L("creativeModePerks_"+_,{}),et.forEach(function(_){t[_.id]=Math.min(t[_.id]||0,_.max-e.bannedPerks[_.id])}),a=["extra_levels","shunt","one_more_choice","instant_upgrade"],n.label=1;case 1:return[4,e7({title:j("lab.title",{lvl:_+1}),actionsAsGrid:!0,content:[j("lab.instructions")].concat(S(et.filter(function(e){return!a.includes(e.id)}).map(function(_){return{icon:_.icon,text:_.name,help:(t[_.id]||0)+"/"+(_.max-e.bannedPerks[_.id]),value:_,disabled:_.max-e.bannedPerks[_.id]<=0,className:t[_.id]?"sandbox":"sandbox grey-out-unless-hovered",tooltip:_.help(t[_.id]||1)}})),[j("lab.select_level")],S(e_.map(function(e){return{icon:ee[e.name],text:e.name,value:e,tooltip:eg(e)}})))})];case 2:if(!(r=n.sent()))return[3,3];if("bricks"in r)return B("creativeModePerks_"+_,t),et.forEach(function(_){e.perks[_.id]=t[_.id],e.bannedPerks[_.id]+=t[_.id]}),e.runLevels[_]=r,[3,3];return r&&(t[r.id]=((t[r.id]||0)+1)%(r.max-e.bannedPerks[r.id]+1)),[3,1];case 3:return[2]}})})).apply(this,arguments)}function _a(e,_){e.puckPosition=_,e.needsRender=!0}function _n(e){_l(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,S(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(j("level_up.before_buttons",{score:e.score-e.levelStartScore,catchGain:a,levelSpawnedCoins:e.levelSpawnedCoins,time:Math.round(e.levelTime/1e3),timeGain:r,levelMisses:e.levelMisses,missesGain:l,levelWallBounces:e.levelWallBounces,wallHitsGain:n,compliment:s}),"\n
\n").concat(j("level_up.after_buttons",{level:e.currentLevel+1,max:ek(e)}),"
\n").concat(ew(e),"
\n")].concat(S(o),[eW(e),''])})];case 2:return"reroll"===(i=u.sent())?(t++,e.rerolls--):(e.perks[i]++,"instant_upgrade"===i&&(t+=2),e.runStatistics.upgrades_picked++),[3,1];case 3:return[2]}})})).apply(this,arguments)}function _R(e,_){return ef(_K,Math.floor(_/_K.brickWidth),Math.floor((e-_K.offsetX)/_K.brickWidth))}function _L(e){if(_K.bricks[e])return e}function _B(e,_,t){var r,a,n;return null!==(n=null!==(a=null!==(r=_L(_R(e-t,_-t)))&&void 0!==r?r:_L(_R(e+t,_-t)))&&void 0!==a?a:_L(_R(e+t,_+t)))&&void 0!==n?n:_L(_R(e-t,_+t))}window.addEventListener("resize",_P),window.addEventListener("fullscreenchange",_P),setInterval(function(){var e=eC.getBoundingClientRect(),_=e.width,t=e.height;(_!==_K.canvasWidth||t!==_K.canvasHeight)&&_P()},1e3),eC.addEventListener("mouseup",function(e){0===e.button&&(_K.running?_q(!0):(_G(),ea("pointerLock")&&eC.requestPointerLock&&eC.requestPointerLock().then()))}),eC.addEventListener("mousemove",function(e){document.pointerLockElement===eC?_a(_K,_K.puckPosition+e.movementX):_a(_K,e.x)}),eC.addEventListener("touchstart",function(e){var _;e.preventDefault(),(null===(_=e.touches)||void 0===_?void 0:_.length)&&(_a(_K,e.touches[0].pageX),_l(_K),_G())}),eC.addEventListener("touchend",function(e){e.preventDefault(),_q(!0)}),eC.addEventListener("touchcancel",function(e){e.preventDefault(),_q(!0)}),eC.addEventListener("touchmove",function(e){var _;(null===(_=e.touches)||void 0===_?void 0:_.length)&&_a(_K,e.touches[0].pageX)});var _C=0,_O=60;function _T(){return _A.apply(this,arguments)}function _A(){return(_A=(0,y._)(function(){return(0,z.__generator)(this,function(e){switch(e.label){case 0:return _q(!0),[4,e8({title:_K.loop?j("score_panel.title_looped",{loop:_K.loop,score:_K.score,level:_K.currentLevel+1,max:ek(_K)}):j("score_panel.title",{score:_K.score,level:_K.currentLevel+1,max:ek(_K)}),content:[eW(_K),ew(_K),_K.rerolls?j("score_panel.rerolls_count",{rerolls:_K.rerolls}):""],allowClose:!0})];case 1:return e.sent(),[2]}})})).apply(this,arguments)}setInterval(function(){_O=_C,_C=0},1e3),window.addEventListener("visibilitychange",function(){document.hidden&&_q(!0)}),eY.addEventListener("click",function(e){e.preventDefault(),e2||_T()}),document.addEventListener("visibilitychange",function(){document.hidden&&_q(!0)}),document.getElementById("menu").addEventListener("click",function(e){e.preventDefault(),e2||_j()});var _E=(p=Math).max.apply(p,S(et.map(function(e){return e.threshold})));function _j(){return _D.apply(this,arguments)}function _D(){return(_D=(0,y._)(function(){var e,_;return(0,z.__generator)(this,function(t){switch(t.label){case 0:return _q(!0),e=[{icon:ee["icon:7_levels_run"],text:j("main_menu.normal"),help:eH("short")||j("main_menu.normal_help"),value:function(){_Q({levelToAvoid:ex(_K).name,mode:"short"})}},{icon:ee["icon:loop"],text:j("main_menu.loop_run"),help:eH("long")||C()<_E&&j("lab.unlocks_at",{score:_E})||j("main_menu.loop_run_help"),value:function(){_Q({levelToAvoid:ex(_K).name,mode:"long"})},disabled:C()<_E},{icon:ee["icon:sandbox"],text:j("lab.menu_entry"),help:eH("creative")||C()<_E&&j("lab.unlocks_at",{score:_E})||j("lab.help"),disabled:C()<_E,value:function(){return(0,y._)(function(){return(0,z.__generator)(this,function(e){switch(e.label){case 0:return[4,_N(_K)];case 1:return e.sent()&&_Q({mode:"creative"}),[2]}})})()}},{icon:ee["icon:unlocks"],text:j("main_menu.unlocks"),help:j("main_menu.unlocks_help"),value:function(){(function(){_F.apply(this,arguments)})()}}].concat(S(function(e){if(!ea("donation_reminder"))return[];var _=Z();return[{text:j("main_menu.donate",{hours:_}),help:j("main_menu.donate_help",{suggestion:Math.min(20,Math.max(1,.2*_)).toFixed(0)}),icon:ee["icon:premium"],value:function(){window.open("https://paypal.me/renanlecaro","_blank")}}]}(0)),[{text:j("main_menu.settings_title"),help:j("main_menu.settings_help"),icon:ee["icon:settings"],value:function(){_V()}},{icon:ee["icon:help"],text:j("main_menu.help_title"),help:j("main_menu.help_help"),value:function(){return(0,y._)(function(){return(0,z.__generator)(this,function(e){switch(e.label){case 0:return[4,e8({title:j("main_menu.help_title"),allowClose:!0,content:[I(j("main_menu.help_content")),j("main_menu.help_upgrades")].concat(S(et.map(function(e){return'\n\n ").concat(e.name,"
\n ").concat(e.help(1),"\n
\n ").concat(e.name,'
\n ').concat(e.credit," \n
".concat(j("unlocks.intro",{ts:e}),"\n ").concat(r<100?j("unlocks.greyed_out_help"):"","
")].concat(S(_),[j("unlocks.level")],S(t)),allowClose:!0,actionsAsGrid:!0})];case 1:if(!(a=n.sent()))return[3,3];return[4,_N(_K)];case 2:n.sent()&&_Q(w(W({},a),{mode:"short"})),n.label=3;case 3:return[2]}})})).apply(this,arguments)}function _N(e){return _X.apply(this,arguments)}function _X(){return(_X=(0,y._)(function(e){return(0,z.__generator)(this,function(_){return!e.currentLevel||e2?[2,!0]:[2,e8({title:j("confirmRestart.title"),content:[j("confirmRestart.text"),{value:!0,text:j("confirmRestart.yes")},{value:!1,text:j("confirmRestart.no")}]})]})})).apply(this,arguments)}var _U={ArrowLeft:0,ArrowRight:0,Shift:0};function _Y(e,_){_U[e]=_,_K.keyboardPuckSpeed=(_U.ArrowRight-_U.ArrowLeft)*(1+2*_U.Shift)*_K.gameZoneWidth/50}document.addEventListener("keydown",(t=(0,y._)(function(e){return(0,z.__generator)(this,function(_){return"f"!==e.key.toLowerCase()||e.ctrlKey||e.metaKey?e.key in _U&&_Y(e.key,1):(en("fullscreen"),_I())," "!==e.key||e2||(_K.running?_q(!0):_G(),e.preventDefault()),[2]})}),function(e){return t.apply(this,arguments)}));var _J=new Date;document.addEventListener("keyup",(r=(0,y._)(function(e){var _,t,r,a,n;return(0,z.__generator)(this,function(l){switch(l.label){case 0:if(n=document.querySelector("button:focus"),!(e.key in _U))return[3,1];return _Y(e.key,0),[3,10];case 1:if("ArrowDown"!==e.key||(null==n?void 0:null===(_=n.nextElementSibling)||void 0===_?void 0:_.tagName)!=="BUTTON")return[3,2];return null==n||null===(t=n.nextElementSibling)||void 0===t||t.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&&e4))return[3,4];return e4(),[3,10];case 4:if(!("Escape"===e.key&&_K.running))return[3,5];return _q(!0),[3,10];case 5:if(!("m"===e.key.toLowerCase()&&!e2))return[3,6];return _j().then(),[3,10];case 6:if(!("s"===e.key.toLowerCase()&&!e2))return[3,7];return _T().then(),[3,10];case 7:if(!("r"===e.key.toLowerCase()&&!e2&&_J>Date.now()+1e3))return[3,9];return[4,_N(_K)];case 8:return l.sent()&&_Q({levelToAvoid:ex(_K).name,mode:_K.mode}),[3,10];case 9:return[2];case 10:return e.preventDefault(),[2]}})}),function(e){return r.apply(this,arguments)}));var _K=_t({mode:"short"});function _Q(e){_P(),Object.assign(_K,_t(e)),e0(),_g(_K,0)}_Q(window.location.search.includes("stressTest")&&{perks:{pierce:2,bigger_explosions:10,sapper:3},mode:"short"}||{mode:"short"}),function e(){var _=performance.now(),t=_-_K.lastTick;_K.lastTick=_;var r=Math.min(4,t/(1e3/60));_K.keyboardPuckSpeed&&_a(_K,_K.puckPosition+_K.keyboardPuckSpeed),_l(_K),_K.running&&(_K.levelTime+=t,_K.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.perks.addiction&&e.lastBrickBroken&&e.lastBrickBroken