UNPKG

phaser

Version:

A fast, free and fun HTML5 Game Framework for Desktop and Mobile web browsers from the team at Phaser Studio Inc.

1 lines 1.35 MB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(this,()=>(()=>{var t={50792(t){"use strict";var e=Object.prototype.hasOwnProperty,i="~";function r(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function n(t,e,r,n,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new s(r,n||t,a),h=i?i+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 a(t,e){0===--t._eventsCount?t._events=new r:delete t._events[e]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,r,s=[];if(0===this._eventsCount)return s;for(r in t=this._events)e.call(t,r)&&s.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},o.prototype.listeners=function(t){var e=i?i+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,n=r.length,a=new Array(n);s<n;s++)a[s]=r[s].fn;return a},o.prototype.listenerCount=function(t){var e=i?i+t:t,r=this._events[e];return r?r.fn?1:r.length:0},o.prototype.emit=function(t,e,r,s,n,a){var o=i?i+t:t;if(!this._events[o])return!1;var h,l,u=this._events[o],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,r),!0;case 4:return u.fn.call(u.context,e,r,s),!0;case 5:return u.fn.call(u.context,e,r,s,n),!0;case 6:return u.fn.call(u.context,e,r,s,n,a),!0}for(l=1,h=new Array(d-1);l<d;l++)h[l-1]=arguments[l];u.fn.apply(u.context,h)}else{var c,f=u.length;for(l=0;l<f;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),d){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,r);break;case 4:u[l].fn.call(u[l].context,e,r,s);break;default:if(!h)for(c=1,h=new Array(d-1);c<d;c++)h[c-1]=arguments[c];u[l].fn.apply(u[l].context,h)}}return!0},o.prototype.on=function(t,e,i){return n(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return n(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,r,s){var n=i?i+t:t;if(!this._events[n])return this;if(!e)return a(this,n),this;var o=this._events[n];if(o.fn)o.fn!==e||s&&!o.once||r&&o.context!==r||a(this,n);else{for(var h=0,l=[],u=o.length;h<u;h++)(o[h].fn!==e||s&&!o[h].once||r&&o[h].context!==r)&&l.push(o[h]);l.length?this._events[n]=1===l.length?l[0]:l:a(this,n)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&a(this,e)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,t.exports=o},93300(t,e,i){var r=i(10312);t.exports=function(t,e){Array.isArray(t)||(t=[t]),e||(e={});for(var i=void 0===e.threshold?.5:e.threshold,s=void 0===e.blurRadius?2:e.blurRadius,n=void 0===e.blurSteps?4:e.blurSteps,a=void 0===e.blurQuality?0:e.blurQuality,o=void 0===e.blendAmount?1:e.blendAmount,h=void 0===e.blendMode?r.ADD:e.blendMode,l=[],u=0;u<t.length;u++){var d=t[u];d.enableFilters&&d.enableFilters();var c=(e.useInternal?d.filters.internal:d.filters.external).addParallelFilters(),f=c.top.addThreshold(i,1),p=c.top.addBlur(a,s,s,1,16777215,n);c.blend.blendMode=h,c.blend.amount=o,l.push({item:d,parallelFilters:c,threshold:f,blur:p})}return l}},56704(t,e,i){var r=i(16438),s=i(10312),n=i(41337),a=i(95643),o=i(45650);t.exports=function(t,e){e||(e={}),Array.isArray(t)||(t=[t]);var i=t[0],h=i.scene,l=void 0===e.direction?.5:e.direction%(2*Math.PI),u=void 0===e.scale?2:e.scale,d=(e.radius||.5)/u,c=e.width||i.width||128,f=e.height||i.height||128,p={x:0,y:0};l<0&&(l+=2*Math.PI),l>3*Math.PI/2?p.y=1:l>Math.PI?(p.x=1,p.y=1):l>Math.PI/2&&(p.x=1);for(var g=[],m=0;m<t.length;m++){var v=t[m],y={origin:0,width:c,height:f,config:{offset:-d,repeatMode:3,shapeMode:0,direction:l,length:u,start:p,bands:e.bands||[{interpolation:2,colorStart:16777215,colorEnd:[1,1,1,0],size:d},{colorStart:[1,1,1,0],size:1-d}]}},x=h.make.gradient(y,!1);if(e.displacementMap){var T=e.displacement||.1;x.enableFilters().filters.internal.addDisplacement(e.displacementMap,T,T)}for(var w=o(),b=h.textures;b.exists(w);)w=o();var S=b.addDynamicTexture(w,x.width,x.height),C=h.tweens.add({targets:x,offset:1+d,repeat:-1,yoyo:!!e.yoyo,ease:e.ease,duration:e.duration||2e3,repeatDelay:e.repeatDelay||0,onUpdate:function(){S.clear().draw(x).render()}});v instanceof a&&v.enableFilters();var E,A,_=e.useExternal?v.filters.external:v.filters.internal,M=e.colorFactor||[1.15,.85,.85,1];e.reveal?E=_.addBlend(w,s.MULTIPLY,1,M):(E=(A=_.addParallelFilters()).top.addBlend(w,s.MULTIPLY,1,M),A.blend.blendMode=s.ADD);var R=function(){C.destroy(),S.destroy()};v instanceof a?v.on(n,R):v.on(r,R),g.push({item:v,dynamicTexture:S,gradient:x,tween:C,parallelFilters:A,blendFilter:E})}return g}},245(t,e,i){var r=i(95643),s=i(93232),n=i(94591);t.exports=function(t,e){Array.isArray(t)||(t=[t]),e||(e={});for(var i=void 0===e.aspectRatio?1:e.aspectRatio,a=e.padding||0,o=t[0].scene,h=[],l=0;l<t.length;l++){var u,d=t[l],c=e.region;switch(c||(c=e.useInternal&&d._sizeComponent?new s(0,0,d.width,d.height):new s(0,0,o.scale.width,o.scale.height)),e.shape){case"ellipse":u=o.add.ellipse(0,0,i,1,16777215);break;case"square":u=o.add.rectangle(0,0,1,1,16777215);break;case"rectangle":u=o.add.rectangle(0,0,i,1,16777215);break;default:u=o.add.circle(0,0,1,16777215)}o.children.remove(u),a&&(c=new s(c.x+a,c.y+a,c.width-2*a,c.height-2*a)),n(u,e.scaleMode,c),e.blurRadius>0&&u.enableFilters().filters.external.addBlur(e.blurQuality,e.blurRadius,e.blurRadius,1,void 0,e.blurSteps),d instanceof r&&d.enableFilters();var f=(e.useInternal?d.filters.internal:d.filters.external).addMask(u,e.invert);h.push(f)}return h}},11517(t,e,i){var r=i(38829);t.exports=function(t,e,i,s){for(var n=t[0],a=1;a<t.length;a++){var o=t[a];r(o,n,e,i,s),n=o}return t}},80318(t,e,i){var r=i(66979);t.exports=function(t,e,i,s,n){return r(t,"angle",e,i,s,n)}},60757(t){t.exports=function(t,e,i){for(var r=0;r<t.length;r++){var s=t[r];e.call(i,s)}return t}},94591(t,e,i){var r=i(87841),s=i(95540);t.exports=function(t,e,i,n){if(Array.isArray(t)||(t=[t]),void 0===e&&(e=0),!i){var a=t[0].scene;i=new r(0,0,a.scale.width,a.scale.height)}n||(n={});for(var o=0;o<t.length;o++){var h=t[o],l=s(n,"width",s(h,"width",1)),u=s(n,"height",s(h,"height",1)),d=s(n,"originX",s(h,"originX",.5)),c=s(n,"originY",s(h,"originY",.5));h.x=i.x+i.width*d,h.y=i.y+i.height*c;var f=i.width/l,p=i.height/u;switch(e){case-1:h.setScale(Math.min(f,p));break;case 0:h.setScale(f,p);break;case 1:h.setScale(Math.max(f,p))}}return h}},69927(t){t.exports=function(t,e,i){void 0===i&&(i=0);for(var r=i;r<t.length;r++){var s=t[r],n=!0;for(var a in e)s[a]!==e[a]&&(n=!1);if(n)return s}return null}},32265(t){t.exports=function(t,e,i){void 0===i&&(i=0);for(var r=t.length-1;r>=i;r--){var s=t[r],n=!0;for(var a in e)s[a]!==e[a]&&(n=!1);if(n)return s}return null}},94420(t,e,i){var r=i(11879),s=i(60461),n=i(95540),a=i(29747),o=new(i(41481))({sys:{queueDepthSort:a,events:{once:a}}},0,0,1,1).setOrigin(0,0);t.exports=function(t,e){void 0===e&&(e={});var i=e.hasOwnProperty("width"),a=e.hasOwnProperty("height"),h=n(e,"width",-1),l=n(e,"height",-1),u=n(e,"cellWidth",1),d=n(e,"cellHeight",u),c=n(e,"position",s.TOP_LEFT),f=n(e,"x",0),p=n(e,"y",0),g=0,m=0,v=h*u,y=l*d;o.setPosition(f,p),o.setSize(u,d);for(var x=0;x<t.length;x++)if(r(t[x],o,c),i&&-1===h)o.x+=u;else if(a&&-1===l)o.y+=d;else if(a&&!i){if(m+=d,o.y+=d,m===y&&(m=0,g+=u,o.y=p,o.x+=u,g===v))break}else if(g+=u,o.x+=u,g===v&&(g=0,m+=d,o.x=f,o.y+=d,m===y))break;return t}},41721(t,e,i){var r=i(66979);t.exports=function(t,e,i,s,n){return r(t,"alpha",e,i,s,n)}},67285(t,e,i){var r=i(66979);t.exports=function(t,e,i,s,n){return r(t,"x",e,i,s,n)}},9074(t,e,i){var r=i(66979);t.exports=function(t,e,i,s,n,a,o){return null==i&&(i=e),r(t,"x",e,s,a,o),r(t,"y",i,n,a,o)}},75222(t,e,i){var r=i(66979);t.exports=function(t,e,i,s,n){return r(t,"y",e,i,s,n)}},22983(t){t.exports=function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=6.28);for(var s=i,n=(r-i)/t.length,a=e.x,o=e.y,h=e.radius,l=0;l<t.length;l++)t[l].x=a+h*Math.cos(s),t[l].y=o+h*Math.sin(s),s+=n;return t}},95253(t){t.exports=function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=6.28);for(var s=i,n=(r-i)/t.length,a=e.width/2,o=e.height/2,h=0;h<t.length;h++)t[h].x=e.x+a*Math.cos(s),t[h].y=e.y+o*Math.sin(s),s+=n;return t}},88505(t,e,i){var r=i(15258),s=i(26708);t.exports=function(t,e,i){var n;n=i?s(e,i,t.length):r(e,t.length);for(var a=0;a<t.length;a++){var o=t[a],h=n[a];o.x=h.x,o.y=h.y}return t}},41346(t,e,i){var r=i(14649),s=i(86003),n=i(49498);t.exports=function(t,e,i){void 0===i&&(i=0);var a=r(e,!1,t.length);i>0?s(a,i):i<0&&n(a,Math.abs(i));for(var o=0;o<t.length;o++)t[o].x=a[o].x,t[o].y=a[o].y;return t}},11575(t,e,i){var r=i(84993);t.exports=function(t,e,i){var s=r({x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},i),n=r({x1:e.x2,y1:e.y2,x2:e.x3,y2:e.y3},i),a=r({x1:e.x3,y1:e.y3,x2:e.x1,y2:e.y1},i);s.pop(),n.pop(),a.pop();for(var o=(s=s.concat(n,a)).length/t.length,h=0,l=0;l<t.length;l++){var u=t[l],d=s[Math.floor(h)];u.x=d.x,u.y=d.y,h+=o}return t}},29953(t){t.exports=function(t,e,i){for(var r=0;r<t.length;r++){var s=t[r];s.anims&&s.anims.play(e,i)}return t}},66979(t){t.exports=function(t,e,i,r,s,n){var a;void 0===r&&(r=0),void 0===s&&(s=0),void 0===n&&(n=1);var o=0,h=t.length;if(1===n)for(a=s;a<h;a++)t[a][e]+=i+o*r,o++;else for(a=s;a>=0;a--)t[a][e]+=i+o*r,o++;return t}},43967(t){t.exports=function(t,e,i,r,s,n){var a;void 0===r&&(r=0),void 0===s&&(s=0),void 0===n&&(n=1);var o=0,h=t.length;if(1===n)for(a=s;a<h;a++)t[a][e]=i+o*r,o++;else for(a=s;a>=0;a--)t[a][e]=i+o*r,o++;return t}},88926(t,e,i){var r=i(28176);t.exports=function(t,e){for(var i=0;i<t.length;i++)r(e,t[i]);return t}},33286(t,e,i){var r=i(24820);t.exports=function(t,e){for(var i=0;i<t.length;i++)r(e,t[i]);return t}},96e3(t,e,i){var r=i(65822);t.exports=function(t,e){for(var i=0;i<t.length;i++)r(e,t[i]);return t}},28789(t,e,i){var r=i(26597);t.exports=function(t,e){for(var i=0;i<t.length;i++)r(e,t[i]);return t}},97154(t,e,i){var r=i(90260);t.exports=function(t,e){for(var i=0;i<t.length;i++)r(e,t[i]);return t}},20510(t,e,i){var r=i(66979);t.exports=function(t,e,i,s,n){return r(t,"rotation",e,i,s,n)}},91051(t,e,i){var r=i(1163),s=i(20339);t.exports=function(t,e,i){for(var n=e.x,a=e.y,o=0;o<t.length;o++){var h=t[o];r(h,n,a,i,Math.max(1,s(h.x,h.y,n,a)))}return t}},76332(t,e,i){var r=i(1163);t.exports=function(t,e,i,s){var n=e.x,a=e.y;if(0===s)return t;for(var o=0;o<t.length;o++)r(t[o],n,a,i,s);return t}},61619(t,e,i){var r=i(66979);t.exports=function(t,e,i,s,n){return r(t,"scaleX",e,i,s,n)}},94868(t,e,i){var r=i(66979);t.exports=function(t,e,i,s,n,a,o){return null==i&&(i=e),r(t,"scaleX",e,s,a,o),r(t,"scaleY",i,n,a,o)}},95532(t,e,i){var r=i(66979);t.exports=function(t,e,i,s,n){return r(t,"scaleY",e,i,s,n)}},8689(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n){return r(t,"alpha",e,i,s,n)}},2645(t,e,i){var r=i(43967);t.exports=function(t,e,i,s){return r(t,"blendMode",e,0,i,s)}},32372(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n){return r(t,"depth",e,i,s,n)}},85373(t){t.exports=function(t,e,i){for(var r=0;r<t.length;r++)t[r].setInteractive(e,i);return t}},81583(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n,a,o){return null==i&&(i=e),r(t,"originX",e,s,a,o),r(t,"originY",i,n,a,o),t.forEach(function(t){t.updateDisplayOrigin()}),t}},79939(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n){return r(t,"rotation",e,i,s,n)}},2699(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n,a,o){return null==i&&(i=e),r(t,"scaleX",e,s,a,o),r(t,"scaleY",i,n,a,o)}},98739(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n){return r(t,"scaleX",e,i,s,n)}},98476(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n){return r(t,"scaleY",e,i,s,n)}},6207(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n,a,o){return null==i&&(i=e),r(t,"scrollFactorX",e,s,a,o),r(t,"scrollFactorY",i,n,a,o)}},6607(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n){return r(t,"scrollFactorX",e,i,s,n)}},72248(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n){return r(t,"scrollFactorY",e,i,s,n)}},14036(t){t.exports=function(t,e,i,r,s){for(var n=0;n<t.length;n++)t[n].setTint(e,i,r,s);return t}},50159(t,e,i){var r=i(43967);t.exports=function(t,e,i,s){return r(t,"visible",e,0,i,s)}},77597(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n){return r(t,"x",e,i,s,n)}},83194(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n,a,o){return null==i&&(i=e),r(t,"x",e,s,a,o),r(t,"y",i,n,a,o)}},67678(t,e,i){var r=i(43967);t.exports=function(t,e,i,s,n){return r(t,"y",e,i,s,n)}},35850(t,e,i){var r=i(26099);t.exports=function(t,e,i,s,n){var a,o;void 0===s&&(s=0),void 0===n&&(n=new r);var h=t.length;if(1===h)a=t[0].x,o=t[0].y,t[0].x=e,t[0].y=i;else{var l=1,u=0;0===s&&(u=h-1,l=h-2),a=t[u].x,o=t[u].y,t[u].x=e,t[u].y=i;for(var d=0;d<h;d++)if(!(l>=h||-1===l)){var c=t[l],f=c.x,p=c.y;c.x=a,c.y=o,a=f,o=p,0===s?l--:l++}}return n.x=a,n.y=o,n}},8628(t,e,i){var r=i(33680);t.exports=function(t){return r(t)}},21837(t,e,i){var r=i(7602);t.exports=function(t,e,i,s,n){void 0===n&&(n=!1);var a,o=Math.abs(s-i)/t.length;if(n)for(a=0;a<t.length;a++)t[a][e]+=r(a*o,i,s);else for(a=0;a<t.length;a++)t[a][e]=r(a*o,i,s);return t}},21910(t,e,i){var r=i(54261);t.exports=function(t,e,i,s,n){void 0===n&&(n=!1);var a,o=Math.abs(s-i)/t.length;if(n)for(a=0;a<t.length;a++)t[a][e]+=r(a*o,i,s);else for(a=0;a<t.length;a++)t[a][e]=r(a*o,i,s);return t}},62054(t){t.exports=function(t,e,i,r,s){if(void 0===s&&(s=!1),0===t.length)return t;if(1===t.length)return s?t[0][e]+=(r+i)/2:t[0][e]=(r+i)/2,t;var n,a=Math.abs(r-i)/(t.length-1);if(s)for(n=0;n<t.length;n++)t[n][e]+=n*a+i;else for(n=0;n<t.length;n++)t[n][e]=n*a+i;return t}},79815(t){t.exports=function(t){for(var e=0;e<t.length;e++)t[e].visible=!t[e].visible;return t}},39665(t,e,i){var r=i(15994);t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=0;s<t.length;s++){var n=t[s];n.x=r(n.x,e.left-i,e.right+i),n.y=r(n.y,e.top-i,e.bottom+i)}return t}},61061(t,e,i){t.exports={AddEffectBloom:i(93300),AddEffectShine:i(56704),AddMaskShape:i(245),AlignTo:i(11517),Angle:i(80318),Call:i(60757),FitToRegion:i(94591),GetFirst:i(69927),GetLast:i(32265),GridAlign:i(94420),IncAlpha:i(41721),IncX:i(67285),IncXY:i(9074),IncY:i(75222),PlaceOnCircle:i(22983),PlaceOnEllipse:i(95253),PlaceOnLine:i(88505),PlaceOnRectangle:i(41346),PlaceOnTriangle:i(11575),PlayAnimation:i(29953),PropertyValueInc:i(66979),PropertyValueSet:i(43967),RandomCircle:i(88926),RandomEllipse:i(33286),RandomLine:i(96e3),RandomRectangle:i(28789),RandomTriangle:i(97154),Rotate:i(20510),RotateAround:i(91051),RotateAroundDistance:i(76332),ScaleX:i(61619),ScaleXY:i(94868),ScaleY:i(95532),SetAlpha:i(8689),SetBlendMode:i(2645),SetDepth:i(32372),SetHitArea:i(85373),SetOrigin:i(81583),SetRotation:i(79939),SetScale:i(2699),SetScaleX:i(98739),SetScaleY:i(98476),SetScrollFactor:i(6207),SetScrollFactorX:i(6607),SetScrollFactorY:i(72248),SetTint:i(14036),SetVisible:i(50159),SetX:i(77597),SetXY:i(83194),SetY:i(67678),ShiftPosition:i(35850),Shuffle:i(8628),SmootherStep:i(21910),SmoothStep:i(21837),Spread:i(62054),ToggleVisible:i(79815),WrapInRectangle:i(39665)}},42099(t,e,i){var r=i(45319),s=i(83419),n=i(74943),a=i(81957),o=i(41138),h=i(35154),l=i(90126),u=new s({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,h(i,"frames",[]),h(i,"defaultTextureKey",null),h(i,"sortFrames",!0)),this.frameRate=h(i,"frameRate",null),this.duration=h(i,"duration",null),this.msPerFrame,this.skipMissedFrames=h(i,"skipMissedFrames",!0),this.delay=h(i,"delay",0),this.repeat=h(i,"repeat",0),this.repeatDelay=h(i,"repeatDelay",0),this.yoyo=h(i,"yoyo",!1),this.showBeforeDelay=h(i,"showBeforeDelay",!1),this.showOnStart=h(i,"showOnStart",!1),this.hideOnComplete=h(i,"hideOnComplete",!1),this.randomFrame=h(i,"randomFrame",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(n.PAUSE_ALL,this.pause,this),this.manager.on(n.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(t,e,i,r){null===i&&null===r?(t.frameRate=24,t.duration=24/e*1e3):i&&null===r?(t.duration=i,t.frameRate=e/(i/1e3)):(t.frameRate=r,t.duration=e/r*1e3),t.msPerFrame=1e3/t.frameRate},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var r=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=r.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t<this.frames.length},getFirstTick:function(t){t.accumulator=0,t.nextTick=t.frameRate===t.currentAnim.frameRate&&t.currentFrame.duration||t.msPerFrame},getFrameAt:function(t){return this.frames[t]},getFrames:function(t,e,i,r){void 0===r&&(r=!0);var s,n,a,u,d=[],c=1;if("string"==typeof e){if(u=e,!t.exists(u))return console.warn('Texture "%s" not found',u),d;var f=t.get(u).getFrameNames();r&&l(f),e=[],f.forEach(function(t){e.push({key:u,frame:t})})}if(!Array.isArray(e)||0===e.length)return d;for(a=0;a<e.length;a++){var p=e[a],g=h(p,"key",i);if(g){var m=h(p,"frame",0),v=t.getFrame(g,m);v?((n=new o(g,m,c,v)).duration=h(p,"duration",0),n.isFirst=!s,s&&(s.nextFrame=n,n.prevFrame=s),d.push(n),s=n,c++):console.warn('Texture "%s" not found',g)}}if(d.length>0){n.isLast=!0,n.nextFrame=d[0],d[0].prevFrame=n;var y=1/(d.length-1);for(a=0;a<d.length;a++)d[a].progress=a*y}return d},getNextTick:function(t){t.accumulator-=t.nextTick,t.nextTick=t.frameRate===t.currentAnim.frameRate&&t.currentFrame.duration||t.msPerFrame},getFrameByProgress:function(t){return t=r(t,0,1),a(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t.yoyo?this.handleYoyoFrame(t,!1):t.repeatCounter>0?t.inReverse&&t.forward?t.forward=!1:this.repeatAnimation(t):t.complete():this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t.inReverse===!e&&t.repeatCounter>0)return(0===t.repeatDelay||t.pendingRepeat)&&(t.forward=e),void this.repeatAnimation(t);if(t.inReverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else t.complete()},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t.yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?(t.inReverse&&!t.forward||(t.forward=!0),this.repeatAnimation(t)):t.complete():this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.setCurrentFrame(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){if(0===t._pendingStopValue)return t.stop();t._pendingStopValue--}t.repeatDelay>0&&!t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t.repeatDelay):(t.repeatCounter--,t.forward?t.setCurrentFrame(t.currentFrame.nextFrame):t.setCurrentFrame(t.currentFrame.prevFrame),t.isPlaying&&(this.getNextTick(t),t.handleRepeat()))},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,showBeforeDelay:this.showBeforeDelay,showOnStart:this.showOnStart,randomFrame:this.randomFrame,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),r=0;r<e;r++)(t=this.frames[r]).index=r+1,t.isFirst=!1,t.isLast=!1,t.progress=r*i,0===r?(t.isFirst=!0,1===e?(t.isLast=!0,t.nextFrame=t,t.prevFrame=t):(t.isLast=!1,t.prevFrame=this.frames[e-1],t.nextFrame=this.frames[r+1])):r===e-1&&e>1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[r-1],t.nextFrame=this.frames[r+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off&&(this.manager.off(n.PAUSE_ALL,this.pause,this),this.manager.off(n.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=u},41138(t,e,i){var r=new(i(83419))({initialize:function(t,e,i,r,s){void 0===s&&(s=!1),this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=r,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=s},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}});t.exports=r},60848(t,e,i){var r=i(42099),s=i(83419),n=i(90330),a=i(50792),o=i(74943),h=i(8443),l=i(95540),u=i(35154),d=i(36383),c=i(20283),f=i(41836),p=new s({Extends:a,initialize:function(t){a.call(this),this.game=t,this.textureManager=null,this.globalTimeScale=1,this.anims=new n,this.mixes=new n,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)},addMix:function(t,e,i){var r=this.anims,s=this.mixes,n="string"==typeof t?t:t.key,a="string"==typeof e?e:e.key;if(r.has(n)&&r.has(a)){var o=s.get(n);o||(o={}),o[a]=i,s.set(n,o)}return this},removeMix:function(t,e){var i=this.mixes,r="string"==typeof t?t:t.key,s=i.get(r);if(s)if(e){var n="string"==typeof e?e:e.key;s.hasOwnProperty(n)&&delete s[n]}else e||i.delete(r);return this},getMix:function(t,e){var i=this.mixes,r="string"==typeof t?t:t.key,s="string"==typeof e?e:e.key,n=i.get(r);return n&&n.hasOwnProperty(s)?n[s]:0},add:function(t,e){return this.anims.has(t)?(console.warn("Animation key exists: "+t),this):(e.key=t,this.anims.set(t,e),this.emit(o.ADD_ANIMATION,t,e),this)},exists:function(t){return this.anims.has(t)},createFromAseprite:function(t,e,i){var r=[],s=this.game.cache.json.get(t);if(!s)return console.warn("No Aseprite data found for: "+t),r;var n=this,a=u(s,"meta",null),o=u(s,"frames",null);a&&o&&u(a,"frameTags",[]).forEach(function(s){var a=[],h=l(s,"name",null),u=l(s,"from",0),c=l(s,"to",0),f=l(s,"direction","forward");if(h&&(!e||e&&e.indexOf(h)>-1)){for(var p=0,g=u;g<=c;g++){var m=g.toString(),v=o[m];if(v){var y=l(v,"duration",d.MAX_SAFE_INTEGER);a.push({key:t,frame:m,duration:y}),p+=y}}"reverse"===f&&(a=a.reverse());var x,T={key:h,frames:a,duration:p,yoyo:"pingpong"===f};i?i.anims&&(x=i.anims.create(T)):x=n.create(T),x&&r.push(x)}});return r},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("AnimationManager key already exists: "+e):(i=new r(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 r=0;r<t.anims.length;r++)i.push(this.create(t.anims[r]));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",""),r=u(e,"start",0),s=u(e,"end",0),n=u(e,"suffix",""),a=u(e,"zeroPad",0),o=u(e,"outputArray",[]),h=u(e,"frames",!1);if(!this.textureManager.exists(t))return console.warn('Texture "%s" not found',t),o;var l,d=this.textureManager.get(t);if(!d)return o;if(e)for(h||(h=c(r,s)),l=0;l<h.length;l++){var p=i+f(h[l],a,"0",1)+n;d.has(p)?o.push({key:t,frame:p}):console.warn('Frame "%s" not found in texture "%s"',p,t)}else for(h=d.getFrameNames(),l=0;l<h.length;l++)o.push({key:t,frame:h[l]});return o},generateFrameNumbers:function(t,e){var i=u(e,"start",0),r=u(e,"end",-1),s=u(e,"first",!1),n=u(e,"outputArray",[]),a=u(e,"frames",!1);if(!this.textureManager.exists(t))return console.warn('Texture "%s" not found',t),n;var o=this.textureManager.get(t);if(!o)return n;s&&o.has(s)&&n.push({key:t,frame:s}),a||(-1===r&&(r=o.frameTotal-2),a=c(i,r));for(var h=0;h<a.length;h++){var l=a[h];o.has(l)?n.push({key:t,frame:l}):console.warn('Frame "%s" not found in texture "%s"',l,t)}return n},get:function(t){return this.anims.get(t)},getAnimsFromTexture:function(t){for(var e=this.textureManager.get(t).key,i=this.anims.getArray(),r=[],s=0;s<i.length;s++)for(var n=i[s],a=n.frames,o=0;o<a.length;o++)if(a[o].textureKey===e){r.push(n.key);break}return r},pauseAll:function(){return this.paused||(this.paused=!0,this.emit(o.PAUSE_ALL)),this},play:function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++)e[i].anims.play(t);return this},staggerPlay:function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=!0),Array.isArray(e)||(e=[e]);var s=e.length;r||s--;for(var n=0;n<e.length;n++){var a=i<0?Math.abs(i)*(s-n):i*n;e[n].anims.playAfterDelay(t,a)}return this},remove:function(t){var e=this.get(t);return e&&(this.emit(o.REMOVE_ANIMATION,t,e),this.anims.delete(t),this.removeMix(t)),e},resumeAll:function(){return this.paused&&(this.paused=!1,this.emit(o.RESUME_ALL)),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.mixes.clear(),this.textureManager=null,this.game=null}});t.exports=p},9674(t,e,i){var r=i(42099),s=i(30976),n=i(83419),a=i(90330),o=i(74943),h=i(95540),l=new n({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.on(o.REMOVE_ANIMATION,this.globalRemove,this),this.textureManager=this.animationManager.textureManager,this.anims=null,this.isPlaying=!1,this.hasStarted=!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.randomFrame=!1,this.delay=0,this.repeat=0,this.repeatDelay=0,this.yoyo=!1,this.showBeforeDelay=!1,this.showOnStart=!1,this.hideOnComplete=!1,this.forward=!0,this.inReverse=!1,this.accumulator=0,this.nextTick=0,this.delayCounter=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},chain:function(t){var e=this.parent;if(void 0===t)return this.nextAnimsQueue.length=0,this.nextAnim=null,e;Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var r=t[i];this.nextAnim?this.nextAnimsQueue.push(r):this.nextAnim=r}return this.parent},getName:function(){return this.currentAnim?this.currentAnim.key:""},getFrameName:function(){return this.currentFrame?this.currentFrame.textureFrame:""},load:function(t){this.isPlaying&&this.stop();var e=this.animationManager,i="string"==typeof t?t:h(t,"key",null),r=this.exists(i)?this.get(i):e.get(i);if(r){this.currentAnim=r;var n=r.getTotalFrames(),a=h(t,"frameRate",r.frameRate),o=h(t,"duration",r.duration);r.calculateDuration(this,n,o,a),this.delay=h(t,"delay",r.delay),this.repeat=h(t,"repeat",r.repeat),this.repeatDelay=h(t,"repeatDelay",r.repeatDelay),this.yoyo=h(t,"yoyo",r.yoyo),this.showBeforeDelay=h(t,"showBeforeDelay",r.showBeforeDelay),this.showOnStart=h(t,"showOnStart",r.showOnStart),this.hideOnComplete=h(t,"hideOnComplete",r.hideOnComplete),this.skipMissedFrames=h(t,"skipMissedFrames",r.skipMissedFrames),this.randomFrame=h(t,"randomFrame",r.randomFrame),this.timeScale=h(t,"timeScale",this.timeScale);var l=h(t,"startFrame",0);l>n&&(l=0),this.randomFrame&&(l=s(0,n-1));var u=r.frames[l];0!==l||this.forward||(u=r.getLastFrame()),this.currentFrame=u}else console.warn("Missing animation: "+i);return this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){if(this.isPlaying){var i=this.nextAnim,r=this.nextAnimsQueue;i&&r.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e}else this.delayCounter=e,this.play(t,!0);return this.parent},playAfterRepeat:function(t,e){if(void 0===e&&(e=1),this.isPlaying){var i=this.nextAnim,r=this.nextAnimsQueue;i&&r.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e}else this.play(t);return this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,r=this.parent,s="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===s)return r;if(i&&this.isPlaying){var n=this.animationManager.getMix(i.key,t);if(n>0)return this.playAfterDelay(t,n)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t)},playReverse:function(t,e){void 0===e&&(e=!1);var i="string"==typeof t?t:t.key;return e&&this.isPlaying&&this.currentAnim.key===i?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t))},startAnimation:function(t){this.load(t);var e=this.currentAnim,i=this.parent;return e?(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat,e.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,0===this.delayCounter?this.handleStart():this.showBeforeDelay&&this.setCurrentFrame(this.currentFrame),i):i},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(o.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(o.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(o.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(o.ANIMATION_COMPLETE,o.ANIMATION_COMPLETE_KEY)},emitEvents:function(t,e){var i=this.currentAnim;if(i){var r=this.currentFrame,s=this.parent,n=r.textureFrame;s.emit(t,i,r,s,n),e&&s.emit(e+i.key,i,r,s,n)}},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var t=this.currentFrame;if(!t)return 0;var e=t.progress;return this.inReverse&&(e*=-1),e},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},setRepeat:function(t){return this.repeatCounter=-1===t?Number.MAX_VALUE:t,this.parent},globalRemove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var i=this.currentAnim,r=this.parent;return i?(e&&(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat),i.getFirstTick(this),this.emitEvents(o.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!t,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(i.frames[0]),this.parent):r},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(t)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.delayCounter=0,this.currentAnim&&this.handleStop(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(t)}return this.parent},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopAfterRepeat:function(t){return void 0===t&&(t=1),-1!==this.repeatCounter&&t>this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale*this.animationManager.globalTimeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var r=0;do{this.forward?i.nextFrame(this):i.previousFrame(this),r++}while(this.isPlaying&&this.accumulator>this.nextTick&&r<60)}}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},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),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(o.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("Animation key already exists: "+e):(i=new r(this,e,t),this.anims||(this.anims=new a),this.anims.set(e,i))),i},createFromAseprite:function(t,e){return this.animationManager.createFromAseprite(t,e,this.parent)},generateFrameNames:function(t,e){return this.animationManager.generateFrameNames(t,e)},generateFrameNumbers:function(t,e){return this.animationManager.generateFrameNumbers(t,e)},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(o.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=l},57090(t){t.exports="add"},25312(t){t.exports="animationcomplete"},89580(t){t.exports="animationcomplete-"},52860(t){t.exports="animationrepeat"},63850(t){t.exports="animationrestart"},99085(t){t.exports="animationstart"},28087(t){t.exports="animationstop"},1794(t){t.exports="animationupdate"},52562(t){t.exports="pauseall"},57953(t){t.exports="remove"},68339(t){t.exports="resumeall"},74943(t,e,i){t.exports={ADD_ANIMATION:i(57090),ANIMATION_COMPLETE:i(25312),ANIMATION_COMPLETE_KEY:i(89580),ANIMATION_REPEAT:i(52860),ANIMATION_RESTART:i(63850),ANIMATION_START:i(99085),ANIMATION_STOP:i(28087),ANIMATION_UPDATE:i(1794),PAUSE_ALL:i(52562),REMOVE_ANIMATION:i(57953),RESUME_ALL:i(68339)}},60421(t,e,i){t.exports={Animation:i(42099),AnimationFrame:i(41138),AnimationManager:i(60848),AnimationState:i(9674),Events:i(74943)}},2161(t,e,i){var r=i(83419),s=i(90330),n=i(50792),a=i(24736),o=new r({initialize:function(){this.entries=new s,this.events=new n},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},24047(t,e,i){var r=i(2161),s=i(83419),n=i(8443),a=new s({initialize:function(t){this.game=t,this.binary=new r,this.bitmapFont=new r,this.json=new r,this.physics=new r,this.shader=new r,this.audio=new r,this.video=new r,this.text=new r,this.html=new r,this.tilemap=new r,this.xml=new r,this.atlas=new r,this.custom={},this.game.events.once(n.DESTROY,this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new r),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","video","text","html","tilemap","xml","atlas"],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},51464(t){t.exports="add"},59261(t){t.exports="remove"},24736(t,e,i){t.exports={ADD:i(51464),REMOVE:i(59261)}},83388(t,e,i){t.exports={BaseCache:i(2161),CacheManager:i(24047),Events:i(24736)}},71911(t,e,i){var r=i(83419),s=i(39506),n=i(50792),a=i(19715),o=i(87841),h=i(88509),l=i(61340),u=i(59715),d=i(80333),c=i(26099),f=new r({Extends:n,Mixins:[h,u],initialize:function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),n.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.roundPixels=!1,this.useBounds=!1,this.worldView=new o,this.dirty=!0,this._x=t,this._y=e,this._width=i,this._height=r,this._bounds=new o,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new l,this.matrixCombined=new l,this.matrixExternal=new l,this.transparent=!0,this.backgroundColor=d("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new c(i/2,r/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null,this.renderList=[],this.isSceneCamera=!0,this.forceComposite=!1,this.renderRoundPixels=!0},addToRenderList:function(t){this.renderList.push(t)},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 c);var r=.5*this.width,s=.5*this.height;return i.x=t-r,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],r=e[1],s=e[2],n=e[3],a=i*n-r*s;if(!a)return t;var o=this.scrollX,h=this.scrollY,l=this.width,u=this.height,d=this.y,c=d+u,f=this.x,p=f+l,g=this.culledObjects,m=t.length;a=1/a,g.length=0;for(var v=0;v<m;++v){var y=t[v];if(y.hasOwnProperty("width")&&!y.parentContainer){var x=y.width,T=y.height,w=y.x-o*y.scrollFactorX-x*y.originX,b=y.y-h*y.scrollFactorY-T*y.originY;(w+x)*i+(b+T)*s>f&&w*i+b*s<p&&(w+x)*r+(b+T)*n>d&&w*r+b*n<c&&g.push(y)}else g.push(y)}return g},getWorldPoint:function(t,e,i){void 0===i&&(i=new c);var r=this.matrixCombined.matrix,s=r[0],n=r[1],a=r[2],o=r[3],h=r[4],l=r[5],u=s*o-n*a;if(!u)return i.x=t,i.y=e,i;var d=o*(u=1/u),f=-n*u,p=-a*u,g=s*u,m=(a*l-o*h)*u,v=(n*h-s*l)*u;return i.x=t*d+e*p+m,i.y=t*f+e*g+v,i},ignore:function(t){var e=this.id;Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var r=t[i];Array.isArray(r)?this.ignore(r):r.isParent?this.ignore(r.getChildren()):r.cameraFilter|=e}return this},clampX:function(t){var e=this._bounds,i=this.displayWidth,r=e.x+(i-this.width)/2,s=Math.max(r,r+e.width-i);return t<r?t=r:t>s&&(t=s),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,r=e.y+(i-this.height)/2,s=Math.max(r,r+e.height-i);return t<r?t=r:t>s&&(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=s(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=d(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,r,s){return void 0===s&&(s=!1),this._bounds.setTo(t,e,i,r),this.dirty=!0,this.useBounds=!0,s?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},setForceComposite:function(t){return this.forceComposite=t,this},getBounds:function(t){void 0===t&&(t=new o);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,e){void 0===e&&(e=!0),this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t,this.isSceneCamera=e;var i=t.sys;return this.sceneManager=i.game.scene,this.scaleManager=i.scale,this.cameraManager=i.cameras,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,r){return this.x=t,this.y=e,this.width=i,this.height=r,this},setZoom:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),0===t&&(t=.001),0===e&&(e=.001),this.zoomX=t,this.zoomY=e,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(){},setIsSceneCamera:function(t){return this.isSceneCamera=t,this},updateSystem:function(){if(this.scaleManager&&this.isSceneCamera){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(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.matrixCombined.destroy(),this.matrixExternal.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this.renderList=[],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.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){t!==this._scrollX&&(this._scrollX=t,this.dirty=!0)}},scrollY:{get:function(){return this._scrollY},set:function(t){t!==this._scrollY&&(this._scrollY=t,this.dirty=!0)}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(t){this._zoomX=t,this._zoomY=t,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(t){this._zoomX=t,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(t){this._zoomY=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.zoomX}},displayHeight:{get:function(){return this.height/this.zoomY}}});t.exports=f},38058(t,e,i){var r=i(71911),s=i(67502),n=i(45319),a=i(83419),o=i(31401),h=i(20052),l=i(19715),u=i(28915),d=i(87841),c=i(26099),f=new a({Extends:r,initialize:function(t,e,i,s){r.call(this,t,e,i,s),this.filters={internal:new o.FilterList(this),external:new o.FilterList(this)},this.isObjectInversion=!1,this.inputEnabled=!0,this.fadeEffect=new h.Fade(this),this.flashEffect=new h.Flash(this),this.shakeEffect=new h.Shake(this),this.panEffect=new h.Pan(this),this.rotateToEffect=new h.RotateTo(this),this.zoomEffect=new h.Zoom(this),this.lerp=new c(1,1),this.followOffset=new c,this.deadzone=null,this._follow=null},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 d(0,0,t,e),this._follow){var i=this.width/2,r=this.height/2,n=this._follow.x-this.followOffset.x,a=this._follow.y-this.followOffset.y;this.midPoint.set(n,a),this.scrollX=n-i,this.scrollY=a-r}s(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,r,s,n){return this.fadeEffect.start(!1,t,e,i,r,!0,s,n)},fadeOut:function(t,e,i,r,s,n){return this.fadeEffect.start(!0,t,e,i,r,!0,s,n)},fadeFrom:function(t,e,i,r,s,n,a){return this.fadeEffect.start(!1,t,e,i,r,s,n,a)},fade:function(t,e,i,r,s,n,a){return this.fadeEffect.start(!0,t,e,i,r,s,n,a)},flash:function(t,e,i,r,s,n,a){return this.flashEffect.start(t,e,i,r,s,n,a)},shake:function(t,e,i,r,s){return this.shakeEffect.start(t,e,i,r,s)},pan:function(t,e,i,r,s,n,a){return this.panEffect.start(t,e,i,r,s,n,a)},rotateTo:function(t,e,i,r,s,n,a){return this.rotateToEffect.start(t,e,i,r,s,n,a)},zoomTo:function(t,e,i,r,s,n){return this.zoomEffect.start(t,e,i,r,s,n)},preRender:function(){this.renderList.length=0;var t=this.width,e=this.height,i=.5*t,r=.5*e,n=this.zoomX,a=this.zoomY;this.renderRoundPixels=this.roundPixels&&Number.isInteger(n)&&Number.isInteger(a);var o=t*this.originX,h=e*this.originY,d=this._follow,c=this.deadzone,f=this.scrollX,p=this.scrollY;c&&s(c,this.midPoint.x,this.midPoint.y);var g=!1;if(d&&!this.panEffect.isRunning){var m=this.lerp,v=d.x-this.followOffset.x,y=d.y-this.followOffset.y;c?(v<c.x?f=u(f,f-(c.x-v),m.x):v>c.right&&(f=u(f,f+(v-c.right),m.x)),y<c.y?p=u(p,p-(c.y-y),m.y):y>c.bottom&&(p=u(p,p+(y-c.bottom),m.y))):(f=u(f,v-o,m.x),p=u(p,y-h,m.y)),g=!0}this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.scrollX=f,this.scrollY=p;var x=f+i,T=p+r;this.midPoint.set(x,T);var w=t/n,b=e/a,S=x-w/2,C=T-b/2;this.worldView.setTo(S,C,w,b);var E=this.matrix,A=this.matrixExternal;this.isObjectInversion?(E.loadIdentity(),E.translate(o,h),E.scale(n,a),E.rotate(this.rotation),E.translate(-f-o,-p-h)):(E.applyITRS(o,h,this.rotation,n,a),E.translate(-f-o,-p-h)),A.applyITRS(this.x,this.y,0,1,1),this.shakeEffect.preRender(),A.multiply(E,this.matrixCombined),g&&this.emit(l.FOLLOW_UPDATE,this,d)},getViewMatrix:function(t){return t||this.forceComposite||this.filters.external.length>0||this.filters.internal.length>0?this.matrix:this.matrixCombined},getPaddingWrapper:function(t){var e={padding:0},i=new Proxy(this,{get:function(t,i){switch(i){case"padding":return e.padding;case"x":case"y":case"scrollX":case"scrollY":return t[i]+e.padding;case"width":case"height":return t[i]-2*e.padding;default:return t[i]}},set:function(i,r,s){switch(r){case"padding":var n=e.padding;e.padding=s;var a=e.padding-n;return i.x-=a,i.y-=a,i.width+=2*a,i.height+=2*a,i.scrollX-=a,i.scrollY-=a,t;case"x":case"y":case"scrollX":case"scrollY":return i[r]=s-e.padding;case"width":case"height":return i[r]=s+2*e.padding;default:return i[r]=s}}});return i.padding=t||0,i},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,r,s,a){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===r&&(r=i),void 0===s&&(s=0),void 0===a&&(a=s),this._follow=t,this.roundPixels=e,i=n(i,0,1),r=n(r,0,1),this.lerp.set(i,r),this.followOffset.set(s,a);var o=this.width/2,h=this.height/2,l=t.x-s,u=t.y-a;return this.midPoint.set(l,u),this.scrollX=l-o,this.scrollY=u-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.resetFX(),this.filters.internal.destroy(),this.filters.external.destroy(),r.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},32743(t,e,i){var r=i(38058),s=i(83419),n=i(95540),a=i(37277),o=i(37303),h=i(97480),l=i(44594),u=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.r