\",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \"]"));function D(e){for(var t=0,r=0;r ')}(r,e.size,e.color);return F[e.name]=n,w(W({},e),{bricks:r,bricksCount:_,icon:n,svg:(t=null!==e.svg&&j[e.svg%j.length],e.color||t||(t=j[D(e.name)%j.length]),t)})}).filter(function(e){return!e.name.startsWith("icon:")}).map(function(e,t){return w(W({},e),{threshold:t<8?0:Math.round(Math.min(10*Math.pow(10,1+(t+e.size)/30),5e3)*t),sortKey:(Math.random()+3)/3.5*e.bricksCount})}),Y=A.map(function(e){return w(W({},e),{icon:F["icon:"+e.id],adventure:!("adventure"in e)||e.adventure,normal:!("normal"in e)||e.normal})}),J={sound:{default:!0,name:T("main_menu.sounds"),help:T("main_menu.sounds_help")},"mobile-mode":{default:window.innerHeight>window.innerWidth,name:T("main_menu.mobile"),help:T("main_menu.mobile_help")},basic:{default:!1,name:T("main_menu.basic"),help:T("main_menu.basic_help")},show_fps:{default:!1,name:T("main_menu.show_fps"),help:T("main_menu.show_fps_help")},pointerLock:{default:!1,name:T("main_menu.pointer_lock"),help:T("main_menu.pointer_lock_help")},easy:{default:!1,name:T("main_menu.kid"),help:T("main_menu.kid_help")},record:{default:!1,name:T("main_menu.record"),help:T("main_menu.record_help")}};function K(e){var t;return q("breakout-settings-enable-"+e,null===(t=J[e])||void 0===t?void 0:t.default)}var Q=Date.now(),$={wallBeep:function(e,t,r){K("sound")&&et(800,t,e)},comboIncreaseMaybe:function(e,t,r){if(K("sound")){var _=0;!isNaN(e_)&&(e_r&&(_=-1)),ea(_,t,e),e_=r}},comboDecrease:function(e,t,r){K("sound")&&ea(-1,t,e)},coinBounce:function(e,t,r){K("sound")&&et(1200,t,e,.1,"triangle")},void:function(e,t){K("sound")&&(et(1200,t,e,.5,"sawtooth"),et(600,t,e,.3,"sawtooth"))},explode:function(e,t,r){K("sound")&&function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5,t=ee();if(t){var r=t.createBufferSource();r.buffer=er(t);var _=t.createGain();r.connect(_);var a=t.createBiquadFilter();a.type="lowpass",a.frequency.setValueAtTime(1e3,t.currentTime),_.connect(a);var s=t.createStereoPanner();s.pan.setValueAtTime(2*e-1,t.currentTime),a.connect(s),s.connect(t.destination),s.connect(n),_.gain.setValueAtTime(1,t.currentTime),_.gain.exponentialRampToValueAtTime(.01,t.currentTime+1),a.frequency.exponentialRampToValueAtTime(60,t.currentTime+1),r.start(t.currentTime),r.stop(t.currentTime+1)}}(t)},lifeLost:function(e,t,r){K("sound")&&function(e){var t=ee();if(t){var r=[es(t,3e3,"square"),es(t,4500,"square"),es(t,6e3,"square")],_=t.createGain(),a=t.createBufferSource();a.buffer=er(t),r.forEach(function(e){return e.connect(_)}),a.connect(_),_.gain.setValueAtTime(.2,t.currentTime),r.forEach(function(e){return e.start()}),a.start(),r.forEach(function(e){return e.stop(t.currentTime+.2)}),a.stop(t.currentTime+.2),_.gain.exponentialRampToValueAtTime(.001,t.currentTime+.2);var s=t.createStereoPanner();s.pan.setValueAtTime(2*e-1,t.currentTime),_.connect(s),s.connect(t.destination),s.connect(n),_.connect(s)}}(t)},coinCatch:function(e,t,r){K("sound")&&et(900,t,e,.1,"triangle")},colorChange:function(e,t,r){et(400,t,e,.5,"sine"),et(800,t,.5*e,.2,"square")}};function ee(){if(!_){if(!K("sound"))return null;n=(_=new(window.AudioContext||window.webkitAudioContext)).createMediaStreamDestination()}return _}function et(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:800,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,_=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"sine",s=ee();if(s){var l=es(s,e,a),o=s.createGain();l.connect(o);var i=s.createStereoPanner();i.pan.setValueAtTime(2*t-1,s.currentTime),o.connect(i),i.connect(s.destination),i.connect(n),o.gain.setValueAtTime(.8*r,s.currentTime),o.gain.exponentialRampToValueAtTime(.001,s.currentTime+_),l.start(s.currentTime),l.stop(s.currentTime+_)}}function er(e){if(!a)for(var t=2*e.sampleRate,r=(a=e.createBuffer(1,t,e.sampleRate)).getChannelData(0),_=0;_11&&(en=0),en<0&&(en=11);var _=function(e){var _=392*Math.pow(1.05945594920268,e),n=Math.abs(e-5.5),a=Math.max(0,r*(1-n/16.5));return et(_,t,a),_.toFixed(2)+" at "+Math.floor(100*a)+"% diff "+n};_(12+en),_(en),_(-12+en)}function es(e,t,r){var _=e.createOscillator();return _.type=r,_.frequency.setValueAtTime(t,e.currentTime),_}function el(e){return e[Math.floor(e.length*Math.random())]}function eo(e){var t;return e&&(null===(t=Object.values(e))||void 0===t?void 0:t.reduce(function(e,t){return e+t},0))||0}var ei=function(e){var t={};return e.forEach(function(e){return t[e.id]=0}),t};function eu(e,t){return e.offsetX+(t%e.gridSize+.5)*e.brickWidth}function ec(e,t){return(Math.floor(t/e.gridSize)+.5)*e.brickWidth}function ep(e,t,r){return t<0||r<0||t>=e.gridSize||r>=e.gridSize?-1:t*e.gridSize+r}function ed(e){return Y.filter(function(t){return e.totalScoreAtRunStart>=t.threshold}).filter(function(t){return!(null==t?void 0:t.requires)||e.perks[null==t?void 0:t.requires]})}function em(e){return 7+e.perks.extra_levels}function eh(e){var t="",r=!0,_=!1,n=void 0;try{for(var a,s=Y[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)for(var l=a.value,o=0;o').concat(F["icon:"+l.id],"")}catch(e){_=!0,n=e}finally{try{r||null==s.return||s.return()}finally{if(_)throw n}}return t?" ".concat(T("score_panel.upgrades_picked"),"
").concat(t,"
"):""}function eb(e){if(e.isAdventureMode||!e.perks.clairvoyant)return"";for(var t="",r=0;r').concat(F[e.runLevels[r].name],"");return"".concat(T("score_panel.upcoming_levels"),"
").concat(t,"
")}function eg(e){return e.level}function ev(e,t){return e.perks.telekinesis&&t.vy<0}function ef(e,t){return e.perks.yoyo&&t.vy>0}function ey(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}function ek(e,t){return Math.sqrt(ey(e,t))}function eW(e,t,r){return Math.max(t,Math.min(e,r))}function ew(e,t){for(var r=t%e.gridSize,_=Math.floor(t/e.gridSize),n=0,a=0;a<_;a++)e.bricks[r+a*e.gridSize]&&n++;return n}function ex(e,t){for(var r=t%e.gridSize,_=Math.floor(t/e.gridSize),n=0,a=_+1;a\n \n');var eq=document.createElement("img"),eH=document.createElement("canvas");function eR(e,t,r,_,n,a,s){var l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1;e.globalAlpha=l,r&&("red"==r?(e.strokeStyle="red",e.lineDashOffset=eV(t),e.lineWidth=2,e.setLineDash(eZ)):(e.strokeStyle="white",e.lineWidth=1),e.beginPath(),e.moveTo(_,n),e.lineTo(a,s),e.stroke(),"red"==r&&(e.setLineDash([]),e.lineWidth=1),e.globalAlpha=1)}var eL=document.createElement("canvas"),eP="",eC={};function eO(e,t,r,_,n){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",s="ball"+t+"_"+r+"_"+a,l=Math.round(r);if(!eC[s]){var o=document.createElement("canvas");o.width=l,o.height=l;var i=o.getContext("2d");i.beginPath(),i.arc(l/2,l/2,Math.round(l/2)-1,0,2*Math.PI),i.fillStyle=t,i.fill(),a&&(i.lineWidth=2,i.strokeStyle=a,i.stroke()),eC[s]=o}e.drawImage(eC[s],Math.round(_-l/2),Math.round(n-l/2))}function eT(e,t,r,_,n,a,s){var l=(Math.round(s/Math.PI*64)%32+32)%32,o="coin with halo_"+t+"_"+r+"_"+a+"_"+("gold"===t?l:"whatever");if(!eC[o]){var i=document.createElement("canvas");i.width=r,i.height=r;var u=i.getContext("2d");u.beginPath(),u.arc(r/2,r/2,r/2,0,2*Math.PI),u.fillStyle=t,u.fill(),("gold"===t||"red"===a)&&(u.strokeStyle=a,"red"==a&&(u.lineWidth=2,u.setLineDash(eZ)),u.stroke()),"gold"===t&&(u.beginPath(),u.arc(r/2,r/2,r/2*.6,0,2*Math.PI),u.fillStyle="rgba(255,255,255,0.5)",u.fill(),u.translate(r/2,r/2),u.rotate(l/16),u.translate(-r/2,-r/2),u.globalCompositeOperation="multiply",eE(u,"$",t,r-2,r/2,r/2+1),eE(u,"$",t,r-2,r/2,r/2+1)),eC[o]=i}e.drawImage(eC[o],Math.round(_-r/2),Math.round(n-r/2))}function eA(e,t,r,_,n){var a="fuzzy-circle"+t+"_"+r,s=Math.round(3*r);if(!eC[a]){var l=document.createElement("canvas");l.width=s,l.height=s;var o=l.getContext("2d"),i=o.createRadialGradient(s/2,s/2,0,s/2,s/2,s/2);i.addColorStop(0,t),i.addColorStop(1,"transparent"),o.fillStyle=i,o.fillRect(0,0,s,s),eC[a]=l}e.drawImage(eC[a],Math.round(_-s/2),Math.round(n-s/2))}function eE(e,t,r,_,n,a){var s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],l="text"+t+"_"+r+"_"+_+"_"+s;if(!eC[l]){var o=document.createElement("canvas");o.width=_*t.length,o.height=_;var i=o.getContext("2d");i.fillStyle=r,i.textAlign=s?"left":"center",i.textBaseline="middle",i.font=_+"px monospace",i.fillText(t,s?0:o.width/2,o.height/2,o.width),eC[l]=o}e.drawImage(eC[l],s?n:Math.round(n-eC[l].width/2),Math.round(a-eC[l].height/2))}var ej=document.getElementById("score"),eD=document.getElementById("menuLabel"),eZ=[5,5];function eV(e){return K("basic")?0:Math.floor(e.levelTime%500/500*10)%10}var b=m("5mG9B"),k=m("6QuVk");function eI(){K("record")&&(null==s?void 0:s.state)==="recording"&&(null==s||s.pause())}function eX(){K("record")&&s&&(null==s||s.stop(),s=null)}var b=m("5mG9B"),k=m("6QuVk"),eU=0,eF=null,eN=document.getElementById("popup"),eY=document.getElementById("close-modale");eY.addEventListener("click",function(e){e.preventDefault(),eF&&eF()}),eY.title=T("play.close_modale_window_tooltip");var eJ=-1;function eK(e){return eQ(w(W({},e),{allowClose:!1}))}function eQ(e){return e$.apply(this,arguments)}function e$(){return(e$=(0,b._)(function(e){var t,r,_,n,a,s,l;return(0,k.__generator)(this,function(o){return t=e.title,_=void 0===(r=e.content)?[]:r,a=void 0===(n=e.allowClose)||n,l=void 0!==(s=e.actionsAsGrid)&&s,e0(1),[2,new Promise(function(e){var r,n=function(t){o||(o=!0,Array.prototype.forEach.call(s.querySelectorAll("button:not([disabled])"),function(e){return e.disabled=!0}),document.body.style.minHeight=document.body.scrollHeight+"px",setTimeout(function(){return document.body.style.minHeight=""},0),s.remove(),e(t))};eN.className=l?" actionsAsGrid":"",eY.style.display=a?"":"none";var s=document.createElement("div"),o=!1;if(eF=a?function(){n(void 0)}:null,t){var i=document.createElement("h2");i.innerHTML=t,s.appendChild(i)}null==_||_.filter(function(e){return e}).forEach(function(e,t){if("string"==typeof e){var r,_,a=document.createElement("div");a.innerHTML=e,s.appendChild(a);return}(null===(r=s.lastChild)||void 0===r?void 0:r.nodeName)=="SECTION"?_=s.lastChild:((_=document.createElement("section")).className="actions",s.appendChild(_));var l=e.text,o=e.value,i=e.help,u=e.disabled,c=e.className,p=e.icon,d=document.createElement("button");d.innerHTML="\n".concat(void 0===p?"":p,"\n\n ").concat(l," \n ").concat(i||""," \n
"),u?d.setAttribute("disabled","disabled"):d.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),n(o),eJ=t}),d.className=(void 0===c?"":c)+(eJ===t?" needs-focus":""),_.appendChild(d)}),eN.appendChild(s),null===(r=eN.querySelector("section.actions > button.needs-focus"))||void 0===r||r.focus(),eJ=-1}).then(function(e){return e0(-1),eF=null,e},function(){eF=null,e0(-1)})]})})).apply(this,arguments)}function e0(e){(eU+=e)>1&&alert("Two alerts where opened at once"),document.body.classList[eU?"add":"remove"]("has-alert-open")}function e1(e,t){if(tF.running&&!tF.isGameOver){tF.isGameOver=!0,tM(!0),eX(),function(e){try{localStorage.setItem("breakout_71_total_play_time",JSON.stringify(JSON.parse(localStorage.getItem("breakout_71_total_play_time")||"0")+e))}catch(e){}}(tF.runStatistics.runTime),tF.runStatistics.max_level=tF.currentLevel+1;var r,_,n=-300,a=function(){return"animation-delay:"+(n+=800)+"ms;"},s="",l=R(),o=l-tF.score,i=(r=[],Y.forEach(function(e){e.threshold&&r.push({threshold:e.threshold,title:e.name+" "+T("level_up.unlocked_perk")})}),N.forEach(function(e){r.push({threshold:e.threshold,title:e.name+" "+T("level_up.unlocked_level")})}),r.filter(function(e){return e.threshold}).sort(function(e,t){return e.threshold-t.threshold}));i.filter(function(e){return e.threshold>o&&e.threshold\n '.concat(e.title,' \n \n
\n')});var u=(null===(_=function(e,t){for(var r=e.length;--r;)if(t(e[r],r,e))return e[r]}(i,function(e){return e.threshold<=l}))||void 0===_?void 0:_.threshold)||0,c=i.find(function(e){return e.threshold>l});if(c){var p=(null==c?void 0:c.threshold)-u,d=l-u;t+=T("gameOver.next_unlock",{points:c.threshold-l});var m=(d/p).toFixed(2);s+='\n \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(T("gameOver.unlocked_count",{count:h.length})," ").concat(h.map(function(e){return e.title}).join(", "),"")),tF.combo=1,eQ({allowClose:!0,title:e,content:["\n ".concat(tF.isCreativeModeRun?"".concat(T("gameOver.test_run"),"
"):"","\n ").concat(t,"
\n ").concat(T("gameOver.cumulative_total",{startTs:o,endTs:l}),"
\n ").concat(s," \n "),{value:null,text:T("gameOver.restart"),help:""},'
\n '.concat(eh(tF),"\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(w(W({},tF.runStatistics),{perks:tF.perks,appVersion:U})),tF.isCreativeModeRun||localStorage.setItem("breakout_71_runs_history",JSON.stringify(t,null,2));var r=function(e,r,_){var n,a,s,l=t.map(function(e){return r(e)||0}),o=(n=Math).min.apply(n,y(l)),i=(a=Math).max.apply(a,y(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(_,'"\n >').concat(!e&&" "||t==v&&g+_||Math.round(p[t]/e)+_," ")}).join("");return''.concat(e," : ").concat(g).concat(_,' \n ').concat(f,"
\n ")};e+=r(T("gameOver.stats.total_score"),function(e){return e.score},""),e+=r(T("gameOver.stats.catch_rate"),function(e){return Math.round(e.score/e.coins_spawned*100)},"%"),e+=r(T("gameOver.stats.bricks_broken"),function(e){return e.bricks_broken},""),e+=r(T("gameOver.stats.bricks_per_minute"),function(e){return Math.round(e.bricks_broken/e.runTime*6e4)},""),e+=r(T("gameOver.stats.hit_rate"),function(e){return Math.round((1-e.misses/e.puck_bounces)*100)},"%"),e+=r(T("gameOver.stats.duration_per_level"),function(e){return Math.round(e.runTime/1e3/e.levelsPlayed)},"s"),e+=r(T("gameOver.stats.level_reached"),function(e){return e.levelsPlayed},""),e+=r(T("gameOver.stats.upgrades_applied"),function(e){return e.upgrades_picked},""),e+=r(T("gameOver.stats.balls_lost"),function(e){return e.balls_lost},""),e+=r(T("gameOver.stats.combo_avg"),function(e){return Math.round(e.coins_spawned/e.bricks_broken)},""),(e+=r(T("gameOver.stats.combo_max"),function(e){return e.max_combo},""))&&(e="".concat(T("gameOver.stats.intro",{count:t.length-1}),"
")+e)}catch(e){console.warn(e)}return e}()," \n ")]}).then(function(){return tN({levelToAvoid:eg(tF).name,adventure:tF.isAdventureMode})})}}var b=m("5mG9B"),k=m("6QuVk"),e2=[{id:"negative_coins",max:20,name:T("debuffs.negative_coins.name"),help:function(e){return T("debuffs.negative_coins.help",{lvl:e})}},{id:"negative_bricks",max:20,name:T("debuffs.negative_bricks.name"),help:function(e){return T("debuffs.negative_bricks.help",{lvl:e})}},{id:"self_destructing_bricks",max:20,name:T("debuffs.self_destructing_bricks.name"),help:function(e){return T("debuffs.self_destructing_bricks.help",{lvl:e})}},{id:"void_coins_on_touch",max:1,name:T("debuffs.void_coins_on_touch.name"),help:function(e){return T("debuffs.void_coins_on_touch.help",{lvl:e})}},{id:"void_brick_on_touch",max:1,name:T("debuffs.void_brick_on_touch.name"),help:function(e){return T("debuffs.void_brick_on_touch.help",{lvl:e})}},{id:"downward_wind",max:20,name:T("debuffs.downward_wind.name"),help:function(e){return T("debuffs.downward_wind.help",{lvl:e})}},{id:"side_wind",max:20,name:T("debuffs.side_wind.name"),help:function(e){return T("debuffs.side_wind.help",{lvl:e})}}];function e4(){return(e4=(0,b._)(function(e){var t,r,_,n,a,s,l,o,i,u;return(0,k.__generator)(this,function(c){switch(c.label){case 0:(t=el(e2.filter(function(t){return e.debuffs[t.id]5?Y.filter(function(e){return e.adventure}).filter(function(t){return e.perks[t.id]}).sort(function(){return Math.random()-.5}).slice(0,3).map(function(e,t){return{icon:''.concat(e.icon," "),text:T("premium.discard",{name:e.name}),help:T("premium.discard_help"),value:{discard:e.id,cost:0}}}):[],i=new Set,u=null,c.label=1;case 1:return[4,eK({title:T("premium.next_step_title"),content:["\n ".concat(T("premium.choose_next_step",{score:e.score}),"
\n ").concat(eh(e)," \n ")].concat(y(l.map(function(t,r){var _=e.perks[t.id],n=(a+eo(e.perks)+_)*(r+1);return{icon:t.icon,text:0==_?T("premium.pick_perk",{name:t.name,cost:n}):T("premium.upgrade_perk_to_level",{name:t.name,cost:n,lvl:_+1}),help:t.help(_+1),value:{perk:t.id,cost:n},disabled:e.score.5?e.baseSpeed:-e.baseSpeed);e.balls.push({x:a,previousX:a,y:e.gameZoneHeight-1.5*e.ballSize,previousY:e.gameZoneHeight-1.5*e.ballSize,vx:s,previousVX:s,vy:-e.baseSpeed,previousVY:-e.baseSpeed,piercePoints:3*e.perks.pierce,hitSinceBounce:0,brokenSinceBounce:0,hitItem:[],sapperUses:0})}e.ballStickToPuck=!0}function e6(e){e.baseSpeed=Math.max(3,e.gameZoneWidth/12/10+e.currentLevel/(e.isAdventureMode?30:3)+e.levelTime/3e4-2*e.perks.slow_down),e.puckWidth=e.gameZoneWidth/12*(3-e.perks.smaller_puck+e.perks.bigger_puck);var t=e.perks.corner_shot&&e.levelTime?e.offsetXRoundedDown-e.puckWidth/2:e.offsetXRoundedDown+e.puckWidth/2,r=e.perks.corner_shot&&e.levelTime?e.offsetXRoundedDown+e.gameZoneWidthRoundedUp+e.puckWidth/2:e.offsetXRoundedDown+e.gameZoneWidthRoundedUp-e.puckWidth/2;e.puckPosition=eW(e.puckPosition,t,r),e.ballStickToPuck&&function(e){var t=e.balls.length,r=e.puckWidth/(t+1);e.balls.forEach(function(t,_){var n=e.puckPosition-e.puckWidth/2+r*(_+1);t.x=n,t.previousX=n,t.y=e.gameZoneHeight-1.5*e.ballSize,t.previousY=t.y,t.hitItem=[],t.hitSinceBounce=0,t.brokenSinceBounce=0,t.piercePoints=3*e.perks.pierce})}(e),Math.abs(e.lastPuckPosition-e.puckPosition)>1&&e.running&&(e.lastPuckMove=e.levelTime),e.lastPuckPosition=e.puckPosition}function e7(e){return 1+3*e.perks.base_combo+5*e.perks.smaller_puck}function e8(e,t,r){var _=e.combo;e.combo=e7(e),_>e.combo&&e.perks.soft_reset&&(e.combo+=Math.floor((_-e.combo)*(10*e.perks.soft_reset)/100));var n=Math.max(0,_-e.combo);if(n){for(var a=0;aP()&&(t=1);for(var a=0;aP()&&(t=1);for(var a=0;aL()?1:Math.floor(c-tb(e.coins))/3)));u>0;){var d=Math.min(p,u);(d<0||isNaN(d))&&console.error({points:d}),u-=d;var m=o+(Math.random()-.5)*(e.brickWidth-e.coinSize),h=i+(Math.random()-.5)*(e.brickWidth-e.coinSize);!function(e,t,r,_,n){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"gold",s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;e.debuffs.negative_coins>100*Math.random()&&(s=0,a="transparent"),tm(e.coins,function(l){l.x=t,l.y=r,l.size=e.coinSize,l.previousX=t,l.previousY=r,l.vx=_,l.vy=n,l.color=a,l.a=Math.random()*Math.PI*2,l.sa=Math.random()-.5,l.weight=.8+.2*Math.random()+Math.min(2,.01*s),l.points=s})}(e,m,h,r.previousVX*(.5+Math.random()),r.previousVY*(.5+Math.random()),e.perks.metamorphosis?a:"gold",d)}e.combo+=e.perks.streak_shots+e.perks.compound_interest+e.perks.left_is_lava+e.perks.right_is_lava+e.perks.top_is_lava+e.perks.picky_eater+e.perks.asceticism+e.perks.zen+e.perks.passive_income+e.perks.nbricks+e.perks.unbounded,e.perks.side_kick&&(Math.abs(r.vx)>Math.abs(r.vy)?e.combo+=e.perks.side_kick:e9(e,e.perks.side_kick,r.x,r.y)),e.perks.reach&&(ew(e,t)&&!ex(e,t)?e8(e,o,i):e.combo+=e.perks.reach),e.lastPuckMove&&e.perks.passive_income&&e.lastPuckMove>e.levelTime-250*e.perks.passive_income&&e8(e,o,i),e.perks.nbricks&&r.brokenSinceBounce>e.perks.nbricks&&e8(e,r.x,r.y),_||((e.perks.picky_eater||e.perks.pierce_color)&&a!==e.ballsColor&&a?(e.perks.picky_eater&&e8(e,r.x,r.y),tn(e,"colorChange",r.x,.8),e.lastExplosion=e.levelTime,e.ballsColor=a,K("basic")||e.balls.forEach(function(t){te(e,7,t.previousX,t.previousY,a)})):tn(e,"comboIncreaseMaybe",r.x,1)),td(e,o,i,a,e.brickWidth,40),te(e,5+Math.min(e.combo,30),o,i,a)}e.bricks[t]||"black"===a||null===(n=r.hitItem)||void 0===n||n.push({index:t,color:a})}}function t_(e,t){e.lastOffered[t]=Math.round(Date.now()/1e3)}function tn(e,t,r,_){if(_){null!=r||(r=e.offsetX+e.gameZoneWidth/2);var n=e.aboutToPlaySound[t];n.x=(r*_+n.x*n.vol)/(_+n.vol),n.vol+=_}}function ta(e,t){return ts.apply(this,arguments)}function ts(){return(ts=(0,b._)(function(e,t){var r,_,n,a,s,l;return(0,k.__generator)(this,function(o){switch(o.label){case 0:if(e.upgradesOfferedFor>=t)return[2,console.warn("Extra upgrade request ignored ")];if(e.upgradesOfferedFor=t,tM(!1),eX(),!(t>0))return[3,4];if(!e.isAdventureMode)return[3,2];return[4,function(e){return e4.apply(this,arguments)}(e)];case 1:return o.sent(),[3,4];case 2:return[4,function(e){return tB.apply(this,arguments)}(e)];case 3:o.sent(),o.label=4;case 4:for(e.currentLevel=t,e.level=e.runLevels[t],e.levelTime=0,e.winAt=0,e.levelWallBounces=0,e.autoCleanUses=0,e.lastTickDown=e.levelTime,e.levelStartScore=e.score,e.levelSpawnedCoins=0,e.levelMisses=0,e.runStatistics.levelsPlayed++,r=e.combo,e.combo=e7(e),e.perks.shunt&&(e.combo+=Math.round(Math.max(0,(r-e.combo)*20*e.perks.shunt/100))),e.combo+=15*e.perks.hot_start,(_=eg(e)).size!==e.gridSize&&(e.gridSize=_.size,tG()),tg(e.coins),tg(e.particles),tg(e.lights),tg(e.texts),e.bricks=[],n=0;n<_.size*_.size;n++)tl(e,n,_.bricks[n]);if(e.debuffs.negative_bricks)for(a=0,s=0;a<100&&ss)){var l=(t.x-r.x)/a,o=(t.y-r.y)/a,i=-_*(s-a)/(1.2*s)/3*Math.min(500,e.levelTime)/500;n&&void 0!==r.vx&&void 0!==r.vy&&(r.vx+=l*i,r.vy+=o*i),t.vx-=l*i,t.vy-=o*i,tc(e,t.x,t.y,-(10*l)+t.vx+(Math.random()-.5)*2,-(10*o)+t.vy+(Math.random()-.5)*2,to(),!0,e.coinSize/2,100),n&&void 0!==r.vx&&void 0!==r.vy&&tc(e,r.x,r.y,10*l+r.vx+(Math.random()-.5)*2,10*o+r.vy+(Math.random()-.5)*2,to(),!0,e.coinSize/2,100)}}function tu(e,t,r,_){if(!t.destroyed){t.previousX=t.x,t.previousY=t.y,t.x+=t.vx*_,t.y+=t.vy*_,e.perks.wind&&(t.vx+=(e.puckPosition-(e.offsetX+e.gameZoneWidth/2))/e.gameZoneWidth*e.perks.wind*.5);var n=0,a=0;return t.xe.canvasWidth-e.offsetXRoundedDown-r&&!e.perks.unbounded&&(t.x=e.canvasWidth-e.offsetXRoundedDown-r-(t.x-(e.canvasWidth-e.offsetXRoundedDown-r)),t.vx*=-1,a=1),a+2*n}}function tc(e,t,r,_,n,a){var s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:8,o=arguments.length>8&&void 0!==arguments[8]?arguments[8]:150;tm(e.particles,function(i){i.time=e.levelTime,i.x=t,i.y=r,i.vx=_,i.vy=n,i.color=a,i.size=l,i.duration=o,i.ethereal=s})}function tp(e,t,r,_,n){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:20,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:150;tm(e.texts,function(l){l.time=e.levelTime,l.x=t,l.y=r,l.color=_,l.size=a,l.duration=s,l.text=n})}function td(e,t,r,_){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:8,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:150;tm(e.lights,function(s){s.time=e.levelTime,s.x=t,s.y=r,s.color=_,s.size=n,s.duration=a})}function tm(e,t){for(;e.list[e.indexMin]&&!e.list[e.indexMin].destroyed&&e.indexMin=e.threshold}).filter(function(t){return t.name!==(null==e?void 0:e.level)}).filter(function(t){return t.name!==(null==e?void 0:e.levelToAvoid)}).sort(function(){return Math.random()-.5}),n=r.concat(_.slice(0,10).sort(function(e,t){return e.sortKey-t.sortKey})),a=W({},ei(Y),(null==e?void 0:e.perks)||{}),s=w(W({runLevels:n,level:n[0],currentLevel:0,upgradesOfferedFor:-1,perks:a,debuffs:W({},(p={},e2.forEach(function(e){return p[e.id]=0}),p),(null==e?void 0:e.debuffs)||{}),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,highScore:parseFloat(localStorage.getItem("breakout-3-hs")||"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:[]},levelStartScore:0,levelMisses:0,levelSpawnedCoins:0,puckColor:"#FFF",ballSize:20,coinSize:14,puckHeight:20,totalScoreAtRunStart:t,isCreativeModeRun:eo(a)>1,pauseUsesDuringRun:0,keyboardPuckSpeed:0,lastTick:performance.now(),lastTickDown:0,runStatistics:{started:Date.now(),levelsPlayed:0,runTime:0,coins_spawned:0,score:0,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},void:{vol:0,x:0}}}),{isAdventureMode:!!(null==e?void 0:e.adventure),rerolls:0});if(e3(s),!eo(s.perks)&&!(null==e?void 0:e.adventure)){var l=ed(s).filter(function(e){return e.giftable}),o=K("easy")&&"slow_down"||l[Math.floor(Math.random()*l.length)].id;a[o]=1,t_(s,o)}var i=!0,u=!1,c=void 0;try{for(var p,d,m=Y[Symbol.iterator]();!(i=(d=m.next()).done);i=!0){var h=d.value;s.perks[h.id]&&t_(s,h.id)}}catch(e){u=!0,c=e}finally{try{i||null==m.return||m.return()}finally{if(u)throw c}}return s}var b=m("5mG9B"),k=m("6QuVk");function ty(){return(ty=(0,b._)(function(e,t){var r,_,n,a,s,l,o;return(0,k.__generator)(this,function(i){switch(i.label){case 0:var u;return _=(r=function(e){if(Array.isArray(e))return e}(u=e.split(":"))||function(e,t){var r,_,n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a=[],s=!0,l=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){l=!0,_=e}finally{try{s||null==n.return||n.return()}finally{if(l)throw _}}return a}}(u,3)||f(u,3)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],n=r[1],a=r[2],s="".concat(_,":").concat(n),l=function(e){for(var t=atob(e.replace(/-----BEGIN PUBLIC KEY-----/,"").replace(/-----END PUBLIC KEY-----/,"").replace(/\s+/g,"")),r=new Uint8Array(t.length),_=0;_0&&void 0!==arguments[0]?arguments[0]:"webm";return"breakout-71-capture-"+new Date().toISOString().replace(/[^0-9\-]+/gi,"-")+"."+e}("webm"),n.target="_blank",!window.location.href.endsWith("index.html?isInWebView=true"))return[3,5];return[4,(s=t,new Promise(function(e,t){var r=new FileReader;r.onload=function(){e(r.result)},r.onerror=function(e){console.error(e),t(Error("Failed to readAsDataURL of the video "))},r.readAsDataURL(s)}))];case 4:return n.href=a.sent(),[3,6];case 5:n.href=_.src,a.label=6;case 6:return n.textContent=T("main_menu.record_download",{size:(t.size/1e6).toFixed(2)}),e.appendChild(n),[2]}})})}}(tF),null===(e=ee())||void 0===e||e.resume(),K("record")&&(null==s?void 0:s.state)==="paused"&&s.resume())}function tM(e){if(tF.running&&!tF.pauseTimeout){var t=function(){tF.running=!1,setTimeout(function(){var e;tF.running||null===(e=ee())||void 0===e||e.suspend()},1e3),eI(),tF.pauseTimeout=null,ej.className="",tF.needsRender=!0};e?(tF.pauseUsesDuringRun++,tF.pauseTimeout=setTimeout(t,Math.min(50*Math.max(0,tF.pauseUsesDuringRun-5),500))):t(),document.exitPointerLock&&document.exitPointerLock()}}tW(q("license","")).then();var tG=function(){var e,t=function(e){e.x=tF.offsetXRoundedDown+(e.x-_)/n*tF.gameZoneWidthRoundedUp,e.y=e.y/a*tF.gameZoneHeight},r=function(e){e.x=tF.offsetXRoundedDown+(e.x-_)/n*tF.gameZoneWidthRoundedUp,e.y=e.y/a*tF.gameZoneHeight,e.previousX=e.x,e.previousY=e.y},_=tF.offsetXRoundedDown,n=tF.gameZoneWidthRoundedUp,a=tF.gameZoneHeight,s=eM.getBoundingClientRect(),l=s.width,o=s.height;tF.canvasWidth=l,tF.canvasHeight=o,eM.width=l,eM.height=o,eG.fillStyle=(null===(e=eg(tF))||void 0===e?void 0:e.color)||"black",eG.globalAlpha=1,eG.fillRect(0,0,l,o),eH.width=l,eH.height=o,tF.gameZoneHeight=K("mobile-mode")?80*o/100:o;var i=Math.round(Math.min(tF.canvasWidth,.73*tF.gameZoneHeight));tF.brickWidth=2*Math.floor(i/tF.gridSize/2),tF.gameZoneWidth=tF.brickWidth*tF.gridSize,tF.offsetX=Math.floor((tF.canvasWidth-tF.gameZoneWidth)/2),tF.offsetXRoundedDown=tF.offsetX,tF.offsetX.9&&(e.rerolls++,n=T("level_up.plus_one_choice")),0===e.levelMisses?(r++,e.rerolls++,s=T("level_up.plus_one_upgrade")):e.levelMisses<=3&&(e.rerolls++,s=T("level_up.plus_one_choice")),c.label=1;case 1:var p,d;if(!r--||(p=3+e.perks.one_more_choice-e.perks.instant_upgrade,(d=ed(e).map(function(t){return w(W({},t),{score:e.isAdventureMode?0:Math.random()+(e.lastOffered[t.id]||0)})}).sort(function(e,t){return e.score-t.score}).filter(function(t){return e.perks[t.id]t.id?1:-1})).forEach(function(t){t_(e,t.id)}),!(l=d.map(function(t){return{text:t.name+(e.perks[t.id]?T("level_up.upgrade_perk_to_level",{level:e.perks[t.id]+1}):""),icon:F["icon:"+t.id],value:t.id,help:t.help(e.perks[t.id]+1)}})).length))return[3,3];return e.rerolls&&l.push({text:T("level_up.reroll",{count:e.rerolls}),help:T("level_up.reroll_help"),value:"reroll",icon:F["icon:reroll"]}),o="\n ".concat(T("level_up.after_buttons",{level:e.currentLevel+1,max:em(e)}),"
\n \n ").concat(eh(e),'\n
\n \n '),i=_&&n&&s&&a&&T("level_up.compliment_perfect")||(_||n||s||a)&&T("level_up.compliment_good")||T("level_up.compliment_advice"),[4,eK({title:T("level_up.pick_upgrade_title")+(r?" ("+(r+1)+")":""),content:["".concat(T("level_up.before_buttons",{score:e.score-e.levelStartScore,catchGain:n,levelSpawnedCoins:e.levelSpawnedCoins,time:Math.round(e.levelTime/1e3),timeGain:_,levelMisses:e.levelMisses,missesGain:s,levelWallBounces:e.levelWallBounces,wallHitsGain:a,compliment:i}),"\n
\n\n ").concat(eb(e),"
\n")].concat(y(l),[o])})];case 2:return"reroll"===(u=c.sent())?(r++,e.rerolls--):(e.perks[u]++,"instant_upgrade"===u&&(r+=2),e.runStatistics.upgrades_picked++),[3,1];case 3:return[2]}})})).apply(this,arguments)}function tq(e,t){return ep(tF,Math.floor(t/tF.brickWidth),Math.floor((e-tF.offsetX)/tF.brickWidth))}function tH(e){if(tF.bricks[e])return e}function tR(e,t,r){var _,n,a;return null!==(a=null!==(n=null!==(_=tH(tq(e-r,t-r)))&&void 0!==_?_:tH(tq(e+r,t-r)))&&void 0!==n?n:tH(tq(e+r,t+r)))&&void 0!==a?a:tH(tq(e-r,t+r))}window.addEventListener("resize",tG),window.addEventListener("fullscreenchange",tG),setInterval(function(){var e=eM.getBoundingClientRect(),t=e.width,r=e.height;(t!==tF.canvasWidth||r!==tF.canvasHeight)&&tG()},1e3),eM.addEventListener("mouseup",function(e){0===e.button&&(tF.running?tM(!0):(tz(),K("pointerLock")&&eM.requestPointerLock&&eM.requestPointerLock().then()))}),eM.addEventListener("mousemove",function(e){document.pointerLockElement===eM?e5(tF,tF.puckPosition+e.movementX):e5(tF,e.x)}),eM.addEventListener("touchstart",function(e){var t;e.preventDefault(),(null===(t=e.touches)||void 0===t?void 0:t.length)&&(e5(tF,e.touches[0].pageX),e6(tF),tz())}),eM.addEventListener("touchend",function(e){e.preventDefault(),tM(!0)}),eM.addEventListener("touchcancel",function(e){e.preventDefault(),tM(!0)}),eM.addEventListener("touchmove",function(e){var t;(null===(t=e.touches)||void 0===t?void 0:t.length)&&e5(tF,e.touches[0].pageX)});var tL=0,tP=document.getElementById("FPSDisplay");function tC(){return tO.apply(this,arguments)}function tO(){return(tO=(0,b._)(function(){return(0,k.__generator)(this,function(e){switch(e.label){case 0:return tM(!0),[4,eQ({title:tF.isAdventureMode?T("score_panel.title_adventure",{score:tF.score,level:tF.currentLevel+1,max:em(tF)}):T("score_panel.title",{score:tF.score,level:tF.currentLevel+1,max:em(tF)}),content:["\n ".concat(tF.isCreativeModeRun?"".concat(T("score_panel.test_run"),"
"):"","\n ").concat(eh(tF)," \n \n ").concat(eb(tF),"
\n ")],allowClose:!0})];case 1:return e.sent(),[2]}})})).apply(this,arguments)}function tT(){return tA.apply(this,arguments)}function tA(){return(tA=(0,b._)(function(){var e,t,r,_;return(0,k.__generator)(this,function(n){switch(n.label){case 0:return tM(!0),t=(e=Math).max.apply(e,y(Y.map(function(e){return e.threshold}))),r=[{icon:F["icon:7_levels_run"],text:T("main_menu.normal"),help:T("main_menu.normal_help"),value:function(){tN({levelToAvoid:eg(tF).name})}},{icon:F["icon:unlocks"],text:T("main_menu.unlocks"),help:T("main_menu.unlocks_help"),value:function(){(function(){tD.apply(this,arguments)})()}},{icon:F["icon:sandbox"],text:T("sandbox.title"),help:R()U)throw Error("Please update your app first, this file is for version "+s+" or newer.");if(o!==D("Security by obscurity, but really the game is oss so eh"+l))throw Error("Key does not match content.");for(var c in i=JSON.parse(l),localStorage.clear(),i)localStorage.setItem(c,i[c]);return[4,eQ({title:T("main_menu.save_file_loaded"),content:[T("main_menu.save_file_loaded_help"),{text:T("main_menu.save_file_loaded_ok")}]})];case 2:e.sent(),window.location.reload(),e.label=3;case 3:return[3,6];case 4:return u=e.sent(),[4,eQ({title:T("main_menu.save_file_error"),content:[u.message,{text:T("main_menu.save_file_loaded_ok")}]})];case 5:return e.sent(),[3,6];case 6:return t.value="",[2]}})}),function(e){return _.apply(this,arguments)})),document.body.appendChild(t)}return null===(e=document.getElementById("save_file_picker"))||void 0===e||e.click(),[2]})})()}}),e.push({text:T("main_menu.language"),help:T("main_menu.language_help"),value:function(){return(0,b._)(function(){var e,t;return(0,k.__generator)(this,function(r){switch(r.label){case 0:return[4,eQ({title:T("main_menu.language"),content:[T("main_menu.language_help"),{text:"English",value:"en"},{text:"Français",value:"fr"}],allowClose:!0})];case 1:if(!(t=(e=r.sent())&&e!==O()))return[3,3];return[4,tZ(tF)];case 2:t=r.sent(),r.label=3;case 3:return t&&(H("lang",e),window.location.reload()),[2]}})})()}}),e.push({text:T("main_menu.max_coins",{max:L()}),help:T("main_menu.max_coins_help"),value:function(){return(0,b._)(function(){return(0,k.__generator)(this,function(e){switch(e.label){case 0:return H("max_coins",(q("max_coins",1)+1)%6),[4,tE()];case 1:return e.sent(),[2]}})})()}}),e.push({text:T("main_menu.max_particles",{max:P()}),help:T("main_menu.max_particles_help"),value:function(){return(0,b._)(function(){return(0,k.__generator)(this,function(e){switch(e.label){case 0:return H("max_particles",(q("max_particles",1)+1)%6),[4,tE()];case 1:return e.sent(),[2]}})})()}}),[4,eQ({title:T("main_menu.settings_title"),content:[T("main_menu.settings_help")].concat(y(e)),allowClose:!0})];case 1:return(l=o.sent())&&(l(),tF.needsRender=!0),[2]}})})).apply(this,arguments)}function tD(){return(tD=(0,b._)(function(){var e,t,r,_;return(0,k.__generator)(this,function(n){switch(n.label){case 0:return e=R(),[4,eQ({title:T("unlocks.title",{percentUnlock:r=Math.round((t=y(Y.sort(function(e,t){return e.threshold-t.threshold}).map(function(t){var r=t.name,_=t.id,n=t.threshold,a=t.icon;return t.help,{text:r,disabled:e=t.threshold;return{text:t.name,disabled:!r,value:{level:t.name},icon:F[t.name]}})))).filter(function(e){return!e.disabled}).length/t.length*100)}),content:["".concat(T("unlocks.intro",{ts:e}),"\n ").concat(r<100?T("unlocks.greyed_out_help"):"","
")].concat(y(t),[" \nYour high score is ".concat(tF.highScore,". \nClick an item above to start a run with it.\n
")]),allowClose:!0,actionsAsGrid:!0})];case 1:if(!(_=n.sent()))return[3,3];return[4,tZ(tF)];case 2:n.sent()&&tN(_),n.label=3;case 3:return[2]}})})).apply(this,arguments)}function tZ(e){return tV.apply(this,arguments)}function tV(){return(tV=(0,b._)(function(e){return(0,k.__generator)(this,function(t){return e.currentLevel?[2,eQ({title:T("confirmRestart.title"),content:[T("confirmRestart.text"),{value:!0,text:T("confirmRestart.yes")},{value:!1,text:T("confirmRestart.no")}]})]:[2,!0]})})).apply(this,arguments)}function tI(){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)}}setInterval(function(){K("show_fps")?tP.innerText=tL+" FPS "+tb(tF.coins)+" COINS "+(tb(tF.particles)+tb(tF.texts)+tb(tF.lights))+" PARTICLES ":tP.innerText="",tL=0},1e3),window.addEventListener("visibilitychange",function(){document.hidden&&tM(!0)}),ej.addEventListener("click",function(e){e.preventDefault(),eU||tC()}),document.addEventListener("visibilitychange",function(){document.hidden&&tM(!0)}),document.getElementById("menu").addEventListener("click",function(e){e.preventDefault(),eU||tT()});var tX={ArrowLeft:0,ArrowRight:0,Shift:0};function tU(e,t){tX[e]=t,tF.keyboardPuckSpeed=(tX.ArrowRight-tX.ArrowLeft)*(1+2*tX.Shift)*tF.gameZoneWidth/50}document.addEventListener("keydown",function(e){"f"!==e.key.toLowerCase()||e.ctrlKey||e.metaKey?e.key in tX&&tU(e.key,1):tI()," "===e.key&&!eU&&(tF.running?tM(!0):tz(),e.preventDefault())}),document.addEventListener("keyup",(r=(0,b._)(function(e){var t,r,_,n,a;return(0,k.__generator)(this,function(s){switch(s.label){case 0:if(a=document.querySelector("button:focus"),!(e.key in tX))return[3,1];return tU(e.key,0),[3,10];case 1:if("ArrowDown"!==e.key||(null==a?void 0:null===(t=a.nextElementSibling)||void 0===t?void 0:t.tagName)!=="BUTTON")return[3,2];return null==a||null===(r=a.nextElementSibling)||void 0===r||r.focus(),[3,10];case 2:if("ArrowUp"!==e.key||(null==a?void 0:null===(_=a.previousElementSibling)||void 0===_?void 0:_.tagName)!=="BUTTON")return[3,3];return null==a||null===(n=a.previousElementSibling)||void 0===n||n.focus(),[3,10];case 3:if(!("Escape"===e.key&&eF))return[3,4];return eF(),[3,10];case 4:if(!("Escape"===e.key&&tF.running))return[3,5];return tM(!0),[3,10];case 5:if(!("m"===e.key.toLowerCase()&&!eU))return[3,6];return tT().then(),[3,10];case 6:if(!("s"===e.key.toLowerCase()&&!eU))return[3,7];return tC().then(),[3,10];case 7:if(!("r"===e.key.toLowerCase()&&!eU))return[3,9];return[4,tZ(tF)];case 8:return s.sent()&&tN({levelToAvoid:eg(tF).name}),[3,10];case 9:return[2];case 10:return e.preventDefault(),[2]}})}),function(e){return r.apply(this,arguments)}));var tF=tf({});function tN(e){tG(),Object.assign(tF,tf(e)),eI(),ta(tF,0)}tN(window.location.search.includes("stressTest")&&{level:"Bird",perks:{sapper:10,bigger_explosions:1,unbounded:1,pierce_color:1,pierce:20,multiball:6,base_combo:7,telekinesis:2,yoyo:2,metamorphosis:1,implosions:1}}||window.location.search.includes("adventure")&&{adventure:!0,perks:{},debuffs:{}}||{}),function e(){var t=performance.now(),r=t-tF.lastTick;tF.lastTick=t;var _=Math.min(4,r/(1e3/60));tF.keyboardPuckSpeed&&e5(tF,tF.puckPosition+tF.keyboardPuckSpeed),e6(tF),tF.running&&(tF.levelTime+=r,tF.runStatistics.runTime+=r,function(e){var t=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 r=e.bricks.filter(function(e){return e&&"black"!==e}).length;e.levelTime>e.lastTickDown+1e3&&e.perks.hot_start&&(e.lastTickDown=e.levelTime,e9(e,e.perks.hot_start,e.puckPosition,e.gameZoneHeight-2*e.puckHeight)),r<=e.perks.skip_last&&!e.autoCleanUses&&(e.bricks.forEach(function(t,r){t&&tr(e,r,e.balls[0],!0)}),e.autoCleanUses++);var _=e.perks.respawn&&e.balls.find(function(e){return e.hitItem.length>1});if(!e.running||r||_?e.winAt=0:e.winAt||(e.winAt=e.levelTime+5e3),e.winAt&&e.levelTime>e.winAt||e.running&&e.levelTime&&!r&&!tb(e.coins))e.isAdventureMode||e.currentLevel+17*e.baseSpeed&&(r.vx=7*e.baseSpeed),r.vx<-7*e.baseSpeed&&(r.vx=-7*e.baseSpeed),r.vy>7*e.baseSpeed&&(r.vy=7*e.baseSpeed),r.vy<-7*e.baseSpeed&&(r.vy=-7*e.baseSpeed),r.a+=r.sa,!e.perks.etherealcoins){var i=e.perks.helium>0&&2*Math.abs(r.x-e.puckPosition)>e.puckWidth+r.size;r.vy+=t*r.weight*.8*(i?-1:1),i&&!K("basic")&&.1>Math.random()&&tc(e,r.x,r.y,0,e.baseSpeed,r.color,!0,5,250)}var u=(Math.abs(r.vx)+Math.abs(r.vy))*10,c=tu(e,r,r.size/2,t);r.y>e.gameZoneHeight-n-e.puckHeight&&r.ye.highScore)||e.isCreativeModeRun||e.isAdventureMode||(e.highScore=e.score,localStorage.setItem("breakout-3-hs",e.score.toString())),K("basic")||tc(e,r.previousX,r.previousY,(e.canvasWidth-r.x)/100,-r.y/100,r.color,!0,e.coinSize/2,100+50*Math.random()),r.points>0?tn(e,"coinCatch",r.x,1):e8(e,r.x,r.y),e.runStatistics.score+=r.points,e.perks.asceticism&&e8(e,r.x,r.y),th(e.coins,_)):r.y>e.canvasHeight+n?(th(e.coins,_),e.perks.compound_interest&&e8(e,r.x,r.y)):e.perks.unbounded&&(r.x<-e.gameZoneWidth/2||r.x>e.canvasWidth+e.gameZoneWidth/2)&&th(e.coins,_);var p=function(e,t){var r,_=t.size/2,n=t.x,a=t.y,s=t.previousX,l=t.previousY,o=tR(s,a,_),i=tR(n,l,_),u=void 0===o&&void 0===i&&tR(n,a,_)||void 0;if(!e.perks.ghost_coins){if(void 0!==o||void 0!==u){t.y=t.previousY,t.vy*=-1;var c=e.bricks[tq(n-_,a+_)],p=e.bricks[tq(n+_,a+_)];c&&!p&&(t.vx+=1,t.sa-=1),!c&&p&&(t.vx-=1,t.sa+=1)}(void 0!==i||void 0!==u)&&(t.x=t.previousX,t.vx*=-1)}return null!==(r=null!=o?o:i)&&void 0!==r?r:u}(e,r);e.debuffs.void_coins_on_touch&&r.points&&void 0!==p&&"transparent"==e.bricks[p]?(r.points=0,r.color="transparent",tn(e,"void",r.x,1)):e.debuffs.void_brick_on_touch&&!r.points&&void 0!==p&&"transparent"!==e.bricks[p]?(tl(e,p,"transparent"),tn(e,"void",r.x,1)):e.perks.metamorphosis&&void 0!==p&&e.bricks[p]&&r.color!==e.bricks[p]&&"black"!==e.bricks[p]&&!r.coloredABrick&&(e.bricks[p]=r.color,r.coloredABrick=!0,tn(e,"colorChange",r.x,.3)),(!e.perks.ghost_coins&&void 0!==p||c)&&(r.vx*=.8,r.vy*=.8,r.sa*=.9,u>20&&tn(e,"coinBounce",r.x,.2),3>Math.abs(r.vy)&&(r.vy=0))}),e.balls.forEach(function(r){return function(e,t,r){t.previousVX=t.vx,t.previousVY=t.vy;var _,n=1+e.perks.telekinesis+e.perks.ball_repulse_ball+e.perks.puck_repulse_ball+e.perks.ball_attract_ball;e.debuffs.downward_wind&&e.levelTime/1e30?1:-1)*.02/n);var a=!0,s=!1,l=void 0;if(e.perks.ball_repulse_ball)try{for(var o,i,u,c=e.balls[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var p=u.value;p.x>=t.x||ti(e,t,p,e.perks.ball_repulse_ball,!0)}}catch(e){s=!0,l=e}finally{try{a||null==c.return||c.return()}finally{if(s)throw l}}var d=!0,m=!1,h=void 0;if(e.perks.ball_attract_ball)try{for(var b,g=e.balls[Symbol.iterator]();!(d=(b=g.next()).done);d=!0){var v=b.value;v.x>=t.x||function(e,t,r,_){var n=ek(t,r),a=3*e.gameZoneWidth/4;if(!(n1&&!K("basic"))for(var f=0;f<(null===(i=t.hitItem)||void 0===i?void 0:i.length)-1&&f.5,x=Math.random()>.5?1:-1,S=Math.random()>.5?1:-1;tc(e,eu(e,k)+x*e.brickWidth/2,ec(e,k)+S*e.brickWidth/2,w?0:-x*e.baseSpeed,w?-S*e.baseSpeed:0,W,!0,e.coinSize/2,250)}}var z=tu(e,t,e.ballSize/2,r);z&&(e.perks.left_is_lava&&z%2&&t.xe.offsetX+e.gameZoneWidth/2&&e8(e,t.x,t.y),e.perks.top_is_lava&&z>=2&&e8(e,t.x,t.y+e.ballSize),e.perks.trampoline&&z>=2&&e9(e,e.perks.trampoline,t.x,t.y+e.ballSize),tn(e,"wallBeep",t.x,1),e.levelWallBounces++,e.runStatistics.wall_bounces++);var M=e.gameZoneHeight-e.puckHeight-e.ballSize/2,G=Math.abs(t.x-e.puckPosition)M&&t.vy>0&&(G||e.perks.extra_life&&t.y>M+e.puckHeight/2)){if(G){var B=Math.sqrt(t.vx*t.vx+t.vy*t.vy),q=Math.atan2(-e.puckWidth/2,(t.x-e.puckPosition)*(e.perks.concave_puck?-.5:1));t.vx=B*Math.cos(q),t.vy=B*Math.sin(q),tn(e,"wallBeep",t.x,1)}else if(t.vy*=-1,e.perks.extra_life-=1,e.perks.extra_life<0?e.perks.extra_life=0:e.perks.sacrifice&&e.bricks.forEach(function(r,_){return r&&tr(e,_,t,!0)}),tn(e,"lifeLost",t.x,1),!K("basic"))for(var H=0;H<10;H++)tc(e,t.x,t.y,Math.random()*e.baseSpeed*3,3*e.baseSpeed,"red",!1,e.coinSize/2,150);if(e.perks.streak_shots&&e8(e,t.x,t.y),e.perks.trampoline&&(e.combo+=e.perks.trampoline),e.perks.nbricks&&t.brokenSinceBouncee.canvasWidth+e.gameZoneWidth/2;e.running&&(t.y>e.gameZoneHeight+e.ballSize/2||L)&&(t.destroyed=!0,e.runStatistics.balls_lost++,e.balls.find(function(e){return!e.destroyed})||e1(T("gameOver.lost.title"),T("gameOver.lost.summary",{score:e.score})));var P=e.ballSize/2,C=t.x,O=t.y,A=t.previousX,E=t.previousY,j=tR(A,O,P),D=tR(C,E,P),Z=void 0===j&&void 0===D&&tR(C,O,P)||void 0,V=null!==(_=null!=j?j:D)&&void 0!==_?_:Z;if(void 0!==V){t.hitSinceBounce++;var I=!1,X=1+(e.perks.pierce_color&&(void 0===j||e.bricks[j]===e.ballsColor)&&(void 0===D||e.bricks[D]===e.ballsColor)&&(void 0===Z||e.bricks[Z]===e.ballsColor)?e.perks.pierce_color:0);e.brickHP[V]-=X;var U=Math.min(t.piercePoints,Math.max(1,e.brickHP[V]));if(e.brickHP[V]-=U,t.piercePoints-=U,e.brickHP[V]<0&&(e.brickHP[V]=0,I=!0),void 0===j&&void 0===Z||I||(t.y=t.previousY,t.vy*=-1),void 0===D&&void 0===Z||I||(t.x=t.previousX,t.vx*=-1),!e.brickHP[V]){var F=e.bricks[V];t.brokenSinceBounce++,tr(e,V,t,!1),t.sapperUses.1/(1+J)||Y&&Math.random()>.1/(1+Y)||J&&Math.random()>.1/(1+J)){var Q=Y?Math.random()>.5?"orange":"red":e.ballsColor;tc(e,t.x,t.y,e.perks.pierce_color||N?-t.vx+(Math.random()-.5)*e.baseSpeed/3:(Math.random()-.5)*e.baseSpeed,e.perks.pierce_color||N?-t.vy+(Math.random()-.5)*e.baseSpeed/3:(Math.random()-.5)*e.baseSpeed,Q,!0,e.coinSize/2,100)}}}(e,r,t)}),!K("basic")&&e.debuffs.downward_wind&&e.levelTime/1e3.5&&tc(e,e.offsetXRoundedDown+Math.random()*e.gameZoneWidthRoundedUp,Math.random()*e.gameZoneHeight,8*s,0,to(),!0,e.coinSize/2,150);tv(e.particles,function(r,_){r.x+=r.vx*t,r.y+=r.vy*t,!r.ethereal&&(r.vy+=.5,tH(tq(r.x,r.y))&&th(e.particles,_))})}if(e.combo>e7(e)&&!K("basic")&&(e.combo-e7(e))*Math.random()>5){if(e.perks.top_is_lava&&tc(e,e.offsetXRoundedDown+Math.random()*e.gameZoneWidthRoundedUp,0,(Math.random()-.5)*10,5,"red",!0,e.coinSize/2,100*(Math.random()+1)),e.perks.left_is_lava&&tc(e,e.offsetXRoundedDown,Math.random()*e.gameZoneHeight,5,(Math.random()-.5)*10,"red",!0,e.coinSize/2,100*(Math.random()+1)),e.perks.right_is_lava&&tc(e,e.offsetXRoundedDown+e.gameZoneWidthRoundedUp,Math.random()*e.gameZoneHeight,-5,(Math.random()-.5)*10,"red",!0,e.coinSize/2,100*(Math.random()+1)),e.perks.compound_interest){var o=e.puckPosition,i=0;do o=e.offsetXRoundedDown+e.gameZoneWidthRoundedUp*Math.random(),i++;while(Math.abs(o-e.puckPosition)t.time+t.duration&&th(e.particles,r)}),tv(e.texts,function(t,r){e.levelTime>t.time+t.duration&&th(e.texts,r)}),tv(e.lights,function(t,r){e.levelTime>t.time+t.duration&&th(e.lights,r)})}(tF,_)),(tF.running||tF.needsRender)&&(tF.needsRender=!1,function(e){var t=eg(e),r=e.combo>e7(e),_=eM.width,n=eM.height;if(_&&n){if(e.currentLevel||e.levelTime?eD.innerText=e.isAdventureMode?T("play.current_lvl_adventure",{level:e.currentLevel+1}):T("play.current_lvl",{level:e.currentLevel+1,max:em(e)}):eD.innerText=T("play.menu_label"),ej.innerText="$".concat(e.score),ej.className=e.lastScoreIncrease>e.levelTime-500?"active":"",K("basic")||t.color||!t.svg)eG.globalAlpha=1,eG.globalCompositeOperation="source-over",eG.fillStyle=t.color||"#000",eG.fillRect(0,0,_,n),tv(e.particles,function(t){var r=t.x,_=t.y,n=t.time,a=t.color,s=t.size,l=t.duration;eG.globalAlpha=Math.min(1,2-(e.levelTime-n)/l*2),eO(eG,a,s,r,_)});else if(eG.globalCompositeOperation="source-over",eG.globalAlpha=1,eG.fillStyle="#000",eG.fillRect(0,0,_,n),eG.globalCompositeOperation="screen",eG.globalAlpha=.6,tv(e.coins,function(t){eA(eG,t.color,2*e.coinSize,t.x,t.y)}),e.balls.forEach(function(t){eA(eG,e.ballsColor,2*e.ballSize,t.x,t.y)}),eG.globalAlpha=.5,e.bricks.forEach(function(t,r){if(t){var _=eu(e,r),n=ec(e,r);eA(eG,"black"==t?"#666":t,e.brickWidth,_,n)}}),eG.globalAlpha=1,tv(e.lights,function(t){var r=t.x,_=t.y,n=t.time,a=t.color,s=t.size,l=t.duration;eG.globalAlpha=Math.min(1,2-(e.levelTime-n)/l*2),eA(eG,a,s,r,_)}),tv(e.particles,function(t){var r=t.x,_=t.y,n=t.time,a=t.color,s=t.size,l=t.duration;eG.globalAlpha=Math.min(1,2-(e.levelTime-n)/l*2),eA(eG,a,3*s,r,_)}),eG.globalAlpha=.2,eG.globalCompositeOperation="multiply",eG.fillStyle="black",eG.fillRect(0,0,_,n),eG.globalAlpha=.8,eG.globalCompositeOperation="multiply",t.svg&&eq.width&&eq.complete){if(eH.title!==t.name){eH.title=t.name,eH.width=e.canvasWidth,eH.height=e.canvasHeight;var a=eH.getContext("2d");a.fillStyle=t.color||"#000",a.fillRect(0,0,e.canvasWidth,e.canvasHeight);var s=eG.createPattern(eq,"repeat");s&&(a.fillStyle=s,a.fillRect(0,0,_,n))}eG.drawImage(eH,0,0)}else eG.fillStyle="#000",eG.fillRect(0,0,_,n);eG.globalAlpha=1,eG.globalCompositeOperation="source-over";var l=Date.now()-e.lastExplosion+5,o=l<200&&!K("basic");if(o){var i=(e.perks.bigger_explosions+1)*50/l;eG.translate(Math.sin(Date.now())*i,Math.sin(Date.now()+36)*i)}if(e.perks.bigger_explosions&&!K("basic")&&o?eM.style.filter="brightness("+(1+100/(1+l))+")":eM.style.filter="",eG.globalAlpha=1,tv(e.coins,function(_){eG.globalCompositeOperation="gold"===_.color||t.color?"source-over":"screen",eT(eG,_.color,_.size,_.x,_.y,r&&e.perks.asceticism&&"red"||!_.points&&"red"||t.color||"black",_.a)}),K("basic")||(eG.globalCompositeOperation="source-over",eG.globalAlpha=Math.min(.8,tb(e.coins)/20),e.balls.forEach(function(r){eO(eG,t.color||"#000",6*e.ballSize,r.x,r.y)})),eG.globalCompositeOperation="source-over",function(){eG.globalAlpha=1;var e=tF.combo>e7(tF),t=e&&tF.perks.picky_eater&&!K("basic"),r=!!(tF.lastPuckMove&&tF.perks.passive_income&&e&&tF.lastPuckMove>tF.levelTime-250*tF.perks.passive_income),_=eV(tF);t||r||tF.perks.reach||tF.perks.zen||tF.debuffs.negative_bricks||(_=0);var n=tF.perks.clairvoyant&&tF.brickHP.reduce(function(e,t){return e+t},0),a=tF.gameZoneWidth+"_"+tF.bricks.join("_")+eB.complete+"_"+t+"_"+r+"_"+tF.ballsColor+"_"+tF.perks.pierce_color+"_"+n+"_"+_;if(a!==eP){eP=a,eL.width=tF.gameZoneWidth,eL.height=tF.gameZoneWidth+1;var s=eL.getContext("2d");s.clearRect(0,0,tF.gameZoneWidth,tF.gameZoneWidth),s.resetTransform(),s.translate(-tF.offsetX,0),tF.bricks.forEach(function(n,a){var l=eu(tF,a),o=ec(tF,a);if(n){var i=tF.perks.reach&&ew(tF,a)&&!ex(tF,a),u="transparent"===n||tF.ballsColor!==n&&"black"!==n&&t||e&&tF.perks.zen&&"black"===n||i||r;s.globalCompositeOperation="source-over",function(e,t,r,_){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=Math.ceil(r-tF.brickWidth/2),s=Math.ceil(_-tF.brickWidth/2),l=Math.ceil(r+tF.brickWidth/2)-1,o=Math.ceil(_+tF.brickWidth/2)-1,i=l-a,u=o-s,c="brick"+t+"__"+i+"_"+u+"_"+n;if(!eC[c]){var p,d,m,h,b,g,v=document.createElement("canvas");v.width=i,v.height=u;var f=v.getContext("2d");f.fillStyle=t,f.setLineDash(-1!==n?eZ:[]),f.lineDashOffset=n,f.strokeStyle=-1!==n?"red":t,f.lineJoin="round",f.lineWidth=4,p=f,d=2,m=2,h=i-4,b=u-4,g=2,p.beginPath(),p.moveTo(4,2),p.lineTo(d+h-g,m),p.quadraticCurveTo(d+h,m,d+h,m+g),p.lineTo(d+h,m+b-g),p.quadraticCurveTo(d+h,m+b,d+h-g,m+b),p.lineTo(d+g,m+b),p.quadraticCurveTo(d,m+b,d,m+b-g),p.lineTo(d,m+g),p.quadraticCurveTo(d,m,d+g,m),p.closePath(),f.fill(),f.stroke(),eC[c]=v}e.drawImage(eC[c],a,s,i,u)}(s,n,l,o,u?_:-1),tF.brickHP[a]>1&&tF.perks.clairvoyant&&(s.globalCompositeOperation="destination-out",eE(s,tF.brickHP[a].toString(),"white",tF.puckHeight,l,o)),"black"===n&&(s.globalCompositeOperation="source-over",function(e,t,r,_,n){var a="svg"+t+"_"+r+"_"+t.complete;if(!eC[a]){var s=document.createElement("canvas");s.width=r,s.height=r;var l=s.getContext("2d"),o=r/Math.max(t.width,t.height),i=t.width*o,u=t.height*o;l.drawImage(t,(r-i)/2,(r-u)/2,i,u),eC[a]=s}e.drawImage(eC[a],Math.round(_-r/2),Math.round(n-r/2))}(s,eB,tF.brickWidth,l,o))}})}eG.drawImage(eL,tF.offsetX,0)}(),eG.globalCompositeOperation="screen",tv(e.texts,function(t){var r=t.x,_=t.y,n=t.time,a=t.color,s=t.size,l=t.duration,o=e.levelTime-n;eG.globalAlpha=Math.max(0,Math.min(1,2-o/l*2)),eG.globalCompositeOperation="source-over",eE(eG,t.text,a,s,r,_-o/10)}),tv(e.particles,function(t){var r=t.x,_=t.y,n=t.time,a=t.color,s=t.size,l=t.duration;eG.globalAlpha=Math.max(0,Math.min(1,2-(e.levelTime-n)/l*2)),eG.globalCompositeOperation="screen",eO(eG,a,s,r,_),eA(eG,a,s,r,_)}),e.perks.extra_life){eG.globalAlpha=1,eG.globalCompositeOperation="source-over",eG.fillStyle=e.puckColor;for(var u=0;u4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,l="puck"+t+"_"+r+"_"+_+"_"+a+"_"+s;if(!eC[l]){var o=document.createElement("canvas");o.width=r,o.height=2*_;var i=o.getContext("2d");i.fillStyle=t,i.beginPath(),i.moveTo(0,2*_),a?(i.lineTo(0,.75*_),i.bezierCurveTo(r/2,_,r/2,+_,r,.75*_)):(i.lineTo(0,1.25*_),i.bezierCurveTo(0,.75*_,r,.75*_,r,1.25*_)),i.lineTo(r,2*_),i.fill(),-1!==s&&(i.strokeStyle="red",i.lineWidth=4,i.setLineDash(eZ),i.lineDashOffset=s,i.stroke()),eC[l]=o}e.drawImage(eC[l],Math.round(tF.puckPosition-r/2),tF.gameZoneHeight-2*_+n)}(eG,e.puckColor,e.puckWidth,e.puckHeight,0,!!e.perks.concave_puck,e.perks.streak_shots&&r?eV(e):-1),e.combo>1){eG.globalCompositeOperation="source-over";var c="x "+e.combo,p=c.length*e.puckHeight/1.8,d=p+2*e.coinSize,m=e.puckPosition-d/2;de.puckWidth?e.combo.toString():c,"#000",p>e.puckWidth?12:20,e.puckPosition,e.gameZoneHeight-e.puckHeight/2,!1)}eG.globalCompositeOperation="source-over",eG.globalAlpha=e.perks.unbounded?.1:1,e.offsetXRoundedDown?(eG.fillStyle=r&&e.perks.left_is_lava?"red":e.puckColor,eR(eG,e,r&&e.perks.left_is_lava&&!e.perks.unbounded&&"red"||"white",e.offsetX-1,0,e.offsetX-1,n,e.perks.unbounded?.1:1),eR(eG,e,r&&e.perks.right_is_lava&&!e.perks.unbounded&&"red"||"white",_-e.offsetX+1,0,_-e.offsetX+1,n,e.perks.unbounded?.1:1)):(eG.fillStyle="red",eR(eG,e,r&&e.perks.left_is_lava&&!e.perks.unbounded&&"red"||"",0,0,0,n,1),eR(eG,e,r&&e.perks.right_is_lava&&!e.perks.unbounded&&"red"||"",_-1,0,_-1,n,1)),eR(eG,e,r&&e.perks.top_is_lava&&"red"||"",e.offsetXRoundedDown,1,_-e.offsetXRoundedDown,1,1),eR(eG,e,r&&e.perks.compound_interest&&"red"||K("mobile-mode")&&"white"||"",e.offsetXRoundedDown,e.gameZoneHeight,_-e.offsetXRoundedDown,e.gameZoneHeight,1),K("mobile-mode")&&!e.running&&eE(eG,T("play.mobile_press_to_play"),e.puckColor,e.puckHeight,e.canvasWidth/2,e.gameZoneHeight+(e.canvasHeight-e.gameZoneHeight)/2),o&&eG.resetTransform()}}(tF)),tF.running&&function(e){if(K("record")){var t;l&&(t=e,u&&(u.drawImage(eM,t.offsetXRoundedDown,0,t.gameZoneWidthRoundedUp,t.gameZoneHeight,0,0,i.width,i.height),u.fillStyle="#FFF",u.textBaseline="top",u.font="12px monospace",u.textAlign="right",u.fillText(t.score.toString(),i.width-12,12),u.textAlign="left",u.fillText("Level "+(t.currentLevel+1)+(t.isAdventureMode?"":"/"+em(t)),12,12)),(null==o?void 0:o.requestFrame)?null==o||o.requestFrame():(null==l?void 0:l.requestFrame)&&l.requestFrame())}}(tF),K("sound")&&function(e){if(!(Q>Date.now()-60))for(var t in Q=Date.now(),e.aboutToPlaySound){var r,_=e.aboutToPlaySound[t];_.vol&&($[t](Math.min(2,_.vol),(r=e,Math.max(0,Math.min(1,(_.x-r.offsetXRoundedDown)/r.gameZoneWidthRoundedUp))),e.combo),_.vol=0)}}(tF),requestAnimationFrame(e),tL++}()}();