You just finished level ".concat(_4.currentLevel+1,"/").concat(_R()," and picked those upgrades so far :
").concat(_d(),'
\n \n \n '),[4,_D({title:"Pick an upgrade "+(e?"("+(e+1)+")":""),actions:i,text:"
\n You caught ".concat(_4.score-_4.levelStartScore," coins ").concat(o," out of ").concat(_4.levelSpawnedCoins," in ").concat(Math.round(_4.levelTime/1e3)," seconds").concat(r,".\n You missed ").concat(_4.levelMisses," times ").concat(n,". \n ").concat(r&&o&&n&&"Impressive, keep it up !"||(r||o||n)&&"Well done !"||"Try to catch all coins, never miss the bricks or clear the level under 30s to gain additional choices and upgrades.","\n
\n')});var c=(null===(r=function(_,e){for(var t=_.length;--t;)if(e(_[t],t,_))return _[t]}(l,function(_){return _.threshold<=s}))||void 0===r?void 0:r.threshold)||0,u=l.find(function(_){return _.threshold>s});if(u){var h=(null==u?void 0:u.threshold)-c,d=s-c;e+="Score ".concat(u.threshold-s," more points to reach the next unlock.");var b=(d/h).toFixed(2);i+='\n
This is a test run, score is not recorded permanently
":"","\n
Upgrades picked so far :
\n
").concat(_d(),"
\n "),allowClose:!0,actions:[{text:"Resume",help:"Return to your run",value:function(){}},{text:"Restart",help:"Start a brand new run.",value:function(){_5({levelToAvoid:_m().name})}}]})];case 1:return(_=e.sent())&&_(),[2]}})})).apply(this,arguments)}function _j(){return _F.apply(this,arguments)}function _F(){return(_F=m(function(){var _,e,t,r,o,n,i,s,a,l;return W(this,function(c){switch(c.label){case 0:_o(!0),e=[{text:"Resume",help:"Return to your run",value:function(){}},{text:"Starting perk",help:"Try perks and levels you unlocked",value:function(){(function(){_U.apply(this,arguments)})()}}],t=!0,r=!1,o=void 0;try{for(n=function(){var _=s.value;E[_]&&e.push({disabled:E[_].disabled(),icon:_X(_)?C["icon:checkmark_checked"]:C["icon:checkmark_unchecked"],text:E[_].name,help:E[_].help,value:function(){(function(_){_q[_]=!_X(_);try{localStorage.setItem("breakout-settings-enable-"+_,JSON.stringify(_q[_]))}catch(_){console.warn(_)}E[_].afterChange()})(_),_j()}})},i=Object.keys(E)[Symbol.iterator]();!(t=(s=i.next()).done);t=!0)n()}catch(_){r=!0,o=_}finally{try{t||null==i.return||i.return()}finally{if(r)throw o}}return a=(_=Math).max.apply(_,k(H.map(function(_){return _.threshold}))),(document.fullscreenEnabled||document.webkitFullscreenEnabled)&&(null!==document.fullscreenElement?e.push({text:"Exit Fullscreen",icon:C["icon:exit_fullscreen"],help:"Might not work on some machines",value:function(){_Q()}}):e.push({icon:C["icon:fullscreen"],text:"Fullscreen",help:"Might not work on some machines",value:function(){_Q()}})),e.push({text:"Sandbox mode",help:_x()\n Made in France by Renan LE CARO. \n Privacy Policy\n F-Droid\n Google Play\n itch.io \n Gitlab\n Web version\n HackerNews\n v.'.concat(L,"\n \n ")})];case 1:return(l=c.sent())&&l(),[2]}})})).apply(this,arguments)}function _U(){return(_U=m(function(){var _,e,t,r,o;return W(this,function(n){switch(n.label){case 0:return _=_x(),t=Math.round((e=k(H.sort(function(_,e){return _.threshold-e.threshold}).map(function(e){var t=e.name,r=e.id,o=e.threshold,n=e.icon,i=e.fullHelp;return{text:t,help:_>=o?i:"Unlocks at total score ".concat(o,"."),disabled:_=e.threshold;return{text:e.name,help:t?"A ".concat(e.size,"x").concat(e.size," level with ").concat(e.bricks.filter(function(_){return _}).length," bricks"):"Unlocks at total score ".concat(e.threshold,"."),disabled:!t,value:{level:e.name},icon:C[e.name]}})))).filter(function(_){return!_.disabled}).length/e.length*100),[4,_D({title:"You unlocked ".concat(t,"% of the game."),text:"\n
Your total score is ".concat(_,". Below are all the upgrades and levels the games has to offer.\n ").concat(t<100?"The greyed out ones can be unlocked by increasing your total score. The total score increases every time you score in game.":"","
\n "),textAfterButtons:"
\nYour high score is ".concat(_4.highScore,". \nClick an item above to start a run with it.\n
"),actions:e,allowClose:!0})];case 1:if(!(r=n.sent()))return[3,4];if(o=!_4.currentLevel)return[3,3];return[4,_D({title:"Restart run to try this item?",text:"You're about to start a new run with the selected unlocked item, is that really what you wanted ? ",actions:[{value:!0,text:"Restart game to test item"},{value:!1,text:"Cancel"}]})];case 2:o=n.sent(),n.label=3;case 3:o&&_5(r),n.label=4;case 4:return[2]}})})).apply(this,arguments)}function _N(_,e){return Math.sqrt(Math.pow(_.x-e.x,2)+Math.pow(_.y-e.y,2))}function _Y(){return"hsl(".concat(2*Math.round(_4.levelTime/4)%360,",100%,70%)")}function _J(_,e,t,r){var o=_N(_,e),n=_4.gameZoneWidth/2;if(!(o>n)){var i=(_.x-e.x)/o,s=(_.y-e.y)/o,a=-t*(n-o)/(1.2*n)/3*Math.min(500,_4.levelTime)/500;r&&void 0!==e.vx&&void 0!==e.vy&&(e.vx+=i*a,e.vy+=s*a),_.vx-=i*a,_.vy-=s*a,_4.flashes.push({type:"particle",duration:100,time:_4.levelTime,size:_4.coinSize/2,color:_Y(),ethereal:!0,x:_.x,y:_.y,vx:-(10*i)+_.vx+(Math.random()-.5)*2,vy:-(10*s)+_.vy+(Math.random()-.5)*2}),r&&void 0!==e.vx&&void 0!==e.vy&&_4.flashes.push({type:"particle",duration:100,time:_4.levelTime,size:_4.coinSize/2,color:_Y(),ethereal:!0,x:e.x,y:e.y,vx:10*i+e.vx+(Math.random()-.5)*2,vy:10*s+e.vy+(Math.random()-.5)*2})}}function _K(){_X("record")&&(null==i?void 0:i.state)==="recording"&&(null==i||i.pause())}function _$(){_X("record")&&i&&(null==i||i.stop(),i=null)}function _Q(){try{if(null!==document.fullscreenElement)document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen();else{var _=document.documentElement;_.requestFullscreen?_.requestFullscreen():_.webkitRequestFullscreen&&_.webkitRequestFullscreen()}}catch(_){console.warn(_)}}_E.addEventListener("click",function(_){_.preventDefault(),_I()}),document.addEventListener("visibilitychange",function(){document.hidden&&_o(!0)}),null===(n=document.getElementById("menu"))||void 0===n||n.addEventListener("click",function(_){_.preventDefault(),_j()});var _0={ArrowLeft:0,ArrowRight:0,Shift:0};function _1(_,e){_0[_]=e,_4.keyboardPuckSpeed=(_0.ArrowRight-_0.ArrowLeft)*(1+2*_0.Shift)*_4.gameZoneWidth/50}function _2(_){var e=_x(),t=(null==_?void 0:_.level)?O.filter(function(e){return e.name===(null==_?void 0:_.level)}):[],r=O.filter(function(_){return e>=_.threshold}).filter(function(e){return e.name!==(null==_?void 0:_.level)}).filter(function(e){return e.name!==(null==_?void 0:_.levelToAvoid)}).sort(function(){return Math.random()-.5}),o=t.concat(r.slice(0,10).sort(function(_,e){return _.sortKey-e.sortKey})),n=y({},N(H),(null==_?void 0:_.perks)||{}),i={runLevels:o,currentLevel:0,perks:n,puckWidth:200,baseSpeed:12,combo:1,gridSize:12,running:!1,puckPosition:400,pauseTimeout:null,canvasWidth:0,canvasHeight:0,offsetX:0,offsetXRoundedDown:0,gameZoneWidth:0,gameZoneWidthRoundedUp:0,gameZoneHeight:0,brickWidth:0,needsRender:!0,score:0,lastScoreIncrease:-1e3,lastExplosion:-1e3,highScore:parseFloat(localStorage.getItem("breakout-3-hs")||"0"),balls:[],ballsColor:"white",bricks:[],flashes:[],coins:[],levelStartScore:0,levelMisses:0,levelSpawnedCoins:0,lastPlayedCoinGrab:0,MAX_COINS:400,MAX_PARTICLES:600,puckColor:"#FFF",ballSize:20,coinSize:14,puckHeight:20,totalScoreAtRunStart:e,isCreativeModeRun:U(n)>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,upgrades_picked:1,max_combo:1,max_level:0},lastOffered:{},levelTime:0,autoCleanUses:0};if(Y(i),!U(i.perks)){var s=_g(i).filter(function(_){return _.giftable}),a=_X("easy")&&"slow_down"||s[Math.floor(Math.random()*s.length)].id;n[a]=1,_y(i,a)}var l=!0,c=!1,u=void 0;try{for(var h,d=H[Symbol.iterator]();!(l=(h=d.next()).done);l=!0){var b=h.value;i.perks[b.id]&&_y(i,b.id)}}catch(_){c=!0,u=_}finally{try{l||null==d.return||d.return()}finally{if(c)throw u}}return i}document.addEventListener("keydown",function(_){"f"!==_.key.toLowerCase()||_.ctrlKey||_.metaKey?_.key in _0&&_1(_.key,1):_Q()," "===_.key&&!_A&&(_4.running?_o(!0):_r(),_.preventDefault())}),document.addEventListener("keyup",(e=m(function(_){var e,t,r,o,n;return W(this,function(i){if(n=document.querySelector("button:focus"),_.key in _0)_1(_.key,0);else if("ArrowDown"===_.key&&(null==n?void 0:null===(e=n.nextElementSibling)||void 0===e?void 0:e.tagName)==="BUTTON")null==n||null===(t=n.nextElementSibling)||void 0===t||t.focus();else if("ArrowUp"===_.key&&(null==n?void 0:null===(r=n.previousElementSibling)||void 0===r?void 0:r.tagName)==="BUTTON")null==n||null===(o=n.previousElementSibling)||void 0===o||o.focus();else if("Escape"===_.key&&_Z)_Z();else if("Escape"===_.key&&_4.running)_o(!0);else if("m"!==_.key.toLowerCase()||_A){if("s"!==_.key.toLowerCase()||_A){if("r"!==_.key.toLowerCase()||_A)return[2];_5({levelToAvoid:_m().name})}else _I()}else _j();return _.preventDefault(),[2]})}),function(_){return e.apply(this,arguments)}));var _4=_2({});function _5(_){Object.assign(_4,_2(_)),_K(),_p(0)}_5({}),_s(),function _(){_a();var e=performance.now();if(_4.puckWidth=_4.gameZoneWidth/12*(3-_4.perks.smaller_puck+_4.perks.bigger_puck),_4.keyboardPuckSpeed&&_v(_4.puckPosition+_4.keyboardPuckSpeed),_4.running){_4.levelTime+=e-_4.lastTick,_4.runStatistics.runTime+=e-_4.lastTick,_4.runStatistics.max_combo=Math.max(_4.runStatistics.max_combo,_4.combo);var t,r,o,n,i,u=Math.min(4,(e-_4.lastTick)/(1e3/60));u*=+!!_4.running,_4.coins=_4.coins.filter(function(_){return!_.destroyed}),_4.balls=_4.balls.filter(function(_){return!_.destroyed});var h=_4.bricks.filter(function(_){return _&&"black"!==_}).length;if(_4.levelTime>_4.lastTickDown+1e3&&_4.perks.hot_start&&(_4.lastTickDown=_4.levelTime,t=_4.perks.hot_start,r=_4.puckPosition,o=_4.gameZoneHeight-2*_4.puckHeight,n=_4.combo,_4.combo=Math.max(K(_4),_4.combo-t),(i=Math.max(0,n-_4.combo))&&(A.comboDecrease(),void 0!==r&&void 0!==o&&_4.flashes.push({type:"text",text:"-"+i,time:_4.levelTime,color:"red",x:r,y:o,duration:300,size:_4.puckHeight}))),h<=_4.perks.skip_last&&!_4.autoCleanUses&&(_4.bricks.forEach(function(_,e){_&&_z(e,_4.balls[0],!0)}),_4.autoCleanUses++),h||_4.coins.length){if(_4.running||_4.levelTime){var d=!1,b=Math.round(_4.coinSize/2);if(_4.coins.forEach(function(_){if(!_.destroyed){if(_4.perks.coin_magnet){var e=u*(_4.puckPosition-_.x)/(100+Math.pow(_.y-_4.gameZoneHeight,2)+Math.pow(_.x-_4.puckPosition,2))*_4.perks.coin_magnet*100;_.vx+=e,_.sa-=e/10}var t=1-(.03*_4.perks.viscosity+.005)*u;_.vy*=t,_.vx*=t,_.vx>7*_4.baseSpeed&&(_.vx=7*_4.baseSpeed),_.vx<-7*_4.baseSpeed&&(_.vx=-7*_4.baseSpeed),_.vy>7*_4.baseSpeed&&(_.vy=7*_4.baseSpeed),_.vy<-7*_4.baseSpeed&&(_.vy=-7*_4.baseSpeed),_.a+=_.sa,_.vy+=u*_.weight*.8;var r=Math.abs(_.sx)+Math.abs(_.sx),o=_w(_,_.size/2,u);_.y>_4.gameZoneHeight-b-_4.puckHeight&&_.y<_4.gameZoneHeight+_4.puckHeight+_.vy&&Math.abs(_.x-_4.puckPosition)_4.highScore&&!_4.isCreativeModeRun&&(_4.highScore=_4.score,localStorage.setItem("breakout-3-hs",_4.score.toString())),_X("basic")||_4.flashes.push({type:"particle",duration:100+50*Math.random(),time:_4.levelTime,size:_4.coinSize/2,color:_.color,x:_.previousX,y:_.previousY,vx:(_4.canvasWidth-_.x)/100,vy:-_.y/100,ethereal:!0}),Date.now()-_4.lastPlayedCoinGrab>16&&(_4.lastPlayedCoinGrab=Date.now(),A.coinCatch(_.x)),_4.runStatistics.score+=_.points):_.y>_4.canvasHeight+b&&(_.destroyed=!0,_4.perks.compound_interest&&$(_4,_.x,_.y));var n=function(_){var e,t=_.size/2,r=_.x,o=_.y,n=_.previousX,i=_.previousY,s=_W(n,o,t),a=_W(r,i,t),l=void 0===s&&void 0===a&&_W(r,o,t)||void 0;if(void 0!==s||void 0!==l){_.y=_.previousY,_.vy*=-1;var c=_4.bricks[_f(r-t,o+t)],u=_4.bricks[_f(r+t,o+t)];c&&!u&&(_.vx+=1,_.sa-=1),!c&&u&&(_.vx-=1,_.sa+=1)}return(void 0!==a||void 0!==l)&&(_.x=_.previousX,_.vx*=-1),null!==(e=null!=s?s:a)&&void 0!==e?e:l}(_);_4.perks.metamorphosis&&void 0!==n&&_4.bricks[n]&&_.color!==_4.bricks[n]&&"black"!==_4.bricks[n]&&!_.coloredABrick&&(_4.bricks[n]=_.color,_.coloredABrick=!0,A.colorChange(_.x,.3)),(void 0!==n||o)&&(_.vx*=.8,_.vy*=.8,_.sa*=.9,r>20&&!d&&(d=!0,A.coinBounce(_.x,.2)),3>Math.abs(_.vy)&&(_.vy=0))}}),_4.balls.forEach(function(_){return function(_,e){_.previousVX=_.vx,_.previousVY=_.vy;var t,r,o=1+_4.perks.telekinesis+_4.perks.ball_repulse_ball+_4.perks.puck_repulse_ball+_4.perks.ball_attract_ball;_S(_)&&(o+=3,_.vx+=(_4.puckPosition-_.x)/1e3*e*_4.perks.telekinesis),_.vx*_.vx+_.vy*_.vy<_4.baseSpeed*_4.baseSpeed*2?(_.vx*=1+.02/o,_.vy*=1+.02/o):(_.vx*=1-.02/o,_.vy*=1-.02/o),Math.abs(_.vy)<.2*_4.baseSpeed&&(_.vy+=(_.vy>0?1:-1)*.02/o);var n=!0,i=!1,s=void 0;if(_4.perks.ball_repulse_ball)try{for(var a,l,c,u=_4.balls[Symbol.iterator]();!(n=(c=u.next()).done);n=!0){var h=c.value;h.x>=_.x||_J(_,h,_4.perks.ball_repulse_ball,!0)}}catch(_){i=!0,s=_}finally{try{n||null==u.return||u.return()}finally{if(i)throw s}}var d=!0,b=!1,p=void 0;if(_4.perks.ball_attract_ball)try{for(var m,g=_4.balls[Symbol.iterator]();!(d=(m=g.next()).done);d=!0){var y=m.value;y.x>=_.x||function(_,e,t){var r=_N(_,e),o=.5*_4.gameZoneWidth;if(!(r1&&!_X("basic"))for(var v=0;v<(null===(l=_.hitItem)||void 0===l?void 0:l.length)-1&&v<_4.perks.respawn;v++){var f=_.hitItem[v],k=f.index,W=f.color;if(!_4.bricks[k]&&"black"!==W){var w=Math.random()>.5,S=Math.random()>.5?1:-1,x=Math.random()>.5?1:-1;_4.flashes.push({type:"particle",duration:250,ethereal:!0,time:_4.levelTime,size:_4.coinSize/2,color:W,x:_l(k)+S*_4.brickWidth/2,y:_c(k)+x*_4.brickWidth/2,vx:w?0:-S*_4.baseSpeed,vy:w?-x*_4.baseSpeed:0})}}var M=_w(_,_4.ballSize/2,e);M&&(_4.perks.left_is_lava&&M%2&&_.x<_4.offsetX+_4.gameZoneWidth/2&&$(_4,_.x,_.y),_4.perks.right_is_lava&&M%2&&_.x>_4.offsetX+_4.gameZoneWidth/2&&$(_4,_.x,_.y),_4.perks.top_is_lava&&M>=2&&$(_4,_.x,_.y+_4.ballSize),A.wallBeep(_.x),null===(t=_.bouncesList)||void 0===t||t.push({x:_.previousX,y:_.previousY}));var z=_4.gameZoneHeight-_4.puckHeight-_4.ballSize/2,R=Math.abs(_.x-_4.puckPosition)<_4.ballSize/2+_4.puckWidth/2;if(_.y>z&&_.vy>0&&(R||_4.perks.extra_life&&_.y>z+_4.puckHeight/2)){if(R){var B=Math.sqrt(_.vx*_.vx+_.vy*_.vy),G=Math.atan2(-_4.puckWidth/2,_.x-_4.puckPosition);_.vx=B*Math.cos(G),_.vy=B*Math.sin(G),A.wallBeep(_.x)}else if(_.vy*=-1,_4.perks.extra_life=Math.max(0,_4.perks.extra_life-1),A.lifeLost(_.x),!_X("basic"))for(var L=0;L<10;L++)_4.flashes.push({type:"particle",ethereal:!1,color:"red",destroyed:!1,duration:150,size:_4.coinSize/2,time:_4.levelTime,x:_.x,y:_.y,vx:Math.random()*_4.baseSpeed*3,vy:3*_4.baseSpeed});_4.perks.streak_shots&&$(_4,_.x,_.y),_4.perks.respawn&&_.hitItem.slice(0,-1).slice(0,_4.perks.respawn).forEach(function(_){var e=_.index,t=_.color;_4.bricks[e]||"black"===t||(_4.bricks[e]=t)}),_.hitItem=[],_.hitSinceBounce||(_4.runStatistics.misses++,_4.levelMisses++,$(_4,_.x,_.y),_4.flashes.push({type:"text",text:"miss",duration:500,time:_4.levelTime,size:1.5*_4.puckHeight,color:"red",x:_4.puckPosition,y:_4.gameZoneHeight-2*_4.puckHeight})),_4.runStatistics.puck_bounces++,_.hitSinceBounce=0,_.sapperUses=0,_.piercedSinceBounce=0,_.bouncesList=[{x:_.previousX,y:_.previousY}]}_.y>_4.gameZoneHeight+_4.ballSize/2&&_4.running&&(_.destroyed=!0,_4.runStatistics.balls_lost++,_4.balls.find(function(_){return!_.destroyed})||_M("Game Over","You dropped the ball after catching "+_4.score+" coins. "));var P=_4.ballSize/2,T=_.x,C=_.y,O=_.previousX,H=_.previousY,E=_W(O,C,P),Z=_W(T,H,P),D=void 0===E&&void 0===Z&&_W(T,C,P)||void 0,q=null!==(r=null!=E?E:Z)&&void 0!==r?r:D,X=q&&"black"!==_4.bricks[q]&&_4.perks.sturdy_bricks&&_4.perks.sturdy_bricks>5*Math.random(),I=!1;if(X||void 0===q||((_4.perks.pierce_color&&(void 0===E||_4.bricks[E]===_4.ballsColor)&&(void 0===Z||_4.bricks[Z]===_4.ballsColor)&&(void 0===D||_4.bricks[D]===_4.ballsColor)?0:1)?_.piercedSinceBounce<3*_4.perks.pierce&&(I=!0,_.piercedSinceBounce++):I=!0),void 0===E&&void 0===D||I||(_.y=_.previousY,_.vy*=-1),void 0===Z&&void 0===D||I||(_.x=_.previousX,_.vx*=-1),X){A.wallBeep(T);return}if(void 0!==q){var V=_4.bricks[q];_z(q,_,!1),_.sapperUses<_4.perks.sapper&&"black"!==V&&!_4.bricks[q]&&(_4.bricks[q]="black",_.sapperUses++)}!_X("basic")&&(_.sparks+=e*(_4.combo-1)/30,_.sparks>1&&(_4.flashes.push({type:"particle",duration:100*_.sparks,time:_4.levelTime,size:_4.coinSize/2,color:_4.ballsColor,x:_.x,y:_.y,vx:(Math.random()-.5)*_4.baseSpeed,vy:(Math.random()-.5)*_4.baseSpeed,ethereal:!1}),_.sparks=0))}(_,u)}),_4.perks.wind)for(var p=(_4.puckPosition-(_4.offsetX+_4.gameZoneWidth/2))/_4.gameZoneWidth*2*_4.perks.wind,m=0;m<_4.perks.wind;m++)Math.random()*Math.abs(p)>.5&&_4.flashes.push({type:"particle",duration:150,ethereal:!0,time:_4.levelTime,size:_4.coinSize/2,color:_Y(),x:_4.offsetXRoundedDown+Math.random()*_4.gameZoneWidthRoundedUp,y:Math.random()*_4.gameZoneHeight,vx:8*p,vy:0});_4.flashes.forEach(function(_){"particle"===_.type&&(_.x+=_.vx*u,_.y+=_.vy*u,!_.ethereal&&(_.vy+=.5,_k(_f(_.x,_.y))&&(_.destroyed=!0)))})}}else _4.currentLevel+1<_R()?_p(_4.currentLevel+1):_M("Run finished ","You cleared all levels for this run, catching ".concat(_4.score," coins in total."));if(_4.combo>K(_4)){var g=!_X("basic")&&(_4.combo-K(_4))*Math.random()>5&&_4.running&&{type:"particle",duration:100*(Math.random()+1),time:_4.levelTime,size:_4.coinSize/2,color:"red",ethereal:!0};if(_4.perks.top_is_lava&&g&&_4.flashes.push(v(y({},g),{x:_4.offsetXRoundedDown+Math.random()*_4.gameZoneWidthRoundedUp,y:0,vx:(Math.random()-.5)*10,vy:5})),_4.perks.left_is_lava&&g&&_4.flashes.push(v(y({},g),{x:_4.offsetXRoundedDown,y:Math.random()*_4.gameZoneHeight,vx:5,vy:(Math.random()-.5)*10})),_4.perks.right_is_lava&&g&&_4.flashes.push(v(y({},g),{x:_4.offsetXRoundedDown+_4.gameZoneWidthRoundedUp,y:Math.random()*_4.gameZoneHeight,vx:-5,vy:(Math.random()-.5)*10})),_4.perks.compound_interest){var f=_4.puckPosition,k=0;do f=_4.offsetXRoundedDown+_4.gameZoneWidthRoundedUp*Math.random(),k++;while(Math.abs(f-_4.puckPosition)<_4.puckWidth/2&&k<10)g&&_4.flashes.push(v(y({},g),{x:f,y:_4.gameZoneHeight,vx:(Math.random()-.5)*10,vy:-5}))}if(_4.perks.streak_shots){var W=.5-Math.random();g&&_4.flashes.push(v(y({},g),{duration:100,x:_4.puckPosition+_4.puckWidth*W,y:_4.gameZoneHeight-_4.puckHeight,vx:10*W,vy:-5}))}}}(function(){if(_4.running&&(_4.needsRender=!0),_4.needsRender){_4.needsRender=!1;var _=_m(),e=__.width,t=__.height;if(e&&t){if(_E.innerText="L".concat(_4.currentLevel+1,"/").concat(_R()," $").concat(_4.score),Object.assign(_E.style,_4.lastScoreIncrease<_4.levelTime-30?{color:"gold",fontWeight:"bold",opacity:1}:{opacity:.5,fontWeight:"normal",color:"white"}),_X("basic")||_.color||!_.svg)_e.globalAlpha=1,_e.globalCompositeOperation="source-over",_e.fillStyle=_.color||"#000",_e.fillRect(0,0,e,t),_4.flashes.forEach(function(_){var e=_.x,t=_.y,r=_.time,o=_.color,n=_.size,i=_.type,s=_.duration;_e.globalAlpha=Math.min(1,2-(_4.levelTime-r)/s*2),"particle"===i&&_T(_e,o,n,e,t)});else if(_e.globalCompositeOperation="source-over",_e.globalAlpha=1,_e.fillStyle="#000",_e.fillRect(0,0,e,t),_e.globalCompositeOperation="screen",_e.globalAlpha=.6,_4.coins.forEach(function(_){_.destroyed||_O(_e,_.color,2*_4.coinSize,_.x,_.y)}),_4.balls.forEach(function(_){_O(_e,_4.ballsColor,2*_4.ballSize,_.x,_.y)}),_e.globalAlpha=.5,_4.bricks.forEach(function(_,e){if(_){var t=_l(e),r=_c(e);_O(_e,"black"==_?"#666":_,_4.brickWidth,t,r)}}),_e.globalAlpha=1,_4.flashes.forEach(function(_){var e=_.x,t=_.y,r=_.time,o=_.color,n=_.size,i=_.type,s=_.duration;_e.globalAlpha=Math.min(1,2-(_4.levelTime-r)/s*2),"ball"===i&&_O(_e,o,n,e,t),"particle"===i&&_O(_e,o,3*n,e,t)}),_e.globalAlpha=.2,_e.globalCompositeOperation="multiply",_e.fillStyle="black",_e.fillRect(0,0,e,t),_e.globalAlpha=.8,_e.globalCompositeOperation="multiply",_.svg&&_n.width&&_n.complete){if(_i.title!==_.name){_i.title=_.name,_i.width=_4.canvasWidth,_i.height=_4.canvasHeight;var r=_i.getContext("2d");r.fillStyle=_.color||"#000",r.fillRect(0,0,_4.canvasWidth,_4.canvasHeight);var o=_e.createPattern(_n,"repeat");o&&(r.fillStyle=o,r.fillRect(0,0,e,t))}_e.drawImage(_i,0,0)}else _e.fillStyle="#000",_e.fillRect(0,0,e,t);_e.globalAlpha=1,_e.globalCompositeOperation="source-over";var n=Date.now()-_4.lastExplosion+5,i=n<200;if(i){var u=(_4.perks.bigger_explosions+1)*50/n;_e.translate(Math.sin(Date.now())*u,Math.sin(Date.now()+36)*u)}if(_e.globalAlpha=1,_4.coins.forEach(function(e){e.destroyed||(_e.globalCompositeOperation="gold"===e.color||_.color?"source-over":"screen",_C(_e,e.color,e.size,e.x,e.y,_.color||"black",e.a))}),_X("basic")||(_e.globalCompositeOperation="source-over",_e.globalAlpha=Math.min(.8,_4.coins.length/20),_4.balls.forEach(function(e){_T(_e,_.color||"#000",6*_4.ballSize,e.x,e.y)})),_e.globalCompositeOperation="source-over",function(){_e.globalAlpha=1;var _=_4.combo>K(_4)&&_4.perks.picky_eater,e=_4.gameZoneWidth+"_"+_4.bricks.join("_")+_t.complete+"_"+_+"_"+_4.ballsColor+"_"+_4.perks.pierce_color;if(e!==_G){_G=e,_B.width=_4.gameZoneWidth,_B.height=_4.gameZoneWidth+1;var t=_B.getContext("2d");t.clearRect(0,0,_4.gameZoneWidth,_4.gameZoneWidth),t.resetTransform(),t.translate(-_4.offsetX,0),_4.bricks.forEach(function(e,r){var o=_l(r),n=_c(r);if(e){var i=_4.ballsColor!==e&&"black"!==e&&_&&"red"||e;(function(_,e,t,r,o){var n=Math.ceil(r-_4.brickWidth/2),i=Math.ceil(o-_4.brickWidth/2),s=Math.ceil(r+_4.brickWidth/2)-1,a=Math.ceil(o+_4.brickWidth/2)-1,l=s-n,c=a-i,u="brick"+e+"_"+t+"_"+l+"_"+c;if(!_L[u]){var h,d,b,p,m,g,y=document.createElement("canvas");y.width=l,y.height=c;var v=y.getContext("2d");v.fillStyle=e,v.strokeStyle=t,v.lineJoin="round",v.lineWidth=2,h=v,d=1,b=1,p=l-2,m=c-2,g=2,h.beginPath(),h.moveTo(3,1),h.lineTo(d+p-g,b),h.quadraticCurveTo(d+p,b,d+p,b+g),h.lineTo(d+p,b+m-g),h.quadraticCurveTo(d+p,b+m,d+p-g,b+m),h.lineTo(d+g,b+m),h.quadraticCurveTo(d,b+m,d,b+m-g),h.lineTo(d,b+g),h.quadraticCurveTo(d,b,d+g,b),h.closePath(),v.fill(),v.stroke(),_L[u]=y}_.drawImage(_L[u],n,i,l,c)})(t,e,i,o,n),"black"===e&&(t.globalCompositeOperation="source-over",function(_,e,t,r,o){var n="svg"+e+"_"+t+"_"+e.complete;if(!_L[n]){var i=document.createElement("canvas");i.width=t,i.height=t;var s=i.getContext("2d"),a=t/Math.max(e.width,e.height),l=e.width*a,c=e.height*a;s.drawImage(e,(t-l)/2,(t-c)/2,l,c),_L[n]=i}_.drawImage(_L[n],Math.round(r-t/2),Math.round(o-t/2))}(t,_t,_4.brickWidth,o,n))}})}_e.drawImage(_B,_4.offsetX,0)}(),_e.globalCompositeOperation="screen",_4.flashes=_4.flashes.filter(function(_){return _4.levelTime-_.time<_.duration&&!_.destroyed}),_4.flashes.forEach(function(_){var e=_.x,t=_.y,r=_.time,o=_.color,n=_.size,i=_.type,s=_.duration,a=_4.levelTime-r;_e.globalAlpha=Math.max(0,Math.min(1,2-a/s*2)),"text"===i?(_e.globalCompositeOperation="source-over",_H(_e,_.text,o,n,e,t-a/10)):"particle"===i&&(_e.globalCompositeOperation="screen",_T(_e,o,n,e,t),_O(_e,o,n,e,t))}),_4.perks.extra_life){_e.globalAlpha=1,_e.globalCompositeOperation="source-over",_e.fillStyle=_4.puckColor;for(var h=0;h<_4.perks.extra_life;h++)_e.fillRect(_4.offsetXRoundedDown,_4.gameZoneHeight-_4.puckHeight/2+2*h,_4.gameZoneWidthRoundedUp,1)}if(_e.globalAlpha=1,_e.globalCompositeOperation="source-over",_4.balls.forEach(function(_){_T(_e,_4.ballsColor,_4.ballSize,_.x,_.y,_4.puckColor),_S(_)&&(_e.strokeStyle=_4.puckColor,_e.beginPath(),_e.bezierCurveTo(_4.puckPosition,_4.gameZoneHeight,_4.puckPosition,_.y,_.x,_.y),_e.stroke())}),_e.globalAlpha=1,_e.globalCompositeOperation="source-over",_4.perks.streak_shots&&_4.combo>K(_4)&&_P(_e,"red",_4.puckWidth,_4.puckHeight,-2),_P(_e,_4.puckColor,_4.puckWidth,_4.puckHeight),_4.combo>1){_e.globalCompositeOperation="source-over";var d="x "+_4.combo,b=d.length*_4.puckHeight/1.8+2*_4.coinSize,p=_4.puckPosition-b/2;b<_4.puckWidth?(_C(_e,"gold",_4.coinSize,p+_4.coinSize/2,_4.gameZoneHeight-_4.puckHeight/2,_4.puckColor,0),_H(_e,d,"#000",_4.puckHeight,p+1.5*_4.coinSize,_4.gameZoneHeight-_4.puckHeight/2,!0)):_H(_e,d,"#FFF",_4.puckHeight,_4.puckPosition,_4.gameZoneHeight-_4.puckHeight/2,!1)}var m=_4.combo>K(_4);_e.globalCompositeOperation="source-over",_4.offsetXRoundedDown?(_e.fillStyle=m&&_4.perks.left_is_lava?"red":_4.puckColor,_e.fillRect(_4.offsetX-1,0,1,t),_e.fillStyle=m&&_4.perks.right_is_lava?"red":_4.puckColor,_e.fillRect(e-_4.offsetX+1,0,1,t)):(_e.fillStyle="red",m&&_4.perks.left_is_lava&&_e.fillRect(0,0,1,t),m&&_4.perks.right_is_lava&&_e.fillRect(e-1,0,1,t)),_4.perks.top_is_lava&&_4.combo>K(_4)&&(_e.fillStyle="red",_e.fillRect(_4.offsetXRoundedDown,0,_4.gameZoneWidthRoundedUp,1));var g=_4.perks.compound_interest&&_4.combo>K(_4);_e.fillStyle=g?"red":_4.puckColor,_X("mobile-mode")?(_e.fillRect(_4.offsetXRoundedDown,_4.gameZoneHeight,_4.gameZoneWidthRoundedUp,1),_4.running||_H(_e,"Press and hold here to play",_4.puckColor,_4.puckHeight,_4.canvasWidth/2,_4.gameZoneHeight+(_4.canvasHeight-_4.gameZoneHeight)/2)):g&&_e.fillRect(_4.offsetXRoundedDown,_4.gameZoneHeight-1,_4.gameZoneWidthRoundedUp,1),i&&_e.resetTransform(),_X("record")&&_4.running&&s&&(c&&(c.drawImage(__,_4.offsetXRoundedDown,0,_4.gameZoneWidthRoundedUp,_4.gameZoneHeight,0,0,l.width,l.height),c.fillStyle="#FFF",c.textBaseline="top",c.font="12px monospace",c.textAlign="right",c.fillText(_4.score.toString(),l.width-12,12),c.textAlign="left",c.fillText("Level "+(_4.currentLevel+1)+"/"+_R(),12,12)),(null==a?void 0:a.requestFrame)?null==a||a.requestFrame():(null==s?void 0:s.requestFrame)&&s.requestFrame())}}})(),requestAnimationFrame(_),_4.lastTick=e}()}();