Файловый менеджер - Редактировать - /home/jogoso94/public_html/jogos/endless_siege/dist/bundle.js
�азад
!function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=20)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){}return t.areValidDomains=function(t){if(0===t.length)return!0;for(var e=window.location.hostname,i=document.referrer,n=!1,s=0;s<t.length;s++)if(-1!==e.indexOf(t[s])){n=!0;break}if(i){n=!1;for(s=0;s<t.length;s++)if(-1!==i.indexOf(t[s])){n=!0;break}}return n},t.fixNumber=function(t){return isNaN(t)?0:Math.round(1e5*t)/1e5},t.formatTime=function(t){if(isNaN(t)||t>86400)return{str:"0:00:00",h:"00",m:"00",s:"00"};var e=Math.floor(t/3600),i=Math.floor((t-3600*e)/60),n=t-3600*e-60*i,s=e.toString(),r=i.toString(),a=n.toString();return e<10&&(s="0"+e),i<10&&(r="0"+i),n<10&&(a="0"+n),{str:s+":"+r+":"+a,h:s,m:r,s:a}},t.formatNumber=function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},t.getDate=function(){var e,i=new Date,n=i.getDate();switch(i.getDay()){case 0:e=t.gameText[t.gameData.language].SUNDAY;break;case 1:e=t.gameText[t.gameData.language].MONDAY;break;case 2:e=t.gameText[t.gameData.language].TUESDAY;break;case 3:e=t.gameText[t.gameData.language].WEDNESDAY;break;case 4:e=t.gameText[t.gameData.language].THURSDAY;break;case 5:e=t.gameText[t.gameData.language].FRIDAY;break;case 6:e=t.gameText[t.gameData.language].SATURDAY}return e+" "+(n%10==1?n+"st":n%10==2?n+"nd":n%10==3?n+"rd":n+"th")},t}();e.GameVars=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),i(13);var n=i(0),s=i(7),r=function(){function t(){}return t.init=function(){GAMESNACKS.subscribeToAudioUpdates((function(e){t.sound.mute(!e),n.GameVars.gameData.soundMuted=!e,t.music.mute(!e),n.GameVars.gameData.musicMuted=!e,s.GameManager.writeGameData()})),t.sound.mute(!GAMESNACKS.isAudioEnabled()),t.music.mute(!GAMESNACKS.isAudioEnabled()),t.backgroundMusicID=null,t.backgroundMusicKey=null},t.toggleSoundState=function(){n.GameVars.gameData.soundMuted=!n.GameVars.gameData.soundMuted,s.GameManager.writeGameData(),t.sound.mute(n.GameVars.gameData.soundMuted)},t.toggleMusicState=function(){n.GameVars.gameData.musicMuted=!n.GameVars.gameData.musicMuted,s.GameManager.writeGameData(),t.music.mute(n.GameVars.gameData.musicMuted)},t.playSoundEffect=function(e,i,n,s){i=i||!1,n?n*=t.GLOBAL_AUDIO_TEMPORARY_FACTOR:n=t.GLOBAL_AUDIO_TEMPORARY_FACTOR,s=s||1;var r=t.sound.play(e);t.sound.loop(i,r),t.sound.rate(s,r),t.sound.volume(n,r)},t.playMusic=function(e,i,n){t.backgroundMusicKey!==e&&(t.backgroundMusicID&&t.stopMusic(),n?n*=t.GLOBAL_AUDIO_TEMPORARY_FACTOR:n=t.GLOBAL_AUDIO_TEMPORARY_FACTOR,t.backgroundMusicKey=e,t.backgroundMusicID=t.music.play(e),t.music.fade(0,n,1e3,t.backgroundMusicID),t.music.loop(!0,t.backgroundMusicID))},t.stopMusic=function(){t.music.fade(t.music.volume(t.backgroundMusicID),0,1e3,t.backgroundMusicID)},t.setMusicRate=function(e){t.music.rate(e,t.backgroundMusicID)},t.setMusicVolume=function(e){t.music.volume(e,t.backgroundMusicID)},t.GLOBAL_AUDIO_TEMPORARY_FACTOR=.5,t}();e.AudioManager=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){}return t.VERSION="0.0",t.DEVELOPMENT=!1,t.SHOW_DEBUG_GEOMETRY=!1,t.INTERPOLATE_TRAJECTORIES=!0,t.VERBOSE=!1,t.GAME_WIDTH=768,t.GAME_HEIGHT=1024,t.LEADERBOARD_ENABLED=!1,t.SPONSOR_NONE="none",t.SPONSOR=t.SPONSOR_NONE,t.TIME_STEP=100,t.ENEMY_SPAWNING_DELTA_TICKS=10,t.INITIAL_CREDITS=500,t.INITIAL_LIFES=20,t.CELLS_SIZE=60,t.ENEMY_FRAMERATE=18,t.LANGUAGE_ENGLISH="en",t.IMPACT_ARROW="impact arrow",t.IMPACT_MORTAR="impact mortar",t.IMPACT_MINE="impact mine",t.IMPACT_FIRE="impact fire",t.IMPACT_ELECTRIC="impact electric",t.IMPACT_FIRE_ELECTRIC="impact fire electric",t.TYPE_ADD_TURRET="add turret",t.TYPE_SELL_TURRET="sell turret",t.TYPE_UPGRADE_TURRET="upgrade turret",t.TYPE_LEVEL_UP_TURRET="level up turret",t.TYPE_CHANGE_STRATEGY_TURRET="change strategy turret",t.TYPE_CHANGE_FIXED_TARGET_TURRET="change fixed target turret",t.TYPE_NEXT_WAVE="next wave",t.SAVED_GAME_DATA_KEY="endless-siege-data",t}();e.GameConstants=n},function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var r=i(6),a=i(2),o=i(0),h=i(9),u=n(i(43)),c=n(i(44)),l=n(i(45)),d=s(i(4)),p=i(8),f=i(7),m=function(){function t(){}return t.init=function(){var e;window.innerHeight/window.innerWidth>1.5&&(o.GameVars.currentMapData.size.c>11?o.GameVars.scaleCorrectionFactor=1:o.GameVars.currentMapData.size.c>10?o.GameVars.scaleCorrectionFactor=1.1:o.GameVars.scaleCorrectionFactor=1.2),o.GameVars.currentScene===r.BattleScene.currentInstance?(o.GameVars.enemiesPathCells=o.GameVars.currentMapData.path,o.GameVars.plateausCells=o.GameVars.currentMapData.plateaus,o.GameVars.enemiesData=u.default.enemies,o.GameVars.turretsData=c.default.turrets,o.GameVars.wavesData=l.default.waves,e={timeStep:a.GameConstants.TIME_STEP,runningInClientSide:!0,enemySpawningDeltaTicks:a.GameConstants.ENEMY_SPAWNING_DELTA_TICKS,credits:a.GameConstants.DEVELOPMENT?5e5:a.GameConstants.INITIAL_CREDITS,lifes:a.GameConstants.INITIAL_LIFES,boardSize:o.GameVars.currentMapData.size,enemiesPathCells:o.GameVars.enemiesPathCells,plateausCells:o.GameVars.plateausCells},o.GameVars.logsObject={actions:[]}):(o.GameVars.enemiesPathCells=o.GameVars.levelObject.gameConfig.enemiesPathCells,o.GameVars.plateausCells=o.GameVars.levelObject.gameConfig.plateausCells,o.GameVars.enemiesData=o.GameVars.levelObject.enemiesData,o.GameVars.turretsData=o.GameVars.levelObject.turretsData,o.GameVars.wavesData=o.GameVars.levelObject.wavesData,e=o.GameVars.levelObject.gameConfig),o.GameVars.currentScene!==r.BattleScene.currentInstance&&o.GameVars.timeStepFactor||(o.GameVars.timeStepFactor=1),o.GameVars.paused=!1,o.GameVars.semiPaused=!1,o.GameVars.waveOver=!0,o.GameVars.autoSendWave=!1,o.GameVars.loopNumber=1,o.GameVars.loopRate=1,o.GameVars.loopVolume=.2,o.GameVars.dangerRate=1,o.GameVars.gameOver=!1,t.engine=new d.Engine(e,o.GameVars.enemiesData,o.GameVars.turretsData,o.GameVars.wavesData),t.setTimeStepFactor(o.GameVars.timeStepFactor),o.GameVars.currentScene===r.BattleScene.currentInstance&&(o.GameVars.levelObject={engineVersion:t.engine.version,gameConfig:e,enemiesData:o.GameVars.enemiesData,turretsData:o.GameVars.turretsData,wavesData:o.GameVars.wavesData}),t.engine.addEventListener(d.Event.ENEMY_SPAWNED,t.onEnemySpawned,t),t.engine.addEventListener(d.Event.ENEMY_REACHED_EXIT,t.onEnemyReachedExit,t),t.engine.addEventListener(d.Event.BULLET_SHOT,t.onBulletShot,t),t.engine.addEventListener(d.Event.GLUE_BULLET_SHOT,t.onGlueBulletShot,t),t.engine.addEventListener(d.Event.ENEMY_HIT,t.onEnemyHit,t),t.engine.addEventListener(d.Event.REMOVE_BULLET,t.removeBullet,t),t.engine.addEventListener(d.Event.REMOVE_GLUE_BULLET,t.removeGlueBullet,t),t.engine.addEventListener(d.Event.ENEMY_GLUE_HIT,t.onEnemyGlueHit,t),t.engine.addEventListener(d.Event.ENEMY_KILLED,t.onEnemyKilled,t),t.engine.addEventListener(d.Event.LASER_SHOT,t.onLaserBeamShot,t),t.engine.addEventListener(d.Event.MORTAR_SHOT,t.onMortarShot,t),t.engine.addEventListener(d.Event.GLUE_SHOT,t.onGlueShot,t),t.engine.addEventListener(d.Event.MINE_SHOT,t.onMineShot,t),t.engine.addEventListener(d.Event.GLUE_CONSUMED,t.onGlueConsumed,t),t.engine.addEventListener(d.Event.ENEMIES_TELEPORTED,t.onEnemiesTeleported,t),t.engine.addEventListener(d.Event.NO_ENEMIES_ON_STAGE,t.onNoEnemiesOnStage,t),t.engine.addEventListener(d.Event.WAVE_OVER,t.onWaveOver,t),t.engine.addEventListener(d.Event.GAME_OVER,t.onGameOver,t),t.engine.addEventListener(d.Event.ACTIVE_NEXT_WAVE,t.onNextWaveActive,t)},t.update=function(e,i){t.engine.update()},t.pause=function(){o.GameVars.semiPaused||o.GameVars.currentScene.anims.pauseAll(),o.GameVars.paused=!0},t.resume=function(){o.GameVars.semiPaused||o.GameVars.currentScene.anims.resumeAll(),o.GameVars.paused=!1},t.semiPause=function(){o.GameVars.currentScene.anims.pauseAll(),o.GameVars.semiPaused=!0,r.BattleScene.currentInstance.semiPause()},t.semiResume=function(){o.GameVars.currentScene.anims.resumeAll(),o.GameVars.semiPaused=!1,r.BattleScene.currentInstance.semiResume()},t.setTimeStepFactor=function(e){o.GameVars.timeStepFactor=e,t.engine.timeStep=a.GameConstants.TIME_STEP/e},t.newWave=function(){var e=t.engine.newWave();if(null!==e){o.GameVars.waveOver=!1,r.BattleScene.currentInstance.newWave(e);var i={type:a.GameConstants.TYPE_NEXT_WAVE,tick:t.engine.ticksCounter};t.addAction(i)}return e},t.createTurret=function(t){o.GameVars.currentScene===r.BattleScene.currentInstance&&r.BattleScene.currentInstance.createTurret(t)},t.addTurretToScene=function(t,e){h.BoardContainer.currentInstance.addTurret(t,e)},t.addTurret=function(e,i){var n=t.engine.addTurret(e,i);if(n.turret){var s={type:a.GameConstants.TYPE_ADD_TURRET,tick:t.engine.ticksCounter,turretType:n.turret.type,position:i};t.addAction(s)}return n.turret},t.sellTurret=function(e){if(t.engine.sellTurret(e).success){var i={type:a.GameConstants.TYPE_SELL_TURRET,tick:t.engine.ticksCounter,id:e};t.addAction(i),h.BoardContainer.currentInstance.onTurretSold(e)}},t.onClickMenu=function(){!o.GameVars.paused&&!o.GameVars.gameOver&&o.GameVars.gameData.tutorialSeen&&h.BoardContainer.currentInstance&&h.BoardContainer.currentInstance.showPauseMenu()},t.setAutoSendWave=function(t){o.GameVars.autoSendWave=t},t.improveTurret=function(e){if(t.engine.improveTurret(e).success){var i={type:a.GameConstants.TYPE_LEVEL_UP_TURRET,tick:t.engine.ticksCounter,id:e};t.addAction(i),h.BoardContainer.currentInstance.improveTurret(e)}},t.upgradeTower=function(e){if(t.engine.upgradeTurret(e).success){var i={type:a.GameConstants.TYPE_UPGRADE_TURRET,tick:t.engine.ticksCounter,id:e};t.addAction(i),h.BoardContainer.currentInstance.upgradeTurret(e),o.GameVars.currentScene===r.BattleScene.currentInstance&&r.BattleScene.currentInstance.updateTurretMenu()}},t.setNextStrategy=function(e){if(t.engine.setNextStrategy(e).success){var i={type:a.GameConstants.TYPE_CHANGE_STRATEGY_TURRET,tick:t.engine.ticksCounter,id:e};t.addAction(i)}},t.setFixedTarget=function(e){if(t.engine.setFixedTarget(e).success){var i={type:a.GameConstants.TYPE_CHANGE_FIXED_TARGET_TURRET,tick:t.engine.ticksCounter,id:e};t.addAction(i)}},t.createRangeCircle=function(t,e,i){return h.BoardContainer.currentInstance.createRangeCircle(t,e,i)},t.hideRangeCircles=function(){h.BoardContainer.currentInstance.hideRangeCircles()},t.showTurretMenu=function(t){r.BattleScene.currentInstance.showTurretMenu(t)},t.hideTurretMenu=function(){r.BattleScene.currentInstance.hideTurretMenu()},t.setTurretPrePosition=function(t,e){h.BoardContainer.currentInstance.setTurretPrePosition(t,e)},t.addAction=function(t){o.GameVars.logsObject.actions.push(t)},t.onEnemySpawned=function(t,e){h.BoardContainer.currentInstance.addEnemy(t,e)},t.onEnemyReachedExit=function(e){h.BoardContainer.currentInstance.removeEnemy(e.id),t.engine.gameOver||(o.GameVars.dangerRate=Math.max(o.GameVars.dangerRate-.0125,.75),r.BattleScene.currentInstance.onEnemyReachedExit()),r.BattleScene.currentInstance.hud.updateLifes()},t.onBulletShot=function(t,e){h.BoardContainer.currentInstance.addBullet(t,e)},t.onGlueBulletShot=function(t,e){h.BoardContainer.currentInstance.addGlueBullet(t,e)},t.onLaserBeamShot=function(t,e){h.BoardContainer.currentInstance.addLaserBeam(t,e)},t.onMortarShot=function(t,e){h.BoardContainer.currentInstance.addMortar(t,e)},t.onGlueShot=function(t,e){h.BoardContainer.currentInstance.addGlue(t,e)},t.onMineShot=function(t,e){h.BoardContainer.currentInstance.addMine(t,e)},t.onGlueConsumed=function(t){h.BoardContainer.currentInstance.onGlueConsumed(t)},t.onEnemyHit=function(t,e,i,n,s,r){var o=null;s&&r?o=a.GameConstants.IMPACT_FIRE_ELECTRIC:e?o=a.GameConstants.IMPACT_ARROW:i?o=a.GameConstants.IMPACT_MORTAR:n?o=a.GameConstants.IMPACT_MINE:s?o=a.GameConstants.IMPACT_FIRE:r&&(o=a.GameConstants.IMPACT_ELECTRIC);for(var u=0;u<t.length;u++)h.BoardContainer.currentInstance.onEnemyHit(t[u],o);e&&h.BoardContainer.currentInstance.removeBullet(e),i&&h.BoardContainer.currentInstance.detonateMortar(i),n&&h.BoardContainer.currentInstance.detonateMine(n)},t.removeBullet=function(t){h.BoardContainer.currentInstance.removeBullet(t)},t.removeGlueBullet=function(t){h.BoardContainer.currentInstance.removeGlueBullet(t)},t.onEnemyGlueHit=function(t,e){for(var i=0;i<t.length;i++)h.BoardContainer.currentInstance.onEnemyGlueHit(t[i]);e&&h.BoardContainer.currentInstance.removeGlueBullet(e)},t.onEnemiesTeleported=function(t){for(var e=0;e<t.length;e++)h.BoardContainer.currentInstance.teleportEnemy(t[e].enemy,t[e].glueTurret)},t.onEnemyKilled=function(e){h.BoardContainer.currentInstance.onEnemyKilled(e),o.GameVars.gameData.tutorialSeen||p.TutorialManager.isFirstEnemyKilled||p.TutorialManager.onFirstEnemyKilled(),setTimeout((function(){GAMESNACKS.sendScore(t.engine.score)}),100)},t.onNoEnemiesOnStage=function(){GAMESNACKS.levelComplete(t.engine.round),t.engine.gameOver||h.BoardContainer.currentInstance.showRoundCompletedLayer()},t.onWaveOver=function(){o.GameVars.autoSendWave?r.BattleScene.currentInstance.gui.onClickNextWave():o.GameVars.waveOver=!0},t.onNextWaveActive=function(){o.GameVars.currentScene===r.BattleScene.currentInstance&&r.BattleScene.currentInstance.gui.activeNextWave()},t.onGameOver=function(){o.GameVars.gameOver=!0,t.engine.score>o.GameVars.gameData.scores[o.GameVars.currentMapId]&&(o.GameVars.gameData.scores[o.GameVars.currentMapId]=t.engine.score,f.GameManager.writeGameData()),r.BattleScene.currentInstance.showGameOverLayer(),GAMESNACKS.sendScore(t.engine.score),GAMESNACKS.gameOver()},t}();e.BattleManager=m},function(t,e,i){"use strict";i.r(e);class n{static fixNumber(t){return isNaN(t)?0:Math.round(1e5*t)/1e5}static isLineSegmentIntersectingCircle(t,e,i,s){if(n.isPointInsideCircle(t.x,t.y,i.x,i.y,s))return!0;if(n.isPointInsideCircle(e.x,e.y,i.x,i.y,s))return!0;const r=t.x-e.x,a=t.y-e.y,o=n.fixNumber(Math.sqrt(r*r+a*a)),h=((i.x-t.x)*(e.x-t.x)+(i.y-t.y)*(e.y-t.y))/(o*o),u=t.x+h*(e.x-t.x),c=t.y+h*(e.y-t.y);if(!n.isPointInLineSegment(t.x,t.y,e.x,e.y,u,c))return!1;const l=u-i.x,d=c-i.y;return n.fixNumber(Math.sqrt(l*l+d*d))<=s}static isPointInLineSegment(t,e,i,s,r,a){const o=n.fixNumber(Math.sqrt((r-t)*(r-t)+(a-e)*(a-e))),h=n.fixNumber(Math.sqrt((r-i)*(r-i)+(a-s)*(a-s))),u=n.fixNumber(Math.sqrt((t-i)*(t-i)+(e-s)*(e-s)));return o+h>=u-.1&&o+h<=u+.1}static isPointInsideCircle(t,e,i,s,r){const a=i-t,o=s-e;return n.fixNumber(Math.sqrt(a*a+o*o))<=r}static mergeSort(t,e){if(e||(e=function(t,e){return t<e}),t.length<=1)return t;let i,s;const r=n.splitList(t);return i=r.leftHalf,s=r.rigthHalf,n.jointLists(n.mergeSort(i,e),n.mergeSort(s,e),e)}static splitList(t){if(0===t.length)return{leftHalf:[],rigthHalf:[]};if(1===t.length)return{leftHalf:t,rigthHalf:[]};const e=Math.floor(t.length/2);return{leftHalf:t.slice(0,e),rigthHalf:t.slice(e)}}static jointLists(t,e,i){const n=[];let s=0,r=0;for(;i(t[s],e[r])?(n.push(t[s]),s++):(n.push(e[r]),r++),s!==t.length&&r!==e.length;);return s<t.length?n.concat(t.slice(s)):r<e.length?n.concat(e.slice(r)):n}}class s{}s.VERSION="v0.9.30.11",s.RELOAD_BASE_TICKS=10,s.BULLET_SPEED=.8,s.MORTAR_SPEED=.45,s.INITIAL_TICKS_WAVE=4,s.ENEMY_SOLDIER="soldier",s.ENEMY_RUNNER="runner",s.ENEMY_HEALER="healer",s.ENEMY_BLOB="blob",s.ENEMY_FLIER="flier",s.TURRET_PROJECTILE="projectile",s.TURRET_LASER="laser",s.TURRET_LAUNCH="launch",s.TURRET_GLUE="glue",s.ATTRIBUTE_DAMAGE="damage",s.ATTRIBUTE_RELOAD="reload",s.ATTRIBUTE_RANGE="range",s.ATTRIBUTE_EXPLOSION_RANGE="explosionRange",s.ATTRIBUTE_INTENSITY="intensity",s.ATTRIBUTE_DURATION="duration",s.ATTRIBUTE_PRICE_IMPROVEMENT="priceImprovement",s.ATTRIBUTE_PRICE_UPGRADE="priceUpgrade",s.ATTRIBUTE_TELEPORT_DISTANCE="teleportDistance",s.STRATEGY_SHOOT_FIRST="first",s.STRATEGY_SHOOT_LAST="last",s.STRATEGY_SHOOT_CLOSEST="closest",s.STRATEGY_SHOOT_WEAKEST="weakest",s.STRATEGY_SHOOT_STRONGEST="strongest",s.STRATEGIES_ARRAY=[s.STRATEGY_SHOOT_FIRST,s.STRATEGY_SHOOT_LAST,s.STRATEGY_SHOOT_CLOSEST,s.STRATEGY_SHOOT_WEAKEST,s.STRATEGY_SHOOT_STRONGEST],s.HEALER_HEALING_TICKS=200,s.HEALER_STOP_TICKS=5,s.HEALER_HEALING_RADIUS=2,s.DIFFICULTY_MODIFIER=8e-4,s.DIFFICULTY_EXPONENT=1.9,s.DIFFICULTY_LINEAR=20,s.MIN_HEALTH_MODIFIER=.5,s.REWARD_MODIFIER=.4,s.REWARD_EXPONENT=.5,s.MIN_REWARD_MODIFIER=1,s.EARLY_BONUS_MODIFIER=3,s.EARLY_BONUS_EXPONENT=.6,s.WEAK_AGAINST_DAMAGE_MODIFIER=3,s.STRONG_AGAINST_DAMAGE_MODIFIER=.33,s.ERROR_VERSION_MISMATCH="E001",s.ERROR_NO_GAME_OVER="E002",s.ERROR_TICKS="E003",s.ERROR_ACTION_ARRAY="E004",s.ERROR_ACTION_TYPE="E005",s.ERROR_ACTION_VALUE="E006",s.ERROR_TURRET="E007",s.ERROR_CREDITS="E008",s.ERROR_NEXT_WAVE="E009",s.ERROR_ADD_TURRET_POSITION="E010",s.ERROR_ADD_TURRET_NAME="E011",s.ERROR_UPGRADE="E012",s.ERROR_LEVEL_UP="E013",s.ACTION_TYPE_NEXT_WAVE="next wave",s.ACTION_TYPE_ADD_TURRET="add turret",s.ACTION_TYPE_SELL_TURRET="sell turret",s.ACTION_TYPE_UPGRADE_TURRET="upgrade turret",s.ACTION_TYPE_LEVEL_UP_TURRET="level up turret",s.ACTION_TYPE_CHANGE_STRATEGY_TURRET="change strategy turret",s.ACTION_TYPE_CHANGE_FIXED_TARGET_TURRET="change fixed target turret";class r{constructor(t,e,i){this.id=i.enemyId,i.enemyId++,this.modifiers={},this.creationTick=e,this.engine=i,this.type=t,this.enemyData=this.engine.enemyData[this.type],this.life=this.enemyData.life,this.maxLife=this.enemyData.life,this.value=this.enemyData.value,this.speed=this.enemyData.speed,this.affectedByGlue=!1,this.glueIntensity=0,this.affectedByGlueBullet=!1,this.glueBulletIntensity=0,this.glueBulletDurationTicks=0,this.glueTicksCounter=0,this.hasBeenTeleported=!1,this.teleporting=!1,this.l=0,this.t=0;const n=this.engine.getPathPosition(this.l);switch(this.x=n.x,this.y=n.y,this.prevX=this.x,this.prevY=this.y,this.boundingRadius=this.type===s.ENEMY_RUNNER?.5:.475,this.type){case s.ENEMY_HEALER:case s.ENEMY_FLIER:this.modifiers[s.TURRET_LASER]="weak",this.modifiers[s.TURRET_PROJECTILE]="weak";break;case s.ENEMY_RUNNER:this.modifiers[s.TURRET_LAUNCH]="weak",this.modifiers[s.TURRET_LASER]="strong";break;case s.ENEMY_BLOB:this.modifiers[s.TURRET_LAUNCH]="weak",this.modifiers[s.TURRET_PROJECTILE]="strong"}}destroy(){}update(){if(this.teleporting)return this.t++,void(8===this.t&&(this.teleporting=!1));let t=this.speed;if(this.affectedByGlue&&(t=n.fixNumber(this.speed/this.glueIntensity)),this.affectedByGlueBullet&&(t=n.fixNumber(this.speed/this.glueBulletIntensity),this.glueTicksCounter++,this.glueTicksCounter===this.glueBulletDurationTicks&&(this.affectedByGlueBullet=!1)),this.l=n.fixNumber(this.l+t),this.prevX=this.x,this.prevY=this.y,this.l>=this.engine.enemiesPathCells.length-1)this.x=this.engine.enemiesPathCells[this.engine.enemiesPathCells.length-1].c,this.y=this.engine.enemiesPathCells[this.engine.enemiesPathCells.length-1].r,this.engine.onEnemyReachedExit(this);else{const t=this.engine.getPathPosition(this.l);this.x=t.x,this.y=t.y}}teleport(t){this.hasBeenTeleported=!0,this.teleporting=!0,this.t=0,this.l-=t,this.l<0&&(this.l=0);const e=this.engine.getPathPosition(this.l);this.x=e.x,this.y=e.y}hitByGlueBullet(t,e){this.glueTicksCounter=0,this.affectedByGlueBullet=!0,this.glueBulletIntensity=t,this.glueBulletDurationTicks=e}glue(t){this.affectedByGlue=!0,this.glueIntensity=t}hit(t,e,i,r,a){if(this.life<=0)return;let o=1;e?"weak"===this.modifiers[s.TURRET_PROJECTILE]?o=s.WEAK_AGAINST_DAMAGE_MODIFIER:"strong"===this.modifiers[s.TURRET_PROJECTILE]&&(o=s.STRONG_AGAINST_DAMAGE_MODIFIER):i||r?"weak"===this.modifiers[s.TURRET_LAUNCH]?o=s.WEAK_AGAINST_DAMAGE_MODIFIER:"strong"===this.modifiers[s.TURRET_LAUNCH]&&(o=s.STRONG_AGAINST_DAMAGE_MODIFIER):a&&("weak"===this.modifiers[s.TURRET_LASER]?o=s.WEAK_AGAINST_DAMAGE_MODIFIER:"strong"===this.modifiers[s.TURRET_LASER]&&(o=s.STRONG_AGAINST_DAMAGE_MODIFIER)),this.life-=n.fixNumber(t*o),e&&e.turret?e.turret.inflicted+=Math.round(t):i&&i.turret?i.turret.inflicted+=Math.round(t):r&&r.turret?r.turret.inflicted+=Math.round(t):a&&(a.inflicted+=Math.round(t)),this.life<=0&&(this.life=0,this.engine.onEnemyKilled(this))}restoreHealth(){this.life+=n.fixNumber(this.maxLife/20),this.life>this.maxLife&&(this.life=this.maxLife)}getNextPosition(t){let e=this.speed;this.affectedByGlue&&(e=n.fixNumber(this.speed/this.glueIntensity));let i=n.fixNumber(this.l+e*t);const s=this.engine.getPathPosition(i);return s?{x:s.x,y:s.y}:null}}class a extends r{constructor(t,e){super(s.ENEMY_HEALER,t,e),this.f=s.HEALER_HEALING_TICKS-t%s.HEALER_HEALING_TICKS,this.healing=!1}update(){this.f++,this.healing?(this.heal(),this.f>=s.HEALER_STOP_TICKS&&(this.f=0,this.healing=!1)):(super.update(),this.f>=s.HEALER_HEALING_TICKS&&this.l<this.engine.enemiesPathCells.length-2&&(this.f=0,this.healing=!0))}heal(){for(let t=0;t<this.engine.enemies.length;t++){const e=this.engine.enemies[t];if(e.id===this.id)e.restoreHealth();else{n.fixNumber((e.x-this.x)*(e.x-this.x)+(e.y-this.y)*(e.y-this.y))<=s.HEALER_HEALING_RADIUS*s.HEALER_HEALING_RADIUS&&e.restoreHealth()}}}}class o{constructor(t,e,i,r,a,o,h){this.engine=o,this.id=this.engine.bulletId,this.engine.bulletId++,this.x=t.x,this.y=t.y,this.assignedEnemy=i,this.outOfStageBoundaries=!1,this.damage=r,this.ticksToImpact=h,this.tick=0,this.turret=a,this.vx=n.fixNumber(s.BULLET_SPEED*Math.cos(e)),this.vy=n.fixNumber(s.BULLET_SPEED*Math.sin(e))}destroy(){}update(){this.tick++,this.x=n.fixNumber(this.x+this.vx),this.y=n.fixNumber(this.y+this.vy),this.tick>=this.ticksToImpact&&this.assignedEnemy&&(this.x=this.assignedEnemy.x,this.y=this.assignedEnemy.y),(this.x<-1||this.x>this.engine.boardSize.c+1||this.y<-1||this.y>this.engine.boardSize.r+1)&&(this.outOfStageBoundaries=!0)}getPositionNextTick(){return{x:n.fixNumber(this.x+this.vx),y:n.fixNumber(this.y+this.vy)}}}class h{constructor(t,e,i,n,s){this.id=s.glueId,s.glueId++,this.x=t.c+.5,this.y=t.r+.5,this.intensity=e,this.duration=i,this.range=n,this.consumed=!1,this.f=0}destroy(){}update(){this.f++,this.f===this.duration&&(this.consumed=!0)}}class u{constructor(t,e,i,r,a,o){this.engine=o,this.id=this.engine.bulletId,this.engine.bulletId++,this.x=t.x,this.y=t.y,this.assignedEnemy=i,this.outOfStageBoundaries=!1,this.intensity=r,this.durationTicks=a,this.vx=n.fixNumber(s.BULLET_SPEED*Math.cos(e)),this.vy=n.fixNumber(s.BULLET_SPEED*Math.sin(e))}destroy(){}update(){this.x=n.fixNumber(this.x+this.vx),this.y=n.fixNumber(this.y+this.vy),(this.x<-1||this.x>this.engine.boardSize.c+1||this.y<-1||this.y>this.engine.boardSize.r+1)&&(this.outOfStageBoundaries=!0)}getPositionNextTick(){return{x:n.fixNumber(this.x+this.vx),y:n.fixNumber(this.y+this.vy)}}}class c{constructor(t,e,i){this.engine=i,this.id=i.turretId,i.turretId++,this.creationTick=this.engine.ticksCounter,this.type=t,this.f=0,this.level=1,this.maxLevel=10,this.grade=1,this.inflicted=0,this.position=e,this.fixedTarget=!0,this.shootingStrategyIndex=0,this.shootingStrategy=s.STRATEGIES_ARRAY[this.shootingStrategyIndex],this.readyToShoot=!1,this.enemiesWithinRange=[],this.followedEnemy=null,this.x=this.position.c+.5,this.y=this.position.r+.5,this.value=this.engine.turretData[this.type].price,this.sellValue=Math.round(this.engine.turretData[this.type].price*c.DOWNGRADE_PERCENT)}destroy(){}update(){this.readyToShoot?(this.enemiesWithinRange=this.getEnemiesWithinRange(),this.fixedTarget?this.enemiesWithinRange.length>0?-1===this.enemiesWithinRange.indexOf(this.followedEnemy)&&(this.followedEnemy=this.enemiesWithinRange[0]):this.followedEnemy=null:this.followedEnemy=this.enemiesWithinRange[0],this.enemiesWithinRange.length>0&&(this.readyToShoot=!1,this.shoot())):(this.f++,this.f>=this.reloadTicks&&(this.readyToShoot=!0,this.f=0))}ageTurret(){this.sellValue=Math.round(this.sellValue*c.DOWNGRADE_PERCENT)}improve(){this.value+=this.priceImprovement,this.sellValue+=this.priceImprovement,this.level++,this.calculateTurretParameters()}upgrade(){this.value+=this.priceUpgrade,this.sellValue+=this.priceUpgrade,this.grade++,this.level=1,3===this.grade&&this.type!==s.TURRET_GLUE&&(this.maxLevel=15),this.type===s.TURRET_GLUE&&(2===this.grade?this.y-=.35:3===this.grade&&(this.y+=.35)),this.f=0,this.calculateTurretParameters()}setNextStrategy(){this.shootingStrategyIndex=this.shootingStrategyIndex===s.STRATEGIES_ARRAY.length-1?0:this.shootingStrategyIndex+1,this.shootingStrategy=s.STRATEGIES_ARRAY[this.shootingStrategyIndex]}setFixedTarget(){this.fixedTarget=!this.fixedTarget}calculateTurretParameters(){this.reloadTicks=Math.floor(s.RELOAD_BASE_TICKS*this.reload),this.squaredRange=n.fixNumber(this.range*this.range)}shoot(){}getEnemiesWithinRange(){let t=[];for(let e=0;e<this.engine.enemies.length;e++){const i=this.engine.enemies[e];if((this.type!==s.TURRET_GLUE||3!==this.grade||!i.hasBeenTeleported)&&(i.life>0&&i.l<this.engine.enemiesPathCells.length-1.5&&!i.teleporting)){const e=this.x-i.x,s=this.y-i.y,r=n.fixNumber(e*e+s*s);this.squaredRange>=r&&t.push({enemy:i,squareDist:r})}}if(t.length>1)switch(this.shootingStrategy){case s.STRATEGY_SHOOT_FIRST:t.sort((function(t,e){return t.enemy.l===e.enemy.l?t.enemy.id-e.enemy.id:e.enemy.l-t.enemy.l}));break;case s.STRATEGY_SHOOT_LAST:t.sort((function(t,e){return t.enemy.l===e.enemy.l?t.enemy.id-e.enemy.id:t.enemy.l-e.enemy.l}));break;case s.STRATEGY_SHOOT_CLOSEST:t.sort((function(t,e){return t.squareDist===e.squareDist?t.enemy.l===e.enemy.l?t.enemy.id-e.enemy.id:e.enemy.l-t.enemy.l:t.squareDist-e.squareDist}));break;case s.STRATEGY_SHOOT_WEAKEST:t.sort((function(t,e){return t.enemy.life===e.enemy.life?t.enemy.l===e.enemy.l?t.enemy.id-e.enemy.id:e.enemy.l-t.enemy.l:t.enemy.life-e.enemy.life}));break;case s.STRATEGY_SHOOT_STRONGEST:t.sort((function(t,e){return t.enemy.life===e.enemy.life?t.enemy.l===e.enemy.l?t.enemy.id-e.enemy.id:e.enemy.l-t.enemy.l:e.enemy.life-t.enemy.life}))}return t.map(t=>t.enemy)}}c.DOWNGRADE_PERCENT=.97;class l extends c{constructor(t,e){super(s.TURRET_GLUE,t,e),this.maxLevel=5,this.teleportDistance=0,this.projectileSpeed=s.BULLET_SPEED,this.calculateTurretParameters()}calculateTurretParameters(){let t=this.engine.turretsAttributes[this.type][this.grade-1];this.reload=t.reload[this.level-1],this.range=t.range[this.level-1],this.priceImprovement=t.priceImprovement[this.level-1],this.nextReload=this.level===this.maxLevel?0:t.reload[this.level],this.nextRange=this.level===this.maxLevel?0:t.range[this.level],this.grade<3&&(this.priceUpgrade=t.priceUpgrade),3===this.grade?(this.teleportDistance=t.teleportDistance[this.level-1],this.nextTeleportDistance=this.level===this.maxLevel?0:t.teleportDistance[this.level]):(this.intensity=t.intensity[this.level-1],this.duration=t.duration[this.level-1],this.nextIntensity=this.level===this.maxLevel?0:t.intensity[this.level],this.nextDuration=this.level===this.maxLevel?0:t.duration[this.level]),this.durationTicks=Math.floor(s.RELOAD_BASE_TICKS*this.duration),super.calculateTurretParameters()}shoot(){let t;switch(super.shoot(),this.grade){case 1:const e=new h(this.position,this.intensity,this.durationTicks,this.range,this.engine);this.engine.addGlue(e,this);break;case 2:t=this.fixedTarget&&this.followedEnemy||this.enemiesWithinRange[0];const i=n.fixNumber(Math.sqrt((this.x-t.x)*(this.x-t.x)+(this.y-t.y)*(this.y-t.y))),s=Math.floor(n.fixNumber(i/this.projectileSpeed)),r=t.getNextPosition(s),a=r.x-this.x,o=r.y-this.y;this.shootAngle=n.fixNumber(Math.atan2(o,a));const c=new u({x:this.x,y:this.y},this.shootAngle,t,this.intensity,this.durationTicks,this.engine);this.engine.addGlueBullet(c,this);break;case 3:t=this.fixedTarget&&this.followedEnemy||this.enemiesWithinRange[0],this.engine.flagEnemyToTeleport(t,this)}}}class d extends c{constructor(t,e){super(s.TURRET_LASER,t,e),this.calculateTurretParameters()}calculateTurretParameters(){let t=this.engine.turretsAttributes[this.type][this.grade-1];this.damage=t.damage[this.level-1],this.reload=t.reload[this.level-1],this.range=t.range[this.level-1],this.priceImprovement=t.priceImprovement[this.level-1],this.nextDamage=this.level===this.maxLevel?0:t.damage[this.level],this.nextReload=this.level===this.maxLevel?0:t.reload[this.level],this.nextRange=this.level===this.maxLevel?0:t.range[this.level],this.grade<3&&(this.priceUpgrade=t.priceUpgrade),super.calculateTurretParameters()}getEnemiesWithinLine(t){let e=[];for(let i=0;i<this.engine.enemies.length;i++){const s=this.engine.enemies[i];let r=s.x+1e3*(t.x-this.x),a=s.y+1e3*(t.y-this.y);s!==t&&n.isLineSegmentIntersectingCircle({x:this.x,y:this.y},{x:r,y:a},{x:s.x,y:s.y},.3)&&e.push(s)}return e}shoot(){super.shoot();let t=[],e=1,i=0;switch(this.grade){case 1:e=1;break;case 2:e=3}if(3===this.grade)this.fixedTarget?t.push(this.followedEnemy||this.enemiesWithinRange[0]):t.push(this.enemiesWithinRange[0]),t=t.concat(this.getEnemiesWithinLine(t[0]));else for(this.fixedTarget&&this.followedEnemy?(t.push(this.followedEnemy),this.followedEnemy===this.enemiesWithinRange[0]&&i++):(t.push(this.enemiesWithinRange[0]),i++);t.length<e&&this.enemiesWithinRange[i];)t.push(this.enemiesWithinRange[i]),i++;t[0].life>0?this.engine.addBeam(this,t):this.readyToShoot=!0}}class p{constructor(t,e,i,n,s){this.id=s.mineId,s.mineId++,this.x=t.c+.5,this.y=t.r+.5,this.explosionRange=e,this.damage=i,this.range=.5,this.detonate=!1,this.engine=s,this.turret=n}destroy(){}update(){if(!this.detonate)for(let t=0;t<this.engine.enemies.length;t++){const e=this.engine.enemies[t],i=n.fixNumber(Math.sqrt((e.x-this.x)*(e.x-this.x)+(e.y-this.y)*(e.y-this.y)));if(e.type!==s.ENEMY_FLIER&&i<=this.range){this.detonate=!0;break}}}getEnemiesWithinExplosionRange(){const t=[];for(let e=0;e<this.engine.enemies.length;e++){const i=this.engine.enemies[e],s=n.fixNumber(Math.sqrt((i.x-this.x)*(i.x-this.x)+(i.y-this.y)*(i.y-this.y)));if(s<=this.explosionRange){const e=n.fixNumber(this.damage*(1-s/this.explosionRange));t.push({enemy:i,damage:e})}}return t}}class f{constructor(t,e,i,s,r,a,o,h){this.id=h.mortarId,h.mortarId++,this.creationTick=h.ticksCounter,this.x=t.x,this.y=t.y,this.angle=e,this.ticksToImpact=i,this.explosionRange=s,this.damage=r,this.grade=a,this.turret=o,this.engine=h,this.detonate=!1,this.f=0,this.vx=n.fixNumber(this.turret.projectileSpeed*Math.cos(e)),this.vy=n.fixNumber(this.turret.projectileSpeed*Math.sin(e))}destroy(){}update(){this.x=n.fixNumber(this.x+this.vx),this.y=n.fixNumber(this.y+this.vy),this.f++,this.f===this.ticksToImpact&&(this.detonate=!0)}getEnemiesWithinExplosionRange(){const t=[];for(let e=0;e<this.engine.enemies.length;e++){const i=this.engine.enemies[e],s=n.fixNumber(Math.sqrt((i.x-this.x)*(i.x-this.x)+(i.y-this.y)*(i.y-this.y)));if(s<=this.explosionRange){const e=n.fixNumber(this.damage*(1-s/this.explosionRange));t.push({enemy:i,damage:e})}}return t}}class m extends c{constructor(t,e){super(s.TURRET_LAUNCH,t,e),this.calculateTurretParameters(),this.y-=.35,this.numMines=0,this.minesCounter=0,this.projectileSpeed=s.MORTAR_SPEED}update(){2===this.grade?this.readyToShoot?(this.readyToShoot=!1,this.shoot()):(this.f++,this.f>=this.reloadTicks&&(this.readyToShoot=!0,this.f=0)):super.update()}calculateTurretParameters(){let t=this.engine.turretsAttributes[this.type][this.grade-1];this.damage=t.damage[this.level-1],this.explosionRange=t.explosionRange[this.level-1],this.reload=t.reload[this.level-1],this.range=t.range[this.level-1],this.priceImprovement=t.priceImprovement[this.level-1],this.projectileSpeed=3===this.grade?2*s.MORTAR_SPEED:s.MORTAR_SPEED,this.nextDamage=this.level===this.maxLevel?0:t.damage[this.level],this.nextReload=this.level===this.maxLevel?0:t.reload[this.level],this.nextRange=this.level===this.maxLevel?0:t.range[this.level],this.nextExplosionRange=this.level===this.maxLevel?0:t.explosionRange[this.level],this.grade<3&&(this.priceUpgrade=t.priceUpgrade),super.calculateTurretParameters()}getPathCellsInRange(){let t=[];for(let e=0;e<this.engine.enemiesPathCells.length;e++){let i=this.engine.enemiesPathCells[e];(i.c>=this.position.c&&i.c<=this.position.c+this.range||i.c<=this.position.c&&i.c>=this.position.c-this.range)&&(i.r>=this.position.r&&i.r<=this.position.r+this.range||i.r<=this.position.r&&i.r>=this.position.r-this.range)&&t.push(i)}return t}shoot(){if(2===this.grade){let t=this.getPathCellsInRange();if(t.length>0&&this.numMines<this.level+3){let e=t[this.minesCounter%t.length];this.minesCounter++,this.numMines++;const i=e.c+.5-this.x,s=e.r+.5-this.y;this.shootAngle=n.fixNumber(Math.atan2(s,i));const r=new p({c:e.c,r:e.r},this.explosionRange,this.damage,this,this.engine);this.engine.addMine(r,this)}else this.readyToShoot=!0}else{let t,e,i;t=this.fixedTarget&&this.followedEnemy||this.enemiesWithinRange[0];let r,a=this.range;r=t.type===s.ENEMY_RUNNER||t.type===s.ENEMY_FLIER?3:2;for(let s=0;s<r;s++)e=Math.floor(a/this.projectileSpeed),i=t.getNextPosition(e),a=n.fixNumber(Math.sqrt((this.x-i.x)*(this.x-i.x)+(this.y-i.y)*(this.y-i.y)));const o=i.x-this.x,h=i.y-this.y;this.shootAngle=n.fixNumber(Math.atan2(h,o));const u=new f({x:this.x,y:this.y},this.shootAngle,e,this.explosionRange,this.damage,this.grade,this,this.engine);this.engine.addMortar(u,this)}}}class g extends c{constructor(t,e){super(s.TURRET_PROJECTILE,t,e),this.projectileSpeed=s.BULLET_SPEED,this.y-=.35,this.calculateTurretParameters()}calculateTurretParameters(){let t=this.engine.turretsAttributes[this.type][this.grade-1];this.damage=t.damage[this.level-1],this.reload=t.reload[this.level-1],this.range=t.range[this.level-1],this.priceImprovement=t.priceImprovement[this.level-1],this.nextDamage=this.level===this.maxLevel?0:t.damage[this.level],this.nextReload=this.level===this.maxLevel?0:t.reload[this.level],this.nextRange=this.level===this.maxLevel?0:t.range[this.level],this.grade<3&&(this.priceUpgrade=t.priceUpgrade),super.calculateTurretParameters()}shoot(){let t;super.shoot(),t=this.fixedTarget&&this.followedEnemy||this.enemiesWithinRange[0];const e=n.fixNumber(Math.sqrt((this.x-t.x)*(this.x-t.x)+(this.y-t.y)*(this.y-t.y))),i=Math.floor(n.fixNumber(e/this.projectileSpeed)),s=t.getNextPosition(i),r=s.x-this.x,a=s.y-this.y;this.shootAngle=n.fixNumber(Math.atan2(a,r));const h=new o({x:this.x,y:this.y},this.shootAngle,t,this.damage,this,this.engine,i);this.engine.addBullet(h,this)}upgrade(){super.upgrade(),2===this.grade&&(this.y-=.1)}}class v{constructor(t,e){this.type=t,this.params=e}getParams(){return this.params}getType(){return this.type}}v.ENEMY_SPAWNED="enemy spawned",v.ENEMY_KILLED="enemy killed",v.ENEMY_HIT="enemy hit by bullet",v.ENEMY_GLUE_HIT="enemy hit by glue bullet",v.ENEMY_REACHED_EXIT="enemy reached exit",v.ACTIVE_NEXT_WAVE="active next wave",v.WAVE_OVER="wave over",v.GAME_OVER="game over",v.NO_ENEMIES_ON_STAGE="no enemies on stage",v.BULLET_SHOT="bullet shot",v.GLUE_BULLET_SHOT="glue bullet shot",v.LASER_SHOT="laser shot",v.MORTAR_SHOT="mortar shot",v.MINE_SHOT="mine shot",v.GLUE_SHOT="glue shot",v.GLUE_CONSUMED="glue consumed",v.ENEMIES_TELEPORTED="enemies teleported",v.REMOVE_BULLET="remove bullet",v.REMOVE_GLUE_BULLET="remove glue bullet";class y{constructor(){this.listeners=[]}hasEventListener(t,e){let i=!1;for(let n=0;n<this.listeners.length;n++)this.listeners[n].type===t&&this.listeners[n].listener===e&&(i=!0);return i}addEventListener(t,e,i){this.hasEventListener(t,e)||this.listeners.push({type:t,listener:e,scope:i})}removeEventListener(t,e){for(let i=0;i<this.listeners.length;i++)this.listeners[i].type===t&&this.listeners[i].listener===e&&this.listeners.splice(i,1)}dispatchEvent(t){for(let e=0;e<this.listeners.length;e++)this.listeners[e].type===t.getType()&&this.listeners[e].listener.apply(this.listeners[e].scope,t.getParams())}}class _{constructor(t){this.engine=t}getEnemy(){let t=null;if(this.engine.waveEnemies.length>0){let e=this.engine.waveEnemies[0];if(e.t===this.engine.ticksCounter){switch(e.type){case s.ENEMY_SOLDIER:t=new r(s.ENEMY_SOLDIER,this.engine.ticksCounter,this.engine);break;case s.ENEMY_RUNNER:t=new r(s.ENEMY_RUNNER,this.engine.ticksCounter,this.engine);break;case s.ENEMY_HEALER:t=new a(this.engine.ticksCounter,this.engine);break;case s.ENEMY_BLOB:t=new r(s.ENEMY_BLOB,this.engine.ticksCounter,this.engine);break;case s.ENEMY_FLIER:t=new r(s.ENEMY_FLIER,this.engine.ticksCounter,this.engine)}t.life=Math.round(t.life*this.engine.enemyHealthModifier),t.maxLife=t.life,this.engine.waveEnemies.shift()}}return t}}var x=i(24);class E{constructor(t,e,i,n){this._version=s.VERSION,this.turretId=0,this.enemyId=0,this.bulletId=0,this.mortarId=0,this.glueId=0,this.mineId=0,this.enemySpawningDeltaTicks=t.enemySpawningDeltaTicks,this.runningInClientSide=t.runningInClientSide,this.boardSize=t.boardSize,this._credits=t.credits,this._lifes=t.lifes,this._timeStep=t.timeStep,this.enemiesPathCells=t.enemiesPathCells,this.plateausCells=t.plateausCells,this.enemyData=e,this.turretData=i,this.wavesData=n,this.generateTurretsAttributes(),this._score=0,this._gameOver=!1,this._round=0,this._bonus=0,this._creditsEarned=0,this.enemyHealthModifier=1,this.enemyRewardModifier=1,this.waveActivated=!1,this.t=0,this.eventDispatcher=new y,this.enemiesSpawner=new _(this),this._ticksCounter=0,this.lastWaveTick=0,this.turrets=[],this.mines=[],this.minesImpacting=[],this.waveEnemies=[],this.canLaunchNextWave=!0,this.initWaveVars(),this._noEnemiesOnStage=!0,this.allEnemiesSpawned=!1,this.enemiesSpawned=0,this.waveEnemiesLength=0,this.remainingReward=0}initWaveVars(){this.t=Date.now(),this.enemies=[],this.bullets=[],this.glueBullets=[],this.mortars=[],this.glues=[],this.bulletsColliding=[],this.glueBulletsColliding=[],this.mortarsImpacting=[],this.consumedGlues=[],this.teleportedEnemies=[]}update(){if(this.runningInClientSide){const t=Date.now();if(t-this.t<this._timeStep)return;this.t=t}this._lifes<=0&&!this._gameOver&&(this.eventDispatcher.dispatchEvent(new v(v.GAME_OVER)),this._gameOver=!0),this._noEnemiesOnStage&&this.allEnemiesSpawned&&0===this.bullets.length&&0===this.glueBullets.length&&0===this.glues.length&&0===this.mortars.length&&(this.waveActivated=!1,this._lifes>0&&this.eventDispatcher.dispatchEvent(new v(v.WAVE_OVER))),this.ticksCounter-this.lastWaveTick>=s.INITIAL_TICKS_WAVE*this.enemySpawningDeltaTicks&&!this.canLaunchNextWave&&(this.canLaunchNextWave=!0,this.eventDispatcher.dispatchEvent(new v(v.ACTIVE_NEXT_WAVE))),this.waveActivated&&this.removeProjectilesAndAccountDamage(),this.teleport(),this.checkCollisions(),this.spawnEnemies(),this.enemies.forEach((function(t){t.update()}),this),this.turrets.forEach((function(t){t.update()})),this.bullets.forEach((function(t){t.update()})),this.glueBullets.forEach((function(t){t.update()})),this.mortars.forEach((function(t){t.update()})),this.mines.forEach((function(t){t.update()})),this.glues.forEach((function(t){t.update()})),this._ticksCounter++}newWave(){if(!this.canLaunchNextWave)return null;this.ageTurrets();const t=this.bonus;this._credits+=this._bonus,this._creditsEarned+=this._bonus,this.canLaunchNextWave=!1,this._noEnemiesOnStage=!1,this.allEnemiesSpawned=!1;let e=Object.keys(this.wavesData).length,i=this.wavesData["wave_"+(this._round%e+1)],r=i.enemies.slice(0),a=JSON.parse(JSON.stringify(r));const o=Math.floor(this._round/e),h=Math.min(o*i.extend,i.maxExtend);this._round++;for(let t=0;t<h;t++){let t=JSON.parse(JSON.stringify(r)),e=a[a.length-1].t;for(let i=0;i<t.length;i++)t[i].t+=e+2;a=a.concat(t)}for(let t=0;t<a.length;t++)a[t].t=a[t].t*this.enemySpawningDeltaTicks+this._ticksCounter+1;this.waveEnemies=this.waveEnemies.concat(a),this.waveEnemies=n.mergeSort(this.waveEnemies,(function(t,e){return t.t-e.t<0})),this.lastWaveTick=this._ticksCounter,this.waveReward=i.waveReward,this.waveActivated=!0,this.waveEnemiesLength+=a.length,this.waveDefaultHealth=0;for(let t=0;t<this.waveEnemies.length;t++)this.waveDefaultHealth+=this.enemyData[this.waveEnemies[t].type].life,this.remainingReward+=Math.round(this.enemyRewardModifier*this.enemyData[this.waveEnemies[t].type].value);const u=Math.round(s.DIFFICULTY_LINEAR*this._creditsEarned+s.DIFFICULTY_MODIFIER*Math.pow(this._creditsEarned,s.DIFFICULTY_EXPONENT));let c=n.fixNumber(u/this.waveDefaultHealth);c=Math.max(c,s.MIN_HEALTH_MODIFIER);let l=s.REWARD_MODIFIER*Math.pow(c,s.REWARD_EXPONENT);return l=Math.max(l,s.MIN_REWARD_MODIFIER),this.enemyHealthModifier=c,this.enemyRewardModifier=l,this._bonus=Math.round(this.waveReward+Math.round(s.EARLY_BONUS_MODIFIER*Math.pow(Math.max(0,this.remainingReward),s.EARLY_BONUS_EXPONENT))),t}removeEnemy(t){const e=this.enemies.indexOf(t);-1!==e&&this.enemies.splice(e,1),t.destroy()}addTurret(t,e){if("string"!=typeof t||!e||"number"!=typeof e.c||"number"!=typeof e.r)return{success:!1,error:{type:s.ERROR_ACTION_VALUE}};if(e.r<0||e.c<0||e.r>=this.boardSize.r||e.c>=this.boardSize.c)return{success:!1,error:{type:s.ERROR_ADD_TURRET_POSITION}};for(let t=0;t<this.enemiesPathCells.length;t++)if(e.c===this.enemiesPathCells[t].c&&e.r===this.enemiesPathCells[t].r)return{success:!1,error:{type:s.ERROR_ADD_TURRET_POSITION}};for(let t=0;t<this.turrets.length;t++)if(e.c===this.turrets[t].position.c&&e.r===this.turrets[t].position.r)return{success:!1,error:{type:s.ERROR_ADD_TURRET_POSITION}};let i=!0;if(0!==this.plateausCells.length)for(let t=0;t<this.plateausCells.length;t++)if(this.plateausCells[t].c===e.c&&this.plateausCells[t].r===e.r){i=!1;break}if(!i)return{success:!1,error:{type:s.ERROR_ADD_TURRET_POSITION}};let n=null;switch(t){case s.TURRET_PROJECTILE:n=new g(e,this);break;case s.TURRET_LASER:n=new d(e,this);break;case s.TURRET_LAUNCH:n=new m(e,this);break;case s.TURRET_GLUE:n=new l(e,this);break;default:return{success:!1,error:{type:s.ERROR_ADD_TURRET_NAME,info:{name:t}}}}return this._credits<n.value?{success:!1,error:{type:s.ERROR_CREDITS}}:(this.turrets.push(n),this._credits-=n.value,{success:!0,turret:n})}sellTurret(t){if("number"!=typeof t)return{success:!1,error:{type:s.ERROR_ACTION_VALUE}};const e=this.getTurretById(t);if(!e)return{success:!1,error:{type:s.ERROR_TURRET,info:{id:t}}};const i=this.turrets.indexOf(e);return-1!==i&&this.turrets.splice(i,1),this._credits+=e.sellValue,e.destroy(),{success:!0}}setNextStrategy(t){if("number"!=typeof t)return{success:!1,error:{type:s.ERROR_ACTION_VALUE}};const e=this.getTurretById(t);return e?(e.setNextStrategy(),{success:!0}):{success:!1,error:{type:s.ERROR_TURRET,info:{id:t}}}}setFixedTarget(t){if("number"!=typeof t)return{success:!1,error:{type:s.ERROR_ACTION_VALUE}};const e=this.getTurretById(t);return e?(e.setFixedTarget(),{success:!0}):{success:!1,error:{type:s.ERROR_TURRET,info:{id:t}}}}addBullet(t,e){this.bullets.push(t),this.eventDispatcher.dispatchEvent(new v(v.BULLET_SHOT,[t,e]))}addGlueBullet(t,e){this.glueBullets.push(t),this.eventDispatcher.dispatchEvent(new v(v.GLUE_BULLET_SHOT,[t,e]))}addGlue(t,e){this.glues.push(t),this.eventDispatcher.dispatchEvent(new v(v.GLUE_SHOT,[t,e]))}addMortar(t,e){this.mortars.push(t),this.eventDispatcher.dispatchEvent(new v(v.MORTAR_SHOT,[t,e]))}addMine(t,e){this.mines.push(t),this.eventDispatcher.dispatchEvent(new v(v.MINE_SHOT,[t,e]))}addBeam(t,e){for(let i=0;i<e.length;i++)e[i].hit(t.damage,null,null,null,t);this.eventDispatcher.dispatchEvent(new v(v.LASER_SHOT,[t,e])),1===t.grade?this.eventDispatcher.dispatchEvent(new v(v.ENEMY_HIT,[e,null,null,null,!0])):2===t.grade?this.eventDispatcher.dispatchEvent(new v(v.ENEMY_HIT,[e,null,null,null,!1,!0])):this.eventDispatcher.dispatchEvent(new v(v.ENEMY_HIT,[e,null,null,null,!0,!0]))}flagEnemyToTeleport(t,e){this.teleportedEnemies.push({enemy:t,glueTurret:e})}onEnemyReachedExit(t){const e=this.enemies.indexOf(t);-1!==e&&this.enemies.splice(e,1),this._gameOver||(this._score+=t.value),this.remainingReward-=t.value,t.destroy(),this._lifes-=1,this._bonus=Math.round(this.waveReward+Math.round(s.EARLY_BONUS_MODIFIER*Math.pow(Math.max(0,this.remainingReward),s.EARLY_BONUS_EXPONENT))),0===this.enemies.length&&this.allEnemiesSpawned&&this.onNoEnemiesOnStage(),this.eventDispatcher.dispatchEvent(new v(v.ENEMY_REACHED_EXIT,[t]))}onEnemyKilled(t){this.eventDispatcher.dispatchEvent(new v(v.ENEMY_KILLED,[t]));const e=this.enemies.indexOf(t);-1!==e&&this.enemies.splice(e,1),this._credits+=t.value,this._creditsEarned+=t.value,this.remainingReward-=t.value,this._gameOver||(this._score+=t.value),t.destroy(),this._bonus=Math.round(this.waveReward+Math.round(s.EARLY_BONUS_MODIFIER*Math.pow(Math.max(0,this.remainingReward),s.EARLY_BONUS_EXPONENT))),0===this.enemies.length&&this.allEnemiesSpawned&&this.onNoEnemiesOnStage()}improveTurret(t){if("number"!=typeof t)return{success:!1,error:{type:s.ERROR_ACTION_VALUE}};const e=this.getTurretById(t);return e?e.level>=e.maxLevel?{success:!1,error:{type:s.ERROR_LEVEL_UP,info:{id:t}}}:this._credits<e.priceImprovement?{success:!1,error:{type:s.ERROR_CREDITS}}:(this._credits-=e.priceImprovement,e.improve(),{success:!0}):{success:!1,error:{type:s.ERROR_TURRET,info:{id:t}}}}upgradeTurret(t){if("number"!=typeof t)return{success:!1,error:{type:s.ERROR_ACTION_VALUE}};const e=this.getTurretById(t);return e?e.grade>=3?{success:!1,error:{type:s.ERROR_UPGRADE,info:{id:t}}}:this._credits<e.priceUpgrade?{success:!1,error:{type:s.ERROR_CREDITS}}:(this._credits-=e.priceUpgrade,e.upgrade(),{success:!0}):{success:!1,error:{type:s.ERROR_TURRET,info:{id:t}}}}getPathPosition(t){let e,i;const s=Math.floor(t);if(!this.enemiesPathCells[s])return null;if(s===this.enemiesPathCells.length-1)e=this.enemiesPathCells[this.enemiesPathCells.length-1].c,i=this.enemiesPathCells[this.enemiesPathCells.length-1].r;else{const r=n.fixNumber(t-s);e=this.enemiesPathCells[s].c+.5,i=this.enemiesPathCells[s].r+.5;const a=n.fixNumber(this.enemiesPathCells[s+1].c-this.enemiesPathCells[s].c),o=n.fixNumber(this.enemiesPathCells[s+1].r-this.enemiesPathCells[s].r);e=n.fixNumber(e+a*r),i=n.fixNumber(i+o*r)}return{x:e,y:i}}addEventListener(t,e,i){this.eventDispatcher.addEventListener(t,e,i)}removeEventListener(t,e){this.eventDispatcher.removeEventListener(t,e)}get credits(){return this._credits}get creditsEarned(){return this._creditsEarned}get bonus(){return this._bonus}get ticksCounter(){return this._ticksCounter}set ticksCounter(t){this._ticksCounter=t}get score(){return this._score}set score(t){this._score=t}get gameOver(){return this._gameOver}set gameOver(t){this._gameOver=t}get lifes(){return this._lifes}get noEnemiesOnStage(){return this._noEnemiesOnStage}set lifes(t){this._lifes=t}get round(){return this._round}get timeStep(){return this._timeStep}set timeStep(t){this._timeStep=t}get version(){return this._version}set version(t){this._version=t}checkCollisions(){for(let t=0;t<this.bullets.length;t++){const e=this.bullets[t];if(e.outOfStageBoundaries)this.bulletsColliding.push(e);else{let t=e.assignedEnemy;const i={x:e.x,y:e.y},s=e.getPositionNextTick();let r,a;if(t){r={x:t.x,y:t.y};let o=t.life>0?t.boundingRadius:1.65*t.boundingRadius;a=n.isLineSegmentIntersectingCircle(i,s,r,o),a&&this.bulletsColliding.push(e)}else for(let o=0;o<this.enemies.length;o++)if(t=this.enemies[o],r={x:t.x,y:t.y},a=n.isLineSegmentIntersectingCircle(i,s,r,1.25*t.boundingRadius),a){e.assignedEnemy=t,this.bulletsColliding.push(e);break}}}for(let t=0;t<this.glueBullets.length;t++){const e=this.glueBullets[t];if(e.outOfStageBoundaries)this.glueBulletsColliding.push(e);else{let t=e.assignedEnemy;const i={x:e.x,y:e.y},s=e.getPositionNextTick();let r,a;if(t){r={x:t.x,y:t.y};let o=t.life>0?t.boundingRadius:1.65*t.boundingRadius;a=n.isLineSegmentIntersectingCircle(i,s,r,o),a&&this.glueBulletsColliding.push(e)}else for(let o=0;o<this.enemies.length;o++)if(t=this.enemies[o],r={x:t.x,y:t.y},a=n.isLineSegmentIntersectingCircle(i,s,r,1.25*t.boundingRadius),a){e.assignedEnemy=t,this.glueBulletsColliding.push(e);break}}}for(let t=0;t<this.mortars.length;t++)this.mortars[t].detonate&&this.mortarsImpacting.push(this.mortars[t]);for(let t=0;t<this.mines.length;t++)this.mines[t].detonate&&this.minesImpacting.push(this.mines[t]);for(let t=0;t<this.glues.length;t++)this.glues[t].consumed&&this.consumedGlues.push(this.glues[t]);for(let t=0;t<this.enemies.length;t++){const e=this.enemies[t];if(e.type!==s.ENEMY_FLIER){e.affectedByGlue=!1;for(let t=0;t<this.glues.length;t++){const i=this.glues[t];if(!i.consumed){const t=e.x-i.x,s=e.y-i.y,r=n.fixNumber(t*t+s*s);if(n.fixNumber(i.range*i.range)>=r){e.glue(i.intensity);break}}}}}}removeProjectilesAndAccountDamage(){for(let t=0;t<this.bulletsColliding.length;t++){const e=this.bulletsColliding[t],i=e.assignedEnemy;e.outOfStageBoundaries||0===i.life?this.eventDispatcher.dispatchEvent(new v(v.REMOVE_BULLET,[e])):(this.eventDispatcher.dispatchEvent(new v(v.ENEMY_HIT,[[i],e])),i.hit(e.damage,e));const n=this.bullets.indexOf(e);this.bullets.splice(n,1),e.destroy()}this.bulletsColliding.length=0;for(let t=0;t<this.glueBulletsColliding.length;t++){const e=this.glueBulletsColliding[t],i=e.assignedEnemy;e.outOfStageBoundaries||0===i.life?this.eventDispatcher.dispatchEvent(new v(v.REMOVE_GLUE_BULLET,[e])):(this.eventDispatcher.dispatchEvent(new v(v.ENEMY_GLUE_HIT,[[i],e])),i.hitByGlueBullet(e.intensity,e.durationTicks));const n=this.glueBullets.indexOf(e);this.glueBullets.splice(n,1),e.destroy()}this.glueBulletsColliding.length=0;for(let t=0;t<this.mortarsImpacting.length;t++){const e=this.mortarsImpacting[t],i=e.getEnemiesWithinExplosionRange(),n=[];if(i.length>0)for(let t=0;t<i.length;t++){const s=i[t].enemy;s.life>0&&(s.hit(i[t].damage,null,e),n.push(s))}this.eventDispatcher.dispatchEvent(new v(v.ENEMY_HIT,[n,null,e]));const s=this.mortars.indexOf(e);this.mortars.splice(s,1),e.destroy()}this.mortarsImpacting.length=0;for(let t=0;t<this.minesImpacting.length;t++){const e=this.minesImpacting[t],i=e.getEnemiesWithinExplosionRange(),n=[];if(i.length>0)for(let t=0;t<i.length;t++){const s=i[t].enemy;s.life>0&&(s.hit(i[t].damage,null,null,e),n.push(s))}this.eventDispatcher.dispatchEvent(new v(v.ENEMY_HIT,[n,null,null,e]));const s=this.mines.indexOf(e);this.mines.splice(s,1);let r=e.turret;r&&r.numMines--,e.destroy()}this.minesImpacting.length=0;for(let t=0;t<this.consumedGlues.length;t++){const e=this.consumedGlues[t],i=this.glues.indexOf(e);this.glues.splice(i,1),this.eventDispatcher.dispatchEvent(new v(v.GLUE_CONSUMED,[e])),e.destroy()}this.consumedGlues.length=0}teleport(){const t=[];for(let e=0;e<this.teleportedEnemies.length;e++){const i=this.teleportedEnemies[e].enemy;i.teleport(this.teleportedEnemies[e].glueTurret.teleportDistance),t.push({enemy:i,glueTurret:this.teleportedEnemies[e].glueTurret});for(let t=0;t<this.bullets.length;t++){const e=this.bullets[t];e.assignedEnemy&&e.assignedEnemy.id===i.id&&(e.assignedEnemy=null)}for(let t=0;t<this.glueBullets.length;t++){const e=this.glueBullets[t];e.assignedEnemy&&e.assignedEnemy.id===i.id&&(e.assignedEnemy=null)}}this.teleportedEnemies.length=0,t.length>0&&this.eventDispatcher.dispatchEvent(new v(v.ENEMIES_TELEPORTED,[t]))}ageTurrets(){for(let t=0;t<this.turrets.length;t++)this.turrets[t].ageTurret()}spawnEnemies(){let t=this.enemiesSpawner.getEnemy();for(;t;)this.enemiesSpawned++,this.enemiesSpawned===this.waveEnemiesLength&&(this.allEnemiesSpawned=!0,this.enemiesSpawned=0,this.waveEnemiesLength=0),this.enemies.push(t),this.eventDispatcher.dispatchEvent(new v(v.ENEMY_SPAWNED,[t,this.enemiesPathCells[0]])),t=this.enemiesSpawner.getEnemy()}onNoEnemiesOnStage(){this._noEnemiesOnStage=!0,this._credits+=this._bonus,this._creditsEarned+=this._bonus,this._bonus=0,this.eventDispatcher.dispatchEvent(new v(v.NO_ENEMIES_ON_STAGE))}getTurretById(t){let e=null;for(let i=0;i<this.turrets.length;i++)if(this.turrets[i].id===t){e=this.turrets[i];break}return e}generateTurretsAttributes(){this.turretsAttributes={};let t=Object.keys(this.turretData);for(let e=0;e<t.length;e++)this.turretsAttributes[t[e]]=[{},{},{}],t[e]===s.TURRET_PROJECTILE?(this.setAttributes(t[e],1,s.ATTRIBUTE_DAMAGE,100,140,"prev + (prev - pprev) + (i + 2) * 2",10),this.setAttributes(t[e],1,s.ATTRIBUTE_RELOAD,1,.95,"prev - .05",10),this.setAttributes(t[e],1,s.ATTRIBUTE_RANGE,2.5,2.55,"prev + .05",10),this.setAttributes(t[e],1,s.ATTRIBUTE_PRICE_IMPROVEMENT,50,60,"prev + (i + 4) * 2",10),this.turretsAttributes[t[e]][0].priceUpgrade=5600,this.setAttributes(t[e],2,s.ATTRIBUTE_DAMAGE,3400,3560,"prev + (prev - pprev) + 64 + (i - 2) * 26",10),this.setAttributes(t[e],2,s.ATTRIBUTE_RELOAD,.55,.5,"prev - .05",10),this.setAttributes(t[e],2,s.ATTRIBUTE_RANGE,3,3.05,"prev + .05",10),this.setAttributes(t[e],2,s.ATTRIBUTE_PRICE_IMPROVEMENT,470,658,"prev + (prev - pprev) + 75 + (i - 2) * 31",10),this.turretsAttributes[t[e]][1].priceUpgrade=68500,this.setAttributes(t[e],3,s.ATTRIBUTE_DAMAGE,2e4,20100,"prev + (i * 100)",15),this.setAttributes(t[e],3,s.ATTRIBUTE_RELOAD,.2,.19,"prev - .01",15),this.setAttributes(t[e],3,s.ATTRIBUTE_RANGE,3.5,3.55,"prev + .05",15),this.setAttributes(t[e],3,s.ATTRIBUTE_PRICE_IMPROVEMENT,750,1125,"prev + (prev - pprev) + 188 + (i - 2) * 92",15)):t[e]===s.TURRET_LAUNCH?(this.setAttributes(t[e],1,s.ATTRIBUTE_DAMAGE,130,200,"prev + (prev - pprev) + (i + 4) * 2",10),this.setAttributes(t[e],1,s.ATTRIBUTE_EXPLOSION_RANGE,1.5,1.6,"prev + .05",10),this.setAttributes(t[e],1,s.ATTRIBUTE_RELOAD,1.85,1.8,"prev - .05",10),this.setAttributes(t[e],1,s.ATTRIBUTE_RANGE,2.6,2.65,"prev + .05",10),this.setAttributes(t[e],1,s.ATTRIBUTE_PRICE_IMPROVEMENT,80,95,"prev + (prev - pprev) + (i + 3)",10),this.turretsAttributes[t[e]][0].priceUpgrade=1e4,this.setAttributes(t[e],2,s.ATTRIBUTE_DAMAGE,5087,5444,"prev + (prev - pprev) + 150 + (i - 2) * 3",10),this.setAttributes(t[e],2,s.ATTRIBUTE_EXPLOSION_RANGE,2,2.05,"prev + .05",10),this.setAttributes(t[e],2,s.ATTRIBUTE_RELOAD,2.55,2.5,"prev - .05",10),this.setAttributes(t[e],2,s.ATTRIBUTE_RANGE,2.5,2.5,"prev",10),this.setAttributes(t[e],2,s.ATTRIBUTE_PRICE_IMPROVEMENT,750,1050,"prev + (prev - pprev) + 120 + (i - 2) * 48",10),this.turretsAttributes[t[e]][1].priceUpgrade=83e3,this.setAttributes(t[e],3,s.ATTRIBUTE_DAMAGE,5e4,50333,"prev + (prev - pprev) + 34",15),this.setAttributes(t[e],3,s.ATTRIBUTE_EXPLOSION_RANGE,1.75,1.8,"prev + .05",15),this.setAttributes(t[e],3,s.ATTRIBUTE_RELOAD,2.5,2.45,"prev - .05",15),this.setAttributes(t[e],3,s.ATTRIBUTE_RANGE,3,3.1,"prev + .1",15),this.setAttributes(t[e],3,s.ATTRIBUTE_PRICE_IMPROVEMENT,950,1425,"prev + (prev - pprev) + 238 + (i - 2) * 117",15)):t[e]===s.TURRET_LASER?(this.setAttributes(t[e],1,s.ATTRIBUTE_DAMAGE,230,270,"prev + (prev - pprev) + (i + 2) * 2",10),this.setAttributes(t[e],1,s.ATTRIBUTE_RELOAD,1.5,1.4,"prev - .1",10),this.setAttributes(t[e],1,s.ATTRIBUTE_RANGE,3,3.05,"prev + .05",10),this.setAttributes(t[e],1,s.ATTRIBUTE_PRICE_IMPROVEMENT,50,60,"prev + (i + 4) * 2",10),this.turretsAttributes[t[e]][0].priceUpgrade=7e3,this.setAttributes(t[e],2,s.ATTRIBUTE_DAMAGE,4300,4460,"prev + (prev - pprev) + 64 + (i - 2) * 26",10),this.setAttributes(t[e],2,s.ATTRIBUTE_RELOAD,1.5,1.4,"prev - .1",10),this.setAttributes(t[e],2,s.ATTRIBUTE_RANGE,3,3.05,"prev + .05",10),this.setAttributes(t[e],2,s.ATTRIBUTE_PRICE_IMPROVEMENT,580,812,"prev + (prev - pprev) + 93 + (i - 2) * 37",10),this.turretsAttributes[t[e]][1].priceUpgrade=76400,this.setAttributes(t[e],3,s.ATTRIBUTE_DAMAGE,44e3,44333,"prev + (prev - pprev) + 34",15),this.setAttributes(t[e],3,s.ATTRIBUTE_RELOAD,2.5,2.45,"prev - .05",15),this.setAttributes(t[e],3,s.ATTRIBUTE_RANGE,3.05,3.1,"prev + .05",15),this.setAttributes(t[e],3,s.ATTRIBUTE_PRICE_IMPROVEMENT,839,1203,"prev + (prev - pprev) + 239 + (i - 2) * 115",15)):(this.setAttributes(t[e],1,s.ATTRIBUTE_INTENSITY,1.2,1.4,"prev + .2",5),this.setAttributes(t[e],1,s.ATTRIBUTE_DURATION,1.5,1.5,"prev",5),this.setAttributes(t[e],1,s.ATTRIBUTE_RELOAD,2,2,"prev",5),this.setAttributes(t[e],1,s.ATTRIBUTE_RANGE,1.5,1.6,"prev + .1",5),this.setAttributes(t[e],1,s.ATTRIBUTE_PRICE_IMPROVEMENT,100,120,"prev + (prev - pprev) + 4 + (i - 2)",5),this.turretsAttributes[t[e]][0].priceUpgrade=800,this.setAttributes(t[e],2,s.ATTRIBUTE_INTENSITY,1.2,1.5,"prev + 5",5),this.setAttributes(t[e],2,s.ATTRIBUTE_DURATION,2.5,2.5,"prev",5),this.setAttributes(t[e],2,s.ATTRIBUTE_RELOAD,3,3,"prev",5),this.setAttributes(t[e],2,s.ATTRIBUTE_RANGE,2.5,2.7,"prev + .2",5),this.setAttributes(t[e],2,s.ATTRIBUTE_PRICE_IMPROVEMENT,200,240,"prev + (prev - pprev) + (i + 2) * 2",5),this.turretsAttributes[t[e]][1].priceUpgrade=1700,this.setAttributes(t[e],3,s.ATTRIBUTE_TELEPORT_DISTANCE,15,20,"prev + 5",5),this.setAttributes(t[e],3,s.ATTRIBUTE_RELOAD,5,4.5,"prev - .5",5),this.setAttributes(t[e],3,s.ATTRIBUTE_RANGE,3.5,3.5,"prev",5),this.setAttributes(t[e],3,s.ATTRIBUTE_PRICE_IMPROVEMENT,2e3,2400,"prev + (prev - pprev) + (i + 2) * 20",5))}setAttributes(t,e,i,n,s,r,a){let o=[];for(let t=0;t<a;t++)if(0===t)o[t]=n;else if(1===t)o[t]=s;else{n=o[t-2],s=o[t-1];let e=r.replace(/i/g,t.toString());e=e.replace(/pprev/g,n.toString()),e=e.replace(/prev/g,s.toString()),o[t]=Math.round(100*x.eval(e))/100}this.turretsAttributes[t][e-1][i]=o}}class T{constructor(t){this.level=t,this.level.gameConfig.runningInClientSide=!1}run(t,e){const i=new E(this.level.gameConfig,this.level.enemiesData,this.level.turretsData,this.level.wavesData);if(this.level.engineVersion!==i.version)throw new Error(this.errorMessage(s.ERROR_VERSION_MISMATCH,{logsVersion:this.level.engineVersion,engineVersion:i.version}));if(!t.actions||0===t.actions.length)throw new Error(this.errorMessage(s.ERROR_ACTION_ARRAY));const n=t.actions[t.actions.length-1].tick;for(let r=0;r<t.actions.length;r++){const a=t.actions[r];let o={success:!0};if("number"!=typeof a.tick||a.tick<i.ticksCounter)throw new Error(this.errorMessage(s.ERROR_TICKS));for(;i.ticksCounter<a.tick&&i.lifes>0;)i.update(),"function"==typeof e&&i.ticksCounter%100==0&&e({timestamp:new Date,ticksCounter:i.ticksCounter,lastActionTick:n,score:i.score,lifes:i.lifes,round:i.round,credits:i.credits});switch(a.type){case s.ACTION_TYPE_NEXT_WAVE:i.newWave()||(o.error={type:s.ERROR_NEXT_WAVE});break;case s.ACTION_TYPE_ADD_TURRET:o=i.addTurret(a.turretType,a.position);break;case s.ACTION_TYPE_SELL_TURRET:o=i.sellTurret(a.id);break;case s.ACTION_TYPE_UPGRADE_TURRET:o=i.upgradeTurret(a.id);break;case s.ACTION_TYPE_LEVEL_UP_TURRET:o=i.improveTurret(a.id);break;case s.ACTION_TYPE_CHANGE_STRATEGY_TURRET:o=i.setNextStrategy(a.id);break;case s.ACTION_TYPE_CHANGE_FIXED_TARGET_TURRET:o=i.setFixedTarget(a.id);break;default:o={error:{type:s.ERROR_ACTION_TYPE,info:a.type},success:!1}}if(o.error)throw new Error(this.errorMessage(o.error.type,o.error.info));if(i.lifes<=0)break}for(;i.waveActivated&&i.lifes>0;)i.update();if(i.lifes>0)throw new Error(this.errorMessage(s.ERROR_NO_GAME_OVER));return{timestamp:new Date,ticksCounter:i.ticksCounter,lastActionTick:n,score:i.score,lifes:i.lifes,round:i.round,credits:i.credits}}errorMessage(t,e){switch(t){case s.ERROR_VERSION_MISMATCH:return"Version mismatch. Engine Version: "+e.engineVersion+". Logs Version: "+e.logsVersion+".";case s.ERROR_NO_GAME_OVER:return"All actions have been executed without reaching game over.";case s.ERROR_TICKS:return"Ticks have to be greater or equal than the tick of the previous action.";case s.ERROR_ACTION_ARRAY:return"Actions array is empty or null.";case s.ERROR_ACTION_TYPE:return"Missing or wrong action type '"+e+"'.";case s.ERROR_ACTION_VALUE:return"Missing or wrong value for action.";case s.ERROR_TURRET:return"Turret '"+e.id+"' does not exist.";case s.ERROR_CREDITS:return"Not enough credits.";case s.ERROR_NEXT_WAVE:return"Wave launched before 40 ticks.";case s.ERROR_ADD_TURRET_POSITION:return"Invalid position for adding turret.";case s.ERROR_ADD_TURRET_NAME:return"Wrong turret type name '"+e.name+"'.";case s.ERROR_UPGRADE:return"Can't upgrade the turret '"+e.id+"' with max grade.";case s.ERROR_LEVEL_UP:return"Can't level up the turret '"+e.id+"' with max level.";default:return"Unexpected error"}}}i.d(e,"Enemy",(function(){return r})),i.d(e,"HealerEnemy",(function(){return a})),i.d(e,"Bullet",(function(){return o})),i.d(e,"Glue",(function(){return h})),i.d(e,"GlueBullet",(function(){return u})),i.d(e,"GlueTurret",(function(){return l})),i.d(e,"LaserTurret",(function(){return d})),i.d(e,"LaunchTurret",(function(){return m})),i.d(e,"Mine",(function(){return p})),i.d(e,"Mortar",(function(){return f})),i.d(e,"ProjectileTurret",(function(){return g})),i.d(e,"Turret",(function(){return c})),i.d(e,"Event",(function(){return v})),i.d(e,"EventDispatcher",(function(){return y})),i.d(e,"Engine",(function(){return E})),i.d(e,"EngineRunner",(function(){return T})),i.d(e,"GameConstants",(function(){return s}))},function(t,e){t.exports=function(){throw new Error("define cannot be used indirect")}},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(9),a=i(61),o=i(16),h=i(3),u=i(0),c=i(1),l=i(67),d=i(68),p=i(75),f=i(8),m=i(77),g=i(78),v=function(t){function e(){var i=t.call(this,"BattleScene")||this;return e.currentInstance=i,i}return s(e,t),e.prototype.create=function(){u.GameVars.currentScene=this,this.coinsOnStage=0,this.coinsEffectPool=new g.CoinsEffectPool(this,5),this.anims.resumeAll(),h.BattleManager.init(),this.boardContainer=new r.BoardContainer(this),this.add.existing(this.boardContainer),this.hud=new o.HUD(this),this.add.existing(this.hud),this.gui=new a.GUI(this),this.add.existing(this.gui),this.coinsContainer=this.add.container(0,0),this.boardContainer.bringToTop(this.coinsContainer),this.turretMenuContainer=this.add.container(this.boardContainer.x,this.boardContainer.y),this.turretMenuContainer.setScale(this.boardContainer.scaleX,this.boardContainer.scaleY),u.GameVars.gameData.tutorialSeen?this.tutorialLayer=null:(f.TutorialManager.init(),this.tutorialLayer=new m.TutorialLayer(this),this.add.existing(this.tutorialLayer),this.tutorialLayer.show(u.GameVars.gameText[u.GameVars.gameData.language].TUTORIAL_2,u.GameVars.gameText[u.GameVars.gameData.language].TUTORIAL_1)),this.cameras.main.fadeIn(500,33,56,68),c.AudioManager.playMusic("endless_siege_game_soundtrack"),this.turretMenu=new d.TurretMenu(this),this.turretMenuContainer.add(this.turretMenu),this.turretMenu.visible=!1},e.prototype.update=function(t,e){u.GameVars.paused||u.GameVars.semiPaused||u.GameVars.waveOver||(h.BattleManager.update(t,e),this.boardContainer.update(t,e)),this.hud.update(t,e),this.boardContainer.sortActors(),this.coinsEffectPool.update(),this.boardContainer.updatePauseMenu()},e.prototype.createTurret=function(t){this.gui.createTurret(t),this.hideTurretMenu(),this.boardContainer.hideRangeCircles()},e.prototype.showTurretMenu=function(t){this.turretMenu.visible||(this.turretMenu.visible=!0,this.turretMenu.setTurretMenu(t),this.boardContainer.showTurretsLevelLabel())},e.prototype.hideTurretMenu=function(){null!=this.turretMenu&&this.turretMenu.visible&&(this.boardContainer.hideTurretsLevelLabel(),this.turretMenu.clearTurretMenu(),this.turretMenu.visible=!1)},e.prototype.updateTurretMenu=function(){this.turretMenu&&this.turretMenu.checkAndUpdateInfo()},e.prototype.onEnemyReachedExit=function(){var t=new l.FxEnemyTraspass(this);this.add.existing(t),this.hud.onEnemyReachedExit()},e.prototype.addCoinsEffect=function(t,e,i){if(!(u.GameVars.gameOver||this.coinsOnStage>75)){var n=this.boardContainer.x+(this.boardContainer.board.x+t)*u.GameVars.scaleCorrectionFactor,s=this.boardContainer.y+(this.boardContainer.board.y+e-50)*u.GameVars.scaleCorrectionFactor*u.GameVars.scaleY,r=this.coinsEffectPool.getCoinsEffect(n,s,i);this.coinsContainer.add(r),this.coinsOnStage+=r.n}},e.prototype.onCoinsRemoved=function(t){this.coinsOnStage-=t.n,t.visible=!1,this.coinsEffectPool.onCoinsEffectRemoved(t),this.coinsContainer.remove(t)},e.prototype.showGameOverLayer=function(){this.boardContainer.onGameOver();var t=new p.GameOverLayer(this);this.add.existing(t),this.hideTurretMenu(),c.AudioManager.stopMusic(),this.time.delayedCall(850,(function(){c.AudioManager.playSoundEffect("gameover")}),[],this),this.time.delayedCall(1500,(function(){c.AudioManager.playMusic("gameover_loop")}),[],this)},e.prototype.newWave=function(t){this.hud.updateRound(),this.boardContainer.hideTurretsLevelLabel()},e.prototype.hideButtonsAtTutorialStart=function(){this.gui.hideButtonsAtTutorialStart()},e.prototype.onTutorialTurredSelected=function(){this.boardContainer.markCellOnTutorial(),this.tutorialLayer.hide()},e.prototype.onTutorialTurretPlaced=function(){this.gui.showNextWaveButtonInTutorial(),this.tutorialLayer.show(u.GameVars.gameText[u.GameVars.gameData.language].TUTORIAL_3)},e.prototype.onFirstWaveReleased=function(){this.tutorialLayer.hide()},e.prototype.onFirstEnemyKilled=function(){this.tutorialLayer.show(u.GameVars.gameText[u.GameVars.gameData.language].TUTORIAL_4),this.boardContainer.onFirstEnemyKilled()},e.prototype.onTurretMenuShown=function(){this.tutorialLayer.hide()},e.prototype.onTurretUpgraded=function(){this.gui.showButtonsAfterTutorialCompletion(),this.boardContainer.hideRangeCircles(),this.hideTurretMenu(),this.tutorialLayer.show(u.GameVars.gameText[u.GameVars.gameData.language].TUTORIAL_5)},e.prototype.onSpeedX2=function(){this.tutorialLayer.show(u.GameVars.gameText[u.GameVars.gameData.language].TUTORIAL_6)},e.prototype.onSpeedX3=function(){this.tutorialLayer.show(u.GameVars.gameText[u.GameVars.gameData.language].TUTORIAL_7)},e.prototype.onSpeedX1=function(){this.tutorialLayer.hide()},e.prototype.onTutorialOver=function(){this.tutorialLayer.showFinalMenu(u.GameVars.gameText[u.GameVars.gameData.language].TUTORIAL_8)},e.prototype.semiPause=function(){this.boardContainer.showTurretsLevelLabel()},e.prototype.semiResume=function(){this.boardContainer.hideTurretsLevelLabel()},e}(Phaser.Scene);e.BattleScene=v},function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=i(0),o=i(1),h=n(i(30)),u=s(i(31)),c=function(){function t(){}return t.init=function(){if(a.GameVars.mapsData=h.default,a.GameVars.isDesktop)a.GameVars.scaleY=1,a.GameVars.scaleCorrectionFactor=1;else{a.GameVars.currentScene.game.scale.displaySize=a.GameVars.currentScene.game.scale.parentSize,a.GameVars.currentScene.game.scale.refresh();var e=window.innerHeight/window.innerWidth;a.GameVars.scaleY=r.GameConstants.GAME_HEIGHT/r.GameConstants.GAME_WIDTH/e,a.GameVars.scaleCorrectionFactor=e>1.5?1.2:e<1.33?.8:1}var i=new Date,n=t.hashCode(i.getDay()+"/"+i.getMonth()+"/"+i.getFullYear());a.GameVars.seedRandom=u.default(n),t.readGameData()},t.readGameData=function(){t.getGameStorageData(r.GameConstants.SAVED_GAME_DATA_KEY,(function(e){a.GameVars.gameData=e?JSON.parse(e):{soundMuted:!1,musicMuted:!1,language:r.GameConstants.LANGUAGE_ENGLISH,scores:[],tutorialSeen:!1,googleUser:null},t.startGame((new Date).getDate()-1)}))},t.setCurrentScene=function(t){a.GameVars.currentScene=t},t.onGameAssetsLoaded=function(){GAMESNACKS.gameReady(),o.AudioManager.init(),a.GameVars.gameText=a.GameVars.currentScene.cache.json.get("game-text"),t.enterSplashScene()},t.enterSplashScene=function(){a.GameVars.currentScene.scene.start("SplashScene")},t.enterBattleScene=function(){a.GameVars.currentScene.scene.start("BattleScene")},t.reset=function(){a.GameVars.gameOver?t.enterSplashScene():t.enterBattleScene()},t.writeGameData=function(){t.setGameStorageData(r.GameConstants.SAVED_GAME_DATA_KEY,a.GameVars.gameData,(function(){t.log("game data successfully saved")}))},t.log=function(t,e){r.GameConstants.VERBOSE&&(e?console.error(t+":",e):console.log(t))},t.getTimeUntilEndOfDay=function(){var t=new Date;return 86400-60*t.getHours()*60-60*t.getMinutes()-t.getSeconds()},t.generateObstaclesBoard=function(){a.GameVars.obstaclesBoard=[];for(var t=0;t<22;t++){a.GameVars.obstaclesBoard[t]=[];for(var e=0;e<14;e++)a.GameVars.obstaclesBoard[t][e]=0}var i=Math.floor(5*a.GameVars.seedRandom())+1,n=i;for(t=0;t<22;t++)for(e=0;e<14;e++){var s=e-1,r=t-8;a.GameVars.seedRandom()<.1&&(i=Math.floor(4*a.GameVars.seedRandom())+6),(r<0||-1===s||12===s)&&(-1===a.GameVars.enemiesPathCells[0].r?(s>a.GameVars.enemiesPathCells[0].c+1||s<a.GameVars.enemiesPathCells[0].c-1||r>a.GameVars.enemiesPathCells[0].r||r<a.GameVars.enemiesPathCells[0].r-1)&&(a.GameVars.obstaclesBoard[t][e]=i):a.GameVars.enemiesPathCells[0].r+1===r&&a.GameVars.enemiesPathCells[0].c===s||(a.GameVars.obstaclesBoard[t][e]=i)),i=n}for(t=0;t<a.GameVars.plateausCells.length;t++)a.GameVars.seedRandom()<.1&&(i=Math.floor(4*a.GameVars.seedRandom())+6),a.GameVars.obstaclesBoard[a.GameVars.plateausCells[t].r+8][a.GameVars.plateausCells[t].c+1]=i,i=n;for(t=0;t<a.GameVars.obstaclesBoard.length;t++)for(e=0;e<a.GameVars.obstaclesBoard[0].length;e++)if(0!==a.GameVars.obstaclesBoard[t][e]){var o=[];if(o.push({i:t,j:e}),0!==t&&0!==a.GameVars.obstaclesBoard[t-1][e]&&o.push({i:t-1,j:e}),t!==a.GameVars.obstaclesBoard.length-1&&0!==a.GameVars.obstaclesBoard[t+1][e]&&o.push({i:t+1,j:e}),0!==e&&0!==a.GameVars.obstaclesBoard[t][e-1]&&o.push({i:t,j:e-1}),e!==a.GameVars.obstaclesBoard[0].length-1&&0!==a.GameVars.obstaclesBoard[t][e+1]&&o.push({i:t,j:e+1}),0!==t&&0!==e&&0!==a.GameVars.obstaclesBoard[t-1][e-1]&&o.push({i:t-1,j:e-1}),0!==t&&e!==a.GameVars.obstaclesBoard[0].length-1&&0!==a.GameVars.obstaclesBoard[t-1][e+1]&&o.push({i:t-1,j:e+1}),t!==a.GameVars.obstaclesBoard.length-1&&0!==e&&0!==a.GameVars.obstaclesBoard[t+1][e-1]&&o.push({i:t+1,j:e-1}),t!==a.GameVars.obstaclesBoard.length-1&&e!==a.GameVars.obstaclesBoard[0].length-1&&0!==a.GameVars.obstaclesBoard[t+1][e+1]&&o.push({i:t+1,j:e+1}),o.length>=4&&a.GameVars.seedRandom()<.1)for(var h=0;h<o.length;h++)a.GameVars.obstaclesBoard[o[h].i][o[h].j]=10}},t.startGame=function(e){if(a.GameVars.currentMapId=e,0===a.GameVars.gameData.scores.length)for(var i=0;i<31;i++)a.GameVars.gameData.scores[i]=0;a.GameVars.currentMapData=a.GameVars.mapsData[e],a.GameVars.enemiesPathCells=a.GameVars.currentMapData.path,a.GameVars.plateausCells=a.GameVars.currentMapData.plateaus,t.generateObstaclesBoard(),a.GameVars.currentScene.scene.start("PreloadScene")},t.getGameStorageData=function(t,e){e(localStorage.getItem(t))},t.setGameStorageData=function(t,e,i){localStorage.setItem(t,JSON.stringify(e)),i()},t.hashCode=function(t){return t.split("").reduce((function(t,e){return(t=(t<<5)-t+e.charCodeAt(0))&t}),0).toString()},t}();e.GameManager=c},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(6),s=i(3),r=i(0),a=i(7),o=function(){function t(){}return t.init=function(){t.isTurretPlaced=!1,t.isFirstEnemyKilled=!1,t.isSpeedControlShown=!1,t.hasFirstWaveBeenReleased=!1,t.isTutoriallCompleted=!1,n.BattleScene.currentInstance.hideButtonsAtTutorialStart()},t.onTurredSelected=function(){n.BattleScene.currentInstance.onTutorialTurredSelected()},t.onTurretPlaced=function(){t.isTurretPlaced=!0,n.BattleScene.currentInstance.onTutorialTurretPlaced()},t.onFirstWaveReleased=function(){t.hasFirstWaveBeenReleased=!0,n.BattleScene.currentInstance.onFirstWaveReleased()},t.onFirstEnemyKilled=function(){t.isFirstEnemyKilled=!0,s.BattleManager.semiPause(),n.BattleScene.currentInstance.onFirstEnemyKilled()},t.onTurretMenuShown=function(){n.BattleScene.currentInstance.onTurretMenuShown()},t.onTurretUpgraded=function(){n.BattleScene.currentInstance.boardContainer.tutorialTurretUpgraded(),this.isTurretFirstTimeUpgraded||(this.isTurretFirstTimeUpgraded=!0,setTimeout((function(){s.BattleManager.semiResume(),t.isSpeedControlShown=!0,n.BattleScene.currentInstance.onTurretUpgraded()}),700))},t.onSpeedX2=function(){n.BattleScene.currentInstance.onSpeedX2()},t.onSpeedX3=function(){n.BattleScene.currentInstance.onSpeedX3()},t.onSpeedX1=function(){t.isTutoriallCompleted=!0,n.BattleScene.currentInstance.onSpeedX1(),setTimeout((function(){n.BattleScene.currentInstance.onTutorialOver()}),1500)},t.onTutorialOver=function(){r.GameVars.gameData.tutorialSeen=!0,a.GameManager.writeGameData(),a.GameManager.enterBattleScene()},t}();e.TutorialManager=o},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var a=r(i(4)),o=i(29),h=i(40),u=i(41),c=i(2),l=i(0),d=i(42),p=i(46),f=i(47),m=i(48),g=i(49),v=i(50),y=i(3),_=i(51),x=i(53),E=i(1),T=i(54),w=i(55),S=i(14),b=i(6),A=i(8),C=i(56),O=i(58),M=function(t){function e(i){var n=t.call(this,i)||this;return e.currentInstance=n,n.x=c.GameConstants.GAME_WIDTH/2,n.y=c.GameConstants.GAME_HEIGHT/2-c.GameConstants.CELLS_SIZE/2,n.setScale(l.GameVars.scaleCorrectionFactor,l.GameVars.scaleCorrectionFactor*l.GameVars.scaleY),n.createAnimations(),n.enemyActors=[],n.turretActors=[],n.arrowActors=[],n.glueBulletActors=[],n.mortarActors=[],n.mineActors=[],n.rangeCircles=[],n.gluePools=[],n.lastPrePositionTurret=null,n.arrowActorsPool=new C.ArrowActorsPool(n.scene,5),n.enemyActorsPool=new O.EnemyActorsPool(n.scene,20,20,5,5),n.board=new u.Board(n.scene),n.add(n.board),c.GameConstants.SHOW_DEBUG_GEOMETRY&&n.drawDebugGeometry(),n.waterContainer=new Phaser.GameObjects.Container(n.scene),n.board.add(n.waterContainer),n.pointerContainer=new Phaser.GameObjects.Container(n.scene),n.board.add(n.pointerContainer),n.glueCirclesContainer=new Phaser.GameObjects.Container(n.scene),n.board.add(n.glueCirclesContainer),n.pointerContainer.setSize(4*c.GameConstants.GAME_WIDTH,4*c.GameConstants.GAME_HEIGHT),n.pointerContainer.setInteractive(),n.pointerContainer.on("pointerdown",(function(){n.onPointerDown()})),n.board.actorsContainer=new Phaser.GameObjects.Container(n.scene),n.board.add(n.board.actorsContainer),n.shotsContainer=new Phaser.GameObjects.Container(n.scene),n.board.add(n.shotsContainer),n.circlesContainer=new Phaser.GameObjects.Container(n.scene),n.board.add(n.circlesContainer),n.prePosition=new Phaser.GameObjects.Graphics(n.scene),n.prePosition.fillStyle(16777215,.5),n.prePosition.fillRect(-30,-30,60,60),n.prePosition.visible=!1,n.board.add(n.prePosition),n.addObstacles(),n.walls=new w.Walls(n.scene),n.board.add(n.walls),n.board.portalFront&&n.board.bringToTop(n.board.portal),n}return s(e,t),e.prototype.updatePauseMenu=function(){this.pauseMenu&&this.pauseMenu.update()},e.prototype.update=function(t,e){this.enemyActors.forEach((function(i){i.update(t,e)})),this.turretActors.forEach((function(i){i.update(t,e)})),this.arrowActors.forEach((function(i){i.update(t,e)})),this.glueBulletActors.forEach((function(i){i.update(t,e)})),this.mortarActors.forEach((function(i){i.update(t,e)}))},e.prototype.markCellOnTutorial=function(){for(var t,e,i=l.GameVars.enemiesPathCells[6],n=[{c:-1,r:-1},{c:0,r:-1},{c:1,r:-1},{c:-1,r:0},{c:1,r:0},{c:-1,r:1},{c:0,r:1},{c:1,r:1}],s=0;s<n.length;s++){t=i.c+n[s].c,e=i.r+n[s].r;var r=!0;if(t<0||e<0)r=!1;else{for(var a=0;a<l.GameVars.plateausCells.length;a++)if(t===l.GameVars.plateausCells[a].c&&e===l.GameVars.plateausCells[a].r){r=!1;break}for(a=0;a<l.GameVars.enemiesPathCells.length;a++)if(t===l.GameVars.enemiesPathCells[a].c&&e===l.GameVars.enemiesPathCells[a].r){r=!1;break}}if(r)break}this.tutorialPosition={c:t,r:e},this.tutorialTurretContainer=new Phaser.GameObjects.Container(this.scene,(this.tutorialPosition.c+.5)*c.GameConstants.CELLS_SIZE,(this.tutorialPosition.r+.5)*c.GameConstants.CELLS_SIZE-8),this.tutorialTurretContainer.setScale(.8),this.tutorialTurretContainer.alpha=.45,this.board.add(this.tutorialTurretContainer);var o=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_4","archer_1_base");this.tutorialTurretContainer.add(o);var h=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_4","archer_1_top");h.angle=-90,this.tutorialTurretContainer.add(h),this.handCursor=new Phaser.GameObjects.Image(this.scene,(this.tutorialPosition.c+.5)*c.GameConstants.CELLS_SIZE+15,(this.tutorialPosition.r+.5)*c.GameConstants.CELLS_SIZE,"texture_atlas_4","hand_cursor"),this.handCursor.setOrigin(.05,.2),this.board.add(this.handCursor),this.scene.tweens.add({targets:this.handCursor,scaleX:1.1,scaleY:1.1,ease:Phaser.Math.Easing.Cubic.Out,duration:750,yoyo:!0,repeat:-1})},e.prototype.onFirstEnemyKilled=function(){this.turretActors[0].addHandCursor()},e.prototype.sortActors=function(){this.board.actorsContainer.sort("y")},e.prototype.addEnemy=function(t,e){var i=this.enemyActorsPool.getEnemy(t,e);i&&(this.board.actorsContainer.add(i),this.enemyActors.push(i)),this.board.newPortalGlare()},e.prototype.removeEnemy=function(t){var e;for(e=0;e<this.enemyActors.length&&this.enemyActors[e].id!==t;e++);var i=this.enemyActors[e];i&&(this.enemyActors.splice(e,1),this.enemyActorsPool.onEnemyRemovedFromBoard(i),this.board.actorsContainer.remove(i))},e.prototype.addTurret=function(t,e){if(this.prePosition.visible=!1,!(e.r<0||e.c<0||e.r>=l.GameVars.currentMapData.size.r||e.c>=l.GameVars.currentMapData.size.c)){for(var i=0;i<l.GameVars.enemiesPathCells.length;i++)if(e.c===l.GameVars.enemiesPathCells[i].c&&e.r===l.GameVars.enemiesPathCells[i].r)return;for(i=0;i<this.turretActors.length;i++)if(e.c===this.turretActors[i].turret.position.c&&e.r===this.turretActors[i].turret.position.r)return;var n=!0;if(0!==l.GameVars.plateausCells.length)for(i=0;i<l.GameVars.plateausCells.length;i++)if(l.GameVars.plateausCells[i].c===e.c&&l.GameVars.plateausCells[i].r===e.r){n=!1;break}if(n){if(!l.GameVars.gameData.tutorialSeen){if(this.tutorialPosition.c!==e.c||this.tutorialPosition.r!==e.r)return;this.tutorialTurretContainer.destroy(),this.handCursor.destroy(),A.TutorialManager.onTurretPlaced()}var s,r=y.BattleManager.addTurret(t,e);if(r){switch(t){case a.GameConstants.TURRET_PROJECTILE:s=new d.ProjectileTurretActor(this.scene,e,r);break;case a.GameConstants.TURRET_LASER:s=new p.LaserTurretActor(this.scene,e,r);break;case a.GameConstants.TURRET_LAUNCH:s=new m.LaunchTurretActor(this.scene,e,r);break;case a.GameConstants.TURRET_GLUE:s=new v.GlueTurretActor(this.scene,e,r)}this.board.actorsContainer.add(s),this.turretActors.push(s),s.onAddedToBoardContainer(),E.AudioManager.playSoundEffect("turret_planted")}}}},e.prototype.onTurretSold=function(t){var e;for(b.BattleScene.currentInstance.hideTurretMenu(),this.hideRangeCircles(),e=0;e<this.turretActors.length&&this.turretActors[e].id!==t;e++);var i=this.turretActors[e];if(i){var n=new S.SmokeEffect(this.scene);n.x=i.x,n.y=i.y,this.board.actorsContainer.add(n),this.turretActors.splice(e,1),i.sold()}},e.prototype.addBullet=function(t,e){this.getTurretActorByID(e.id).shootArrow();var i=this.arrowActorsPool.getArrow(t);this.shotsContainer.add(i),this.arrowActors.push(i)},e.prototype.addGlueBullet=function(t,e){this.getTurretActorByID(e.id).shootGlue();var i=new x.GlueBulletActor(this.scene,t);this.shotsContainer.add(i),this.glueBulletActors.push(i)},e.prototype.addLaserBeam=function(t,e){for(var i=this.getTurretActorByID(t.id),n=[],s=0;s<e.length;s++)n.push(this.getEnemyActorByID(e[s].id));i.shootLaser(n);var r=new f.LaserBeam(this.scene,i,n,t.grade);this.shotsContainer.add(r)},e.prototype.addMortar=function(t,e){this.getTurretActorByID(e.id).shootMortar();var i=new g.MortarActor(this.scene,t);this.shotsContainer.add(i),this.mortarActors.push(i)},e.prototype.addMine=function(t,e){var i=this.getTurretActorByID(e.id);i.shootMine();var n=new o.MineActor(this.scene,t,i);this.glueCirclesContainer.add(n),this.mineActors.push(n)},e.prototype.addGlue=function(t,e){var i=this.getTurretActorByID(e.id);i.shootGlue();var n=new h.GluePool(this.scene,i,t);this.glueCirclesContainer.add(n),this.glueCirclesContainer.sendToBack(n),this.gluePools.push(n)},e.prototype.onGlueConsumed=function(t){for(var e=null,i=0;i<this.gluePools.length;i++)if(t.id===this.gluePools[i].id){e=this.gluePools[i],this.gluePools.splice(i,1),e.destroy();break}},e.prototype.onEnemyHit=function(t,e){var i=this.getEnemyActorByID(t.id);i&&!i.isDead&&i.hit(e)},e.prototype.onEnemyGlueHit=function(t){var e=this.getEnemyActorByID(t.id);e&&!e.isDead&&e.glueHit()},e.prototype.onEnemyKilled=function(t){var e=this.getEnemyActorByID(t.id);e&&e.die()},e.prototype.teleportEnemy=function(t,e){var i=this.getEnemyActorByID(t.id);if(i&&!i.isDead){i.teleport(e),E.AudioManager.playSoundEffect("t3_teleport");var n=new Phaser.GameObjects.Sprite(this.scene,i.x,i.y-10,"texture_atlas_3");this.scene.add.existing(n),this.board.add(n),n.anims.play("teleport_in"),n.on("animationcomplete",(function(){n.destroy()}),this)}},e.prototype.teleportEnd=function(t){var e=new Phaser.GameObjects.Sprite(this.scene,t.x,t.y-10,"texture_atlas_3");this.scene.add.existing(e),this.board.add(e),e.anims.play("teleport_out"),e.on("animationcomplete",(function(){e.destroy()}),this)},e.prototype.removeBullet=function(t){for(var e=null,i=0;i<this.arrowActors.length;i++)if(this.arrowActors[i].bullet.id===t.id){e=this.arrowActors[i];break}if(e){i=this.arrowActors.indexOf(e);this.arrowActors.splice(i,1),this.shotsContainer.remove(e),this.arrowActorsPool.onArrowRemovedFromBoard(e)}},e.prototype.removeGlueBullet=function(t){for(var e=null,i=0;i<this.glueBulletActors.length;i++)if(this.glueBulletActors[i].glueBullet.id===t.id){e=this.glueBulletActors[i];break}if(e){i=this.glueBulletActors.indexOf(e);this.glueBulletActors.splice(i,1),e.destroy()}},e.prototype.detonateMortar=function(t){for(var e=null,i=0;i<this.mortarActors.length;i++)if(this.mortarActors[i].mortar.id===t.id){e=this.mortarActors[i];break}e&&e.detonate()},e.prototype.detonateMine=function(t){for(var e=null,i=0;i<this.mineActors.length;i++)if(this.mineActors[i].mine.id===t.id){e=this.mineActors[i];break}e&&e.detonate()},e.prototype.removeMortar=function(t){var e=this.mortarActors.indexOf(t);this.mortarActors.splice(e,1),t.destroy()},e.prototype.removeMine=function(t){var e=this.mineActors.indexOf(t);this.mineActors.splice(e,1),t.destroy()},e.prototype.upgradeTurret=function(t){this.getTurretActorByID(t).upgrade()},e.prototype.improveTurret=function(t){this.getTurretActorByID(t).improve()},e.prototype.getTurretActorByID=function(t){for(var e=null,i=0;i<this.turretActors.length;i++)if(this.turretActors[i].id===t){e=this.turretActors[i];break}return e},e.prototype.getEnemyActorByID=function(t){for(var e=null,i=0;i<this.enemyActors.length;i++)if(this.enemyActors[i].id===t){e=this.enemyActors[i];break}return e},e.prototype.createRangeCircle=function(t,e,i){var n=new Phaser.GameObjects.Image(this.scene,e,i,"texture_atlas_4","shoot_range");return n.setScale(2*t/n.width),n.visible=!1,this.circlesContainer.add(n),this.rangeCircles.push(n),n},e.prototype.hideRangeCircles=function(){for(var t=0;t<this.rangeCircles.length;t++)this.rangeCircles[t].visible=!1;this.board.hideTurretFrame()},e.prototype.showPauseMenu=function(){this.pauseMenu?this.hidePauseMenu():(y.BattleManager.pause(),this.pauseMenu=new _.PauseMenu(this.scene),b.BattleScene.currentInstance.add.existing(this.pauseMenu),this.pauseMenu.setScale(this.scaleX,this.scaleY),this.pauseMenu.x=this.x,this.pauseMenu.y=this.y-150,this.hideRangeCircles(),b.BattleScene.currentInstance.hideTurretMenu())},e.prototype.hidePauseMenu=function(){this.pauseMenu&&(y.BattleManager.resume(),this.pauseMenu.destroy(),this.pauseMenu=null,this.pauseMenu=null)},e.prototype.onGameOver=function(){this.pauseMenu&&this.hidePauseMenu()},e.prototype.showRoundCompletedLayer=function(){8!==l.GameVars.timeStepFactor&&!l.GameVars.autoSendWave&&l.GameVars.gameData.tutorialSeen&&(this.roundCompletedLayer=new T.RoundCompletedLayer(this.scene),this.add(this.roundCompletedLayer),this.showTurretsLevelLabel())},e.prototype.hideRoundCompletedLayer=function(){this.remove(this.roundCompletedLayer),this.roundCompletedLayer=null},e.prototype.setTurretPrePosition=function(t,e){this.prePosition.visible||(this.prePosition.visible=!0);var i=!0;(t<0||t>=this.board.boardMatrix[0].length||e<0||e>=this.board.boardMatrix.length||1===this.board.boardMatrix[e][t])&&(i=!1);for(var n=0;n<this.turretActors.length;n++)this.turretActors[n].turret.position.c===t&&this.turretActors[n].turret.position.r===e&&(i=!1);for(n=0;n<l.GameVars.plateausCells.length;n++)l.GameVars.plateausCells[n].c===t&&l.GameVars.plateausCells[n].r===e&&(i=!1);l.GameVars.gameData.tutorialSeen||this.tutorialPosition.c===t&&this.tutorialPosition.r===e||(i=!1),this.prePosition.clear(),i?(this.prePosition.fillStyle(16777215,.5),this.prePosition.fillRect(-30,-30,60,60),null===this.lastPrePositionTurret||this.lastPrePositionTurret.c===t&&this.lastPrePositionTurret.r===e||E.AudioManager.playSoundEffect("drag_over_buildable_cell")):(this.prePosition.fillStyle(16711680,.5),this.prePosition.fillRect(-30,-30,60,60),null===this.lastPrePositionTurret||this.lastPrePositionTurret.c===t&&this.lastPrePositionTurret.r===e||E.AudioManager.playSoundEffect("drag_over_non_buildable_cell")),this.lastPrePositionTurret={c:t,r:e},this.prePosition.setPosition(c.GameConstants.CELLS_SIZE*t+c.GameConstants.CELLS_SIZE/2,c.GameConstants.CELLS_SIZE*e+c.GameConstants.CELLS_SIZE/2)},e.prototype.showTurretsLevelLabel=function(){for(var t=0;t<this.turretActors.length;t++)this.turretActors[t].showLevel()},e.prototype.tutorialTurretUpgraded=function(){A.TutorialManager.isTurretFirstTimeUpgraded||(this.turretActors[0].level=1),++this.turretActors[0].level,this.turretActors[0].hideLevel(),this.turretActors[0].showLevel()},e.prototype.hideTurretsLevelLabel=function(){if(l.GameVars.semiPaused)this.showTurretsLevelLabel();else for(var t=0;t<this.turretActors.length;t++)this.turretActors[t].hideLevel()},e.prototype.addObstacles=function(){for(var t=0;t<l.GameVars.obstaclesBoard.length;t++)for(var e=0;e<l.GameVars.obstaclesBoard[0].length;e++){if(10===l.GameVars.obstaclesBoard[t][e]){var i=new Phaser.GameObjects.Sprite(this.scene,-c.GameConstants.CELLS_SIZE+c.GameConstants.CELLS_SIZE*e+c.GameConstants.CELLS_SIZE/2,8*-c.GameConstants.CELLS_SIZE+c.GameConstants.CELLS_SIZE*t+c.GameConstants.CELLS_SIZE/2,"texture_atlas_1");this.scene.add.existing(i),i.anims.play("water"),this.waterContainer.add(i);var n=this.addWaterEdges(t,e);(parseInt(n)>=3&&parseInt(n)<=16||parseInt(n)>=26&&parseInt(n)<=29||24===parseInt(n)||32===parseInt(n)||35===parseInt(n))&&(i=new Phaser.GameObjects.Sprite(this.scene,-c.GameConstants.CELLS_SIZE+c.GameConstants.CELLS_SIZE*e+c.GameConstants.CELLS_SIZE/2,8*-c.GameConstants.CELLS_SIZE+c.GameConstants.CELLS_SIZE*t+c.GameConstants.CELLS_SIZE/2,"texture_atlas_4","water_edge_"+n),this.scene.add.existing(i),this.waterContainer.add(i))}else if(0!==l.GameVars.obstaclesBoard[t][e]){(i=new Phaser.GameObjects.Image(this.scene,-c.GameConstants.CELLS_SIZE+c.GameConstants.CELLS_SIZE*e+c.GameConstants.CELLS_SIZE/2,7*-c.GameConstants.CELLS_SIZE+c.GameConstants.CELLS_SIZE*t,"texture_atlas_1","obstacle_0"+l.GameVars.obstaclesBoard[t][e])).setOrigin(.5,1),this.board.actorsContainer.add(i)}this.addWaterEdges(t,e)}},e.prototype.addWaterEdges=function(t,e){var i=[0,0,0,1,1,1,0,0];l.GameVars.obstaclesBoard[t-1]&&l.GameVars.obstaclesBoard[t-1][e]&&10===l.GameVars.obstaclesBoard[t-1][e]&&(i[0]=1),l.GameVars.obstaclesBoard[t-1]&&l.GameVars.obstaclesBoard[t-1][e+1]&&10===l.GameVars.obstaclesBoard[t-1][e+1]&&(i[1]=1),l.GameVars.obstaclesBoard[t]&&l.GameVars.obstaclesBoard[t][e+1]&&10===l.GameVars.obstaclesBoard[t][e+1]&&(i[2]=1),l.GameVars.obstaclesBoard[t]&&l.GameVars.obstaclesBoard[t][e-1]&&10===l.GameVars.obstaclesBoard[t][e-1]&&(i[6]=1),l.GameVars.obstaclesBoard[t-1]&&l.GameVars.obstaclesBoard[t-1][e-1]&&10===l.GameVars.obstaclesBoard[t-1][e-1]&&(i[7]=1);var n="";return 0===i[0]&&0===i[2]&&0===i[4]&&0===i[6]?n+="01":0===i[0]&&0===i[2]&&0===i[6]?n+="03":0===i[0]&&0===i[2]&&0===i[4]?n+="04":0===i[6]&&0===i[2]&&0===i[4]?n+="05":0===i[6]&&0===i[0]&&0===i[4]?n+="06":0===i[0]&&0===i[2]?1===i[5]?n+="07":n+="38":0===i[0]&&0===i[6]?1===i[3]?n+="08":n+="41":0===i[2]&&0===i[4]?1===i[7]?n+="09":n+="39":0===i[6]&&0===i[4]?1===i[1]?n+="10":n+="40":0===i[0]&&0===i[4]?n+="11":0===i[2]&&0===i[6]?n+="12":0===i[6]?0===i[1]&&0===i[3]?n+="45":0===i[1]?n+="35":0===i[3]?n+="36":n+="13":0===i[0]?0===i[5]&&0===i[3]?n+="42":0===i[5]?n+="30":0===i[3]?n+="37":n+="14":0===i[2]?0===i[5]&&0===i[7]?n+="43":0===i[5]?n+="31":0===i[7]?n+="32":n+="15":0===i[4]?0===i[1]&&0===i[7]?n+="44":0===i[1]?n+="34":0===i[7]?n+="33":n+="16":0===i[1]&&0===i[3]&&0===i[5]&&0===i[7]?n+="17":0===i[3]&&0===i[5]&&0===i[7]?n+="18":0===i[5]&&0===i[1]&&0===i[7]?n+="19":0===i[3]&&0===i[1]&&0===i[7]?n+="20":0===i[3]&&0===i[1]&&0===i[5]?n+="21":0===i[3]&&0===i[5]?n+="22":0===i[7]&&0===i[5]?n+="23":0===i[7]&&0===i[1]?n+="24":0===i[3]&&0===i[1]?n+="25":0===i[5]?n+="26":0===i[7]?n+="27":0===i[1]?n+="28":0===i[3]?n+="29":n+="02",n},e.prototype.drawDebugGeometry=function(){var t=new Phaser.GameObjects.Graphics(this.scene);t.lineStyle(2,16753920);for(var e=0;e<l.GameVars.enemiesPathCells.length-1;e++){var i=(l.GameVars.enemiesPathCells[e].c+.5)*c.GameConstants.CELLS_SIZE,n=(l.GameVars.enemiesPathCells[e].r+.5)*c.GameConstants.CELLS_SIZE;t.moveTo(i,n),i=(l.GameVars.enemiesPathCells[e+1].c+.5)*c.GameConstants.CELLS_SIZE,n=(l.GameVars.enemiesPathCells[e+1].r+.5)*c.GameConstants.CELLS_SIZE,t.lineTo(i,n),t.stroke()}this.board.add(t)},e.prototype.onPointerDown=function(){l.GameVars.gameData.tutorialSeen&&(this.pauseMenu?this.hidePauseMenu():(this.hideRangeCircles(),b.BattleScene.currentInstance.hideTurretMenu()))},e.prototype.createAnimations=function(){this.scene.anims.create({key:"enemy_blob_back",frames:this.scene.anims.generateFrameNames("texture_atlas_2",{prefix:"enemy_blob_back_",start:1,end:11,zeroPad:2,suffix:""}),frameRate:c.GameConstants.ENEMY_FRAMERATE,repeat:-1}),this.scene.anims.create({key:"enemy_blob_front",frames:this.scene.anims.generateFrameNames("texture_atlas_2",{prefix:"enemy_blob_front_",start:1,end:11,zeroPad:2,suffix:""}),frameRate:c.GameConstants.ENEMY_FRAMERATE,repeat:-1}),this.scene.anims.create({key:"enemy_blob_left",frames:this.scene.anims.generateFrameNames("texture_atlas_2",{prefix:"enemy_blob_left_",start:1,end:11,zeroPad:2,suffix:""}),frameRate:c.GameConstants.ENEMY_FRAMERATE,repeat:-1}),this.scene.anims.create({key:"enemy_blob_right",frames:this.scene.anims.generateFrameNames("texture_atlas_2",{prefix:"enemy_blob_right_",start:1,end:11,zeroPad:2,suffix:""}),frameRate:c.GameConstants.ENEMY_FRAMERATE,repeat:-1}),this.scene.anims.create({key:"enemy_flier_back",frames:this.scene.anims.generateFrameNames("texture_atlas_2",{prefix:"enemy_flier_back_",start:1,end:11,zeroPad:2,suffix:""}),frameRate:c.GameConstants.ENEMY_FRAMERATE,repeat:-1}),this.scene.anims.create({key:"enemy_flier_front",frames:this.scene.anims.generateFrameNames("texture_atlas_2",{prefix:"enemy_flier_front_",start:1,end:11,zeroPad:2,suffix:""}),frameRate:c.GameConstants.ENEMY_FRAMERATE,repeat:-1}),this.scene.anims.create({key:"enemy_flier_left",frames:this.scene.anims.generateFrameNames("texture_atlas_2",{prefix:"enemy_flier_left_",start:1,end:11,zeroPad:2,suffix:""}),frameRate:c.GameConstants.ENEMY_FRAMERATE,repeat:-1}),this.scene.anims.create({key:"enemy_flier_right",frames:this.scene.anims.generateFrameNames("texture_atlas_2",{prefix:"enemy_flier_right_",start:1,end:11,zeroPad:2,suffix:""}),frameRate:c.GameConstants.ENEMY_FRAMERATE,repeat:-1}),this.scene.anims.create({key:"enemy_healer_back",frames:this.scene.anims.generateFrameNames("texture_atlas_2",{prefix:"enemy_healer_back_",start:1,end:11,zeroPad:2,suffix:""}),frameRate:c.GameConstants.ENEMY_FRAMERATE,repeat:-1}),this.scene.anims.create({key:"enemy_healer_front",frames:this.scene.anims.generateFrameNames("texture_atlas_2",{prefix:"enemy_healer_front_",start:1,end:11,zeroPad:2,suffix:""}),frameRate:c.GameConstants.ENEMY_FRAMERATE,repeat:-1}),this.scene.anims.create({key:"enemy_healer_left",frames:this.scene.anims.generateFrameNames("texture_atlas_2",{prefix:"enemy_healer_left_",start:1,end:11,zeroPad:2,suffix:""}),frameRate:c.GameConstants.ENEMY_FRAMERATE,repeat:-1}),this.scene.anims.create({key:"enemy_healer_right",frames:this.scene.anims.generateFrameNames("texture_atlas_2",{prefix:"enemy_healer_right_",start:1,end:11,zeroPad:2,suffix:""}),frameRate:c.GameConstants.ENEMY_FRAMERATE,repeat:-1}),this.scene.anims.create({key:"enemy_runner_back",frames:this.scene.anims.generateFrameNames("texture_atlas_2",{prefix:"enemy_runner_back_",start:1,end:11,zeroPad:2,suffix:""}),frameRate:2*c.GameConstants.ENEMY_FRAMERATE,repeat:-1}),this.scene.anims.create({key:"enemy_runner_front",frames:this.scene.anims.generateFrameNames("texture_atlas_2",{prefix:"enemy_runner_front_",start:1,end:11,zeroPad:2,suffix:""}),frameRate:2*c.GameConstants.ENEMY_FRAMERATE,repeat:-1}),this.scene.anims.create({key:"enemy_runner_left",frames:this.scene.anims.generateFrameNames("texture_atlas_2",{prefix:"enemy_runner_left_",start:1,end:11,zeroPad:2,suffix:""}),frameRate:2*c.GameConstants.ENEMY_FRAMERATE,repeat:-1}),this.scene.anims.create({key:"enemy_runner_right",frames:this.scene.anims.generateFrameNames("texture_atlas_2",{prefix:"enemy_runner_right_",start:1,end:11,zeroPad:2,suffix:""}),frameRate:2*c.GameConstants.ENEMY_FRAMERATE,repeat:-1}),this.scene.anims.create({key:"enemy_soldier_back",frames:this.scene.anims.generateFrameNames("texture_atlas_2",{prefix:"enemy_soldier_back_",start:1,end:11,zeroPad:2,suffix:""}),frameRate:c.GameConstants.ENEMY_FRAMERATE,repeat:-1}),this.scene.anims.create({key:"enemy_soldier_front",frames:this.scene.anims.generateFrameNames("texture_atlas_2",{prefix:"enemy_soldier_front_",start:1,end:11,zeroPad:2,suffix:""}),frameRate:c.GameConstants.ENEMY_FRAMERATE,repeat:-1}),this.scene.anims.create({key:"enemy_soldier_left",frames:this.scene.anims.generateFrameNames("texture_atlas_2",{prefix:"enemy_soldier_left_",start:1,end:11,zeroPad:2,suffix:""}),frameRate:c.GameConstants.ENEMY_FRAMERATE,repeat:-1}),this.scene.anims.create({key:"enemy_soldier_right",frames:this.scene.anims.generateFrameNames("texture_atlas_2",{prefix:"enemy_soldier_right_",start:1,end:11,zeroPad:2,suffix:""}),frameRate:c.GameConstants.ENEMY_FRAMERATE,repeat:-1}),this.scene.anims.create({key:"bolt",frames:this.scene.anims.generateFrameNames("texture_atlas_3",{prefix:"bolt_",start:0,end:13,zeroPad:2,suffix:""}),frameRate:30,repeat:0}),this.scene.anims.create({key:"flame",frames:this.scene.anims.generateFrameNames("texture_atlas_3",{prefix:"flame_",start:0,end:29,zeroPad:2,suffix:""}),frameRate:30,repeat:0}),this.scene.anims.create({key:"plasma_blast",frames:this.scene.anims.generateFrameNames("texture_atlas_3",{prefix:"plasma_blast_",start:1,end:3,zeroPad:1,suffix:""}),frameRate:30,repeat:-1}),this.scene.anims.create({key:"heal",frames:this.scene.anims.generateFrameNames("texture_atlas_3",{prefix:"heal_fx_",start:1,end:36,zeroPad:2,suffix:""}),frameRate:30,repeat:0}),this.scene.anims.create({key:"electricity",frames:this.scene.anims.generateFrameNames("texture_atlas_4",{prefix:"electricity_",start:0,end:11,zeroPad:2,suffix:""}),frameRate:24,repeat:-1}),this.scene.anims.create({key:"fire",frames:this.scene.anims.generateFrameNames("texture_atlas_4",{prefix:"fire_",start:0,end:23,zeroPad:2,suffix:""}),frameRate:24,repeat:-1}),this.scene.anims.create({key:"plasma",frames:this.scene.anims.generateFrameNames("texture_atlas_4",{prefix:"plasma_",start:0,end:17,zeroPad:2,suffix:""}),frameRate:24,repeat:-1}),this.scene.anims.create({key:"snow_shoot",frames:this.scene.anims.generateFrameNames("texture_atlas_4",{prefix:"fx_snow_shoot_",start:1,end:16,zeroPad:2,suffix:""}),frameRate:30,repeat:0}),this.scene.anims.create({key:"explosion",frames:this.scene.anims.generateFrameNames("texture_atlas_4",{prefix:"explossion_",start:1,end:28,zeroPad:2,suffix:""}),frameRate:60,repeat:0}),this.scene.anims.create({key:"crystal_top",frames:this.scene.anims.generateFrameNames("texture_atlas_4",{prefix:"crystal_1_top_",start:1,end:18,zeroPad:2,suffix:""}),frameRate:16,repeat:-1}),this.scene.anims.create({key:"portal_inner_fx",frames:this.scene.anims.generateFrameNames("texture_atlas_4",{prefix:"portal_inner_fx_",start:1,end:13,zeroPad:4,suffix:""}),frameRate:12,repeat:-1}),this.scene.anims.create({key:"teleport_in",frames:this.scene.anims.generateFrameNames("texture_atlas_3",{prefix:"teleport_in_",start:1,end:23,zeroPad:2,suffix:""}),frameRate:60,repeat:0}),this.scene.anims.create({key:"teleport_out",frames:this.scene.anims.generateFrameNames("texture_atlas_3",{prefix:"teleport_out_",start:1,end:3,zeroPad:2,suffix:""}),frameRate:60,repeat:0}),this.scene.anims.create({key:"glue_fx",frames:this.scene.anims.generateFrameNames("texture_atlas_4",{prefix:"fx_snow_shoot_",start:1,end:16,zeroPad:1,suffix:""}),frameRate:12,repeat:0}),this.scene.anims.create({key:"mine",frames:this.scene.anims.generateFrameNames("texture_atlas_4",{prefix:"mine_falling_",start:1,end:11,zeroPad:2,suffix:""}),frameRate:30,repeat:-1}),this.scene.anims.create({key:"splat",frames:this.scene.anims.generateFrameNames("texture_atlas_4",{prefix:"death_splash_",start:1,end:10,zeroPad:2,suffix:""}),frameRate:20,hideOnComplete:!0}),this.scene.anims.create({key:"red-splat",frames:this.scene.anims.generateFrameNames("texture_atlas_4",{prefix:"red_splash_",start:1,end:10,zeroPad:2,suffix:""}),frameRate:20,hideOnComplete:!0}),this.scene.anims.create({key:"electric_damage",frames:this.scene.anims.generateFrameNames("texture_atlas_4",{prefix:"electric_damage_",start:0,end:17,zeroPad:2,suffix:""}),frameRate:30,repeat:0}),this.scene.anims.create({key:"water",frames:this.scene.anims.generateFrameNames("texture_atlas_1",{prefix:"cell_water_",start:1,end:25,zeroPad:2,suffix:""}),frameRate:16,repeat:-1})},e}(Phaser.GameObjects.Container);e.BoardContainer=M},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(6),a=i(2),o=i(3),h=i(0),u=i(9),c=i(1),l=i(8),d=function(t){function e(e,i,n,s){var r=t.call(this,e)||this;return r.p=n,r.name=i,r.handCursor=null,r.setScale(.9),r.turret=s,r.id=r.turret.id,r.x=a.GameConstants.CELLS_SIZE*(r.p.c+.5),r.y=a.GameConstants.CELLS_SIZE*(r.p.r+.5),r.canonLength=40,r.canonInitialY=0,r.canonAngle=19,r.canonPrevRotation=1.5*Math.PI,r.rangeCircle=o.BattleManager.createRangeCircle(r.turret.range*a.GameConstants.CELLS_SIZE,r.x,r.y),r.levelLabel=new Phaser.GameObjects.BitmapText(r.scene,0,0,"supercell-green","1",17),r.levelLabel.setOrigin(.5),r.add(r.levelLabel),r}return s(e,t),e.prototype.update=function(t,e){var i=this.turret.getEnemiesWithinRange();if(this.turret.fixedTarget?i.length>0?-1===i.indexOf(this.followedEnemy)&&(this.followedEnemy=i[0]):this.followedEnemy=null:i.length>0?this.followedEnemy=i[0]:this.followedEnemy=null,this.followedEnemy){var n=u.BoardContainer.currentInstance.getEnemyActorByID(this.followedEnemy.id);if(n){var s=n.x-this.x,r=n.y-(this.y+this.canonInitialY);this.canon&&this.setCanonRotation(s,r)}}},e.prototype.showLevel=function(){this.bringToTop(this.levelLabel),this.levelLabel.visible=!0,this.levelLabel.text=this.turret.level.toString()},e.prototype.hideLevel=function(){this.levelLabel.visible=!1},e.prototype.onAddedToBoardContainer=function(){h.GameVars.semiPaused?this.showLevel():this.hideLevel()},e.prototype.addHandCursor=function(){this.handCursor=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_4","hand_cursor"),this.handCursor.setOrigin(.05,.2),this.add(this.handCursor),this.scene.tweens.add({targets:this.handCursor,x:25,ease:Phaser.Math.Easing.Cubic.Out,duration:750,yoyo:!1,repeat:-1})},e.prototype.setCanonRotation=function(t,e){var i=Math.atan2(e,t);i<0&&(i=2*Math.PI+i);var n=i-this.canonPrevRotation;n>Math.PI?n-=2*Math.PI:n<-Math.PI&&(n+=2*Math.PI),Math.abs(n)>Math.PI/16&&(n/=2),(i=this.canonPrevRotation+n)>2*Math.PI?i-=2*Math.PI:i<0&&(i+=2*Math.PI);var s=180*i/Math.PI;s=Math.round(s/15),this.canonAngle=Phaser.Math.Clamp(s+1,1,24),this.canonPrevRotation=i},e.prototype.upgrade=function(){for(var t=[],e=0;e<this.length;e++){var i=this.getAt(e);t.push(i),i.alpha=0,i.setScale(.9)}this.scene.tweens.add({targets:t,alpha:1,scaleX:1,scaleY:1,ease:Phaser.Math.Easing.Cubic.Out,duration:400});var n=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_4","glow");n.setScale(0),n.blendMode=Phaser.BlendModes.SCREEN,this.addAt(n,0),this.scene.tweens.add({targets:n,scaleX:1.35,scaleY:1.35,ease:Phaser.Math.Easing.Cubic.Out,duration:200,yoyo:!0,onComplete:function(){n.destroy()},onCompleteScope:this}),this.reloadRangeCircle(),c.AudioManager.playSoundEffect("turret_upgrade")},e.prototype.improve=function(){this.reloadRangeCircle(),this.base.blendMode=Phaser.BlendModes.SCREEN,this.canon&&(this.canon.blendMode=Phaser.BlendModes.SCREEN),this.scene.time.delayedCall(125,(function(){this.base.blendMode=Phaser.BlendModes.NORMAL,this.canon&&(this.canon.blendMode=Phaser.BlendModes.NORMAL)}),[],this)},e.prototype.reloadRangeCircle=function(){this.rangeCircle.setScale(1),this.rangeCircle.setScale(this.turret.range*a.GameConstants.CELLS_SIZE*2/this.rangeCircle.width)},e.prototype.sold=function(){this.scene.tweens.add({targets:this,alpha:0,scaleX:.65,scaleY:.65,ease:Phaser.Math.Easing.Cubic.Out,duration:1e3,onComplete:function(){this.destroy()},onCompleteScope:this}),c.AudioManager.playSoundEffect("sell_turret")},e.prototype.shoot=function(){},e.prototype.onDownTurret=function(){h.GameVars.currentScene===r.BattleScene.currentInstance&&(h.GameVars.paused||o.BattleManager.engine.gameOver||(h.GameVars.gameData.tutorialSeen||l.TutorialManager.isFirstEnemyKilled)&&(o.BattleManager.hideRangeCircles(),o.BattleManager.hideTurretMenu(),this.rangeCircle.visible=!0,h.GameVars.gameData.tutorialSeen?this.levelLabel.visible=!1:(this.handCursor&&(this.handCursor.destroy(),this.handCursor=null),l.TutorialManager.onTurretMenuShown()),r.BattleScene.currentInstance.boardContainer.board.resetTurretFrame(this.x,this.y),o.BattleManager.showTurretMenu(this.turret),c.AudioManager.playSoundEffect("btn_click")))},e}(Phaser.GameObjects.Container);e.TurretActor=d},function(t,e,i){(function(i){var n; /*! * howler.js v2.2.0 * howlerjs.com * * (c) 2013-2020, James Simpson of GoldFire Studios * goldfirestudios.com * * MIT License */!function(){"use strict";var s=function(){this.init()};s.prototype={init:function(){var t=this||r;return t._counter=1e3,t._html5AudioPool=[],t.html5PoolSize=10,t._codecs={},t._howls=[],t._muted=!1,t._volume=1,t._canPlayEvent="canplaythrough",t._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,t.masterGain=null,t.noAudio=!1,t.usingWebAudio=!0,t.autoSuspend=!0,t.ctx=null,t.autoUnlock=!0,t._setup(),t},volume:function(t){var e=this||r;if(t=parseFloat(t),e.ctx||p(),void 0!==t&&t>=0&&t<=1){if(e._volume=t,e._muted)return e;e.usingWebAudio&&e.masterGain.gain.setValueAtTime(t,r.ctx.currentTime);for(var i=0;i<e._howls.length;i++)if(!e._howls[i]._webAudio)for(var n=e._howls[i]._getSoundIds(),s=0;s<n.length;s++){var a=e._howls[i]._soundById(n[s]);a&&a._node&&(a._node.volume=a._volume*t)}return e}return e._volume},mute:function(t){var e=this||r;e.ctx||p(),e._muted=t,e.usingWebAudio&&e.masterGain.gain.setValueAtTime(t?0:e._volume,r.ctx.currentTime);for(var i=0;i<e._howls.length;i++)if(!e._howls[i]._webAudio)for(var n=e._howls[i]._getSoundIds(),s=0;s<n.length;s++){var a=e._howls[i]._soundById(n[s]);a&&a._node&&(a._node.muted=!!t||a._muted)}return e},stop:function(){for(var t=this||r,e=0;e<t._howls.length;e++)t._howls[e].stop();return t},unload:function(){for(var t=this||r,e=t._howls.length-1;e>=0;e--)t._howls[e].unload();return t.usingWebAudio&&t.ctx&&void 0!==t.ctx.close&&(t.ctx.close(),t.ctx=null,p()),t},codecs:function(t){return(this||r)._codecs[t.replace(/^x-/,"")]},_setup:function(){var t=this||r;if(t.state=t.ctx&&t.ctx.state||"suspended",t._autoSuspend(),!t.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(t._canPlayEvent="canplay")}catch(e){t.noAudio=!0}else t.noAudio=!0;try{(new Audio).muted&&(t.noAudio=!0)}catch(t){}return t.noAudio||t._setupCodecs(),t},_setupCodecs:function(){var t=this||r,e=null;try{e="undefined"!=typeof Audio?new Audio:null}catch(e){return t}if(!e||"function"!=typeof e.canPlayType)return t;var i=e.canPlayType("audio/mpeg;").replace(/^no$/,""),n=t._navigator&&t._navigator.userAgent.match(/OPR\/([0-6].)/g),s=n&&parseInt(n[0].split("/")[1],10)<33;return t._codecs={mp3:!(s||!i&&!e.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!i,opus:!!e.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!e.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),aac:!!e.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!e.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(e.canPlayType("audio/x-m4a;")||e.canPlayType("audio/m4a;")||e.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(e.canPlayType("audio/x-m4b;")||e.canPlayType("audio/m4b;")||e.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(e.canPlayType("audio/x-mp4;")||e.canPlayType("audio/mp4;")||e.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!e.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,""),webm:!!e.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,""),dolby:!!e.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(e.canPlayType("audio/x-flac;")||e.canPlayType("audio/flac;")).replace(/^no$/,"")},t},_unlockAudio:function(){var t=this||r;if(!t._audioUnlocked&&t.ctx){t._audioUnlocked=!1,t.autoUnlock=!1,t._mobileUnloaded||44100===t.ctx.sampleRate||(t._mobileUnloaded=!0,t.unload()),t._scratchBuffer=t.ctx.createBuffer(1,1,22050);var e=function(i){for(;t._html5AudioPool.length<t.html5PoolSize;)try{var n=new Audio;n._unlocked=!0,t._releaseHtml5Audio(n)}catch(i){t.noAudio=!0;break}for(var s=0;s<t._howls.length;s++)if(!t._howls[s]._webAudio)for(var r=t._howls[s]._getSoundIds(),a=0;a<r.length;a++){var o=t._howls[s]._soundById(r[a]);o&&o._node&&!o._node._unlocked&&(o._node._unlocked=!0,o._node.load())}t._autoResume();var h=t.ctx.createBufferSource();h.buffer=t._scratchBuffer,h.connect(t.ctx.destination),void 0===h.start?h.noteOn(0):h.start(0),"function"==typeof t.ctx.resume&&t.ctx.resume(),h.onended=function(){h.disconnect(0),t._audioUnlocked=!0,document.removeEventListener("touchstart",e,!0),document.removeEventListener("touchend",e,!0),document.removeEventListener("click",e,!0);for(var i=0;i<t._howls.length;i++)t._howls[i]._emit("unlock")}};return document.addEventListener("touchstart",e,!0),document.addEventListener("touchend",e,!0),document.addEventListener("click",e,!0),t}},_obtainHtml5Audio:function(){var t=this||r;if(t._html5AudioPool.length)return t._html5AudioPool.pop();var e=(new Audio).play();return e&&"undefined"!=typeof Promise&&(e instanceof Promise||"function"==typeof e.then)&&e.catch((function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")})),new Audio},_releaseHtml5Audio:function(t){var e=this||r;return t._unlocked&&e._html5AudioPool.push(t),e},_autoSuspend:function(){var t=this;if(t.autoSuspend&&t.ctx&&void 0!==t.ctx.suspend&&r.usingWebAudio){for(var e=0;e<t._howls.length;e++)if(t._howls[e]._webAudio)for(var i=0;i<t._howls[e]._sounds.length;i++)if(!t._howls[e]._sounds[i]._paused)return t;return t._suspendTimer&&clearTimeout(t._suspendTimer),t._suspendTimer=setTimeout((function(){if(t.autoSuspend){t._suspendTimer=null,t.state="suspending";var e=function(){t.state="suspended",t._resumeAfterSuspend&&(delete t._resumeAfterSuspend,t._autoResume())};t.ctx.suspend().then(e,e)}}),3e4),t}},_autoResume:function(){var t=this;if(t.ctx&&void 0!==t.ctx.resume&&r.usingWebAudio)return"running"===t.state&&"interrupted"!==t.ctx.state&&t._suspendTimer?(clearTimeout(t._suspendTimer),t._suspendTimer=null):"suspended"===t.state||"running"===t.state&&"interrupted"===t.ctx.state?(t.ctx.resume().then((function(){t.state="running";for(var e=0;e<t._howls.length;e++)t._howls[e]._emit("resume")})),t._suspendTimer&&(clearTimeout(t._suspendTimer),t._suspendTimer=null)):"suspending"===t.state&&(t._resumeAfterSuspend=!0),t}};var r=new s,a=function(t){t.src&&0!==t.src.length?this.init(t):console.error("An array of source files must be passed with any new Howl.")};a.prototype={init:function(t){var e=this;return r.ctx||p(),e._autoplay=t.autoplay||!1,e._format="string"!=typeof t.format?t.format:[t.format],e._html5=t.html5||!1,e._muted=t.mute||!1,e._loop=t.loop||!1,e._pool=t.pool||5,e._preload="boolean"!=typeof t.preload&&"metadata"!==t.preload||t.preload,e._rate=t.rate||1,e._sprite=t.sprite||{},e._src="string"!=typeof t.src?t.src:[t.src],e._volume=void 0!==t.volume?t.volume:1,e._xhr={method:t.xhr&&t.xhr.method?t.xhr.method:"GET",headers:t.xhr&&t.xhr.headers?t.xhr.headers:null,withCredentials:!(!t.xhr||!t.xhr.withCredentials)&&t.xhr.withCredentials},e._duration=0,e._state="unloaded",e._sounds=[],e._endTimers={},e._queue=[],e._playLock=!1,e._onend=t.onend?[{fn:t.onend}]:[],e._onfade=t.onfade?[{fn:t.onfade}]:[],e._onload=t.onload?[{fn:t.onload}]:[],e._onloaderror=t.onloaderror?[{fn:t.onloaderror}]:[],e._onplayerror=t.onplayerror?[{fn:t.onplayerror}]:[],e._onpause=t.onpause?[{fn:t.onpause}]:[],e._onplay=t.onplay?[{fn:t.onplay}]:[],e._onstop=t.onstop?[{fn:t.onstop}]:[],e._onmute=t.onmute?[{fn:t.onmute}]:[],e._onvolume=t.onvolume?[{fn:t.onvolume}]:[],e._onrate=t.onrate?[{fn:t.onrate}]:[],e._onseek=t.onseek?[{fn:t.onseek}]:[],e._onunlock=t.onunlock?[{fn:t.onunlock}]:[],e._onresume=[],e._webAudio=r.usingWebAudio&&!e._html5,void 0!==r.ctx&&r.ctx&&r.autoUnlock&&r._unlockAudio(),r._howls.push(e),e._autoplay&&e._queue.push({event:"play",action:function(){e.play()}}),e._preload&&"none"!==e._preload&&e.load(),e},load:function(){var t=null;if(r.noAudio)this._emit("loaderror",null,"No audio support.");else{"string"==typeof this._src&&(this._src=[this._src]);for(var e=0;e<this._src.length;e++){var i,n;if(this._format&&this._format[e])i=this._format[e];else{if("string"!=typeof(n=this._src[e])){this._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}(i=/^data:audio\/([^;,]+);/i.exec(n))||(i=/\.([^.]+)$/.exec(n.split("?",1)[0])),i&&(i=i[1].toLowerCase())}if(i||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),i&&r.codecs(i)){t=this._src[e];break}}if(t)return this._src=t,this._state="loading","https:"===window.location.protocol&&"http:"===t.slice(0,5)&&(this._html5=!0,this._webAudio=!1),new o(this),this._webAudio&&u(this),this;this._emit("loaderror",null,"No codec support for selected audio sources.")}},play:function(t,e){var i=this,n=null;if("number"==typeof t)n=t,t=null;else{if("string"==typeof t&&"loaded"===i._state&&!i._sprite[t])return null;if(void 0===t&&(t="__default",!i._playLock)){for(var s=0,a=0;a<i._sounds.length;a++)i._sounds[a]._paused&&!i._sounds[a]._ended&&(s++,n=i._sounds[a]._id);1===s?t=null:n=null}}var o=n?i._soundById(n):i._inactiveSound();if(!o)return null;if(n&&!t&&(t=o._sprite||"__default"),"loaded"!==i._state){o._sprite=t,o._ended=!1;var h=o._id;return i._queue.push({event:"play",action:function(){i.play(h)}}),h}if(n&&!o._paused)return e||i._loadQueue("play"),o._id;i._webAudio&&r._autoResume();var u=Math.max(0,o._seek>0?o._seek:i._sprite[t][0]/1e3),c=Math.max(0,(i._sprite[t][0]+i._sprite[t][1])/1e3-u),l=1e3*c/Math.abs(o._rate),d=i._sprite[t][0]/1e3,p=(i._sprite[t][0]+i._sprite[t][1])/1e3;o._sprite=t,o._ended=!1;var f=function(){o._paused=!1,o._seek=u,o._start=d,o._stop=p,o._loop=!(!o._loop&&!i._sprite[t][2])};if(!(u>=p)){var m=o._node;if(i._webAudio){var g=function(){i._playLock=!1,f(),i._refreshBuffer(o);var t=o._muted||i._muted?0:o._volume;m.gain.setValueAtTime(t,r.ctx.currentTime),o._playStart=r.ctx.currentTime,void 0===m.bufferSource.start?o._loop?m.bufferSource.noteGrainOn(0,u,86400):m.bufferSource.noteGrainOn(0,u,c):o._loop?m.bufferSource.start(0,u,86400):m.bufferSource.start(0,u,c),l!==1/0&&(i._endTimers[o._id]=setTimeout(i._ended.bind(i,o),l)),e||setTimeout((function(){i._emit("play",o._id),i._loadQueue()}),0)};"running"===r.state&&"interrupted"!==r.ctx.state?g():(i._playLock=!0,i.once("resume",g),i._clearTimer(o._id))}else{var v=function(){m.currentTime=u,m.muted=o._muted||i._muted||r._muted||m.muted,m.volume=o._volume*r.volume(),m.playbackRate=o._rate;try{var n=m.play();if(n&&"undefined"!=typeof Promise&&(n instanceof Promise||"function"==typeof n.then)?(i._playLock=!0,f(),n.then((function(){i._playLock=!1,m._unlocked=!0,e||(i._emit("play",o._id),i._loadQueue())})).catch((function(){i._playLock=!1,i._emit("playerror",o._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),o._ended=!0,o._paused=!0}))):e||(i._playLock=!1,f(),i._emit("play",o._id),i._loadQueue()),m.playbackRate=o._rate,m.paused)return void i._emit("playerror",o._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==t||o._loop?i._endTimers[o._id]=setTimeout(i._ended.bind(i,o),l):(i._endTimers[o._id]=function(){i._ended(o),m.removeEventListener("ended",i._endTimers[o._id],!1)},m.addEventListener("ended",i._endTimers[o._id],!1))}catch(t){i._emit("playerror",o._id,t)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===m.src&&(m.src=i._src,m.load());var y=window&&window.ejecta||!m.readyState&&r._navigator.isCocoonJS;if(m.readyState>=3||y)v();else{i._playLock=!0;var _=function(){v(),m.removeEventListener(r._canPlayEvent,_,!1)};m.addEventListener(r._canPlayEvent,_,!1),i._clearTimer(o._id)}}return o._id}i._ended(o)},pause:function(t){var e=this;if("loaded"!==e._state||e._playLock)return e._queue.push({event:"pause",action:function(){e.pause(t)}}),e;for(var i=e._getSoundIds(t),n=0;n<i.length;n++){e._clearTimer(i[n]);var s=e._soundById(i[n]);if(s&&!s._paused&&(s._seek=e.seek(i[n]),s._rateSeek=0,s._paused=!0,e._stopFade(i[n]),s._node))if(e._webAudio){if(!s._node.bufferSource)continue;void 0===s._node.bufferSource.stop?s._node.bufferSource.noteOff(0):s._node.bufferSource.stop(0),e._cleanBuffer(s._node)}else isNaN(s._node.duration)&&s._node.duration!==1/0||s._node.pause();arguments[1]||e._emit("pause",s?s._id:null)}return e},stop:function(t,e){var i=this;if("loaded"!==i._state||i._playLock)return i._queue.push({event:"stop",action:function(){i.stop(t)}}),i;for(var n=i._getSoundIds(t),s=0;s<n.length;s++){i._clearTimer(n[s]);var r=i._soundById(n[s]);r&&(r._seek=r._start||0,r._rateSeek=0,r._paused=!0,r._ended=!0,i._stopFade(n[s]),r._node&&(i._webAudio?r._node.bufferSource&&(void 0===r._node.bufferSource.stop?r._node.bufferSource.noteOff(0):r._node.bufferSource.stop(0),i._cleanBuffer(r._node)):isNaN(r._node.duration)&&r._node.duration!==1/0||(r._node.currentTime=r._start||0,r._node.pause(),r._node.duration===1/0&&i._clearSound(r._node))),e||i._emit("stop",r._id))}return i},mute:function(t,e){var i=this;if("loaded"!==i._state||i._playLock)return i._queue.push({event:"mute",action:function(){i.mute(t,e)}}),i;if(void 0===e){if("boolean"!=typeof t)return i._muted;i._muted=t}for(var n=i._getSoundIds(e),s=0;s<n.length;s++){var a=i._soundById(n[s]);a&&(a._muted=t,a._interval&&i._stopFade(a._id),i._webAudio&&a._node?a._node.gain.setValueAtTime(t?0:a._volume,r.ctx.currentTime):a._node&&(a._node.muted=!!r._muted||t),i._emit("mute",a._id))}return i},volume:function(){var t,e,i,n=this,s=arguments;if(0===s.length)return n._volume;if(1===s.length||2===s.length&&void 0===s[1]){var a=n._getSoundIds(),o=a.indexOf(s[0]);o>=0?e=parseInt(s[0],10):t=parseFloat(s[0])}else s.length>=2&&(t=parseFloat(s[0]),e=parseInt(s[1],10));if(!(void 0!==t&&t>=0&&t<=1))return(i=e?n._soundById(e):n._sounds[0])?i._volume:0;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"volume",action:function(){n.volume.apply(n,s)}}),n;void 0===e&&(n._volume=t),e=n._getSoundIds(e);for(var h=0;h<e.length;h++)(i=n._soundById(e[h]))&&(i._volume=t,s[2]||n._stopFade(e[h]),n._webAudio&&i._node&&!i._muted?i._node.gain.setValueAtTime(t,r.ctx.currentTime):i._node&&!i._muted&&(i._node.volume=t*r.volume()),n._emit("volume",i._id));return n},fade:function(t,e,i,n){var s=this;if("loaded"!==s._state||s._playLock)return s._queue.push({event:"fade",action:function(){s.fade(t,e,i,n)}}),s;t=Math.min(Math.max(0,parseFloat(t)),1),e=Math.min(Math.max(0,parseFloat(e)),1),i=parseFloat(i),s.volume(t,n);for(var a=s._getSoundIds(n),o=0;o<a.length;o++){var h=s._soundById(a[o]);if(h){if(n||s._stopFade(a[o]),s._webAudio&&!h._muted){var u=r.ctx.currentTime,c=u+i/1e3;h._volume=t,h._node.gain.setValueAtTime(t,u),h._node.gain.linearRampToValueAtTime(e,c)}s._startFadeInterval(h,t,e,i,a[o],void 0===n)}}return s},_startFadeInterval:function(t,e,i,n,s,r){var a=this,o=e,h=i-e,u=Math.abs(h/.01),c=Math.max(4,u>0?n/u:n),l=Date.now();t._fadeTo=i,t._interval=setInterval((function(){var s=(Date.now()-l)/n;l=Date.now(),o+=h*s,o=h<0?Math.max(i,o):Math.min(i,o),o=Math.round(100*o)/100,a._webAudio?t._volume=o:a.volume(o,t._id,!0),r&&(a._volume=o),(i<e&&o<=i||i>e&&o>=i)&&(clearInterval(t._interval),t._interval=null,t._fadeTo=null,a.volume(i,t._id),a._emit("fade",t._id))}),c)},_stopFade:function(t){var e=this._soundById(t);return e&&e._interval&&(this._webAudio&&e._node.gain.cancelScheduledValues(r.ctx.currentTime),clearInterval(e._interval),e._interval=null,this.volume(e._fadeTo,t),e._fadeTo=null,this._emit("fade",t)),this},loop:function(){var t,e,i,n=this,s=arguments;if(0===s.length)return n._loop;if(1===s.length){if("boolean"!=typeof s[0])return!!(i=n._soundById(parseInt(s[0],10)))&&i._loop;t=s[0],n._loop=t}else 2===s.length&&(t=s[0],e=parseInt(s[1],10));for(var r=n._getSoundIds(e),a=0;a<r.length;a++)(i=n._soundById(r[a]))&&(i._loop=t,n._webAudio&&i._node&&i._node.bufferSource&&(i._node.bufferSource.loop=t,t&&(i._node.bufferSource.loopStart=i._start||0,i._node.bufferSource.loopEnd=i._stop)));return n},rate:function(){var t,e,i,n=this,s=arguments;if(0===s.length)e=n._sounds[0]._id;else if(1===s.length){var a=n._getSoundIds(),o=a.indexOf(s[0]);o>=0?e=parseInt(s[0],10):t=parseFloat(s[0])}else 2===s.length&&(t=parseFloat(s[0]),e=parseInt(s[1],10));if("number"!=typeof t)return(i=n._soundById(e))?i._rate:n._rate;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"rate",action:function(){n.rate.apply(n,s)}}),n;void 0===e&&(n._rate=t),e=n._getSoundIds(e);for(var h=0;h<e.length;h++)if(i=n._soundById(e[h])){n.playing(e[h])&&(i._rateSeek=n.seek(e[h]),i._playStart=n._webAudio?r.ctx.currentTime:i._playStart),i._rate=t,n._webAudio&&i._node&&i._node.bufferSource?i._node.bufferSource.playbackRate.setValueAtTime(t,r.ctx.currentTime):i._node&&(i._node.playbackRate=t);var u=n.seek(e[h]),c=(n._sprite[i._sprite][0]+n._sprite[i._sprite][1])/1e3-u,l=1e3*c/Math.abs(i._rate);!n._endTimers[e[h]]&&i._paused||(n._clearTimer(e[h]),n._endTimers[e[h]]=setTimeout(n._ended.bind(n,i),l)),n._emit("rate",i._id)}return n},seek:function(){var t,e,i=this,n=arguments;if(0===n.length)e=i._sounds[0]._id;else if(1===n.length){var s=i._getSoundIds(),a=s.indexOf(n[0]);a>=0?e=parseInt(n[0],10):i._sounds.length&&(e=i._sounds[0]._id,t=parseFloat(n[0]))}else 2===n.length&&(t=parseFloat(n[0]),e=parseInt(n[1],10));if(void 0===e)return i;if("loaded"!==i._state||i._playLock)return i._queue.push({event:"seek",action:function(){i.seek.apply(i,n)}}),i;var o=i._soundById(e);if(o){if(!("number"==typeof t&&t>=0)){if(i._webAudio){var h=i.playing(e)?r.ctx.currentTime-o._playStart:0,u=o._rateSeek?o._rateSeek-o._seek:0;return o._seek+(u+h*Math.abs(o._rate))}return o._node.currentTime}var c=i.playing(e);c&&i.pause(e,!0),o._seek=t,o._ended=!1,i._clearTimer(e),i._webAudio||!o._node||isNaN(o._node.duration)||(o._node.currentTime=t);var l=function(){i._emit("seek",e),c&&i.play(e,!0)};if(c&&!i._webAudio){var d=function(){i._playLock?setTimeout(d,0):l()};setTimeout(d,0)}else l()}return i},playing:function(t){if("number"==typeof t){var e=this._soundById(t);return!!e&&!e._paused}for(var i=0;i<this._sounds.length;i++)if(!this._sounds[i]._paused)return!0;return!1},duration:function(t){var e=this._duration,i=this._soundById(t);return i&&(e=this._sprite[i._sprite][1]/1e3),e},state:function(){return this._state},unload:function(){for(var t=this,e=t._sounds,i=0;i<e.length;i++)e[i]._paused||t.stop(e[i]._id),t._webAudio||(t._clearSound(e[i]._node),e[i]._node.removeEventListener("error",e[i]._errorFn,!1),e[i]._node.removeEventListener(r._canPlayEvent,e[i]._loadFn,!1),r._releaseHtml5Audio(e[i]._node)),delete e[i]._node,t._clearTimer(e[i]._id);var n=r._howls.indexOf(t);n>=0&&r._howls.splice(n,1);var s=!0;for(i=0;i<r._howls.length;i++)if(r._howls[i]._src===t._src||t._src.indexOf(r._howls[i]._src)>=0){s=!1;break}return h&&s&&delete h[t._src],r.noAudio=!1,t._state="unloaded",t._sounds=[],t=null,null},on:function(t,e,i,n){var s=this["_on"+t];return"function"==typeof e&&s.push(n?{id:i,fn:e,once:n}:{id:i,fn:e}),this},off:function(t,e,i){var n=this["_on"+t],s=0;if("number"==typeof e&&(i=e,e=null),e||i)for(s=0;s<n.length;s++){var r=i===n[s].id;if(e===n[s].fn&&r||!e&&r){n.splice(s,1);break}}else if(t)this["_on"+t]=[];else{var a=Object.keys(this);for(s=0;s<a.length;s++)0===a[s].indexOf("_on")&&Array.isArray(this[a[s]])&&(this[a[s]]=[])}return this},once:function(t,e,i){return this.on(t,e,i,1),this},_emit:function(t,e,i){for(var n=this["_on"+t],s=n.length-1;s>=0;s--)n[s].id&&n[s].id!==e&&"load"!==t||(setTimeout(function(t){t.call(this,e,i)}.bind(this,n[s].fn),0),n[s].once&&this.off(t,n[s].fn,n[s].id));return this._loadQueue(t),this},_loadQueue:function(t){if(this._queue.length>0){var e=this._queue[0];e.event===t&&(this._queue.shift(),this._loadQueue()),t||e.action()}return this},_ended:function(t){var e=t._sprite;if(!this._webAudio&&t._node&&!t._node.paused&&!t._node.ended&&t._node.currentTime<t._stop)return setTimeout(this._ended.bind(this,t),100),this;var i=!(!t._loop&&!this._sprite[e][2]);if(this._emit("end",t._id),!this._webAudio&&i&&this.stop(t._id,!0).play(t._id),this._webAudio&&i){this._emit("play",t._id),t._seek=t._start||0,t._rateSeek=0,t._playStart=r.ctx.currentTime;var n=1e3*(t._stop-t._start)/Math.abs(t._rate);this._endTimers[t._id]=setTimeout(this._ended.bind(this,t),n)}return this._webAudio&&!i&&(t._paused=!0,t._ended=!0,t._seek=t._start||0,t._rateSeek=0,this._clearTimer(t._id),this._cleanBuffer(t._node),r._autoSuspend()),this._webAudio||i||this.stop(t._id,!0),this},_clearTimer:function(t){if(this._endTimers[t]){if("function"!=typeof this._endTimers[t])clearTimeout(this._endTimers[t]);else{var e=this._soundById(t);e&&e._node&&e._node.removeEventListener("ended",this._endTimers[t],!1)}delete this._endTimers[t]}return this},_soundById:function(t){for(var e=0;e<this._sounds.length;e++)if(t===this._sounds[e]._id)return this._sounds[e];return null},_inactiveSound:function(){this._drain();for(var t=0;t<this._sounds.length;t++)if(this._sounds[t]._ended)return this._sounds[t].reset();return new o(this)},_drain:function(){var t=this._pool,e=0,i=0;if(!(this._sounds.length<t)){for(i=0;i<this._sounds.length;i++)this._sounds[i]._ended&&e++;for(i=this._sounds.length-1;i>=0;i--){if(e<=t)return;this._sounds[i]._ended&&(this._webAudio&&this._sounds[i]._node&&this._sounds[i]._node.disconnect(0),this._sounds.splice(i,1),e--)}}},_getSoundIds:function(t){if(void 0===t){for(var e=[],i=0;i<this._sounds.length;i++)e.push(this._sounds[i]._id);return e}return[t]},_refreshBuffer:function(t){return t._node.bufferSource=r.ctx.createBufferSource(),t._node.bufferSource.buffer=h[this._src],t._panner?t._node.bufferSource.connect(t._panner):t._node.bufferSource.connect(t._node),t._node.bufferSource.loop=t._loop,t._loop&&(t._node.bufferSource.loopStart=t._start||0,t._node.bufferSource.loopEnd=t._stop||0),t._node.bufferSource.playbackRate.setValueAtTime(t._rate,r.ctx.currentTime),this},_cleanBuffer:function(t){var e=r._navigator&&r._navigator.vendor.indexOf("Apple")>=0;if(r._scratchBuffer&&t.bufferSource&&(t.bufferSource.onended=null,t.bufferSource.disconnect(0),e))try{t.bufferSource.buffer=r._scratchBuffer}catch(t){}return t.bufferSource=null,this},_clearSound:function(t){/MSIE |Trident\//.test(r._navigator&&r._navigator.userAgent)||(t.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var o=function(t){this._parent=t,this.init()};o.prototype={init:function(){var t=this._parent;return this._muted=t._muted,this._loop=t._loop,this._volume=t._volume,this._rate=t._rate,this._seek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++r._counter,t._sounds.push(this),this.create(),this},create:function(){var t=this._parent,e=r._muted||this._muted||this._parent._muted?0:this._volume;return t._webAudio?(this._node=void 0===r.ctx.createGain?r.ctx.createGainNode():r.ctx.createGain(),this._node.gain.setValueAtTime(e,r.ctx.currentTime),this._node.paused=!0,this._node.connect(r.masterGain)):r.noAudio||(this._node=r._obtainHtml5Audio(),this._errorFn=this._errorListener.bind(this),this._node.addEventListener("error",this._errorFn,!1),this._loadFn=this._loadListener.bind(this),this._node.addEventListener(r._canPlayEvent,this._loadFn,!1),this._node.src=t._src,this._node.preload=!0===t._preload?"auto":t._preload,this._node.volume=e*r.volume(),this._node.load()),this},reset:function(){var t=this._parent;return this._muted=t._muted,this._loop=t._loop,this._volume=t._volume,this._rate=t._rate,this._seek=0,this._rateSeek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++r._counter,this},_errorListener:function(){this._parent._emit("loaderror",this._id,this._node.error?this._node.error.code:0),this._node.removeEventListener("error",this._errorFn,!1)},_loadListener:function(){var t=this._parent;t._duration=Math.ceil(10*this._node.duration)/10,0===Object.keys(t._sprite).length&&(t._sprite={__default:[0,1e3*t._duration]}),"loaded"!==t._state&&(t._state="loaded",t._emit("load"),t._loadQueue()),this._node.removeEventListener(r._canPlayEvent,this._loadFn,!1)}};var h={},u=function(t){var e=t._src;if(h[e])return t._duration=h[e].duration,void d(t);if(/^data:[^;]+;base64,/.test(e)){for(var i=atob(e.split(",")[1]),n=new Uint8Array(i.length),s=0;s<i.length;++s)n[s]=i.charCodeAt(s);l(n.buffer,t)}else{var r=new XMLHttpRequest;r.open(t._xhr.method,e,!0),r.withCredentials=t._xhr.withCredentials,r.responseType="arraybuffer",t._xhr.headers&&Object.keys(t._xhr.headers).forEach((function(e){r.setRequestHeader(e,t._xhr.headers[e])})),r.onload=function(){var e=(r.status+"")[0];"0"===e||"2"===e||"3"===e?l(r.response,t):t._emit("loaderror",null,"Failed loading audio file with status: "+r.status+".")},r.onerror=function(){t._webAudio&&(t._html5=!0,t._webAudio=!1,t._sounds=[],delete h[e],t.load())},c(r)}},c=function(t){try{t.send()}catch(e){t.onerror()}},l=function(t,e){var i=function(){e._emit("loaderror",null,"Decoding audio data failed.")},n=function(t){t&&e._sounds.length>0?(h[e._src]=t,d(e,t)):i()};"undefined"!=typeof Promise&&1===r.ctx.decodeAudioData.length?r.ctx.decodeAudioData(t).then(n).catch(i):r.ctx.decodeAudioData(t,n,i)},d=function(t,e){e&&!t._duration&&(t._duration=e.duration),0===Object.keys(t._sprite).length&&(t._sprite={__default:[0,1e3*t._duration]}),"loaded"!==t._state&&(t._state="loaded",t._emit("load"),t._loadQueue())},p=function(){if(r.usingWebAudio){try{"undefined"!=typeof AudioContext?r.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?r.ctx=new webkitAudioContext:r.usingWebAudio=!1}catch(t){r.usingWebAudio=!1}r.ctx||(r.usingWebAudio=!1);var t=/iP(hone|od|ad)/.test(r._navigator&&r._navigator.platform),e=r._navigator&&r._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),i=e?parseInt(e[1],10):null;if(t&&i&&i<9){var n=/safari/.test(r._navigator&&r._navigator.userAgent.toLowerCase());r._navigator&&!n&&(r.usingWebAudio=!1)}r.usingWebAudio&&(r.masterGain=void 0===r.ctx.createGain?r.ctx.createGainNode():r.ctx.createGain(),r.masterGain.gain.setValueAtTime(r._muted?0:r._volume,r.ctx.currentTime),r.masterGain.connect(r.ctx.destination)),r._setup()}};void 0===(n=function(){return{Howler:r,Howl:a}}.apply(e,[]))||(t.exports=n),e.Howler=r,e.Howl=a,void 0!==i?(i.HowlerGlobal=s,i.Howler=r,i.Howl=a,i.Sound=o):"undefined"!=typeof window&&(window.HowlerGlobal=s,window.Howler=r,window.Howl=a,window.Sound=o)}(), /*! * Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported. * * howler.js v2.2.0 * howlerjs.com * * (c) 2013-2020, James Simpson of GoldFire Studios * goldfirestudios.com * * MIT License */ function(){"use strict";var t;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(t){if(!this.ctx||!this.ctx.listener)return this;for(var e=this._howls.length-1;e>=0;e--)this._howls[e].stereo(t);return this},HowlerGlobal.prototype.pos=function(t,e,i){return this.ctx&&this.ctx.listener?(e="number"!=typeof e?this._pos[1]:e,i="number"!=typeof i?this._pos[2]:i,"number"!=typeof t?this._pos:(this._pos=[t,e,i],void 0!==this.ctx.listener.positionX?(this.ctx.listener.positionX.setTargetAtTime(this._pos[0],Howler.ctx.currentTime,.1),this.ctx.listener.positionY.setTargetAtTime(this._pos[1],Howler.ctx.currentTime,.1),this.ctx.listener.positionZ.setTargetAtTime(this._pos[2],Howler.ctx.currentTime,.1)):this.ctx.listener.setPosition(this._pos[0],this._pos[1],this._pos[2]),this)):this},HowlerGlobal.prototype.orientation=function(t,e,i,n,s,r){if(!this.ctx||!this.ctx.listener)return this;var a=this._orientation;return e="number"!=typeof e?a[1]:e,i="number"!=typeof i?a[2]:i,n="number"!=typeof n?a[3]:n,s="number"!=typeof s?a[4]:s,r="number"!=typeof r?a[5]:r,"number"!=typeof t?a:(this._orientation=[t,e,i,n,s,r],void 0!==this.ctx.listener.forwardX?(this.ctx.listener.forwardX.setTargetAtTime(t,Howler.ctx.currentTime,.1),this.ctx.listener.forwardY.setTargetAtTime(e,Howler.ctx.currentTime,.1),this.ctx.listener.forwardZ.setTargetAtTime(i,Howler.ctx.currentTime,.1),this.ctx.listener.upX.setTargetAtTime(n,Howler.ctx.currentTime,.1),this.ctx.listener.upY.setTargetAtTime(s,Howler.ctx.currentTime,.1),this.ctx.listener.upZ.setTargetAtTime(r,Howler.ctx.currentTime,.1)):this.ctx.listener.setOrientation(t,e,i,n,s,r),this)},Howl.prototype.init=(t=Howl.prototype.init,function(e){return this._orientation=e.orientation||[1,0,0],this._stereo=e.stereo||null,this._pos=e.pos||null,this._pannerAttr={coneInnerAngle:void 0!==e.coneInnerAngle?e.coneInnerAngle:360,coneOuterAngle:void 0!==e.coneOuterAngle?e.coneOuterAngle:360,coneOuterGain:void 0!==e.coneOuterGain?e.coneOuterGain:0,distanceModel:void 0!==e.distanceModel?e.distanceModel:"inverse",maxDistance:void 0!==e.maxDistance?e.maxDistance:1e4,panningModel:void 0!==e.panningModel?e.panningModel:"HRTF",refDistance:void 0!==e.refDistance?e.refDistance:1,rolloffFactor:void 0!==e.rolloffFactor?e.rolloffFactor:1},this._onstereo=e.onstereo?[{fn:e.onstereo}]:[],this._onpos=e.onpos?[{fn:e.onpos}]:[],this._onorientation=e.onorientation?[{fn:e.onorientation}]:[],t.call(this,e)}),Howl.prototype.stereo=function(t,i){var n=this;if(!n._webAudio)return n;if("loaded"!==n._state)return n._queue.push({event:"stereo",action:function(){n.stereo(t,i)}}),n;var s=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===i){if("number"!=typeof t)return n._stereo;n._stereo=t,n._pos=[t,0,0]}for(var r=n._getSoundIds(i),a=0;a<r.length;a++){var o=n._soundById(r[a]);if(o){if("number"!=typeof t)return o._stereo;o._stereo=t,o._pos=[t,0,0],o._node&&(o._pannerAttr.panningModel="equalpower",o._panner&&o._panner.pan||e(o,s),"spatial"===s?void 0!==o._panner.positionX?(o._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),o._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),o._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):o._panner.setPosition(t,0,0):o._panner.pan.setValueAtTime(t,Howler.ctx.currentTime)),n._emit("stereo",o._id)}}return n},Howl.prototype.pos=function(t,i,n,s){var r=this;if(!r._webAudio)return r;if("loaded"!==r._state)return r._queue.push({event:"pos",action:function(){r.pos(t,i,n,s)}}),r;if(i="number"!=typeof i?0:i,n="number"!=typeof n?-.5:n,void 0===s){if("number"!=typeof t)return r._pos;r._pos=[t,i,n]}for(var a=r._getSoundIds(s),o=0;o<a.length;o++){var h=r._soundById(a[o]);if(h){if("number"!=typeof t)return h._pos;h._pos=[t,i,n],h._node&&(h._panner&&!h._panner.pan||e(h,"spatial"),void 0!==h._panner.positionX?(h._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),h._panner.positionY.setValueAtTime(i,Howler.ctx.currentTime),h._panner.positionZ.setValueAtTime(n,Howler.ctx.currentTime)):h._panner.setPosition(t,i,n)),r._emit("pos",h._id)}}return r},Howl.prototype.orientation=function(t,i,n,s){var r=this;if(!r._webAudio)return r;if("loaded"!==r._state)return r._queue.push({event:"orientation",action:function(){r.orientation(t,i,n,s)}}),r;if(i="number"!=typeof i?r._orientation[1]:i,n="number"!=typeof n?r._orientation[2]:n,void 0===s){if("number"!=typeof t)return r._orientation;r._orientation=[t,i,n]}for(var a=r._getSoundIds(s),o=0;o<a.length;o++){var h=r._soundById(a[o]);if(h){if("number"!=typeof t)return h._orientation;h._orientation=[t,i,n],h._node&&(h._panner||(h._pos||(h._pos=r._pos||[0,0,-.5]),e(h,"spatial")),void 0!==h._panner.orientationX?(h._panner.orientationX.setValueAtTime(t,Howler.ctx.currentTime),h._panner.orientationY.setValueAtTime(i,Howler.ctx.currentTime),h._panner.orientationZ.setValueAtTime(n,Howler.ctx.currentTime)):h._panner.setOrientation(t,i,n)),r._emit("orientation",h._id)}}return r},Howl.prototype.pannerAttr=function(){var t,i,n,s=this,r=arguments;if(!s._webAudio)return s;if(0===r.length)return s._pannerAttr;if(1===r.length){if("object"!=typeof r[0])return(n=s._soundById(parseInt(r[0],10)))?n._pannerAttr:s._pannerAttr;t=r[0],void 0===i&&(t.pannerAttr||(t.pannerAttr={coneInnerAngle:t.coneInnerAngle,coneOuterAngle:t.coneOuterAngle,coneOuterGain:t.coneOuterGain,distanceModel:t.distanceModel,maxDistance:t.maxDistance,refDistance:t.refDistance,rolloffFactor:t.rolloffFactor,panningModel:t.panningModel}),s._pannerAttr={coneInnerAngle:void 0!==t.pannerAttr.coneInnerAngle?t.pannerAttr.coneInnerAngle:s._coneInnerAngle,coneOuterAngle:void 0!==t.pannerAttr.coneOuterAngle?t.pannerAttr.coneOuterAngle:s._coneOuterAngle,coneOuterGain:void 0!==t.pannerAttr.coneOuterGain?t.pannerAttr.coneOuterGain:s._coneOuterGain,distanceModel:void 0!==t.pannerAttr.distanceModel?t.pannerAttr.distanceModel:s._distanceModel,maxDistance:void 0!==t.pannerAttr.maxDistance?t.pannerAttr.maxDistance:s._maxDistance,refDistance:void 0!==t.pannerAttr.refDistance?t.pannerAttr.refDistance:s._refDistance,rolloffFactor:void 0!==t.pannerAttr.rolloffFactor?t.pannerAttr.rolloffFactor:s._rolloffFactor,panningModel:void 0!==t.pannerAttr.panningModel?t.pannerAttr.panningModel:s._panningModel})}else 2===r.length&&(t=r[0],i=parseInt(r[1],10));for(var a=s._getSoundIds(i),o=0;o<a.length;o++)if(n=s._soundById(a[o])){var h=n._pannerAttr;h={coneInnerAngle:void 0!==t.coneInnerAngle?t.coneInnerAngle:h.coneInnerAngle,coneOuterAngle:void 0!==t.coneOuterAngle?t.coneOuterAngle:h.coneOuterAngle,coneOuterGain:void 0!==t.coneOuterGain?t.coneOuterGain:h.coneOuterGain,distanceModel:void 0!==t.distanceModel?t.distanceModel:h.distanceModel,maxDistance:void 0!==t.maxDistance?t.maxDistance:h.maxDistance,refDistance:void 0!==t.refDistance?t.refDistance:h.refDistance,rolloffFactor:void 0!==t.rolloffFactor?t.rolloffFactor:h.rolloffFactor,panningModel:void 0!==t.panningModel?t.panningModel:h.panningModel};var u=n._panner;u?(u.coneInnerAngle=h.coneInnerAngle,u.coneOuterAngle=h.coneOuterAngle,u.coneOuterGain=h.coneOuterGain,u.distanceModel=h.distanceModel,u.maxDistance=h.maxDistance,u.refDistance=h.refDistance,u.rolloffFactor=h.rolloffFactor,u.panningModel=h.panningModel):(n._pos||(n._pos=s._pos||[0,0,-.5]),e(n,"spatial"))}return s},Sound.prototype.init=function(t){return function(){var e=this._parent;this._orientation=e._orientation,this._stereo=e._stereo,this._pos=e._pos,this._pannerAttr=e._pannerAttr,t.call(this),this._stereo?e.stereo(this._stereo):this._pos&&e.pos(this._pos[0],this._pos[1],this._pos[2],this._id)}}(Sound.prototype.init),Sound.prototype.reset=function(t){return function(){var e=this._parent;return this._orientation=e._orientation,this._stereo=e._stereo,this._pos=e._pos,this._pannerAttr=e._pannerAttr,this._stereo?e.stereo(this._stereo):this._pos?e.pos(this._pos[0],this._pos[1],this._pos[2],this._id):this._panner&&(this._panner.disconnect(0),this._panner=void 0,e._refreshBuffer(this)),t.call(this)}}(Sound.prototype.reset);var e=function(t,e){"spatial"===(e=e||"spatial")?(t._panner=Howler.ctx.createPanner(),t._panner.coneInnerAngle=t._pannerAttr.coneInnerAngle,t._panner.coneOuterAngle=t._pannerAttr.coneOuterAngle,t._panner.coneOuterGain=t._pannerAttr.coneOuterGain,t._panner.distanceModel=t._pannerAttr.distanceModel,t._panner.maxDistance=t._pannerAttr.maxDistance,t._panner.refDistance=t._pannerAttr.refDistance,t._panner.rolloffFactor=t._pannerAttr.rolloffFactor,t._panner.panningModel=t._pannerAttr.panningModel,void 0!==t._panner.positionX?(t._panner.positionX.setValueAtTime(t._pos[0],Howler.ctx.currentTime),t._panner.positionY.setValueAtTime(t._pos[1],Howler.ctx.currentTime),t._panner.positionZ.setValueAtTime(t._pos[2],Howler.ctx.currentTime)):t._panner.setPosition(t._pos[0],t._pos[1],t._pos[2]),void 0!==t._panner.orientationX?(t._panner.orientationX.setValueAtTime(t._orientation[0],Howler.ctx.currentTime),t._panner.orientationY.setValueAtTime(t._orientation[1],Howler.ctx.currentTime),t._panner.orientationZ.setValueAtTime(t._orientation[2],Howler.ctx.currentTime)):t._panner.setOrientation(t._orientation[0],t._orientation[1],t._orientation[2])):(t._panner=Howler.ctx.createStereoPanner(),t._panner.pan.setValueAtTime(t._stereo,Howler.ctx.currentTime)),t._panner.connect(t._node),t._paused||t._parent.pause(t._id,!0).play(t._id,!0)}}()}).call(this,i(22))},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e){for(var i=t.call(this,e)||this,n=0;n<5;n++){var s=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_1","smoke_particle");i.add(s),s.setScale(0),s.angle=360*Math.random(),s.alpha=0;var r=12-24*Math.random(),a=-60-60*Math.random(),o=Math.round(500+500*Math.random()),h=.6+.2*Math.random();i.scene.tweens.add({targets:s,alpha:1,scaleX:h,scaleY:h,ease:Phaser.Math.Easing.Cubic.Out,duration:300}),i.scene.tweens.add({targets:s,x:r,y:a,ease:Phaser.Math.Easing.Linear,duration:o,delay:100}),i.scene.tweens.add({targets:s,alpha:0,scaleX:.5,scaleY:.5,ease:Phaser.Math.Easing.Cubic.Out,duration:400,delay:o-400,onComplete:function(){this.n++,5===this.n&&this.destroy()},onCompleteScope:i})}return i}return s(e,t),e}(Phaser.GameObjects.Container);e.SmokeEffect=r},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var a=i(6),o=i(2),h=i(0),u=i(59),c=i(1),l=r(i(4)),d=function(t){function e(e){var i=t.call(this,e)||this;return i.sprite=new Phaser.GameObjects.Sprite(i.scene,0,0,"texture_atlas_2"),i.scene.add.existing(i.sprite),i.sprite.setOrigin(.5,.65),i.add(i.sprite),i.lifeBar=new u.LifeBar(i.scene),i.add(i.lifeBar),i}return s(e,t),e.prototype.reset=function(t,e){switch(this.isActive=!0,this.isDead=!1,this.creeptsEnemy=t,this.id=this.creeptsEnemy.id,this.type=this.creeptsEnemy.type,this.affectedByFire=!1,this.alpha=1,this.sparks=null,this.sprite.alpha=1,this.sprite.scaleX=1,this.sprite.scaleY=1,this.enemyFramerate=o.GameConstants.ENEMY_FRAMERATE,t.type===l.GameConstants.ENEMY_BLOB?this.enemyFramerate*=.5:t.type===l.GameConstants.ENEMY_RUNNER&&(this.enemyFramerate*=2),this.x=o.GameConstants.CELLS_SIZE*(e.c+.5),this.y=o.GameConstants.CELLS_SIZE*(e.r+.5),this.lifeBar.reset(this.creeptsEnemy.life,this.type),this.dx=6-12*Math.random(),this.dy=-6*Math.random(),this.mirrored=Math.random()>.5,this.type){case"soldier":this.frameRate=o.GameConstants.ENEMY_FRAMERATE;break;case"runner":this.frameRate=o.GameConstants.ENEMY_FRAMERATE+8;break;case"blob":this.frameRate=o.GameConstants.ENEMY_FRAMERATE-8;break;case"healer":this.frameRate=o.GameConstants.ENEMY_FRAMERATE;break;case"flier":this.frameRate=o.GameConstants.ENEMY_FRAMERATE+6}this.sprite.anims.play("enemy_"+this.type+"_front")},e.prototype.update=function(t,e){if(0!==this.creeptsEnemy.life&&this.isActive)if(this.creeptsEnemy.teleporting)8===h.GameVars.timeStepFactor?(this.x=this.creeptsEnemy.x*o.GameConstants.CELLS_SIZE,this.y=this.creeptsEnemy.y*o.GameConstants.CELLS_SIZE,this.scaleX=0,this.scaleY=0):(this.scaleX=.3,this.scaleY=.3);else{var i,n=this.enemyFramerate*h.GameVars.timeStepFactor;this.creeptsEnemy.affectedByGlue||this.creeptsEnemy.affectedByGlueBullet?(7204863!==this.sprite.tint&&this.sprite.setTint(7204863),n*=.5):16777215===this.sprite.tint||this.affectedByFire||this.sprite.setTint(16777215),this.sprite.anims.msPerFrame=1e3/n,this.creeptsEnemy.hasBeenTeleported?16160764!==this.sprite.tint&&this.sprite.setTint(16160764):16777215===this.sprite.tint||this.creeptsEnemy.affectedByGlue||this.creeptsEnemy.affectedByGlueBullet||this.affectedByFire||this.sprite.setTint(16777215),this.scaleX=1,this.scaleY=1,i=o.GameConstants.INTERPOLATE_TRAJECTORIES?1===h.GameVars.timeStepFactor?.15:.5:1;var s=(this.creeptsEnemy.x*o.GameConstants.CELLS_SIZE-this.x+this.dx)*i,r=(this.creeptsEnemy.y*o.GameConstants.CELLS_SIZE-this.y+this.dy)*i;if(this.x+=s,this.y+=r,this.sprite.anims.msPerFrame=1e3/(this.frameRate*h.GameVars.timeStepFactor),s>.1&&Math.abs(s)>Math.abs(r)){if(this.mirrored){if(this.sprite.anims.currentAnim.key!=="enemy_"+this.type+"_left"){var a=this.sprite.anims.currentFrame.frame.name.substring(this.sprite.anims.currentFrame.frame.name.length-2);this.sprite.anims.play("enemy_"+this.type+"_left",!1,parseInt(a))}this.sprite.scaleX=-1}else if(this.sprite.anims.currentAnim.key!=="enemy_"+this.type+"_right"){a=this.sprite.anims.currentFrame.frame.name.substring(this.sprite.anims.currentFrame.frame.name.length-2);this.sprite.anims.play("enemy_"+this.type+"_right",!1,parseInt(a))}}else if(s<-.1&&Math.abs(s)>Math.abs(r)){if(this.mirrored){if(this.sprite.anims.currentAnim.key!=="enemy_"+this.type+"_right"){a=this.sprite.anims.currentFrame.frame.name.substring(this.sprite.anims.currentFrame.frame.name.length-2);this.sprite.anims.play("enemy_"+this.type+"_right",!1,parseInt(a))}this.sprite.scaleX=-1}else if(this.sprite.anims.currentAnim.key!=="enemy_"+this.type+"_left"){a=this.sprite.anims.currentFrame.frame.name.substring(this.sprite.anims.currentFrame.frame.name.length-2);this.sprite.anims.play("enemy_"+this.type+"_left",!1,parseInt(a))}}else if(r>.1&&Math.abs(s)<Math.abs(r)){if(this.sprite.anims.currentAnim.key!=="enemy_"+this.type+"_front"){a=this.sprite.anims.currentFrame.frame.name.substring(this.sprite.anims.currentFrame.frame.name.length-2);this.sprite.anims.play("enemy_"+this.type+"_front",!1,parseInt(a))}this.mirrored&&(this.sprite.scaleX=-1)}else if(r<-.1&&Math.abs(s)<Math.abs(r)){if(this.sprite.anims.currentAnim.key!=="enemy_"+this.type+"_back"){a=this.sprite.anims.currentFrame.frame.name.substring(this.sprite.anims.currentFrame.frame.name.length-2);this.sprite.anims.play("enemy_"+this.type+"_back",!1,parseInt(a))}this.mirrored&&(this.sprite.scaleX=-1)}this.lifeBar.updateValue(this.creeptsEnemy.life),this.alpha<1&&(this.alpha+=1===h.GameVars.timeStepFactor?.025:.075)}},e.prototype.hit=function(t){var e=this;if(this.lifeBar.visible=!0,null!==this.sparks||t!==o.GameConstants.IMPACT_ELECTRIC&&t!==o.GameConstants.IMPACT_FIRE_ELECTRIC||(this.sparks=new Phaser.GameObjects.Sprite(this.scene,0,0,"texture_atlas_4","electric_damage_00"),this.scene.add.existing(this.sparks),this.sparks.setScale(this.sprite.width/this.sparks.width*.85,this.sprite.height/this.sparks.height*.85),this.sparks.angle=360*Math.random(),this.add(this.sparks),this.sparks.anims.play("electric_damage"),this.sparks.on("animationcomplete",(function(){e.sparks&&e.sparks.destroy(),e.sparks=null}),this)),(t===o.GameConstants.IMPACT_FIRE||t===o.GameConstants.IMPACT_FIRE_ELECTRIC)&&8!==h.GameVars.timeStepFactor){this.affectedByFire=!0,this.sprite.setTint(16750719),this.scene.time.delayedCall(150,(function(){this.sprite.setTint(16760751),this.scene&&this.scene.time.delayedCall(150,(function(){this.affectedByFire=!1,this.sprite.setTint(16777215)}),[],this)}),[],this);var i=new Phaser.GameObjects.Image(this.scene,0,-25,"texture_atlas_1","smoke_particle");this.add(i),i.setScale(.2);var n="blob"===this.type?1:.75;this.scene.tweens.add({targets:i,y:i.y-30,alpha:0,scaleY:n,scaleX:n,ease:Phaser.Math.Easing.Cubic.Out,duration:1===h.GameVars.timeStepFactor?2e3:500,onComplete:function(){i.destroy()},onCompleteScope:this})}},e.prototype.glueHit=function(){var t=new Phaser.GameObjects.Sprite(this.scene,0,0,"texture_atlas_4");this.scene.add.existing(t),t.setScale(.3),this.add(t),t.anims.play("snow_shoot"),t.on("animationcomplete",(function(){t.destroy()}),this)},e.prototype.teleport=function(t){var e=(t.position.c+.5)*o.GameConstants.CELLS_SIZE,i=(t.position.r+.5)*o.GameConstants.CELLS_SIZE-8;8===h.GameVars.timeStepFactor?(this.x=e,this.y=i):this.scene.tweens.add({targets:this,x:e,y:i,scaleX:.175,scaleY:.175,ease:Phaser.Math.Easing.Cubic.Out,duration:1===h.GameVars.timeStepFactor?500:100})},e.prototype.die=function(){this.isDead=!0,this.lifeBar.visible=!1,this.sparks&&(this.sparks.destroy(),this.sparks=null),this.scene.tweens.add({targets:this.sprite,scaleX:.85,scaleY:.5,alpha:0,ease:Phaser.Math.Easing.Cubic.Out,duration:350});var t=new Phaser.GameObjects.Sprite(this.scene,0,0,"texture_atlas_4");this.scene.add.existing(t),t.angle=360*Math.random(),this.scene.add.existing(t);var e=1;"runner"===this.type?t.play("red-splat"):(t.play("splat"),"blob"===this.type&&(e=1.5)),this.add(t),t.on("animationcomplete",(function(){a.BattleScene.currentInstance.boardContainer.removeEnemy(this.id)}),this),this.scene.tweens.add({targets:t,scaleX:1.35*e,scaleY:1.35*e,y:-15,ease:Phaser.Math.Easing.Cubic.Out,duration:350}),a.BattleScene.currentInstance.addCoinsEffect(this.x,this.y,this.creeptsEnemy.value),c.AudioManager.playSoundEffect("enemy_dies")},e}(Phaser.GameObjects.Container);e.EnemyActor=d},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(65),a=i(3),o=i(2),h=i(0),u=i(66),c=i(17),l=i(1),d=function(t){function e(i){var n=t.call(this,i)||this;e.currentInstance=n,n.topContainer=new Phaser.GameObjects.Container(n.scene),n.topContainer.scaleY=h.GameVars.scaleY,n.add(n.topContainer),n.bottomContainer=new Phaser.GameObjects.Container(n.scene),n.bottomContainer.y=o.GameConstants.GAME_HEIGHT,n.bottomContainer.scaleY=h.GameVars.scaleY,n.add(n.bottomContainer),n.score=new c.Score(n.scene),n.topContainer.add(n.score),n.creditsContainer=new u.CreditsContainer(n.scene),n.topContainer.add(n.creditsContainer),n.lifesContainer=new r.LifesContainer(n.scene),n.topContainer.add(n.lifesContainer),o.GameConstants.DEVELOPMENT?(n.fpsLabel=new Phaser.GameObjects.Text(n.scene,5,(o.GameConstants.GAME_HEIGHT-30)/h.GameVars.scaleY,"",{fontFamily:"Arial",fontSize:"22px",color:"#FF0000"}),n.add(n.fpsLabel)):n.fpsLabel=null;var s=new Phaser.GameObjects.Graphics(n.scene);s.fillStyle(0,.75),s.fillRect(0,-100,o.GameConstants.GAME_WIDTH,30),n.bottomContainer.add(s);var l=new Phaser.GameObjects.Image(n.scene,-40,0,"texture_atlas_4","btn_wave");return l.setOrigin(0,1),l.setScale(6,1),n.bottomContainer.add(l),n.roundLabel=new Phaser.GameObjects.Text(n.scene,o.GameConstants.GAME_WIDTH-190,-85,h.GameVars.gameText[h.GameVars.gameData.language].ROUND+h.GameVars.formatNumber(a.BattleManager.engine.round),{fontFamily:"Supercell",fontSize:"15px",color:"#ffffff"}),n.roundLabel.setOrigin(0,.5),n.roundLabel.setStroke("#000000",8),n.roundLabel.setShadow(4,4,"#000000"),n.bottomContainer.add(n.roundLabel),n}return s(e,t),e.prototype.update=function(t,e){this.creditsContainer.text.setText(h.GameVars.formatNumber(a.BattleManager.engine.credits)),this.score.scoreLabel.setText(h.GameVars.formatNumber(a.BattleManager.engine.score)),this.fpsLabel&&(this.fpsLabel.text=Math.round(this.scene.game.loop.actualFps).toString())},e.prototype.updateLifes=function(){this.lifesContainer.lifesLabel.setText(a.BattleManager.engine.lifes<0?"0":a.BattleManager.engine.lifes.toString()),h.GameVars.gameOver||(a.BattleManager.engine.lifes>0?l.AudioManager.playSoundEffect("heart_lost_"+(Math.floor(3*Math.random())+1).toString(),!1,1,h.GameVars.dangerRate):l.AudioManager.playSoundEffect("heart_final_lost"))},e.prototype.updateRound=function(){this.roundLabel.setText(h.GameVars.gameText[h.GameVars.gameData.language].ROUND+a.BattleManager.engine.round)},e.prototype.onCoinsReachedEndPosition=function(){this.creditsContainer.onCoinsReachedEndPosition()},e.prototype.onEnemyReachedExit=function(){this.lifesContainer.onEnemyReachedExit()},e}(Phaser.GameObjects.Container);e.HUD=d},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(3),a=i(0),o=function(t){function e(e){var i=t.call(this,e)||this;i.y=35,i.x=90;var n=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","box_big_2");n.scaleX=-1,n.setOrigin(0,.5),i.add(n);var s=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","box_big_1");s.setOrigin(0,.5),s.scaleX=9.2,i.add(s);var o=new Phaser.GameObjects.Image(i.scene,s.width*s.scaleX,0,"texture_atlas_4","box_big_2");if(o.setOrigin(0,.5),i.add(o),i.scoreLabel=new Phaser.GameObjects.Text(i.scene,s.width*s.scaleX/2,-1,a.GameVars.formatNumber(r.BattleManager.engine.score),{fontFamily:"Supercell",fontSize:"32px",color:"#FFE734"}),i.scoreLabel.setOrigin(.5),i.scoreLabel.setStroke("#B35B20",8),i.scoreLabel.setShadow(3,3,"#700000"),i.add(i.scoreLabel),a.GameVars.gameOver){var h=new Phaser.GameObjects.Text(i.scene,s.width*s.scaleX/2,-1,a.GameVars.formatNumber(r.BattleManager.engine.score),{fontFamily:"Supercell",fontSize:"32px",color:"#FFE734"});h.setOrigin(.5),h.setStroke("#B35B20",8),h.setShadow(3,3,"#700000",0,!0,!1),i.addAt(h,3),i.scene.tweens.add({targets:h,scaleX:1.35,scaleY:1.45,alpha:0,ease:Phaser.Math.Easing.Cubic.InOut,duration:1250,yoyo:!1,repeat:-1})}return i}return s(e,t),e}(Phaser.GameObjects.Container);e.Score=o},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=i(14),o=i(19),h=i(1),u=function(t){function e(i){var n=t.call(this,i)||this;return n.scaleY=r.GameVars.scaleY,n.hammerShadow=new Phaser.GameObjects.Image(n.scene,0,0,"texture_atlas_0","endless_siege_title_3"),n.hammerShadow.x=e.PIVOT_X-n.hammerShadow.width/2,n.hammerShadow.y=e.PIVOT_Y-n.hammerShadow.height/2,n.hammerShadow.setOrigin(e.PIVOT_X/n.hammerShadow.width,e.PIVOT_Y/n.hammerShadow.height),n.add(n.hammerShadow),n.base=new Phaser.GameObjects.Image(n.scene,0,0,"texture_atlas_0","endless_siege_title_01"),n.add(n.base),n.hammer=new Phaser.GameObjects.Image(n.scene,0,0,"texture_atlas_0","endless_siege_title_02"),n.hammer.x=e.PIVOT_X-n.hammer.width/2,n.hammer.y=e.PIVOT_Y-n.hammer.height/2,n.hammer.setOrigin(e.PIVOT_X/n.hammer.width,e.PIVOT_Y/n.hammer.height),n.add(n.hammer),o.SplashScene.firstInstantiation&&(n.hammerShadow.alpha=0,n.hammer.alpha=0),n}return s(e,t),e.prototype.update=function(){this.hammerShadow.x=this.hammer.x,this.hammerShadow.angle=this.hammer.angle,this.hammerShadow.scaleX=this.hammer.scaleX,this.hammerShadow.scaleY=this.hammer.scaleY},e.prototype.activate=function(){if(o.SplashScene.firstInstantiation){var t=this.hammer.x;this.hammer.x+=30,this.scene.tweens.add({targets:[this.hammer,this.hammerShadow],x:t,alpha:1,ease:Phaser.Math.Easing.Cubic.Out,duration:500,onComplete:function(){this.loop()},onCompleteScope:this})}else this.loop()},e.prototype.loop=function(){this.scene.tweens.add({targets:this.hammer,angle:15,scaleX:1.1,scaleY:1.1,ease:Phaser.Math.Easing.Cubic.Out,duration:500,onComplete:function(){this.scene.tweens.add({targets:this.hammer,angle:16,scaleX:1.11,scaleY:1.11,ease:Phaser.Math.Easing.Linear,duration:200,onComplete:function(){var t=new a.SmokeEffect(this.scene);t.x=170,t.y=-10,t.scaleX=2.5,t.scaleY=2.5,t.alpha=.25,this.addAt(t,2),(t=new a.SmokeEffect(this.scene)).x=180,t.y=-10,t.scaleX=3,t.scaleY=3,t.alpha=.15,this.addAt(t,2),this.scene.tweens.add({targets:this.hammer,angle:-3,scaleX:.97,scaleY:.97,ease:Phaser.Math.Easing.Cubic.In,duration:150,onComplete:function(){h.AudioManager.playSoundEffect("hammer_hits_shield"),o.SplashScene.currentInstance.showSplashElelements(),this.scene.tweens.add({targets:this.hammer,angle:0,scaleX:1,scaleY:1,ease:Phaser.Math.Easing.Cubic.Out,duration:200}),this.base.scaleX=.95,this.base.scaleY=.95,this.scene.tweens.add({targets:this.base,scaleX:1,scaleY:1,ease:Phaser.Math.Easing.Cubic.Out,duration:400,onComplete:function(){this.scene.time.delayedCall(2500,(function(){this.loop()}),[],this)},onCompleteScope:this})},onCompleteScope:this})},onCompleteScope:this})},onCompleteScope:this})},e.PIVOT_X=536,e.PIVOT_Y=190,e}(Phaser.GameObjects.Container);e.GameTitle=u},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(82),a=i(83),o=i(2),h=i(0),u=i(7),c=i(1),l=i(18),d=function(t){function e(){var i=t.call(this,"SplashScene")||this;return e.currentInstance=i,i}return s(e,t),e.prototype.create=function(){var t=this;h.GameVars.currentScene=this,this.scene.setVisible(!0),this.f=0,this.loadComplete=!1,this.onClickDown=!1;var i=this.add.container(0,0);i.alpha=0,i.scaleY=h.GameVars.scaleY;for(var n=Math.round(o.GameConstants.GAME_HEIGHT/128/h.GameVars.scaleY)+1,s=0;s<n;s++){var u=new Phaser.GameObjects.Image(this,0,128*s,"texture_atlas_0","splash_bg");u.setOrigin(0,0),i.add(u)}var c,d=new Phaser.GameObjects.Image(this,0,0,"texture_atlas_0","blue_gradient");d.setOrigin(0),d.scaleX=o.GameConstants.GAME_WIDTH/10,d.scaleY=1.35/h.GameVars.scaleY,this.add.existing(d),this.gameTitle=new l.GameTitle(this),this.gameTitle.x=o.GameConstants.GAME_WIDTH/2+14,this.gameTitle.y=160*h.GameVars.scaleY,this.add.existing(this.gameTitle),this.gameTitle.activate(),this.midContainer=new Phaser.GameObjects.Container(this,o.GameConstants.GAME_WIDTH/2,.45*o.GameConstants.GAME_HEIGHT),this.midContainer.scaleY=h.GameVars.scaleY,this.midContainer.alpha=e.firstInstantiation?0:1,this.add.existing(this.midContainer);var p=Math.random();c=p<.2?"pose_blob":p<.4?"pose_flier":p<.6?"pose_healer":p<.8?"pose_normal":"pose_runner",this.character=new Phaser.GameObjects.Image(this,-145,90,"texture_atlas_1",c),this.character.setOrigin(1,.5),this.midContainer.add(this.character),e.firstInstantiation&&(this.character.x=-100,this.character.alpha=0,this.character.setScale(.85),this.tweens.add({targets:this.character,x:-145,alpha:1,scaleX:1,scaleY:1,ease:Phaser.Math.Easing.Cubic.Out,duration:300,delay:2500}));var f=new a.SplashMapPreview(this);this.midContainer.add(f);var m=new Phaser.GameObjects.Image(this,0,-100,"texture_atlas_1","banner_red");m.setScale(.85),this.midContainer.add(m);var g=new Phaser.GameObjects.Text(this,0,-108,h.GameVars.gameText[h.GameVars.gameData.language].MAP_OF_THE_DAY,{fontFamily:"Supercell",fontSize:"24px",color:"#FFFFFF"});g.setOrigin(.5),g.setStroke("#000000",6),g.setShadow(4,4,"#000000"),this.midContainer.add(g);var v=new Phaser.GameObjects.Text(this,0,-60,h.GameVars.getDate(),{fontFamily:"Supercell",fontSize:"16px",color:"#FFFFFF"});v.setOrigin(.5),v.setStroke("#000000",4),v.setShadow(3,3,"#000000"),this.midContainer.add(v);var y=new r.ResultsLayer(this);y.setPosition(0,300),this.midContainer.add(y);var _=new Phaser.GameObjects.Container(this,0,235);this.midContainer.add(_),this.tweens.add({targets:_,scaleX:1.035,scaleY:1.035,ease:Phaser.Math.Easing.Cubic.InOut,duration:350,yoyo:!0,repeat:-1});var x=new Phaser.GameObjects.Image(this,0,0,"texture_atlas_1","btn_play_void");x.setInteractive({useHandCursor:!0}),x.on("pointerover",(function(){_.setScale(1.025)})),x.on("pointerout",(function(){_.setScale(1)})),x.on("pointerdown",(function(){t.onPlayDown()})),_.add(x);var E=new Phaser.GameObjects.Text(this,0,0,h.GameVars.gameText[h.GameVars.gameData.language].PLAY_MAYUS,{fontFamily:"Supercell",fontSize:"28px",color:"#FFFFFF"});E.setOrigin(.5),E.setStroke("#663333",8),E.setShadow(5,5,"#663333"),_.add(E),e.firstInstantiation=!1,this.tweens.add({targets:i,alpha:1,ease:Phaser.Math.Easing.Cubic.Out,duration:1e3})},e.prototype.update=function(){this.f++,550===this.f&&(this.f=0,this.tweens.add({targets:this.character,y:this.character.y-6,ease:Phaser.Math.Easing.Cubic.InOut,duration:80,yoyo:!0,repeat:1})),this.gameTitle.update()},e.prototype.showSplashElelements=function(){var t=this;1!==this.midContainer.alpha&&(this.midContainer.setScale(.65),this.tweens.add({targets:this.midContainer,alpha:1,scaleX:1,scaleY:1*h.GameVars.scaleY,ease:Phaser.Math.Easing.Elastic.Out,duration:1e3}),c.AudioManager.playSoundEffect("title_appears"),this.load.atlas("texture_atlas_2","assets/texture_atlas_2.png","assets/texture_atlas_2.json"),this.load.atlas("texture_atlas_3","assets/texture_atlas_3.png","assets/texture_atlas_3.json"),this.load.atlas("texture_atlas_4","assets/texture_atlas_4.png","assets/texture_atlas_4.json"),this.load.start(),this.load.on("complete",(function(){t.onClickDown?u.GameManager.enterBattleScene():t.loadComplete=!0}),this))},e.prototype.onPlayDown=function(){this.cameras.main.fadeOut(300,40,49,78),this.loadComplete?u.GameManager.enterBattleScene():this.onClickDown=!0,c.AudioManager.playSoundEffect("btn_click")},e.prototype.onFullscreenButtonDown=function(){this.isFullscreen?(h.GameVars.currentScene.scale.stopFullscreen(),this.isFullscreen=!1,this.fullscreenButton.setFrame("icon_expand_screen",!1,!0)):(h.GameVars.currentScene.scale.startFullscreen(),this.isFullscreen=!0,this.fullscreenButton.setFrame("icon_shrink_screen",!1,!0))},e.firstInstantiation=!0,e}(Phaser.Scene);e.SplashScene=d},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),i(21),i(13);var n,s=i(23),r=i(2),a=i(80),o=i(81),h=i(6),u=i(19),c=i(7);function l(){setTimeout((function(){window.innerWidth<window.innerHeight?(a.BootScene.bootedInWrongOrientation&&(a.BootScene.bootedInWrongOrientation=!1,c.GameManager.init()),document.getElementById("orientation").style.display="none",document.getElementById("content").style.display="block"):(document.getElementById("orientation").style.display="block",document.getElementById("content").style.display="none")}),250)}window.onload=function(){var t,e,i,c,d,p,f,m={version:r.GameConstants.VERSION,type:Phaser.AUTO,transparent:!0,scale:{mode:Phaser.Scale.FIT,autoCenter:Phaser.Scale.CENTER_BOTH,parent:"content",width:r.GameConstants.GAME_WIDTH,height:r.GameConstants.GAME_HEIGHT},scene:[a.BootScene,o.PreloadScene,u.SplashScene,h.BattleScene]};n=new s.Game(m),window.focus(),t=document.querySelector("canvas"),e=window.innerWidth,i=window.innerHeight,c=e/i,d=n.config.width,p=n.config.height,c<(f=d/p)?(t.style.width=e+"px",t.style.height=e/f+"px"):(t.style.width=i*f+"px",t.style.height=i+"px"),window.addEventListener("orientationchange",l,!1)}},function(t,e,i){window,t.exports=function(){return i={},t.m=e=[function(t,e){function i(t,e,i){var n=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&n.value&&"object"==typeof n.value&&(n=n.value),!(!n||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(n))&&(void 0===n.enumerable&&(n.enumerable=!0),void 0===n.configurable&&(n.configurable=!0),n)}function n(t,e,n,s){for(var a in e)if(e.hasOwnProperty(a)){var o=i(e,a,n);if(!1!==o){if(h=(s||t).prototype,u=a,c=void 0,(c=Object.getOwnPropertyDescriptor(h,u))&&(c.value&&"object"==typeof c.value&&(c=c.value),!1===c.configurable)){if(r.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,o)}else t.prototype[a]=e[a]}var h,u,c}function s(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++)n(t,e[i].prototype||e[i])}}function r(t){var e,i;if((t=t||{}).initialize){if("function"!=typeof t.initialize)throw new Error("initialize must be a function");e=t.initialize,delete t.initialize}else if(t.Extends){var r=t.Extends;e=function(){r.apply(this,arguments)}}else e=function(){};t.Extends?(e.prototype=Object.create(t.Extends.prototype),e.prototype.constructor=e,i=t.Extends,delete t.Extends):e.prototype.constructor=e;var a=null;return t.Mixins&&(a=t.Mixins,delete t.Mixins),s(e,a),n(e,t,!0,i),e}r.extend=n,r.mixin=s,r.ignoreFinals=!1,t.exports=r},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1===e.indexOf("."))return i;for(var n=e.split("."),s=t,r=i,a=0;a<n.length;a++){if(!s.hasOwnProperty(n[a])){r=i;break}r=s[n[a]],s=s[n[a]]}return r}return i}},function(t,e,i){"use strict";var n=Object.prototype.hasOwnProperty,s="~";function r(){}function a(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function o(t,e,i,n,r){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new a(i,n||t,r),h=s?s+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function h(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function u(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(s=!1)),u.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)n.call(t,e)&&i.push(s?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},u.prototype.listeners=function(t){var e=s?s+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,r=i.length,a=new Array(r);n<r;n++)a[n]=i[n].fn;return a},u.prototype.listenerCount=function(t){var e=s?s+t:t,i=this._events[e];return i?i.fn?1:i.length:0},u.prototype.emit=function(t,e,i,n,r,a){var o=s?s+t:t;if(!this._events[o])return!1;var h,u,c=this._events[o],l=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,i),!0;case 4:return c.fn.call(c.context,e,i,n),!0;case 5:return c.fn.call(c.context,e,i,n,r),!0;case 6:return c.fn.call(c.context,e,i,n,r,a),!0}for(u=1,h=new Array(l-1);u<l;u++)h[u-1]=arguments[u];c.fn.apply(c.context,h)}else{var d,p=c.length;for(u=0;u<p;u++)switch(c[u].once&&this.removeListener(t,c[u].fn,void 0,!0),l){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,e);break;case 3:c[u].fn.call(c[u].context,e,i);break;case 4:c[u].fn.call(c[u].context,e,i,n);break;default:if(!h)for(d=1,h=new Array(l-1);d<l;d++)h[d-1]=arguments[d];c[u].fn.apply(c[u].context,h)}}return!0},u.prototype.on=function(t,e,i){return o(this,t,e,i,!1)},u.prototype.once=function(t,e,i){return o(this,t,e,i,!0)},u.prototype.removeListener=function(t,e,i,n){var r=s?s+t:t;if(!this._events[r])return this;if(!e)return h(this,r),this;var a=this._events[r];if(a.fn)a.fn!==e||n&&!a.once||i&&a.context!==i||h(this,r);else{for(var o=0,u=[],c=a.length;o<c;o++)(a[o].fn!==e||n&&!a[o].once||i&&a[o].context!==i)&&u.push(a[o]);u.length?this._events[r]=1===u.length?u[0]:u:h(this,r)}return this},u.prototype.removeAllListeners=function(t){var e;return t?(e=s?s+t:t,this._events[e]&&h(this,e)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=s,u.EventEmitter=u,t.exports=u},function(t,e){t.exports=function(t,e,i){var n=typeof t;return t&&"number"!=n&&"string"!=n&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},function(t,e){t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},function(t,e,i){t.exports={BLUR:i(253),BOOT:i(254),CONTEXT_LOST:i(255),CONTEXT_RESTORED:i(256),DESTROY:i(257),FOCUS:i(258),HIDDEN:i(259),PAUSE:i(260),POST_RENDER:i(261),POST_STEP:i(262),PRE_RENDER:i(263),PRE_STEP:i(264),READY:i(265),RESUME:i(266),STEP:i(267),VISIBLE:i(268)}},function(t,e,i){var n=i(0),s=i(61),r=new n({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new r(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return s(this.x,t.x,e)&&s(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return 0<i&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},transformMat3:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},transformMat4:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[4]*i+n[12],this.y=n[1]*e+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&t<e&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)}});r.ZERO=new r,r.RIGHT=new r(1,0),r.LEFT=new r(-1,0),r.UP=new r(0,-1),r.DOWN=new r(0,1),r.ONE=new r(1,1),t.exports=r},function(t,e,i){var n=i(0),s=i(24),r=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=s.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=r},function(t,e){var i={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=i},function(t,e){var i={},n={},s={register:function(t,e,n,s){void 0===s&&(s=!1),i[t]={plugin:e,mapping:n,custom:s}},registerCustom:function(t,e,i,s){n[t]={plugin:e,mapping:i,data:s}},hasCore:function(t){return i.hasOwnProperty(t)},hasCustom:function(t){return n.hasOwnProperty(t)},getCore:function(t){return i[t]},getCustom:function(t){return n[t]},getCustomClass:function(t){return n.hasOwnProperty(t)?n[t].plugin:null},remove:function(t){i.hasOwnProperty(t)&&delete i[t]},removeCustom:function(t){n.hasOwnProperty(t)&&delete n[t]},destroyCorePlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]},destroyCustomPlugins:function(){for(var t in n)n.hasOwnProperty(t)&&delete n[t]}};t.exports=s},function(t,e,i){t.exports={BOOT:i(364),CREATE:i(365),DESTROY:i(366),PAUSE:i(367),POST_UPDATE:i(368),PRE_UPDATE:i(369),READY:i(370),RENDER:i(371),RESUME:i(372),SHUTDOWN:i(373),SLEEP:i(374),START:i(375),TRANSITION_COMPLETE:i(376),TRANSITION_INIT:i(377),TRANSITION_OUT:i(378),TRANSITION_START:i(379),TRANSITION_WAKE:i(380),UPDATE:i(381),WAKE:i(382)}},function(t,e,i){var n,s=i(14),r=i(317),a=[],o=!1;function h(t,e,i,h,u){var c;void 0===e&&(e=1),void 0===i&&(i=1),void 0===h&&(h=s.CANVAS),void 0===u&&(u=!1);var l=n(h);return null===l?(l={parent:t,canvas:document.createElement("canvas"),type:h},h===s.CANVAS&&a.push(l)):l.parent=t,c=l.canvas,u&&(l.parent=c),c.width=e,c.height=i,o&&h===s.CANVAS&&r.disable(c.getContext("2d")),c}function u(){var t=0;return a.forEach((function(e){e.parent&&t++})),t}t.exports={create2D:function(t,e,i){return h(t,e,i,s.CANVAS)},create:h,createWebGL:function(t,e,i){return h(t,e,i,s.WEBGL)},disableSmoothing:function(){o=!0},enableSmoothing:function(){o=!1},first:n=function(t){if(void 0===t&&(t=s.CANVAS),t===s.WEBGL)return null;for(var e=0;e<a.length;e++){var i=a[e];if(!i.parent&&i.type===t)return i}return null},free:function(){return a.length-u()},pool:a,remove:function(t){var e=t instanceof HTMLCanvasElement;a.forEach((function(i){(e&&i.canvas===t||!e&&i.parent===t)&&(i.parent=null,i.canvas.width=1,i.canvas.height=1)}))},total:u}},function(t,e,i){var n=i(16),s=function(){var t,e,i,r,a,o,h=arguments[0]||{},u=1,c=arguments.length,l=!1;for("boolean"==typeof h&&(l=h,h=arguments[1]||{},u=2),c===u&&(h=this,--u);u<c;u++)if(null!=(t=arguments[u]))for(e in t)i=h[e],h!==(r=t[e])&&(l&&r&&(n(r)||(a=Array.isArray(r)))?(o=a?(a=!1,i&&Array.isArray(i)?i:[]):i&&n(i)?i:{},h[e]=s(l,o,r)):void 0!==r&&(h[e]=r));return h};t.exports=s},function(t,e,i){var n={VERSION:"3.24.1",BlendModes:i(29),ScaleModes:i(98),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=n},function(t,e,i){t.exports={DESTROY:i(292),FADE_IN_COMPLETE:i(293),FADE_IN_START:i(294),FADE_OUT_COMPLETE:i(295),FADE_OUT_START:i(296),FLASH_COMPLETE:i(297),FLASH_START:i(298),PAN_COMPLETE:i(299),PAN_START:i(300),POST_RENDER:i(301),PRE_RENDER:i(302),ROTATE_COMPLETE:i(303),ROTATE_START:i(304),SHAKE_COMPLETE:i(305),SHAKE_START:i(306),ZOOM_COMPLETE:i(307),ZOOM_START:i(308)}},function(t,e){t.exports=function(t){if("object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},function(t,e,i){t.exports={Alpha:i(273),AlphaSingle:i(107),Animation:i(274),BlendMode:i(108),ComputedSize:i(275),Crop:i(276),Depth:i(109),Flip:i(277),GetBounds:i(278),Mask:i(113),Origin:i(286),PathFollower:i(287),Pipeline:i(114),ScrollFactor:i(115),Size:i(288),Texture:i(289),TextureCrop:i(290),Tint:i(291),ToJSON:i(116),Transform:i(117),TransformMatrix:i(18),Visible:i(120)}},function(t,e,i){var n=i(0),s=i(9),r=i(7),a=new n({initialize:function(t,e,i,n,s,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===s&&(s=0),void 0===r&&(r=0),this.matrix=new Float32Array([t,e,i,n,s,r,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],r=t[3];return e||i?0<i?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):n||r?s.TAU-(0<r?Math.acos(-n/this.scaleY):-Math.acos(n/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),n=this.matrix,s=n[0],r=n[1],a=n[2],o=n[3];return n[0]=s*i+a*e,n[1]=r*i+o*e,n[2]=s*-e+a*i,n[3]=r*-e+o*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,s=i[0],r=i[1],a=i[2],o=i[3],h=i[4],u=i[5],c=n[0],l=n[1],d=n[2],p=n[3],f=n[4],m=n[5],g=void 0===e?this:e;return g.a=c*s+l*a,g.b=c*r+l*o,g.c=d*s+p*a,g.d=d*r+p*o,g.e=f*s+m*a+h,g.f=f*r+m*o+u,g},multiplyWithOffset:function(t,e,i){var n=this.matrix,s=t.matrix,r=n[0],a=n[1],o=n[2],h=n[3],u=e*r+i*o+n[4],c=e*a+i*h+n[5],l=s[0],d=s[1],p=s[2],f=s[3],m=s[4],g=s[5];return n[0]=l*r+d*o,n[1]=l*a+d*h,n[2]=p*r+f*o,n[3]=p*a+f*h,n[4]=m*r+g*o+u,n[5]=m*a+g*h+c,this},transform:function(t,e,i,n,s,r){var a=this.matrix,o=a[0],h=a[1],u=a[2],c=a[3],l=a[4],d=a[5];return a[0]=t*o+e*u,a[1]=t*h+e*c,a[2]=i*o+n*u,a[3]=i*h+n*c,a[4]=s*o+r*u+l,a[5]=s*h+r*c+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var n=this.matrix,s=n[0],r=n[1],a=n[2],o=n[3],h=n[4],u=n[5];return i.x=t*s+e*a+h,i.y=t*r+e*o+u,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=e*s-i*n;return t[0]=s/o,t[1]=-i/o,t[2]=-n/o,t[3]=e/o,t[4]=(n*a-s*r)/o,t[5]=-(e*a-i*r)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,n,s,r){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=n,a[4]=s,a[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],s=e[2],r=e[3],a=i*r-n*s;if(t.translateX=e[4],t.translateY=e[5],i||n){var o=Math.sqrt(i*i+n*n);t.rotation=0<n?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(s||r){var h=Math.sqrt(s*s+r*r);t.rotation=.5*Math.PI-(0<r?Math.acos(-s/h):-Math.acos(s/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,n,s){var r=this.matrix,a=Math.sin(i),o=Math.cos(i);return r[4]=t,r[5]=e,r[0]=o*n,r[1]=a*n,r[2]=-a*s,r[3]=o*s,this},applyInverse:function(t,e,i){void 0===i&&(i=new r);var n=this.matrix,s=n[0],a=n[1],o=n[2],h=n[3],u=n[4],c=n[5],l=1/(s*h+o*-a);return i.x=h*l*t+-o*l*e+(c*o-u*h)*l,i.y=s*l*e+-a*l*t+(-c*s+u*a)*l,i},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.decomposedMatrix=null}});t.exports=a},function(t,e){t.exports={getTintFromFloats:function(t,e,i,n){return((255&(255*n|0))<<24|(255&(255*t|0))<<16|(255&(255*e|0))<<8|255&(255*i|0))>>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},getComponentCount:function(t,e){for(var i=0,n=0;n<t.length;++n){var s=t[n];s.type===e.FLOAT?i+=s.size:i+=1}return i}}},function(t,e,i){var n=i(0),s=i(122),r=i(310),a=i(311),o=i(312),h=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,n)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=n,this._locked=!1,this.update(s)},setGLTo:function(t,e,i,n){return void 0===n&&(n=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=n,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return a(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,n=this.b,a=this.a;return this._color=s(e,i,n),this._color32=r(e,i,n,a),this._rgba="rgba("+e+","+i+","+n+","+a/255+")",t&&o(e,i,n,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return o(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t));return this.setTo(i,n,s)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,n=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),n=Math.max(0,Math.min(255,n-Math.round(-t/100*255))),this.setTo(e,i,n)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,a(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,a(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,a(this._h,this._s,t,this)}}});t.exports=h},function(t,e,i){t.exports={BOOT:i(470),DESTROY:i(471),DRAG_END:i(472),DRAG_ENTER:i(473),DRAG:i(474),DRAG_LEAVE:i(475),DRAG_OVER:i(476),DRAG_START:i(477),DROP:i(478),GAME_OUT:i(479),GAME_OVER:i(480),GAMEOBJECT_DOWN:i(481),GAMEOBJECT_DRAG_END:i(482),GAMEOBJECT_DRAG_ENTER:i(483),GAMEOBJECT_DRAG:i(484),GAMEOBJECT_DRAG_LEAVE:i(485),GAMEOBJECT_DRAG_OVER:i(486),GAMEOBJECT_DRAG_START:i(487),GAMEOBJECT_DROP:i(488),GAMEOBJECT_MOVE:i(489),GAMEOBJECT_OUT:i(490),GAMEOBJECT_OVER:i(491),GAMEOBJECT_POINTER_DOWN:i(492),GAMEOBJECT_POINTER_MOVE:i(493),GAMEOBJECT_POINTER_OUT:i(494),GAMEOBJECT_POINTER_OVER:i(495),GAMEOBJECT_POINTER_UP:i(496),GAMEOBJECT_POINTER_WHEEL:i(497),GAMEOBJECT_UP:i(498),GAMEOBJECT_WHEEL:i(499),MANAGER_BOOT:i(500),MANAGER_PROCESS:i(501),MANAGER_UPDATE:i(502),POINTER_DOWN:i(503),POINTER_DOWN_OUTSIDE:i(504),POINTER_MOVE:i(505),POINTER_OUT:i(506),POINTER_OVER:i(507),POINTER_UP:i(508),POINTER_UP_OUTSIDE:i(509),POINTER_WHEEL:i(510),POINTERLOCK_CHANGE:i(511),PRE_UPDATE:i(512),SHUTDOWN:i(513),START:i(514),UPDATE:i(515)}},function(t,e,i){var n=i(0),s=i(116),r=i(166),a=i(3),o=i(193),h=new n({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new r(this)),this},setData:function(t,e){return this.data||(this.data=new r(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new r(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new r(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new r(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.input&&(this.input.enabled=!1),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},update:function(){},toJSON:function(){return s(this)},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),(t=e).parentContainer);)e=e.parentContainer;return i.unshift(this.scene.sys.displayList.getIndex(t)),i},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){this.preDestroy&&this.preDestroy.call(this),this.emit(o.DESTROY,this);var e=this.scene.sys;t||(e.displayList.remove(this),e.updateList.remove(this)),this.input&&(e.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),t||e.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners()}}});h.RENDER_MASK=15,t.exports=h},function(t,e,i){var n=i(0),s=i(58),r=i(110),a=i(279),o=i(24),h=i(59),u=i(283),c=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=o.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return u(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=c},function(t,e){t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},function(t,e){var i={},n={install:function(t){for(var e in i)t[e]=i[e]},register:function(t,e){i[t]=e},destroy:function(){i={}}};t.exports=n},function(t,e){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},function(t,e){t.exports=function(t,e,i,n){var s=t.length;if(e<0||s<e||i<=e||s<i||s<e+i){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e,i){t.exports={COMPLETE:i(545),DECODED:i(546),DECODED_ALL:i(547),DESTROY:i(548),DETUNE:i(549),GLOBAL_DETUNE:i(550),GLOBAL_MUTE:i(551),GLOBAL_RATE:i(552),GLOBAL_VOLUME:i(553),LOOP:i(554),LOOPED:i(555),MUTE:i(556),PAUSE_ALL:i(557),PAUSE:i(558),PLAY:i(559),RATE:i(560),RESUME_ALL:i(561),RESUME:i(562),SEEK:i(563),STOP_ALL:i(564),STOP:i(565),UNLOCKED:i(566),VOLUME:i(567)}},function(t,e){t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},function(t,e,i){var n=i(0),s=i(17),r=i(62),a=i(3),o=i(15),h=i(23),u=i(18),c=i(121),l=i(7),d=new n({Extends:a,Mixins:[s.Alpha,s.Visible],initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),a.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.resolution=1,this.roundPixels=!1,this.useBounds=!1,this.worldView=new h,this.dirty=!0,this._x=t,this._y=e,this._cx=0,this._cy=0,this._cw=0,this._ch=0,this._width=i,this._height=n,this._bounds=new h,this._scrollX=0,this._scrollY=0,this._zoom=1,this._rotation=0,this.matrix=new u,this.transparent=!0,this.backgroundColor=c("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new l(i/2,n/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new l);var n=.5*this.width,s=.5*this.height;return i.x=t-n,i.y=e-s,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(t){var e=.5*this.width;return this.midPoint.x=t,this.scrollX=t-e,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(t){var e=.5*this.height;return this.midPoint.y=t,this.scrollY=t-e,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(t,e){return this.centerOnX(t),this.centerOnY(e),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],n=e[1],s=e[2],r=e[3],a=i*r-n*s;if(!a)return t;var o=e[4],h=e[5],u=this.scrollX,c=this.scrollY,l=this.width,d=this.height,p=this.y,f=p+d,m=this.x,g=m+l,v=this.culledObjects,y=t.length;a=1/a;for(var _=v.length=0;_<y;++_){var x=t[_];if(x.hasOwnProperty("width")&&!x.parentContainer){var E=x.width,T=x.height,w=x.x-u*x.scrollFactorX-E*x.originX,S=x.y-c*x.scrollFactorY-T*x.originY;m<(w+E)*i+(S+T)*s+o&&w*i+S*s+o<g&&p<(w+E)*n+(S+T)*r+h&&w*n+S*r+h<f&&v.push(x)}else v.push(x)}return v},getWorldPoint:function(t,e,i){void 0===i&&(i=new l);var n=this.matrix.matrix,s=n[0],r=n[1],a=n[2],o=n[3],h=n[4],u=n[5],c=s*o-r*a;if(!c)return i.x=t,i.y=e,i;var d=o*(c=1/c),p=-r*c,f=-a*c,m=s*c,g=(a*u-o*h)*c,v=(r*h-s*u)*c,y=Math.cos(this.rotation),_=Math.sin(this.rotation),x=this.zoom,E=this.resolution,T=this.scrollX,w=this.scrollY,S=t+(T*y-w*_)*x,b=e+(T*_+w*y)*x;return i.x=(S*d+b*f)*E+g,i.y=(S*p+b*m)*E+v,i},ignore:function(t){var e=this.id;Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];Array.isArray(n)?this.ignore(n):n.isParent?this.ignore(n.getChildren()):n.cameraFilter|=e}return this},preRender:function(t){var e=this.width,i=this.height,n=.5*e,s=.5*i,r=this.zoom*t,a=this.matrix,o=e*this.originX,h=i*this.originY,u=this.scrollX,c=this.scrollY;this.useBounds&&(u=this.clampX(u),c=this.clampY(c)),this.roundPixels&&(o=Math.round(o),h=Math.round(h));var l=(this.scrollX=u)+n,d=(this.scrollY=c)+s;this.midPoint.set(l,d);var p=e/r,f=i/r;this.worldView.setTo(l-p/2,d-f/2,p,f),a.applyITRS(this.x+o,this.y+h,this.rotation,r,r),a.translate(-o,-h)},clampX:function(t){var e=this._bounds,i=this.displayWidth,n=e.x+(i-this.width)/2,s=Math.max(n,n+e.width-i);return t<n?t=n:s<t&&(t=s),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,n=e.y+(i-this.height)/2,s=Math.max(n,n+e.height-i);return t<n?t=n:s<t&&(t=s),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=c(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,n,s){return void 0===s&&(s=!1),this._bounds.setTo(t,e,i,n),this.dirty=!0,this.useBounds=!0,s?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(t){void 0===t&&(t=new h);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--;var e=(this.scene=t).sys;this.sceneManager=e.game.scene,this.scaleManager=e.scale,this.cameraManager=e.cameras;var i=this.scaleManager.resolution;return this.resolution=i,this._cx=this._x*i,this._cy=this._y*i,this._cw=this._width*i,this._ch=this._height*i,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setZoom:function(t){return void 0===t&&(t=1),0===t&&(t=.001),this.zoom=t,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.scaleManager){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(o.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this._cx=t*this.resolution,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._cy=t*this.resolution,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this._cw=t*this.resolution,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this._ch=t*this.resolution,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return this._zoom},set:function(t){this._zoom=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoom}},displayHeight:{get:function(){return this.height/this.zoom}}});t.exports=d},function(t,e){t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},function(t,e){t.exports={CREATED:0,INIT:1,DELAY:2,OFFSET_DELAY:3,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING_ADD:20,PAUSED:21,LOOP_DELAY:22,ACTIVE:23,COMPLETE_DELAY:24,PENDING_REMOVE:25,REMOVED:26}},function(t,e,i){t.exports={ENTER_FULLSCREEN:i(358),FULLSCREEN_FAILED:i(359),FULLSCREEN_UNSUPPORTED:i(360),LEAVE_FULLSCREEN:i(361),ORIENTATION_CHANGE:i(362),RESIZE:i(363)}},function(t,e,i){var n=i(5);t.exports=function(t,e,i){return(i-e)*n(t,0,1)}},function(t,e){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,n=t[e],s=e;s<i;s++)t[s]=t[s+1];return t.length=i,n}}},function(t,e,i){var n=i(0),s=i(10),r=i(11),a=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.displayList,this.updateList,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.systems.events.once(r.DESTROY,this.destroy,this)},start:function(){this.systems.events.once(r.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.systems.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},s.register("GameObjectFactory",a,"add"),t.exports=a},function(t,e,i){var n=i(66),s=i(2);t.exports=function(t,e,i){var r=s(t,e,null);if(null===r)return i;if(Array.isArray(r))return n.RND.pick(r);if("object"==typeof r){if(r.hasOwnProperty("randInt"))return n.RND.integerInRange(r.randInt[0],r.randInt[1]);if(r.hasOwnProperty("randFloat"))return n.RND.realInRange(r.randFloat[0],r.randFloat[1])}else if("function"==typeof r)return r(e);return r}},function(t,e){t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19}},function(t,e,i){var n=i(41),s=i(78);t.exports=function(t,e){var i=n.Power0;if("string"==typeof t)if(n.hasOwnProperty(t))i=n[t];else{var r="";t.indexOf(".")&&("in"===(r=t.substr(t.indexOf(".")+1)).toLowerCase()?r="easeIn":"out"===r.toLowerCase()?r="easeOut":"inout"===r.toLowerCase()&&(r="easeInOut")),t=s(t.substr(0,t.indexOf(".")+1)+r),n.hasOwnProperty(t)&&(i=n[t])}else"function"==typeof t?i=t:Array.isArray(t)&&t.length;if(!e)return i;var a=e.slice(0);return a.unshift(0),function(t){return a[0]=t,i.apply(this,a)}}},function(t,e,i){t.exports={ADD_ANIMATION:i(235),ANIMATION_COMPLETE:i(236),ANIMATION_REPEAT:i(237),ANIMATION_RESTART:i(238),ANIMATION_START:i(239),PAUSE_ALL:i(240),REMOVE_ANIMATION:i(241),RESUME_ALL:i(242),SPRITE_ANIMATION_COMPLETE:i(243),SPRITE_ANIMATION_KEY_COMPLETE:i(244),SPRITE_ANIMATION_KEY_REPEAT:i(245),SPRITE_ANIMATION_KEY_RESTART:i(246),SPRITE_ANIMATION_KEY_START:i(247),SPRITE_ANIMATION_KEY_UPDATE:i(248),SPRITE_ANIMATION_REPEAT:i(249),SPRITE_ANIMATION_RESTART:i(250),SPRITE_ANIMATION_START:i(251),SPRITE_ANIMATION_UPDATE:i(252)}},function(t,e,i){var n=i(124),s=i(125),r=i(126),a=i(127),o=i(128),h=i(129),u=i(130),c=i(131),l=i(132),d=i(133),p=i(134),f=i(135);t.exports={Power0:u,Power1:c.Out,Power2:a.Out,Power3:l.Out,Power4:d.Out,Linear:u,Quad:c.Out,Cubic:a.Out,Quart:l.Out,Quint:d.Out,Sine:p.Out,Expo:h.Out,Circ:r.Out,Elastic:o.Out,Back:n.Out,Bounce:s.Out,Stepped:f,"Quad.easeIn":c.In,"Cubic.easeIn":a.In,"Quart.easeIn":l.In,"Quint.easeIn":d.In,"Sine.easeIn":p.In,"Expo.easeIn":h.In,"Circ.easeIn":r.In,"Elastic.easeIn":o.In,"Back.easeIn":n.In,"Bounce.easeIn":s.In,"Quad.easeOut":c.Out,"Cubic.easeOut":a.Out,"Quart.easeOut":l.Out,"Quint.easeOut":d.Out,"Sine.easeOut":p.Out,"Expo.easeOut":h.Out,"Circ.easeOut":r.Out,"Elastic.easeOut":o.Out,"Back.easeOut":n.Out,"Bounce.easeOut":s.Out,"Quad.easeInOut":c.InOut,"Cubic.easeInOut":a.InOut,"Quart.easeInOut":l.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":p.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":r.InOut,"Elastic.easeInOut":o.InOut,"Back.easeInOut":n.InOut,"Bounce.easeInOut":s.InOut}},function(t,e,i){(function(e){var i={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){var t=navigator.userAgent;/Windows/.test(t)?i.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?i.macOS=!0:/Android/.test(t)?i.android=!0:/Linux/.test(t)?i.linux=!0:/iP[ao]d|iPhone/i.test(t)?(i.iOS=!0,navigator.appVersion.match(/OS (\d+)/),i.iOSVersion=parseInt(RegExp.$1,10),i.iPhone=-1!==t.toLowerCase().indexOf("iphone"),i.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?i.kindle=!0:/CrOS/.test(t)&&(i.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(i.android=!1,i.iOS=!1,i.macOS=!1,i.windows=!0,i.windowsPhone=!0);var n=/Silk/.test(t);return(i.windows||i.macOS||i.linux&&!n||i.chromeOS)&&(i.desktop=!0),(i.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(i.desktop=!1),navigator.standalone&&(i.webApp=!0),void 0!==window.cordova&&(i.cordova=!0),void 0!==e&&e.versions&&e.versions.node&&(i.node=!0),i.node&&"object"==typeof e.versions&&(i.nodeWebkit=!!e.versions["node-webkit"],i.electron=!!e.versions.electron),void 0!==window.ejecta&&(i.ejecta=!0),/Crosswalk/.test(t)&&(i.crosswalk=!0),i.pixelRatio=window.devicePixelRatio||1,i}()}).call(this,i(384))},function(t,e,i){var n,s=i(42),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0};t.exports=(n=navigator.userAgent,/Edge\/\d+/.test(n)?r.edge=!0:/Chrome\/(\d+)/.test(n)&&!s.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10)):/Firefox\D+(\d+)/.test(n)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(n)&&s.iOS?r.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(n)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Opera/.test(n)?r.opera=!0:/Safari/.test(n)&&!s.windowsPhone?r.safari=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(n)&&(r.silk=!0),r)},function(t,e){t.exports=function(t,e){return 0<t&&0==(t&t-1)&&0<e&&0==(e&e-1)}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),n?(i+t)/e:i+t)}},function(t,e,i){t.exports={ADD:i(451),ERROR:i(452),LOAD:i(453),READY:i(454),REMOVE:i(455)}},function(t,e,i){var n=i(0),s=i(19),r=new n({initialize:function(t){this.name="WebGLPipeline",this.game=t.game,this.view=t.game.canvas,this.resolution=1,this.width=0,this.height=0,this.gl=t.gl,this.vertexCount=0,this.vertexCapacity=t.vertexCapacity,this.renderer=t.renderer,this.vertexData=t.vertices?t.vertices:new ArrayBuffer(t.vertexCapacity*t.vertexSize),this.vertexBuffer=this.renderer.createVertexBuffer(t.vertices?t.vertices:this.vertexData.byteLength,this.gl.STREAM_DRAW),this.program=this.renderer.createProgram(t.vertShader,t.fragShader),this.attributes=t.attributes,this.vertexSize=t.vertexSize,this.topology=t.topology,this.bytes=new Uint8Array(this.vertexData),this.vertexComponentCount=s.getComponentCount(t.attributes,this.gl),this.flushLocked=!1,this.active=!1},boot:function(){},addAttribute:function(t,e,i,n,r){return this.attributes.push({name:t,size:e,type:this.renderer.glFormats[i],normalized:n,offset:r}),this.vertexComponentCount=s.getComponentCount(this.attributes,this.gl),this},shouldFlush:function(){return this.vertexCount>=this.vertexCapacity},resize:function(t,e,i){return this.width=t*i,this.height=e*i,this.resolution=i,this},bind:function(){var t=this.gl,e=this.vertexBuffer,i=this.attributes,n=this.program,s=this.renderer,r=this.vertexSize;s.setProgram(n),s.setVertexBuffer(e);for(var a=0;a<i.length;++a){var o=i[a],h=t.getAttribLocation(n,o.name);0<=h?(t.enableVertexAttribArray(h),t.vertexAttribPointer(h,o.size,o.type,o.normalized,r,o.offset)):-1!==h&&t.disableVertexAttribArray(h)}return this},onBind:function(){return this},onPreRender:function(){return this},onRender:function(){return this},onPostRender:function(){return this},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t=this.gl,e=this.vertexCount,i=this.topology,n=this.vertexSize;if(0!==e)return t.bufferSubData(t.ARRAY_BUFFER,0,this.bytes.subarray(0,e*n)),t.drawArrays(i,0,e),this.vertexCount=0,this.flushLocked=!1,this;this.flushLocked=!1},destroy:function(){var t=this.gl;return t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),delete this.program,delete this.vertexBuffer,delete this.gl,this},setFloat1:function(t,e){return this.renderer.setFloat1(this.program,t,e),this},setFloat2:function(t,e,i){return this.renderer.setFloat2(this.program,t,e,i),this},setFloat3:function(t,e,i,n){return this.renderer.setFloat3(this.program,t,e,i,n),this},setFloat4:function(t,e,i,n,s){return this.renderer.setFloat4(this.program,t,e,i,n,s),this},setFloat1v:function(t,e){return this.renderer.setFloat1v(this.program,t,e),this},setFloat2v:function(t,e){return this.renderer.setFloat2v(this.program,t,e),this},setFloat3v:function(t,e){return this.renderer.setFloat3v(this.program,t,e),this},setFloat4v:function(t,e){return this.renderer.setFloat4v(this.program,t,e),this},setInt1:function(t,e){return this.renderer.setInt1(this.program,t,e),this},setInt2:function(t,e,i){return this.renderer.setInt2(this.program,t,e,i),this},setInt3:function(t,e,i,n){return this.renderer.setInt3(this.program,t,e,i,n),this},setInt4:function(t,e,i,n,s){return this.renderer.setInt4(this.program,t,e,i,n,s),this},setMatrix2:function(t,e,i){return this.renderer.setMatrix2(this.program,t,e,i),this},setMatrix3:function(t,e,i){return this.renderer.setMatrix3(this.program,t,e,i),this},setMatrix4:function(t,e,i){return this.renderer.setMatrix4(this.program,t,e,i),this}});t.exports=r},function(t,e,i){var n=i(35);t.exports=function(t,e,i,s){var r;if(void 0===s&&(s=t),!Array.isArray(e))return-1!==(r=t.indexOf(e))?(n(t,r),i&&i.call(s,e),e):null;for(var a=e.length-1;0<=a;){var o=e[a];-1!==(r=t.indexOf(o))?(n(t,r),i&&i.call(s,o)):e.pop(),a--}return e}},function(t,e){t.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,NUMPAD_ADD:107,NUMPAD_SUBTRACT:109,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175}},function(t,e){t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},function(t,e,i){var n=i(84),s=i(190);t.exports=function(t,e){if(void 0===e&&(e=90),!n(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=s(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=s(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i<t.length;i++)t[i].reverse();t.reverse()}return t}},function(t,e,i){var n=i(2),s={},r={register:function(t,e,i,n,r){s[t]={plugin:e,mapping:i,settingsKey:n,configKey:r}},getPlugin:function(t){return s[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,r=e.game.config;for(var a in s){var o=s[a].plugin,h=s[a].mapping,u=s[a].settingsKey,c=s[a].configKey;n(i,u,r[c])&&(t[h]=new o(t))}},remove:function(t){s.hasOwnProperty(t)&&delete s[t]}};t.exports=r},function(t,e,i){t.exports={ANY_KEY_DOWN:i(685),ANY_KEY_UP:i(686),COMBO_MATCH:i(687),DOWN:i(688),KEY_DOWN:i(689),KEY_UP:i(690),UP:i(691)}},function(t,e){t.exports=function(t,e,i){return t.hasOwnProperty(e)?"function"==typeof t[e]?function(i,n,s,r,a,o){return t[e](i,n,s,r,a,o)}:function(){return t[e]}:"function"==typeof i?i:function(){return i}}},function(t,e,i){var n=i(94),s=i(37),r=i(31),a=i(39),o=i(54),h=i(216),u=i(92),c=i(2),l=i(93),d=i(95),p=i(97);t.exports=function(t,e,i){void 0===i&&(i=n);for(var f=i.targets?i.targets:u(e),m=h(e),g=o(e,"delay",i.delay),v=o(e,"duration",i.duration),y=c(e,"easeParams",i.easeParams),_=a(c(e,"ease",i.ease),y),x=o(e,"hold",i.hold),E=o(e,"repeat",i.repeat),T=o(e,"repeatDelay",i.repeatDelay),w=r(e,"yoyo",i.yoyo),S=r(e,"flipX",i.flipX),b=r(e,"flipY",i.flipY),A=[],C=0;C<m.length;C++)for(var O=m[C].key,M=m[C].value,R=0;R<f.length;R++){var P=l(O,M),I=p(f[R],R,O,P.getEnd,P.getStart,P.getActive,a(c(M,"ease",_),y),o(M,"delay",g),o(M,"duration",v),r(M,"yoyo",w),o(M,"hold",x),o(M,"repeat",E),o(M,"repeatDelay",T),r(M,"flipX",S),r(M,"flipY",b));A.push(I)}var L=new d(t,A,f);L.offset=s(e,"offset",null),L.completeDelay=s(e,"completeDelay",0),L.loop=Math.round(s(e,"loop",0)),L.loopDelay=Math.round(s(e,"loopDelay",0)),L.paused=r(e,"paused",!1),L.useFrames=r(e,"useFrames",!1);for(var G=c(e,"callbackScope",L),D=[L,null],k=d.TYPES,F=0;F<k.length;F++){var N=k[F],B=c(e,N,!1);if(B){var U=c(e,N+"Scope",G),V=c(e,N+"Params",[]);L.setCallback(N,B,D.concat(V),U)}}return L}},function(t,e,i){var n=i(5),s=i(0),r=i(3),a=i(40),o=i(99),h=i(100),u=i(2),c=new s({Extends:r,initialize:function(t,e,i){r.call(this),this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,u(i,"frames",[]),u(i,"defaultTextureKey",null)),this.frameRate=u(i,"frameRate",null),this.duration=u(i,"duration",null),null===this.duration&&null===this.frameRate?(this.frameRate=24,this.duration=this.frameRate/this.frames.length*1e3):this.duration&&null===this.frameRate?this.frameRate=this.frames.length/(this.duration/1e3):this.duration=this.frames.length/this.frameRate*1e3,this.msPerFrame=1e3/this.frameRate,this.skipMissedFrames=u(i,"skipMissedFrames",!0),this.delay=u(i,"delay",0),this.repeat=u(i,"repeat",0),this.repeatDelay=u(i,"repeatDelay",0),this.yoyo=u(i,"yoyo",!1),this.showOnStart=u(i,"showOnStart",!1),this.hideOnComplete=u(i,"hideOnComplete",!1),this.paused=!1,this.manager.on(a.PAUSE_ALL,this.pause,this),this.manager.on(a.RESUME_ALL,this.resume,this)},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(0<i.length){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var n=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=n.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return 0<=t&&t<this.frames.length},completeAnimation:function(t){this.hideOnComplete&&(t.parent.visible=!1),t.stop()},getFirstTick:function(t,e){void 0===e&&(e=!0),t.accumulator=0,t.nextTick=t.msPerFrame+t.currentFrame.duration,e&&(t.nextTick+=t._delay)},getFrameAt:function(t){return this.frames[t]},getFrames:function(t,e,i){var n,s,r,a,o=[],c=1;if("string"==typeof e){a=e;var l=t.get(a).getFrameNames();e=[],l.forEach((function(t,i){e.push({key:a,frame:i})}))}if(!Array.isArray(e)||0===e.length)return o;for(r=0;r<e.length;r++){var d=e[r],p=u(d,"key",i);if(p){var f=u(d,"frame",0),m=t.getFrame(p,f);(s=new h(p,f,c,m)).duration=u(d,"duration",0),s.isFirst=!n,n&&((n.nextFrame=s).prevFrame=n),o.push(s),n=s,c++}}if(0<o.length){s.isLast=!0,s.nextFrame=o[0],o[0].prevFrame=s;var g=1/(o.length-1);for(r=0;r<o.length;r++)o[r].progress=r*g}return o},getNextTick:function(t){t.accumulator-=t.nextTick,t.nextTick=t.msPerFrame+t.currentFrame.duration},load:function(t,e){e>=this.frames.length&&(e=0),t.currentAnim!==this&&(t.currentAnim=this,t.frameRate=this.frameRate,t.duration=this.duration,t.msPerFrame=this.msPerFrame,t.skipMissedFrames=this.skipMissedFrames,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo);var i=this.frames[e];0!==e||t.forward||(i=this.getLastFrame()),t.updateFrame(i)},getFrameByProgress:function(t){return t=n(t,0,1),o(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t._yoyo?this.handleYoyoFrame(t,!1):0<t.repeatCounter?t._reverse&&t.forward?t.forward=!1:this.repeatAnimation(t):this.completeAnimation(t):this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e=e||!1,t._reverse===!e&&0<t.repeatCounter)return t._repeatDelay&&!t.pendingRepeat||(t.forward=e),void this.repeatAnimation(t);if(t._reverse===e||0!==t.repeatCounter){var i=(t.forward=e)?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else this.completeAnimation(t)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t._yoyo?this.handleYoyoFrame(t,!0):0<t.repeatCounter?(t._reverse&&!t.forward?t.currentFrame=this.getLastFrame():t.forward=!0,this.repeatAnimation(t)):this.completeAnimation(t):this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.updateFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop)return this.completeAnimation(t);if(0<t._repeatDelay&&!1===t.pendingRepeat)t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t._repeatDelay;else if(t.repeatCounter--,t.updateFrame(t.currentFrame[t.forward?"nextFrame":"prevFrame"]),t.isPlaying){this.getNextTick(t),t.pendingRepeat=!1;var e=t.currentFrame,i=t.parent;this.emit(a.ANIMATION_REPEAT,this,e),i.emit(a.SPRITE_ANIMATION_KEY_REPEAT+this.key,this,e,t.repeatCounter,i),i.emit(a.SPRITE_ANIMATION_REPEAT,this,e,t.repeatCounter,i)}},setFrame:function(t){t.forward?this.nextFrame(t):this.previousFrame(t)},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach((function(e){t.frames.push(e.toJSON())})),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),n=0;n<e;n++)(t=this.frames[n]).index=n+1,t.isFirst=!1,t.isLast=!1,t.progress=n*i,0===n?(t.isFirst=!0,1===e?(t.isLast=!0,(t.nextFrame=t).prevFrame=t):(t.isLast=!1,t.prevFrame=this.frames[e-1],t.nextFrame=this.frames[n+1])):n===e-1&&1<e?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):1<e&&(t.prevFrame=this.frames[n-1],t.nextFrame=this.frames[n+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.removeAllListeners(),this.manager.off(a.PAUSE_ALL,this.pause,this),this.manager.off(a.RESUME_ALL,this.resume,this),this.manager.remove(this.key);for(var t=0;t<this.frames.length;t++)this.frames[t].destroy();this.frames=[],this.manager=null}});t.exports=c},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===n&&(n=3);var s=0;if(e+1>=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((s=e-t.length)/2);t=new Array(s-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e){t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i}},function(t,e,i){var n=i(0),s=i(280),r=i(281),a=i(24),o=i(282),h=i(7),u=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=a.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=n},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return r(this,t,e,i)},getRandomPoint:function(t){return o(this,t)},setTo:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=u},function(t,e){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)<i}},function(t,e,i){var n=i(9);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e){t.exports=function(t,e,i){var n=i-e;return e+((t-e)%n+n)%n}},function(t,e){t.exports=function(t,e,i){return(e-t)*i+t}},function(t,e,i){var n=i(42),s=i(43),r=i(12),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var e=r.createWebGL(this),i=e.getContext("webgl")||e.getContext("experimental-webgl"),n=r.create2D(this),s=n.getContext("2d").createImageData(1,1);return t=s.data instanceof Uint8ClampedArray,r.remove(e),r.remove(n),!!i}catch(e){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,s.firefox&&s.firefoxVersion<21&&(a.getUserMedia=!1),!n.iOS&&(s.ie||s.firefox||s.chrome)&&(a.canvasBitBltShift=!0),(s.safari||s.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=function(){var t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t);return e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null}()),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&t,a}()},function(t,e,i){var n=i(9),s=i(13),r={Angle:i(389),Distance:i(399),Easing:i(406),Fuzzy:i(407),Interpolation:i(412),Pow2:i(419),Snap:i(422),RandomDataGenerator:i(425),Average:i(426),Bernstein:i(141),Between:i(427),CatmullRom:i(143),CeilTo:i(428),Clamp:i(5),DegToRad:i(62),Difference:i(429),Factorial:i(142),FloatBetween:i(67),FloorTo:i(430),FromPercent:i(34),GetSpeed:i(431),IsEven:i(432),IsEvenStrict:i(433),Linear:i(64),MaxAdd:i(434),MinSub:i(435),Percent:i(436),RadToDeg:i(437),RandomXY:i(438),RandomXYZ:i(439),RandomXYZW:i(440),Rotate:i(441),RotateAround:i(112),RotateAroundDistance:i(442),RotateTo:i(443),RoundAwayFromZero:i(147),RoundTo:i(444),SinCosTableGenerator:i(445),SmootherStep:i(146),SmoothStep:i(145),ToXY:i(446),TransformXY:i(148),Within:i(447),Wrap:i(63),Vector2:i(7),Vector3:i(69),Vector4:i(448),Matrix3:i(149),Matrix4:i(150),Quaternion:i(151),RotateVec3:i(449)};r=s(!1,r,n),t.exports=r},function(t,e){t.exports=function(t,e){return Math.random()*(e-t)+t}},function(t,e){t.exports=function(t,e,i,n){var s=t-i,r=e-n;return Math.sqrt(s*s+r*r)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},clone:function(){return new n(this.x,this.y,this.z)},crossVectors:function(t,e){var i=t.x,n=t.y,s=t.z,r=e.x,a=e.y,o=e.z;return this.x=n*o-s*a,this.y=s*r-i*o,this.z=i*a-n*r,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return Math.sqrt(e*e+i*i+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return e*e+i*i+n*n},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,n=t*t+e*e+i*i;return 0<n&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,a=t.z;return this.x=i*a-n*r,this.y=n*s-e*a,this.z=e*r-i*s,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this},transformMat3:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=e*s[0]+i*s[3]+n*s[6],this.y=e*s[1]+i*s[4]+n*s[7],this.z=e*s[2]+i*s[5]+n*s[8],this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12],this.y=s[1]*e+s[5]*i+s[9]*n+s[13],this.z=s[2]*e+s[6]*i+s[10]*n+s[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=e*s[0]+i*s[4]+n*s[8]+s[12],a=e*s[1]+i*s[5]+n*s[9]+s[13],o=e*s[2]+i*s[6]+n*s[10]+s[14],h=e*s[3]+i*s[7]+n*s[11]+s[15];return this.x=r/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,a=t.z,o=t.w,h=o*e+r*n-a*i,u=o*i+a*e-s*n,c=o*n+s*i-r*e,l=-s*e-r*i-a*n;return this.x=h*o+l*-s+u*-a-c*-r,this.y=u*o+l*-r+c*-s-h*-a,this.z=c*o+l*-a+h*-r-u*-s,this},project:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=s[0],a=s[1],o=s[2],h=s[3],u=s[4],c=s[5],l=s[6],d=s[7],p=s[8],f=s[9],m=s[10],g=s[11],v=s[12],y=s[13],_=s[14],x=1/(e*h+i*d+n*g+s[15]);return this.x=(e*r+i*u+n*p+v)*x,this.y=(e*a+i*c+n*f+y)*x,this.z=(e*o+i*l+n*m+_)*x,this},unproject:function(t,e){var i=t.x,n=t.y,s=t.z,r=t.w,a=this.x-i,o=r-this.y-1-n,h=this.z;return this.x=2*a/s-1,this.y=2*o/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});n.ZERO=new n,n.RIGHT=new n(1,0,0),n.LEFT=new n(-1,0,0),n.UP=new n(0,-1,0),n.DOWN=new n(0,1,0),n.FORWARD=new n(0,0,1),n.BACK=new n(0,0,-1),n.ONE=new n(1,1,1),t.exports=n},function(t,e,i){t.exports={Global:["game","anims","cache","plugins","registry","scale","sound","textures"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]}},function(t,e,i){var n=i(0),s=i(459),r=i(4),a=i(72),o=i(160),h=i(161),u=i(18),c=i(19),l=i(47),d=new n({Extends:l,Mixins:[a],initialize:function(t){var e=t.renderer.config;l.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:r(t,"topology",t.renderer.gl.TRIANGLES),vertShader:r(t,"vertShader",h),fragShader:r(t,"fragShader",o),vertexCapacity:r(t,"vertexCapacity",6*e.batchSize),vertexSize:r(t,"vertexSize",5*Float32Array.BYTES_PER_ELEMENT+4*Uint8Array.BYTES_PER_ELEMENT),attributes:[{name:"inPosition",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:0},{name:"inTexCoord",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:2*Float32Array.BYTES_PER_ELEMENT},{name:"inTintEffect",size:1,type:t.renderer.gl.FLOAT,normalized:!1,offset:4*Float32Array.BYTES_PER_ELEMENT},{name:"inTint",size:4,type:t.renderer.gl.UNSIGNED_BYTE,normalized:!0,offset:5*Float32Array.BYTES_PER_ELEMENT}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.vertexViewU32=new Uint32Array(this.vertexData),this.maxQuads=e.batchSize,this.batches=[],this._tempMatrix1=new u,this._tempMatrix2=new u,this._tempMatrix3=new u,this._tempMatrix4=new u,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.tintEffect=2,this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[],this.mvpInit()},onBind:function(){return l.prototype.onBind.call(this),this.mvpUpdate(),this},resize:function(t,e,i){return l.prototype.resize.call(this,t,e,i),this.projOrtho(0,this.width,this.height,0,-1e3,1e3),this},setTexture2D:function(t,e){return void 0===t&&(t=this.renderer.blankTexture.glTexture),void 0===e&&(e=0),this.requireTextureBatch(t,e)&&this.pushBatch(t,e),this},requireTextureBatch:function(t,e){var i=this.batches,n=i.length;return!(0<n&&(0<e?i[n-1].textures[e-1]:i[n-1].texture)===t)},pushBatch:function(t,e){if(0===e)this.batches.push({first:this.vertexCount,texture:t,textures:[]});else{var i=[];i[e-1]=t,this.batches.push({first:this.vertexCount,texture:null,textures:i})}},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t,e,i,n=this.gl,s=this.vertexCount,r=this.topology,a=this.vertexSize,o=this.renderer,h=this.batches,u=h.length,c=0,l=null;if(0===u||0===s)return this.flushLocked=!1,this;n.bufferSubData(n.ARRAY_BUFFER,0,this.bytes.subarray(0,s*a));for(var d=0;d<u-1;d++){if(l=h[d],t=h[d+1],0<l.textures.length){for(e=0;e<l.textures.length;++e)(i=l.textures[e])&&o.setTexture2D(i,1+e,!1);n.activeTexture(n.TEXTURE0)}c=t.first-l.first,null===l.texture||c<=0||(o.setTexture2D(l.texture,0,!1),n.drawArrays(r,l.first,c))}if(0<(l=h[u-1]).textures.length){for(e=0;e<l.textures.length;++e)(i=l.textures[e])&&o.setTexture2D(i,1+e,!1);n.activeTexture(n.TEXTURE0)}return c=s-l.first,l.texture&&0<c&&(o.setTexture2D(l.texture,0,!1),n.drawArrays(r,l.first,c)),this.vertexCount=0,h.length=0,this.flushLocked=!1,this},batchSprite:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix1,s=this._tempMatrix2,r=this._tempMatrix3,a=t.frame,o=a.glTexture,h=a.u0,u=a.v0,l=a.u1,d=a.v1,p=a.x,f=a.y,m=a.cutWidth,g=a.cutHeight,v=a.customPivot,y=t.displayOriginX,_=t.displayOriginY,x=-y+p,E=-_+f;if(t.isCropped){var T=t._crop;T.flipX===t.flipX&&T.flipY===t.flipY||a.updateCropUVs(T,t.flipX,t.flipY),h=T.u0,u=T.v0,l=T.u1,d=T.v1,m=T.width,g=T.height,x=-y+(p=T.x),E=-_+(f=T.y)}var w=1,S=1;t.flipX&&(v||(x+=-a.realWidth+2*y),w=-1),(t.flipY||a.source.isGLTexture&&!o.flipY)&&(v||(E+=-a.realHeight+2*_),S=-1),s.applyITRS(t.x,t.y,t.rotation,t.scaleX*w,t.scaleY*S),n.copyFrom(e.matrix),i?(n.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),s.e=t.x,s.f=t.y):(s.e-=e.scrollX*t.scrollFactorX,s.f-=e.scrollY*t.scrollFactorY),n.multiply(s,r);var b=x+m,A=E+g,C=r.getX(x,E),O=r.getY(x,E),M=r.getX(x,A),R=r.getY(x,A),P=r.getX(b,A),I=r.getY(b,A),L=r.getX(b,E),G=r.getY(b,E),D=c.getTintAppendFloatAlpha(t._tintTL,e.alpha*t._alphaTL),k=c.getTintAppendFloatAlpha(t._tintTR,e.alpha*t._alphaTR),F=c.getTintAppendFloatAlpha(t._tintBL,e.alpha*t._alphaBL),N=c.getTintAppendFloatAlpha(t._tintBR,e.alpha*t._alphaBR);e.roundPixels&&(C=Math.round(C),O=Math.round(O),M=Math.round(M),R=Math.round(R),P=Math.round(P),I=Math.round(I),L=Math.round(L),G=Math.round(G)),this.setTexture2D(o,0);var B=t._isTinted&&t.tintFill;this.batchQuad(C,O,M,R,P,I,L,G,h,u,l,d,D,k,F,N,B,o,0)},batchQuad:function(t,e,i,n,s,r,a,o,h,u,c,l,d,p,f,m,g,v,y){var _=!1;this.vertexCount+6>this.vertexCapacity&&(this.flush(),_=!0,this.setTexture2D(v,y));var x=this.vertexViewF32,E=this.vertexViewU32,T=this.vertexCount*this.vertexComponentCount-1;return x[++T]=t,x[++T]=e,x[++T]=h,x[++T]=u,x[++T]=g,E[++T]=d,x[++T]=i,x[++T]=n,x[++T]=h,x[++T]=l,x[++T]=g,E[++T]=f,x[++T]=s,x[++T]=r,x[++T]=c,x[++T]=l,x[++T]=g,E[++T]=m,x[++T]=t,x[++T]=e,x[++T]=h,x[++T]=u,x[++T]=g,E[++T]=d,x[++T]=s,x[++T]=r,x[++T]=c,x[++T]=l,x[++T]=g,E[++T]=m,x[++T]=a,x[++T]=o,x[++T]=c,x[++T]=u,x[++T]=g,E[++T]=p,this.vertexCount+=6,_},batchTri:function(t,e,i,n,s,r,a,o,h,u,c,l,d,p,f,m){var g=!1;this.vertexCount+3>this.vertexCapacity&&(this.flush(),this.setTexture2D(f,m),g=!0);var v=this.vertexViewF32,y=this.vertexViewU32,_=this.vertexCount*this.vertexComponentCount-1;return v[++_]=t,v[++_]=e,v[++_]=a,v[++_]=o,v[++_]=p,y[++_]=c,v[++_]=i,v[++_]=n,v[++_]=a,v[++_]=u,v[++_]=p,y[++_]=l,v[++_]=s,v[++_]=r,v[++_]=h,v[++_]=u,v[++_]=p,y[++_]=d,this.vertexCount+=3,g},batchTexture:function(t,e,i,n,s,r,a,o,h,u,c,l,d,p,f,m,g,v,y,_,x,E,T,w,S,b,A,C,O,M,R){this.renderer.setPipeline(this,t);var P=this._tempMatrix1,I=this._tempMatrix2,L=this._tempMatrix3,G=v/i+A,D=y/n+C,k=(v+_)/i+A,F=(y+x)/n+C,N=a,B=o,U=-m,V=-g;if(t.isCropped){var Y=t._crop;N=Y.width,B=Y.height,a=Y.width,o=Y.height;var z=v=Y.x,H=y=Y.y;l&&(z=_-Y.x-Y.width),d&&!e.isRenderTexture&&(H=x-Y.y-Y.height),G=z/i+A,D=H/n+C,k=(z+Y.width)/i+A,F=(H+Y.height)/n+C,U=-m+v,V=-g+y}l&&(N*=-1,U+=a),(d^=!R&&e.isRenderTexture?1:0)&&(B*=-1,V+=o);var j=U+N,W=V+B;I.applyITRS(s,r,c,h,u),P.copyFrom(O.matrix),M?(P.multiplyWithOffset(M,-O.scrollX*p,-O.scrollY*f),I.e=s,I.f=r):(I.e-=O.scrollX*p,I.f-=O.scrollY*f),P.multiply(I,L);var X=L.getX(U,V),Z=L.getY(U,V),K=L.getX(U,W),q=L.getY(U,W),J=L.getX(j,W),Q=L.getY(j,W),$=L.getX(j,V),tt=L.getY(j,V);O.roundPixels&&(X=Math.round(X),Z=Math.round(Z),K=Math.round(K),q=Math.round(q),J=Math.round(J),Q=Math.round(Q),$=Math.round($),tt=Math.round(tt)),this.setTexture2D(e,0),this.batchQuad(X,Z,K,q,J,Q,$,tt,G,D,k,F,E,T,w,S,b,e,0)},batchTextureFrame:function(t,e,i,n,s,r,a){this.renderer.setPipeline(this);var o=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,u=e+t.width,l=i+t.height;a?o.multiply(a,h):h=o;var d=h.getX(e,i),p=h.getY(e,i),f=h.getX(e,l),m=h.getY(e,l),g=h.getX(u,l),v=h.getY(u,l),y=h.getX(u,i),_=h.getY(u,i);this.setTexture2D(t.glTexture,0),n=c.getTintAppendFloatAlpha(n,s),this.batchQuad(d,p,f,m,g,v,y,_,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0,t.glTexture,0)},drawFillRect:function(t,e,i,n,s,r){var a=t+i,o=e+n;this.setTexture2D();var h=c.getTintAppendFloatAlphaAndSwap(s,r);this.batchQuad(t,e,t,o,a,o,a,e,0,0,1,1,h,h,h,h,2)},batchFillRect:function(t,e,i,n,s,r){this.renderer.setPipeline(this);var a=this._tempMatrix3;r&&r.multiply(s,a);var o=t+i,h=e+n,u=a.getX(t,e),c=a.getY(t,e),l=a.getX(t,h),d=a.getY(t,h),p=a.getX(o,h),f=a.getY(o,h),m=a.getX(o,e),g=a.getY(o,e),v=this.currentFrame,y=v.u0,_=v.v0,x=v.u1,E=v.v1;this.batchQuad(u,c,l,d,p,f,m,g,y,_,x,E,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.fillTint.BR,this.tintEffect)},batchFillTriangle:function(t,e,i,n,s,r,a,o){this.renderer.setPipeline(this);var h=this._tempMatrix3;o&&o.multiply(a,h);var u=h.getX(t,e),c=h.getY(t,e),l=h.getX(i,n),d=h.getY(i,n),p=h.getX(s,r),f=h.getY(s,r),m=this.currentFrame,g=m.u0,v=m.v0,y=m.u1,_=m.v1;this.batchTri(u,c,l,d,p,f,g,v,y,_,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.tintEffect)},batchStrokeTriangle:function(t,e,i,n,s,r,a,o,h){var u=this.tempTriangle;u[0].x=t,u[0].y=e,u[0].width=a,u[1].x=i,u[1].y=n,u[1].width=a,u[2].x=s,u[2].y=r,u[2].width=a,u[3].x=t,u[3].y=e,u[3].width=a,this.batchStrokePath(u,a,!1,o,h)},batchFillPath:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix3;i&&i.multiply(e,n);for(var r,a,o=t.length,h=this.polygonCache,u=this.fillTint.TL,c=this.fillTint.TR,l=this.fillTint.BL,d=this.tintEffect,p=0;p<o;++p)a=t[p],h.push(a.x,a.y);o=(r=s(h)).length;for(var f=this.currentFrame,m=0;m<o;m+=3){var g=2*r[m+0],v=2*r[m+1],y=2*r[m+2],_=h[0+g],x=h[1+g],E=h[0+v],T=h[1+v],w=h[0+y],S=h[1+y],b=n.getX(_,x),A=n.getY(_,x),C=n.getX(E,T),O=n.getY(E,T),M=n.getX(w,S),R=n.getY(w,S),P=f.u0,I=f.v0,L=f.u1,G=f.v1;this.batchTri(b,A,C,O,M,R,P,I,L,G,u,c,l,d)}h.length=0},batchStrokePath:function(t,e,i,n,s){this.renderer.setPipeline(this),this.prevQuad[4]=0,this.firstQuad[4]=0;for(var r=t.length-1,a=0;a<r;a++){var o=t[a],h=t[a+1];this.batchLine(o.x,o.y,h.x,h.y,o.width/2,h.width/2,e,a,!i&&a===r-1,n,s)}},batchLine:function(t,e,i,n,s,r,a,o,h,u,c){this.renderer.setPipeline(this);var l=this._tempMatrix3;c&&c.multiply(u,l);var d=i-t,p=n-e,f=Math.sqrt(d*d+p*p),m=s*(n-e)/f,g=s*(t-i)/f,v=r*(n-e)/f,y=r*(t-i)/f,_=i-v,x=n-y,E=t-m,T=e-g,w=i+v,S=n+y,b=t+m,A=e+g,C=l.getX(_,x),O=l.getY(_,x),M=l.getX(E,T),R=l.getY(E,T),P=l.getX(w,S),I=l.getY(w,S),L=l.getX(b,A),G=l.getY(b,A),D=this.strokeTint,k=this.tintEffect,F=D.TL,N=D.TR,B=D.BL,U=D.BR,V=this.currentFrame,Y=V.u0,z=V.v0,H=V.u1,j=V.v1;if(this.batchQuad(L,G,M,R,C,O,P,I,Y,z,H,j,F,N,B,U,k),!(a<=2)){var W=this.prevQuad,X=this.firstQuad;0<o&&W[4]?this.batchQuad(L,G,M,R,W[0],W[1],W[2],W[3],Y,z,H,j,F,N,B,U,k):(X[0]=L,X[1]=G,X[2]=M,X[3]=R,X[4]=1),h&&X[4]?this.batchQuad(C,O,P,I,X[0],X[1],X[2],X[3],Y,z,H,j,F,N,B,U,k):(W[0]=C,W[1]=O,W[2]=P,W[3]=I,W[4]=1)}}});t.exports=d},function(t,e){var i={modelMatrixDirty:!1,viewMatrixDirty:!1,projectionMatrixDirty:!1,modelMatrix:null,viewMatrix:null,projectionMatrix:null,mvpInit:function(){return this.modelMatrixDirty=!0,this.viewMatrixDirty=!0,this.projectionMatrixDirty=!0,this.modelMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.viewMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.projectionMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this},mvpUpdate:function(){var t=this.program;return this.modelMatrixDirty&&(this.renderer.setMatrix4(t,"uModelMatrix",!1,this.modelMatrix),this.modelMatrixDirty=!1),this.viewMatrixDirty&&(this.renderer.setMatrix4(t,"uViewMatrix",!1,this.viewMatrix),this.viewMatrixDirty=!1),this.projectionMatrixDirty&&(this.renderer.setMatrix4(t,"uProjectionMatrix",!1,this.projectionMatrix),this.projectionMatrixDirty=!1),this},modelIdentity:function(){var t=this.modelMatrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this.modelMatrixDirty=!0,this},modelScale:function(t,e,i){var n=this.modelMatrix;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this.modelMatrixDirty=!0,this},modelTranslate:function(t,e,i){var n=this.modelMatrix;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this.modelMatrixDirty=!0,this},modelRotateX:function(t){var e=this.modelMatrix,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],a=e[6],o=e[7],h=e[8],u=e[9],c=e[10],l=e[11];return e[4]=s*n+h*i,e[5]=r*n+u*i,e[6]=a*n+c*i,e[7]=o*n+l*i,e[8]=h*n-s*i,e[9]=u*n-r*i,e[10]=c*n-a*i,e[11]=l*n-o*i,this.modelMatrixDirty=!0,this},modelRotateY:function(t){var e=this.modelMatrix,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],a=e[2],o=e[3],h=e[8],u=e[9],c=e[10],l=e[11];return e[0]=s*n-h*i,e[1]=r*n-u*i,e[2]=a*n-c*i,e[3]=o*n-l*i,e[8]=s*i+h*n,e[9]=r*i+u*n,e[10]=a*i+c*n,e[11]=o*i+l*n,this.modelMatrixDirty=!0,this},modelRotateZ:function(t){var e=this.modelMatrix,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],a=e[2],o=e[3],h=e[4],u=e[5],c=e[6],l=e[7];return e[0]=s*n+h*i,e[1]=r*n+u*i,e[2]=a*n+c*i,e[3]=o*n+l*i,e[4]=h*n-s*i,e[5]=u*n-r*i,e[6]=c*n-a*i,e[7]=l*n-o*i,this.modelMatrixDirty=!0,this},viewIdentity:function(){var t=this.viewMatrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this.viewMatrixDirty=!0,this},viewScale:function(t,e,i){var n=this.viewMatrix;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this.viewMatrixDirty=!0,this},viewTranslate:function(t,e,i){var n=this.viewMatrix;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this.viewMatrixDirty=!0,this},viewRotateX:function(t){var e=this.viewMatrix,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],a=e[6],o=e[7],h=e[8],u=e[9],c=e[10],l=e[11];return e[4]=s*n+h*i,e[5]=r*n+u*i,e[6]=a*n+c*i,e[7]=o*n+l*i,e[8]=h*n-s*i,e[9]=u*n-r*i,e[10]=c*n-a*i,e[11]=l*n-o*i,this.viewMatrixDirty=!0,this},viewRotateY:function(t){var e=this.viewMatrix,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],a=e[2],o=e[3],h=e[8],u=e[9],c=e[10],l=e[11];return e[0]=s*n-h*i,e[1]=r*n-u*i,e[2]=a*n-c*i,e[3]=o*n-l*i,e[8]=s*i+h*n,e[9]=r*i+u*n,e[10]=a*i+c*n,e[11]=o*i+l*n,this.viewMatrixDirty=!0,this},viewRotateZ:function(t){var e=this.viewMatrix,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],a=e[2],o=e[3],h=e[4],u=e[5],c=e[6],l=e[7];return e[0]=s*n+h*i,e[1]=r*n+u*i,e[2]=a*n+c*i,e[3]=o*n+l*i,e[4]=h*n-s*i,e[5]=u*n-r*i,e[6]=c*n-a*i,e[7]=l*n-o*i,this.viewMatrixDirty=!0,this},viewLoad2D:function(t){var e=this.viewMatrix;return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=0,e[4]=t[2],e[5]=t[3],e[6]=0,e[7]=0,e[8]=t[4],e[9]=t[5],e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this.viewMatrixDirty=!0,this},viewLoad:function(t){var e=this.viewMatrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this.viewMatrixDirty=!0,this},projIdentity:function(){var t=this.projectionMatrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this.projectionMatrixDirty=!0,this},projOrtho:function(t,e,i,n,s,r){var a=this.projectionMatrix,o=1/(t-e),h=1/(i-n),u=1/(s-r);return a[0]=-2*o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=-2*h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=2*u,a[11]=0,a[12]=(t+e)*o,a[13]=(n+i)*h,a[14]=(r+s)*u,a[15]=1,this.projectionMatrixDirty=!0,this},projPersp:function(t,e,i,n){var s=this.projectionMatrix,r=1/Math.tan(t/2),a=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*a,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*a,s[15]=0,this.projectionMatrixDirty=!0,this}};t.exports=i},function(t,e){t.exports=function(t,e){var i;if(e)"string"==typeof e?i=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(i=e);else if(t.parentElement||null===e)return t;return(i=i||document.body).appendChild(t),t}},function(t,e){t.exports={MOUSE_DOWN:0,MOUSE_MOVE:1,MOUSE_UP:2,TOUCH_START:3,TOUCH_MOVE:4,TOUCH_END:5,POINTER_LOCK_CHANGE:6,TOUCH_CANCEL:7,MOUSE_WHEEL:8}},function(t,e,i){var n={CENTER:i(175),ORIENTATION:i(176),SCALE_MODE:i(177),ZOOM:i(178)};t.exports=n},function(t,e,i){t.exports={ADD:i(520),COMPLETE:i(521),FILE_COMPLETE:i(522),FILE_KEY_COMPLETE:i(523),FILE_LOAD_ERROR:i(524),FILE_LOAD:i(525),FILE_PROGRESS:i(526),POST_PROCESS:i(527),PROGRESS:i(528),START:i(529)}},function(t,e,i){var n=i(0),s=i(50),r=i(70),a=i(11),o=i(530),h=i(531),u=i(1),c=i(181),l=new n({initialize:function(t,e){this.scene=t,this.game,this.renderer,this.config=e,this.settings=c.create(e),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=u},init:function(t){this.settings.status=s.INIT,this.sceneUpdate=u,this.game=t,this.renderer=t.renderer,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;(this.plugins=e).addToScene(this,r.Global,[r.CoreScene,h(this),o(this)]),this.events.emit(a.BOOT,this),this.settings.isBooted=!0},install:function(t){Array.isArray(t)||(t=[t]),this.plugins.installLocal(this,t)},step:function(t,e){this.events.emit(a.PRE_UPDATE,t,e),this.events.emit(a.UPDATE,t,e),this.sceneUpdate.call(this.scene,t,e),this.events.emit(a.POST_UPDATE,t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.cameras.render(t,e),this.events.emit(a.RENDER,t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(t){return this.settings.active&&(this.settings.status=s.PAUSED,this.settings.active=!1,this.events.emit(a.PAUSE,this,t)),this},resume:function(t){return this.settings.active||(this.settings.status=s.RUNNING,this.settings.active=!0,this.events.emit(a.RESUME,this,t)),this},sleep:function(t){return this.settings.status=s.SLEEPING,this.settings.active=!1,this.settings.visible=!1,this.events.emit(a.SLEEP,this,t),this},wake:function(t){var e=this.settings;return e.status=s.RUNNING,e.active=!0,e.visible=!0,this.events.emit(a.WAKE,this,t),e.isTransition&&this.events.emit(a.TRANSITION_WAKE,e.transitionFrom,e.transitionDuration),this},getData:function(){return this.settings.data},isSleeping:function(){return this.settings.status===s.SLEEPING},isActive:function(){return this.settings.status===s.RUNNING},isPaused:function(){return this.settings.status===s.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&0<this.scenePlugin._duration},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){t&&(this.settings.data=t),this.settings.status=s.START,this.settings.active=!0,this.settings.visible=!0,this.events.emit(a.START,this),this.events.emit(a.READY,this,t)},shutdown:function(t){this.events.off(a.TRANSITION_INIT),this.events.off(a.TRANSITION_START),this.events.off(a.TRANSITION_COMPLETE),this.events.off(a.TRANSITION_OUT),this.settings.status=s.SHUTDOWN,this.settings.active=!1,this.settings.visible=!1,this.events.emit(a.SHUTDOWN,this,t)},destroy:function(){this.settings.status=s.DESTROYED,this.settings.active=!1,this.settings.visible=!1,this.events.emit(a.DESTROY,this),this.events.removeAllListeners();for(var t=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],e=0;e<t.length;e++)this[t[e]]=null}});t.exports=l},function(t,e){t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},function(t,e,i){var n=i(0),s=i(80),r=i(185),a="Texture.frame missing: ",o=new n({initialize:function(t,e,i,n,s){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE";for(var a=this.frameTotal=0;a<i.length;a++)this.source.push(new r(this,i[a],n,s))},add:function(t,e,i,n,r,a){if(this.has(t))return null;var o=new s(this,t,e,i,n,r,a);return this.frames[t]=o,"__BASE"===this.firstFrame&&(this.firstFrame=t),this.frameTotal++,o},remove:function(t){return!!this.has(t)&&(this.get(t).destroy(),delete this.frames[t],!0)},has:function(t){return this.frames[t]},get:function(t){t=t||this.firstFrame;var e=this.frames[t];return e||(console.warn(a+t),e=this.frames[this.firstFrame]),e},getTextureSourceIndex:function(t){for(var e=0;e<this.source.length;e++)if(this.source[e]===t)return e;return-1},getFramesFromTextureSource:function(t,e){void 0===e&&(e=!1);var i=[];for(var n in this.frames)if("__BASE"!==n||e){var s=this.frames[n];s.sourceIndex===t&&i.push(s)}return i},getFrameNames:function(t){void 0===t&&(t=!1);var e=Object.keys(this.frames);if(!t){var i=e.indexOf("__BASE");-1!==i&&e.splice(i,1)}return e},getSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e=this.frames[t];return e?e.source.image:(console.warn(a+t),this.frames.__BASE.source.image)},getDataSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e,i=this.frames[t];return e=i?i.sourceIndex:(console.warn(a+t),this.frames.__BASE.sourceIndex),this.dataSource[e].image},setDataSource:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=this.source[e];this.dataSource.push(new r(this,t[e],i.width,i.height))}},setFilter:function(t){var e;for(e=0;e<this.source.length;e++)this.source[e].setFilter(t);for(e=0;e<this.dataSource.length;e++)this.dataSource[e].setFilter(t)},destroy:function(){var t;for(t=0;t<this.source.length;t++)this.source[t].destroy();for(t=0;t<this.dataSource.length;t++)this.dataSource[t].destroy();for(var e in this.frames)this.frames[e].destroy();this.source=[],this.dataSource=[],this.frames={},this.manager.removeKey(this.key),this.manager=null}});t.exports=o},function(t,e,i){var n=i(0),s=i(5),r=i(13),a=new n({initialize:function(t,e,i,n,s,r,a){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(r,a,n,s)},setSize:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this.cutX=i,this.cutY=n,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var s=this.data,r=s.cut;r.x=i,r.y=n,r.w=t,r.h=e,r.r=i+t,r.b=n+e,s.sourceSize.w=t,s.sourceSize.h=e,s.spriteSourceSize.w=t,s.spriteSourceSize.h=e,s.radius=.5*Math.sqrt(t*t+e*e);var a=s.drawImage;return a.x=i,a.y=n,a.width=t,a.height=e,this.updateUVs()},setTrim:function(t,e,i,n,s,r){var a=this.data,o=a.spriteSourceSize;return a.trim=!0,a.sourceSize.w=t,a.sourceSize.h=e,o.x=i,o.y=n,o.w=s,o.h=r,o.r=i+s,o.b=n+r,this.x=i,this.y=n,this.width=s,this.height=r,this.halfWidth=.5*s,this.halfHeight=.5*r,this.centerX=Math.floor(s/2),this.centerY=Math.floor(r/2),this.updateUVs()},setCropUVs:function(t,e,i,n,r,a,o){var h=this.cutX,u=this.cutY,c=this.cutWidth,l=this.cutHeight,d=this.realWidth,p=this.realHeight,f=h+(e=s(e,0,d)),m=u+(i=s(i,0,p)),g=n=s(n,0,d-e),v=r=s(r,0,p-i),y=this.data;if(y.trim){var _=y.spriteSourceSize,x=e+(n=s(n,0,c-e)),E=i+(r=s(r,0,l-i));if(_.r<e||_.b<i||_.x>x||_.y>E)v=g=m=f=0;else{var T=Math.max(_.x,e),w=Math.max(_.y,i),S=Math.min(_.r,x)-T,b=Math.min(_.b,E)-w;g=S,v=b,f=a?h+(c-(T-_.x)-S):h+(T-_.x),m=o?u+(l-(w-_.y)-b):u+(w-_.y),e=T,i=w,n=S,r=b}}else a&&(f=h+(c-e-n)),o&&(m=u+(l-i-r));var A=this.source.width,C=this.source.height;return t.u0=Math.max(0,f/A),t.v0=Math.max(0,m/C),t.u1=Math.min(1,(f+g)/A),t.v1=Math.min(1,(m+v)/C),t.x=e,t.y=i,t.cx=f,t.cy=m,t.cw=g,t.ch=v,t.width=n,t.height=r,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=n;var r=this.source.width,a=this.source.height;return this.u0=t/r,this.v0=e/a,this.u1=(t+i)/r,this.v1=(e+n)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=r(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},function(t,e,i){var n=i(0),s=i(26),r=i(3),a=i(28),o=i(6),h=i(1),u=i(187),c=i(188),l=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on(o.BLUR,this.onGameBlur,this),t.events.on(o.FOCUS,this.onGameFocus,this),t.events.on(o.PRE_STEP,this.update,this),t.events.once(o.DESTROY,this.destroy,this)},add:h,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var n in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(n)){var r=s(e),a=i.spritemap[n];r.loop=!!a.hasOwnProperty("loop")&&a.loop,i.addMarker({name:n,start:a.start,duration:a.end-a.start,config:r})}return i},get:function(t){return c(this.sounds,"key",t)},getAll:function(t){return u(this.sounds,"key",t)},play:function(t,e){var i=this.add(t);return i.once(a.COMPLETE,i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var n=this.addAudioSprite(t);return n.once(a.COMPLETE,n.destroy,n),n.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeAll:function(){this.sounds.forEach((function(t){t.destroy()})),this.sounds.length=0},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;0<=i;i--){var n=this.sounds[i];n.key===t&&(n.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound((function(t){t.pause()})),this.emit(a.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound((function(t){t.resume()})),this.emit(a.RESUME_ALL,this)},stopAll:function(){this.forEachActiveSound((function(t){t.stop()})),this.emit(a.STOP_ALL,this)},stopByKey:function(t){var e=0;return this.getAll(t).forEach((function(t){t.stop()&&e++})),e},unlock:h,onBlur:h,onFocus:h,onGameBlur:function(){this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.pauseOnBlur&&this.onFocus()},update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(a.UNLOCKED,this));for(var i=this.sounds.length-1;0<=i;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach((function(i){i.update(t,e)}))},destroy:function(){this.game.events.off(o.BLUR,this.onGameBlur,this),this.game.events.off(o.FOCUS,this.onGameFocus,this),this.game.events.off(o.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach((function(n,s){n&&!n.pendingRemove&&t.call(e||i,n,s,i.sounds)}))},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(a.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(a.GLOBAL_DETUNE,this,t)}}});t.exports=l},function(t,e,i){var n=i(0),s=i(3),r=i(28),a=i(13),o=i(1),h=new n({Extends:s,initialize:function(t,e,i){s.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},this.currentConfig=this.config,this.config=a(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name||(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),1):(t=a(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0}},t),this.markers[t.name]=t,0)))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name||(this.markers[t.name]?(this.markers[t.name]=a(!0,this.markers[t.name],t),0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),1)))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=a(this.currentConfig,e),this.isPlaying=!0,!(this.isPaused=!1)},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0)},resume:function(){return!(!this.isPaused||this.isPlaying||(this.isPlaying=!0,this.isPaused=!1))},stop:function(){return!(!this.isPaused&&!this.isPlaying||(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),0))},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:o,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit(r.DESTROY,this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=h},function(t,e,i){t.exports={Matrix:i(575),Add:i(582),AddAt:i(583),BringToTop:i(584),CountAllMatching:i(585),Each:i(586),EachInRange:i(587),FindClosestInSorted:i(99),GetAll:i(187),GetFirst:i(188),GetRandom:i(588),MoveDown:i(589),MoveTo:i(590),MoveUp:i(591),NumberArray:i(592),NumberArrayStep:i(593),QuickSelect:i(594),Range:i(595),Remove:i(48),RemoveAt:i(596),RemoveBetween:i(597),RemoveRandomElement:i(598),Replace:i(599),RotateLeft:i(600),RotateRight:i(601),SafeRange:i(27),SendToBack:i(602),SetAll:i(603),Shuffle:i(191),SpliceOne:i(35),StableSort:i(85),Swap:i(604)}},function(t,e){t.exports=function(t){if(!Array.isArray(t)||t.length<2||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i<t.length;i++)if(t[i].length!==e)return!1;return!0}},function(t,e,i){!function(){function e(t,e){return i(t.slice(),e)}function i(t,e){"function"!=typeof e&&(e=function(t,e){return String(t).localeCompare(e)});var i=t.length;if(i<=1)return t;for(var s=new Array(i),r=1;r<i;r*=2){n(t,e,r,s);var a=t;t=s,s=a}return t}e.inplace=function(t,e){var s=i(t,e);return s!==t&&n(s,null,t.length,t),t};var n=function(t,e,i,n){var s,r,a,o,h,u=t.length,c=0,l=2*i;for(s=0;s<u;s+=l)for(a=(r=s+i)+i,u<r&&(r=u),u<a&&(a=u),o=s,h=r;;)if(o<r&&h<a)e(t[o],t[h])<=0?n[c++]=t[o++]:n[c++]=t[h++];else if(o<r)n[c++]=t[o++];else{if(!(h<a))break;n[c++]=t[h++]}};t.exports=e}()},function(t,e){t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,SET_TEXTURE:19,CLEAR_TEXTURE:20,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},function(t,e){t.exports=function(t,e,i,n,s){var r=n.alpha*i.alpha;if(r<=0)return!1;var a=t._tempMatrix1.copyFromArray(n.matrix.matrix),o=t._tempMatrix2.applyITRS(i.x,i.y,i.rotation,i.scaleX,i.scaleY),h=t._tempMatrix3;return s?(a.multiplyWithOffset(s,-n.scrollX*i.scrollFactorX,-n.scrollY*i.scrollFactorY),o.e=i.x,o.f=i.y):(o.e-=n.scrollX*i.scrollFactorX,o.f-=n.scrollY*i.scrollFactorY),a.multiply(o,h),e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=r,e.save(),h.setToContext(e),e.imageSmoothingEnabled=!(!t.antialias||i.frame&&i.frame.source.scaleMode),!0}},function(t,e){function i(t,e){return parseInt(t.getAttribute(e),10)}t.exports=function(t,e,n,s){void 0===e&&(e=0),void 0===n&&(n=0);var r={},a=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0];r.font=a.getAttribute("face"),r.size=i(a,"size"),r.lineHeight=i(o,"lineHeight")+n,r.chars={};var h=t.getElementsByTagName("char"),u=void 0!==s&&s.trimmed;if(u)var c=s.height,l=s.width;for(var d=0;d<h.length;d++){var p=h[d],f=i(p,"id"),m=i(p,"x"),g=i(p,"y"),v=i(p,"width"),y=i(p,"height");u&&(m<l&&(l=m),g<c&&(c=g)),r.chars[f]={x:m,y:g,width:v,height:y,centerX:Math.floor(v/2),centerY:Math.floor(y/2),xOffset:i(p,"xoffset"),yOffset:i(p,"yoffset"),xAdvance:i(p,"xadvance")+e,data:{},kerning:{}}}if(u&&0!==c&&0!==l)for(var _ in r.chars){var x=r.chars[_];x.x-=s.x,x.y-=s.y}var E=t.getElementsByTagName("kerning");for(d=0;d<E.length;d++){var T=E[d],w=i(T,"first"),S=i(T,"second"),b=i(T,"amount");r.chars[S].kerning[w]=b}return r}},function(t,e,i){t.exports={BUTTON_DOWN:i(662),BUTTON_UP:i(663),CONNECTED:i(664),DISCONNECTED:i(665),GAMEPAD_BUTTON_DOWN:i(666),GAMEPAD_BUTTON_UP:i(667)}},function(t,e,i){var n=i(0),s=i(38),r=i(76),a=i(4),o=i(704),h=i(211),u=i(705),c=i(91),l=new n({initialize:function(t,e){this.loader=t,this.cache=a(e,"cache",!1),this.type=a(e,"type",!1),this.key=a(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.type||!this.key)throw new Error("Error calling 'Loader."+this.type+"' invalid key provided.");this.url=a(e,"url"),void 0===this.url?this.url=t.path+i+"."+a(e,"extension",""):"string"==typeof this.url&&0!==this.url.indexOf("blob:")&&0!==this.url.indexOf("data:")&&(this.url=t.path+this.url),this.src="",this.xhrSettings=c(a(e,"responseType",void 0)),a(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,a(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?s.FILE_POPULATED:s.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){(this.linkFile=t).linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===s.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=s.FILE_LOADING,this.src=o(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=u(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&0===t.responseURL.indexOf("file://")&&0===e.target.status,n=!(e.target&&200!==e.target.status)||i;4===t.readyState&&400<=t.status&&t.status<=599&&(n=!1),this.state=s.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,n)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(r.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=s.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=s.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){this.state=s.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(r.FILE_COMPLETE,e,i,t),this.loader.emit(r.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this)},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});l.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var n=new FileReader;n.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=t.onerror,n.readAsDataURL(e)}},l.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=l},function(t,e){t.exports=function(t,e,i,n,s,r){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===s&&(s=0),void 0===r&&(r=!1),{responseType:t,async:e,user:i,password:n,timeout:s,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:r}}},function(t,e,i){var n=i(2);t.exports=function(t){var e=n(t,"targets",null);return null===e||("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e])),e}},function(t,e){function i(t){return!!t.getActive&&"function"==typeof t.getActive}function n(t){return!!t.getStart&&"function"==typeof t.getStart}function s(t){return!!t.getEnd&&"function"==typeof t.getEnd}var r=function(t,e){var a,o=function(t,e,i){return i},h=function(t,e,i){return i},u=null,c=typeof e;if("number"==c)o=function(){return e};else if("string"==c){var l=e[0],d=parseFloat(e.substr(2));switch(l){case"+":o=function(t,e,i){return i+d};break;case"-":o=function(t,e,i){return i-d};break;case"*":o=function(t,e,i){return i*d};break;case"/":o=function(t,e,i){return i/d};break;default:o=function(){return parseFloat(e)}}}else if("function"==c)o=e;else if("object"==c)if(function(t){return n(t)||s(t)||i(t)}(e))i(e)&&(u=e.getActive),s(e)&&(o=e.getEnd),n(e)&&(h=e.getStart);else if(e.hasOwnProperty("value"))a=r(t,e.value);else{var p=e.hasOwnProperty("to"),f=e.hasOwnProperty("from"),m=e.hasOwnProperty("start");if(p&&(f||m)){if(a=r(t,e.to),m){var g=r(t,e.start);a.getActive=g.getEnd}if(f){var v=r(t,e.from);a.getStart=v.getEnd}}}return a||{getActive:u,getEnd:o,getStart:h}};t.exports=r},function(t,e){t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1}},function(t,e,i){var n=i(0),s=i(3),r=i(96),a=i(173),o=i(36),h=i(32),u=i(9),c=new n({Extends:s,initialize:function(t,e,i){s.call(this),this.parent=t,this.parentIsTimeline=t.hasOwnProperty("isTimeline"),this.data=e,this.totalData=e.length,this.targets=i,this.totalTargets=i.length,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.startDelay=0,this.hasStarted=!1,this.isSeeking=!1,this.completeDelay=0,this.countdown=0,this.offset=0,this.calculatedOffset=0,this.state=h.PENDING_ADD,this._pausedState=h.INIT,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onActive:null,onComplete:null,onLoop:null,onRepeat:null,onStart:null,onStop:null,onUpdate:null,onYoyo:null},this.callbackScope},getValue:function(t){return void 0===t&&(t=0),this.data[t].current},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===h.ACTIVE},isPaused:function(){return this.state===h.PAUSED},hasTarget:function(t){return-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){void 0===i&&(i=!1);for(var n=0;n<this.totalData;n++){var s=this.data[n];s.key===t&&(s.end=e,i&&(s.start=s.current))}return this},restart:function(){return this.elapsed=0,this.progress=0,this.totalElapsed=0,this.totalProgress=0,this.state===h.ACTIVE?this.seek(0):this.state===h.REMOVED?(this.seek(0),this.parent.makeActive(this),this):this.state===h.PENDING_ADD?this:this.play()},calcDuration:function(){for(var t=0,e=u.MAX_SAFE_INTEGER,i=this.data,n=0;n<this.totalData;n++){var s=i[n];s.t1=s.duration+s.hold,s.yoyo&&(s.t1+=s.duration),s.t2=s.t1+s.repeatDelay,s.totalDuration=s.delay+s.t1,-1===s.repeat?s.totalDuration+=999999999999*s.t2:0<s.repeat&&(s.totalDuration+=s.t2*s.repeat),s.totalDuration>t&&(t=s.totalDuration),s.delay<e&&(e=s.delay)}this.duration=Math.max(t,.001),this.loopCounter=-1===this.loop?999999999999:this.loop,0<this.loopCounter?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay,this.startDelay=e},init:function(){if(this.paused&&!this.parentIsTimeline)return this.state=h.PENDING_ADD,this._pausedState=h.INIT,!1;for(var t=this.data,e=this.totalTargets,i=0;i<this.totalData;i++){var n=t[i],s=n.target,r=n.gen,a=n.key,o=n.index;n.delay=r.delay(s,a,0,o,e,this),n.duration=Math.max(r.duration(s,a,0,o,e,this),.001),n.hold=r.hold(s,a,0,o,e,this),n.repeat=r.repeat(s,a,0,o,e,this),n.repeatDelay=r.repeatDelay(s,a,0,o,e,this)}return this.calcDuration(),this.progress=0,this.totalProgress=0,this.elapsed=0,this.totalElapsed=0,this.state=h.INIT,!0},makeActive:function(){this.parent.makeActive(this),this.dispatchTweenEvent(r.TWEEN_ACTIVE,this.callbacks.onActive)},nextState:function(){0<this.loopCounter?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweenData(!0),0<this.loopDelay?(this.countdown=this.loopDelay,this.state=h.LOOP_DELAY):(this.state=h.ACTIVE,this.dispatchTweenEvent(r.TWEEN_LOOP,this.callbacks.onLoop))):0<this.completeDelay?(this.state=h.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=h.PENDING_REMOVE,this.dispatchTweenEvent(r.TWEEN_COMPLETE,this.callbacks.onComplete))},pause:function(){return this.state===h.PAUSED||(this.paused=!0,this._pausedState=this.state,this.state=h.PAUSED),this},play:function(t){void 0===t&&(t=!1);var e=this.state;return e!==h.INIT||this.parentIsTimeline?e===h.ACTIVE||e===h.PENDING_ADD&&this._pausedState===h.PENDING_ADD||(this.parentIsTimeline||e!==h.PENDING_REMOVE&&e!==h.REMOVED?this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?this.state=h.ACTIVE:(this.countdown=this.calculatedOffset,this.state=h.OFFSET_DELAY)):(this.paused?this.paused=!1:(this.resetTweenData(t),this.state=h.ACTIVE),this.makeActive()):(this.seek(0),this.parent.makeActive(this))):(this.resetTweenData(!1),this.state=h.ACTIVE),this},resetTweenData:function(t){for(var e=this.data,i=this.totalData,n=this.totalTargets,s=0;s<i;s++){var r=e[s],a=r.target,o=r.key,u=r.index;r.progress=0,r.elapsed=0,r.repeatCounter=-1===r.repeat?999999999999:r.repeat,t?(r.start=r.getStartValue(a,o,r.start,u,n,this),r.end=r.getEndValue(a,o,r.end,u,n,this),r.current=r.start,r.state=h.PLAYING_FORWARD):r.state=h.PENDING_RENDER,0<r.delay&&(r.elapsed=r.delay,r.state=h.DELAY),r.getActiveValue&&(a[o]=r.getActiveValue(r.target,r.key,r.start))}},resume:function(){return this.state===h.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t,e){if(void 0===e&&(e=16.6),36e5<=this.totalDuration)return console.warn("Tween.seek duration too long"),this;this.state===h.REMOVED&&this.makeActive(),this.elapsed=0,this.progress=0,this.totalElapsed=0,this.totalProgress=0;for(var i=this.data,n=this.totalTargets,s=0;s<this.totalData;s++){var r=i[s],a=r.target,o=r.gen,u=r.key,c=r.index;r.progress=0,r.elapsed=0,r.repeatCounter=-1===r.repeat?999999999999:r.repeat,r.delay=o.delay(a,u,0,c,n,this),r.duration=Math.max(o.duration(a,u,0,c,n,this),.001),r.hold=o.hold(a,u,0,c,n,this),r.repeat=o.repeat(a,u,0,c,n,this),r.repeatDelay=o.repeatDelay(a,u,0,c,n,this),r.current=r.start,r.state=h.PLAYING_FORWARD,this.updateTweenData(this,r,0,c,n),0<r.delay&&(r.elapsed=r.delay,r.state=h.DELAY)}this.calcDuration();var l=!1;for(this.state===h.PAUSED&&(l=!0,this.state=h.ACTIVE),this.isSeeking=!0;this.update(0,e),this.totalProgress<t;);return this.isSeeking=!1,l&&(this.state=h.PAUSED),this},setCallback:function(t,e,i,n){return this.callbacks[t]={func:e,scope:n,params:i},this},complete:function(t){return void 0===t&&(t=0),t?(this.state=h.COMPLETE_DELAY,this.countdown=t):(this.state=h.PENDING_REMOVE,this.dispatchTweenEvent(r.TWEEN_COMPLETE,this.callbacks.onComplete)),this},remove:function(){return this.parent.remove(this),this},stop:function(t){return this.state===h.ACTIVE&&void 0!==t&&this.seek(t),this.state!==h.REMOVED&&(this.state!==h.PAUSED&&this.state!==h.PENDING_ADD||(this.parentIsTimeline?(this.parent.manager._destroy.push(this),this.parent.manager._toProcess++):(this.parent._destroy.push(this),this.parent._toProcess++)),this.dispatchTweenEvent(r.TWEEN_STOP,this.callbacks.onStop),this.removeAllListeners(),this.state=h.PENDING_REMOVE),this},update:function(t,e){if(this.state===h.PAUSED)return!1;switch(this.useFrames&&(e=1*this.parent.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case h.ACTIVE:this.hasStarted||this.isSeeking||(this.startDelay-=e,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchTweenEvent(r.TWEEN_START,this.callbacks.onStart)));for(var i=!1,n=0;n<this.totalData;n++){var s=this.data[n];this.updateTweenData(this,s,e)&&(i=!0)}i||this.nextState();break;case h.LOOP_DELAY:this.countdown-=e,this.countdown<=0&&(this.state=h.ACTIVE,this.dispatchTweenEvent(r.TWEEN_LOOP,this.callbacks.onLoop));break;case h.OFFSET_DELAY:this.countdown-=e,this.countdown<=0&&(this.state=h.ACTIVE);break;case h.COMPLETE_DELAY:this.countdown-=e,this.countdown<=0&&(this.state=h.PENDING_REMOVE,this.dispatchTweenEvent(r.TWEEN_COMPLETE,this.callbacks.onComplete))}return this.state===h.PENDING_REMOVE},dispatchTweenDataEvent:function(t,e,i){this.isSeeking||(this.emit(t,this,i.key,i.target,i.current,i.previous),e&&(e.params[1]=i.target,e.func.apply(e.scope,e.params)))},dispatchTweenEvent:function(t,e){this.isSeeking||(this.emit(t,this,this.targets),e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)))},setStateFromEnd:function(t,e,i){return e.yoyo?(e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),this.dispatchTweenDataEvent(r.TWEEN_YOYO,t.callbacks.onYoyo,e),e.start=e.getStartValue(e.target,e.key,e.start,e.index,t.totalTargets,t),h.PLAYING_BACKWARD):0<e.repeatCounter?(e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),e.start=e.getStartValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.end=e.getEndValue(e.target,e.key,e.start,e.index,t.totalTargets,t),0<e.repeatDelay?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,h.REPEAT_DELAY):(this.dispatchTweenDataEvent(r.TWEEN_REPEAT,t.callbacks.onRepeat,e),h.PLAYING_FORWARD)):h.COMPLETE},setStateFromStart:function(t,e,i){return 0<e.repeatCounter?(e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),e.end=e.getEndValue(e.target,e.key,e.start,e.index,t.totalTargets,t),0<e.repeatDelay?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,h.REPEAT_DELAY):(this.dispatchTweenDataEvent(r.TWEEN_REPEAT,t.callbacks.onRepeat,e),h.PLAYING_FORWARD)):h.COMPLETE},updateTweenData:function(t,e,i){var n=e.target;switch(e.state){case h.PLAYING_FORWARD:case h.PLAYING_BACKWARD:if(!n){e.state=h.COMPLETE;break}var s=e.elapsed,a=e.duration,o=0;a<(s+=i)&&(o=s-a,s=a);var u=e.state===h.PLAYING_FORWARD,c=s/a;if(e.elapsed=s,e.progress=c,e.previous=e.current,1==c)u?(e.current=e.end,n[e.key]=e.end,0<e.hold?(e.elapsed=e.hold-o,e.state=h.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,o)):(e.current=e.start,n[e.key]=e.start,e.state=this.setStateFromStart(t,e,o));else{var l=u?e.ease(c):e.ease(1-c);e.current=e.start+(e.end-e.start)*l,n[e.key]=e.current}this.dispatchTweenDataEvent(r.TWEEN_UPDATE,t.callbacks.onUpdate,e);break;case h.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=h.PENDING_RENDER);break;case h.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=h.PLAYING_FORWARD,this.dispatchTweenDataEvent(r.TWEEN_REPEAT,t.callbacks.onRepeat,e));break;case h.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case h.PENDING_RENDER:n?(e.start=e.getStartValue(n,e.key,n[e.key],e.index,t.totalTargets,t),e.end=e.getEndValue(n,e.key,e.start,e.index,t.totalTargets,t),e.current=e.start,n[e.key]=e.start,e.state=h.PLAYING_FORWARD):e.state=h.COMPLETE}return e.state!==h.COMPLETE}});c.TYPES=["onActive","onComplete","onLoop","onRepeat","onStart","onStop","onUpdate","onYoyo"],o.register("tween",(function(t){return this.scene.sys.tweens.add(t)})),a.register("tween",(function(t){return this.scene.sys.tweens.create(t)})),t.exports=c},function(t,e,i){t.exports={TIMELINE_COMPLETE:i(728),TIMELINE_LOOP:i(729),TIMELINE_PAUSE:i(730),TIMELINE_RESUME:i(731),TIMELINE_START:i(732),TIMELINE_UPDATE:i(733),TWEEN_ACTIVE:i(734),TWEEN_COMPLETE:i(735),TWEEN_LOOP:i(736),TWEEN_REPEAT:i(737),TWEEN_START:i(738),TWEEN_STOP:i(739),TWEEN_UPDATE:i(740),TWEEN_YOYO:i(741)}},function(t,e){t.exports=function(t,e,i,n,s,r,a,o,h,u,c,l,d,p,f){return{target:t,index:e,key:i,getActiveValue:r,getEndValue:n,getStartValue:s,ease:a,duration:0,totalDuration:0,delay:0,yoyo:u,hold:0,repeat:0,repeatDelay:0,flipX:p,flipY:f,progress:0,elapsed:0,repeatCounter:0,start:0,previous:0,current:0,end:0,t1:0,t2:0,gen:{delay:o,duration:h,hold:c,repeat:l,repeatDelay:d},state:0}}},function(t,e){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},function(t,e){t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var n,s,r=1;if(i){if(t<e[0][i])return e[0];for(;e[r][i]<t;)r++}else for(;e[r]<t;)r++;return r>e.length&&(r=e.length),i?(n=e[r-1][i],(s=e[r][i])-t<=t-n?e[r]:e[r-1]):(n=e[r-1],(s=e[r])-t<=t-n?s:n)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=n,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration}},destroy:function(){this.frame=void 0}});t.exports=n},function(t,e,i){var n=i(56),s=i(0),r=i(102),a=i(3),o=i(40),h=i(6),u=i(2),c=i(57),l=new s({Extends:a,initialize:function(t){a.call(this),this.game=t,this.textureManager=null,this.globalTimeScale=1,this.anims=new r,this.paused=!1,this.name="AnimationManager",t.events.once(h.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(h.DESTROY,this.destroy,this)},add:function(t,e){return this.anims.has(t)?console.warn("Animation key exists: "+t):(e.key=t,this.anims.set(t,e),this.emit(o.ADD_ANIMATION,t,e)),this},exists:function(t){return this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))||(i=new n(this,e,t),this.anims.set(e,i),this.emit(o.ADD_ANIMATION,e,i))),i},fromJSON:function(t,e){void 0===e&&(e=!1),e&&this.anims.clear(),"string"==typeof t&&(t=JSON.parse(t));var i=[];if(t.hasOwnProperty("anims")&&Array.isArray(t.anims)){for(var n=0;n<t.anims.length;n++)i.push(this.create(t.anims[n]));t.hasOwnProperty("globalTimeScale")&&(this.globalTimeScale=t.globalTimeScale)}else t.hasOwnProperty("key")&&"frame"===t.type&&i.push(this.create(t));return i},generateFrameNames:function(t,e){var i=u(e,"prefix",""),n=u(e,"start",0),s=u(e,"end",0),r=u(e,"suffix",""),a=u(e,"zeroPad",0),o=u(e,"outputArray",[]),h=u(e,"frames",!1),l=this.textureManager.get(t);if(!l)return o;var d,p,f=n<s?1:-1;if(s+=f,e)if(Array.isArray(h))for(d=0;d<h.length;d++)p=i+c(h[d],a,"0",1)+r,l.has(p)&&o.push({key:t,frame:p});else for(d=n;d!==s;d+=f)p=i+c(d,a,"0",1)+r,l.has(p)&&o.push({key:t,frame:p});else for(h=l.getFrameNames(),d=0;d<h.length;d++)o.push({key:t,frame:h[d]});return o},generateFrameNumbers:function(t,e){var i,n=u(e,"start",0),s=u(e,"end",-1),r=u(e,"first",!1),a=u(e,"outputArray",[]),o=u(e,"frames",!1),h=this.textureManager.get(t);if(!h)return a;if(r&&h.has(r)&&a.push({key:t,frame:r}),Array.isArray(o))for(i=0;i<o.length;i++)h.has(o[i])&&a.push({key:t,frame:o[i]});else{-1===s&&(s=h.frameTotal);var c=n<s?1:-1;for(s+=c,i=n;i!==s;i+=c)h.has(i)&&a.push({key:t,frame:i})}return a},get:function(t){return this.anims.get(t)},load:function(t,e,i){var n=this.get(e);return n?n.load(t,i):console.warn("Missing animation: "+e),t},pauseAll:function(){return this.paused||(this.paused=!0,this.emit(o.PAUSE_ALL)),this},play:function(t,e){if(Array.isArray(e)||(e=[e]),!this.get(t))return this;for(var i=0;i<e.length;i++)e[i].anims.play(t);return this},remove:function(t){var e=this.get(t);return e&&(this.emit(o.REMOVE_ANIMATION,t,e),this.anims.delete(t)),e},resumeAll:function(){return this.paused&&(this.paused=!1,this.emit(o.RESUME_ALL)),this},staggerPlay:function(t,e,i){if(void 0===i&&(i=0),Array.isArray(e)||(e=[e]),!this.get(t))return this;for(var n=0;n<e.length;n++)e[n].anims.delayedPlay(i*n,t);return this},toJSON:function(t){var e={anims:[],globalTimeScale:this.globalTimeScale};return void 0!==t&&""!==t?e.anims.push(this.anims.get(t).toJSON()):this.anims.each((function(t,i){e.anims.push(i.toJSON())})),e},destroy:function(){this.anims.clear(),this.textureManager=null,this.game=null}});t.exports=l},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e<t.length;e++)this.set(t[e][0],t[e][1])},set:function(t,e){return this.has(t)||this.size++,this.entries[t]=e,this},get:function(t){if(this.has(t))return this.entries[t]},getArray:function(){var t=[],e=this.entries;for(var i in e)t.push(e[i]);return t},has:function(t){return this.entries.hasOwnProperty(t)},delete:function(t){return this.has(t)&&(delete this.entries[t],this.size--),this},clear:function(){return Object.keys(this.entries).forEach((function(t){delete this.entries[t]}),this),this.size=0,this},keys:function(){return Object.keys(this.entries)},values:function(){var t=[],e=this.entries;for(var i in e)t.push(e[i]);return t},dump:function(){var t=this.entries;for(var e in console.group("Map"),t)console.log(e,t[e]);console.groupEnd()},each:function(t){var e=this.entries;for(var i in e)if(!1===t(i,e[i]))break;return this},contains:function(t){var e=this.entries;for(var i in e)if(e[i]===t)return!0;return!1},merge:function(t,e){void 0===e&&(e=!1);var i=this.entries,n=t.entries;for(var s in n)i.hasOwnProperty(s)&&e?i[s]=n[s]:this.set(s,n[s]);return this}});t.exports=n},function(t,e,i){var n=i(0),s=i(102),r=i(3),a=i(104),o=new n({initialize:function(){this.entries=new s,this.events=new r},add:function(t,e){return this.entries.set(t,e),this.events.emit(a.ADD,this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit(a.REMOVE,this,t,e.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=o},function(t,e,i){t.exports={ADD:i(270),REMOVE:i(271)}},function(t,e,i){var n=i(103),s=i(0),r=i(6),a=new s({initialize:function(t){this.game=t,this.binary=new n,this.bitmapFont=new n,this.json=new n,this.physics=new n,this.shader=new n,this.audio=new n,this.video=new n,this.text=new n,this.html=new n,this.obj=new n,this.tilemap=new n,this.xml=new n,this.custom={},this.game.events.once(r.DESTROY,this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new n),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","video","text","html","obj","tilemap","xml"],e=0;e<t.length;e++)this[t[e]].destroy(),this[t[e]]=null;for(var i in this.custom)this.custom[i].destroy();this.custom=null,this.game=null}});t.exports=a},function(t,e,i){var n=i(30),s=i(12),r=i(318),a=i(5),o=i(0),h=i(17),u=i(123),c=i(64),l=i(23),d=i(7),p=new o({Extends:n,Mixins:[h.Flip,h.Tint],initialize:function(t,e,i,s){n.call(this,t,e,i,s),this.inputEnabled=!0,this.fadeEffect=new u.Fade(this),this.flashEffect=new u.Flash(this),this.shakeEffect=new u.Shake(this),this.panEffect=new u.Pan(this),this.rotateToEffect=new u.RotateTo(this),this.zoomEffect=new u.Zoom(this),this.lerp=new d(1,1),this.followOffset=new d,this.deadzone=null,this._follow=null,this.renderToTexture=!1,this.renderToGame=!0,this.canvas=null,this.context=null,this.glTexture=null,this.framebuffer=null,this.pipeline=null},setRenderToTexture:function(t,e){void 0===e&&(e=!0);var i=this.scene.sys.game.renderer;return i.gl?(this.glTexture=i.createTextureFromSource(null,this.width,this.height,0),this.framebuffer=i.createFramebuffer(this.width,this.height,this.glTexture,!1)):(this.canvas=s.create2D(this,this.width,this.height),this.context=this.canvas.getContext("2d")),this.renderToTexture=!0,this.renderToGame=e,t&&this.setPipeline(t),this},setPipeline:function(t){if("string"==typeof t){var e=this.scene.sys.game.renderer;e.gl&&e.hasPipeline(t)&&(this.pipeline=e.getPipeline(t))}else this.pipeline=t;return this},clearRenderToTexture:function(){if(this.scene){var t=this.scene.sys.game.renderer;if(t)return t.gl?(this.framebuffer&&t.deleteFramebuffer(this.framebuffer),this.glTexture&&t.deleteTexture(this.glTexture),this.framebuffer=null,this.glTexture=null,this.pipeline=null):(s.remove(this),this.canvas=null,this.context=null),this.renderToTexture=!1,this}},setDeadzone:function(t,e){if(void 0===t)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=t,this.deadzone.height=e):this.deadzone=new l(0,0,t,e),this._follow){var i=this.width/2,n=this.height/2,s=this._follow.x-this.followOffset.x,a=this._follow.y-this.followOffset.y;this.midPoint.set(s,a),this.scrollX=s-i,this.scrollY=a-n}r(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,n,s,r){return this.fadeEffect.start(!1,t,e,i,n,!0,s,r)},fadeOut:function(t,e,i,n,s,r){return this.fadeEffect.start(!0,t,e,i,n,!0,s,r)},fadeFrom:function(t,e,i,n,s,r,a){return this.fadeEffect.start(!1,t,e,i,n,s,r,a)},fade:function(t,e,i,n,s,r,a){return this.fadeEffect.start(!0,t,e,i,n,s,r,a)},flash:function(t,e,i,n,s,r,a){return this.flashEffect.start(t,e,i,n,s,r,a)},shake:function(t,e,i,n,s){return this.shakeEffect.start(t,e,i,n,s)},pan:function(t,e,i,n,s,r,a){return this.panEffect.start(t,e,i,n,s,r,a)},rotateTo:function(t,e,i,n,s,r,a){return this.rotateToEffect.start(t,e,i,n,s,r,a)},zoomTo:function(t,e,i,n,s,r){return this.zoomEffect.start(t,e,i,n,s,r)},preRender:function(t){var e=this.width,i=this.height,n=.5*e,s=.5*i,a=this.zoom*t,o=this.matrix,h=e*this.originX,u=i*this.originY,l=this._follow,d=this.deadzone,p=this.scrollX,f=this.scrollY;if(d&&r(d,this.midPoint.x,this.midPoint.y),l&&!this.panEffect.isRunning){var m=l.x-this.followOffset.x,g=l.y-this.followOffset.y;d?(m<d.x?p=c(p,p-(d.x-m),this.lerp.x):m>d.right&&(p=c(p,p+(m-d.right),this.lerp.x)),g<d.y?f=c(f,f-(d.y-g),this.lerp.y):g>d.bottom&&(f=c(f,f+(g-d.bottom),this.lerp.y))):(p=c(p,m-h,this.lerp.x),f=c(f,g-u,this.lerp.y))}this.useBounds&&(p=this.clampX(p),f=this.clampY(f)),this.roundPixels&&(h=Math.round(h),u=Math.round(u));var v=(this.scrollX=p)+n,y=(this.scrollY=f)+s;this.midPoint.set(v,y);var _=e/a,x=i/a;this.worldView.setTo(v-_/2,y-x/2,_,x),o.applyITRS(this.x+h,this.y+u,this.rotation,a,a),o.translate(-h,-u),this.shakeEffect.preRender()},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,s,r){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=s),this._follow=t,this.roundPixels=e,i=a(i,0,1),n=a(n,0,1),this.lerp.set(i,n),this.followOffset.set(s,r);var o=this.width/2,h=this.height/2,u=t.x-s,c=t.y-r;return this.midPoint.set(u,c),this.scrollX=u-o,this.scrollY=c-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.clearRenderToTexture(),this.resetFX(),n.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=p},function(t,e,i){var n=i(5),s={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);0===(this._alpha=e)?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=s},function(t,e,i){var n=i(29),s={_blendMode:n.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=n[t]),-1<=(t|=0)&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=s},function(t,e){t.exports={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.scene.sys.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}}},function(t,e,i){var n=i(111),s=i(8);t.exports=function(t,e,i){if(void 0===i&&(i=new s),e<=0||1<=e)return i.x=t.x,i.y=t.y,i;var r=n(t)*e;return.5<e?(r-=t.width+t.height)<=t.width?(i.x=t.right-r,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(r-t.width)):r<=t.width?(i.x=t.x+r,i.y=t.y):(i.x=t.right,i.y=t.y+(r-t.width)),i}},function(t,e){t.exports=function(t){return 2*(t.width+t.height)}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),a=t.x-e,o=t.y-i;return t.x=a*s-o*r+e,t.y=a*r+o*s+i,t}},function(t,e,i){var n=i(284),s=i(285),r={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t){return void 0===t&&(this.texture||this.shader)&&(t=this),new n(this.scene,t)},createGeometryMask:function(t){return void 0===t&&"Graphics"===this.type&&(t=this),new s(this.scene,t)}};t.exports=r},function(t,e){t.exports={defaultPipeline:null,pipeline:null,initPipeline:function(t){void 0===t&&(t="TextureTintPipeline");var e=this.scene.sys.game.renderer;return!!(e&&e.gl&&e.hasPipeline(t))&&(this.defaultPipeline=e.getPipeline(t),this.pipeline=this.defaultPipeline,!0)},setPipeline:function(t){var e=this.scene.sys.game.renderer;return e&&e.gl&&e.hasPipeline(t)&&(this.pipeline=e.getPipeline(t)),this},resetPipeline:function(){return this.pipeline=this.defaultPipeline,null!==this.pipeline},getPipelineName:function(){return this.pipeline.name}}},function(t,e){t.exports={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}}},function(t,e){t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e,i){var n=i(9),s=i(18),r=i(118),a=i(119),o={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,0===(this._scaleY=t)?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){0===(this._scaleX=t)?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){0===(this._scaleY=t)?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return a(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=a(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=r(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new s),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new s),void 0===e&&(e=new s);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=o},function(t,e,i){var n=i(63);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},function(t,e,i){var n=i(63);t.exports=function(t){return n(t,-180,180)}},function(t,e){t.exports={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}}},function(t,e,i){var n=i(309),s=i(313),r=i(315),a=i(316);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?a(t):n(t);case"number":return s(t);case"object":return r(t)}}},function(t,e){t.exports=function(t,e,i){return t<<16|e<<8|i}},function(t,e,i){t.exports={Fade:i(319),Flash:i(320),Pan:i(321),Shake:i(354),RotateTo:i(355),Zoom:i(356)}},function(t,e,i){t.exports={In:i(322),Out:i(323),InOut:i(324)}},function(t,e,i){t.exports={In:i(325),Out:i(326),InOut:i(327)}},function(t,e,i){t.exports={In:i(328),Out:i(329),InOut:i(330)}},function(t,e,i){t.exports={In:i(331),Out:i(332),InOut:i(333)}},function(t,e,i){t.exports={In:i(334),Out:i(335),InOut:i(336)}},function(t,e,i){t.exports={In:i(337),Out:i(338),InOut:i(339)}},function(t,e,i){t.exports=i(340)},function(t,e,i){t.exports={In:i(341),Out:i(342),InOut:i(343)}},function(t,e,i){t.exports={In:i(344),Out:i(345),InOut:i(346)}},function(t,e,i){t.exports={In:i(347),Out:i(348),InOut:i(349)}},function(t,e,i){t.exports={In:i(350),Out:i(351),InOut:i(352)}},function(t,e,i){t.exports=i(353)},function(t,e,i){var n=i(0),s=i(14),r=i(137),a=i(4),o=i(2),h=i(16),u=i(66),c=i(1),l=i(70),d=i(121),p=new n({initialize:function(t){void 0===t&&(t={}),this.width=o(t,"width",1024),this.height=o(t,"height",768),this.zoom=o(t,"zoom",1),this.resolution=o(t,"resolution",1),this.parent=o(t,"parent",void 0),this.scaleMode=o(t,"scaleMode",0),this.expandParent=o(t,"expandParent",!0),this.autoRound=o(t,"autoRound",!1),this.autoCenter=o(t,"autoCenter",0),this.resizeInterval=o(t,"resizeInterval",500),this.fullscreenTarget=o(t,"fullscreenTarget",null),this.minWidth=o(t,"minWidth",0),this.maxWidth=o(t,"maxWidth",0),this.minHeight=o(t,"minHeight",0),this.maxHeight=o(t,"maxHeight",0);var e=o(t,"scale",null);e&&(this.width=o(e,"width",this.width),this.height=o(e,"height",this.height),this.zoom=o(e,"zoom",this.zoom),this.resolution=o(e,"resolution",this.resolution),this.parent=o(e,"parent",this.parent),this.scaleMode=o(e,"mode",this.scaleMode),this.expandParent=o(e,"expandParent",this.expandParent),this.autoRound=o(e,"autoRound",this.autoRound),this.autoCenter=o(e,"autoCenter",this.autoCenter),this.resizeInterval=o(e,"resizeInterval",this.resizeInterval),this.fullscreenTarget=o(e,"fullscreenTarget",this.fullscreenTarget),this.minWidth=o(e,"min.width",this.minWidth),this.maxWidth=o(e,"max.width",this.maxWidth),this.minHeight=o(e,"min.height",this.minHeight),this.maxHeight=o(e,"max.height",this.maxHeight)),this.renderType=o(t,"type",s.AUTO),this.canvas=o(t,"canvas",null),this.context=o(t,"context",null),this.canvasStyle=o(t,"canvasStyle",null),this.customEnvironment=o(t,"customEnvironment",!1),this.sceneConfig=o(t,"scene",null),this.seed=o(t,"seed",[(Date.now()*Math.random()).toString()]),u.RND=new u.RandomDataGenerator(this.seed),this.gameTitle=o(t,"title",""),this.gameURL=o(t,"url","https://phaser.io"),this.gameVersion=o(t,"version",""),this.autoFocus=o(t,"autoFocus",!0),this.domCreateContainer=o(t,"dom.createContainer",!1),this.domBehindCanvas=o(t,"dom.behindCanvas",!1),this.inputKeyboard=o(t,"input.keyboard",!0),this.inputKeyboardEventTarget=o(t,"input.keyboard.target",window),this.inputKeyboardCapture=o(t,"input.keyboard.capture",[]),this.inputMouse=o(t,"input.mouse",!0),this.inputMouseEventTarget=o(t,"input.mouse.target",null),this.inputMouseCapture=o(t,"input.mouse.capture",!0),this.inputTouch=o(t,"input.touch",r.input.touch),this.inputTouchEventTarget=o(t,"input.touch.target",null),this.inputTouchCapture=o(t,"input.touch.capture",!0),this.inputActivePointers=o(t,"input.activePointers",1),this.inputSmoothFactor=o(t,"input.smoothFactor",0),this.inputWindowEvents=o(t,"input.windowEvents",!0),this.inputGamepad=o(t,"input.gamepad",!1),this.inputGamepadEventTarget=o(t,"input.gamepad.target",window),this.disableContextMenu=o(t,"disableContextMenu",!1),this.audio=o(t,"audio"),this.hideBanner=!1===o(t,"banner",null),this.hidePhaser=o(t,"banner.hidePhaser",!1),this.bannerTextColor=o(t,"banner.text","#ffffff"),this.bannerBackgroundColor=o(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=o(t,"fps",null);var i=o(t,"render",t);this.antialias=o(i,"antialias",!0),this.antialiasGL=o(i,"antialiasGL",!0),this.mipmapFilter=o(i,"mipmapFilter","LINEAR"),this.desynchronized=o(i,"desynchronized",!1),this.roundPixels=o(i,"roundPixels",!1),this.pixelArt=o(i,"pixelArt",1!==this.zoom),this.pixelArt&&(this.antialias=!1,this.roundPixels=!0),this.transparent=o(i,"transparent",!1),this.clearBeforeRender=o(i,"clearBeforeRender",!0),this.premultipliedAlpha=o(i,"premultipliedAlpha",!0),this.failIfMajorPerformanceCaveat=o(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=o(i,"powerPreference","default"),this.batchSize=o(i,"batchSize",2e3),this.maxLights=o(i,"maxLights",10);var n=o(t,"backgroundColor",0);this.backgroundColor=d(n),0===n&&this.transparent&&(this.backgroundColor.alpha=0),this.preBoot=o(t,"callbacks.preBoot",c),this.postBoot=o(t,"callbacks.postBoot",c),this.physics=o(t,"physics",{}),this.defaultPhysicsSystem=o(this.physics,"default",!1),this.loaderBaseURL=o(t,"loader.baseURL",""),this.loaderPath=o(t,"loader.path",""),this.loaderMaxParallelDownloads=o(t,"loader.maxParallelDownloads",32),this.loaderCrossOrigin=o(t,"loader.crossOrigin",void 0),this.loaderResponseType=o(t,"loader.responseType",""),this.loaderAsync=o(t,"loader.async",!0),this.loaderUser=o(t,"loader.user",""),this.loaderPassword=o(t,"loader.password",""),this.loaderTimeout=o(t,"loader.timeout",0),this.loaderWithCredentials=o(t,"loader.withCredentials",!1),this.installGlobalPlugins=[],this.installScenePlugins=[];var p=o(t,"plugins",null),f=l.DefaultScene;p&&(Array.isArray(p)?this.defaultPlugins=p:h(p)&&(this.installGlobalPlugins=a(p,"global",[]),this.installScenePlugins=a(p,"scene",[]),Array.isArray(p.default)?f=p.default:Array.isArray(p.defaultMerge)&&(f=f.concat(p.defaultMerge)))),this.defaultPlugins=f;var m="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=o(t,"images.default",m+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=o(t,"images.missing",m+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),window&&(window.FORCE_WEBGL?this.renderType=s.WEBGL:window.FORCE_CANVAS&&(this.renderType=s.CANVAS))}});t.exports=p},function(t,e,i){t.exports={os:i(42),browser:i(43),features:i(65),input:i(385),audio:i(386),video:i(387),fullscreen:i(388),canvasFeatures:i(138)}},function(t,e,i){var n,s,r,a=i(12),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=(void 0!==document&&(o.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",s="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create(t,6,1).getContext("2d");if(e.globalCompositeOperation="multiply",e.drawImage(r,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=n+"/wCKxvRF"+s},r.src=n+"AP804Oa6"+s,!1),o.supportInverseAlpha=function(){var t=a.create(this,2,1).getContext("2d");t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1);return i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3]}()),o)},function(t,e){t.exports=function(t,e,i,n){return Math.atan2(n-e,i-t)}},function(t,e){t.exports=function(t){return 0<=(t%=2*Math.PI)?t:t+2*Math.PI}},function(t,e,i){var n=i(142);t.exports=function(t,e){return n(t)/n(e)/n(t-e)}},function(t,e){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},function(t,e){t.exports=function(t,e,i,n,s){var r=.5*(n-e),a=.5*(s-i),o=t*t;return(2*i-2*n+r+a)*(t*o)+(-3*i+3*n-2*r-a)*o+r*t+i}},function(t,e,i){var n=i(145);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e){t.exports=function(t,e,i){return t<=e?0:i<=t?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},function(t,e){t.exports=function(t){return 0<t?Math.ceil(t):Math.floor(t)}},function(t,e,i){var n=i(7);t.exports=function(t,e,i,s,r,a,o,h){void 0===h&&(h=new n);var u=Math.sin(r),c=Math.cos(r),l=c*a,d=u*a,p=-u*o,f=c*o,m=1/(l*f+p*-d);return h.x=f*m*t+-p*m*e+(s*p-i*f)*m,h.y=l*m*e+-d*m*t+(-s*l+i*d)*m,h}},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=n,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],h=t[7],u=t[8],c=u*r-a*h,l=-u*s+a*o,d=h*s-r*o,p=e*c+i*l+n*d;return p?(p=1/p,t[0]=c*p,t[1]=(-u*i+n*h)*p,t[2]=(a*i-n*r)*p,t[3]=l*p,t[4]=(u*e-n*o)*p,t[5]=(-a*e+n*s)*p,t[6]=d*p,t[7]=(-h*e+i*o)*p,t[8]=(r*e-i*s)*p,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],h=t[7],u=t[8];return t[0]=r*u-a*h,t[1]=n*h-i*u,t[2]=i*a-n*r,t[3]=a*o-s*u,t[4]=e*u-n*o,t[5]=n*s-e*a,t[6]=s*h-r*o,t[7]=i*o-e*h,t[8]=e*r-i*s,this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],h=t[7],u=t[8];return e*(u*r-a*h)+i*(-u*s+a*o)+n*(h*s-r*o)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],a=e[4],o=e[5],h=e[6],u=e[7],c=e[8],l=t.val,d=l[0],p=l[1],f=l[2],m=l[3],g=l[4],v=l[5],y=l[6],_=l[7],x=l[8];return e[0]=d*i+p*r+f*h,e[1]=d*n+p*a+f*u,e[2]=d*s+p*o+f*c,e[3]=m*i+g*r+v*h,e[4]=m*n+g*a+v*u,e[5]=m*s+g*o+v*c,e[6]=y*i+_*r+x*h,e[7]=y*n+_*a+x*u,e[8]=y*s+_*o+x*c,this},translate:function(t){var e=this.val,i=t.x,n=t.y;return e[6]=i*e[0]+n*e[3]+e[6],e[7]=i*e[1]+n*e[4]+e[7],e[8]=i*e[2]+n*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],a=e[4],o=e[5],h=Math.sin(t),u=Math.cos(t);return e[0]=u*i+h*r,e[1]=u*n+h*a,e[2]=u*s+h*o,e[3]=u*r-h*i,e[4]=u*a-h*n,e[5]=u*o-h*s,this},scale:function(t){var e=this.val,i=t.x,n=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=n*e[3],e[4]=n*e[4],e[5]=n*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,s=t.w,r=e+e,a=i+i,o=n+n,h=e*r,u=e*a,c=e*o,l=i*a,d=i*o,p=n*o,f=s*r,m=s*a,g=s*o,v=this.val;return v[0]=1-(l+p),v[3]=u+g,v[6]=c-m,v[1]=u-g,v[4]=1-(h+p),v[7]=d+f,v[2]=c+m,v[5]=d-f,v[8]=1-(h+l),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],s=e[1],r=e[2],a=e[3],o=e[4],h=e[5],u=e[6],c=e[7],l=e[8],d=e[9],p=e[10],f=e[11],m=e[12],g=e[13],v=e[14],y=e[15],_=n*h-s*o,x=n*u-r*o,E=n*c-a*o,T=s*u-r*h,w=s*c-a*h,S=r*c-a*u,b=l*g-d*m,A=l*v-p*m,C=l*y-f*m,O=d*v-p*g,M=d*y-f*g,R=p*y-f*v,P=_*R-x*M+E*O+T*C-w*A+S*b;return P?(P=1/P,i[0]=(h*R-u*M+c*O)*P,i[1]=(u*C-o*R-c*A)*P,i[2]=(o*M-h*C+c*b)*P,i[3]=(r*M-s*R-a*O)*P,i[4]=(n*R-r*C+a*A)*P,i[5]=(s*C-n*M-a*b)*P,i[6]=(g*S-v*w+y*T)*P,i[7]=(v*E-m*S-y*x)*P,i[8]=(m*w-g*E+y*_)*P,this):null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},xyz:function(t,e,i){this.identity();var n=this.val;return n[12]=t,n[13]=e,n[14]=i,this},scaling:function(t,e,i){this.zero();var n=this.val;return n[0]=t,n[5]=e,n[10]=i,n[15]=1,this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],s=t[6],r=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=s,t[11]=t[14],t[12]=n,t[13]=r,t[14]=a,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],h=t[7],u=t[8],c=t[9],l=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15],v=e*a-i*r,y=e*o-n*r,_=e*h-s*r,x=i*o-n*a,E=i*h-s*a,T=n*h-s*o,w=u*f-c*p,S=u*m-l*p,b=u*g-d*p,A=c*m-l*f,C=c*g-d*f,O=l*g-d*m,M=v*O-y*C+_*A+x*b-E*S+T*w;return M?(M=1/M,t[0]=(a*O-o*C+h*A)*M,t[1]=(n*C-i*O-s*A)*M,t[2]=(f*T-m*E+g*x)*M,t[3]=(l*E-c*T-d*x)*M,t[4]=(o*b-r*O-h*S)*M,t[5]=(e*O-n*b+s*S)*M,t[6]=(m*_-p*T-g*y)*M,t[7]=(u*T-l*_+d*y)*M,t[8]=(r*C-a*b+h*w)*M,t[9]=(i*b-e*C-s*w)*M,t[10]=(p*E-f*_+g*v)*M,t[11]=(c*_-u*E-d*v)*M,t[12]=(a*S-r*A-o*w)*M,t[13]=(e*A-i*S+n*w)*M,t[14]=(f*y-p*x-m*v)*M,t[15]=(u*x-c*y+l*v)*M,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],h=t[7],u=t[8],c=t[9],l=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15];return t[0]=a*(l*g-d*m)-c*(o*g-h*m)+f*(o*d-h*l),t[1]=-(i*(l*g-d*m)-c*(n*g-s*m)+f*(n*d-s*l)),t[2]=i*(o*g-h*m)-a*(n*g-s*m)+f*(n*h-s*o),t[3]=-(i*(o*d-h*l)-a*(n*d-s*l)+c*(n*h-s*o)),t[4]=-(r*(l*g-d*m)-u*(o*g-h*m)+p*(o*d-h*l)),t[5]=e*(l*g-d*m)-u*(n*g-s*m)+p*(n*d-s*l),t[6]=-(e*(o*g-h*m)-r*(n*g-s*m)+p*(n*h-s*o)),t[7]=e*(o*d-h*l)-r*(n*d-s*l)+u*(n*h-s*o),t[8]=r*(c*g-d*f)-u*(a*g-h*f)+p*(a*d-h*c),t[9]=-(e*(c*g-d*f)-u*(i*g-s*f)+p*(i*d-s*c)),t[10]=e*(a*g-h*f)-r*(i*g-s*f)+p*(i*h-s*a),t[11]=-(e*(a*d-h*c)-r*(i*d-s*c)+u*(i*h-s*a)),t[12]=-(r*(c*m-l*f)-u*(a*m-o*f)+p*(a*l-o*c)),t[13]=e*(c*m-l*f)-u*(i*m-n*f)+p*(i*l-n*c),t[14]=-(e*(a*m-o*f)-r*(i*m-n*f)+p*(i*o-n*a)),t[15]=e*(a*l-o*c)-r*(i*l-n*c)+u*(i*o-n*a),this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],h=t[7],u=t[8],c=t[9],l=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15];return(e*a-i*r)*(l*g-d*m)-(e*o-n*r)*(c*g-d*f)+(e*h-s*r)*(c*m-l*f)+(i*o-n*a)*(u*g-d*p)-(i*h-s*a)*(u*m-l*p)+(n*h-s*o)*(u*f-c*p)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],a=e[4],o=e[5],h=e[6],u=e[7],c=e[8],l=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],v=e[15],y=t.val,_=y[0],x=y[1],E=y[2],T=y[3];return e[0]=_*i+x*a+E*c+T*f,e[1]=_*n+x*o+E*l+T*m,e[2]=_*s+x*h+E*d+T*g,e[3]=_*r+x*u+E*p+T*v,_=y[4],x=y[5],E=y[6],T=y[7],e[4]=_*i+x*a+E*c+T*f,e[5]=_*n+x*o+E*l+T*m,e[6]=_*s+x*h+E*d+T*g,e[7]=_*r+x*u+E*p+T*v,_=y[8],x=y[9],E=y[10],T=y[11],e[8]=_*i+x*a+E*c+T*f,e[9]=_*n+x*o+E*l+T*m,e[10]=_*s+x*h+E*d+T*g,e[11]=_*r+x*u+E*p+T*v,_=y[12],x=y[13],E=y[14],T=y[15],e[12]=_*i+x*a+E*c+T*f,e[13]=_*n+x*o+E*l+T*m,e[14]=_*s+x*h+E*d+T*g,e[15]=_*r+x*u+E*p+T*v,this},multiplyLocal:function(t){var e=[],i=this.val,n=t.val;return e[0]=i[0]*n[0]+i[1]*n[4]+i[2]*n[8]+i[3]*n[12],e[1]=i[0]*n[1]+i[1]*n[5]+i[2]*n[9]+i[3]*n[13],e[2]=i[0]*n[2]+i[1]*n[6]+i[2]*n[10]+i[3]*n[14],e[3]=i[0]*n[3]+i[1]*n[7]+i[2]*n[11]+i[3]*n[15],e[4]=i[4]*n[0]+i[5]*n[4]+i[6]*n[8]+i[7]*n[12],e[5]=i[4]*n[1]+i[5]*n[5]+i[6]*n[9]+i[7]*n[13],e[6]=i[4]*n[2]+i[5]*n[6]+i[6]*n[10]+i[7]*n[14],e[7]=i[4]*n[3]+i[5]*n[7]+i[6]*n[11]+i[7]*n[15],e[8]=i[8]*n[0]+i[9]*n[4]+i[10]*n[8]+i[11]*n[12],e[9]=i[8]*n[1]+i[9]*n[5]+i[10]*n[9]+i[11]*n[13],e[10]=i[8]*n[2]+i[9]*n[6]+i[10]*n[10]+i[11]*n[14],e[11]=i[8]*n[3]+i[9]*n[7]+i[10]*n[11]+i[11]*n[15],e[12]=i[12]*n[0]+i[13]*n[4]+i[14]*n[8]+i[15]*n[12],e[13]=i[12]*n[1]+i[13]*n[5]+i[14]*n[9]+i[15]*n[13],e[14]=i[12]*n[2]+i[13]*n[6]+i[14]*n[10]+i[15]*n[14],e[15]=i[12]*n[3]+i[13]*n[7]+i[14]*n[11]+i[15]*n[15],this.fromArray(e)},translate:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[12]=s[0]*e+s[4]*i+s[8]*n+s[12],s[13]=s[1]*e+s[5]*i+s[9]*n+s[13],s[14]=s[2]*e+s[6]*i+s[10]*n+s[14],s[15]=s[3]*e+s[7]*i+s[11]*n+s[15],this},translateXYZ:function(t,e,i){var n=this.val;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this},scale:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[0]=s[0]*e,s[1]=s[1]*e,s[2]=s[2]*e,s[3]=s[3]*e,s[4]=s[4]*i,s[5]=s[5]*i,s[6]=s[6]*i,s[7]=s[7]*i,s[8]=s[8]*n,s[9]=s[9]*n,s[10]=s[10]*n,s[11]=s[11]*n,this},scaleXYZ:function(t,e,i){var n=this.val;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),s=1-i,r=t.x,a=t.y,o=t.z,h=s*r,u=s*a;return this.fromArray([h*r+i,h*a-n*o,h*o+n*a,0,h*a+n*o,u*a+i,u*o-n*r,0,h*o-n*a,u*o+n*r,s*o*o+i,0,0,0,0,1]),this},rotate:function(t,e){var i=this.val,n=e.x,s=e.y,r=e.z,a=Math.sqrt(n*n+s*s+r*r);if(Math.abs(a)<1e-6)return null;n*=a=1/a,s*=a,r*=a;var o=Math.sin(t),h=Math.cos(t),u=1-h,c=i[0],l=i[1],d=i[2],p=i[3],f=i[4],m=i[5],g=i[6],v=i[7],y=i[8],_=i[9],x=i[10],E=i[11],T=n*n*u+h,w=s*n*u+r*o,S=r*n*u-s*o,b=n*s*u-r*o,A=s*s*u+h,C=r*s*u+n*o,O=n*r*u+s*o,M=s*r*u-n*o,R=r*r*u+h;return i[0]=c*T+f*w+y*S,i[1]=l*T+m*w+_*S,i[2]=d*T+g*w+x*S,i[3]=p*T+v*w+E*S,i[4]=c*b+f*A+y*C,i[5]=l*b+m*A+_*C,i[6]=d*b+g*A+x*C,i[7]=p*b+v*A+E*C,i[8]=c*O+f*M+y*R,i[9]=l*O+m*M+_*R,i[10]=d*O+g*M+x*R,i[11]=p*O+v*M+E*R,this},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],a=e[6],o=e[7],h=e[8],u=e[9],c=e[10],l=e[11];return e[4]=s*n+h*i,e[5]=r*n+u*i,e[6]=a*n+c*i,e[7]=o*n+l*i,e[8]=h*n-s*i,e[9]=u*n-r*i,e[10]=c*n-a*i,e[11]=l*n-o*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],a=e[2],o=e[3],h=e[8],u=e[9],c=e[10],l=e[11];return e[0]=s*n-h*i,e[1]=r*n-u*i,e[2]=a*n-c*i,e[3]=o*n-l*i,e[8]=s*i+h*n,e[9]=r*i+u*n,e[10]=a*i+c*n,e[11]=o*i+l*n,this},rotateZ:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],a=e[2],o=e[3],h=e[4],u=e[5],c=e[6],l=e[7];return e[0]=s*n+h*i,e[1]=r*n+u*i,e[2]=a*n+c*i,e[3]=o*n+l*i,e[4]=h*n-s*i,e[5]=u*n-r*i,e[6]=c*n-a*i,e[7]=l*n-o*i,this},fromRotationTranslation:function(t,e){var i=this.val,n=t.x,s=t.y,r=t.z,a=t.w,o=n+n,h=s+s,u=r+r,c=n*o,l=n*h,d=n*u,p=s*h,f=s*u,m=r*u,g=a*o,v=a*h,y=a*u;return i[0]=1-(p+m),i[1]=l+y,i[2]=d-v,i[3]=0,i[4]=l-y,i[5]=1-(c+m),i[6]=f+g,i[7]=0,i[8]=d+v,i[9]=f-g,i[10]=1-(c+p),i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},fromQuat:function(t){var e=this.val,i=t.x,n=t.y,s=t.z,r=t.w,a=i+i,o=n+n,h=s+s,u=i*a,c=i*o,l=i*h,d=n*o,p=n*h,f=s*h,m=r*a,g=r*o,v=r*h;return e[0]=1-(d+f),e[1]=c+v,e[2]=l-g,e[3]=0,e[4]=c-v,e[5]=1-(u+f),e[6]=p+m,e[7]=0,e[8]=l+g,e[9]=p-m,e[10]=1-(u+d),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,i,n,s,r){var a=this.val,o=1/(e-t),h=1/(n-i),u=1/(s-r);return a[0]=2*s*o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=2*s*h,a[6]=0,a[7]=0,a[8]=(e+t)*o,a[9]=(n+i)*h,a[10]=(r+s)*u,a[11]=-1,a[12]=0,a[13]=0,a[14]=r*s*2*u,a[15]=0,this},perspective:function(t,e,i,n){var s=this.val,r=1/Math.tan(t/2),a=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*a,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*a,s[15]=0,this},perspectiveLH:function(t,e,i,n){var s=this.val;return s[0]=2*i/t,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/e,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=-n/(i-n),s[11]=1,s[12]=0,s[13]=0,s[14]=i*n/(i-n),s[15]=0,this},ortho:function(t,e,i,n,s,r){var a=this.val,o=t-e,h=i-n,u=s-r;return o=0===o?o:1/o,h=0===h?h:1/h,u=0===u?u:1/u,a[0]=-2*o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=-2*h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=2*u,a[11]=0,a[12]=(t+e)*o,a[13]=(n+i)*h,a[14]=(r+s)*u,a[15]=1,this},lookAt:function(t,e,i){var n=this.val,s=t.x,r=t.y,a=t.z,o=i.x,h=i.y,u=i.z,c=e.x,l=e.y,d=e.z;if(Math.abs(s-c)<1e-6&&Math.abs(r-l)<1e-6&&Math.abs(a-d)<1e-6)return this.identity();var p=s-c,f=r-l,m=a-d,g=1/Math.sqrt(p*p+f*f+m*m),v=h*(m*=g)-u*(f*=g),y=u*(p*=g)-o*m,_=o*f-h*p;(g=Math.sqrt(v*v+y*y+_*_))?(v*=g=1/g,y*=g,_*=g):_=y=v=0;var x=f*_-m*y,E=m*v-p*_,T=p*y-f*v;return(g=Math.sqrt(x*x+E*E+T*T))?(x*=g=1/g,E*=g,T*=g):T=E=x=0,n[0]=v,n[1]=x,n[2]=p,n[3]=0,n[4]=y,n[5]=E,n[6]=f,n[7]=0,n[8]=_,n[9]=T,n[10]=m,n[11]=0,n[12]=-(v*s+y*r+_*a),n[13]=-(x*s+E*r+T*a),n[14]=-(p*s+f*r+m*a),n[15]=1,this},yawPitchRoll:function(t,e,i){this.zero(),s.zero(),r.zero();var n=this.val,a=s.val,o=r.val,h=Math.sin(i),u=Math.cos(i);return n[10]=1,n[15]=1,n[0]=u,n[1]=h,n[4]=-h,n[5]=u,h=Math.sin(e),u=Math.cos(e),a[0]=1,a[15]=1,a[5]=u,a[10]=u,a[9]=-h,a[6]=h,h=Math.sin(t),u=Math.cos(t),o[5]=1,o[15]=1,o[0]=u,o[2]=-h,o[8]=h,o[10]=u,this.multiplyLocal(s),this.multiplyLocal(r),this},setWorldMatrix:function(t,e,i,n,a){return this.yawPitchRoll(t.y,t.x,t.z),s.scaling(i.x,i.y,i.z),r.xyz(e.x,e.y,e.z),this.multiplyLocal(s),this.multiplyLocal(r),void 0!==n&&this.multiplyLocal(n),void 0!==a&&this.multiplyLocal(a),this}}),s=new n,r=new n;t.exports=n},function(t,e,i){var n=i(0),s=i(69),r=i(149),a=new Int8Array([1,2,0]),o=new Float32Array([0,0,0]),h=new s(1,0,0),u=new s(0,1,0),c=new s,l=new r,d=new n({initialize:function(t,e,i,n){"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n;return 0<s&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(c.copy(h).cross(t).length()<1e-6&&c.copy(u).cross(t),c.normalize(),this.setAxisAngle(c,Math.PI)):.999999<i?(this.x=0,this.y=0,this.z=0,this.w=1,this):(c.copy(t).cross(e),this.x=c.x,this.y=c.y,this.z=c.z,this.w=1+i,this.normalize())},setAxes:function(t,e,i){var n=l.val;return n[0]=e.x,n[3]=e.y,n[6]=e.z,n[1]=i.x,n[4]=i.y,n[7]=i.z,n[2]=-t.x,n[5]=-t.y,n[8]=-t.z,this.fromMat3(l).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.x=i*t.x,this.y=i*t.y,this.z=i*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.x,a=t.y,o=t.z,h=t.w;return this.x=e*h+s*r+i*o-n*a,this.y=i*h+s*a+n*r-e*o,this.z=n*h+s*o+e*a-i*r,this.w=s*h-e*r-i*a-n*o,this},slerp:function(t,e){var i=this.x,n=this.y,s=this.z,r=this.w,a=t.x,o=t.y,h=t.z,u=t.w,c=i*a+n*o+s*h+r*u;c<0&&(c=-c,a=-a,o=-o,h=-h,u=-u);var l=1-e,d=e;if(1e-6<1-c){var p=Math.acos(c),f=Math.sin(p);l=Math.sin((1-e)*p)/f,d=Math.sin(e*p)/f}return this.x=l*i+d*a,this.y=l*n+d*o,this.z=l*s+d*h,this.w=l*r+d*u,this},invert:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n,r=s?1/s:0;return this.x=-t*r,this.y=-e*r,this.z=-i*r,this.w=n*r,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),a=Math.cos(t);return this.x=e*a+s*r,this.y=i*a+n*r,this.z=n*a-i*r,this.w=s*a-e*r,this},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),a=Math.cos(t);return this.x=e*a-n*r,this.y=i*a+s*r,this.z=n*a+e*r,this.w=s*a-i*r,this},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),a=Math.cos(t);return this.x=e*a+i*r,this.y=i*a-e*r,this.z=n*a+s*r,this.w=s*a-n*r,this},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},fromMat3:function(t){var e,i=t.val,n=i[0]+i[4]+i[8];if(0<n)e=Math.sqrt(n+1),this.w=.5*e,e=.5/e,this.x=(i[7]-i[5])*e,this.y=(i[2]-i[6])*e,this.z=(i[3]-i[1])*e;else{var s=0;i[4]>i[0]&&(s=1),i[8]>i[3*s+s]&&(s=2);var r=a[s],h=a[r];e=Math.sqrt(i[3*s+s]-i[3*r+r]-i[3*h+h]+1),o[s]=.5*e,e=.5/e,o[r]=(i[3*r+s]+i[3*s+r])*e,o[h]=(i[3*h+s]+i[3*s+h])*e,this.x=o[0],this.y=o[1],this.z=o[2],this.w=(i[3*h+r]-i[3*r+h])*e}return this}});t.exports=d},function(t,e,i){var n=i(450),s=i(12),r=i(14),a=i(65);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===r.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==r.HEADLESS)if(e.renderType===r.CANVAS||e.renderType!==r.CANVAS&&!a.webGL){if(!a.canvas)throw new Error("Cannot create Canvas or WebGL context, aborting.");e.renderType=r.CANVAS}else e.renderType=r.WEBGL;e.antialias||s.disableSmoothing();var o,h,u=t.scale.baseSize,c=u.width,l=u.height;e.canvas?(t.canvas=e.canvas,t.canvas.width=c,t.canvas.height=l):t.canvas=s.create(t,c,l,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||n.setCrisp(t.canvas),e.renderType!==r.HEADLESS&&(o=i(153),h=i(156),e.renderType===r.WEBGL?t.renderer=new h(t):(t.renderer=new o(t),t.context=t.renderer.gameContext))}},function(t,e,i){var n=i(154),s=i(15),r=i(0),a=i(14),o=i(155),h=i(33),u=i(18),c=new r({initialize:function(t){this.game=t,this.type=a.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.config={clearBeforeRender:t.config.clearBeforeRender,backgroundColor:t.config.backgroundColor,resolution:t.config.resolution,antialias:t.config.antialias,roundPixels:t.config.roundPixels},this.gameCanvas=t.canvas;var e={alpha:t.config.transparent,desynchronized:t.config.desynchronized};this.gameContext=this.game.config.context?this.game.config.context:this.gameCanvas.getContext("2d",e),this.currentContext=this.gameContext,this.antialias=t.config.antialias,this.blendModes=o(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new u,this._tempMatrix2=new u,this._tempMatrix3=new u,this._tempMatrix4=new u,this.init()},init:function(){this.game.scale.on(h.RESIZE,this.onResize,this);var t=this.game.scale.baseSize;this.resize(t.width,t.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,n=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),e.clearBeforeRender&&t.clearRect(0,0,i,n),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,n)),t.save(),this.drawCount=0},render:function(t,e,i,n){var r=e.list,a=r.length,o=n._cx,h=n._cy,u=n._cw,c=n._ch,l=n.renderToTexture?n.context:t.sys.context;l.save(),this.game.scene.customViewports&&(l.beginPath(),l.rect(o,h,u,c),l.clip()),this.currentContext=l;var d=n.mask;d&&d.preRenderCanvas(this,null,n._maskCamera),n.transparent||(l.fillStyle=n.backgroundColor.rgba,l.fillRect(o,h,u,c)),l.globalAlpha=n.alpha,l.globalCompositeOperation="source-over",this.drawCount+=r.length,n.renderToTexture&&n.emit(s.PRE_RENDER,n),n.matrix.copyToContext(l);for(var p=0;p<a;p++){var f=r[p];f.willRender(n)&&(f.mask&&f.mask.preRenderCanvas(this,f,n),f.renderCanvas(this,f,i,n),f.mask&&f.mask.postRenderCanvas(this,f,n))}l.setTransform(1,0,0,1,0,0),l.globalCompositeOperation="source-over",l.globalAlpha=1,n.flashEffect.postRenderCanvas(l),n.fadeEffect.postRenderCanvas(l),n.dirty=!1,d&&d.postRenderCanvas(this),l.restore(),n.renderToTexture&&(n.emit(s.POST_RENDER,n),n.renderToGame&&t.sys.context.drawImage(n.canvas,o,h))},postRender:function(){this.gameContext.restore();var t=this.snapshotState;t.callback&&(n(this.gameCanvas,t),t.callback=null)},snapshotCanvas:function(t,e,i,s,r,a,o,h,u){void 0===i&&(i=!1),this.snapshotArea(s,r,a,o,e,h,u);var c=this.snapshotState;return c.getPixel=i,n(this.canvas,c),c.callback=null,this},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gameCanvas.width,this.gameCanvas.height,t,e,i)},snapshotArea:function(t,e,i,n,s,r,a){var o=this.snapshotState;return o.callback=s,o.type=r,o.encoder=a,o.getPixel=!1,o.x=t,o.y=e,o.width=Math.min(i,this.gameCanvas.width),o.height=Math.min(n,this.gameCanvas.height),this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},batchSprite:function(t,e,i,n){var s=i.alpha*t.alpha;if(0!=s){var r=this.currentContext,a=this._tempMatrix1,o=this._tempMatrix2,h=this._tempMatrix3,u=e.canvasData,c=u.x,l=u.y,d=e.cutWidth,p=e.cutHeight,f=e.customPivot,m=e.source.resolution,g=t.displayOriginX,v=t.displayOriginY,y=-g+e.x,_=-v+e.y;if(t.isCropped){var x=t._crop;x.flipX===t.flipX&&x.flipY===t.flipY||e.updateCropUVs(x,t.flipX,t.flipY),d=x.cw,p=x.ch,c=x.cx,l=x.cy,y=-g+x.x,_=-v+x.y,t.flipX&&(0<=y?y=-(y+d):y<0&&(y=Math.abs(y)-d)),t.flipY&&(0<=_?_=-(_+p):_<0&&(_=Math.abs(_)-p))}var E=1,T=1;t.flipX&&(f||(y+=-e.realWidth+2*g),E=-1),t.flipY&&(f||(_+=-e.realHeight+2*v),T=-1),o.applyITRS(t.x,t.y,t.rotation,t.scaleX*E,t.scaleY*T),a.copyFrom(i.matrix),n?(a.multiplyWithOffset(n,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),o.e=t.x,o.f=t.y):(o.e-=i.scrollX*t.scrollFactorX,o.f-=i.scrollY*t.scrollFactorY),a.multiply(o,h),r.save(),h.setToContext(r),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=s,r.imageSmoothingEnabled=!(!this.antialias||e.source.scaleMode),t.mask&&t.mask.preRenderCanvas(this,t,i),r.drawImage(e.source.image,c,l,d,p,y,_,d/m,p/m),t.mask&&t.mask.postRenderCanvas(this,t,i),r.restore()}},destroy:function(){this.gameCanvas=null,this.gameContext=null,this.game=null}});t.exports=c},function(t,e,i){var n=i(12),s=i(20),r=i(4);t.exports=function(t,e){var i=r(e,"callback"),a=r(e,"type","image/png"),o=r(e,"encoder",.92),h=Math.abs(Math.round(r(e,"x",0))),u=Math.abs(Math.round(r(e,"y",0))),c=r(e,"width",t.width),l=r(e,"height",t.height);if(r(e,"getPixel",!1)){var d=t.getContext("2d").getImageData(h,u,1,1).data;i.call(null,new s(d[0],d[1],d[2],d[3]/255))}else if(0!==h||0!==u||c!==t.width||l!==t.height){var p=n.createWebGL(this,c,l);p.getContext("2d").drawImage(t,h,u,c,l,0,0,c,l);var f=new Image;f.onerror=function(){i.call(null),n.remove(p)},f.onload=function(){i.call(null,f),n.remove(p)},f.src=p.toDataURL(a,o)}else{var m=new Image;m.onerror=function(){i.call(null)},m.onload=function(){i.call(null,m)},m.src=t.toDataURL(a,o)}}},function(t,e,i){var n=i(29),s=i(138);t.exports=function(){var t=[],e=s.supportNewBlendModes,i="source-over";return t[n.NORMAL]=i,t[n.ADD]="lighter",t[n.MULTIPLY]=e?"multiply":i,t[n.SCREEN]=e?"screen":i,t[n.OVERLAY]=e?"overlay":i,t[n.DARKEN]=e?"darken":i,t[n.LIGHTEN]=e?"lighten":i,t[n.COLOR_DODGE]=e?"color-dodge":i,t[n.COLOR_BURN]=e?"color-burn":i,t[n.HARD_LIGHT]=e?"hard-light":i,t[n.SOFT_LIGHT]=e?"soft-light":i,t[n.DIFFERENCE]=e?"difference":i,t[n.EXCLUSION]=e?"exclusion":i,t[n.HUE]=e?"hue":i,t[n.SATURATION]=e?"saturation":i,t[n.COLOR]=e?"color":i,t[n.LUMINOSITY]=e?"luminosity":i,t[n.ERASE]="destination-out",t[n.SOURCE_IN]="source-in",t[n.SOURCE_OUT]="source-out",t[n.SOURCE_ATOP]="source-atop",t[n.DESTINATION_OVER]="destination-over",t[n.DESTINATION_IN]="destination-in",t[n.DESTINATION_OUT]="destination-out",t[n.DESTINATION_ATOP]="destination-atop",t[n.LIGHTER]="lighter",t[n.COPY]="copy",t[n.XOR]="xor",t}},function(t,e,i){var n=i(30),s=i(15),r=i(0),a=i(14),o=i(6),h=i(44),u=i(1),c=i(33),l=i(35),d=i(46),p=i(18),f=i(19),m=i(157),g=i(158),v=i(159),y=i(71),_=i(162),x=new r({initialize:function(t){var e=t.config,i={alpha:e.transparent,desynchronized:e.desynchronized,depth:!1,antialias:e.antialiasGL,premultipliedAlpha:e.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:e.failIfMajorPerformanceCaveat,powerPreference:e.powerPreference};this.config={clearBeforeRender:e.clearBeforeRender,antialias:e.antialias,backgroundColor:e.backgroundColor,contextCreation:i,resolution:e.resolution,roundPixels:e.roundPixels,maxTextures:e.maxTextures,maxTextureSize:e.maxTextureSize,batchSize:e.batchSize,maxLights:e.maxLights,mipmapFilter:e.mipmapFilter},this.game=t,this.type=a.WEBGL,this.width=0,this.height=0,this.canvas=t.canvas,this.blendModes=[],this.nativeTextures=[],this.contextLost=!1,this.pipelines=null,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92,isFramebuffer:!1,bufferWidth:0,bufferHeight:0},this.currentActiveTextureUnit=0,this.currentTextures=new Array(16),this.currentFramebuffer=null,this.currentPipeline=null,this.currentProgram=null,this.currentVertexBuffer=null,this.currentIndexBuffer=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.contextLostHandler=u,this.contextRestoredHandler=u,this.gl=null,this.supportedExtensions=null,this.extensions={},this.glFormats=[],this.compression={ETC1:!1,PVRTC:!1,S3TC:!1},this.drawingBufferHeight=0,this.blankTexture=null,this.defaultCamera=new n(0,0,0,0),this._tempMatrix1=new p,this._tempMatrix2=new p,this._tempMatrix3=new p,this._tempMatrix4=new p,this.maskCount=0,this.maskStack=[],this.currentMask={mask:null,camera:null},this.currentCameraMask={mask:null,camera:null},this.glFuncMap=null,this.currentType="",this.newType=!1,this.nextTypeMatch=!1,this.mipmapFilter=null,this.init(this.config)},init:function(t){var e,i=this.game,n=this.canvas,s=t.backgroundColor;if(!(e=i.config.context?i.config.context:n.getContext("webgl",t.contextCreation)||n.getContext("experimental-webgl",t.contextCreation))||e.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=e;var r=this;this.contextLostHandler=function(t){r.contextLost=!0,r.game.events.emit(o.CONTEXT_LOST,r),t.preventDefault()},this.contextRestoredHandler=function(){r.contextLost=!1,r.init(r.config),r.game.events.emit(o.CONTEXT_RESTORED,r)},n.addEventListener("webglcontextlost",this.contextLostHandler,!1),n.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),i.context=e;for(var h=0;h<=27;h++)this.blendModes.push({func:[e.ONE,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_ADD});this.blendModes[1].func=[e.ONE,e.DST_ALPHA],this.blendModes[2].func=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[e.ONE,e.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[e.ZERO,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_REVERSE_SUBTRACT},this.glFormats[0]=e.BYTE,this.glFormats[1]=e.SHORT,this.glFormats[2]=e.UNSIGNED_BYTE,this.glFormats[3]=e.UNSIGNED_SHORT,this.glFormats[4]=e.FLOAT,this.glFuncMap={mat2:{func:e.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:e.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:e.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:e.uniform1f,length:1},"1fv":{func:e.uniform1fv,length:1},"1i":{func:e.uniform1i,length:1},"1iv":{func:e.uniform1iv,length:1},"2f":{func:e.uniform2f,length:2},"2fv":{func:e.uniform2fv,length:1},"2i":{func:e.uniform2i,length:2},"2iv":{func:e.uniform2iv,length:1},"3f":{func:e.uniform3f,length:3},"3fv":{func:e.uniform3fv,length:1},"3i":{func:e.uniform3i,length:3},"3iv":{func:e.uniform3iv,length:1},"4f":{func:e.uniform4f,length:4},"4fv":{func:e.uniform4fv,length:1},"4i":{func:e.uniform4i,length:4},"4iv":{func:e.uniform4iv,length:1}};var u=e.getSupportedExtensions();t.maxTextures||(t.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),t.maxTextureSize||(t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE));var c="WEBGL_compressed_texture_",l="WEBKIT_"+c;this.compression.ETC1=e.getExtension(c+"etc1")||e.getExtension(l+"etc1"),this.compression.PVRTC=e.getExtension(c+"pvrtc")||e.getExtension(l+"pvrtc"),this.compression.S3TC=e.getExtension(c+"s3tc")||e.getExtension(l+"s3tc"),this.supportedExtensions=u,e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),e.enable(e.BLEND),e.clearColor(s.redGL,s.greenGL,s.blueGL,s.alphaGL),this.mipmapFilter=e[t.mipmapFilter];for(var p=0;p<this.currentTextures.length;++p)this.currentTextures[p]=null;return this.pipelines={},this.addPipeline("TextureTintPipeline",new y({game:i,renderer:this})),this.addPipeline("TextureTintStripPipeline",new _({game:i,renderer:this})),this.addPipeline("BitmapMaskPipeline",new g({game:i,renderer:this})),this.addPipeline("Light2D",new v({game:i,renderer:this,maxLights:t.maxLights})),this.setBlendMode(a.BlendModes.NORMAL),i.textures.once(d.READY,this.boot,this),this},boot:function(){for(var t in this.pipelines)this.pipelines[t].boot();var e=this.game.textures.getFrame("__DEFAULT");this.pipelines.TextureTintPipeline.currentFrame=e,this.blankTexture=e;var i=this.gl;i.bindFramebuffer(i.FRAMEBUFFER,null),i.enable(i.SCISSOR_TEST),this.setPipeline(this.pipelines.TextureTintPipeline),this.game.scale.on(c.RESIZE,this.onResize,this);var n=this.game.scale.baseSize;this.resize(n.width,n.height,this.game.scale.resolution)},onResize:function(t,e,i,n){e.width===this.width&&e.height===this.height&&n===this.resolution||this.resize(e.width,e.height,n)},resize:function(t,e,i){var n=this.gl,s=this.pipelines;for(var r in this.width=t,this.height=e,this.resolution=i,n.viewport(0,0,t,e),s)s[r].resize(t,e,i);return this.drawingBufferHeight=n.drawingBufferHeight,n.scissor(0,n.drawingBufferHeight-e,t,e),this.defaultCamera.setSize(t,e),this},hasExtension:function(t){return!!this.supportedExtensions&&this.supportedExtensions.indexOf(t)},getExtension:function(t){return this.hasExtension(t)?(t in this.extensions||(this.extensions[t]=this.gl.getExtension(t)),this.extensions[t]):null},flush:function(){this.currentPipeline&&this.currentPipeline.flush()},hasPipeline:function(t){return t in this.pipelines},getPipeline:function(t){return this.hasPipeline(t)?this.pipelines[t]:null},removePipeline:function(t){return delete this.pipelines[t],this},addPipeline:function(t,e){return this.hasPipeline(t)?console.warn("Pipeline exists: "+t):this.pipelines[t]=e,e.name=t,this.pipelines[t].resize(this.width,this.height,this.config.resolution),e},pushScissor:function(t,e,i,n,s){void 0===s&&(s=this.drawingBufferHeight);var r=[t,e,i,n];return this.scissorStack.push(r),this.setScissor(t,e,i,n,s),this.currentScissor=r},setScissor:function(t,e,i,n,s){void 0===s&&(s=this.drawingBufferHeight);var r=this.gl,a=this.currentScissor,o=0<i&&0<n;if(a&&o){var h=a[0],u=a[1],c=a[2],l=a[3];o=h!==t||u!==e||c!==i||l!==n}o&&(this.flush(),r.scissor(t,s-e-n,i,n))},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},setPipeline:function(t,e){return this.currentPipeline===t&&this.currentPipeline.vertexBuffer===this.currentVertexBuffer&&this.currentPipeline.program===this.currentProgram||(this.flush(),this.currentPipeline=t,this.currentPipeline.bind()),this.currentPipeline.onBind(e),this.currentPipeline},hasActiveStencilMask:function(){var t=this.currentMask.mask,e=this.currentCameraMask.mask;return t&&t.isStencil||e&&e.isStencil},rebindPipeline:function(t){var e=this.gl;e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),this.hasActiveStencilMask()?e.clear(e.DEPTH_BUFFER_BIT):(e.disable(e.STENCIL_TEST),e.clear(e.DEPTH_BUFFER_BIT|e.STENCIL_BUFFER_BIT)),e.viewport(0,0,this.width,this.height),this.setBlendMode(0,!0),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this.blankTexture.glTexture),this.currentActiveTextureUnit=0,this.currentTextures[0]=this.blankTexture.glTexture,this.currentPipeline=t,this.currentPipeline.bind(),this.currentPipeline.onBind()},clearPipeline:function(){this.flush(),this.currentPipeline=null,this.currentProgram=null,this.currentVertexBuffer=null,this.currentIndexBuffer=null,this.setBlendMode(0,!0)},setBlendMode:function(t,e){void 0===e&&(e=!1);var i=this.gl,n=this.blendModes[t];return!!(e||t!==a.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t)&&(this.flush(),i.enable(i.BLEND),i.blendEquation(n.equation),2<n.func.length?i.blendFuncSeparate(n.func[0],n.func[1],n.func[2],n.func[3]):i.blendFunc(n.func[0],n.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return 17<t&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(t){void 0===t&&(t=!1),!t&&0===this.currentActiveTextureUnit&&this.currentTextures[0]||this.setTexture2D(this.blankTexture.glTexture,0)},setTexture2D:function(t,e,i){void 0===i&&(i=!0);var n=this.gl;return t!==this.currentTextures[e]&&(i&&this.flush(),this.currentActiveTextureUnit!==e&&(n.activeTexture(n.TEXTURE0+e),this.currentActiveTextureUnit=e),n.bindTexture(n.TEXTURE_2D,t),this.currentTextures[e]=t),this},setFramebuffer:function(t,e){void 0===e&&(e=!1);var i=this.gl,n=this.width,s=this.height;return t!==this.currentFramebuffer&&(t&&t.renderTexture?(n=t.renderTexture.width,s=t.renderTexture.height):this.flush(),i.bindFramebuffer(i.FRAMEBUFFER,t),i.viewport(0,0,n,s),e&&(t?(this.drawingBufferHeight=s,this.pushScissor(0,0,n,s)):(this.drawingBufferHeight=this.height,this.popScissor())),this.currentFramebuffer=t),this},setProgram:function(t){var e=this.gl;return t!==this.currentProgram&&(this.flush(),e.useProgram(t),this.currentProgram=t),this},setVertexBuffer:function(t){var e=this.gl;return t!==this.currentVertexBuffer&&(this.flush(),e.bindBuffer(e.ARRAY_BUFFER,t),this.currentVertexBuffer=t),this},setIndexBuffer:function(t){var e=this.gl;return t!==this.currentIndexBuffer&&(this.flush(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.currentIndexBuffer=t),this},createTextureFromSource:function(t,e,i,n){var s=this.gl,r=s.NEAREST,o=s.NEAREST,u=s.CLAMP_TO_EDGE;e=t?t.width:e,i=t?t.height:i;var c=h(e,i);return c&&(u=s.REPEAT),n===a.ScaleModes.LINEAR&&this.config.antialias&&(r=c?this.mipmapFilter:s.LINEAR,o=s.LINEAR),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,r,o,u,u,s.RGBA,t):this.createTexture2D(0,r,o,u,u,s.RGBA,null,e,i)},createTexture2D:function(t,e,i,n,s,r,a,o,u,c,l,d){c=null==c||c,void 0===l&&(l=!1),void 0===d&&(d=!1);var p=this.gl,f=p.createTexture();return this.setTexture2D(f,0),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,e),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,i),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,s),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,n),p.pixelStorei(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL,c),p.pixelStorei(p.UNPACK_FLIP_Y_WEBGL,d),null==a?p.texImage2D(p.TEXTURE_2D,t,r,o,u,0,r,p.UNSIGNED_BYTE,null):(l||(o=a.width,u=a.height),p.texImage2D(p.TEXTURE_2D,t,r,r,p.UNSIGNED_BYTE,a)),h(o,u)&&p.generateMipmap(p.TEXTURE_2D),this.setTexture2D(null,0),f.isAlphaPremultiplied=c,f.isRenderTexture=!1,f.width=o,f.height=u,this.nativeTextures.push(f),f},createFramebuffer:function(t,e,i,n){var s,r=this.gl,a=r.createFramebuffer();if(this.setFramebuffer(a),n){var o=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,o),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,o)}if(i.isRenderTexture=!0,i.isAlphaPremultiplied=!1,r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,i,0),(s=r.checkFramebufferStatus(r.FRAMEBUFFER))===r.FRAMEBUFFER_COMPLETE)return a.renderTexture=i,this.setFramebuffer(null),a;throw new Error("Framebuffer incomplete. Framebuffer status: "+{36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"}[s])},createProgram:function(t,e){var i=this.gl,n=i.createProgram(),s=i.createShader(i.VERTEX_SHADER),r=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(s,t),i.shaderSource(r,e),i.compileShader(s),i.compileShader(r),!i.getShaderParameter(s,i.COMPILE_STATUS))throw new Error("Failed to compile Vertex Shader:\n"+i.getShaderInfoLog(s));if(!i.getShaderParameter(r,i.COMPILE_STATUS))throw new Error("Failed to compile Fragment Shader:\n"+i.getShaderInfoLog(r));if(i.attachShader(n,s),i.attachShader(n,r),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw new Error("Failed to link program:\n"+i.getProgramInfoLog(n));return n},createVertexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setVertexBuffer(n),i.bufferData(i.ARRAY_BUFFER,t,e),this.setVertexBuffer(null),n},createIndexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setIndexBuffer(n),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t,e),this.setIndexBuffer(null),n},deleteTexture:function(t){var e=this.nativeTextures.indexOf(t);return-1!==e&&l(this.nativeTextures,e),this.gl.deleteTexture(t),this.currentTextures[0]!==t||this.game.pendingDestroy||this.setBlankTexture(!0),this},deleteFramebuffer:function(t){return this.gl.deleteFramebuffer(t),this},deleteProgram:function(t){return this.gl.deleteProgram(t),this},deleteBuffer:function(t){return this.gl.deleteBuffer(t),this},preRenderCamera:function(t){var e=t._cx,i=t._cy,n=t._cw,r=t._ch,a=this.pipelines.TextureTintPipeline,o=t.backgroundColor;if(t.renderToTexture){this.flush(),this.pushScissor(e,i,n,-r),this.setFramebuffer(t.framebuffer);var h=this.gl;h.clearColor(0,0,0,0),h.clear(h.COLOR_BUFFER_BIT),a.projOrtho(e,n+e,i,r+i,-1e3,1e3),t.mask&&(this.currentCameraMask.mask=t.mask,this.currentCameraMask.camera=t._maskCamera,t.mask.preRenderWebGL(this,t,t._maskCamera)),0<o.alphaGL&&a.drawFillRect(e,i,n+e,r+i,f.getTintFromFloats(o.redGL,o.greenGL,o.blueGL,1),o.alphaGL),t.emit(s.PRE_RENDER,t)}else this.pushScissor(e,i,n,r),t.mask&&(this.currentCameraMask.mask=t.mask,this.currentCameraMask.camera=t._maskCamera,t.mask.preRenderWebGL(this,t,t._maskCamera)),0<o.alphaGL&&a.drawFillRect(e,i,n,r,f.getTintFromFloats(o.redGL,o.greenGL,o.blueGL,1),o.alphaGL)},getCurrentStencilMask:function(){var t=null,e=this.maskStack,i=this.currentCameraMask;return 0<e.length?t=e[e.length-1]:i.mask&&i.mask.isStencil&&(t=i),t},postRenderCamera:function(t){this.setPipeline(this.pipelines.TextureTintPipeline);var e=this.pipelines.TextureTintPipeline;if(t.flashEffect.postRenderWebGL(e,f.getTintFromFloats),t.fadeEffect.postRenderWebGL(e,f.getTintFromFloats),t.dirty=!1,this.popScissor(),t.renderToTexture){if(e.flush(),this.setFramebuffer(null),t.emit(s.POST_RENDER,t),t.renderToGame){e.projOrtho(0,e.width,e.height,0,-1e3,1e3);var i=f.getTintAppendFloatAlpha;(t.pipeline?t.pipeline:e).batchTexture(t,t.glTexture,t.width,t.height,t.x,t.y,t.width,t.height,t.zoom,t.zoom,t.rotation,t.flipX,!t.flipY,1,1,0,0,0,0,t.width,t.height,i(t._tintTL,t._alphaTL),i(t._tintTR,t._alphaTR),i(t._tintBL,t._alphaBL),i(t._tintBR,t._alphaBR),t._isTinted&&t.tintFill,0,0,this.defaultCamera,null)}this.setBlankTexture(!0)}t.mask&&(this.currentCameraMask.mask=null,t.mask.postRenderWebGL(this,t._maskCamera))},preRender:function(){if(!this.contextLost){var t=this.gl,e=this.pipelines;if(t.bindFramebuffer(t.FRAMEBUFFER,null),this.config.clearBeforeRender){var i=this.config.backgroundColor;t.clearColor(i.redGL,i.greenGL,i.blueGL,i.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)}for(var n in t.enable(t.SCISSOR_TEST),e)e[n].onPreRender();this.currentScissor=[0,0,this.width,this.height],this.scissorStack=[this.currentScissor],this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.setPipeline(this.pipelines.TextureTintPipeline)}},render:function(t,e,i,n){if(!this.contextLost){var s=e.list,r=s.length,o=this.pipelines;for(var h in o)o[h].onRender(t,n);if(this.preRenderCamera(n),0===r)return this.setBlendMode(a.BlendModes.NORMAL),void this.postRenderCamera(n);this.currentType="";for(var u=this.currentMask,c=0;c<r;c++){var l=s[c];if(l.willRender(n)){l.blendMode!==this.currentBlendMode&&this.setBlendMode(l.blendMode);var d=l.mask;(u=this.currentMask).mask&&u.mask!==d&&u.mask.postRenderWebGL(this,u.camera),d&&u.mask!==d&&d.preRenderWebGL(this,l,n);var p=l.type;p!==this.currentType&&(this.newType=!0,this.currentType=p),this.nextTypeMatch=c<r-1&&s[c+1].type===this.currentType,l.renderWebGL(this,l,i,n),this.newType=!1}}(u=this.currentMask).mask&&u.mask.postRenderWebGL(this,u.camera),this.setBlendMode(a.BlendModes.NORMAL),this.postRenderCamera(n)}},postRender:function(){if(!this.contextLost){this.flush();var t=this.snapshotState;t.callback&&(m(this.canvas,t),t.callback=null);var e=this.pipelines;for(var i in e)e[i].onPostRender()}},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,t,e,i)},snapshotArea:function(t,e,i,n,s,r,a){var o=this.snapshotState;return o.callback=s,o.type=r,o.encoder=a,o.getPixel=!1,o.x=t,o.y=e,o.width=Math.min(i,this.gl.drawingBufferWidth),o.height=Math.min(n,this.gl.drawingBufferHeight),this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},snapshotFramebuffer:function(t,e,i,n,s,r,a,o,h,u,c){void 0===s&&(s=!1),void 0===r&&(r=0),void 0===a&&(a=0),void 0===o&&(o=e),void 0===h&&(h=i);var l=this.currentFramebuffer;this.snapshotArea(r,a,o,h,n,u,c);var d=this.snapshotState;return d.getPixel=s,d.isFramebuffer=!0,d.bufferWidth=e,d.bufferHeight=i,this.setFramebuffer(t),m(this.canvas,d),this.setFramebuffer(l),d.callback=null,d.isFramebuffer=!1,this},canvasToTexture:function(t,e,i,n){return void 0===i&&(i=!1),void 0===n&&(n=!1),e?this.updateCanvasTexture(t,e,n):this.createCanvasTexture(t,i,n)},createCanvasTexture:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=this.gl,s=n.NEAREST,r=n.NEAREST,a=t.width,o=t.height,u=n.CLAMP_TO_EDGE,c=h(a,o);return!e&&c&&(u=n.REPEAT),this.config.antialias&&(s=c?this.mipmapFilter:n.LINEAR,r=n.LINEAR),this.createTexture2D(0,s,r,u,u,n.RGBA,t,a,o,!0,!1,i)},updateCanvasTexture:function(t,e,i){void 0===i&&(i=!1);var n=this.gl,s=t.width,r=t.height;return 0<s&&0<r&&(this.setTexture2D(e,0),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,i),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),e.width=s,e.height=r,this.setTexture2D(null,0)),e},createVideoTexture:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=this.gl,s=n.NEAREST,r=n.NEAREST,a=t.videoWidth,o=t.videoHeight,u=n.CLAMP_TO_EDGE,c=h(a,o);return!e&&c&&(u=n.REPEAT),this.config.antialias&&(s=c?this.mipmapFilter:n.LINEAR,r=n.LINEAR),this.createTexture2D(0,s,r,u,u,n.RGBA,t,a,o,!0,!0,i)},updateVideoTexture:function(t,e,i){void 0===i&&(i=!1);var n=this.gl,s=t.videoWidth,r=t.videoHeight;return 0<s&&0<r&&(this.setTexture2D(e,0),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,i),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),e.width=s,e.height=r,this.setTexture2D(null,0)),e},setTextureFilter:function(t,e){var i=this.gl,n=[i.LINEAR,i.NEAREST][e];return this.setTexture2D(t,0),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,n),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,n),this.setTexture2D(null,0),this},setFloat1:function(t,e,i){return this.setProgram(t),this.gl.uniform1f(this.gl.getUniformLocation(t,e),i),this},setFloat2:function(t,e,i,n){return this.setProgram(t),this.gl.uniform2f(this.gl.getUniformLocation(t,e),i,n),this},setFloat3:function(t,e,i,n,s){return this.setProgram(t),this.gl.uniform3f(this.gl.getUniformLocation(t,e),i,n,s),this},setFloat4:function(t,e,i,n,s,r){return this.setProgram(t),this.gl.uniform4f(this.gl.getUniformLocation(t,e),i,n,s,r),this},setFloat1v:function(t,e,i){return this.setProgram(t),this.gl.uniform1fv(this.gl.getUniformLocation(t,e),i),this},setFloat2v:function(t,e,i){return this.setProgram(t),this.gl.uniform2fv(this.gl.getUniformLocation(t,e),i),this},setFloat3v:function(t,e,i){return this.setProgram(t),this.gl.uniform3fv(this.gl.getUniformLocation(t,e),i),this},setFloat4v:function(t,e,i){return this.setProgram(t),this.gl.uniform4fv(this.gl.getUniformLocation(t,e),i),this},setInt1:function(t,e,i){return this.setProgram(t),this.gl.uniform1i(this.gl.getUniformLocation(t,e),i),this},setInt2:function(t,e,i,n){return this.setProgram(t),this.gl.uniform2i(this.gl.getUniformLocation(t,e),i,n),this},setInt3:function(t,e,i,n,s){return this.setProgram(t),this.gl.uniform3i(this.gl.getUniformLocation(t,e),i,n,s),this},setInt4:function(t,e,i,n,s,r){return this.setProgram(t),this.gl.uniform4i(this.gl.getUniformLocation(t,e),i,n,s,r),this},setMatrix2:function(t,e,i,n){return this.setProgram(t),this.gl.uniformMatrix2fv(this.gl.getUniformLocation(t,e),i,n),this},setMatrix3:function(t,e,i,n){return this.setProgram(t),this.gl.uniformMatrix3fv(this.gl.getUniformLocation(t,e),i,n),this},setMatrix4:function(t,e,i,n){return this.setProgram(t),this.gl.uniformMatrix4fv(this.gl.getUniformLocation(t,e),i,n),this},getMaxTextures:function(){return this.config.maxTextures},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){for(var t=0;t<this.nativeTextures.length;t++)this.gl.deleteTexture(this.nativeTextures[t]);for(var e in this.nativeTextures=[],this.pipelines)this.pipelines[e].destroy(),delete this.pipelines[e];this.defaultCamera.destroy(),this.currentMask=null,this.currentCameraMask=null,this.canvas.removeEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoredHandler,!1),this.game=null,this.gl=null,this.canvas=null,this.maskStack=[],this.contextLost=!0,this.extensions={}}});t.exports=x},function(t,e,i){var n=i(12),s=i(20),r=i(4);t.exports=function(t,e){var i=t.getContext("experimental-webgl"),a=r(e,"callback"),o=r(e,"type","image/png"),h=r(e,"encoder",.92),u=r(e,"x",0),c=r(e,"y",0),l=r(e,"getPixel",!1),d=r(e,"isFramebuffer",!1),p=d?r(e,"bufferWidth",1):i.drawingBufferWidth,f=d?r(e,"bufferHeight",1):i.drawingBufferHeight;if(l){var m=new Uint8Array(4),g=d?c:f-c;i.readPixels(u,g,1,1,i.RGBA,i.UNSIGNED_BYTE,m),a.call(null,new s(m[0],m[1],m[2],m[3]/255))}else{var v=r(e,"width",p),y=r(e,"height",f),_=v*y*4,x=new Uint8Array(_);i.readPixels(u,f-c-y,v,y,i.RGBA,i.UNSIGNED_BYTE,x);for(var E=n.createWebGL(this,v,y),T=E.getContext("2d"),w=T.getImageData(0,0,v,y),S=w.data,b=0;b<y;b++)for(var A=0;A<v;A++){var C=4*((y-b)*v+A),O=d?_-4*(b*v+(v-A)):4*(b*v+A);S[0+O]=x[0+C],S[1+O]=x[1+C],S[2+O]=x[2+C],S[3+O]=x[3+C]}T.putImageData(w,0,0);var M=new Image;M.onerror=function(){a.call(null),n.remove(E)},M.onload=function(){a.call(null,M),n.remove(E)},M.src=E.toDataURL(o,h)}}},function(t,e,i){var n=i(0),s=i(456),r=i(457),a=i(47),o=new n({Extends:a,initialize:function(t){a.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:t.topology?t.topology:t.renderer.gl.TRIANGLES,vertShader:t.vertShader?t.vertShader:r,fragShader:t.fragShader?t.fragShader:s,vertexCapacity:t.vertexCapacity?t.vertexCapacity:3,vertexSize:t.vertexSize?t.vertexSize:2*Float32Array.BYTES_PER_ELEMENT,vertices:new Float32Array([-1,1,-1,-7,7,1]).buffer,attributes:[{name:"inPosition",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:0}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.maxQuads=1,this.resolutionDirty=!0},onBind:function(){a.prototype.onBind.call(this);var t=this.renderer,e=this.program;return this.resolutionDirty&&(t.setFloat2(e,"uResolution",this.width,this.height),t.setInt1(e,"uMainSampler",0),t.setInt1(e,"uMaskSampler",1),this.resolutionDirty=!1),this},resize:function(t,e,i){return a.prototype.resize.call(this,t,e,i),this.resolutionDirty=!0,this},beginMask:function(t,e,i){var n=this.renderer,s=this.gl;t.bitmapMask&&s&&(n.flush(),t.prevFramebuffer=n.currentFramebuffer,n.setFramebuffer(t.mainFramebuffer),s.disable(s.STENCIL_TEST),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),n.currentCameraMask.mask!==t&&(n.currentMask.mask=t,n.currentMask.camera=i))},endMask:function(t,e){var i=this.gl,n=this.renderer,s=t.bitmapMask;if(s&&i){n.flush(),n.setFramebuffer(t.maskFramebuffer),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),n.setBlendMode(0,!0),s.renderWebGL(n,s,0,e),n.flush(),n.setFramebuffer(t.prevFramebuffer);var r=n.getCurrentStencilMask();r?(i.enable(i.STENCIL_TEST),r.mask.applyStencil(n,r.camera,!0)):n.currentMask.mask=null,n.setPipeline(this),i.activeTexture(i.TEXTURE1),i.bindTexture(i.TEXTURE_2D,t.maskTexture),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.mainTexture),i.uniform1i(i.getUniformLocation(this.program,"uInvertMaskAlpha"),t.invertAlpha),i.drawArrays(this.topology,0,3)}}});t.exports=o},function(t,e,i){var n=i(0),s=i(458),r=i(71),a=10,o=new n({Extends:r,initialize:function(t){a=t.maxLights,t.fragShader=s.replace("%LIGHT_COUNT%",a.toString()),r.call(this,t),this.defaultNormalMap,this.inverseRotationMatrix=new Float32Array([1,0,0,0,1,0,0,0,1])},boot:function(){this.defaultNormalMap=this.game.textures.getFrame("__DEFAULT")},onBind:function(t){r.prototype.onBind.call(this);var e=this.renderer,i=this.program;return this.mvpUpdate(),e.setInt1(i,"uNormSampler",1),e.setFloat2(i,"uResolution",this.width,this.height),t&&this.setNormalMap(t),this},onRender:function(t,e){this.active=!1;var i=t.sys.lights;if(!i||i.lights.length<=0||!i.active)return this;var n=i.cull(e),s=Math.min(n.length,a);if(0===s)return this;this.active=!0;var r,o=this.renderer,h=this.program,u=e.matrix,c={x:0,y:0},l=o.height;for(r=0;r<a;++r)o.setFloat1(h,"uLights["+r+"].radius",0);for(o.setFloat4(h,"uCamera",e.x,e.y,e.rotation,e.zoom),o.setFloat3(h,"uAmbientLightColor",i.ambientColor.r,i.ambientColor.g,i.ambientColor.b),r=0;r<s;++r){var d=n[r],p="uLights["+r+"].";u.transformPoint(d.x,d.y,c),o.setFloat2(h,p+"position",c.x-e.scrollX*d.scrollFactorX*e.zoom,l-(c.y-e.scrollY*d.scrollFactorY*e.zoom)),o.setFloat3(h,p+"color",d.r,d.g,d.b),o.setFloat1(h,p+"intensity",d.intensity),o.setFloat1(h,p+"radius",d.radius)}return this.currentNormalMapRotation=null,this},batchTexture:function(t,e,i,n,s,r,a,o,h,u,c,l,d,p,f,m,g,v,y,_,x,E,T,w,S,b,A,C,O,M){var R;if(this.active)if(this.renderer.setPipeline(this),t.displayTexture?R=t.displayTexture.dataSource[t.displayFrame.sourceIndex]:t.texture?R=t.texture.dataSource[t.frame.sourceIndex]:t.tileset&&(R=Array.isArray(t.tileset)?t.tileset[0].image.dataSource[0]:t.tileset.image.dataSource[0]),R){this.setTexture2D(R.glTexture,1),this.setNormalMapRotation(c);var P=this._tempMatrix1,I=this._tempMatrix2,L=this._tempMatrix3,G=v/i+A,D=y/n+C,k=(v+_)/i+A,F=(y+x)/n+C,N=a,B=o,U=-m,V=-g;if(t.isCropped){var Y=t._crop;N=Y.width,B=Y.height,a=Y.width,o=Y.height;var z=v=Y.x,H=y=Y.y;l&&(z=_-Y.x-Y.width),d&&!e.isRenderTexture&&(H=x-Y.y-Y.height),G=z/i+A,D=H/n+C,k=(z+Y.width)/i+A,F=(H+Y.height)/n+C,U=-m+v,V=-g+y}l&&(N*=-1,U+=a),(d^=e.isRenderTexture?1:0)&&(B*=-1,V+=o);var j=U+N,W=V+B;I.applyITRS(s,r,c,h,u),P.copyFrom(O.matrix),M?(P.multiplyWithOffset(M,-O.scrollX*p,-O.scrollY*f),I.e=s,I.f=r):(I.e-=O.scrollX*p,I.f-=O.scrollY*f),P.multiply(I,L);var X=L.getX(U,V),Z=L.getY(U,V),K=L.getX(U,W),q=L.getY(U,W),J=L.getX(j,W),Q=L.getY(j,W),$=L.getX(j,V),tt=L.getY(j,V);O.roundPixels&&(X=Math.round(X),Z=Math.round(Z),K=Math.round(K),q=Math.round(q),J=Math.round(J),Q=Math.round(Q),$=Math.round($),tt=Math.round(tt)),this.setTexture2D(e,0),this.batchQuad(X,Z,K,q,J,Q,$,tt,G,D,k,F,E,T,w,S,b,e,0)}else console.warn("Normal map missing or invalid")},setNormalMap:function(t){var e;this.active&&t&&(t.texture&&(e=t.texture.dataSource[t.frame.sourceIndex]),e=e||this.defaultNormalMap,this.setTexture2D(e.glTexture,1),this.renderer.setPipeline(t.defaultPipeline))},setNormalMapRotation:function(t){if(t!==this.currentNormalMapRotation||0===this.batches.length){0<this.batches.length&&this.flush();var e=this.inverseRotationMatrix;if(t){var i=-t,n=Math.cos(i),s=Math.sin(i);e[1]=s,e[3]=-s,e[0]=e[4]=n}else e[0]=e[4]=1,e[1]=e[3]=0;this.renderer.setMatrix3(this.program,"uInverseRotationMatrix",!1,e),this.currentNormalMapRotation=t}},batchSprite:function(t,e,i){if(this.active){var n=t.texture.dataSource[t.frame.sourceIndex];n&&(this.renderer.setPipeline(this),this.setTexture2D(n.glTexture,1),this.setNormalMapRotation(t.rotation),r.prototype.batchSprite.call(this,t,e,i))}}});o.LIGHT_COUNT=a,t.exports=o},function(t,e){t.exports=["#define SHADER_NAME PHASER_TEXTURE_TINT_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 texel = vec4(outTint.rgb * outTint.a, outTint.a);"," vec4 color = texture;",""," if (outTintEffect == 0.0)"," {"," // Multiply texture tint"," color = texture * texel;"," }"," else if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.rgb * outTint.a, texture.a);"," color.a = texture.a * texel.a;"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_TEXTURE_TINT_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform mat4 uModelMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}","",""].join("\n")},function(t,e,i){var n=i(0),s=i(4),r=i(72),a=i(160),o=i(161),h=i(18),u=i(47),c=new n({Extends:u,Mixins:[r],initialize:function(t){var e=t.renderer.config;u.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:t.renderer.gl.TRIANGLE_STRIP,vertShader:s(t,"vertShader",o),fragShader:s(t,"fragShader",a),vertexCapacity:s(t,"vertexCapacity",6*e.batchSize),vertexSize:s(t,"vertexSize",5*Float32Array.BYTES_PER_ELEMENT+4*Uint8Array.BYTES_PER_ELEMENT),attributes:[{name:"inPosition",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:0},{name:"inTexCoord",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:2*Float32Array.BYTES_PER_ELEMENT},{name:"inTintEffect",size:1,type:t.renderer.gl.FLOAT,normalized:!1,offset:4*Float32Array.BYTES_PER_ELEMENT},{name:"inTint",size:4,type:t.renderer.gl.UNSIGNED_BYTE,normalized:!0,offset:5*Float32Array.BYTES_PER_ELEMENT}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.vertexViewU32=new Uint32Array(this.vertexData),this.maxQuads=e.batchSize,this.batches=[],this._tempMatrix1=new h,this._tempMatrix2=new h,this._tempMatrix3=new h,this.mvpInit()},onBind:function(){return u.prototype.onBind.call(this),this.mvpUpdate(),this},resize:function(t,e,i){return u.prototype.resize.call(this,t,e,i),this.projOrtho(0,this.width,this.height,0,-1e3,1e3),this},setTexture2D:function(t,e){return void 0===t&&(t=this.renderer.blankTexture.glTexture),void 0===e&&(e=0),this.requireTextureBatch(t,e)&&this.pushBatch(t,e),this},requireTextureBatch:function(t,e){var i=this.batches,n=i.length;return!(0<n&&(0<e?i[n-1].textures[e-1]:i[n-1].texture)===t)},pushBatch:function(t,e){if(0===e)this.batches.push({first:this.vertexCount,texture:t,textures:[]});else{var i=[];i[e-1]=t,this.batches.push({first:this.vertexCount,texture:null,textures:i})}},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t,e,i,n=this.gl,s=this.vertexCount,r=this.topology,a=this.vertexSize,o=this.renderer,h=this.batches,u=h.length,c=0,l=null;if(0===u||0===s)return this.flushLocked=!1,this;n.bufferSubData(n.ARRAY_BUFFER,0,this.bytes.subarray(0,s*a));for(var d=0;d<u-1;d++){if(l=h[d],t=h[d+1],0<l.textures.length){for(e=0;e<l.textures.length;++e)(i=l.textures[e])&&o.setTexture2D(i,1+e,!1);n.activeTexture(n.TEXTURE0)}c=t.first-l.first,null===l.texture||c<=0||(o.setTexture2D(l.texture,0,!1),n.drawArrays(r,l.first,c))}if(0<(l=h[u-1]).textures.length){for(e=0;e<l.textures.length;++e)(i=l.textures[e])&&o.setTexture2D(i,1+e,!1);n.activeTexture(n.TEXTURE0)}return c=s-l.first,l.texture&&0<c&&(o.setTexture2D(l.texture,0,!1),n.drawArrays(r,l.first,c)),this.vertexCount=0,h.length=0,this.flushLocked=!1,this}});t.exports=c},function(t,e,i){var n=i(14);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===n.CANVAS?i="Canvas":e.renderType===n.HEADLESS&&(i="Headless");var s,r=e.audio,a=t.device.audio;if(s=!a.webAudio||r&&r.disableWebAudio?r&&r.noAudio||!a.webAudio&&!a.audioData?"No Audio":"HTML5 Audio":"Web Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+n.VERSION+" / https://phaser.io");else{var o,h="",u=[h];Array.isArray(e.bannerBackgroundColor)?(e.bannerBackgroundColor.forEach((function(t){h=h.concat("%c "),u.push("background: "+t),o=t})),u[u.length-1]="color: "+e.bannerTextColor+"; background: "+o):(h=h.concat("%c "),u.push("color: "+e.bannerTextColor+"; background: "+e.bannerBackgroundColor)),u.push("background: #fff"),e.gameTitle&&(h=h.concat(e.gameTitle),e.gameVersion&&(h=h.concat(" v"+e.gameVersion)),e.hidePhaser||(h=h.concat(" / "))),e.hidePhaser||(h=h.concat("Phaser v"+n.VERSION+" ("+i+" | "+s+")")),h=h.concat(" %c "+e.gameURL),u[0]=h,console.log.apply(console,u)}}}},function(t,e,i){var n=i(0),s=i(2),r=i(1),a=i(460),o=new n({initialize:function(t,e){this.game=t,this.raf=new a,this.started=!1,this.running=!1,this.minFps=s(e,"min",5),this.targetFps=s(e,"target",60),this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=r,this.forceSetTimeOut=s(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=s(e,"deltaHistory",10),this.panicMax=s(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=s(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3;for(var e=this.framesThisSecond=0;e<this.deltaSmoothingMax;e++)this.deltaHistory[e]=Math.min(this._target,this.deltaHistory[e]);this.delta=0,this.deltaIndex=0,this._coolDown=this.panicMax},start:function(t){if(this.started)return this;this.started=!0,this.running=!0;for(var e=0;e<this.deltaSmoothingMax;e++)this.deltaHistory[e]=this._target;this.resetDelta(),this.startTime=window.performance.now(),this.callback=t,this.raf.start(this.step.bind(this),this.forceSetTimeOut,this._target)},step:function(){var t=window.performance.now(),e=(this.now=t)-this.lastTime;e<0&&(e=0),this.rawDelta=e;var i=this.deltaIndex,n=this.deltaHistory,s=this.deltaSmoothingMax,r=e,a=e;if(this.smoothStep){(0<this._coolDown||!this.inFocus)&&(this._coolDown--,r=Math.min(r,this._target)),r>this._min&&(r=n[i],r=Math.min(r,this._min)),n[i]=r,this.deltaIndex++,this.deltaIndex>s&&(this.deltaIndex=0);for(var o=a=0;o<s;o++)a+=n[o];a/=s}this.delta=a,this.time+=this.rawDelta,t>this.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=a/this._target;this.callback(t,a,h),this.lastTime=t,this.frame++},tick:function(){this.step()},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running||(t&&(this.startTime+=-this.lastTime+(this.lastTime+window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step())},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=o},function(t,e,i){var n=i(6);t.exports=function(t){var e,i=t.events;void 0!==document.hidden?e="visibilitychange":["webkit","moz","ms"].forEach((function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")})),e&&document.addEventListener(e,(function(t){document.hidden||"pause"===t.type?i.emit(n.HIDDEN):i.emit(n.VISIBLE)}),!1),window.onblur=function(){i.emit(n.BLUR)},window.onfocus=function(){i.emit(n.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},function(t,e,i){var n=i(0),s=i(464),r=new n({initialize:function(t,e){this.parent=t,(this.events=e)||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once("destroy",this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;n<t.length;n++)i.push(e[t[n]]);return i}return e[t]},getAll:function(){var t={};for(var e in this.list)this.list.hasOwnProperty(e)&&(t[e]=this.list[e]);return t},query:function(t){var e={};for(var i in this.list)this.list.hasOwnProperty(i)&&i.match(t)&&(e[i]=this.list[i]);return e},set:function(t,e){if(this._frozen)return this;if("string"==typeof t)return this.setValue(t,e);for(var i in t)this.setValue(i,t[i]);return this},inc:function(t,e){if(this._frozen)return this;void 0===e&&(e=1);var i=this.get(t);return void 0===i&&(i=0),this.set(t,i+e),this},toggle:function(t){return this._frozen||this.set(t,!this.get(t)),this},setValue:function(t,e){if(this._frozen)return this;if(this.has(t))this.values[t]=e;else{var i=this,n=this.list,r=this.events,a=this.parent;Object.defineProperty(this.values,t,{enumerable:!0,configurable:!0,get:function(){return n[t]},set:function(e){if(!i._frozen){var o=n[t];n[t]=e,r.emit(s.CHANGE_DATA,a,t,e,o),r.emit(s.CHANGE_DATA_KEY+t,a,e,o)}}}),n[t]=e,r.emit(s.SET_DATA,a,t,e)}return this},each:function(t,e){for(var i=[this.parent,null,void 0],n=1;n<arguments.length;n++)i.push(arguments[n]);for(var s in this.list)i[1]=s,i[2]=this.list[s],t.apply(e,i);return this},merge:function(t,e){for(var i in void 0===e&&(e=!0),t)t.hasOwnProperty(i)&&(e||!e&&!this.has(i))&&this.setValue(i,t[i]);return this},remove:function(t){if(this._frozen)return this;if(!Array.isArray(t))return this.removeValue(t);for(var e=0;e<t.length;e++)this.removeValue(t[e]);return this},removeValue:function(t){if(this.has(t)){var e=this.list[t];delete this.list[t],delete this.values[t],this.events.emit(s.REMOVE_DATA,this.parent,t,e)}return this},pop:function(t){var e=void 0;return!this._frozen&&this.has(t)&&(e=this.list[t],delete this.list[t],delete this.values[t],this.events.emit(s.REMOVE_DATA,this.parent,t,e)),e},has:function(t){return this.list.hasOwnProperty(t)},setFreeze:function(t){return this._frozen=t,this},reset:function(){for(var t in this.list)delete this.list[t],delete this.values[t];return this._frozen=!1,this},destroy:function(){this.reset(),this.events.off(s.CHANGE_DATA),this.events.off(s.SET_DATA),this.events.off(s.REMOVE_DATA),this.parent=null},freeze:{get:function(){return this._frozen},set:function(t){this._frozen=!!t}},count:{get:function(){var t=0;for(var e in this.list)void 0!==this.list[e]&&t++;return t}}});t.exports=r},function(t,e,i){var n=i(0),s=i(74),r=i(3),a=i(21),o=i(6),h=i(168),u=i(169),c=i(170),l=i(171),d=i(18),p=i(148),f=new n({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new r,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new u(this):null,this.touch=e.inputTouch?new l(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers,e.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++){var n=new c(this,i);n.smoothFactor=e.inputSmoothFactor,this.pointers.push(n)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new d,this._tempMatrix2=new d,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(o.BOOT,this.boot,this)},boot:function(){this.canvas=this.game.canvas,this.scaleManager=this.game.scale,this.events.emit(a.MANAGER_BOOT),this.game.events.on(o.PRE_RENDER,this.preRender,this),this.game.events.once(o.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(a.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(a.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(a.MANAGER_UPDATE);for(var n=0;n<i.length;n++){var s=i[n];if(s.sys.input&&s.sys.input.updatePoll(t,e)&&this.globalTopOnly)return}},setDefaultCursor:function(t){this.defaultCursor=t,this.canvas.style.cursor!==t&&(this.canvas.style.cursor=t)},setCursor:function(t){t.cursor&&(this.canvas.style.cursor=t.cursor)},resetCursor:function(t){t.cursor&&this.canvas&&(this.canvas.style.cursor=this.defaultCursor)},addPointer:function(t){void 0===t&&(t=1);var e=[];10<this.pointersTotal+t&&(t=10-this.pointersTotal);for(var i=0;i<t;i++){var n=this.pointers.length,s=new c(this,n);s.smoothFactor=this.config.inputSmoothFactor,this.pointers.push(s),this.pointersTotal++,e.push(s)}return e},updateInputPlugins:function(t,e){var i=this.game.scene.getScenes(!0,!0);this._tempSkip=!1;for(var n=0;n<i.length;n++){var s=i[n];if(s.sys.input&&(s.sys.input.update(t,e)&&this.globalTopOnly||this._tempSkip))return}},onTouchStart:function(t){for(var e=this.pointers,i=[],n=0;n<t.changedTouches.length;n++)for(var r=t.changedTouches[n],a=1;a<this.pointersTotal;a++){var o=e[a];if(!o.active){o.touchstart(r,t),this.activePointer=o,i.push(o);break}}this.updateInputPlugins(s.TOUCH_START,i)},onTouchMove:function(t){for(var e=this.pointers,i=[],n=0;n<t.changedTouches.length;n++)for(var r=t.changedTouches[n],a=1;a<this.pointersTotal;a++){var o=e[a];if(o.active&&o.identifier===r.identifier){o.touchmove(r,t),this.activePointer=o,i.push(o);break}}this.updateInputPlugins(s.TOUCH_MOVE,i)},onTouchEnd:function(t){for(var e=this.pointers,i=[],n=0;n<t.changedTouches.length;n++)for(var r=t.changedTouches[n],a=1;a<this.pointersTotal;a++){var o=e[a];if(o.active&&o.identifier===r.identifier){o.touchend(r,t),i.push(o);break}}this.updateInputPlugins(s.TOUCH_END,i)},onTouchCancel:function(t){for(var e=this.pointers,i=[],n=0;n<t.changedTouches.length;n++)for(var r=t.changedTouches[n],a=1;a<this.pointersTotal;a++){var o=e[a];if(o.active&&o.identifier===r.identifier){o.touchcancel(r,t),i.push(o);break}}this.updateInputPlugins(s.TOUCH_CANCEL,i)},onMouseDown:function(t){this.mousePointer.down(t),this.mousePointer.updateMotion(),this.updateInputPlugins(s.MOUSE_DOWN,this.mousePointerContainer)},onMouseMove:function(t){this.mousePointer.move(t),this.mousePointer.updateMotion(),this.updateInputPlugins(s.MOUSE_MOVE,this.mousePointerContainer)},onMouseUp:function(t){this.mousePointer.up(t),this.mousePointer.updateMotion(),this.updateInputPlugins(s.MOUSE_UP,this.mousePointerContainer)},onMouseWheel:function(t){this.mousePointer.wheel(t),this.updateInputPlugins(s.MOUSE_WHEEL,this.mousePointerContainer)},onPointerLockChange:function(t){var e=this.mouse.locked;this.mousePointer.locked=e,this.events.emit(a.POINTERLOCK_CHANGE,t,e)},inputCandidate:function(t,e){var i=t.input;if(!i||!i.enabled||!i.alwaysEnabled&&!t.willRender(e))return!1;var n=!0,s=t.parentContainer;if(s)do{if(!s.willRender(e)){n=!1;break}s=s.parentContainer}while(s);return n},hitTest:function(t,e,i,n){void 0===n&&(n=this._tempHitTest);var s=this._tempPoint,r=i.scrollX,a=i.scrollY;n.length=0;var o=t.x,h=t.y;1!==i.resolution&&(o+=i._x,h+=i._y),i.getWorldPoint(o,h,s),t.worldX=s.x,t.worldY=s.y;for(var u={x:0,y:0},c=this._tempMatrix,l=this._tempMatrix2,d=0;d<e.length;d++){var f=e[d];if(this.inputCandidate(f,i)){var m=s.x+r*f.scrollFactorX-r,g=s.y+a*f.scrollFactorY-a;f.parentContainer?(f.getWorldTransformMatrix(c,l),c.applyInverse(m,g,u)):p(m,g,f.x,f.y,f.rotation,f.scaleX,f.scaleY,u),this.pointWithinHitArea(f,u.x,u.y)&&n.push(f)}}return n},pointWithinHitArea:function(t,e,i){e+=t.displayOriginX,i+=t.displayOriginY;var n=t.input;return!(!n||!n.hitAreaCallback(n.hitArea,e,i,t)||(n.localX=e,n.localY=i,0))},pointWithinInteractiveObject:function(t,e,i){return!!t.hitArea&&(e+=t.gameObject.displayOriginX,i+=t.gameObject.displayOriginY,t.localX=e,t.localY=i,t.hitAreaCallback(t.hitArea,e,i,t))},transformPointer:function(t,e,i,n){var s=t.position,r=t.prevPosition;r.x=s.x,r.y=s.y;var a=this.scaleManager.transformX(e),o=this.scaleManager.transformY(i),h=t.smoothFactor;n&&0!==h?(s.x=a*h+r.x*(1-h),s.y=o*h+r.y*(1-h)):(s.x=a,s.y=o)},destroy:function(){this.events.removeAllListeners(),this.game.events.off(o.PRE_RENDER),this.keyboard&&this.keyboard.destroy(),this.mouse&&this.mouse.destroy(),this.touch&&this.touch.destroy();for(var t=0;t<this.pointers.length;t++)this.pointers[t].destroy();this.pointers=[],this._tempHitTest=[],this._tempMatrix.destroy(),this.canvas=null,this.game=null}});t.exports=f},function(t,e,i){var n=i(48),s=i(0),r=i(6),a=i(21),o=i(49),h=i(1),u=new s({initialize:function(t){this.manager=t,this.queue=[],this.preventDefault=!0,this.captures=[],this.enabled=!1,this.target,this.onKeyDown=h,this.onKeyUp=h,t.events.once(a.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputKeyboard,this.target=t.inputKeyboardEventTarget,this.addCapture(t.inputKeyboardCapture),!this.target&&window&&(this.target=window),this.enabled&&this.target&&this.startListeners(),this.manager.game.events.on(r.POST_STEP,this.postUpdate,this)},startListeners:function(){var t=this;this.onKeyDown=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.useQueue||t.manager.events.emit(a.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&-1<t.captures.indexOf(e.keyCode)&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.useQueue||t.manager.events.emit(a.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&-1<t.captures.indexOf(e.keyCode)&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i<t.length;i++){var n=t[i];"string"==typeof n&&(n=o[n.trim().toUpperCase()]),-1===e.indexOf(n)&&e.push(n)}this.preventDefault=0<e.length},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i<t.length;i++){var s=t[i];"string"==typeof s&&(s=o[s.toUpperCase()]),n(e,s)}this.preventDefault=0<e.length},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(r.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=u},function(t,e,i){var n=i(0),s=i(65),r=i(21),a=i(1),o=new n({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=a,this.onMouseDown=a,this.onMouseUp=a,this.onMouseDownWindow=a,this.onMouseUpWindow=a,this.onMouseOver=a,this.onMouseOut=a,this.onMouseWheel=a,this.pointerLockChange=a,t.events.once(r.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.capture=t.inputMouseCapture,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},requestPointerLock:function(){if(s.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){s.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var t=this,e=this.manager.canvas,i=window&&window.focus&&this.manager.game.config.autoFocus;this.onMouseMove=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseMove(e),t.capture&&e.preventDefault())},this.onMouseDown=function(n){i&&window.focus(),!n.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseDown(n),t.capture&&n.target===e&&n.preventDefault())},this.onMouseDownWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onMouseDown(i)},this.onMouseUp=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseUp(i),t.capture&&i.target===e&&i.preventDefault())},this.onMouseUpWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onMouseUp(i)},this.onMouseOver=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOver(e)},this.onMouseOut=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOut(e)},this.onMouseWheel=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.onMouseWheel(e)};var n=this.target;if(n){var r={passive:!0},a={passive:!1};n.addEventListener("mousemove",this.onMouseMove,this.capture?a:r),n.addEventListener("mousedown",this.onMouseDown,this.capture?a:r),n.addEventListener("mouseup",this.onMouseUp,this.capture?a:r),n.addEventListener("mouseover",this.onMouseOver,this.capture?a:r),n.addEventListener("mouseout",this.onMouseOut,this.capture?a:r),n.addEventListener("wheel",this.onMouseWheel,this.capture?a:r),window&&this.manager.game.config.inputWindowEvents&&(window.addEventListener("mousedown",this.onMouseDownWindow,a),window.addEventListener("mouseup",this.onMouseUpWindow,a)),s.pointerLock&&(this.pointerLockChange=function(e){var i=t.target;t.locked=document.pointerLockElement===i||document.mozPointerLockElement===i||document.webkitPointerLockElement===i,t.manager.onPointerLockChange(e)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mouseover",this.onMouseOver),t.removeEventListener("mouseout",this.onMouseOut),window&&(window.removeEventListener("mousedown",this.onMouseDownWindow),window.removeEventListener("mouseup",this.onMouseUpWindow)),s.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=o},function(t,e,i){var n=i(139),s=i(0),r=i(68),a=i(61),o=i(144),h=i(7),u=new s({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new h,this.prevPosition=new h,this.midPoint=new h(-1,-1),this.velocity=new h,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(t){var e=this.x,i=this.y;1!==t.resolution&&(e+=t._x,i+=t._y);var n=t.getWorldPoint(e,i);return this.worldX=n.x,this.worldY=n.y,this},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},updateMotion:function(){var t=this.position.x,e=this.position.y,i=this.midPoint.x,s=this.midPoint.y;if(t!==i||e!==s){var r=o(this.motionFactor,i,t),h=o(this.motionFactor,s,e);a(r,t,.1)&&(r=t),a(h,e,.1)&&(h=e),this.midPoint.set(r,h);var u=t-r,c=e-h;this.velocity.set(u,c),this.angle=n(r,h,t,e),this.distance=Math.sqrt(u*u+c*c)}},up:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=t.timeStamp),this.isDown=!1,this.wasTouch=!1},down:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=t.timeStamp),this.isDown=!0,this.wasTouch=!1},move:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.locked&&(this.movementX=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.moveTime=t.timeStamp,this.wasTouch=!1},wheel:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.deltaZ=t.deltaZ,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=e,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(t,e){this.event=e,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.moveTime=e.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return!!(1&this.buttons)},rightButtonDown:function(){return!!(2&this.buttons)},middleButtonDown:function(){return!!(4&this.buttons)},backButtonDown:function(){return!!(8&this.buttons)},forwardButtonDown:function(){return!!(16&this.buttons)},leftButtonReleased:function(){return 0===this.button&&!this.isDown},rightButtonReleased:function(){return 2===this.button&&!this.isDown},middleButtonReleased:function(){return 1===this.button&&!this.isDown},backButtonReleased:function(){return 3===this.button&&!this.isDown},forwardButtonReleased:function(){return 4===this.button&&!this.isDown},getDistance:function(){return this.isDown?r(this.downX,this.downY,this.x,this.y):r(this.downX,this.downY,this.upX,this.upY)},getDistanceX:function(){return this.isDown?Math.abs(this.downX-this.x):Math.abs(this.downX-this.upX)},getDistanceY:function(){return this.isDown?Math.abs(this.downY-this.y):Math.abs(this.downY-this.upY)},getDuration:function(){return this.isDown?this.manager.time-this.downTime:this.upTime-this.downTime},getAngle:function(){return this.isDown?n(this.downX,this.downY,this.x,this.y):n(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,n=this.prevPosition.y,s=this.position.x,r=this.position.y,a=0;a<t;a++){var h=1/t*a;e[a]={x:o(h,i,s),y:o(h,n,r)}}return e},destroy:function(){this.camera=null,this.manager=null,this.position=null},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},time:{get:function(){return this.event?this.event.timeStamp:0}}});t.exports=u},function(t,e,i){var n=i(0),s=i(21),r=i(1),a=new n({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=r,this.onTouchStartWindow=r,this.onTouchMove=r,this.onTouchEnd=r,this.onTouchEndWindow=r,this.onTouchCancel=r,this.onTouchCancelWindow=r,this.onTouchOver=r,this.onTouchOut=r,t.events.once(s.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputTouch,this.target=t.inputTouchEventTarget,this.capture=t.inputTouchCapture,this.target||(this.target=this.manager.game.canvas),t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},startListeners:function(){var t=this,e=this.manager.canvas,i=window&&window.focus&&this.manager.game.config.autoFocus;this.onTouchStart=function(n){i&&window.focus(),!n.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchStart(n),t.capture&&n.cancelable&&n.target===e&&n.preventDefault())},this.onTouchStartWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onTouchStart(i)},this.onTouchMove=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchMove(e),t.capture&&e.cancelable&&e.preventDefault())},this.onTouchEnd=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchEnd(i),t.capture&&i.cancelable&&i.target===e&&i.preventDefault())},this.onTouchEndWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onTouchEnd(i)},this.onTouchCancel=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchCancel(e),t.capture&&e.preventDefault())},this.onTouchCancelWindow=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.onTouchCancel(e)},this.onTouchOver=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOver(e)},this.onTouchOut=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOut(e)};var n=this.target;if(n){var s={passive:!0},r={passive:!1};n.addEventListener("touchstart",this.onTouchStart,this.capture?r:s),n.addEventListener("touchmove",this.onTouchMove,this.capture?r:s),n.addEventListener("touchend",this.onTouchEnd,this.capture?r:s),n.addEventListener("touchcancel",this.onTouchCancel,this.capture?r:s),n.addEventListener("touchover",this.onTouchOver,this.capture?r:s),n.addEventListener("touchout",this.onTouchOut,this.capture?r:s),window&&this.manager.game.config.inputWindowEvents&&(window.addEventListener("touchstart",this.onTouchStartWindow,r),window.addEventListener("touchend",this.onTouchEndWindow,r),window.addEventListener("touchcancel",this.onTouchCancelWindow,r)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("touchmove",this.onTouchMove),t.removeEventListener("touchend",this.onTouchEnd),t.removeEventListener("touchcancel",this.onTouchCancel),t.removeEventListener("touchover",this.onTouchOver),t.removeEventListener("touchout",this.onTouchOut),window&&(window.removeEventListener("touchstart",this.onTouchStartWindow),window.removeEventListener("touchend",this.onTouchEndWindow))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=a},function(t,e,i){var n=i(0),s=i(6),r=i(3),a=i(25),o=i(173),h=i(36),u=i(4),c=i(10),l=i(48),d=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted?this.boot():t.events.once(s.BOOT,this.boot,this)},boot:function(){var t,e,i,n,r,a,o,h=this.game.config,c=h.installGlobalPlugins;for(c=c.concat(this._pendingGlobal),t=0;t<c.length;t++)e=c[t],i=u(e,"key",null),n=u(e,"plugin",null),r=u(e,"start",!1),a=u(e,"mapping",null),o=u(e,"data",null),i&&(n?this.install(i,n,r,a,o):console.warn("Missing `plugin` for key: "+i));for(c=(c=h.installScenePlugins).concat(this._pendingScene),t=0;t<c.length;t++)e=c[t],i=u(e,"key",null),n=u(e,"plugin",null),a=u(e,"mapping",null),i&&(n?this.installScenePlugin(i,n,a):console.warn("Missing `plugin` for key: "+i));this._pendingGlobal=[],this._pendingScene=[],this.game.events.once(s.DESTROY,this.destroy,this)},addToScene:function(t,e,i){var n,s,r,a=this.game,o=t.scene,h=t.settings.map,u=t.settings.isBooted;for(n=0;n<e.length;n++)a[s=e[n]]?(t[s]=a[s],h.hasOwnProperty(s)&&(o[h[s]]=t[s])):"game"===s&&h.hasOwnProperty(s)&&(o[h[s]]=a);for(var l=0;l<i.length;l++)for(r=i[l],n=0;n<r.length;n++)if(s=r[n],c.hasCore(s)){var d=c.getCore(s),p=new d.plugin(o,this);t[d.mapping]=p,d.custom?o[d.mapping]=p:h.hasOwnProperty(d.mapping)&&(o[h[d.mapping]]=p),u&&p.boot()}for(r=this.plugins,n=0;n<r.length;n++){var f=r[n];f.mapping&&(o[f.mapping]=f.plugin)}},getDefaultScenePlugins:function(){var t=this.game.config.defaultPlugins;return t.concat(this.scenePlugins)},installScenePlugin:function(t,e,i,n,s){if(void 0===s&&(s=!1),"function"==typeof e){if(c.hasCore(t)){if(!s&&c.hasCore(t))return void console.warn("Scene Plugin key in use: "+t)}else c.register(t,e,i,!0),this.scenePlugins.push(t);if(n){var r=new e(n,this);n.sys[t]=r,i&&""!==i&&(n[i]=r),r.boot()}}else console.warn("Invalid Scene Plugin: "+t)},install:function(t,e,i,n,s){if(void 0===i&&(i=!1),void 0===n&&(n=null),void 0===s&&(s=null),"function"!=typeof e)return console.warn("Invalid Plugin: "+t),null;if(c.hasCustom(t))return console.warn("Plugin key in use: "+t),null;if(null!==n&&(i=!0),this.game.isBooted){if(c.registerCustom(t,e,n,s),i)return this.start(t)}else this._pendingGlobal.push({key:t,plugin:e,start:i,mapping:n,data:s});return null},getIndex:function(t){for(var e=this.plugins,i=0;i<e.length;i++)if(e[i].key===t)return i;return-1},getEntry:function(t){var e=this.getIndex(t);if(-1!==e)return this.plugins[e]},isActive:function(t){var e=this.getEntry(t);return e&&e.active},start:function(t,e){void 0===e&&(e=t);var i=this.getEntry(e);return i&&!i.active?(i.active=!0,i.plugin.start()):i=i||this.createEntry(t,e),i?i.plugin:null},createEntry:function(t,e){var i=c.getCustom(t);if(i){var n=new i.plugin(this);i={key:e,plugin:n,active:!0,mapping:i.mapping,data:i.data},this.plugins.push(i),n.init(i.data),n.start()}return i},stop:function(t){var e=this.getEntry(t);return e&&e.active&&(e.active=!1,e.plugin.stop()),this},get:function(t,e){void 0===e&&(e=!0);var i=this.getEntry(t);if(i)return i.plugin;var n=this.getClass(t);return n&&e?(i=this.createEntry(t,t))?i.plugin:null:n||null},getClass:function(t){return c.getCustomClass(t)},removeGlobalPlugin:function(t){var e=this.getEntry(t);e&&l(this.plugins,e),c.removeCustom(t)},removeScenePlugin:function(t){l(this.scenePlugins,t),c.remove(t)},registerGameObject:function(t,e,i){return e&&h.register(t,e),i&&o.register(t,i),this},removeGameObject:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),e&&h.remove(t),i&&o.remove(t),this},registerFileType:function(t,e,i){a.register(t,e),i&&i.sys.load&&(i.sys.load[t]=e)},destroy:function(){for(var t=0;t<this.plugins.length;t++)this.plugins[t].plugin.destroy();c.destroyCustomPlugins(),this.game.noReturn&&c.destroyCorePlugins(),this.game=null,this.plugins=[],this.scenePlugins=[]}});t.exports=d},function(t,e,i){var n=i(0),s=i(10),r=i(11),a=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.displayList,this.updateList,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.systems.events.once(r.DESTROY,this.destroy,this)},start:function(){this.systems.events.once(r.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.systems.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},s.register("GameObjectCreator",a,"make"),t.exports=a},function(t,e,i){var n=i(75),s=i(0),r=i(3),a=i(33),o=i(6),h=i(516),u=i(517),c=i(518),l=i(1),d=i(23),p=i(519),f=i(45),m=i(7),g=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.canvas,this.canvasBounds=new d,this.parent=null,this.parentIsWindow=!1,this.parentSize=new p,this.gameSize=new p,this.baseSize=new p,this.displaySize=new p,this.scaleMode=n.SCALE_MODE.NONE,this.resolution=1,this.zoom=1,this._resetZoom=!1,this.displayScale=new m(1,1),this.autoRound=!1,this.autoCenter=n.CENTER.NO_CENTER,this.orientation=n.ORIENTATION.LANDSCAPE,this.fullscreen,this.fullscreenTarget=null,this._createdFullscreenTarget=!1,this.dirty=!1,this.resizeInterval=500,this._lastCheck=0,this._checkOrientation=!1,this.listeners={orientationChange:l,windowResize:l,fullScreenChange:l,fullScreenError:l}},preBoot:function(){this.parseConfig(this.game.config),this.game.events.once("boot",this.boot,this)},boot:function(){var t=this.game;this.canvas=t.canvas,this.fullscreen=t.device.fullscreen,this.scaleMode!==n.SCALE_MODE.RESIZE&&this.displaySize.setAspectMode(this.scaleMode),this.scaleMode===n.SCALE_MODE.NONE?this.resize(this.width,this.height):(this.getParentBounds(),0<this.parentSize.width&&0<this.parentSize.height&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(o.PRE_STEP,this.step,this),t.events.once(o.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,s=t.scaleMode,r=t.resolution,a=t.zoom,o=t.autoRound;if("string"==typeof e){var h=this.parentSize.width;0===h&&(h=window.innerWidth);var u=parseInt(e,10)/100;e=Math.floor(h*u)}if("string"==typeof i){var l=this.parentSize.height;0===l&&(l=window.innerHeight);var d=parseInt(i,10)/100;i=Math.floor(l*d)}this.resolution=1,this.scaleMode=s,this.autoRound=o,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,o&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),a===n.ZOOM.MAX_ZOOM&&(a=this.getMaxZoom()),1!==(this.zoom=a)&&(this._resetZoom=!0),this.baseSize.setSize(e*r,i*r),o&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),0<t.minWidth&&this.displaySize.setMin(t.minWidth*a,t.minHeight*a),0<t.maxWidth&&this.displaySize.setMax(t.maxWidth*a,t.maxHeight*a),this.displaySize.setSize(e,i),this.orientation=c(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=u(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==n.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();!this.parentIsWindow&&0!==i.height||(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=u(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=h(!0));var i=this.resolution,n=e.width*i,s=e.height*i;return(t.width!==n||t.height!==s)&&(t.setSize(n,s),!0)},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e.call(screen,t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound,n=this.resolution;i&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,r=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t*n,e*n),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(t/e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(s,r)},resize:function(t,e){var i=this.zoom,n=this.resolution,s=this.autoRound;s&&(t=Math.floor(t),e=Math.floor(e));var r=this.width,a=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t*n,e*n),s&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i*n,e*i*n),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var o=this.canvas.style,h=t*i,u=e*i;return s&&(h=Math.floor(h),u=Math.floor(u)),h===t&&u===e||(o.width=h+"px",o.height=u+"px"),this.refresh(r,a)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var n=this.canvas.style,s=i.style;s.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",s.marginLeft=n.marginLeft,s.marginTop=n.marginTop}return this.emit(a.RESIZE,this.gameSize,this.baseSize,this.displaySize,this.resolution,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=c(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(a.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,s=this.gameSize.width,r=this.gameSize.height,a=this.zoom,o=this.autoRound;this.scaleMode===n.SCALE_MODE.NONE?(this.displaySize.setSize(s*a*1,r*a*1),t=this.displaySize.width/1,e=this.displaySize.height/1,o&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1)):this.scaleMode===n.SCALE_MODE.RESIZE?(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(1*this.displaySize.width,1*this.displaySize.height),t=this.displaySize.width/1,e=this.displaySize.height/1,o&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e):(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),t=this.displaySize.width/1,e=this.displaySize.height/1,o&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px"),this.getParentBounds(),this.updateCenter()},getMaxZoom:function(){var t=f(this.parentSize.width,this.gameSize.width,0,!0),e=f(this.parentSize.height,this.gameSize.height,0,!0);return Math.max(Math.min(t,e),1)},updateCenter:function(){var t=this.autoCenter;if(t!==n.CENTER.NO_CENTER){var e=this.canvas,i=e.style,s=e.getBoundingClientRect(),r=s.width,a=s.height,o=Math.floor((this.parentSize.width-r)/2),h=Math.floor((this.parentSize.height-a)/2);t===n.CENTER.CENTER_HORIZONTALLY?h=0:t===n.CENTER.CENTER_VERTICALLY&&(o=0),i.marginLeft=o+"px",i.marginTop=h+"px"}},updateBounds:function(){var t=this.canvasBounds,e=this.canvas.getBoundingClientRect();t.x=e.left+(window.pageXOffset||0)-(document.documentElement.clientLeft||0),t.y=e.top+(window.pageYOffset||0)-(document.documentElement.clientTop||0),t.width=e.width,t.height=e.height},transformX:function(t){return(t-this.canvasBounds.left)*this.displayScale.x},transformY:function(t){return(t-this.canvasBounds.top)*this.displayScale.y},startFullscreen:function(t){void 0===t&&(t={navigationUI:"hide"});var e=this.fullscreen;if(e.available){if(!e.active){var i=this.getFullscreenTarget();e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT):i[e.request](t)}}else this.emit(a.FULLSCREEN_UNSUPPORTED)},fullscreenSuccessHandler:function(){this.getParentBounds(),this.refresh(),this.emit(a.ENTER_FULLSCREEN)},fullscreenErrorHandler:function(t){this.removeFullscreenTarget(),this.emit(a.FULLSCREEN_FAILED,t)},getFullscreenTarget:function(){if(!this.fullscreenTarget){var t=document.createElement("div");t.style.margin="0",t.style.padding="0",t.style.width="100%",t.style.height="100%",this.fullscreenTarget=t,this._createdFullscreenTarget=!0}return this._createdFullscreenTarget&&(this.canvas.parentNode.insertBefore(this.fullscreenTarget,this.canvas),this.fullscreenTarget.appendChild(this.canvas)),this.fullscreenTarget},removeFullscreenTarget:function(){if(this._createdFullscreenTarget){var t=this.fullscreenTarget;if(t&&t.parentNode){var e=t.parentNode;e.insertBefore(this.canvas,t),e.removeChild(t)}}},stopFullscreen:function(){var t=this.fullscreen;if(!t.available)return this.emit(a.FULLSCREEN_UNSUPPORTED),!1;t.active&&document[t.cancel](),this.removeFullscreenTarget(),this.getParentBounds(),this.emit(a.LEAVE_FULLSCREEN),this.refresh()},toggleFullscreen:function(t){this.fullscreen.active?this.stopFullscreen():this.startFullscreen(t)},startListeners:function(){var t=this,e=this.listeners;e.orientationChange=function(){t._checkOrientation=!0,t.dirty=!0},e.windowResize=function(){t.dirty=!0},window.addEventListener("orientationchange",e.orientationChange,!1),window.addEventListener("resize",e.windowResize,!1),this.fullscreen.available&&(e.fullScreenChange=function(e){return t.onFullScreenChange(e)},e.fullScreenError=function(e){return t.onFullScreenError(e)},["webkit","moz",""].forEach((function(t){document.addEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.addEventListener(t+"fullscreenerror",e.fullScreenError,!1)})),document.addEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.addEventListener("MSFullscreenError",e.fullScreenError,!1))},onFullScreenChange:function(){document.fullscreenElement||document.webkitFullscreenElement||document.msFullscreenElement||document.mozFullScreenElement?this.fullscreenSuccessHandler():this.stopFullscreen()},onFullScreenError:function(){this.removeFullscreenTarget()},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.listeners;window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1),["webkit","moz",""].forEach((function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)})),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===n.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===n.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=g},function(t,e){t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},function(t,e){t.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},function(t,e){t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5}},function(t,e){t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},function(t,e,i){var n=i(0),s=i(50),r=i(11),a=i(6),o=i(2),h=i(76),u=i(1),c=i(180),l=i(77),d=new n({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++)this._pending.push({key:"default",scene:e[i],autoStart:0===i,data:{}})}t.events.once(a.READY,this.bootQueue,this)},bootQueue:function(){if(!this.isBooted){var t,e,i,n;for(t=0;t<this._pending.length;t++){var s;i=(e=this._pending[t]).key,(n=e.scene)instanceof c?s=this.createSceneFromInstance(i,n):"object"==typeof n?s=this.createSceneFromObject(i,n):"function"==typeof n&&(s=this.createSceneFromFunction(i,n)),i=s.sys.settings.key,this.keys[i]=s,this.scenes.push(s),this._data[i]&&(s.sys.settings.data=this._data[i].data,this._data[i].autoStart&&(e.autoStart=!0)),(e.autoStart||s.sys.settings.active)&&this._start.push(i)}for(this._pending.length=0,this._data={},this.isBooted=!0,t=0;t<this._start.length;t++)e=this._start[t],this.start(e);this._start.length=0}},processQueue:function(){var t=this._pending.length,e=this._queue.length;if(0!==t||0!==e){var i,n;if(t){for(i=0;i<t;i++)n=this._pending[i],this.add(n.key,n.scene,n.autoStart,n.data);for(i=0;i<this._start.length;i++)n=this._start[i],this.start(n);return this._start.length=0,void(this._pending.length=0)}for(i=0;i<this._queue.length;i++)this[(n=this._queue[i]).op](n.keyA,n.keyB);this._queue.length=0}},add:function(t,e,i,n){return void 0===i&&(i=!1),void 0===n&&(n={}),this.isProcessing||!this.isBooted?(this._pending.push({key:t,scene:e,autoStart:i,data:n}),this.isBooted||(this._data[t]={data:n}),null):(t=this.getKey(t,e),e instanceof c?s=this.createSceneFromInstance(t,e):"object"==typeof e?(e.key=t,s=this.createSceneFromObject(t,e)):"function"==typeof e&&(s=this.createSceneFromFunction(t,e)),s.sys.settings.data=n,t=s.sys.settings.key,this.keys[t]=s,this.scenes.push(s),(i||s.sys.settings.active)&&(this._pending.length?this._start.push(t):this.start(t)),s);var s},remove:function(t){if(this.isProcessing)this._queue.push({op:"remove",keyA:t,keyB:null});else{var e=this.getScene(t);if(!e||e.sys.isTransitioning())return this;var i=this.scenes.indexOf(e),n=e.sys.settings.key;-1<i&&(delete this.keys[n],this.scenes.splice(i,1),-1<this._start.indexOf(n)&&(i=this._start.indexOf(n),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,n=i.settings;i.sceneUpdate=u,t.init&&(t.init.call(t,n.data),n.status=s.INIT,n.isTransition&&i.events.emit(r.TRANSITION_INIT,n.transitionFrom,n.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),0===e.list.size?this.create(t):(n.status=s.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start())):this.create(t)},loadComplete:function(t){var e=t.scene;this.game.sound&&this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(e)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;0<=i;i--){var n=this.scenes[i].sys;n.settings.status>s.START&&n.settings.status<=s.RUNNING&&n.step(t,e)}},render:function(t){for(var e=0;e<this.scenes.length;e++){var i=this.scenes[e].sys;i.settings.visible&&i.settings.status>=s.LOADING&&i.settings.status<s.SLEEPING&&i.render(t)}this.isProcessing=!1},create:function(t){var e=t.sys,i=e.settings;t.create&&(i.status=s.CREATING,t.create.call(t,i.data),i.status===s.DESTROYED)||(i.isTransition&&e.events.emit(r.TRANSITION_START,i.transitionFrom,i.transitionDuration),t.update&&(e.sceneUpdate=t.update),i.status=s.RUNNING,e.events.emit(r.CREATE,t))},createSceneFromFunction:function(t,e){var i=new e;if(i instanceof c){var n=i.sys.settings.key;if(""!==n&&(t=n),this.keys.hasOwnProperty(t))throw new Error("Cannot add a Scene with duplicate key: "+t);return this.createSceneFromInstance(t,i)}return i.sys=new l(i),i.sys.settings.key=t,i.sys.init(this.game),i},createSceneFromInstance:function(t,e){return""===e.sys.settings.key&&(e.sys.settings.key=t),e.sys.init(this.game),e},createSceneFromObject:function(t,e){var i=new c(e),n=i.sys.settings.key;""!==n?t=n:i.sys.settings.key=t,i.sys.init(this.game);for(var s=["init","preload","create","update","render"],r=0;r<s.length;r++){var a=o(e,s[r],null);a&&(i[s[r]]=a)}if(e.hasOwnProperty("extend"))for(var h in e.extend)if(e.extend.hasOwnProperty(h)){var u=e.extend[h];"data"===h&&i.hasOwnProperty("data")&&"object"==typeof u?i.data.merge(u):"sys"!==h&&(i[h]=u)}return i},getKey:function(t,e){if(t=t||"default","function"==typeof e)return t;if(e instanceof c?t=e.sys.settings.key:"object"==typeof e&&e.hasOwnProperty("key")&&(t=e.key),this.keys.hasOwnProperty(t))throw new Error("Cannot add a Scene with duplicate key: "+t);return t},getScenes:function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!1);for(var i=[],n=this.scenes,s=0;s<n.length;s++){var r=n[s];r&&(!t||t&&r.sys.isActive())&&i.push(r)}return e?i.reverse():i},getScene:function(t){if("string"==typeof t){if(this.keys[t])return this.keys[t]}else for(var e=0;e<this.scenes.length;e++)if(t===this.scenes[e])return t;return null},isActive:function(t){var e=this.getScene(t);return e?e.sys.isActive():null},isPaused:function(t){var e=this.getScene(t);return e?e.sys.isPaused():null},isVisible:function(t){var e=this.getScene(t);return e?e.sys.isVisible():null},isSleeping:function(t){var e=this.getScene(t);return e?e.sys.isSleeping():null},pause:function(t,e){var i=this.getScene(t);return i&&i.sys.pause(e),this},resume:function(t,e){var i=this.getScene(t);return i&&i.sys.resume(e),this},sleep:function(t,e){var i=this.getScene(t);return i&&!i.sys.isTransitioning()&&i.sys.sleep(e),this},wake:function(t,e){var i=this.getScene(t);return i&&i.sys.wake(e),this},run:function(t,e){var i=this.getScene(t);if(!i){for(var n=0;n<this._pending.length;n++)if(this._pending[n].key===t){this.queueOp("start",t,e);break}return this}i.sys.isSleeping()?i.sys.wake(e):i.sys.isPaused()?i.sys.resume(e):this.start(t,e)},start:function(t,e){if(!this.isBooted)return this._data[t]={autoStart:!0,data:e},this;var i=this.getScene(t);if(i){var n;if(i.sys.isActive()||i.sys.isPaused())i.sys.shutdown(),i.sys.start(e);else if(i.sys.start(e),i.sys.load&&(n=i.sys.load),n&&i.sys.settings.hasOwnProperty("pack")&&(n.reset(),n.addPack({payload:i.sys.settings.pack})))return i.sys.settings.status=s.LOADING,n.once(h.COMPLETE,this.payloadComplete,this),n.start(),this;this.bootScene(i)}return this},stop:function(t,e){var i=this.getScene(t);return i&&!i.sys.isTransitioning()&&i.sys.shutdown(e),this},switch:function(t,e){var i=this.getScene(t),n=this.getScene(e);return i&&n&&i!==n&&(this.sleep(t),this.isSleeping(e)?this.wake(e):this.start(e)),this},getAt:function(t){return this.scenes[t]},getIndex:function(t){var e=this.getScene(t);return this.scenes.indexOf(e)},bringToTop:function(t){if(this.isProcessing)this._queue.push({op:"bringToTop",keyA:t,keyB:null});else{var e=this.getIndex(t);if(-1!==e&&e<this.scenes.length){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.push(i)}}return this},sendToBack:function(t){if(this.isProcessing)this._queue.push({op:"sendToBack",keyA:t,keyB:null});else{var e=this.getIndex(t);if(-1!==e&&0<e){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(0<e){var i=e-1,n=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=n}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e<this.scenes.length-1){var i=e+1,n=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=n}}return this},moveAbove:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"moveAbove",keyA:t,keyB:e});else{var i=this.getIndex(t),n=this.getIndex(e);if(-1!==i&&-1!==n){var s=this.getAt(n);this.scenes.splice(n,1),this.scenes.splice(i+1,0,s)}}return this},moveBelow:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"moveBelow",keyA:t,keyB:e});else{var i=this.getIndex(t),n=this.getIndex(e);if(-1!==i&&-1!==n){var s=this.getAt(n);this.scenes.splice(n,1),0===i?this.scenes.unshift(s):this.scenes.splice(i,0,s)}}return this},queueOp:function(t,e,i){return this._queue.push({op:t,keyA:e,keyB:i}),this},swapPosition:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"swapPosition",keyA:t,keyB:e});else{var i=this.getIndex(t),n=this.getIndex(e);if(i!==n&&-1!==i&&-1!==n){var s=this.getAt(i);this.scenes[i]=this.scenes[n],this.scenes[n]=s}}return this},dump:function(){for(var t=[],e=["pending","init","start","loading","creating","running","paused","sleeping","shutdown","destroyed"],i=0;i<this.scenes.length;i++){var n=this.scenes[i].sys,r=!n.settings.visible||n.settings.status!==s.RUNNING&&n.settings.status!==s.PAUSED?"[-] ":"[*] ";r+=n.settings.key+" ("+e[n.settings.status]+")",t.push(r)}console.log(t.join("\n"))},destroy:function(){for(var t=0;t<this.scenes.length;t++)this.scenes[t].sys.destroy();this.update=u,this.scenes=[],this._pending=[],this._start=[],this._queue=[],this.game=null}});t.exports=d},function(t,e,i){var n=i(0),s=i(77),r=new n({initialize:function(t){this.sys=new s(this,t),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins},update:function(){}});t.exports=r},function(t,e,i){var n=i(50),s=i(2),r=i(182),a=i(532),o={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:n.PENDING,key:s(t,"key",""),active:s(t,"active",!1),visible:s(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:s(t,"pack",!1),cameras:s(t,"cameras",null),map:s(t,"map",r(a,s(t,"mapAdd",{}))),physics:s(t,"physics",{}),loader:s(t,"loader",{}),plugins:s(t,"plugins",!1),input:s(t,"input",{})}}};t.exports=o},function(t,e,i){var n=i(26);t.exports=function(t,e){var i=n(t);for(var s in e)i.hasOwnProperty(s)||(i[s]=e[s]);return i}},function(t,e,i){var n=i(12),s=i(184),r=i(0),a=i(20),o=i(14),h=i(3),u=i(46),c=i(6),l=i(533),d=i(2),p=i(186),f=i(79),m=new r({Extends:h,initialize:function(t){h.call(this),this.game=t,this.name="TextureManager",this.list={},this._tempCanvas=n.create2D(this,1,1),this._tempContext=this._tempCanvas.getContext("2d"),this._pending=0,t.events.once(c.BOOT,this.boot,this)},boot:function(){this._pending=2,this.on(u.LOAD,this.updatePending,this),this.on(u.ERROR,this.updatePending,this),this.addBase64("__DEFAULT",this.game.config.defaultImage),this.addBase64("__MISSING",this.game.config.missingImage),this.game.events.once(c.DESTROY,this.destroy,this)},updatePending:function(){this._pending--,0===this._pending&&(this.off(u.LOAD),this.off(u.ERROR),this.emit(u.READY))},checkKey:function(t){return!this.exists(t)||(console.error("Texture key already in use: "+t),!1)},remove:function(t){if("string"==typeof t){if(!this.exists(t))return console.warn("No texture found matching key: "+t),this;t=this.get(t)}return this.list.hasOwnProperty(t.key)&&(t.destroy(),this.emit(u.REMOVE,t.key)),this},removeKey:function(t){return this.list.hasOwnProperty(t)&&delete this.list[t],this},addBase64:function(t,e){if(this.checkKey(t)){var i=this,n=new Image;n.onerror=function(){i.emit(u.ERROR,t)},n.onload=function(){var e=i.create(t,n);p.Image(e,0),i.emit(u.ADD,t,e),i.emit(u.LOAD,t,e)},n.src=e}return this},getBase64:function(t,e,i,s){void 0===i&&(i="image/png"),void 0===s&&(s=.92);var r="",a=this.getFrame(t,e);if(a&&(a.source.isRenderTexture||a.source.isGLTexture))console.warn("Cannot getBase64 from WebGL Texture");else if(a){var o=a.canvasData,h=n.create2D(this,o.width,o.height);h.getContext("2d").drawImage(a.source.image,o.x,o.y,o.width,o.height,0,0,o.width,o.height),r=h.toDataURL(i,s),n.remove(h)}return r},addImage:function(t,e,i){var n=null;return this.checkKey(t)&&(n=this.create(t,e),p.Image(n,0),i&&n.setDataSource(i),this.emit(u.ADD,t,n)),n},addGLTexture:function(t,e,i,n){var s=null;return this.checkKey(t)&&((s=this.create(t,e,i,n)).add("__BASE",0,0,0,i,n),this.emit(u.ADD,t,s)),s},addRenderTexture:function(t,e){var i=null;return this.checkKey(t)&&((i=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),this.emit(u.ADD,t,i)),i},generate:function(t,e){if(this.checkKey(t)){var i=n.create(this,1,1);return e.canvas=i,l(e),this.addCanvas(t,i)}return null},createCanvas:function(t,e,i){if(void 0===e&&(e=256),void 0===i&&(i=256),this.checkKey(t)){var s=n.create(this,e,i,o.CANVAS,!0);return this.addCanvas(t,s)}return null},addCanvas:function(t,e,i){void 0===i&&(i=!1);var n=null;return i?n=new s(this,t,e,e.width,e.height):this.checkKey(t)&&(n=new s(this,t,e,e.width,e.height),this.list[t]=n,this.emit(u.ADD,t,n)),n},addAtlas:function(t,e,i,n){return Array.isArray(i.textures)||Array.isArray(i.frames)?this.addAtlasJSONArray(t,e,i,n):this.addAtlasJSONHash(t,e,i,n)},addAtlasJSONArray:function(t,e,i,n){var s=null;if(this.checkKey(t)){if(s=this.create(t,e),Array.isArray(i))for(var r=1===i.length,a=0;a<s.source.length;a++){var o=r?i[0]:i[a];p.JSONArray(s,a,o)}else p.JSONArray(s,0,i);n&&s.setDataSource(n),this.emit(u.ADD,t,s)}return s},addAtlasJSONHash:function(t,e,i,n){var s=null;if(this.checkKey(t)){if(s=this.create(t,e),Array.isArray(i))for(var r=0;r<i.length;r++)p.JSONHash(s,r,i[r]);else p.JSONHash(s,0,i);n&&s.setDataSource(n),this.emit(u.ADD,t,s)}return s},addAtlasXML:function(t,e,i,n){var s=null;return this.checkKey(t)&&(s=this.create(t,e),p.AtlasXML(s,0,i),n&&s.setDataSource(n),this.emit(u.ADD,t,s)),s},addUnityAtlas:function(t,e,i,n){var s=null;return this.checkKey(t)&&(s=this.create(t,e),p.UnityYAML(s,0,i),n&&s.setDataSource(n),this.emit(u.ADD,t,s)),s},addSpriteSheet:function(t,e,i){var n=null;if(this.checkKey(t)){var s=(n=this.create(t,e)).source[0].width,r=n.source[0].height;p.SpriteSheet(n,0,0,0,s,r,i),this.emit(u.ADD,t,n)}return n},addSpriteSheetFromAtlas:function(t,e){if(!this.checkKey(t))return null;var i=d(e,"atlas",null),n=d(e,"frame",null);if(i&&n){var s=this.get(i).get(n);if(s){var r=this.create(t,s.source.image);return s.trimmed?p.SpriteSheetFromAtlas(r,s,e):p.SpriteSheet(r,0,s.cutX,s.cutY,s.cutWidth,s.cutHeight,e),this.emit(u.ADD,t,r),r}}},create:function(t,e,i,n){var s=null;return this.checkKey(t)&&(s=new f(this,t,e,i,n),this.list[t]=s),s},exists:function(t){return this.list.hasOwnProperty(t)},get:function(t){return void 0===t&&(t="__DEFAULT"),this.list[t]?this.list[t]:t instanceof f?t:this.list.__MISSING},cloneFrame:function(t,e){if(this.list[t])return this.list[t].get(e).clone()},getFrame:function(t,e){if(this.list[t])return this.list[t].get(e)},getTextureKeys:function(){var t=[];for(var e in this.list)"__DEFAULT"!==e&&"__MISSING"!==e&&t.push(e);return t},getPixel:function(t,e,i,n){var s=this.getFrame(i,n);if(s){t-=s.x,e-=s.y;var r=s.data.cut;if(t+=r.x,e+=r.y,t>=r.x&&t<r.r&&e>=r.y&&e<r.b){var o=this._tempContext;o.clearRect(0,0,1,1),o.drawImage(s.source.image,t,e,1,1,0,0,1,1);var h=o.getImageData(0,0,1,1);return new a(h.data[0],h.data[1],h.data[2],h.data[3])}}return null},getPixelAlpha:function(t,e,i,n){var s=this.getFrame(i,n);if(s){t-=s.x,e-=s.y;var r=s.data.cut;if(t+=r.x,e+=r.y,t>=r.x&&t<r.r&&e>=r.y&&e<r.b){var a=this._tempContext;return a.clearRect(0,0,1,1),a.drawImage(s.source.image,t,e,1,1,0,0,1,1),a.getImageData(0,0,1,1).data[3]}}return null},setTexture:function(t,e,i){return this.list[e]&&(t.texture=this.list[e],t.frame=t.texture.get(i)),t},renameTexture:function(t,e){var i=this.get(t);return!(!i||t===e||(i.key=e,this.list[e]=i,delete this.list[t],0))},each:function(t,e){for(var i=[null],n=1;n<arguments.length;n++)i.push(arguments[n]);for(var s in this.list)i[0]=this.list[s],t.apply(e,i)},destroy:function(){for(var t in this.list)this.list[t].destroy();this.list={},this.game=null,n.remove(this._tempCanvas)}});t.exports=m},function(t,e,i){var n=i(0),s=i(5),r=i(20),a=i(14),o=i(44),h=i(79),u=new n({Extends:h,initialize:function(t,e,i,n,s){h.call(this,t,e,i,n,s),this.add("__BASE",0,0,0,n,s),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d"),this.width=n,this.height=s,this.imageData=this.context.getImageData(0,0,n,s),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this.manager.game.config.renderType===a.WEBGL&&this.refresh(),this},draw:function(t,e,i){return this.context.drawImage(i,t,e),this.update()},drawFrame:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0);var s=this.manager.getFrame(t,e);if(s){var r=s.canvasData,a=s.cutWidth,o=s.cutHeight,h=s.source.resolution;return this.context.drawImage(s.source.image,r.x,r.y,a,o,i,n,a/h,o/h),this.update()}return this},setPixel:function(t,e,i,n,s,r){if(void 0===r&&(r=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),-1<this.getIndex(t,e)){var a=this.context.getImageData(t,e,1,1);a.data[0]=i,a.data[1]=n,a.data[2]=s,a.data[3]=r,this.context.putImageData(a,t,e)}return this},putData:function(t,e,i,n,s,r,a){return void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=t.width),void 0===a&&(a=t.height),this.context.putImageData(t,e,i,n,s,r,a),this},getData:function(t,e,i,n){return t=s(Math.floor(t),0,this.width-1),e=s(Math.floor(e),0,this.height-1),i=s(i,1,this.width-t),n=s(n,1,this.height-e),this.context.getImageData(t,e,i,n)},getPixel:function(t,e,i){i=i||new r;var n=this.getIndex(t,e);if(-1<n){var s=this.data,a=s[n+0],o=s[n+1],h=s[n+2],u=s[n+3];i.setTo(a,o,h,u)}return i},getPixels:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===n&&(n=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var a=s(t,0,this.width),o=s(t+i,0,this.width),h=s(e,0,this.height),u=s(e+n,0,this.height),c=new r,l=[],d=h;d<u;d++){for(var p=[],f=a;f<o;f++)c=this.getPixel(f,d,c),p.push({x:f,y:d,color:c.color,alpha:c.alphaGL});l.push(p)}return l},getIndex:function(t,e){return t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e)),t<this.width&&e<this.height?4*(t+e*this.width):-1},refresh:function(){return this._source.update(),this},getCanvas:function(){return this.canvas},getContext:function(){return this.context},clear:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===n&&(n=this.height),this.context.clearRect(t,e,i,n),this.update()},setSize:function(t,e){return void 0===e&&(e=t),t===this.width&&e===this.height||(this.canvas.width=t,this.canvas.height=e,this._source.width=t,this._source.height=e,this._source.isPowerOf2=o(t,e),this.frames.__BASE.setSize(t,e,0,0),this.width=t,this.height=e,this.refresh()),this},destroy:function(){h.prototype.destroy.call(this),this._source=null,this.canvas=null,this.context=null,this.imageData=null,this.data=null,this.pixels=null,this.buffer=null}});t.exports=u},function(t,e,i){var n=i(12),s=i(0),r=i(44),a=i(98),o=new s({initialize:function(t,e,i,n,s){void 0===s&&(s=!1);var o=t.manager.game;this.renderer=o.renderer,this.texture=t,this.source=e,this.image=e,this.compressionAlgorithm=null,this.resolution=1,this.width=i||e.naturalWidth||e.videoWidth||e.width||0,this.height=n||e.naturalHeight||e.videoHeight||e.height||0,this.scaleMode=a.DEFAULT,this.isCanvas=e instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&e instanceof HTMLVideoElement,this.isRenderTexture="RenderTexture"===e.type,this.isGLTexture=window.hasOwnProperty("WebGLTexture")&&e instanceof WebGLTexture,this.isPowerOf2=r(this.width,this.height),this.glTexture=null,this.flipY=s,this.init(o)},init:function(t){this.renderer&&(this.renderer.gl?this.isCanvas?this.glTexture=this.renderer.createCanvasTexture(this.image,!1,this.flipY):this.isVideo?this.glTexture=this.renderer.createVideoTexture(this.image,!1,this.flipY):this.isRenderTexture?(this.image=this.source.canvas,this.glTexture=this.renderer.createTextureFromSource(null,this.width,this.height,this.scaleMode)):this.isGLTexture?this.glTexture=this.source:this.glTexture=this.renderer.createTextureFromSource(this.image,this.width,this.height,this.scaleMode):this.isRenderTexture&&(this.image=this.source.canvas)),t.config.antialias||this.setFilter(1)},setFilter:function(t){this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,t),this.scaleMode=t},setFlipY:function(t){return void 0===t&&(t=!0),this.flipY=t,this},update:function(){var t=this.renderer.gl;t&&this.isCanvas?this.glTexture=this.renderer.updateCanvasTexture(this.image,this.glTexture,this.flipY):t&&this.isVideo&&(this.glTexture=this.renderer.updateVideoTexture(this.image,this.glTexture,this.flipY))},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture),this.isCanvas&&n.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});t.exports=o},function(t,e,i){t.exports={AtlasXML:i(535),Canvas:i(536),Image:i(537),JSONArray:i(538),JSONHash:i(539),SpriteSheet:i(540),SpriteSheetFromAtlas:i(541),UnityYAML:i(542)}},function(t,e,i){var n=i(27);t.exports=function(t,e,i,s,r){void 0===s&&(s=0),void 0===r&&(r=t.length);var a=[];if(n(t,s,r))for(var o=s;o<r;o++){var h=t[o];(!e||e&&void 0===i&&h.hasOwnProperty(e)||e&&void 0!==i&&h[e]===i)&&a.push(h)}return a}},function(t,e,i){var n=i(27);t.exports=function(t,e,i,s,r){if(void 0===s&&(s=0),void 0===r&&(r=t.length),n(t,s,r))for(var a=s;a<r;a++){var o=t[a];if(!e||e&&void 0===i&&o.hasOwnProperty(e)||e&&void 0!==i&&o[e]===i)return o}return null}},function(t,e){for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(256),s=0;s<i.length;s++)n[i.charCodeAt(s)]=s;t.exports=function(t){var e,i,s,r,a=(t=t.substr(t.indexOf(",")+1)).length,o=.75*a,h=0;"="===t[a-1]&&(o--,"="===t[a-2]&&o--);for(var u=new ArrayBuffer(o),c=new Uint8Array(u),l=0;l<a;l+=4)e=n[t.charCodeAt(l)],i=n[t.charCodeAt(l+1)],s=n[t.charCodeAt(l+2)],r=n[t.charCodeAt(l+3)],c[h++]=e<<2|i>>4,c[h++]=(15&i)<<4|s>>2,c[h++]=(3&s)<<6|63&r;return u}},function(t,e){t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),s=0;s<i;s++){n[s]=new Array(e);for(var r=e-1;-1<r;r--)n[s][r]=t[r][s]}return n}},function(t,e){t.exports=function(t){for(var e=t.length-1;0<e;e--){var i=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t}},function(t,e,i){var n=i(83),s=i(29),r=i(0),a=i(17),o=i(193),h=i(22),u=i(23),c=i(621),l=i(624),d=i(7),p=new r({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.Transform,a.Visible,c],initialize:function(t,e,i,n){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this.tempTransformMatrix=new a.TransformMatrix,this._displayList=t.sys.displayList,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),n&&this.add(n)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new u),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(0<this.list.length){var i=this.list,n=new u,s=!1;t.setEmpty();for(var r=0;r<i.length;r++){var a=i[r];a.getBounds&&(a.getBounds(n),s?l(n,t,t):(t.setTo(n.x,n.y,n.width,n.height),s=!0))}}return t},addHandler:function(t){t.once(o.DESTROY,this.remove,this),this.exclusive&&(this._displayList.remove(t),t.parentContainer&&t.parentContainer.remove(t),t.parentContainer=this)},removeHandler:function(t){t.off(o.DESTROY,this.remove),this.exclusive&&(t.parentContainer=null)},pointToContainer:function(t,e){void 0===e&&(e=new d),this.parentContainer?this.parentContainer.pointToContainer(t,e):e=new d(t.x,t.y);var i=this.tempTransformMatrix;return i.applyITRS(this.x,this.y,this.rotation,this.scaleX,this.scaleY),i.invert(),i.transformPoint(t.x,t.y,e),e},getBoundsTransformMatrix:function(){return this.getWorldTransformMatrix(this.tempTransformMatrix,this.localTransform)},add:function(t){return n.Add(this.list,t,this.maxSize,this.addHandler,this),this},addAt:function(t,e){return n.AddAt(this.list,t,e,this.maxSize,this.addHandler,this),this},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t&&(void 0===e&&(e=function(e,i){return e[t]-i[t]}),n.StableSort.inplace(this.list,e)),this},getByName:function(t){return n.GetFirst(this.list,"name",t)},getRandom:function(t,e){return n.GetRandom(this.list,t,e)},getFirst:function(t,e,i,s){return n.GetFirst(this.list,t,e,i,s)},getAll:function(t,e,i,s){return n.GetAll(this.list,t,e,i,s)},count:function(t,e,i,s){return n.CountAllMatching(this.list,t,e,i,s)},swap:function(t,e){return n.Swap(this.list,t,e),this},moveTo:function(t,e){return n.MoveTo(this.list,t,e),this},remove:function(t,e){var i=n.Remove(this.list,t,this.removeHandler,this);if(e&&i){Array.isArray(i)||(i=[i]);for(var s=0;s<i.length;s++)i[s].destroy()}return this},removeAt:function(t,e){var i=n.RemoveAt(this.list,t,this.removeHandler,this);return e&&i&&i.destroy(),this},removeBetween:function(t,e,i){var s=n.RemoveBetween(this.list,t,e,this.removeHandler,this);if(i)for(var r=0;r<s.length;r++)s[r].destroy();return this},removeAll:function(t){var e=n.RemoveBetween(this.list,0,this.list.length,this.removeHandler,this);if(t)for(var i=0;i<e.length;i++)e[i].destroy();return this},bringToTop:function(t){return n.BringToTop(this.list,t),this},sendToBack:function(t){return n.SendToBack(this.list,t),this},moveUp:function(t){return n.MoveUp(this.list,t),this},moveDown:function(t){return n.MoveDown(this.list,t),this},reverse:function(){return this.list.reverse(),this},shuffle:function(){return n.Shuffle(this.list),this},replace:function(t,e,i){return n.Replace(this.list,t,e)&&(this.addHandler(e),this.removeHandler(t),i&&t.destroy()),this},exists:function(t){return-1<this.list.indexOf(t)},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){var i,n=[null],s=this.list.slice(),r=s.length;for(i=2;i<arguments.length;i++)n.push(arguments[i]);for(i=0;i<r;i++)n[0]=s[i],t.apply(e,n);return this},iterate:function(t,e){var i,n=[null];for(i=2;i<arguments.length;i++)n.push(arguments[i]);for(i=0;i<this.list.length;i++)n[0]=this.list[i],t.apply(e,n);return this},setScrollFactor:function(t,e,i){return void 0===e&&(e=t),void 0===i&&(i=!1),this.scrollFactorX=t,this.scrollFactorY=e,i&&(n.SetAll(this.list,"scrollFactorX",t),n.SetAll(this.list,"scrollFactorY",e)),this},length:{get:function(){return this.list.length}},first:{get:function(){return(this.position=0)<this.list.length?this.list[0]:null}},last:{get:function(){return 0<this.list.length?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position<this.list.length?(this.position++,this.list[this.position]):null}},previous:{get:function(){return 0<this.position?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null}});t.exports=p},function(t,e,i){t.exports={DESTROY:i(610),VIDEO_COMPLETE:i(611),VIDEO_CREATED:i(612),VIDEO_ERROR:i(613),VIDEO_LOOP:i(614),VIDEO_PLAY:i(615),VIDEO_SEEKED:i(616),VIDEO_SEEKING:i(617),VIDEO_STOP:i(618),VIDEO_TIMEOUT:i(619),VIDEO_UNLOCKED:i(620)}},function(t,e,i){var n=i(0),s=i(195),r=i(634),a=i(635),o=i(24),h=i(637),u=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=o.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},function(t,e){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var n=(e-t.x)/t.width,s=(i-t.y)/t.height;return(n*=n)+(s*=s)<.25}},function(t,e,i){var n=i(8);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=t.width/2,r=t.height/2;return i.x=t.x+s*Math.cos(e),i.y=t.y+r*Math.sin(e),i}},function(t,e,i){var n=i(86),s=i(87);t.exports=function(t,e,i,r,a,o,h){var u=e.commandBuffer,c=u.length,l=o||t.currentContext;if(0!==c&&s(t,l,e,r,a)){var d=1,p=1,f=0,m=0,g=1,v=0,y=0,_=0;l.beginPath();for(var x=0;x<c;++x)switch(u[x]){case n.ARC:l.arc(u[x+1],u[x+2],u[x+3],u[x+4],u[x+5],u[x+6]),x+=7;break;case n.LINE_STYLE:g=u[x+1],f=u[x+2],d=u[x+3],v=(16711680&f)>>>16,y=(65280&f)>>>8,_=255&f,l.strokeStyle="rgba("+v+","+y+","+_+","+d+")",l.lineWidth=g,x+=3;break;case n.FILL_STYLE:m=u[x+1],p=u[x+2],v=(16711680&m)>>>16,y=(65280&m)>>>8,_=255&m,l.fillStyle="rgba("+v+","+y+","+_+","+p+")",x+=2;break;case n.BEGIN_PATH:l.beginPath();break;case n.CLOSE_PATH:l.closePath();break;case n.FILL_PATH:h||l.fill();break;case n.STROKE_PATH:h||l.stroke();break;case n.FILL_RECT:h?l.rect(u[x+1],u[x+2],u[x+3],u[x+4]):l.fillRect(u[x+1],u[x+2],u[x+3],u[x+4]),x+=4;break;case n.FILL_TRIANGLE:l.beginPath(),l.moveTo(u[x+1],u[x+2]),l.lineTo(u[x+3],u[x+4]),l.lineTo(u[x+5],u[x+6]),l.closePath(),h||l.fill(),x+=6;break;case n.STROKE_TRIANGLE:l.beginPath(),l.moveTo(u[x+1],u[x+2]),l.lineTo(u[x+3],u[x+4]),l.lineTo(u[x+5],u[x+6]),l.closePath(),h||l.stroke(),x+=6;break;case n.LINE_TO:l.lineTo(u[x+1],u[x+2]),x+=2;break;case n.MOVE_TO:l.moveTo(u[x+1],u[x+2]),x+=2;break;case n.LINE_FX_TO:l.lineTo(u[x+1],u[x+2]),x+=5;break;case n.MOVE_FX_TO:l.moveTo(u[x+1],u[x+2]),x+=5;break;case n.SAVE:l.save();break;case n.RESTORE:l.restore();break;case n.TRANSLATE:l.translate(u[x+1],u[x+2]),x+=2;break;case n.SCALE:l.scale(u[x+1],u[x+2]),x+=2;break;case n.ROTATE:l.rotate(u[x+1]),x+=1;break;case n.GRADIENT_FILL_STYLE:x+=5;break;case n.GRADIENT_LINE_STYLE:x+=6;break;case n.SET_TEXTURE:x+=2}l.restore()}}},function(t,e,i){var n=i(73),s=i(12),r=i(0),a=i(17),o=i(6),h=i(22),u=i(640),c=i(2),l=i(641),d=i(642),p=i(645),f=new r({Extends:h,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Crop,a.Depth,a.Flip,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.ScrollFactor,a.Tint,a.Transform,a.Visible,d],initialize:function(t,e,i,n,r){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Text"),this.renderer=t.sys.game.renderer,this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.canvas=s.create(this),this.context=this.canvas.getContext("2d"),this.style=new p(this,r),this.autoRound=!0,this.splitRegExp=/(?:\r\n|\r|\n)/,this._text=void 0,this.padding={left:0,right:0,top:0,bottom:0},this.width=1,this.height=1,this.lineSpacing=0,this.dirty=!1,0===this.style.resolution&&(this.style.resolution=t.sys.game.config.resolution),this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.frame.source.resolution=this.style.resolution,this.renderer&&this.renderer.gl&&(this.renderer.deleteTexture(this.frame.source.glTexture),this.frame.source.glTexture=null),this.initRTL(),this.setText(n),r&&r.padding&&this.setPadding(r.padding),r&&r.lineSpacing&&this.setLineSpacing(r.lineSpacing),t.sys.game.events.on(o.CONTEXT_RESTORED,(function(){this.dirty=!0}),this)},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",n(this.canvas,this.scene.sys.canvas),this.originX=1)},runWordWrap:function(t){var e=this.style;if(e.wordWrapCallback){var i=e.wordWrapCallback.call(e.wordWrapCallbackScope,t,this);return Array.isArray(i)&&(i=i.join("\n")),i}return e.wordWrapWidth?e.wordWrapUseAdvanced?this.advancedWordWrap(t,this.context,this.style.wordWrapWidth):this.basicWordWrap(t,this.context,this.style.wordWrapWidth):t},advancedWordWrap:function(t,e,i){for(var n="",s=t.replace(/ +/gi," ").split(this.splitRegExp),r=s.length,a=0;a<r;a++){var o=s[a],h="";if(o=o.replace(/^ *|\s*$/gi,""),e.measureText(o).width<i)n+=o+"\n";else{for(var u=i,c=o.split(" "),l=0;l<c.length;l++){var d=c[l],p=d+" ",f=e.measureText(p).width;if(u<f){if(0===l){for(var m=p;m.length&&(m=m.slice(0,-1),!((f=e.measureText(m).width)<=u)););if(!m.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var g=d.substr(m.length);c[l]=g,h+=m}var v=c[l].length?l:l+1,y=c.slice(v).join(" ").replace(/[ \n]*$/gi,"");s[a+1]=y+" "+(s[a+1]||""),r=s.length;break}h+=p,u-=f}n+=h.replace(/[ \n]*$/gi,"")+"\n"}}return n.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var n="",s=t.split(this.splitRegExp),r=s.length-1,a=e.measureText(" ").width,o=0;o<=r;o++){for(var h=i,u=s[o].split(" "),c=u.length-1,l=0;l<=c;l++){var d=u[l],p=e.measureText(d).width,f=p+a;h<f&&0<l&&(n+="\n",h=i),n+=d,l<c?(n+=" ",h-=f):h-=p}o<r&&(n+="\n")}return n},getWrappedText:function(t){return void 0===t&&(t=this._text),this.style.syncFont(this.canvas,this.context),this.runWordWrap(t).split(this.splitRegExp)},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this._text&&(this._text=t.toString(),this.updateText()),this},setStyle:function(t){return this.style.setStyle(t)},setFont:function(t){return this.style.setFont(t)},setFontFamily:function(t){return this.style.setFontFamily(t)},setFontSize:function(t){return this.style.setFontSize(t)},setFontStyle:function(t){return this.style.setFontStyle(t)},setFixedSize:function(t,e){return this.style.setFixedSize(t,e)},setBackgroundColor:function(t){return this.style.setBackgroundColor(t)},setFill:function(t){return this.style.setFill(t)},setColor:function(t){return this.style.setColor(t)},setStroke:function(t,e){return this.style.setStroke(t,e)},setShadow:function(t,e,i,n,s,r){return this.style.setShadow(t,e,i,n,s,r)},setShadowOffset:function(t,e){return this.style.setShadowOffset(t,e)},setShadowColor:function(t){return this.style.setShadowColor(t)},setShadowBlur:function(t){return this.style.setShadowBlur(t)},setShadowStroke:function(t){return this.style.setShadowStroke(t)},setShadowFill:function(t){return this.style.setShadowFill(t)},setWordWrapWidth:function(t,e){return this.style.setWordWrapWidth(t,e)},setWordWrapCallback:function(t,e){return this.style.setWordWrapCallback(t,e)},setAlign:function(t){return this.style.setAlign(t)},setResolution:function(t){return this.style.setResolution(t)},setLineSpacing:function(t){return this.lineSpacing=t,this.updateText()},setPadding:function(t,e,i,n){if("object"==typeof t){var s=t,r=c(s,"x",null);i=null!==r?t=r:(t=c(s,"left",0),c(s,"right",t));var a=c(s,"y",null);n=null!==a?e=a:(e=c(s,"top",0),c(s,"bottom",e))}else void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=e);return this.padding.left=t,this.padding.top=e,this.padding.right=i,this.padding.bottom=n,this.updateText()},setMaxLines:function(t){return this.style.setMaxLines(t)},updateText:function(){var t=this.canvas,e=this.context,i=this.style,n=i.resolution,s=i.metrics;i.syncFont(t,e);var r=this._text;(i.wordWrapWidth||i.wordWrapCallback)&&(r=this.runWordWrap(this._text));var a,o=r.split(this.splitRegExp),h=u(this,s,o),c=this.padding;0===i.fixedWidth?(this.width=h.width+c.left+c.right,a=h.width):(this.width=i.fixedWidth,(a=this.width-c.left-c.right)<h.width&&(a=h.width)),0===i.fixedHeight?this.height=h.height+c.top+c.bottom:this.height=i.fixedHeight;var l,d,p=this.width,f=this.height;this.updateDisplayOrigin(),p*=n,f*=n,p=Math.max(p,1),f=Math.max(f,1),t.width!==p||t.height!==f?(t.width=p,t.height=f,this.frame.setSize(p,f),i.syncFont(t,e)):e.clearRect(0,0,p,f),e.save(),e.scale(n,n),i.backgroundColor&&(e.fillStyle=i.backgroundColor,e.fillRect(0,0,p,f)),i.syncStyle(t,e),e.textBaseline="alphabetic",e.translate(c.left,c.top);for(var m=0;m<h.lines;m++){if(l=i.strokeThickness/2,d=i.strokeThickness/2+m*h.lineHeight+s.ascent,0<m&&(d+=h.lineSpacing*m),i.rtl)l=p-l;else if("right"===i.align)l+=a-h.lineWidths[m];else if("center"===i.align)l+=(a-h.lineWidths[m])/2;else if("justify"===i.align&&.85<=h.lineWidths[m]/h.width){var g=h.width-h.lineWidths[m],v=e.measureText(" ").width,y=o[m].trim(),_=y.split(" ");g+=(o[m].length-y.length)*v;for(var x=Math.floor(g/v),E=0;0<x;)_[E]+=" ",E=(E+1)%(_.length-1||1),--x;o[m]=_.join(" ")}this.autoRound&&(l=Math.round(l),d=Math.round(d)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(o[m],l,d)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(o[m],l,d))}e.restore(),this.renderer&&this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0;var T=this.input;return T&&!T.customHitArea&&(T.hitArea.width=this.width,T.hitArea.height=this.height),this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=a.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},preDestroy:function(){this.style.rtl&&l(this.canvas),s.remove(this.canvas),this.texture.destroy()}});t.exports=f},function(t,e){t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}},function(t,e,i){var n=i(0),s=i(17),r=i(22),a=i(652),o=i(653),h=i(88),u=i(654),c=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Texture,s.Tint,s.Transform,s.Visible,u],initialize:function(t,e,i,n,s,o,h){void 0===s&&(s=""),void 0===h&&(h=0),r.call(this,t,"BitmapText"),this.font=n;var u=this.scene.sys.cache.bitmapFont.get(n);this.fontData=u.data,this._text="",this._fontSize=o||this.fontData.size,this._letterSpacing=0,this._align=h,this._bounds=a(),this._dirty=!0,this._maxWidth=0,this.wordWrapCharCode=32,this.setTexture(u.texture,u.frame),this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.setText(s)},setLeftAlign:function(){return this._align=c.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=c.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=c.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(t){return this._fontSize=t,this._dirty=!0,this},setLetterSpacing:function(t){return void 0===t&&(t=0),this._letterSpacing=t,this._dirty=!0,this},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this.text&&(this._text=t.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},getTextBounds:function(t){var e=this._bounds;return!this._dirty&&this.scaleX===e.scaleX&&this.scaleY===e.scaleY||(a(this,t,e),this._dirty=!1,this.updateDisplayOrigin()),e},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this._dirty=!0,this},setFont:function(t,e,i){if(void 0===e&&(e=this._fontSize),void 0===i&&(i=this._align),t!==this.font){var n=this.scene.sys.cache.bitmapFont.get(t);n&&(this.font=t,this.fontData=n.data,this._fontSize=e,this._align=i,this.setTexture(n.texture,n.frame),a(this,!1,this._bounds))}return this},setMaxWidth:function(t,e){return this._maxWidth=t,this._dirty=!0,void 0!==e&&(this.wordWrapCharCode=e),this},align:{set:function(t){this._align=t,this._dirty=!0},get:function(){return this._align}},text:{set:function(t){this.setText(t)},get:function(){return this._text}},fontSize:{set:function(t){this._fontSize=t,this._dirty=!0},get:function(){return this._fontSize}},letterSpacing:{set:function(t){this._letterSpacing=t,this._dirty=!0},get:function(){return this._letterSpacing}},maxWidth:{set:function(t){this._maxWidth=t,this._dirty=!0},get:function(){return this._maxWidth}},width:{get:function(){return this.getTextBounds(!1),this._bounds.global.width}},height:{get:function(){return this.getTextBounds(!1),this._bounds.global.height}},toJSON:function(){var t=s.ToJSON(this),e={font:this.font,text:this.text,fontSize:this.fontSize,letterSpacing:this.letterSpacing,align:this.align};return t.data=e,t}});c.ALIGN_LEFT=0,c.ALIGN_CENTER=1,c.ALIGN_RIGHT=2,c.ParseFromAtlas=o,c.ParseXMLBitmapFont=h,t.exports=c},function(t,e){t.exports=function(t,e,i){return{gameObject:t,enabled:!0,alwaysEnabled:!1,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragX:0,dragY:0}}},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value)<this.threshold?0:this.value},destroy:function(){this.pad=null,this.events=null}});t.exports=n},function(t,e,i){var n=i(0),s=i(89),r=new n({initialize:function(t,e){this.pad=t,this.events=t.manager,this.index=e,this.value=0,this.threshold=1,this.pressed=!1},update:function(t){this.value=t;var e=this.pad,i=this.index;t>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(s.BUTTON_DOWN,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(s.BUTTON_UP,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=r},function(t,e,i){var n=i(202),s=i(203),r=i(0),a=i(3),o=i(7),h=new r({Extends:a,initialize:function(t,e){a.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],r=0;r<e.buttons.length;r++)i.push(new s(this,r));this.buttons=i;var h=[];for(r=0;r<e.axes.length;r++)h.push(new n(this,r));this.axes=h,this.vibration=e.vibrationActuator;var u={value:0,pressed:!1};this._LCLeft=i[14]?i[14]:u,this._LCRight=i[15]?i[15]:u,this._LCTop=i[12]?i[12]:u,this._LCBottom=i[13]?i[13]:u,this._RCLeft=i[2]?i[2]:u,this._RCRight=i[1]?i[1]:u,this._RCTop=i[3]?i[3]:u,this._RCBottom=i[0]?i[0]:u,this._FBLeftTop=i[4]?i[4]:u,this._FBLeftBottom=i[6]?i[6]:u,this._FBRightTop=i[5]?i[5]:u,this._FBRightBottom=i[7]?i[7]:u;var c={value:0};this._HAxisLeft=h[0]?h[0]:c,this._VAxisLeft=h[1]?h[1]:c,this._HAxisRight=h[2]?h[2]:c,this._VAxisRight=h[3]?h[3]:c,this.leftStick=new o,this.rightStick=new o},getAxisTotal:function(){return this.axes.length},getAxisValue:function(t){return this.axes[t].getValue()},setAxisThreshold:function(t){for(var e=0;e<this.axes.length;e++)this.axes[e].threshold=t},getButtonTotal:function(){return this.buttons.length},getButtonValue:function(t){return this.buttons[t].value},isButtonDown:function(t){return this.buttons[t].pressed},update:function(t){var e,i=this.buttons,n=t.buttons,s=i.length;for(e=0;e<s;e++)i[e].update(n[e].value);var r=this.axes,a=t.axes;for(s=r.length,e=0;e<s;e++)r[e].update(a[e]);2<=s&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),4<=s&&this.rightStick.set(r[2].getValue(),r[3].getValue()))},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t<this.buttons.length;t++)this.buttons[t].destroy();for(t=0;t<this.axes.length;t++)this.axes[t].destroy();this.buttons=[],this.axes=[]},connected:{get:function(){return this.pad.connected}},timestamp:{get:function(){return this.pad.timestamp}},left:{get:function(){return this._LCLeft.pressed}},right:{get:function(){return this._LCRight.pressed}},up:{get:function(){return this._LCTop.pressed}},down:{get:function(){return this._LCBottom.pressed}},A:{get:function(){return this._RCBottom.pressed}},Y:{get:function(){return this._RCTop.pressed}},X:{get:function(){return this._RCLeft.pressed}},B:{get:function(){return this._RCRight.pressed}},L1:{get:function(){return this._FBLeftTop.value}},L2:{get:function(){return this._FBLeftBottom.value}},R1:{get:function(){return this._FBRightTop.value}},R2:{get:function(){return this._FBRightBottom.value}}});t.exports=h},function(t,e){t.exports=function(t,e,i){return 0<t.radius&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},function(t,e,i){var n=i(8);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},function(t,e){t.exports=function(t,e,i){var n=t.x3-t.x1,s=t.y3-t.y1,r=t.x2-t.x1,a=t.y2-t.y1,o=e-t.x1,h=i-t.y1,u=n*n+s*s,c=n*r+s*a,l=n*o+s*h,d=r*r+a*a,p=r*o+a*h,f=u*d-c*c,m=0==f?0:1/f,g=(d*l-c*p)*m,v=(u*p-c*l)*m;return 0<=g&&0<=v&&g+v<1}},function(t,e,i){var n=i(0),s=i(3),r=i(53),a=new n({Extends:s,initialize:function(t,e){s.call(this),this.plugin=t,this.keyCode=e,this.originalEvent=void 0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.location=0,this.timeDown=0,this.duration=0,this.timeUp=0,this.emitOnRepeat=!1,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1},setEmitOnRepeat:function(t){return this.emitOnRepeat=t,this},onDown:function(t){this.originalEvent=t,this.enabled&&(this.altKey=t.altKey,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.location=t.location,this.repeats++,this.isDown?this.emitOnRepeat&&this.emit(r.DOWN,this,t):(this.isDown=!0,this.isUp=!1,this.timeDown=t.timeStamp,this.duration=0,this._justDown=!0,this._justUp=!1,this.emit(r.DOWN,this,t)))},onUp:function(t){this.originalEvent=t,this.enabled&&(this.isDown=!1,this.isUp=!0,this.timeUp=t.timeStamp,this.duration=this.timeUp-this.timeDown,this.repeats=0,this._justDown=!1,this._justUp=!0,this._tick=-1,this.emit(r.UP,this,t))},reset:function(){return this.preventDefault=!0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1,this},getDuration:function(){return this.isDown?this.plugin.game.loop.time-this.timeDown:0},destroy:function(){this.removeAllListeners(),this.originalEvent=null,this.plugin=null}});t.exports=a},function(t,e,i){var n=i(0),s=i(53),r=i(4),a=i(693),o=i(695),h=new n({initialize:function(t,e,i){if(void 0===i&&(i={}),e.length<2)return!1;this.manager=t,this.enabled=!0,this.keyCodes=[];for(var n=0;n<e.length;n++){var h=e[n];"string"==typeof h?this.keyCodes.push(h.toUpperCase().charCodeAt(0)):"number"==typeof h?this.keyCodes.push(h):h.hasOwnProperty("keyCode")&&this.keyCodes.push(h.keyCode)}this.current=this.keyCodes[0],this.index=0,this.size=this.keyCodes.length,this.timeLastMatched=0,this.matched=!1,this.timeMatched=0,this.resetOnWrongKey=r(i,"resetOnWrongKey",!0),this.maxKeyDelay=r(i,"maxKeyDelay",0),this.resetOnMatch=r(i,"resetOnMatch",!1),this.deleteOnMatch=r(i,"deleteOnMatch",!1);var u=this;this.onKeyDown=function(t){!u.matched&&u.enabled&&a(t,u)&&(u.manager.emit(s.COMBO_MATCH,u,t),u.resetOnMatch?o(u):u.deleteOnMatch&&u.destroy())},this.manager.on(s.ANY_KEY_DOWN,this.onKeyDown)},progress:{get:function(){return this.index/this.size}},destroy:function(){this.enabled=!1,this.keyCodes=[],this.manager.off(s.ANY_KEY_DOWN,this.onKeyDown),this.manager=null}});t.exports=h},function(t,e,i){var n=i(0),s=i(38),r=i(90),a=i(25),o=i(4),h=i(16),u=new n({Extends:r,initialize:function t(e,i,n,s,a){var u,c="png";if(h(i)){var l=i;i=o(l,"key"),n=o(l,"url"),u=o(l,"normalMap"),s=o(l,"xhrSettings"),c=o(l,"extension",c),a=o(l,"frameConfig")}Array.isArray(n)&&(u=n[1],n=n[0]);var d={type:"image",cache:e.textureManager,extension:c,responseType:"blob",key:i,url:n,xhrSettings:s,config:a};if(r.call(this,e,d),u){var p=new t(e,this.key,u,s,a);p.type="normalMap",this.setLink(p),e.addFile(p)}},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){r.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(t.data),t.onProcessError()},r.createObjectURL(this.data,this.xhrLoader.response,"image/png")},addToCache:function(){var t,e=this.linkFile;e&&e.state===s.FILE_COMPLETE?(t="image"===this.type?this.cache.addImage(this.key,this.data,e.data):this.cache.addImage(e.key,e.data,this.data),this.pendingDestroy(t),e.pendingDestroy(t)):e||(t=this.cache.addImage(this.key,this.data),this.pendingDestroy(t))}});a.register("image",(function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new u(this,t[n]));else this.addFile(new u(this,t,e,i));return this})),t.exports=u},function(t,e,i){var n=i(13),s=i(91);t.exports=function(t,e){var i=void 0===t?s():n({},t);if(e)for(var r in e)void 0!==e[r]&&(i[r]=e[r]);return i}},function(t,e,i){var n=i(0),s=i(38),r=i(90),a=i(25),o=i(4),h=i(2),u=i(16),c=new n({Extends:r,initialize:function(t,e,i,n,a){var c="json";if(u(e)){var l=e;e=o(l,"key"),i=o(l,"url"),n=o(l,"xhrSettings"),c=o(l,"extension",c),a=o(l,"dataKey",a)}var d={type:"json",cache:t.cacheManager.json,extension:c,responseType:"text",key:e,url:i,xhrSettings:n,config:a};r.call(this,t,d),u(i)&&(this.data=a?h(i,a):i,this.state=s.FILE_POPULATED)},onProcess:function(){if(this.state!==s.FILE_POPULATED){this.state=s.FILE_PROCESSING;var t=JSON.parse(this.xhrLoader.responseText),e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});a.register("json",(function(t,e,i,n){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new c(this,t[s]));else this.addFile(new c(this,t,e,n,i));return this})),t.exports=c},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=n,this.complete=!1,this.pending=n.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var s=0;s<n.length;s++)n[s].multiFile=this},isReadyToProcess:function(){return 0===this.pending&&0===this.failed&&!this.complete},addToMultiFile:function(t){return this.files.push(t),(t.multiFile=this).pending++,this.complete=!1,this},onFileComplete:function(t){-1!==this.files.indexOf(t)&&this.pending--},onFileFailed:function(t){-1!==this.files.indexOf(t)&&this.failed++}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=n},function(t,e,i){var n=i(0),s=i(4),r=new n({initialize:function(t){this.delay=0,this.repeat=0,this.repeatCount=0,this.loop=!1,this.callback,this.callbackScope,this.args,this.timeScale=1,this.startAt=0,this.elapsed=0,this.paused=!1,this.hasDispatched=!1,this.reset(t)},reset:function(t){return this.delay=s(t,"delay",0),this.repeat=s(t,"repeat",0),this.loop=s(t,"loop",!1),this.callback=s(t,"callback",void 0),this.callbackScope=s(t,"callbackScope",this.callback),this.args=s(t,"args",[]),this.timeScale=s(t,"timeScale",1),this.startAt=s(t,"startAt",0),this.paused=s(t,"paused",!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=-1===this.repeat||this.loop?999999999999:this.repeat,this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(0<this.repeat){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},function(t,e,i){var n=i(727);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substr(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===n.indexOf(e)&&"_"!==e.substr(0,1)&&i.push({key:e,value:t[e]});return i}},function(t,e,i){var n=i(2);t.exports=function(t){var e=n(t,"tweens",null);return null===e?[]:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},function(t,e,i){var n=i(94),s=i(37),r=i(31),a=i(39),o=i(54),h=i(2),u=i(93),c=i(95),l=i(97);t.exports=function(t,e,i){void 0===i&&(i=n);var d=h(e,"from",0),p=h(e,"to",1),f=[{value:d}],m=o(e,"delay",i.delay),g=o(e,"duration",i.duration),v=h(e,"easeParams",i.easeParams),y=a(h(e,"ease",i.ease),v),_=o(e,"hold",i.hold),x=o(e,"repeat",i.repeat),E=o(e,"repeatDelay",i.repeatDelay),T=r(e,"yoyo",i.yoyo),w=[],S=u("value",p),b=l(f[0],0,"value",S.getEnd,S.getStart,S.getActive,y,m,g,T,_,x,E,!1,!1);b.start=d,b.current=d,b.to=p,w.push(b);var A=new c(t,w,f);A.offset=s(e,"offset",null),A.completeDelay=s(e,"completeDelay",0),A.loop=Math.round(s(e,"loop",0)),A.loopDelay=Math.round(s(e,"loopDelay",0)),A.paused=r(e,"paused",!1),A.useFrames=r(e,"useFrames",!1);for(var C=h(e,"callbackScope",A),O=[A,null],M=c.TYPES,R=0;R<M.length;R++){var P=M[R],I=h(e,P,!1);if(I){var L=h(e,P+"Scope",C),G=h(e,P+"Params",[]);A.setCallback(P,I,O.concat(G),L)}}return A}},function(t,e,i){var n=i(39),s=i(2),r=i(9);t.exports=function(t,e){void 0===e&&(e={});var i=s(e,"start",0),a=s(e,"ease",null),o=s(e,"grid",null),h=s(e,"from",0),u="first"===h,c="center"===h,l="last"===h,d="number"==typeof h,p=Array.isArray(t),f=p?parseFloat(t[0]):parseFloat(t),m=p?parseFloat(t[1]):0,g=Math.max(f,m);if(p&&(i+=f),o){var v=o[0],y=o[1],_=0,x=0,E=0,T=0,w=[];l?(_=v-1,x=y-1):d?(_=h%v,x=Math.floor(h/v)):c&&(_=(v-1)/2,x=(y-1)/2);for(var S=r.MIN_SAFE_INTEGER,b=0;b<y;b++){w[b]=[];for(var A=0;A<v;A++){E=_-A,T=x-b;var C=Math.sqrt(E*E+T*T);S<C&&(S=C),w[b][A]=C}}}var O=a?n(a):null;return o?function(t,e,n,s){var r,a=0,o=s%v,h=Math.floor(s/v);if(0<=o&&o<v&&0<=h&&h<y&&(a=w[h][o]),p){var u=m-f;r=O?a/S*u*O(a/S):a/S*u}else r=O?a*f*O(a/S):a*f;return r+i}:function(t,e,n,s,r){var a,o,v;return r--,u?a=s:c?a=Math.abs(r/2-s):l?a=r-s:d&&(a=Math.abs(h-s)),p?(v=c?(m-f)/r*(2*a):(m-f)/r*a,o=O?v*O(a/r):v):o=O?r*g*O(a/r):a*f,o+i}}},function(t,e,i){var n=i(26),s=i(94),r=i(37),a=i(31),o=i(39),h=i(54),u=i(92),c=i(217),l=i(2),d=i(221),p=i(55);t.exports=function(t,e){var i=new d(t);i.completeDelay=r(e,"completeDelay",0),i.loop=Math.round(r(e,"loop",0)),i.loopDelay=Math.round(r(e,"loopDelay",0)),i.paused=a(e,"paused",!1),i.useFrames=a(e,"useFrames",!1);var f=l(e,"callbackScope",i),m=[i],g=l(e,"onStart",!1);if(g){var v=l(e,"onStartScope",f),y=l(e,"onStartParams",[]);i.setCallback("onStart",g,m.concat(y),v)}var _=l(e,"onUpdate",!1);if(_){var x=l(e,"onUpdateScope",f),E=l(e,"onUpdateParams",[]);i.setCallback("onUpdate",_,m.concat(E),x)}var T=l(e,"onLoop",!1);if(T){var w=l(e,"onLoopScope",f),S=l(e,"onLoopParams",[]);i.setCallback("onLoop",T,m.concat(S),w)}var b=l(e,"onYoyo",!1);if(b){var A=l(e,"onYoyoScope",f),C=l(e,"onYoyoParams",[]);i.setCallback("onYoyo",b,m.concat(null,C),A)}var O=l(e,"onComplete",!1);if(O){var M=l(e,"onCompleteScope",f),R=l(e,"onCompleteParams",[]);i.setCallback("onComplete",O,m.concat(R),M)}var P=c(e);if(0===P.length)return i.paused=!0,i;var I=n(s);I.targets=u(e);var L=r(e,"totalDuration",0);I.duration=0<L?Math.floor(L/P.length):h(e,"duration",I.duration),I.delay=h(e,"delay",I.delay),I.easeParams=l(e,"easeParams",I.easeParams),I.ease=o(l(e,"ease",I.ease),I.easeParams),I.hold=h(e,"hold",I.hold),I.repeat=h(e,"repeat",I.repeat),I.repeatDelay=h(e,"repeatDelay",I.repeatDelay),I.yoyo=a(e,"yoyo",I.yoyo),I.flipX=a(e,"flipX",I.flipX),I.flipY=a(e,"flipY",I.flipY);for(var G=0;G<P.length;G++)i.queue(p(i,P[G],I));return i}},function(t,e,i){var n=i(0),s=i(3),r=i(96),a=i(55),o=i(32),h=new n({Extends:s,initialize:function(t){s.call(this),this.manager=t,this.isTimeline=!0,this.data=[],this.totalData=0,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=o.PENDING_ADD,this._pausedState=o.PENDING_ADD,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onComplete:null,onLoop:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope},dispatchTimelineEvent:function(t,e){this.emit(t,this),e&&e.func.apply(e.scope,e.params)},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===o.ACTIVE},add:function(t){return this.queue(a(this,t))},queue:function(t){return this.isPlaying()||(t.parent=this,t.parentIsTimeline=!0,this.data.push(t),this.totalData=this.data.length),this},hasOffset:function(t){return null!==t.offset},isOffsetAbsolute:function(t){return"number"==typeof t},isOffsetRelative:function(t){if("string"==typeof t){var e=t[0];if("-"===e||"+"===e)return!0}return!1},getRelativeOffset:function(t,e){var i=t[0],n=parseFloat(t.substr(2)),s=e;switch(i){case"+":s+=n;break;case"-":s-=n}return Math.max(0,s)},calcDuration:function(){for(var t=0,e=0,i=0,n=0;n<this.totalData;n++){var s=this.data[n];s.init(),this.hasOffset(s)?this.isOffsetAbsolute(s.offset)?(s.calculatedOffset=s.offset,0===s.offset&&(i=0)):this.isOffsetRelative(s.offset)&&(s.calculatedOffset=this.getRelativeOffset(s.offset,t)):s.calculatedOffset=i,t=s.totalDuration+s.calculatedOffset,e+=s.totalDuration,i+=s.totalDuration}this.duration=e,this.loopCounter=-1===this.loop?999999999999:this.loop,0<this.loopCounter?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=o.PAUSED,!1)},resetTweens:function(t){for(var e=0;e<this.totalData;e++)this.data[e].play(t)},setCallback:function(t,e,i,n){return-1!==h.TYPES.indexOf(t)&&(this.callbacks[t]={func:e,scope:n,params:i}),this},makeActive:function(t){return this.manager.makeActive(t)},play:function(){if(this.state!==o.ACTIVE){if(this.paused)return this.paused=!1,void this.manager.makeActive(this);this.resetTweens(!1),this.state=o.ACTIVE,this.dispatchTimelineEvent(r.TIMELINE_START,this.callbacks.onStart)}},nextState:function(){0<this.loopCounter?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweens(!0),0<this.loopDelay?(this.countdown=this.loopDelay,this.state=o.LOOP_DELAY):(this.state=o.ACTIVE,this.dispatchTimelineEvent(r.TIMELINE_LOOP,this.callbacks.onLoop))):0<this.completeDelay?(this.state=o.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=o.PENDING_REMOVE,this.dispatchTimelineEvent(r.TIMELINE_COMPLETE,this.callbacks.onComplete))},update:function(t,e){if(this.state!==o.PAUSED){switch(this.useFrames&&(e=1*this.manager.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case o.ACTIVE:for(var i=this.totalData,n=0;n<this.totalData;n++)this.data[n].update(t,e)&&i--;this.dispatchTimelineEvent(r.TIMELINE_UPDATE,this.callbacks.onUpdate),0===i&&this.nextState();break;case o.LOOP_DELAY:this.countdown-=e,this.countdown<=0&&(this.state=o.ACTIVE,this.dispatchTimelineEvent(r.TIMELINE_LOOP,this.callbacks.onLoop));break;case o.COMPLETE_DELAY:this.countdown-=e,this.countdown<=0&&(this.state=o.PENDING_REMOVE,this.dispatchTimelineEvent(r.TIMELINE_COMPLETE,this.callbacks.onComplete))}return this.state===o.PENDING_REMOVE}},stop:function(){this.state=o.PENDING_REMOVE},pause:function(){if(this.state!==o.PAUSED)return this.paused=!0,this._pausedState=this.state,this.state=o.PAUSED,this.emit(r.TIMELINE_PAUSE,this),this},resume:function(){return this.state===o.PAUSED&&(this.paused=!1,this.state=this._pausedState,this.emit(r.TIMELINE_RESUME,this)),this},hasTarget:function(t){for(var e=0;e<this.data.length;e++)if(this.data[e].hasTarget(t))return!0;return!1},destroy:function(){for(var t=0;t<this.data.length;t++)this.data[t].stop()}});h.TYPES=["onStart","onUpdate","onLoop","onComplete","onYoyo"],t.exports=h},function(t,e){t.exports=function(t,e){return t.hasOwnProperty(e)}},function(t,e,i){(function(e){i(225);var n=i(14),s=i(13),r={Animations:i(234),Cache:i(269),Cameras:{Scene2D:i(272)},Core:i(383),Class:i(0),Events:i(461),Game:i(462),GameObjects:{DisplayList:i(573),UpdateList:i(605),Container:i(192),Sprite:i(625),Image:i(629),Graphics:i(633),Text:i(198),Shape:i(647),RenderTexture:i(648),BitmapText:i(200),Factories:{Text:i(657),Container:i(658),BitmapText:i(659)}},Input:i(660),Loader:{FileTypes:{AtlasJSONFile:i(703),JSONFile:i(212),BitmapFontFile:i(706)},LoaderPlugin:i(709)},Math:i(66),Plugins:i(711),Renderer:i(713),Scale:i(718),Scene:i(180),Scenes:i(719),Textures:i(721),Time:i(723),Tweens:i(725),Utils:i(743)};r=s(!1,r,n),t.exports=r,e.Phaser=r}).call(this,i(224))},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){i(226),i(227),i(228),i(229),i(230),i(231),i(232),i(233)},function(t,e){Array.prototype.forEach||(Array.prototype.forEach=function(t){"use strict";if(null==this)throw new TypeError;var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var n=2<=arguments.length?arguments[1]:void 0,s=0;s<i;s++)s in e&&t.call(n,e[s],s,e)})},function(t,e){Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)})},function(t,e){function i(t){t&&(t.setTargetAtTime||(t.setTargetAtTime=t.setTargetValueAtTime))}window.hasOwnProperty("webkitAudioContext")&&!window.hasOwnProperty("AudioContext")&&(window.AudioContext=webkitAudioContext,AudioContext.prototype.hasOwnProperty("createGain")||(AudioContext.prototype.createGain=AudioContext.prototype.createGainNode),AudioContext.prototype.hasOwnProperty("createDelay")||(AudioContext.prototype.createDelay=AudioContext.prototype.createDelayNode),AudioContext.prototype.hasOwnProperty("createScriptProcessor")||(AudioContext.prototype.createScriptProcessor=AudioContext.prototype.createJavaScriptNode),AudioContext.prototype.hasOwnProperty("createPeriodicWave")||(AudioContext.prototype.createPeriodicWave=AudioContext.prototype.createWaveTable),AudioContext.prototype.internal_createGain=AudioContext.prototype.createGain,AudioContext.prototype.createGain=function(){var t=this.internal_createGain();return i(t.gain),t},AudioContext.prototype.internal_createDelay=AudioContext.prototype.createDelay,AudioContext.prototype.createDelay=function(t){var e=t?this.internal_createDelay(t):this.internal_createDelay();return i(e.delayTime),e},AudioContext.prototype.internal_createBufferSource=AudioContext.prototype.createBufferSource,AudioContext.prototype.createBufferSource=function(){var t=this.internal_createBufferSource();return t.start?(t.internal_start=t.start,t.start=function(e,i,n){void 0!==n?t.internal_start(e||0,i,n):t.internal_start(e||0,i||0)}):t.start=function(t,e,i){e||i?this.noteGrainOn(t||0,e,i):this.noteOn(t||0)},t.stop?(t.internal_stop=t.stop,t.stop=function(e){t.internal_stop(e||0)}):t.stop=function(t){this.noteOff(t||0)},i(t.playbackRate),t},AudioContext.prototype.internal_createDynamicsCompressor=AudioContext.prototype.createDynamicsCompressor,AudioContext.prototype.createDynamicsCompressor=function(){var t=this.internal_createDynamicsCompressor();return i(t.threshold),i(t.knee),i(t.ratio),i(t.reduction),i(t.attack),i(t.release),t},AudioContext.prototype.internal_createBiquadFilter=AudioContext.prototype.createBiquadFilter,AudioContext.prototype.createBiquadFilter=function(){var t=this.internal_createBiquadFilter();return i(t.frequency),i(t.detune),i(t.Q),i(t.gain),t},AudioContext.prototype.hasOwnProperty("createOscillator")&&(AudioContext.prototype.internal_createOscillator=AudioContext.prototype.createOscillator,AudioContext.prototype.createOscillator=function(){var t=this.internal_createOscillator();return t.start?(t.internal_start=t.start,t.start=function(e){t.internal_start(e||0)}):t.start=function(t){this.noteOn(t||0)},t.stop?(t.internal_stop=t.stop,t.stop=function(e){t.internal_stop(e||0)}):t.stop=function(t){this.noteOff(t||0)},t.setPeriodicWave||(t.setPeriodicWave=t.setWaveTable),i(t.frequency),i(t.detune),t})),window.hasOwnProperty("webkitOfflineAudioContext")&&!window.hasOwnProperty("OfflineAudioContext")&&(window.OfflineAudioContext=webkitOfflineAudioContext)},function(t,e){window.console||(window.console={},window.console.log=window.console.assert=function(){},window.console.warn=window.console.assert=function(){})},function(t,e){Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)})},function(t,e){!function(){if("performance"in window==0&&(window.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in window.performance==0){var t=Date.now();performance.timing&&performance.timing.navigationStart&&(t=performance.timing.navigationStart),window.performance.now=function(){return Date.now()-t}}}()},function(t,e){for(var i=Date.now(),n=["ms","moz","webkit","o"],s=0;s<n.length&&!window.requestAnimationFrame;s++)window.requestAnimationFrame=window[n[s]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[n[s]+"CancelAnimationFrame"]||window[n[s]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){if("function"!=typeof t)throw new TypeError(t+"is not a function");var e=Date.now(),n=16+i-e;return n<0&&(n=0),i=e,setTimeout((function(){i=Date.now(),t(performance.now())}),n)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})},function(t,e){if("function"!=typeof window.Uint32Array&&"object"!=typeof window.Uint32Array){function i(t){var e=new Array;window[t]=function(t){if("number"==typeof t){Array.call(this,t),this.length=t;for(var e=0;e<this.length;e++)this[e]=0}else for(Array.call(this,t.length),this.length=t.length,e=0;e<this.length;e++)this[e]=t[e]},window[t].prototype=e,window[t].constructor=window[t]}i("Float32Array"),i("Uint32Array"),i("Uint16Array"),i("Int16Array"),i("ArrayBuffer")}},function(t,e,i){t.exports={Animation:i(56),AnimationFrame:i(100),AnimationManager:i(101),Events:i(40)}},function(t,e){t.exports="add"},function(t,e){t.exports="complete"},function(t,e){t.exports="repeat"},function(t,e){t.exports="restart"},function(t,e){t.exports="start"},function(t,e){t.exports="pauseall"},function(t,e){t.exports="remove"},function(t,e){t.exports="resumeall"},function(t,e){t.exports="animationcomplete"},function(t,e){t.exports="animationcomplete-"},function(t,e){t.exports="animationrepeat-"},function(t,e){t.exports="animationrestart-"},function(t,e){t.exports="animationstart-"},function(t,e){t.exports="animationupdate-"},function(t,e){t.exports="animationrepeat"},function(t,e){t.exports="animationrestart"},function(t,e){t.exports="animationstart"},function(t,e){t.exports="animationupdate"},function(t,e){t.exports="blur"},function(t,e){t.exports="boot"},function(t,e){t.exports="contextlost"},function(t,e){t.exports="contextrestored"},function(t,e){t.exports="destroy"},function(t,e){t.exports="focus"},function(t,e){t.exports="hidden"},function(t,e){t.exports="pause"},function(t,e){t.exports="postrender"},function(t,e){t.exports="poststep"},function(t,e){t.exports="prerender"},function(t,e){t.exports="prestep"},function(t,e){t.exports="ready"},function(t,e){t.exports="resume"},function(t,e){t.exports="step"},function(t,e){t.exports="visible"},function(t,e,i){t.exports={BaseCache:i(103),CacheManager:i(105),Events:i(104)}},function(t,e){t.exports="add"},function(t,e){t.exports="remove"},function(t,e,i){t.exports={Camera:i(106),BaseCamera:i(30),CameraManager:i(357),Effects:i(123),Events:i(15)}},function(t,e,i){var n=i(5),s={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,s){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=n(t,0,1),this._alphaTR=n(e,0,1),this._alphaBL=n(i,0,1),this._alphaBR=n(s,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,0===(this._alphaBR=e)?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=n(t,0,1);0!==(this._alphaTL=e)&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=n(t,0,1);0!==(this._alphaTR=e)&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=n(t,0,1);0!==(this._alphaBL=e)&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=n(t,0,1);0!==(this._alphaBR=e)&&(this.renderFlags|=2)}}};t.exports=s},function(t,e,i){var n=i(56),s=i(0),r=i(40),a=new s({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.once(r.REMOVE_ANIMATION,this.remove,this),this.isPlaying=!1,this.currentAnim=null,this.currentFrame=null,this.nextAnim=null,this.nextAnimsQueue=[],this._timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this._delay=0,this._repeat=0,this._repeatDelay=0,this._yoyo=!1,this.forward=!0,this._reverse=!1,this.accumulator=0,this.nextTick=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},chain:function(t){return t instanceof n&&(t=t.key),null===this.nextAnim?this.nextAnim=t:this.nextAnimsQueue.push(t),this.parent},setDelay:function(t){return void 0===t&&(t=0),this._delay=t,this.parent},getDelay:function(){return this._delay},delayedPlay:function(t,e,i){return this.play(e,!0,i),this.nextTick+=t,this.parent},getCurrentKey:function(){if(this.currentAnim)return this.currentAnim.key},load:function(t,e){return void 0===e&&(e=0),this.isPlaying&&this.stop(),this.animationManager.load(this,t,e),this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.updateFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.updateFrame(t),this.parent},isPaused:{get:function(){return this._paused}},play:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=0),t instanceof n&&(t=t.key),e&&this.isPlaying&&this.currentAnim.key===t?this.parent:(this.forward=!0,this._reverse=!1,this._paused=!1,this._wasPlaying=!0,this._startAnimation(t,i))},playReverse:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=0),t instanceof n&&(t=t.key),e&&this.isPlaying&&this.currentAnim.key===t?this.parent:(this.forward=!1,this._reverse=!0,this._startAnimation(t,i))},_startAnimation:function(t,e){this.load(t,e);var i=this.currentAnim,n=this.parent;if(!i)return n;this.repeatCounter=-1===this._repeat?Number.MAX_VALUE:this._repeat,i.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,i.showOnStart&&(n.visible=!0);var s=this.currentFrame;return i.emit(r.ANIMATION_START,i,s,n),n.emit(r.SPRITE_ANIMATION_KEY_START+t,i,s,n),n.emit(r.SPRITE_ANIMATION_START,i,s,n),n},reverse:function(){return this.isPlaying&&(this._reverse=!this._reverse,this.forward=!this.forward),this.parent},getProgress:function(){var t=this.currentFrame.progress;return this.forward||(t=1-t),t},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},remove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},getRepeat:function(){return this._repeat},setRepeat:function(t){return this._repeat=t,this.repeatCounter=-1===t?Number.MAX_VALUE:t,this.parent},getRepeatDelay:function(){return this._repeatDelay},setRepeatDelay:function(t){return this._repeatDelay=t,this.parent},restart:function(t){void 0===t&&(t=!1);var e=this.currentAnim;e.getFirstTick(this,t),this.forward=!0,this.isPlaying=!0,this.pendingRepeat=!1,this._paused=!1,this.updateFrame(e.frames[0]);var i=this.parent,n=this.currentFrame;return e.emit(r.ANIMATION_RESTART,e,n,i),i.emit(r.SPRITE_ANIMATION_KEY_RESTART+e.key,e,n,i),i.emit(r.SPRITE_ANIMATION_RESTART,e,n,i),this.parent},stop:function(){this._pendingStop=0,this.isPlaying=!1;var t=this.parent,e=this.currentAnim,i=this.currentFrame;if(e&&(e.emit(r.ANIMATION_COMPLETE,e,i,t),t.emit(r.SPRITE_ANIMATION_KEY_COMPLETE+e.key,e,i,t),t.emit(r.SPRITE_ANIMATION_COMPLETE,e,i,t)),this.nextAnim){var n=this.nextAnim;this.nextAnim=0<this.nextAnimsQueue.length?this.nextAnimsQueue.shift():null,this.play(n)}return t},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopOnRepeat:function(){return this._pendingStop=2,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},setTimeScale:function(t){return void 0===t&&(t=1),this._timeScale=t,this.parent},getTimeScale:function(){return this._timeScale},getTotalFrames:function(){return this.currentAnim.frames.length},update:function(t,e){if(this.currentAnim&&this.isPlaying&&!this.currentAnim.paused){if(this.accumulator+=e*this._timeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.currentAnim.completeAnimation(this);this.accumulator>=this.nextTick&&this.currentAnim.setFrame(this)}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),e},updateFrame:function(t){var e=this.setCurrentFrame(t);if(this.isPlaying){t.setAlpha&&(e.alpha=t.alpha);var i=this.currentAnim;e.emit(r.SPRITE_ANIMATION_KEY_UPDATE+i.key,i,t,e),e.emit(r.SPRITE_ANIMATION_UPDATE,i,t,e),3===this._pendingStop&&this._pendingStopValue===t&&this.currentAnim.completeAnimation(this)}},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},setYoyo:function(t){return void 0===t&&(t=!1),this._yoyo=t,this.parent},getYoyo:function(){return this._yoyo},destroy:function(){this.animationManager.off(r.REMOVE_ANIMATION,this.remove,this),this.animationManager=null,this.parent=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null}});t.exports=a},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e){t.exports={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}}},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e,i){var n=i(23),s=i(112),r=i(7),a={prepareBoundsOutput:function(t,e){return void 0===e&&(e=!1),0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t),t},getCenter:function(t){return void 0===t&&(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){return(t=t||new r).x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return(t=t||new r).x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return(t=t||new r).x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return(t=t||new r).x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return(t=t||new r).x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return(t=t||new r).x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return(t=t||new r).x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return(t=t||new r).x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,s,r,a,o,h,u;if(void 0===t&&(t=new n),this.parentContainer){var c=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),c.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),c.transformPoint(t.x,t.y,t),s=t.x,r=t.y,this.getBottomLeft(t),c.transformPoint(t.x,t.y,t),a=t.x,o=t.y,this.getBottomRight(t),c.transformPoint(t.x,t.y,t),h=t.x,u=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),s=t.x,r=t.y,this.getBottomLeft(t),a=t.x,o=t.y,this.getBottomRight(t),h=t.x,u=t.y;return t.x=Math.min(e,s,a,h),t.y=Math.min(i,r,o,u),t.width=Math.max(e,s,a,h)-t.x,t.height=Math.max(i,r,o,u)-t.y,t}};t.exports=a},function(t,e,i){var n=i(110),s=i(111);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&0<i&&(e=s(t)/i);for(var a=0;a<e;a++){var o=a/e;r.push(n(t,o))}return r}},function(t,e,i){var n=i(8);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},function(t,e,i){var n=i(60),s=i(8);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&0<i&&(e=n(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,u=t.y2,c=0;c<e;c++){var l=c/e,d=a+(h-a)*l,p=o+(u-o)*l;r.push(new s(d,p))}return r}},function(t,e,i){var n=i(8);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},function(t,e,i){var n=i(8);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},function(t,e,i){var n=i(0),s=i(6),r=new n({initialize:function(t,e){var i=t.sys.game.renderer;if(this.renderer=i,this.bitmapMask=e,this.maskTexture=null,this.mainTexture=null,this.dirty=!0,this.mainFramebuffer=null,this.maskFramebuffer=null,this.prevFramebuffer=null,this.invertAlpha=!1,this.isStencil=!1,i&&i.gl){var n=i.width,r=i.height,a=0==(n&n-1)&&0==(r&r-1),o=i.gl,h=a?o.REPEAT:o.CLAMP_TO_EDGE,u=o.LINEAR;this.mainTexture=i.createTexture2D(0,u,u,h,h,o.RGBA,null,n,r),this.maskTexture=i.createTexture2D(0,u,u,h,h,o.RGBA,null,n,r),this.mainFramebuffer=i.createFramebuffer(n,r,this.mainTexture,!0),this.maskFramebuffer=i.createFramebuffer(n,r,this.maskTexture,!0),t.sys.game.events.on(s.CONTEXT_RESTORED,(function(t){var e=t.width,i=t.height,n=0==(e&e-1)&&0==(i&i-1),s=t.gl,r=n?s.REPEAT:s.CLAMP_TO_EDGE,a=s.LINEAR;this.mainTexture=t.createTexture2D(0,a,a,r,r,s.RGBA,null,e,i),this.maskTexture=t.createTexture2D(0,a,a,r,r,s.RGBA,null,e,i),this.mainFramebuffer=t.createFramebuffer(e,i,this.mainTexture,!0),this.maskFramebuffer=t.createFramebuffer(e,i,this.maskTexture,!0)}),this)}},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BitmapMaskPipeline.beginMask(this,e,i)},postRenderWebGL:function(t,e){t.pipelines.BitmapMaskPipeline.endMask(this,e)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null;var t=this.renderer;t&&t.gl&&(t.deleteTexture(this.mainTexture),t.deleteTexture(this.maskTexture),t.deleteFramebuffer(this.mainFramebuffer),t.deleteFramebuffer(this.maskFramebuffer)),this.mainTexture=null,this.maskTexture=null,this.mainFramebuffer=null,this.maskFramebuffer=null,this.prevFramebuffer=null,this.renderer=null}});t.exports=r},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var n=t.gl;t.flush(),0===t.maskStack.length&&(n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var n=t.gl,s=this.geometryMask,r=t.maskCount;n.colorMask(!1,!1,!1,!1),i?(n.stencilFunc(n.EQUAL,r,255),n.stencilOp(n.KEEP,n.KEEP,n.INCR)):(n.stencilFunc(n.EQUAL,r+1,255),n.stencilOp(n.KEEP,n.KEEP,n.DECR)),s.renderWebGL(t,s,0,e),t.flush(),n.colorMask(!0,!0,!0,!0),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),i?this.invertAlpha?n.stencilFunc(n.NOTEQUAL,r+1,255):n.stencilFunc(n.EQUAL,r+1,255):this.invertAlpha?n.stencilFunc(n.NOTEQUAL,r,255):n.stencilFunc(n.EQUAL,r,255)},postRenderWebGL:function(t){var e=t.gl;if(t.maskStack.pop(),t.maskCount--,0===t.maskStack.length)t.flush(),t.currentMask.mask=null,e.disable(e.STENCIL_TEST);else{t.flush();var i=t.maskStack[t.maskStack.length-1];i.mask.applyStencil(t,i.camera,!1),t.currentCameraMask.mask!==i.mask?(t.currentMask.mask=i.mask,t.currentMask.camera=i.camera):t.currentMask.mask=null}},preRenderCanvas:function(t,e,i){var n=this.geometryMask;t.currentContext.save(),n.renderCanvas(t,n,0,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=n},function(t,e){t.exports={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}}},function(t,e,i){var n=i(62),s=i(31),r=i(2),a=i(32),o=i(7),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:a.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=r(t,"from",0),t.to=r(t,"to",1);var h=s(t,"positionOnPath",!1);this.rotateToPath=s(t,"rotateToPath",!1),this.pathRotationOffset=r(t,"rotationOffset",0);var u=r(t,"startAt",e);if(u&&(t.onStart=function(t){var e=t.data[0];e.progress=u,e.elapsed=e.duration*u;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.target[e.key]=e.current}),this.pathOffset||(this.pathOffset=new o(this.x,this.y)),this.pathVector||(this.pathVector=new o),this.pathDelta||(this.pathDelta=new o),this.pathDelta.reset(),this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=a.PLAYING_FORWARD,this.rotateToPath){var c=this.path.getPoint(.1);this.rotation=Math.atan2(c.y-this.y,c.x-this.x)+n(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,s=this.pathVector;if(i.copy(s).negate(),e.state===a.COMPLETE)return this.path.getPoint(1,s),i.add(s),s.add(this.pathOffset),void this.setPosition(s.x,s.y);if(e.state!==a.PLAYING_FORWARD&&e.state!==a.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),s),i.add(s),s.add(this.pathOffset);var r=this.x,o=this.y;this.setPosition(s.x,s.y);var h=this.x-r,u=this.y-o;if(0==h&&0==u)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(u,h)+n(this.pathRotationOffset))}}};t.exports=h},function(t,e){var i={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){return void 0===t&&(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=i},function(t,e){t.exports={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}}},function(t,e){t.exports={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}}},function(t,e){function i(t){return(t>>16)+(65280&t)+((255&t)<<16)}var n={_tintTL:16777215,_tintTR:16777215,_tintBL:16777215,_tintBR:16777215,_isTinted:!1,tintFill:!1,clearTint:function(){return this.setTint(16777215),this._isTinted=!1,this},setTint:function(t,e,n,s){return void 0===t&&(t=16777215),void 0===e&&(s=n=e=t),this._tintTL=i(t),this._tintTR=i(e),this._tintBL=i(n),this._tintBR=i(s),this._isTinted=!0,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tintTopLeft:{get:function(){return this._tintTL},set:function(t){this._tintTL=i(t),this._isTinted=!0}},tintTopRight:{get:function(){return this._tintTR},set:function(t){this._tintTR=i(t),this._isTinted=!0}},tintBottomLeft:{get:function(){return this._tintBL},set:function(t){this._tintBL=i(t),this._isTinted=!0}},tintBottomRight:{get:function(){return this._tintBR},set:function(t){this._tintBR=i(t),this._isTinted=!0}},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this._isTinted}}};t.exports=n},function(t,e){t.exports="cameradestroy"},function(t,e){t.exports="camerafadeincomplete"},function(t,e){t.exports="camerafadeinstart"},function(t,e){t.exports="camerafadeoutcomplete"},function(t,e){t.exports="camerafadeoutstart"},function(t,e){t.exports="cameraflashcomplete"},function(t,e){t.exports="cameraflashstart"},function(t,e){t.exports="camerapancomplete"},function(t,e){t.exports="camerapanstart"},function(t,e){t.exports="postrender"},function(t,e){t.exports="prerender"},function(t,e){t.exports="camerarotatecomplete"},function(t,e){t.exports="camerarotatestart"},function(t,e){t.exports="camerashakecomplete"},function(t,e){t.exports="camerashakestart"},function(t,e){t.exports="camerazoomcomplete"},function(t,e){t.exports="camerazoomstart"},function(t,e,i){var n=i(20);t.exports=function(t){var e=new n;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,i,n){return e+e+i+i+n+n}));var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var s=parseInt(i[1],16),r=parseInt(i[2],16),a=parseInt(i[3],16);e.setTo(s,r,a)}return e}},function(t,e){t.exports=function(t,e,i,n){return n<<24|t<<16|e<<8|i}},function(t,e,i){var n=i(122);t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1);var r=Math.floor(6*t),a=6*t-r,o=Math.floor(i*(1-e)*255),h=Math.floor(i*(1-a*e)*255),u=Math.floor(i*(1-(1-a)*e)*255),c=i=Math.floor(i*=255),l=i,d=i,p=r%6;return 0==p?(l=u,d=o):1==p?(c=h,d=o):2==p?(c=o,d=u):3==p?(c=o,l=h):4==p?(c=u,l=o):5==p&&(l=o,d=h),s?s.setTo?s.setTo(c,l,d,s.alpha,!1):(s.r=c,s.g=l,s.b=d,s.color=n(c,l,d),s):{r:c,g:l,b:d,color:n(c,l,d)}}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var s=Math.min(t,e,i),r=Math.max(t,e,i),a=r-s,o=0,h=0===r?0:a/r,u=r;return r!==s&&(r===t?o=(e-i)/a+(e<i?6:0):r===e?o=(i-t)/a+2:r===i&&(o=(t-e)/a+4),o/=6),n.hasOwnProperty("_h")?(n._h=o,n._s=h,n._v=u):(n.h=o,n.s=h,n.v=u),n}},function(t,e,i){var n=i(20),s=i(314);t.exports=function(t){var e=s(t);return new n(e.r,e.g,e.b,e.a)}},function(t,e){t.exports=function(t){return 16777215<t?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e,i){var n=i(20);t.exports=function(t){return new n(t.r,t.g,t.b,t.a)}},function(t,e,i){var n=i(20);t.exports=function(t){var e=new n,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var s=parseInt(i[1],10),r=parseInt(i[2],10),a=parseInt(i[3],10),o=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(s,r,a,255*o)}return e}},function(t,e){var i="";function n(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i<e.length;i++){var n=e[i]+"mageSmoothingEnabled";if(n in t)return n}return null}t.exports={disable:function(t){return""===i&&(i=n(t)),i&&(t[i]=!1),t},enable:function(t){return""===i&&(i=n(t)),i&&(t[i]=!0),t},getPrefix:n,isEnabled:function(t){return null!==i?t[i]:null}}},function(t,e){t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},function(t,e,i){var n=i(5),s=i(0),r=i(15),a=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,a,o,h){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===a&&(a=!1),void 0===o&&(o=null),void 0===h&&(h=this.camera.scene),!a&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=n,this.blue=s,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=h;var u=t?r.FADE_OUT_START:r.FADE_IN_START;return this.camera.emit(u,this.camera,this,e,i,n,s),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration?this.alpha=this.direction?this.progress:1-this.progress:(this.alpha=this.direction?1:0,this.effectComplete()))},postRenderCanvas:function(t){if(!this.isRunning&&!this.isComplete)return!1;var e=this.camera;return t.fillStyle="rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")",t.fillRect(e._cx,e._cy,e._cw,e._ch),!0},postRenderWebGL:function(t,e){if(!this.isRunning&&!this.isComplete)return!1;var i=this.camera,n=this.red/255,s=this.blue/255,r=this.green/255;return t.drawFillRect(i._cx,i._cy,i._cw,i._ch,e(n,r,s,1),this.alpha),!0},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.isComplete=!0;var t=this.direction?r.FADE_OUT_COMPLETE:r.FADE_IN_COMPLETE;this.camera.emit(t,this.camera,this)},reset:function(){this.isRunning=!1,this.isComplete=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=a},function(t,e,i){var n=i(5),s=i(0),r=i(15),a=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,a,o){return void 0===t&&(t=250),void 0===e&&(e=255),void 0===i&&(i=255),void 0===n&&(n=255),void 0===s&&(s=!1),void 0===a&&(a=null),void 0===o&&(o=this.camera.scene),!s&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,this.red=e,this.green=i,this.blue=n,this.alpha=1,this._elapsed=0,this._onUpdate=a,this._onUpdateScope=o,this.camera.emit(r.FLASH_START,this.camera,this,t,e,i,n)),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration?this.alpha=1-this.progress:this.effectComplete())},postRenderCanvas:function(t){if(!this.isRunning)return!1;var e=this.camera;return t.fillStyle="rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")",t.fillRect(e._cx,e._cy,e._cw,e._ch),!0},postRenderWebGL:function(t,e){if(!this.isRunning)return!1;var i=this.camera,n=this.red/255,s=this.blue/255,r=this.green/255;return t.drawFillRect(i._cx,i._cy,i._cw,i._ch,e(n,r,s,1),this.alpha),!0},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(r.FLASH_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=a},function(t,e,i){var n=i(5),s=i(0),r=i(41),a=i(15),o=i(7),h=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=new o,this.current=new o,this.destination=new o,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,o,h){void 0===i&&(i=1e3),void 0===n&&(n=r.Linear),void 0===s&&(s=!1),void 0===o&&(o=null),void 0===h&&(h=this.camera.scene);var u=this.camera;return!s&&this.isRunning||(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(u.scrollX,u.scrollY),this.destination.set(t,e),u.getScroll(t,e,this.current),"string"==typeof n&&r.hasOwnProperty(n)?this.ease=r[n]:"function"==typeof n&&(this.ease=n),this._elapsed=0,this._onUpdate=o,this._onUpdateScope=h,this.camera.emit(a.PAN_START,this.camera,this,i,t,e)),u},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=n(this._elapsed/this.duration,0,1);this.progress=i;var s=this.camera;if(this._elapsed<this.duration){var r=this.ease(i);s.getScroll(this.destination.x,this.destination.y,this.current);var a=this.source.x+(this.current.x-this.source.x)*r,o=this.source.y+(this.current.y-this.source.y)*r;s.setScroll(a,o),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,s,i,a,o)}else s.centerOn(this.destination.x,this.destination.y),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,s,i,s.scrollX,s.scrollY),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(a.PAN_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.source=null,this.destination=null}});t.exports=h},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((1+i)*t-i)*.5:.5*((t-=2)*t*((1+i)*t+i)+2)}},function(t,e){t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},function(t,e){t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},function(t,e){t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},function(t,e){t.exports=function(t){return 1-Math.sqrt(1-t*t)}},function(t,e){t.exports=function(t){return Math.sqrt(1- --t*t)}},function(t,e){t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},function(t,e){t.exports=function(t){return t*t*t}},function(t,e){t.exports=function(t){return--t*t*t+1}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-n)*(2*Math.PI)/i)+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*.5+1}},function(t,e){t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},function(t,e){t.exports=function(t){return 1-Math.pow(2,-10*t)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},function(t,e){t.exports=function(t){return t}},function(t,e){t.exports=function(t){return t*t}},function(t,e){t.exports=function(t){return t*(2-t)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},function(t,e){t.exports=function(t){return t*t*t*t}},function(t,e){t.exports=function(t){return 1- --t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},function(t,e){t.exports=function(t){return t*t*t*t*t}},function(t,e){t.exports=function(t){return--t*t*t*t*t+1}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:1<=t?1:1/e*(1+(e*t|0))}},function(t,e,i){var n=i(5),s=i(0),r=i(15),a=i(7),o=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new a,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===n&&(n=null),void 0===s&&(s=this.camera.scene),!i&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=n,this._onUpdateScope=s,this.camera.emit(r.SHAKE_START,this.camera,this,t,e)),this.camera},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration){var i=this.intensity,s=this.camera._cw,r=this.camera._ch,a=this.camera.zoom;this._offsetX=(Math.random()*i.x*s*2-i.x*s)*a,this._offsetY=(Math.random()*i.y*r*2-i.y*r)*a,this.camera.roundPixels&&(this._offsetX=Math.round(this._offsetX),this._offsetY=Math.round(this._offsetY))}else this.effectComplete()},effectComplete:function(){this._offsetX=0,this._offsetY=0,this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(r.SHAKE_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._offsetX=0,this._offsetY=0,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.intensity=null}});t.exports=o},function(t,e,i){var n=i(5),s=i(0),r=i(15),a=i(41),o=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=0,this.current=0,this.destination=0,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope,this.clockwise=!0,this.shortestPath=!1},start:function(t,e,i,n,s,o,h){void 0===i&&(i=1e3),void 0===n&&(n=a.Linear),void 0===s&&(s=!1),void 0===o&&(o=null),void 0===h&&(h=this.camera.scene),void 0===e&&(e=!1),this.shortestPath=e;var u=t;t<0?(u=-1*t,this.clockwise=!1):this.clockwise=!0;var c=360*Math.PI/180;u-=Math.floor(u/c)*c;var l,d,p=this.camera;if(!s&&this.isRunning)return p;(this.isRunning=!0,this.duration=i,this.progress=0,this.source=p.rotation,this.destination=u,"string"==typeof n&&a.hasOwnProperty(n)?this.ease=a[n]:"function"==typeof n&&(this.ease=n),this._elapsed=0,this._onUpdate=o,this._onUpdateScope=h,this.shortestPath)&&((l=this.destination>this.source?Math.abs(this.destination-this.source):Math.abs(this.destination+c)-this.source)<(d=this.source>this.destination?Math.abs(this.source-this.destination):Math.abs(this.source+c)-this.destination)?this.clockwise=!0:d<l&&(this.clockwise=!1));return this.camera.emit(r.ROTATE_START,this.camera,this,i,u),p},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=n(this._elapsed/this.duration,0,1);this.progress=i;var s=this.camera;if(this._elapsed<this.duration){var r=this.ease(i);this.current=s.rotation;var a,o,h=360*Math.PI/180,u=this.destination,c=this.current;!1===this.clockwise&&(u=this.current,c=this.destination),a=c<=u?Math.abs(u-c):Math.abs(u+h)-c,o=this.clockwise?s.rotation+a*r:s.rotation-a*r,s.rotation=o,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,s,i,o)}else s.rotation=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,s,i,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(r.ROTATE_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.source=null,this.destination=null}});t.exports=o},function(t,e,i){var n=i(5),s=i(0),r=i(41),a=i(15),o=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=1,this.destination=1,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,o){void 0===e&&(e=1e3),void 0===i&&(i=r.Linear),void 0===n&&(n=!1),void 0===s&&(s=null),void 0===o&&(o=this.camera.scene);var h=this.camera;return!n&&this.isRunning||(this.isRunning=!0,this.duration=e,this.progress=0,this.source=h.zoom,this.destination=t,"string"==typeof i&&r.hasOwnProperty(i)?this.ease=r[i]:"function"==typeof i&&(this.ease=i),this._elapsed=0,this._onUpdate=s,this._onUpdateScope=o,this.camera.emit(a.ZOOM_START,this.camera,this,e,t)),h},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._elapsed<this.duration?(this.camera.zoom=this.source+(this.destination-this.source)*this.ease(this.progress),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress,this.camera.zoom)):(this.camera.zoom=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress,this.destination),this.effectComplete()))},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(a.ZOOM_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=o},function(t,e,i){var n=i(106),s=i(0),r=i(4),a=i(10),o=i(58),h=i(33),u=i(11),c=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,t.sys.events.once(u.BOOT,this.boot,this),t.sys.events.on(u.START,this.start,this)},boot:function(){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new n(0,0,t.scale.width,t.scale.height).setScene(this.scene),t.game.scale.on(h.RESIZE,this.onResize,this),this.systems.events.once(u.DESTROY,this.destroy,this)},start:function(){if(!this.main){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0]}var e=this.systems.events;e.on(u.UPDATE,this.update,this),e.once(u.SHUTDOWN,this.shutdown,this)},add:function(t,e,i,s,r,a){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),void 0===r&&(r=!1),void 0===a&&(a="");var o=new n(t,e,i,s);return o.setName(a),o.setScene(this.scene),o.setRoundPixels(this.roundPixels),o.id=this.getNextID(),this.cameras.push(o),r&&(this.main=o),o},addExisting:function(t,e){return void 0===e&&(e=!1),-1===this.cameras.indexOf(t)?(t.id=this.getNextID(),t.setRoundPixels(this.roundPixels),this.cameras.push(t),e&&(this.main=t),t):null},getNextID:function(){for(var t=this.cameras,e=1,i=0;i<32;i++){for(var n=!1,s=0;s<t.length;s++){var r=t[s];r&&r.id===e&&(n=!0)}if(!n)return e;e<<=1}return 0},getTotal:function(t){void 0===t&&(t=!1);for(var e=0,i=this.cameras,n=0;n<i.length;n++){var s=i[n];(!t||t&&s.visible)&&e++}return e},fromJSON:function(t){Array.isArray(t)||(t=[t]);for(var e=this.scene.sys.scale.width,i=this.scene.sys.scale.height,n=0;n<t.length;n++){var s=t[n],a=r(s,"x",0),o=r(s,"y",0),h=r(s,"width",e),u=r(s,"height",i),c=this.add(a,o,h,u);c.name=r(s,"name",""),c.zoom=r(s,"zoom",1),c.rotation=r(s,"rotation",0),c.scrollX=r(s,"scrollX",0),c.scrollY=r(s,"scrollY",0),c.roundPixels=r(s,"roundPixels",!1),c.visible=r(s,"visible",!0);var l=r(s,"backgroundColor",!1);l&&c.setBackgroundColor(l);var d=r(s,"bounds",null);if(d){var p=r(d,"x",0),f=r(d,"y",0),m=r(d,"width",e),g=r(d,"height",i);c.setBounds(p,f,m,g)}}return this},getCamera:function(t){for(var e=this.cameras,i=0;i<e.length;i++)if(e[i].name===t)return e[i];return null},getCamerasBelowPointer:function(t){for(var e=this.cameras,i=t.x,n=t.y,s=[],r=0;r<e.length;r++){var a=e[r];a.visible&&a.inputEnabled&&o(a,i,n)&&s.unshift(a)}return s},remove:function(t,e){void 0===e&&(e=!0),Array.isArray(t)||(t=[t]);for(var i=0,n=this.cameras,s=0;s<t.length;s++){var r=n.indexOf(t[s]);-1!==r&&(e&&n[r].destroy(),n.splice(r,1),i++)}return!this.main&&n[0]&&(this.main=n[0]),i},render:function(t,e,i){for(var n=this.scene,s=this.cameras,r=0;r<this.cameras.length;r++){var a=s[r];a.visible&&0<a.alpha&&(a.preRender(1),t.render(n,e,i,a))}},resetAll:function(){for(var t=0;t<this.cameras.length;t++)this.cameras[t].destroy();return this.cameras=[],this.main=this.add(),this.main},update:function(t,e){for(var i=0;i<this.cameras.length;i++)this.cameras[i].update(t,e)},onResize:function(t,e,i,n,s,r){for(var a=0;a<this.cameras.length;a++){var o=this.cameras[a];0===o._x&&0===o._y&&o._width===s&&o._height===r&&o.setSize(e.width,e.height)}},resize:function(t,e){for(var i=0;i<this.cameras.length;i++)this.cameras[i].setSize(t,e)},shutdown:function(){this.main=void 0;for(var t=0;t<this.cameras.length;t++)this.cameras[t].destroy();this.cameras=[];var e=this.systems.events;e.off(u.UPDATE,this.update,this),e.off(u.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.default.destroy(),this.scene.sys.events.off(u.START,this.start,this),this.scene=null,this.systems=null}});a.register("CameraManager",c,"cameras"),t.exports=c},function(t,e){t.exports="enterfullscreen"},function(t,e){t.exports="fullscreenfailed"},function(t,e){t.exports="fullscreenunsupported"},function(t,e){t.exports="leavefullscreen"},function(t,e){t.exports="orientationchange"},function(t,e){t.exports="resize"},function(t,e){t.exports="boot"},function(t,e){t.exports="create"},function(t,e){t.exports="destroy"},function(t,e){t.exports="pause"},function(t,e){t.exports="postupdate"},function(t,e){t.exports="preupdate"},function(t,e){t.exports="ready"},function(t,e){t.exports="render"},function(t,e){t.exports="resume"},function(t,e){t.exports="shutdown"},function(t,e){t.exports="sleep"},function(t,e){t.exports="start"},function(t,e){t.exports="transitioncomplete"},function(t,e){t.exports="transitioninit"},function(t,e){t.exports="transitionout"},function(t,e){t.exports="transitionstart"},function(t,e){t.exports="transitionwake"},function(t,e){t.exports="update"},function(t,e){t.exports="wake"},function(t,e,i){t.exports={Config:i(136),CreateRenderer:i(152),DebugHeader:i(163),Events:i(6),TimeStep:i(164),VisibilityHandler:i(165)}},function(t,e){var i,n,s=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(t){if(i===setTimeout)return setTimeout(t,0);if((i===r||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:r}catch(t){i=r}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var h,u=[],c=!1,l=-1;function d(){c&&h&&(c=!1,h.length?u=h.concat(u):l=-1,u.length&&p())}function p(){if(!c){var t=o(d);c=!0;for(var e=u.length;e;){for(h=u,u=[];++l<e;)h&&h[l].run();l=-1,e=u.length}h=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function m(){}s.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];u.push(new f(t,e)),1!==u.length||c||o(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=m,s.addListener=m,s.once=m,s.off=m,s.removeListener=m,s.removeAllListeners=m,s.emit=m,s.prependListener=m,s.prependOnceListener=m,s.listeners=function(t){return[]},s.binding=function(t){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(t){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},function(t,e,i){var n=i(43),s={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&1<=navigator.maxTouchPoints)&&(s.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(s.mspointer=!0),navigator.getGamepads&&(s.gamepads=!0),"onwheel"in window||n.ie&&"WheelEvent"in window?s.wheelEvent="wheel":"onmousewheel"in window?s.wheelEvent="mousewheel":n.firefox&&"MouseScrollEvent"in window&&(s.wheelEvent="DOMMouseScroll"),s)},function(t,e,i){var n=i(43),s={audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){s.audioData=!!window.Audio,s.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e&&(t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(s.ogg=!0),(t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")||t.canPlayType("audio/opus;").replace(/^no$/,""))&&(s.opus=!0),t.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(s.mp3=!0),t.canPlayType('audio/wav; codecs="1"').replace(/^no$/,"")&&(s.wav=!0),(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/aac;").replace(/^no$/,""))&&(s.m4a=!0),t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")&&(s.webm=!0),""!==t.canPlayType('audio/mp4;codecs="ec-3"')))if(n.edge)s.dolby=!0;else if(n.safari&&9<=n.safariVersion&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var i=parseInt(RegExp.$1,10),r=parseInt(RegExp.$2,10);(10===i&&11<=r||10<i)&&(s.dolby=!0)}}catch(t){}return s}()},function(t,e){var i={h264:!1,hls:!1,mp4:!1,ogg:!1,vp9:!1,webm:!1};t.exports=function(){var t=document.createElement("video"),e=!!t.canPlayType;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"")&&(i.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.h264=!0,i.mp4=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")&&(i.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,"")&&(i.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.hls=!0))}catch(t){}return i}()},function(t,e){var i={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){var t,e="Fullscreen",n="FullScreen",s=["request"+e,"request"+n,"webkitRequest"+e,"webkitRequest"+n,"msRequest"+e,"msRequest"+n,"mozRequest"+n,"mozRequest"+e];for(t=0;t<s.length;t++)if(document.documentElement[s[t]]){i.available=!0,i.request=s[t];break}var r=["cancel"+n,"exit"+e,"webkitCancel"+n,"webkitExit"+e,"msCancel"+n,"msExit"+e,"mozCancel"+n,"mozExit"+e];if(i.available)for(t=0;t<r.length;t++)if(document[r[t]]){i.cancel=r[t];break}return window.Element&&Element.ALLOW_KEYBOARD_INPUT&&!/ Version\/5\.1(?:\.\d+)? Safari\//.test(navigator.userAgent)&&(i.keyboard=!0),Object.defineProperty(i,"active",{get:function(){return!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)}}),i}()},function(t,e,i){t.exports={Between:i(139),BetweenPoints:i(390),BetweenPointsY:i(391),BetweenY:i(392),CounterClockwise:i(393),Normalize:i(140),Random:i(394),RandomDegrees:i(395),Reverse:i(396),RotateTo:i(397),ShortestBetween:i(398),Wrap:i(118),WrapDegrees:i(119)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},function(t,e){t.exports=function(t,e,i,n){return Math.atan2(i-t,n-e)}},function(t,e,i){var n=i(9);t.exports=function(t){return t>Math.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},function(t,e,i){var n=i(67);t.exports=function(){return n(-Math.PI,Math.PI)}},function(t,e,i){var n=i(67);t.exports=function(){return n(-180,180)}},function(t,e,i){var n=i(140);t.exports=function(t){return n(t+Math.PI)}},function(t,e,i){var n=i(9);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(e<t?e+=n.PI2:e-=n.PI2),t<e?t+=i:e<t&&(t-=i))),t}},function(t,e){t.exports=function(t,e){var i=e-t;return 0==i?0:i-360*Math.floor((i+180)/360)}},function(t,e,i){t.exports={Between:i(68),BetweenPoints:i(400),BetweenPointsSquared:i(401),Chebyshev:i(402),Power:i(403),Snake:i(404),Squared:i(405)}},function(t,e){t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)}},function(t,e){t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n}},function(t,e){t.exports=function(t,e,i,n){return Math.max(Math.abs(t-i),Math.abs(e-n))}},function(t,e){t.exports=function(t,e,i,n,s){return void 0===s&&(s=2),Math.sqrt(Math.pow(i-t,s)+Math.pow(n-e,s))}},function(t,e){t.exports=function(t,e,i,n){return Math.abs(t-i)+Math.abs(e-n)}},function(t,e){t.exports=function(t,e,i,n){var s=t-i,r=e-n;return s*s+r*r}},function(t,e,i){t.exports={Back:i(124),Bounce:i(125),Circular:i(126),Cubic:i(127),Elastic:i(128),Expo:i(129),Linear:i(130),Quadratic:i(131),Quartic:i(132),Quintic:i(133),Sine:i(134),Stepped:i(135)}},function(t,e,i){t.exports={Ceil:i(408),Equal:i(61),Floor:i(409),GreaterThan:i(410),LessThan:i(411)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),e-i<t}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t<e+i}},function(t,e,i){t.exports={Bezier:i(413),CatmullRom:i(414),CubicBezier:i(415),Linear:i(416),QuadraticBezier:i(417),SmoothStep:i(144),SmootherStep:i(418)}},function(t,e,i){var n=i(141);t.exports=function(t,e){for(var i=0,s=t.length-1,r=0;r<=s;r++)i+=Math.pow(1-e,s-r)*Math.pow(e,r)*t[r]*n(s,r);return i}},function(t,e,i){var n=i(143);t.exports=function(t,e){var i=t.length-1,s=i*e,r=Math.floor(s);return t[0]===t[i]?(e<0&&(r=Math.floor(s=i*(1+e))),n(s-r,t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i])):e<0?t[0]-(n(-s,t[0],t[0],t[1],t[1])-t[0]):1<e?t[i]-(n(s-i,t[i],t[i],t[i-1],t[i-1])-t[i]):n(s-r,t[r?r-1:0],t[r],t[i<r+1?i:r+1],t[i<r+2?i:r+2])}},function(t,e){t.exports=function(t,e,i,n,s){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,n)+function(t,e){return t*t*t*e}(t,s)}},function(t,e,i){var n=i(64);t.exports=function(t,e){var i=t.length-1,s=i*e,r=Math.floor(s);return e<0?n(t[0],t[1],s):1<e?n(t[i],t[i-1],i-s):n(t[r],t[i<r+1?i:r+1],s-r)}},function(t,e){t.exports=function(t,e,i,n){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,n)}},function(t,e,i){var n=i(146);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){t.exports={GetNext:i(420),IsSize:i(44),IsValue:i(421)}},function(t,e){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<<Math.ceil(e)}},function(t,e){t.exports=function(t){return 0<t&&0==(t&t-1)}},function(t,e,i){t.exports={Ceil:i(423),Floor:i(45),To:i(424)}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),n?(i+t)/e:i+t)}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),n?(i+t)/e:i+t)}},function(t,e,i){var n=new(i(0))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var n=0;n<t.length;n++)e=.02519603282416938*(i+=t.charCodeAt(n)),e-=i=e>>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return 2.3283064365386963e-10*((this.n=i)>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e<t.length&&null!=t[e];e++){var i=t[e];this.s0-=this.hash(i),this.s0+=~~(this.s0<0),this.s1-=this.hash(i),this.s1+=~~(this.s1<0),this.s2-=this.hash(i),this.s2+=~~(this.s2<0)}},integer:function(){return 4294967296*this.rnd()},frac:function(){return this.rnd()+11102230246251565e-32*(2097152*this.rnd()|0)},real:function(){return this.integer()+this.frac()},integerInRange:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},between:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},realInRange:function(t,e){return this.frac()*(e-t)+t},normal:function(){return 1-2*this.frac()},uuid:function(){var t="",e="";for(e=t="";t++<36;e+=~t%5|3*t&4?(15^t?8^this.frac()*(20^t?16:4):4).toString(16):"-");return e},pick:function(t){return t[this.integerInRange(0,t.length-1)]},sign:function(){return this.pick(this.signs)},weightedPick:function(t){return t[~~(Math.pow(this.frac(),2)*(t.length-1)+.5)]},timestamp:function(t,e){return this.realInRange(t||9466848e5,e||1577862e6)},angle:function(){return this.integerInRange(-180,180)},rotation:function(){return this.realInRange(-3.1415926,3.1415926)},state:function(t){return"string"==typeof t&&t.match(/^!rnd/)&&(t=t.split(","),this.c=parseFloat(t[1]),this.s0=parseFloat(t[2]),this.s1=parseFloat(t[3]),this.s2=parseFloat(t[4])),["!rnd",this.c,this.s0,this.s1,this.s2].join(",")},shuffle:function(t){for(var e=t.length-1;0<e;e--){var i=Math.floor(this.frac()*(e+1)),n=t[i];t[i]=t[e],t[e]=n}return t}});t.exports=n},function(t,e){t.exports=function(t){for(var e=0,i=0;i<t.length;i++)e+=+t[i];return e/t.length}},function(t,e){t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.ceil(t*n)/n}},function(t,e){t.exports=function(t,e){return Math.abs(t-e)}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.floor(t*n)/n}},function(t,e){t.exports=function(t,e){return t/e/1e3}},function(t,e){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t,e,i){return Math.min(t+e,i)}},function(t,e){t.exports=function(t,e,i){return Math.max(t-e,i)}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=e+1);var s=(t-e)/(i-e);return 1<s?void 0!==n?(s=(n-t)/(n-i))<0&&(s=0):s=1:s<0&&(s=0),s}},function(t,e,i){var n=i(9);t.exports=function(t){return t*n.RAD_TO_DEG}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,n=2*Math.random()-1,s=Math.sqrt(1-n*n)*e;return t.x=Math.cos(i)*s,t.y=Math.sin(i)*s,t.z=n*e,t}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},function(t,e){t.exports=function(t,e){var i=t.x,n=t.y;return t.x=i*Math.cos(e)-n*Math.sin(e),t.y=i*Math.sin(e)+n*Math.cos(e),t}},function(t,e){t.exports=function(t,e,i,n,s){var r=n+Math.atan2(t.y-i,t.x-e);return t.x=e+s*Math.cos(r),t.y=i+s*Math.sin(r),t}},function(t,e){t.exports=function(t,e,i,n,s){return t.x=e+s*Math.cos(n),t.y=i+s*Math.sin(n),t}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.round(t*n)/n}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),n*=Math.PI/t;for(var s=[],r=[],a=0;a<t;a++)e+=(i-=e*n)*n,s[a]=i,r[a]=e;return{sin:r,cos:s,length:t}}},function(t,e,i){var n=i(7);t.exports=function(t,e,i,s){void 0===s&&(s=new n);var r=0,a=0;return 0<t&&t<=e*i&&(r=e-1<t?t-(a=Math.floor(t/e))*e:t,s.set(r,a)),s}},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},clone:function(){return new n(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n;return 0<s&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return Math.sqrt(e*e+i*i+n*n+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return e*e+i*i+n*n+s*s},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*n+r[12]*s,this.y=r[1]*e+r[5]*i+r[9]*n+r[13]*s,this.z=r[2]*e+r[6]*i+r[10]*n+r[14]*s,this.w=r[3]*e+r[7]*i+r[11]*n+r[15]*s,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,a=t.z,o=t.w,h=o*e+r*n-a*i,u=o*i+a*e-s*n,c=o*n+s*i-r*e,l=-s*e-r*i-a*n;return this.x=h*o+l*-s+u*-a-c*-r,this.y=u*o+l*-r+c*-s-h*-a,this.z=c*o+l*-a+h*-r-u*-s,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});n.prototype.sub=n.prototype.subtract,n.prototype.mul=n.prototype.multiply,n.prototype.div=n.prototype.divide,n.prototype.dist=n.prototype.distance,n.prototype.distSq=n.prototype.distanceSq,n.prototype.len=n.prototype.length,n.prototype.lenSq=n.prototype.lengthSq,t.exports=n},function(t,e,i){var n=i(69),s=i(150),r=i(151),a=new s,o=new r,h=new n;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},function(t,e){t.exports={setCrisp:function(t){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach((function(e){t.style["image-rendering"]=e})),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e){t.exports="addtexture"},function(t,e){t.exports="onerror"},function(t,e){t.exports="onload"},function(t,e){t.exports="ready"},function(t,e){t.exports="removetexture"},function(t,e){t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool uInvertMaskAlpha;","","void main()","{"," vec2 uv = gl_FragCoord.xy / uResolution;"," vec4 mainColor = texture2D(uMainSampler, uv);"," vec4 maskColor = texture2D(uMaskSampler, uv);"," float alpha = mainColor.a;",""," if (!uInvertMaskAlpha)"," {"," alpha *= (maskColor.a);"," }"," else"," {"," alpha *= (1.0 - maskColor.a);"," }",""," gl_FragColor = vec4(mainColor.rgb * alpha, alpha);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_VS","","precision mediump float;","","attribute vec2 inPosition;","","void main()","{"," gl_Position = vec4(inPosition, 0.0, 1.0);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_FORWARD_DIFFUSE_FS","","precision mediump float;","","struct Light","{"," vec2 position;"," vec3 color;"," float intensity;"," float radius;","};","","const int kMaxLights = %LIGHT_COUNT%;","","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform mat3 uInverseRotationMatrix;","","varying vec2 outTexCoord;","varying vec4 outTint;","","void main()","{"," vec3 finalColor = vec3(0.0, 0.0, 0.0);"," vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.rgb * outTint.a, outTint.a);"," vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;",""," for (int index = 0; index < kMaxLights; ++index)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," vec3 diffuse = light.color * diffuseFactor;"," finalColor += (attenuation * diffuse) * light.intensity;"," }",""," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);"," gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);","","}",""].join("\n")},function(t,e,i){"use strict";function n(t,e,i){i=i||2;var n,o,h,u,c,p,m,g=e&&e.length,v=g?e[0]*i:t.length,y=s(t,0,v,i,!0),_=[];if(!y||y.next===y.prev)return _;if(g&&(y=function(t,e,i,n){var a,o,h,u=[];for(a=0,o=e.length;a<o;a++)(h=s(t,e[a]*n,a<o-1?e[a+1]*n:t.length,n,!1))===h.next&&(h.steiner=!0),u.push(f(h));for(u.sort(l),a=0;a<u.length;a++)d(u[a],i),i=r(i,i.next);return i}(t,e,y,i)),t.length>80*i){n=h=t[0],o=u=t[1];for(var x=i;x<v;x+=i)(c=t[x])<n&&(n=c),(p=t[x+1])<o&&(o=p),h<c&&(h=c),u<p&&(u=p);m=0!==(m=Math.max(h-n,u-o))?1/m:0}return a(y,_,i,n,o,m),_}function s(t,e,i,n,s){var r,a;if(s===0<S(t,e,i,n))for(r=e;r<i;r+=n)a=E(r,t[r],t[r+1],a);else for(r=i-n;e<=r;r-=n)a=E(r,t[r],t[r+1],a);return a&&v(a,a.next)&&(T(a),a=a.next),a}function r(t,e){if(!t)return t;e=e||t;var i,n=t;do{if(i=!1,n.steiner||!v(n,n.next)&&0!==g(n.prev,n,n.next))n=n.next;else{if(T(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function a(t,e,i,n,s,l,d){if(t){!d&&l&&function(t,e,i,n){for(var s=t;null===s.z&&(s.z=p(s.x,s.y,e,i,n)),s.prevZ=s.prev,s.nextZ=s.next,(s=s.next)!==t;);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,n,s,r,a,o,h,u=1;do{for(i=t,r=t=null,a=0;i;){for(a++,n=i,e=o=0;e<u&&(o++,n=n.nextZ);e++);for(h=u;0<o||0<h&&n;)0!==o&&(0===h||!n||i.z<=n.z)?(i=(s=i).nextZ,o--):(n=(s=n).nextZ,h--),r?r.nextZ=s:t=s,s.prevZ=r,r=s;i=n}r.nextZ=null,u*=2}while(1<a)}(s)}(t,n,s,l);for(var f,m,g=t;t.prev!==t.next;)if(f=t.prev,m=t.next,l?h(t,n,s,l):o(t))e.push(f.i/i),e.push(t.i/i),e.push(m.i/i),T(t),t=m.next,g=m.next;else if((t=m)===g){d?1===d?a(t=u(t,e,i),e,i,n,s,l,2):2===d&&c(t,e,i,n,s,l):a(r(t),e,i,n,s,l,1);break}}}function o(t){var e=t.prev,i=t,n=t.next;if(0<=g(e,i,n))return!1;for(var s=t.next.next;s!==t.prev;){if(m(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&0<=g(s.prev,s,s.next))return!1;s=s.next}return!0}function h(t,e,i,n){var s=t.prev,r=t,a=t.next;if(0<=g(s,r,a))return!1;for(var o=s.x<r.x?s.x<a.x?s.x:a.x:r.x<a.x?r.x:a.x,h=s.y<r.y?s.y<a.y?s.y:a.y:r.y<a.y?r.y:a.y,u=s.x>r.x?s.x>a.x?s.x:a.x:r.x>a.x?r.x:a.x,c=s.y>r.y?s.y>a.y?s.y:a.y:r.y>a.y?r.y:a.y,l=p(o,h,e,i,n),d=p(u,c,e,i,n),f=t.prevZ,v=t.nextZ;f&&f.z>=l&&v&&v.z<=d;){if(f!==t.prev&&f!==t.next&&m(s.x,s.y,r.x,r.y,a.x,a.y,f.x,f.y)&&0<=g(f.prev,f,f.next))return!1;if(f=f.prevZ,v!==t.prev&&v!==t.next&&m(s.x,s.y,r.x,r.y,a.x,a.y,v.x,v.y)&&0<=g(v.prev,v,v.next))return!1;v=v.nextZ}for(;f&&f.z>=l;){if(f!==t.prev&&f!==t.next&&m(s.x,s.y,r.x,r.y,a.x,a.y,f.x,f.y)&&0<=g(f.prev,f,f.next))return!1;f=f.prevZ}for(;v&&v.z<=d;){if(v!==t.prev&&v!==t.next&&m(s.x,s.y,r.x,r.y,a.x,a.y,v.x,v.y)&&0<=g(v.prev,v,v.next))return!1;v=v.nextZ}return!0}function u(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!v(s,r)&&y(s,n,n.next,r)&&_(s,r)&&_(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),T(n),T(n.next),n=t=r),n=n.next}while(n!==t);return n}function c(t,e,i,n,s,o){var h,u,c=t;do{for(var l=c.next.next;l!==c.prev;){if(c.i!==l.i&&(u=l,(h=c).next.i!==u.i&&h.prev.i!==u.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&y(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(h,u)&&_(h,u)&&_(u,h)&&function(t,e){for(var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),(i=i.next)!==t;);return n}(h,u))){var d=x(c,l);return c=r(c,c.next),d=r(d,d.next),a(c,e,i,n,s,o),void a(d,e,i,n,s,o)}l=l.next}c=c.next}while(c!==t)}function l(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var i,n=e,s=t.x,r=t.y,a=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var o=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(o<=s&&a<o){if((a=o)===s){if(r===n.y)return n;if(r===n.next.y)return n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!i)return null;if(s===a)return i.prev;var h,u=i,c=i.x,l=i.y,d=1/0;for(n=i.next;n!==u;)s>=n.x&&n.x>=c&&s!==n.x&&m(r<l?s:a,r,c,l,r<l?a:s,r,n.x,n.y)&&((h=Math.abs(r-n.y)/(s-n.x))<d||h===d&&n.x>i.x)&&_(n,t)&&(i=n,d=h),n=n.next;return i}(t,e)){var i=x(e,t);r(i,i.next)}}function p(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*s)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*s)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){for(var e=t,i=t;e.x<i.x&&(i=e),(e=e.next)!==t;);return i}function m(t,e,i,n,s,r,a,o){return 0<=(s-a)*(e-o)-(t-a)*(r-o)&&0<=(t-a)*(n-o)-(i-a)*(e-o)&&0<=(i-a)*(r-o)-(s-a)*(n-o)}function g(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function v(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,i,n){return!!(v(t,e)&&v(i,n)||v(t,n)&&v(i,e))||0<g(t,e,i)!=0<g(t,e,n)&&0<g(i,n,t)!=0<g(i,n,e)}function _(t,e){return g(t.prev,t,t.next)<0?0<=g(t,e,t.next)&&0<=g(t,t.prev,e):g(t,e,t.prev)<0||g(t,t.next,e)<0}function x(t,e){var i=new w(t.i,t.x,t.y),n=new w(e.i,e.x,e.y),s=t.next,r=e.prev;return(t.next=e).prev=t,(i.next=s).prev=i,(n.next=i).prev=n,(r.next=n).prev=r,n}function E(t,e,i,n){var s=new w(t,e,i);return n?(s.next=n.next,(s.prev=n).next.prev=s,n.next=s):(s.prev=s).next=s,s}function T(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function w(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(t,e,i,n){for(var s=0,r=e,a=i-n;r<i;r+=n)s+=(t[a]-t[r])*(t[r+1]+t[a+1]),a=r;return s}(t.exports=n).deviation=function(t,e,i,n){var s=e&&e.length,r=s?e[0]*i:t.length,a=Math.abs(S(t,0,r,i));if(s)for(var o=0,h=e.length;o<h;o++){var u=e[o]*i,c=o<h-1?e[o+1]*i:t.length;a-=Math.abs(S(t,u,c,i))}var l=0;for(o=0;o<n.length;o+=3){var d=n[o]*i,p=n[o+1]*i,f=n[o+2]*i;l+=Math.abs((t[d]-t[f])*(t[1+p]-t[1+d])-(t[d]-t[p])*(t[1+f]-t[1+d]))}return 0===a&&0===l?0:Math.abs((l-a)/a)},n.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},n=0,s=0;s<t.length;s++){for(var r=0;r<t[s].length;r++)for(var a=0;a<e;a++)i.vertices.push(t[s][r][a]);0<s&&(n+=t[s-1].length,i.holes.push(n))}return i}},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(){this.isRunning=!1,this.callback=s,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0,this.target=0;var t=this;this.step=function e(){var i=window.performance.now();t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.requestAnimationFrame(e)},this.stepTimeout=function e(){var i=Date.now(),n=Math.min(Math.max(2*t.target+t.tick-i,0),t.target);t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.setTimeout(e,n)}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.target=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=s}});t.exports=r},function(t,e,i){var n=i(0),s=i(3),r=i(10),a=new n({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",a,"events"),t.exports=a},function(t,e,i){var n=i(73),s=i(101),r=i(105),a=i(12),o=i(0),h=i(136),u=i(463),c=i(152),l=i(166),d=i(163),p=i(137),f=i(469),m=i(3),g=i(6),v=i(167),y=i(10),_=i(172),x=i(174),E=i(179),T=i(46),w=i(183),S=i(164),b=i(165),A=i(543),C=new o({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new m,this.anims=new s(this),this.textures=new w(this),this.cache=new r(this),this.registry=new l(this),this.input=new v(this,this.config),this.scene=new E(this,this.config.sceneConfig),this.device=p,this.scale=new x(this,this.config),this.sound=null,this.sound=A.create(this),this.loop=new S(this,this.config.fps),this.plugins=new _(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,f(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),c(this),u(this),d(this),n(this.canvas,this.config.parent),this.textures.once(T.READY,this.texturesReady,this),this.events.emit(g.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(g.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),b(this);var t=this.events;t.on(g.HIDDEN,this.onHidden,this),t.on(g.VISIBLE,this.onVisible,this),t.on(g.BLUR,this.onBlur,this),t.on(g.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e);var n=this.renderer;n.preRender(),i.emit(g.PRE_RENDER,n,t,e),this.scene.render(n),n.postRender(),i.emit(g.POST_RENDER,n,t,e)},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e),i.emit(g.PRE_RENDER),i.emit(g.POST_RENDER)},onHidden:function(){this.loop.pause(),this.events.emit(g.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(g.RESUME)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(g.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(a.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=C},function(t,e,i){var n=i(73);t.exports=function(t){var e=t.config;if(e.parent&&e.domCreateContainer){var i=document.createElement("div");i.style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: none;","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,n(i,e.parent)}}},function(t,e,i){t.exports={CHANGE_DATA:i(465),CHANGE_DATA_KEY:i(466),REMOVE_DATA:i(467),SET_DATA:i(468)}},function(t,e){t.exports="changedata"},function(t,e){t.exports="changedata-"},function(t,e){t.exports="removedata"},function(t,e){t.exports="setdata"},function(t,e,i){var n=i(42);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?n.cordova?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},function(t,e){t.exports="boot"},function(t,e){t.exports="destroy"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameout"},function(t,e){t.exports="gameover"},function(t,e){t.exports="gameobjectdown"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameobjectmove"},function(t,e){t.exports="gameobjectout"},function(t,e){t.exports="gameobjectover"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="wheel"},function(t,e){t.exports="gameobjectup"},function(t,e){t.exports="gameobjectwheel"},function(t,e){t.exports="boot"},function(t,e){t.exports="process"},function(t,e){t.exports="update"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointerdownoutside"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="pointerupoutside"},function(t,e){t.exports="wheel"},function(t,e){t.exports="pointerlockchange"},function(t,e){t.exports="preupdate"},function(t,e){t.exports="shutdown"},function(t,e){t.exports="start"},function(t,e){t.exports="update"},function(t,e){t.exports=function(t){if(!t)return window.innerHeight;var e=Math.abs(window.orientation),i={w:0,h:0},n=document.createElement("div");return n.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(n),i.w=90===e?n.offsetHeight:window.innerWidth,i.h=90===e?window.innerWidth:n.offsetHeight,document.documentElement.removeChild(n),n=null,90!==Math.abs(window.orientation)?i.h:i.w}},function(t,e){t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||document.body}},function(t,e,i){var n=i(75);t.exports=function(t,e){var i=window.screen,s=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);if(s&&"string"==typeof s.type)return s.type;if("string"==typeof s)return s;if(i)return i.height>i.width?n.ORIENTATION.PORTRAIT:n.ORIENTATION.LANDSCAPE;if("number"==typeof window.orientation)return 0===window.orientation||180===window.orientation?n.ORIENTATION.PORTRAIT:n.ORIENTATION.LANDSCAPE;if(window.matchMedia){if(window.matchMedia("(orientation: portrait)").matches)return n.ORIENTATION.PORTRAIT;if(window.matchMedia("(orientation: landscape)").matches)return n.ORIENTATION.LANDSCAPE}return t<e?n.ORIENTATION.PORTRAIT:n.ORIENTATION.LANDSCAPE}},function(t,e,i){var n=i(5),s=i(0),r=i(45),a=i(7),o=new s({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=null),this._width=t,this._height=e,this._parent=n,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new a},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=n(t,0,this.maxWidth),this.minHeight=n(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=n(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=n(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case o.NONE:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case o.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case o.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(r(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case o.FIT:this.constrain(t,e,!0);break;case o.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var n=this.snapTo,s=0===e?1:t/e;return i&&this.aspectRatio>s||!i&&this.aspectRatio<s?(e=(t=r(t,n.x))/this.aspectRatio,0<n.y&&(t=(e=r(e,n.y))*this.aspectRatio)):(i&&this.aspectRatio<s||!i&&this.aspectRatio>s)&&(t=(e=r(e,n.y))*this.aspectRatio,0<n.x&&(e=(t=r(t,n.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});o.NONE=0,o.WIDTH_CONTROLS_HEIGHT=1,o.HEIGHT_CONTROLS_WIDTH=2,o.FIT=3,o.ENVELOP=4,t.exports=o},function(t,e){t.exports="addfile"},function(t,e){t.exports="complete"},function(t,e){t.exports="filecomplete"},function(t,e){t.exports="filecomplete-"},function(t,e){t.exports="loaderror"},function(t,e){t.exports="load"},function(t,e){t.exports="fileprogress"},function(t,e){t.exports="postprocess"},function(t,e){t.exports="progress"},function(t,e){t.exports="start"},function(t,e,i){var n=i(4),s=i(78);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=n(t.settings,"physics",!1);if(e||i){var r=[];if(e&&r.push(s(e+"Physics")),i)for(var a in i)a=s(a.concat("Physics")),-1===r.indexOf(a)&&r.push(a);return r}}},function(t,e,i){var n=i(4);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=n(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},function(t,e,i){t.exports={game:"game",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},function(t,e,i){var n=i(534),s=i(12),r=i(2);t.exports=function(t){var e=r(t,"data",[]),i=r(t,"canvas",null),a=r(t,"palette",n),o=r(t,"pixelWidth",1),h=r(t,"pixelHeight",o),u=r(t,"resizeCanvas",!0),c=r(t,"clearCanvas",!0),l=r(t,"preRender",null),d=r(t,"postRender",null),p=Math.floor(Math.abs(e[0].length*o)),f=Math.floor(Math.abs(e.length*h));i||(i=s.create2D(this,p,f),c=u=!1),u&&(i.width=p,i.height=f);var m=i.getContext("2d");c&&m.clearRect(0,0,p,f),l&&l(i,m);for(var g=0;g<e.length;g++)for(var v=e[g],y=0;y<v.length;y++){var _=v[y];"."!==_&&" "!==_&&(m.fillStyle=a[_],m.fillRect(y*o,g*h,o,h))}return d&&d(i,m),i}},function(t,e){t.exports={0:"#000",1:"#9D9D9D",2:"#FFF",3:"#BE2633",4:"#E06F8B",5:"#493C2B",6:"#A46422",7:"#EB8931",8:"#F7E26B",9:"#2F484E",A:"#44891A",B:"#A3CE27",C:"#1B2632",D:"#005784",E:"#31A2F2",F:"#B2DCEF"}},function(t,e){t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var s,r=i.getElementsByTagName("SubTexture"),a=0;a<r.length;a++){var o=r[a].attributes,h=o.name.value,u=parseInt(o.x.value,10),c=parseInt(o.y.value,10),l=parseInt(o.width.value,10),d=parseInt(o.height.value,10);if(s=t.add(h,e,u,c,l,d),o.frameX){var p=Math.abs(parseInt(o.frameX.value,10)),f=Math.abs(parseInt(o.frameY.value,10)),m=parseInt(o.frameWidth.value,10),g=parseInt(o.frameHeight.value,10);s.setTrim(l,d,p,f,m,g)}}return t}console.warn("Invalid Texture Atlas XML given")}},function(t,e){t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},function(t,e){t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},function(t,e,i){var n=i(26);t.exports=function(t,e,i){if(i.frames||i.textures){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);for(var r,a=Array.isArray(i.textures)?i.textures[e].frames:i.frames,o=0;o<a.length;o++){var h=a[o];r=t.add(h.filename,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h),h.trimmed&&r.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(r.rotated=!0,r.updateUVsInverted());var u=h.anchor||h.pivot;u&&(r.customPivot=!0,r.pivotX=u.x,r.pivotY=u.y),r.customData=n(h)}for(var c in i)"frames"!==c&&(Array.isArray(i[c])?t.customData[c]=i[c].slice(0):t.customData[c]=i[c]);return t}console.warn("Invalid Texture Atlas JSON Array")}},function(t,e,i){var n=i(26);t.exports=function(t,e,i){if(i.frames){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);var r,a=i.frames;for(var o in a){var h=a[o];r=t.add(o,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h),h.trimmed&&r.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(r.rotated=!0,r.updateUVsInverted());var u=h.anchor||h.pivot;u&&(r.customPivot=!0,r.pivotX=u.x,r.pivotY=u.y),r.customData=n(h)}for(var c in i)"frames"!==c&&(Array.isArray(i[c])?t.customData[c]=i[c].slice(0):t.customData[c]=i[c]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},function(t,e,i){var n=i(4);t.exports=function(t,e,i,s,r,a,o){var h=n(o,"frameWidth",null),u=n(o,"frameHeight",h);if(null===h)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var c=t.source[e];t.add("__BASE",e,0,0,c.width,c.height);var l=n(o,"startFrame",0),d=n(o,"endFrame",-1),p=n(o,"margin",0),f=n(o,"spacing",0),m=Math.floor((r-p+f)/(h+f))*Math.floor((a-p+f)/(u+f));0===m&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",t.key),(m<l||l<-m)&&(l=0),l<0&&(l=m+l),-1!==d&&(m=l+(d+1));for(var g=p,v=p,y=0,_=0,x=0;x<m;x++){_=y=0;var E=g+h,T=v+u;r<E&&(y=E-r),a<T&&(_=T-a),t.add(x,e,i+g,s+v,h-y,u-_),r<(g+=h+f)+h&&(g=p,v+=u+f)}return t}},function(t,e,i){var n=i(4);t.exports=function(t,e,i){var s=n(i,"frameWidth",null),r=n(i,"frameHeight",s);if(!s)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var a=t.source[0];t.add("__BASE",0,0,0,a.width,a.height);var o,h=n(i,"startFrame",0),u=n(i,"endFrame",-1),c=n(i,"margin",0),l=n(i,"spacing",0),d=e.cutX,p=e.cutY,f=e.cutWidth,m=e.cutHeight,g=e.realWidth,v=e.realHeight,y=Math.floor((g-c+l)/(s+l)),_=Math.floor((v-c+l)/(r+l)),x=y*_,E=e.x,T=s-E,w=s-(g-f-E),S=e.y,b=r-S,A=r-(v-m-S);(x<h||h<-x)&&(h=0),h<0&&(h=x+h),-1!==u&&(x=h+(u+1));for(var C=c,O=c,M=0,R=e.sourceIndex,P=0;P<_;P++){for(var I=0===P,L=P===_-1,G=0;G<y;G++){var D=0===G,k=G===y-1;if(o=t.add(M,R,d+C,p+O,s,r),D||I||k||L){var F=D?E:0,N=I?S:0,B=0,U=0;D&&(B+=s-T),k&&(B+=s-w),I&&(U+=r-b),L&&(U+=r-A);var V=s-B,Y=r-U;o.cutWidth=V,o.cutHeight=Y,o.setTrim(s,r,F,N,V,Y)}C+=l,C+=D?T:k?w:s,M++}C=c,O+=l,O+=I?b:L?A:r}return t}},function(t,e){function i(t,e,i,s){var r=n-s.y-s.height;t.add(i,e,s.x,r,s.width,s.height)}var n=0;t.exports=function(t,e,s){var r=t.source[e];t.add("__BASE",e,0,0,r.width,r.height),n=r.height;for(var a=s.split("\n"),o=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",u="",c={x:0,y:0,width:0,height:0},l=0;l<a.length;l++){var d=a[l].match(o);if(d){var p="- "===d[1],f=d[2],m=d[3];if(p&&(u!==h&&(i(t,e,u,c),h=u),c={x:0,y:0,width:0,height:0}),"name"!==f)switch(f){case"x":case"y":case"width":case"height":c[f]=parseInt(m,10)}else u=m}}return u!==h&&i(t,e,u,c),t}},function(t,e,i){var n=i(544),s=i(569),r=i(571),a={create:function(t){var e=t.config.audio,i=t.device.audio;return e&&e.noAudio||!i.webAudio&&!i.audioData?new s(t):!i.webAudio||e&&e.disableWebAudio?new n(t):new r(t)}};t.exports=a},function(t,e,i){var n=i(81),s=i(0),r=i(28),a=i(568),o=new s({Extends:n,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,n.call(this,t)},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each((function(e,i){for(var n=0;n<i.length;n++)if("true"===i[n].dataset.locked)return!(t.locked=!0);return!0})),this.locked){function e(){i=!0}var i=!1,n=function(){if(i)i=!1;else{document.body.removeEventListener("touchmove",e),document.body.removeEventListener("touchend",n);var s=[];if(t.game.cache.audio.entries.each((function(t,e){for(var i=0;i<e.length;i++){var n=e[i];"true"===n.dataset.locked&&s.push(n)}return!0})),0!==s.length){var r=s[s.length-1];r.oncanplaythrough=function(){r.oncanplaythrough=null,s.forEach((function(t){t.dataset.locked="false"})),t.unlocked=!0},s.forEach((function(t){t.load()}))}}};this.once(r.UNLOCKED,(function(){for(this.forEachActiveSound((function(t){null===t.currentMarker&&0===t.duration&&(t.duration=t.tags[0].duration),t.totalDuration=t.tags[0].duration}));this.lockedActionsQueue.length;){var t=this.lockedActionsQueue.shift();t.sound[t.prop].apply?t.sound[t.prop].apply(t.sound,t.value||[]):t.sound[t.prop]=t.value}}),this),document.body.addEventListener("touchmove",e,!1),document.body.addEventListener("touchend",n,!1)}},onBlur:function(){this.forEachActiveSound((function(t){t.isPlaying&&(this.onBlurPausedSounds.push(t),t.onBlur())}))},onFocus:function(){this.onBlurPausedSounds.forEach((function(t){t.onFocus()})),this.onBlurPausedSounds.length=0},destroy:function(){n.prototype.destroy.call(this),this.onBlurPausedSounds.length=0,this.onBlurPausedSounds=null},isLocked:function(t,e,i){return"true"===t.tags[0].dataset.locked&&(this.lockedActionsQueue.push({sound:t,prop:e,value:i}),!0)},setMute:function(t){return this.mute=t,this},mute:{get:function(){return this._mute},set:function(t){this._mute=t,this.forEachActiveSound((function(t){t.updateMute()})),this.emit(r.GLOBAL_MUTE,this,t)}},setVolume:function(t){return this.volume=t,this},volume:{get:function(){return this._volume},set:function(t){this._volume=t,this.forEachActiveSound((function(t){t.updateVolume()})),this.emit(r.GLOBAL_VOLUME,this,t)}}});t.exports=o},function(t,e){t.exports="complete"},function(t,e){t.exports="decoded"},function(t,e){t.exports="decodedall"},function(t,e){t.exports="destroy"},function(t,e){t.exports="detune"},function(t,e){t.exports="detune"},function(t,e){t.exports="mute"},function(t,e){t.exports="rate"},function(t,e){t.exports="volume"},function(t,e){t.exports="loop"},function(t,e){t.exports="looped"},function(t,e){t.exports="mute"},function(t,e){t.exports="pauseall"},function(t,e){t.exports="pause"},function(t,e){t.exports="play"},function(t,e){t.exports="rate"},function(t,e){t.exports="resumeall"},function(t,e){t.exports="resume"},function(t,e){t.exports="seek"},function(t,e){t.exports="stopall"},function(t,e){t.exports="stop"},function(t,e){t.exports="unlocked"},function(t,e){t.exports="volume"},function(t,e,i){var n=i(82),s=i(0),r=i(28),a=i(5),o=new s({Extends:n,initialize:function(t,e,i){if(void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),!this.tags)throw new Error('There is no audio asset with key "'+e+'" in the audio cache');this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,n.call(this,t,e,i)},play:function(t,e){return!(this.manager.isLocked(this,"play",[t,e])||!n.prototype.play.call(this,t,e)||!this.pickAndPlayAudioTag()||(this.emit(r.PLAY,this),0))},pause:function(){return!(this.manager.isLocked(this,"pause")||0<this.startTime||!n.prototype.pause.call(this)||(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(r.PAUSE,this),0))},resume:function(){return!(this.manager.isLocked(this,"resume")||0<this.startTime||!n.prototype.resume.call(this)||!this.pickAndPlayAudioTag()||(this.emit(r.RESUME,this),0))},stop:function(){return!this.manager.isLocked(this,"stop")&&!!n.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(r.STOP,this),!0)},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t<this.tags.length;t++){var e=this.tags[t];if("false"===e.dataset.used)return e.dataset.used="true",this.audio=e,!0}if(!this.manager.override)return!1;var i=[];this.manager.forEachActiveSound((function(t){t.key===this.key&&t.audio&&i.push(t)}),this),i.sort((function(t,e){return t.loop===e.loop?e.seek/e.duration-t.seek/t.duration:t.loop?1:-1}));var n=i[0];return this.audio=n.audio,n.reset(),n.audio=null,n.startTime=0,!(n.previousTime=0)},playCatchPromise:function(){var t=this.audio.play();t&&t.catch((function(t){console.warn(t)}))},stopAndReleaseAudioTag:function(){this.startTime=0,this.previousTime=0,this.audio&&(this.audio.pause(),this.audio.dataset.used="false",this.audio=null)},reset:function(){n.prototype.stop.call(this)},onBlur:function(){this.isPlaying=!1,this.isPaused=!0,this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.currentConfig.delay=Math.max(0,(this.startTime-window.performance.now())/1e3),this.stopAndReleaseAudioTag()},onFocus:function(){this.isPlaying=!0,this.isPaused=!1,this.pickAndPlayAudioTag()},update:function(t,e){if(this.isPlaying)if(0<this.startTime)this.startTime<t-this.manager.audioPlayDelay&&(this.audio.currentTime+=Math.max(0,t-this.startTime)/1e3,this.startTime=0,this.previousTime=this.audio.currentTime,this.playCatchPromise());else{var i=this.currentMarker?this.currentMarker.start:0,n=i+this.duration,s=this.audio.currentTime;if(this.currentConfig.loop)s>=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):s<i&&(this.audio.currentTime+=i,s=this.audio.currentTime),s<this.previousTime&&this.emit(r.LOOPED,this);else if(n<=s)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(r.COMPLETE,this);this.previousTime=s}},destroy:function(){n.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=a(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){n.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(r.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(r.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,r.RATE,t)||(this.calculateRate(),this.emit(r.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,r.DETUNE,t)||(this.calculateRate(),this.emit(r.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||0<this.startTime||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(r.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(r.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this}});t.exports=o},function(t,e,i){var n=i(81),s=i(0),r=i(3),a=i(570),o=i(1),h=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return n.prototype.remove.call(this,t)},removeByKey:function(t){return n.prototype.removeByKey.call(this,t)},pauseAll:o,resumeAll:o,stopAll:o,update:o,setRate:o,setDetune:o,setMute:o,setVolume:o,forEachActiveSound:function(t,e){n.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){n.prototype.destroy.call(this)}});t.exports=h},function(t,e,i){function n(){return!1}function s(){return this}var r=i(82),a=i(0),o=i(3),h=i(13),u=new a({Extends:o,initialize:function(t,e,i){void 0===i&&(i={}),o.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=h({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:n,updateMarker:n,removeMarker:function(){return null},play:n,pause:n,resume:n,stop:n,destroy:function(){r.prototype.destroy.call(this)},setMute:s,setVolume:s,setRate:s,setDetune:s,setSeek:s,setLoop:s});t.exports=u},function(t,e,i){var n=i(189),s=i(81),r=i(0),a=i(28),o=i(572),h=new r({Extends:s,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),s.call(this,t),this.locked&&this.unlock()},createAudioContext:function(t){var e=t.config.audio;return e&&e.context?(e.context.resume(),e.context):new AudioContext},setAudioContext:function(t){return this.context&&this.context.close(),this.masterMuteNode&&this.masterMuteNode.disconnect(),this.masterVolumeNode&&this.masterVolumeNode.disconnect(),this.context=t,this.masterMuteNode=t.createGain(),this.masterVolumeNode=t.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(t.destination),this.destination=this.masterMuteNode,this},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},decodeAudio:function(t,e){var i;i=Array.isArray(t)?t:[{key:t,data:e}];for(var s=this.game.cache.audio,r=i.length,o=0;o<i.length;o++){var h=i[o],u=h.key,c=h.data;"string"==typeof c&&(c=n(c));var l=function(t,e){s.add(t,e),this.emit(a.DECODED,t),0==--r&&this.emit(a.DECODED_ALL)}.bind(this,u),d=function(t,e){console.error("Error decoding audio: "+t+" - ",e?e.message:""),0==--r&&this.emit(a.DECODED_ALL)}.bind(this,u);this.context.decodeAudioData(c,l,d)}},unlock:function(){function t(){e.context&&e.context.resume().then((function(){i.removeEventListener("touchstart",t),i.removeEventListener("touchend",t),i.removeEventListener("click",t),i.removeEventListener("keydown",t),e.unlocked=!0}),(function(){i.removeEventListener("touchstart",t),i.removeEventListener("touchend",t),i.removeEventListener("click",t),i.removeEventListener("keydown",t)}))}var e=this,i=document.body;i&&(i.addEventListener("touchstart",t,!1),i.addEventListener("touchend",t,!1),i.addEventListener("click",t,!1),i.addEventListener("keydown",t,!1))},onBlur:function(){this.locked||this.context.suspend()},onFocus:function(){this.locked||this.context.resume()},destroy:function(){if(this.destination=null,this.masterVolumeNode.disconnect(),this.masterVolumeNode=null,this.masterMuteNode.disconnect(),this.masterMuteNode=null,this.game.config.audio&&this.game.config.audio.context)this.context.suspend();else{var t=this;this.context.close().then((function(){t.context=null}))}s.prototype.destroy.call(this)},setMute:function(t){return this.mute=t,this},mute:{get:function(){return 0===this.masterMuteNode.gain.value},set:function(t){this.masterMuteNode.gain.setValueAtTime(t?0:1,0),this.emit(a.GLOBAL_MUTE,this,t)}},setVolume:function(t){return this.volume=t,this},volume:{get:function(){return this.masterVolumeNode.gain.value},set:function(t){this.masterVolumeNode.gain.setValueAtTime(t,0),this.emit(a.GLOBAL_VOLUME,this,t)}}});t.exports=h},function(t,e,i){var n=i(82),s=i(0),r=i(28),a=new s({Extends:n,initialize:function(t,e,i){if(void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),!this.audioBuffer)throw new Error('There is no audio asset with key "'+e+'" in the audio cache');this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,n.call(this,t,e,i)},play:function(t,e){return!!n.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(r.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime<this.startTime||!n.prototype.pause.call(this)||(this.currentConfig.seek=this.getCurrentTime(),this.stopAndRemoveBufferSource(),this.emit(r.PAUSE,this),0))},resume:function(){return!(this.manager.context.currentTime<this.startTime||!n.prototype.resume.call(this)||(this.createAndStartBufferSource(),this.emit(r.RESUME,this),0))},stop:function(){return!!n.prototype.stop.call(this)&&(this.stopAndRemoveBufferSource(),this.emit(r.STOP,this),!0)},createAndStartBufferSource:function(){var t=this.currentConfig.seek,e=this.currentConfig.delay,i=this.manager.context.currentTime+e,n=(this.currentMarker?this.currentMarker.start:0)+t,s=this.duration-t;this.playTime=i-t,this.startTime=i,this.source=this.createBufferSource(),this.applyConfig(),this.source.start(Math.max(0,i),Math.max(0,n),Math.max(0,s)),this.resetConfig()},createAndStartLoopBufferSource:function(){var t=this.getLoopTime(),e=this.currentMarker?this.currentMarker.start:0,i=this.duration;this.loopTime=t,this.loopSource=this.createBufferSource(),this.loopSource.playbackRate.setValueAtTime(this.totalRate,0),this.loopSource.start(Math.max(0,t),Math.max(0,e),Math.max(0,i))},createBufferSource:function(){var t=this,e=this.manager.context.createBufferSource();return e.buffer=this.audioBuffer,e.connect(this.muteNode),e.onended=function(e){e.target===t.source&&(t.currentConfig.loop?t.hasLooped=!0:t.hasEnded=!0)},e},stopAndRemoveBufferSource:function(){this.source&&(this.source.stop(),this.source.disconnect(),this.source=null),this.playTime=0,this.startTime=0,this.stopAndRemoveLoopBufferSource()},stopAndRemoveLoopBufferSource:function(){this.loopSource&&(this.loopSource.stop(),this.loopSource.disconnect(),this.loopSource=null),this.loopTime=0},applyConfig:function(){this.rateUpdates.length=0,this.rateUpdates.push({time:0,rate:1}),n.prototype.applyConfig.call(this)},update:function(t,e){this.hasEnded?(this.hasEnded=!1,n.prototype.stop.call(this),this.stopAndRemoveBufferSource(),this.emit(r.COMPLETE,this)):this.hasLooped&&(this.hasLooped=!1,this.source=this.loopSource,this.loopSource=null,this.playTime=this.startTime=this.loopTime,this.rateUpdates.length=0,this.rateUpdates.push({time:0,rate:this.totalRate}),this.createAndStartLoopBufferSource(),this.emit(r.LOOPED,this))},destroy:function(){n.prototype.destroy.call(this),this.audioBuffer=null,this.stopAndRemoveBufferSource(),this.muteNode.disconnect(),this.muteNode=null,this.volumeNode.disconnect(),this.volumeNode=null,this.rateUpdates.length=0,this.rateUpdates=null},calculateRate:function(){n.prototype.calculateRate.call(this);var t=this.manager.context.currentTime;this.source&&"number"==typeof this.totalRate&&this.source.playbackRate.setValueAtTime(this.totalRate,t),this.isPlaying&&(this.rateUpdates.push({time:Math.max(this.startTime,t)-this.playTime,rate:this.totalRate}),this.loopSource&&(this.stopAndRemoveLoopBufferSource(),this.createAndStartLoopBufferSource()))},getCurrentTime:function(){for(var t=0,e=0;e<this.rateUpdates.length;e++)t+=((e<this.rateUpdates.length-1?this.rateUpdates[e+1].time:this.manager.context.currentTime-this.playTime)-this.rateUpdates[e].time)*this.rateUpdates[e].rate;return t},getLoopTime:function(){for(var t=0,e=0;e<this.rateUpdates.length-1;e++)t+=(this.rateUpdates[e+1].time-this.rateUpdates[e].time)*this.rateUpdates[e].rate;var i=this.rateUpdates[this.rateUpdates.length-1];return this.playTime+i.time+(this.duration-t)/i.rate},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.calculateRate(),this.emit(r.RATE,this,t)}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.calculateRate(),this.emit(r.DETUNE,this,t)}},setDetune:function(t){return this.detune=t,this},mute:{get:function(){return 0===this.muteNode.gain.value},set:function(t){this.currentConfig.mute=t,this.muteNode.gain.setValueAtTime(t?0:1,0),this.emit(r.MUTE,this,t)}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.volumeNode.gain.value},set:function(t){this.currentConfig.volume=t,this.volumeNode.gain.setValueAtTime(t,0),this.emit(r.VOLUME,this,t)}},setVolume:function(t){return this.volume=t,this},seek:{get:function(){return this.isPlaying?this.manager.context.currentTime<this.startTime?this.startTime-this.playTime:this.getCurrentTime():this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.context.currentTime<this.startTime||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.currentConfig.seek=t,this.isPlaying&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource()),this.emit(r.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.isPlaying&&(this.stopAndRemoveLoopBufferSource(),t&&this.createAndStartLoopBufferSource()),this.emit(r.LOOP,this,t)}},setLoop:function(t){return this.loop=t,this}});t.exports=a},function(t,e,i){var n=i(0),s=i(574),r=i(10),a=i(11),o=i(85),h=new n({Extends:s,initialize:function(t){s.call(this,t),this.sortChildrenFlag=!1,this.scene=t,this.systems=t.sys,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.start,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){this.systems.events.once(a.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(o.inplace(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},shutdown:function(){for(var t=this.list.length;t--;)this.list[t].destroy(!0);this.list.length=0,this.systems.events.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off(a.START,this.start,this),this.scene=null,this.systems=null}});r.register("DisplayList",h,"displayList"),t.exports=h},function(t,e,i){var n=i(83),s=i(0),r=i(1),a=i(85),o=new s({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=r,this.removeCallback=r,this._sortKey=""},add:function(t,e){return e?n.Add(this.list,t):n.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?n.AddAt(this.list,t,e):n.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t&&(void 0===e&&(e=function(e,i){return e[t]-i[t]}),a.inplace(this.list,e)),this},getByName:function(t){return n.GetFirst(this.list,"name",t)},getRandom:function(t,e){return n.GetRandom(this.list,t,e)},getFirst:function(t,e,i,s){return n.GetFirst(this.list,t,e,i,s)},getAll:function(t,e,i,s){return n.GetAll(this.list,t,e,i,s)},count:function(t,e){return n.CountAllMatching(this.list,t,e)},swap:function(t,e){n.Swap(this.list,t,e)},moveTo:function(t,e){return n.MoveTo(this.list,t,e)},remove:function(t,e){return e?n.Remove(this.list,t):n.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?n.RemoveAt(this.list,t):n.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?n.RemoveBetween(this.list,t,e):n.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return n.BringToTop(this.list,t)},sendToBack:function(t){return n.SendToBack(this.list,t)},moveUp:function(t){return n.MoveUp(this.list,t),t},moveDown:function(t){return n.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return n.Shuffle(this.list),this},replace:function(t,e){return n.Replace(this.list,t,e)},exists:function(t){return-1<this.list.indexOf(t)},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){for(var i=[null],n=2;n<arguments.length;n++)i.push(arguments[n]);for(n=0;n<this.list.length;n++)i[0]=this.list[n],t.apply(e,i)},shutdown:function(){this.removeAll(),this.list=[]},destroy:function(){this.removeAll(),this.parent=null,this.addCallback=null,this.removeCallback=null},length:{get:function(){return this.list.length}},first:{get:function(){return(this.position=0)<this.list.length?this.list[0]:null}},last:{get:function(){return 0<this.list.length?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position<this.list.length?(this.position++,this.list[this.position]):null}},previous:{get:function(){return 0<this.position?(this.position--,this.list[this.position]):null}}});t.exports=o},function(t,e,i){t.exports={CheckMatrix:i(84),MatrixToString:i(576),ReverseColumns:i(577),ReverseRows:i(578),Rotate180:i(579),RotateLeft:i(580),RotateMatrix:i(51),RotateRight:i(581),TransposeMatrix:i(190)}},function(t,e,i){var n=i(57),s=i(84);t.exports=function(t){var e="";if(!s(t))return e;for(var i=0;i<t.length;i++){for(var r=0;r<t[i].length;r++){var a=t[i][r].toString();e+="undefined"!==a?n(a,2):"?",r<t[i].length-1&&(e+=" |")}if(i<t.length-1){e+="\n";for(var o=0;o<t[i].length;o++)e+="---",o<t[i].length-1&&(e+="+");e+="\n"}}return e}},function(t,e){t.exports=function(t){return t.reverse()}},function(t,e){t.exports=function(t){for(var e=0;e<t.length;e++)t[e].reverse();return t}},function(t,e,i){var n=i(51);t.exports=function(t){return n(t,180)}},function(t,e,i){var n=i(51);t.exports=function(t){return n(t,90)}},function(t,e,i){var n=i(51);t.exports=function(t){return n(t,-90)}},function(t,e){t.exports=function(t,e,i,n,s){if(void 0===s&&(s=t),0<i){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),n&&n.call(s,e),e):null;for(var a=e.length-1;0<=a;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;0<i&&r<a&&(e.splice(r),a=r);for(var o=0;o<a;o++){var h=e[o];t.push(h),n&&n.call(s,h)}return e}},function(t,e){t.exports=function(t,e,i,n,s,r){if(void 0===i&&(i=0),void 0===r&&(r=t),0<n){var a=n-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),s&&s.call(r,e),e):null;for(var o=e.length-1;0<=o;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;0<n&&a<o&&(e.splice(a),o=a);for(var h=o-1;0<=h;h--){var u=e[h];t.splice(i,0,u),s&&s.call(r,u)}return e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i<t.length&&(t.splice(i,1),t.push(e)),e}},function(t,e,i){var n=i(27);t.exports=function(t,e,i,s,r){void 0===s&&(s=0),void 0===r&&(r=t.length);var a=0;if(n(t,s,r))for(var o=s;o<r;o++)t[o][e]===i&&a++;return a}},function(t,e){t.exports=function(t,e,i){var n,s=[null];for(n=3;n<arguments.length;n++)s.push(arguments[n]);for(n=0;n<t.length;n++)s[0]=t[n],e.apply(i,s);return t}},function(t,e,i){var n=i(27);t.exports=function(t,e,i,s,r){if(void 0===s&&(s=0),void 0===r&&(r=t.length),n(t,s,r)){var a,o=[null];for(a=5;a<arguments.length;a++)o.push(arguments[a]);for(a=s;a<r;a++)o[0]=t[a],e.apply(i,o)}return t}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return void 0===t[n]?null:t[n]}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(0<i){var n=t[i-1],s=t.indexOf(n);t[i]=n,t[s]=e}return t}},function(t,e){t.exports=function(t,e,i){var n=t.indexOf(e);if(-1===n||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i<t.length-1){var n=t[i+1],s=t.indexOf(n);t[i]=n,t[s]=e}return t}},function(t,e){t.exports=function(t,e,i,n){for(var s=[],r=t;r<=e;r++)if(i||n){var a=i?i+r.toString():r.toString();n&&(a=a.concat(n)),s.push(a)}else s.push(r);return s}},function(t,e,i){var n=i(147);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var s=[],r=Math.max(n((e-t)/(i||1)),0),a=0;a<r;a++)s.push(t),t+=i;return s}},function(t,e){function i(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function n(t,e){return t<e?-1:e<t?1:0}var s=function(t,e,r,a,o){for(void 0===r&&(r=0),void 0===a&&(a=t.length-1),void 0===o&&(o=n);r<a;){if(600<a-r){var h=a-r+1,u=e-r+1,c=Math.log(h),l=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*l*(h-l)/h)*(u-h/2<0?-1:1),p=Math.max(r,Math.floor(e-u*l/h+d)),f=Math.min(a,Math.floor(e+(h-u)*l/h+d));s(t,e,p,f,o)}var m=t[e],g=r,v=a;for(i(t,r,e),0<o(t[a],m)&&i(t,r,a);g<v;){for(i(t,g,v),g++,v--;o(t[g],m)<0;)g++;for(;0<o(t[v],m);)v--}0===o(t[r],m)?i(t,r,v):i(t,++v,a),v<=e&&(r=v+1),e<=v&&(a=v-1)}};t.exports=s},function(t,e,i){function n(t,e,i){for(var n=[],s=0;s<t.length;s++)for(var r=0;r<e.length;r++)for(var a=0;a<i;a++)n.push({a:t[s],b:e[r]});return n}var s=i(2),r=i(191);t.exports=function(t,e,i){var a=s(i,"max",0),o=s(i,"qty",1),h=s(i,"random",!1),u=s(i,"randomB",!1),c=s(i,"repeat",0),l=s(i,"yoyo",!1),d=[];if(u&&r(e),-1===c)if(0===a)c=0;else{var p=t.length*e.length*o;l&&(p*=2),c=Math.ceil(a/p)}for(var f=0;f<=c;f++){var m=n(t,e,o);h&&r(m),d=d.concat(m),l&&(m.reverse(),d=d.concat(m))}return a&&d.splice(a),d}},function(t,e,i){var n=i(35);t.exports=function(t,e,i,s){if(void 0===s&&(s=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var r=n(t,e);return i&&i.call(s,r),r}},function(t,e,i){var n=i(27);t.exports=function(t,e,i,s,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),n(t,e,i)){var a=i-e,o=t.splice(e,a);if(s)for(var h=0;h<o.length;h++){var u=o[h];s.call(r,u)}return o}return[]}},function(t,e,i){var n=i(35);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return n(t,s)}},function(t,e){t.exports=function(t,e,i){var n=t.indexOf(e),s=t.indexOf(i);return-1!==n&&-1===s&&(t[n]=i,!0)}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n<e;n++)i=t.shift(),t.push(i);return i}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n<e;n++)i=t.pop(),t.unshift(i);return i}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&0<i&&(t.splice(i,1),t.unshift(e)),e}},function(t,e,i){var n=i(27);t.exports=function(t,e,i,s,r){if(void 0===s&&(s=0),void 0===r&&(r=t.length),n(t,s,r))for(var a=s;a<r;a++){var o=t[a];o.hasOwnProperty(e)&&(o[e]=i)}return t}},function(t,e){t.exports=function(t,e,i){if(e!==i){var n=t.indexOf(e),s=t.indexOf(i);if(n<0||s<0)throw new Error("Supplied items must be elements of the same array");return t[n]=i,t[s]=e,t}}},function(t,e,i){var n=i(0),s=i(606),r=i(10),a=i(11),o=new n({Extends:s,initialize:function(t){s.call(this),this.scene=t,this.systems=t.sys,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.start,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(a.PRE_UPDATE,this.update,this),t.on(a.UPDATE,this.sceneUpdate,this),t.once(a.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(t,e){for(var i=this._active,n=i.length,s=0;s<n;s++){var r=i[s];r.active&&r.preUpdate.call(r,t,e)}},shutdown:function(){for(var t=this._active.length;t--;)this._active[t].destroy(!0);for(t=this._pending.length;t--;)this._pending[t].destroy(!0);for(t=this._destroy.length;t--;)this._destroy[t].destroy(!0);this._toProcess=0,this._pending=[],this._active=[],this._destroy=[],this.removeAllListeners();var e=this.systems.events;e.off(a.PRE_UPDATE,this.preUpdate,this),e.off(a.UPDATE,this.sceneUpdate,this),e.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.systems.events.off(a.START,this.start,this),this.scene=null,this.systems=null}});r.register("UpdateList",o,"updateList"),t.exports=o},function(t,e,i){var n=i(0),s=i(3),r=i(607),a=new n({Extends:s,initialize:function(){s.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0},add:function(t){return this._pending.push(t),this._toProcess++,t},remove:function(t){return this._destroy.push(t),this._toProcess++,t},removeAll:function(){for(var t=this._active,e=this._destroy,i=t.length;i--;)e.push(t[i]),this._toProcess++;return this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,n=this._active;for(t=0;t<i.length;t++){e=i[t];var s=n.indexOf(e);-1!==s&&(n.splice(s,1),this.emit(r.REMOVE,e))}for(i.length=0,i=this._pending,t=0;t<i.length;t++)e=i[t],this._active.push(e),this.emit(r.ADD,e);return i.length=0,this._toProcess=0,this._active},getActive:function(){return this._active},length:{get:function(){return this._active.length}},destroy:function(){this._toProcess=0,this._pending=[],this._active=[],this._destroy=[]}});t.exports=a},function(t,e,i){t.exports={PROCESS_QUEUE_ADD:i(608),PROCESS_QUEUE_REMOVE:i(609)}},function(t,e){t.exports="add"},function(t,e){t.exports="remove"},function(t,e){t.exports="destroy"},function(t,e){t.exports="complete"},function(t,e){t.exports="created"},function(t,e){t.exports="error"},function(t,e){t.exports="loop"},function(t,e){t.exports="play"},function(t,e){t.exports="seeked"},function(t,e){t.exports="seeking"},function(t,e){t.exports="stop"},function(t,e){t.exports="timeout"},function(t,e){t.exports="unlocked"},function(t,e,i){var n=i(1),s=i(1);n=i(622),s=i(623),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){var r=e.list;if(0!==r.length){var a=e.localTransform;s?(a.loadIdentity(),a.multiply(s),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var o=-1!==e.blendMode;o||t.setBlendMode(0);for(var h=e.alpha,u=e.scrollFactorX,c=e.scrollFactorY,l=r,d=r.length,p=0;p<d;p++){var f=r[p];if(f.willRender(n)){var m,g,v,y;void 0!==f.alphaTopLeft?(m=f.alphaTopLeft,g=f.alphaTopRight,v=f.alphaBottomLeft,y=f.alphaBottomRight):y=v=g=m=f.alpha;var _=f.scrollFactorX,x=f.scrollFactorY;o||f.blendMode===t.currentBlendMode||t.setBlendMode(f.blendMode);var E=f.mask;E&&E.preRenderWebGL(t,f,n);var T=f.type;T!==t.currentType&&(t.newType=!0,t.currentType=T),t.nextTypeMatch=p<d-1&&l[p+1].type===t.currentType,f.setScrollFactor(_*u,x*c),f.setAlpha(m*h,g*h,v*h,y*h),f.renderWebGL(t,f,i,n,a),f.setAlpha(m,g,v,y),f.setScrollFactor(_,x),E&&E.postRenderWebGL(t,n),t.newType=!1}}}}},function(t,e){t.exports=function(t,e,i,n,s){var r=e.list;if(0!==r.length){var a=e.localTransform;s?(a.loadIdentity(),a.multiply(s),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var o=-1!==e.blendMode;o||t.setBlendMode(0);var h=e._alpha,u=e.scrollFactorX,c=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,n);for(var l=0;l<r.length;l++){var d=r[l];if(d.willRender(n)){var p=d.alpha,f=d.scrollFactorX,m=d.scrollFactorY;o||d.blendMode===t.currentBlendMode||t.setBlendMode(d.blendMode),d.setScrollFactor(f*u,m*c),d.setAlpha(p*h),d.renderCanvas(t,d,i,n,a),d.setAlpha(p),d.setScrollFactor(f,m)}}e.mask&&e.mask.postRenderCanvas(t)}}},function(t,e,i){var n=i(23);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=Math.min(t.x,e.x),r=Math.min(t.y,e.y),a=Math.max(t.right,e.right)-s,o=Math.max(t.bottom,e.bottom)-r;return i.setTo(s,r,a,o)}},function(t,e,i){var n=i(0),s=i(17),r=i(22),a=i(626),o=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,a],initialize:function(t,e,i,n,a){r.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s.Animation(this),this.setTexture(n,a),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e,i){return this.anims.play(t,e,i),this},toJSON:function(){return s.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=o},function(t,e,i){var n=i(1),s=i(1);n=i(627),s=i(628),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){this.pipeline.batchSprite(e,n,s)}},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(0),s=i(17),r=i(22),a=i(630),o=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,a],initialize:function(t,e,i,n,s){r.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(n,s),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()}});t.exports=o},function(t,e,i){var n=i(1),s=i(1);n=i(631),s=i(632),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){this.pipeline.batchSprite(e,n,s)}},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(30),s=i(0),r=i(86),a=i(107),o=i(108),h=i(109),u=i(113),c=i(114),l=i(117),d=i(120),p=i(115),f=i(18),m=i(194),g=i(22),v=i(4),y=i(2),_=i(9),x=i(638),E=new s({Extends:g,Mixins:[a,o,h,u,c,l,d,p,x],initialize:function(t,e){var i=y(e,"x",0),n=y(e,"y",0);g.call(this,t,"Graphics"),this.setPosition(i,n),this.initPipeline(),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this._tempMatrix1=new f,this._tempMatrix2=new f,this._tempMatrix3=new f,this.setDefaultStyles(e)},setDefaultStyles:function(t){return y(t,"lineStyle",null)&&(this.defaultStrokeWidth=y(t,"lineStyle.width",1),this.defaultStrokeColor=y(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=y(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),y(t,"fillStyle",null)&&(this.defaultFillColor=y(t,"fillStyle.color",16777215),this.defaultFillAlpha=y(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(r.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(r.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,n,s){return void 0===s&&(s=1),this.commandBuffer.push(r.GRADIENT_FILL_STYLE,s,t,e,i,n),this},lineGradientStyle:function(t,e,i,n,s,a){return void 0===a&&(a=1),this.commandBuffer.push(r.GRADIENT_LINE_STYLE,t,a,e,i,n,s),this},setTexture:function(t,e,i){if(void 0===i&&(i=0),void 0===t)this.commandBuffer.push(r.CLEAR_TEXTURE);else{var n=this.scene.sys.textures.getFrame(t,e);n&&(2===i&&(i=3),this.commandBuffer.push(r.SET_TEXTURE,n,i))}return this},beginPath:function(){return this.commandBuffer.push(r.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(r.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(r.FILL_PATH),this},fill:function(){return this.commandBuffer.push(r.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(r.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(r.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,_.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,_.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,n){return this.commandBuffer.push(r.FILL_RECT,t,e,i,n),this},strokeRect:function(t,e,i,n){var s=this._lineWidth/2,r=t-s,a=t+s;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+n),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+n),this.strokePath(),this.beginPath(),this.moveTo(r,e),this.lineTo(a+i,e),this.strokePath(),this.beginPath(),this.moveTo(r,e+n),this.lineTo(a+i,e+n),this.strokePath(),this},fillRoundedRect:function(t,e,i,n,s){void 0===s&&(s=20);var r=s,a=s,o=s,h=s;return"number"!=typeof s&&(r=v(s,"tl",20),a=v(s,"tr",20),o=v(s,"bl",20),h=v(s,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-a,e),this.arc(t+i-a,e+a,a,-_.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,_.TAU),this.lineTo(t+o,e+n),this.arc(t+o,e+n-o,o,_.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-_.TAU),this.fillPath(),this},strokeRoundedRect:function(t,e,i,n,s){void 0===s&&(s=20);var r=s,a=s,o=s,h=s;return"number"!=typeof s&&(r=v(s,"tl",20),a=v(s,"tr",20),o=v(s,"bl",20),h=v(s,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-a,e),this.arc(t+i-a,e+a,a,-_.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,_.TAU),this.lineTo(t+o,e+n),this.arc(t+o,e+n-o,o,_.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-_.TAU),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(r.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,n,s,a){return this.commandBuffer.push(r.FILL_TRIANGLE,t,e,i,n,s,a),this},strokeTriangle:function(t,e,i,n,s,a){return this.commandBuffer.push(r.STROKE_TRIANGLE,t,e,i,n,s,a),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,n){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,n),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(r.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(r.MOVE_TO,t,e),this},strokePoints:function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===n&&(n=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var s=1;s<n;s++)this.lineTo(t[s].x,t[s].y);return e&&this.lineTo(t[0].x,t[0].y),i&&this.closePath(),this.strokePath(),this},fillPoints:function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===n&&(n=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var s=1;s<n;s++)this.lineTo(t[s].x,t[s].y);return e&&this.lineTo(t[0].x,t[0].y),i&&this.closePath(),this.fillPath(),this},strokeEllipseShape:function(t,e){void 0===e&&(e=32);var i=t.getPoints(e);return this.strokePoints(i,!0)},strokeEllipse:function(t,e,i,n,s){void 0===s&&(s=32);var r=new m(t,e,i,n).getPoints(s);return this.strokePoints(r,!0)},fillEllipseShape:function(t,e){void 0===e&&(e=32);var i=t.getPoints(e);return this.fillPoints(i,!0)},fillEllipse:function(t,e,i,n,s){void 0===s&&(s=32);var r=new m(t,e,i,n).getPoints(s);return this.fillPoints(r,!0)},arc:function(t,e,i,n,s,a,o){return void 0===a&&(a=!1),void 0===o&&(o=0),this.commandBuffer.push(r.ARC,t,e,i,n,s,a,o),this},slice:function(t,e,i,n,s,a,o){return void 0===a&&(a=!1),void 0===o&&(o=0),this.commandBuffer.push(r.BEGIN_PATH),this.commandBuffer.push(r.MOVE_TO,t,e),this.commandBuffer.push(r.ARC,t,e,i,n,s,a,o),this.commandBuffer.push(r.CLOSE_PATH),this},save:function(){return this.commandBuffer.push(r.SAVE),this},restore:function(){return this.commandBuffer.push(r.RESTORE),this},translateCanvas:function(t,e){return this.commandBuffer.push(r.TRANSLATE,t,e),this},scaleCanvas:function(t,e){return this.commandBuffer.push(r.SCALE,t,e),this},rotateCanvas:function(t){return this.commandBuffer.push(r.ROTATE,t),this},clear:function(){return this.commandBuffer.length=0,-1<this.defaultFillColor&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),-1<this.defaultStrokeColor&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var n,s,r=this.scene.sys,a=r.game.renderer;if(void 0===e&&(e=r.scale.width),void 0===i&&(i=r.scale.height),E.TargetCamera.setScene(this.scene),E.TargetCamera.setViewport(0,0,e,i),E.TargetCamera.scrollX=this.x,E.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var o=(n=r.textures.get(t)).getSourceImage();o instanceof HTMLCanvasElement&&(s=o.getContext("2d"))}else s=(n=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(s=t.getContext("2d"));return s&&(this.renderCanvas(a,this,0,E.TargetCamera,null,s,!1),n&&n.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});E.TargetCamera=new n,t.exports=E},function(t,e,i){var n=i(196),s=i(34),r=i(9),a=i(8);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=s(e,0,r.PI2);return n(t,o,i)}},function(t,e,i){var n=i(636),s=i(196),r=i(34),a=i(9);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&0<i&&(e=n(t)/i);for(var h=0;h<e;h++){var u=r(h/e,0,a.PI2);o.push(s(t,u))}return o}},function(t,e){t.exports=function(t){var e=t.width/2,i=t.height/2,n=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*n/(10+Math.sqrt(4-3*n)))}},function(t,e,i){var n=i(8);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random()*Math.PI*2,s=Math.sqrt(Math.random());return e.x=t.x+s*Math.cos(i)*t.width/2,e.y=t.y+s*Math.sin(i)*t.height/2,e}},function(t,e,i){var n=i(1),s=i(1);n=i(639),i(197),s=i(197),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){function n(t,e,i){this.x=t,this.y=e,this.width=i}function s(t,e,i){this.points=[],this.pointsLength=1,this.points[0]=new n(t,e,i)}var r=i(86),a=i(19),o=[];t.exports=function(t,e,i,h,u){if(0!==e.commandBuffer.length){var c=this.pipeline;t.setPipeline(c,e);var l=e._tempMatrix1,d=e._tempMatrix2,p=e._tempMatrix3;p.loadIdentity(),d.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),l.copyFrom(h.matrix),u?(l.multiplyWithOffset(u,-h.scrollX*e.scrollFactorX,-h.scrollY*e.scrollFactorY),d.e=e.x,d.f=e.y):(d.e-=h.scrollX*e.scrollFactorX,d.f-=h.scrollY*e.scrollFactorY),l.multiply(d);for(var f=e.commandBuffer,m=h.alpha*e.alpha,g=1,v=c.fillTint,y=c.strokeTint,_=0,x=0,E=0,T=2*Math.PI,w=[],S=0,b=!1,A=null,C=a.getTintAppendFloatAlphaAndSwap,O=t.blankTexture.glTexture,M=0;M<f.length;M++)switch(f[M]){case r.BEGIN_PATH:w.length=0,b=!(A=null);break;case r.CLOSE_PATH:b=!1,A&&A.points.length&&A.points.push(A.points[0]);break;case r.FILL_PATH:for(S=0;S<w.length;S++)c.setTexture2D(O),c.batchFillPath(w[S].points,p,l);break;case r.STROKE_PATH:for(S=0;S<w.length;S++)c.setTexture2D(O),c.batchStrokePath(w[S].points,g,b,p,l);break;case r.LINE_STYLE:g=f[++M];var R=C(f[++M],f[++M]*m);y.TL=R,y.TR=R,y.BL=R,y.BR=R;break;case r.FILL_STYLE:var P=C(f[++M],f[++M]*m);v.TL=P,v.TR=P,v.BL=P,v.BR=P;break;case r.GRADIENT_FILL_STYLE:var I=f[++M]*m;v.TL=C(f[++M],I),v.TR=C(f[++M],I),v.BL=C(f[++M],I),v.BR=C(f[++M],I);break;case r.GRADIENT_LINE_STYLE:g=f[++M];var L=f[++M]*m;y.TL=C(f[++M],L),y.TR=C(f[++M],L),y.BL=C(f[++M],L),y.BR=C(f[++M],L);break;case r.ARC:var G=0,D=f[++M],k=f[++M],F=f[++M],N=f[++M],B=f[++M],U=f[++M],V=f[++M];for(B-=N,U?B<-T?B=-T:0<B&&(B=B%T-T):T<B?B=T:B<0&&(B=T+B%T),null===A&&(A=new s(D+Math.cos(N)*F,k+Math.sin(N)*F,g),w.push(A),G+=.01);G<1+V;)E=B*G+N,_=D+Math.cos(E)*F,x=k+Math.sin(E)*F,A.points.push(new n(_,x,g)),G+=.01;E=B+N,_=D+Math.cos(E)*F,x=k+Math.sin(E)*F,A.points.push(new n(_,x,g));break;case r.FILL_RECT:c.setTexture2D(O),c.batchFillRect(f[++M],f[++M],f[++M],f[++M],p,l);break;case r.FILL_TRIANGLE:c.setTexture2D(O),c.batchFillTriangle(f[++M],f[++M],f[++M],f[++M],f[++M],f[++M],p,l);break;case r.STROKE_TRIANGLE:c.setTexture2D(O),c.batchStrokeTriangle(f[++M],f[++M],f[++M],f[++M],f[++M],f[++M],g,p,l);break;case r.LINE_TO:null!==A?A.points.push(new n(f[++M],f[++M],g)):(A=new s(f[++M],f[++M],g),w.push(A));break;case r.MOVE_TO:A=new s(f[++M],f[++M],g),w.push(A);break;case r.SAVE:o.push(p.copyToArray());break;case r.RESTORE:p.copyFromArray(o.pop());break;case r.TRANSLATE:D=f[++M],k=f[++M],p.translate(D,k);break;case r.SCALE:D=f[++M],k=f[++M],p.scale(D,k);break;case r.ROTATE:p.rotate(f[++M]);break;case r.SET_TEXTURE:var Y=f[++M],z=f[++M];c.currentFrame=Y,c.setTexture2D(Y.glTexture,0),c.tintEffect=z,O=Y.glTexture;break;case r.CLEAR_TEXTURE:c.currentFrame=t.blankTexture,c.tintEffect=2,O=t.blankTexture.glTexture}}}},function(t,e){t.exports=function(t,e,i){var n=t.canvas,s=t.context,r=t.style,a=[],o=0,h=i.length;0<r.maxLines&&r.maxLines<i.length&&(h=r.maxLines),r.syncFont(n,s);for(var u=0;u<h;u++){var c=r.strokeThickness;c+=s.measureText(i[u]).width,r.wordWrap&&(c-=s.measureText(" ").width),a[u]=Math.ceil(c),o=Math.max(o,a[u])}var l=e.fontSize+r.strokeThickness,d=l*h,p=t.lineSpacing;return 1<h&&(d+=p*(h-1)),{width:o,height:d,lines:h,lineWidths:a,lineSpacing:p,lineHeight:l}}},function(t,e){t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},function(t,e,i){var n=i(1),s=i(1);n=i(643),s=i(644),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(19);t.exports=function(t,e,i,s,r){if(0!==e.width&&0!==e.height){var a=e.frame,o=a.width,h=a.height,u=n.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,a.glTexture,o,h,e.x,e.y,o/e.style.resolution,h/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,o,h,u(e._tintTL,s.alpha*e._alphaTL),u(e._tintTR,s.alpha*e._alphaTR),u(e._tintBL,s.alpha*e._alphaBL),u(e._tintBR,s.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,s,r)}}},function(t,e){t.exports=function(t,e,i,n,s){0!==e.width&&0!==e.height&&t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(0),s=i(37),r=i(2),a=i(646),o={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},h=new n({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this.wordWrapWidth,this.wordWrapCallback,this.wordWrapCallbackScope,this.wordWrapUseAdvanced,this._font,this.setStyle(e,!1,!0);var i=r(e,"metrics",!1);this.metrics=i?{ascent:r(i,"ascent",0),descent:r(i,"descent",0),fontSize:r(i,"fontSize",0)}:a(this)},setStyle:function(t,e,i){for(var n in void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),o){var a=i?o[n][1]:this[n];this[n]="wordWrapCallback"===n||"wordWrapCallbackScope"===n?r(t,o[n][0],a):s(t,o[n][0],a)}var h=r(t,"font",null);null!==h&&this.setFont(h,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var u=r(t,"fill",null);return null!==u&&(this.color=u),e?this.update(!0):this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=a(this)),this.parent.updateText()},setFont:function(t,e){void 0===e&&(e=!0);var i=t,n="",s="";if("string"!=typeof t)i=r(t,"fontFamily","Courier"),n=r(t,"fontSize","16px"),s=r(t,"fontStyle","");else{var a=t.split(" "),o=0;s=2<a.length?a[o++]:"",n=a[o++]||"16px",i=a[o++]||"Courier"}return i===this.fontFamily&&n===this.fontSize&&s===this.fontStyle||(this.fontFamily=i,this.fontSize=n,this.fontStyle=s,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,n,s,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===s&&(s=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=n,this.shadowStroke=s,this.shadowFill=r,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in o)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},function(t,e,i){var n=i(12);t.exports=function(t){var e=n.create(this),i=e.getContext("2d");t.syncFont(e,i);var s=Math.ceil(i.measureText(t.testString).width*t.baselineX),r=s,a=2*r;r=r*t.baselineY|0,e.width=s,e.height=a,i.fillStyle="#f00",i.fillRect(0,0,s,a),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,r);var o={ascent:0,descent:0,fontSize:0};if(!i.getImageData(0,0,s,a))return o.ascent=r,o.descent=r+6,o.fontSize=o.ascent+o.descent,n.remove(e),o;var h,u,c=i.getImageData(0,0,s,a).data,l=c.length,d=4*s,p=0,f=!1;for(h=0;h<r;h++){for(u=0;u<d;u+=4)if(255!==c[p+u]){f=!0;break}if(f)break;p+=d}for(o.ascent=r-h,p=l-d,f=!1,h=a;r<h;h--){for(u=0;u<d;u+=4)if(255!==c[p+u]){f=!0;break}if(f)break;p-=d}return o.descent=h-r,o.fontSize=o.ascent+o.descent,n.remove(e),o}},function(t,e,i){var n=i(0),s=i(17),r=i(22),a=i(59),o=new n({Extends:r,Mixins:[s.AlphaSingle,s.BlendMode,s.ComputedSize,s.Depth,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Transform,s.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new a,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]}});t.exports=o},function(t,e,i){var n=i(29),s=i(30),r=i(12),a=i(0),o=i(17),h=i(14),u=i(80),c=i(22),l=i(1),d=i(649),p=i(19),f=i(199),m=new a({Extends:c,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.ScrollFactor,o.Tint,o.Transform,o.Visible,d],initialize:function(t,e,i,n,a,o,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=32),void 0===a&&(a=32),c.call(this,t,"RenderTexture"),this.renderer=t.sys.game.renderer,this.textureManager=t.sys.textures,this.globalTint=16777215,this.globalAlpha=1,this.canvas=null,this.framebuffer=null,this.dirty=!1,this._crop=this.resetCropObject(),this.texture=null,this.frame=null,this._saved=!1,void 0===o?(this.canvas=r.create2D(this,n,a),this.texture=t.sys.textures.addCanvas(f(),this.canvas),this.frame=this.texture.get()):(this.texture=t.sys.textures.get(o),this.frame=this.texture.get(u),this.canvas=this.frame.source.image,this._saved=!0,this.dirty=!0,this.width=this.frame.cutWidth,this.height=this.frame.cutHeight),this.context=this.canvas.getContext("2d"),this._eraseMode=!1,this.camera=new s(0,0,n,a),this.gl=null,this.glTexture=null;var d=this.renderer;if(d)if(d.type===h.WEBGL){var p=d.gl;this.gl=p,this.glTexture=this.frame.source.glTexture,this.drawGameObject=this.batchGameObjectWebGL,this.framebuffer=d.createFramebuffer(n,a,this.glTexture,!1)}else d.type===h.CANVAS&&(this.drawGameObject=this.batchGameObjectCanvas);else this.drawGameObject=l;this.camera.setScene(t),this.setPosition(e,i),void 0===o&&this.setSize(n,a),this.setOrigin(0,0),this.initPipeline()},setSize:function(t,e){return this.resize(t,e)},resize:function(t,e){if(void 0===e&&(e=t),t!==this.width||e!==this.height){if("__BASE"===this.frame.name){if(this.canvas.width=t,this.canvas.height=e,this.texture.width=t,this.texture.height=e,this.gl){var i=this.gl;this.renderer.deleteTexture(this.frame.source.glTexture),this.renderer.deleteFramebuffer(this.framebuffer);var n=this.renderer.createTexture2D(0,i.NEAREST,i.NEAREST,i.CLAMP_TO_EDGE,i.CLAMP_TO_EDGE,i.RGBA,null,t,e,!1);this.framebuffer=this.renderer.createFramebuffer(t,e,n,!1),this.frame.source.isRenderTexture=!0,this.frame.glTexture=n,this.glTexture=n}this.frame.source.width=t,this.frame.source.height=e,this.camera.setSize(t,e),this.frame.setSize(t,e),this.width=t,this.height=e}}else{var s=this.texture.getSourceImage();this.frame.cutX+t>s.width&&(t=s.width-this.frame.cutX),this.frame.cutY+e>s.height&&(e=s.height-this.frame.cutY),this.frame.setSize(t,e,this.frame.cutX,this.frame.cutY)}this.updateDisplayOrigin();var r=this.input;return r&&!r.customHitArea&&(r.hitArea.width=t,r.hitArea.height=e),this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e,i,n,s,r){void 0===e&&(e=1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.frame.cutWidth),void 0===r&&(r=this.frame.cutHeight);var a=255&(t>>16|0),o=255&(t>>8|0),h=255&(0|t),u=this.gl,c=this.frame;if(this.camera.preRender(1,1),u){var l=this.camera._cx,d=this.camera._cy,f=this.camera._cw,m=this.camera._ch;this.renderer.setFramebuffer(this.framebuffer,!1),this.renderer.pushScissor(l,d,f,m,m);var g=this.pipeline;g.projOrtho(0,this.texture.width,0,this.texture.height,-1e3,1e3),g.drawFillRect(i,n,s,r,p.getTintFromFloats(a/255,o/255,h/255,1),e),this.renderer.setFramebuffer(null,!1),this.renderer.popScissor(),g.projOrtho(0,g.width,g.height,0,-1e3,1e3)}else this.renderer.setContext(this.context),this.context.fillStyle="rgba("+a+","+o+","+h+","+e+")",this.context.fillRect(i+c.cutX,n+c.cutY,s,r),this.renderer.setContext();return this.dirty=!0,this},clear:function(){if(this.dirty){var t=this.gl;if(t){var e=this.renderer;e.setFramebuffer(this.framebuffer,!0),this.frame.cutWidth===this.canvas.width&&this.frame.cutHeight===this.canvas.height||t.scissor(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),e.setFramebuffer(null,!0)}else{var i=this.context;i.save(),i.setTransform(1,0,0,1,0,0),i.clearRect(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),i.restore()}this.dirty=!1}return this},erase:function(t,e,i){this._eraseMode=!0;var s=this.renderer.currentBlendMode;return this.renderer.setBlendMode(n.ERASE),this.draw(t,e,i,1,16777215),this.renderer.setBlendMode(s),this._eraseMode=!1,this},draw:function(t,e,i,n,s){void 0===n&&(n=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16),Array.isArray(t)||(t=[t]);var r=this.gl;if(this.camera.preRender(1,1),r){var a=this.camera._cx,o=this.camera._cy,h=this.camera._cw,u=this.camera._ch;this.renderer.setFramebuffer(this.framebuffer,!1),this.renderer.pushScissor(a,o,h,u,u);var c=this.pipeline;c.projOrtho(0,this.texture.width,0,this.texture.height,-1e3,1e3),this.batchList(t,e,i,n,s),c.flush(),this.renderer.setFramebuffer(null,!1),this.renderer.popScissor(),c.projOrtho(0,c.width,c.height,0,-1e3,1e3)}else this.renderer.setContext(this.context),this.batchList(t,e,i,n,s),this.renderer.setContext();return this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var a=this.gl,o=this.textureManager.getFrame(t,e);if(o){if(this.camera.preRender(1,1),a){var h=this.camera._cx,u=this.camera._cy,c=this.camera._cw,l=this.camera._ch;this.renderer.setFramebuffer(this.framebuffer,!1),this.renderer.pushScissor(h,u,c,l,l);var d=this.pipeline;d.projOrtho(0,this.texture.width,0,this.texture.height,-1e3,1e3),d.batchTextureFrame(o,i+this.frame.cutX,n+this.frame.cutY,r,s,this.camera.matrix,null),d.flush(),this.renderer.setFramebuffer(null,!1),this.renderer.popScissor(),d.projOrtho(0,d.width,d.height,0,-1e3,1e3)}else this.batchTextureFrame(o,i+this.frame.cutX,n+this.frame.cutY,s,r);this.dirty=!0}return this},batchList:function(t,e,i,n,s){for(var r=0;r<t.length;r++){var a=t[r];a&&a!==this&&(a.renderWebGL||a.renderCanvas?this.drawGameObject(a,e,i):a.isParent||a.list?this.batchGroup(a.getChildren(),e,i):"string"==typeof a?this.batchTextureFrameKey(a,null,e,i,n,s):a instanceof u?this.batchTextureFrame(a,e,i,n,s):Array.isArray(a)&&this.batchList(a,e,i,n,s))}},batchGroup:function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0),e+=this.frame.cutX,i+=this.frame.cutY;for(var n=0;n<t.length;n++){var s=t[n];if(s.willRender()){var r=s.x+e,a=s.y+i;this.drawGameObject(s,r,a)}}},batchGameObjectWebGL:function(t,e,i){void 0===e&&(e=t.x),void 0===i&&(i=t.y);var n=t.x,s=t.y;this._eraseMode||this.renderer.setBlendMode(t.blendMode),t.setPosition(e+this.frame.cutX,i+this.frame.cutY),t.renderWebGL(this.renderer,t,0,this.camera,null),t.setPosition(n,s)},batchGameObjectCanvas:function(t,e,i){void 0===e&&(e=t.x),void 0===i&&(i=t.y);var s=t.x,r=t.y;if(this._eraseMode){var a=t.blendMode;t.blendMode=n.ERASE}t.setPosition(e+this.frame.cutX,i+this.frame.cutY),t.renderCanvas(this.renderer,t,0,this.camera,null),t.setPosition(s,r),this._eraseMode&&(t.blendMode=a)},batchTextureFrameKey:function(t,e,i,n,s,r){var a=this.textureManager.getFrame(t,e);a&&this.batchTextureFrame(a,i,n,s,r)},batchTextureFrame:function(t,e,i,n,s){if(void 0===e&&(e=0),void 0===i&&(i=0),e+=this.frame.cutX,i+=this.frame.cutY,this.gl)this.pipeline.batchTextureFrame(t,e,i,s,n,this.camera.matrix,null);else{var r=this.context,a=t.canvasData,o=t.source.image,h=this.camera.matrix;r.globalAlpha=this.globalAlpha,r.setTransform(h[0],h[1],h[2],h[3],h[4],h[5]),r.drawImage(o,a.x,a.y,a.width,a.height,e,i,a.width,a.height)}},snapshotArea:function(t,e,i,n,s,r,a){return this.gl?this.renderer.snapshotFramebuffer(this.framebuffer,this.width,this.height,s,!1,t,e,i,n,r,a):this.renderer.snapshotCanvas(this.canvas,s,!1,t,e,i,n,r,a),this},snapshot:function(t,e,i){return this.gl?this.renderer.snapshotFramebuffer(this.framebuffer,this.width,this.height,t,!1,0,0,this.width,this.height,e,i):this.renderer.snapshotCanvas(this.canvas,t,!1,0,0,this.width,this.height,e,i),this},snapshotPixel:function(t,e,i){return this.gl?this.renderer.snapshotFramebuffer(this.framebuffer,this.width,this.height,i,!0,t,e):this.renderer.snapshotCanvas(this.canvas,i,!0,t,e),this},preDestroy:function(){this._saved||(r.remove(this.canvas),this.gl&&this.renderer.deleteFramebuffer(this.framebuffer),this.texture.destroy(),this.camera.destroy(),this.canvas=null,this.context=null,this.framebuffer=null,this.texture=null,this.glTexture=null)}});t.exports=m},function(t,e,i){var n=i(1),s=i(1);n=i(650),s=i(651),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(19);t.exports=function(t,e,i,s,r){var a=e.frame,o=a.width,h=a.height,u=n.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,a.glTexture,o,h,e.x,e.y,o,h,e.scaleX,e.scaleY,e.rotation,e.flipX,!e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,o,h,u(e._tintTL,s.alpha*e._alphaTL),u(e._tintTR,s.alpha*e._alphaTR),u(e._tintBL,s.alpha*e._alphaBL),u(e._tintBR,s.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,s,r),t.setBlankTexture(!0)}},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e){t.exports=function(t,e,i){if(void 0===i)return{local:{x:0,y:0,width:0,height:0},global:{x:0,y:0,width:0,height:0},lines:{shortest:0,longest:0,lengths:null,height:0},wrappedText:"",words:[],scaleX:0,scaleY:0};var n,s,r,a=t.text,o=a.length,h=t.maxWidth,u=t.wordWrapCharCode,c=Number.MAX_VALUE,l=Number.MAX_VALUE,d=0,p=0,f=t.fontData.chars,m=t.fontData.lineHeight,g=t.letterSpacing,v=0,y=0,_=0,x=null,E=0,T=0,w=t.fontSize/t.fontData.size,S=w*t.scaleX,b=w*t.scaleY,A=null,C=0,O=[],M=Number.MAX_VALUE,R=0,P=0,I=0,L=[],G=null;if(0<h){for(n=0;n<o;n++)if(10!==(_=a.charCodeAt(n))){if(x=f[_]){if(null!==A)var D=x.kerning[C];_===u?null!==G&&(L.push({word:G.word,i:G.i,x:G.x*S,y:G.y*b,w:G.w*S,h:G.h*b,cr:!1}),G=null):(null===G&&(G={word:"",i:n,x:v,y:y,w:0,h:m,cr:!1}),G.word=G.word.concat(a[n]),G.w+=x.xOffset+x.xAdvance+(void 0!==D?D:0)),v+=x.xAdvance+g,A=x,C=_}}else null!==G&&(L.push({word:G.word,i:G.i,x:G.x*S,y:G.y*b,w:G.w*S,h:G.h*b,cr:!0}),G=null),v=0,y+=m,A=null;var k;null!==G&&L.push({word:G.word,i:G.i,x:G.x*S,y:G.y*b,w:G.w*S,h:G.h*b,cr:!1}),A=null;var F=C=y=v=0,N=[];for(n=0;n<L.length;n++){var B=L[n],U=B.x,V=B.x+B.w;k&&(F=U-(U-(k.x+k.w)+k.w),k=null),h<U-F||h<V-F?(N.push(B.i-1),k=B.cr?(N.push(B.i+B.word.length),F=0,null):B):B.cr&&(N.push(B.i+B.word.length),F=0,k=null)}for(n=N.length-1;0<=n;n--)s=a,r=N[n],a=s.substr(0,r)+"\n"+s.substr(r+1);o=(i.wrappedText=a).length,L=[],G=null}for(n=0;n<o;n++)if(10!==(_=a.charCodeAt(n))){if(x=f[_]){if(E=v,T=y,null!==A){var Y=x.kerning[C];E+=void 0!==Y?Y:0}E<c&&(c=E),T<l&&(l=T);var z=E+x.xAdvance,H=T+m;d<z&&(d=z),p<H&&(p=H),_===u?null!==G&&(L.push({word:G.word,i:G.i,x:G.x*S,y:G.y*b,w:G.w*S,h:G.h*b}),G=null):(null===G&&(G={word:"",i:n,x:v,y:y,w:0,h:m}),G.word=G.word.concat(a[n]),G.w+=x.xOffset+x.xAdvance+(void 0!==Y?Y:0)),v+=x.xAdvance+g,A=x,C=_,I=z*w}}else null!==G&&(L.push({word:G.word,i:G.i,x:G.x*S,y:G.y*b,w:G.w*S,h:G.h*b}),G=null),v=0,y+=m,A=null,R<(O[P]=I)&&(R=I),I<M&&(M=I),P++,I=0;null!==G&&L.push({word:G.word,i:G.i,x:G.x*S,y:G.y*b,w:G.w*S,h:G.h*b}),R<(O[P]=I)&&(R=I),I<M&&(M=I);var j=i.local,W=i.global,X=i.lines;return j.x=c*w,j.y=l*w,j.width=d*w,j.height=p*w,W.x=t.x-t.displayOriginX+c*S,W.y=t.y-t.displayOriginY+l*b,W.width=d*S,W.height=p*b,X.shortest=M,X.longest=R,X.lengths=O,e&&(j.x=Math.round(j.x),j.y=Math.round(j.y),j.width=Math.round(j.width),j.height=Math.round(j.height),W.x=Math.round(W.x),W.y=Math.round(W.y),W.width=Math.round(W.width),W.height=Math.round(W.height),X.shortest=Math.round(M),X.longest=Math.round(R)),i.words=L,i.lines.height=m,i.scaleX=t.scaleX,i.scaleY=t.scaleY,i}},function(t,e,i){var n=i(88);t.exports=function(t,e,i,s,r,a,o){var h=t.sys.textures.getFrame(i,s),u=t.sys.cache.xml.get(r);if(h&&u){var c=n(u,a,o,h);return t.sys.cache.bitmapFont.add(e,{data:c,texture:i,frame:s}),!0}return!1}},function(t,e,i){var n=i(1),s=i(1);n=i(655),s=i(656),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(19);t.exports=function(t,e,i,s,r){var a=e._text,o=a.length;if(0!==o){var h=this.pipeline;t.setPipeline(h,e);var u=h._tempMatrix1,c=h._tempMatrix2,l=h._tempMatrix3;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(s.matrix),r?(u.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y):(c.e-=s.scrollX*e.scrollFactorX,c.f-=s.scrollY*e.scrollFactorY),u.multiply(c,l);var d=e.frame,p=d.glTexture,f=d.cutX,m=d.cutY,g=p.width,v=p.height,y=e._isTinted&&e.tintFill,_=n.getTintAppendFloatAlpha(e._tintTL,s.alpha*e._alphaTL),x=n.getTintAppendFloatAlpha(e._tintTR,s.alpha*e._alphaTR),E=n.getTintAppendFloatAlpha(e._tintBL,s.alpha*e._alphaBL),T=n.getTintAppendFloatAlpha(e._tintBR,s.alpha*e._alphaBR);h.setTexture2D(p,0);var w,S,b=0,A=0,C=0,O=0,M=e._letterSpacing,R=0,P=0,I=0,L=0,G=e.fontData,D=G.chars,k=G.lineHeight,F=e._fontSize/G.size,N=e._align,B=0,U=0,V=e.getTextBounds(!1);0<e.maxWidth&&(o=(a=V.wrappedText).length);var Y=e._bounds.lines;1===N?U=(Y.longest-Y.lengths[0])/2:2===N&&(U=Y.longest-Y.lengths[0]);for(var z=s.roundPixels,H=0;H<o;H++)if(10!==(C=a.charCodeAt(H))){if(w=D[C]){R=f+w.x,P=m+w.y,I=w.width,L=w.height;var j=w.xOffset+b,W=w.yOffset+A;if(null!==S){var X=w.kerning[O];j+=void 0!==X?X:0}if(b+=w.xAdvance+M,S=w,O=C,0!==I&&0!==L&&32!==C){j*=F,W*=F,j-=e.displayOriginX;var Z=R/g,K=P/v,q=(R+I)/g,J=(P+L)/v,Q=(j+=U)+I*F,$=(W-=e.displayOriginY)+L*F,tt=l.getX(j,W),et=l.getY(j,W),it=l.getX(j,$),nt=l.getY(j,$),st=l.getX(Q,$),rt=l.getY(Q,$),at=l.getX(Q,W),ot=l.getY(Q,W);z&&(tt=Math.round(tt),et=Math.round(et),it=Math.round(it),nt=Math.round(nt),st=Math.round(st),rt=Math.round(rt),at=Math.round(at),ot=Math.round(ot)),h.batchQuad(tt,et,it,nt,st,rt,at,ot,Z,K,q,J,_,x,E,T,y,p,0)}}}else B++,1===N?U=(Y.longest-Y.lengths[B])/2:2===N&&(U=Y.longest-Y.lengths[B]),b=0,A+=k,S=null}}},function(t,e,i){var n=i(87);t.exports=function(t,e,i,s,r){var a=e._text,o=a.length,h=t.currentContext;if(0!==o&&n(t,h,e,s,r)){var u=e.frame,c=e.fontData.chars,l=e.fontData.lineHeight,d=e._letterSpacing,p=0,f=0,m=0,g=null,v=0,y=0,_=0,x=0,E=0,T=0,w=null,S=0,b=e.frame.source.image,A=u.cutX,C=u.cutY,O=e._fontSize/e.fontData.size,M=e._align,R=0,P=0,I=e.getTextBounds(!1);0<e.maxWidth&&(o=(a=I.wrappedText).length);var L=e._bounds.lines;1===M?P=(L.longest-L.lengths[0])/2:2===M&&(P=L.longest-L.lengths[0]),h.translate(-e.displayOriginX,-e.displayOriginY);for(var G=s.roundPixels,D=0;D<o;D++)if(10!==(m=a.charCodeAt(D))){if(g=c[m]){if(v=A+g.x,y=C+g.y,_=g.width,x=g.height,E=g.xOffset+p,T=g.yOffset+f,null!==w){var k=g.kerning[S];E+=void 0!==k?k:0}E*=O,T*=O,E+=P,p+=g.xAdvance+d,w=g,S=m,0!==_&&0!==x&&32!==m&&(G&&(E=Math.round(E),T=Math.round(T)),h.save(),h.translate(E,T),h.scale(O,O),h.drawImage(b,v,y,_,x,0,0,_,x),h.restore())}}else R++,1===M?P=(L.longest-L.lengths[R])/2:2===M&&(P=L.longest-L.lengths[R]),p=0,f+=l,w=null;h.restore()}}},function(t,e,i){var n=i(198);i(36).register("text",(function(t,e,i,s){return this.displayList.add(new n(this.scene,t,e,i,s))}))},function(t,e,i){var n=i(192);i(36).register("container",(function(t,e,i){return this.displayList.add(new n(this.scene,t,e,i))}))},function(t,e,i){var n=i(200);i(36).register("bitmapText",(function(t,e,i,s,r,a){return this.displayList.add(new n(this.scene,t,e,i,s,r,a))}))},function(t,e,i){var n=i(74),s=i(13),r={CreateInteractiveObject:i(201),Events:i(21),Gamepad:i(661),InputManager:i(167),InputPlugin:i(673),InputPluginCache:i(52),Keyboard:i(684),Mouse:i(701),Pointer:i(170),Touch:i(702)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={Axis:i(202),Button:i(203),Events:i(89),Gamepad:i(204),GamepadPlugin:i(668),Configs:i(669)}},function(t,e){t.exports="down"},function(t,e){t.exports="up"},function(t,e){t.exports="connected"},function(t,e){t.exports="disconnected"},function(t,e){t.exports="down"},function(t,e){t.exports="up"},function(t,e,i){var n=i(0),s=i(3),r=i(89),a=i(204),o=i(2),h=i(52),u=i(21),c=new n({Extends:s,initialize:function(t){s.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,t.pluginEvents.once(u.BOOT,this.boot,this),t.pluginEvents.on(u.START,this.start,this)},boot:function(){var t=this.scene.sys.game,e=this.settings.input,i=t.config;this.enabled=o(e,"gamepad",i.inputGamepad)&&t.device.input.gamepads,this.target=o(e,"gamepad.target",i.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(u.DESTROY,this.destroy,this)},start:function(){this.enabled&&this.startListeners(),this.sceneInputPlugin.pluginEvents.once(u.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){function t(t){!t.defaultPrevented&&e.isActive()&&(e.refreshPads(),e.queue.push(t))}var e=this,i=this.target;this.onGamepadHandler=t,i.addEventListener("gamepadconnected",t,!1),i.addEventListener("gamepaddisconnected",t,!1),this.sceneInputPlugin.pluginEvents.on(u.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(u.UPDATE,this.update)},disconnectAll:function(){for(var t=0;t<this.gamepads.length;t++)this.gamepads.connected=!1},refreshPads:function(){var t=navigator.getGamepads();if(t)for(var e=this.gamepads,i=0;i<t.length;i++){var n=t[i];if(n){var s=n.id,r=n.index,o=e[r];if(o)o.id!==s?(o.destroy(),e[r]=new a(this,n)):o.update(n);else{var h=new a(this,n);e[r]=h,this._pad1?this._pad2?this._pad3?this._pad4||(this._pad4=h):this._pad3=h:this._pad2=h:this._pad1=h}}}else this.disconnectAll()},getAll:function(){for(var t=[],e=this.gamepads,i=0;i<e.length;i++)e[i]&&t.push(e[i]);return t},getPad:function(t){for(var e=this.gamepads,i=0;i<e.length;i++)if(e[i]&&e[i].index===t)return e[i]},update:function(){if(this.enabled){this.refreshPads();var t=this.queue.length;if(0!==t)for(var e=this.queue.splice(0,t),i=0;i<t;i++){var n=e[i],s=this.getPad(n.gamepad.index);"gamepadconnected"===n.type?this.emit(r.CONNECTED,s,n):"gamepaddisconnected"===n.type&&this.emit(r.DISCONNECTED,s,n)}}},shutdown:function(){this.stopListeners(),this.disconnectAll(),this.removeAllListeners()},destroy:function(){this.shutdown();for(var t=0;t<this.gamepads.length;t++)this.gamepads[t]&&this.gamepads[t].destroy();this.gamepads=[],this.scene=null,this.settings=null,this.sceneInputPlugin=null,this.target=null},total:{get:function(){return this.gamepads.length}},pad1:{get:function(){return this._pad1}},pad2:{get:function(){return this._pad2}},pad3:{get:function(){return this._pad3}},pad4:{get:function(){return this._pad4}}});h.register("GamepadPlugin",c,"gamepad","gamepad","inputGamepad"),t.exports=c},function(t,e,i){t.exports={DUALSHOCK_4:i(670),SNES_USB:i(671),XBOX_360:i(672)}},function(t,e){t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SHARE:8,OPTIONS:9,PS:16,TOUCHBAR:17,X:0,CIRCLE:1,SQUARE:2,TRIANGLE:3,L1:4,R1:5,L2:6,R2:7,L3:10,R3:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},function(t,e){t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SELECT:8,START:9,B:0,A:1,Y:2,X:3,LEFT_SHOULDER:4,RIGHT_SHOULDER:5}},function(t,e){t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,MENU:16,A:0,B:1,X:2,Y:3,LB:4,RB:5,LT:6,RT:7,BACK:8,START:9,LS:10,RS:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},function(t,e,i){var n=i(674),s=i(205),r=i(0),a=i(74),o=i(201),h=i(679),u=i(68),c=i(194),l=i(195),d=i(21),p=i(3),f=i(4),m=i(24),g=i(52),v=i(16),y=i(10),_=i(23),x=i(58),E=i(11),T=i(680),w=i(207),S=new r({Extends:p,initialize:function(t){p.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new p,this.enabled=!0,this.displayList,this.cameras,g.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var e={cancelled:!1};this._eventContainer={stopPropagation:function(){e.cancelled=!0}},this._eventData=e,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._dragState=[],this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],this._updatedThisFrame=!1,t.sys.events.once(E.BOOT,this.boot,this),t.sys.events.on(E.START,this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once(E.DESTROY,this.destroy,this),this.pluginEvents.emit(d.BOOT)},start:function(){var t=this.systems.events;t.on(E.TRANSITION_START,this.transitionIn,this),t.on(E.TRANSITION_OUT,this.transitionOut,this),t.on(E.TRANSITION_COMPLETE,this.transitionComplete,this),t.on(E.PRE_UPDATE,this.preUpdate,this),t.once(E.SHUTDOWN,this.shutdown,this),this.manager.events.on(d.GAME_OUT,this.onGameOut,this),this.manager.events.on(d.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(d.START)},onGameOver:function(t){this.isActive()&&this.emit(d.GAME_OVER,t.timeStamp,t)},onGameOut:function(t){this.isActive()&&this.emit(d.GAME_OUT,t.timeStamp,t)},preUpdate:function(){this.pluginEvents.emit(d.PRE_UPDATE);var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,n=e.length;if(0!==i||0!==n){for(var s=this._list,r=0;r<i;r++){var a=t[r],o=s.indexOf(a);-1<o&&(s.splice(o,1),this.clear(a,!0))}t.length=0,this._pendingRemoval.length=0,this._list=s.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(d.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1;var i,n=this.manager,s=n.pointers,r=n.pointersTotal;for(i=0;i<r;i++)s[i].updateMotion();if(0===this._list.length)return!1;var a=this.pollRate;if(-1===a)return!1;if(0<a){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var o=!1;for(i=0;i<r;i++){var h=0,u=s[i];this._tempZones=[],this._temp=this.hitTestPointer(u),this.sortGameObjects(this._temp),this.sortGameObjects(this._tempZones),this.topOnly&&(this._temp.length&&this._temp.splice(1),this._tempZones.length&&this._tempZones.splice(1)),h+=this.processOverOutEvents(u),2===this.getDragState(u)&&this.processDragThresholdEvent(u,t),0<h&&(o=!0)}return o},update:function(t,e){if(!this.isActive())return!1;for(var i=e.length,n=!1,s=0;s<i;s++){var r=0,o=e[s];switch(this._tempZones=[],this._temp=this.hitTestPointer(o),this.sortGameObjects(this._temp),this.sortGameObjects(this._tempZones),this.topOnly&&(this._temp.length&&this._temp.splice(1),this._tempZones.length&&this._tempZones.splice(1)),t){case a.MOUSE_DOWN:r+=this.processDragDownEvent(o),r+=this.processDownEvents(o),r+=this.processOverOutEvents(o);break;case a.MOUSE_UP:r+=this.processDragUpEvent(o),r+=this.processUpEvents(o),r+=this.processOverOutEvents(o);break;case a.TOUCH_START:r+=this.processDragDownEvent(o),r+=this.processDownEvents(o),r+=this.processOverEvents(o);break;case a.TOUCH_END:case a.TOUCH_CANCEL:r+=this.processDragUpEvent(o),r+=this.processUpEvents(o),r+=this.processOutEvents(o);break;case a.MOUSE_MOVE:case a.TOUCH_MOVE:r+=this.processDragMoveEvent(o),r+=this.processMoveEvents(o),r+=this.processOverOutEvents(o);break;case a.MOUSE_WHEEL:r+=this.processWheelEvent(o)}0<r&&(n=!0)}return this._updatedThisFrame=!0,n},clear:function(t,e){void 0===e&&(e=!1);var i=t.input;if(i){e||this.queueForRemoval(t),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,this.manager.resetCursor(i),t.input=null;var n=this._draggable.indexOf(t);return-1<n&&this._draggable.splice(n,1),-1<(n=this._drag[0].indexOf(t))&&this._drag[0].splice(n,1),-1<(n=this._over[0].indexOf(t))&&this._over[0].splice(n,1),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,n){return void 0===n&&(n=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&n&&!t.input.dropZone&&(t.input.dropZone=n),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i<e.length;i++){for(var n=e[i],s=this.manager.hitTest(t,this._list,n),r=0;r<s.length;r++){var a=s[r];a.input.dropZone&&this._tempZones.push(a)}if(0<s.length)return t.camera=n,s}return t.camera=e[0],[]},processDownEvents:function(t){for(var e=0,i=this._temp,n=this._eventData,s=this._eventContainer,r=n.cancelled=!1,a=0;a<i.length;a++){var o=i[a];if(o.input){if(e++,o.emit(d.GAMEOBJECT_POINTER_DOWN,t,o.input.localX,o.input.localY,s),n.cancelled||!o.input){r=!0;break}if(this.emit(d.GAMEOBJECT_DOWN,t,o,s),n.cancelled||!o.input){r=!0;break}}}return!r&&this.manager&&(t.downElement===this.manager.game.canvas?this.emit(d.POINTER_DOWN,t,i):this.emit(d.POINTER_DOWN_OUTSIDE,t)),e},getDragState:function(t){return this._dragState[t.id]},setDragState:function(t,e){this._dragState[t.id]=e},processDragThresholdEvent:function(t,e){var i=!1,n=this.dragTimeThreshold,s=this.dragDistanceThreshold;if((0<s&&u(t.x,t.y,t.downX,t.downY)>=s||0<n&&e>=t.downTime+n)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;i<e.length;i++){var n=e[i],s=n.input;s.dragState=2,s.dragStartX=n.x,s.dragStartY=n.y,s.dragStartXGlobal=t.worldX,s.dragStartYGlobal=t.worldY,s.dragX=s.dragStartXGlobal-s.dragStartX,s.dragY=s.dragStartYGlobal-s.dragStartY,n.emit(d.GAMEOBJECT_DRAG_START,t,s.dragX,s.dragY),this.emit(d.DRAG_START,t,n)}return this.setDragState(t,4),e.length},processDragDownEvent:function(t){var e=this._temp;if(0===this._draggable.length||0===e.length||!t.primaryDown||0!==this.getDragState(t))return 0;this.setDragState(t,1);for(var i=[],n=0;n<e.length;n++){var s=e[n];s.input.draggable&&0===s.input.dragState&&i.push(s)}return 0===i.length?(this.setDragState(t,0),0):(1<i.length&&(this.sortGameObjects(i),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(2===this.getDragState(t)&&this.processDragThresholdEvent(t,this.manager.game.loop.now),4!==this.getDragState(t))return 0;for(var e=this._tempZones,i=this._drag[t.id],n=0;n<i.length;n++){var s,r,a=i[n],o=a.input,h=o.target;if(h){var u=e.indexOf(h);0===u?(a.emit(d.GAMEOBJECT_DRAG_OVER,t,h),this.emit(d.DRAG_OVER,t,a,h)):0<u?(a.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,a,h),o.target=e[0],h=o.target,a.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,a,h)):(a.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,a,h),e[0]?(o.target=e[0],h=o.target,a.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,a,h)):o.target=null)}else!h&&e[0]&&(o.target=e[0],h=o.target,a.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,a,h));if(a.parentContainer){var c=t.worldX-o.dragStartXGlobal,l=t.worldY-o.dragStartYGlobal,p=a.getParentRotation(),f=c*Math.cos(p)+l*Math.sin(p),m=l*Math.cos(p)-c*Math.sin(p);f*=1/a.parentContainer.scaleX,m*=1/a.parentContainer.scaleY,s=f+o.dragStartX,r=m+o.dragStartY}else s=t.worldX-o.dragX,r=t.worldY-o.dragY;a.emit(d.GAMEOBJECT_DRAG,t,s,r),this.emit(d.DRAG,t,a,s,r)}return i.length},processDragUpEvent:function(t){for(var e=this._drag[t.id],i=0;i<e.length;i++){var n=e[i],s=n.input;if(s&&2===s.dragState){s.dragState=0,s.dragX=s.localX-n.displayOriginX,s.dragY=s.localY-n.displayOriginY;var r=!1,a=s.target;a&&(n.emit(d.GAMEOBJECT_DROP,t,a),this.emit(d.DROP,t,n,a),r=!(s.target=null)),n.input&&(n.emit(d.GAMEOBJECT_DRAG_END,t,s.dragX,s.dragY,r),this.emit(d.DRAG_END,t,n,r))}}return this.setDragState(t,0),e.splice(0),0},processMoveEvents:function(t){for(var e=0,i=this._temp,n=this._eventData,s=this._eventContainer,r=n.cancelled=!1,a=0;a<i.length;a++){var o=i[a];if(o.input){if(e++,o.emit(d.GAMEOBJECT_POINTER_MOVE,t,o.input.localX,o.input.localY,s),n.cancelled||!o.input){r=!0;break}if(this.emit(d.GAMEOBJECT_MOVE,t,o,s),n.cancelled||!o.input){r=!0;break}if(this.topOnly)break}}return r||this.emit(d.POINTER_MOVE,t,i),e},processWheelEvent:function(t){for(var e=0,i=this._temp,n=this._eventData,s=this._eventContainer,r=n.cancelled=!1,a=t.deltaX,o=t.deltaY,h=t.deltaZ,u=0;u<i.length;u++){var c=i[u];if(c.input){if(e++,c.emit(d.GAMEOBJECT_POINTER_WHEEL,t,a,o,h,s),n.cancelled||!c.input){r=!0;break}if(this.emit(d.GAMEOBJECT_WHEEL,t,c,a,o,h,s),n.cancelled||!c.input){r=!0;break}}}return r||this.emit(d.POINTER_WHEEL,t,i,a,o,h),e},processOverEvents:function(t){var e=this._temp,i=0,n=e.length,s=[];if(0<n){for(var r=this.manager,a=this._eventData,o=this._eventContainer,h=a.cancelled=!1,u=0;u<n;u++){var c=e[u];if(c.input){if(s.push(c),r.setCursor(c.input),c.emit(d.GAMEOBJECT_POINTER_OVER,t,c.input.localX,c.input.localY,o),i++,a.cancelled||!c.input){h=!0;break}if(this.emit(d.GAMEOBJECT_OVER,t,c,o),a.cancelled||!c.input){h=!0;break}}}h||this.emit(d.POINTER_OVER,t,s)}return this._over[t.id]=s,i},processOutEvents:function(t){var e=this._over[t.id],i=0,n=e.length;if(0<n){var s=this.manager,r=this._eventData,a=this._eventContainer,o=r.cancelled=!1;this.sortGameObjects(e);for(var h=0;h<n;h++){var u=e[h];for(h=0;h<n;h++)if((u=e[h]).input){if(s.resetCursor(u.input),u.emit(d.GAMEOBJECT_POINTER_OUT,t,a),i++,r.cancelled||!u.input){o=!0;break}if(this.emit(d.GAMEOBJECT_OUT,t,u,a),r.cancelled||!u.input){o=!0;break}}o||this.emit(d.POINTER_OUT,t,e)}this._over[t.id]=[]}return i},processOverOutEvents:function(t){var e,i,n=this._temp,s=[],r=[],a=[],o=this._over[t.id],h=this._drag[t.id],u=this.manager;for(e=0;e<o.length;e++)i=o[e],-1===n.indexOf(i)&&-1===h.indexOf(i)?s.push(i):a.push(i);for(e=0;e<n.length;e++)i=n[e],-1===o.indexOf(i)&&r.push(i);var c=s.length,l=0,p=this._eventData,f=this._eventContainer,m=p.cancelled=!1;if(0<c){for(this.sortGameObjects(s),e=0;e<c;e++)if((i=s[e]).input){if(u.resetCursor(i.input),i.emit(d.GAMEOBJECT_POINTER_OUT,t,f),l++,p.cancelled||!i.input){m=!0;break}if(this.emit(d.GAMEOBJECT_OUT,t,i,f),p.cancelled||!i.input){m=!0;break}}m||this.emit(d.POINTER_OUT,t,s)}if(c=r.length,m=p.cancelled=!1,0<c){for(this.sortGameObjects(r),e=0;e<c;e++)if((i=r[e]).input){if(u.setCursor(i.input),i.emit(d.GAMEOBJECT_POINTER_OVER,t,i.input.localX,i.input.localY,f),l++,p.cancelled||!i.input){m=!0;break}if(this.emit(d.GAMEOBJECT_OVER,t,i,f),p.cancelled||!i.input){m=!0;break}}m||this.emit(d.POINTER_OVER,t,r)}return o=a.concat(r),this._over[t.id]=this.sortGameObjects(o),l},processUpEvents:function(t){for(var e=this._temp,i=this._eventData,n=this._eventContainer,s=i.cancelled=!1,r=0;r<e.length;r++){var a=e[r];if(a.input){if(a.emit(d.GAMEOBJECT_POINTER_UP,t,a.input.localX,a.input.localY,n),i.cancelled||!a.input){s=!0;break}if(this.emit(d.GAMEOBJECT_UP,t,a,n),i.cancelled||!a.input){s=!0;break}}}return!s&&this.manager&&(t.upElement===this.manager.game.canvas?this.emit(d.POINTER_UP,t,e):this.emit(d.POINTER_UP_OUTSIDE,t)),e.length},queueForInsertion:function(t){return-1===this._pendingInsertion.indexOf(t)&&-1===this._list.indexOf(t)&&this._pendingInsertion.push(t),this},queueForRemoval:function(t){return this._pendingRemoval.push(t),this},setDraggable:function(t,e){void 0===e&&(e=!0),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];n.input.draggable=e;var s=this._draggable.indexOf(n);e&&-1===s?this._draggable.push(n):!e&&-1<s&&this._draggable.splice(s,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var n=!1,s=!1,r=!1,a=!1,h=!1,u=!0;if(v(e)){var c=e;e=f(c,"hitArea",null),i=f(c,"hitAreaCallback",null),n=f(c,"draggable",!1),s=f(c,"dropZone",!1),r=f(c,"cursor",!1),a=f(c,"useHandCursor",!1),h=f(c,"pixelPerfect",!1);var l=f(c,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(l)),e&&i||(this.setHitAreaFromTexture(t),u=!1)}else"function"!=typeof e||i||(i=e,e={});for(var d=0;d<t.length;d++){var p=t[d];if(h&&"Container"===p.type)console.warn("Cannot pixelPerfect test a Container. Use a custom callback.");else{var m=p.input?p.input:o(p,e,i);m.customHitArea=u,m.dropZone=s,m.cursor=a?"pointer":r,p.input=m,n&&this.setDraggable(p),this.queueForInsertion(p)}}return this},setHitAreaCircle:function(t,e,i,r,a){void 0===a&&(a=s);var o=new n(e,i,r);return this.setHitArea(t,o,a)},setHitAreaEllipse:function(t,e,i,n,s,r){void 0===r&&(r=l);var a=new c(e,i,n,s);return this.setHitArea(t,a,r)},setHitAreaFromTexture:function(t,e){void 0===e&&(e=x),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i],s=n.frame,r=0,a=0;n.width?(r=n.width,a=n.height):s&&(r=s.realWidth,a=s.realHeight),"Container"!==n.type||0!==r&&0!==a?0!==r&&0!==a&&(n.input=o(n,new _(0,0,r,a),e),this.queueForInsertion(n)):console.warn("Container.setInteractive must specify a Shape or call setSize() first")}return this},setHitAreaRectangle:function(t,e,i,n,s,r){void 0===r&&(r=x);var a=new _(e,i,n,s);return this.setHitArea(t,a,r)},setHitAreaTriangle:function(t,e,i,n,s,r,a,o){void 0===o&&(o=w);var h=new T(e,i,n,s,r,a);return this.setHitArea(t,h,o)},enableDebug:function(t,e){void 0===e&&(e=65280);var i=t.input;if(!i||!i.hitArea)return this;var n=i.hitArea,s=n.type,r=i.hitAreaDebug,a=this.systems.add,o=this.systems.updateList;r&&(o.remove(r),r.destroy(),r=null);var h=0,u=0;switch(s){case m.CIRCLE:r=a.arc(0,0,n.radius),h=n.x-n.radius,u=n.y-n.radius;break;case m.ELLIPSE:r=a.ellipse(0,0,n.width,n.height),h=n.x-n.width/2,u=n.y-n.height/2;break;case m.LINE:r=a.line(0,0,n.x1,n.y1,n.x2,n.y2);break;case m.POLYGON:r=a.polygon(0,0,n.points);break;case m.RECTANGLE:r=a.rectangle(0,0,n.width,n.height),h=n.x,u=n.y;break;case m.TRIANGLE:r=a.triangle(0,0,n.x1,n.y1,n.x2,n.y2,n.x3,n.y3)}return r&&(r.isFilled=!1,r.preUpdate=function(){r.setStrokeStyle(1/t.scale,e),r.setDisplayOrigin(t.displayOriginX,t.displayOriginY);var i=t.x,n=t.y,s=t.rotation,a=t.scaleX,o=t.scaleY;if(t.parentContainer){var c=t.getWorldTransformMatrix();i=c.tx,n=c.ty,s=c.rotation,a=c.scaleX,o=c.scaleY}r.setRotation(s),r.setScale(a,o),r.setPosition(i+h,n+u),r.setScrollFactor(t.scrollFactorX,t.scrollFactorY),r.setDepth(t.depth)},o.add(r),i.hitAreaDebug=r),this},removeDebug:function(t){var e=t.input;if(e&&e.hitAreaDebug){var i=e.hitAreaDebug;this.systems.updateList.remove(i),i.destroy(),e.hitAreaDebug=null}return this},setPollAlways:function(){return this.setPollRate(0)},setPollOnMove:function(){return this.setPollRate(-1)},setPollRate:function(t){return this.pollRate=t,this._pollTimer=0,this},setGlobalTopOnly:function(t){return this.manager.globalTopOnly=t,this},setTopOnly:function(t){return this.topOnly=t,this},sortGameObjects:function(t){return t.length<2?t:(this.scene.sys.depthSort(),t.sort(this.sortHandlerGO.bind(this)))},sortHandlerGO:function(t,e){if(t.parentContainer||e.parentContainer){if(t.parentContainer===e.parentContainer)return e.parentContainer.getIndex(e)-t.parentContainer.getIndex(t);if(t.parentContainer===e)return-1;if(e.parentContainer===t)return 1;for(var i=t.getIndexList(),n=e.getIndexList(),s=Math.min(i.length,n.length),r=0;r<s;r++){var a=i[r],o=n[r];if(a!==o)return o-a}return n.length-i.length}return this.displayList.getIndex(e)-this.displayList.getIndex(t)},stopPropagation:function(){return this.manager._tempSkip=!0,this},addPointer:function(t){return this.manager.addPointer(t)},setDefaultCursor:function(t){return this.manager.setDefaultCursor(t),this},transitionIn:function(){this.enabled=this.settings.transitionAllowInput},transitionComplete:function(){this.settings.transitionAllowInput||(this.enabled=!0)},transitionOut:function(){this.enabled=this.settings.transitionAllowInput},shutdown:function(){this.pluginEvents.emit(d.SHUTDOWN),this._temp.length=0,this._list.length=0,this._draggable.length=0,this._pendingRemoval.length=0,this._pendingInsertion.length=0;for(var t=this._dragState.length=0;t<10;t++)this._drag[t]=[],this._over[t]=[];this.removeAllListeners();var e=this.systems.events;e.off(E.TRANSITION_START,this.transitionIn,this),e.off(E.TRANSITION_OUT,this.transitionOut,this),e.off(E.TRANSITION_COMPLETE,this.transitionComplete,this),e.off(E.PRE_UPDATE,this.preUpdate,this),this.manager.events.off(d.GAME_OUT,this.onGameOut,this),this.manager.events.off(d.GAME_OVER,this.onGameOver,this),e.off(E.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.pluginEvents.emit(d.DESTROY),this.pluginEvents.removeAllListeners(),this.scene.sys.events.off(E.START,this.start,this),this.scene=null,this.cameras=null,this.manager=null,this.events=null,this.mouse=null},x:{get:function(){return this.manager.activePointer.x}},y:{get:function(){return this.manager.activePointer.y}},isOver:{get:function(){return this.manager.isOver}},mousePointer:{get:function(){return this.manager.mousePointer}},activePointer:{get:function(){return this.manager.activePointer}},pointer1:{get:function(){return this.manager.pointers[1]}},pointer2:{get:function(){return this.manager.pointers[2]}},pointer3:{get:function(){return this.manager.pointers[3]}},pointer4:{get:function(){return this.manager.pointers[4]}},pointer5:{get:function(){return this.manager.pointers[5]}},pointer6:{get:function(){return this.manager.pointers[6]}},pointer7:{get:function(){return this.manager.pointers[7]}},pointer8:{get:function(){return this.manager.pointers[8]}},pointer9:{get:function(){return this.manager.pointers[9]}},pointer10:{get:function(){return this.manager.pointers[10]}}});y.register("InputPlugin",S,"input"),t.exports=S},function(t,e,i){var n=i(0),s=i(205),r=i(675),a=i(676),o=i(24),h=i(678),u=new n({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=o.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=u},function(t,e,i){var n=i(206),s=i(34),r=i(9),a=i(8);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=s(e,0,r.PI2);return n(t,o,i)}},function(t,e,i){var n=i(677),s=i(206),r=i(34),a=i(9);t.exports=function(t,e,i,o){void 0===o&&(o=[]),!e&&0<i&&(e=n(t)/i);for(var h=0;h<e;h++){var u=r(h/e,0,a.PI2);o.push(s(t,u))}return o}},function(t,e){t.exports=function(t){return Math.PI*t.radius*2}},function(t,e,i){var n=i(8);t.exports=function(t,e){void 0===e&&(e=new n);var i=2*Math.PI*Math.random(),s=Math.random()+Math.random(),r=1<s?2-s:s,a=r*Math.cos(i),o=r*Math.sin(i);return e.x=t.x+a*t.radius,e.y=t.y+o*t.radius,e}},function(t,e){t.exports=function(t,e){return function(i,n,s,r){var a=t.getPixelAlpha(n,s,r.texture.key,r.frame.name);return a&&e<=a}}},function(t,e,i){var n=i(0),s=i(207),r=i(681),a=i(682),o=i(24),h=i(59),u=i(683),c=new n({initialize:function(t,e,i,n,s,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=0),this.type=o.TRIANGLE,this.x1=t,this.y1=e,this.x2=i,this.y2=n,this.x3=s,this.y3=r},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return u(this,t)},setTo:function(t,e,i,n,s,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this.x3=s,this.y3=r,this},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.x3,this.y3,this.x1,this.y1),t},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(t){var e;e=this.x1<=this.x2&&this.x1<=this.x3?this.x1-t:this.x2<=this.x1&&this.x2<=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(t){var e;e=this.x1>=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=c},function(t,e,i){var n=i(8),s=i(60);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=t.getLineA(),a=t.getLineB(),o=t.getLineC();if(e<=0||1<=e)return i.x=r.x1,i.y=r.y1,i;var h=s(r),u=s(a),c=s(o),l=(h+u+c)*e,d=0;return l<h?(d=l/h,i.x=r.x1+(r.x2-r.x1)*d,i.y=r.y1+(r.y2-r.y1)*d):h+u<l?(d=(l-=h+u)/c,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d):(d=(l-=h)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d),i}},function(t,e,i){var n=i(60),s=i(8);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var a=t.getLineA(),o=t.getLineB(),h=t.getLineC(),u=n(a),c=n(o),l=n(h),d=u+c+l;!e&&0<i&&(e=d/i);for(var p=0;p<e;p++){var f=d*(p/e),m=0,g=new s;f<u?(m=f/u,g.x=a.x1+(a.x2-a.x1)*m,g.y=a.y1+(a.y2-a.y1)*m):u+c<f?(m=(f-=u+c)/l,g.x=h.x1+(h.x2-h.x1)*m,g.y=h.y1+(h.y2-h.y1)*m):(m=(f-=u)/c,g.x=o.x1+(o.x2-o.x1)*m,g.y=o.y1+(o.y2-o.y1)*m),r.push(g)}return r}},function(t,e,i){var n=i(8);t.exports=function(t,e){void 0===e&&(e=new n);var i=t.x2-t.x1,s=t.y2-t.y1,r=t.x3-t.x1,a=t.y3-t.y1,o=Math.random(),h=Math.random();return 1<=o+h&&(o=1-o,h=1-h),e.x=t.x1+(i*o+r*h),e.y=t.y1+(s*o+a*h),e}},function(t,e,i){t.exports={Events:i(53),KeyboardManager:i(168),KeyboardPlugin:i(692),Key:i(208),KeyCodes:i(49),KeyCombo:i(209),JustDown:i(697),JustUp:i(698),DownDuration:i(699),UpDuration:i(700)}},function(t,e){t.exports="keydown"},function(t,e){t.exports="keyup"},function(t,e){t.exports="keycombomatch"},function(t,e){t.exports="down"},function(t,e){t.exports="keydown-"},function(t,e){t.exports="keyup-"},function(t,e){t.exports="up"},function(t,e,i){var n=i(0),s=i(3),r=i(53),a=i(6),o=i(2),h=i(21),u=i(52),c=i(208),l=i(49),d=i(209),p=i(696),f=i(45),m=new n({Extends:s,initialize:function(t){s.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=o(t,"keyboard",!0);var e=o(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.useQueue?this.sceneInputPlugin.pluginEvents.on(h.UPDATE,this.update,this):this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(a.BLUR,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:l.UP,down:l.DOWN,left:l.LEFT,right:l.RIGHT,space:l.SPACE,shift:l.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var n={};if("string"==typeof t){t=t.split(",");for(var s=0;s<t.length;s++){var r=t[s].trim();r&&(n[r]=this.addKey(r,e,i))}}else for(var a in t)n[a]=this.addKey(t[a],e,i);return n},addKey:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var n=this.keys;if(t instanceof c){var s=n.indexOf(t);return-1<s?n[s]=t:n[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=l[t.toUpperCase()]),n[t]||(n[t]=new c(this,t),e&&this.addCapture(t),n[t].setEmitOnRepeat(i)),n[t]},removeKey:function(t,e){void 0===e&&(e=!1);var i,n=this.keys;if(t instanceof c){var s=n.indexOf(t);-1<s&&(i=this.keys[s],this.keys[s]=void 0)}else"string"==typeof t&&(t=l[t.toUpperCase()]);return n[t]&&(i=n[t],n[t]=void 0),i&&(i.plugin=null,e&&i.destroy()),this},removeAllKeys:function(t){for(var e=this.keys,i=0;i<e.length;i++){var n=e[i];n&&(e[i]=void 0,t&&n.destroy())}return this},createCombo:function(t,e){return new d(this,t,e)},checkDown:function(t,e){if(void 0===e&&(e=0),this.enabled&&t.isDown){var i=f(this.time-t.timeDown,e);if(i>t._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,n=0;n<e;n++){var s=t[n],a=s.keyCode,o=i[a],h=!1;void 0===s.cancelled&&(s.cancelled=0,s.stopImmediatePropagation=function(){s.cancelled=1},s.stopPropagation=function(){s.cancelled=-1}),-1!==s.cancelled&&("keydown"===s.type?(o&&(h=o.isDown,o.onDown(s)),s.cancelled||o&&h||(p[a]&&(this.emit(r.KEY_DOWN+p[a],s),this.emit("keydown_"+p[a],s)),s.cancelled||this.emit(r.ANY_KEY_DOWN,s))):(o&&o.onUp(s),s.cancelled||(p[a]&&(this.emit(r.KEY_UP+p[a],s),this.emit("keyup_"+p[a],s)),s.cancelled||this.emit(r.ANY_KEY_UP,s))),1===s.cancelled&&(s.cancelled=0))}},resetKeys:function(){for(var t=this.keys,e=0;e<t.length;e++)t[e]&&t[e].reset();return this},shutdown:function(){this.resetKeys(),this.sceneInputPlugin.manager.useQueue?this.sceneInputPlugin.pluginEvents.off(h.UPDATE,this.update,this):this.sceneInputPlugin.manager.events.off(h.MANAGER_PROCESS,this.update,this),this.game.events.off(a.BLUR,this.resetKeys),this.removeAllListeners(),this.queue=[]},destroy:function(){this.shutdown();for(var t=this.keys,e=0;e<t.length;e++)t[e]&&t[e].destroy();this.keys=[],this.combos=[],this.queue=[],this.scene=null,this.settings=null,this.sceneInputPlugin=null,this.manager=null},time:{get:function(){return this.sceneInputPlugin.manager.time}}});u.register("KeyboardPlugin",m,"keyboard","keyboard","inputKeyboard"),t.exports=m},function(t,e,i){var n=i(694);t.exports=function(t,e){if(e.matched)return!0;var i=!1,s=!1;if(t.keyCode===e.current)if(0<e.index&&0<e.maxKeyDelay){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(s=!0,i=n(t,e))}else s=!0,i=n(t,e);return!s&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},function(t,e){t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},function(t,e){t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},function(t,e,i){var n=i(49),s={};for(var r in n)s[n[r]]=r;t.exports=s},function(t,e){t.exports=function(t){return!!t._justDown&&!(t._justDown=!1)}},function(t,e){t.exports=function(t){return!!t._justUp&&!(t._justUp=!1)}},function(t,e){t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i<e}},function(t,e){t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeUp;return t.isUp&&i<e}},function(t,e,i){t.exports={MouseManager:i(169)}},function(t,e,i){t.exports={TouchManager:i(171)}},function(t,e,i){var n=i(0),s=i(25),r=i(4),a=i(210),o=i(16),h=i(212),u=i(213),c=new n({Extends:u,initialize:function(t,e,i,n,s,c){var l,d;if(o(e)){var p=e;e=r(p,"key"),l=new a(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new h(t,{key:e,url:r(p,"atlasURL"),extension:r(p,"atlasExtension","json"),xhrSettings:r(p,"atlasXhrSettings")})}else l=new a(t,e,i,s),d=new h(t,e,n,c);l.linkFile?u.call(this,t,"atlasjson",e,[l,d,l.linkFile]):u.call(this,t,"atlasjson",e,[l,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});s.register("atlas",(function(t,e,i,n,s){var r;if(Array.isArray(t))for(var a=0;a<t.length;a++)r=new c(this,t[a]),this.addFile(r.files);else r=new c(this,t,e,i,n,s),this.addFile(r.files);return this})),t.exports=c},function(t,e){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},function(t,e,i){var n=i(211);t.exports=function(t,e){var i=n(e,t.xhrSettings),s=new XMLHttpRequest;if(s.open("GET",t.src,i.async,i.user,i.password),s.responseType=t.xhrSettings.responseType,s.timeout=i.timeout,i.headers)for(var r in i.headers)s.setRequestHeader(r,i.headers[r]);return i.header&&i.headerValue&&s.setRequestHeader(i.header,i.headerValue),i.requestedWith&&s.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&s.overrideMimeType(i.overrideMimeType),i.withCredentials&&(s.withCredentials=!0),s.onload=t.onLoad.bind(t,s),s.onerror=t.onError.bind(t,s),s.onprogress=t.onProgress.bind(t),s.send(),s}},function(t,e,i){var n=i(0),s=i(25),r=i(4),a=i(210),o=i(16),h=i(213),u=i(88),c=i(707),l=new n({Extends:h,initialize:function(t,e,i,n,s,u){var l,d;if(o(e)){var p=e;e=r(p,"key"),l=new a(t,{key:e,url:r(p,"textureURL"),extension:r(p,"textureExtension","png"),normalMap:r(p,"normalMap"),xhrSettings:r(p,"textureXhrSettings")}),d=new c(t,{key:e,url:r(p,"fontDataURL"),extension:r(p,"fontDataExtension","xml"),xhrSettings:r(p,"fontDataXhrSettings")})}else l=new a(t,e,i,s),d=new c(t,e,n,u);l.linkFile?h.call(this,t,"bitmapfont",e,[l,d,l.linkFile]):h.call(this,t,"bitmapfont",e,[l,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.addToCache(),this.loader.cacheManager.bitmapFont.add(t.key,{data:u(e.data),texture:t.key,frame:null}),this.complete=!0}}});s.register("bitmapFont",(function(t,e,i,n,s){var r;if(Array.isArray(t))for(var a=0;a<t.length;a++)r=new l(this,t[a]),this.addFile(r.files);else r=new l(this,t,e,i,n,s),this.addFile(r.files);return this})),t.exports=l},function(t,e,i){var n=i(0),s=i(38),r=i(90),a=i(25),o=i(4),h=i(16),u=i(708),c=new n({Extends:r,initialize:function(t,e,i,n){var s="xml";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),n=o(a,"xhrSettings"),s=o(a,"extension",s)}var u={type:"xml",cache:t.cacheManager.xml,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,u)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=u(this.xhrLoader.responseText),this.data?this.onProcessComplete():(console.warn("Invalid XMLFile: "+this.key),this.onProcessError())}});a.register("xml",(function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new c(this,t[n]));else this.addFile(new c(this,t,e,i));return this})),t.exports=c},function(t,e){t.exports=function(t){var e="";try{window.DOMParser?e=(new DOMParser).parseFromString(t,"text/xml"):(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},function(t,e,i){var n=i(0),s=i(38),r=i(710),a=i(3),o=i(76),h=i(25),u=i(4),c=i(10),l=i(11),d=i(91),p=new n({Extends:a,initialize:function(t){a.call(this);var e=t.sys.game.config,i=t.sys.settings.loader;this.scene=t,this.systems=t.sys,this.cacheManager=t.sys.cache,this.textureManager=t.sys.textures,this.sceneManager=t.sys.game.scene,h.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(u(i,"baseURL",e.loaderBaseURL)),this.setPath(u(i,"path",e.loaderPath)),this.setPrefix(u(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=u(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=d(u(i,"responseType",e.loaderResponseType),u(i,"async",e.loaderAsync),u(i,"user",e.loaderUser),u(i,"password",e.loaderPassword),u(i,"timeout",e.loaderTimeout),u(i,"withCredentials",e.loaderWithCredentials)),this.crossOrigin=u(i,"crossOrigin",e.loaderCrossOrigin),this.totalToLoad=0,this.progress=0,this.list=new r,this.inflight=new r,this.queue=new r,this._deleteQueue=new r,this.totalFailed=0,this.totalComplete=0,this.state=s.LOADER_IDLE,this.multiKeyIndex=0,t.sys.events.once(l.BOOT,this.boot,this),t.sys.events.on(l.START,this.pluginStart,this)},boot:function(){this.systems.events.once(l.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(l.SHUTDOWN,this.shutdown,this)},setBaseURL:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.baseURL=t,this},setPath:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.path=t,this},setPrefix:function(t){return void 0===t&&(t=""),this.prefix=t,this},setCORS:function(t){return this.crossOrigin=t,this},addFile:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=t[e];this.keyExists(i)||(this.list.set(i),this.emit(o.ADD,i.key,i.type,this,i),this.isLoading()&&(this.totalToLoad++,this.updateProgress()))}},keyExists:function(t){var e=t.hasCacheConflict();return e||this.list.iterate((function(i){if(i.type===t.type&&i.key===t.key)return!(e=!0)})),!e&&this.isLoading()&&(this.inflight.iterate((function(i){if(i.type===t.type&&i.key===t.key)return!(e=!0)})),this.queue.iterate((function(i){if(i.type===t.type&&i.key===t.key)return!(e=!0)}))),e},addPack:function(t,e){e&&t.hasOwnProperty(e)&&(t={packKey:t[e]});var i=0,n=this.baseURL,s=this.path,r=this.prefix;for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){var o=t[a],h=u(o,"baseURL",n),c=u(o,"path",s),l=u(o,"prefix",r),d=u(o,"files",null),p=u(o,"defaultType","void");if(Array.isArray(d)){this.setBaseURL(h),this.setPath(c),this.setPrefix(l);for(var f=0;f<d.length;f++){var m=d[f],g=m.hasOwnProperty("type")?m.type:p;this[g]&&(this[g](m),i++)}}}return this.setBaseURL(n),this.setPath(s),this.setPrefix(r),0<i},isLoading:function(){return this.state===s.LOADER_LOADING||this.state===s.LOADER_PROCESSING},isReady:function(){return this.state===s.LOADER_IDLE||this.state===s.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(o.START,this),0===this.list.size?this.loadComplete():(this.state=s.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(l.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(o.PROGRESS,this.progress)},update:function(){this.state===s.LOADER_LOADING&&0<this.list.size&&this.inflight.size<this.maxParallelDownloads&&this.checkLoadQueue()},checkLoadQueue:function(){this.list.each((function(t){if((t.state===s.FILE_POPULATED||t.state===s.FILE_PENDING&&this.inflight.size<this.maxParallelDownloads)&&(this.inflight.set(t),this.list.delete(t),t.crossOrigin||(t.crossOrigin=this.crossOrigin),t.load()),this.inflight.size===this.maxParallelDownloads)return!1}),this)},nextFile:function(t,e){this.inflight&&(this.inflight.delete(t),this.updateProgress(),e?(this.totalComplete++,this.queue.set(t),this.emit(o.FILE_LOAD,t),t.onProcess()):(this.totalFailed++,this._deleteQueue.set(t),this.emit(o.FILE_LOAD_ERROR,t),this.fileProcessComplete(t)))},fileProcessComplete:function(t){this.scene&&this.systems&&this.systems.game&&!this.systems.game.pendingDestroy&&(t.state===s.FILE_ERRORED?t.multiFile&&t.multiFile.onFileFailed(t):t.state===s.FILE_COMPLETE&&(t.multiFile?t.multiFile.isReadyToProcess()&&t.multiFile.addToCache():t.addToCache()),this.queue.delete(t),0===this.list.size&&0===this.inflight.size&&0===this.queue.size&&this.loadComplete())},loadComplete:function(){this.emit(o.POST_PROCESS,this),this.list.clear(),this.inflight.clear(),this.queue.clear(),this.progress=1,this.state=s.LOADER_COMPLETE,this.systems.events.off(l.UPDATE,this.update,this),this._deleteQueue.iterateLocal("destroy"),this._deleteQueue.clear(),this.emit(o.COMPLETE,this,this.totalComplete,this.totalFailed)},flagForRemoval:function(t){this._deleteQueue.set(t)},saveJSON:function(t,e){return this.save(JSON.stringify(t),e)},save:function(t,e,i){void 0===e&&(e="file.json"),void 0===i&&(i="application/json");var n=new Blob([t],{type:i}),s=URL.createObjectURL(n),r=document.createElement("a");return r.download=e,r.textContent="Download "+e,r.href=s,r.click(),this},reset:function(){this.list.clear(),this.inflight.clear(),this.queue.clear();var t=this.systems.game.config,e=this.systems.settings.loader;this.setBaseURL(u(e,"baseURL",t.loaderBaseURL)),this.setPath(u(e,"path",t.loaderPath)),this.setPrefix(u(e,"prefix",t.loaderPrefix)),this.state=s.LOADER_IDLE},shutdown:function(){this.reset(),this.state=s.LOADER_SHUTDOWN,this.systems.events.off(l.UPDATE,this.update,this),this.systems.events.off(l.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.state=s.LOADER_DESTROYED,this.systems.events.off(l.UPDATE,this.update,this),this.systems.events.off(l.START,this.pluginStart,this),this.list=null,this.inflight=null,this.queue=null,this.scene=null,this.systems=null,this.textureManager=null,this.cacheManager=null,this.sceneManager=null}});c.register("Loader",p,"load"),t.exports=p},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries=[],Array.isArray(t))for(var e=0;e<t.length;e++)this.set(t[e])},set:function(t){return-1===this.entries.indexOf(t)&&this.entries.push(t),this},get:function(t,e){for(var i=0;i<this.entries.length;i++){var n=this.entries[i];if(n[t]===e)return n}},getArray:function(){return this.entries.slice(0)},delete:function(t){var e=this.entries.indexOf(t);return-1<e&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t<this.entries.length;t++){var e=this.entries[t];console.log(e)}console.groupEnd()},each:function(t,e){var i,n=this.entries.slice(),s=n.length;if(e)for(i=0;i<s&&!1!==t.call(e,n[i],i);i++);else for(i=0;i<s&&!1!==t(n[i],i);i++);return this},iterate:function(t,e){var i,n=this.entries.length;if(e)for(i=0;i<n&&!1!==t.call(e,this.entries[i],i);i++);else for(i=0;i<n&&!1!==t(this.entries[i],i);i++);return this},iterateLocal:function(t){var e,i=[];for(e=1;e<arguments.length;e++)i.push(arguments[e]);var n=this.entries.length;for(e=0;e<n;e++){var s=this.entries[e];s[t].apply(s,i)}return this},clear:function(){return this.entries.length=0,this},contains:function(t){return-1<this.entries.indexOf(t)},union:function(t){var e=new n;return t.entries.forEach((function(t){e.set(t)})),this.entries.forEach((function(t){e.set(t)})),e},intersect:function(t){var e=new n;return this.entries.forEach((function(i){t.contains(i)&&e.set(i)})),e},difference:function(t){var e=new n;return this.entries.forEach((function(i){t.contains(i)||e.set(i)})),e},size:{get:function(){return this.entries.length},set:function(t){return t<this.entries.length?this.entries.length=t:this.entries.length}}});t.exports=n},function(t,e,i){t.exports={BasePlugin:i(214),DefaultPlugins:i(70),PluginCache:i(10),PluginManager:i(172),ScenePlugin:i(712)}},function(t,e,i){var n=i(214),s=i(0),r=i(11),a=new s({Extends:n,initialize:function(t,e){n.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once(r.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=a},function(t,e,i){t.exports={Canvas:i(714),Snapshot:i(715),WebGL:i(716)}},function(t,e,i){t.exports={CanvasRenderer:i(153),GetBlendModes:i(155),SetTransform:i(87)}},function(t,e,i){t.exports={Canvas:i(154),WebGL:i(157)}},function(t,e,i){t.exports={Utils:i(19),WebGLPipeline:i(47),WebGLRenderer:i(156),Pipelines:i(717),BYTE:0,SHORT:1,UNSIGNED_BYTE:2,UNSIGNED_SHORT:3,FLOAT:4}},function(t,e,i){t.exports={BitmapMaskPipeline:i(158),ForwardDiffuseLightPipeline:i(159),TextureTintPipeline:i(71),TextureTintStripPipeline:i(162),ModelViewProjection:i(72)}},function(t,e,i){var n=i(13),s=i(75),r={Center:i(175),Events:i(33),Orientation:i(176),ScaleManager:i(174),ScaleModes:i(177),Zoom:i(178)};r=n(!1,r,s.CENTER),r=n(!1,r,s.ORIENTATION),r=n(!1,r,s.SCALE_MODE),r=n(!1,r,s.ZOOM),t.exports=r},function(t,e,i){var n=i(50),s=i(13),r={Events:i(11),SceneManager:i(179),ScenePlugin:i(720),Settings:i(181),Systems:i(77)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(5),s=i(0),r=i(11),a=i(4),o=i(10),h=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.pluginStart,this)},boot:function(){this.systems.events.once(r.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(r.SHUTDOWN,this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=a(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var n=a(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=n,this._willSleep=a(t,"sleep",!1),this._willRemove=a(t,"remove",!1);var s=a(t,"onUpdate",null);s&&(this._onUpdate=s,this._onUpdateScope=a(t,"onUpdateScope",this.scene));var o=a(t,"allowInput",!1);this.settings.transitionAllowInput=o;var h=i.sys.settings;return h.isTransition=!0,h.transitionFrom=this.scene,h.transitionDuration=n,h.transitionAllowInput=o,a(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):a(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake(a(t,"data")):this.manager.start(e,a(t,"data")),this.systems.events.emit(r.TRANSITION_OUT,i,n),this.systems.events.on(r.UPDATE,this.step,this),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=n(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off(r.UPDATE,this.step,this),t.events.emit(r.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,n){return this.manager.add(t,e,i,n)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(r.SHUTDOWN,this.shutdown,this),t.off(r.POST_UPDATE,this.step,this),t.off(r.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});o.register("ScenePlugin",h,"scenePlugin"),t.exports=h},function(t,e,i){var n=i(13),s=i(722),r={CanvasTexture:i(184),Events:i(46),FilterMode:s,Frame:i(80),Parsers:i(186),Texture:i(79),TextureManager:i(183),TextureSource:i(185)};r=n(!1,r,s),t.exports=r},function(t,e){t.exports={LINEAR:0,NEAREST:1}},function(t,e,i){t.exports={Clock:i(724),TimerEvent:i(215)}},function(t,e,i){var n=i(0),s=i(10),r=i(11),a=i(215),o=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.now=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(r.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(r.PRE_UPDATE,this.preUpdate,this),t.on(r.UPDATE,this.update,this),t.once(r.SHUTDOWN,this.shutdown,this)},addEvent:function(t){var e=new a(t);return this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,n){return this.addEvent({delay:t,callback:e,args:i,callbackScope:n})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeAllEvents:function(){return this._pendingRemoval=this._pendingRemoval.concat(this._active),this},preUpdate:function(){var t=this._pendingRemoval.length,e=this._pendingInsertion.length;if(0!==t||0!==e){var i,n;for(i=0;i<t;i++){n=this._pendingRemoval[i];var s=this._active.indexOf(n);-1<s&&this._active.splice(s,1),n.destroy()}for(i=0;i<e;i++)n=this._pendingInsertion[i],this._active.push(n);this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){if(this.now=t,!this.paused){e*=this.timeScale;for(var i=0;i<this._active.length;i++){var n=this._active[i];if(!n.paused&&(n.elapsed+=e*n.timeScale,n.elapsed>=n.delay)){var s=n.elapsed-n.delay;n.elapsed=n.delay,!n.hasDispatched&&n.callback&&(n.hasDispatched=!0,n.callback.apply(n.callbackScope,n.args)),0<n.repeatCount?(n.repeatCount--,n.elapsed=s,n.hasDispatched=!1):this._pendingRemoval.push(n)}}}},shutdown:function(){var t;for(t=0;t<this._pendingInsertion.length;t++)this._pendingInsertion[t].destroy();for(t=0;t<this._active.length;t++)this._active[t].destroy();for(t=0;t<this._pendingRemoval.length;t++)this._pendingRemoval[t].destroy();this._active.length=0,this._pendingRemoval.length=0,this._pendingInsertion.length=0;var e=this.systems.events;e.off(r.PRE_UPDATE,this.preUpdate,this),e.off(r.UPDATE,this.update,this),e.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null}});s.register("Clock",o,"time"),t.exports=o},function(t,e,i){var n=i(32),s=i(13),r={Builders:i(726),Events:i(96),TweenManager:i(742),Tween:i(95),TweenData:i(97),Timeline:i(221)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={GetBoolean:i(31),GetEaseFunction:i(39),GetNewValue:i(54),GetProps:i(216),GetTargets:i(92),GetTweens:i(217),GetValueOp:i(93),NumberTweenBuilder:i(218),StaggerBuilder:i(219),TimelineBuilder:i(220),TweenBuilder:i(55)}},function(t,e){t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","loop","loopDelay","offset","onActive","onActiveParams","onActiveScope","onComplete","onCompleteParams","onCompleteScope","onLoop","onLoopParams","onLoopScope","onRepeat","onRepeatParams","onRepeatScope","onStart","onStartParams","onStartScope","onStop","onStopParams","onStopScope","onUpdate","onUpdateParams","onUpdateScope","onYoyo","onYoyoParams","onYoyoScope","paused","props","repeat","repeatDelay","targets","useFrames","yoyo"]},function(t,e){t.exports="complete"},function(t,e){t.exports="loop"},function(t,e){t.exports="pause"},function(t,e){t.exports="resume"},function(t,e){t.exports="start"},function(t,e){t.exports="update"},function(t,e){t.exports="active"},function(t,e){t.exports="complete"},function(t,e){t.exports="loop"},function(t,e){t.exports="repeat"},function(t,e){t.exports="start"},function(t,e){t.exports="stop"},function(t,e){t.exports="update"},function(t,e){t.exports="yoyo"},function(t,e,i){var n=i(48),s=i(0),r=i(218),a=i(10),o=i(11),h=i(219),u=i(220),c=i(32),l=i(55),d=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.timeScale=1,this._add=[],this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,t.sys.events.once(o.BOOT,this.boot,this),t.sys.events.on(o.START,this.start,this)},boot:function(){this.systems.events.once(o.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(o.PRE_UPDATE,this.preUpdate,this),t.on(o.UPDATE,this.update,this),t.once(o.SHUTDOWN,this.shutdown,this),this.timeScale=1},createTimeline:function(t){return u(this,t)},timeline:function(t){var e=u(this,t);return e.paused||(this._add.push(e),this._toProcess++),e},create:function(t){return l(this,t)},add:function(t){var e=l(this,t);return this._add.push(e),this._toProcess++,e},existing:function(t){return this._add.push(t),this._toProcess++,this},addCounter:function(t){var e=r(this,t);return this._add.push(e),this._toProcess++,e},stagger:function(t,e){return h(t,e)},preUpdate:function(){if(0!==this._toProcess){var t,e,i=this._destroy,n=this._active,s=this._pending;for(t=0;t<i.length;t++){e=i[t];var r=n.indexOf(e);-1===r?-1<(r=s.indexOf(e))&&(e.state=c.REMOVED,s.splice(r,1)):(e.state=c.REMOVED,n.splice(r,1))}for(i.length=0,i=this._add,t=0;t<i.length;t++)(e=i[t]).state===c.PENDING_ADD&&(e.init()?(e.play(),this._active.push(e)):this._pending.push(e));i.length=0,this._toProcess=0}},update:function(t,e){var i,n=this._active;e*=this.timeScale;for(var s=0;s<n.length;s++)(i=n[s]).update(t,e)&&(this._destroy.push(i),this._toProcess++)},remove:function(t){return n(this._add,t),n(this._pending,t),n(this._active,t),n(this._destroy,t),t.state=c.REMOVED,this},makeActive:function(t){if(-1!==this._add.indexOf(t)||-1!==this._active.indexOf(t))return this;var e=this._pending.indexOf(t);return-1!==e&&this._pending.splice(e,1),this._add.push(t),t.state=c.PENDING_ADD,this._toProcess++,this},each:function(t,e){for(var i=[null],n=1;n<arguments.length;n++)i.push(arguments[n]);for(var s in this.list)i[0]=this.list[s],t.apply(e,i)},getAllTweens:function(){for(var t=this._active,e=[],i=0;i<t.length;i++)e.push(t[i]);return e},getGlobalTimeScale:function(){return this.timeScale},getTweensOf:function(t){var e,i,n=this._active,s=[];if(Array.isArray(t))for(i=0;i<n.length;i++){e=n[i];for(var r=0;r<t.length;r++)e.hasTarget(t[r])&&s.push(e)}else for(i=0;i<n.length;i++)(e=n[i]).hasTarget(t)&&s.push(e);return s},isTweening:function(t){for(var e,i=this._active,n=0;n<i.length;n++)if((e=i[n]).hasTarget(t)&&e.isPlaying())return!0;return!1},killAll:function(){for(var t=this.getAllTweens(),e=0;e<t.length;e++)t[e].stop();return this},killTweensOf:function(t){for(var e=this.getTweensOf(t),i=0;i<e.length;i++)e[i].stop();return this},pauseAll:function(){for(var t=this._active,e=0;e<t.length;e++)t[e].pause();return this},resumeAll:function(){for(var t=this._active,e=0;e<t.length;e++)t[e].resume();return this},setGlobalTimeScale:function(t){return this.timeScale=t,this},shutdown:function(){this.killAll(),this._add=[],this._pending=[],this._active=[],this._destroy=[],this._toProcess=0;var t=this.systems.events;t.off(o.PRE_UPDATE,this.preUpdate,this),t.off(o.UPDATE,this.update,this),t.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off(o.START,this.start,this),this.scene=null,this.systems=null}});a.register("TweenManager",d,"tweens"),t.exports=d},function(t,e,i){t.exports={Array:i(83),Base64:i(744),Objects:i(746),String:i(753)}},function(t,e,i){t.exports={ArrayBufferToBase64:i(745),Base64ToArrayBuffer:i(189)}},function(t,e){var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports=function(t,e){for(var n=new Uint8Array(t),s=n.length,r=e?"data:"+e+";base64,":"",a=0;a<s;a+=3)r+=i[n[a]>>2],r+=i[(3&n[a])<<4|n[a+1]>>4],r+=i[(15&n[a+1])<<2|n[a+2]>>6],r+=i[63&n[a+2]];return s%3==2?r=r.substring(0,r.length-1)+"=":s%3==1&&(r=r.substring(0,r.length-2)+"=="),r}},function(t,e,i){t.exports={Clone:i(26),Extend:i(13),GetAdvancedValue:i(37),GetFastValue:i(4),GetMinMaxValue:i(747),GetValue:i(2),HasAll:i(748),HasAny:i(749),HasValue:i(222),IsPlainObject:i(16),Merge:i(182),MergeRight:i(750),Pick:i(751),SetValue:i(752)}},function(t,e,i){var n=i(2),s=i(5);t.exports=function(t,e,i,r,a){void 0===a&&(a=i);var o=n(t,e,a);return s(o,i,r)}},function(t,e){t.exports=function(t,e){for(var i=0;i<e.length;i++)if(!t.hasOwnProperty(e[i]))return!1;return!0}},function(t,e){t.exports=function(t,e){for(var i=0;i<e.length;i++)if(t.hasOwnProperty(e[i]))return!0;return!1}},function(t,e,i){var n=i(26);t.exports=function(t,e){var i=n(t);for(var s in e)i.hasOwnProperty(s)&&(i[s]=e[s]);return i}},function(t,e,i){var n=i(222);t.exports=function(t,e){for(var i={},s=0;s<e.length;s++){var r=e[s];n(t,r)&&(i[r]=t[r])}return i}},function(t,e){t.exports=function(t,e,i){if(!t||"number"==typeof t)return!1;if(t.hasOwnProperty(e))return t[e]=i,!0;if(-1===e.indexOf("."))return!1;for(var n=e.split("."),s=t,r=t,a=0;a<n.length;a++){if(!s.hasOwnProperty(n[a]))return!1;s=(r=s)[n[a]]}return r[n[n.length-1]]=i,!0}},function(t,e,i){t.exports={Format:i(754),Pad:i(57),Reverse:i(755),UppercaseFirst:i(78),UUID:i(199)}},function(t,e){t.exports=function(t,e){return t.replace(/%([0-9]+)/g,(function(t,i){return e[Number(i)-1]}))}},function(t,e){t.exports=function(t){return t.split("").reverse().join("")}}],t.c=i,t.d=function(e,i,n){t.o(e,i)||Object.defineProperty(e,i,{enumerable:!0,get:n})},t.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},t.t=function(e,i){if(1&i&&(e=t(e)),8&i)return e;if(4&i&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&i&&"string"!=typeof e)for(var s in e)t.d(n,s,function(t){return e[t]}.bind(null,s));return n},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t.p="",t(t.s=223);function t(n){if(i[n])return i[n].exports;var s=i[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,t),s.l=!0,s.exports}var e,i}()},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(6),a=i(1),o=i(0),h=i(3),u=function(t){function e(i,n){var s=t.call(this,i)||this;return e.currentInstance=s,s.device.os.iPhone&&setInterval((function(){document.hasFocus()?(a.AudioManager.sound&&a.AudioManager.sound.mute(o.GameVars.gameData.soundMuted),a.AudioManager.music&&a.AudioManager.music.mute(o.GameVars.gameData.musicMuted)):(a.AudioManager.sound&&a.AudioManager.sound.mute(!0),a.AudioManager.music&&a.AudioManager.music.mute(!0))}),100),s}return s(e,t),e.prototype.onBlur=function(){a.AudioManager.sound&&a.AudioManager.sound.mute(!0),a.AudioManager.music&&a.AudioManager.music.mute(!0),r.BattleScene.currentInstance&&h.BattleManager.onClickMenu()},e.prototype.onFocus=function(){a.AudioManager.sound&&a.AudioManager.sound.mute(o.GameVars.gameData.soundMuted),a.AudioManager.music&&a.AudioManager.music.mute(o.GameVars.gameData.musicMuted)},e}(Phaser.Game);e.Game=u},function(t,e,i){var n=i(25);n.prototype.formulaEval=function(){"use strict";for(var t,e,i,n=[],s=this.value,r=0;r<s.length;r++)1===s[r].type||3===s[r].type?n.push({value:3===s[r].type?s[r].show:s[r].value,type:1}):13===s[r].type?n.push({value:s[r].show,type:1}):0===s[r].type?n[n.length-1]={value:s[r].show+("-"!=s[r].show?"(":"")+n[n.length-1].value+("-"!=s[r].show?")":""),type:0}:7===s[r].type?n[n.length-1]={value:(1!=n[n.length-1].type?"(":"")+n[n.length-1].value+(1!=n[n.length-1].type?")":"")+s[r].show,type:7}:10===s[r].type?(t=n.pop(),e=n.pop(),"P"===s[r].show||"C"===s[r].show?n.push({value:"<sup>"+e.value+"</sup>"+s[r].show+"<sub>"+t.value+"</sub>",type:10}):n.push({value:(1!=e.type?"(":"")+e.value+(1!=e.type?")":"")+"<sup>"+t.value+"</sup>",type:1})):2===s[r].type||9===s[r].type?(t=n.pop(),e=n.pop(),n.push({value:(1!=e.type?"(":"")+e.value+(1!=e.type?")":"")+s[r].show+(1!=t.type?"(":"")+t.value+(1!=t.type?")":""),type:s[r].type})):12===s[r].type&&(t=n.pop(),e=n.pop(),i=n.pop(),n.push({value:s[r].show+"("+i.value+","+e.value+","+t.value+")",type:12}));return n[0].value},t.exports=n},function(t,e,i){var n=i(26);n.prototype.postfixEval=function(t){"use strict";(t=t||{}).PI=Math.PI,t.E=Math.E;for(var e,i,s,r=[],a=this.value,o=void 0!==t.n,h=0;h<a.length;h++)1===a[h].type?r.push({value:a[h].value,type:1}):3===a[h].type?r.push({value:t[a[h].value],type:1}):0===a[h].type||7===a[h].type?void 0===r[r.length-1].type?r[r.length-1].value.push(a[h]):r[r.length-1].value=a[h].value(r[r.length-1].value):8===a[h].type?(e=r.pop(),i=r.pop(),r.push({type:1,value:a[h].value(i.value,e.value)})):10===a[h].type?(e=r.pop(),void 0===(i=r.pop()).type?(i.value=i.concat(e),i.value.push(a[h]),r.push(i)):void 0===e.type?(e.unshift(i),e.push(a[h]),r.push(e)):r.push({type:1,value:a[h].value(i.value,e.value)})):2===a[h].type||9===a[h].type?(e=r.pop(),void 0===(i=r.pop()).type?(console.log(i),(i=i.concat(e)).push(a[h]),r.push(i)):void 0===e.type?(e.unshift(i),e.push(a[h]),r.push(e)):r.push({type:1,value:a[h].value(i.value,e.value)})):12===a[h].type?(void 0!==(e=r.pop()).type&&(e=[e]),i=r.pop(),s=r.pop(),r.push({type:1,value:a[h].value(s.value,i.value,new n(e))})):13===a[h].type&&(o?r.push({value:t[a[h].value],type:3}):r.push([a[h]]));if(r.length>1)throw new n.exception("Uncaught Syntax error");return r[0].value>1e15?"Infinity":parseFloat(r[0].value.toFixed(15))},n.eval=function(t,e,i){return void 0===e?this.lex(t).toPostfix().postfixEval():void 0===i?void 0!==e.length?this.lex(t,e).toPostfix().postfixEval():this.lex(t).toPostfix().postfixEval(e):this.lex(t,e).toPostfix().postfixEval(i)},t.exports=n},function(t,e,i){var n=i(27);n.prototype.toPostfix=function(){"use strict";for(var t,e,i,s,r,a=[],o=[{value:"(",type:4,pre:0}],h=this.value,u=1;u<h.length;u++)if(1===h[u].type||3===h[u].type||13===h[u].type)1===h[u].type&&(h[u].value=Number(h[u].value)),a.push(h[u]);else if(4===h[u].type)o.push(h[u]);else if(5===h[u].type)for(;4!==(e=o.pop()).type;)a.push(e);else if(11===h[u].type){for(;4!==(e=o.pop()).type;)a.push(e);o.push(e)}else{s=(t=h[u]).pre,i=(r=o[o.length-1]).pre;var c="Math.pow"==r.value&&"Math.pow"==t.value;if(s>i)o.push(t);else{for(;i>=s&&!c||c&&s<i;)e=o.pop(),r=o[o.length-1],a.push(e),i=r.pre,c="Math.pow"==t.value&&"Math.pow"==r.value;o.push(t)}}return new n(a)},t.exports=n},function(t,e,i){var n=i(28);function s(t,e){for(var i=0;i<t.length;i++)t[i]+=e;return t}var r=["sin","cos","tan","pi","(",")","P","C","asin","acos","atan","7","8","9","int","cosh","acosh","ln","^","root","4","5","6","/","!","tanh","atanh","Mod","1","2","3","*","sinh","asinh","e","log","0",".","+","-",",","Sigma","n","Pi","pow"],a=["sin","cos","tan","π","(",")","P","C","asin","acos","atan","7","8","9","Int","cosh","acosh"," ln","^","root","4","5","6","÷","!","tanh","atanh"," Mod ","1","2","3","×","sinh","asinh","e"," log","0",".","+","-",",","Σ","n","Π","pow"],o=[n.math.sin,n.math.cos,n.math.tan,"PI","(",")",n.math.P,n.math.C,n.math.asin,n.math.acos,n.math.atan,"7","8","9",Math.floor,n.math.cosh,n.math.acosh,Math.log,Math.pow,Math.sqrt,"4","5","6",n.math.div,n.math.fact,n.math.tanh,n.math.atanh,n.math.mod,"1","2","3",n.math.mul,n.math.sinh,n.math.asinh,"E",n.math.log,"0",".",n.math.add,n.math.sub,",",n.math.sigma,"n",n.math.Pi,Math.pow],h={0:11,1:0,2:3,3:0,4:0,5:0,6:0,7:11,8:11,9:1,10:10,11:0,12:11,13:0},u=[0,0,0,3,4,5,10,10,0,0,0,1,1,1,0,0,0,0,10,0,1,1,1,2,7,0,0,2,1,1,1,2,0,0,3,0,1,6,9,9,11,12,13,12,8],c={0:!0,1:!0,3:!0,4:!0,6:!0,8:!0,9:!0,12:!0,13:!0},l={0:!0,1:!0,2:!0,3:!0,4:!0,5:!0,6:!0,7:!0,8:!0,9:!0,10:!0,11:!0,12:!0,13:!0},d={0:!0,3:!0,4:!0,8:!0,12:!0,13:!0},p={},f={0:!0,1:!0,3:!0,4:!0,6:!0,8:!0,12:!0,13:!0},m={1:!0},g=[[],["1","2","3","7","8","9","4","5","6","+","-","*","/","(",")","^","!","P","C","e","0",".",",","n"],["pi","ln","Pi"],["sin","cos","tan","Del","int","Mod","log","pow"],["asin","acos","atan","cosh","root","tanh","sinh"],["acosh","atanh","asinh","Sigma"]];function v(t,e,i,n){for(var s=0;s<n;s++)if(t[i+s]!==e[s])return!1;return!0}n.addToken=function(t){for(var e=0;e<t.length;e++){var i=t[e].token.length,n=-1;if(i<g.length)for(var s=0;s<g[i].length;s++)if(t[e].token===g[i][s]){n=r.indexOf(g[i][s]);break}-1===n?(r.push(t[e].token),u.push(t[e].type),g.length<=t[e].token.length&&(g[t[e].token.length]=[]),g[t[e].token.length].push(t[e].token),o.push(t[e].value),a.push(t[e].show)):(r[n]=t[e].token,u[n]=t[e].type,o[n]=t[e].value,a[n]=t[e].show)}},n.lex=function(t,e){"use strict";var i,y,_,x,E={value:n.math.changeSign,type:0,pre:21,show:"-"},T={value:")",show:")",type:5,pre:0},w={value:"(",type:4,pre:0,show:"("},S=[w],b=[],A=t,C=c,O=0,M=p,R="";void 0!==e&&n.addToken(e);var P={};for(y=0;y<A.length;y++)if(" "!==A[y]){for(i="",_=A.length-y>g.length-2?g.length-1:A.length-y;_>0;_--)if(void 0!==g[_])for(x=0;x<g[_].length;x++)v(A,g[_][x],y,_)&&(i=g[_][x],x=g[_].length,_=0);if(y+=i.length-1,""===i)throw new n.Exception("Can't understand after "+A.slice(y));var I,L=r.indexOf(i),G=i,D=u[L],k=o[L],F=h[D],N=a[L],B=S[S.length-1];for(I=b.length;I--&&0===b[I];)if(-1!==[0,2,3,4,5,9,11,12,13].indexOf(D)){if(!0!==C[D])throw new n.Exception(i+" is not allowed after "+R);S.push(T),C=l,M=f,s(b,-1).pop()}if(!0!==C[D])throw new n.Exception(i+" is not allowed after "+R);if(!0===M[D]&&(D=2,k=n.math.mul,N="×",F=3,y-=i.length),P={value:k,type:D,pre:F,show:N},0===D)C=c,M=p,s(b,2).push(2),S.push(P),S.push(w);else if(1===D)1===B.type?(B.value+=k,s(b,1)):S.push(P),C=l,M=d;else if(2===D)C=c,M=p,s(b,2),S.push(P);else if(3===D)S.push(P),C=l,M=f;else if(4===D)s(b,1),O++,C=c,M=p,S.push(P);else if(5===D){if(!O)throw new n.Exception("Closing parenthesis are more than opening one, wait What!!!");O--,C=l,M=f,S.push(P)}else if(6===D){if(B.hasDec)throw new n.Exception("Two decimals are not allowed in one number");1!==B.type&&(B={value:0,type:1,pre:0},S.push(B),s(b,-1)),C=m,s(b,1),M=p,B.value+=k,B.hasDec=!0}else 7===D&&(C=l,M=f,s(b,1),S.push(P));8===D?(C=c,M=p,s(b,4).push(4),S.push(P),S.push(w)):9===D?(9===B.type?B.value===n.math.add?(B.value=k,B.show=N,s(b,1)):B.value===n.math.sub&&"-"===N&&(B.value=n.math.add,B.show="+",s(b,1)):5!==B.type&&7!==B.type&&1!==B.type&&3!==B.type&&13!==B.type?"-"===G&&(C=c,M=p,s(b,2).push(2),S.push(E),S.push(w)):(S.push(P),s(b,2)),C=c,M=p):10===D?(C=c,M=p,s(b,2),S.push(P)):11===D?(C=c,M=p,S.push(P)):12===D?(C=c,M=p,s(b,6).push(6),S.push(P),S.push(w)):13===D&&(C=l,M=f,S.push(P)),s(b,-1),R=i}for(I=b.length;I--&&0===b[I];)S.push(T),s(b,-1).pop();if(!0!==C[5])throw new n.Exception("complete the expression");for(;O--;)S.push(T);return S.push(T),new n(S)},t.exports=n},function(t,e){var i=function(t){this.value=t};i.math={isDegree:!0,acos:function(t){return i.math.isDegree?180/Math.PI*Math.acos(t):Math.acos(t)},add:function(t,e){return t+e},asin:function(t){return i.math.isDegree?180/Math.PI*Math.asin(t):Math.asin(t)},atan:function(t){return i.math.isDegree?180/Math.PI*Math.atan(t):Math.atan(t)},acosh:function(t){return Math.log(t+Math.sqrt(t*t-1))},asinh:function(t){return Math.log(t+Math.sqrt(t*t+1))},atanh:function(t){return Math.log((1+t)/(1-t))},C:function(t,e){var n=1,s=t-e,r=e;r<s&&(r=s,s=e);for(var a=r+1;a<=t;a++)n*=a;return n/i.math.fact(s)},changeSign:function(t){return-t},cos:function(t){return i.math.isDegree&&(t=i.math.toRadian(t)),Math.cos(t)},cosh:function(t){return(Math.pow(Math.E,t)+Math.pow(Math.E,-1*t))/2},div:function(t,e){return t/e},fact:function(t){if(t%1!=0)return"NaN";for(var e=1,i=2;i<=t;i++)e*=i;return e},inverse:function(t){return 1/t},log:function(t){return Math.log(t)/Math.log(10)},mod:function(t,e){return t%e},mul:function(t,e){return t*e},P:function(t,e){for(var i=1,n=Math.floor(t)-Math.floor(e)+1;n<=Math.floor(t);n++)i*=n;return i},Pi:function(t,e,i){for(var n=1,s=t;s<=e;s++)n*=Number(i.postfixEval({n:s}));return n},pow10x:function(t){for(var e=1;t--;)e*=10;return e},sigma:function(t,e,i){for(var n=0,s=t;s<=e;s++)n+=Number(i.postfixEval({n:s}));return n},sin:function(t){return i.math.isDegree&&(t=i.math.toRadian(t)),Math.sin(t)},sinh:function(t){return(Math.pow(Math.E,t)-Math.pow(Math.E,-1*t))/2},sub:function(t,e){return t-e},tan:function(t){return i.math.isDegree&&(t=i.math.toRadian(t)),Math.tan(t)},tanh:function(t){return i.sinha(t)/i.cosha(t)},toRadian:function(t){return t*Math.PI/180}},i.Exception=function(t){this.message=t},t.exports=i},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=i(0),o=i(9),h=i(1),u=function(t){function e(e,i,n){var s=t.call(this,e,0,0)||this;s.mine=i;var o=Math.random()*r.GameConstants.CELLS_SIZE/2-r.GameConstants.CELLS_SIZE/3,u=Math.random()*r.GameConstants.CELLS_SIZE/2-r.GameConstants.CELLS_SIZE/3;s.x=n.x,s.y=n.y-30;var c=s.y<s.mine.y*r.GameConstants.CELLS_SIZE+u?s.y-30:s.mine.y*r.GameConstants.CELLS_SIZE+u-30,l=n.x+(s.mine.x*r.GameConstants.CELLS_SIZE+o-n.x)/2;return s.mineImage=new Phaser.GameObjects.Sprite(s.scene,0,0,"texture_atlas_4"),s.scene.add.existing(s.mineImage),s.add(s.mineImage),s.mineImage.anims.play("mine"),s.scene.tweens.add({targets:s,y:c,scaleX:1.5,scaleY:1.5,ease:Phaser.Math.Easing.Cubic.Out,duration:1===a.GameVars.timeStepFactor?300:100,onComplete:function(){this.scene&&this.scene.tweens.add({targets:this,scaleX:1,scaleY:1,y:this.mine.y*r.GameConstants.CELLS_SIZE+u,ease:Phaser.Math.Easing.Cubic.In,duration:1===a.GameVars.timeStepFactor?600:200,onComplete:function(){this.scene&&(this.mineImage.anims.stop(),this.mineImage.setFrame("mine"),h.AudioManager.playSoundEffect("mine_lands"))},onCompleteScope:this})},onCompleteScope:s}),s.scene.tweens.add({targets:s,x:l,ease:Phaser.Math.Easing.Linear,duration:1===a.GameVars.timeStepFactor?300:100,onComplete:function(){s.scene&&s.scene.tweens.add({targets:s,x:s.mine.x*r.GameConstants.CELLS_SIZE+o,ease:Phaser.Math.Easing.Linear,duration:1===a.GameVars.timeStepFactor?600:200})}}),h.AudioManager.playSoundEffect("t2_mine_launcher"),s}return s(e,t),e.prototype.detonate=function(){var t=this;this.mineImage.visible=!1;var e=new Phaser.GameObjects.Sprite(this.scene,0,0,"texture_atlas_4","explossion_01");this.scene.add.existing(e),e.setScale(2),this.add(e),e.anims.play("explosion"),e.on("animationcomplete",(function(){o.BoardContainer.currentInstance.removeMine(t)}),this),h.AudioManager.playSoundEffect("t2_mine_explosion")},e}(Phaser.GameObjects.Container);e.MineActor=u},function(t){t.exports=JSON.parse('[{"name":"Map 1","size":{"r":14,"c":12},"path":[{"r":-1,"c":3},{"r":0,"c":3},{"r":1,"c":3},{"r":1,"c":4},{"r":1,"c":5},{"r":1,"c":6},{"r":1,"c":7},{"r":1,"c":8},{"r":1,"c":9},{"r":2,"c":9},{"r":3,"c":9},{"r":4,"c":9},{"r":5,"c":9},{"r":6,"c":9},{"r":6,"c":8},{"r":6,"c":7},{"r":6,"c":6},{"r":6,"c":5},{"r":6,"c":4},{"r":6,"c":3},{"r":6,"c":2},{"r":5,"c":2},{"r":4,"c":2},{"r":4,"c":3},{"r":4,"c":4},{"r":5,"c":4},{"r":6,"c":4},{"r":7,"c":4},{"r":8,"c":4},{"r":9,"c":4},{"r":10,"c":4},{"r":10,"c":5},{"r":10,"c":6},{"r":10,"c":7},{"r":10,"c":8},{"r":11,"c":8},{"r":12,"c":8},{"r":12,"c":7},{"r":12,"c":6},{"r":12,"c":5},{"r":12,"c":4},{"r":12,"c":3},{"r":12,"c":2},{"r":13,"c":2},{"r":14,"c":2}],"plateaus":[]},{"name":"Map 2","size":{"r":14,"c":12},"path":[{"r":1,"c":-1},{"r":1,"c":0},{"r":1,"c":1},{"r":1,"c":2},{"r":1,"c":3},{"r":1,"c":4},{"r":2,"c":4},{"r":3,"c":4},{"r":3,"c":3},{"r":3,"c":2},{"r":3,"c":1},{"r":4,"c":1},{"r":5,"c":1},{"r":5,"c":2},{"r":5,"c":3},{"r":5,"c":4},{"r":5,"c":5},{"r":5,"c":6},{"r":5,"c":7},{"r":6,"c":7},{"r":7,"c":7},{"r":7,"c":6},{"r":7,"c":5},{"r":7,"c":4},{"r":7,"c":3},{"r":7,"c":2},{"r":8,"c":2},{"r":9,"c":2},{"r":9,"c":3},{"r":9,"c":4},{"r":9,"c":5},{"r":9,"c":6},{"r":9,"c":7},{"r":9,"c":8},{"r":10,"c":8},{"r":11,"c":8},{"r":11,"c":7},{"r":11,"c":6},{"r":11,"c":5},{"r":12,"c":5},{"r":13,"c":5},{"r":14,"c":5}],"plateaus":[]},{"name":"Map 3","size":{"r":14,"c":12},"path":[{"r":7,"c":-1},{"r":7,"c":0},{"r":7,"c":1},{"r":7,"c":2},{"r":7,"c":3},{"r":7,"c":4},{"r":7,"c":5},{"r":6,"c":5},{"r":5,"c":5},{"r":4,"c":5},{"r":4,"c":4},{"r":4,"c":3},{"r":4,"c":2},{"r":3,"c":2},{"r":2,"c":2},{"r":1,"c":2},{"r":1,"c":3},{"r":1,"c":4},{"r":1,"c":5},{"r":1,"c":6},{"r":1,"c":7},{"r":1,"c":8},{"r":1,"c":9},{"r":2,"c":9},{"r":3,"c":9},{"r":4,"c":9},{"r":4,"c":8},{"r":4,"c":7},{"r":4,"c":6},{"r":5,"c":6},{"r":6,"c":6},{"r":7,"c":6},{"r":7,"c":7},{"r":7,"c":8},{"r":8,"c":8},{"r":9,"c":8},{"r":10,"c":8},{"r":10,"c":7},{"r":10,"c":6},{"r":11,"c":6},{"r":12,"c":6},{"r":13,"c":6},{"r":14,"c":6}],"plateaus":[]},{"name":"Map 4","size":{"r":14,"c":12},"path":[{"r":-1,"c":4},{"r":0,"c":4},{"r":1,"c":4},{"r":2,"c":4},{"r":3,"c":4},{"r":4,"c":4},{"r":5,"c":4},{"r":6,"c":4},{"r":7,"c":4},{"r":8,"c":4},{"r":9,"c":4},{"r":10,"c":4},{"r":11,"c":4},{"r":11,"c":5},{"r":11,"c":6},{"r":12,"c":6},{"r":13,"c":6},{"r":14,"c":6}],"plateaus":[]},{"name":"Map 5","size":{"r":14,"c":12},"path":[{"r":-1,"c":10},{"r":0,"c":10},{"r":1,"c":10},{"r":2,"c":10},{"r":3,"c":10},{"r":3,"c":9},{"r":3,"c":8},{"r":3,"c":7},{"r":3,"c":6},{"r":3,"c":5},{"r":3,"c":4},{"r":3,"c":3},{"r":3,"c":2},{"r":4,"c":2},{"r":5,"c":2},{"r":6,"c":2},{"r":7,"c":2},{"r":8,"c":2},{"r":9,"c":2},{"r":9,"c":3},{"r":10,"c":3},{"r":10,"c":4},{"r":10,"c":5},{"r":10,"c":6},{"r":10,"c":7},{"r":9,"c":7},{"r":9,"c":8},{"r":8,"c":8},{"r":7,"c":8},{"r":6,"c":8},{"r":5,"c":8},{"r":5,"c":7},{"r":5,"c":6},{"r":5,"c":5},{"r":6,"c":5},{"r":6,"c":4},{"r":7,"c":4},{"r":7,"c":5},{"r":7,"c":6},{"r":6,"c":6},{"r":6,"c":7},{"r":7,"c":7},{"r":8,"c":7},{"r":8,"c":6},{"r":9,"c":6},{"r":9,"c":5},{"r":9,"c":4},{"r":8,"c":4},{"r":8,"c":3},{"r":7,"c":3},{"r":6,"c":3},{"r":5,"c":3},{"r":5,"c":4},{"r":4,"c":4},{"r":4,"c":5},{"r":4,"c":6},{"r":4,"c":7},{"r":4,"c":8},{"r":4,"c":9},{"r":4,"c":10},{"r":5,"c":10},{"r":6,"c":10},{"r":7,"c":10},{"r":8,"c":10},{"r":9,"c":10},{"r":10,"c":10},{"r":11,"c":10},{"r":12,"c":10},{"r":12,"c":9},{"r":12,"c":8},{"r":12,"c":7},{"r":12,"c":6},{"r":12,"c":5},{"r":13,"c":5},{"r":14,"c":5}],"plateaus":[]},{"name":"Map 6","size":{"r":14,"c":12},"path":[{"r":-1,"c":7},{"r":0,"c":7},{"r":1,"c":7},{"r":2,"c":7},{"r":2,"c":6},{"r":2,"c":5},{"r":1,"c":5},{"r":1,"c":4},{"r":1,"c":3},{"r":1,"c":2},{"r":1,"c":1},{"r":2,"c":1},{"r":3,"c":1},{"r":4,"c":1},{"r":5,"c":1},{"r":6,"c":1},{"r":7,"c":1},{"r":7,"c":2},{"r":7,"c":3},{"r":6,"c":3},{"r":5,"c":3},{"r":4,"c":3},{"r":4,"c":4},{"r":4,"c":5},{"r":5,"c":5},{"r":6,"c":5},{"r":7,"c":5},{"r":8,"c":5},{"r":9,"c":5},{"r":9,"c":4},{"r":9,"c":3},{"r":9,"c":2},{"r":10,"c":2},{"r":11,"c":2},{"r":11,"c":3},{"r":11,"c":4},{"r":11,"c":5},{"r":11,"c":6},{"r":11,"c":7},{"r":10,"c":7},{"r":9,"c":7},{"r":9,"c":8},{"r":9,"c":9},{"r":8,"c":9},{"r":7,"c":9},{"r":7,"c":8},{"r":7,"c":7},{"r":6,"c":7},{"r":5,"c":7},{"r":4,"c":7},{"r":4,"c":8},{"r":4,"c":9},{"r":3,"c":9},{"r":2,"c":9},{"r":1,"c":9},{"r":1,"c":10},{"r":1,"c":11},{"r":2,"c":11},{"r":3,"c":11},{"r":4,"c":11},{"r":5,"c":11},{"r":6,"c":11},{"r":7,"c":11},{"r":8,"c":11},{"r":9,"c":11},{"r":10,"c":11},{"r":11,"c":11},{"r":12,"c":11},{"r":13,"c":11},{"r":14,"c":11}],"plateaus":[]},{"name":"Map 7","size":{"r":14,"c":12},"path":[{"r":0,"c":-1},{"r":0,"c":0},{"r":0,"c":1},{"r":1,"c":1},{"r":2,"c":1},{"r":3,"c":1},{"r":4,"c":1},{"r":5,"c":1},{"r":6,"c":1},{"r":7,"c":1},{"r":8,"c":1},{"r":9,"c":1},{"r":10,"c":1},{"r":10,"c":2},{"r":10,"c":3},{"r":9,"c":3},{"r":8,"c":3},{"r":7,"c":3},{"r":6,"c":3},{"r":5,"c":3},{"r":4,"c":3},{"r":3,"c":3},{"r":2,"c":3},{"r":1,"c":3},{"r":1,"c":4},{"r":1,"c":5},{"r":2,"c":5},{"r":3,"c":5},{"r":4,"c":5},{"r":5,"c":5},{"r":6,"c":5},{"r":7,"c":5},{"r":8,"c":5},{"r":9,"c":5},{"r":10,"c":5},{"r":10,"c":6},{"r":10,"c":7},{"r":9,"c":7},{"r":8,"c":7},{"r":7,"c":7},{"r":6,"c":7},{"r":5,"c":7},{"r":4,"c":7},{"r":3,"c":7},{"r":2,"c":7},{"r":1,"c":7},{"r":1,"c":8},{"r":1,"c":9},{"r":2,"c":9},{"r":3,"c":9},{"r":4,"c":9},{"r":5,"c":9},{"r":6,"c":9},{"r":7,"c":9},{"r":8,"c":9},{"r":9,"c":9},{"r":10,"c":9},{"r":10,"c":10},{"r":11,"c":10},{"r":12,"c":10},{"r":13,"c":10},{"r":14,"c":10}],"plateaus":[]},{"name":"Map 8","size":{"r":14,"c":12},"path":[{"r":-1,"c":4},{"r":0,"c":4},{"r":1,"c":4},{"r":2,"c":4},{"r":3,"c":4},{"r":4,"c":4},{"r":5,"c":4},{"r":6,"c":4},{"r":7,"c":4},{"r":8,"c":4},{"r":8,"c":5},{"r":8,"c":6},{"r":9,"c":6},{"r":10,"c":6},{"r":10,"c":5},{"r":11,"c":5},{"r":12,"c":5},{"r":11,"c":5},{"r":10,"c":5},{"r":10,"c":6},{"r":9,"c":6},{"r":8,"c":6},{"r":7,"c":6},{"r":6,"c":6},{"r":5,"c":6},{"r":4,"c":6},{"r":4,"c":7},{"r":3,"c":7},{"r":2,"c":7},{"r":1,"c":7},{"r":1,"c":8},{"r":1,"c":7},{"r":2,"c":7},{"r":3,"c":7},{"r":4,"c":7},{"r":4,"c":6},{"r":5,"c":6},{"r":6,"c":6},{"r":6,"c":7},{"r":6,"c":8},{"r":7,"c":8},{"r":8,"c":8},{"r":9,"c":8},{"r":10,"c":8},{"r":11,"c":8},{"r":12,"c":8},{"r":13,"c":8},{"r":14,"c":8}],"plateaus":[]},{"name":"Map 9","size":{"r":14,"c":12},"path":[{"r":1,"c":-1},{"r":1,"c":0},{"r":1,"c":1},{"r":1,"c":2},{"r":1,"c":3},{"r":1,"c":4},{"r":1,"c":5},{"r":1,"c":6},{"r":1,"c":7},{"r":1,"c":8},{"r":1,"c":9},{"r":1,"c":10},{"r":2,"c":10},{"r":3,"c":10},{"r":4,"c":10},{"r":5,"c":10},{"r":6,"c":10},{"r":7,"c":10},{"r":8,"c":10},{"r":9,"c":10},{"r":10,"c":10},{"r":11,"c":10},{"r":11,"c":9},{"r":11,"c":8},{"r":11,"c":7},{"r":11,"c":6},{"r":11,"c":5},{"r":11,"c":4},{"r":11,"c":3},{"r":11,"c":2},{"r":11,"c":1},{"r":10,"c":1},{"r":9,"c":1},{"r":8,"c":1},{"r":7,"c":1},{"r":6,"c":1},{"r":5,"c":1},{"r":4,"c":1},{"r":3,"c":1},{"r":3,"c":2},{"r":3,"c":3},{"r":3,"c":4},{"r":3,"c":5},{"r":3,"c":6},{"r":3,"c":7},{"r":3,"c":8},{"r":4,"c":8},{"r":5,"c":8},{"r":6,"c":8},{"r":7,"c":8},{"r":8,"c":8},{"r":9,"c":8},{"r":9,"c":7},{"r":9,"c":6},{"r":9,"c":5},{"r":9,"c":4},{"r":9,"c":3},{"r":8,"c":3},{"r":7,"c":3},{"r":6,"c":3},{"r":5,"c":3},{"r":5,"c":4},{"r":5,"c":5},{"r":5,"c":6},{"r":6,"c":6},{"r":7,"c":6},{"r":8,"c":6},{"r":9,"c":6},{"r":10,"c":6},{"r":11,"c":6},{"r":12,"c":6},{"r":13,"c":6},{"r":14,"c":6}],"plateaus":[]},{"name":"Map 10","size":{"r":14,"c":12},"path":[{"r":1,"c":-1},{"r":1,"c":0},{"r":1,"c":1},{"r":1,"c":2},{"r":1,"c":3},{"r":1,"c":4},{"r":1,"c":5},{"r":1,"c":6},{"r":1,"c":7},{"r":1,"c":8},{"r":1,"c":9},{"r":1,"c":10},{"r":2,"c":10},{"r":3,"c":10},{"r":3,"c":9},{"r":3,"c":8},{"r":4,"c":8},{"r":5,"c":8},{"r":5,"c":7},{"r":5,"c":6},{"r":6,"c":6},{"r":7,"c":6},{"r":7,"c":5},{"r":7,"c":4},{"r":8,"c":4},{"r":9,"c":4},{"r":9,"c":3},{"r":9,"c":2},{"r":10,"c":2},{"r":11,"c":2},{"r":11,"c":3},{"r":11,"c":4},{"r":11,"c":5},{"r":11,"c":6},{"r":11,"c":7},{"r":11,"c":8},{"r":11,"c":9},{"r":11,"c":10},{"r":12,"c":10},{"r":13,"c":10},{"r":14,"c":10}],"plateaus":[]},{"name":"Map 11","size":{"r":14,"c":12},"path":[{"r":-1,"c":1},{"r":0,"c":1},{"r":1,"c":1},{"r":2,"c":1},{"r":3,"c":1},{"r":3,"c":2},{"r":3,"c":3},{"r":3,"c":4},{"r":3,"c":5},{"r":3,"c":6},{"r":3,"c":7},{"r":3,"c":8},{"r":3,"c":9},{"r":3,"c":10},{"r":4,"c":10},{"r":5,"c":10},{"r":6,"c":10},{"r":7,"c":10},{"r":7,"c":9},{"r":7,"c":8},{"r":7,"c":7},{"r":7,"c":6},{"r":7,"c":5},{"r":7,"c":4},{"r":7,"c":3},{"r":7,"c":2},{"r":7,"c":1},{"r":8,"c":1},{"r":9,"c":1},{"r":10,"c":1},{"r":11,"c":1},{"r":11,"c":2},{"r":11,"c":3},{"r":11,"c":4},{"r":11,"c":5},{"r":11,"c":6},{"r":11,"c":7},{"r":11,"c":8},{"r":11,"c":9},{"r":11,"c":10},{"r":12,"c":10},{"r":13,"c":10},{"r":14,"c":10}],"plateaus":[]},{"name":"Map 12","size":{"r":14,"c":12},"path":[{"r":-1,"c":3},{"r":0,"c":3},{"r":1,"c":3},{"r":2,"c":3},{"r":3,"c":3},{"r":4,"c":3},{"r":5,"c":3},{"r":6,"c":3},{"r":7,"c":3},{"r":8,"c":3},{"r":8,"c":4},{"r":8,"c":5},{"r":8,"c":6},{"r":8,"c":7},{"r":8,"c":8},{"r":8,"c":9},{"r":8,"c":10},{"r":7,"c":10},{"r":6,"c":10},{"r":5,"c":10},{"r":4,"c":10},{"r":3,"c":10},{"r":3,"c":9},{"r":3,"c":8},{"r":3,"c":7},{"r":3,"c":6},{"r":3,"c":5},{"r":3,"c":4},{"r":3,"c":3},{"r":3,"c":2},{"r":3,"c":1},{"r":4,"c":1},{"r":5,"c":1},{"r":6,"c":1},{"r":7,"c":1},{"r":8,"c":1},{"r":9,"c":1},{"r":10,"c":1},{"r":11,"c":1},{"r":12,"c":1},{"r":13,"c":1},{"r":14,"c":1}],"plateaus":[]},{"name":"Map 13","size":{"r":14,"c":12},"path":[{"r":-1,"c":1},{"r":0,"c":1},{"r":1,"c":1},{"r":2,"c":1},{"r":2,"c":2},{"r":2,"c":3},{"r":3,"c":3},{"r":4,"c":3},{"r":4,"c":4},{"r":4,"c":5},{"r":5,"c":5},{"r":6,"c":5},{"r":6,"c":6},{"r":6,"c":7},{"r":5,"c":7},{"r":4,"c":7},{"r":4,"c":8},{"r":4,"c":9},{"r":4,"c":10},{"r":5,"c":10},{"r":6,"c":10},{"r":7,"c":10},{"r":8,"c":10},{"r":8,"c":9},{"r":8,"c":8},{"r":8,"c":7},{"r":8,"c":6},{"r":8,"c":5},{"r":8,"c":4},{"r":8,"c":3},{"r":8,"c":2},{"r":8,"c":1},{"r":9,"c":1},{"r":10,"c":1},{"r":11,"c":1},{"r":11,"c":2},{"r":11,"c":3},{"r":11,"c":4},{"r":11,"c":5},{"r":11,"c":6},{"r":12,"c":6},{"r":13,"c":6},{"r":14,"c":6}],"plateaus":[]},{"name":"Map 14","size":{"r":14,"c":12},"path":[{"r":1,"c":12},{"r":1,"c":11},{"r":1,"c":10},{"r":1,"c":9},{"r":1,"c":8},{"r":1,"c":7},{"r":1,"c":6},{"r":1,"c":5},{"r":1,"c":4},{"r":1,"c":3},{"r":1,"c":2},{"r":1,"c":1},{"r":2,"c":1},{"r":3,"c":1},{"r":4,"c":1},{"r":5,"c":1},{"r":6,"c":1},{"r":6,"c":2},{"r":6,"c":3},{"r":6,"c":4},{"r":6,"c":5},{"r":6,"c":6},{"r":6,"c":7},{"r":5,"c":7},{"r":4,"c":7},{"r":3,"c":7},{"r":2,"c":7},{"r":1,"c":7},{"r":1,"c":6},{"r":1,"c":5},{"r":1,"c":4},{"r":1,"c":3},{"r":1,"c":2},{"r":1,"c":1},{"r":2,"c":1},{"r":3,"c":1},{"r":4,"c":1},{"r":5,"c":1},{"r":6,"c":1},{"r":7,"c":1},{"r":8,"c":1},{"r":9,"c":1},{"r":10,"c":1},{"r":11,"c":1},{"r":12,"c":1},{"r":13,"c":1},{"r":14,"c":1}],"plateaus":[]},{"name":"Map 15","size":{"r":14,"c":12},"path":[{"r":-1,"c":5},{"r":0,"c":5},{"r":1,"c":5},{"r":2,"c":5},{"r":2,"c":4},{"r":2,"c":3},{"r":3,"c":3},{"r":4,"c":3},{"r":5,"c":3},{"r":6,"c":3},{"r":7,"c":3},{"r":8,"c":3},{"r":9,"c":3},{"r":10,"c":3},{"r":10,"c":4},{"r":10,"c":5},{"r":10,"c":6},{"r":10,"c":7},{"r":9,"c":7},{"r":8,"c":7},{"r":7,"c":7},{"r":6,"c":7},{"r":5,"c":7},{"r":4,"c":7},{"r":3,"c":7},{"r":2,"c":7},{"r":2,"c":6},{"r":2,"c":5},{"r":2,"c":4},{"r":2,"c":3},{"r":3,"c":3},{"r":4,"c":3},{"r":5,"c":3},{"r":6,"c":3},{"r":7,"c":3},{"r":8,"c":3},{"r":9,"c":3},{"r":10,"c":3},{"r":10,"c":4},{"r":10,"c":5},{"r":11,"c":5},{"r":12,"c":5},{"r":13,"c":5},{"r":14,"c":5}],"plateaus":[]},{"name":"Map 16","size":{"r":14,"c":12},"path":[{"r":-1,"c":3},{"r":0,"c":3},{"r":1,"c":3},{"r":1,"c":4},{"r":1,"c":5},{"r":1,"c":6},{"r":1,"c":7},{"r":1,"c":8},{"r":1,"c":9},{"r":2,"c":9},{"r":3,"c":9},{"r":4,"c":9},{"r":5,"c":9},{"r":6,"c":9},{"r":6,"c":8},{"r":6,"c":7},{"r":6,"c":6},{"r":6,"c":5},{"r":6,"c":4},{"r":6,"c":3},{"r":6,"c":2},{"r":5,"c":2},{"r":4,"c":2},{"r":4,"c":3},{"r":4,"c":4},{"r":5,"c":4},{"r":6,"c":4},{"r":7,"c":4},{"r":8,"c":4},{"r":9,"c":4},{"r":10,"c":4},{"r":10,"c":5},{"r":10,"c":6},{"r":10,"c":7},{"r":10,"c":8},{"r":11,"c":8},{"r":12,"c":8},{"r":12,"c":7},{"r":12,"c":6},{"r":12,"c":5},{"r":12,"c":4},{"r":12,"c":3},{"r":12,"c":2},{"r":13,"c":2},{"r":14,"c":2}],"plateaus":[{"r":3,"c":6},{"r":3,"c":7},{"r":4,"c":6},{"r":4,"c":7},{"r":8,"c":6},{"r":8,"c":7},{"r":8,"c":8},{"r":8,"c":9},{"r":8,"c":10},{"r":8,"c":11}]},{"name":"Map 17","size":{"r":14,"c":12},"path":[{"r":1,"c":-1},{"r":1,"c":0},{"r":1,"c":1},{"r":1,"c":2},{"r":1,"c":3},{"r":1,"c":4},{"r":2,"c":4},{"r":3,"c":4},{"r":3,"c":3},{"r":3,"c":2},{"r":3,"c":1},{"r":4,"c":1},{"r":5,"c":1},{"r":5,"c":2},{"r":5,"c":3},{"r":5,"c":4},{"r":5,"c":5},{"r":5,"c":6},{"r":5,"c":7},{"r":6,"c":7},{"r":7,"c":7},{"r":7,"c":6},{"r":7,"c":5},{"r":7,"c":4},{"r":7,"c":3},{"r":7,"c":2},{"r":8,"c":2},{"r":9,"c":2},{"r":9,"c":3},{"r":9,"c":4},{"r":9,"c":5},{"r":9,"c":6},{"r":9,"c":7},{"r":9,"c":8},{"r":10,"c":8},{"r":11,"c":8},{"r":11,"c":7},{"r":11,"c":6},{"r":11,"c":5},{"r":12,"c":5},{"r":13,"c":5},{"r":14,"c":5}],"plateaus":[{"r":1,"c":6},{"r":1,"c":7},{"r":1,"c":8},{"r":1,"c":9},{"r":1,"c":10},{"r":1,"c":11},{"r":2,"c":6},{"r":2,"c":7},{"r":2,"c":8},{"r":2,"c":9},{"r":2,"c":10},{"r":2,"c":11},{"r":3,"c":6},{"r":3,"c":7},{"r":3,"c":8},{"r":3,"c":9},{"r":3,"c":10},{"r":3,"c":11}]},{"name":"Map 18","size":{"r":14,"c":12},"path":[{"r":7,"c":-1},{"r":7,"c":0},{"r":7,"c":1},{"r":7,"c":2},{"r":7,"c":3},{"r":7,"c":4},{"r":7,"c":5},{"r":6,"c":5},{"r":5,"c":5},{"r":4,"c":5},{"r":4,"c":4},{"r":4,"c":3},{"r":4,"c":2},{"r":3,"c":2},{"r":2,"c":2},{"r":1,"c":2},{"r":1,"c":3},{"r":1,"c":4},{"r":1,"c":5},{"r":1,"c":6},{"r":1,"c":7},{"r":1,"c":8},{"r":1,"c":9},{"r":2,"c":9},{"r":3,"c":9},{"r":4,"c":9},{"r":4,"c":8},{"r":4,"c":7},{"r":4,"c":6},{"r":5,"c":6},{"r":6,"c":6},{"r":7,"c":6},{"r":7,"c":7},{"r":7,"c":8},{"r":8,"c":8},{"r":9,"c":8},{"r":10,"c":8},{"r":10,"c":7},{"r":10,"c":6},{"r":11,"c":6},{"r":12,"c":6},{"r":13,"c":6},{"r":14,"c":6}],"plateaus":[{"r":9,"c":0},{"r":10,"c":0},{"r":11,"c":0},{"r":12,"c":0},{"r":13,"c":0},{"r":9,"c":1},{"r":10,"c":1},{"r":11,"c":1},{"r":12,"c":1},{"r":13,"c":1},{"r":9,"c":2},{"r":10,"c":2},{"r":11,"c":2},{"r":12,"c":2},{"r":13,"c":2},{"r":9,"c":3},{"r":10,"c":3},{"r":11,"c":3},{"r":12,"c":3},{"r":13,"c":3},{"r":9,"c":4},{"r":10,"c":4},{"r":11,"c":4},{"r":12,"c":4},{"r":13,"c":4}]},{"name":"Map 19","size":{"r":14,"c":12},"path":[{"r":-1,"c":4},{"r":0,"c":4},{"r":1,"c":4},{"r":2,"c":4},{"r":3,"c":4},{"r":4,"c":4},{"r":5,"c":4},{"r":6,"c":4},{"r":7,"c":4},{"r":8,"c":4},{"r":9,"c":4},{"r":10,"c":4},{"r":11,"c":4},{"r":11,"c":5},{"r":11,"c":6},{"r":12,"c":6},{"r":13,"c":6},{"r":14,"c":6}],"plateaus":[{"r":1,"c":6},{"r":1,"c":7},{"r":1,"c":8},{"r":1,"c":9},{"r":1,"c":10},{"r":1,"c":11},{"r":2,"c":6},{"r":2,"c":7},{"r":2,"c":8},{"r":2,"c":9},{"r":2,"c":10},{"r":2,"c":11},{"r":3,"c":6},{"r":3,"c":7},{"r":3,"c":8},{"r":3,"c":9},{"r":3,"c":10},{"r":3,"c":11},{"r":10,"c":0},{"r":11,"c":0},{"r":12,"c":0},{"r":13,"c":0},{"r":10,"c":1},{"r":11,"c":1},{"r":12,"c":1},{"r":13,"c":1},{"r":10,"c":2},{"r":11,"c":2},{"r":12,"c":2},{"r":13,"c":2},{"r":13,"c":3},{"r":13,"c":4}]},{"name":"Map 20","size":{"r":14,"c":12},"path":[{"r":-1,"c":10},{"r":0,"c":10},{"r":1,"c":10},{"r":2,"c":10},{"r":3,"c":10},{"r":3,"c":9},{"r":3,"c":8},{"r":3,"c":7},{"r":3,"c":6},{"r":3,"c":5},{"r":3,"c":4},{"r":3,"c":3},{"r":3,"c":2},{"r":4,"c":2},{"r":5,"c":2},{"r":6,"c":2},{"r":7,"c":2},{"r":8,"c":2},{"r":9,"c":2},{"r":9,"c":3},{"r":10,"c":3},{"r":10,"c":4},{"r":10,"c":5},{"r":10,"c":6},{"r":10,"c":7},{"r":9,"c":7},{"r":9,"c":8},{"r":8,"c":8},{"r":7,"c":8},{"r":6,"c":8},{"r":5,"c":8},{"r":5,"c":7},{"r":5,"c":6},{"r":5,"c":5},{"r":6,"c":5},{"r":6,"c":4},{"r":7,"c":4},{"r":7,"c":5},{"r":7,"c":6},{"r":6,"c":6},{"r":6,"c":7},{"r":7,"c":7},{"r":8,"c":7},{"r":8,"c":6},{"r":9,"c":6},{"r":9,"c":5},{"r":9,"c":4},{"r":8,"c":4},{"r":8,"c":3},{"r":7,"c":3},{"r":6,"c":3},{"r":5,"c":3},{"r":5,"c":4},{"r":4,"c":4},{"r":4,"c":5},{"r":4,"c":6},{"r":4,"c":7},{"r":4,"c":8},{"r":4,"c":9},{"r":4,"c":10},{"r":5,"c":10},{"r":6,"c":10},{"r":7,"c":10},{"r":8,"c":10},{"r":9,"c":10},{"r":10,"c":10},{"r":11,"c":10},{"r":12,"c":10},{"r":12,"c":9},{"r":12,"c":8},{"r":12,"c":7},{"r":12,"c":6},{"r":12,"c":5},{"r":13,"c":5},{"r":14,"c":5}],"plateaus":[{"r":0,"c":0},{"r":0,"c":1},{"r":0,"c":2},{"r":0,"c":3},{"r":0,"c":4},{"r":0,"c":5},{"r":0,"c":6},{"r":0,"c":7},{"r":0,"c":8},{"r":1,"c":0},{"r":1,"c":1},{"r":1,"c":2},{"r":1,"c":3},{"r":1,"c":4},{"r":1,"c":5},{"r":1,"c":6},{"r":1,"c":7},{"r":1,"c":8}]},{"name":"Map 21","size":{"r":14,"c":12},"path":[{"r":-1,"c":7},{"r":0,"c":7},{"r":1,"c":7},{"r":2,"c":7},{"r":2,"c":6},{"r":2,"c":5},{"r":1,"c":5},{"r":1,"c":4},{"r":1,"c":3},{"r":1,"c":2},{"r":1,"c":1},{"r":2,"c":1},{"r":3,"c":1},{"r":4,"c":1},{"r":5,"c":1},{"r":6,"c":1},{"r":7,"c":1},{"r":7,"c":2},{"r":7,"c":3},{"r":6,"c":3},{"r":5,"c":3},{"r":4,"c":3},{"r":4,"c":4},{"r":4,"c":5},{"r":5,"c":5},{"r":6,"c":5},{"r":7,"c":5},{"r":8,"c":5},{"r":9,"c":5},{"r":9,"c":4},{"r":9,"c":3},{"r":9,"c":2},{"r":10,"c":2},{"r":11,"c":2},{"r":11,"c":3},{"r":11,"c":4},{"r":11,"c":5},{"r":11,"c":6},{"r":11,"c":7},{"r":10,"c":7},{"r":9,"c":7},{"r":9,"c":8},{"r":9,"c":9},{"r":8,"c":9},{"r":7,"c":9},{"r":7,"c":8},{"r":7,"c":7},{"r":6,"c":7},{"r":5,"c":7},{"r":4,"c":7},{"r":4,"c":8},{"r":4,"c":9},{"r":3,"c":9},{"r":2,"c":9},{"r":1,"c":9},{"r":1,"c":10},{"r":1,"c":11},{"r":2,"c":11},{"r":3,"c":11},{"r":4,"c":11},{"r":5,"c":11},{"r":6,"c":11},{"r":7,"c":11},{"r":8,"c":11},{"r":9,"c":11},{"r":10,"c":11},{"r":11,"c":11},{"r":12,"c":11},{"r":13,"c":11},{"r":14,"c":11}],"plateaus":[{"r":9,"c":0},{"r":10,"c":0},{"r":11,"c":0},{"r":12,"c":0},{"r":13,"c":0},{"r":13,"c":1},{"r":13,"c":2},{"r":13,"c":3},{"r":13,"c":4},{"r":13,"c":5},{"r":13,"c":6},{"r":13,"c":7},{"r":13,"c":8},{"r":13,"c":9},{"r":12,"c":9},{"r":11,"c":9}]},{"name":"Map 22","size":{"r":14,"c":12},"path":[{"r":0,"c":-1},{"r":0,"c":0},{"r":0,"c":1},{"r":1,"c":1},{"r":2,"c":1},{"r":3,"c":1},{"r":4,"c":1},{"r":5,"c":1},{"r":6,"c":1},{"r":7,"c":1},{"r":8,"c":1},{"r":9,"c":1},{"r":10,"c":1},{"r":10,"c":2},{"r":10,"c":3},{"r":9,"c":3},{"r":8,"c":3},{"r":7,"c":3},{"r":6,"c":3},{"r":5,"c":3},{"r":4,"c":3},{"r":3,"c":3},{"r":2,"c":3},{"r":1,"c":3},{"r":1,"c":4},{"r":1,"c":5},{"r":2,"c":5},{"r":3,"c":5},{"r":4,"c":5},{"r":5,"c":5},{"r":6,"c":5},{"r":7,"c":5},{"r":8,"c":5},{"r":9,"c":5},{"r":10,"c":5},{"r":10,"c":6},{"r":10,"c":7},{"r":9,"c":7},{"r":8,"c":7},{"r":7,"c":7},{"r":6,"c":7},{"r":5,"c":7},{"r":4,"c":7},{"r":3,"c":7},{"r":2,"c":7},{"r":1,"c":7},{"r":1,"c":8},{"r":1,"c":9},{"r":2,"c":9},{"r":3,"c":9},{"r":4,"c":9},{"r":5,"c":9},{"r":6,"c":9},{"r":7,"c":9},{"r":8,"c":9},{"r":9,"c":9},{"r":10,"c":9},{"r":10,"c":10},{"r":11,"c":10},{"r":12,"c":10},{"r":13,"c":10},{"r":14,"c":10}],"plateaus":[{"r":12,"c":0},{"r":12,"c":1},{"r":12,"c":2},{"r":12,"c":3},{"r":12,"c":4},{"r":12,"c":5},{"r":12,"c":6},{"r":12,"c":7},{"r":12,"c":8},{"r":13,"c":0},{"r":13,"c":1},{"r":13,"c":2},{"r":13,"c":3},{"r":13,"c":4},{"r":13,"c":5},{"r":13,"c":6},{"r":13,"c":7},{"r":13,"c":8},{"r":0,"c":11},{"r":1,"c":11},{"r":2,"c":11},{"r":3,"c":11},{"r":4,"c":11},{"r":5,"c":11},{"r":6,"c":11},{"r":7,"c":11},{"r":8,"c":11}]},{"name":"Map 23","size":{"r":14,"c":12},"path":[{"r":-1,"c":4},{"r":0,"c":4},{"r":1,"c":4},{"r":2,"c":4},{"r":3,"c":4},{"r":4,"c":4},{"r":5,"c":4},{"r":6,"c":4},{"r":7,"c":4},{"r":8,"c":4},{"r":8,"c":5},{"r":8,"c":6},{"r":9,"c":6},{"r":10,"c":6},{"r":10,"c":5},{"r":11,"c":5},{"r":12,"c":5},{"r":11,"c":5},{"r":10,"c":5},{"r":10,"c":6},{"r":9,"c":6},{"r":8,"c":6},{"r":7,"c":6},{"r":6,"c":6},{"r":5,"c":6},{"r":4,"c":6},{"r":4,"c":7},{"r":3,"c":7},{"r":2,"c":7},{"r":1,"c":7},{"r":1,"c":8},{"r":1,"c":7},{"r":2,"c":7},{"r":3,"c":7},{"r":4,"c":7},{"r":4,"c":6},{"r":5,"c":6},{"r":6,"c":6},{"r":6,"c":7},{"r":6,"c":8},{"r":7,"c":8},{"r":8,"c":8},{"r":9,"c":8},{"r":10,"c":8},{"r":11,"c":8},{"r":12,"c":8},{"r":13,"c":8},{"r":14,"c":8}],"plateaus":[{"r":3,"c":9},{"r":3,"c":10},{"r":3,"c":11},{"r":4,"c":9},{"r":4,"c":10},{"r":4,"c":11},{"r":10,"c":0},{"r":11,"c":0},{"r":12,"c":0},{"r":13,"c":0},{"r":10,"c":1},{"r":11,"c":1},{"r":12,"c":1},{"r":13,"c":1},{"r":10,"c":2},{"r":11,"c":2},{"r":12,"c":2},{"r":13,"c":2},{"r":10,"c":3},{"r":11,"c":3},{"r":12,"c":3},{"r":13,"c":3}]},{"name":"Map 24","size":{"r":14,"c":12},"path":[{"r":1,"c":-1},{"r":1,"c":0},{"r":1,"c":1},{"r":1,"c":2},{"r":1,"c":3},{"r":1,"c":4},{"r":1,"c":5},{"r":1,"c":6},{"r":1,"c":7},{"r":1,"c":8},{"r":1,"c":9},{"r":1,"c":10},{"r":2,"c":10},{"r":3,"c":10},{"r":4,"c":10},{"r":5,"c":10},{"r":6,"c":10},{"r":7,"c":10},{"r":8,"c":10},{"r":9,"c":10},{"r":10,"c":10},{"r":11,"c":10},{"r":11,"c":9},{"r":11,"c":8},{"r":11,"c":7},{"r":11,"c":6},{"r":11,"c":5},{"r":11,"c":4},{"r":11,"c":3},{"r":11,"c":2},{"r":11,"c":1},{"r":10,"c":1},{"r":9,"c":1},{"r":8,"c":1},{"r":7,"c":1},{"r":6,"c":1},{"r":5,"c":1},{"r":4,"c":1},{"r":3,"c":1},{"r":3,"c":2},{"r":3,"c":3},{"r":3,"c":4},{"r":3,"c":5},{"r":3,"c":6},{"r":3,"c":7},{"r":3,"c":8},{"r":4,"c":8},{"r":5,"c":8},{"r":6,"c":8},{"r":7,"c":8},{"r":8,"c":8},{"r":9,"c":8},{"r":9,"c":7},{"r":9,"c":6},{"r":9,"c":5},{"r":9,"c":4},{"r":9,"c":3},{"r":8,"c":3},{"r":7,"c":3},{"r":6,"c":3},{"r":5,"c":3},{"r":5,"c":4},{"r":5,"c":5},{"r":5,"c":6},{"r":6,"c":6},{"r":7,"c":6},{"r":8,"c":6},{"r":9,"c":6},{"r":10,"c":6},{"r":11,"c":6},{"r":12,"c":6},{"r":13,"c":6},{"r":14,"c":6}],"plateaus":[{"r":13,"c":0},{"r":13,"c":1},{"r":13,"c":2},{"r":13,"c":3},{"r":13,"c":4},{"r":13,"c":8},{"r":13,"c":9},{"r":13,"c":10},{"r":13,"c":11}]},{"name":"Map 25","size":{"r":14,"c":12},"path":[{"r":1,"c":-1},{"r":1,"c":0},{"r":1,"c":1},{"r":1,"c":2},{"r":1,"c":3},{"r":1,"c":4},{"r":1,"c":5},{"r":1,"c":6},{"r":1,"c":7},{"r":1,"c":8},{"r":1,"c":9},{"r":1,"c":10},{"r":2,"c":10},{"r":3,"c":10},{"r":3,"c":9},{"r":3,"c":8},{"r":4,"c":8},{"r":5,"c":8},{"r":5,"c":7},{"r":5,"c":6},{"r":6,"c":6},{"r":7,"c":6},{"r":7,"c":5},{"r":7,"c":4},{"r":8,"c":4},{"r":9,"c":4},{"r":9,"c":3},{"r":9,"c":2},{"r":10,"c":2},{"r":11,"c":2},{"r":11,"c":3},{"r":11,"c":4},{"r":11,"c":5},{"r":11,"c":6},{"r":11,"c":7},{"r":11,"c":8},{"r":11,"c":9},{"r":11,"c":10},{"r":12,"c":10},{"r":13,"c":10},{"r":14,"c":10}],"plateaus":[{"r":3,"c":0},{"r":3,"c":1},{"r":3,"c":2},{"r":3,"c":3},{"r":3,"c":4},{"r":3,"c":5},{"r":3,"c":6},{"r":4,"c":0},{"r":4,"c":1},{"r":4,"c":2},{"r":4,"c":3},{"r":4,"c":4},{"r":5,"c":0},{"r":5,"c":1},{"r":5,"c":2},{"r":5,"c":3},{"r":5,"c":4},{"r":6,"c":0},{"r":6,"c":1},{"r":6,"c":2},{"r":7,"c":0},{"r":7,"c":1},{"r":7,"c":2}]},{"name":"Map 26","size":{"r":14,"c":12},"path":[{"r":-1,"c":1},{"r":0,"c":1},{"r":1,"c":1},{"r":2,"c":1},{"r":3,"c":1},{"r":3,"c":2},{"r":3,"c":3},{"r":3,"c":4},{"r":3,"c":5},{"r":3,"c":6},{"r":3,"c":7},{"r":3,"c":8},{"r":3,"c":9},{"r":3,"c":10},{"r":4,"c":10},{"r":5,"c":10},{"r":6,"c":10},{"r":7,"c":10},{"r":7,"c":9},{"r":7,"c":8},{"r":7,"c":7},{"r":7,"c":6},{"r":7,"c":5},{"r":7,"c":4},{"r":7,"c":3},{"r":7,"c":2},{"r":7,"c":1},{"r":8,"c":1},{"r":9,"c":1},{"r":10,"c":1},{"r":11,"c":1},{"r":11,"c":2},{"r":11,"c":3},{"r":11,"c":4},{"r":11,"c":5},{"r":11,"c":6},{"r":11,"c":7},{"r":11,"c":8},{"r":11,"c":9},{"r":11,"c":10},{"r":12,"c":10},{"r":13,"c":10},{"r":14,"c":10}],"plateaus":[{"r":5,"c":0},{"r":5,"c":1},{"r":5,"c":2},{"r":5,"c":3},{"r":5,"c":4},{"r":5,"c":5},{"r":5,"c":6},{"r":5,"c":7},{"r":5,"c":8},{"r":9,"c":3},{"r":9,"c":4},{"r":9,"c":5},{"r":9,"c":6},{"r":9,"c":7},{"r":9,"c":8},{"r":9,"c":9},{"r":9,"c":10},{"r":9,"c":11}]},{"name":"Map 27","size":{"r":14,"c":12},"path":[{"r":-1,"c":3},{"r":0,"c":3},{"r":1,"c":3},{"r":2,"c":3},{"r":3,"c":3},{"r":4,"c":3},{"r":5,"c":3},{"r":6,"c":3},{"r":7,"c":3},{"r":8,"c":3},{"r":8,"c":4},{"r":8,"c":5},{"r":8,"c":6},{"r":8,"c":7},{"r":8,"c":8},{"r":8,"c":9},{"r":8,"c":10},{"r":7,"c":10},{"r":6,"c":10},{"r":5,"c":10},{"r":4,"c":10},{"r":3,"c":10},{"r":3,"c":9},{"r":3,"c":8},{"r":3,"c":7},{"r":3,"c":6},{"r":3,"c":5},{"r":3,"c":4},{"r":3,"c":3},{"r":3,"c":2},{"r":3,"c":1},{"r":4,"c":1},{"r":5,"c":1},{"r":6,"c":1},{"r":7,"c":1},{"r":8,"c":1},{"r":9,"c":1},{"r":10,"c":1},{"r":11,"c":1},{"r":12,"c":1},{"r":13,"c":1},{"r":14,"c":1}],"plateaus":[{"r":5,"c":5},{"r":5,"c":6},{"r":5,"c":7},{"r":5,"c":8},{"r":6,"c":5},{"r":6,"c":6},{"r":6,"c":7},{"r":6,"c":8}]},{"name":"Map 28","size":{"r":14,"c":12},"path":[{"r":-1,"c":1},{"r":0,"c":1},{"r":1,"c":1},{"r":2,"c":1},{"r":2,"c":2},{"r":2,"c":3},{"r":3,"c":3},{"r":4,"c":3},{"r":4,"c":4},{"r":4,"c":5},{"r":5,"c":5},{"r":6,"c":5},{"r":6,"c":6},{"r":6,"c":7},{"r":5,"c":7},{"r":4,"c":7},{"r":4,"c":8},{"r":4,"c":9},{"r":4,"c":10},{"r":5,"c":10},{"r":6,"c":10},{"r":7,"c":10},{"r":8,"c":10},{"r":8,"c":9},{"r":8,"c":8},{"r":8,"c":7},{"r":8,"c":6},{"r":8,"c":5},{"r":8,"c":4},{"r":8,"c":3},{"r":8,"c":2},{"r":8,"c":1},{"r":9,"c":1},{"r":10,"c":1},{"r":11,"c":1},{"r":11,"c":2},{"r":11,"c":3},{"r":11,"c":4},{"r":11,"c":5},{"r":11,"c":6},{"r":12,"c":6},{"r":13,"c":6},{"r":14,"c":6}],"plateaus":[{"r":4,"c":0},{"r":4,"c":1},{"r":5,"c":0},{"r":5,"c":1},{"r":6,"c":0},{"r":6,"c":1},{"r":6,"c":2},{"r":6,"c":3},{"r":10,"c":8},{"r":10,"c":9},{"r":10,"c":10},{"r":10,"c":11},{"r":11,"c":8},{"r":11,"c":9},{"r":11,"c":10},{"r":11,"c":11},{"r":12,"c":8},{"r":12,"c":9},{"r":12,"c":10},{"r":12,"c":11},{"r":13,"c":8},{"r":13,"c":9},{"r":13,"c":10},{"r":13,"c":11}]},{"name":"Map 29","size":{"r":14,"c":12},"path":[{"r":1,"c":12},{"r":1,"c":11},{"r":1,"c":10},{"r":1,"c":9},{"r":1,"c":8},{"r":1,"c":7},{"r":1,"c":6},{"r":1,"c":5},{"r":1,"c":4},{"r":1,"c":3},{"r":1,"c":2},{"r":1,"c":1},{"r":2,"c":1},{"r":3,"c":1},{"r":4,"c":1},{"r":5,"c":1},{"r":6,"c":1},{"r":6,"c":2},{"r":6,"c":3},{"r":6,"c":4},{"r":6,"c":5},{"r":6,"c":6},{"r":6,"c":7},{"r":5,"c":7},{"r":4,"c":7},{"r":3,"c":7},{"r":2,"c":7},{"r":1,"c":7},{"r":1,"c":6},{"r":1,"c":5},{"r":1,"c":4},{"r":1,"c":3},{"r":1,"c":2},{"r":1,"c":1},{"r":2,"c":1},{"r":3,"c":1},{"r":4,"c":1},{"r":5,"c":1},{"r":6,"c":1},{"r":7,"c":1},{"r":8,"c":1},{"r":9,"c":1},{"r":10,"c":1},{"r":11,"c":1},{"r":12,"c":1},{"r":13,"c":1},{"r":14,"c":1}],"plateaus":[{"r":3,"c":3},{"r":3,"c":4},{"r":3,"c":5},{"r":4,"c":3},{"r":4,"c":4},{"r":4,"c":5}]},{"name":"Map 30","size":{"r":14,"c":12},"path":[{"r":-1,"c":5},{"r":0,"c":5},{"r":1,"c":5},{"r":2,"c":5},{"r":2,"c":4},{"r":2,"c":3},{"r":3,"c":3},{"r":4,"c":3},{"r":5,"c":3},{"r":6,"c":3},{"r":7,"c":3},{"r":8,"c":3},{"r":9,"c":3},{"r":10,"c":3},{"r":10,"c":4},{"r":10,"c":5},{"r":10,"c":6},{"r":10,"c":7},{"r":9,"c":7},{"r":8,"c":7},{"r":7,"c":7},{"r":6,"c":7},{"r":5,"c":7},{"r":4,"c":7},{"r":3,"c":7},{"r":2,"c":7},{"r":2,"c":6},{"r":2,"c":5},{"r":2,"c":4},{"r":2,"c":3},{"r":3,"c":3},{"r":4,"c":3},{"r":5,"c":3},{"r":6,"c":3},{"r":7,"c":3},{"r":8,"c":3},{"r":9,"c":3},{"r":10,"c":3},{"r":10,"c":4},{"r":10,"c":5},{"r":11,"c":5},{"r":12,"c":5},{"r":13,"c":5},{"r":14,"c":5}],"plateaus":[{"r":4,"c":5},{"r":5,"c":5},{"r":6,"c":5},{"r":7,"c":5},{"r":8,"c":5}]},{"name":"Map 31","size":{"r":14,"c":12},"path":[{"r":-1,"c":4},{"r":0,"c":4},{"r":1,"c":4},{"r":2,"c":4},{"r":3,"c":4},{"r":4,"c":4},{"r":5,"c":4},{"r":6,"c":4},{"r":7,"c":4},{"r":8,"c":4},{"r":8,"c":5},{"r":8,"c":6},{"r":9,"c":6},{"r":10,"c":6},{"r":10,"c":5},{"r":11,"c":5},{"r":12,"c":5},{"r":11,"c":5},{"r":10,"c":5},{"r":10,"c":6},{"r":9,"c":6},{"r":8,"c":6},{"r":7,"c":6},{"r":6,"c":6},{"r":5,"c":6},{"r":4,"c":6},{"r":4,"c":7},{"r":3,"c":7},{"r":2,"c":7},{"r":1,"c":7},{"r":1,"c":8},{"r":1,"c":7},{"r":2,"c":7},{"r":3,"c":7},{"r":4,"c":7},{"r":4,"c":6},{"r":5,"c":6},{"r":6,"c":6},{"r":6,"c":7},{"r":6,"c":8},{"r":7,"c":8},{"r":8,"c":8},{"r":9,"c":8},{"r":10,"c":8},{"r":11,"c":8},{"r":12,"c":8},{"r":13,"c":8},{"r":14,"c":8}],"plateaus":[{"r":0,"c":0},{"r":1,"c":0},{"r":2,"c":0},{"r":3,"c":0},{"r":4,"c":0},{"r":5,"c":0},{"r":6,"c":0},{"r":7,"c":0},{"r":8,"c":0},{"r":9,"c":0},{"r":10,"c":0},{"r":11,"c":0},{"r":12,"c":0},{"r":13,"c":0},{"r":0,"c":1},{"r":1,"c":1},{"r":2,"c":1},{"r":3,"c":1},{"r":4,"c":1},{"r":5,"c":1},{"r":6,"c":1},{"r":7,"c":1},{"r":8,"c":1},{"r":9,"c":1},{"r":10,"c":1},{"r":11,"c":1},{"r":12,"c":1},{"r":13,"c":1},{"r":0,"c":2},{"r":1,"c":2},{"r":2,"c":2},{"r":3,"c":2},{"r":4,"c":2},{"r":5,"c":2},{"r":6,"c":2},{"r":7,"c":2},{"r":8,"c":2},{"r":9,"c":2},{"r":10,"c":2},{"r":11,"c":2},{"r":12,"c":2},{"r":13,"c":2},{"r":11,"c":3},{"r":12,"c":3},{"r":13,"c":3}]}]')},function(t,e,i){var n=i(32),s=i(33),r=i(34),a=i(35),o=i(36),h=i(37),u=i(38);u.alea=n,u.xor128=s,u.xorwow=r,u.xorshift7=a,u.xor4096=o,u.tychei=h,t.exports=u},function(t,e,i){(function(t){var n;!function(t,s,r){function a(t){var e,i=this,n=(e=4022871197,function(t){t=String(t);for(var i=0;i<t.length;i++){var n=.02519603282416938*(e+=t.charCodeAt(i));n-=e=n>>>0,e=(n*=e)>>>0,e+=4294967296*(n-=e)}return 2.3283064365386963e-10*(e>>>0)});i.next=function(){var t=2091639*i.s0+2.3283064365386963e-10*i.c;return i.s0=i.s1,i.s1=i.s2,i.s2=t-(i.c=0|t)},i.c=1,i.s0=n(" "),i.s1=n(" "),i.s2=n(" "),i.s0-=n(t),i.s0<0&&(i.s0+=1),i.s1-=n(t),i.s1<0&&(i.s1+=1),i.s2-=n(t),i.s2<0&&(i.s2+=1),n=null}function o(t,e){return e.c=t.c,e.s0=t.s0,e.s1=t.s1,e.s2=t.s2,e}function h(t,e){var i=new a(t),n=e&&e.state,s=i.next;return s.int32=function(){return 4294967296*i.next()|0},s.double=function(){return s()+11102230246251565e-32*(2097152*s()|0)},s.quick=s,n&&("object"==typeof n&&o(n,i),s.state=function(){return o(i,{})}),s}s&&s.exports?s.exports=h:i(5)&&i(11)?void 0===(n=function(){return h}.call(e,i,e,s))||(s.exports=n):this.alea=h}(0,t,i(5))}).call(this,i(10)(t))},function(t,e,i){(function(t){var n;!function(t,s,r){function a(t){var e=this,i="";e.x=0,e.y=0,e.z=0,e.w=0,e.next=function(){var t=e.x^e.x<<11;return e.x=e.y,e.y=e.z,e.z=e.w,e.w^=e.w>>>19^t^t>>>8},t===(0|t)?e.x=t:i+=t;for(var n=0;n<i.length+64;n++)e.x^=0|i.charCodeAt(n),e.next()}function o(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e}function h(t,e){var i=new a(t),n=e&&e.state,s=function(){return(i.next()>>>0)/4294967296};return s.double=function(){do{var t=((i.next()>>>11)+(i.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},s.int32=i.next,s.quick=s,n&&("object"==typeof n&&o(n,i),s.state=function(){return o(i,{})}),s}s&&s.exports?s.exports=h:i(5)&&i(11)?void 0===(n=function(){return h}.call(e,i,e,s))||(s.exports=n):this.xor128=h}(0,t,i(5))}).call(this,i(10)(t))},function(t,e,i){(function(t){var n;!function(t,s,r){function a(t){var e=this,i="";e.next=function(){var t=e.x^e.x>>>2;return e.x=e.y,e.y=e.z,e.z=e.w,e.w=e.v,(e.d=e.d+362437|0)+(e.v=e.v^e.v<<4^t^t<<1)|0},e.x=0,e.y=0,e.z=0,e.w=0,e.v=0,t===(0|t)?e.x=t:i+=t;for(var n=0;n<i.length+64;n++)e.x^=0|i.charCodeAt(n),n==i.length&&(e.d=e.x<<10^e.x>>>4),e.next()}function o(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e.v=t.v,e.d=t.d,e}function h(t,e){var i=new a(t),n=e&&e.state,s=function(){return(i.next()>>>0)/4294967296};return s.double=function(){do{var t=((i.next()>>>11)+(i.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},s.int32=i.next,s.quick=s,n&&("object"==typeof n&&o(n,i),s.state=function(){return o(i,{})}),s}s&&s.exports?s.exports=h:i(5)&&i(11)?void 0===(n=function(){return h}.call(e,i,e,s))||(s.exports=n):this.xorwow=h}(0,t,i(5))}).call(this,i(10)(t))},function(t,e,i){(function(t){var n;!function(t,s,r){function a(t){var e=this;e.next=function(){var t,i,n=e.x,s=e.i;return t=n[s],i=(t^=t>>>7)^t<<24,i^=(t=n[s+1&7])^t>>>10,i^=(t=n[s+3&7])^t>>>3,i^=(t=n[s+4&7])^t<<7,t=n[s+7&7],i^=(t^=t<<13)^t<<9,n[s]=i,e.i=s+1&7,i},function(t,e){var i,n=[];if(e===(0|e))n[0]=e;else for(e=""+e,i=0;i<e.length;++i)n[7&i]=n[7&i]<<15^e.charCodeAt(i)+n[i+1&7]<<13;for(;n.length<8;)n.push(0);for(i=0;i<8&&0===n[i];++i);for(8==i?n[7]=-1:n[i],t.x=n,t.i=0,i=256;i>0;--i)t.next()}(e,t)}function o(t,e){return e.x=t.x.slice(),e.i=t.i,e}function h(t,e){null==t&&(t=+new Date);var i=new a(t),n=e&&e.state,s=function(){return(i.next()>>>0)/4294967296};return s.double=function(){do{var t=((i.next()>>>11)+(i.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},s.int32=i.next,s.quick=s,n&&(n.x&&o(n,i),s.state=function(){return o(i,{})}),s}s&&s.exports?s.exports=h:i(5)&&i(11)?void 0===(n=function(){return h}.call(e,i,e,s))||(s.exports=n):this.xorshift7=h}(0,t,i(5))}).call(this,i(10)(t))},function(t,e,i){(function(t){var n;!function(t,s,r){function a(t){var e=this;e.next=function(){var t,i,n=e.w,s=e.X,r=e.i;return e.w=n=n+1640531527|0,i=s[r+34&127],t=s[r=r+1&127],i^=i<<13,t^=t<<17,i^=i>>>15,t^=t>>>12,i=s[r]=i^t,e.i=r,i+(n^n>>>16)|0},function(t,e){var i,n,s,r,a,o=[],h=128;for(e===(0|e)?(n=e,e=null):(e+="\0",n=0,h=Math.max(h,e.length)),s=0,r=-32;r<h;++r)e&&(n^=e.charCodeAt((r+32)%e.length)),0===r&&(a=n),n^=n<<10,n^=n>>>15,n^=n<<4,n^=n>>>13,r>=0&&(a=a+1640531527|0,s=0==(i=o[127&r]^=n+a)?s+1:0);for(s>=128&&(o[127&(e&&e.length||0)]=-1),s=127,r=512;r>0;--r)n=o[s+34&127],i=o[s=s+1&127],n^=n<<13,i^=i<<17,n^=n>>>15,i^=i>>>12,o[s]=n^i;t.w=a,t.X=o,t.i=s}(e,t)}function o(t,e){return e.i=t.i,e.w=t.w,e.X=t.X.slice(),e}function h(t,e){null==t&&(t=+new Date);var i=new a(t),n=e&&e.state,s=function(){return(i.next()>>>0)/4294967296};return s.double=function(){do{var t=((i.next()>>>11)+(i.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},s.int32=i.next,s.quick=s,n&&(n.X&&o(n,i),s.state=function(){return o(i,{})}),s}s&&s.exports?s.exports=h:i(5)&&i(11)?void 0===(n=function(){return h}.call(e,i,e,s))||(s.exports=n):this.xor4096=h}(0,t,i(5))}).call(this,i(10)(t))},function(t,e,i){(function(t){var n;!function(t,s,r){function a(t){var e=this,i="";e.next=function(){var t=e.b,i=e.c,n=e.d,s=e.a;return t=t<<25^t>>>7^i,i=i-n|0,n=n<<24^n>>>8^s,s=s-t|0,e.b=t=t<<20^t>>>12^i,e.c=i=i-n|0,e.d=n<<16^i>>>16^s,e.a=s-t|0},e.a=0,e.b=0,e.c=-1640531527,e.d=1367130551,t===Math.floor(t)?(e.a=t/4294967296|0,e.b=0|t):i+=t;for(var n=0;n<i.length+20;n++)e.b^=0|i.charCodeAt(n),e.next()}function o(t,e){return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e}function h(t,e){var i=new a(t),n=e&&e.state,s=function(){return(i.next()>>>0)/4294967296};return s.double=function(){do{var t=((i.next()>>>11)+(i.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},s.int32=i.next,s.quick=s,n&&("object"==typeof n&&o(n,i),s.state=function(){return o(i,{})}),s}s&&s.exports?s.exports=h:i(5)&&i(11)?void 0===(n=function(){return h}.call(e,i,e,s))||(s.exports=n):this.tychei=h}(0,t,i(5))}).call(this,i(10)(t))},function(t,e,i){var n;!function(s,r,a){var o,h=a.pow(256,6),u=a.pow(2,52),c=2*u;function l(t,e,i){var n=[],l=f(function t(e,i){var n,s=[],r=typeof e;if(i&&"object"==r)for(n in e)try{s.push(t(e[n],i-1))}catch(t){}return s.length?s:"string"==r?e:e+"\0"}((e=1==e?{entropy:!0}:e||{}).entropy?[t,m(r)]:null==t?function(){try{var t;return o&&(t=o.randomBytes)?t=t(256):(t=new Uint8Array(256),(s.crypto||s.msCrypto).getRandomValues(t)),m(t)}catch(t){var e=s.navigator,i=e&&e.plugins;return[+new Date,s,i,s.screen,m(r)]}}():t,3),n),g=new d(n),v=function(){for(var t=g.g(6),e=h,i=0;t<u;)t=256*(t+i),e*=256,i=g.g(1);for(;t>=c;)t/=2,e/=2,i>>>=1;return(t+i)/e};return v.int32=function(){return 0|g.g(4)},v.quick=function(){return g.g(4)/4294967296},v.double=v,f(m(g.S),r),(e.pass||i||function(t,e,i,n){return n&&(n.S&&p(n,g),t.state=function(){return p(g,{})}),i?(a.random=t,e):t})(v,l,"global"in e?e.global:this==a,e.state)}function d(t){var e,i=t.length,n=this,s=0,r=n.i=n.j=0,a=n.S=[];for(i||(t=[i++]);s<256;)a[s]=s++;for(s=0;s<256;s++)a[s]=a[r=255&r+t[s%i]+(e=a[s])],a[r]=e;(n.g=function(t){for(var e,i=0,s=n.i,r=n.j,a=n.S;t--;)e=a[s=255&s+1],i=256*i+a[255&(a[s]=a[r=255&r+e])+(a[r]=e)];return n.i=s,n.j=r,i})(256)}function p(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function f(t,e){for(var i,n=t+"",s=0;s<n.length;)e[255&s]=255&(i^=19*e[255&s])+n.charCodeAt(s++);return m(e)}function m(t){return String.fromCharCode.apply(0,t)}if(f(a.random(),r),t.exports){t.exports=l;try{o=i(39)}catch(t){}}else void 0===(n=function(){return l}.call(e,i,e,t))||(t.exports=n)}("undefined"!=typeof self?self:this,[],Math)},function(t,e){},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=i(0),o=i(1),h=function(t){function e(e,i,n){var s=t.call(this,e)||this;s.glueTurretActor=i,s.glue=n,s.id=n.id,s.x=s.glueTurretActor.x,s.y=s.glueTurretActor.y;for(var h=s.glue.range*r.GameConstants.CELLS_SIZE,u=function(t){var e=new Phaser.GameObjects.Image(c.scene,0,0,"texture_atlas_4","area_freeze");e.setScale(0),e.alpha=0,c.add(e),c.scene.tweens.add({targets:e,scaleX:2*h/e.width,scaleY:2*h/e.width,alpha:1,ease:Phaser.Math.Easing.Cubic.Out,duration:1===a.GameVars.timeStepFactor?600:200,delay:(1===a.GameVars.timeStepFactor?300:100)*t,onComplete:function(){s.scene&&s.scene.tweens.add({targets:e,alpha:0,ease:Phaser.Math.Easing.Cubic.Out,duration:1===a.GameVars.timeStepFactor?300:100})},onCompleteScope:c})},c=this,l=0;l<3;l++)u(l);return o.AudioManager.playSoundEffect("t2_hielo"),s}return s(e,t),e.prototype.destroy=function(){var e=this;this.scene.tweens.add({targets:this,alpha:0,ease:Phaser.Math.Easing.Cubic.Out,duration:1===a.GameVars.timeStepFactor?600:200,onComplete:function(){t.prototype.destroy.call(e)},onCompleteScope:this})},e.prototype.drawFx=function(){var t=180*Math.random(),e=40,i=Phaser.Math.DegToRad(40*Math.random()-20+t),n=new Phaser.GameObjects.Image(this.scene,e*Math.cos(i),e*Math.sin(i),"texture_atlas_4","bullet_fx_3");n.setScale(.4),this.add(n),e=65,(n=new Phaser.GameObjects.Image(this.scene,e*Math.cos(i),e*Math.sin(i),"texture_atlas_4","bullet_fx_3")).setScale(.25),this.add(n),i=Phaser.Math.DegToRad(100+40*Math.random()+t),e=40,(n=new Phaser.GameObjects.Image(this.scene,e*Math.cos(i),e*Math.sin(i),"texture_atlas_4","bullet_fx_3")).setScale(.25),this.add(n),e=65,(n=new Phaser.GameObjects.Image(this.scene,e*Math.cos(i),e*Math.sin(i),"texture_atlas_4","bullet_fx_3")).setScale(.4),this.add(n),e=54,(n=new Phaser.GameObjects.Image(this.scene,e*Math.cos(i+.45),e*Math.sin(i+.45),"texture_atlas_4","bullet_fx_3")).setScale(.15),this.add(n),i=Phaser.Math.DegToRad(220+40*Math.random()+t),e=50,(n=new Phaser.GameObjects.Image(this.scene,e*Math.cos(i-.1),e*Math.sin(i-.1),"texture_atlas_4","bullet_fx_3")).setScale(.3),this.add(n),e=65,(n=new Phaser.GameObjects.Image(this.scene,e*Math.cos(i+.25),e*Math.sin(i+.25),"texture_atlas_4","bullet_fx_3")).setScale(.25),this.add(n)},e}(Phaser.GameObjects.Container);e.GluePool=h},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=i(0),o=i(1),h=function(t){function e(e){var i=t.call(this,e)||this;i.x=-r.GameConstants.CELLS_SIZE*a.GameVars.currentMapData.size.c/2,i.y=-r.GameConstants.CELLS_SIZE*a.GameVars.currentMapData.size.r/2,i.pathContainer=new Phaser.GameObjects.Container(i.scene),i.add(i.pathContainer),i.renderTextureBackground=new Phaser.GameObjects.RenderTexture(i.scene,-r.GameConstants.GAME_WIDTH,-r.GameConstants.GAME_HEIGHT,3*r.GameConstants.GAME_WIDTH,2*r.GameConstants.GAME_HEIGHT),i.pathContainer.add(i.renderTextureBackground),i.boardMatrix=new Array(a.GameVars.currentMapData.size.r);for(var n=0;n<i.boardMatrix.length;n++)i.boardMatrix[n]=new Array(a.GameVars.currentMapData.size.c).fill(2);for(n=0;n<a.GameVars.plateausCells.length;n++)i.boardMatrix[a.GameVars.plateausCells[n].r][a.GameVars.plateausCells[n].c]=0;for(n=0;n<a.GameVars.enemiesPathCells.length;n++)a.GameVars.enemiesPathCells[n].c<0||a.GameVars.enemiesPathCells[n].r<0||a.GameVars.enemiesPathCells[n].c>=a.GameVars.currentMapData.size.c||a.GameVars.enemiesPathCells[n].r>=a.GameVars.currentMapData.size.r||(i.boardMatrix[a.GameVars.enemiesPathCells[n].r][a.GameVars.enemiesPathCells[n].c]=1);for(n=0;n<i.boardMatrix.length+20;n++)for(var s=0;s<i.boardMatrix[0].length+6;s++){var o=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_1",n%2==0&&s%2==0||n%2==1&&s%2==1?"cell_grass_1":"cell_grass_2");i.renderTextureBackground.draw(o,r.GameConstants.GAME_WIDTH+r.GameConstants.CELLS_SIZE*(s-2)+r.GameConstants.CELLS_SIZE/2,r.GameConstants.GAME_HEIGHT+r.GameConstants.CELLS_SIZE*(n-10)+r.GameConstants.CELLS_SIZE/2)}for(n=0;n<i.boardMatrix.length;n++)for(s=0;s<i.boardMatrix[n].length;s++)if(1===i.boardMatrix[n][s]){o=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_1","cell_dirt");i.renderTextureBackground.draw(o,r.GameConstants.GAME_WIDTH+r.GameConstants.CELLS_SIZE*s+r.GameConstants.CELLS_SIZE/2,r.GameConstants.GAME_HEIGHT+r.GameConstants.CELLS_SIZE*n+r.GameConstants.CELLS_SIZE/2),i.addPathShadows(n,s)}else if(2===i.boardMatrix[n][s]){o=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_1",n%2==0&&s%2==0||n%2==1&&s%2==1?"cell_grass_1":"cell_grass_2");i.renderTextureBackground.draw(o,r.GameConstants.GAME_WIDTH+r.GameConstants.CELLS_SIZE*s+r.GameConstants.CELLS_SIZE/2,r.GameConstants.GAME_HEIGHT+r.GameConstants.CELLS_SIZE*n+r.GameConstants.CELLS_SIZE/2)}if(i.portal=new Phaser.GameObjects.Image(i.scene,r.GameConstants.CELLS_SIZE*a.GameVars.enemiesPathCells[0].c+r.GameConstants.CELLS_SIZE/2,r.GameConstants.CELLS_SIZE*a.GameVars.enemiesPathCells[0].r+r.GameConstants.CELLS_SIZE,"texture_atlas_4","portal"),i.portal.setOrigin(.5,1),i.add(i.portal),-1===a.GameVars.enemiesPathCells[0].c)i.portalFront=new Phaser.GameObjects.Image(i.scene,r.GameConstants.CELLS_SIZE*a.GameVars.enemiesPathCells[0].c+r.GameConstants.CELLS_SIZE/2,r.GameConstants.CELLS_SIZE*a.GameVars.enemiesPathCells[0].r+r.GameConstants.CELLS_SIZE+8,"texture_atlas_4","portal_side_down"),i.portalFront.setOrigin(0,1),i.add(i.portalFront),i.portal.setFrame("portal_side_up"),i.portal.setOrigin(0,1),i.portal.y+=8;else if(a.GameVars.enemiesPathCells[0].c===i.boardMatrix[0].length)i.portalFront=new Phaser.GameObjects.Image(i.scene,r.GameConstants.CELLS_SIZE*a.GameVars.enemiesPathCells[0].c+r.GameConstants.CELLS_SIZE/2,r.GameConstants.CELLS_SIZE*a.GameVars.enemiesPathCells[0].r+r.GameConstants.CELLS_SIZE+8,"texture_atlas_4","portal_side_down"),i.portalFront.setOrigin(0,1),i.portalFront.scaleX=-1,i.add(i.portalFront),i.portal.setFrame("portal_side_up"),i.portal.setOrigin(0,1),i.portal.scaleX=-1,i.portal.y+=8;else{var h=new Phaser.GameObjects.Sprite(i.scene,r.GameConstants.CELLS_SIZE*a.GameVars.enemiesPathCells[0].c+r.GameConstants.CELLS_SIZE/2,r.GameConstants.CELLS_SIZE*a.GameVars.enemiesPathCells[0].r+r.GameConstants.CELLS_SIZE,"texture_atlas_4");i.scene.add.existing(h),h.setOrigin(.5,1),i.pathContainer.add(h),h.anims.play("portal_inner_fx"),i.pathContainer.bringToTop(i.portal)}return i.turretFrame=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","tower_frame"),i.turretFrame.visible=!1,i.add(i.turretFrame),i.scene.tweens.add({targets:i.turretFrame,scaleX:1.075,scaleY:1.075,ease:Phaser.Math.Easing.Cubic.InOut,duration:400,yoyo:!0,repeat:-1}),i}return s(e,t),e.prototype.resetTurretFrame=function(t,e){this.turretFrame.visible=!0,this.turretFrame.x=t,this.turretFrame.y=e-10,this.bringToTop(this.turretFrame)},e.prototype.hideTurretFrame=function(){this.turretFrame.visible=!1},e.prototype.addPathShadows=function(t,e){if(0===e||1!==this.boardMatrix[t][e-1]){var i=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_1","shadow_side");this.renderTextureBackground.draw(i,r.GameConstants.GAME_WIDTH+r.GameConstants.CELLS_SIZE*e+r.GameConstants.CELLS_SIZE/2,r.GameConstants.GAME_HEIGHT+r.GameConstants.CELLS_SIZE*t+r.GameConstants.CELLS_SIZE/2)}0!==t&&1===this.boardMatrix[t-1][e]||((i=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_1","shadow_side")).setAngle(90),this.renderTextureBackground.draw(i,r.GameConstants.GAME_WIDTH+r.GameConstants.CELLS_SIZE*e+r.GameConstants.CELLS_SIZE/2,r.GameConstants.GAME_HEIGHT+r.GameConstants.CELLS_SIZE*t+r.GameConstants.CELLS_SIZE/2));e!==this.boardMatrix[0].length-1&&1===this.boardMatrix[t][e+1]||((i=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_1","shadow_side")).setAngle(180),this.renderTextureBackground.draw(i,r.GameConstants.GAME_WIDTH+r.GameConstants.CELLS_SIZE*e+r.GameConstants.CELLS_SIZE/2,r.GameConstants.GAME_HEIGHT+r.GameConstants.CELLS_SIZE*t+r.GameConstants.CELLS_SIZE/2));t!==this.boardMatrix.length-1&&1===this.boardMatrix[t+1][e]||((i=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_1","shadow_side")).setAngle(270),this.renderTextureBackground.draw(i,r.GameConstants.GAME_WIDTH+r.GameConstants.CELLS_SIZE*e+r.GameConstants.CELLS_SIZE/2,r.GameConstants.GAME_HEIGHT+r.GameConstants.CELLS_SIZE*t+r.GameConstants.CELLS_SIZE/2));if(0!==e&&t!==this.boardMatrix.length-1&&1!==this.boardMatrix[t+1][e-1]&&1===this.boardMatrix[t][e-1]&&1===this.boardMatrix[t+1][e]){var i=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_1","shadow_corner");this.renderTextureBackground.draw(i,r.GameConstants.GAME_WIDTH+r.GameConstants.CELLS_SIZE*e+r.GameConstants.CELLS_SIZE/2,r.GameConstants.GAME_HEIGHT+r.GameConstants.CELLS_SIZE*t+r.GameConstants.CELLS_SIZE/2)}0!==e&&0!==t&&1!==this.boardMatrix[t-1][e-1]&&1===this.boardMatrix[t][e-1]&&1===this.boardMatrix[t-1][e]&&((i=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_1","shadow_corner")).setAngle(90),this.renderTextureBackground.draw(i,r.GameConstants.GAME_WIDTH+r.GameConstants.CELLS_SIZE*e+r.GameConstants.CELLS_SIZE/2,r.GameConstants.GAME_HEIGHT+r.GameConstants.CELLS_SIZE*t+r.GameConstants.CELLS_SIZE/2));e!==this.boardMatrix[0].length-1&&0!==t&&1!==this.boardMatrix[t-1][e+1]&&1===this.boardMatrix[t][e+1]&&1===this.boardMatrix[t-1][e]&&((i=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_1","shadow_corner")).setAngle(180),this.renderTextureBackground.draw(i,r.GameConstants.GAME_WIDTH+r.GameConstants.CELLS_SIZE*e+r.GameConstants.CELLS_SIZE/2,r.GameConstants.GAME_HEIGHT+r.GameConstants.CELLS_SIZE*t+r.GameConstants.CELLS_SIZE/2));e!==this.boardMatrix[0].length-1&&t!==this.boardMatrix.length-1&&1!==this.boardMatrix[t+1][e+1]&&1===this.boardMatrix[t][e+1]&&1===this.boardMatrix[t+1][e]&&((i=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_1","shadow_corner")).setAngle(270),this.renderTextureBackground.draw(i,r.GameConstants.GAME_WIDTH+r.GameConstants.CELLS_SIZE*e+r.GameConstants.CELLS_SIZE/2,r.GameConstants.GAME_HEIGHT+r.GameConstants.CELLS_SIZE*t+r.GameConstants.CELLS_SIZE/2))},e.prototype.newPortalGlare=function(){var t;"portal"===this.portal.frame.name?(t=new Phaser.GameObjects.Image(this.scene,this.portal.x,this.portal.y-this.portal.height,"texture_atlas_4","portal_glare")).setOrigin(.5,0):((t=new Phaser.GameObjects.Image(this.scene,this.portal.x,this.portal.y,"texture_atlas_4","portal_side_glare")).setOrigin(0,1),t.scaleX=this.portal.scaleX);var e=this.getIndex(this.actorsContainer);this.addAt(t,e-1),this.scene.tweens.add({targets:t,alpha:0,ease:Phaser.Math.Easing.Linear,duration:1===a.GameVars.timeStepFactor?500:120,onComplete:function(){t.destroy()},onCompleteScope:this}),o.AudioManager.playSoundEffect("portal_spawns")},e.prototype.sendActorBack=function(t){this.sendToBack(t),this.sendToBack(this.pathContainer)},e}(Phaser.GameObjects.Container);e.Board=h},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var a=i(1),o=i(12),h=r(i(4)),u=i(0),c=function(t){function e(e,i,n){var s=t.call(this,e,h.GameConstants.TURRET_PROJECTILE,i,n)||this;return s.setScale(.8),s.base=new Phaser.GameObjects.Image(s.scene,0,-10,"texture_atlas_4","archer_1_base"),s.base.setInteractive({useHandCursor:!0}),s.base.on("pointerdown",s.onDownTurret,s),s.addAt(s.base,0),s.canon=new Phaser.GameObjects.Sprite(s.scene,0,-20,"texture_atlas_4","archer_1_top"),s.scene.add.existing(s.canon),s.add(s.canon),s.canonInitialY=-20,s.canon.rotation=s.canonPrevRotation,s}return s(e,t),e.prototype.setCanonRotation=function(e,i){t.prototype.setCanonRotation.call(this,e,i),this.canon.rotation=this.canonPrevRotation},e.prototype.upgrade=function(){switch(t.prototype.upgrade.call(this),this.turret.grade){case 2:this.base.setFrame("archer_2_base"),this.canon.setFrame("archer_2_top"),this.base.y=-18,this.canonInitialY=-32;break;case 3:this.base.setFrame("archer_3_base"),this.canon.setFrame("archer_3_top"),this.base.y=-22,this.canonInitialY=-32}this.canon.y=this.canonInitialY},e.prototype.shootArrow=function(){var t=this;this.scene.tweens.add({targets:this.canon,x:-5*Math.cos(this.canon.rotation),y:-5*Math.sin(this.canon.rotation)+this.canonInitialY,ease:Phaser.Math.Easing.Cubic.Out,duration:1===u.GameVars.timeStepFactor?40:10,onComplete:function(){t.scene&&t.scene.tweens.add({targets:t.canon,x:0,y:t.canonInitialY,ease:Phaser.Math.Easing.Cubic.Out,duration:1===u.GameVars.timeStepFactor?40:10})},onCompleteScope:this}),a.AudioManager.playSoundEffect("ballista")},e}(o.TurretActor);e.ProjectileTurretActor=c},function(t){t.exports=JSON.parse('{"enemies":{"soldier":{"life":300,"speed":0.1,"value":10},"runner":{"life":200,"speed":0.2,"value":15},"healer":{"life":400,"speed":0.1,"value":30},"blob":{"life":600,"speed":0.05,"value":20},"flier":{"life":400,"speed":0.15,"value":30}}}')},function(t){t.exports=JSON.parse('{"turrets":{"projectile":{"price":100,"name":"Ballista"},"laser":{"price":150,"name":"Torch"},"launch":{"price":250,"name":"Cannon"},"glue":{"price":500,"name":"Time Warper"}}}')},function(t){t.exports=JSON.parse('{"waves":{"wave_1":{"waveReward":100,"extend":2,"maxExtend":8,"enemies":[{"type":"soldier","t":0},{"type":"soldier","t":1},{"type":"soldier","t":2},{"type":"soldier","t":3},{"type":"soldier","t":4},{"type":"soldier","t":5}]},"wave_2":{"waveReward":100,"extend":2,"maxExtend":4,"enemies":[{"type":"soldier","t":0},{"type":"soldier","t":1},{"type":"soldier","t":2},{"type":"soldier","t":3},{"type":"soldier","t":4},{"type":"soldier","t":5},{"type":"soldier","t":7},{"type":"soldier","t":8},{"type":"soldier","t":9},{"type":"soldier","t":10},{"type":"soldier","t":11},{"type":"soldier","t":12}]},"wave_3":{"waveReward":120,"extend":1,"maxExtend":4,"enemies":[{"type":"soldier","t":0},{"type":"soldier","t":1},{"type":"soldier","t":2},{"type":"soldier","t":3},{"type":"soldier","t":4},{"type":"soldier","t":5},{"type":"blob","t":7},{"type":"blob","t":9},{"type":"blob","t":11},{"type":"blob","t":13},{"type":"blob","t":15},{"type":"blob","t":17}]},"wave_4":{"waveReward":120,"extend":1,"maxExtend":3,"enemies":[{"type":"soldier","t":0},{"type":"soldier","t":1},{"type":"soldier","t":2},{"type":"soldier","t":3},{"type":"soldier","t":4},{"type":"soldier","t":5},{"type":"blob","t":7},{"type":"blob","t":9},{"type":"blob","t":11},{"type":"blob","t":13},{"type":"blob","t":15},{"type":"blob","t":17},{"type":"soldier","t":19},{"type":"soldier","t":20},{"type":"soldier","t":21},{"type":"soldier","t":22},{"type":"soldier","t":23},{"type":"soldier","t":24}]},"wave_5":{"waveReward":150,"extend":1,"maxExtend":3,"enemies":[{"type":"runner","t":0},{"type":"runner","t":1},{"type":"runner","t":2},{"type":"runner","t":3},{"type":"runner","t":4},{"type":"runner","t":5},{"type":"soldier","t":7},{"type":"soldier","t":8},{"type":"soldier","t":9},{"type":"soldier","t":10},{"type":"soldier","t":11},{"type":"soldier","t":12},{"type":"blob","t":14},{"type":"blob","t":16},{"type":"blob","t":18},{"type":"blob","t":20},{"type":"blob","t":22},{"type":"blob","t":24}]},"wave_6":{"waveReward":150,"extend":1,"maxExtend":3,"enemies":[{"type":"soldier","t":0},{"type":"soldier","t":1},{"type":"soldier","t":2},{"type":"soldier","t":3},{"type":"soldier","t":4},{"type":"soldier","t":5},{"type":"runner","t":7},{"type":"runner","t":8},{"type":"runner","t":9},{"type":"runner","t":10},{"type":"runner","t":11},{"type":"runner","t":12},{"type":"blob","t":14},{"type":"blob","t":16},{"type":"blob","t":18},{"type":"blob","t":20},{"type":"blob","t":22},{"type":"blob","t":24}]},"wave_7":{"waveReward":170,"extend":1,"maxExtend":4,"enemies":[{"type":"flier","t":0},{"type":"flier","t":1},{"type":"flier","t":2},{"type":"flier","t":3},{"type":"flier","t":4},{"type":"flier","t":5},{"type":"soldier","t":7},{"type":"soldier","t":8},{"type":"soldier","t":9},{"type":"soldier","t":10},{"type":"soldier","t":11},{"type":"soldier","t":12}]},"wave_8":{"waveReward":170,"extend":1,"maxExtend":3,"enemies":[{"type":"runner","t":0},{"type":"runner","t":1},{"type":"runner","t":2},{"type":"runner","t":3},{"type":"runner","t":4},{"type":"runner","t":5},{"type":"blob","t":7},{"type":"blob","t":9},{"type":"blob","t":11},{"type":"blob","t":13},{"type":"blob","t":15},{"type":"blob","t":17},{"type":"flier","t":19},{"type":"flier","t":20},{"type":"flier","t":21},{"type":"flier","t":22},{"type":"flier","t":23},{"type":"flier","t":24}]},"wave_9":{"waveReward":190,"extend":1,"maxExtend":2,"enemies":[{"type":"runner","t":0},{"type":"runner","t":1},{"type":"runner","t":2},{"type":"runner","t":3},{"type":"runner","t":4},{"type":"runner","t":5},{"type":"runner","t":6},{"type":"runner","t":7},{"type":"runner","t":8},{"type":"blob","t":10},{"type":"blob","t":12},{"type":"blob","t":14},{"type":"blob","t":16},{"type":"blob","t":18},{"type":"blob","t":20},{"type":"blob","t":22},{"type":"blob","t":24},{"type":"blob","t":26},{"type":"flier","t":28},{"type":"flier","t":29},{"type":"flier","t":30},{"type":"flier","t":31},{"type":"flier","t":32},{"type":"flier","t":33},{"type":"flier","t":34},{"type":"flier","t":35},{"type":"flier","t":36}]},"wave_10":{"waveReward":190,"extend":1,"maxExtend":2,"enemies":[{"type":"healer","t":0},{"type":"healer","t":1},{"type":"healer","t":2},{"type":"healer","t":3},{"type":"healer","t":4},{"type":"healer","t":5},{"type":"healer","t":6},{"type":"healer","t":7},{"type":"healer","t":8},{"type":"runner","t":10},{"type":"runner","t":11},{"type":"runner","t":12},{"type":"runner","t":13},{"type":"runner","t":14},{"type":"runner","t":15},{"type":"runner","t":16},{"type":"runner","t":17},{"type":"runner","t":18},{"type":"blob","t":20},{"type":"blob","t":22},{"type":"blob","t":24},{"type":"blob","t":26},{"type":"blob","t":28},{"type":"blob","t":30},{"type":"blob","t":32},{"type":"blob","t":34},{"type":"blob","t":36}]},"wave_11":{"waveReward":240,"extend":1,"maxExtend":4,"enemies":[{"type":"healer","t":0},{"type":"healer","t":1},{"type":"healer","t":2},{"type":"healer","t":3},{"type":"healer","t":4},{"type":"healer","t":5},{"type":"healer","t":6},{"type":"healer","t":7},{"type":"healer","t":8},{"type":"healer","t":9},{"type":"healer","t":10},{"type":"healer","t":11}]},"wave_12":{"waveReward":240,"extend":1,"maxExtend":4,"enemies":[{"type":"healer","t":0},{"type":"healer","t":1},{"type":"healer","t":2},{"type":"healer","t":3},{"type":"healer","t":4},{"type":"healer","t":5},{"type":"healer","t":6},{"type":"healer","t":7},{"type":"healer","t":8},{"type":"runner","t":10},{"type":"runner","t":11},{"type":"runner","t":12},{"type":"runner","t":13},{"type":"runner","t":14},{"type":"runner","t":15},{"type":"runner","t":16},{"type":"runner","t":17},{"type":"runner","t":18}]},"wave_13":{"waveReward":240,"extend":1,"maxExtend":3,"enemies":[{"type":"healer","t":0},{"type":"healer","t":1},{"type":"healer","t":2},{"type":"healer","t":3},{"type":"healer","t":4},{"type":"healer","t":5},{"type":"soldier","t":7},{"type":"soldier","t":8},{"type":"soldier","t":9},{"type":"soldier","t":10},{"type":"soldier","t":11},{"type":"soldier","t":12},{"type":"healer","t":14},{"type":"healer","t":15},{"type":"healer","t":16},{"type":"healer","t":17},{"type":"healer","t":18},{"type":"healer","t":19},{"type":"soldier","t":21},{"type":"soldier","t":22},{"type":"soldier","t":23},{"type":"soldier","t":24},{"type":"soldier","t":25},{"type":"soldier","t":26}]},"wave_14":{"waveReward":240,"extend":1,"maxExtend":3,"enemies":[{"type":"healer","t":0},{"type":"healer","t":1},{"type":"healer","t":2},{"type":"healer","t":3},{"type":"healer","t":4},{"type":"healer","t":5},{"type":"blob","t":7},{"type":"blob","t":9},{"type":"blob","t":11},{"type":"blob","t":13},{"type":"blob","t":15},{"type":"blob","t":17},{"type":"flier","t":19},{"type":"flier","t":20},{"type":"flier","t":21},{"type":"flier","t":22},{"type":"flier","t":23},{"type":"flier","t":24}]},"wave_15":{"waveReward":300,"extend":1,"maxExtend":2,"enemies":[{"type":"healer","t":0},{"type":"healer","t":1},{"type":"healer","t":2},{"type":"healer","t":3},{"type":"healer","t":4},{"type":"healer","t":5},{"type":"blob","t":7},{"type":"blob","t":9},{"type":"blob","t":11},{"type":"blob","t":13},{"type":"blob","t":15},{"type":"blob","t":17},{"type":"flier","t":19},{"type":"flier","t":20},{"type":"flier","t":21},{"type":"flier","t":22},{"type":"flier","t":23},{"type":"flier","t":24},{"type":"soldier","t":26},{"type":"soldier","t":27},{"type":"soldier","t":28},{"type":"soldier","t":29},{"type":"soldier","t":30},{"type":"soldier","t":31},{"type":"runner","t":33},{"type":"runner","t":34},{"type":"runner","t":35},{"type":"runner","t":36},{"type":"runner","t":37},{"type":"runner","t":38}]}}}')},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var a=i(1),o=i(12),h=i(0),u=r(i(4)),c=function(t){function e(e,i,n){var s=t.call(this,e,u.GameConstants.TURRET_LASER,i,n)||this;return s.base=new Phaser.GameObjects.Image(s.scene,0,-5,"texture_atlas_4","fire_1_base"),s.base.setInteractive({useHandCursor:!0}),s.base.on("pointerdown",s.onDownTurret,s),s.addAt(s.base,0),s.topAnimation=new Phaser.GameObjects.Sprite(s.scene,0,-40,"texture_atlas_4"),s.scene.add.existing(s.topAnimation),s.add(s.topAnimation),s.topAnimation.anims.play("fire"),s.laserShoot=!1,s}return s(e,t),e.prototype.update=function(e,i){this.laserShoot?this.f++===this.framesDuration&&(this.laserShoot=!1):t.prototype.update.call(this,e,i)},e.prototype.upgrade=function(){switch(t.prototype.upgrade.call(this),this.turret.grade){case 2:this.base.setFrame("fire_2_base"),this.topAnimation.anims.play("electricity"),this.topAnimation.y=-35;break;case 3:this.base.setFrame("fire_3_base"),this.topAnimation.anims.play("plasma"),this.topAnimation.y=-35}},e.prototype.improve=function(){t.prototype.improve.call(this),this.topAnimation.blendMode=Phaser.BlendModes.SCREEN,this.scene.time.delayedCall(125,(function(){this.topAnimation.blendMode=Phaser.BlendModes.NORMAL}),[],this)},e.prototype.shootLaser=function(t){switch(this.laserShoot=!0,this.framesDuration=1===h.GameVars.timeStepFactor?24:6,this.f=0,this.turret.grade){case 1:a.AudioManager.playSoundEffect("fireball");break;case 2:a.AudioManager.playSoundEffect("t2_laser2");break;case 3:a.AudioManager.playSoundEffect("fireball"),a.AudioManager.playSoundEffect("t2_laser3")}},e}(o.TurretActor);e.LaserTurretActor=c},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=function(t){function e(e,i,n,s){var a=t.call(this,e)||this;a.laserTurretActor=i,a.enemyActors=n,a.grade=s,a.f=0,a.framesDuration=1===r.GameVars.timeStepFactor?16:4,a.lines=[],a.impact_x=[],a.impact_y=[];for(var o=0;o<a.enemyActors.length;o++)a.impact_x.push(a.enemyActors[o].x),a.impact_y.push(a.enemyActors[o].y);if(3===a.grade){var h=a.enemyActors[0].x,u=a.enemyActors[0].y-20;h+=50*(h-(p=a.laserTurretActor.x)),u+=50*(u-(f=a.laserTurretActor.y-30));var c=new Phaser.GameObjects.Sprite(a.scene,h,u,"texture_atlas_3","plasma_blast_1");a.scene.add.existing(c),c.scaleX=Math.hypot(u-f,h-p)/c.width,c.setOrigin(1,.5),c.setAngle(180*Math.atan2(u-f,h-p)/Math.PI),a.add(c),a.lines.push(c),c.anims.play("plasma_blast");var l=new Phaser.GameObjects.Sprite(a.scene,p,f-7,"texture_atlas_4");a.scene.add.existing(l),l.setScale(.9),a.add(l),l.anims.play("plasma");var d=new Phaser.GameObjects.Sprite(a.scene,p,f-7,"texture_atlas_4","electric_damage_00");a.scene.add.existing(d),d.setScale(1.1),a.add(d),d.anims.play("electric_damage"),a.scene.tweens.add({targets:d,scaleX:.1,scaleY:.1,ease:Phaser.Math.Easing.Cubic.In,duration:500}),d.on("animationcomplete",(function(){d.destroy()}),a),a.lines[0].visible=!1}else{a.impact_x=[],a.impact_y=[];for(o=0;o<a.enemyActors.length;o++)a.impact_x.push(a.enemyActors[o].x),a.impact_y.push(a.enemyActors[o].y);for(o=0;o<a.enemyActors.length;o++){h=void 0,u=void 0;var p=void 0,f=void 0;if(0===o?(h=a.impact_x[o],u=a.impact_y[o],p=a.laserTurretActor.x,f=a.laserTurretActor.y-20):(h=a.impact_x[o],u=a.impact_y[o],p=a.impact_x[o-1],f=a.impact_y[o-1]),1===a.grade){c=new Phaser.GameObjects.Sprite(a.scene,h,u,"texture_atlas_3","flame_00");a.scene.add.existing(c),c.scaleX=Math.hypot(u-f,h-p)/c.width*1.1,c.scaleY=.4+.2*a.grade,c.setOrigin(1,.5),c.setAngle(180*Math.atan2(u-f,h-p)/Math.PI),a.add(c),a.lines.push(c),c.anims.play("flame")}else{c=new Phaser.GameObjects.Sprite(a.scene,h,u,"texture_atlas_3","bolt_00");a.scene.add.existing(c),c.scaleX=Math.hypot(u-f,h-p)/c.width*1.1,c.scaleY=.4+.2*a.grade,c.setOrigin(1,.5),c.setAngle(180*Math.atan2(u-f,h-p)/Math.PI),a.add(c),a.lines.push(c),c.anims.play("bolt")}}}return a.scene.sys.updateList.add(a),a}return s(e,t),e.prototype.preUpdate=function(t,e){if(this.f++!==this.framesDuration)if(3===this.grade){this.f<=(1===r.GameVars.timeStepFactor?4:1)?this.lines[0].visible=!1:this.lines[0].visible=!0;var i=this.enemyActors[0].x,n=this.enemyActors[0].y-20;i+=50*(i-(a=this.laserTurretActor.x)),n+=50*(n-(o=this.laserTurretActor.y-30)),this.lines[0]&&(this.lines[0].setPosition(i,n),this.lines[0].scaleX=1,this.lines[0].scaleX=Math.hypot(n-o,i-a)/this.lines[0].width,this.lines[0].setAngle(180*Math.atan2(n-o,i-a)/Math.PI))}else{this.impact_x=[],this.impact_y=[];for(var s=0;s<this.enemyActors.length;s++)this.impact_x.push(this.enemyActors[s].x),this.impact_y.push(this.enemyActors[s].y);for(s=0;s<this.enemyActors.length;s++){i=void 0,n=void 0;var a=void 0,o=void 0;0===s?(i=this.impact_x[s],n=this.impact_y[s],a=this.laserTurretActor.x,o=this.laserTurretActor.y-30):(i=this.impact_x[s],n=this.impact_y[s],a=this.impact_x[s-1],o=this.impact_y[s-1]),this.lines[s]&&(this.lines[s].setPosition(i,n),this.lines[s].scaleX=1,this.lines[s].scaleX=Math.hypot(n-o,i-a)/this.lines[s].width,this.lines[s].setAngle(180*Math.atan2(n-o,i-a)/Math.PI)),1===this.grade&&(this.lines[s].scaleY-=.025,this.lines[s].scaleX-=.055*this.f,this.lines[s].scaleX=Math.max(0,this.lines[s].scaleX))}}else this.destroy()},e}(Phaser.GameObjects.Container);e.LaserBeam=a},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var a=i(12),o=i(0),h=r(i(4)),u=function(t){function e(e,i,n){var s=t.call(this,e,h.GameConstants.TURRET_LAUNCH,i,n)||this;return s.base=new Phaser.GameObjects.Image(s.scene,0,-20,"texture_atlas_4","cannon_1_base"),s.base.setInteractive({useHandCursor:!0}),s.base.on("pointerdown",s.onDownTurret,s),s.addAt(s.base,0),s.canonInitialY=-30,s.canon=new Phaser.GameObjects.Sprite(s.scene,0,s.canonInitialY,"texture_atlas_4","cannon_1_top_"+s.canonAngle),s.scene.add.existing(s.canon),s.add(s.canon),s.canon.setFrame("cannon_"+s.turret.grade+"_top_"+s.canonAngle),s}return s(e,t),e.prototype.upgrade=function(){switch(t.prototype.upgrade.call(this),this.turret.grade){case 2:this.base.setFrame("cannon_2_base"),this.canon.visible=!1,this.base.y=30,this.base.setOrigin(.5,.95);break;case 3:this.base.setFrame("cannon_3_base"),this.canon.setFrame("cannon_3_top_"+this.canonAngle),this.canon.visible=!0,this.base.y=-25,this.base.setOrigin(.5)}},e.prototype.setCanonRotation=function(e,i){t.prototype.setCanonRotation.call(this,e,i),2!==this.turret.grade&&(this.canon.setFrame("cannon_"+this.turret.grade+"_top_"+this.canonAngle),this.shine&&this.shine.setPosition(25*Math.cos(this.canonPrevRotation),25*Math.sin(this.canonPrevRotation)+this.canonInitialY))},e.prototype.shootMortar=function(){var t=this;this.shine||(this.shine=new Phaser.GameObjects.Image(this.scene,25*Math.cos(this.canonPrevRotation),25*Math.sin(this.canonPrevRotation)+this.canonInitialY,"texture_atlas_4","cannon_shine"),this.add(this.shine),this.scene.tweens.add({targets:this.shine,scaleX:2,scaleY:2,ease:Phaser.Math.Easing.Cubic.In,duration:20,onComplete:function(){t.scene.tweens.add({targets:t.shine,scaleX:4,scaleY:4,alpha:0,ease:Phaser.Math.Easing.Cubic.Out,duration:60,onComplete:function(){t.shine.destroy(),t.shine=null},onCompleteScope:t})},onCompleteScope:this}),this.scene.tweens.add({targets:this.canon,x:-5*Math.cos(this.canonPrevRotation),y:-5*Math.sin(this.canonPrevRotation)+this.canonInitialY,ease:Phaser.Math.Easing.Cubic.Out,duration:1===o.GameVars.timeStepFactor?40:10,onComplete:function(){t.scene&&t.scene.tweens.add({targets:t.canon,x:0,y:t.canonInitialY,ease:Phaser.Math.Easing.Cubic.Out,duration:1===o.GameVars.timeStepFactor?40:10})},onCompleteScope:this}))},e.prototype.shootMine=function(){this.shine||(this.scaleY=.75,this.scene.tweens.add({targets:this,scaleY:.9,ease:Phaser.Math.Easing.Cubic.Out,duration:350}),this.base.setFrame("cannon_2_fire"),this.scene.time.delayedCall(1===o.GameVars.timeStepFactor?100:25,(function(){this.base.setFrame("cannon_"+this.turret.grade+"_base")}),[],this))},e}(a.TurretActor);e.LaunchTurretActor=u},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=i(0),o=i(9),h=i(3),u=i(1),c=function(t){function e(e,i){var n=t.call(this,e)||this;if(n.mortar=i,n.detonated=!1,n.x=n.mortar.x*r.GameConstants.CELLS_SIZE,n.y=n.mortar.y*r.GameConstants.CELLS_SIZE,n.initialPosition={x:n.x,y:n.y},n.mortarImage=new Phaser.GameObjects.Image(n.scene,0,0,"texture_atlas_4","granade"),n.mortarImage.setScale(.5),n.add(n.mortarImage),3===i.grade){var s=i.angle;s<0&&(s=2*Math.PI+s);var a=180*s/Math.PI;a=Math.round(a/15);var o=Phaser.Math.Clamp(a+1,1,24);n.mortarImage.setFrame("cannon_3_bullet_"+o)}return n.visible=!1,n.deltaAngle=Math.random()>.5?.5:-.5,1===n.mortar.grade?u.AudioManager.playSoundEffect("t1_cannon"):u.AudioManager.playSoundEffect("t3_missile_launcher"),n}return s(e,t),e.prototype.update=function(t,e){if(!this.detonated){if(!this.visible){var i=this.initialPosition.x-this.x,n=this.initialPosition.y-this.y;Math.sqrt(i*i+n*n)>30&&(this.visible=!0)}var s,o,u=h.BattleManager.engine.ticksCounter-this.mortar.creationTick;s=u<this.mortar.ticksToImpact/2?.75*(1+u/(this.mortar.ticksToImpact/2)):.75*(1+(this.mortar.ticksToImpact-u)/(this.mortar.ticksToImpact/2)),this.mortarImage.setScale(s),o=r.GameConstants.INTERPOLATE_TRAJECTORIES?1===a.GameVars.timeStepFactor?.2:.65:1;var c=(this.mortar.x*r.GameConstants.CELLS_SIZE-this.x)*o,l=(this.mortar.y*r.GameConstants.CELLS_SIZE-this.y)*o;this.x+=c,this.y+=l,1===this.mortar.grade&&(this.mortarImage.angle+=this.deltaAngle)}},e.prototype.detonate=function(){var t=this;this.visible=!0,this.detonated=!0,this.mortarImage.visible=!1;var e=new Phaser.GameObjects.Sprite(this.scene,0,0,"texture_atlas_4","explossion_01");this.scene.add.existing(e),1===this.mortar.turret.grade?(e.setScale(1.5),u.AudioManager.playSoundEffect("t1_explosion")):3===this.mortar.turret.grade&&(e.setScale(2.5),u.AudioManager.playSoundEffect("t2_mine_explosion")),this.add(e),e.anims.play("explosion"),e.on("animationcomplete",(function(){o.BoardContainer.currentInstance.removeMortar(t)}),this)},e}(Phaser.GameObjects.Container);e.MortarActor=c},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var a=i(12),o=i(1),h=i(0),u=r(i(4)),c=function(t){function e(e,i,n){var s=t.call(this,e,u.GameConstants.TURRET_GLUE,i,n)||this;return s.base=new Phaser.GameObjects.Image(s.scene,0,-25,"texture_atlas_4","crystal_1_base"),s.base.setInteractive({useHandCursor:!0}),s.base.on("pointerdown",s.onDownTurret,s),s.addAt(s.base,0),s.canon=new Phaser.GameObjects.Sprite(s.scene,0,-25,"texture_atlas_4","crystal_1_top_01"),s.scene.add.existing(s.canon),s.canon.anims.play("crystal_top"),s.add(s.canon),s}return s(e,t),e.prototype.upgrade=function(){switch(t.prototype.upgrade.call(this),this.turret.grade){case 2:this.base.setFrame("crystal_2_base"),this.canon.anims.stop(),this.canon.setFrame("crystal_2_top_01");break;case 3:this.base.setFrame("crystal_3_base"),this.canon.setFrame("crystal_3_top_01")}},e.prototype.shootGlue=function(){var t=this;2===this.turret.grade&&(o.AudioManager.playSoundEffect("t3_pegamento"),this.scene.tweens.add({targets:this.canon,y:-15,ease:Phaser.Math.Easing.Cubic.Out,duration:1===h.GameVars.timeStepFactor?100:25,onComplete:function(){t.scene&&t.scene.tweens.add({targets:t.canon,y:-25,ease:Phaser.Math.Easing.Cubic.Out,duration:1===h.GameVars.timeStepFactor?100:25})},onCompleteScope:this}))},e}(a.TurretActor);e.GlueTurretActor=c},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(1),a=i(7),o=i(0),h=i(52),u=i(9),c=function(t){function e(e){var i=t.call(this,e)||this;i.y=-200;var n=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","layout_box_3");n.setOrigin(.5,0),n.scaleY=7.5,i.add(n);var s=new Phaser.GameObjects.Image(i.scene,0,n.height*n.scaleY,"texture_atlas_4","layout_box_4");s.setOrigin(.5,0),i.add(s);var r=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","title_area");r.setScale(.8),i.add(r);var a=new Phaser.GameObjects.Text(i.scene,0,-7,o.GameVars.gameText[o.GameVars.gameData.language].PAUSE_MENU_TITLE,{fontFamily:"Supercell",fontSize:"26px",color:"#FFFFFF"});a.setOrigin(.5),a.setStroke("#000000",6),a.setShadow(4,4,"#000000"),i.add(a),i.settingsContainer=new Phaser.GameObjects.Container(i.scene),i.add(i.settingsContainer);var c=new Phaser.GameObjects.Container(i.scene,0,100);i.settingsContainer.add(c);var l=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","btn_red_wide");l.setInteractive({useHandCursor:!0}),l.on("pointerover",(function(){c.setScale(1.025)})),l.on("pointerout",(function(){c.setScale(1)})),l.on("pointerdown",i.onDownResetButton,i),c.add(l);var d=new Phaser.GameObjects.Text(i.scene,0,0,o.GameVars.gameText[o.GameVars.gameData.language].RESTART,{fontFamily:"Supercell",fontSize:"18px",color:"#FFFFFF"});d.setOrigin(.5),d.setStroke("#000000",6),d.setShadow(3,3,"#000000"),c.add(d);var p=new h.Button(i.scene,0,375,"texture_atlas_1","btn_resume_off","btn_resume_on");p.onDown((function(){u.BoardContainer.currentInstance.hidePauseMenu()}),i),p.setScale(.75),i.settingsContainer.add(p);var f=new Phaser.GameObjects.Graphics(i.scene);f.setPosition(0,255),f.fillStyle(11184810,.35),f.fillRoundedRect(-165,-75,330,150,10),i.settingsContainer.add(f);var m=new Phaser.GameObjects.Container(i.scene,0,220);i.settingsContainer.add(m);var g=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","btn_info");g.setInteractive({useHandCursor:!0}),g.on("pointerdown",i.onDownMusicButton,i),g.on("pointerover",(function(){1===i.alpha&&m.setScale(1.025)}),i),g.on("pointerout",(function(){1===i.alpha&&m.setScale(1)}),i),m.add(g);var v=new Phaser.GameObjects.Text(i.scene,-130,0,o.GameVars.gameText[o.GameVars.gameData.language].MUSIC,{fontFamily:"Supercell",fontSize:"20px",color:"#FFFFFF"});v.setOrigin(0,.5),v.setStroke("#000000",4),v.setShadow(3,3,"#000000"),m.add(v),i.musicLabel=new Phaser.GameObjects.Text(i.scene,92,0,o.GameVars.gameText[o.GameVars.gameData.language].OFF,{fontFamily:"Supercell",fontSize:"20px",color:"#FFFFFF"}),i.musicLabel.setOrigin(.5),i.musicLabel.setStroke("#000000",4),i.musicLabel.setShadow(3,3,"#000000"),m.add(i.musicLabel);var y=new Phaser.GameObjects.Container(i.scene,0,290);i.settingsContainer.add(y);var _=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","btn_info");_.setInteractive({useHandCursor:!0}),_.on("pointerdown",i.onDownSoundsButton,i),_.on("pointerover",(function(){1===i.alpha&&y.setScale(1.025)}),i),g.on("pointerout",(function(){1===i.alpha&&y.setScale(1)}),i),y.add(_);var x=new Phaser.GameObjects.Text(i.scene,-130,0,o.GameVars.gameText[o.GameVars.gameData.language].SOUNDS,{fontFamily:"Supercell",fontSize:"20px",color:"#FFFFFF"});x.setOrigin(0,.5),x.setStroke("#000000",4),x.setShadow(3,3,"#000000"),y.add(x),i.soundsLabel=new Phaser.GameObjects.Text(i.scene,92,0,o.GameVars.gameText[o.GameVars.gameData.language].OFF,{fontFamily:"Supercell",fontSize:"20px",color:"#FFFFFF"}),i.soundsLabel.setOrigin(.5),i.soundsLabel.setStroke("#000000",4),i.soundsLabel.setShadow(3,3,"#000000"),y.add(i.soundsLabel),i.setAudioLabels(),i.setScale(.95*o.GameVars.scaleY),i.setAlpha(.7),i.scene.tweens.add({targets:i,scaleX:1,scaleY:o.GameVars.scaleY,alpha:1,ease:Phaser.Math.Easing.Cubic.Out,duration:250}),i.quitContainer=new Phaser.GameObjects.Container(i.scene,0,45),i.quitContainer.visible=!1,i.add(i.quitContainer);var E=new Phaser.GameObjects.Text(i.scene,0,-10,o.GameVars.gameText[o.GameVars.gameData.language].RESTART_GAME_QUESTION,{fontFamily:"Supercell",fontSize:"25px",color:"#FFFFFF",align:"center"});E.setOrigin(.5,-1.35),E.setStroke("#000000",6),E.setShadow(4,4,"#000000"),i.quitContainer.add(E);var T=new Phaser.GameObjects.Text(i.scene,0,-10,o.GameVars.gameText[o.GameVars.gameData.language].RESTART_GAME_SUBTITLE,{fontFamily:"Supercell",fontSize:"20px",color:"#FFFFFF",align:"center"});T.setOrigin(.5,-1.85),T.setStroke("#000000",6),T.setShadow(4,4,"#000000"),i.quitContainer.add(T);var w=new Phaser.GameObjects.Container(i.scene,-75,270);i.quitContainer.add(w);var S=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","btn_yellow_wide");S.setInteractive({useHandCursor:!0}),S.on("pointerover",(function(){w.setScale(1.025)})),S.on("pointerout",(function(){w.setScale(1)})),S.on("pointerdown",i.onDownNoButton,i),w.add(S);var b=new Phaser.GameObjects.Text(i.scene,0,0,o.GameVars.gameText[o.GameVars.gameData.language].RESTART_MENU_NO,{fontFamily:"Supercell",fontSize:"18px",color:"#FFFFFF"});b.setOrigin(.5),b.setStroke("#000000",6),b.setShadow(3,3,"#000000"),w.add(b);var A=new Phaser.GameObjects.Container(i.scene,75,270);i.quitContainer.add(A);var C=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","btn_red_wide");C.setInteractive({useHandCursor:!0}),C.on("pointerover",(function(){A.setScale(1.025)})),C.on("pointerout",(function(){A.setScale(1)})),C.on("pointerdown",i.onDownYesButton,i),A.add(C);var O=new Phaser.GameObjects.Text(i.scene,0,0,o.GameVars.gameText[o.GameVars.gameData.language].RESTART_MENU_YES,{fontFamily:"Supercell",fontSize:"18px",color:"#FFFFFF"});return O.setOrigin(.5),O.setStroke("#000000",6),O.setShadow(3,3,"#000000"),A.add(O),i}return s(e,t),e.prototype.onDownResetButton=function(){this.settingsContainer.visible=!1,this.quitContainer.visible=!0,r.AudioManager.playSoundEffect("btn_click")},e.prototype.onDownMusicButton=function(){r.AudioManager.toggleMusicState(),this.setAudioLabels(),r.AudioManager.playSoundEffect("btn_click")},e.prototype.onDownNoButton=function(){this.settingsContainer.visible=!0,this.quitContainer.visible=!1,r.AudioManager.playSoundEffect("btn_click")},e.prototype.onDownYesButton=function(){GAMESNACKS.gameOver(),a.GameManager.reset(),r.AudioManager.playSoundEffect("btn_click")},e.prototype.onDownSoundsButton=function(){r.AudioManager.toggleSoundState(),this.setAudioLabels(),r.AudioManager.playSoundEffect("btn_click")},e.prototype.setAudioLabels=function(){o.GameVars.gameData.musicMuted?(this.musicLabel.text=o.GameVars.gameText[o.GameVars.gameData.language].OFF,this.musicLabel.setColor("#FE0044")):(this.musicLabel.text=o.GameVars.gameText[o.GameVars.gameData.language].ON,this.musicLabel.setColor("#32CB00")),o.GameVars.gameData.soundMuted?(this.soundsLabel.text=o.GameVars.gameText[o.GameVars.gameData.language].OFF,this.soundsLabel.setColor("#FE0044")):(this.soundsLabel.text=o.GameVars.gameText[o.GameVars.gameData.language].ON,this.soundsLabel.setColor("#32CB00"))},e}(Phaser.GameObjects.Container);e.PauseMenu=c},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=function(t){function e(e,i,n,s,r,a,o){void 0===a&&(a=r);var h=t.call(this,e,i,n,s,r)||this;return o?(h.setInteractive(h.scene.input.makePixelPerfect(20)),h.setInteractive({pixelPerfect:!0})):h.setInteractive(),r!==a&&(h.on("pointerover",(function(){h.setFrame(a)}),h),h.on("pointerout",(function(){h.setFrame(r)}),h),h.on("pointerdown",(function(){h.setFrame(a)}),h),h.on("pointerup",(function(){h.setFrame(r)}),h)),h}return s(e,t),e.prototype.setInflationTween=function(t,e,i,n,s){var a=this;void 0===e&&(e=this.scaleX),void 0===i&&(i=this.scaleY),this.setScale(e,i),this.defaultScale={x:e,y:i},n&&(s||(s={ease:Phaser.Math.Easing.Cubic.Out,duration:200})),this.on("pointerover",(function(){n?a.scene.tweens.add({targets:[a],scaleX:a.defaultScale.x*t,scaleY:a.defaultScale.y*t,ease:s.ease,duration:s.duration}):a.setScale(a.defaultScale.x*t,a.defaultScale.y*t)}),this),this.on("pointerout",(function(){n?a.scene.tweens.add({targets:[a],scaleX:a.defaultScale.x,scaleY:a.defaultScale.y,ease:s.ease,duration:s.duration}):a.setScale(a.defaultScale.x,a.defaultScale.y)}),this),this.on("pointerdown",(function(){r.GameVars.isDesktop?a.setScale(a.defaultScale.x,a.defaultScale.y):a.setScale(a.defaultScale.x*t,a.defaultScale.y*t)}),this),this.on("pointerup",(function(){r.GameVars.isDesktop?a.setScale(a.defaultScale.x*t,a.defaultScale.y*t):a.setScale(a.defaultScale.x,a.defaultScale.y)}),this)},e.prototype.onUp=function(t,e){this.on("pointerup",t,e)},e.prototype.onDown=function(t,e){this.on("pointerdown",t,e)},e.prototype.onOver=function(t,e){this.on("pointerover",t,e)},e.prototype.onOut=function(t,e){this.on("pointerout",t,e)},e}(Phaser.GameObjects.Image);e.Button=a},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=function(t){function e(e,i){var n=t.call(this,e)||this;return n.img=new Phaser.GameObjects.Sprite(n.scene,0,0,"texture_atlas_4","bullet_fx_3"),n.scene.add.existing(n.img),n.img.setOrigin(.5,1),n.img.setScale(.25),n.add(n.img),n.glueBullet=i,n.visible=!1,n.x=n.glueBullet.x*r.GameConstants.CELLS_SIZE,n.y=n.glueBullet.y*r.GameConstants.CELLS_SIZE,n.initialPosition={x:n.x,y:n.y},n.f=0,n}return s(e,t),e.prototype.update=function(t,e){var i;i=r.GameConstants.INTERPOLATE_TRAJECTORIES?.3:1;var n=(this.glueBullet.x*r.GameConstants.CELLS_SIZE-(this.x+this.img.x))*i,s=(this.glueBullet.y*r.GameConstants.CELLS_SIZE-(this.y+this.img.y))*i;if(this.img.x+=n,this.img.y+=s,this.img.rotation=Math.atan2(s,n)+.5*Math.PI,!this.visible){var a=this.initialPosition.x-(this.x+this.img.x),o=this.initialPosition.y-(this.y+this.img.y);Math.sqrt(a*a+o*o)>20&&(this.visible=!0)}if(this.f++,this.f%6==0){var h=new Phaser.GameObjects.Sprite(this.scene,this.img.x,this.img.y,"texture_atlas_4");this.scene.add.existing(h),h.setScale(.1*Math.random()+.2),this.add(h),h.anims.play("snow_shoot"),h.on("animationcomplete",(function(){h.destroy()}),this)}},e.prototype.destroy=function(){var e=this;this.img.visible=!1,this.scene.time.addEvent({callback:function(){t.prototype.destroy.call(e)},delay:500,callbackScope:this})},e}(Phaser.GameObjects.Container);e.GlueBulletActor=a},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=i(9),o=i(3),h=i(0),u=i(1),c=function(t){function e(e){var i=t.call(this,e)||this,n=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","title_area");i.add(n),i.y=r.GameConstants.GAME_HEIGHT/2-200;var s=new Phaser.GameObjects.Text(i.scene,0,-10,h.GameVars.gameText[h.GameVars.gameData.language].ROUND_MINUS+o.BattleManager.engine.round+h.GameVars.gameText[h.GameVars.gameData.language].COMPLETE_MINUS,{fontFamily:"Supercell",fontSize:"25px",color:"#FFFFFF"});return s.setOrigin(.5),s.setStroke("#000000",6),s.setShadow(4,4,"#000000"),i.add(s),i.alpha=0,i.scene.tweens.add({targets:i,alpha:1,ease:Phaser.Math.Easing.Cubic.Out,duration:500}),i.scene.tweens.add({targets:i,alpha:0,ease:Phaser.Math.Easing.Cubic.Out,duration:500,delay:2e3,onComplete:function(){a.BoardContainer.currentInstance.hideRoundCompletedLayer()},onCOmpleteScope:i}),u.AudioManager.playSoundEffect("wave_complete"),i}return s(e,t),e}(Phaser.GameObjects.Container);e.RoundCompletedLayer=c},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=i(0),o=function(t){function e(e){var i=t.call(this,e)||this;i.y=r.GameConstants.CELLS_SIZE*a.GameVars.enemiesPathCells[a.GameVars.enemiesPathCells.length-1].r+r.GameConstants.CELLS_SIZE;for(var n=-2;n<15;n++){var s=new Phaser.GameObjects.Image(i.scene,n*r.GameConstants.CELLS_SIZE,0,"texture_atlas_4","wall");s.setOrigin(.5,1),i.add(s);for(var o=0;o<10;o++){var h=new Phaser.GameObjects.Image(i.scene,n*r.GameConstants.CELLS_SIZE,(o+1)*r.GameConstants.CELLS_SIZE,"texture_atlas_4","tile_castle");h.setOrigin(.5,1),i.add(h)}}return i}return s(e,t),e}(Phaser.GameObjects.Container);e.Walls=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(57),s=function(){function t(t,e){this.scene=t,this.scene=t,this.arrowActors=[];for(var i=0;i<e;i++){var s=new n.ArrowActor(this.scene);this.arrowActors.push(s)}}return t.prototype.getArrow=function(t){0===this.arrowActors.length&&this.increasePoolSize();var e=this.arrowActors.pop();return e.reset(t),e},t.prototype.onArrowRemovedFromBoard=function(t){this.arrowActors.push(t)},t.prototype.increasePoolSize=function(){for(var t=0;t<5;t++){var e=new n.ArrowActor(this.scene);this.arrowActors.push(e)}},t}();e.ArrowActorsPool=s},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=i(0),o=function(t){function e(e){var i=t.call(this,e,0,0,"texture_atlas_4")||this;return i.setOrigin(.5,0),i}return s(e,t),e.prototype.update=function(t,e){var i;i=r.GameConstants.INTERPOLATE_TRAJECTORIES?.3:1;var n=(this.bullet.x*r.GameConstants.CELLS_SIZE-this.realX)*i,s=(this.bullet.y*r.GameConstants.CELLS_SIZE-this.realY)*i;if(this.realX+=n,this.realY+=s,this.bullet.tick<=this.bullet.ticksToImpact?this.rotation=Math.atan2(s,n)+Math.PI/2:this.setScale(.75*this.scale),this.x=this.realX,this.y=this.realY,this.showInStage&&this.showInStage){var a=this.initialPosition.x-this.x,o=this.initialPosition.y-this.y;Math.sqrt(a*a+o*o)>45&&(this.visible=!0)}},e.prototype.reset=function(t){this.bullet=t,this.setFrame("archer_"+t.turret.grade+"_arrow"),this.visible=!1,this.setScale(1),this.x=this.bullet.x*r.GameConstants.CELLS_SIZE,this.y=this.bullet.y*r.GameConstants.CELLS_SIZE,this.realX=this.x,this.realY=this.y,this.initialPosition={x:this.x,y:this.y},8===a.GameVars.timeStepFactor?this.showInStage=!1:this.showInStage=!0},e}(Phaser.GameObjects.Image);e.ArrowActor=o},function(t,e,i){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var s=i(15),r=i(60),a=n(i(4)),o=function(){function t(t,e,i,n,a){this.scene=t,this.scene=t,this.enemyActors=[],this.healerEnemyActors=[],this.increasePoolDefault=n,this.increasePoolHealers=a;for(var o=0;o<e;++o)this.enemyActors.push(new s.EnemyActor(this.scene));for(o=0;o<i;++o)this.healerEnemyActors.push(new r.HealerEnemyActor(this.scene))}return t.prototype.getEnemy=function(t,e){var i;switch(t.type){case a.GameConstants.ENEMY_HEALER:0===this.healerEnemyActors.length&&this.increaseHealerActorsPoolSize();var n=this.healerEnemyActors.pop();n.reset(t,e),i=n;break;default:0===this.enemyActors.length&&this.increaseEnemyActorsPoolSize(),(i=this.enemyActors.pop()).reset(t,e)}return i},t.prototype.increaseHealerActorsPoolSize=function(){for(var t=0;t<this.increasePoolHealers;t++)this.healerEnemyActors.push(new r.HealerEnemyActor(this.scene))},t.prototype.increaseEnemyActorsPoolSize=function(){for(var t=0;t<this.increasePoolDefault;t++)this.enemyActors.push(new s.EnemyActor(this.scene))},t.prototype.onEnemyRemovedFromBoard=function(t){switch(t.isActive=!1,t.type){case a.GameConstants.ENEMY_HEALER:this.healerEnemyActors.push(t);break;default:this.enemyActors.push(t)}},t}();e.EnemyActorsPool=o},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(4),a=function(t){function e(e){var i=t.call(this,e)||this;return i.bar=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","life_bar_1"),i.bar.setOrigin(.5,0),i.add(i.bar),i.visible=!1,i}return s(e,t),e.prototype.reset=function(t,e){switch(this.totalLife=t,e){case r.GameConstants.ENEMY_SOLDIER:case r.GameConstants.ENEMY_RUNNER:case r.GameConstants.ENEMY_HEALER:this.y=-50;break;case r.GameConstants.ENEMY_BLOB:this.y=-65;break;case r.GameConstants.ENEMY_FLIER:this.y=-55}this.visible=!1},e.prototype.updateValue=function(t){var e=40-Math.round(t/this.totalLife*40);this.bar.setFrame("life_bar_"+Math.max(e,1))},e}(Phaser.GameObjects.Container);e.LifeBar=a},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e){return t.call(this,e)||this}return s(e,t),e.prototype.update=function(e,i){var n=this;t.prototype.update.call(this,e,i),this.creeptsEnemy.healing&&!this.healFx&&(this.healFx=new Phaser.GameObjects.Sprite(this.scene,0,0,"texture_atlas_3"),this.scene.add.existing(this.healFx),this.add(this.healFx),this.healFx.anims.play("heal"),this.healFx.on("animationcomplete",(function(){n.healFx.destroy(),n.healFx=null}),this))},e}(i(15).EnemyActor);e.HealerEnemyActor=r},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(62),a=i(63),o=i(3),h=i(0),u=i(2),c=i(1),l=i(8),d=function(t){function e(e){var i=t.call(this,e)||this;i.handCursor=null,i.pauseButtonTween=null,i.topContainer=new Phaser.GameObjects.Container(i.scene),i.topContainer.scaleY=h.GameVars.scaleY,i.add(i.topContainer),i.bottomContainer=new Phaser.GameObjects.Container(i.scene),i.bottomContainer.y=u.GameConstants.GAME_HEIGHT,i.bottomContainer.scaleY=h.GameVars.scaleY,i.add(i.bottomContainer),i.menuButton=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","btn_menu"),i.menuButton.setInteractive({useHandCursor:!0}),i.menuButton.setOrigin(0),i.menuButton.on("pointerdown",i.onClickMenu,i),i.menuButton.on("pointerover",(function(){h.GameVars.paused||h.GameVars.gameOver||i.onBtnOver(i.menuButton)})),i.menuButton.on("pointerout",(function(){h.GameVars.paused||h.GameVars.gameOver||i.onBtnOut(i.menuButton)})),i.topContainer.add(i.menuButton);var n=h.GameVars.currentMapData.path[0],s=h.GameVars.currentMapData.path[1],r=u.GameConstants.GAME_WIDTH/2,o=(u.GameConstants.GAME_HEIGHT/2-u.GameConstants.CELLS_SIZE/2)/h.GameVars.scaleY;return r-=u.GameConstants.CELLS_SIZE*h.GameVars.currentMapData.size.c/2*h.GameVars.scaleCorrectionFactor,o-=u.GameConstants.CELLS_SIZE*h.GameVars.currentMapData.size.r/2*h.GameVars.scaleCorrectionFactor,r+=(u.GameConstants.CELLS_SIZE*s.c+u.GameConstants.CELLS_SIZE/2)*h.GameVars.scaleCorrectionFactor,o+=(u.GameConstants.CELLS_SIZE*s.r+u.GameConstants.CELLS_SIZE/2)*h.GameVars.scaleCorrectionFactor,i.nextWaveButton=new Phaser.GameObjects.Image(i.scene,r,o,"texture_atlas_4",-1===n.r?"box_next_wave":"box_next_wave_side"),i.nextWaveButton.setInteractive({useHandCursor:!0}),i.nextWaveButton.setScale(-1!==n.r&&-1!==n.c?-1:1,1),i.nextWaveButton.on("pointerdown",i.onClickNextWave,i),i.nextWaveButton.on("pointerover",(function(){h.GameVars.paused||h.GameVars.gameOver||!h.GameVars.gameData.tutorialSeen||(i.nextWaveButton.setScale(-1!==n.r&&-1!==n.c?-1.1:1.1,1.1),i.nextWaveText.setScale(1.1))}),i),i.nextWaveButton.on("pointerout",(function(){h.GameVars.paused||h.GameVars.gameOver||(i.nextWaveButton.setScale(-1!==n.r&&-1!==n.c?-1:1,1),i.nextWaveText.setScale(1))}),i),i.topContainer.add(i.nextWaveButton),i.nextWaveText=new Phaser.GameObjects.Text(i.scene,r,o,h.GameVars.gameText[h.GameVars.gameData.language].NEXT_WAVE,{fontFamily:"Supercell",fontSize:"13px",color:"#FFFFFF",align:"center"}),i.nextWaveText.setOrigin(.5),i.nextWaveText.setStroke("#000000",4),i.nextWaveText.setShadow(3,3,"#000000"),i.nextWaveText.lineSpacing=-3,i.nextWaveText.setWordWrapWidth(50),i.topContainer.add(i.nextWaveText),-1===n.r?(i.nextWaveButton.y+=10*h.GameVars.scaleCorrectionFactor,i.nextWaveText.y+=14*h.GameVars.scaleCorrectionFactor):-1===n.c?(i.nextWaveButton.x+=18*h.GameVars.scaleCorrectionFactor,i.nextWaveText.x+=26*h.GameVars.scaleCorrectionFactor,i.nextWaveText.y-=2):(i.nextWaveButton.x-=18*h.GameVars.scaleCorrectionFactor,i.nextWaveText.x-=26*h.GameVars.scaleCorrectionFactor,i.nextWaveText.y-=2,i.nextWaveButton.scaleX=-1),i.createNextWaveTween(),i.pauseButton=new Phaser.GameObjects.Image(i.scene,u.GameConstants.GAME_WIDTH-186,0,"texture_atlas_4","btn_wave"),i.pauseButton.setOrigin(1),i.pauseButton.setInteractive({useHandCursor:!0}),i.pauseButton.on("pointerdown",i.onClickPause,i),i.pauseButton.on("pointerover",(function(){h.GameVars.gameOver||h.GameVars.paused||i.pauseButton.setFrame("btn_wave_on")})),i.pauseButton.on("pointerout",(function(){h.GameVars.gameOver||h.GameVars.paused||i.pauseButton.setFrame("btn_wave")})),i.bottomContainer.add(i.pauseButton),i.pauseImage=new Phaser.GameObjects.Image(i.scene,u.GameConstants.GAME_WIDTH-232,-35,"texture_atlas_4","icon_waves_4"),i.bottomContainer.add(i.pauseImage),i.timeStepButton=new Phaser.GameObjects.Image(i.scene,u.GameConstants.GAME_WIDTH-93,0,"texture_atlas_4","btn_wave"),i.timeStepButton.setOrigin(1),i.timeStepButton.setInteractive({useHandCursor:!0}),i.timeStepButton.on("pointerdown",i.onClickTimeStep,i),i.timeStepButton.on("pointerover",(function(){h.GameVars.paused||h.GameVars.gameOver||i.timeStepButton.setFrame("btn_wave_on")})),i.timeStepButton.on("pointerout",(function(){h.GameVars.paused||h.GameVars.gameOver||i.timeStepButton.setFrame("btn_wave")})),i.bottomContainer.add(i.timeStepButton),i.timeStepImage=new Phaser.GameObjects.Image(i.scene,u.GameConstants.GAME_WIDTH-139,-35,"texture_atlas_4","icon_x1"),i.bottomContainer.add(i.timeStepImage),i.autoButton=new Phaser.GameObjects.Image(i.scene,u.GameConstants.GAME_WIDTH,0,"texture_atlas_4","btn_wave"),i.autoButton.setOrigin(1),i.autoButton.setInteractive({useHandCursor:!0}),i.autoButton.on("pointerdown",(function(){h.GameVars.gameOver||h.GameVars.paused||i.onClickAuto()})),i.autoButton.on("pointerover",(function(){h.GameVars.gameOver||h.GameVars.paused||i.autoButton.setFrame("btn_wave_on")})),i.autoButton.on("pointerout",(function(){h.GameVars.gameOver||h.GameVars.paused||i.autoButton.setFrame("btn_wave")})),i.bottomContainer.add(i.autoButton),i.autoImage=new Phaser.GameObjects.Image(i.scene,u.GameConstants.GAME_WIDTH-47,-35,"texture_atlas_4","icon_waves_6"),i.bottomContainer.add(i.autoImage),h.GameVars.autoSendWave?i.autoImage.setFrame("icon_waves_5"):i.autoImage.setFrame("icon_waves_6"),i.turretButtonsContainer=new a.TurretButtonsContainer(i.scene),i.bottomContainer.add(i.turretButtonsContainer),i}return s(e,t),e.prototype.createTurret=function(t){this.turretSelected=new r.TurretSelected(this.scene,t,this),this.bottomContainer.add(this.turretSelected)},e.prototype.removeTurret=function(){this.bottomContainer.remove(this.turretSelected),this.turretSelected=null},e.prototype.activeNextWave=function(){!h.GameVars.gameData.tutorialSeen&&l.TutorialManager.hasFirstWaveBeenReleased||this.scene.tweens.add({targets:[this.nextWaveButton,this.nextWaveText],alpha:1,ease:Phaser.Math.Easing.Cubic.Out,duration:200})},e.prototype.onClickNextWave=function(){if(1===this.nextWaveButton.alpha&&!h.GameVars.paused&&!h.GameVars.gameOver){!l.TutorialManager.isFirstEnemyKilled&&this.handCursor&&(this.handCursor.destroy(),this.handCursor=null,l.TutorialManager.onFirstWaveReleased()),this.nextWaveButton.alpha=0,this.nextWaveText.alpha=0;var t=o.BattleManager.newWave();if(t>0){var e=new Phaser.GameObjects.Container(this.scene);e.x=this.nextWaveButton.x-20,e.y=this.nextWaveButton.y+5,this.topContainer.add(e);var i=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_4","info_icon_gold");i.setScale(.6),e.add(i);var n=new Phaser.GameObjects.Text(this.scene,i.x+12,i.y,h.GameVars.formatNumber(t),{fontFamily:"Supercell",fontSize:"20px",color:"#FFE734"});n.setOrigin(0,.5),n.setStroke("#B35B20",4),n.setShadow(1,1.5,"#700000",0,!0,!1),e.add(n),this.scene.tweens.add({targets:e,y:e.y-15,ease:Phaser.Math.Easing.Cubic.Out,duration:450,delay:150,onComplete:function(){this.scene.tweens.add({targets:e,alpha:0,ease:Phaser.Math.Easing.Cubic.Out,duration:250,onComplete:function(){e.destroy()},onCompleteScope:this})},onCompleteScope:this}),c.AudioManager.playSoundEffect("coins_emitted")}else c.AudioManager.playSoundEffect("btn_click")}},e.prototype.hideButtonsAtTutorialStart=function(){this.turretButtonsContainer.hideButtonsAtTutorialStart(),this.nextWaveButton.visible=!1,this.nextWaveText.visible=!1,this.pauseImage.visible=!1,this.timeStepImage.visible=!1,this.autoImage.visible=!1},e.prototype.showButtonsAfterTutorialCompletion=function(){this.timeStepImage.visible=!0,this.handCursor=new Phaser.GameObjects.Image(this.scene,this.timeStepImage.x,this.timeStepImage.y-50,"texture_atlas_4","hand_cursor"),this.handCursor.setOrigin(.2),this.handCursor.angle=-90,this.bottomContainer.add(this.handCursor),this.scene.tweens.add({targets:this.handCursor,y:this.handCursor.y-25,ease:Phaser.Math.Easing.Cubic.Out,duration:750,yoyo:!1,repeat:-1})},e.prototype.showNextWaveButtonInTutorial=function(){this.nextWaveButton.visible=!0,this.nextWaveText.visible=!0,this.handCursor=new Phaser.GameObjects.Image(this.scene,this.nextWaveButton.x+50,this.nextWaveButton.y,"texture_atlas_4","hand_cursor"),this.handCursor.setOrigin(.2),this.topContainer.add(this.handCursor);var t=this.handCursor.x+25;this.nextWaveButton.scaleX<0&&(this.handCursor.x=this.nextWaveButton.x-70,this.handCursor.scaleX=-1,t=this.handCursor.x-25),this.scene.tweens.add({targets:this.handCursor,x:t,ease:Phaser.Math.Easing.Cubic.Out,duration:750,yoyo:!1,repeat:-1})},e.prototype.onClickTimeStep=function(){1!==this.timeStepButton.alpha||h.GameVars.paused||h.GameVars.gameOver||!h.GameVars.gameData.tutorialSeen&&!l.TutorialManager.isSpeedControlShown||(1===h.GameVars.timeStepFactor?(o.BattleManager.setTimeStepFactor(4),this.timeStepImage.setFrame("icon_x2"),h.GameVars.gameData.tutorialSeen||l.TutorialManager.isTutoriallCompleted||l.TutorialManager.onSpeedX2()):4===h.GameVars.timeStepFactor?(o.BattleManager.setTimeStepFactor(8),this.timeStepImage.setFrame("icon_x3"),h.GameVars.gameData.tutorialSeen||l.TutorialManager.isTutoriallCompleted||l.TutorialManager.onSpeedX3()):(o.BattleManager.setTimeStepFactor(1),this.timeStepImage.setFrame("icon_x1"),h.GameVars.gameData.tutorialSeen||l.TutorialManager.isTutoriallCompleted||(this.handCursor.destroy(),this.handCursor=null,l.TutorialManager.onSpeedX1())))},e.prototype.onClickMenu=function(){h.GameVars.paused||h.GameVars.gameOver||!h.GameVars.gameData.tutorialSeen||(o.BattleManager.onClickMenu(),c.AudioManager.playSoundEffect("btn_click"))},e.prototype.createNextWaveTween=function(){var t=this,e=h.GameVars.waveOver,i=this.nextWaveButton.scaleY>1,n=this.nextWaveButton.scaleX<0?-1:1;this.scene.tweens.add({targets:this.nextWaveButton,scaleX:(i?1:e?1.2:1.1)*n,scaleY:i?1:e?1.2:1.1,ease:Phaser.Math.Easing.Cubic.Out,duration:e?250:600,onComplete:function(){t.createNextWaveTween()},onCompleteScope:this,yoyo:!0,delay:e?100:800}),this.scene.tweens.add({targets:this.nextWaveText,scaleX:i?1:e?1.2:1.1,scaleY:i?1:e?1.2:1.1,ease:Phaser.Math.Easing.Cubic.Out,duration:e?250:600,onCompleteScope:this,yoyo:!0,delay:e?100:800})},e.prototype.onClickPause=function(){h.GameVars.paused||h.GameVars.gameOver||!h.GameVars.gameData.tutorialSeen||(h.GameVars.semiPaused?(o.BattleManager.semiResume(),this.pauseImage.setFrame("icon_waves_4"),this.pauseButtonTween.remove(),this.pauseImage.alpha=1):(o.BattleManager.semiPause(),this.pauseImage.setFrame("icon_waves_1"),this.pauseButtonTween=this.scene.tweens.add({targets:this.pauseImage,alpha:.35,ease:Phaser.Math.Easing.Cubic.InOut,duration:600,repeat:-1,yoyo:!0})),c.AudioManager.playSoundEffect("btn_click"))},e.prototype.onClickAuto=function(){h.GameVars.gameData.tutorialSeen&&(h.GameVars.autoSendWave?(this.autoImage.setFrame("icon_waves_6"),o.BattleManager.setAutoSendWave(!1)):(this.autoImage.setFrame("icon_waves_5"),o.BattleManager.setAutoSendWave(!0)),c.AudioManager.playSoundEffect("btn_click"))},e.prototype.onBtnOver=function(t){t.setScale(1.1)},e.prototype.onBtnOut=function(t){t.setScale(1)},e}(Phaser.GameObjects.Container);e.GUI=d},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var a=i(3),o=i(2),h=i(0),u=r(i(4)),c=function(t){function e(e,i,n){var s,r,a=t.call(this,e)||this;a.prevWorldY=0,h.GameVars.isDesktop?a.offY=0:a.offY=-30,a.turretType=i,a.gui=n;var c=o.GameConstants.CELLS_SIZE,l=-20,d=0;switch(i){case u.GameConstants.TURRET_PROJECTILE:s="archer_1_base",r="archer_1_top",l=-30,c*=2.5,d=1.5*Math.PI;break;case u.GameConstants.TURRET_LASER:s="fire_1_base",r="fire_01",l=-55,c*=3.05;break;case u.GameConstants.TURRET_LAUNCH:s="cannon_1_base",r="cannon_1_top_19",l=-30,c*=2.5;break;case u.GameConstants.TURRET_GLUE:s="crystal_1_base",r="crystal_1_top_01",c*=1.5}a.base=new Phaser.GameObjects.Image(a.scene,0,-20,"texture_atlas_4",s),a.add(a.base),r&&(a.canon=new Phaser.GameObjects.Image(a.scene,0,l,"texture_atlas_4",r),a.canon.rotation=d,a.add(a.canon));var p=new Phaser.GameObjects.Image(a.scene,0,0,"texture_atlas_4","shoot_range");return p.setScale(2*c/p.width),a.add(p),a.scene.sys.updateList.add(a),a.scene.input.on("pointerup",(function(t){a.onPointerUp(t)}),a),a.scene.input.on("pointerdown",(function(t){a.onPointerMove(t)}),a),a.scene.input.on("pointermove",(function(t){a.onPointerMove(t)}),a),h.GameVars.turretSelectedOn=!0,a}return s(e,t),e.prototype.preUpdate=function(t,e){!this.scene.input.activePointer.isDown&&h.GameVars.turretSelectedOn&&this.onPointerUp(this.scene.input.activePointer)},e.prototype.onPointerMove=function(t){h.GameVars.isDesktop||(this.prevWorldY>o.GameConstants.GAME_HEIGHT/4&&t.worldY<=o.GameConstants.GAME_HEIGHT/4?this.offY=-60:this.prevWorldY<o.GameConstants.GAME_HEIGHT*(3/4)&&t.worldY>=o.GameConstants.GAME_HEIGHT*(3/4)&&(this.offY=60)),this.setPosition(t.x,(t.y+this.offY-o.GameConstants.GAME_HEIGHT)/h.GameVars.scaleY),this.prevWorldY=t.worldY;var e=(t.x-o.GameConstants.GAME_WIDTH/2)/h.GameVars.scaleCorrectionFactor+h.GameVars.currentMapData.size.c*o.GameConstants.CELLS_SIZE/2,i=(t.y+this.offY-o.GameConstants.GAME_HEIGHT/2+o.GameConstants.CELLS_SIZE/2)/(h.GameVars.scaleCorrectionFactor*h.GameVars.scaleY)+h.GameVars.currentMapData.size.r*o.GameConstants.CELLS_SIZE/2,n=Math.floor(e/o.GameConstants.CELLS_SIZE),s=Math.floor(i/o.GameConstants.CELLS_SIZE);a.BattleManager.setTurretPrePosition(n,s)},e.prototype.onPointerUp=function(t){var e=(t.x-o.GameConstants.GAME_WIDTH/2)/h.GameVars.scaleCorrectionFactor+h.GameVars.currentMapData.size.c*o.GameConstants.CELLS_SIZE/2,i=(t.y+this.offY-o.GameConstants.GAME_HEIGHT/2+o.GameConstants.CELLS_SIZE/2)/(h.GameVars.scaleCorrectionFactor*h.GameVars.scaleY)+h.GameVars.currentMapData.size.r*o.GameConstants.CELLS_SIZE/2,n=Math.floor(e/o.GameConstants.CELLS_SIZE),s=Math.floor(i/o.GameConstants.CELLS_SIZE);a.BattleManager.addTurretToScene(this.turretType,{r:s,c:n}),this.scene.input.removeAllListeners(),this.gui.removeTurret(),h.GameVars.turretSelectedOn=!1},e}(Phaser.GameObjects.Container);e.TurretSelected=c},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var a=i(64),o=r(i(4)),h=function(t){function e(e){var i=t.call(this,e)||this;i.y=-60,i.x=80,i.turretButtons=[];for(var n=[o.GameConstants.TURRET_PROJECTILE,o.GameConstants.TURRET_LASER,o.GameConstants.TURRET_LAUNCH,o.GameConstants.TURRET_GLUE],s=0;s<4;s++){var r=new a.TurretButton(i.scene,n[s],s);i.add(r),i.turretButtons.push(r)}return i}return s(e,t),e.prototype.hideButtonsAtTutorialStart=function(){for(var t=0;t<this.turretButtons.length;t++)this.turretButtons[t].name===o.GameConstants.TURRET_PROJECTILE?this.turretButtons[t].showHandCursor():this.turretButtons[t].hide()},e}(Phaser.GameObjects.Container);e.TurretButtonsContainer=h},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=i(3),o=i(0),h=i(1),u=i(8),c=function(t){function e(e,i,n){var s=t.call(this,e)||this;s.x=110*n,s.turretType=i,s.name=i,s.handCursor=null,s.backButton=new Phaser.GameObjects.Image(s.scene,0,0,"texture_atlas_4","btn_yellow_on"),s.add(s.backButton),s.button=new Phaser.GameObjects.Image(s.scene,s.x+80,r.GameConstants.GAME_HEIGHT-60*o.GameVars.scaleY,"texture_atlas_4","btn_yellow"),s.scene.add.existing(s.button),s.button.setInteractive({useHandCursor:!0}),s.button.scaleY=o.GameVars.scaleY,s.button.on("pointerdown",s.onDownTurret,s),s.button.on("pointerover",(function(){o.GameVars.gameOver||o.GameVars.paused||(s.setScale(1.05),s.button.setScale(1.05,1.05*o.GameVars.scaleY))}),s),s.button.on("pointerout",(function(){o.GameVars.gameOver||o.GameVars.paused||(s.setScale(1),s.button.setScale(1,o.GameVars.scaleY))}),s),s.maskShape=new Phaser.GameObjects.Graphics(s.scene),s.maskShape.x=s.x+80,s.maskShape.y=r.GameConstants.GAME_HEIGHT-60*o.GameVars.scaleY;s.base=new Phaser.GameObjects.Image(s.scene,0,27+[8,-12,0,-3][n],"texture_atlas_4",["archer_1_base","fire_1_base","cannon_1_base","crystal_1_base"][n]),s.base.setOrigin(.5,1),s.add(s.base);s.canon=new Phaser.GameObjects.Image(s.scene,0,27+[-65,-80,-73,-67][n],"texture_atlas_4",["archer_1_top","fire_01","cannon_1_top_19","crystal_1_top_01"][n]),s.canon.setOrigin(.5),s.add(s.canon),0===n&&(s.canon.rotation=1.5*Math.PI);var h=new Phaser.GameObjects.Image(s.scene,26,29,"texture_atlas_4","coin");return s.add(h),s.priceLabel=new Phaser.GameObjects.BitmapText(s.scene,8,30,"supercell-white",a.BattleManager.engine.turretData[s.turretType].price,17),s.priceLabel.setOrigin(1,.5),s.add(s.priceLabel),s.scene.sys.updateList.add(s),s}return s(e,t),e.prototype.preUpdate=function(t,e){if(a.BattleManager.engine.turretData[this.turretType].price>a.BattleManager.engine.credits){this.button.input.enabled=!1,this.setScale(1),this.button.setScale(1,o.GameVars.scaleY),this.priceLabel.setTexture("supercell-red"),this.maskShape.visible=!0;var i=a.BattleManager.engine.credits/a.BattleManager.engine.turretData[this.turretType].price;this.maskShape.clear(),this.maskShape.fillStyle(16711680,.5),this.maskShape.fillRect(-this.button.width/2,this.button.height/2*o.GameVars.scaleY,this.button.width,-this.button.height*i*o.GameVars.scaleY),this.button.setMask(this.maskShape.createGeometryMask())}else this.maskShape.visible=!1,this.button.input.enabled=!0,this.maskShape.scaleY=1,this.priceLabel.setTexture("supercell-white"),this.button.mask&&this.button.clearMask()},e.prototype.hide=function(){this.visible=!1,this.button.visible=!1},e.prototype.showHandCursor=function(){this.handCursor=new Phaser.GameObjects.Image(this.scene,50,-40,"texture_atlas_4","hand_cursor"),this.handCursor.setOrigin(.2),this.add(this.handCursor),this.scene.tweens.add({targets:this.handCursor,x:75,ease:Phaser.Math.Easing.Cubic.Out,duration:750,yoyo:!1,repeat:-1})},e.prototype.onDownTurret=function(){o.GameVars.paused||o.GameVars.gameOver||!o.GameVars.gameData.tutorialSeen&&u.TutorialManager.isTurretPlaced||(this.handCursor&&(this.handCursor.destroy(),this.handCursor=null,u.TutorialManager.onTurredSelected()),a.BattleManager.createTurret(this.turretType),h.AudioManager.playSoundEffect("btn_click"))},e}(Phaser.GameObjects.Container);e.TurretButton=c},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=i(3),o=function(t){function e(e){var i=t.call(this,e)||this;i.x=r.GameConstants.GAME_WIDTH-100,i.y=35;var n=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","box_small_2");n.setOrigin(0,.5),n.scaleX=3.5,i.add(n);var s=new Phaser.GameObjects.Image(i.scene,n.width*n.scaleX,0,"texture_atlas_4","box_small_1");return s.setOrigin(0,.5),i.add(s),i.lifesLabel=new Phaser.GameObjects.Text(i.scene,52,-1,a.BattleManager.engine.lifes.toString(),{fontFamily:"Supercell",fontSize:"22px",color:"#FFFFFF"}),i.lifesLabel.setOrigin(.5),i.lifesLabel.setStroke("#000000",4),i.lifesLabel.setShadow(3,3,"#000000"),i.add(i.lifesLabel),i.heartIcon=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","info_icon_life"),i.add(i.heartIcon),i}return s(e,t),e.prototype.onEnemyReachedExit=function(){this.heartIcon.setScale(1.25),this.scene.time.delayedCall(120,(function(){this.heartIcon.setScale(1)}),[],this)},e}(Phaser.GameObjects.Container);e.LifesContainer=o},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=i(3),o=i(0),h=function(t){function e(e){var i=t.call(this,e)||this;i.x=r.GameConstants.GAME_WIDTH/2+40,i.y=35;var n=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","box_small_2");n.setOrigin(0,.5),n.scaleX=10,i.add(n);var s=new Phaser.GameObjects.Image(i.scene,n.width*n.scaleX,0,"texture_atlas_4","box_small_1");return s.setOrigin(0,.5),i.add(s),i.text=new Phaser.GameObjects.Text(i.scene,n.width*n.scaleX/2+17,-2,o.GameVars.formatNumber(a.BattleManager.engine.credits),{fontFamily:"Supercell",fontSize:"22px",color:"#FFE734"}),i.text.setOrigin(.5),i.text.setStroke("#B35B20",4),i.add(i.text),i.coinIcon=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","info_icon_gold"),i.add(i.coinIcon),i}return s(e,t),e.prototype.onCoinsReachedEndPosition=function(){this.coinIcon.setScale(1.35),this.scene.time.delayedCall(80,(function(){this.coinIcon.setScale(1)}),[],this)},e}(Phaser.GameObjects.Container);e.CreditsContainer=h},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=i(2),o=i(3),h=function(t){function e(e){var i=t.call(this,e)||this,n=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","fx_enemy_traspass");n.setOrigin(1,0),n.setScale(a.GameConstants.GAME_HEIGHT/n.width,.5),n.setAngle(-90),i.add(n);var s=new Phaser.GameObjects.Image(i.scene,a.GameConstants.GAME_WIDTH,0,"texture_atlas_4","fx_enemy_traspass");s.setOrigin(1,0),s.setScale(a.GameConstants.GAME_HEIGHT/n.width,-.5),s.setAngle(-90),i.add(s);var h=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","fx_enemy_traspass");h.setOrigin(0),h.setScale(a.GameConstants.GAME_WIDTH/n.width,.5),i.add(h);var u=new Phaser.GameObjects.Image(i.scene,0,a.GameConstants.GAME_HEIGHT,"texture_atlas_4","fx_enemy_traspass");u.setOrigin(0),u.setScale(a.GameConstants.GAME_WIDTH/n.width,-.5),i.add(u);var c=1===r.GameVars.timeStepFactor?800:200;return o.BattleManager.engine.noEnemiesOnStage&&(c*=4),i.scene.tweens.add({targets:i,alpha:0,ease:Phaser.Math.Easing.Cubic.In,duration:c,onComplete:function(){this.destroy()},onCompleteScope:i}),i}return s(e,t),e}(Phaser.GameObjects.Container);e.FxEnemyTraspass=h},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var a=i(69),o=i(70),h=i(71),u=i(72),c=i(73),l=i(74),d=i(3),p=i(0),f=r(i(4)),m=i(1),g=i(2),v=function(t){function e(e){var i=t.call(this,e)||this;i.showingInfo=!1,i.bckMid=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","layout_box_3"),i.bckMid.scaleY=7.3,i.bckMid.alpha=.8,i.add(i.bckMid),i.bckTop=new Phaser.GameObjects.Image(i.scene,0,-i.bckMid.height/2*i.bckMid.scaleY,"texture_atlas_4","layout_box_2"),i.bckTop.setOrigin(.5,1),i.bckTop.alpha=.8,i.add(i.bckTop),i.bckBottom=new Phaser.GameObjects.Image(i.scene,0,i.bckMid.height/2*i.bckMid.scaleY,"texture_atlas_4","layout_box_4"),i.bckBottom.setOrigin(.5,0),i.bckBottom.alpha=.8,i.add(i.bckBottom),i.topContainer=new Phaser.GameObjects.Container(i.scene),i.topContainer.y=-200,i.add(i.topContainer),i.title=new Phaser.GameObjects.BitmapText(i.scene,0,0,"supercell-white",p.GameVars.turretsData[f.GameConstants.TURRET_PROJECTILE].name+" -"+p.GameVars.gameText[p.GameVars.gameData.language].LEVEL+"1/10",20),i.title.setOrigin(.5),i.topContainer.add(i.title),i.titleGreen=new Phaser.GameObjects.BitmapText(i.scene,i.title.x+i.title.width/2,0,"supercell-green",p.GameVars.gameText[p.GameVars.gameData.language].LEVEL+1+"/10",20),i.titleGreen.setOrigin(1,.5),i.topContainer.add(i.titleGreen),i.turrets=[],i.images=[];for(var n=0;n<3;n++){var s=new Phaser.GameObjects.Container(i.scene);s.setPosition(85*n-135,70),s.setScale(.8),i.topContainer.add(s),i.turrets.push(s);var r=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","archer_"+(n+1)+"_base");s.add(r),i.images.push(r);var a=void 0;(a=new Phaser.GameObjects.Image(i.scene,0,-10,"texture_atlas_4","archer_"+(n+1)+"_top")).angle=-90,s.add(a),i.images.push(a)}i.turrets[2].x+=10;var d=new Phaser.GameObjects.Image(i.scene,-92,70,"texture_atlas_4","icon_upgrade1");i.topContainer.add(d),d=new Phaser.GameObjects.Image(i.scene,-5,70,"texture_atlas_4","icon_upgrade2"),i.topContainer.add(d),i.infoBtn=new Phaser.GameObjects.Container(i.scene),i.infoBtn.setPosition(125,75),i.topContainer.add(i.infoBtn);var m=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","btn_base");m.setInteractive({useHandCursor:!0}),m.on("pointerdown",i.onDownShowInfo,i),m.on("pointerover",(function(){i.infoBtn.setScale(1.05)}),i),m.on("pointerout",(function(){i.infoBtn.setScale(1)}),i),i.infoBtn.add(m),i.infoText=new Phaser.GameObjects.Text(i.scene,0,0,p.GameVars.gameText[p.GameVars.gameData.language].SHOW_TURRET_INFO,{fontFamily:"Supercell",fontSize:"14px",color:"#FFFFFF",align:"center"}),i.infoText.setOrigin(.5),i.infoText.setStroke("#000000",4),i.infoText.setShadow(3,3,"#000000"),i.infoBtn.add(i.infoText),i.bottomContainer=new Phaser.GameObjects.Container(i.scene),i.bottomContainer.y=-20,i.add(i.bottomContainer),i.buttonLevelUp=new c.ButtonLevelUp(i.scene,-110,3),i.bottomContainer.add(i.buttonLevelUp),i.buttonUpgrade=new l.ButtonUpgrade(i.scene,0,3),i.bottomContainer.add(i.buttonUpgrade),i.buttonSell=new u.ButtonSell(i.scene,110,3),i.bottomContainer.add(i.buttonSell);var g=new Phaser.GameObjects.Graphics(i.scene);return g.setPosition(0,150),g.fillStyle(11184810,.35),g.fillRoundedRect(-165,-75,330,150,10),i.bottomContainer.add(g),i.buttonStrategy=new h.ButtonStrategy(i.scene,0,115),i.bottomContainer.add(i.buttonStrategy),i.buttonTarget=new o.ButtonTarget(i.scene,0,185),i.bottomContainer.add(i.buttonTarget),i.setScale(.875),i.setAlpha(.5),p.GameVars.gameData.tutorialSeen||(i.buttonUpgrade.visible=!1,i.buttonSell.visible=!1,i.infoBtn.visible=!1,m.visible=!1,i.infoText.visible=!1,i.buttonStrategy.visible=!1,i.buttonTarget.visible=!1),i.scene.sys.updateList.add(i),i}return s(e,t),e.prototype.preUpdate=function(t,e){null!=this.turret&&(d.BattleManager.engine.credits<this.turret.priceImprovement?this.buttonLevelUp.setInactiveButton():this.turret.level!==this.turret.maxLevel&&this.buttonLevelUp.setActiveButton(),d.BattleManager.engine.credits<this.turret.priceUpgrade?this.buttonUpgrade.setInactiveButton():3!==this.turret.grade&&this.buttonUpgrade.setActiveButton())},e.prototype.onDownShowInfo=function(){this.showingInfo?(this.infoText.setText(p.GameVars.gameText[p.GameVars.gameData.language].SHOW_TURRET_INFO),this.hideInfo()):(this.infoText.setText(p.GameVars.gameText[p.GameVars.gameData.language].HIDE_TURRET_INFO),this.showInfo()),this.showingInfo=!this.showingInfo,m.AudioManager.playSoundEffect("btn_click")},e.prototype.setTurretMenu=function(t){var e;switch(this.turret=t,this.turret.type){case f.GameConstants.TURRET_PROJECTILE:e="archer";break;case f.GameConstants.TURRET_LAUNCH:e="cannon";break;case f.GameConstants.TURRET_LASER:e="fire";break;case f.GameConstants.TURRET_GLUE:e="crystal"}for(var i=0,n=0;n<3;n++)this.images[i].setFrame(e+"_"+(n+1)+"_base"),this.images[i+1].visible=!0,this.turret.type===f.GameConstants.TURRET_PROJECTILE?(this.images[i+1].setFrame(e+"_"+(n+1)+"_top",!0,!0),this.images[i+1].y=-10,this.images[i+1].angle=-90):this.turret.type===f.GameConstants.TURRET_LAUNCH?1!=n?(this.images[i+1].setFrame(e+"_"+(n+1)+"_top_19",!0,!0),this.images[i+1].y=-10,this.images[i+1].angle=9):this.images[i+1].visible=!1:this.turret.type===f.GameConstants.TURRET_GLUE?(this.images[i+1].setFrame(e+"_"+(n+1)+"_top_01",!0,!0),this.images[i+1].y=0,this.images[i+1].angle=0):this.images[i+1].visible=!1,i+=2;this.buttonLevelUp.setTurretMenu(this),this.buttonSell.setTurretMenu(this),this.buttonStrategy.setTurretMenu(this),this.buttonTarget.setTurretMenu(this),this.buttonUpgrade.setTurretMenu(this),this.checkAndUpdateInfo(),this.showingInfo&&this.showInfo(),this.setScale(.875),this.setAlpha(.5),this.setPositionInBoard(),this.scene.tweens.add({targets:this,scaleX:1,scaleY:1,alpha:1,ease:Phaser.Math.Easing.Cubic.Out,duration:300})},e.prototype.clearTurretMenu=function(){null!=this.infoLayer&&this.hideInfo(),this.buttonLevelUp.clearTurretMenu(),this.buttonSell.clearTurretMenu(),this.buttonStrategy.clearTurretMenu(),this.buttonTarget.clearTurretMenu(),this.buttonUpgrade.clearTurretMenu(),this.turret=null},e.prototype.showInfo=function(){null!=this.turret&&(this.bckMid.scaleY=11.8,this.bckTop.y=-this.bckMid.height/2*this.bckMid.scaleY,this.bckBottom.y=this.bckMid.height/2*this.bckMid.scaleY,this.topContainer.y=-317,this.bottomContainer.y=95,this.infoLayer=new a.InfoLayer(this.scene,this),this.add(this.infoLayer))},e.prototype.hideInfo=function(){null!=this.turret&&(this.bckMid.scaleY=7.3,this.bckTop.y=-this.bckMid.height/2*this.bckMid.scaleY,this.bckBottom.y=this.bckMid.height/2*this.bckMid.scaleY,this.topContainer.y=-200,this.bottomContainer.y=-20,this.infoLayer.clearTurretMenu(),this.remove(this.infoLayer),this.infoLayer=null)},e.prototype.checkAndUpdateInfo=function(){if(null!=this.turret){this.title.setText(p.GameVars.turretsData[this.turret.type].name+" -"+p.GameVars.gameText[p.GameVars.gameData.language].LEVEL+this.turret.level+"/"+this.turret.maxLevel),this.titleGreen.setText(p.GameVars.gameText[p.GameVars.gameData.language].LEVEL+this.turret.level+"/"+this.turret.maxLevel),this.titleGreen.x=this.title.x+this.title.width/2,this.turret.type===f.GameConstants.TURRET_GLUE&&1===this.turret.grade||this.turret.type===f.GameConstants.TURRET_LAUNCH&&2===this.turret.grade?(this.buttonStrategy.setInactiveButton(),this.buttonTarget.setInactiveButton()):(this.buttonStrategy.setActiveButton(),this.buttonTarget.setActiveButton());for(var t=0;t<this.turrets.length;t++)this.turret.grade===t+1?this.turrets[t].alpha=1:this.turrets[t].alpha=.5;this.buttonLevelUp.priceLabel.setText(p.GameVars.formatNumber(this.turret.priceImprovement)),this.buttonUpgrade.priceLabel.setText(p.GameVars.formatNumber(this.turret.priceUpgrade)),this.buttonUpgrade.priceLabel.text.length>=6&&this.buttonUpgrade.priceLabel.setScale(.9);var e=p.GameVars.formatNumber(this.turret.sellValue);this.buttonSell.priceLabel.setText(e),e.length>=6&&this.buttonSell.priceLabel.setScale(.9),this.turret.level===this.turret.maxLevel?this.buttonLevelUp.setInactiveButton():this.buttonLevelUp.setActiveButton(),3===this.turret.grade?this.buttonUpgrade.setInactiveButton():this.buttonUpgrade.setActiveButton()}},e.prototype.resetInfo=function(){null!=this.turret&&this.infoLayer&&(this.infoLayer.destroy(),this.infoLayer=new a.InfoLayer(this.scene,this),this.add(this.infoLayer))},e.prototype.setPositionInBoard=function(){if(null!=this.turret){this.x=0,this.y=0;var t=Math.floor(this.turret.x),e=Math.floor(this.turret.y);t>=3&&t<=8&&e>=1&&e<=12&&(this.x=t<=5?3*g.GameConstants.CELLS_SIZE:-3*g.GameConstants.CELLS_SIZE)}},e}(Phaser.GameObjects.Container);e.TurretMenu=v},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var a=i(0),o=r(i(4)),h=function(t){function e(e,i){var n=t.call(this,e)||this;n.y=-190,n.turretMenu=i,n.incContainer=new Phaser.GameObjects.Container(n.scene);var s,r,h,u,c=0;return h=n.turretMenu.turret.type===o.GameConstants.TURRET_GLUE?3===n.turretMenu.turret.grade?90:60:n.turretMenu.turret.type===o.GameConstants.TURRET_LAUNCH?45:60,n.turretMenu.turret.type!==o.GameConstants.TURRET_GLUE?((s=new Phaser.GameObjects.Graphics(n.scene)).fillStyle(11184810,.35),s.fillRoundedRect(-160,c,320,40,5),n.add(s),r=new Phaser.GameObjects.Image(n.scene,-140,c+20,"texture_atlas_4","icon_damage"),n.add(r),(u=new Phaser.GameObjects.BitmapText(n.scene,-115,c+22,"supercell-white",a.GameVars.gameText[a.GameVars.gameData.language].DAMAGE+":",16)).setOrigin(0,.5),n.add(u),n.damageText=new Phaser.GameObjects.BitmapText(n.scene,75,c+22,"supercell-white",a.GameVars.formatNumber(n.turretMenu.turret.damage),16),n.damageText.setOrigin(1,.5),n.add(n.damageText),n.damageIncText=new Phaser.GameObjects.BitmapText(n.scene,148,c+22,"supercell-green","+"+a.GameVars.formatNumber(n.turretMenu.turret.nextDamage-n.turretMenu.turret.damage),16),n.damageIncText.setOrigin(1,.5),n.incContainer.add(n.damageIncText),0===n.turretMenu.turret.nextDamage&&(n.damageIncText.visible=!1),c+=h):3===n.turretMenu.turret.grade?((s=new Phaser.GameObjects.Graphics(n.scene)).fillStyle(11184810,.35),s.fillRoundedRect(-160,c,320,40,5),n.add(s),r=new Phaser.GameObjects.Image(n.scene,-140,c+20,"texture_atlas_4","icon_distance_teleport"),n.add(r),(u=new Phaser.GameObjects.BitmapText(n.scene,-120,c+22,"supercell-white",a.GameVars.gameText[a.GameVars.gameData.language].DISTANCE+":",16)).setOrigin(0,.5),n.add(u),n.distanceText=new Phaser.GameObjects.BitmapText(n.scene,75,c+22,"supercell-white",a.GameVars.formatNumber(n.turretMenu.turret.teleportDistance),16),n.distanceText.setOrigin(1,.5),n.add(n.distanceText),n.distanceIncText=new Phaser.GameObjects.BitmapText(n.scene,148,c+22,"supercell-green","+"+a.GameVars.formatNumber(a.GameVars.fixNumber(n.turretMenu.turret.nextTeleportDistance-n.turretMenu.turret.teleportDistance)),16),n.distanceIncText.setOrigin(1,.5),n.incContainer.add(n.distanceIncText),c+=h):((s=new Phaser.GameObjects.Graphics(n.scene)).fillStyle(11184810,.35),s.fillRoundedRect(-160,c,320,40,5),n.add(s),r=new Phaser.GameObjects.Image(n.scene,-140,c+20,"texture_atlas_4","icon_intensity"),n.add(r),(u=new Phaser.GameObjects.BitmapText(n.scene,-115,c+22,"supercell-white","Intensity:",16)).setOrigin(0,.5),n.add(u),n.intensityText=new Phaser.GameObjects.BitmapText(n.scene,75,c+20,"supercell-white",a.GameVars.formatNumber(n.turretMenu.turret.intensity),16),n.intensityText.setOrigin(1,.5),n.add(n.intensityText),n.intensityIncText=new Phaser.GameObjects.BitmapText(n.scene,148,c+20,"supercell-green","+"+a.GameVars.formatNumber(a.GameVars.fixNumber(n.turretMenu.turret.nextIntensity-n.turretMenu.turret.intensity)),16),n.intensityIncText.setOrigin(1,.5),n.incContainer.add(n.intensityIncText),c+=h,(s=new Phaser.GameObjects.Graphics(n.scene)).fillStyle(11184810,.35),s.fillRoundedRect(-160,c,320,40,5),n.add(s),r=new Phaser.GameObjects.Image(n.scene,-140,c+20,"texture_atlas_4","icon_duration"),n.add(r),(u=new Phaser.GameObjects.BitmapText(n.scene,-115,c+22,"supercell-white","Duration:",16)).setOrigin(0,.5),n.add(u),n.durationText=new Phaser.GameObjects.BitmapText(n.scene,75,c+22,"supercell-white",a.GameVars.formatNumber(n.turretMenu.turret.duration),16),n.durationText.setOrigin(1,.5),n.add(n.durationText),n.durationIncText=new Phaser.GameObjects.BitmapText(n.scene,148,c+20,"supercell-green","+"+a.GameVars.formatNumber(a.GameVars.fixNumber(n.turretMenu.turret.nextDuration-n.turretMenu.turret.duration)),16),n.durationIncText.setOrigin(1,.5),n.incContainer.add(n.durationIncText),c+=h),(s=new Phaser.GameObjects.Graphics(n.scene)).fillStyle(11184810,.35),s.fillRoundedRect(-160,c,320,40,5),n.add(s),r=new Phaser.GameObjects.Image(n.scene,-140,c+20,"texture_atlas_4","icon_reload"),n.add(r),(u=new Phaser.GameObjects.BitmapText(n.scene,-115,c+22,"supercell-white","Reload:",16)).setOrigin(0,.5),n.add(u),n.reloadText=new Phaser.GameObjects.BitmapText(n.scene,75,c+22,"supercell-white",a.GameVars.formatNumber(n.turretMenu.turret.reload),16),n.reloadText.setOrigin(1,.5),n.add(n.reloadText),n.reloadIncText=new Phaser.GameObjects.BitmapText(n.scene,148,c+22,"supercell-green",a.GameVars.formatNumber(a.GameVars.fixNumber(n.turretMenu.turret.nextReload-n.turretMenu.turret.reload)),16),n.reloadIncText.setOrigin(1,.5),n.incContainer.add(n.reloadIncText),0===n.turretMenu.turret.nextReload&&(n.reloadIncText.visible=!1),c+=h,(s=new Phaser.GameObjects.Graphics(n.scene)).fillStyle(11184810,.35),s.fillRoundedRect(-160,c,320,40,5),n.add(s),r=new Phaser.GameObjects.Image(n.scene,-140,c+20,"texture_atlas_4","icon_range"),n.add(r),(u=new Phaser.GameObjects.BitmapText(n.scene,-115,c+22,"supercell-white",a.GameVars.gameText[a.GameVars.gameData.language].RANGE+":",16)).setOrigin(0,.5),n.add(u),n.rangeText=new Phaser.GameObjects.BitmapText(n.scene,75,c+22,"supercell-white",a.GameVars.formatNumber(n.turretMenu.turret.range),16),n.rangeText.setOrigin(1,.5),n.add(n.rangeText),n.rangeIncText=new Phaser.GameObjects.BitmapText(n.scene,148,c+22,"supercell-green","+"+a.GameVars.formatNumber(a.GameVars.fixNumber(n.turretMenu.turret.nextRange-n.turretMenu.turret.range)),16),n.rangeIncText.setOrigin(1,.5),n.incContainer.add(n.rangeIncText),0===n.turretMenu.turret.nextRange&&(n.rangeIncText.visible=!1),n.turretMenu.turret.type===o.GameConstants.TURRET_LAUNCH&&(c+=h,(s=new Phaser.GameObjects.Graphics(n.scene)).fillStyle(11184810,.35),s.fillRoundedRect(-160,c,320,40,5),n.add(s),r=new Phaser.GameObjects.Image(n.scene,-140,c+20,"texture_atlas_4","icon_explossion_range"),n.add(r),(u=new Phaser.GameObjects.BitmapText(n.scene,-115,c+22,"supercell-white","E."+a.GameVars.gameText[a.GameVars.gameData.language].RANGE+":",16)).setOrigin(0,.5),n.add(u),n.explosionRangeText=new Phaser.GameObjects.BitmapText(n.scene,75,c+22,"supercell-white",a.GameVars.formatNumber(n.turretMenu.turret.explosionRange),16),n.explosionRangeText.setOrigin(1,.5),n.add(n.explosionRangeText),n.explosionRangeIncText=new Phaser.GameObjects.BitmapText(n.scene,148,c+22,"supercell-green","+"+a.GameVars.formatNumber(a.GameVars.fixNumber(n.turretMenu.turret.nextExplosionRange-n.turretMenu.turret.explosionRange)),16),n.explosionRangeIncText.setOrigin(1,.5),n.incContainer.add(n.explosionRangeIncText),0===n.turretMenu.turret.nextExplosionRange&&(n.explosionRangeIncText.visible=!1)),n.turretMenu.turret.type!==o.GameConstants.TURRET_GLUE&&(c+=h,(s=new Phaser.GameObjects.Graphics(n.scene)).fillStyle(11184810,.35),s.fillRoundedRect(-160,c,320,40,5),n.add(s),r=new Phaser.GameObjects.Image(n.scene,-140,c+20,"texture_atlas_4","icon_inflicted"),n.add(r),(u=new Phaser.GameObjects.BitmapText(n.scene,-115,c+22,"supercell-white",a.GameVars.gameText[a.GameVars.gameData.language].INFLICTED+":",16)).setOrigin(0,.5),n.add(u),n.inflictedText=new Phaser.GameObjects.BitmapText(n.scene,148,c+22,"supercell-white",a.GameVars.formatNumber(n.turretMenu.turret.inflicted),16),n.inflictedText.setOrigin(1,.5),n.add(n.inflictedText)),n.add(n.incContainer),n.scaleY=.9,n.scene.tweens.add({targets:n,scaleY:1,ease:Phaser.Math.Easing.Cubic.Out,duration:250}),n.scene.sys.updateList.add(n),n}return s(e,t),e.prototype.clearTurretMenu=function(){this.turretMenu=null},e.prototype.preUpdate=function(t,e){null!=this.turretMenu&&(this.turretMenu.turret.type!==o.GameConstants.TURRET_GLUE?(this.damageText.setText(a.GameVars.formatNumber(this.turretMenu.turret.damage)),this.damageIncText.setText("+"+a.GameVars.formatNumber(this.turretMenu.turret.nextDamage-this.turretMenu.turret.damage)),this.inflictedText.setText(a.GameVars.formatNumber(this.turretMenu.turret.inflicted))):3===this.turretMenu.turret.grade?this.distanceText&&(this.distanceText.setText(a.GameVars.formatNumber(this.turretMenu.turret.teleportDistance)),this.distanceIncText.setText("+"+a.GameVars.formatNumber(a.GameVars.fixNumber(this.turretMenu.turret.nextTeleportDistance-this.turretMenu.turret.teleportDistance)))):(this.intensityText.setText(a.GameVars.formatNumber(this.turretMenu.turret.intensity)),this.intensityIncText.setText("+"+a.GameVars.formatNumber(a.GameVars.fixNumber(this.turretMenu.turret.nextIntensity-this.turretMenu.turret.intensity))),this.durationText.setText(a.GameVars.formatNumber(this.turretMenu.turret.duration)),this.durationIncText.setText("+"+a.GameVars.formatNumber(a.GameVars.fixNumber(this.turretMenu.turret.nextDuration-this.turretMenu.turret.duration)))),this.reloadText.setText(a.GameVars.formatNumber(this.turretMenu.turret.reload)),this.reloadIncText.setText(a.GameVars.formatNumber(a.GameVars.fixNumber(this.turretMenu.turret.nextReload-this.turretMenu.turret.reload))),this.rangeText.setText(a.GameVars.formatNumber(this.turretMenu.turret.range)),this.rangeIncText.setText("+"+a.GameVars.formatNumber(a.GameVars.fixNumber(this.turretMenu.turret.nextRange-this.turretMenu.turret.range))),this.turretMenu.turret.type===o.GameConstants.TURRET_LAUNCH&&(this.explosionRangeText.setText(a.GameVars.formatNumber(this.turretMenu.turret.explosionRange)),this.explosionRangeIncText.setText("+"+a.GameVars.formatNumber(a.GameVars.fixNumber(this.turretMenu.turret.nextExplosionRange-this.turretMenu.turret.explosionRange)))),this.turretMenu.turret.level===this.turretMenu.turret.maxLevel?this.incContainer.visible=!1:this.incContainer.visible=!0)},e}(Phaser.GameObjects.Container);e.InfoLayer=h},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(3),a=i(1),o=i(0),h=function(t){function e(e,i,n){var s=t.call(this,e)||this;s.x=i,s.y=n,s.button=new Phaser.GameObjects.Image(s.scene,0,0,"texture_atlas_4","btn_info"),s.button.setInteractive({useHandCursor:!0}),s.button.on("pointerdown",s.onDownButton,s),s.button.on("pointerover",(function(){1===s.alpha&&s.setScale(1.025)}),s),s.button.on("pointerout",(function(){1===s.alpha&&s.setScale(1)}),s),s.add(s.button);var r=new Phaser.GameObjects.Text(s.scene,-130,0,o.GameVars.gameText[o.GameVars.gameData.language].TARGET,{fontFamily:"Supercell",fontSize:"20px",color:"#FFFFFF"});return r.setOrigin(0,.5),r.setStroke("#000000",4),r.setShadow(3,3,"#000000"),s.add(r),s.textResult=new Phaser.GameObjects.Text(s.scene,92,0,o.GameVars.gameText[o.GameVars.gameData.language].FIXED,{fontFamily:"Supercell",fontSize:"18px",color:"#FFFFFF"}),s.textResult.setOrigin(.5),s.textResult.setStroke("#000000",4),s.textResult.setShadow(3,3,"#000000"),s.add(s.textResult),s}return s(e,t),e.prototype.setTurretMenu=function(t){this.turretMenu=t,this.textResult.text=this.turretMenu.turret.fixedTarget?o.GameVars.gameText[o.GameVars.gameData.language].FIXED:o.GameVars.gameText[o.GameVars.gameData.language].UNFIXED},e.prototype.clearTurretMenu=function(){this.turretMenu=null},e.prototype.setInactiveButton=function(){null!=this.turretMenu&&(this.button.disableInteractive(),this.alpha=.5,this.textResult.setText(""))},e.prototype.setActiveButton=function(){null!=this.turretMenu&&(this.button.setInteractive({useHandCursor:!0}),this.alpha=1,this.textResult.setText(this.turretMenu.turret.fixedTarget?o.GameVars.gameText[o.GameVars.gameData.language].FIXED:o.GameVars.gameText[o.GameVars.gameData.language].UNFIXED))},e.prototype.onDownButton=function(){1===this.alpha&&null!=this.turretMenu&&(r.BattleManager.setFixedTarget(this.turretMenu.turret.id),this.textResult.setText(this.turretMenu.turret.fixedTarget?o.GameVars.gameText[o.GameVars.gameData.language].FIXED:o.GameVars.gameText[o.GameVars.gameData.language].UNFIXED),a.AudioManager.playSoundEffect("btn_click"))},e}(Phaser.GameObjects.Container);e.ButtonTarget=h},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var a=r(i(4)),o=i(3),h=i(1),u=i(0),c=function(t){function e(e,i,n){var s=t.call(this,e)||this;s.x=i,s.y=n,s.button=new Phaser.GameObjects.Image(s.scene,0,0,"texture_atlas_4","btn_info"),s.button.setInteractive({useHandCursor:!0}),s.button.on("pointerdown",s.onDownButton,s),s.button.on("pointerover",(function(){1===s.alpha&&s.setScale(1.025)}),s),s.button.on("pointerout",(function(){1===s.alpha&&s.setScale(1)}),s),s.add(s.button);var r=new Phaser.GameObjects.Text(s.scene,-130,0,u.GameVars.gameText[u.GameVars.gameData.language].STRATEGY,{fontFamily:"Supercell",fontSize:"20px",color:"#FFFFFF"});return r.setOrigin(0,.5),r.setStroke("#000000",4),r.setShadow(3,3,"#000000"),s.add(r),s.textResult=new Phaser.GameObjects.Text(s.scene,92,0,"text",{fontFamily:"Supercell",fontSize:"20px",color:"#FFFFFF"}),s.textResult.setOrigin(.5),s.textResult.setStroke("#000000",4),s.textResult.setShadow(3,3,"#000000"),s.add(s.textResult),s}return s(e,t),e.prototype.setTurretMenu=function(t){this.turretMenu=t;var e=this.turretMenu.turret.shootingStrategy;this.textResult.text=e.charAt(0).toUpperCase()+e.slice(1)},e.prototype.clearTurretMenu=function(){this.turretMenu=null},e.prototype.setInactiveButton=function(){null!=this.turretMenu&&(this.button.disableInteractive(),this.alpha=.5,this.textResult.setText(""))},e.prototype.setActiveButton=function(){if(null!=this.turretMenu){this.button.setInteractive({useHandCursor:!0});var t=this.turretMenu.turret.shootingStrategy;this.alpha=1,this.textResult.setText(t.charAt(0).toUpperCase()+t.slice(1))}},e.prototype.onDownButton=function(){if(1===this.alpha&&null!=this.turretMenu){o.BattleManager.setNextStrategy(this.turretMenu.turret.id);var t=this.turretMenu.turret.shootingStrategy;this.textResult.setText(t.charAt(0).toUpperCase()+t.slice(1)),this.turretMenu.turret.shootingStrategy===a.GameConstants.STRATEGY_SHOOT_CLOSEST?this.textResult.setFontSize(18):this.turretMenu.turret.shootingStrategy===a.GameConstants.STRATEGY_SHOOT_WEAKEST?this.textResult.setFontSize(16):this.turretMenu.turret.shootingStrategy===a.GameConstants.STRATEGY_SHOOT_STRONGEST?this.textResult.setFontSize(13):this.textResult.setFontSize(20),h.AudioManager.playSoundEffect("btn_click")}},e}(Phaser.GameObjects.Container);e.ButtonStrategy=c},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(3),a=i(0),o=i(1),h=function(t){function e(e,i,n){var s=t.call(this,e)||this;s.x=i,s.y=n,s.button=new Phaser.GameObjects.Image(s.scene,0,0,"texture_atlas_4","btn_yellow"),s.button.setInteractive({useHandCursor:!0}),s.button.on("pointerdown",s.onDownButton,s),s.button.on("pointerover",(function(){s.setScale(1.05)}),s),s.button.on("pointerout",(function(){s.setScale(1)}),s),s.add(s.button);var r=new Phaser.GameObjects.Text(s.scene,0,-34,"Sell",{fontFamily:"Supercell",fontSize:"14px",color:"#FFFFFF"});r.setOrigin(.5),r.setStroke("#000000",4),r.setShadow(3,3,"#000000"),s.add(r);var o=new Phaser.GameObjects.Image(s.scene,0,0,"texture_atlas_4","icon_sell");return s.add(o),s.priceLabel=new Phaser.GameObjects.BitmapText(s.scene,-2,36,"supercell-white",a.GameVars.formatNumber(10),17),s.priceLabel.setOrigin(.5),s.priceLabel.text.length>=6&&s.priceLabel.setScale(.9),s.add(s.priceLabel),s}return s(e,t),e.prototype.setTurretMenu=function(t){this.turretMenu=t},e.prototype.clearTurretMenu=function(){this.turretMenu=null},e.prototype.onDownButton=function(){null!=this.turretMenu&&(r.BattleManager.sellTurret(this.turretMenu.turret.id),o.AudioManager.playSoundEffect("btn_click"))},e}(Phaser.GameObjects.Container);e.ButtonSell=h},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=i(3),o=i(1),h=i(8),u=i(6),c=function(t){function e(e,i,n){var s=t.call(this,e)||this;s.x=i,s.y=n,s.button=new Phaser.GameObjects.Image(s.scene,0,0,"texture_atlas_4","btn_yellow"),s.button.setInteractive({useHandCursor:!0}),s.button.on("pointerdown",s.onDownButton,s),s.button.on("pointerover",(function(){1===s.alpha&&s.setScale(1.05)}),s),s.button.on("pointerout",(function(){1===s.alpha&&s.setScale(1)}),s),s.add(s.button);var a=new Phaser.GameObjects.Text(s.scene,0,-34,r.GameVars.gameText[r.GameVars.gameData.language].LEVEL_UP,{fontFamily:"Supercell",fontSize:"14px",color:"#FFFFFF"});a.setOrigin(.5),a.setStroke("#000000",4),a.setShadow(3,3,"#000000"),s.add(a);var o=new Phaser.GameObjects.Image(s.scene,0,0,"texture_atlas_4","icon_lvl_up");return s.add(o),s.priceLabel=new Phaser.GameObjects.BitmapText(s.scene,0,36,"supercell-white",r.GameVars.formatNumber(10),17),s.priceLabel.setOrigin(.5),s.add(s.priceLabel),r.GameVars.gameData.tutorialSeen?s.handCursor=null:(s.handCursor=new Phaser.GameObjects.Image(s.scene,50,-15,"texture_atlas_4","hand_cursor"),s.handCursor.setOrigin(.2),s.add(s.handCursor),s.scene.tweens.add({targets:s.handCursor,x:75,ease:Phaser.Math.Easing.Cubic.Out,duration:750,yoyo:!1,repeat:-1})),s}return s(e,t),e.prototype.setTurretMenu=function(t){this.turretMenu=t},e.prototype.clearTurretMenu=function(){this.turretMenu=null},e.prototype.setInactiveButton=function(){null!=this.turretMenu&&(this.alpha=.5,this.turretMenu.turret.level===this.turretMenu.turret.maxLevel?this.priceLabel.visible=!1:this.priceLabel.setTexture("supercell-red"))},e.prototype.setActiveButton=function(){null!=this.turretMenu&&(this.alpha=1,this.priceLabel.visible=!0,this.priceLabel.setTexture("supercell-white"))},e.prototype.onDownButton=function(){1===this.alpha&&null!=this.turretMenu&&(this.setScale(1),a.BattleManager.improveTurret(this.turretMenu.turret.id),this.turretMenu.checkAndUpdateInfo(),r.GameVars.gameData.tutorialSeen||(this.handCursor.destroy(),h.TutorialManager.onTurretUpgraded()),u.BattleScene.currentInstance.boardContainer.getTurretActorByID(this.turretMenu.turret.id).showLevel(),o.AudioManager.playSoundEffect("btn_click"))},e}(Phaser.GameObjects.Container);e.ButtonLevelUp=c},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=i(3),o=i(6),h=function(t){function e(e,i,n){var s=t.call(this,e)||this;s.x=i,s.y=n,s.button=new Phaser.GameObjects.Image(s.scene,0,0,"texture_atlas_4","btn_yellow"),s.button.setInteractive({useHandCursor:!0}),s.button.on("pointerdown",s.onDownButton,s),s.button.on("pointerover",(function(){1===s.alpha&&s.setScale(1.05)}),s),s.button.on("pointerout",(function(){1===s.alpha&&s.setScale(1)}),s),s.add(s.button);var a=new Phaser.GameObjects.Text(s.scene,0,-34,r.GameVars.gameText[r.GameVars.gameData.language].UPGRADE,{fontFamily:"Supercell",fontSize:"13px",color:"#FFFFFF"});a.setOrigin(.5),a.setStroke("#000000",4),a.setShadow(3,3,"#000000"),s.add(a);var o=new Phaser.GameObjects.Image(s.scene,0,0,"texture_atlas_4","icon_upgrade1");return s.add(o),s.priceLabel=new Phaser.GameObjects.BitmapText(s.scene,-2,36,"supercell-white",r.GameVars.formatNumber(10),17),s.priceLabel.setOrigin(.5),s.priceLabel.text.length>=6&&s.priceLabel.setScale(.9),s.add(s.priceLabel),s}return s(e,t),e.prototype.setTurretMenu=function(t){this.turretMenu=t},e.prototype.clearTurretMenu=function(){this.turretMenu=null},e.prototype.setInactiveButton=function(){null!=this.turretMenu&&(this.alpha=.5,3===this.turretMenu.turret.grade?this.priceLabel.visible=!1:this.priceLabel.setTexture("supercell-red"))},e.prototype.setActiveButton=function(){null!=this.turretMenu&&(this.alpha=1,this.priceLabel.visible=!0,this.priceLabel.setTexture("supercell-white"))},e.prototype.onDownButton=function(){1===this.alpha&&null!=this.turretMenu&&(this.setScale(1),a.BattleManager.upgradeTower(this.turretMenu.turret.id),this.turretMenu.checkAndUpdateInfo(),this.turretMenu.resetInfo(),o.BattleScene.currentInstance.boardContainer.getTurretActorByID(this.turretMenu.turret.id).showLevel())},e}(Phaser.GameObjects.Container);e.ButtonUpgrade=h},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(7),a=i(3),o=i(0),h=i(76),u=i(17),c=i(2),l=i(1),d=function(t){function e(e){var i=t.call(this,e)||this,n=new Phaser.GameObjects.Graphics(i.scene);n.fillStyle(0,.5),n.fillRect(0,0,c.GameConstants.GAME_WIDTH,c.GameConstants.GAME_HEIGHT),i.add(n);var s=new Phaser.GameObjects.Container(i.scene);s.x=c.GameConstants.GAME_WIDTH/2,s.y=c.GameConstants.GAME_HEIGHT/2,s.scaleY=o.GameVars.scaleY,i.add(s);var r=new Phaser.GameObjects.Graphics(i.scene);r.fillStyle(0,.75),r.fillRoundedRect(-180,-200,360,400,10),r.lineStyle(3,11337722),r.strokeRoundedRect(-180,-200,360,400,10),s.add(r);var l=new h.MenuTitle(i.scene,o.GameVars.gameText[o.GameVars.gameData.language].GAME_OVER);l.setPosition(0,-200),s.add(l);var d=new Phaser.GameObjects.Container(i.scene,0,130);s.add(d);var p=new Phaser.GameObjects.Text(i.scene,0,-130,o.GameVars.gameText[o.GameVars.gameData.language].BEST_SCORE,{fontFamily:"Supercell",fontSize:"22px",color:"#FFE734"});p.setOrigin(.5),p.setStroke("#B35B20",4),p.setShadow(1,2,"#700000",0,!0,!1),s.add(p);var f=new u.Score(i.scene);f.setPosition(-137,-70),s.add(f);var m=new Phaser.GameObjects.Text(i.scene,0,-10,o.GameVars.gameText[o.GameVars.gameData.language].ROUND+o.GameVars.formatNumber(a.BattleManager.engine.round),{fontFamily:"Supercell",fontSize:"22px",color:"#FFFFFF"});m.setOrigin(.5),m.setStroke("#000000",5),m.setShadow(3,3,"#000000"),s.add(m);var g=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","btn_yellow_wide");g.setInteractive({useHandCursor:!0}),g.on("pointerover",(function(){d.setScale(1.025)})),g.on("pointerout",(function(){d.setScale(1)})),g.on("pointerdown",(function(){i.onRestartDown()})),d.add(g),i.scene.tweens.add({targets:d,scaleX:1.035,scaleY:1.035,ease:Phaser.Math.Easing.Cubic.InOut,duration:350,yoyo:!0,repeat:-1});var v=new Phaser.GameObjects.Text(i.scene,0,0,o.GameVars.gameText[o.GameVars.gameData.language].OK,{fontFamily:"Supercell",fontSize:"22px",color:"#FFFFFF"});return v.setOrigin(.5),v.setStroke("#663333",6),v.setShadow(3,3,"#663333"),d.add(v),i.alpha=0,i.scene.tweens.add({targets:i,alpha:1,ease:Phaser.Math.Easing.Cubic.Out,duration:500}),i}return s(e,t),e.prototype.onRestartDown=function(){r.GameManager.enterBattleScene(),l.AudioManager.playSoundEffect("btn_click")},e}(Phaser.GameObjects.Container);e.GameOverLayer=d},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=function(t){function e(i,n){var s=t.call(this,i)||this;s.setSize(e.WIDTH,e.HEIGHT);var a=new Phaser.GameObjects.Image(s.scene,0,0,"texture_atlas_1","banner_red");s.add(a);var o=new Phaser.GameObjects.Text(s.scene,0,-10,r.GameVars.gameText[r.GameVars.gameData.language].GAME_OVER,{fontFamily:"Supercell",fontSize:"30px",color:"#FFFFFF"});return o.setOrigin(.5),o.setStroke("#000000",6),o.setShadow(4,4,"#000000"),s.add(o),s}return s(e,t),e.WIDTH=360,e.HEIGHT=70,e}(Phaser.GameObjects.Container);e.MenuTitle=a},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=i(0),o=i(1),h=i(8),u=function(t){function e(e){var i=t.call(this,e)||this;i.scaledItemsContainer=new Phaser.GameObjects.Container(i.scene),i.scaledItemsContainer.x=r.GameConstants.GAME_WIDTH/2,i.scaledItemsContainer.y=r.GameConstants.GAME_HEIGHT/2,i.scaledItemsContainer.scaleY=a.GameVars.scaleY,i.add(i.scaledItemsContainer);var n=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","layout_box_3");n.setOrigin(.5),n.setScale(1.25,3.125),i.scaledItemsContainer.add(n);var s=new Phaser.GameObjects.Image(i.scene,0,-n.height*n.scaleY*.5,"texture_atlas_4","layout_box_2");s.setOrigin(.5,1),s.setScale(1.25),i.scaledItemsContainer.add(s);var o=new Phaser.GameObjects.Image(i.scene,0,n.height*n.scaleY*.5,"texture_atlas_4","layout_box_4");return o.setOrigin(.5,0),o.setScale(1.25),i.scaledItemsContainer.add(o),i.tutorialText=new Phaser.GameObjects.Text(i.scene,0,0,"",{fontFamily:"Supercell",fontSize:"20px",color:"#FFFFFF",align:"center"}),i.tutorialText.setOrigin(.5),i.tutorialText.setStroke("#000000",8),i.tutorialText.setShadow(3,3,"#000000"),i.scaledItemsContainer.add(i.tutorialText),i.ribbon=new Phaser.GameObjects.Image(i.scene,0,-120,"texture_atlas_4","title_area"),i.ribbon.setScale(1.35,1.15),i.scaledItemsContainer.add(i.ribbon),i.textRibbon=new Phaser.GameObjects.Text(i.scene,0,-130,"",{fontFamily:"Supercell",fontSize:"24px",color:"#FFFFFF",align:"center"}),i.textRibbon.setOrigin(.5),i.textRibbon.setStroke("#000000",8),i.textRibbon.setShadow(3,3,"#000000"),i.scaledItemsContainer.add(i.textRibbon),i.alpha=0,i}return s(e,t),e.prototype.hide=function(){this.scene.tweens.add({targets:this,alpha:0,duration:400})},e.prototype.show=function(t,e){var i=this;if(e?(this.ribbon.visible=!0,this.textRibbon.text=e,this.tutorialText.y=15):(this.ribbon.visible=!1,this.textRibbon.visible=!1,this.tutorialText.y=0),t.length<36?this.tutorialText.setFontSize(28):t.length<56?this.tutorialText.setFontSize(24):this.tutorialText.setFontSize(20),this.tutorialText.text=t,this.alpha=0,this.scene.tweens.add({targets:this,alpha:1,duration:400}),this.skipButtonContainer&&this.skipButtonContainer.destroy(),!h.TutorialManager.isTurretPlaced){this.skipButtonContainer=new Phaser.GameObjects.Container(this.scene,130,195),this.skipButtonContainer.visible=!1,this.scaledItemsContainer.add(this.skipButtonContainer),this.scene.time.delayedCall(1500,(function(){this.skipButtonContainer.visible=!0}),[],this);var n=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_1","btn_play_void");n.setInteractive({useHandCursor:!0}),n.on("pointerover",(function(){i.skipButtonContainer.setScale(1.025)})),n.on("pointerout",(function(){i.skipButtonContainer.setScale(1)})),n.on("pointerdown",(function(){i.onPlayDown()})),this.skipButtonContainer.add(n);var s=new Phaser.GameObjects.Text(this.scene,0,0,a.GameVars.gameText[a.GameVars.gameData.language].TUTORIAL_SKIP,{fontFamily:"Supercell",fontSize:"18px",color:"#FFFFFF",align:"center"});s.setOrigin(.5),s.setStroke("#663333",8),s.setShadow(5,5,"#663333"),this.skipButtonContainer.add(s)}},e.prototype.showFinalMenu=function(t){var e=this;t.length<16&&this.textRibbon.setFontSize(30),this.ribbon.visible=!0,this.textRibbon.text=t,this.textRibbon.visible=!0,this.tutorialText.visible=!1;var i=new Phaser.GameObjects.Container(this.scene,0,35);this.scaledItemsContainer.add(i),this.scene.tweens.add({targets:i,scaleX:1.035,scaleY:1.035,ease:Phaser.Math.Easing.Cubic.InOut,duration:350,yoyo:!0,repeat:-1});var n=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_4","btn_yellow_wide");n.setInteractive({useHandCursor:!0}),n.on("pointerover",(function(){i.setScale(1.025)})),n.on("pointerout",(function(){i.setScale(1)})),n.on("pointerdown",(function(){e.onPlayDown()})),i.add(n);var s=new Phaser.GameObjects.Text(this.scene,0,0,a.GameVars.gameText[a.GameVars.gameData.language].PLAY,{fontFamily:"Supercell",fontSize:"22px",color:"#FFFFFF"});s.setOrigin(.5),s.setStroke("#663333",6),s.setShadow(3,3,"#663333"),i.add(s),this.alpha=0,this.scene.tweens.add({targets:this,alpha:1,duration:400}),o.AudioManager.playSoundEffect("title_appears")},e.prototype.onPlayDown=function(){h.TutorialManager.onTutorialOver(),o.AudioManager.playSoundEffect("btn_click")},e}(Phaser.GameObjects.Container);e.TutorialLayer=u},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(79),s=function(){function t(t,e){this.scene=t,this.scene=t,this.coinsEffects=[],this.coinsEffectsOnStage=[];for(var i=0;i<e;i++){var s=new n.CoinsEffect(this.scene);this.coinsEffects.push(s)}}return t.prototype.update=function(){for(var t=0;t<this.coinsEffectsOnStage.length;t++)this.coinsEffectsOnStage[t].update()},t.prototype.getCoinsEffect=function(t,e,i){0===this.coinsEffects.length&&this.increasePoolSize();var n=this.coinsEffects.pop();return n.reset(t,e,i),this.coinsEffectsOnStage.push(n),n},t.prototype.onCoinsEffectRemoved=function(t){var e=this.coinsEffectsOnStage.indexOf(t);this.coinsEffectsOnStage.splice(e,1),this.coinsEffects.push(t)},t.prototype.increasePoolSize=function(){for(var t=0;t<5;t++){var e=new n.CoinsEffect(this.scene);this.coinsEffects.push(e)}},t}();e.CoinsEffectPool=s},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=i(0),o=i(16),h=i(1),u=i(6),c=function(t){function e(e){var i=t.call(this,e)||this;i.visible=!1,i.endPx=.5*r.GameConstants.GAME_WIDTH+35,i.endPy=32*a.GameVars.scaleY,i.coins=[];for(var n=0;n<12;n++){var s=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_4","coin");s.visible=!1,i.add(s),i.coins.push({coin:s,f:30+Math.floor(35*Math.random()),levitatingSpeed:.3+.5*Math.random(),smoothFactor:.01+.0125*Math.random()})}return i}return s(e,t),e.prototype.update=function(){if(this.visible){this.f++;for(var t=0,e=0;e<this.n;e++){var i=this.coins[e].coin,n=this.coins[e].f,s=this.coins[e].levitatingSpeed;if(this.f<n){e%2==0?i.x+=s:i.x-=s,i.y-=.5*s*a.GameVars.scaleY;var r=i.scaleX;r<1&&(r+=.075),i.setScale(r,r*a.GameVars.scaleY)}else{this.coins[e].smoothFactor*=1.075;var c=(this.endPx-i.x)*this.coins[e].smoothFactor,l=(this.endPy-i.y)*this.coins[e].smoothFactor;t+=Math.abs(this.endPx-i.x)+Math.abs(this.endPy-i.y),i.x+=c,i.y+=l,i.alpha*=.975}}this.f>50&&t<50&&!this.areCoinsCloseToEndPosition&&(this.areCoinsCloseToEndPosition=!0,o.HUD.currentInstance.onCoinsReachedEndPosition(),h.AudioManager.playSoundEffect("coins_collected")),this.f>50&&t<2.5&&u.BattleScene.currentInstance.onCoinsRemoved(this)}},e.prototype.reset=function(t,e,i){this.visible=!0,this.f=0,this.areCoinsCloseToEndPosition=!1,this.n=i<=10?4:i<=15?6:i<=20?8:12;for(var n=0;n<this.coins.length;n++){var s=this.coins[n].coin;s.x=t+12-24*Math.random(),s.y=e+20-30*Math.random(),s.setScale(0),s.alpha=1,s.visible=n<this.n,this.coins[n].smoothFactor=.02+.02*Math.random(),8===a.GameVars.timeStepFactor&&(this.coins[n].smoothFactor*=3)}h.AudioManager.playSoundEffect("coins_emitted")},e}(Phaser.GameObjects.Container);e.CoinsEffect=c},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(7),a=i(0),o=function(t){function e(){return t.call(this,"BootScene")||this}return s(e,t),e.prototype.preload=function(){this.load.atlas("texture_atlas_0","assets/texture_atlas_0.png","assets/texture_atlas_0.json")},e.prototype.create=function(){(this.add.text(-100,-100,"abcdefg",{fontFamily:"Supercell",fontSize:28,color:"#A6F834"}),r.GameManager.setCurrentScene(this),a.GameVars.isDesktop=window.innerWidth>window.innerHeight,a.GameVars.isDesktop)?r.GameManager.init():window.innerWidth<window.innerHeight?(e.bootedInWrongOrientation=!1,r.GameManager.init()):(e.bootedInWrongOrientation=!0,document.getElementById("orientation").style.display="block",document.getElementById("content").style.display="none")},e}(Phaser.Scene);e.BootScene=o},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(7),a=i(1),o=i(2),h=i(0),u=i(18),c=function(t){function e(){var i=t.call(this,"PreloadScene")||this;return e.currentInstance=i,i}return s(e,t),e.prototype.preload=function(){this.composeScene(),this.loadAssets()},e.prototype.create=function(){this.loadHowl()},e.prototype.composeScene=function(){this.add.text(-100,-100,"abcdefg",{fontFamily:"Supercell",fontSize:28,color:"#A6F834"}),this.add.text(-100,-100,"abcdefg",{fontFamily:"Oswald-SemiBold",fontSize:28,color:"#A6F834"});var t=new u.GameTitle(this);t.x=o.GameConstants.GAME_WIDTH/2+14,t.alpha=0,t.y=160*h.GameVars.scaleY,this.add.existing(t),this.tweens.add({targets:t,alpha:1,ease:Phaser.Math.Easing.Cubic.Out,duration:1e3});var e=this.add.container(o.GameConstants.GAME_WIDTH/2,o.GameConstants.GAME_HEIGHT/2+130*h.GameVars.scaleY);e.scaleY=h.GameVars.scaleY;var i=new Phaser.GameObjects.Graphics(this);i.fillStyle(89728),i.fillRect(0,0,456,22),i.x=-228,i.y=-3,e.add(i);var n=new Phaser.GameObjects.Graphics(this);n.fillStyle(5592405),n.fillRect(0,0,450,16),n.x=-225,e.add(n),this.progressBar=new Phaser.GameObjects.Graphics(this),this.progressBar.fillStyle(16777215),this.progressBar.fillRect(0,0,450,16),this.progressBar.x=-225,this.progressBar.scaleX=0,e.add(this.progressBar)},e.prototype.loadAssets=function(){this.load.atlas("texture_atlas_1","assets/texture_atlas_1.png","assets/texture_atlas_1.json"),this.load.json("game-text","assets/config/text.json"),this.load.bitmapFont("supercell-white","assets/fonts/supercell-white.png","assets/fonts/supercell-white.xml"),this.load.bitmapFont("supercell-green","assets/fonts/supercell-green.png","assets/fonts/supercell-green.xml"),this.load.bitmapFont("supercell-red","assets/fonts/supercell-red.png","assets/fonts/supercell-red.xml"),this.load.json("sound","assets/audio/sound.json"),this.load.json("music","assets/audio/music.json"),this.load.on("progress",this.updateLoadedPercentage,this)},e.prototype.updateLoadedPercentage=function(t){this.progressBar.scaleX<t&&(this.progressBar.scaleX=t)},e.prototype.loadHowl=function(){var t=this.cache.json.get("music");t=JSON.parse(JSON.stringify(t).replace("urls","src")),a.AudioManager.music=new Howl(t),a.AudioManager.music.on("load",(function(){var t=e.currentInstance.cache.json.get("sound");t=JSON.parse(JSON.stringify(t).replace("urls","src")),a.AudioManager.sound=new Howl(t),a.AudioManager.sound.on("load",(function(){r.GameManager.setCurrentScene(e.currentInstance),e.currentInstance.scene.setVisible(!1),r.GameManager.onGameAssetsLoaded()}))}))},e}(Phaser.Scene);e.PreloadScene=c},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(7),a=i(0),o=i(2),h=i(1),u=function(t){function e(e){var i=t.call(this,e)||this,n=new Phaser.GameObjects.Image(i.scene,0,40,"texture_atlas_1","box_results");i.add(n);var s=new Phaser.GameObjects.Text(i.scene,0,20,a.GameVars.gameText[a.GameVars.gameData.language].BEST_SCORE,{fontFamily:"Supercell",fontSize:"16px",color:"#FFE734"});s.setOrigin(.5),s.setStroke("#B35B20",4),s.setShadow(1,2,"#700000",0,!0,!1),i.add(s);var r=new Phaser.GameObjects.Text(i.scene,0,54,a.GameVars.formatNumber(a.GameVars.gameData.scores[a.GameVars.currentMapId]),{fontFamily:"Supercell",fontSize:"25px",color:"#FFE734"});if(r.setOrigin(.5),r.setStroke("#B35B20",6),r.setShadow(2,3,"#700000",0,!0,!1),i.add(r),i.timeText=new Phaser.GameObjects.Text(i.scene,-150,120,a.GameVars.gameText[a.GameVars.gameData.language].NEW_MAP_IN+"\n ",{fontFamily:"Supercell",fontSize:"18px",color:"#6ceeff",align:"center"}),i.timeText.setOrigin(0,.5),i.timeText.setStroke("#30608f",5),i.timeText.setShadow(2,2,"#1d3956",0,!0,!1),i.add(i.timeText),o.GameConstants.LEADERBOARD_ENABLED){var h=new Phaser.GameObjects.Image(i.scene,220,40,"texture_atlas_1","btn_leaderboards");h.setInteractive({useHandCursor:!0}),h.on("pointerover",(function(){h.setScale(1.025)})),h.on("pointerout",(function(){h.setScale(1)})),h.on("pointerdown",(function(){i.onLeaderboardDown()})),i.add(h),i.scene.time.addEvent({callback:function(){i.scene.tweens.add({targets:h,scaleX:1.05,scaleY:1.05,ease:Phaser.Math.Easing.Cubic.InOut,duration:350,yoyo:!0})},delay:5e3,loop:!0,callbackScope:i})}return i.scene.sys.updateList.add(i),i}return s(e,t),e.prototype.preUpdate=function(t,e){var i=r.GameManager.getTimeUntilEndOfDay(),n=Math.floor(i/3600);i%=3600;var s=Math.floor(i/60),o=i%60;this.timeText.setText(a.GameVars.gameText[a.GameVars.gameData.language].NEW_MAP_IN+" "+n+"h "+s+"m "+o+"s\n ")},e.prototype.onLeaderboardDown=function(){h.AudioManager.playSoundEffect("btn_click")},e}(Phaser.GameObjects.Container);e.ResultsLayer=u},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=i(0),o=function(t){function e(e){var i=t.call(this,e)||this;i.setScale(.4),i.y=85,i.boardMatrix=new Array(a.GameVars.currentMapData.size.r);for(var n=0;n<i.boardMatrix.length;n++)i.boardMatrix[n]=new Array(a.GameVars.currentMapData.size.c).fill(2);for(n=0;n<a.GameVars.plateausCells.length;n++)i.boardMatrix[a.GameVars.plateausCells[n].r][a.GameVars.plateausCells[n].c]=0;for(n=0;n<a.GameVars.enemiesPathCells.length;n++)a.GameVars.enemiesPathCells[n].c<0||a.GameVars.enemiesPathCells[n].r<0||a.GameVars.enemiesPathCells[n].c>=a.GameVars.currentMapData.size.c||a.GameVars.enemiesPathCells[n].r>=a.GameVars.currentMapData.size.r||(i.boardMatrix[a.GameVars.enemiesPathCells[n].r][a.GameVars.enemiesPathCells[n].c]=1);i.renderTexture=new Phaser.GameObjects.RenderTexture(i.scene,-r.GameConstants.CELLS_SIZE*a.GameVars.currentMapData.size.c/2,-r.GameConstants.CELLS_SIZE*a.GameVars.currentMapData.size.r/2,r.GameConstants.CELLS_SIZE*a.GameVars.currentMapData.size.c,r.GameConstants.CELLS_SIZE*a.GameVars.currentMapData.size.r),i.add(i.renderTexture);for(n=0;n<i.boardMatrix.length;n++)for(var s=0;s<i.boardMatrix[n].length;s++)if(1===i.boardMatrix[n][s]){var o=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_1","cell_dirt");i.renderTexture.draw(o,r.GameConstants.CELLS_SIZE*s+r.GameConstants.CELLS_SIZE/2,r.GameConstants.CELLS_SIZE*n+r.GameConstants.CELLS_SIZE/2),i.addPathShadows(n,s)}else{o=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_1",n%2==0&&s%2==0||n%2==1&&s%2==1?"cell_grass_1":"cell_grass_2");i.renderTexture.draw(o,r.GameConstants.CELLS_SIZE*s+r.GameConstants.CELLS_SIZE/2,r.GameConstants.CELLS_SIZE*n+r.GameConstants.CELLS_SIZE/2)}for(n=0;n<a.GameVars.obstaclesBoard.length;n++)for(s=0;s<a.GameVars.obstaclesBoard[0].length;s++){var h=s-1,u=n-8;if(10===a.GameVars.obstaclesBoard[n][s]){o=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_1","cell_water_01");i.renderTexture.draw(o,r.GameConstants.CELLS_SIZE*h+r.GameConstants.CELLS_SIZE/2,r.GameConstants.CELLS_SIZE*u+r.GameConstants.CELLS_SIZE/2)}else if(0!==a.GameVars.obstaclesBoard[n][s]){(o=new Phaser.GameObjects.Image(i.scene,r.GameConstants.CELLS_SIZE*h+r.GameConstants.CELLS_SIZE/2,r.GameConstants.CELLS_SIZE*u+r.GameConstants.CELLS_SIZE,"texture_atlas_1","obstacle_0"+a.GameVars.obstaclesBoard[n][s])).setOrigin(.5,1),i.renderTexture.draw(o)}}var c=new Phaser.GameObjects.Graphics(i.scene);c.lineStyle(5,2565966),c.strokeRect(-r.GameConstants.CELLS_SIZE*a.GameVars.currentMapData.size.c/2,-r.GameConstants.CELLS_SIZE*a.GameVars.currentMapData.size.r/2,r.GameConstants.CELLS_SIZE*a.GameVars.currentMapData.size.c,r.GameConstants.CELLS_SIZE*a.GameVars.currentMapData.size.r+3),i.add(c);var l=new Phaser.GameObjects.Image(i.scene,0,0,"texture_atlas_1","gradient");return l.setOrigin(.5,1),l.y=r.GameConstants.CELLS_SIZE*a.GameVars.currentMapData.size.r/2,l.scaleX=r.GameConstants.CELLS_SIZE*a.GameVars.currentMapData.size.c/l.width,l.scaleY=4,l.alpha=.8,i.add(l),i}return s(e,t),e.prototype.addPathShadows=function(t,e){if(0===e||1!==this.boardMatrix[t][e-1]){var i=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_1","shadow_side");this.renderTexture.draw(i,r.GameConstants.CELLS_SIZE*e+r.GameConstants.CELLS_SIZE/2,r.GameConstants.CELLS_SIZE*t+r.GameConstants.CELLS_SIZE/2)}0!==t&&1===this.boardMatrix[t-1][e]||((i=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_1","shadow_side")).setAngle(90),this.renderTexture.draw(i,r.GameConstants.CELLS_SIZE*e+r.GameConstants.CELLS_SIZE/2,r.GameConstants.CELLS_SIZE*t+r.GameConstants.CELLS_SIZE/2));e!==this.boardMatrix[0].length-1&&1===this.boardMatrix[t][e+1]||((i=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_1","shadow_side")).setAngle(180),this.renderTexture.draw(i,r.GameConstants.CELLS_SIZE*e+r.GameConstants.CELLS_SIZE/2,r.GameConstants.CELLS_SIZE*t+r.GameConstants.CELLS_SIZE/2));t!==this.boardMatrix.length-1&&1===this.boardMatrix[t+1][e]||((i=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_1","shadow_side")).setAngle(270),this.renderTexture.draw(i,r.GameConstants.CELLS_SIZE*e+r.GameConstants.CELLS_SIZE/2,r.GameConstants.CELLS_SIZE*t+r.GameConstants.CELLS_SIZE/2));if(0!==e&&t!==this.boardMatrix.length-1&&1!==this.boardMatrix[t+1][e-1]&&1===this.boardMatrix[t][e-1]&&1===this.boardMatrix[t+1][e]){var i=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_1","shadow_corner");this.renderTexture.draw(i,r.GameConstants.CELLS_SIZE*e+r.GameConstants.CELLS_SIZE/2,r.GameConstants.CELLS_SIZE*t+r.GameConstants.CELLS_SIZE/2)}0!==e&&0!==t&&1!==this.boardMatrix[t-1][e-1]&&1===this.boardMatrix[t][e-1]&&1===this.boardMatrix[t-1][e]&&((i=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_1","shadow_corner")).setAngle(90),this.renderTexture.draw(i,r.GameConstants.CELLS_SIZE*e+r.GameConstants.CELLS_SIZE/2,r.GameConstants.CELLS_SIZE*t+r.GameConstants.CELLS_SIZE/2));e!==this.boardMatrix[0].length-1&&0!==t&&1!==this.boardMatrix[t-1][e+1]&&1===this.boardMatrix[t][e+1]&&1===this.boardMatrix[t-1][e]&&((i=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_1","shadow_corner")).setAngle(180),this.renderTexture.draw(i,r.GameConstants.CELLS_SIZE*e+r.GameConstants.CELLS_SIZE/2,r.GameConstants.CELLS_SIZE*t+r.GameConstants.CELLS_SIZE/2));e!==this.boardMatrix[0].length-1&&t!==this.boardMatrix.length-1&&1!==this.boardMatrix[t+1][e+1]&&1===this.boardMatrix[t][e+1]&&1===this.boardMatrix[t+1][e]&&((i=new Phaser.GameObjects.Image(this.scene,0,0,"texture_atlas_1","shadow_corner")).setAngle(270),this.renderTexture.draw(i,r.GameConstants.CELLS_SIZE*e+r.GameConstants.CELLS_SIZE/2,r.GameConstants.CELLS_SIZE*t+r.GameConstants.CELLS_SIZE/2))},e}(Phaser.GameObjects.Container);e.SplashMapPreview=o}]); //# sourceMappingURL=bundle.js.map
| ver. 1.4 |
Github
|
.
| PHP 8.2.29 | Генераци� �траницы: 0.14 |
proxy
|
phpinfo
|
�а�тройка