!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()}(window,function(){return function(t){var e={};function i(s){if(e[s])return e[s].exports;var n=e[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:s})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},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=1026)}([function(t,e){function i(t,e,i){var s=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&s.value&&"object"==typeof s.value&&(s=s.value),!(!s||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(s))&&(void 0===s.enumerable&&(s.enumerable=!0),void 0===s.configurable&&(s.configurable=!0),s)}function s(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function n(t,e,n,r){for(var o in e)if(e.hasOwnProperty(o)){var h=i(e,o,n);if(!1!==h){if(s((r||t).prototype,o)){if(a.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=e[o]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i0&&(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},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,s=this.y;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this},transformMat3:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this},transformMat4:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[4]*i+s[12],this.y=s[1]*e+s[5]*i+s[13],this},reset:function(){return this.x=0,this.y=0,this}});s.ZERO=new s,t.exports=s},function(t,e){var i={},s={install:function(t){for(var e in i)t[e]=i[e]},register:function(t,e){i[t]=e},destroy:function(){i={}}};t.exports=s},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){"use strict";var s=Object.prototype.hasOwnProperty,n="~";function r(){}function a(t,e,i,s,r){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new function(t,e,i){this.fn=t,this.context=e,this.once=i||!1}(i,s||t,r),o=n?n+e:e;return t._events[o]?t._events[o].fn?t._events[o]=[t._events[o],a]:t._events[o].push(a):(t._events[o]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function h(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),h.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)s.call(t,e)&&i.push(n?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},h.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var s=0,r=i.length,a=new Array(r);s=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=u},function(t,e,i){t.exports={Alpha:i(587),Animation:i(302),BlendMode:i(586),ComputedSize:i(585),Depth:i(584),Flip:i(583),GetBounds:i(582),Mask:i(581),MatrixStack:i(580),Origin:i(579),Pipeline:i(291),ScaleMode:i(578),ScrollFactor:i(577),Size:i(576),Texture:i(575),Tint:i(574),ToJSON:i(573),Transform:i(572),TransformMatrix:i(64),Visible:i(571)}},function(t,e,i){var s=i(297),n={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:new s};t.exports=n},function(t,e,i){var s=i(8),n=function(){var t,e,i,r,a,o,h=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},u=2),l===u&&(h=this,--u);u=400&&t.status<=599&&(i=!1),this.resetXHR(),this.loader.nextFile(this,i)},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("fileprogress",this,this.percentComplete))},onProcess:function(){this.state=n.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=n.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){this.state=n.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("filecomplete",e,i,t),this.loader.emit("filecomplete_"+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 s=new FileReader;s.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+s.result.split(",")[1]},s.onerror=t.onerror,s.readAsDataURL(e)}},l.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=l},function(t,e,i){var s={VERSION:"3.10.1",BlendModes:i(51),ScaleModes:i(59),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=s},,function(t,e,i){var s,n,r,a=i(20),o=i(131),h=[],u=!1;t.exports={create2D:function(t,e,i){return s(t,e,i,a.CANVAS)},create:s=function(t,e,i,s,r){var l;void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=a.CANVAS),void 0===r&&(r=!1);var c=n(s);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:s},s===a.CANVAS&&h.push(c),l=c.canvas):(c.parent=t,l=c.canvas),r&&(c.parent=l),l.width=e,l.height=i,u&&s===a.CANVAS&&o.disable(l.getContext("2d")),l},createWebGL:function(t,e,i){return s(t,e,i,a.WEBGL)},disableSmoothing:function(){u=!0},enableSmoothing:function(){u=!1},first:n=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e>>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,s=0;sn||e>=i||i>n||e+i>n){if(s)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e,i){var s=i(0),n=i(152),r=i(284),a=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=255),this.r=0,this.g=0,this.b=0,this.a=255,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,s)},transparent:function(){return this.red=0,this.green=0,this.blue=0,this.alpha=0,this.update()},setTo:function(t,e,i,s){return void 0===s&&(s=255),this.red=t,this.green=e,this.blue=i,this.alpha=s,this.update()},setGLTo:function(t,e,i,s){return void 0===s&&(s=1),this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=s,this.update()},setFromRGB:function(t){return this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this.update()},update:function(){return this._color=n(this.r,this.g,this.b),this._color32=r(this.r,this.g,this.b,this.a),this._rgba="rgba("+this.r+","+this.g+","+this.b+","+this.a/255+")",this},clone:function(){return new a(this.r,this.g,this.b,this.a)},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()}},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()}},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()}},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()}},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()}},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()}},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()}}});t.exports=a},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){t.exports=function(t,e,i){return t.radius>0&&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){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,i){var s=i(0),n=i(15),r=i(2),a=i(556),o=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.ScaleMode,n.ScrollFactor,n.Size,n.Texture,n.Tint,n.Transform,n.Visible,a],initialize:function(t,e,i,s,a){r.call(this,t,"Sprite"),this.anims=new n.Animation(this),this.setTexture(s,a),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline("TextureTintPipeline")},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 n.ToJSON(this)}});t.exports=o},,function(t,e,i){var s=new(i(0))({initialize:function(t,e,i,s){this.loader=t,this.type=e,this.key=i,this.files=s,this.complete=!1,this.pending=s.length,this.failed=0,this.config={};for(var n=0;n=t.length)){for(var i=t.length-1,s=t[e],n=e;n=0&&v>=0&&m+v<1}},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){t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},function(t,e,i){var s=i(453);t.exports=function(t,e){if("string"==typeof t&&s.hasOwnProperty(t)){if(e){var i=e.slice(0);return i.unshift(0),function(e){return i[0]=e,s[t].apply(this,i)}}return s[t]}return"function"==typeof t?t:(Array.isArray(t)&&t.length,s.Power0)}},function(t,e,i){var s=new(i(0))({initialize:function(t,e,i,s,n,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=1),void 0===n&&(n=0),void 0===r&&(r=0),this.matrix=new Float32Array([t,e,i,s,n,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}},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)}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.c*this.c)}},scaleY:{get:function(){return Math.sqrt(this.b*this.b+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),s=this.matrix,n=s[0],r=s[1],a=s[2],o=s[3];return s[0]=n*i+a*e,s[1]=r*i+o*e,s[2]=n*-e+a*i,s[3]=r*-e+o*i,this},multiply:function(t){var e=this.matrix,i=t.matrix,s=e[0],n=e[1],r=e[2],a=e[3],o=e[4],h=e[5],u=i[0],l=i[1],c=i[2],d=i[3],f=i[4],p=i[5];return e[0]=u*s+l*r,e[1]=u*n+l*a,e[2]=c*s+d*r,e[3]=c*n+d*a,e[4]=f*s+p*r+o,e[5]=f*n+p*a+h,this},transform:function(t,e,i,s,n,r){var a=this.matrix,o=a[0],h=a[1],u=a[2],l=a[3],c=a[4],d=a[5];return a[0]=t*o+e*u,a[1]=t*h+e*l,a[2]=i*o+s*u,a[3]=i*h+s*l,a[4]=n*o+r*u+c,a[5]=n*h+r*l+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var s=this.matrix,n=s[0],r=s[1],a=s[2],o=s[3],h=s[4],u=s[5];return i.x=t*n+e*a+h,i.y=t*r+e*o+u,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=e*n-i*s;return t[0]=n/o,t[1]=-i/o,t[2]=-s/o,t[3]=e/o,t[4]=(s*a-n*r)/o,t[5]=-(e*a-i*r)/o,this},setTransform:function(t,e,i,s,n,r){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=s,a[4]=n,a[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],s=e[1],n=e[2],r=e[3],a=i*i,o=s*s,h=n*n,u=r*r,l=Math.sqrt(a+h),c=Math.sqrt(o+u);return t.translateX=e[4],t.translateY=e[5],t.scaleX=l,t.scaleY=c,t.rotation=Math.acos(i/l)*(Math.atan(-n/i)<0?-1:1),t},applyITRS:function(t,e,i,s,n){var r=this.matrix,a=Math.sin(i),o=Math.cos(i);return r[4]=t,r[5]=e,r[0]=o*s,r[1]=a*s,r[2]=-a*n,r[3]=o*n,this},destroy:function(){this.matrix=null,this.decomposedMatrix=null}});t.exports=s},function(t,e,i){var s=i(23);t.exports=function(t,e,i){return(i-e)*(t=s(t,0,1))}},,,function(t,e,i){var s=i(0),n=i(60),r=i(227),a=i(226),o=i(96),h=i(153),u=new s({initialize:function(t,e,i,s,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=n,this.y3=r},contains:function(t,e){return n(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,s,n,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=n,this.y3=r,this},getLineA:function(t){return void 0===t&&(t=new o),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new o),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new o),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=0;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=0;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=0;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=0;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=u},function(t,e,i){var s=i(0),n=i(15),r=i(2),a=i(461),o=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.ScaleMode,n.ScrollFactor,n.Size,n.Texture,n.Tint,n.Transform,n.Visible,a],initialize:function(t,e,i,s,n){r.call(this,t,"Image"),this.setTexture(s,n),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline("TextureTintPipeline")}});t.exports=o},function(t,e,i){var s=new(i(0))({initialize:function(t){if(this.entries=[],Array.isArray(t))for(var e=0;e-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new s;return t.entries.forEach(function(t){e.set(t)}),this.entries.forEach(function(t){e.set(t)}),e},intersect:function(t){var e=new s;return this.entries.forEach(function(i){t.contains(i)&&e.set(i)}),e},difference:function(t){var e=new s;return this.entries.forEach(function(i){t.contains(i)||e.set(i)}),e},size:{get:function(){return this.entries.length},set:function(t){return this.entries.length=t}}});t.exports=s},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,i){var s=i(100),n=i(10),r=i(62),a=i(63),o=i(73),h=i(163),u=i(102),l=i(4),c=i(101),d=i(99),f=i(98);t.exports=function(t,e,i){void 0===i&&(i=s);for(var p=i.targets?i.targets:u(e),g=h(e),m=o(e,"delay",i.delay),v=o(e,"duration",i.duration),y=l(e,"easeParams",i.easeParams),x=a(l(e,"ease",i.ease),y),w=o(e,"hold",i.hold),T=o(e,"repeat",i.repeat),S=o(e,"repeatDelay",i.repeatDelay),b=r(e,"yoyo",i.yoyo),A=r(e,"flipX",i.flipX),E=r(e,"flipY",i.flipY),_=[],C=0;C=0;i--){var s=this.sounds[i];s.key===t&&(s.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit("pauseall",this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit("resumeall",this)},stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit("stopall",this)},unlock:a,onBlur:a,onFocus:a,update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit("unlocked",this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.removeAllListeners(),this.forEachActiveSound(function(t){t.destroy()}),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(s,n){s.pendingRemove||t.call(e||i,s,n,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("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("detune",this,t)}}});t.exports=o},function(t,e,i){var s,n=i(57),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=(s=navigator.userAgent,/Edge\/\d+/.test(s)?r.edge=!0:/Chrome\/(\d+)/.test(s)&&!n.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10)):/Firefox\D+(\d+)/.test(s)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(s)&&n.iOS?r.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(s)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Opera/.test(s)?r.opera=!0:/Safari/.test(s)&&!n.windowsPhone?r.safari=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(s)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(s)&&(r.silk=!0),r)},function(t,e,i){var s=new(i(0))({initialize:function(t,e){this.parent=t,this.events=e,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=[],s=0;su&&(r=u),a>u&&(a=u),o=n,h=r;;)if(o=this.vertexCapacity},resize:function(t,e,i){return this.width=t*i,this.height=e*i,this},bind:function(){var t=this.gl,e=this.vertexBuffer,i=this.attributes,s=this.program,n=this.renderer,r=this.vertexSize;n.setProgram(s),n.setVertexBuffer(e);for(var a=0;a=0?(t.enableVertexAttribArray(h),t.vertexAttribPointer(h,o.size,o.type,o.normalized,r,o.offset)):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,s=this.vertexSize;if(0!==e)return t.bufferSubData(t.ARRAY_BUFFER,0,this.bytes.subarray(0,e*s)),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,s){return this.renderer.setFloat3(this.program,t,e,i,s),this},setFloat4:function(t,e,i,s,n){return this.renderer.setFloat4(this.program,t,e,i,s,n),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,s){return this.renderer.setInt3(this.program,t,e,i,s),this},setInt4:function(t,e,i,s,n){return this.renderer.setInt4(this.program,t,e,i,s,n),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){t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},,,function(t,e,i){var s=i(0),n=i(32),r=i(298),a=i(296),o=i(157),h=new s({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return n(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 o(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=h},,,,,function(t,e,i){var s=i(147),n=i(0),r=i(3),a=i(83),o=new n({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?s.Add(this.list,t):s.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?s.AddAt(this.list,t,e):s.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){return t&&(this._sortKey=t,a.inplace(this.list,this.sortHandler)),this},sortHandler:function(t,e){return t[this._sortKey]-e[this._sortKey]},getByName:function(t){return s.GetFirst(this.list,"name",t)},getRandom:function(t,e){return s.GetRandom(this.list,t,e)},getFirst:function(t,e,i,n){return s.GetFirstElement(this.list,t,e,i,n)},getAll:function(t,e,i,n){return s.GetAll(this.list,t,e,i,n)},count:function(t,e){return s.CountAllMatching(this.list,t,e)},swap:function(t,e){s.Swap(this.list,t,e)},moveTo:function(t,e){return s.MoveTo(this.list,t,e)},remove:function(t,e){return e?s.Remove(this.list,t):s.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?s.RemoveAt(this.list,t):s.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?s.RemoveBetween(this.list,t,e):s.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 s.BringToTop(this.list,t)},sendToBack:function(t){return s.SendToBack(this.list,t)},moveUp:function(t){return s.MoveUp(this.list,t),t},moveDown:function(t){return s.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return s.Shuffle(this.list),this},replace:function(t,e){return s.Replace(this.list,t,e)},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){for(var i=[null],s=2;s0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=o},function(t,e,i){var s=i(33);t.exports=function(t,e){var i=s(t);for(var n in e)i.hasOwnProperty(n)||(i[n]=e[n]);return i}},function(t,e){t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t}},function(t,e,i){var s=i(0),n=i(293),r=i(156),a=i(155),o=i(6),h=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return r(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this},getPointA:function(t){return void 0===t&&(t=new o),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new o),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=h},function(t,e){t.exports=function(t){return 2*(t.width+t.height)}},function(t,e){t.exports=function(t,e,i,s,n,r,a,o,h,u,l,c,d){return{target:t,key:e,getEndValue:i,getStartValue:s,ease:n,duration:0,totalDuration:0,delay:0,yoyo:o,hold:0,repeat:0,repeatDelay:0,flipX:c,flipY:d,progress:0,elapsed:0,repeatCounter:0,start:0,current:0,end:0,t1:0,t2:0,gen:{delay:r,duration:a,hold:h,repeat:u,repeatDelay:l},state:0}}},function(t,e,i){var s=i(0),n=i(13),r=i(11),a=i(61),o=new s({initialize:function(t,e,i){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.completeDelay=0,this.countdown=0,this.offset=0,this.calculatedOffset=0,this.state=a.PENDING_ADD,this._pausedState=a.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,onRepeat:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope},getValue:function(){return this.data[0].current},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===a.ACTIVE},isPaused:function(){return this.state===a.PAUSED},hasTarget:function(t){return-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){for(var s=0;s0&&(s.totalDuration+=s.t2*s.repeat),s.totalDuration>t&&(t=s.totalDuration)}this.duration=t,this.loopCounter=-1===this.loop?999999999999:this.loop,this.loopCounter>0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){for(var t=this.data,e=this.totalTargets,i=0;i0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&(t.params[1]=this.targets,t.func.apply(t.scope,t.params)),this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=a.LOOP_DELAY):this.state=a.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=a.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=a.PENDING_REMOVE}},pause:function(){if(this.state!==a.PAUSED)return this.paused=!0,this._pausedState=this.state,this.state=a.PAUSED,this},play:function(t){if(this.state!==a.ACTIVE){this.state!==a.PENDING_REMOVE&&this.state!==a.REMOVED||(this.init(),this.parent.makeActive(this),t=!0);var e=this.callbacks.onStart;this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?(e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=a.ACTIVE):(this.countdown=this.calculatedOffset,this.state=a.OFFSET_DELAY)):this.paused?(this.paused=!1,this.parent.makeActive(this)):(this.resetTweenData(t),this.state=a.ACTIVE,e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)))}},resetTweenData:function(t){for(var e=this.data,i=0;i0?(s.elapsed=s.delay,s.state=a.DELAY):s.state=a.PENDING_RENDER}},resume:function(){return this.state===a.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t){for(var e=this.data,i=0;i=n.totalDuration?(r=1,a=n.duration):s>n.delay&&s<=n.t1?(r=(s=Math.max(0,s-n.delay))/n.t1,a=n.duration*r):s>n.t1&&sn.repeatDelay&&(r=s/n.t1,a=n.duration*r)),n.progress=r,n.elapsed=a;var o=n.ease(n.progress);n.current=n.start+(n.end-n.start)*o,n.target[n.key]=n.current}},setCallback:function(t,e,i,s){return this.callbacks[t]={func:e,scope:s,params:i},this},complete:function(t){if(void 0===t&&(t=0),t)this.countdown=t,this.state=a.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=a.PENDING_REMOVE}},stop:function(t){this.state===a.ACTIVE&&void 0!==t&&this.seek(t),this.state!==a.REMOVED&&(this.state=a.PENDING_REMOVE)},update:function(t,e){if(this.state===a.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 a.ACTIVE:for(var i=!1,s=0;s0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var n=t.callbacks.onRepeat;return n&&(n.params[1]=e.target,n.func.apply(n.scope,n.params)),e.start=e.getStartValue(e.target,e.key,e.start),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,a.REPEAT_DELAY):a.PLAYING_FORWARD}return a.COMPLETE},setStateFromStart:function(t,e,i){if(e.repeatCounter>0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var s=t.callbacks.onRepeat;return s&&(s.params[1]=e.target,s.func.apply(s.scope,s.params)),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,a.REPEAT_DELAY):a.PLAYING_FORWARD}return a.COMPLETE},updateTweenData:function(t,e,i){switch(e.state){case a.PLAYING_FORWARD:case a.PLAYING_BACKWARD:if(!e.target){e.state=a.COMPLETE;break}var s=e.elapsed,n=e.duration,r=0;(s+=i)>n&&(r=s-n,s=n);var o,h=e.state===a.PLAYING_FORWARD,u=s/n;o=h?e.ease(u):e.ease(1-u),e.current=e.start+(e.end-e.start)*o,e.target[e.key]=e.current,e.elapsed=s,e.progress=u;var l=t.callbacks.onUpdate;l&&(l.params[1]=e.target,l.func.apply(l.scope,l.params)),1===u&&(h?e.hold>0?(e.elapsed=e.hold-r,e.state=a.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,r):e.state=this.setStateFromStart(t,e,r));break;case a.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=a.PENDING_RENDER);break;case a.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=a.PLAYING_FORWARD);break;case a.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case a.PENDING_RENDER:e.target?(e.start=e.getStartValue(e.target,e.key,e.target[e.key]),e.end=e.getEndValue(e.target,e.key,e.start),e.current=e.start,e.target[e.key]=e.start,e.state=a.PLAYING_FORWARD):e.state=a.COMPLETE}return e.state!==a.COMPLETE}});o.TYPES=["onComplete","onLoop","onRepeat","onStart","onUpdate","onYoyo"],r.register("tween",function(t){return this.scene.sys.tweens.add(t)}),n.register("tween",function(t){return this.scene.sys.tweens.create(t)}),t.exports=o},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){function i(t){return!!t.getStart&&"function"==typeof t.getStart}function s(t){return!!t.getEnd&&"function"==typeof t.getEnd}var n=function(t,e){var r,a,o=function(t,e,i){return i},h=function(t,e,i){return i},u=typeof e;if("number"===u)o=function(){return e};else if("string"===u){var l=e[0],c=parseFloat(e.substr(2));switch(l){case"+":o=function(t,e,i){return i+c};break;case"-":o=function(t,e,i){return i-c};break;case"*":o=function(t,e,i){return i*c};break;case"/":o=function(t,e,i){return i/c};break;default:o=function(){return parseFloat(e)}}}else"function"===u?o=e:"object"===u&&(i(a=e)||s(a))?(s(e)&&(o=e.getEnd),i(e)&&(h=e.getStart)):e.hasOwnProperty("value")&&(r=n(t,e.value));return r||(r={getEnd:o,getStart:h}),r};t.exports=n},function(t,e,i){var s=i(4);t.exports=function(t){var e=s(t,"targets",null);return null===e?e:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},,,,,function(t,e,i){var s=i(17),n=i(75);t.exports=function(t,e){var i=void 0===t?n():s({},t);if(e)for(var r in e)void 0!==e[r]&&(i[r]=e[r]);return i}},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){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,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}},function(t,e,i){var s=i(130),n=i(22),r=i(0),a=i(15),o=i(20),h=i(2),u=i(417),l=i(4),c=i(269),d=i(416),f=i(413),p=new r({Extends:h,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Depth,a.Flip,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.ScaleMode,a.ScrollFactor,a.Tint,a.Transform,a.Visible,d],initialize:function(t,e,i,s,r){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Text"),this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline("TextureTintPipeline"),this.canvas=n.create(this),this.context=this.canvas.getContext("2d"),this.style=new f(this,r),this.autoRound=!0,this.splitRegExp=/(?:\r\n|\r|\n)/,this.text="",this.resolution=1,this.padding={left:0,right:0,top:0,bottom:0},this.width=1,this.height=1,this.canvasTexture=null,this.dirty=!1,this.initRTL(),r&&r.padding&&this.setPadding(r.padding),r&&r.lineSpacing&&(this._lineSpacing=r.lineSpacing),this.setText(s),t.sys.game.config.renderType===o.WEBGL&&t.sys.game.renderer.onContextRestored(function(){this.canvasTexture=null,this.dirty=!0},this)},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",s(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 s="",n=t.replace(/ +/gi," ").split(this.splitRegExp),r=n.length,a=0;au){if(0===c){for(var g=f;g.length&&(g=g.slice(0,-1),!((p=e.measureText(g).width)<=u)););if(!g.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var m=d.substr(g.length);l[c]=m,h+=g}var v=l[c].length?c:c+1,y=l.slice(v).join(" ").replace(/[ \n]*$/gi,"");n[a+1]=y+" "+(n[a+1]||""),r=n.length;break}h+=f,u-=p}s+=h.replace(/[ \n]*$/gi,"")+"\n"}}return s=s.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var s="",n=t.split(this.splitRegExp),r=0;ra?(h>0&&(s+="\n"),s+=o[h]+" ",a=i-u):(a-=l,s+=o[h],h0&&(o+=l.lineSpacing*p),i.rtl?a=d-a:"right"===i.align?a+=l.width-l.lineWidths[p]:"center"===i.align&&(a+=(l.width-l.lineWidths[p])/2),this.autoRound&&(a=Math.round(a),o=Math.round(o)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(h[p],a,o)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(h[p],a,o));return e.restore(),this.dirty=!0,this},getTextMetrics:function(){return this.style.getTextMetrics()},toJSON:function(){var t=a.ToJSON(this),e={autoRound:this.autoRound,text:this.text,style:this.style.toJSON(),resolution:this.resolution,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&&c(this.canvas),n.remove(this.canvas)}});t.exports=p},,,function(t,e,i){var s=i(5);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.width/2,r=t.height/2;return i.x=t.x+n*Math.cos(e),i.y=t.y+r*Math.sin(e),i}},function(t,e,i){var s=i(0),n=i(54),r=i(179),a=i(178),o=i(134),h=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return n(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 o(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,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=h},function(t,e,i){var s=i(123),n=i(0),r=i(119),a=i(15),o=i(249),h=i(2),u=i(4),l=i(16),c=i(463),d=new n({Extends:h,Mixins:[a.Alpha,a.BlendMode,a.Depth,a.Mask,a.Pipeline,a.Transform,a.Visible,a.ScrollFactor,c],initialize:function(t,e){var i=u(e,"x",0),s=u(e,"y",0);h.call(this,t,"Graphics"),this.setPosition(i,s),this.initPipeline("FlatTintPipeline"),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.setDefaultStyles(e)},setDefaultStyles:function(t){return u(t,"lineStyle",null)&&(this.defaultStrokeWidth=u(t,"lineStyle.width",1),this.defaultStrokeColor=u(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=u(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),u(t,"fillStyle",null)&&(this.defaultFillColor=u(t,"fillStyle.color",16777215),this.defaultFillAlpha=u(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},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},strokePath: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,l.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,l.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,s){return this.commandBuffer.push(r.FILL_RECT,t,e,i,s),this},strokeRect:function(t,e,i,s){var n=this._lineWidth/2,r=t-n,a=t+n;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+s),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+s),this.strokePath(),this.beginPath(),this.moveTo(r,e),this.lineTo(a+i,e),this.strokePath(),this.beginPath(),this.moveTo(r,e+s),this.lineTo(a+i,e+s),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,s,n,a){return this.commandBuffer.push(r.FILL_TRIANGLE,t,e,i,s,n,a),this},strokeTriangle:function(t,e,i,s,n,a){return this.commandBuffer.push(r.STROKE_TRIANGLE,t,e,i,s,n,a),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,s){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,s),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},lineFxTo:function(t,e,i,s){return this.commandBuffer.push(r.LINE_FX_TO,t,e,i,s,1),this},moveFxTo:function(t,e,i,s){return this.commandBuffer.push(r.MOVE_FX_TO,t,e,i,s,1),this},strokePoints:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var s=1;s-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var s,n,r=this.scene.sys;if(void 0===e&&(e=r.game.config.width),void 0===i&&(i=r.game.config.height),d.TargetCamera.setViewport(0,0,e,i),d.TargetCamera.scrollX=this.x,d.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var a=(s=r.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(n=a.getContext("2d"))}else n=(s=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(n=t.getContext("2d"));return n&&(this.renderCanvas(r.game.renderer,this,0,d.TargetCamera,null,n),r.game.renderer.gl&&s&&(s.source[0].glTexture=r.game.renderer.canvasToTexture(n.canvas,s.source[0].glTexture))),this},preDestroy:function(){this.commandBuffer=[]}});d.TargetCamera=new s(0,0,0,0),t.exports=d},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;i0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t){return t?this.resume():this.pause()},start:function(t){t&&(this.settings.data=t),this.settings.status=n.START,this.settings.active=!0,this.settings.visible=!0,this.events.emit("start",this),this.events.emit("ready",this)},resize:function(t,e){this.events.emit("resize",t,e)},shutdown:function(){this.events.off("transitioninit"),this.events.off("transitionstart"),this.events.off("transitioncomplete"),this.events.off("transitionout"),this.settings.status=n.SHUTDOWN,this.settings.active=!1,this.settings.visible=!1,this.events.emit("shutdown",this)},destroy:function(){this.settings.status=n.DESTROYED,this.settings.active=!1,this.settings.visible=!1,this.events.emit("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-v&&S>-y&&T-v&&A>-y&&bc&&(this.scrollX=c),this.scrollYd&&(this.scrollY=d)}this.roundPixels&&(this.scrollX=Math.round(this.scrollX),this.scrollY=Math.round(this.scrollY)),r.loadIdentity(),r.scale(e,e),r.translate(this.x+a,this.y+o),r.rotate(this.rotation),r.scale(n,n),r.translate(-a,-o),this.shakeEffect.preRender()},removeBounds:function(){return this.useBounds=!1,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},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},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,s){return this._bounds.setTo(t,e,i,s),this.useBounds=!0,this},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){return this.scene=t,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,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setZoom:function(t){return void 0===t&&(t=1),this.zoom=t,this},setVisible:function(t){return this.visible=t,this},startFollow:function(t,e,i,n,r,a){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===r&&(r=0),void 0===a&&(a=r),this._follow=t,this.roundPixels=e,i=s(i,0,1),n=s(n,0,1),this.lerp.set(i,n),this.followOffset.set(r,a);var o=this.zoom,h=this.width/2,u=this.height/2;return this.scrollX=(t.x-r-h)/o,this.scrollY=(t.y-a-u)/o,this},stopFollow:function(){return this._follow=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},resetFX:function(){return this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.emit("cameradestroy",this),this.removeAllListeners(),this.resetFX(),this.matrix.destroy(),this.culledObjects=[],this._follow=null,this._bounds=null,this.scene=null},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}}});t.exports=f},function(t,e,i){var s=new(i(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e0?n.delayedPlay(d,r,a):n.load(r)}return t}},function(t,e,i){var s=i(0),n=i(17),r=new s({initialize:function(t,e,i,s,n,r,a){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,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.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},uvs:{x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},radius:0,drawImage:{sx:0,sy:0,sWidth:0,sHeight:0,dWidth:0,dHeight:0}},this.setSize(r,a,s,n)},setSize:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0),this.cutX=i,this.cutY=s,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 n=this.data,r=n.cut;r.x=i,r.y=s,r.w=t,r.h=e,r.r=i+t,r.b=s+e,n.sourceSize.w=t,n.sourceSize.h=e,n.spriteSourceSize.w=t,n.spriteSourceSize.h=e,n.radius=.5*Math.sqrt(t*t+e*e);var a=n.drawImage;return a.sx=i,a.sy=s,a.sWidth=t,a.sHeight=e,a.dWidth=t,a.dHeight=e,this.updateUVs()},setTrim:function(t,e,i,s,n,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=s,o.w=n,o.h=r,this.x=i,this.y=s,this.width=n,this.height=r,this.halfWidth=.5*n,this.halfHeight=.5*r,this.centerX=Math.floor(n/2),this.centerY=Math.floor(r/2),this.updateUVs()},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,s=this.cutHeight,n=this.data.drawImage;n.sWidth=i,n.sHeight=s,n.dWidth=i,n.dHeight=s;var r=this.source.width,a=this.source.height,o=this.data.uvs;return o.x0=t/r,o.y0=e/a,o.x1=t/r,o.y1=(e+s)/a,o.x2=(t+i)/r,o.y2=(e+s)/a,o.x3=(t+i)/r,o.y3=e/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height,i=this.data.uvs;return i.x3=(this.cutX+this.cutHeight)/t,i.y3=(this.cutY+this.cutWidth)/e,i.x2=this.cutX/t,i.y2=(this.cutY+this.cutWidth)/e,i.x1=this.cutX/t,i.y1=this.cutY/e,i.x0=(this.cutX+this.cutHeight)/t,i.y0=this.cutY/e,this},clone:function(){var t=new r(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=n(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.texture=null,this.source=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},uvs:{get:function(){return this.data.uvs}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=r},function(t,e,i){var s=i(0),n=i(202),r=i(526),a=i(525),o=i(27),h=i(84),u=new s({Extends:h,Mixins:[n],initialize:function(t){h.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:a,fragShader:t.fragShader?t.fragShader:r,vertexCapacity:t.vertexCapacity?t.vertexCapacity:12e3,vertexSize:t.vertexSize?t.vertexSize:2*Float32Array.BYTES_PER_ELEMENT+2*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:"inTint",size:4,type:t.renderer.gl.UNSIGNED_BYTE,normalized:!0,offset:4*Float32Array.BYTES_PER_ELEMENT}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.vertexViewU32=new Uint32Array(this.vertexData),this.maxQuads=2e3,this.batches=[],this.mvpInit()},setTexture2D:function(t,e){if(!t)return this;var i=this.batches;0===i.length&&this.pushBatch();var s=i[i.length-1];return e>0?(s.textures[e-1]&&s.textures[e-1]!==t&&this.pushBatch(),i[i.length-1].textures[e-1]=t):(null!==s.texture&&s.texture!==t&&this.pushBatch(),i[i.length-1].texture=t),this},pushBatch:function(){var t={first:this.vertexCount,texture:null,textures:[]};this.batches.push(t)},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t,e,i,s=this.gl,n=this.renderer,r=this.vertexCount,a=this.topology,o=this.vertexSize,h=this.batches,u=0,l=null;if(0===h.length||0===r)return this.flushLocked=!1,this;s.bufferSubData(s.ARRAY_BUFFER,0,this.bytes.subarray(0,r*o));for(var c=0;c0){for(e=0;e0){for(e=0;e0&&(n.setTexture2D(l.texture,0),s.drawArrays(a,l.first,u)),this.vertexCount=0,h.length=0,this.pushBatch(),this.flushLocked=!1,this},onBind:function(){return h.prototype.onBind.call(this),this.mvpUpdate(),0===this.batches.length&&this.pushBatch(),this},resize:function(t,e,i){return h.prototype.resize.call(this,t,e,i),this.projOrtho(0,this.width,this.height,0,-1e3,1e3),this},drawStaticTilemapLayer:function(t){if(t.vertexCount>0){var e=this.vertexBuffer,i=this.gl,s=this.renderer,n=t.tileset.image.get();s.currentPipeline&&s.currentPipeline.vertexCount>0&&s.flush(),this.vertexBuffer=t.vertexBuffer,s.setPipeline(this),s.setTexture2D(n.source.glTexture,0),i.drawArrays(this.topology,0,t.vertexCount),this.vertexBuffer=e}this.viewIdentity(),this.modelIdentity()},drawEmitterManager:function(t,e,i){var s=null;i&&(s=i.matrix),this.renderer.setPipeline(this);var n,r,a,o,h,u,l,c,d,f,p=this.renderer.config.roundPixels,g=t.emitters.list,m=g.length,v=this.vertexViewF32,y=this.vertexViewU32,x=this.renderer,w=this.maxQuads,T=e.scrollX,S=e.scrollY,b=e.matrix.matrix,A=b[0],E=b[1],_=b[2],C=b[3],M=b[4],P=b[5],k=Math.sin,L=Math.cos,R=this.vertexComponentCount,F=this.vertexCapacity,O=t.defaultFrame.source.glTexture;s&&(h=s[0],u=s[1],l=s[2],c=s[3],d=s[4],f=s[5]),this.setTexture2D(O,0);for(var D=0;D=F&&(this.flush(),this.setTexture2D(O,0));for(var H=0;H=F&&(this.flush(),this.setTexture2D(O,0))}}Y+=W,N-=W,this.vertexCount>=F&&(this.flush(),this.setTexture2D(O,0))}}}this.setTexture2D(O,0)},drawBlitter:function(t,e,i){var s=null;i&&(s=i.matrix),this.renderer.setPipeline(this);var n=this.renderer.config.roundPixels,r=o.getTintAppendFloatAlpha,a=this.vertexViewF32,h=this.vertexViewU32,u=t.getRenderList(),l=u.length,c=e.matrix.matrix,d=c[0],f=c[1],p=c[2],g=c[3],m=c[4],v=c[5],y=e.scrollX*t.scrollFactorX,x=e.scrollY*t.scrollFactorY,w=Math.ceil(l/this.maxQuads),T=0;if(s){var S=s[0],b=s[1],A=s[2],E=s[3],_=s[4],C=s[5],M=-y,P=-x,k=A*d+E*p,L=A*f+E*g,R=_*d+C*p+(M*d+P*p+m),F=_*f+C*g+(M*f+P*g+v);d=S*d+b*p,f=S*f+b*g,p=k,g=L,m=R,v=F,y=0,x=0}for(var O,D=t.x-y,I=t.y-x,B=0;B=this.vertexCapacity&&(this.flush(),O=-1)}}T+=N,l-=N,this.vertexCount>=this.vertexCapacity&&this.flush()}},batchSprite:function(t,e,i){var s=null;i&&(s=i.matrix),this.renderer.setPipeline(this),this.vertexCount+6>this.vertexCapacity&&this.flush();var n,r,a,h,u,l,c=this.renderer.config.roundPixels,d=o.getTintAppendFloatAlpha,f=this.vertexViewF32,p=this.vertexViewU32,g=e.matrix.matrix,m=t.frame,v=m.texture.source[m.sourceIndex].glTexture,y=!!v.isRenderTexture,x=t.flipX,w=t.flipY^y,T=m.uvs,S=m.width*(x?-1:1),b=m.height*(w?-1:1),A=-t.displayOriginX+m.x+m.width*(x?1:0),E=-t.displayOriginY+m.y+m.height*(w?1:0),_=(c?0|A:A)+S,C=(c?0|E:E)+b,M=t.scaleX,P=t.scaleY,k=t.rotation,L=t._alphaTL,R=t._alphaTR,F=t._alphaBL,O=t._alphaBR,D=t._tintTL,I=t._tintTR,B=t._tintBL,N=t._tintBR,U=Math.sin(k),Y=Math.cos(k),X=Y*M,z=U*M,G=-U*P,V=Y*P,H=t.x,W=t.y,j=g[0],q=g[1],K=g[2],J=g[3],Z=g[4],Q=g[5];if(s){var $=s[0],tt=s[1],et=s[2],it=s[3],st=s[4],nt=s[5],rt=-e.scrollX*t.scrollFactorX,at=-e.scrollY*t.scrollFactorY,ot=$*j+tt*K,ht=$*q+tt*J,ut=et*j+it*K,lt=et*q+it*J;n=X*ot+z*ut,r=X*ht+z*lt,a=G*ot+V*ut,h=G*ht+V*lt,u=H*ot+W*ut+(st*j+nt*K+(rt*j+at*K+Z)),l=H*ht+W*lt+(st*q+nt*J+(rt*q+at*J+Q))}else n=X*j+z*K,r=X*q+z*J,a=G*j+V*K,h=G*q+V*J,u=(H-=e.scrollX*t.scrollFactorX)*j+(W-=e.scrollY*t.scrollFactorY)*K+Z,l=H*q+W*J+Q;var ct,dt=A*n+E*a+u,ft=A*r+E*h+l,pt=A*n+C*a+u,gt=A*r+C*h+l,mt=_*n+C*a+u,vt=_*r+C*h+l,yt=_*n+E*a+u,xt=_*r+E*h+l,wt=d(D,L),Tt=d(I,R),St=d(B,F),bt=d(N,O);c&&(dt|=0,ft|=0,pt|=0,gt|=0,mt|=0,vt|=0,yt|=0,xt|=0),this.setTexture2D(v,0),f[(ct=this.vertexCount*this.vertexComponentCount)+0]=dt,f[ct+1]=ft,f[ct+2]=T.x0,f[ct+3]=T.y0,p[ct+4]=wt,f[ct+5]=pt,f[ct+6]=gt,f[ct+7]=T.x1,f[ct+8]=T.y1,p[ct+9]=St,f[ct+10]=mt,f[ct+11]=vt,f[ct+12]=T.x2,f[ct+13]=T.y2,p[ct+14]=bt,f[ct+15]=dt,f[ct+16]=ft,f[ct+17]=T.x0,f[ct+18]=T.y0,p[ct+19]=wt,f[ct+20]=mt,f[ct+21]=vt,f[ct+22]=T.x2,f[ct+23]=T.y2,p[ct+24]=bt,f[ct+25]=yt,f[ct+26]=xt,f[ct+27]=T.x3,f[ct+28]=T.y3,p[ct+29]=Tt,this.vertexCount+=6},batchMesh:function(t,e,i){var s=null;i&&(s=i.matrix);var n=t.vertices,r=n.length,a=r/2|0;this.renderer.setPipeline(this),this.vertexCount+a>this.vertexCapacity&&this.flush();var h,u,l,c,d,f,p=this.renderer.config.roundPixels,g=o.getTintAppendFloatAlpha,m=t.uv,v=t.colors,y=t.alphas,x=this.vertexViewF32,w=this.vertexViewU32,T=e.matrix.matrix,S=t.frame,b=t.texture.source[S.sourceIndex].glTexture,A=t.x,E=t.y,_=t.scaleX,C=t.scaleY,M=t.rotation,P=Math.sin(M),k=Math.cos(M),L=k*_,R=P*_,F=-P*C,O=k*C,D=A,I=E,B=T[0],N=T[1],U=T[2],Y=T[3],X=T[4],z=T[5],G=0;if(s){var V=s[0],H=s[1],W=s[2],j=s[3],q=s[4],K=s[5],J=-e.scrollX*t.scrollFactorX,Z=-e.scrollY*t.scrollFactorY,Q=V*B+H*U,$=V*N+H*Y,tt=W*B+j*U,et=W*N+j*Y;h=L*Q+R*tt,u=L*$+R*et,l=F*Q+O*tt,c=F*$+O*et,d=D*Q+I*tt+(q*B+K*U+(J*B+Z*U+X)),f=D*$+I*et+(q*N+K*Y+(J*N+Z*Y+z))}else h=L*B+R*U,u=L*N+R*Y,l=F*B+O*U,c=F*N+O*Y,d=(D-=e.scrollX*t.scrollFactorX)*B+(I-=e.scrollY*t.scrollFactorY)*U+X,f=D*N+I*Y+z;this.setTexture2D(b,0),G=this.vertexCount*this.vertexComponentCount;for(var it=0,st=0;itthis.vertexCapacity&&this.flush();var n,r,a,h,u,l,c,d,f,p,g,m,v,y,x=this.renderer.config.roundPixels,w=t.text,T=w.length,S=o.getTintAppendFloatAlpha,b=this.vertexViewF32,A=this.vertexViewU32,E=e.matrix.matrix,_=e.width+50,C=e.height+50,M=t.frame,P=t.texture.source[M.sourceIndex],k=e.scrollX*t.scrollFactorX,L=e.scrollY*t.scrollFactorY,R=t.fontData,F=R.lineHeight,O=t.fontSize/R.size,D=R.chars,I=t.alpha,B=S(t._tintTL,I),N=S(t._tintTR,I),U=S(t._tintBL,I),Y=S(t._tintBR,I),X=t.x,z=t.y,G=M.cutX,V=M.cutY,H=P.width,W=P.height,j=P.glTexture,q=0,K=0,J=0,Z=0,Q=null,$=0,tt=0,et=0,it=0,st=0,nt=0,rt=0,at=0,ot=0,ht=0,ut=0,lt=0,ct=null,dt=0,ft=X+M.x,pt=z+M.y,gt=t.rotation,mt=t.scaleX,vt=t.scaleY,yt=t.letterSpacing,xt=Math.sin(gt),wt=Math.cos(gt),Tt=wt*mt,St=xt*mt,bt=-xt*vt,At=wt*vt,Et=ft,_t=pt,Ct=E[0],Mt=E[1],Pt=E[2],kt=E[3],Lt=E[4],Rt=E[5],Ft=0;if(s){var Ot=s[0],Dt=s[1],It=s[2],Bt=s[3],Nt=s[4],Ut=s[5],Yt=-k,Xt=-L,zt=Ot*Ct+Dt*Pt,Gt=Ot*Mt+Dt*kt,Vt=It*Ct+Bt*Pt,Ht=It*Mt+Bt*kt;f=Tt*zt+St*Vt,p=Tt*Gt+St*Ht,g=bt*zt+At*Vt,m=bt*Gt+At*Ht,v=Et*zt+_t*Vt+(Nt*Ct+Ut*Pt+(Yt*Ct+Xt*Pt+Lt)),y=Et*Gt+_t*Ht+(Nt*Mt+Ut*kt+(Yt*Mt+Xt*kt+Rt))}else f=Tt*Ct+St*Pt,p=Tt*Mt+St*kt,g=bt*Ct+At*Pt,m=bt*Mt+At*kt,v=(Et-=k)*Ct+(_t-=L)*Pt+Lt,y=Et*Mt+_t*kt+Rt;this.setTexture2D(j,0);for(var Wt=0;Wt_||r<-50||r>C)&&(a<-50||a>_||h<-50||h>C)&&(u<-50||u>_||l<-50||l>C)&&(c<-50||c>_||d<-50||d>C)||(this.vertexCount+6>this.vertexCapacity&&this.flush(),Ft=this.vertexCount*this.vertexComponentCount,x&&(n|=0,r|=0,a|=0,h|=0,u|=0,l|=0,c|=0,d|=0),b[Ft+0]=n,b[Ft+1]=r,b[Ft+2]=ot,b[Ft+3]=ut,A[Ft+4]=B,b[Ft+5]=a,b[Ft+6]=h,b[Ft+7]=ot,b[Ft+8]=lt,A[Ft+9]=U,b[Ft+10]=u,b[Ft+11]=l,b[Ft+12]=ht,b[Ft+13]=lt,A[Ft+14]=Y,b[Ft+15]=n,b[Ft+16]=r,b[Ft+17]=ot,b[Ft+18]=ut,A[Ft+19]=B,b[Ft+20]=u,b[Ft+21]=l,b[Ft+22]=ht,b[Ft+23]=lt,A[Ft+24]=Y,b[Ft+25]=c,b[Ft+26]=d,b[Ft+27]=ht,b[Ft+28]=ut,A[Ft+29]=N,this.vertexCount+=6))}}else q=0,J=0,K+=F,ct=null},batchDynamicBitmapText:function(t,e,i){var s=null;i&&(s=i.matrix),this.renderer.setPipeline(this),this.vertexCount+6>this.vertexCapacity&&this.flush();var n,r,a,h,u,l,c,d,f,p,g,m,v,y,x,w,T,S,b,A,E=this.renderer.config.roundPixels,_=t.displayCallback,C=t.text,M=C.length,P=o.getTintAppendFloatAlpha,k=this.vertexViewF32,L=this.vertexViewU32,R=this.renderer,F=e.matrix.matrix,O=t.frame,D=t.texture.source[O.sourceIndex],I=e.scrollX*t.scrollFactorX,B=e.scrollY*t.scrollFactorY,N=t.scrollX,U=t.scrollY,Y=t.fontData,X=Y.lineHeight,z=t.fontSize/Y.size,G=Y.chars,V=t.alpha,H=P(t._tintTL,V),W=P(t._tintTR,V),j=P(t._tintBL,V),q=P(t._tintBR,V),K=t.x,J=t.y,Z=O.cutX,Q=O.cutY,$=D.width,tt=D.height,et=D.glTexture,it=0,st=0,nt=0,rt=0,at=null,ot=0,ht=0,ut=0,lt=0,ct=0,dt=0,ft=0,pt=0,gt=0,mt=0,vt=0,yt=0,xt=null,wt=0,Tt=K+O.x,St=J+O.y,bt=t.rotation,At=t.scaleX,Et=t.scaleY,_t=t.letterSpacing,Ct=Math.sin(bt),Mt=Math.cos(bt),Pt=Mt*At,kt=Ct*At,Lt=-Ct*Et,Rt=Mt*Et,Ft=Tt,Ot=St,Dt=F[0],It=F[1],Bt=F[2],Nt=F[3],Ut=F[4],Yt=F[5],Xt=t.cropWidth>0||t.cropHeight>0,zt=0;if(s){var Gt=s[0],Vt=s[1],Ht=s[2],Wt=s[3],jt=s[4],qt=s[5],Kt=-I,Jt=-B,Zt=Gt*Dt+Vt*Bt,Qt=Gt*It+Vt*Nt,$t=Ht*Dt+Wt*Bt,te=Ht*It+Wt*Nt;x=Pt*Zt+kt*$t,w=Pt*Qt+kt*te,T=Lt*Zt+Rt*$t,S=Lt*Qt+Rt*te,b=Ft*Zt+Ot*$t+(jt*Dt+qt*Bt+(Kt*Dt+Jt*Bt+Ut)),A=Ft*Qt+Ot*te+(jt*It+qt*Nt+(Kt*It+Jt*Nt+Yt))}else x=Pt*Dt+kt*Bt,w=Pt*It+kt*Nt,T=Lt*Dt+Rt*Bt,S=Lt*It+Rt*Nt,b=(Ft-=I)*Dt+(Ot-=B)*Bt+Ut,A=Ft*It+Ot*Nt+Yt;this.setTexture2D(et,0),Xt&&R.pushScissor(t.x,t.y,t.cropWidth*t.scaleX,t.cropHeight*t.scaleY);for(var ee=0;eethis.vertexCapacity&&this.flush(),zt=this.vertexCount*this.vertexComponentCount,E&&(n|=0,r|=0,a|=0,h|=0,u|=0,l|=0,c|=0,d|=0),k[zt+0]=n,k[zt+1]=r,k[zt+2]=gt,k[zt+3]=vt,L[zt+4]=H,k[zt+5]=a,k[zt+6]=h,k[zt+7]=gt,k[zt+8]=yt,L[zt+9]=j,k[zt+10]=u,k[zt+11]=l,k[zt+12]=mt,k[zt+13]=yt,L[zt+14]=q,k[zt+15]=n,k[zt+16]=r,k[zt+17]=gt,k[zt+18]=vt,L[zt+19]=H,k[zt+20]=u,k[zt+21]=l,k[zt+22]=mt,k[zt+23]=yt,L[zt+24]=q,k[zt+25]=c,k[zt+26]=d,k[zt+27]=mt,k[zt+28]=vt,L[zt+29]=W,this.vertexCount+=6}}}else it=0,nt=0,st+=X,xt=null;Xt&&R.popScissor()},batchText:function(t,e,i){var s=o.getTintAppendFloatAlpha;this.batchTexture(t,t.canvasTexture,t.canvasTexture.width,t.canvasTexture.height,t.x,t.y,t.canvasTexture.width,t.canvasTexture.height,t.scaleX,t.scaleY,t.rotation,t.flipX,t.flipY,t.scrollFactorX,t.scrollFactorY,t.displayOriginX,t.displayOriginY,0,0,t.canvasTexture.width,t.canvasTexture.height,s(t._tintTL,t._alphaTL),s(t._tintTR,t._alphaTR),s(t._tintBL,t._alphaBL),s(t._tintBR,t._alphaBR),0,0,e,i)},batchDynamicTilemapLayer:function(t,e,i){for(var s=t.culledTiles,n=s.length,r=t.tileset.image.get().source.glTexture,a=t.tileset,h=t.scrollFactorX,u=t.scrollFactorY,l=t.alpha,c=t.x,d=t.y,f=t.scaleX,p=t.scaleY,g=o.getTintAppendFloatAlpha,m=0;mthis.vertexCapacity&&this.flush(),d^=e.isRenderTexture?1:0;var k,L,R,F,O,D,I=this.renderer.config.roundPixels,B=this.vertexViewF32,N=this.vertexViewU32,U=C.matrix.matrix,Y=a*(c?1:0)-g,X=o*(d?1:0)-m,z=Y+a*(c?-1:1),G=X+o*(d?-1:1),V=n,H=r,W=Math.sin(l),j=Math.cos(l),q=j*h,K=W*h,J=-W*u,Z=j*u,Q=V,$=H,tt=U[0],et=U[1],it=U[2],st=U[3],nt=U[4],rt=U[5];if(P){var at=P[0],ot=P[1],ht=P[2],ut=P[3],lt=P[4],ct=P[5],dt=-C.scrollX*f,ft=-C.scrollY*p,pt=at*tt+ot*it,gt=at*et+ot*st,mt=ht*tt+ut*it,vt=ht*et+ut*st;k=q*pt+K*mt,L=q*gt+K*vt,R=J*pt+Z*mt,F=J*gt+Z*vt,O=Q*pt+$*mt+(lt*tt+ct*it+(dt*tt+ft*it+nt)),D=Q*gt+$*vt+(lt*et+ct*st+(dt*et+ft*st+rt))}else k=q*tt+K*it,L=q*et+K*st,R=J*tt+Z*it,F=J*et+Z*st,O=(Q-=C.scrollX*f)*tt+($-=C.scrollY*p)*it+nt,D=Q*et+$*st+rt;var yt,xt=Y*k+X*R+O,wt=Y*L+X*F+D,Tt=Y*k+G*R+O,St=Y*L+G*F+D,bt=z*k+G*R+O,At=z*L+G*F+D,Et=z*k+X*R+O,_t=z*L+X*F+D,Ct=v/i+E,Mt=y/s+_,Pt=(v+x)/i+E,kt=(y+w)/s+_;this.setTexture2D(e,0),yt=this.vertexCount*this.vertexComponentCount,I&&(xt|=0,wt|=0,Tt|=0,St|=0,bt|=0,At|=0,Et|=0,_t|=0),B[yt+0]=xt,B[yt+1]=wt,B[yt+2]=Ct,B[yt+3]=Mt,N[yt+4]=T,B[yt+5]=Tt,B[yt+6]=St,B[yt+7]=Ct,B[yt+8]=kt,N[yt+9]=S,B[yt+10]=bt,B[yt+11]=At,B[yt+12]=Pt,B[yt+13]=kt,N[yt+14]=b,B[yt+15]=xt,B[yt+16]=wt,B[yt+17]=Ct,B[yt+18]=Mt,N[yt+19]=T,B[yt+20]=bt,B[yt+21]=At,B[yt+22]=Pt,B[yt+23]=kt,N[yt+24]=b,B[yt+25]=Et,B[yt+26]=_t,B[yt+27]=Pt,B[yt+28]=Mt,N[yt+29]=A,this.vertexCount+=6},drawTexture:function(t,e,i,s,n,r,a,h,u,l,c){var d=null;c&&(d=c.matrix),this.renderer.setPipeline(this),this.vertexCount+6>this.vertexCapacity&&this.flush();var f=this.renderer.config.roundPixels,p=this.vertexViewF32,g=this.vertexViewU32,m=e,v=i,y=m+h,x=v+u,w=l[0],T=l[1],S=l[2],b=l[3],A=l[4],E=l[5];if(d){var _=d[0],C=d[1],M=d[2],P=d[3],k=d[4],L=w*C+T*P,R=S*C+b*P,F=A*C+E*P+d[5];w=w*_+T*M,T=L,S=S*_+b*M,b=R,A=A*_+E*M+k,E=F}var O,D=m*w+v*S+A,I=m*T+v*b+E,B=m*w+x*S+A,N=m*T+x*b+E,U=y*w+x*S+A,Y=y*T+x*b+E,X=y*w+v*S+A,z=y*T+v*b+E,G=t.width,V=t.height,H=r/G,W=a/V,j=(r+h)/G,q=(a+u)/V;s=o.getTintAppendFloatAlpha(s,n),this.setTexture2D(t,0),O=this.vertexCount*this.vertexComponentCount,f&&(D|=0,I|=0,B|=0,N|=0,U|=0,Y|=0,X|=0,z|=0),p[O+0]=D,p[O+1]=I,p[O+2]=H,p[O+3]=W,g[O+4]=s,p[O+5]=B,p[O+6]=N,p[O+7]=H,p[O+8]=q,g[O+9]=s,p[O+10]=U,p[O+11]=Y,p[O+12]=j,p[O+13]=q,g[O+14]=s,p[O+15]=D,p[O+16]=I,p[O+17]=H,p[O+18]=W,g[O+19]=s,p[O+20]=U,p[O+21]=Y,p[O+22]=j,p[O+23]=q,g[O+24]=s,p[O+25]=X,p[O+26]=z,p[O+27]=j,p[O+28]=W,g[O+29]=s,this.vertexCount+=6,this.flush()},batchGraphics:function(){}});t.exports=u},function(t,e){t.exports=function(t,e,i){var s;if(void 0===i&&(i=!0),e)"string"==typeof e?s=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(s=e);else if(t.parentElement)return t;return s||(s=document.body),i&&s.style&&(s.style.overflow="hidden"),s.appendChild(t),t}},function(t,e){var i,s="";t.exports={disable:function(t){return""===s&&(s=i(t)),s&&(t[s]=!1),t},enable:function(t){return""===s&&(s=i(t)),s&&(t[s]=!0),t},getPrefix:i=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((n=e-t.length)/2);t=new Array(n-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,i){var s=i(5);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random()*Math.PI*2,n=Math.sqrt(Math.random());return e.x=t.x+n*Math.cos(i)*t.width/2,e.y=t.y+n*Math.sin(i)*t.height/2,e}},function(t,e,i){var s=i(97),n=i(5);t.exports=function(t,e,i){if(void 0===i&&(i=new n),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var r=s(t)*e;return e>.5?(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,i){var s=i(5);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},,,,,,,function(t,e,i){var s=i(0),n=i(18),r=i(19),a=i(7),o=i(1),h=i(8),u=i(270),l=new s({Extends:r,initialize:function(t,e,i,s){var n="xml";if(h(e)){var a=e;e=o(a,"key"),i=o(a,"url"),s=o(a,"xhrSettings"),n=o(a,"extension",n)}var u={type:"xml",cache:t.cacheManager.xml,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,u)},onProcess:function(){this.state=n.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 s=0;s=1&&(o=1-o,h=1-h),e.x=t.x1+(i*o+r*h),e.y=t.y1+(n*o+a*h),e}},function(t,e,i){var s=i(5);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},function(t,e,i){var s=i(5);t.exports=function(t,e){void 0===e&&(e=new s);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 s=i(71),n=i(5);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=s(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,u=t.y2,l=0;l1?2-n:n,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,i){var s=i(0),n=i(9),r=i(72),a=i(61),o=new s({Extends:n,initialize:function(t){n.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=a.PENDING_ADD,this._pausedState=a.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},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===a.ACTIVE},add:function(t){return this.queue(r(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],s=parseFloat(t.substr(2)),n=e;switch(i){case"+":n+=s;break;case"-":n-=s}return Math.max(0,n)},calcDuration:function(){for(var t=0,e=0,i=0,s=0;s0?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=a.PAUSED,!1)},resetTweens:function(t){for(var e=0;e0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&t.func.apply(t.scope,t.params),this.emit("loop",this,this.loopCounter),this.resetTweens(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=a.LOOP_DELAY):this.state=a.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=a.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&e.func.apply(e.scope,e.params),this.emit("complete",this),this.state=a.PENDING_REMOVE}},update:function(t,e){if(this.state!==a.PAUSED){var i=e;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 a.ACTIVE:for(var s=this.totalData,n=0;n0?Math.floor(m/p.length):h(e,"duration",g.duration),g.delay=h(e,"delay",g.delay),g.easeParams=c(e,"easeParams",g.easeParams),g.ease=o(c(e,"ease",g.ease),g.easeParams),g.hold=h(e,"hold",g.hold),g.repeat=h(e,"repeat",g.repeat),g.repeatDelay=h(e,"repeatDelay",g.repeatDelay),g.yoyo=a(e,"yoyo",g.yoyo),g.flipX=a(e,"flipX",g.flipX),g.flipY=a(e,"flipY",g.flipY);for(var v=0;v0){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 s=new(i(0))({initialize:function(t){this.pluginManager=t,this.game=t.game,this.scene,this.systems},init:function(){},start:function(){},stop:function(){},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=s},,function(t,e,i){var s=i(0),n=i(19),r=i(1),a=i(108),o=i(8),h=new s({Extends:n,initialize:function(t,e,i,s){if(o(e)){var a=e;e=r(a,"key"),s=r(a,"config",s)}var h={type:"audio",cache:t.cacheManager.audio,extension:i.type,key:e,url:i.url,config:s};n.call(this,t,h),this.locked="ontouchstart"in window,this.loaded=!1,this.filesLoaded=0,this.filesTotal=0},onLoad:function(){this.loaded||(this.loaded=!0,this.loader.nextFile(this,!0))},onError:function(){for(var t=0;t=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),n>=4&&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.threshold?this.pressed||(this.pressed=!0,this.events.emit("down",e,this,t),this.pad.emit("down",i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit("up",e,this,t),this.pad.emit("up",i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=s},function(t,e,i){var s=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)0&&e.cameraFilter&r._id)){var u=r.scrollX*e.scrollFactorX,l=r.scrollY*e.scrollFactorY,c=e.x,d=e.y,f=e.scaleX,p=e.scaleY,g=e.rotation,m=e.commandBuffer,v=o||t.currentContext,y=1,x=1,w=0,T=0,S=1,b=0,A=0,E=0;if(t.currentBlendMode!==e.blendMode&&(t.currentBlendMode=e.blendMode,v.globalCompositeOperation=t.blendModes[e.blendMode]),t.currentAlpha!==e.alpha&&(t.currentAlpha=e.alpha,v.globalAlpha=e.alpha),t.currentScaleMode!==e.scaleMode&&(t.currentScaleMode=e.scaleMode),v.save(),a){var _=a.matrix;v.transform(_[0],_[1],_[2],_[3],_[4],_[5])}v.translate(c-u,d-l),v.rotate(g),v.scale(f,p),v.fillStyle="#fff",v.globalAlpha=e.alpha;for(var C=0,M=m.length;C>>16,A=(65280&w)>>>8,E=255&w,v.strokeStyle="rgba("+b+","+A+","+E+","+y+")",v.lineWidth=S,C+=3;break;case s.FILL_STYLE:T=m[C+1],x=m[C+2],b=(16711680&T)>>>16,A=(65280&T)>>>8,E=255&T,v.fillStyle="rgba("+b+","+A+","+E+","+x+")",C+=2;break;case s.BEGIN_PATH:v.beginPath();break;case s.CLOSE_PATH:v.closePath();break;case s.FILL_PATH:h||v.fill();break;case s.STROKE_PATH:h||v.stroke();break;case s.FILL_RECT:h?v.rect(m[C+1],m[C+2],m[C+3],m[C+4]):v.fillRect(m[C+1],m[C+2],m[C+3],m[C+4]),C+=4;break;case s.FILL_TRIANGLE:v.beginPath(),v.moveTo(m[C+1],m[C+2]),v.lineTo(m[C+3],m[C+4]),v.lineTo(m[C+5],m[C+6]),v.closePath(),h||v.fill(),C+=6;break;case s.STROKE_TRIANGLE:v.beginPath(),v.moveTo(m[C+1],m[C+2]),v.lineTo(m[C+3],m[C+4]),v.lineTo(m[C+5],m[C+6]),v.closePath(),h||v.stroke(),C+=6;break;case s.LINE_TO:v.lineTo(m[C+1],m[C+2]),C+=2;break;case s.MOVE_TO:v.moveTo(m[C+1],m[C+2]),C+=2;break;case s.LINE_FX_TO:v.lineTo(m[C+1],m[C+2]),C+=5;break;case s.MOVE_FX_TO:v.moveTo(m[C+1],m[C+2]),C+=5;break;case s.SAVE:v.save();break;case s.RESTORE:v.restore();break;case s.TRANSLATE:v.translate(m[C+1],m[C+2]),C+=2;break;case s.SCALE:v.scale(m[C+1],m[C+2]),C+=2;break;case s.ROTATE:v.rotate(m[C+1]),C+=1}v.restore()}}},function(t,e){t.exports=function(t){var e=t.width/2,i=t.height/2,s=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*s/(10+Math.sqrt(4-3*s)))}},function(t,e,i){var s=i(177),n=i(113),r=i(65),a=i(16);t.exports=function(t,e,i,o){void 0===o&&(o=[]),e||(e=s(t)/i);for(var h=0;hr;){if(a-r>600){var h=a-r+1,u=e-r+1,l=Math.log(h),c=.5*Math.exp(2*l/3),d=.5*Math.sqrt(l*c*(h-c)/h)*(u-h/2<0?-1:1),f=Math.max(r,Math.floor(e-u*c/h+d)),p=Math.min(a,Math.floor(e+(h-u)*c/h+d));i(t,e,f,p,o)}var g=t[e],m=r,v=a;for(s(t,r,e),o(t[a],g)>0&&s(t,r,a);m0;)v--}0===o(t[r],g)?s(t,r,v):s(t,++v,a),v<=e&&(r=v+1),e<=v&&(a=v-1)}};function s(t,e,i){var s=t[e];t[e]=t[i],t[i]=s}function n(t,e){return te?1:0}t.exports=i},function(t,e){t.exports=function(t){for(var e=t.length,i=t[0].length,s=new Array(i),n=0;n-1;r--)s[n][r]=t[r][n]}return s}},function(t,e,i){t.exports={AtlasXML:i(514),Canvas:i(513),Image:i(512),JSONArray:i(511),JSONHash:i(510),SpriteSheet:i(509),SpriteSheetFromAtlas:i(508),UnityYAML:i(507)}},function(t,e,i){var s=i(22),n=i(0),r=i(85),a=i(59),o=new n({initialize:function(t,e,i,s){var n=t.manager.game;this.renderer=n.renderer,this.texture=t,this.image=e,this.compressionAlgorithm=null,this.resolution=1,this.width=i||e.naturalWidth||e.width||0,this.height=s||e.naturalHeight||e.height||0,this.scaleMode=a.DEFAULT,this.isCanvas=e instanceof HTMLCanvasElement,this.isPowerOf2=r(this.width,this.height),this.glTexture=null,this.init(n)},init:function(t){this.renderer&&this.renderer.gl&&(this.isCanvas?this.glTexture=this.renderer.canvasToTexture(this.image):this.glTexture=this.renderer.createTextureFromSource(this.image,this.width,this.height,this.scaleMode)),t.config.pixelArt&&this.setFilter(1)},setFilter:function(t){this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,t)},update:function(){this.renderer.gl&&this.isCanvas&&this.renderer.canvasToTexture(this.image,this.glTexture)},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture),this.isCanvas&&s.remove(this.image),this.renderer=null,this.texture=null,this.image=null}});t.exports=o},function(t,e,i){var s=i(22),n=i(515),r=i(0),a=i(30),o=i(20),h=i(9),u=i(276),l=i(4),c=i(182),d=i(117),f=new r({Extends:h,initialize:function(t){h.call(this),this.game=t,this.name="TextureManager",this.list={},this._tempCanvas=s.create2D(this,1,1),this._tempContext=this._tempCanvas.getContext("2d"),this._pending=0,t.events.once("boot",this.boot,this)},boot:function(){this._pending=2,this.on("onload",this.updatePending,this),this.on("onerror",this.updatePending,this),this.addBase64("__DEFAULT",this.game.config.defaultImage),this.addBase64("__MISSING",this.game.config.missingImage),this.game.events.once("destroy",this.destroy,this)},updatePending:function(){this._pending--,0===this._pending&&(this.off("onload"),this.off("onerror"),this.game.events.emit("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)&&(delete this.list[t.key],t.destroy(),this.emit("removetexture",t.key)),this},addBase64:function(t,e){if(this.checkKey(t)){var i=this,s=new Image;s.onerror=function(){i.emit("onerror",t)},s.onload=function(){var e=i.create(t,s);c.Image(e,0),i.emit("addtexture",t,e),i.emit("onload",t,e)},s.src=e}},addImage:function(t,e,i){var s=null;return this.checkKey(t)&&(s=this.create(t,e),c.Image(s,0),i&&s.setDataSource(i),this.emit("addtexture",t,s)),s},generate:function(t,e){if(this.checkKey(t)){var i=s.create(this,1,1);return e.canvas=i,u(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 n=s.create(this,e,i,o.CANVAS,!0);return this.addCanvas(t,n)}return null},addCanvas:function(t,e){var i=null;return this.checkKey(t)&&(i=new n(this,t,e,e.width,e.height),this.list[t]=i,this.emit("addtexture",t,i)),i},addAtlas:function(t,e,i,s){return Array.isArray(i.textures)||Array.isArray(i.frames)?this.addAtlasJSONArray(t,e,i,s):this.addAtlasJSONHash(t,e,i,s)},addAtlasJSONArray:function(t,e,i,s){var n=null;if(this.checkKey(t)){if(n=this.create(t,e),Array.isArray(i))for(var r=1===i.length,a=0;a=0&&t<=r.width&&e>=0&&e<=r.height){t+=n.cutX,e+=n.cutY;var o=this._tempContext;o.clearRect(0,0,1,1),o.drawImage(r,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,s){var n=this.getFrame(i,s);if(n){var r=n.source.image;if(t>=0&&t<=r.width&&e>=0&&e<=r.height){t+=n.cutX,e+=n.cutY;var a=this._tempContext;return a.clearRect(0,0,1,1),a.drawImage(r,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},each:function(t,e){for(var i=[null],s=1;s0)&&(!!s.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit("pause",this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!s.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit("resume",this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!s.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit("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;t0)this.startTime=s-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,n-s),n=this.audio.currentTime):n=s)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit("ended",this);this.previousTime=n}},destroy:function(){s.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=this.currentConfig.volume*this.manager.volume)},calculateRate:function(){s.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.emit("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.emit("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,"rate",t)||(this.calculateRate(),this.emit("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,"detune",t)||(this.calculateRate(),this.emit("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)||this.startTime>0||(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("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("loop",this,t))}},setLoop:function(t){return this.loop=t,this}});t.exports=n},function(t,e,i){var s=i(79),n=i(0),r=i(189),a=new n({Extends:s,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,s.call(this,t)},add:function(t,e){var i=new r(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 s=0;s-1&&(delete this.keys[s],this.scenes.splice(i,1),this._start.indexOf(s)>-1&&(i=this._start.indexOf(s),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,s=i.settings;t.init&&(t.init.call(t,s.data),s.isTransition&&i.events.emit("transitioninit",s.transitionFrom,s.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),0===e.list.size?this.create(t):(s.status=n.LOADING,e.once("complete",this.loadComplete,this),e.start())):this.create(t)},loadComplete:function(t){var e=t.scene;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;i>=0;i--){var s=this.scenes[i].sys;s.settings.status>n.START&&s.settings.status<=n.RUNNING&&s.step(t,e)}},resize:function(t,e){for(var i=0;i=n.LOADING&&i.settings.status0){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(e>0){var i=e-1,s=this.getScene(t),n=this.getAt(i);this.scenes[e]=n,this.scenes[i]=s}}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=0;t--){this.scenes[t].sys.destroy()}this.update=a,this.scenes=[],this._pending=[],this._start=[],this._queue=[],this.game=null}});t.exports=u},function(t,e,i){var s=i(56);t.exports=function(t,e,i,n){var r;if(void 0===n&&(n=t),!Array.isArray(e))return-1!==(r=t.indexOf(e))?(s(t,r),i&&i.call(n,e),e):null;for(var a=e.length-1;a>=0;){var o=e[a];-1!==(r=t.indexOf(o))?(s(t,r),i&&i.call(n,o)):e.pop(),a--}return e}},function(t,e,i){var s=i(0),n=i(9),r=i(7),a=i(13),o=i(11),h=i(1),u=i(12),l=i(195),c=new s({Extends:n,initialize:function(t){n.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted?this.boot():t.events.once("boot",this.boot,this)},boot:function(){var t,e,i,s,n,r,a=this.game.config,o=a.installGlobalPlugins;for(o=o.concat(this._pendingGlobal),t=0;t10&&(t=10-this.pointersTotal);for(var i=0;i0},queueTouchStart:function(t){if(this.queue.push(n.TOUCH_START,t),this._hasDownCallback){var e=this.domCallbacks;this._hasDownCallback=this.processDomCallbacks(e.downOnce,e.down,t)}},queueTouchMove:function(t){if(this.queue.push(n.TOUCH_MOVE,t),this._hasMoveCallback){var e=this.domCallbacks;this._hasMoveCallback=this.processDomCallbacks(e.moveOnce,e.move,t)}},queueTouchEnd:function(t){if(this.queue.push(n.TOUCH_END,t),this._hasUpCallback){var e=this.domCallbacks;this._hasUpCallback=this.processDomCallbacks(e.upOnce,e.up,t)}},queueMouseDown:function(t){if(this.queue.push(n.MOUSE_DOWN,t),this._hasDownCallback){var e=this.domCallbacks;this._hasDownCallback=this.processDomCallbacks(e.downOnce,e.down,t)}},queueMouseMove:function(t){if(this.queue.push(n.MOUSE_MOVE,t),this._hasMoveCallback){var e=this.domCallbacks;this._hasMoveCallback=this.processDomCallbacks(e.moveOnce,e.move,t)}},queueMouseUp:function(t){if(this.queue.push(n.MOUSE_UP,t),this._hasUpCallback){var e=this.domCallbacks;this._hasUpCallback=this.processDomCallbacks(e.upOnce,e.up,t)}},addUpCallback:function(t,e){return void 0===e&&(e=!0),e?this.domCallbacks.upOnce.push(t):this.domCallbacks.up.push(t),this._hasUpCallback=!0,this},addDownCallback:function(t,e){return void 0===e&&(e=!0),e?this.domCallbacks.downOnce.push(t):this.domCallbacks.down.push(t),this._hasDownCallback=!0,this},addMoveCallback:function(t,e){return void 0===e&&(e=!1),e?this.domCallbacks.moveOnce.push(t):this.domCallbacks.move.push(t),this._hasMoveCallback=!0,this},inputCandidate:function(t){var e=t.input;if(!e||!e.enabled||!t.willRender())return!1;var i=!0,s=t.parentContainer;if(s)do{if(!s.visible){i=!1;break}s=s.parentContainer}while(s);return i},hitTest:function(t,e,i,s){void 0===s&&(s=this._tempHitTest);var n=this._tempPoint,r=i.width,a=i.height;s.length=0;var o=t.x,h=t.y;if(!(o>=i.x&&h>=i.y&&o<=i.x+r&&h<=i.y+a))return s;i.getWorldPoint(o,h,n),t.worldX=n.x,t.worldY=n.y;for(var u={x:0,y:0},l=this.game.config.resolution,d=this._tempMatrix,f=0;fe.length&&(r=e.length),i?(s=e[r-1][i],(n=e[r][i])-t<=t-s?e[r]:e[r-1]):(s=e[r-1],(n=e[r])-t<=t-s?n:s)}},function(t,e,i){var s=i(23),n=i(0),r=i(209),a=i(208),o=i(4),h=new n({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,o(i,"frames",[]),o(i,"defaultTextureKey",null)),this.frameRate=o(i,"frameRate",null),this.duration=o(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=o(i,"skipMissedFrames",!0),this.delay=o(i,"delay",0),this.repeat=o(i,"repeat",0),this.repeatDelay=o(i,"repeatDelay",0),this.yoyo=o(i,"yoyo",!1),this.showOnStart=o(i,"showOnStart",!1),this.hideOnComplete=o(i,"hideOnComplete",!1),this.paused=!1,this.manager.on("pauseall",this.pause,this),this.manager.on("resumeall",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(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 s=this.frames.slice(0,t),n=this.frames.slice(t);this.frames=s.concat(i,n)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){n.isLast=!0,n.nextFrame=u[0],u[0].prevFrame=n;var m=1/(u.length-1);for(r=0;r=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._timeScale=1,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo),t.updateFrame(this.frames[e])},getFrameByProgress:function(t){return t=s(t,0,1),r(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t._yoyo?(t.forward=!1,t.updateFrame(e.prevFrame),this.getNextTick(t)):t.repeatCounter>0?this.repeatAnimation(t):this.completeAnimation(t):(t.updateFrame(e.nextFrame),this.getNextTick(t))},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t.repeatCounter>0?this.repeatAnimation(t):this.completeAnimation(t):(t.updateFrame(e.prevFrame),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);t._repeatDelay>0&&!1===t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t._repeatDelay):(t.repeatCounter--,t.forward=!0,t.updateFrame(t.currentFrame.nextFrame),t.isPlaying&&(this.getNextTick(t),t.pendingRepeat=!1,t.parent.emit("animationrepeat",this,t.currentFrame,t.repeatCounter)))},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=this.frames.length,e=1/(t-1),i=0;i1&&(s.prevFrame=this.frames[i-1],s.nextFrame=this.frames[i+1])}return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off("pauseall",this.pause,this),this.manager.off("resumeall",this.resume,this),this.manager.remove(this.key);for(var t=0;t=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(t,e,i,n,r){for(var a,o=[e,i];o.length;)(i=o.pop())-(e=o.pop())<=n||(a=e+Math.ceil((i-e)/n/2)*n,s(t,a,e,i,r),o.push(e,a,a,i))}n.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],s=this.toBBox;if(!p(t,e))return i;for(var n,r,a,o,h=[];e;){for(n=0,r=e.children.length;n=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},_split:function(t,e){var i=t[e],s=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,s);var r=this._chooseSplitIndex(i,n,s),o=g(i.children.splice(r,i.children.length-r));o.height=i.height,o.leaf=i.leaf,a(i,this.toBBox),a(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var s,n,r,a,h,u,l,d,f,p,g,m,v,y;for(u=l=1/0,s=e;s<=i-e;s++)n=o(t,0,s,this.toBBox),r=o(t,s,i,this.toBBox),f=n,p=r,void 0,void 0,void 0,void 0,g=Math.max(f.minX,p.minX),m=Math.max(f.minY,p.minY),v=Math.min(f.maxX,p.maxX),y=Math.min(f.maxY,p.maxY),a=Math.max(0,v-g)*Math.max(0,y-m),h=c(n)+c(r),a=e;n--)r=t.children[n],h(l,t.leaf?a(r):r),c+=d(l);return c},_adjustParentBBoxes:function(t,e,i){for(var s=i;s>=0;s--)h(e[s],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():a(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=n},function(t,e,i){var s=new(i(0))({initialize:function(){this._pending=[],this._active=[],this._destroy=[],this._toProcess=0},add:function(t){return this._pending.push(t),this._toProcess++,this},remove:function(t){return this._destroy.push(t),this._toProcess++,this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,s=this._active;for(t=0;tu+l?(g=(p-=u+l)/c,m.x=h.x1+(h.x2-h.x1)*g,m.y=h.y1+(h.y2-h.y1)*g):(g=(p-=u)/l,m.x=o.x1+(o.x2-o.x1)*g,m.y=o.y1+(o.y2-o.y1)*g),r.push(m)}return r}},function(t,e,i){var s=i(5),n=i(71);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=t.getLineA(),a=t.getLineB(),o=t.getLineC();if(e<=0||e>=1)return i.x=r.x1,i.y=r.y1,i;var h=n(r),u=n(a),l=n(o),c=(h+u+l)*e,d=0;return ch+u?(d=(c-=h+u)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d):(d=(c-=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){t.exports=i(421)},function(t,e,i){t.exports={In:i(424),Out:i(423),InOut:i(422)}},function(t,e,i){t.exports={In:i(427),Out:i(426),InOut:i(425)}},function(t,e,i){t.exports={In:i(430),Out:i(429),InOut:i(428)}},function(t,e,i){t.exports={In:i(433),Out:i(432),InOut:i(431)}},function(t,e,i){t.exports=i(434)},function(t,e,i){t.exports={In:i(437),Out:i(436),InOut:i(435)}},function(t,e,i){t.exports={In:i(440),Out:i(439),InOut:i(438)}},function(t,e,i){t.exports={In:i(443),Out:i(442),InOut:i(441)}},function(t,e,i){t.exports={In:i(446),Out:i(445),InOut:i(444)}},function(t,e,i){t.exports={In:i(449),Out:i(448),InOut:i(447)}},function(t,e,i){t.exports={In:i(452),Out:i(451),InOut:i(450)}},function(t,e){t.exports=function(t,e){return Math.random()*(e-t)+t}},function(t,e,i){var s=i(114);s.Area=i(472),s.Circumference=i(177),s.CircumferencePoint=i(113),s.Clone=i(471),s.Contains=i(54),s.ContainsPoint=i(470),s.ContainsRect=i(469),s.CopyFrom=i(468),s.Equals=i(467),s.GetBounds=i(466),s.GetPoint=i(179),s.GetPoints=i(178),s.Offset=i(465),s.OffsetPoint=i(464),s.Random=i(134),t.exports=s},,,,,function(t,e,i){var s=i(4),n=i(95),r=function(t,e,i){for(var s=[],n=0;n0?Math.ceil(t):Math.floor(t)}},function(t,e){t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},function(t,e,i){var s=i(6);t.exports=function(t,e,i,n,r,a,o,h){void 0===h&&(h=new s);var u=Math.sin(-r),l=Math.cos(-r),c=l*a,d=-u*a,f=u*o,p=l*o,g=c*p-d*f,m=p/g,v=-d/g,y=-f/g,x=c/g,w=(f*n-p*i)/g,T=-(c*n-d*i)/g;return h.x=t*m+e*y+w,h.y=t*v+e*x+T,h}},function(t,e,i){"use strict";function s(t,e,i){i=i||2;var s,o,h,u,l,f,g,m=e&&e.length,v=m?e[0]*i:t.length,y=n(t,0,v,i,!0),x=[];if(!y)return x;if(m&&(y=function(t,e,i,s){var a,o,h,u,l,f=[];for(a=0,o=e.length;a80*i){s=h=t[0],o=u=t[1];for(var w=i;wh&&(h=l),f>u&&(u=f);g=Math.max(h-s,u-o)}return a(y,x,i,s,o,g),x}function n(t,e,i,s,n){var r,a;if(n===E(t,e,i,s)>0)for(r=e;r=e;r-=s)a=S(r,t[r],t[r+1],a);return a&&y(a,a.next)&&(b(a),a=a.next),a}function r(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!y(s,s.next)&&0!==v(s.prev,s,s.next))s=s.next;else{if(b(s),(s=e=s.prev)===s.next)return null;i=!0}}while(i||s!==e);return e}function a(t,e,i,s,n,c,d){if(t){!d&&c&&function(t,e,i,s){var n=t;do{null===n.z&&(n.z=f(n.x,n.y,e,i,s)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,i,s,n,r,a,o,h,u=1;do{for(i=t,t=null,r=null,a=0;i;){for(a++,s=i,o=0,e=0;e0||h>0&&s;)0!==o&&(0===h||!s||i.z<=s.z)?(n=i,i=i.nextZ,o--):(n=s,s=s.nextZ,h--),r?r.nextZ=n:t=n,n.prevZ=r,r=n;i=s}r.nextZ=null,u*=2}while(a>1)}(n)}(t,s,n,c);for(var p,g,m=t;t.prev!==t.next;)if(p=t.prev,g=t.next,c?h(t,s,n,c):o(t))e.push(p.i/i),e.push(t.i/i),e.push(g.i/i),b(t),t=g.next,m=g.next;else if((t=g)===m){d?1===d?a(t=u(t,e,i),e,i,s,n,c,2):2===d&&l(t,e,i,s,n,c):a(r(t),e,i,s,n,c,1);break}}}function o(t){var e=t.prev,i=t,s=t.next;if(v(e,i,s)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(g(e.x,e.y,i.x,i.y,s.x,s.y,n.x,n.y)&&v(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function h(t,e,i,s){var n=t.prev,r=t,a=t.next;if(v(n,r,a)>=0)return!1;for(var o=n.xr.x?n.x>a.x?n.x:a.x:r.x>a.x?r.x:a.x,l=n.y>r.y?n.y>a.y?n.y:a.y:r.y>a.y?r.y:a.y,c=f(o,h,e,i,s),d=f(u,l,e,i,s),p=t.nextZ;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&g(n.x,n.y,r.x,r.y,a.x,a.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&g(n.x,n.y,r.x,r.y,a.x,a.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function u(t,e,i){var s=t;do{var n=s.prev,r=s.next.next;!y(n,r)&&x(n,s,s.next,r)&&w(n,r)&&w(r,n)&&(e.push(n.i/i),e.push(s.i/i),e.push(r.i/i),b(s),b(s.next),s=t=r),s=s.next}while(s!==t);return s}function l(t,e,i,s,n,o){var h=t;do{for(var u=h.next.next;u!==h.prev;){if(h.i!==u.i&&m(h,u)){var l=T(h,u);return h=r(h,h.next),l=r(l,l.next),a(h,e,i,s,n,o),void a(l,e,i,s,n,o)}u=u.next}h=h.next}while(h!==t)}function c(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var i,s=e,n=t.x,r=t.y,a=-1/0;do{if(r<=s.y&&r>=s.next.y&&s.next.y!==s.y){var o=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(o<=n&&o>a){if(a=o,o===n){if(r===s.y)return s;if(r===s.next.y)return s.next}i=s.x=s.x&&s.x>=l&&n!==s.x&&g(ri.x)&&w(s,t)&&(i=s,d=h),s=s.next;return i}(t,e)){var i=T(e,t);r(i,i.next)}}function f(t,e,i,s,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)/n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-s)/n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{e.x=0&&(t-a)*(s-o)-(i-a)*(e-o)>=0&&(i-a)*(r-o)-(n-a)*(s-o)>=0}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.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&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&w(t,e)&&w(e,t)&&function(t,e){var i=t,s=!1,n=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&n<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)}function v(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,s){return!!(y(t,e)&&y(i,s)||y(t,s)&&y(i,e))||v(t,e,i)>0!=v(t,e,s)>0&&v(i,s,t)>0!=v(i,s,e)>0}function w(t,e){return v(t.prev,t,t.next)<0?v(t,e,t.next)>=0&&v(t,t.prev,e)>=0:v(t,e,t.prev)<0||v(t,t.next,e)<0}function T(t,e){var i=new A(t.i,t.x,t.y),s=new A(e.i,e.x,e.y),n=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,s.next=i,i.prev=s,r.next=s,s.prev=r,s}function S(t,e,i,s){var n=new A(t,e,i);return s?(n.next=s.next,n.prev=s,s.next.prev=n,s.next=n):(n.prev=n,n.next=n),n}function b(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 A(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 E(t,e,i,s){for(var n=0,r=e,a=i-s;r0&&(s+=t[n-1].length,i.holes.push(s))}return i}},function(t,e,i){var s=i(0),n=i(119),r=i(258),a=i(202),o=i(529),h=i(528),u=i(27),l=i(84),c=function(t,e,i,s,n){this.x=t,this.y=e,this.width=i,this.rgb=s,this.alpha=n},d=function(t,e,i,s,n){this.points=[],this.pointsLength=1,this.points[0]=new c(t,e,i,s,n)},f=new Float32Array([1,0,0,1,0,0]),p=new Float32Array(6e3),g=0,m=[],v=new s({Extends:l,Mixins:[a],initialize:function(t){l.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:h,fragShader:t.fragShader?t.fragShader:o,vertexCapacity:t.vertexCapcity?t.vertexCapacity:12e3,vertexSize:t.vertexSize?t.vertexSize:2*Float32Array.BYTES_PER_ELEMENT+4*Uint8Array.BYTES_PER_ELEMENT,attributes:[{name:"inPosition",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:0},{name:"inTint",size:4,type:t.renderer.gl.UNSIGNED_BYTE,normalized:!0,offset:2*Float32Array.BYTES_PER_ELEMENT}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.vertexViewU32=new Uint32Array(this.vertexData),this.tempTriangle=[{x:0,y:0,width:0,rgb:16777215,alpha:1},{x:0,y:0,width:0,rgb:16777215,alpha:1},{x:0,y:0,width:0,rgb:16777215,alpha:1},{x:0,y:0,width:0,rgb:16777215,alpha:1}],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},batchFillRect:function(t,e,i,s,n,r,a,o,h,l,c,d,f,p,g,m,v,y){this.renderer.setPipeline(this),this.vertexCount+6>this.vertexCapacity&&this.flush();var x=this.vertexViewF32,w=this.vertexViewU32,T=this.vertexCount*this.vertexComponentCount,S=r+o,b=a+h,A=y[0],E=y[1],_=y[2],C=y[3],M=d*A+f*_,P=d*E+f*C,k=p*A+g*_,L=p*E+g*C,R=m*A+v*_+y[4],F=m*E+v*C+y[5],O=r*M+a*k+R,D=r*P+a*L+F,I=r*M+b*k+R,B=r*P+b*L+F,N=S*M+b*k+R,U=S*P+b*L+F,Y=S*M+a*k+R,X=S*P+a*L+F,z=u.getTintAppendFloatAlphaAndSwap(l,c);x[T+0]=O,x[T+1]=D,w[T+2]=z,x[T+3]=I,x[T+4]=B,w[T+5]=z,x[T+6]=N,x[T+7]=U,w[T+8]=z,x[T+9]=O,x[T+10]=D,w[T+11]=z,x[T+12]=N,x[T+13]=U,w[T+14]=z,x[T+15]=Y,x[T+16]=X,w[T+17]=z,this.vertexCount+=6},batchFillTriangle:function(t,e,i,s,n,r,a,o,h,l,c,d,f,p,g,m,v,y,x,w){this.renderer.setPipeline(this),this.vertexCount+3>this.vertexCapacity&&this.flush();var T=this.vertexViewF32,S=this.vertexViewU32,b=this.vertexCount*this.vertexComponentCount,A=w[0],E=w[1],_=w[2],C=w[3],M=p*A+g*_,P=p*E+g*C,k=m*A+v*_,L=m*E+v*C,R=y*A+x*_+w[4],F=y*E+x*C+w[5],O=r*M+a*k+R,D=r*P+a*L+F,I=o*M+h*k+R,B=o*P+h*L+F,N=l*M+c*k+R,U=l*P+c*L+F,Y=u.getTintAppendFloatAlphaAndSwap(d,f);T[b+0]=O,T[b+1]=D,S[b+2]=Y,T[b+3]=I,T[b+4]=B,S[b+5]=Y,T[b+6]=N,T[b+7]=U,S[b+8]=Y,this.vertexCount+=3},batchStrokeTriangle:function(t,e,i,s,n,r,a,o,h,u,l,c,d,f,p,g,m,v,y,x,w){var T=this.tempTriangle;T[0].x=r,T[0].y=a,T[0].width=c,T[0].rgb=d,T[0].alpha=f,T[1].x=o,T[1].y=h,T[1].width=c,T[1].rgb=d,T[1].alpha=f,T[2].x=u,T[2].y=l,T[2].width=c,T[2].rgb=d,T[2].alpha=f,T[3].x=r,T[3].y=a,T[3].width=c,T[3].rgb=d,T[3].alpha=f,this.batchStrokePath(t,e,i,s,n,T,c,d,f,p,g,m,v,y,x,!1,w)},batchFillPath:function(t,e,i,s,n,a,o,h,l,c,d,f,p,g,m){this.renderer.setPipeline(this);for(var v,y,x,w,T,S,b,A,E,_,C,M,P,k,L,R,F,O=a.length,D=this.polygonCache,I=this.vertexViewF32,B=this.vertexViewU32,N=0,U=m[0],Y=m[1],X=m[2],z=m[3],G=l*U+c*X,V=l*Y+c*z,H=d*U+f*X,W=d*Y+f*z,j=p*U+g*X+m[4],q=p*Y+g*z+m[5],K=u.getTintAppendFloatAlphaAndSwap(o,h),J=0;Jthis.vertexCapacity&&this.flush(),N=this.vertexCount*this.vertexComponentCount,M=(S=D[x+0])*G+(b=D[x+1])*H+j,P=S*V+b*W+q,k=(A=D[w+0])*G+(E=D[w+1])*H+j,L=A*V+E*W+q,R=(_=D[T+0])*G+(C=D[T+1])*H+j,F=_*V+C*W+q,I[N+0]=M,I[N+1]=P,B[N+2]=K,I[N+3]=k,I[N+4]=L,B[N+5]=K,I[N+6]=R,I[N+7]=F,B[N+8]=K,this.vertexCount+=3;D.length=0},batchStrokePath:function(t,e,i,s,n,r,a,o,h,l,c,d,f,p,g,m,v){var y,x;this.renderer.setPipeline(this);for(var w,T,S,b,A=r.length,E=this.polygonCache,_=this.vertexViewF32,C=this.vertexViewU32,M=u.getTintAppendFloatAlphaAndSwap,P=0;P+1this.vertexCapacity&&this.flush(),w=E[k-1]||E[L-1],T=E[k],_[(S=this.vertexCount*this.vertexComponentCount)+0]=w[6],_[S+1]=w[7],C[S+2]=M(w[8],h),_[S+3]=w[0],_[S+4]=w[1],C[S+5]=M(w[2],h),_[S+6]=T[9],_[S+7]=T[10],C[S+8]=M(T[11],h),_[S+9]=w[0],_[S+10]=w[1],C[S+11]=M(w[2],h),_[S+12]=w[6],_[S+13]=w[7],C[S+14]=M(w[8],h),_[S+15]=T[3],_[S+16]=T[4],C[S+17]=M(T[5],h),this.vertexCount+=6;E.length=0},batchLine:function(t,e,i,s,n,r,a,o,h,l,c,d,f,p,g,m,v,y,x,w,T){this.renderer.setPipeline(this),this.vertexCount+6>this.vertexCapacity&&this.flush();var S=T[0],b=T[1],A=T[2],E=T[3],_=g*S+m*A,C=g*b+m*E,M=v*S+y*A,P=v*b+y*E,k=x*S+w*A+T[4],L=x*b+w*E+T[5],R=this.vertexViewF32,F=this.vertexViewU32,O=o-r,D=h-a,I=Math.sqrt(O*O+D*D),B=l*(h-a)/I,N=l*(r-o)/I,U=c*(h-a)/I,Y=c*(r-o)/I,X=o-U,z=h-Y,G=r-B,V=a-N,H=o+U,W=h+Y,j=r+B,q=a+N,K=X*_+z*M+k,J=X*C+z*P+L,Z=G*_+V*M+k,Q=G*C+V*P+L,$=H*_+W*M+k,tt=H*C+W*P+L,et=j*_+q*M+k,it=j*C+q*P+L,st=u.getTintAppendFloatAlphaAndSwap,nt=st(d,p),rt=st(f,p),at=this.vertexCount*this.vertexComponentCount;return R[at+0]=K,R[at+1]=J,F[at+2]=rt,R[at+3]=Z,R[at+4]=Q,F[at+5]=nt,R[at+6]=$,R[at+7]=tt,F[at+8]=rt,R[at+9]=Z,R[at+10]=Q,F[at+11]=nt,R[at+12]=et,R[at+13]=it,F[at+14]=nt,R[at+15]=$,R[at+16]=tt,F[at+17]=rt,this.vertexCount+=6,[K,J,f,Z,Q,d,$,tt,f,et,it,d]},batchGraphics:function(t,e,i){if(!(t.commandBuffer.length<=0)){var s=null;i&&(s=i.matrix),this.renderer.setPipeline(this);var r,a,o,h,u,l,v,y,x=e.scrollX*t.scrollFactorX,w=e.scrollY*t.scrollFactorY,T=t.x,S=t.y,b=t.scaleX,A=t.scaleY,E=t.rotation,_=t.commandBuffer,C=t.alpha,M=1,P=1,k=0,L=0,R=1,F=e.matrix.matrix,O=null,D=0,I=0,B=0,N=0,U=0,Y=0,X=0,z=0,G=0,V=0,H=null,W=Math.sin,j=Math.cos,q=2*Math.PI,K=W(E),J=j(E),Z=J*b,Q=K*b,$=-K*A,tt=J*A,et=T,it=S,st=F[0],nt=F[1],rt=F[2],at=F[3],ot=F[4],ht=F[5];if(s){var ut=s[0],lt=s[1],ct=s[2],dt=s[3],ft=s[4],pt=s[5],gt=-x,mt=-w,vt=ut*st+lt*rt,yt=ut*nt+lt*at,xt=ct*st+dt*rt,wt=ct*nt+dt*at;r=Z*vt+Q*xt,a=Z*yt+Q*wt,o=$*vt+tt*xt,h=$*yt+tt*wt,u=et*vt+it*xt+(ft*st+pt*rt+(gt*st+mt*rt+ot)),l=et*yt+it*wt+(ft*nt+pt*at+(gt*nt+mt*at+ht))}else r=Z*st+Q*rt,a=Z*nt+Q*at,o=$*st+tt*rt,h=$*nt+tt*at,u=(et-=x)*st+(it-=w)*rt+ot,l=et*nt+it*at+ht;m.length=0;for(var Tt=0,St=_.length;Tt0&&(G=G%q-q):G>q?G=q:G<0&&(G=q+G%q);D<1;)I=U+j(N=G*D+z)*X,B=Y+W(N)*X,O.points.push(new c(I,B,R,k,M*C)),D+=.01;I=U+j(N=G+z)*X,B=Y+W(N)*X,O.points.push(new c(I,B,R,k,M*C)),Tt+=6;break;case n.LINE_STYLE:R=_[Tt+1],k=_[Tt+2],M=_[Tt+3],Tt+=3;break;case n.FILL_STYLE:L=_[Tt+1],P=_[Tt+2],Tt+=2;break;case n.BEGIN_PATH:m.length=0,O=null;break;case n.CLOSE_PATH:O&&O.points.length&&O.points.push(O.points[0]);break;case n.FILL_PATH:for(v=0,y=m.length;v=0&&s>=0;return r[0]===t&&r[1]===e&&r[2]===i&&r[3]===s||this.flush(),r[0]=t,r[1]=e,r[2]=i,r[3]=s,this.currentScissorEnabled=a,a?(n.disable(n.SCISSOR_TEST),this):(n.enable(n.SCISSOR_TEST),n.scissor(t,n.drawingBufferHeight-e-s,i,s),this)},pushScissor:function(t,e,i,s){var n=this.scissorStack,r=this.currentScissorIdx,a=this.currentScissor;return n[r+0]=a[0],n[r+1]=a[1],n[r+2]=a[2],n[r+3]=a[3],this.currentScissorIdx+=4,this.setScissor(t,e,i,s),this},popScissor:function(){var t=this.scissorStack,e=this.currentScissorIdx-4,i=t[e+0],s=t[e+1],n=t[e+2],r=t[e+3];return this.currentScissorIdx=e,this.setScissor(i,s,n,r),this},setPipeline:function(t){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(),this.currentPipeline},setBlendMode:function(t){var e=this.gl,i=this.blendModes[t];return t!==n.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t&&(this.flush(),e.enable(e.BLEND),e.blendEquation(i.equation),i.func.length>2?e.blendFuncSeparate(i.func[0],i.func[1],i.func[2],i.func[3]):e.blendFunc(i.func[0],i.func[1]),this.currentBlendMode=t),this},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 t>16&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setTexture2D:function(t,e){var i=this.gl;return t!==this.currentTextures[e]&&(this.flush(),this.currentActiveTextureUnit!==e&&(i.activeTexture(i.TEXTURE0+e),this.currentActiveTextureUnit=e),i.bindTexture(i.TEXTURE_2D,t),this.currentTextures[e]=t),this},setFramebuffer:function(t){var e=this.gl;return t!==this.currentFramebuffer&&(this.flush(),e.bindFramebuffer(e.FRAMEBUFFER,t),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,s){var a=this.gl,o=a.NEAREST,h=a.CLAMP_TO_EDGE;return e=t?t.width:e,i=t?t.height:i,r(e,i)&&(h=a.REPEAT),s===n.ScaleModes.LINEAR?o=a.LINEAR:(s===n.ScaleModes.NEAREST||this.config.pixelArt)&&(o=a.NEAREST),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,o,o,h,h,a.RGBA,t):this.createTexture2D(0,o,o,h,h,a.RGBA,null,e,i)},createTexture2D:function(t,e,i,s,n,r,a,o,h,u){var l=this.gl,c=l.createTexture();return u=void 0===u||null===u||u,this.setTexture2D(c,0),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,e),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,i),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,n),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,s),l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),null===a||void 0===a?l.texImage2D(l.TEXTURE_2D,t,r,o,h,0,r,l.UNSIGNED_BYTE,null):(l.texImage2D(l.TEXTURE_2D,t,r,r,l.UNSIGNED_BYTE,a),o=a.width,h=a.height),this.setTexture2D(null,0),c.isAlphaPremultiplied=u,c.isRenderTexture=!1,c.width=o,c.height=h,this.nativeTextures.push(c),c},createFramebuffer:function(t,e,i,s){var n,r=this.gl,a=r.createFramebuffer();if(this.setFramebuffer(a),s){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),(n=r.checkFramebufferStatus(r.FRAMEBUFFER))!==r.FRAMEBUFFER_COMPLETE){throw new Error("Framebuffer incomplete. Framebuffer status: "+{36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"}[n])}return a.renderTexture=i,this.setFramebuffer(null),a},createProgram:function(t,e){var i=this.gl,s=i.createProgram(),n=i.createShader(i.VERTEX_SHADER),r=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(n,t),i.shaderSource(r,e),i.compileShader(n),i.compileShader(r),!i.getShaderParameter(n,i.COMPILE_STATUS))throw new Error("Failed to compile Vertex Shader:\n"+i.getShaderInfoLog(n));if(!i.getShaderParameter(r,i.COMPILE_STATUS))throw new Error("Failed to compile Fragment Shader:\n"+i.getShaderInfoLog(r));if(i.attachShader(s,n),i.attachShader(s,r),i.linkProgram(s),!i.getProgramParameter(s,i.LINK_STATUS))throw new Error("Failed to link program:\n"+i.getProgramInfoLog(s));return s},createVertexBuffer:function(t,e){var i=this.gl,s=i.createBuffer();return this.setVertexBuffer(s),i.bufferData(i.ARRAY_BUFFER,t,e),this.setVertexBuffer(null),s},createIndexBuffer:function(t,e){var i=this.gl,s=i.createBuffer();return this.setIndexBuffer(s),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t,e),this.setIndexBuffer(null),s},deleteTexture:function(t){var e=this.nativeTextures.indexOf(t);return-1!==e&&a(this.nativeTextures,e),this.gl.deleteTexture(t),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=this.config.resolution,i=Math.floor(t.x*e),s=Math.floor(t.y*e),n=Math.floor(t.width*e),r=Math.floor(t.height*e);if(this.pushScissor(i,s,n,r),t.backgroundColor.alphaGL>0){var a=t.backgroundColor,h=this.pipelines.FlatTintPipeline;h.batchFillRect(0,0,1,1,0,t.x,t.y,t.width,t.height,o.getTintFromFloats(a.redGL,a.greenGL,a.blueGL,1),a.alphaGL,1,0,0,1,0,0,[1,0,0,1,0,0]),h.flush()}},postRenderCamera:function(t){var e=this.pipelines.FlatTintPipeline,i=t.flashEffect.postRenderWebGL(e,o.getTintFromFloats);(t.fadeEffect.postRenderWebGL(e,o.getTintFromFloats)||i)&&e.flush(),this.popScissor()},preRender:function(){if(!this.contextLost){var t=this.gl,e=this.config.backgroundColor,i=this.pipelines;for(var s in t.clearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),this.config.clearBeforeRender&&t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT),i)i[s].onPreRender()}},render:function(t,e,i,s){if(!this.contextLost){var r=e.list,a=r.length,o=this.pipelines;for(var h in o)o[h].onRender(t,s);this.preRenderCamera(s);for(var u=0;u16777215?{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 s=i(30),n=i(282);t.exports=function(t){var e=n(t);return new s(e.r,e.g,e.b,e.a)}},function(t,e){t.exports=function(t,e,i,s){return s<<24|t<<16|e<<8|i}},function(t,e,i){var s=i(30);t.exports=function(t){var e=new s;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,s){return e+e+i+i+s+s});var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var n=parseInt(i[1],16),r=parseInt(i[2],16),a=parseInt(i[3],16);e.setTo(n,r,a)}return e}},,,,function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(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;e0;i--){var s=Math.floor(this.frac()*(e+1)),n=t[s];t[s]=t[i],t[i]=n}return t}});t.exports=s},function(t,e,i){var s=i(136),n=i(65),r=i(16),a=i(5);t.exports=function(t,e,i){void 0===i&&(i=new a);var o=n(e,0,r.PI2);return s(t,o,i)}},,,,function(t,e,i){var s=new(i(0))({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.once("remove",this.remove,this),this.isPlaying=!1,this.currentAnim=null,this.currentFrame=null,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.accumulator=0,this.nextTick=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},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){if(void 0===e&&(e=!1),void 0===i&&(i=0),e&&this.isPlaying&&this.currentAnim.key===t)return this.parent;this.load(t,i);var s=this.currentAnim,n=this.parent;return this.repeatCounter=-1===this._repeat?Number.MAX_VALUE:this._repeat,s.getFirstTick(this),this.forward=!0,this.isPlaying=!0,this.pendingRepeat=!1,s.showOnStart&&(n.visible=!0),n.emit("animationstart",this.currentAnim,this.currentFrame),n},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=0,this.parent},getRepeatDelay:function(){return this._repeatDelay},setRepeatDelay:function(t){return this._repeatDelay=t,this.parent},restart:function(t){return void 0===t&&(t=!1),this.currentAnim.getFirstTick(this,t),this.forward=!0,this.isPlaying=!0,this.pendingRepeat=!1,this._paused=!1,this.updateFrame(this.currentAnim.frames[0]),this.parent},stop:function(){this._pendingStop=0,this.isPlaying=!1;var t=this.parent;return t.emit("animationcomplete",this.currentAnim,this.currentFrame),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.setSizeToFrame(),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("animationupdate",i,t),3===this._pendingStop&&this._pendingStopValue===t&&this.currentAnim.completeAnimation(this)}},setYoyo:function(t){return void 0===t&&(t=!1),this._yoyo=t,this.parent},getYoyo:function(){return this._yoyo},destroy:function(){this.animationManager.off("remove",this.remove,this),this.animationManager=null,this.parent=null,this.currentAnim=null,this.currentFrame=null}});t.exports=s},function(t,e,i){var s=i(0),n=i(161),r=i(12),a=i(160),o=i(61),h=i(72),u=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("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.systems.events.once("destroy",this.destroy,this)},start:function(){var t=this.systems.events;t.on("preupdate",this.preUpdate,this),t.on("update",this.update,this),t.once("shutdown",this.shutdown,this),this.timeScale=1},createTimeline:function(t){return a(this,t)},timeline:function(t){var e=a(this,t);return e.paused||(this._add.push(e),this._toProcess++),e},create:function(t){return h(this,t)},add:function(t){var e=h(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=n(this,t);return this._add.push(e),this._toProcess++,e},preUpdate:function(){if(0!==this._toProcess){var t,e,i=this._destroy,s=this._active;for(t=0;t-1&&this._active.splice(n,1),s.destroy()}for(i=0;i=s.delay)){var n=s.elapsed-s.delay;s.elapsed=s.delay,!s.hasDispatched&&s.callback&&(s.hasDispatched=!0,s.callback.apply(s.callbackScope,s.args)),s.repeatCount>0?(s.repeatCount--,s.elapsed=n,s.hasDispatched=!1):this._pendingRemoval.push(s)}}}},shutdown:function(){var t;for(t=0;t=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off("update",this.step,this),t.events.emit("transitioncomplete",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){return this.manager.add(t,e,i),this},launch:function(t,e){return t&&t!==this.key&&(this.settings.status!==r.RUNNING?this.manager.queueOp("start",t,e):this.manager.start(t,e)),this},run:function(t,e){return this.settings.status!==r.RUNNING?this.manager.queueOp("run",t,e):this.manager.run(t,e),this},pause:function(t){return void 0===t&&(t=this.key),this.manager.pause(t),this},resume:function(t){return void 0===t&&(t=this.key),this.manager.resume(t),this},sleep:function(t){return void 0===t&&(t=this.key),this.manager.sleep(t),this},wake:function(t){return void 0===t&&(t=this.key),this.manager.wake(t),this},switch:function(t){return t!==this.key&&(this.settings.status!==r.RUNNING?this.manager.queueOp("switch",this.key,t):this.manager.switch(this.key,t)),this},stop:function(t){return void 0===t&&(t=this.key),this.manager.stop(t),this},setActive:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setActive(t),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)},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("shutdown",this.shutdown,this),t.off("postupdate",this.step,this),t.off("transitionout")},destroy:function(){this.shutdown(),this.scene.sys.events.off("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 s=i(55),n=i(17),r={SceneManager:i(194),ScenePlugin:i(327),Settings:i(192),Systems:i(118)};r=n(!1,r,s),t.exports=r},function(t,e,i){var s=i(165),n=new(i(0))({Extends:s,initialize:function(t,e){s.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this)},boot:function(){}});t.exports=n},function(t,e,i){t.exports={BasePlugin:i(165),DefaultPlugins:i(121),PluginCache:i(12),PluginManager:i(196),ScenePlugin:i(329)}},,,,,,,,,,,,,,,,,,,,,,,function(t,e,i){var s=i(0),n=i(18),r=i(70),a=i(9),o=i(7),h=i(1),u=i(12),l=i(75),c=new s({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,o.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(h(i,"baseURL",e.loaderBaseURL)),this.setPath(h(i,"path",e.loaderPath)),this.setPrefix(h(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=h(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=l(h(i,"responseType",e.loaderResponseType),h(i,"async",e.loaderAsync),h(i,"user",e.loaderUser),h(i,"password",e.loaderPassword),h(i,"timeout",e.loaderTimeout)),this.crossOrigin=h(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=n.LOADER_IDLE,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.pluginStart,this)},boot:function(){this.systems.events.once("destroy",this.destroy,this)},pluginStart:function(){this.systems.events.once("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;e0},isLoading:function(){return this.state===n.LOADER_LOADING||this.state===n.LOADER_PROCESSING},isReady:function(){return this.state===n.LOADER_IDLE||this.state===n.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit("start",this),0===this.list.size?this.loadComplete():(this.state=n.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on("update",this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit("progress",this.progress)},update:function(){this.state===n.LOADER_LOADING&&this.list.size>0&&this.inflight.size0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(n=!0,i=s(t,e))}else n=!0,i=s(t,e);return!n&&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,i){var s=i(0),n=i(9),r=i(4),a=i(76),o=i(171),h=i(109),u=i(170),l=i(369),c=i(368),d=i(367),f=new s({Extends:n,initialize:function(t){n.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.keys=[],this.combos=[],this.queue=[],this.onKeyHandler,t.pluginEvents.once("boot",this.boot,this),t.pluginEvents.on("start",this.start,this)},boot:function(){var t=this.settings.input,e=this.scene.sys.game.config;this.enabled=r(t,"keyboard",e.inputKeyboard),this.target=r(t,"keyboard.target",e.inputKeyboardEventTarget),this.sceneInputPlugin.pluginEvents.once("destroy",this.destroy,this)},start:function(){this.enabled&&this.startListeners(),this.sceneInputPlugin.pluginEvents.once("shutdown",this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var t=this,e=function(e){if(!e.defaultPrevented&&t.isActive()){t.queue.push(e);var i=t.keys[e.keyCode];i&&i.preventDefault&&e.preventDefault()}};this.onKeyHandler=e,this.target.addEventListener("keydown",e,!1),this.target.addEventListener("keyup",e,!1),this.sceneInputPlugin.pluginEvents.on("update",this.update,this)},stopListeners:function(){this.target.removeEventListener("keydown",this.onKeyHandler),this.target.removeEventListener("keyup",this.onKeyHandler),this.sceneInputPlugin.pluginEvents.off("update",this.update)},createCursorKeys:function(){return this.addKeys({up:h.UP,down:h.DOWN,left:h.LEFT,right:h.RIGHT,space:h.SPACE,shift:h.SHIFT})},addKeys:function(t){var e={};if("string"==typeof t){t=t.split(",");for(var i=0;i-1?e[i]=t:e[t.keyCode]=t,t}return"string"==typeof t&&(t=h[t.toUpperCase()]),e[t]||(e[t]=new o(t)),e[t]},removeKey:function(t){var e=this.keys;if(t instanceof o){var i=e.indexOf(t);i>-1&&(this.keys[i]=void 0)}else"string"==typeof t&&(t=h[t.toUpperCase()]);e[t]&&(e[t]=void 0)},createCombo:function(t,e){return new u(this,t,e)},update:function(){var t=this.queue.length;if(this.enabled&&0!==t)for(var e=this.queue.splice(0,t),i=this.keys,s=0;s=e}}},function(t,e,i){var s=i(88),n=i(32),r=i(0),a=i(175),o=i(375),h=i(58),u=i(114),l=i(54),c=i(9),d=i(1),f=i(76),p=i(8),g=i(12),m=i(14),v=i(31),y=i(68),x=i(60),w=new r({Extends:c,initialize:function(t){c.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new c,this.enabled=!0,this.displayList,this.cameras,f.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0,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._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"],t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once("destroy",this.destroy,this),this.pluginEvents.emit("boot")},start:function(){var t=this.systems.events;t.on("transitionstart",this.transitionIn,this),t.on("transitionout",this.transitionOut,this),t.on("transitioncomplete",this.transitionComplete,this),t.on("preupdate",this.preUpdate,this),t.on("update",this.update,this),t.once("shutdown",this.shutdown,this),this.enabled=!0,this.pluginEvents.emit("start")},preUpdate:function(){this.pluginEvents.emit("preUpdate");var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,s=e.length;if(0!==i||0!==s){for(var n=this._list,r=0;r-1&&(n.splice(o,1),this.clear(a))}t.length=0,this._pendingRemoval.length=0,this._list=n.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},update:function(t,e){if(this.isActive()){this.pluginEvents.emit("update",t,e);var i=this.manager;if(!i.globalTopOnly||!i.ignoreEvents){var s=i.dirty||0===this.pollRate;if(this.pollRate>-1&&(this._pollTimer-=e,this._pollTimer<0&&(s=!0,this._pollTimer=this.pollRate)),s)for(var n=this.manager.pointers,r=0;r0&&i.globalTopOnly&&(i.ignoreEvents=!0)}}}},clear:function(t){var e=t.input;if(e){this.queueForRemoval(t),e.gameObject=void 0,e.target=void 0,e.hitArea=void 0,e.hitAreaCallback=void 0,e.callbackContext=void 0,t.input=null;var i=this._draggable.indexOf(t);return i>-1&&this._draggable.splice(i,1),(i=this._drag[0].indexOf(t))>-1&&this._drag[0].splice(i,1),(i=this._over[0].indexOf(t))>-1&&this._over[0].splice(i,1),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,s){return void 0===s&&(s=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&s&&!t.input.dropZone&&(t.input.dropZone=s),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=s,n}return[]},processDownEvents:function(t){var e=this._temp;this.emit("pointerdown",t,e);for(var i=0,s=0;s0?t.dragState=1:t.dragState>0&&!t.primaryDown&&t.justUp&&(t.dragState=5),1===t.dragState){var o=[];for(i=0;i1&&(this.sortGameObjects(o),this.topOnly&&o.splice(1)),this._drag[t.id]=o,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?t.dragState=3:t.dragState=2}if(2===t.dragState&&(this.dragDistanceThreshold>0&&h(t.x,t.y,t.downX,t.downY)>=this.dragDistanceThreshold&&(t.dragState=3),this.dragTimeThreshold>0&&e>=t.downTime+this.dragTimeThreshold&&(t.dragState=3)),3===t.dragState){for(n=this._drag[t.id],i=0;i0?(s.emit("dragleave",t,r.target),this.emit("dragleave",t,s,r.target),r.target=u[0],s.emit("dragenter",t,r.target),this.emit("dragenter",t,s,r.target)):(s.emit("dragleave",t,r.target),this.emit("dragleave",t,s,r.target),u[0]?(r.target=u[0],s.emit("dragenter",t,r.target),this.emit("dragenter",t,s,r.target)):r.target=null)}else!r.target&&u[0]&&(r.target=u[0],s.emit("dragenter",t,r.target),this.emit("dragenter",t,s,r.target));var c=t.x-s.input.dragX,d=t.y-s.input.dragY;s.emit("drag",t,c,d),this.emit("drag",t,s,c,d)}return n.length}if(5===t.dragState){for(n=this._drag[t.id],i=0;i0)for(this.sortGameObjects(n),this.emit("pointerout",t,n),e=0;e0)for(this.sortGameObjects(r),this.emit("pointerover",t,r),e=0;e-1&&this._draggable.splice(n,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return o(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var s=!1,n=!1,r=!1,o=!1;if(p(e)){var h=e;e=d(h,"hitArea",null),i=d(h,"hitAreaCallback",null),s=d(h,"draggable",!1),n=d(h,"dropZone",!1),r=d(h,"cursor",!1),o=d(h,"useHandCursor",!1);var u=d(h,"pixelPerfect",!1),l=d(h,"alphaTolerance",1);u&&(e={},i=this.makePixelPerfect(l)),e&&i||this.setHitAreaFromTexture(t)}else"function"!=typeof e||i||(i=e,e={});for(var c=0;cr;h--){for(u=0;u0&&e.cameraFilter&n._id||""===e.text)){var a=t.currentContext;t.currentBlendMode!==e.blendMode&&(t.currentBlendMode=e.blendMode,a.globalCompositeOperation=t.blendModes[e.blendMode]),t.currentAlpha!==e.alpha&&(t.currentAlpha=e.alpha,a.globalAlpha=e.alpha),t.currentScaleMode!==e.scaleMode&&(t.currentScaleMode=e.scaleMode);var o=e.canvas;if(a.save(),void 0!==r){var h=r.matrix;a.transform(h[0],h[1],h[2],h[3],h[4],h[5])}var u=e.x-n.scrollX*e.scrollFactorX,l=e.y-n.scrollY*e.scrollFactorY;t.config.roundPixels&&(u|=0,l|=0),a.translate(u,l),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY),a.translate(o.width*(e.flipX?1:0),o.height*(e.flipY?1:0)),a.scale(e.flipX?-1:1,e.flipY?-1:1),a.drawImage(o,0,0,o.width,o.height,-e.displayOriginX,-e.displayOriginY,o.width,o.height),a.restore()}}},function(t,e,i){var s=i(2);t.exports=function(t,e,i,n,r){s.RENDER_MASK!==e.renderFlags||e.cameraFilter>0&&e.cameraFilter&n._id||""===e.text||(e.dirty&&(e.canvasTexture=t.canvasToTexture(e.canvas,e.canvasTexture),e.dirty=!1),this.pipeline.batchText(this,n,r))}},function(t,e,i){var s=i(3),n=i(3);s=i(415),n=i(414),t.exports={renderWebGL:s,renderCanvas:n}},function(t,e){t.exports=function(t,e,i){var s=t.canvas,n=t.context,r=t.style,a=[],o=0,h=i.length;r.maxLines>0&&r.maxLinesc&&(f=-c),0!==f&&(d+=f>0?f*i.length:f*(i.length-1)),{width:o,height:d,lines:h,lineWidths:a,lineSpacing:f,lineHeight:c}}},,,,function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},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){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:1-Math.cos(t*Math.PI/2)}},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--t*t*t*t*t+1}},function(t,e){t.exports=function(t){return t*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 1- --t*t*t*t}},function(t,e){t.exports=function(t){return t*t*t*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*(2-t)}},function(t,e){t.exports=function(t){return t*t}},function(t,e){t.exports=function(t){return 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 1-Math.pow(2,-10*t)}},function(t,e){t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},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 s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*.5+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 s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-s)*(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 s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)}},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){return--t*t*t+1}},function(t,e){t.exports=function(t){return t*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 Math.sqrt(1- --t*t)}},function(t,e){t.exports=function(t){return 1-Math.sqrt(1-t*t)}},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 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){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,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},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){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},function(t,e,i){var s=i(247),n=i(246),r=i(245),a=i(244),o=i(243),h=i(242),u=i(241),l=i(240),c=i(239),d=i(238),f=i(237),p=i(236);t.exports={Power0:u,Power1:l.Out,Power2:a.Out,Power3:c.Out,Power4:d.Out,Linear:u,Quad:l.Out,Cubic:a.Out,Quart:c.Out,Quint:d.Out,Sine:f.Out,Expo:h.Out,Circ:r.Out,Elastic:o.Out,Back:s.Out,Bounce:n.Out,Stepped:p,"Quad.easeIn":l.In,"Cubic.easeIn":a.In,"Quart.easeIn":c.In,"Quint.easeIn":d.In,"Sine.easeIn":f.In,"Expo.easeIn":h.In,"Circ.easeIn":r.In,"Elastic.easeIn":o.In,"Back.easeIn":s.In,"Bounce.easeIn":n.In,"Quad.easeOut":l.Out,"Cubic.easeOut":a.Out,"Quart.easeOut":c.Out,"Quint.easeOut":d.Out,"Sine.easeOut":f.Out,"Expo.easeOut":h.Out,"Circ.easeOut":r.Out,"Elastic.easeOut":o.Out,"Back.easeOut":s.Out,"Bounce.easeOut":n.Out,"Quad.easeInOut":l.InOut,"Cubic.easeInOut":a.InOut,"Quart.easeInOut":c.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":f.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":r.InOut,"Elastic.easeInOut":o.InOut,"Back.easeInOut":s.InOut,"Bounce.easeInOut":n.InOut}},,,,,,function(t,e,i){var s=i(2);t.exports=function(t,e,i,n,r){s.RENDER_MASK!==e.renderFlags||e.cameraFilter>0&&e.cameraFilter&n._id||t.drawImage(e,n,r)}},function(t,e,i){var s=i(2);t.exports=function(t,e,i,n,r){s.RENDER_MASK!==e.renderFlags||e.cameraFilter>0&&e.cameraFilter&n._id||this.pipeline.batchSprite(e,n,r)}},function(t,e,i){var s=i(3),n=i(3);s=i(460),n=i(459),t.exports={renderWebGL:s,renderCanvas:n}},function(t,e,i){var s=i(2);t.exports=function(t,e,i,n,r){s.RENDER_MASK!==e.renderFlags||e.cameraFilter>0&&e.cameraFilter&n._id||this.pipeline.batchGraphics(this,n,r)}},function(t,e,i){var s=i(3),n=i(3);s=i(462),n=i(176),n=i(176),t.exports={renderWebGL:s,renderCanvas:n}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e,i){var s=i(14);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e,i){var s=i(54);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},function(t,e,i){var s=i(54);t.exports=function(t,e){return s(t,e.x,e.y)}},function(t,e,i){var s=i(114);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},,,,function(t,e,i){var s=i(0),n=i(12),r=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.systems.events.once("destroy",this.destroy,this)},start:function(){var t=this.systems.events;t.on("preupdate",this.preUpdate,this),t.on("update",this.update,this),t.once("shutdown",this.shutdown,this)},add:function(t){return-1===this._list.indexOf(t)&&-1===this._pendingInsertion.indexOf(t)&&this._pendingInsertion.push(t),t},preUpdate:function(){var t=this._pendingRemoval.length,e=this._pendingInsertion.length;if(0!==t||0!==e){var i,s;for(i=0;i-1&&this._list.splice(n,1)}this._list=this._list.concat(this._pendingInsertion.splice(0)),this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){for(var i=0;i0&&(t.splice(i,1),t.unshift(e)),e}},function(t,e){t.exports=function(t,e,i){var s=t.indexOf(e),n=t.indexOf(i);return-1!==s&&-1===n&&(t[s]=i,!0)}},function(t,e,i){var s=i(56);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 s(t,n)}},function(t,e,i){var s=i(29);t.exports=function(t,e,i,n,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),s(t,e,i)){var a=i-e,o=t.splice(e,a);if(n)for(var h=0;ht.length-1)throw new Error("Index out of bounds");var r=s(t,e);return i&&i.call(n,r),r}},function(t,e,i){var s=i(255);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 n=[],r=Math.max(s((e-t)/(i||1)),0),a=0;a=t.length)throw new Error("Supplied index out of bounds");return s!==i&&(t.splice(s,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var s=t[i-1],n=t.indexOf(s);t[i]=s,t[n]=e}return t}},function(t,e,i){var s=i(29);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var a=n;a0){var a=s-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),n&&n.call(r,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;s>0&&o>a&&(e.splice(a),o=a);for(var h=o;h>0;h--){var u=e[h];t.splice(i,0,u),n&&n.call(r,u)}return e}},function(t,e){t.exports=function(t,e,i,s,n){if(void 0===n&&(n=t),i>0){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),s&&s.call(n,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;i>0&&a>r&&(e.splice(r),a=r);for(var o=0;o0||!this.inFocus)&&(this._coolDown--,r=Math.min(r,this._target)),r>this._min&&(r=s[i],r=Math.min(r,this._min)),s[i]=r,this.deltaIndex++,this.deltaIndex>n&&(this.deltaIndex=0);for(var a=0,o=0;othis.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},tick:function(){this.step(window.performance.now())},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running?this.sleep():t&&(this.startTime+=-this.lastTime+(this.lastTime=window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step(window.performance.now())},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){var i=0,s=function(t,e,s,n){var r=i-n.y-n.height;t.add(s,e,n.x,r,n.width,n.height)};t.exports=function(t,e,n){var r=t.source[e];t.add("__BASE",e,0,0,r.width,r.height),i=r.height;for(var a=n.split("\n"),o=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",u="",l={x:0,y:0,width:0,height:0},c=0;cx||o<-x)&&(o=0),o<0&&(o=x+o),-1!==h&&(x=o+(h+1));for(var _=u,C=u,M=0,P=e.sourceIndex,k=0;kg||c<-g)&&(c=0),c<0&&(c=g+c),-1!==d&&(g=c+(d+1));for(var m=f,v=f,y=0,x=0,w=0;wr&&(y=T-r),S>a&&(x=S-a),t.add(w,e,i+m,n+v,h-y,u-x),(m+=h+p)+h>r&&(m=f,v+=u+p)}return t}},function(t,e,i){var s=i(33);t.exports=function(t,e,i){if(i.frames){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.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()),r.customData=s(h)}for(var u in i)"frames"!==u&&(Array.isArray(i[u])?t.customData[u]=i[u].slice(0):t.customData[u]=i[u]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},function(t,e,i){var s=i(33);t.exports=function(t,e,i){if(i.frames||i.textures){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var r,a=Array.isArray(i.textures)?i.textures[e].frames:i.frames,o=0;o=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var i=parseInt(RegExp.$1,10),r=parseInt(RegExp.$2,10);(10===i&&r>=11||i>10)&&(n.dolby=!0)}}catch(t){}return n}()},function(t,e,i){var s=i(57),n=i(80),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),s.cocoonJS||("onwheel"in window||n.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":n.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},function(t,e,i){t.exports={os:i(57),browser:i(80),features:i(120),input:i(522),audio:i(521),video:i(520),fullscreen:i(519),canvasFeatures:i(203)}},function(t,e,i){var s=i(20);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===s.CANVAS?i="Canvas":e.renderType===s.HEADLESS&&(i="Headless");var n,r=e.audio,a=t.device.audio;if(n=!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"+s.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"+s.VERSION+" ("+i+" | "+n+")")),h=h.concat(" %c "+e.gameURL),u[0]=h,console.log.apply(console,u)}}}},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 vec4 inTint;","","varying vec2 outTexCoord;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(inPosition, 1.0, 1.0);"," outTexCoord = inTexCoord;"," outTint = inTint;","}","",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_TEXTURE_TINT_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","varying vec4 outTint;","","void main()","{"," vec4 texel = texture2D(uMainSampler, outTexCoord);"," texel *= vec4(outTint.rgb * outTint.a, outTint.a);"," gl_FragColor = texel;","}",""].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];","","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(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){t.exports=["#define SHADER_NAME PHASER_FLAT_TINT_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform mat4 uModelMatrix;","","attribute vec2 inPosition;","attribute vec4 inTint;","","varying vec4 outTint;","","void main () {"," gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(inPosition, 1.0, 1.0);"," outTint = inTint;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_FLAT_TINT_FS","","precision mediump float;","","varying vec4 outTint;","","void main() {"," gl_FragColor = vec4(outTint.rgb * outTint.a, outTint.a);","}",""].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_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,i){var s=i(272),n=i(22),r=i(20),a=i(120);t.exports=function(t){var e,o,h=t.config;if(h.renderType!==r.HEADLESS)if(h.renderType===r.CANVAS||h.renderType!==r.CANVAS&&!a.webGL){if(!a.canvas)throw new Error("Cannot create Canvas or WebGL context, aborting.");h.renderType=r.CANVAS}else h.renderType=r.WEBGL;h.pixelArt&&n.disableSmoothing(),h.canvas?t.canvas=h.canvas:t.canvas=n.create(t,h.width,h.height,h.renderType),h.canvasStyle&&(t.canvas.style=h.canvasStyle),h.pixelArt&&s.setCrisp(t.canvas),1!==h.zoom&&(t.canvas.style.width=(h.width*h.zoom).toString()+"px",t.canvas.style.height=(h.height*h.zoom).toString()+"px"),h.renderType!==r.HEADLESS&&(e=i(267),o=i(262),h.renderType===r.WEBGL?(t.renderer=new o(t),t.context=null):(t.renderer=new e(t),t.context=t.renderer.gameContext))}},function(t,e,i){var s=i(0),n=i(20),r=i(1),a=i(4),o=i(8),h=i(16),u=i(3),l=i(121),c=i(132),d=new s({initialize:function(t){void 0===t&&(t={});this.width=a(t,"width",1024),this.height=a(t,"height",768),this.zoom=a(t,"zoom",1),this.resolution=a(t,"resolution",1),this.renderType=a(t,"type",n.AUTO),this.parent=a(t,"parent",null),this.canvas=a(t,"canvas",null),this.context=a(t,"context",null),this.canvasStyle=a(t,"canvasStyle",null),this.sceneConfig=a(t,"scene",null),this.seed=a(t,"seed",[(Date.now()*Math.random()).toString()]),h.RND.init(this.seed),this.gameTitle=a(t,"title",""),this.gameURL=a(t,"url","https://phaser.io"),this.gameVersion=a(t,"version",""),this.autoFocus=a(t,"autoFocus",!0),this.inputKeyboard=a(t,"input.keyboard",!0),this.inputKeyboardEventTarget=a(t,"input.keyboard.target",window),this.inputMouse=a(t,"input.mouse",!0),this.inputMouseEventTarget=a(t,"input.mouse.target",null),this.inputMouseCapture=a(t,"input.mouse.capture",!0),this.inputTouch=a(t,"input.touch",!0),this.inputTouchEventTarget=a(t,"input.touch.target",null),this.inputTouchCapture=a(t,"input.touch.capture",!0),this.inputActivePointers=a(t,"input.activePointers",1),this.inputGamepad=a(t,"input.gamepad",!1),this.inputGamepadEventTarget=a(t,"input.gamepad.target",window),this.disableContextMenu=a(t,"disableContextMenu",!1),this.audio=a(t,"audio"),this.hideBanner=!1===a(t,"banner",null),this.hidePhaser=a(t,"banner.hidePhaser",!1),this.bannerTextColor=a(t,"banner.text","#ffffff"),this.bannerBackgroundColor=a(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=a(t,"fps",null);var e=a(t,"render",t);this.antialias=a(e,"antialias",!0),this.pixelArt=a(e,"pixelArt",!1),this.autoResize=a(e,"autoResize",!1),this.roundPixels=a(e,"roundPixels",!1),this.transparent=a(e,"transparent",!1),this.clearBeforeRender=a(e,"clearBeforeRender",!0),this.premultipliedAlpha=a(e,"premultipliedAlpha",!0),this.preserveDrawingBuffer=a(e,"preserveDrawingBuffer",!1),this.failIfMajorPerformanceCaveat=a(e,"failIfMajorPerformanceCaveat",!1),this.powerPreference=a(e,"powerPreference","default");var i=a(t,"backgroundColor",0);this.backgroundColor=c(i),0===i&&this.transparent&&(this.backgroundColor.alpha=0),this.preBoot=a(t,"callbacks.preBoot",u),this.postBoot=a(t,"callbacks.postBoot",u),this.physics=a(t,"physics",{}),this.defaultPhysicsSystem=a(this.physics,"default",!1),this.loaderBaseURL=a(t,"loader.baseURL",""),this.loaderPath=a(t,"loader.path",""),this.loaderMaxParallelDownloads=a(t,"loader.maxParallelDownloads",32),this.loaderCrossOrigin=a(t,"loader.crossOrigin",void 0),this.loaderResponseType=a(t,"loader.responseType",""),this.loaderAsync=a(t,"loader.async",!0),this.loaderUser=a(t,"loader.user",""),this.loaderPassword=a(t,"loader.password",""),this.loaderTimeout=a(t,"loader.timeout",0),this.installGlobalPlugins=[],this.installScenePlugins=[];var s=a(t,"plugins",null),d=l.DefaultScene;s&&(Array.isArray(s)?this.defaultPlugins=s:o(s)&&(this.installGlobalPlugins=r(s,"global",[]),this.installScenePlugins=r(s,"scene",[]),Array.isArray(s.default)?d=s.default:Array.isArray(s.defaultMerge)&&(d=d.concat(s.defaultMerge)))),this.defaultPlugins=d;var f="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=a(t,"images.default",f+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=a(t,"images.missing",f+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg==")}});t.exports=d},function(t,e,i){var s=i(130),n=i(207),r=i(205),a=i(22),o=i(0),h=i(533),u=i(532),l=i(81),c=i(524),d=i(523),f=i(271),p=i(9),g=i(201),m=i(196),v=i(194),y=i(191),x=i(184),w=i(506),T=i(505),S=new o({initialize:function(t){this.config=new h(t),this.renderer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new p,this.anims=new n(this),this.textures=new x(this),this.cache=new r(this),this.registry=new l(this),this.input=new g(this,this.config),this.scene=new v(this,this.config.sceneConfig),this.device=d,this.sound=y.create(this),this.loop=new w(this,this.config.fps),this.plugins=new m(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.hasFocus=!1,this.isOver=!0,f(this.boot.bind(this))},boot:function(){this.isBooted=!0,this.config.preBoot(this),u(this),c(this),s(this.canvas,this.config.parent),this.events.emit("boot"),this.events.once("ready",this.start,this)},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)),T(this);var t=this.events;t.on("hidden",this.onHidden,this),t.on("visible",this.onVisible,this),t.on("blur",this.onBlur,this),t.on("focus",this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit("prestep",t,e),i.emit("step",t,e),this.scene.update(t,e),i.emit("poststep",t,e);var s=this.renderer;s.preRender(),i.emit("prerender",s,t,e),this.scene.render(s),s.postRender(),i.emit("postrender",s,t,e)},headlessStep:function(t,e){var i=this.events;i.emit("prestep",t,e),i.emit("step",t,e),this.scene.update(t,e),i.emit("poststep",t,e),i.emit("prerender"),i.emit("postrender")},onHidden:function(){this.loop.pause(),this.events.emit("pause")},onVisible:function(){this.loop.resume(),this.events.emit("resume")},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},resize:function(t,e){this.config.width=t,this.config.height=e,this.renderer.resize(t,e),this.input.resize(),this.scene.resize(t,e),this.events.emit("resize",t,e)},destroy:function(t){this.pendingDestroy=!0,this.removeCanvas=t},runDestroy:function(){this.events.emit("destroy"),this.events.removeAllListeners(),this.scene.destroy(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(a.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=S},function(t,e,i){var s=i(0),n=i(9),r=i(12),a=new s({Extends:n,initialize:function(){n.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",a,"events"),t.exports=a},function(t,e,i){t.exports={EventEmitter:i(535)}},function(t,e){var i,s,n=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{s="function"==typeof clearTimeout?clearTimeout:a}catch(t){s=a}}();var h,u=[],l=!1,c=-1;function d(){l&&h&&(l=!1,h.length?u=h.concat(u):c=-1,u.length&&f())}function f(){if(!l){var t=o(d);l=!0;for(var e=u.length;e;){for(h=u,u=[];++c1)for(var i=1;i0&&e.cameraFilter&n._id||t.drawImage(e,n,r)}},function(t,e,i){var s=i(2);t.exports=function(t,e,i,n,r){s.RENDER_MASK!==e.renderFlags||e.cameraFilter>0&&e.cameraFilter&n._id||this.pipeline.batchSprite(e,n,r)}},function(t,e,i){var s=i(3),n=i(3);s=i(555),n=i(554),t.exports={renderWebGL:s,renderCanvas:n}},,,,,,function(t,e,i){var s=i(123),n=i(0),r=i(1),a=i(12),o=i(31),h=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.currentCameraId=1,this.cameras=[],this.cameraPool=[],this.main,this.baseScale=1,t.sys.events.once("boot",this.boot,this),t.sys.events.on("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.systems.events.once("destroy",this.destroy,this)},start:function(){this.main||this.boot();var t=this.systems.events;t.on("update",this.update,this),t.once("shutdown",this.shutdown,this)},add:function(t,e,i,n,r,a){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.game.config.width),void 0===n&&(n=this.scene.sys.game.config.height),void 0===r&&(r=!1),void 0===a&&(a="");var o=null;return this.cameraPool.length>0?(o=this.cameraPool.pop()).setViewport(t,e,i,n):o=new s(t,e,i,n),o.setName(a),o.setScene(this.scene),this.cameras.push(o),r&&(this.main=o),o._id=this.currentCameraId,this.currentCameraId=this.currentCameraId<<1,o},addExisting:function(t){var e=this.cameras.indexOf(t),i=this.cameraPool.indexOf(t);return e<0&&i>=0?(this.cameras.push(t),this.cameraPool.slice(i,1),t):null},fromJSON:function(t){Array.isArray(t)||(t=[t]);for(var e=this.scene.sys.game.config.width,i=this.scene.sys.game.config.height,s=0;s=0&&this.cameras.length>1&&(this.cameraPool.push(this.cameras[e]),this.cameras.splice(e,1),this.main===t&&(this.main=this.cameras[0]))},render:function(t,e,i){for(var s=this.cameras,n=this.baseScale,r=0,a=s.length;r0;)this.cameraPool.push(this.cameras.pop());return this.main=this.add(),this.main},update:function(t,e){for(var i=0,s=this.cameras.length;i>16)+(65280&t)+((255&t)<<16)},s={_tintTL:16777215,_tintTR:16777215,_tintBL:16777215,_tintBR:16777215,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,s,n){return void 0===t&&(t=16777215),void 0===e&&(e=t,s=t,n=t),this._tintTL=i(t),this._tintTR=i(e),this._tintBL=i(s),this._tintBR=i(n),this},tintTopLeft:{get:function(){return this._tintTL},set:function(t){this._tintTL=i(t)}},tintTopRight:{get:function(){return this._tintTR},set:function(t){this._tintTR=i(t)}},tintBottomLeft:{get:function(){return this._tintBL},set:function(t){this._tintBL=i(t)}},tintBottomRight:{get:function(){return this._tintBR},set:function(t){this._tintBR=i(t)}},tint:{set:function(t){this.setTint(t,t,t,t)}}};t.exports=s},function(t,e){var i={texture:null,frame:null,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}};t.exports=i},function(t,e){var i={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.frame.realWidth},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return 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){var i={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=i},function(t,e,i){var s=i(59),n={_scaleMode:s.DEFAULT,scaleMode:{get:function(){return this._scaleMode},set:function(t){t!==s.LINEAR&&t!==s.NEAREST||(this._scaleMode=t)}},setScaleMode:function(t){return this.scaleMode=t,this}};t.exports=n},function(t,e){var i={_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=Math.round(this.originX*this.width),this._displayOriginY=Math.round(this.originY*this.height),this}};t.exports=i},function(t,e){var i={matrixStack:null,currentMatrix:null,currentMatrixIndex:0,initMatrixStack:function(){return this.matrixStack=new Float32Array(6e3),this.currentMatrix=new Float32Array([1,0,0,1,0,0]),this.currentMatrixIndex=0,this},save:function(){if(this.currentMatrixIndex>=this.matrixStack.length)return this;var t=this.matrixStack,e=this.currentMatrix,i=this.currentMatrixIndex;return this.currentMatrixIndex+=6,t[i+0]=e[0],t[i+1]=e[1],t[i+2]=e[2],t[i+3]=e[3],t[i+4]=e[4],t[i+5]=e[5],this},restore:function(){if(this.currentMatrixIndex<=0)return this;this.currentMatrixIndex-=6;var t=this.matrixStack,e=this.currentMatrix,i=this.currentMatrixIndex;return e[0]=t[i+0],e[1]=t[i+1],e[2]=t[i+2],e[3]=t[i+3],e[4]=t[i+4],e[5]=t[i+5],this},loadIdentity:function(){return this.setTransform(1,0,0,1,0,0),this},transform:function(t,e,i,s,n,r){var a=this.currentMatrix,o=a[0],h=a[1],u=a[2],l=a[3],c=a[4],d=a[5];return a[0]=o*t+u*e,a[1]=h*t+l*e,a[2]=o*i+u*s,a[3]=h*i+l*s,a[4]=o*n+u*r+c,a[5]=h*n+l*r+d,this},setTransform:function(t,e,i,s,n,r){var a=this.currentMatrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=s,a[4]=n,a[5]=r,this},translate:function(t,e){var i=this.currentMatrix,s=i[0],n=i[1],r=i[2],a=i[3],o=i[4],h=i[5];return i[4]=s*t+r*e+o,i[5]=n*t+a*e+h,this},scale:function(t,e){var i=this.currentMatrix,s=i[0],n=i[1],r=i[2],a=i[3];return i[0]=s*t,i[1]=n*t,i[2]=r*e,i[3]=a*e,this},rotate:function(t){var e=this.currentMatrix,i=e[0],s=e[1],n=e[2],r=e[3],a=Math.sin(t),o=Math.cos(t);return e[0]=i*o+n*a,e[1]=s*o+r*a,e[2]=i*-a+n*o,e[3]=s*-a+r*o,this}};t.exports=i},function(t,e,i){var s=i(214),n=i(213),r={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t){return void 0===t&&this.texture&&(t=this),new s(this.scene,t)},createGeometryMask:function(t){return void 0===t&&"Graphics"===this.type&&(t=this),new n(this.scene,t)}};t.exports=r},function(t,e,i){var s=i(14),n=i(292),r=i(6),a={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){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,0!==this.rotation&&n(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getTopRight:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,0!==this.rotation&&n(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBottomLeft:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,0!==this.rotation&&n(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBottomRight:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,0!==this.rotation&&n(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBounds:function(t){var e,i,n,r,a,o,h,u;if(void 0===t&&(t=new s),this.parentContainer){var l=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),l.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),l.transformPoint(t.x,t.y,t),n=t.x,r=t.y,this.getBottomLeft(t),l.transformPoint(t.x,t.y,t),a=t.x,o=t.y,this.getBottomRight(t),l.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),n=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,n,a,h),t.y=Math.min(i,r,o,u),t.width=Math.max(e,n,a,h)-t.x,t.height=Math.max(i,r,o,u)-t.y,t}};t.exports=a},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){var i={_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}};t.exports=i},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,i){var s=i(51),n={_blendMode:s.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=s[t]),(t|=0)>=0&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=n},function(t,e,i){var s=i(23),n={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,n){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=s(t,0,1),this._alphaTR=s(e,0,1),this._alphaBL=s(i,0,1),this._alphaBR=s(n,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=s(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=s(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=s(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=s(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=n},,,,,,,,,,,,,function(t,e){if("function"!=typeof window.Uint32Array&&"object"!=typeof window.Uint32Array){var i=function(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>>0;if("function"!=typeof t)throw new TypeError;for(var s=arguments.length>=2?arguments[1]:void 0,n=0;n