},c.Point.interpolate=function(a,b,d,e){return"undefined"==typeofe&&(e=newc.Point),e.setTo(a.x+(b.x-a.x)*d,a.y+(b.y-a.y)*d)},c.Point.perp=function(a,b){return"undefined"==typeofb&&(b=newc.Point),b.setTo(-a.y,a.x)},c.Point.rperp=function(a,b){return"undefined"==typeofb&&(b=newc.Point),b.setTo(a.y,-a.x)},c.Point.distance=function(a,b,d){vare=c.Math.distance(a.x,a.y,b.x,b.y);returnd?Math.round(e):e},c.Point.project=function(a,b,d){"undefined"==typeofd&&(d=newc.Point);vare=a.dot(b)/b.getMagnitudeSq();return0!==e&&d.setTo(e*b.x,e*b.y),d},c.Point.projectUnit=function(a,b,d){"undefined"==typeofd&&(d=newc.Point);vare=a.dot(b);return0!==e&&d.setTo(e*b.x,e*b.y),d},c.Point.normalRightHand=function(a,b){return"undefined"==typeofb&&(b=newc.Point),b.setTo(-1*a.y,a.x)},c.Point.normalize=function(a,b){"undefined"==typeofb&&(b=newc.Point);vard=a.getMagnitude();return0!==d&&b.setTo(a.x/d,a.y/d),b},c.Point.rotate=function(a,b,d,e,f,g){f=f||!1,g=g||null,f&&(e=c.Math.degToRad(e)),null===g&&(g=Math.sqrt((b-a.x)*(b-a.x)+(d-a.y)*(d-a.y)));varh=e+Math.atan2(a.y-d,a.x-b);returna.setTo(b+g*Math.cos(h),d+g*Math.sin(h))},c.Point.centroid=function(a,b){if("undefined"==typeofb&&(b=newc.Point),"[object Array]"!==Object.prototype.toString.call(a))thrownewError("Phaser.Point. Parameter 'points' must be an array");vard=a.length;if(1>d)thrownewError("Phaser.Point. Parameter 'points' array must not be empty");if(1===d)returnb.copyFrom(a[0]),b;for(vare=0;d>e;e++)c.Point.add(b,a[e],b);returnb.divide(d,d),b},c.Point.parse=function(a,b,d){b=b||"x",d=d||"y";vare=newc.Point;returna[b]&&(e.x=parseInt(a[b],10)),a[d]&&(e.y=parseInt(a[d],10)),e},PIXI.Point=c.Point,c.Rectangle=function(a,b,c,d){a=a||0,b=b||0,c=c||0,d=d||0,this.x=a,this.y=b,this.width=c,this.height=d},c.Rectangle.prototype={offset:function(a,b){returnthis.x+=a,this.y+=b,this},offsetPoint:function(a){returnthis.offset(a.x,a.y)},setTo:function(a,b,c,d){returnthis.x=a,this.y=b,this.width=c,this.height=d,this},scale:function(a,b){return"undefined"==typeofb&&(b=a),this.width*=a,this.height*=b,this},centerOn:function(a,b){returnthis.centerX=a,this.centerY=b,this},floor:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y)},floorAll:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.width=Math.floor(this.width),this.height=Math.floor(this.height)},copyFrom:function(a){returnthis.setTo(a.x,a.y,a.width,a.height)},copyTo:function(a){returna.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},inflate:function(a,b){returnc.Rectangle.inflate(this,a,b)},size:function(a){returnc.Rectangle.size(this,a)},clone:function(a){returnc.Rectangle.clone(this,a)},contains:function(a,b){returnc.Rectangle.contains(this,a,b)},containsRect:function(a){returnc.Rectangle.containsRect(a,this)},equals:function(a){returnc.Rectangle.equals(this,a)},intersection:function(a,b){returnc.Rectangle.intersection(this,a,b)},intersects:function(a,b){returnc.Rectangle.intersects(this,a,b)},intersectsRaw:function(a,b,d,e,f){returnc.Rectangle.intersectsRaw(this,a,b,d,e,f)},union:function(a,b){returnc.Rectangle.union(this,a,b)},toString:function(){return"[{Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+" empty="+this.empty+")}]"}},Object.defineProperty(c.Rectangle.prototype,"halfWidth",{get:function(){returnMath.round(this.width/2)}}),Object.defineProperty(c.Rectangle.prototype,"halfHeight",{get:function(){returnMath.round(this.height/2)}}),Object.defineProperty(c.Rectangle.prototype,"bottom",{get:function(){returnthis.y+this.height},set:function(a){this.height=a<=this.y?0:a-this.y}}),Object.defineProperty(c.Rectangle.prototype,"bottomRight",{get:function(){returnnewc.Point(this.right,this.bottom)},set:function(a){this.right=a.x,this.bottom=a.y}}),Object.defineProperty(c.Rectangle.prototype,"left",{get:function(){returnthis.x},set:function(a){this.width=a>=this.right?0:this.right-a,this.x=a}}),Object.defineProperty(c.Rectangle.prototype,"right",{get:function(){returnthis.x+this.width},set:function(a){this.width=a<=this.x?
},checkState:function(a){if(this.states[a]){varb=!1;return(this.states[a].preload||this.states[a].create||this.states[a].update||this.states[a].render)&&(b=!0),b===!1?(console.warn("Invalid Phaser State object given. Must contain at least a one of the required functions: preload, create, update or render"),!1):!0}returnconsole.warn("Phaser.StateManager - No state found with the key: "+a),!1},link:function(a){this.states[a].game=this.game,this.states[a].add=this.game.add,this.states[a].make=this.game.make,this.states[a].camera=this.game.camera,this.states[a].cache=this.game.cache,this.states[a].input=this.game.input,this.states[a].load=this.game.load,this.states[a].math=this.game.math,this.states[a].sound=this.game.sound,this.states[a].scale=this.game.scale,this.states[a].state=this,this.states[a].stage=this.game.stage,this.states[a].time=this.game.time,this.states[a].tweens=this.game.tweens,this.states[a].world=this.game.world,this.states[a].particles=this.game.particles,this.states[a].rnd=this.game.rnd,this.states[a].physics=this.game.physics},unlink:function(a){this.states[a]&&(this.states[a].game=null,this.states[a].add=null,this.states[a].make=null,this.states[a].camera=null,this.states[a].cache=null,this.states[a].input=null,this.states[a].load=null,this.states[a].math=null,this.states[a].sound=null,this.states[a].scale=null,this.states[a].state=null,this.states[a].stage=null,this.states[a].time=null,this.states[a].tweens=null,this.states[a].world=null,this.states[a].particles=null,this.states[a].rnd=null,this.states[a].physics=null)},setCurrentState:function(a){this.callbackContext=this.states[a],this.link(a),this.onInitCallback=this.states[a].init||this.dummy,this.onPreloadCallback=this.states[a].preload||null,this.onLoadRenderCallback=this.states[a].loadRender||null,this.onLoadUpdateCallback=this.states[a].loadUpdate||null,this.onCreateCallback=this.states[a].create||null,this.onUpdateCallback=this.states[a].update||null,this.onPreRenderCallback=this.states[a].preRender||null,this.onRenderCallback=this.states[a].render||null,this.onResizeCallback=this.states[a].resize||null,this.onPausedCallback=this.states[a].paused||null,this.onResumedCallback=this.states[a].resumed||null,this.onPauseUpdateCallback=this.states[a].pauseUpdate||null,this.onShutDownCallback=this.states[a].shutdown||this.dummy,this.current=a,this._created=!1,this.onInitCallback.apply(this.callbackContext,this._args),a===this._pendingState&&(this._args=[])},getCurrentState:function(){returnthis.states[this.current]},loadComplete:function(){this._created===!1&&this.onCreateCallback?(this._created=!0,this.onCreateCallback.call(this.callbackContext,this.game)):this._created=!0},pause:function(){this._created&&this.onPausedCallback&&this.onPausedCallback.call(this.callbackContext,this.game)},resume:function(){this._created&&this.onResumedCallback&&this.onResumedCallback.call(this.callbackContext,this.game)},update:function(){this._created&&this.onUpdateCallback?this.onUpdateCallback.call(this.callbackContext,this.game):this.onLoadUpdateCallback&&this.onLoadUpdateCallback.call(this.callbackContext,this.game)},pauseUpdate:function(){this._created&&this.onPauseUpdateCallback?this.onPauseUpdateCallback.call(this.callbackContext,this.game):this.onLoadUpdateCallback&&this.onLoadUpdateCallback.call(this.callbackContext,this.game)},preRender:function(a){this.onPreRenderCallback&&this.onPreRenderCallback.call(this.callbackContext,this.game,a)},resize:function(a,b){this.onResizeCallback&&this.onResizeCallback.call(this.callbackContext,a,b)},render:function(){this._created&&this.onRenderCallback?(this.game.renderType===c.CANVAS&&(this.game.context.save(),this.game.context.setTransform(1,0,0,1,0,0)),this.onRenderCallback.call(this.callbackContext,this.game),this.game.renderType===c.CANVAS&&this.game.context.restore()):this.onLoadRenderCallback&&this.onLoadRenderCallback.call(this.callbackContext,this.game)},destroy:function(){this.clearCurrentState(),this.callbackContext=null,this.onInitCallback=null,this.onShutDownCallback=null,this.onPreloadCallback=null,this
},c.FlexGrid.prototype={setSize:function(a,b){this.width=a,this.height=b,this.ratioH=a/b,this.ratioV=b/a,this.scaleNone=newc.Point(1,1),this.boundsNone.width=this.width,this.boundsNone.height=this.height,this.refresh()},createCustomLayer:function(a,b,d,e){"undefined"==typeofe&&(e=!0),this.customWidth=a,this.customHeight=b,this.boundsCustom.width=a,this.boundsCustom.height=b;varf=newc.FlexLayer(this,this.positionCustom,this.boundsCustom,this.scaleCustom);returne&&this.game.world.add(f),this.layers.push(f),"undefined"!=typeofd&&null!==typeofd&&f.addMultiple(d),f},createFluidLayer:function(a,b){"undefined"==typeofb&&(b=!0);vard=newc.FlexLayer(this,this.positionFluid,this.boundsFluid,this.scaleFluid);returnb&&this.game.world.add(d),this.layers.push(d),"undefined"!=typeofa&&null!==typeofa&&d.addMultiple(a),d},createFullLayer:function(a){varb=newc.FlexLayer(this,this.positionFull,this.boundsFull,this.scaleFluid);returnthis.game.world.add(b),this.layers.push(b),"undefined"!=typeofa&&b.addMultiple(a),b},createFixedLayer:function(a){varb=newc.FlexLayer(this,this.positionNone,this.boundsNone,this.scaleNone);returnthis.game.world.add(b),this.layers.push(b),"undefined"!=typeofa&&b.addMultiple(a),b},reset:function(){for(vara=this.layers.length;a--;)this.layers[a].persist||(this.layers[a].position=null,this.layers[a].scale=null,this.layers.slice(a,1))},onResize:function(a,b){this.ratioH=a/b,this.ratioV=b/a,this.refresh(a,b)},refresh:function(){this.multiplier=Math.min(this.manager.height/this.height,this.manager.width/this.width),this.boundsFluid.width=Math.round(this.width*this.multiplier),this.boundsFluid.height=Math.round(this.height*this.multiplier),this.scaleFluid.set(this.boundsFluid.width/this.width,this.boundsFluid.height/this.height),this.scaleFluidInversed.set(this.width/this.boundsFluid.width,this.height/this.boundsFluid.height),this.scaleFull.set(this.boundsFull.width/this.width,this.boundsFull.height/this.height),this.boundsFull.width=Math.round(this.manager.width*this.scaleFluidInversed.x),this.boundsFull.height=Math.round(this.manager.height*this.scaleFluidInversed.y),this.boundsFluid.centerOn(this.manager.bounds.centerX,this.manager.bounds.centerY),this.boundsNone.centerOn(this.manager.bounds.centerX,this.manager.bounds.centerY),this.positionFluid.set(this.boundsFluid.x,this.boundsFluid.y),this.positionNone.set(this.boundsNone.x,this.boundsNone.y)},fitSprite:function(a){this.manager.scaleSprite(a),a.x=this.manager.bounds.centerX,a.y=this.manager.bounds.centerY},debug:function(){this.game.debug.text(this.boundsFluid.width+" x "+this.boundsFluid.height,this.boundsFluid.x+4,this.boundsFluid.y+16),this.game.debug.geom(this.boundsFluid,"rgba(255,0,0,0.9",!1)}},c.FlexGrid.prototype.constructor=c.FlexGrid,c.FlexLayer=function(a,b,d,e){c.Group.call(this,a.game,null,"__flexLayer"+a.game.rnd.uuid(),!1),this.manager=a.manager,this.grid=a,this.persist=!1,this.position=b,this.bounds=d,this.scale=e,this.topLeft=d.topLeft,this.topMiddle=newc.Point(d.halfWidth,0),this.topRight=d.topRight,this.bottomLeft=d.bottomLeft,this.bottomMiddle=newc.Point(d.halfWidth,d.bottom),this.bottomRight=d.bottomRight},c.FlexLayer.prototype=Object.create(c.Group.prototype),c.FlexLayer.prototype.constructor=c.FlexLayer,c.FlexLayer.prototype.resize=function(){},c.FlexLayer.prototype.debug=function(){this.game.debug.text(this.bounds.width+" x "+this.bounds.height,this.bounds.x+4,this.bounds.y+16),this.game.debug.geom(this.bounds,"rgba(0,0,255,0.9",!1),this.game.debug.geom(this.topLeft,"rgba(255,255,255,0.9"),this.game.debug.geom(this.topMiddle,"rgba(255,255,255,0.9"),this.game.debug.geom(this.topRight,"rgba(255,255,255,0.9")},c.ScaleManager=function(a,b,d){this.game=a,this.dom=c.DOM,this.grid=null,this.width=0,this.height=0,this.minWidth=null,this.maxWidth=null,this.minHeight=null,this.maxHeight=null,this.offset=newc.Point,this.forceLandscape=!1,this.forcePortrait=!1,this.incorrectOrientation=!1,this._pageAlignHorizontally=!1,this._pageAlignVertically=!1,this.maxIterations=5,this.onOrientationChange=newc.Signal,this.enterLandscape=n
}}),c.Input=function(a){this.game=a,this.hitCanvas=null,this.hitContext=null,this.moveCallbacks=[],this.moveCallback=null,this.moveCallbackContext=this,this.pollRate=0,this.enabled=!0,this.multiInputOverride=c.Input.MOUSE_TOUCH_COMBINE,this.position=null,this.speed=null,this.circle=null,this.scale=null,this.maxPointers=-1,this.currentPointers=0,this.tapRate=200,this.doubleTapRate=300,this.holdRate=2e3,this.justPressedRate=200,this.justReleasedRate=200,this.recordPointerHistory=!1,this.recordRate=100,this.recordLimit=100,this.pointer1=null,this.pointer2=null,this.pointer3=null,this.pointer4=null,this.pointer5=null,this.pointer6=null,this.pointer7=null,this.pointer8=null,this.pointer9=null,this.pointer10=null,this.pointers=[],this.activePointer=null,this.mousePointer=null,this.mouse=null,this.keyboard=null,this.touch=null,this.mspointer=null,this.gamepad=null,this.resetLocked=!1,this.onDown=null,this.onUp=null,this.onTap=null,this.onHold=null,this.minPriorityID=0,this.interactiveItems=newc.ArraySet,this._localPoint=newc.Point,this._pollCounter=0,this._oldPosition=null,this._x=0,this._y=0},c.Input.MOUSE_OVERRIDES_TOUCH=0,c.Input.TOUCH_OVERRIDES_MOUSE=1,c.Input.MOUSE_TOUCH_COMBINE=2,c.Input.MAX_POINTERS=10,c.Input.prototype={boot:function(){this.mousePointer=newc.Pointer(this.game,0),this.addPointer(),this.addPointer(),this.mouse=newc.Mouse(this.game),this.keyboard=newc.Keyboard(this.game),this.touch=newc.Touch(this.game),this.mspointer=newc.MSPointer(this.game),this.gamepad=newc.Gamepad(this.game),this.onDown=newc.Signal,this.onUp=newc.Signal,this.onTap=newc.Signal,this.onHold=newc.Signal,this.scale=newc.Point(1,1),this.speed=newc.Point,this.position=newc.Point,this._oldPosition=newc.Point,this.circle=newc.Circle(0,0,44),this.activePointer=this.mousePointer,this.currentPointers=0,this.hitCanvas=document.createElement("canvas"),this.hitCanvas.width=1,this.hitCanvas.height=1,this.hitContext=this.hitCanvas.getContext("2d"),this.mouse.start(),this.keyboard.start(),this.touch.start(),this.mspointer.start(),this.mousePointer.active=!0;vara=this;this._onClickTrampoline=function(b){a.onClickTrampoline(b)},this.game.canvas.addEventListener("click",this._onClickTrampoline,!1)},destroy:function(){this.mouse.stop(),this.keyboard.stop(),this.touch.stop(),this.mspointer.stop(),this.gamepad.stop(),this.moveCallbacks=[],this.game.canvas.removeEventListener("click",this._onClickTrampoline)},addMoveCallback:function(a,b){returnthis.moveCallbacks.push({callback:a,context:b})-1},deleteMoveCallback:function(a){this.moveCallbacks[a]&&this.moveCallbacks.splice(a,1)},addPointer:function(){if(this.pointers.length>=c.Input.MAX_POINTERS)returnconsole.warn("Phaser.Input.addPointer: only "+c.Input.MAX_POINTERS+" pointer allowed"),null;vara=this.pointers.length+1,b=newc.Pointer(this.game,a);returnthis.pointers.push(b),this["pointer"+a]=b,b},update:function(){if(this.keyboard.update(),this.pollRate>0&&this._pollCounter<this.pollRate)returnvoidthis._pollCounter++;this.speed.x=this.position.x-this._oldPosition.x,this.speed.y=this.position.y-this._oldPosition.y,this._oldPosition.copyFrom(this.position),this.mousePointer.update(),this.gamepad.active&&this.gamepad.update();for(vara=0;a<this.pointers.length;a++)this.pointers[a].update();this._pollCounter=0},reset:function(a){if(this.game.isBooted&&!this.resetLocked){"undefined"==typeofa&&(a=!1),this.keyboard.reset(a),this.mousePointer.reset(),this.gamepad.reset();for(varb=0;b<this.pointers.length;b++)this.pointers[b].reset();this.currentPointers=0,"none"!==this.game.canvas.style.cursor&&(this.game.canvas.style.cursor="inherit"),a&&(this.onDown.dispose(),this.onUp.dispose(),this.onTap.dispose(),this.onHold.dispose(),this.onDown=newc.Signal,this.onUp=newc.Signal,this.onTap=newc.Signal,this.onHold=newc.Signal,this.moveCallbacks=[]),this._pollCounter=0}},resetSpeed:function(a,b){this._oldPosition.setTo(a,b),this.speed.setTo(0,0)},startPointer:function(a){if(this.maxPointers>=0&&this.countActivePointers(this.maxPointers)>=this.maxPointers)returnnull;if(!this.pointer1.active)return
if(this.isLoaded)for(varcinthis._anims)this._anims[c].updateFrameData(a);returnthis._frameData=a,"undefined"==typeofb||null===b?this.frame=0:"string"==typeofb?this.frameName=b:this.frame=b,this.isLoaded=!0,!0},copyFrameData:function(a,b){if(this._frameData=a.clone(),this.isLoaded)for(varcinthis._anims)this._anims[c].updateFrameData(this._frameData);return"undefined"==typeofb||null===b?this.frame=0:"string"==typeofb?this.frameName=b:this.frame=b,this.isLoaded=!0,!0},add:function(a,b,d,e,f){returnb=b||[],d=d||60,"undefined"==typeofe&&(e=!1),"undefined"==typeoff&&(f=b&&"number"==typeofb[0]?!0:!1),this._outputFrames.length=0,this._frameData.getFrameIndexes(b,f,this._outputFrames),this._anims[a]=newc.Animation(this.game,this.sprite,a,this._frameData,this._outputFrames,d,e),this.currentAnim=this._anims[a],this.currentFrame=this.currentAnim.currentFrame,this.sprite.__tilePattern&&(this.sprite.__tilePattern=!1,this.tilingTexture=!1),this._anims[a]},validateFrames:function(a,b){"undefined"==typeofb&&(b=!0);for(varc=0;c<a.length;c++)if(b===!0){if(a[c]>this._frameData.total)return!1}elseif(this._frameData.checkFrameName(a[c])===!1)return!1;return!0},play:function(a,b,c,d){returnthis._anims[a]?this.currentAnim===this._anims[a]?this.currentAnim.isPlaying===!1?(this.currentAnim.paused=!1,this.currentAnim.play(b,c,d)):this.currentAnim:(this.currentAnim&&this.currentAnim.isPlaying&&this.currentAnim.stop(),this.currentAnim=this._anims[a],this.currentAnim.paused=!1,this.currentFrame=this.currentAnim.currentFrame,this.currentAnim.play(b,c,d)):void0},stop:function(a,b){"undefined"==typeofb&&(b=!1),"string"==typeofa?this._anims[a]&&(this.currentAnim=this._anims[a],this.currentAnim.stop(b)):this.currentAnim&&this.currentAnim.stop(b)},update:function(){returnthis.updateIfVisible&&!this.sprite.visible?!1:this.currentAnim&&this.currentAnim.update()===!0?(this.currentFrame=this.currentAnim.currentFrame,!0):!1},next:function(a){this.currentAnim&&(this.currentAnim.next(a),this.currentFrame=this.currentAnim.currentFrame)},previous:function(a){this.currentAnim&&(this.currentAnim.previous(a),this.currentFrame=this.currentAnim.currentFrame)},getAnimation:function(a){return"string"==typeofa&&this._anims[a]?this._anims[a]:null},refreshFrame:function(){this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1)},destroy:function(){vara=null;for(varainthis._anims)this._anims.hasOwnProperty(a)&&this._anims[a].destroy();this._anims={},this._frameData=null,this._frameIndex=0,this.currentAnim=null,this.currentFrame=null}},c.AnimationManager.prototype.constructor=c.AnimationManager,Object.defineProperty(c.AnimationManager.prototype,"frameData",{get:function(){returnthis._frameData}}),Object.defineProperty(c.AnimationManager.prototype,"frameTotal",{get:function(){returnthis._frameData.total}}),Object.defineProperty(c.AnimationManager.prototype,"paused",{get:function(){returnthis.currentAnim.isPaused},set:function(a){this.currentAnim.paused=a}}),Object.defineProperty(c.AnimationManager.prototype,"name",{get:function(){returnthis.currentAnim?this.currentAnim.name:void0}}),Object.defineProperty(c.AnimationManager.prototype,"frame",{get:function(){returnthis.currentFrame?this._frameIndex:void0},set:function(a){"number"==typeofa&&this._frameData&&null!==this._frameData.getFrame(a)&&(this.currentFrame=this._frameData.getFrame(a),this.currentFrame&&(this._frameIndex=a,this.sprite.setFrame(this.currentFrame),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1)))}}),Object.defineProperty(c.AnimationManager.prototype,"frameName",{get:function(){returnthis.currentFrame?this.currentFrame.name:void0},set:function(a){"string"==typeofa&&null!==this._frameData.getFrameByName(a)?(this.currentFrame=this._frameData.getFrameByName(a),this.currentFrame&&(this._frameIndex=this.currentFrame.index,this.sprite.setFrame(this.currentFrame),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1))):console.warn("Cannot set frameName: "+
},spritesheet:function(a,b,c,d,e,f,g){return"undefined"==typeofe&&(e=-1),"undefined"==typeoff&&(f=0),"undefined"==typeofg&&(g=0),this.addToFileList("spritesheet",a,b,{frameWidth:c,frameHeight:d,frameMax:e,margin:f,spacing:g}),this},audio:function(a,b,c){return"undefined"==typeofc&&(c=!0),this.addToFileList("audio",a,b,{buffer:null,autoDecode:c}),this},audiosprite:function(a,b,c){returnthis.audio(a,b),this.json(a+"-audioatlas",c),this},tilemap:function(a,b,d,e){if("undefined"==typeofb&&(b=null),"undefined"==typeofd&&(d=null),"undefined"==typeofe&&(e=c.Tilemap.CSV),null==b&&null==d)returnconsole.warn("Phaser.Loader.tilemap - Both url and data are null. One must be set."),this;if(d){switch(e){casec.Tilemap.CSV:break;casec.Tilemap.TILED_JSON:"string"==typeofd&&(d=JSON.parse(d))}this.game.cache.addTilemap(a,null,d,e)}elsethis.addToFileList("tilemap",a,b,{format:e});returnthis},physics:function(a,b,d,e){return"undefined"==typeofb&&(b=null),"undefined"==typeofd&&(d=null),"undefined"==typeofe&&(e=c.Physics.LIME_CORONA_JSON),null==b&&null==d?(console.warn("Phaser.Loader.physics - Both url and data are null. One must be set."),this):(d?("string"==typeofd&&(d=JSON.parse(d)),this.game.cache.addPhysicsData(a,null,d,e)):this.addToFileList("physics",a,b,{format:e}),this)},bitmapFont:function(a,b,c,d,e,f){if("undefined"==typeofc&&(c=null),"undefined"==typeofd&&(d=null),"undefined"==typeofe&&(e=0),"undefined"==typeoff&&(f=0),c)this.addToFileList("bitmapfont",a,b,{xmlURL:c,xSpacing:e,ySpacing:f});elseif("string"==typeofd){varg;try{if(window.DOMParser){varh=newDOMParser;g=h.parseFromString(d,"text/xml")}elseg=newActiveXObject("Microsoft.XMLDOM"),g.async="false",g.loadXML(d)}catch(i){g=void0}if(!g||!g.documentElement||g.getElementsByTagName("parsererror").length)thrownewError("Phaser.Loader. Invalid Bitmap Font XML given");this.addToFileList("bitmapfont",a,b,{xmlURL:null,xmlData:g,xSpacing:e,ySpacing:f})}returnthis},atlasJSONArray:function(a,b,d,e){returnthis.atlas(a,b,d,e,c.Loader.TEXTURE_ATLAS_JSON_ARRAY)},atlasJSONHash:function(a,b,d,e){returnthis.atlas(a,b,d,e,c.Loader.TEXTURE_ATLAS_JSON_HASH)},atlasXML:function(a,b,d,e){returnthis.atlas(a,b,d,e,c.Loader.TEXTURE_ATLAS_XML_STARLING)},atlas:function(a,b,d,e,f){if("undefined"==typeofd&&(d=null),"undefined"==typeofe&&(e=null),"undefined"==typeoff&&(f=c.Loader.TEXTURE_ATLAS_JSON_ARRAY),d)this.addToFileList("textureatlas",a,b,{atlasURL:d,format:f});else{switch(f){casec.Loader.TEXTURE_ATLAS_JSON_ARRAY:"string"==typeofe&&(e=JSON.parse(e));break;casec.Loader.TEXTURE_ATLAS_XML_STARLING:if("string"==typeofe){varg;try{if(window.DOMParser){varh=newDOMParser;g=h.parseFromString(e,"text/xml")}elseg=newActiveXObject("Microsoft.XMLDOM"),g.async="false",g.loadXML(e)}catch(i){g=void0}if(!g||!g.documentElement||g.getElementsByTagName("parsererror").length)thrownewError("Phaser.Loader. Invalid Texture Atlas XML given");e=g}}this.addToFileList("textureatlas",a,b,{atlasURL:null,atlasData:e,format:f})}returnthis},removeFile:function(a,b){varc=this.getAsset(a,b);c!==!1&&this._fileList.splice(c.index,1)},removeAll:function(){this._fileList.length=0},start:function(){this.isLoading||(this._packList.length>0?(this._packIndex=0,this.loadPack()):this.beginLoad())},beginLoad:function(){this.progress=0,this.progressFloat=0,this.hasLoaded=!1,this.isLoading=!0,this.onLoadStart.dispatch(this._fileList.length),this._fileList.length>0?(this._fileIndex=0,this._progressChunk=100/this._fileList.length,this.loadFile()):(this.progress=100,this.progressFloat=100,this.hasLoaded=!0,this.isLoading=!1,this.onLoadComplete.dispatch())},loadPack:function(){if(!this._packList[this._packIndex])returnvoidconsole.warn("Phaser.Loader loadPackList invalid index "+this._packIndex);vara=this._packList[this._packIndex];null!==a.data?this.packLoadComplete(this._packIndex,!1):this.xhrLoad(this._packIndex,this.baseURL+a.url,"text","packLoadComplete","packLoadError")},packLoadComplete:function(a,b){if("undefined"==typeofb&&(b=!0),!this._packList[a])returnvoidconsole.warn("Phaser.Loaderpac
c.Buffer=d,c.SlowBuffer=d,c.INSPECT_MAX_BYTES=50,d.poolSize=8192;varDb;d.isEncoding=function(a){switch((a+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},d.isBuffer=function(a){returna&&a._isBuffer},d.byteLength=function(a,b){switch(b||"utf8"){case"hex":returna.length/2;case"utf8":case"utf-8":returnqb(a).length;case"ascii":case"binary":returna.length;case"base64":returnsb(a).length;default:thrownewError("Unknown encoding")}},d.concat=function(a,b){if(!Array.isArray(a))thrownewError("Usage: Buffer.concat(list, [totalLength])\nlist should be an Array.");varc,e;if(0===a.length)returnnewd(0);if(1===a.length)returna[0];if("number"!=typeofb)for(b=0,c=0;c<a.length;c++)e=a[c],b+=e.length;varf=newd(b),g=0;for(c=0;c<a.length;c++)e=a[c],e.copy(f,g),g+=e.length;returnf},kb.prototype.write=j,kb.prototype.toString=k,kb.prototype.toLocaleString=k,kb.prototype.toJSON=l,kb.prototype.copy=m,kb.prototype.slice=s,kb.prototype.readUInt8=t,kb.prototype.readUInt16LE=v,kb.prototype.readUInt16BE=w,kb.prototype.readUInt32LE=y,kb.prototype.readUInt32BE=z,kb.prototype.readInt8=A,kb.prototype.readInt16LE=C,kb.prototype.readInt16BE=D,kb.prototype.readInt32LE=F,kb.prototype.readInt32BE=G,kb.prototype.readFloatLE=I,kb.prototype.readFloatBE=J,kb.prototype.readDoubleLE=L,kb.prototype.readDoubleBE=M,kb.prototype.writeUInt8=N,kb.prototype.writeUInt16LE=P,kb.prototype.writeUInt16BE=Q,kb.prototype.writeUInt32LE=S,kb.prototype.writeUInt32BE=T,kb.prototype.writeInt8=U,kb.prototype.writeInt16LE=W,kb.prototype.writeInt16BE=X,kb.prototype.writeInt32LE=Z,kb.prototype.writeInt32BE=$,kb.prototype.writeFloatLE=ab,kb.prototype.writeFloatBE=bb,kb.prototype.writeDoubleLE=db,kb.prototype.writeDoubleBE=eb,kb.prototype.fill=fb,kb.prototype.inspect=gb,kb.prototype.toArrayBuffer=hb,kb.prototype._isBuffer=!0,kb.prototype.subarray=function(){returnthis._arr.subarray.apply(this._arr,arguments)},kb.prototype.set=function(){returnthis._arr.set.apply(this._arr,arguments)};varEb={get:function(a,b){returnbina?a[b]:a._arr[b]},set:function(a,b,c){a._arr[b]=c}}},{"base64-js":3,typedarray:4}],"native-buffer-browserify":[function(a,b){b.exports=a("PcZj9L")},{}],3:[function(a,b){!function(){"use strict";functiona(a){varb,c,e,f,g,h;if(a.length%4>0)throw"Invalid string. Length must be a multiple of 4";for(g=a.indexOf("="),g=g>0?a.length-g:0,h=[],e=g>0?a.length-4:a.length,b=0,c=0;e>b;b+=4,c+=3)f=d.indexOf(a[b])<<18|d.indexOf(a[b+1])<<12|d.indexOf(a[b+2])<<6|d.indexOf(a[b+3]),h.push((16711680&f)>>16),h.push((65280&f)>>8),h.push(255&f);return2===g?(f=d.indexOf(a[b])<<2|d.indexOf(a[b+1])>>4,h.push(255&f)):1===g&&(f=d.indexOf(a[b])<<10|d.indexOf(a[b+1])<<4|d.indexOf(a[b+2])>>2,h.push(f>>8&255),h.push(255&f)),h}functionc(a){functionb(a){returnd[a>>18&63]+d[a>>12&63]+d[a>>6&63]+d[63&a]}varc,e,f,g=a.length%3,h="";for(c=0,f=a.length-g;f>c;c+=3)e=(a[c]<<16)+(a[c+1]<<8)+a[c+2],h+=b(e);switch(g){case1:e=a[a.length-1],h+=d[e>>2],h+=d[e<<4&63],h+="==";break;case2:e=(a[a.length-2]<<8)+a[a.length-1],h+=d[e>>10],h+=d[e>>4&63],h+=d[e<<2&63],h+="="}returnh}vard="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";b.exports.toByteArray=a,b.exports.fromByteArray=c}()},{}],4:[function(a,b,c){functiond(a){if(L&&K){varb,c=L(a);for(b=0;b<c.length;b+=1)K(a,c[b],{value:a[c[b]],writable:!1,enumerable:!1,configurable:!1})}}functione(a){functionb(b){K(a,b,{get:function(){returna._getter(b)},set:function(c){a._setter(b,c)},enumerable:!0,configurable:!1})}if(K){if(a.length>B)thrownewRangeError("Array too large for polyfill");varc;for(c=0;c<a.length;c+=1)b(c)}}functionf(a,b){varc=32-b;returna<<c>>c}functiong(a,b){varc=32-b;returna<<c>>>c}functionh(a){return[255&a]}functioni(a){returnf(a[0],8)}functionj(a){return[255&a]}functionk(a){returng(a[0],8)}functionl(a){returna=J(Number(a)),[0>a?0:a>255?255:255&a]}functionm(a){return[a>>8&255,255&a]}functionn(a){returnf(a[0]<<8|a[1],16)}functiono(a){return[a>>8&255,255&a]}functi
},c.prototype.updateBoundingRadius=function(){thrownewError("Shape.updateBoundingRadius is not implemented in this Shape...")},c.prototype.updateArea=function(){},c.prototype.computeAABB=function(){}},{__browserify_Buffer:1,__browserify_process:2}],46:[function(a,b){functionc(a){f.call(this,a,f.GS),a=a||{},this.iterations=a.iterations||10,this.tolerance=a.tolerance||1e-10,this.arrayStep=30,this.lambda=newg.ARRAY_TYPE(this.arrayStep),this.Bs=newg.ARRAY_TYPE(this.arrayStep),this.invCs=newg.ARRAY_TYPE(this.arrayStep),this.useZeroRHS=!1,this.frictionIterations=0,this.usedIterations=0}functiond(a){for(varb=a.length;b--;)a[b]=0}vare=(a("__browserify_process"),a("__browserify_Buffer"),a("../math/vec2")),f=a("./Solver"),g=a("../utils/Utils"),h=a("../equations/FrictionEquation");b.exports=c,c.prototype=newf,c.prototype.solve=function(a,b){this.sortEquations();varf=0,i=this.iterations,j=this.frictionIterations,k=this.equations,l=k.length,m=Math.pow(this.tolerance*l,2),n=b.bodies,o=b.bodies.length,p=(e.add,e.set,this.useZeroRHS),q=this.lambda;if(this.usedIterations=0,l)for(varr=0;r!==o;r++){vars=n[r];s.updateSolveMassProperties()}q.length<l&&(q=this.lambda=newg.ARRAY_TYPE(l+this.arrayStep),this.Bs=newg.ARRAY_TYPE(l+this.arrayStep),this.invCs=newg.ARRAY_TYPE(l+this.arrayStep)),d(q);for(vart=this.invCs,u=this.Bs,q=this.lambda,r=0;r!==k.length;r++){varv=k[r];(v.timeStep!==a||v.needsUpdate)&&(v.timeStep=a,v.update()),u[r]=v.computeB(v.a,v.b,a),t[r]=v.computeInvC(v.epsilon)}varv,w,r,x;if(0!==l){for(r=0;r!==o;r++){vars=n[r];s.resetConstraintVelocity()}if(j){for(f=0;f!==j;f++){for(w=0,x=0;x!==l;x++){v=k[x];vary=c.iterateEquation(x,v,v.epsilon,u,t,q,p,a,f);w+=Math.abs(y)}if(this.usedIterations++,m>=w*w)break}for(c.updateMultipliers(k,q,1/a),x=0;x!==l;x++){varz=k[x];if(zinstanceofh){for(varA=0,B=0;B!==z.contactEquations.length;B++)A+=z.contactEquations[B].multiplier;A*=z.frictionCoefficient/z.contactEquations.length,z.maxForce=A,z.minForce=-A}}}for(f=0;f!==i;f++){for(w=0,x=0;x!==l;x++){v=k[x];vary=c.iterateEquation(x,v,v.epsilon,u,t,q,p,a,f);w+=Math.abs(y)}if(this.usedIterations++,m>=w*w)break}for(r=0;r!==o;r++)n[r].addConstraintVelocity();c.updateMultipliers(k,q,1/a)}},c.updateMultipliers=function(a,b,c){for(vard=a.length;d--;)a[d].multiplier=b[d]*c},c.iterateEquation=function(a,b,c,d,e,f,g,h){vari=d[a],j=e[a],k=f[a],l=b.computeGWlambda(),m=b.maxForce,n=b.minForce;g&&(i=0);varo=j*(i-l-c*k),p=k+o;returnn*h>p?o=n*h-k:p>m*h&&(o=m*h-k),f[a]+=o,b.addToWlambda(o),o}},{"../equations/FrictionEquation":24,"../math/vec2":31,"../utils/Utils":50,"./Solver":47,__browserify_Buffer:1,__browserify_process:2}],47:[function(a,b){functionc(a,b){a=a||{},d.call(this),this.type=b,this.equations=[],this.equationSortFunction=a.equationSortFunction||!1}vard=(a("__browserify_process"),a("__browserify_Buffer"),a("../utils/Utils"),a("../events/EventEmitter"));b.exports=c,c.prototype=newd,c.prototype.solve=function(){thrownewError("Solver.solve should be implemented by subclasses!")};vare={bodies:[]};c.prototype.solveIsland=function(a,b){this.removeAllEquations(),b.equations.length&&(this.addEquations(b.equations),e.bodies.length=0,b.getBodies(e.bodies),e.bodies.length&&this.solve(a,e))},c.prototype.sortEquations=function(){this.equationSortFunction&&this.equations.sort(this.equationSortFunction)},c.prototype.addEquation=function(a){a.enabled&&this.equations.push(a)},c.prototype.addEquations=function(a){for(varb=0,c=a.length;b!==c;b++){vard=a[b];d.enabled&&this.equations.push(d)}},c.prototype.removeEquation=function(a){varb=this.equations.indexOf(a);-1!==b&&this.equations.splice(b,1)},c.prototype.removeAllEquations=function(){this.equations.length=0},c.GS=1,c.ISLAND=2},{"../events/EventEmitter":27,"../utils/Utils":50,__browserify_Buffer:1,__browserify_process:2}],48:[function(a,b){functionc(){this.overlappingShapesLastState=newe,this.overlappingShapesCurrentState=newe,this.recordPool=[],this.tmpDict=newe,this.tmpArray1=[]}functiond(a,b,c,d){this.shapeA=b,this.shapeB=d,this.bodyA=a,this.bodyB=c}{vare=(a("__browserify_proces
},clear:function(){this.world.time=0,this.world.fixedStepTime=0,this.world.solver&&this.world.solver.equations.length&&this.world.solver.removeAllEquations();for(vara=this.world.constraints,b=a.length-1;b>=0;b--)this.world.removeConstraint(a[b]);for(varc=this.world.bodies,b=c.length-1;b>=0;b--)this.world.removeBody(c[b]);for(vard=this.world.springs,b=d.length-1;b>=0;b--)this.world.removeSpring(d[b]);for(vare=this.world.contactMaterials,b=e.length-1;b>=0;b--)this.world.removeContactMaterial(e[b]);this.world.off("beginContact",this.beginContactHandler,this),this.world.off("endContact",this.endContactHandler,this),this.postBroadphaseCallback=null,this.callbackContext=null,this.impactCallback=null,this.collisionGroups=[],this._toRemove=[],this.boundsCollidesWith=[]},destroy:function(){this.clear(),this.game=null},addBody:function(a){returna.data.world?!1:(this.world.addBody(a.data),this.onBodyAdded.dispatch(a),!0)},removeBody:function(a){returna.data.world==this.world&&(this.world.removeBody(a.data),this.onBodyRemoved.dispatch(a)),a},addSpring:function(a){returnthis.world.addSpring(ainstanceofPhaser.Physics.P2.Spring||ainstanceofPhaser.Physics.P2.RotationalSpring?a.data:a),this.onSpringAdded.dispatch(a),a},removeSpring:function(a){returnthis.world.removeSpring(ainstanceofPhaser.Physics.P2.Spring||ainstanceofPhaser.Physics.P2.RotationalSpring?a.data:a),this.onSpringRemoved.dispatch(a),a},createDistanceConstraint:function(a,b,c,d,e,f){returna=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(newPhaser.Physics.P2.DistanceConstraint(this,a,b,c,d,e,f)):voidconsole.warn("Cannot create Constraint, invalid body objects given")},createGearConstraint:function(a,b,c,d){returna=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(newPhaser.Physics.P2.GearConstraint(this,a,b,c,d)):voidconsole.warn("Cannot create Constraint, invalid body objects given")},createRevoluteConstraint:function(a,b,c,d,e,f){returna=this.getBody(a),c=this.getBody(c),a&&c?this.addConstraint(newPhaser.Physics.P2.RevoluteConstraint(this,a,b,c,d,e,f)):voidconsole.warn("Cannot create Constraint, invalid body objects given")},createLockConstraint:function(a,b,c,d,e){returna=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(newPhaser.Physics.P2.LockConstraint(this,a,b,c,d,e)):voidconsole.warn("Cannot create Constraint, invalid body objects given")},createPrismaticConstraint:function(a,b,c,d,e,f,g){returna=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(newPhaser.Physics.P2.PrismaticConstraint(this,a,b,c,d,e,f,g)):voidconsole.warn("Cannot create Constraint, invalid body objects given")},addConstraint:function(a){returnthis.world.addConstraint(a),this.onConstraintAdded.dispatch(a),a},removeConstraint:function(a){returnthis.world.removeConstraint(a),this.onConstraintRemoved.dispatch(a),a},addContactMaterial:function(a){returnthis.world.addContactMaterial(a),this.onContactMaterialAdded.dispatch(a),a},removeContactMaterial:function(a){returnthis.world.removeContactMaterial(a),this.onContactMaterialRemoved.dispatch(a),a},getContactMaterial:function(a,b){returnthis.world.getContactMaterial(a,b)},setMaterial:function(a,b){for(varc=b.length;c--;)b[c].setMaterial(a)},createMaterial:function(a,b){a=a||"";varc=newPhaser.Physics.P2.Material(a);returnthis.materials.push(c),"undefined"!=typeofb&&b.setMaterial(c),c},createContactMaterial:function(a,b,c){"undefined"==typeofa&&(a=this.createMaterial()),"undefined"==typeofb&&(b=this.createMaterial());vard=newPhaser.Physics.P2.ContactMaterial(a,b,c);returnthis.addContactMaterial(d)},getBodies:function(){for(vara=[],b=this.world.bodies.length;b--;)a.push(this.world.bodies[b].parent);returna},getBody:function(a){returnainstanceofp2.Body?a:ainstanceofPhaser.Physics.P2.Body?a.data:a.body&&a.body.type===Phaser.Physics.P2JS?a.body.data:null},getSprings:function(){for(vara=[],b=this.world.springs.length;b--;)a.push(this.world.springs[b].parent);returna},getConstraints:function(){for(vara=[],b=this.world.constraints.length;b--;)a.push(this.world.constraints[b].