Files
BluePotato102 9d4d374c3d abanandoned 2
2025-12-03 15:34:44 -05:00

1 line
766 KiB
JavaScript

!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(i){var n={};function s(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return i[t].call(e.exports,e,e.exports,s),e.l=!0,e.exports}return s.m=i,s.c=n,s.d=function(t,e,i){s.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},s.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=1071)}([function(t,e){function r(t,e,i,n){for(var s in e)if(e.hasOwnProperty(s)){var r=(l=e,u=s,f=d=void 0,f=(c=i)?l[u]:Object.getOwnPropertyDescriptor(l,u),!c&&f.value&&"object"==typeof f.value&&(f=f.value),!(!f||!((d=f).get&&"function"==typeof d.get||d.set&&"function"==typeof d.set))&&(void 0===f.enumerable&&(f.enumerable=!0),void 0===f.configurable&&(f.configurable=!0),f));if(!1!==r){if(o=(n||t).prototype,a=s,h=void 0,(h=Object.getOwnPropertyDescriptor(o,a))&&(h.value&&"object"==typeof h.value&&(h=h.value),!1===h.configurable)){if(p.ignoreFinals)continue;throw new Error("cannot override final property '"+s+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,s,r)}else t.prototype[s]=e[s]}var o,a,h,l,u,c,d,f}function o(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++)r(t,e[i].prototype||e[i])}}function p(t){var e,i;if(t||(t={}),t.initialize){if("function"!=typeof t.initialize)throw new Error("initialize must be a function");e=t.initialize,delete t.initialize}else if(t.Extends){var n=t.Extends;e=function(){n.apply(this,arguments)}}else e=function(){};t.Extends?(e.prototype=Object.create(t.Extends.prototype),e.prototype.constructor=e,i=t.Extends,delete t.Extends):e.prototype.constructor=e;var s=null;return t.Mixins&&(s=t.Mixins,delete t.Mixins),o(e,s),r(e,t,!0,i),e}p.extend=r,p.mixin=o,p.ignoreFinals=!1,t.exports=p},function(t,e){t.exports=function(t,e,i){var n=typeof t;return t&&"number"!==n&&"string"!==n&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},function(t,e,i){var n=i(0),s=i(15),r=i(81),o=i(9),a=new n({Extends:o,initialize:function(t,e){o.call(this),this.scene=t,this.type=e,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,t.sys.queueDepthSort(),t.sys.events.once("shutdown",this.destroy,this)},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setDataEnabled:function(){return this.data||(this.data=new r(this)),this},setData:function(t,e){return this.data||(this.data=new r(this)),this.data.set(t,e),this},getData:function(t){return this.data||(this.data=new r(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.input&&(this.input.enabled=!this.input.enabled),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},update:function(){},toJSON:function(){return s.ToJSON(this)},willRender:function(){return a.RENDER_MASK===this.renderFlags},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),(t=e).parentContainer);)e=e.parentContainer;return i.unshift(this.scene.sys.displayList.getIndex(t)),i},destroy:function(){if(this.scene&&!this.ignoreDestroy){this.preDestroy&&this.preDestroy.call(this),this.emit("destroy",this);var t=this.scene.sys;t.displayList.remove(this),t.updateList.remove(this),this.input&&(t.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),t.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners()}}});a.RENDER_MASK=15,t.exports=a},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(e.indexOf(".")){for(var n=e.split("."),s=t,r=i,o=0;o<n.length;o++){if(!s.hasOwnProperty(n[o])){r=i;break}r=s[n[o]],s=s[n[o]]}return r}return i}return i}},function(t,e,i){var n=new(i(0))({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new n(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return 0<i&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},transformMat3:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},transformMat4:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[4]*i+n[12],this.y=n[1]*e+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this}});n.ZERO=new n,t.exports=n},function(t,e){var i={},n={install:function(t){for(var e in i)t[e]=i[e]},register:function(t,e){i[t]=e},destroy:function(){i={}}};t.exports=n},function(t,e){t.exports=function(t){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 n=Object.prototype.hasOwnProperty,f="~";function s(){}function a(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,i,n,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var r=new a(i,n||t,s),o=f?f+e:e;return t._events[o]?t._events[o].fn?t._events[o]=[t._events[o],r]:t._events[o].push(r):(t._events[o]=r,t._eventsCount++),t}function l(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(f=!1)),o.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)n.call(t,e)&&i.push(f?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},o.prototype.listeners=function(t){var e=f?f+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,s=i.length,r=new Array(s);n<s;n++)r[n]=i[n].fn;return r},o.prototype.listenerCount=function(t){var e=f?f+t:t,i=this._events[e];return i?i.fn?1:i.length:0},o.prototype.emit=function(t,e,i,n,s,r){var o=f?f+t:t;if(!this._events[o])return!1;var a,h,l=this._events[o],u=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),u){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,i),!0;case 4:return l.fn.call(l.context,e,i,n),!0;case 5:return l.fn.call(l.context,e,i,n,s),!0;case 6:return l.fn.call(l.context,e,i,n,s,r),!0}for(h=1,a=new Array(u-1);h<u;h++)a[h-1]=arguments[h];l.fn.apply(l.context,a)}else{var c,d=l.length;for(h=0;h<d;h++)switch(l[h].once&&this.removeListener(t,l[h].fn,void 0,!0),u){case 1:l[h].fn.call(l[h].context);break;case 2:l[h].fn.call(l[h].context,e);break;case 3:l[h].fn.call(l[h].context,e,i);break;case 4:l[h].fn.call(l[h].context,e,i,n);break;default:if(!a)for(c=1,a=new Array(u-1);c<u;c++)a[c-1]=arguments[c];l[h].fn.apply(l[h].context,a)}}return!0},o.prototype.on=function(t,e,i){return r(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return r(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,i,n){var s=f?f+t:t;if(!this._events[s])return this;if(!e)return l(this,s),this;var r=this._events[s];if(r.fn)r.fn!==e||n&&!r.once||i&&r.context!==i||l(this,s);else{for(var o=0,a=[],h=r.length;o<h;o++)(r[o].fn!==e||n&&!r[o].once||i&&r[o].context!==i)&&a.push(r[o]);a.length?this._events[s]=1===a.length?a[0]:a:l(this,s)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=f?f+t:t,this._events[e]&&l(this,e)):(this._events=new s,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=f,o.EventEmitter=o,t.exports=o},function(t,e,i){var s=i(16),r=i(4);t.exports=function(t,e,i){var n=r(t,e,null);if(null===n)return i;if(Array.isArray(n))return s.RND.pick(n);if("object"==typeof n){if(n.hasOwnProperty("randInt"))return s.RND.integerInRange(n.randInt[0],n.randInt[1]);if(n.hasOwnProperty("randFloat"))return s.RND.realInRange(n.randFloat[0],n.randFloat[1])}else if("function"==typeof n)return n(e);return n}},function(t,e,i){var n=i(0),s=i(12),r=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.displayList,this.updateList,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.systems.events.once("destroy",this.destroy,this)},start:function(){this.systems.events.once("shutdown",this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null,this.displayList=null,this.updateList=null}});r.register=function(t,e){r.prototype.hasOwnProperty(t)||(r.prototype[t]=e)},s.register("GameObjectFactory",r,"add"),t.exports=r},function(t,e){var s={},n={},i={register:function(t,e,i,n){void 0===n&&(n=!1),s[t]={plugin:e,mapping:i,custom:n}},registerCustom:function(t,e,i){n[t]={plugin:e,mapping:i}},hasCore:function(t){return s.hasOwnProperty(t)},hasCustom:function(t){return n.hasOwnProperty(t)},getCore:function(t){return s[t]},getCustom:function(t){return n[t]},getCustomClass:function(t){return n.hasOwnProperty(t)?n[t].plugin:null},remove:function(t){s.hasOwnProperty(t)&&delete s[t]},removeCustom:function(t){n.hasOwnProperty(t)&&delete n[t]}};t.exports=i},function(t,e,i){var n=i(0),s=i(12),r=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.displayList,this.updateList,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.systems.events.once("destroy",this.destroy,this)},start:function(){this.systems.events.once("shutdown",this.shutdown,this)},shutdown:function(){this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null,this.displayList=null,this.updateList=null}});r.register=function(t,e){r.prototype.hasOwnProperty(t)||(r.prototype[t]=e)},s.register("GameObjectCreator",r,"make"),t.exports=r},function(t,e,i){var n=i(0),s=i(31),r=i(135),o=i(294),a=i(96),h=i(154),l=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new a),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new a),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new a),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new a),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},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 n=i(297),s={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 n};t.exports=s},function(t,e,i){var u=i(8),c=function(){var t,e,i,n,s,r,o=arguments[0]||{},a=1,h=arguments.length,l=!1;for("boolean"==typeof o&&(l=o,o=arguments[1]||{},a=2),h===a&&(o=this,--a);a<h;a++)if(null!=(t=arguments[a]))for(e in t)i=o[e],o!==(n=t[e])&&(l&&n&&(u(n)||(s=Array.isArray(n)))?(s?(s=!1,r=i&&Array.isArray(i)?i:[]):r=i&&u(i)?i:{},o[e]=c(l,r,n)):void 0!==n&&(o[e]=n));return o};t.exports=c},function(t,e){t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19}},function(t,e,i){var n=i(0),s=i(18),r=i(1),o=i(108),a=i(107),h=i(169),l=i(75),u=new n({initialize:function(t,e){this.loader=t,this.cache=r(e,"cache",!1),this.type=r(e,"type",!1),this.key=r(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.type||!this.key)throw new Error("Error calling 'Loader."+this.type+"' invalid key provided.");this.url=r(e,"url"),void 0===this.url?this.url=t.path+i+"."+r(e,"extension",""):"function"!=typeof this.url&&(this.url=t.path+this.url),this.src="",this.xhrSettings=l(r(e,"responseType",void 0)),r(e,"xhrSettings",!1)&&(this.xhrSettings=a(this.xhrSettings,r(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?s.FILE_POPULATED:s.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=r(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){(this.linkFile=t).linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===s.FILE_POPULATED?this.loader.nextFile(this,!0):(this.src=o(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=h(this,this.loader.xhr))},onLoad:function(t,e){var i=!(e.target&&200!==e.target.status);4===t.readyState&&400<=t.status&&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=s.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=s.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){this.state=s.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit("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}});u.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var n=new FileReader;n.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=t.onerror,n.readAsDataURL(e)}},u.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=u},function(t,e,i){var n={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=n},function(t,e,i){var f=i(1);t.exports=function(t,e,i,n,s,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=r.width),void 0===n&&(n=r.height);var o=f(s,"isNotEmpty",!1),a=f(s,"isColliding",!1),h=f(s,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(n+=e,e=0),t+i>r.width&&(i=Math.max(r.width-t,0)),e+n>r.height&&(n=Math.max(r.height-e,0));for(var l=[],u=e;u<e+n;u++)for(var c=t;c<t+i;c++){var d=r.data[u][c];if(null!==d){if(o&&-1===d.index)continue;if(a&&!d.collides)continue;if(h&&!d.hasInterestingFace)continue;l.push(d)}}return l}},function(t,e,i){var n,a,s,h=i(20),l=i(131),u=[],c=!1;t.exports=(s=function(){var e=0;return u.forEach(function(t){t.parent&&e++}),e},{create2D:function(t,e,i){return n(t,e,i,h.CANVAS)},create:n=function(t,e,i,n,s){var r;void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=h.CANVAS),void 0===s&&(s=!1);var o=a(n);return null===o?(o={parent:t,canvas:document.createElement("canvas"),type:n},n===h.CANVAS&&u.push(o)):o.parent=t,r=o.canvas,s&&(o.parent=r),r.width=e,r.height=i,c&&n===h.CANVAS&&l.disable(r.getContext("2d")),r},createWebGL:function(t,e,i){return n(t,e,i,h.WEBGL)},disableSmoothing:function(){c=!0},enableSmoothing:function(){c=!1},first:a=function(t){if(void 0===t&&(t=h.CANVAS),t===h.WEBGL)return null;for(var e=0;e<u.length;e++){var i=u[e];if(!i.parent&&i.type===t)return i}return null},free:function(){return u.length-s()},pool:u,remove:function(e){var i=e instanceof HTMLCanvasElement;u.forEach(function(t){(i&&t.canvas===e||!i&&t.parent===e)&&(t.parent=null,t.canvas.width=1,t.canvas.height=1)})},total:s})},function(t,e){t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},function(t,e,i){var l=i(51),u=i(10),c=i(59);t.exports=function(t,e,i){e.x=u(i,"x",0),e.y=u(i,"y",0),e.depth=u(i,"depth",0),e.flipX=u(i,"flipX",!1),e.flipY=u(i,"flipY",!1);var n=u(i,"scale",null);"number"==typeof n?e.setScale(n):null!==n&&(e.scaleX=u(n,"x",1),e.scaleY=u(n,"y",1));var s=u(i,"scrollFactor",null);"number"==typeof s?e.setScrollFactor(s):null!==s&&(e.scrollFactorX=u(s,"x",1),e.scrollFactorY=u(s,"y",1)),e.rotation=u(i,"rotation",0);var r=u(i,"angle",null);null!==r&&(e.angle=r),e.alpha=u(i,"alpha",1);var o=u(i,"origin",null);if("number"==typeof o)e.setOrigin(o);else if(null!==o){var a=u(o,"x",.5),h=u(o,"y",.5);e.setOrigin(a,h)}return e.scaleMode=u(i,"scaleMode",c.DEFAULT),e.blendMode=u(i,"blendMode",l.NORMAL),e.visible=u(i,"visible",!0),u(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},function(t,e){t.exports=function(t,e,i,n,s,r){var o;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=s;o<h;o++)t[o][e]=i+a*n,a++;else for(o=s;0<=o;o--)t[o][e]=i+a*n,a++;return t}},function(t,e){t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},function(t,e){t.exports={getTintFromFloats:function(t,e,i,n){return((255&(255*n|0))<<24|(255&(255*t|0))<<16|(255&(255*e|0))<<8|255&(255*i|0))>>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},getComponentCount:function(t,e){for(var i=0,n=0;n<t.length;++n){var s=t[n];s.type===e.FLOAT?i+=s.size:i+=1}return i}}},function(t,e,i){var n=i(0),h=i(18),l=i(19),s=i(7),u=i(1),c=i(4),d=i(8),r=new n({Extends:l,initialize:function(t,e,i,n,s){var r="json";if(d(e)){var o=e;e=u(o,"key"),i=u(o,"url"),n=u(o,"xhrSettings"),r=u(o,"extension",r),s=u(o,"dataKey",s)}var a={type:"json",cache:t.cacheManager.json,extension:r,responseType:"text",key:e,url:i,xhrSettings:n,config:s};l.call(this,t,a),d(i)&&(this.data=s?c(i,s):i,this.state=h.FILE_POPULATED)},onProcess:function(){if(this.state!==h.FILE_POPULATED){this.state=h.FILE_PROCESSING;var t=JSON.parse(this.xhrLoader.responseText),e=this.config;this.data="string"==typeof e?c(t,e,t):t}this.onProcessComplete()}});s.register("json",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new r(this,t[s]));else this.addFile(new r(this,t,e,n,i));return this}),t.exports=r},function(t,e){t.exports=function(t,e,i,n){var s=t.length;if(e<0||s<e||i<=e||s<i||s<e+i){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e,i){var n=i(0),s=i(152),r=i(284),o=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=255),this.r=0,this.g=0,this.b=0,this.a=255,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,n)},transparent:function(){return this.red=0,this.green=0,this.blue=0,this.alpha=0,this.update()},setTo:function(t,e,i,n){return void 0===n&&(n=255),this.red=t,this.green=e,this.blue=i,this.alpha=n,this.update()},setGLTo:function(t,e,i,n){return void 0===n&&(n=1),this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=n,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=s(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 o(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=o},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 0<t.radius&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},function(t,e){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 n=i(0),r=i(15),o=i(2),s=i(556),a=new n({Extends:o,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScaleMode,r.ScrollFactor,r.Size,r.Texture,r.Tint,r.Transform,r.Visible,s],initialize:function(t,e,i,n,s){o.call(this,t,"Sprite"),this.anims=new r.Animation(this),this.setTexture(n,s),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 r.ToJSON(this)}});t.exports=a},function(t,e){t.exports=function(t,e,i,n,s,r){var o;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=s;o<h;o++)t[o][e]+=i+a*n,a++;else for(o=s;0<=o;o--)t[o][e]+=i+a*n,a++;return t}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.loader=t,this.type=e,this.key=i,this.files=n,this.complete=!1,this.pending=n.length,this.failed=0,this.config={};for(var s=0;s<n.length;s++)n[s].multiFile=this},isReadyToProcess:function(){return 0===this.pending&&0===this.failed&&!this.complete},addToMultiFile:function(t){return this.files.push(t),(t.multiFile=this).pending++,this.complete=!1,this},onFileComplete:function(t){-1!==this.files.indexOf(t)&&this.pending--},onFileFailed:function(t){-1!==this.files.indexOf(t)&&this.failed++}});t.exports=n},function(t,e,i){var n=i(0),s=i(18),c=i(19),r=i(7),d=i(1),f=i(8),o=new n({Extends:c,initialize:function t(e,i,n,s,r){var o,a="png";if(f(i)){var h=i;i=d(h,"key"),n=d(h,"url"),o=d(h,"normalMap"),s=d(h,"xhrSettings"),a=d(h,"extension",a),r=d(h,"frameConfig")}Array.isArray(n)&&(o=n[1],n=n[0]);var l={type:"image",cache:e.textureManager,extension:a,responseType:"blob",key:i,url:n,xhrSettings:s,config:r};if(c.call(this,e,l),o){var u=new t(e,this.key,o,s,r);u.type="normalMap",this.setLink(u),e.addFile(u)}},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){c.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){c.revokeObjectURL(t.data),t.onProcessError()},c.createObjectURL(this.data,this.xhrLoader.response,"image/png")},addToCache:function(){var t,e=this.linkFile;e&&e.state===s.FILE_COMPLETE?(t="image"===this.type?this.cache.addImage(this.key,this.data,e.data):this.cache.addImage(e.key,e.data,this.data),this.pendingDestroy(t),e.pendingDestroy(t)):e||(t=this.cache.addImage(this.key,this.data),this.pendingDestroy(t))}});r.register("image",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new o(this,t[n]));else this.addFile(new o(this,t,e,i));return this}),t.exports=o},function(t,e,i){var n=i(16);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e){t.exports=function(t,e,i){var n=i-e;return e+((t-e)%n+n)%n}},function(t,e,i){var d=i(140),f=i(21);t.exports=function(t,e,i,n,s){for(var r=null,o=null,a=null,h=null,l=f(t,e,i,n,null,s),u=0;u<l.length;u++){var c=l[u];c&&(c.collides?(r=d(c.x,c.y-1,!0,s),o=d(c.x,c.y+1,!0,s),a=d(c.x-1,c.y,!0,s),h=d(c.x+1,c.y,!0,s),c.faceTop=!r||!r.collides,c.faceBottom=!o||!o.collides,c.faceLeft=!a||!a.collides,c.faceRight=!h||!h.collides):c.resetFaces())}}},function(t,e){var a={};t.exports=a,function(){a._nextId=0,a._seed=0,a._nowStartTime=+new Date,a.extend=function(t,e){var i,n;"boolean"==typeof e?(i=2,n=e):(i=1,n=!0);for(var s=i;s<arguments.length;s++){var r=arguments[s];if(r)for(var o in r)n&&r[o]&&r[o].constructor===Object?t[o]&&t[o].constructor!==Object?t[o]=r[o]:(t[o]=t[o]||{},a.extend(t[o],n,r[o])):t[o]=r[o]}return t},a.clone=function(t,e){return a.extend({},e,t)},a.keys=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var i in t)e.push(i);return e},a.values=function(t){var e=[];if(Object.keys){for(var i=Object.keys(t),n=0;n<i.length;n++)e.push(t[i[n]]);return e}for(var s in t)e.push(t[s]);return e},a.get=function(t,e,i,n){e=e.split(".").slice(i,n);for(var s=0;s<e.length;s+=1)t=t[e[s]];return t},a.set=function(t,e,i,n,s){var r=e.split(".").slice(n,s);return a.get(t,e,0,-1)[r[r.length-1]]=i},a.shuffle=function(t){for(var e=t.length-1;0<e;e--){var i=Math.floor(a.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t},a.choose=function(t){return t[Math.floor(a.random()*t.length)]},a.isElement=function(t){return t instanceof HTMLElement},a.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},a.isFunction=function(t){return"function"==typeof t},a.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},a.isString=function(t){return"[object String]"===Object.prototype.toString.call(t)},a.clamp=function(t,e,i){return t<e?e:i<t?i:t},a.sign=function(t){return t<0?-1:1},a.now=function(){if(window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return new Date-a._nowStartTime},a.random=function(t,e){return e=void 0!==e?e:1,(t=void 0!==t?t:0)+i()*(e-t)};var i=function(){return a._seed=(9301*a._seed+49297)%233280,a._seed/233280};a.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},a.logLevel=1,a.log=function(){console&&0<a.logLevel&&a.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},a.info=function(){console&&0<a.logLevel&&a.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},a.warn=function(){console&&0<a.logLevel&&a.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},a.nextId=function(){return a._nextId++},a.map=function(t,e){if(t.map)return t.map(e);for(var i=[],n=0;n<t.length;n+=1)i.push(e(t[n]));return i},a.topologicalSort=function(t){var e=[],i=[],n=[];for(var s in t)i[s]||n[s]||h(s,i,n,t,e);return e};var h=function(t,e,i,n,s){var r=n[t]||[];i[t]=!0;for(var o=0;o<r.length;o+=1){var a=r[o];i[a]||(e[a]||h(a,e,i,n,s))}i[t]=!1,e[t]=!0,s.push(t)};a.chain=function(){for(var r=[],t=0;t<arguments.length;t+=1){var e=arguments[t];e._chained?r.push.apply(r,e._chained):r.push(e)}var i=function(){for(var t,e=new Array(arguments.length),i=0,n=arguments.length;i<n;i++)e[i]=arguments[i];for(i=0;i<r.length;i+=1){var s=r[i].apply(t,e);void 0!==s&&(t=s)}return t};return i._chained=r,i},a.chainPathBefore=function(t,e,i){return a.set(t,e,a.chain(i,a.get(t,e)))},a.chainPathAfter=function(t,e,i){return a.set(t,e,a.chain(a.get(t,e),i))}}()},function(t,e){t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},function(t,e){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY}},function(t,e){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x+t.width-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.y+t.height-t.height*t.originY}},function(t,e){t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var s=n.baseTileHeight,r=n.tilemapLayer;return r&&(void 0===i&&(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),s*=r.scaleY),e?Math.floor(t/s):t/s}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var s=n.baseTileWidth,r=n.tilemapLayer;return r&&(void 0===i&&(i=r.scene.cameras.main),t-=r.x+i.scrollX*(1-r.scrollFactorX),s*=r.scaleX),e?Math.floor(t/s):t/s}},function(t,e){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var n=(e-t.x)/t.width,s=(i-t.y)/t.height;return(n*=n)+(s*=s)<.25}},function(t,e){t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},function(t,e){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,n=t[e],s=e;s<i;s++)t[s]=t[s+1];return t.length=i,n}}},function(t,e,i){(function(i){var n={android:!1,chromeOS:!1,cocoonJS:!1,cocoonJSApp:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){var t=navigator.userAgent;/Windows/.test(t)?n.windows=!0:/Mac OS/.test(t)?n.macOS=!0:/Android/.test(t)?n.android=!0:/Linux/.test(t)?n.linux=!0:/iP[ao]d|iPhone/i.test(t)?(n.iOS=!0,navigator.appVersion.match(/OS (\d+)/),n.iOSVersion=parseInt(RegExp.$1,10)):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?n.kindle=!0:/CrOS/.test(t)&&(n.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(n.android=!1,n.iOS=!1,n.macOS=!1,n.windows=!0,n.windowsPhone=!0);var e=/Silk/.test(t);if((n.windows||n.macOS||n.linux&&!e||n.chromeOS)&&(n.desktop=!0),(n.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(n.desktop=!1),navigator.standalone&&(n.webApp=!0),void 0!==window.cordova&&(n.cordova=!0),i&&i.versions&&i.versions.node&&(n.node=!0),n.node&&"object"==typeof i.versions&&(n.nodeWebkit=!!i.versions["node-webkit"],n.electron=!!i.versions.electron),navigator.isCocoonJS){n.cocoonJS=!0;try{n.cocoonJSApp="undefined"!=typeof CocoonJS}catch(t){n.cocoonJSApp=!1}}return void 0!==window.ejecta&&(n.ejecta=!0),/Crosswalk/.test(t)&&(n.crosswalk=!0),n.iPhone=-1!==t.toLowerCase().indexOf("iphone"),n.iPad=-1!==t.toLowerCase().indexOf("ipad"),n.pixelRatio=window.devicePixelRatio||1,n}()}).call(this,i(537))},function(t,e){t.exports=function(t,e,i,n){var s=t-i,r=e-n;return Math.sqrt(s*s+r*r)}},function(t,e){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},function(t,e){t.exports=function(t,e,i){var n=t.x3-t.x1,s=t.y3-t.y1,r=t.x2-t.x1,o=t.y2-t.y1,a=e-t.x1,h=i-t.y1,l=n*n+s*s,u=n*r+s*o,c=n*a+s*h,d=r*r+o*o,f=r*a+o*h,p=l*d-u*u,g=0===p?0:1/p,v=(d*c-u*f)*g,y=(l*f-u*c)*g;return 0<=v&&0<=y&&v+y<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 n=i(453);t.exports=function(e,t){if("string"==typeof e&&n.hasOwnProperty(e)){if(t){var i=t.slice(0);return i.unshift(0),function(t){return i[0]=t,n[e].apply(this,i)}}return n[e]}return"function"==typeof e?e:(Array.isArray(e)&&e.length,n.Power0)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===s&&(s=0),void 0===r&&(r=0),this.matrix=new Float32Array([t,e,i,n,s,r,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},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),n=this.matrix,s=n[0],r=n[1],o=n[2],a=n[3];return n[0]=s*i+o*e,n[1]=r*i+a*e,n[2]=s*-e+o*i,n[3]=r*-e+a*i,this},multiply:function(t){var e=this.matrix,i=t.matrix,n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=i[0],u=i[1],c=i[2],d=i[3],f=i[4],p=i[5];return e[0]=l*n+u*r,e[1]=l*s+u*o,e[2]=c*n+d*r,e[3]=c*s+d*o,e[4]=f*n+p*r+a,e[5]=f*s+p*o+h,this},transform:function(t,e,i,n,s,r){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+n*l,o[3]=i*h+n*u,o[4]=s*a+r*l+c,o[5]=s*h+r*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var n=this.matrix,s=n[0],r=n[1],o=n[2],a=n[3],h=n[4],l=n[5];return i.x=t*s+e*o+h,i.y=t*r+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=e*s-i*n;return t[0]=s/a,t[1]=-i/a,t[2]=-n/a,t[3]=e/a,t[4]=(n*o-s*r)/a,t[5]=-(e*o-i*r)/a,this},setTransform:function(t,e,i,n,s,r){var o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=n,o[4]=s,o[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*i,a=n*n,h=s*s,l=r*r,u=Math.sqrt(o+h),c=Math.sqrt(a+l);return t.translateX=e[4],t.translateY=e[5],t.scaleX=u,t.scaleY=c,t.rotation=Math.acos(i/u)*(Math.atan(-s/i)<0?-1:1),t},applyITRS:function(t,e,i,n,s){var r=this.matrix,o=Math.sin(i),a=Math.cos(i);return r[4]=t,r[5]=e,r[0]=a*n,r[1]=o*n,r[2]=-o*s,r[3]=a*s,this},destroy:function(){this.matrix=null,this.decomposedMatrix=null}});t.exports=n},function(t,e,i){var n=i(23);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))}},function(t,e,i){var n=i(0),s=i(15),r=i(389),o=new n({Mixins:[s.Alpha,s.Flip,s.Visible],initialize:function(t,e,i,n,s,r,o,a){this.layer=t,this.index=e,this.x=i,this.y=n,this.width=s,this.height=r,this.baseWidth=void 0!==o?o:s,this.baseHeight=void 0!==a?a:r,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=null,(this.collisionCallbackContext=this).tint=16777215,this.physics={}},containsPoint:function(t,e){return!(t<this.pixelX||e<this.pixelY||t>this.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new r),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return this.getLeft(t)+this.width/2},getCenterY:function(t){return this.getTop(t)+this.height/2},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,s){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,s)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){return this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight-(this.height-this.baseHeight),this},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.tilemapLayer;return t?t.tileset:null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=o},function(t,e){t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},function(t,e,i){var n=i(0),s=i(60),r=i(227),o=i(226),a=i(96),h=i(153),l=new n({initialize:function(t,e,i,n,s,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this.x3=s,this.y3=r},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,n,s,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this.x3=s,this.y3=r,this},getLineA:function(t){return void 0===t&&(t=new a),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new a),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new a),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=l},function(t,e,i){var n=i(0),s=i(15),r=i(2),o=i(461),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.ScrollFactor,s.Size,s.Texture,s.Tint,s.Transform,s.Visible,o],initialize:function(t,e,i,n,s){r.call(this,t,"Image"),this.setTexture(n,s),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline("TextureTintPipeline")}});t.exports=a},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries=[],Array.isArray(t))for(var e=0;e<t.length;e++)this.set(t[e])},set:function(t){return-1===this.entries.indexOf(t)&&this.entries.push(t),this},get:function(t,e){for(var i=0;i<this.entries.length;i++){var n=this.entries[i];if(n[t]===e)return n}},getArray:function(){return this.entries.slice(0)},delete:function(t){var e=this.entries.indexOf(t);return-1<e&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t<this.entries.length;t++){var e=this.entries[t];console.log(e)}console.groupEnd()},each:function(t,e){var i,n=this.entries.slice(),s=n.length;if(e)for(i=0;i<s&&!1!==t.call(e,n[i],i);i++);else for(i=0;i<s&&!1!==t(n[i],i);i++);return this},iterate:function(t,e){var i,n=this.entries.length;if(e)for(i=0;i<n&&!1!==t.call(e,this.entries[i],i);i++);else for(i=0;i<n&&!1!==t(this.entries[i],i);i++);return this},iterateLocal:function(t){var e,i=[];for(e=1;e<arguments.length;e++)i.push(arguments[e]);var n=this.entries.length;for(e=0;e<n;e++){var s=this.entries[e];s[t].apply(s,i)}return this},clear:function(){return this.entries.length=0,this},contains:function(t){return-1<this.entries.indexOf(t)},union:function(t){var e=new n;return t.entries.forEach(function(t){e.set(t)}),this.entries.forEach(function(t){e.set(t)}),e},intersect:function(e){var i=new n;return this.entries.forEach(function(t){e.contains(t)&&i.set(t)}),i},difference:function(e){var i=new n;return this.entries.forEach(function(t){e.contains(t)||i.set(t)}),i},size:{get:function(){return this.entries.length},set:function(t){return this.entries.length=t}}});t.exports=n},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 L=i(100),F=i(10),R=i(62),O=i(63),B=i(73),D=i(163),I=i(102),z=i(4),Y=i(101),X=i(99),N=i(98);t.exports=function(t,e,i){void 0===i&&(i=L);for(var n=i.targets?i.targets:I(e),s=D(e),r=B(e,"delay",i.delay),o=B(e,"duration",i.duration),a=z(e,"easeParams",i.easeParams),h=O(z(e,"ease",i.ease),a),l=B(e,"hold",i.hold),u=B(e,"repeat",i.repeat),c=B(e,"repeatDelay",i.repeatDelay),d=R(e,"yoyo",i.yoyo),f=R(e,"flipX",i.flipX),p=R(e,"flipY",i.flipY),g=[],v=0;v<s.length;v++)for(var y=s[v].key,m=s[v].value,x=0;x<n.length;x++){var w=Y(y,m),b=N(n[x],y,w.getEnd,w.getStart,O(z(m,"ease",h),a),B(m,"delay",r),B(m,"duration",o),R(m,"yoyo",d),B(m,"hold",l),B(m,"repeat",u),B(m,"repeatDelay",c),R(m,"flipX",f),R(m,"flipY",p));g.push(b)}var T=new X(t,g,n);T.offset=F(e,"offset",null),T.completeDelay=F(e,"completeDelay",0),T.loop=Math.round(F(e,"loop",0)),T.loopDelay=Math.round(F(e,"loopDelay",0)),T.paused=R(e,"paused",!1),T.useFrames=R(e,"useFrames",!1);for(var S=z(e,"callbackScope",T),A=[T,null],C=X.TYPES,M=0;M<C.length;M++){var _=C[M],E=z(e,_,!1);if(E){var P=z(e,_+"Scope",S),k=z(e,_+"Params",[]);T.setCallback(_,E,A.concat(k),P)}}return T}},function(t,e){t.exports=function(n,s,t){var e;e=n.hasOwnProperty(s)?"function"==typeof n[s]?function(t,e,i){return n[s](t,e,i)}:function(){return n[s]}:"function"==typeof t?t:function(){return t};return e}},function(t,e,i){var u={};t.exports=u;var c=i(126),d=i(106),s=i(331),r=i(41),f=i(125),p=i(680);!function(){u._inertiaScale=4,u._nextCollidingGroupId=1,u._nextNonCollidingGroupId=-1,u._nextCategory=1,u.create=function(t){var e={id:r.nextId(),type:"body",label:"Body",gameObject:null,parts:[],plugin:{},angle:0,vertices:c.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"),position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},previousPositionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,ignoreGravity:!1,ignorePointer:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,render:{visible:!0,opacity:1,sprite:{xScale:1,yScale:1,xOffset:0,yOffset:0},lineWidth:0},events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inertia:0,_original:null},i=r.extend(e,t);return n(i,t),i},u.nextGroup=function(t){return t?u._nextNonCollidingGroupId--:u._nextCollidingGroupId++},u.nextCategory=function(){return u._nextCategory=u._nextCategory<<1,u._nextCategory};var n=function(t,e){e=e||{},u.set(t,{bounds:t.bounds||f.create(t.vertices),positionPrev:t.positionPrev||d.clone(t.position),anglePrev:t.anglePrev||t.angle,vertices:t.vertices,parts:t.parts||[t],isStatic:t.isStatic,isSleeping:t.isSleeping,parent:t.parent||t}),c.rotate(t.vertices,t.angle,t.position),p.rotate(t.axes,t.angle),f.update(t.bounds,t.vertices,t.velocity),u.set(t,{axes:e.axes||t.axes,area:e.area||t.area,mass:e.mass||t.mass,inertia:e.inertia||t.inertia});var i=t.isStatic?"#2e2b44":r.choose(["#006BA6","#0496FF","#FFBC42","#D81159","#8F2D56"]);t.render.fillStyle=t.render.fillStyle||i,t.render.strokeStyle=t.render.strokeStyle||"#000",t.render.sprite.xOffset+=-(t.bounds.min.x-t.position.x)/(t.bounds.max.x-t.bounds.min.x),t.render.sprite.yOffset+=-(t.bounds.min.y-t.position.y)/(t.bounds.max.y-t.bounds.min.y)};u.set=function(t,e){var i,n;for(i in"string"==typeof e&&(i=e,(e={})[i]=n),e)if(e.hasOwnProperty(i))switch(n=e[i],i){case"isStatic":u.setStatic(t,n);break;case"isSleeping":s.set(t,n);break;case"mass":u.setMass(t,n);break;case"density":u.setDensity(t,n);break;case"inertia":u.setInertia(t,n);break;case"vertices":u.setVertices(t,n);break;case"position":u.setPosition(t,n);break;case"angle":u.setAngle(t,n);break;case"velocity":u.setVelocity(t,n);break;case"angularVelocity":u.setAngularVelocity(t,n);break;case"parts":u.setParts(t,n);break;default:t[i]=n}},u.setStatic=function(t,e){for(var i=0;i<t.parts.length;i++){var n=t.parts[i];(n.isStatic=e)?(n._original={restitution:n.restitution,friction:n.friction,mass:n.mass,inertia:n.inertia,density:n.density,inverseMass:n.inverseMass,inverseInertia:n.inverseInertia},n.restitution=0,n.friction=1,n.mass=n.inertia=n.density=1/0,n.inverseMass=n.inverseInertia=0,n.positionPrev.x=n.position.x,n.positionPrev.y=n.position.y,n.anglePrev=n.angle,n.angularVelocity=0,n.speed=0,n.angularSpeed=0,n.motion=0):n._original&&(n.restitution=n._original.restitution,n.friction=n._original.friction,n.mass=n._original.mass,n.inertia=n._original.inertia,n.density=n._original.density,n.inverseMass=n._original.inverseMass,n.inverseInertia=n._original.inverseInertia,n._original=null)}},u.setMass=function(t,e){var i=t.inertia/(t.mass/6);t.inertia=i*(e/6),t.inverseInertia=1/t.inertia,t.mass=e,t.inverseMass=1/t.mass,t.density=t.mass/t.area},u.setDensity=function(t,e){u.setMass(t,e*t.area),t.density=e},u.setInertia=function(t,e){t.inertia=e,t.inverseInertia=1/t.inertia},u.setVertices=function(t,e){e[0].body===t?t.vertices=e:t.vertices=c.create(e,t),t.axes=p.fromVertices(t.vertices),t.area=c.area(t.vertices),u.setMass(t,t.density*t.area);var i=c.centre(t.vertices);c.translate(t.vertices,i,-1),u.setInertia(t,u._inertiaScale*c.inertia(t.vertices,t.mass)),c.translate(t.vertices,t.position),f.update(t.bounds,t.vertices,t.velocity)},u.setParts=function(t,e,i){var n;for(e=e.slice(0),t.parts.length=0,t.parts.push(t),t.parent=t,n=0;n<e.length;n++){var s=e[n];s!==t&&(s.parent=t).parts.push(s)}if(1!==t.parts.length){if(i=void 0===i||i){var r=[];for(n=0;n<e.length;n++)r=r.concat(e[n].vertices);c.clockwiseSort(r);var o=c.hull(r),a=c.centre(o);u.setVertices(t,o),c.translate(t.vertices,a)}var h=l(t);t.area=h.area,(t.parent=t).position.x=h.centre.x,t.position.y=h.centre.y,t.positionPrev.x=h.centre.x,t.positionPrev.y=h.centre.y,u.setMass(t,h.mass),u.setInertia(t,h.inertia),u.setPosition(t,h.centre)}},u.setPosition=function(t,e){var i=d.sub(e,t.position);t.positionPrev.x+=i.x,t.positionPrev.y+=i.y;for(var n=0;n<t.parts.length;n++){var s=t.parts[n];s.position.x+=i.x,s.position.y+=i.y,c.translate(s.vertices,i),f.update(s.bounds,s.vertices,t.velocity)}},u.setAngle=function(t,e){var i=e-t.angle;t.anglePrev+=i;for(var n=0;n<t.parts.length;n++){var s=t.parts[n];s.angle+=i,c.rotate(s.vertices,i,t.position),p.rotate(s.axes,i),f.update(s.bounds,s.vertices,t.velocity),0<n&&d.rotateAbout(s.position,i,t.position,s.position)}},u.setVelocity=function(t,e){t.positionPrev.x=t.position.x-e.x,t.positionPrev.y=t.position.y-e.y,t.velocity.x=e.x,t.velocity.y=e.y,t.speed=d.magnitude(t.velocity)},u.setAngularVelocity=function(t,e){t.anglePrev=t.angle-e,t.angularVelocity=e,t.angularSpeed=Math.abs(t.angularVelocity)},u.translate=function(t,e){u.setPosition(t,d.add(t.position,e))},u.rotate=function(t,e,i){if(i){var n=Math.cos(e),s=Math.sin(e),r=t.position.x-i.x,o=t.position.y-i.y;u.setPosition(t,{x:i.x+(r*n-o*s),y:i.y+(r*s+o*n)}),u.setAngle(t,t.angle+e)}else u.setAngle(t,t.angle+e)},u.scale=function(t,e,i,n){n=n||t.position;for(var s=0;s<t.parts.length;s++){var r=t.parts[s];r.position.x=n.x+(r.position.x-n.x)*e,r.position.y=n.y+(r.position.y-n.y)*i,c.scale(r.vertices,e,i,n),r.axes=p.fromVertices(r.vertices),t.isStatic||(r.area=c.area(r.vertices),u.setMass(r,t.density*r.area),c.translate(r.vertices,{x:-r.position.x,y:-r.position.y}),u.setInertia(r,c.inertia(r.vertices,r.mass)),c.translate(r.vertices,{x:r.position.x,y:r.position.y})),f.update(r.bounds,r.vertices,t.velocity)}if(t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null),!t.isStatic){var o=l(t);t.area=o.area,u.setMass(t,o.mass),u.setInertia(t,o.inertia)}},u.update=function(t,e,i,n){var s=Math.pow(e*i*t.timeScale,2),r=1-t.frictionAir*i*t.timeScale,o=t.position.x-t.positionPrev.x,a=t.position.y-t.positionPrev.y;t.velocity.x=o*r*n+t.force.x/t.mass*s,t.velocity.y=a*r*n+t.force.y/t.mass*s,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.angularVelocity=(t.angle-t.anglePrev)*r*n+t.torque/t.inertia*s,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=d.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var h=0;h<t.parts.length;h++){var l=t.parts[h];c.translate(l.vertices,t.velocity),0<h&&(l.position.x+=t.velocity.x,l.position.y+=t.velocity.y),0!==t.angularVelocity&&(c.rotate(l.vertices,t.angularVelocity,t.position),p.rotate(l.axes,t.angularVelocity),0<h&&d.rotateAbout(l.position,t.angularVelocity,t.position,l.position)),f.update(l.bounds,l.vertices,t.velocity)}},u.applyForce=function(t,e,i){t.force.x+=i.x,t.force.y+=i.y;var n=e.x-t.position.x,s=e.y-t.position.y;t.torque+=n*i.y-s*i.x};var l=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i<t.parts.length;i++){var n=t.parts[i],s=n.mass!==1/0?n.mass:1;e.mass+=n.mass,e.area+=n.area,e.inertia+=n.inertia,e.centre=d.add(e.centre,d.mult(n.position,s))}return e.centre=d.div(e.centre,e.mass),e}}()},function(t,e){t.exports=function(t,e,i,n,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===s&&(s=0),{responseType:t,async:e,user:i,password:n,timeout:s,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0}}},function(t,e,i){var l=i(4),u={},n={register:function(t,e,i,n,s){u[t]={plugin:e,mapping:i,settingsKey:n,configKey:s}},getPlugin:function(t){return u[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,n=e.game.config;for(var s in u){var r=u[s].plugin,o=u[s].mapping,a=u[s].settingsKey,h=u[s].configKey;l(i,a,n[h])&&(t[o]=new r(t))}},remove:function(t){u.hasOwnProperty(t)&&delete u[t]}};t.exports=n},function(t,e,i){var n=i(116),s=i(181);t.exports=function(t,e){if(void 0===e&&(e=90),!n(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=s(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=s(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i<t.length;i++)t[i].reverse();t.reverse()}return t}},function(t,e,i){var n=i(0),s=i(9),r=i(17),o=i(3),a=new n({Extends:s,initialize:function(t,e,i){s.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},this.currentConfig=this.config,this.config=r(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=r(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=r(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=r(this.currentConfig,e),this.isPlaying=!0,!(this.isPaused=!1)},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,!(this.isPaused=!1))},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:o,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit("destroy",this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=a},function(t,e,i){var n=i(0),o=i(33),s=i(9),r=i(3),a=new n({Extends:s,initialize:function(t){s.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on("blur",function(){this.pauseOnBlur&&this.onBlur()},this),t.events.on("focus",function(){this.pauseOnBlur&&this.onFocus()},this),t.events.on("prestep",this.update,this),t.events.once("destroy",this.destroy,this)},add:r,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var n in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(n)){var s=o(e),r=i.spritemap[n];s.loop=!!r.hasOwnProperty("loop")&&r.loop,i.addMarker({name:n,start:r.start,duration:r.end-r.start,config:s})}return i},play:function(t,e){var i=this.add(t);return i.once("ended",i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var n=this.addAudioSprite(t);return n.once("ended",n.destroy,n),n.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;0<=i;i--){var n=this.sounds[i];n.key===t&&(n.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit("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:r,onBlur:r,onFocus:r,update:function(e,i){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit("unlocked",this));for(var t=this.sounds.length-1;0<=t;t--)this.sounds[t].pendingRemove&&this.sounds.splice(t,1);this.sounds.forEach(function(t){t.update(e,i)})},destroy:function(){this.removeAllListeners(),this.forEachActiveSound(function(t){t.destroy()}),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(i,n){var s=this;this.sounds.forEach(function(t,e){t.pendingRemove||i.call(n||s,t,e,s.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=a},function(t,e,i){var n,s=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=(n=navigator.userAgent,/Edge\/\d+/.test(n)?r.edge=!0:/Chrome\/(\d+)/.test(n)&&!s.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10)):/Firefox\D+(\d+)/.test(n)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(n)&&s.iOS?r.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(n)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Opera/.test(n)?r.opera=!0:/Safari/.test(n)&&!s.windowsPhone?r.safari=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(n)&&(r.silk=!0),r)},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.parent=t,(this.events=e)||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once("destroy",this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;n<t.length;n++)i.push(e[t[n]]);return i}return e[t]},getAll:function(){var t={};for(var e in this.list)this.list.hasOwnProperty(e)&&(t[e]=this.list[e]);return t},query:function(t){var e={};for(var i in this.list)this.list.hasOwnProperty(i)&&i.match(t)&&(e[i]=this.list[i]);return e},set:function(t,e){if(this._frozen)return this;if("string"==typeof t)return this.setValue(t,e);for(var i in t)this.setValue(i,t[i]);return this},setValue:function(e,i){if(this._frozen)return this;if(this.has(e))this.values[e]=i;else{var n=this,s=this.list,r=this.events,o=this.parent;Object.defineProperty(this.values,e,{enumerable:!0,get:function(){return s[e]},set:function(t){n._frozen||(s[e]=t,r.emit("changedata",o,e,i),r.emit("changedata_"+e,o,i))}}),s[e]=i,r.emit("setdata",o,e,i)}return this},each:function(t,e){for(var i=[this.parent,null,void 0],n=1;n<arguments.length;n++)i.push(arguments[n]);for(var s in this.list)i[1]=s,i[2]=this.list[s],t.apply(e,i);return this},merge:function(t,e){for(var i in void 0===e&&(e=!0),t)t.hasOwnProperty(i)&&(e||!e&&!this.has(i))&&this.setValue(i,t[i]);return this},remove:function(t){if(this._frozen)return this;if(!Array.isArray(t))return this.removeValue(t);for(var e=0;e<t.length;e++)this.removeValue(t[e]);return this},removeValue:function(t){if(this.has(t)){var e=this.list[t];delete this.list[t],delete this.values[t],this.events.emit("removedata",this,t,e)}return this},pop:function(t){var e=void 0;return!this._frozen&&this.has(t)&&(e=this.list[t],delete this.list[t],delete this.values[t],this.events.emit("removedata",this,t,e)),e},has:function(t){return this.list.hasOwnProperty(t)},setFreeze:function(t){return this._frozen=t,this},reset:function(){for(var t in this.list)delete this.list[t],delete this.values[t];return this._frozen=!1,this},destroy:function(){this.reset(),this.events.off("changedata"),this.events.off("setdata"),this.events.off("removedata"),this.parent=null},freeze:{get:function(){return this._frozen},set:function(t){this._frozen=!!t}},count:{get:function(){var t=0;for(var e in this.list)void 0!==this.list[e]&&t++;return t}}});t.exports=n},function(t,e){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},function(e,t,i){!function(){var t=function(t,e){return n(t.slice(),e)};function n(t,e){"function"!=typeof e&&(e=function(t,e){return String(t).localeCompare(e)});var i=t.length;if(i<=1)return t;for(var n=new Array(i),s=1;s<i;s*=2){o(t,e,s,n);var r=t;t=n,n=r}return t}t.inplace=function(t,e){var i=n(t,e);return i!==t&&o(i,null,t.length,t),t};var o=function(t,e,i,n){var s,r,o,a,h,l=t.length,u=0,c=2*i;for(s=0;s<l;s+=c)for(o=(r=s+i)+i,l<r&&(r=l),l<o&&(o=l),a=s,h=r;;)if(a<r&&h<o)e(t[a],t[h])<=0?n[u++]=t[a++]:n[u++]=t[h++];else if(a<r)n[u++]=t[a++];else{if(!(h<o))break;n[u++]=t[h++]}};e.exports=t}()},function(t,e,i){var n=i(0),s=i(27),r=new n({initialize:function(t){this.name="WebGLPipeline",this.game=t.game,this.view=t.game.canvas,this.resolution=t.game.config.resolution,this.width=t.game.config.width*this.resolution,this.height=t.game.config.height*this.resolution,this.gl=t.gl,this.vertexCount=0,this.vertexCapacity=t.vertexCapacity,this.renderer=t.renderer,this.vertexData=t.vertices?t.vertices:new ArrayBuffer(t.vertexCapacity*t.vertexSize),this.vertexBuffer=this.renderer.createVertexBuffer(t.vertices?t.vertices:this.vertexData.byteLength,this.gl.STREAM_DRAW),this.program=this.renderer.createProgram(t.vertShader,t.fragShader),this.attributes=t.attributes,this.vertexSize=t.vertexSize,this.topology=t.topology,this.bytes=new Uint8Array(this.vertexData),this.vertexComponentCount=s.getComponentCount(t.attributes,this.gl),this.flushLocked=!1,this.active=!1},addAttribute:function(t,e,i,n,s){return this.attributes.push({name:t,size:e,type:this.renderer.glFormats[i],normalized:n,offset:s}),this},shouldFlush:function(){return this.vertexCount>=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,n=this.program,s=this.renderer,r=this.vertexSize;s.setProgram(n),s.setVertexBuffer(e);for(var o=0;o<i.length;++o){var a=i[o],h=t.getAttribLocation(n,a.name);0<=h?(t.enableVertexAttribArray(h),t.vertexAttribPointer(h,a.size,a.type,a.normalized,r,a.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,n=this.vertexSize;if(0!==e)return t.bufferSubData(t.ARRAY_BUFFER,0,this.bytes.subarray(0,e*n)),t.drawArrays(i,0,e),this.vertexCount=0,this.flushLocked=!1,this;this.flushLocked=!1},destroy:function(){var t=this.gl;return t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),delete this.program,delete this.vertexBuffer,delete this.gl,this},setFloat1:function(t,e){return this.renderer.setFloat1(this.program,t,e),this},setFloat2:function(t,e,i){return this.renderer.setFloat2(this.program,t,e,i),this},setFloat3:function(t,e,i,n){return this.renderer.setFloat3(this.program,t,e,i,n),this},setFloat4:function(t,e,i,n,s){return this.renderer.setFloat4(this.program,t,e,i,n,s),this},setInt1:function(t,e){return this.renderer.setInt1(this.program,t,e),this},setInt2:function(t,e,i){return this.renderer.setInt2(this.program,t,e,i),this},setInt3:function(t,e,i,n){return this.renderer.setInt3(this.program,t,e,i,n),this},setInt4:function(t,e,i,n,s){return this.renderer.setInt4(this.program,t,e,i,n,s),this},setMatrix2:function(t,e,i){return this.renderer.setMatrix2(this.program,t,e,i),this},setMatrix3:function(t,e,i){return this.renderer.setMatrix3(this.program,t,e,i),this},setMatrix4:function(t,e,i){return this.renderer.setMatrix4(this.program,t,e,i),this}});t.exports=r},function(t,e){t.exports=function(t,e){return 0<t&&0==(t&t-1)&&0<e&&0==(e&e-1)}},function(t,e,i){var n=i(0),s=i(274),r=i(14),o=i(6),a=new n({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new o,this._tmpVec2B=new o},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t||(t=new r),void 0===e&&(e=16);var i=this.getLength();i<e&&(e=i/2);var n=Math.max(1,Math.round(i/e));return s(this.getSpacedPoints(n),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0,this._tmpVec2A),s=0;i.push(0);for(var r=1;r<=t;r++)s+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(n),i.push(s),n.copy(e);return this.cacheArcLengths=i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++){var n=this.getUtoTmapping(i/t,null,t);e.push(this.getPoint(n))}return e},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=t-1e-4,n=t+1e-4;return i<0&&(i=0),1<n&&(n=1),this.getPoint(i,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var n,s=this.getLengths(i),r=0,o=s.length;n=e?Math.min(e,s[o-1]):t*s[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=s[r=Math.floor(h+(l-h)/2)]-n)<0)h=r+1;else{if(!(0<a)){l=r;break}l=r-1}if(s[r=l]===n)return r/(o-1);var u=s[r];return(r+(n-u)/(s[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},clone:function(){return new n(this.x,this.y,this.z)},crossVectors:function(t,e){var i=t.x,n=t.y,s=t.z,r=e.x,o=e.y,a=e.z;return this.x=n*a-s*o,this.y=s*r-i*a,this.z=i*o-n*r,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return Math.sqrt(e*e+i*i+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return e*e+i*i+n*n},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,n=t*t+e*e+i*i;return 0<n&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z;return this.x=i*o-n*r,this.y=n*s-e*o,this.z=e*r-i*s,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this},transformMat3:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=e*s[0]+i*s[3]+n*s[6],this.y=e*s[1]+i*s[4]+n*s[7],this.z=e*s[2]+i*s[5]+n*s[8],this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12],this.y=s[1]*e+s[5]*i+s[9]*n+s[13],this.z=s[2]*e+s[6]*i+s[10]*n+s[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=e*s[0]+i*s[4]+n*s[8]+s[12],o=e*s[1]+i*s[5]+n*s[9]+s[13],a=e*s[2]+i*s[6]+n*s[10]+s[14],h=e*s[3]+i*s[7]+n*s[11]+s[15];return this.x=r/h,this.y=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},project:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=s[6],d=s[7],f=s[8],p=s[9],g=s[10],v=s[11],y=s[12],m=s[13],x=s[14],w=1/(e*h+i*d+n*v+s[15]);return this.x=(e*r+i*l+n*f+y)*w,this.y=(e*o+i*u+n*p+m)*w,this.z=(e*a+i*c+n*g+x)*w,this},unproject:function(t,e){var i=t.x,n=t.y,s=t.z,r=t.w,o=this.x-i,a=r-this.y-1-n,h=this.z;return this.x=2*o/s-1,this.y=2*a/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});t.exports=n},function(t,e,i){var n=i(0),s=i(32),r=i(298),o=i(296),a=i(157),h=new n({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 s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return a(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){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},function(t,e,i){var s=i(147),n=i(0),r=i(3),o=i(83),a=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,o.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-1<this.list.indexOf(t)},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){for(var i=[null],n=2;n<arguments.length;n++)i.push(arguments[n]);for(n=0;n<this.list.length;n++)i[0]=this.list[n],t.apply(e,i)},shutdown:function(){this.removeAll(),this.list=[]},destroy:function(){this.removeAll(),this.parent=null,this.addCallback=null,this.removeCallback=null},length:{get:function(){return this.list.length}},first:{get:function(){return(this.position=0)<this.list.length?this.list[0]:null}},last:{get:function(){return 0<this.list.length?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position<this.list.length?(this.position++,this.list[this.position]):null}},previous:{get:function(){return 0<this.position?(this.position--,this.list[this.position]):null}}});t.exports=a},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;0<e;e--){var i=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t}},function(t,e,i){var n=i(0),s=i(293),r=i(156),o=i(155),a=i(6),h=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return r(this,t,e,i)},getRandomPoint:function(t){return o(this,t)},setTo:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this},getPointA:function(t){return void 0===t&&(t=new a),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new a),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,n,s,r,o,a,h,l,u,c,d){return{target:t,key:e,getEndValue:i,getStartValue:n,ease:s,duration:0,totalDuration:0,delay:0,yoyo:a,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:o,hold:h,repeat:l,repeatDelay:u},state:0}}},function(t,e,i){var n=i(0),s=i(13),r=i(11),u=i(61),o=new n({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=u.PENDING_ADD,this._pausedState=u.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===u.ACTIVE},isPaused:function(){return this.state===u.PAUSED},hasTarget:function(t){return-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){for(var n=0;n<this.totalData;n++){var s=this.data[n];if(s.key===t){s.end=e,i&&(s.start=s.current);break}}return this},restart:function(){this.state===u.REMOVED?(this.seek(0),this.parent.makeActive(this)):(this.stop(),this.play())},calcDuration:function(){for(var t=0,e=this.data,i=0;i<this.totalData;i++){var n=e[i];n.t1=n.duration+n.hold,n.yoyo&&(n.t1+=n.duration),n.t2=n.t1+n.repeatDelay,n.totalDuration=n.delay+n.t1,-1===n.repeat?n.totalDuration+=999999999999*n.t2:0<n.repeat&&(n.totalDuration+=n.t2*n.repeat),n.totalDuration>t&&(t=n.totalDuration)}this.duration=t,this.loopCounter=-1===this.loop?999999999999:this.loop,0<this.loopCounter?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){for(var t=this.data,e=this.totalTargets,i=0;i<this.totalData;i++){var n=t[i],s=n.target,r=n.gen;n.delay=r.delay(i,e,s),n.duration=r.duration(i,e,s),n.hold=r.hold(i,e,s),n.repeat=r.repeat(i,e,s),n.repeatDelay=r.repeatDelay(i,e,s)}return this.calcDuration(),this.progress=0,this.totalProgress=0,this.elapsed=0,this.totalElapsed=0,this.paused&&!this.parentIsTimeline?(this.state=u.PENDING_ADD,this._pausedState=u.INIT,!1):(this.state=u.INIT,!0)},nextState:function(){if(0<this.loopCounter){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),0<this.loopDelay?(this.countdown=this.loopDelay,this.state=u.LOOP_DELAY):this.state=u.ACTIVE}else if(0<this.completeDelay)this.countdown=this.completeDelay,this.state=u.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=u.PENDING_REMOVE}},pause:function(){if(this.state!==u.PAUSED)return this.paused=!0,this._pausedState=this.state,this.state=u.PAUSED,this},play:function(t){if(this.state!==u.ACTIVE){this.state!==u.PENDING_REMOVE&&this.state!==u.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=u.ACTIVE):(this.countdown=this.calculatedOffset,this.state=u.OFFSET_DELAY)):this.paused?(this.paused=!1,this.parent.makeActive(this)):(this.resetTweenData(t),this.state=u.ACTIVE,e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)))}},resetTweenData:function(t){for(var e=this.data,i=0;i<this.totalData;i++){var n=e[i];n.progress=0,n.elapsed=0,n.repeatCounter=-1===n.repeat?999999999999:n.repeat,t?(n.start=n.getStartValue(n.target,n.key,n.start),n.end=n.getEndValue(n.target,n.key,n.end),n.current=n.start,n.state=u.PLAYING_FORWARD):0<n.delay?(n.elapsed=n.delay,n.state=u.DELAY):n.state=u.PENDING_RENDER}},resume:function(){return this.state===u.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t){for(var e=this.data,i=0;i<this.totalData;i++){var n=this.totalDuration*t,s=e[i],r=0,o=0;n<=s.delay?o=r=0:n>=s.totalDuration?(r=1,o=s.duration):n>s.delay&&n<=s.t1?(r=(n=Math.max(0,n-s.delay))/s.t1,o=s.duration*r):n>s.t1&&n<s.totalDuration&&(n-=s.delay,(n=(n-=s.t1)/s.t2%1*s.t2)>s.repeatDelay&&(r=n/s.t1,o=s.duration*r)),s.progress=r,s.elapsed=o;var a=s.ease(s.progress);s.current=s.start+(s.end-s.start)*a,s.target[s.key]=s.current}},setCallback:function(t,e,i,n){return this.callbacks[t]={func:e,scope:n,params:i},this},complete:function(t){if(void 0===t&&(t=0),t)this.countdown=t,this.state=u.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=u.PENDING_REMOVE}},stop:function(t){this.state===u.ACTIVE&&void 0!==t&&this.seek(t),this.state!==u.REMOVED&&(this.state=u.PENDING_REMOVE)},update:function(t,e){if(this.state===u.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 u.ACTIVE:for(var i=!1,n=0;n<this.totalData;n++)this.updateTweenData(this,this.data[n],e)&&(i=!0);i||this.nextState();break;case u.LOOP_DELAY:this.countdown-=e,this.countdown<=0&&(this.state=u.ACTIVE);break;case u.OFFSET_DELAY:if(this.countdown-=e,this.countdown<=0){var s=this.callbacks.onStart;s&&(s.params[1]=this.targets,s.func.apply(s.scope,s.params)),this.state=u.ACTIVE}break;case u.COMPLETE_DELAY:if(this.countdown-=e,this.countdown<=0){var r=this.callbacks.onComplete;r&&r.func.apply(r.scope,r.params),this.state=u.PENDING_REMOVE}}return this.state===u.PENDING_REMOVE},setStateFromEnd:function(t,e,i){if(e.yoyo){e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var n=t.callbacks.onYoyo;return n&&(n.params[1]=e.target,n.func.apply(n.scope,n.params)),e.start=e.getStartValue(e.target,e.key,e.start),u.PLAYING_BACKWARD}if(0<e.repeatCounter){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.start=e.getStartValue(e.target,e.key,e.start),e.end=e.getEndValue(e.target,e.key,e.start),0<e.repeatDelay?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,u.REPEAT_DELAY):u.PLAYING_FORWARD}return u.COMPLETE},setStateFromStart:function(t,e,i){if(0<e.repeatCounter){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.end=e.getEndValue(e.target,e.key,e.start),0<e.repeatDelay?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,u.REPEAT_DELAY):u.PLAYING_FORWARD}return u.COMPLETE},updateTweenData:function(t,e,i){switch(e.state){case u.PLAYING_FORWARD:case u.PLAYING_BACKWARD:if(!e.target){e.state=u.COMPLETE;break}var n=e.elapsed,s=e.duration,r=0;s<(n+=i)&&(r=n-s,n=s);var o,a=e.state===u.PLAYING_FORWARD,h=n/s;o=a?e.ease(h):e.ease(1-h),e.current=e.start+(e.end-e.start)*o,e.target[e.key]=e.current,e.elapsed=n,e.progress=h;var l=t.callbacks.onUpdate;l&&(l.params[1]=e.target,l.func.apply(l.scope,l.params)),1===h&&(a?0<e.hold?(e.elapsed=e.hold-r,e.state=u.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,r):e.state=this.setStateFromStart(t,e,r));break;case u.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=u.PENDING_RENDER);break;case u.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=u.PLAYING_FORWARD);break;case u.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case u.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=u.PLAYING_FORWARD):e.state=u.COMPLETE}return e.state!==u.COMPLETE}});o.TYPES=["onComplete","onLoop","onRepeat","onStart","onUpdate","onYoyo"],r.register("tween",function(t){return this.scene.sys.tweens.add(t)}),s.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 l(t){return!!t.getStart&&"function"==typeof t.getStart}function u(t){return!!t.getEnd&&"function"==typeof t.getEnd}var c=function(t,e){var i,n,s=function(t,e,i){return i},r=function(t,e,i){return i},o=typeof e;if("number"===o)s=function(){return e};else if("string"===o){var a=e[0],h=parseFloat(e.substr(2));switch(a){case"+":s=function(t,e,i){return i+h};break;case"-":s=function(t,e,i){return i-h};break;case"*":s=function(t,e,i){return i*h};break;case"/":s=function(t,e,i){return i/h};break;default:s=function(){return parseFloat(e)}}}else"function"===o?s=e:"object"===o&&(l(n=e)||u(n))?(u(e)&&(s=e.getEnd),l(e)&&(r=e.getStart)):e.hasOwnProperty("value")&&(i=c(t,e.value));return i||(i={getEnd:s,getStart:r}),i};t.exports=c},function(t,e,i){var n=i(4);t.exports=function(t){var e=n(t,"targets",null);return null===e||("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e])),e}},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","map"),this.width=s(t,"width",0),this.height=s(t,"height",0),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.widthInPixels=s(t,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.tileHeight),this.format=s(t,"format",null),this.orientation=s(t,"orientation","orthogonal"),this.version=s(t,"version","1"),this.properties=s(t,"properties",{}),this.layers=s(t,"layers",[]),this.images=s(t,"images",[]),this.objects=s(t,"objects",{}),this.collision=s(t,"collision",{}),this.tilesets=s(t,"tilesets",[]),this.imageCollections=s(t,"imageCollections",[]),this.tiles=s(t,"tiles",[])}});t.exports=r},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","layer"),this.x=s(t,"x",0),this.y=s(t,"y",0),this.width=s(t,"width",0),this.height=s(t,"height",0),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.baseTileWidth=s(t,"baseTileWidth",this.tileWidth),this.baseTileHeight=s(t,"baseTileHeight",this.tileHeight),this.widthInPixels=s(t,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.baseTileHeight),this.alpha=s(t,"alpha",1),this.visible=s(t,"visible",!0),this.properties=s(t,"properties",{}),this.indexes=s(t,"indexes",[]),this.collideIndexes=s(t,"collideIndexes",[]),this.callbacks=s(t,"callbacks",[]),this.bodies=s(t,"bodies",[]),this.data=s(t,"data",[]),this.tilemapLayer=s(t,"tilemapLayer",null)}});t.exports=r},function(t,e){t.exports=function(t,e,i){return 0<=t&&t<i.width&&0<=e&&e<i.height}},function(t,e){var i={};(t.exports=i).create=function(t,e){return{x:t||0,y:e||0}},i.clone=function(t){return{x:t.x,y:t.y}},i.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},i.rotate=function(t,e,i){var n=Math.cos(e),s=Math.sin(e);i||(i={});var r=t.x*n-t.y*s;return i.y=t.x*s+t.y*n,i.x=r,i},i.rotateAbout=function(t,e,i,n){var s=Math.cos(e),r=Math.sin(e);n||(n={});var o=i.x+((t.x-i.x)*s-(t.y-i.y)*r);return n.y=i.y+((t.x-i.x)*r+(t.y-i.y)*s),n.x=o,n},i.normalise=function(t){var e=i.magnitude(t);return 0===e?{x:0,y:0}:{x:t.x/e,y:t.y/e}},i.dot=function(t,e){return t.x*e.x+t.y*e.y},i.cross=function(t,e){return t.x*e.y-t.y*e.x},i.cross3=function(t,e,i){return(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x)},i.add=function(t,e,i){return i||(i={}),i.x=t.x+e.x,i.y=t.y+e.y,i},i.sub=function(t,e,i){return i||(i={}),i.x=t.x-e.x,i.y=t.y-e.y,i},i.mult=function(t,e){return{x:t.x*e,y:t.y*e}},i.div=function(t,e){return{x:t.x/e,y:t.y/e}},i.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},i.neg=function(t){return{x:-t.x,y:-t.y}},i.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},i._temp=[i.create(),i.create(),i.create(),i.create(),i.create(),i.create()]},function(t,e,i){var s=i(17),r=i(75);t.exports=function(t,e){var i=void 0===t?r():s({},t);if(e)for(var n in e)void 0!==e[n]&&(i[n]=e[n]);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 n=i(130),r=i(22),s=i(0),o=i(15),a=i(20),h=i(2),p=i(417),l=i(4),u=i(269),c=i(416),d=i(413),f=new s({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Flip,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.ScaleMode,o.ScrollFactor,o.Tint,o.Transform,o.Visible,c],initialize:function(t,e,i,n,s){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=r.create(this),this.context=this.canvas.getContext("2d"),this.style=new d(this,s),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(),s&&s.padding&&this.setPadding(s.padding),s&&s.lineSpacing&&(this._lineSpacing=s.lineSpacing),this.setText(n),t.sys.game.config.renderType===a.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",n(this.canvas,this.scene.sys.canvas),this.originX=1)},runWordWrap:function(t){var e=this.style;if(e.wordWrapCallback){var i=e.wordWrapCallback.call(e.wordWrapCallbackScope,t,this);return Array.isArray(i)&&(i=i.join("\n")),i}return e.wordWrapWidth?e.wordWrapUseAdvanced?this.advancedWordWrap(t,this.context,this.style.wordWrapWidth):this.basicWordWrap(t,this.context,this.style.wordWrapWidth):t},advancedWordWrap:function(t,e,i){for(var n="",s=t.replace(/ +/gi," ").split(this.splitRegExp),r=s.length,o=0;o<r;o++){var a=s[o],h="";if(a=a.replace(/^ *|\s*$/gi,""),e.measureText(a).width<i)n+=a+"\n";else{for(var l=i,u=a.split(" "),c=0;c<u.length;c++){var d=u[c],f=d+" ",p=e.measureText(f).width;if(l<p){if(0===c){for(var g=f;g.length&&(g=g.slice(0,-1),!((p=e.measureText(g).width)<=l)););if(!g.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var v=d.substr(g.length);u[c]=v,h+=g}var y=u[c].length?c:c+1,m=u.slice(y).join(" ").replace(/[ \n]*$/gi,"");s[o+1]=m+" "+(s[o+1]||""),r=s.length;break}h+=f,l-=p}n+=h.replace(/[ \n]*$/gi,"")+"\n"}}return n=n.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var n="",s=t.split(this.splitRegExp),r=0;r<s.length;r++){for(var o=i,a=s[r].split(" "),h=0;h<a.length;h++){var l=e.measureText(a[h]).width,u=l+e.measureText(" ").width;o<u?(0<h&&(n+="\n"),n+=a[h]+" ",o=i-l):(o-=u,n+=a[h],h<a.length-1&&(n+=" "))}r<s.length-1&&(n+="\n")}return n},getWrappedText:function(t){return void 0===t&&(t=this.text),this.style.syncFont(this.canvas,this.context),this.runWordWrap(t).split(this.splitRegExp)},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this.text&&(this.text=t.toString(),this.updateText()),this},setStyle:function(t){return this.style.setStyle(t)},setFont:function(t){return this.style.setFont(t)},setFontFamily:function(t){return this.style.setFontFamily(t)},setFontSize:function(t){return this.style.setFontSize(t)},setFontStyle:function(t){return this.style.setFontStyle(t)},setFixedSize:function(t,e){return this.style.setFixedSize(t,e)},setBackgroundColor:function(t){return this.style.setBackgroundColor(t)},setFill:function(t){return this.style.setFill(t)},setColor:function(t){return this.style.setColor(t)},setStroke:function(t,e){return this.style.setStroke(t,e)},setShadow:function(t,e,i,n,s,r){return this.style.setShadow(t,e,i,n,s,r)},setShadowOffset:function(t,e){return this.style.setShadowOffset(t,e)},setShadowColor:function(t){return this.style.setShadowColor(t)},setShadowBlur:function(t){return this.style.setShadowBlur(t)},setShadowStroke:function(t){return this.style.setShadowStroke(t)},setShadowFill:function(t){return this.style.setShadowFill(t)},setWordWrapWidth:function(t,e){return this.style.setWordWrapWidth(t,e)},setWordWrapCallback:function(t,e){return this.style.setWordWrapCallback(t,e)},setAlign:function(t){return this.style.setAlign(t)},setPadding:function(t,e,i,n){if("object"==typeof t){var s=t,r=l(s,"x",null);null!==r?i=t=r:(t=l(s,"left",0),i=l(s,"right",t));var o=l(s,"y",null);null!==o?n=e=o:(e=l(s,"top",0),n=l(s,"bottom",e))}else void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=e);return this.padding.left=t,this.padding.top=e,this.padding.right=i,this.padding.bottom=n,this.updateText()},setMaxLines:function(t){return this.style.setMaxLines(t)},updateText:function(){var t=this.canvas,e=this.context,i=this.style,n=this.resolution,s=i.metrics;i.syncFont(t,e);var r=this.text;(i.wordWrapWidth||i.wordWrapCallback)&&(r=this.runWordWrap(this.text));var o,a,h=r.split(this.splitRegExp),l=p(this,s,h),u=this.padding,c=l.width+u.left+u.right,d=l.height+u.top+u.bottom;0===i.fixedWidth&&(this.width=c),0===i.fixedHeight&&(this.height=d),this.updateDisplayOrigin(),c*=n,d*=n,c=Math.max(c,1),d=Math.max(d,1),t.width!==c||t.height!==d?(t.width=c,t.height=d,i.syncFont(t,e)):e.clearRect(0,0,c,d),e.save(),i.backgroundColor&&(e.fillStyle=i.backgroundColor,e.fillRect(0,0,c,d)),i.syncStyle(t,e),e.textBaseline="alphabetic",e.translate(u.left,u.top);for(var f=0;f<l.lines;f++)o=i.strokeThickness/2,a=i.strokeThickness/2+f*l.lineHeight+s.ascent,0<f&&(a+=l.lineSpacing*f),i.rtl?o=c-o:"right"===i.align?o+=l.width-l.lineWidths[f]:"center"===i.align&&(o+=(l.width-l.lineWidths[f])/2),this.autoRound&&(o=Math.round(o),a=Math.round(a)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(h[f],o,a)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(h[f],o,a));return e.restore(),this.dirty=!0,this},getTextMetrics:function(){return this.style.getTextMetrics()},toJSON:function(){var t=o.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&&u(this.canvas),r.remove(this.canvas)}});t.exports=f},function(t,e){t.exports=function(t,e){return t.hasOwnProperty(e)}},function(t,e,i){var k=i(599),n=i(0),L=i(1),F=i(4),R=i(254),s=i(70),r=i(34),o=new n({initialize:function(t,e,i){void 0!==i||Array.isArray(e)||"object"!=typeof e||(i=e,e=null),this.scene=t,this.children=new s(e),this.isParent=!0,this.classType=L(i,"classType",r),this.active=L(i,"active",!0),this.maxSize=L(i,"maxSize",-1),this.defaultKey=L(i,"defaultKey",null),this.defaultFrame=L(i,"defaultFrame",null),this.runChildUpdate=L(i,"runChildUpdate",!1),this.createCallback=L(i,"createCallback",null),this.removeCallback=L(i,"removeCallback",null),this.createMultipleCallback=L(i,"createMultipleCallback",null),i&&this.createMultiple(i)},create:function(t,e,i,n,s,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===n&&(n=this.defaultFrame),void 0===s&&(s=!0),void 0===r&&(r=!0),this.isFull())return null;var o=new this.classType(this.scene,t,e,i,n);return this.scene.sys.displayList.add(o),o.preUpdate&&this.scene.sys.updateList.add(o),o.visible=s,o.setActive(r),this.add(o),o},createMultiple:function(t){if(this.isFull())return[];if(Array.isArray(t)||(t=[t]),void 0===t[0].key)return[];for(var e=[],i=0;i<t.length;i++){var n=this.createFromConfig(t[i]);e=e.concat(n)}return e},createFromConfig:function(t){if(this.isFull())return[];this.classType=L(t,"classType",this.classType);var e=L(t,"key",void 0),i=L(t,"frame",null),n=L(t,"visible",!0),s=L(t,"active",!0),r=[];if(void 0===e)return r;Array.isArray(e)||(e=[e]),Array.isArray(i)||(i=[i]);for(var o=L(t,"repeat",0),a=L(t,"randomKey",!1),h=L(t,"randomFrame",!1),l=L(t,"yoyo",!1),u=L(t,"frameQuantity",1),c=L(t,"max",0),d=R(e,i,{max:c,qty:u,random:a,randomB:h,repeat:o,yoyo:l}),f=0;f<d.length;f++){var p=this.create(0,0,d[f].a,d[f].b,n,s);if(!p)break;r.push(p)}var g=F(t,"setXY.x",0),v=F(t,"setXY.y",0),y=F(t,"setXY.stepX",0),m=F(t,"setXY.stepY",0);k.SetXY(r,g,v,y,m);var x=F(t,"setRotation.value",0),w=F(t,"setRotation.step",0);k.SetRotation(r,x,w);var b=F(t,"setScale.x",1),T=F(t,"setScale.y",b),S=F(t,"setScale.stepX",0),A=F(t,"setScale.stepY",0);k.SetScale(r,b,T,S,A);var C=F(t,"setAlpha.value",1),M=F(t,"setAlpha.step",0);k.SetAlpha(r,C,M);var _=L(t,"hitArea",null),E=L(t,"hitAreaCallback",null);_&&k.SetHitArea(r,_,E);var P=L(t,"gridAlign",!1);return P&&k.GridAlign(r,P),this.createMultipleCallback&&this.createMultipleCallback.call(this,r),r},preUpdate:function(t,e){if(this.runChildUpdate&&0!==this.children.size)for(var i=this.children.entries.slice(),n=0;n<i.length;n++){var s=i[n];s.active&&s.update(t,e)}},add:function(t,e){return void 0===e&&(e=!1),this.isFull()||(this.children.set(t),this.createCallback&&this.createCallback.call(this,t),e&&(this.scene.sys.displayList.add(t),t.preUpdate&&this.scene.sys.updateList.add(t)),t.on("destroy",this.remove,this)),this},addMultiple:function(t,e){if(void 0===e&&(e=!1),Array.isArray(t))for(var i=0;i<t.length;i++)this.add(t[i],e);return this},remove:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!1),this.children.contains(t)&&(this.children.delete(t),this.removeCallback&&this.removeCallback.call(this,t),t.off("destroy",this.remove,this),i?t.destroy():e&&(t.scene.sys.displayList.remove(t),t.preUpdate&&t.scene.sys.updateList.remove(t))),this},clear:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);for(var i=this.children,n=0;n<i.size;n++){var s=i.entries[n];s.off("destroy",this.remove,this),e?s.destroy():t&&(s.scene.sys.displayList.remove(s),s.preUpdate&&s.scene.sys.updateList.remove(s))}return this.children.clear(),this},contains:function(t){return this.children.contains(t)},getChildren:function(){return this.children.entries},getLength:function(){return this.children.size},getFirst:function(t,e,i,n,s,r,o){return this.getHandler(!0,1,t,e,i,n,s,r,o)},getFirstNth:function(t,e,i,n,s,r,o,a){return this.getHandler(!0,t,e,i,n,s,r,o,a)},getLast:function(t,e,i,n,s,r,o){return this.getHandler(!1,1,t,e,i,n,s,r,o)},getLastNth:function(t,e,i,n,s,r,o,a){return this.getHandler(!1,t,e,i,n,s,r,o,a)},getHandler:function(t,e,i,n,s,r,o,a,h){var l,u;void 0===i&&(i=!1),void 0===n&&(n=!1);var c=0,d=this.children.entries;if(t)for(u=0;u<d.length;u++)if((l=d[u]).active===i){if(++c===e)break}else l=null;else for(u=d.length-1;0<=u;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof s&&(l.x=s),"number"==typeof r&&(l.y=r),l):n?this.create(s,r,o,a,h):null},get:function(t,e,i,n,s){return this.getFirst(!1,!0,t,e,i,n,s)},getFirstAlive:function(t,e,i,n,s,r){return this.getFirst(!0,t,e,i,n,s,r)},getFirstDead:function(t,e,i,n,s,r){return this.getFirst(!1,t,e,i,n,s,r)},playAnimation:function(t,e){return k.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i<this.children.size;i++)this.children.entries[i].active===t&&e++;return e},getTotalUsed:function(){return this.countActive()},getTotalFree:function(){var t=this.getTotalUsed();return(-1===this.maxSize?999999999999:this.maxSize)-t},setDepth:function(t,e){return k.SetDepth(this.children.entries,t,e),this},kill:function(t){this.children.contains(t)&&t.setActive(!1)},killAndHide:function(t){this.children.contains(t)&&(t.setActive(!1),t.setVisible(!1))},toggleVisible:function(){return k.ToggleVisible(this.children.entries),this},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){if(t)for(var e=this.children,i=0;i<e.size;i++){var n=e.entries[i];n.off("destroy",this.remove,this),n.destroy()}this.children.clear(),this.scene=void 0,this.children=void 0}}});t.exports=o},function(t,e,i){var r=i(5);t.exports=function(t,e,i){void 0===i&&(i=new r);var n=t.width/2,s=t.height/2;return i.x=t.x+n*Math.cos(e),i.y=t.y+s*Math.sin(e),i}},function(t,e,i){var n=i(0),s=i(54),r=i(179),o=i(178),a=i(134),h=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=h},function(t,e,i){var n=i(123),s=i(0),o=i(119),r=i(15),a=i(249),h=i(2),l=i(4),u=i(16),c=i(463),d=new s({Extends:h,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Mask,r.Pipeline,r.Transform,r.Visible,r.ScrollFactor,c],initialize:function(t,e){var i=l(e,"x",0),n=l(e,"y",0);h.call(this,t,"Graphics"),this.setPosition(i,n),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 l(t,"lineStyle",null)&&(this.defaultStrokeWidth=l(t,"lineStyle.width",1),this.defaultStrokeColor=l(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=l(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),l(t,"fillStyle",null)&&(this.defaultFillColor=l(t,"fillStyle.color",16777215),this.defaultFillAlpha=l(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(o.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(o.FILL_STYLE,t,e),this},beginPath:function(){return this.commandBuffer.push(o.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(o.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(o.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(o.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,u.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,u.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,n){return this.commandBuffer.push(o.FILL_RECT,t,e,i,n),this},strokeRect:function(t,e,i,n){var s=this._lineWidth/2,r=t-s,o=t+s;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+n),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+n),this.strokePath(),this.beginPath(),this.moveTo(r,e),this.lineTo(o+i,e),this.strokePath(),this.beginPath(),this.moveTo(r,e+n),this.lineTo(o+i,e+n),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(o.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,n,s,r){return this.commandBuffer.push(o.FILL_TRIANGLE,t,e,i,n,s,r),this},strokeTriangle:function(t,e,i,n,s,r){return this.commandBuffer.push(o.STROKE_TRIANGLE,t,e,i,n,s,r),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,n){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,n),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(o.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(o.MOVE_TO,t,e),this},lineFxTo:function(t,e,i,n){return this.commandBuffer.push(o.LINE_FX_TO,t,e,i,n,1),this},moveFxTo:function(t,e,i,n){return this.commandBuffer.push(o.MOVE_FX_TO,t,e,i,n,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 n=1;n<i;n++)this.lineTo(t[n].x,t[n].y);return e&&this.lineTo(t[0].x,t[0].y),this.strokePath(),this},fillPoints: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 n=1;n<i;n++)this.lineTo(t[n].x,t[n].y);return e&&this.lineTo(t[0].x,t[0].y),this.fillPath(),this},strokeEllipseShape:function(t,e){void 0===e&&(e=32);var i=t.getPoints(e);return this.strokePoints(i,!0)},strokeEllipse:function(t,e,i,n,s){void 0===s&&(s=32);var r=new a(t,e,i,n).getPoints(s);return this.strokePoints(r,!0)},fillEllipseShape:function(t,e){void 0===e&&(e=32);var i=t.getPoints(e);return this.fillPoints(i,!0)},fillEllipse:function(t,e,i,n,s){void 0===s&&(s=32);var r=new a(t,e,i,n).getPoints(s);return this.fillPoints(r,!0)},arc:function(t,e,i,n,s,r){return this.commandBuffer.push(o.ARC,t,e,i,n,s,r),this},slice:function(t,e,i,n,s,r){return void 0===r&&(r=!1),this.commandBuffer.push(o.BEGIN_PATH),this.commandBuffer.push(o.MOVE_TO,t,e),this.commandBuffer.push(o.ARC,t,e,i,n,s,r),this.commandBuffer.push(o.CLOSE_PATH),this},save:function(){return this.commandBuffer.push(o.SAVE),this},restore:function(){return this.commandBuffer.push(o.RESTORE),this},translate:function(t,e){return this.commandBuffer.push(o.TRANSLATE,t,e),this},scale:function(t,e){return this.commandBuffer.push(o.SCALE,t,e),this},rotate:function(t){return this.commandBuffer.push(o.ROTATE,t),this},clear:function(){return this.commandBuffer.length=0,-1<this.defaultFillColor&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),-1<this.defaultStrokeColor&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var n,s,r=this.scene.sys;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 o=(n=r.textures.get(t)).getSourceImage();o instanceof HTMLCanvasElement&&(s=o.getContext("2d"))}else s=(n=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(s=t.getContext("2d"));return s&&(this.renderCanvas(r.game.renderer,this,0,d.TargetCamera,null,s),r.game.renderer.gl&&n&&(n.source[0].glTexture=r.game.renderer.canvasToTexture(s.canvas,n.source[0].glTexture))),this},preDestroy:function(){this.commandBuffer=[]}});d.TargetCamera=new n(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;i<t.length;i++)if(t[i].length!==e)return!1;return!0}},function(t,e,i){var n=i(0),a=i(128),o=i(183),s=new n({initialize:function(t,e,i,n,s){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE";for(var r=this.frameTotal=0;r<i.length;r++)this.source.push(new o(this,i[r],n,s))},add:function(t,e,i,n,s,r){var o=new a(this,t,e,i,n,s,r);return this.frames[t]=o,1===this.frameTotal&&(this.firstFrame=t),this.frameTotal++,o},has:function(t){return this.frames[t]},get:function(t){t||(t=this.firstFrame);var e=this.frames[t];return e||(console.warn("No Texture.frame found with name "+t),e=this.frames[this.firstFrame]),e},getTextureSourceIndex:function(t){for(var e=0;e<this.source.length;e++)if(this.source[e]===t)return e;return-1},getFramesFromTextureSource:function(t){var e=[];for(var i in this.frames)if("__BASE"!==i){var n=this.frames[i];n.sourceIndex===t&&e.push(n.name)}return e},getFrameNames:function(t){void 0===t&&(t=!1);var e=Object.keys(this.frames);if(!t){var i=e.indexOf("__BASE");-1!==i&&e.splice(i,1)}return e},getSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e=this.frames[t];return e?e.source.image:(console.warn("No Texture.frame found with name "+t),this.frames.__BASE.source.image)},getDataSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e,i=this.frames[t];return i?e=i.sourceIndex:(console.warn("No Texture.frame found with name "+t),e=this.frames.__BASE.sourceIndex),this.dataSource[e].image},setDataSource:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=this.source[e];this.dataSource.push(new o(this,t[e],i.width,i.height))}},setFilter:function(t){var e;for(e=0;e<this.source.length;e++)this.source[e].setFilter(t);for(e=0;e<this.dataSource.length;e++)this.dataSource[e].setFilter(t)},destroy:function(){var t;for(t=0;t<this.source.length;t++)this.source[t].destroy();for(t=0;t<this.dataSource.length;t++)this.dataSource[t].destroy();for(var e in this.frames){this.frames[e].destroy()}this.source=[],this.dataSource=[],this.frames={},this.manager=null}});t.exports=s},function(t,e,i){var n=i(0),s=i(55),r=i(121),o=i(518),a=i(517),h=i(3),l=i(192),u=new n({initialize:function(t,e){this.scene=t,this.game,this.config=e,this.settings=l.create(e),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=h},init:function(t){this.settings.status=s.INIT,this.sceneUpdate=h,this.game=t,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;(this.plugins=e).addToScene(this,r.Global,[r.CoreScene,a(this),o(this)]),this.events.emit("boot",this),this.settings.isBooted=!0},install:function(t){Array.isArray(t)||(t=[t]),this.plugins.installLocal(this,t)},step:function(t,e){this.events.emit("preupdate",t,e),this.events.emit("update",t,e),this.sceneUpdate.call(this.scene,t,e),this.events.emit("postupdate",t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.cameras.render(t,e),this.events.emit("render",t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(){return this.settings.active&&(this.settings.status=s.PAUSED,this.settings.active=!1,this.events.emit("pause",this)),this},resume:function(){return this.settings.active||(this.settings.status=s.RUNNING,this.settings.active=!0,this.events.emit("resume",this)),this},sleep:function(){return this.settings.status=s.SLEEPING,this.settings.active=!1,this.settings.visible=!1,this.events.emit("sleep",this),this},wake:function(){var t=this.settings;return t.status=s.RUNNING,t.active=!0,t.visible=!0,this.events.emit("wake",this),t.isTransition&&this.events.emit("transitionwake",t.transitionFrom,t.transitionDuration),this},isSleeping:function(){return this.settings.status===s.SLEEPING},isActive:function(){return this.settings.status===s.RUNNING},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&0<this.scenePlugin._duration},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t){return t?this.resume():this.pause()},start:function(t){t&&(this.settings.data=t),this.settings.status=s.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=s.SHUTDOWN,this.settings.active=!1,this.settings.visible=!1,this.events.emit("shutdown",this)},destroy:function(){this.settings.status=s.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<t.length;e++)this[t[e]]=null}});t.exports=u},function(t,e){t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,LINE_FX_TO:12,MOVE_FX_TO:13,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18}},function(t,e,i){var r=i(57),n=i(80),o=i(22),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){a.canvas=!!window.CanvasRenderingContext2D||r.cocoonJS;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,s=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=o.createWebGL(this);r.cocoonJS&&(t.screencanvas=!1);var e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=o.create2D(this),n=i.getContext("2d").createImageData(1,1);return s=n.data instanceof Uint8ClampedArray,o.remove(t),o.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,n.firefox&&n.firefoxVersion<21&&(a.getUserMedia=!1),!r.iOS&&(n.ie||n.firefox||n.chrome)&&(a.canvasBitBltShift=!0),(n.safari||n.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&s,a}()},function(t,e){t.exports={Global:["anims","cache","plugins","registry","sound","textures"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["CameraManager3D","Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]}},function(t,e){t.exports=function(t,e,i){return(e-t)*i+t}},function(t,e,i){var l=i(23),n=i(0),s=i(38),r=i(204),o=i(9),d=i(122),a=i(14),h=i(64),u=i(132),A=i(6),c=new n({Extends:o,initialize:function(t,e,i,n){o.call(this),this.scene,this.name="",this.x=t,this.y=e,this.width=i,this.height=n,this.roundPixels=!1,this.visible=!0,this.useBounds=!1,this._bounds=new a,this.inputEnabled=!0,this.scrollX=0,this.scrollY=0,this.zoom=1,this.rotation=0,this.matrix=new h(1,0,0,1,0,0),this.transparent=!0,this.backgroundColor=u("rgba(0,0,0,0)"),this.fadeEffect=new r.Fade(this),this.flashEffect=new r.Flash(this),this.shakeEffect=new r.Shake(this),this.disableCull=!1,this.culledObjects=[],this.lerp=new A(1,1),this.followOffset=new A,this._follow=null,this._id=0},centerToBounds:function(){return this.useBounds&&(this.scrollX=.5*this._bounds.width-.5*this.width,this.scrollY=.5*this._bounds.height-.5*this.height),this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.culledObjects,p=t.length;o=1/o;for(var g=f.length=0;g<p;++g){var v=t[g];if(v.hasOwnProperty("width")&&!v.parentContainer){var y=v.width,m=v.height,x=v.x-l*v.scrollFactorX-y*v.originX,w=v.y-u*v.scrollFactorY-m*v.originY,b=x*i+w*s+a,T=x*n+w*r+h,S=(x+y)*i+(w+m)*s+a,A=(x+y)*n+(w+m)*r+h,C=c+y,M=d+m;-y<b&&-m<T&&b<C&&T<M&&-y<S&&-m<A&&S<C&&A<M&&f.push(v)}else f.push(v)}return f},fadeIn:function(t,e,i,n,s,r){return this.fadeEffect.start(!1,t,e,i,n,!0,s,r)},fadeOut:function(t,e,i,n,s,r){return this.fadeEffect.start(!0,t,e,i,n,!0,s,r)},fadeFrom:function(t,e,i,n,s,r,o){return this.fadeEffect.start(!1,t,e,i,n,s,r,o)},fade:function(t,e,i,n,s,r,o){return this.fadeEffect.start(!0,t,e,i,n,s,r,o)},flash:function(t,e,i,n,s,r,o){return this.flashEffect.start(t,e,i,n,s,r,o)},shake:function(t,e,i,n,s){return this.shakeEffect.start(t,e,i,n,s)},getWorldPoint:function(t,e,i){void 0===i&&(i=new A);var n=this.matrix.matrix,s=n[0],r=n[1],o=n[2],a=n[3],h=n[4],l=n[5],u=s*a-r*o;if(!u)return i.x=t,i.y=e,i;var c=a*(u=1/u),d=-r*u,f=-o*u,p=s*u,g=(o*l-a*h)*u,v=(r*h-s*l)*u,y=Math.cos(this.rotation),m=Math.sin(this.rotation),x=this.zoom,w=this.scrollX,b=this.scrollY,T=t+(w*y-b*m)*x,S=e+(w*m+b*y)*x;return i.x=T*c+S*f+g,i.y=T*d+S*p+v,i},ignore:function(t){var e=this._id;if(Array.isArray(t))for(var i=0;i<t.length;i++)t[i].cameraFilter|=e;else t.cameraFilter|=e;return this},preRender:function(t,e){var i=this.width,n=this.height,s=this.zoom*t,r=this.matrix,o=i/2,a=n/2,h=this._follow;if(h&&(this.scrollX=d(this.scrollX,h.x-this.followOffset.x-o,this.lerp.x)/s,this.scrollY=d(this.scrollY,h.y-this.followOffset.y-a,this.lerp.y)/s),this.useBounds){var l=this._bounds,u=Math.max(0,l.right-i),c=Math.max(0,l.bottom-n);this.scrollX<l.x?this.scrollX=l.x:this.scrollX>u&&(this.scrollX=u),this.scrollY<l.y?this.scrollY=l.y:this.scrollY>c&&(this.scrollY=c)}this.roundPixels&&(this.scrollX=Math.round(this.scrollX),this.scrollY=Math.round(this.scrollY)),r.loadIdentity(),r.scale(e,e),r.translate(this.x+o,this.y+a),r.rotate(this.rotation),r.scale(s,s),r.translate(-o,-a),this.shakeEffect.preRender()},removeBounds:function(){return this.useBounds=!1,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=s(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=u(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,n){return this._bounds.setTo(t,e,i,n),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,n){return this.x=t,this.y=e,this.width=i,this.height=n,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,s,r){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=s),this._follow=t,this.roundPixels=e,i=l(i,0,1),n=l(n,0,1),this.lerp.set(i,n),this.followOffset.set(s,r);var o=this.zoom,a=this.width/2,h=this.height/2;return this.scrollX=(t.x-s-a)/o,this.scrollY=(t.y-r-h)/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=c},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e<t.length;e++)this.set(t[e][0],t[e][1])},set:function(t,e){return this.has(t)||(this.entries[t]=e,this.size++),this},get:function(t){if(this.has(t))return this.entries[t]},getArray:function(){var t=[],e=this.entries;for(var i in e)t.push(e[i]);return t},has:function(t){return this.entries.hasOwnProperty(t)},delete:function(t){return this.has(t)&&(delete this.entries[t],this.size--),this},clear:function(){return Object.keys(this.entries).forEach(function(t){delete this.entries[t]},this),this.size=0,this},keys:function(){return Object.keys(this.entries)},values:function(){var t=[],e=this.entries;for(var i in e)t.push(e[i]);return t},dump:function(){var t=this.entries;for(var e in console.group("Map"),t)console.log(e,t[e]);console.groupEnd()},each:function(t){var e=this.entries;for(var i in e)if(!1===t(i,e[i]))break;return this},contains:function(t){var e=this.entries;for(var i in e)if(e[i]===t)return!0;return!1},merge:function(t,e){void 0===e&&(e=!1);var i=this.entries,n=t.entries;for(var s in n)i.hasOwnProperty(s)&&e?i[s]=n[s]:this.set(s,n[s]);return this}});t.exports=n},function(t,e){var i={};(t.exports=i).create=function(t){var e={min:{x:0,y:0},max:{x:0,y:0}};return t&&i.update(e,t),e},i.update=function(t,e,i){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var n=0;n<e.length;n++){var s=e[n];s.x>t.max.x&&(t.max.x=s.x),s.x<t.min.x&&(t.min.x=s.x),s.y>t.max.y&&(t.max.y=s.y),s.y<t.min.y&&(t.min.y=s.y)}i&&(0<i.x?t.max.x+=i.x:t.min.x+=i.x,0<i.y?t.max.y+=i.y:t.min.y+=i.y)},i.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},i.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},i.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},i.shift=function(t,e){var i=t.max.x-t.min.x,n=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+n}},function(t,e,i){var a={};t.exports=a;var w=i(106),b=i(41);a.create=function(t,e){for(var i=[],n=0;n<t.length;n++){var s=t[n],r={x:s.x,y:s.y,index:n,body:e,isInternal:!1,contact:null};r.contact={vertex:r,normalImpulse:0,tangentImpulse:0},i.push(r)}return i},a.fromPath=function(t,e){var n=[];return t.replace(/L?\s*([\-\d\.e]+)[\s,]*([\-\d\.e]+)*/gi,function(t,e,i){n.push({x:parseFloat(e),y:parseFloat(i)})}),a.create(n,e)},a.centre=function(t){for(var e,i,n,s=a.area(t,!0),r={x:0,y:0},o=0;o<t.length;o++)n=(o+1)%t.length,e=w.cross(t[o],t[n]),i=w.mult(w.add(t[o],t[n]),e),r=w.add(r,i);return w.div(r,6*s)},a.mean=function(t){for(var e={x:0,y:0},i=0;i<t.length;i++)e.x+=t[i].x,e.y+=t[i].y;return w.div(e,t.length)},a.area=function(t,e){for(var i=0,n=t.length-1,s=0;s<t.length;s++)i+=(t[n].x-t[s].x)*(t[n].y+t[s].y),n=s;return e?i/2:Math.abs(i)/2},a.inertia=function(t,e){for(var i,n,s=0,r=0,o=t,a=0;a<o.length;a++)n=(a+1)%o.length,s+=(i=Math.abs(w.cross(o[n],o[a])))*(w.dot(o[n],o[n])+w.dot(o[n],o[a])+w.dot(o[a],o[a])),r+=i;return e/6*(s/r)},a.translate=function(t,e,i){var n;if(i)for(n=0;n<t.length;n++)t[n].x+=e.x*i,t[n].y+=e.y*i;else for(n=0;n<t.length;n++)t[n].x+=e.x,t[n].y+=e.y;return t},a.rotate=function(t,e,i){if(0!==e){for(var n=Math.cos(e),s=Math.sin(e),r=0;r<t.length;r++){var o=t[r],a=o.x-i.x,h=o.y-i.y;o.x=i.x+(a*n-h*s),o.y=i.y+(a*s+h*n)}return t}},a.contains=function(t,e){for(var i=0;i<t.length;i++){var n=t[i],s=t[(i+1)%t.length];if(0<(e.x-n.x)*(s.y-n.y)+(e.y-n.y)*(n.x-s.x))return!1}return!0},a.scale=function(t,e,i,n){if(1===e&&1===i)return t;var s,r;n=n||a.centre(t);for(var o=0;o<t.length;o++)s=t[o],r=w.sub(s,n),t[o].x=n.x+r.x*e,t[o].y=n.y+r.y*i;return t},a.chamfer=function(t,e,i,n,s){(e="number"==typeof e?[e]:e||[8]).length||(e=[e]),i=void 0!==i?i:-1,n=n||2,s=s||14;for(var r=[],o=0;o<t.length;o++){var a=t[0<=o-1?o-1:t.length-1],h=t[o],l=t[(o+1)%t.length],u=e[o<e.length?o:e.length-1];if(0!==u){var c=w.normalise({x:h.y-a.y,y:a.x-h.x}),d=w.normalise({x:l.y-h.y,y:h.x-l.x}),f=Math.sqrt(2*Math.pow(u,2)),p=w.mult(b.clone(c),u),g=w.normalise(w.mult(w.add(c,d),.5)),v=w.sub(h,w.mult(g,f)),y=i;-1===i&&(y=1.75*Math.pow(u,.32)),(y=b.clamp(y,n,s))%2==1&&(y+=1);for(var m=Math.acos(w.dot(c,d))/y,x=0;x<y;x++)r.push(w.add(w.rotate(p,m*x),v))}else r.push(h)}return r},a.clockwiseSort=function(t){var i=a.mean(t);return t.sort(function(t,e){return w.angle(i,t)-w.angle(i,e)}),t},a.isConvex=function(t){var e,i,n,s,r=0,o=t.length;if(o<3)return null;for(e=0;e<o;e++)if(n=(e+2)%o,s=(t[i=(e+1)%o].x-t[e].x)*(t[n].y-t[i].y),(s-=(t[i].y-t[e].y)*(t[n].x-t[i].x))<0?r|=1:0<s&&(r|=2),3===r)return!1;return 0!==r||null},a.hull=function(t){var e,i,n=[],s=[];for((t=t.slice(0)).sort(function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y}),i=0;i<t.length;i+=1){for(e=t[i];2<=s.length&&w.cross3(s[s.length-2],s[s.length-1],e)<=0;)s.pop();s.push(e)}for(i=t.length-1;0<=i;i-=1){for(e=t[i];2<=n.length&&w.cross3(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}return n.pop(),s.pop(),n.concat(s)}},function(t,e,i){var d=i(10);t.exports=function(t,e){var i=d(e,"anims",null);if(null===i)return t;if("string"==typeof i)t.anims.play(i);else if("object"==typeof i){var n=t.anims,s=d(i,"key",void 0),r=d(i,"startFrame",void 0),o=d(i,"delay",0),a=d(i,"repeat",0),h=d(i,"repeatDelay",0),l=d(i,"yoyo",!1),u=d(i,"play",!1),c=d(i,"delayedPlay",0);n.delay(o),n.repeat(a),n.repeatDelay(h),n.yoyo(l),u?n.play(s,r):0<c?n.delayedPlay(c,s,r):n.load(s)}return t}},function(t,e,i){var n=i(0),s=i(17),r=new n({initialize:function(t,e,i,n,s,r,o){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,o,n,s)},setSize:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this.cutX=i,this.cutY=n,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var s=this.data,r=s.cut;r.x=i,r.y=n,r.w=t,r.h=e,r.r=i+t,r.b=n+e,s.sourceSize.w=t,s.sourceSize.h=e,s.spriteSourceSize.w=t,s.spriteSourceSize.h=e,s.radius=.5*Math.sqrt(t*t+e*e);var o=s.drawImage;return o.sx=i,o.sy=n,o.sWidth=t,o.sHeight=e,o.dWidth=t,o.dHeight=e,this.updateUVs()},setTrim:function(t,e,i,n,s,r){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=n,a.w=s,a.h=r,this.x=i,this.y=n,this.width=s,this.height=r,this.halfWidth=.5*s,this.halfHeight=.5*r,this.centerX=Math.floor(s/2),this.centerY=Math.floor(r/2),this.updateUVs()},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,s=this.data.drawImage;s.sWidth=i,s.sHeight=n,s.dWidth=i,s.dHeight=n;var r=this.source.width,o=this.source.height,a=this.data.uvs;return a.x0=t/r,a.y0=e/o,a.x1=t/r,a.y1=(e+n)/o,a.x2=(t+i)/r,a.y2=(e+n)/o,a.x3=(t+i)/r,a.y3=e/o,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=s(!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 n=i(0),s=i(202),r=i(526),o=i(525),ne=i(27),a=i(84),h=new n({Extends:a,Mixins:[s],initialize:function(t){a.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:t.topology?t.topology:t.renderer.gl.TRIANGLES,vertShader:t.vertShader?t.vertShader:o,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 n=i[i.length-1];return 0<e?(n.textures[e-1]&&n.textures[e-1]!==t&&this.pushBatch(),i[i.length-1].textures[e-1]=t):(null!==n.texture&&n.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,n=this.gl,s=this.renderer,r=this.vertexCount,o=this.topology,a=this.vertexSize,h=this.batches,l=0,u=null;if(0===h.length||0===r)return this.flushLocked=!1,this;n.bufferSubData(n.ARRAY_BUFFER,0,this.bytes.subarray(0,r*a));for(var c=0;c<h.length-1;++c){if(u=h[c],t=h[c+1],0<u.textures.length){for(e=0;e<u.textures.length;++e)(i=u.textures[e])&&s.setTexture2D(i,1+e);n.activeTexture(n.TEXTURE0)}l=t.first-u.first,null===u.texture||l<=0||(s.setTexture2D(u.texture,0),n.drawArrays(o,u.first,l))}if(0<(u=h[h.length-1]).textures.length){for(e=0;e<u.textures.length;++e)(i=u.textures[e])&&s.setTexture2D(i,1+e);n.activeTexture(n.TEXTURE0)}return l=r-u.first,u.texture&&0<l&&(s.setTexture2D(u.texture,0),n.drawArrays(o,u.first,l)),this.vertexCount=0,h.length=0,this.pushBatch(),this.flushLocked=!1,this},onBind:function(){return a.prototype.onBind.call(this),this.mvpUpdate(),0===this.batches.length&&this.pushBatch(),this},resize:function(t,e,i){return a.prototype.resize.call(this,t,e,i),this.projOrtho(0,this.width,this.height,0,-1e3,1e3),this},drawStaticTilemapLayer:function(t){if(0<t.vertexCount){var e=this.vertexBuffer,i=this.gl,n=this.renderer,s=t.tileset.image.get();n.currentPipeline&&0<n.currentPipeline.vertexCount&&n.flush(),this.vertexBuffer=t.vertexBuffer,n.setPipeline(this),n.setTexture2D(s.source.glTexture,0),i.drawArrays(this.topology,0,t.vertexCount),this.vertexBuffer=e}this.viewIdentity(),this.modelIdentity()},drawEmitterManager:function(t,e,i){var n=null;i&&(n=i.matrix),this.renderer.setPipeline(this);var s,r,o,a,h,l,u,c,d,f,p=this.renderer.config.roundPixels,g=t.emitters.list,v=g.length,y=this.vertexViewF32,m=this.vertexViewU32,x=this.renderer,w=this.maxQuads,b=e.scrollX,T=e.scrollY,S=e.matrix.matrix,A=S[0],C=S[1],M=S[2],_=S[3],E=S[4],P=S[5],k=Math.sin,L=Math.cos,F=this.vertexComponentCount,R=this.vertexCapacity,O=t.defaultFrame.source.glTexture;n&&(h=n[0],l=n[1],u=n[2],c=n[3],d=n[4],f=n[5]),this.setTexture2D(O,0);for(var B=0;B<v;++B){var D=g[B],I=D.alive,z=I.length,Y=Math.ceil(z/w),X=0,N=b*D.scrollFactorX,V=T*D.scrollFactorY;if(n){var U=-N,G=-V;s=u*A+c*M,r=u*C+c*_,o=d*A+f*M+(U*A+G*M+E),a=d*C+f*_+(U*C+G*_+P),A=h*A+l*M,C=h*C+l*_,M=s,_=r,E=o,P=a,V=N=0}if(D.visible&&0!==z){x.setBlendMode(D.blendMode),this.vertexCount>=R&&(this.flush(),this.setTexture2D(O,0));for(var W=0;W<Y;++W){for(var H=Math.min(z,w),j=0;j<H;++j){var q=I[X+j];if(!(q.alpha<=0)){var K=q.frame,J=K.uvs,Z=-K.halfWidth,Q=-K.halfHeight,$=q.color,tt=Z+K.width,et=Q+K.height,it=k(q.rotation),nt=L(q.rotation),st=nt*q.scaleX,rt=it*q.scaleX,ot=-it*q.scaleY,at=nt*q.scaleY,ht=q.x-N,lt=q.y-V,ut=st*A+rt*M,ct=st*C+rt*_,dt=ot*A+at*M,ft=ot*C+at*_,pt=ht*A+lt*M+E,gt=ht*C+lt*_+P,vt=Z*ut+Q*dt+pt,yt=Z*ct+Q*ft+gt,mt=Z*ut+et*dt+pt,xt=Z*ct+et*ft+gt,wt=tt*ut+et*dt+pt,bt=tt*ct+et*ft+gt,Tt=tt*ut+Q*dt+pt,St=tt*ct+Q*ft+gt,At=this.vertexCount*F;p&&(vt|=0,yt|=0,mt|=0,xt|=0,wt|=0,bt|=0,Tt|=0,St|=0),y[At+0]=vt,y[At+1]=yt,y[At+2]=J.x0,y[At+3]=J.y0,m[At+4]=$,y[At+5]=mt,y[At+6]=xt,y[At+7]=J.x1,y[At+8]=J.y1,m[At+9]=$,y[At+10]=wt,y[At+11]=bt,y[At+12]=J.x2,y[At+13]=J.y2,m[At+14]=$,y[At+15]=vt,y[At+16]=yt,y[At+17]=J.x0,y[At+18]=J.y0,m[At+19]=$,y[At+20]=wt,y[At+21]=bt,y[At+22]=J.x2,y[At+23]=J.y2,m[At+24]=$,y[At+25]=Tt,y[At+26]=St,y[At+27]=J.x3,y[At+28]=J.y3,m[At+29]=$,this.vertexCount+=6,this.vertexCount>=R&&(this.flush(),this.setTexture2D(O,0))}}X+=H,z-=H,this.vertexCount>=R&&(this.flush(),this.setTexture2D(O,0))}}}this.setTexture2D(O,0)},drawBlitter:function(t,e,i){var n=null;i&&(n=i.matrix),this.renderer.setPipeline(this);var s=this.renderer.config.roundPixels,r=ne.getTintAppendFloatAlpha,o=this.vertexViewF32,a=this.vertexViewU32,h=t.getRenderList(),l=h.length,u=e.matrix.matrix,c=u[0],d=u[1],f=u[2],p=u[3],g=u[4],v=u[5],y=e.scrollX*t.scrollFactorX,m=e.scrollY*t.scrollFactorY,x=Math.ceil(l/this.maxQuads),w=0;if(n){var b=n[0],T=n[1],S=n[2],A=n[3],C=n[4],M=n[5],_=-y,E=-m,P=S*c+A*f,k=S*d+A*p,L=C*c+M*f+(_*c+E*f+g),F=C*d+M*p+(_*d+E*p+v);c=b*c+T*f,d=b*d+T*p,f=P,p=k,g=L,v=F,m=y=0}for(var R,O=t.x-y,B=t.y-m,D=0;D<x;++D){for(var I=Math.min(l,this.maxQuads),z=0;z<I;++z){var Y=h[w+z],X=Y.frame,N=Y.alpha;if(0!==N){var V=r(16777215,N),U=X.uvs,G=Y.flipX,W=Y.flipY,H=X.width*(G?-1:1),j=X.height*(W?-1:1),q=O+Y.x+X.x+X.width*(G?1:0),K=B+Y.y+X.y+X.height*(W?1:0),J=q+H,Z=K+j,Q=q*c+K*f+g,$=q*d+K*p+v,tt=J*c+Z*f+g,et=J*d+Z*p+v;X.sourceIndex!==R&&(this.setTexture2D(X.texture.source[X.sourceIndex].glTexture,0),R=X.sourceIndex);var it=this.vertexCount*this.vertexComponentCount;s&&(Q|=0,$|=0,tt|=0,et|=0),o[it+0]=Q,o[it+1]=$,o[it+2]=U.x0,o[it+3]=U.y0,a[it+4]=V,o[it+5]=Q,o[it+6]=et,o[it+7]=U.x1,o[it+8]=U.y1,a[it+9]=V,o[it+10]=tt,o[it+11]=et,o[it+12]=U.x2,o[it+13]=U.y2,a[it+14]=V,o[it+15]=Q,o[it+16]=$,o[it+17]=U.x0,o[it+18]=U.y0,a[it+19]=V,o[it+20]=tt,o[it+21]=et,o[it+22]=U.x2,o[it+23]=U.y2,a[it+24]=V,o[it+25]=tt,o[it+26]=$,o[it+27]=U.x3,o[it+28]=U.y3,a[it+29]=V,this.vertexCount+=6,this.vertexCount>=this.vertexCapacity&&(this.flush(),R=-1)}}w+=I,l-=I,this.vertexCount>=this.vertexCapacity&&this.flush()}},batchSprite:function(t,e,i){var n=null;i&&(n=i.matrix),this.renderer.setPipeline(this),this.vertexCount+6>this.vertexCapacity&&this.flush();var s,r,o,a,h,l,u=this.renderer.config.roundPixels,c=ne.getTintAppendFloatAlpha,d=this.vertexViewF32,f=this.vertexViewU32,p=e.matrix.matrix,g=t.frame,v=g.texture.source[g.sourceIndex].glTexture,y=!!v.isRenderTexture,m=t.flipX,x=t.flipY^y,w=g.uvs,b=g.width*(m?-1:1),T=g.height*(x?-1:1),S=-t.displayOriginX+g.x+g.width*(m?1:0),A=-t.displayOriginY+g.y+g.height*(x?1:0),C=(u?0|S:S)+b,M=(u?0|A:A)+T,_=t.scaleX,E=t.scaleY,P=t.rotation,k=t._alphaTL,L=t._alphaTR,F=t._alphaBL,R=t._alphaBR,O=t._tintTL,B=t._tintTR,D=t._tintBL,I=t._tintBR,z=Math.sin(P),Y=Math.cos(P),X=Y*_,N=z*_,V=-z*E,U=Y*E,G=t.x,W=t.y,H=p[0],j=p[1],q=p[2],K=p[3],J=p[4],Z=p[5];if(n){var Q=n[0],$=n[1],tt=n[2],et=n[3],it=n[4],nt=n[5],st=-e.scrollX*t.scrollFactorX,rt=-e.scrollY*t.scrollFactorY,ot=Q*H+$*q,at=Q*j+$*K,ht=tt*H+et*q,lt=tt*j+et*K;s=X*ot+N*ht,r=X*at+N*lt,o=V*ot+U*ht,a=V*at+U*lt,h=G*ot+W*ht+(it*H+nt*q+(st*H+rt*q+J)),l=G*at+W*lt+(it*j+nt*K+(st*j+rt*K+Z))}else s=X*H+N*q,r=X*j+N*K,o=V*H+U*q,a=V*j+U*K,h=(G-=e.scrollX*t.scrollFactorX)*H+(W-=e.scrollY*t.scrollFactorY)*q+J,l=G*j+W*K+Z;var ut,ct=S*s+A*o+h,dt=S*r+A*a+l,ft=S*s+M*o+h,pt=S*r+M*a+l,gt=C*s+M*o+h,vt=C*r+M*a+l,yt=C*s+A*o+h,mt=C*r+A*a+l,xt=c(O,k),wt=c(B,L),bt=c(D,F),Tt=c(I,R);u&&(ct|=0,dt|=0,ft|=0,pt|=0,gt|=0,vt|=0,yt|=0,mt|=0),this.setTexture2D(v,0),d[(ut=this.vertexCount*this.vertexComponentCount)+0]=ct,d[ut+1]=dt,d[ut+2]=w.x0,d[ut+3]=w.y0,f[ut+4]=xt,d[ut+5]=ft,d[ut+6]=pt,d[ut+7]=w.x1,d[ut+8]=w.y1,f[ut+9]=bt,d[ut+10]=gt,d[ut+11]=vt,d[ut+12]=w.x2,d[ut+13]=w.y2,f[ut+14]=Tt,d[ut+15]=ct,d[ut+16]=dt,d[ut+17]=w.x0,d[ut+18]=w.y0,f[ut+19]=xt,d[ut+20]=gt,d[ut+21]=vt,d[ut+22]=w.x2,d[ut+23]=w.y2,f[ut+24]=Tt,d[ut+25]=yt,d[ut+26]=mt,d[ut+27]=w.x3,d[ut+28]=w.y3,f[ut+29]=wt,this.vertexCount+=6},batchMesh:function(t,e,i){var n=null;i&&(n=i.matrix);var s=t.vertices,r=s.length,o=r/2|0;this.renderer.setPipeline(this),this.vertexCount+o>this.vertexCapacity&&this.flush();var a,h,l,u,c,d,f=this.renderer.config.roundPixels,p=ne.getTintAppendFloatAlpha,g=t.uv,v=t.colors,y=t.alphas,m=this.vertexViewF32,x=this.vertexViewU32,w=e.matrix.matrix,b=t.frame,T=t.texture.source[b.sourceIndex].glTexture,S=t.x,A=t.y,C=t.scaleX,M=t.scaleY,_=t.rotation,E=Math.sin(_),P=Math.cos(_),k=P*C,L=E*C,F=-E*M,R=P*M,O=S,B=A,D=w[0],I=w[1],z=w[2],Y=w[3],X=w[4],N=w[5],V=0;if(n){var U=n[0],G=n[1],W=n[2],H=n[3],j=n[4],q=n[5],K=-e.scrollX*t.scrollFactorX,J=-e.scrollY*t.scrollFactorY,Z=U*D+G*z,Q=U*I+G*Y,$=W*D+H*z,tt=W*I+H*Y;a=k*Z+L*$,h=k*Q+L*tt,l=F*Z+R*$,u=F*Q+R*tt,c=O*Z+B*$+(j*D+q*z+(K*D+J*z+X)),d=O*Q+B*tt+(j*I+q*Y+(K*I+J*Y+N))}else a=k*D+L*z,h=k*I+L*Y,l=F*D+R*z,u=F*I+R*Y,c=(O-=e.scrollX*t.scrollFactorX)*D+(B-=e.scrollY*t.scrollFactorY)*z+X,d=O*I+B*Y+N;this.setTexture2D(T,0),V=this.vertexCount*this.vertexComponentCount;for(var et=0,it=0;et<r;et+=2){var nt=s[et+0],st=s[et+1],rt=nt*a+st*l+c,ot=nt*h+st*u+d;f&&(rt|=0,ot|=0),m[V+0]=rt,m[V+1]=ot,m[V+2]=g[et+0],m[V+3]=g[et+1],x[V+4]=p(v[it],y[it]),V+=5,it+=1}this.vertexCount+=o},batchBitmapText:function(t,e,i){var n=null;i&&(n=i.matrix),this.renderer.setPipeline(this),this.vertexCount+6>this.vertexCapacity&&this.flush();var s,r,o,a,h,l,u,c,d,f,p,g,v,y,m=this.renderer.config.roundPixels,x=t.text,w=x.length,b=ne.getTintAppendFloatAlpha,T=this.vertexViewF32,S=this.vertexViewU32,A=e.matrix.matrix,C=e.width+50,M=e.height+50,_=t.frame,E=t.texture.source[_.sourceIndex],P=e.scrollX*t.scrollFactorX,k=e.scrollY*t.scrollFactorY,L=t.fontData,F=L.lineHeight,R=t.fontSize/L.size,O=L.chars,B=t.alpha,D=b(t._tintTL,B),I=b(t._tintTR,B),z=b(t._tintBL,B),Y=b(t._tintBR,B),X=t.x,N=t.y,V=_.cutX,U=_.cutY,G=E.width,W=E.height,H=E.glTexture,j=0,q=0,K=0,J=0,Z=null,Q=0,$=0,tt=0,et=0,it=0,nt=0,st=0,rt=0,ot=0,at=0,ht=0,lt=0,ut=null,ct=0,dt=X+_.x,ft=N+_.y,pt=t.rotation,gt=t.scaleX,vt=t.scaleY,yt=t.letterSpacing,mt=Math.sin(pt),xt=Math.cos(pt),wt=xt*gt,bt=mt*gt,Tt=-mt*vt,St=xt*vt,At=dt,Ct=ft,Mt=A[0],_t=A[1],Et=A[2],Pt=A[3],kt=A[4],Lt=A[5],Ft=0;if(n){var Rt=n[0],Ot=n[1],Bt=n[2],Dt=n[3],It=n[4],zt=n[5],Yt=-P,Xt=-k,Nt=Rt*Mt+Ot*Et,Vt=Rt*_t+Ot*Pt,Ut=Bt*Mt+Dt*Et,Gt=Bt*_t+Dt*Pt;d=wt*Nt+bt*Ut,f=wt*Vt+bt*Gt,p=Tt*Nt+St*Ut,g=Tt*Vt+St*Gt,v=At*Nt+Ct*Ut+(It*Mt+zt*Et+(Yt*Mt+Xt*Et+kt)),y=At*Vt+Ct*Gt+(It*_t+zt*Pt+(Yt*_t+Xt*Pt+Lt))}else d=wt*Mt+bt*Et,f=wt*_t+bt*Pt,p=Tt*Mt+St*Et,g=Tt*_t+St*Pt,v=(At-=P)*Mt+(Ct-=k)*Et+kt,y=At*_t+Ct*Pt+Lt;this.setTexture2D(H,0);for(var Wt=0;Wt<w;++Wt)if(10!==(J=x.charCodeAt(Wt))){if(Z=O[J]){if(Q=V+Z.x,$=U+Z.y,tt=Z.width,et=Z.height,it=(K+Z.xOffset+j)*R,nt=(Z.yOffset+q)*R,null!==ut){var Ht=Z.kerning[ct];it+=void 0!==Ht?Ht:0}j+=Z.xAdvance+yt,K+=1,ut=Z,ct=J,0!==tt&&0!==et&&32!==J&&(r=(it-=t.displayOriginX)*f+(nt-=t.displayOriginY)*g+y,o=it*d+(rt=nt+et*R)*p+v,a=it*f+rt*g+y,h=(st=it+tt*R)*d+rt*p+v,l=st*f+rt*g+y,u=st*d+nt*p+v,c=st*f+nt*g+y,ot=Q/G,at=(Q+tt)/G,ht=$/W,lt=($+et)/W,((s=it*d+nt*p+v)<-50||C<s||r<-50||M<r)&&(o<-50||C<o||a<-50||M<a)&&(h<-50||C<h||l<-50||M<l)&&(u<-50||C<u||c<-50||M<c)||(this.vertexCount+6>this.vertexCapacity&&this.flush(),m&&(s|=0,r|=0,o|=0,a|=0,h|=0,l|=0,u|=0,c|=0),T[(Ft=this.vertexCount*this.vertexComponentCount)+0]=s,T[Ft+1]=r,T[Ft+2]=ot,T[Ft+3]=ht,S[Ft+4]=D,T[Ft+5]=o,T[Ft+6]=a,T[Ft+7]=ot,T[Ft+8]=lt,S[Ft+9]=z,T[Ft+10]=h,T[Ft+11]=l,T[Ft+12]=at,T[Ft+13]=lt,S[Ft+14]=Y,T[Ft+15]=s,T[Ft+16]=r,T[Ft+17]=ot,T[Ft+18]=ht,S[Ft+19]=D,T[Ft+20]=h,T[Ft+21]=l,T[Ft+22]=at,T[Ft+23]=lt,S[Ft+24]=Y,T[Ft+25]=u,T[Ft+26]=c,T[Ft+27]=at,T[Ft+28]=ht,S[Ft+29]=I,this.vertexCount+=6))}}else K=j=0,q+=F,ut=null},batchDynamicBitmapText:function(t,e,i){var n=null;i&&(n=i.matrix),this.renderer.setPipeline(this),this.vertexCount+6>this.vertexCapacity&&this.flush();var s,r,o,a,h,l,u,c,d,f,p,g,v,y,m,x,w,b,T,S,A=this.renderer.config.roundPixels,C=t.displayCallback,M=t.text,_=M.length,E=ne.getTintAppendFloatAlpha,P=this.vertexViewF32,k=this.vertexViewU32,L=this.renderer,F=e.matrix.matrix,R=t.frame,O=t.texture.source[R.sourceIndex],B=e.scrollX*t.scrollFactorX,D=e.scrollY*t.scrollFactorY,I=t.scrollX,z=t.scrollY,Y=t.fontData,X=Y.lineHeight,N=t.fontSize/Y.size,V=Y.chars,U=t.alpha,G=E(t._tintTL,U),W=E(t._tintTR,U),H=E(t._tintBL,U),j=E(t._tintBR,U),q=t.x,K=t.y,J=R.cutX,Z=R.cutY,Q=O.width,$=O.height,tt=O.glTexture,et=0,it=0,nt=0,st=0,rt=null,ot=0,at=0,ht=0,lt=0,ut=0,ct=0,dt=0,ft=0,pt=0,gt=0,vt=0,yt=0,mt=null,xt=0,wt=q+R.x,bt=K+R.y,Tt=t.rotation,St=t.scaleX,At=t.scaleY,Ct=t.letterSpacing,Mt=Math.sin(Tt),_t=Math.cos(Tt),Et=_t*St,Pt=Mt*St,kt=-Mt*At,Lt=_t*At,Ft=wt,Rt=bt,Ot=F[0],Bt=F[1],Dt=F[2],It=F[3],zt=F[4],Yt=F[5],Xt=0<t.cropWidth||0<t.cropHeight,Nt=0;if(n){var Vt=n[0],Ut=n[1],Gt=n[2],Wt=n[3],Ht=n[4],jt=n[5],qt=-B,Kt=-D,Jt=Vt*Ot+Ut*Dt,Zt=Vt*Bt+Ut*It,Qt=Gt*Ot+Wt*Dt,$t=Gt*Bt+Wt*It;m=Et*Jt+Pt*Qt,x=Et*Zt+Pt*$t,w=kt*Jt+Lt*Qt,b=kt*Zt+Lt*$t,T=Ft*Jt+Rt*Qt+(Ht*Ot+jt*Dt+(qt*Ot+Kt*Dt+zt)),S=Ft*Zt+Rt*$t+(Ht*Bt+jt*It+(qt*Bt+Kt*It+Yt))}else m=Et*Ot+Pt*Dt,x=Et*Bt+Pt*It,w=kt*Ot+Lt*Dt,b=kt*Bt+Lt*It,T=(Ft-=B)*Ot+(Rt-=D)*Dt+zt,S=Ft*Bt+Rt*It+Yt;this.setTexture2D(tt,0),Xt&&L.pushScissor(t.x,t.y,t.cropWidth*t.scaleX,t.cropHeight*t.scaleY);for(var te=0;te<_;++te)if(N=t.fontSize/t.fontData.size,Tt=0,10!==(st=M.charCodeAt(te))){if(rt=V[st]){if(ot=J+rt.x,at=Z+rt.y,ht=rt.width,lt=rt.height,ut=nt+rt.xOffset+et-I,ct=rt.yOffset+it-z,null!==mt){var ee=rt.kerning[xt];ut+=void 0!==ee?ee:0}if(et+=rt.xAdvance+Ct,nt+=1,mt=rt,xt=st,0!==ht&&0!==lt&&32!==st){if(C){var ie=C({color:0,tint:{topLeft:G,topRight:W,bottomLeft:H,bottomRight:j},index:te,charCode:st,x:ut,y:ct,scale:N,rotation:0,data:rt.data});ut=ie.x,ct=ie.y,N=ie.scale,Tt=ie.rotation,ie.color?(G=ie.color,W=ie.color,H=ie.color,j=ie.color):(G=ie.tint.topLeft,W=ie.tint.topRight,H=ie.tint.bottomLeft,j=ie.tint.bottomRight),G=E(G,U),W=E(W,U),H=E(H,U),j=E(j,U)}ut-=t.displayOriginX,ct-=t.displayOriginY,ut*=N,ct*=N,o=(ft=lt)*(kt=(p=-(Mt=Math.sin(Tt))*N)*m+(g=d=(_t=Math.cos(Tt))*N)*w)+(s=Ft=(v=ut)*m+(y=ct)*w+T),a=ft*(Lt=p*x+g*b)+(r=Rt=v*x+y*b+S),h=(dt=ht)*(Et=d*m+(f=Mt*N)*w)+ft*kt+Ft,l=dt*(Pt=d*x+f*b)+ft*Lt+Rt,u=dt*Et+Ft,c=dt*Pt+Rt,pt=ot/Q,gt=(ot+ht)/Q,vt=at/$,yt=(at+lt)/$,this.vertexCount+6>this.vertexCapacity&&this.flush(),A&&(s|=0,r|=0,o|=0,a|=0,h|=0,l|=0,u|=0,c|=0),P[(Nt=this.vertexCount*this.vertexComponentCount)+0]=s,P[Nt+1]=r,P[Nt+2]=pt,P[Nt+3]=vt,k[Nt+4]=G,P[Nt+5]=o,P[Nt+6]=a,P[Nt+7]=pt,P[Nt+8]=yt,k[Nt+9]=H,P[Nt+10]=h,P[Nt+11]=l,P[Nt+12]=gt,P[Nt+13]=yt,k[Nt+14]=j,P[Nt+15]=s,P[Nt+16]=r,P[Nt+17]=pt,P[Nt+18]=vt,k[Nt+19]=G,P[Nt+20]=h,P[Nt+21]=l,P[Nt+22]=gt,P[Nt+23]=yt,k[Nt+24]=j,P[Nt+25]=u,P[Nt+26]=c,P[Nt+27]=gt,P[Nt+28]=vt,k[Nt+29]=W,this.vertexCount+=6}}}else nt=et=0,it+=X,mt=null;Xt&&L.popScissor()},batchText:function(t,e,i){var n=ne.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,n(t._tintTL,t._alphaTL),n(t._tintTR,t._alphaTR),n(t._tintBL,t._alphaBL),n(t._tintBR,t._alphaBR),0,0,e,i)},batchDynamicTilemapLayer:function(t,e,i){for(var n=t.culledTiles,s=n.length,r=t.tileset.image.get().source.glTexture,o=t.tileset,a=t.scrollFactorX,h=t.scrollFactorY,l=t.alpha,u=t.x,c=t.y,d=t.scaleX,f=t.scaleY,p=ne.getTintAppendFloatAlpha,g=0;g<s;++g){var v=n[g],y=o.getTileTextureCoordinates(v.index);if(null!==y){var m=v.width,x=v.height,w=y.x,b=y.y,T=p(v.tint,l*v.alpha);this.batchTexture(t,r,r.width,r.height,v.width/2+u+v.pixelX*d,v.height/2+c+v.pixelY*f,v.width*d,v.height*f,1,1,v.rotation,v.flipX,v.flipY,a,h,v.width/2,v.height/2,w,b,m,x,T,T,T,T,0,0,e,i)}}},batchTileSprite:function(t,e,i){var n=ne.getTintAppendFloatAlpha;this.batchTexture(t,t.tileTexture,t.frame.width,t.frame.height,t.x,t.y,t.width,t.height,t.scaleX,t.scaleY,t.rotation,t.flipX,t.flipY,t.scrollFactorX,t.scrollFactorY,t.originX*t.width,t.originY*t.height,0,0,t.width,t.height,n(t._tintTL,t._alphaTL),n(t._tintTR,t._alphaTR),n(t._tintBL,t._alphaBL),n(t._tintBR,t._alphaBR),t.tilePositionX%t.frame.width/t.frame.width,t.tilePositionY%t.frame.height/t.frame.height,e,i)},batchTexture:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,y,m,x,w,b,T,S,A,C,M,_,E){var P=null;E&&(P=E.matrix),this.renderer.setPipeline(this),this.vertexCount+6>this.vertexCapacity&&this.flush(),d^=e.isRenderTexture?1:0;var k,L,F,R,O,B,D=this.renderer.config.roundPixels,I=this.vertexViewF32,z=this.vertexViewU32,Y=_.matrix.matrix,X=o*(c?1:0)-g,N=a*(d?1:0)-v,V=X+o*(c?-1:1),U=N+a*(d?-1:1),G=s,W=r,H=Math.sin(u),j=Math.cos(u),q=j*h,K=H*h,J=-H*l,Z=j*l,Q=G,$=W,tt=Y[0],et=Y[1],it=Y[2],nt=Y[3],st=Y[4],rt=Y[5];if(P){var ot=P[0],at=P[1],ht=P[2],lt=P[3],ut=P[4],ct=P[5],dt=-_.scrollX*f,ft=-_.scrollY*p,pt=ot*tt+at*it,gt=ot*et+at*nt,vt=ht*tt+lt*it,yt=ht*et+lt*nt;k=q*pt+K*vt,L=q*gt+K*yt,F=J*pt+Z*vt,R=J*gt+Z*yt,O=Q*pt+$*vt+(ut*tt+ct*it+(dt*tt+ft*it+st)),B=Q*gt+$*yt+(ut*et+ct*nt+(dt*et+ft*nt+rt))}else k=q*tt+K*it,L=q*et+K*nt,F=J*tt+Z*it,R=J*et+Z*nt,O=(Q-=_.scrollX*f)*tt+($-=_.scrollY*p)*it+st,B=Q*et+$*nt+rt;var mt,xt=X*k+N*F+O,wt=X*L+N*R+B,bt=X*k+U*F+O,Tt=X*L+U*R+B,St=V*k+U*F+O,At=V*L+U*R+B,Ct=V*k+N*F+O,Mt=V*L+N*R+B,_t=y/i+C,Et=m/n+M,Pt=(y+x)/i+C,kt=(m+w)/n+M;this.setTexture2D(e,0),D&&(xt|=0,wt|=0,bt|=0,Tt|=0,St|=0,At|=0,Ct|=0,Mt|=0),I[(mt=this.vertexCount*this.vertexComponentCount)+0]=xt,I[mt+1]=wt,I[mt+2]=_t,I[mt+3]=Et,z[mt+4]=b,I[mt+5]=bt,I[mt+6]=Tt,I[mt+7]=_t,I[mt+8]=kt,z[mt+9]=T,I[mt+10]=St,I[mt+11]=At,I[mt+12]=Pt,I[mt+13]=kt,z[mt+14]=S,I[mt+15]=xt,I[mt+16]=wt,I[mt+17]=_t,I[mt+18]=Et,z[mt+19]=b,I[mt+20]=St,I[mt+21]=At,I[mt+22]=Pt,I[mt+23]=kt,z[mt+24]=S,I[mt+25]=Ct,I[mt+26]=Mt,I[mt+27]=Pt,I[mt+28]=Et,z[mt+29]=A,this.vertexCount+=6},drawTexture:function(t,e,i,n,s,r,o,a,h,l,u){var c=null;u&&(c=u.matrix),this.renderer.setPipeline(this),this.vertexCount+6>this.vertexCapacity&&this.flush();var d=this.renderer.config.roundPixels,f=this.vertexViewF32,p=this.vertexViewU32,g=e,v=i,y=g+a,m=v+h,x=l[0],w=l[1],b=l[2],T=l[3],S=l[4],A=l[5];if(c){var C=c[0],M=c[1],_=c[2],E=c[3],P=c[4],k=x*M+w*E,L=b*M+T*E,F=S*M+A*E+c[5];x=x*C+w*_,w=k,b=b*C+T*_,T=L,S=S*C+A*_+P,A=F}var R,O=g*x+v*b+S,B=g*w+v*T+A,D=g*x+m*b+S,I=g*w+m*T+A,z=y*x+m*b+S,Y=y*w+m*T+A,X=y*x+v*b+S,N=y*w+v*T+A,V=t.width,U=t.height,G=r/V,W=o/U,H=(r+a)/V,j=(o+h)/U;n=ne.getTintAppendFloatAlpha(n,s),this.setTexture2D(t,0),d&&(O|=0,B|=0,D|=0,I|=0,z|=0,Y|=0,X|=0,N|=0),f[(R=this.vertexCount*this.vertexComponentCount)+0]=O,f[R+1]=B,f[R+2]=G,f[R+3]=W,p[R+4]=n,f[R+5]=D,f[R+6]=I,f[R+7]=G,f[R+8]=j,p[R+9]=n,f[R+10]=z,f[R+11]=Y,f[R+12]=H,f[R+13]=j,p[R+14]=n,f[R+15]=O,f[R+16]=B,f[R+17]=G,f[R+18]=W,p[R+19]=n,f[R+20]=z,f[R+21]=Y,f[R+22]=H,f[R+23]=j,p[R+24]=n,f[R+25]=X,f[R+26]=N,f[R+27]=H,f[R+28]=W,p[R+29]=n,this.vertexCount+=6,this.flush()},batchGraphics:function(){}});t.exports=h},function(t,e){t.exports=function(t,e,i){var n;if(void 0===i&&(i=!0),e)"string"==typeof e?n=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(n=e);else if(t.parentElement)return t;return n||(n=document.body),i&&n.style&&(n.style.overflow="hidden"),n.appendChild(t),t}},function(t,e){var i,n="";t.exports={disable:function(t){return""===n&&(n=i(t)),n&&(t[n]=!1),t},enable:function(t){return""===n&&(n=i(t)),n&&(t[n]=!0),t},getPrefix:i=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i<e.length;i++){var n=e[i]+"mageSmoothingEnabled";if(n in t)return n}return null},isEnabled:function(t){return null!==n?t[n]:null}}},function(t,e,i){var n=i(285),s=i(283),r=i(281),o=i(280);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?o(t):n(t);case"number":return s(t);case"object":return r(t)}}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===n&&(n=3);var s=0;if(e+1>=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((s=e-t.length)/2);t=new Array(s-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e,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),r=i(5);t.exports=function(t,e,i){if(void 0===i&&(i=new r),e<=0||1<=e)return i.x=t.x,i.y=t.y,i;var n=s(t)*e;return.5<e?(n-=t.width+t.height)<=t.width?(i.x=t.right-n,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(n-t.width)):n<=t.width?(i.x=t.x+n,i.y=t.y):(i.x=t.right,i.y=t.y+(n-t.width)),i}},function(t,e,i){var n=i(5);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o,a){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o={}),void 0===a&&(a={}),this.name=t,this.firstgid=e,this.tileWidth=i,this.tileHeight=n,this.tileMargin=s,this.tileSpacing=r,this.tileProperties=o,this.tileData=a,this.image=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(t){return this.containsTileIndex(t)?this.tileProperties[t-this.firstgid]:null},getTileData:function(t){return this.containsTileIndex(t)?this.tileData[t-this.firstgid]:null},getTileCollisionGroup:function(t){var e=this.getTileData(t);return e&&e.objectgroup?e.objectgroup:null},containsTileIndex:function(t){return t>=this.firstgid&&t<this.firstgid+this.total},getTileTextureCoordinates:function(t){return this.containsTileIndex(t)?this.texCoordinates[t-this.firstgid]:null},setImage:function(t){return this.image=t,this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setTileSize:function(t,e){return void 0!==t&&(this.tileWidth=t),void 0!==e&&(this.tileHeight=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(t,e){return void 0!==t&&(this.tileMargin=t),void 0!==e&&(this.tileSpacing=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(t,e){var i=(e-2*this.tileMargin+this.tileSpacing)/(this.tileHeight+this.tileSpacing),n=(t-2*this.tileMargin+this.tileSpacing)/(this.tileWidth+this.tileSpacing);i%1==0&&n%1==0||console.warn("Tileset "+this.name+" image tile area is not an even multiple of tile size"),i=Math.floor(i),n=Math.floor(n),this.rows=i,this.columns=n,this.total=i*n,this.texCoordinates.length=0;for(var s=this.tileMargin,r=this.tileMargin,o=0;o<this.rows;o++){for(var a=0;a<this.columns;a++)this.texCoordinates.push({x:s,y:r}),s+=this.tileWidth+this.tileSpacing;s=this.tileMargin,r+=this.tileHeight+this.tileSpacing}return this}});t.exports=n},function(t,e){t.exports=function(t,e,i){var n=i.baseTileHeight,s=i.tilemapLayer,r=0;return s&&(void 0===e&&(e=s.scene.cameras.main),r=s.y+e.scrollY*(1-s.scrollFactorY),n*=s.scaleY),r+t*n}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileWidth,s=i.tilemapLayer,r=0;return s&&(void 0===e&&(e=s.scene.cameras.main),r=s.x+e.scrollX*(1-s.scrollFactorX),n*=s.scaleX),r+t*n}},function(t,e,i){var r=i(105);t.exports=function(t,e,i,n){if(void 0===i&&(i=!1),r(t,e,n)){var s=n.data[e][t];return null===s?null:-1===s.index?i?s:null:s}return null}},function(t,e,i){t.exports={CalculateFacesAt:i(220),CalculateFacesWithin:i(40),Copy:i(667),CreateFromTiles:i(666),CullTiles:i(665),Fill:i(664),FilterTiles:i(663),FindByIndex:i(662),FindTile:i(661),ForEachTile:i(660),GetTileAt:i(140),GetTileAtWorldXY:i(659),GetTilesWithin:i(21),GetTilesWithinShape:i(658),GetTilesWithinWorldXY:i(657),HasTileAt:i(321),HasTileAtWorldXY:i(656),IsInLayerBounds:i(105),PutTileAt:i(219),PutTileAtWorldXY:i(655),PutTilesAt:i(654),Randomize:i(653),RemoveTileAt:i(320),RemoveTileAtWorldXY:i(652),RenderDebug:i(651),ReplaceByIndex:i(322),SetCollision:i(650),SetCollisionBetween:i(649),SetCollisionByExclusion:i(648),SetCollisionByProperty:i(647),SetCollisionFromCollisionGroup:i(646),SetTileIndexCallback:i(645),SetTileLocationCallback:i(644),Shuffle:i(643),SwapByIndex:i(642),TileToWorldX:i(139),TileToWorldXY:i(641),TileToWorldY:i(138),WeightedRandomize:i(640),WorldToTileX:i(53),WorldToTileXY:i(639),WorldToTileY:i(52)}},function(t,e,i){var n=i(0),s=i(343),r=i(34),o=new n({Extends:r,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Size,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t,e,i,n,s),this.body=null}});t.exports=o},function(t,e,i){var n=i(0),s=i(18),a=i(19),r=i(7),h=i(1),l=i(8),o=i(270),u=new n({Extends:a,initialize:function(t,e,i,n){var s="xml";if(l(e)){var r=e;e=h(r,"key"),i=h(r,"url"),n=h(r,"xhrSettings"),s=h(r,"extension",s)}var o={type:"xml",cache:t.cacheManager.xml,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};a.call(this,t,o)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=o(this.xhrLoader.responseText),this.data?this.onProcessComplete():(console.warn("Invalid XMLFile: "+this.key),this.onProcessError())}});r.register("xml",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new u(this,t[n]));else this.addFile(new u(this,t,e,i));return this}),t.exports=u},function(t,e,i){var p=i(5);t.exports=function(t,e,i){void 0===i&&(i=new p);var n=t.x1,s=t.y1,r=t.x2,o=t.y2,a=e.x1,h=e.y1,l=e.x2,u=e.y2,c=(u-h)*(r-n)-(l-a)*(o-s);if(0===c)return!1;var d=((l-a)*(s-h)-(u-h)*(n-a))/c,f=((r-n)*(s-h)-(o-s)*(n-a))/c;return 0<=d&&d<=1&&0<=f&&f<=1&&(i.x=n+d*(r-n),i.y=s+d*(o-s),!0)}},function(t,e,i){var n=i(0),s=i(15),c=i(2),r=i(862),o=new n({Extends:c,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.Size,s.Texture,s.Transform,s.Visible,s.ScrollFactor,r],initialize:function(t,e,i,n,s,r,o,a,h){if(c.call(this,t,"Mesh"),this.setTexture(a,h),this.setPosition(e,i),this.setSizeToFrame(),this.setOrigin(),this.initPipeline("TextureTintPipeline"),n.length!==s.length)throw new Error("Mesh Vertex count must match UV count");var l,u=n.length/2|0;if(0<r.length&&r.length<u)throw new Error("Mesh Color count must match Vertex count");if(0<o.length&&o.length<u)throw new Error("Mesh Alpha count must match Vertex count");if(0===r.length)for(l=0;l<u;++l)r[l]=16777215;if(0===o.length)for(l=0;l<u;++l)o[l]=1;this.vertices=new Float32Array(n),this.uv=new Float32Array(s),this.colors=new Uint32Array(r),this.alphas=new Float32Array(o)}});t.exports=o},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return void 0===t[n]?null:t[n]}},function(t,e,i){t.exports={Matrix:i(503),Add:i(496),AddAt:i(495),BringToTop:i(494),CountAllMatching:i(493),Each:i(492),EachInRange:i(491),FindClosestInSorted:i(209),GetAll:i(490),GetFirst:i(489),GetRandom:i(146),MoveDown:i(488),MoveTo:i(487),MoveUp:i(486),NumberArray:i(485),NumberArrayStep:i(484),QuickSelect:i(180),Range:i(254),Remove:i(195),RemoveAt:i(483),RemoveBetween:i(482),RemoveRandomElement:i(481),Replace:i(480),RotateLeft:i(290),RotateRight:i(289),SafeRange:i(29),SendToBack:i(479),SetAll:i(478),Shuffle:i(95),SpliceOne:i(56),StableSort:i(83),Swap:i(477)}},function(t,e,i){var n=i(0),s=i(527),r=i(129),o=new n({Extends:r,initialize:function(t){t.fragShader=s.replace("%LIGHT_COUNT%",10..toString()),r.call(this,t)},onBind:function(){r.prototype.onBind.call(this);var t=this.renderer,e=this.program;return this.mvpUpdate(),t.setInt1(e,"uNormSampler",1),t.setFloat2(e,"uResolution",this.width,this.height),this},onRender:function(t,e){this.active=!1;var i=t.sys.lights;if(!i||i.lights.length<=0||!i.active)return this;var n=i.cull(e),s=Math.min(n.length,10);if(0===s)return this;this.active=!0;var r,o=this.renderer,a=this.program,h=e.matrix,l={x:0,y:0},u=o.height;for(r=0;r<10;++r)o.setFloat1(a,"uLights["+r+"].radius",0);for(o.setFloat4(a,"uCamera",e.x,e.y,e.rotation,e.zoom),o.setFloat3(a,"uAmbientLightColor",i.ambientColor.r,i.ambientColor.g,i.ambientColor.b),r=0;r<s;++r){var c=n[r],d="uLights["+r+"].";h.transformPoint(c.x,c.y,l),o.setFloat2(a,d+"position",l.x-e.scrollX*c.scrollFactorX*e.zoom,u-(l.y-e.scrollY*c.scrollFactorY*e.zoom)),o.setFloat3(a,d+"color",c.r,c.g,c.b),o.setFloat1(a,d+"intensity",c.intensity),o.setFloat1(a,d+"radius",c.radius)}return this},drawStaticTilemapLayer:function(t,e,i){if(this.active){var n=t.tileset.image.dataSource[0];n?(this.renderer.setPipeline(this),this.setTexture2D(n.glTexture,1),r.prototype.drawStaticTilemapLayer.call(this,t,e,i)):(console.warn("Normal map texture missing for using Light2D pipeline. StaticTilemapLayer rendered with default pipeline."),this.renderer.pipelines.TextureTintPipeline.drawStaticTilemapLayer(t,e,i))}},drawEmitterManager:function(t,e,i){if(this.active){var n=t.texture.dataSource[t.frame.sourceIndex];n?(this.renderer.setPipeline(this),this.setTexture2D(n.glTexture,1),r.prototype.drawEmitterManager.call(this,t,e,i)):(console.warn("Normal map texture missing for using Light2D pipeline. EmitterManager rendered with default pipeline."),this.renderer.pipelines.TextureTintPipeline.drawEmitterManager(t,e,i))}},drawBlitter:function(t,e,i){if(this.active){var n=t.texture.dataSource[t.frame.sourceIndex];n?(this.renderer.setPipeline(this),this.setTexture2D(n.glTexture,1),r.prototype.drawBlitter.call(this,t,e,i)):(console.warn("Normal map texture missing for using Light2D pipeline. Blitter rendered with default pipeline."),this.renderer.pipelines.TextureTintPipeline.drawBlitter(t,e,i))}},batchSprite:function(t,e,i){if(this.active){var n=t.texture.dataSource[t.frame.sourceIndex];n?(this.renderer.setPipeline(this),this.setTexture2D(n.glTexture,1),r.prototype.batchSprite.call(this,t,e,i)):(console.warn("Normal map texture missing for using Light2D pipeline. Sprite rendered with default pipeline."),this.renderer.pipelines.TextureTintPipeline.batchSprite(t,e,i))}},batchMesh:function(t,e,i){if(this.active){var n=t.texture.dataSource[t.frame.sourceIndex];n?(this.renderer.setPipeline(this),this.setTexture2D(n.glTexture,1),r.prototype.batchMesh.call(this,t,e,i)):(console.warn("Normal map texture missing for using Light2D pipeline. Mesh rendered with default pipeline."),this.renderer.pipelines.TextureTintPipeline.batchMesh(t,e,i))}},batchBitmapText:function(t,e,i){if(this.active){var n=t.texture.dataSource[t.frame.sourceIndex];n?(this.renderer.setPipeline(this),this.setTexture2D(n.glTexture,1),r.prototype.batchBitmapText.call(this,t,e,i)):(console.warn("Normal map texture missing for using Light2D pipeline. BitmapText rendered with default pipeline."),this.renderer.pipelines.TextureTintPipeline.batchBitmapText(t,e,i))}},batchDynamicBitmapText:function(t,e,i){var n=t.texture.dataSource[t.frame.sourceIndex];n?(this.renderer.setPipeline(this),this.setTexture2D(n.glTexture,1),r.prototype.batchDynamicBitmapText.call(this,t,e,i)):(console.warn("Normal map texture missing for using Light2D pipeline. DynamicBitmapText rendered with default pipeline."),this.renderer.pipelines.TextureTintPipeline.batchDynamicBitmapText(t,e,i))},batchText:function(t,e,i){if(this.active){var n=t.texture.dataSource[t.frame.sourceIndex];n?(this.renderer.setPipeline(this),this.setTexture2D(n.glTexture,1),r.prototype.batchText.call(this,t,e,i)):(console.warn("Normal map texture missing for using Light2D pipeline. Text rendered with default pipeline."),this.renderer.pipelines.TextureTintPipeline.batchText(t,e,i))}},batchDynamicTilemapLayer:function(t,e,i){if(this.active){var n=t.tileset.image.dataSource[0];n?(this.renderer.setPipeline(this),this.setTexture2D(n.glTexture,1),r.prototype.batchDynamicTilemapLayer.call(this,t,e,i)):(console.warn("Normal map texture missing for using Light2D pipeline. DynamicTilemapLayer rendered with default pipeline."),this.renderer.pipelines.TextureTintPipeline.batchDynamicTilemapLayer(t,e,i))}},batchTileSprite:function(t,e,i){if(this.active){var n=t.texture.dataSource[t.frame.sourceIndex];n?(this.renderer.setPipeline(this),this.setTexture2D(n.glTexture,1),r.prototype.batchTileSprite.call(this,t,e,i)):(console.warn("Normal map texture missing for using Light2D pipeline. TileSprite rendered with default pipeline."),this.renderer.pipelines.TextureTintPipeline.batchTileSprite(t,e,i))}}});o.LIGHT_COUNT=10,t.exports=o},function(t,e){t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},function(t,e,i){var n=i(16);t.exports=function(t){return t*n.RAD_TO_DEG}},function(t,e,i){var n=i(0),o=i(2),a=i(34),h=i(6),l=i(277),s=new n({Extends:o,initialize:function(t,e,i,n,s,r){o.call(this,t,"Sprite3D"),this.gameObject=new a(t,0,0,s,r),this.position=new l(e,i,n),this.size=new h(this.gameObject.width,this.gameObject.height),this.scale=new h(1,1),this.adjustScaleX=!0,this.adjustScaleY=!0,this._visible=!0},project:function(t){var e=this.position,i=this.gameObject;t.project(e,i),t.getPointSize(e,this.size,this.scale),this.scale.x<=0||this.scale.y<=0?i.setVisible(!1):(i.visible||i.setVisible(!0),this.adjustScaleX&&(i.scaleX=this.scale.x),this.adjustScaleY&&(i.scaleY=this.scale.y),i.setDepth(-1*i.z))},setVisible:function(t){return this.visible=t,this},visible:{get:function(){return this._visible},set:function(t){this._visible=t,this.gameObject.visible=t}},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},z:{get:function(){return this.position.z},set:function(t){this.position.z=t}}});t.exports=s},function(t,e){t.exports=function(t,e,i){return t<<16|e<<8|i}},function(t,e,i){var h=i(5);t.exports=function(t,e){void 0===e&&(e=new h);var i=t.x2-t.x1,n=t.y2-t.y1,s=t.x3-t.x1,r=t.y3-t.y1,o=Math.random(),a=Math.random();return 1<=o+a&&(o=1-o,a=1-a),e.x=t.x1+(i*o+s*a),e.y=t.y1+(n*o+r*a),e}},function(t,e,i){var n=i(5);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},function(t,e,i){var n=i(5);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},function(t,e,i){var d=i(71),f=i(5);t.exports=function(t,e,i,n){void 0===n&&(n=[]),e||(e=d(t)/i);for(var s=t.x1,r=t.y1,o=t.x2,a=t.y2,h=0;h<e;h++){var l=h/e,u=s+(o-s)*l,c=r+(a-r)*l;n.push(new f(u,c))}return n}},function(t,e,i){var a=i(5);t.exports=function(t,e){void 0===e&&(e=new a);var i=2*Math.PI*Math.random(),n=Math.random()+Math.random(),s=1<n?2-n:n,r=s*Math.cos(i),o=s*Math.sin(i);return e.x=t.x+r*t.radius,e.y=t.y+o*t.radius,e}},function(t,e,i){var r=i(51),n=i(88),s=i(32),o=i(0),a=i(15),h=i(2),l=i(14),u=i(31),c=new o({Extends:h,Mixins:[a.Depth,a.GetBounds,a.Origin,a.ScaleMode,a.Transform,a.ScrollFactor,a.Visible],initialize:function(t,e,i,n,s){void 0===n&&(n=1),void 0===s&&(s=n),h.call(this,t,"Zone"),this.setPosition(e,i),this.width=n,this.height=s,this.blendMode=r.NORMAL},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,i){return void 0===i&&(i=!0),this.width=t,this.height=e,i&&this.input&&this.input.hitArea instanceof l&&(this.input.hitArea.width=t,this.input.hitArea.height=e),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},setCircleDropZone:function(t){return this.setDropZone(new n(0,0,t),s)},setRectangleDropZone:function(t,e){var i=-t/2,n=-e/2;return this.setDropZone(new l(i,n,t,e),u)},setDropZone:function(t,e){return void 0===t?this.setRectangleDropZone(this.width,this.height):this.input||this.setInteractive(t,e,!0),this},renderCanvas:function(){},renderWebGL:function(){}});t.exports=c},function(t,e,i){var n=i(0),s=i(9),r=i(72),a=i(61),o=new n({Extends:s,initialize:function(t){s.call(this),this.manager=t,this.isTimeline=!0,this.data=[],this.totalData=0,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=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],n=parseFloat(t.substr(2)),s=e;switch(i){case"+":s+=n;break;case"-":s-=n}return Math.max(0,s)},calcDuration:function(){for(var t=0,e=0,i=0,n=0;n<this.totalData;n++){var s=this.data[n];s.init(),this.hasOffset(s)?this.isOffsetAbsolute(s.offset)?(s.calculatedOffset=s.offset,0===s.offset&&(i=0)):this.isOffsetRelative(s.offset)&&(s.calculatedOffset=this.getRelativeOffset(s.offset,t)):s.calculatedOffset=i,t=s.totalDuration+s.calculatedOffset,e+=s.totalDuration,i+=s.totalDuration}this.duration=e,this.loopCounter=-1===this.loop?999999999999:this.loop,0<this.loopCounter?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=a.PAUSED,!1)},resetTweens:function(t){for(var e=0;e<this.totalData;e++){this.data[e].play(t)}},setCallback:function(t,e,i,n){return-1!==o.TYPES.indexOf(t)&&(this.callbacks[t]={func:e,scope:n,params:i}),this},makeActive:function(t){return this.manager.makeActive(t)},play:function(){if(this.state!==a.ACTIVE){if(this.paused)return this.paused=!1,void this.manager.makeActive(this);this.resetTweens(!1),this.state=a.ACTIVE;var t=this.callbacks.onStart;t&&t.func.apply(t.scope,t.params),this.emit("start",this)}},nextState:function(){if(0<this.loopCounter){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),0<this.loopDelay?(this.countdown=this.loopDelay,this.state=a.LOOP_DELAY):this.state=a.ACTIVE}else if(0<this.completeDelay)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 n=this.totalData,s=0;s<this.totalData;s++){this.data[s].update(t,i)&&n--}var r=this.callbacks.onUpdate;r&&r.func.apply(r.scope,r.params),this.emit("update",this),0===n&&this.nextState();break;case a.LOOP_DELAY:this.countdown-=e,this.countdown<=0&&(this.state=a.ACTIVE);break;case a.COMPLETE_DELAY:if(this.countdown-=e,this.countdown<=0){var o=this.callbacks.onComplete;o&&o.func.apply(o.scope,o.params),this.emit("complete",this),this.state=a.PENDING_REMOVE}}return this.state===a.PENDING_REMOVE}},stop:function(){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.emit("pause",this),this},resume:function(){return this.state===a.PAUSED&&(this.paused=!1,this.state=this._pausedState),this.emit("resume",this),this},hasTarget:function(t){for(var e=0;e<this.data.length;e++)if(this.data[e].hasTarget(t))return!0;return!1},destroy:function(){for(var t=0;t<this.data.length;t++)this.data[t].stop()}});o.TYPES=["onStart","onUpdate","onLoop","onComplete","onYoyo"],t.exports=o},function(t,e,i){var A=i(33),C=i(100),M=i(10),_=i(62),E=i(63),P=i(73),k=i(102),L=i(162),F=i(4),R=i(159),O=i(72);t.exports=function(t,e){var i=new R(t),n=L(e);if(0===n.length)return i.paused=!0,i;var s=A(C);s.targets=k(e);var r=M(e,"totalDuration",0);s.duration=0<r?Math.floor(r/n.length):P(e,"duration",s.duration),s.delay=P(e,"delay",s.delay),s.easeParams=F(e,"easeParams",s.easeParams),s.ease=E(F(e,"ease",s.ease),s.easeParams),s.hold=P(e,"hold",s.hold),s.repeat=P(e,"repeat",s.repeat),s.repeatDelay=P(e,"repeatDelay",s.repeatDelay),s.yoyo=_(e,"yoyo",s.yoyo),s.flipX=_(e,"flipX",s.flipX),s.flipY=_(e,"flipY",s.flipY);for(var o=0;o<n.length;o++)i.queue(O(i,n[o],s));i.completeDelay=M(e,"completeDelay",0),i.loop=Math.round(M(e,"loop",0)),i.loopDelay=Math.round(M(e,"loopDelay",0)),i.paused=_(e,"paused",!1),i.useFrames=_(e,"useFrames",!1);var a=F(e,"callbackScope",i),h=[i],l=F(e,"onStart",!1);if(l){var u=F(e,"onStartScope",a),c=F(e,"onStartParams",[]);i.setCallback("onStart",l,h.concat(c),u)}var d=F(e,"onUpdate",!1);if(d){var f=F(e,"onUpdateScope",a),p=F(e,"onUpdateParams",[]);i.setCallback("onUpdate",d,h.concat(p),f)}var g=F(e,"onLoop",!1);if(g){var v=F(e,"onLoopScope",a),y=F(e,"onLoopParams",[]);i.setCallback("onLoop",g,h.concat(y),v)}var m=F(e,"onYoyo",!1);if(m){var x=F(e,"onYoyoScope",a),w=F(e,"onYoyoParams",[]);i.setCallback("onYoyo",m,h.concat(null,w),x)}var b=F(e,"onComplete",!1);if(b){var T=F(e,"onCompleteScope",a),S=F(e,"onCompleteParams",[]);i.setCallback("onComplete",b,h.concat(S),T)}return i}},function(t,e,i){var M=i(100),_=i(10),E=i(62),P=i(63),k=i(73),L=i(4),F=i(101),R=i(99),O=i(98);t.exports=function(t,e,i){void 0===i&&(i=M);var n=L(e,"from",0),s=L(e,"to",1),r=[{value:n}],o=k(e,"delay",i.delay),a=k(e,"duration",i.duration),h=L(e,"easeParams",i.easeParams),l=P(L(e,"ease",i.ease),h),u=k(e,"hold",i.hold),c=k(e,"repeat",i.repeat),d=k(e,"repeatDelay",i.repeatDelay),f=E(e,"yoyo",i.yoyo),p=[],g=F("value",s),v=O(r[0],"value",g.getEnd,g.getStart,l,o,a,f,u,c,d,!1,!1);v.start=n,v.current=n,v.to=s,p.push(v);var y=new R(t,p,r);y.offset=_(e,"offset",null),y.completeDelay=_(e,"completeDelay",0),y.loop=Math.round(_(e,"loop",0)),y.loopDelay=Math.round(_(e,"loopDelay",0)),y.paused=E(e,"paused",!1),y.useFrames=E(e,"useFrames",!1);for(var m=L(e,"callbackScope",y),x=[y,null],w=R.TYPES,b=0;b<w.length;b++){var T=w[b],S=L(e,T,!1);if(S){var A=L(e,T+"Scope",m),C=L(e,T+"Params",[]);y.setCallback(T,S,x.concat(C),A)}}return y}},function(t,e,i){var n=i(4);t.exports=function(t){var e=n(t,"tweens",null);return null===e?[]:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},function(t,e,i){var n=i(304);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substr(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===n.indexOf(e)&&"_"!==e.substr(0,1)&&i.push({key:e,value:t[e]});return i}},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(t){this.delay=0,this.repeat=0,this.repeatCount=0,this.loop=!1,this.callback,this.callbackScope,this.args,this.timeScale=1,this.startAt=0,this.elapsed=0,this.paused=!1,this.hasDispatched=!1,this.reset(t)},reset:function(t){return this.delay=s(t,"delay",0),this.repeat=s(t,"repeat",0),this.loop=s(t,"loop",!1),this.callback=s(t,"callback",void 0),this.callbackScope=s(t,"callbackScope",this.callback),this.args=s(t,"args",[]),this.timeScale=s(t,"timeScale",1),this.startAt=s(t,"startAt",0),this.paused=s(t,"paused",!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=-1===this.repeat||this.loop?999999999999:this.repeat,this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(0<this.repeat){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},function(t,e,i){var n=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=n},function(t,e,i){var p={};t.exports=p;var C=i(126),M=i(41),_=i(74),E=i(125),P=i(106),k=i(1017);p.rectangle=function(t,e,i,n,s){s=s||{};var r={label:"Rectangle Body",position:{x:t,y:e},vertices:C.fromPath("L 0 0 L "+i+" 0 L "+i+" "+n+" L 0 "+n)};if(s.chamfer){var o=s.chamfer;r.vertices=C.chamfer(r.vertices,o.radius,o.quality,o.qualityMin,o.qualityMax),delete s.chamfer}return _.create(M.extend({},r,s))},p.trapezoid=function(t,e,i,n,s,r){r=r||{};var o,a=i*(s*=.5),h=a+(1-2*s)*i,l=h+a;o=s<.5?"L 0 0 L "+a+" "+-n+" L "+h+" "+-n+" L "+l+" 0":"L 0 0 L "+h+" "+-n+" L "+l+" 0";var u={label:"Trapezoid Body",position:{x:t,y:e},vertices:C.fromPath(o)};if(r.chamfer){var c=r.chamfer;u.vertices=C.chamfer(u.vertices,c.radius,c.quality,c.qualityMin,c.qualityMax),delete r.chamfer}return _.create(M.extend({},u,r))},p.circle=function(t,e,i,n,s){n=n||{};var r={label:"Circle Body",circleRadius:i};s=s||25;var o=Math.ceil(Math.max(10,Math.min(s,i)));return o%2==1&&(o+=1),p.polygon(t,e,o,i,M.extend({},r,n))},p.polygon=function(t,e,i,n,s){if(s=s||{},i<3)return p.circle(t,e,n,s);for(var r=2*Math.PI/i,o="",a=.5*r,h=0;h<i;h+=1){var l=a+h*r,u=Math.cos(l)*n,c=Math.sin(l)*n;o+="L "+u.toFixed(3)+" "+c.toFixed(3)+" "}var d={label:"Polygon Body",position:{x:t,y:e},vertices:C.fromPath(o)};if(s.chamfer){var f=s.chamfer;d.vertices=C.chamfer(d.vertices,f.radius,f.quality,f.qualityMin,f.qualityMax),delete s.chamfer}return _.create(M.extend({},d,s))},p.fromVertices=function(t,e,i,n,s,r,o){var a,h,l,u,c,d,f,p,g;for(n=n||{},h=[],s=void 0!==s&&s,r=void 0!==r?r:.01,o=void 0!==o?o:10,k||M.warn("Bodies.fromVertices: poly-decomp.js required. Could not decompose vertices. Fallback to convex hull."),M.isArray(i[0])||(i=[i]),p=0;p<i.length;p+=1)if(u=i[p],(l=C.isConvex(u))||!k)u=l?C.clockwiseSort(u):C.hull(u),h.push({position:{x:t,y:e},vertices:u});else{var v=u.map(function(t){return[t.x,t.y]});k.makeCCW(v),!1!==r&&k.removeCollinearPoints(v,r);var y=k.quickDecomp(v);for(c=0;c<y.length;c++){var m=y[c].map(function(t){return{x:t[0],y:t[1]}});0<o&&C.area(m)<o||h.push({position:C.centre(m),vertices:m})}}for(c=0;c<h.length;c++)h[c]=_.create(M.extend(h[c],n));if(s)for(c=0;c<h.length;c++){var x=h[c];for(d=c+1;d<h.length;d++){var w=h[d];if(E.overlaps(x.bounds,w.bounds)){var b=x.vertices,T=w.vertices;for(f=0;f<x.vertices.length;f++)for(g=0;g<w.vertices.length;g++){var S=P.magnitudeSquared(P.sub(b[(f+1)%b.length],T[g])),A=P.magnitudeSquared(P.sub(b[f],T[(g+1)%T.length]));S<5&&A<5&&(b[f].isInternal=!0,T[g].isInternal=!0)}}}}return 1<h.length?(a=_.create(M.extend({parts:h.slice(0)},n)),_.setPosition(a,{x:t,y:e}),a):h[0]}},function(t,e,i){var n=i(0),o=i(19),a=i(1),s=i(108),h=i(8),r=new n({Extends:o,initialize:function(t,e,i,n){if(h(e)){var s=e;e=a(s,"key"),n=a(s,"config",n)}var r={type:"audio",cache:t.cacheManager.audio,extension:i.type,key:e,url:i.url,config:n};o.call(this,t,r),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<this.data.length;t++){var e=this.data[t];e.oncanplaythrough=null,e.onerror=null}this.loader.nextFile(this,!1)},onProgress:function(t){var e=t.target;e.oncanplaythrough=null,e.onerror=null,this.filesLoaded++,this.percentComplete=Math.min(this.filesLoaded/this.filesTotal,1),this.loader.emit("fileprogress",this,this.percentComplete),this.filesLoaded===this.filesTotal&&this.onLoad()},load:function(){this.data=[];var t=this.config&&this.config.instances||1;this.filesTotal=t,this.filesLoaded=0;for(var e=this.percentComplete=0;e<t;e++){var i=new Audio;i.dataset.name=this.key+("0"+e).slice(-2),i.dataset.used="false",this.locked?i.dataset.locked="true":(i.dataset.locked="false",i.preload="auto",i.oncanplaythrough=this.onProgress.bind(this),i.onerror=this.onError.bind(this)),this.data.push(i)}for(e=0;e<this.data.length;e++)(i=this.data[e]).src=s(this,this.loader.baseURL),this.locked||i.load();this.locked&&setTimeout(this.onLoad.bind(this))}});t.exports=r},function(t,e,i){var n=i(0),s=i(20),a=i(19),r=i(7),l=i(1),u=i(167),c=i(8),d=new n({Extends:a,initialize:function(t,e,i,n,s){if(c(e)){var r=e;e=l(r,"key"),n=l(r,"xhrSettings"),s=l(r,"context",s)}var o={type:"audio",cache:t.cacheManager.audio,extension:i.type,responseType:"arraybuffer",key:e,url:i.url,xhrSettings:n,config:{context:s}};a.call(this,t,o)},onProcess:function(){this.state=s.FILE_PROCESSING;var e=this;this.config.context.decodeAudioData(this.xhrLoader.response,function(t){e.data=t,e.onProcessComplete()},function(t){console.error("Error decoding audio: "+this.key+" - ",t.message),e.onProcessError()}),this.config.context=null}});d.create=function(t,e,i,n,s){var r=t.systems.game,o=r.config.audio,a=r.device.audio;c(e)&&(i=l(e,"url",[]),n=l(e,"config",{}));var h=d.getAudioURL(r,i);return h?!a.webAudio||o&&o.disableWebAudio?new u(t,e,h,n):new d(t,e,h,s,r.sound.context):null},d.getAudioURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++){var n=l(e[i],"url",e[i]);if(0===n.indexOf("blob:")||0===n.indexOf("data:"))return n;var s=n.match(/\.([a-zA-Z0-9]+)($|\?)/);if(s=l(e[i],"type",s?s[1]:"").toLowerCase(),t.device.audio[s])return{url:n,type:s}}return null},r.register("audio",function(t,e,i,n){var s,r=this.systems.game,o=r.config.audio,a=r.device.audio;if(o&&o.noAudio||!a.webAudio&&!a.audioData)return this;if(Array.isArray(t))for(var h=0;h<t.length;h++)(s=d.create(this,t[h]))&&this.addFile(s);else(s=d.create(this,t,e,i,n))&&this.addFile(s);return this}),t.exports=d},function(t,e,i){var s=i(107);t.exports=function(t,e){var i=s(e,t.xhrSettings),n=new XMLHttpRequest;return n.open("GET",t.src,i.async,i.user,i.password),n.responseType=t.xhrSettings.responseType,n.timeout=i.timeout,i.header&&i.headerValue&&n.setRequestHeader(i.header,i.headerValue),i.requestedWith&&n.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&n.overrideMimeType(i.overrideMimeType),n.onload=t.onLoad.bind(t,n),n.onerror=t.onError.bind(t),n.onprogress=t.onProgress.bind(t),n.send(),n}},function(t,e,i){var n=i(0),a=i(1),h=i(372),l=i(370),s=new n({initialize:function(t,e,i){if(void 0===i&&(i={}),e.length<2)return!1;this.manager=t,this.enabled=!0,this.keyCodes=[];for(var n=0;n<e.length;n++){var s=e[n];"string"==typeof s?this.keyCodes.push(s.toUpperCase().charCodeAt(0)):"number"==typeof s?this.keyCodes.push(s):s.hasOwnProperty("keyCode")&&this.keyCodes.push(s.keyCode)}this.current=this.keyCodes[0],this.index=0,this.size=this.keyCodes.length,this.timeLastMatched=0,this.matched=!1,this.timeMatched=0,this.resetOnWrongKey=a(i,"resetOnWrongKey",!0),this.maxKeyDelay=a(i,"maxKeyDelay",0),this.resetOnMatch=a(i,"resetOnMatch",!1),this.deleteOnMatch=a(i,"deleteOnMatch",!1);var r=this,o=function(t){!r.matched&&r.enabled&&(h(t,r)&&(r.manager.emit("keycombomatch",r,t),r.resetOnMatch?l(r):r.deleteOnMatch&&r.destroy()))};this.onKeyDown=o,this.manager.on("keydown",o)},progress:{get:function(){return this.index/this.size}},destroy:function(){this.enabled=!1,this.keyCodes=[],this.manager.off("keydown",this.onKeyDown),this.manager=null}});t.exports=s},function(t,e,i){var n=new(i(0))({initialize:function(t){this.keyCode=t,this.originalEvent=void 0,this.preventDefault=!0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.location=0,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1},reset:function(){return this.preventDefault=!0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1,this}});t.exports=n},function(t,e,i){var a=i(174),h=i(173),n=i(0),l=i(9),u=i(6),s=new n({Extends:l,initialize:function(t,e){l.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],n=0;n<e.buttons.length;n++)i.push(new h(this,n));this.buttons=i;var s=[];for(n=0;n<e.axes.length;n++)s.push(new a(this,n));this.axes=s,this.vibration=e.vibrationActuator;var r={value:0,pressed:!1};this._LCLeft=i[14]?i[14]:r,this._LCRight=i[15]?i[15]:r,this._LCTop=i[12]?i[12]:r,this._LCBottom=i[13]?i[13]:r,this._RCLeft=i[2]?i[2]:r,this._RCRight=i[1]?i[1]:r,this._RCTop=i[3]?i[3]:r,this._RCBottom=i[0]?i[0]:r,this._FBLeftTop=i[4]?i[4]:r,this._FBLeftBottom=i[6]?i[6]:r,this._FBRightTop=i[5]?i[5]:r,this._FBRightBottom=i[7]?i[7]:r;var o={value:0};this._HAxisLeft=s[0]?s[0]:o,this._VAxisLeft=s[1]?s[1]:o,this._HAxisRight=s[2]?s[2]:o,this._VAxisRight=s[3]?s[3]:o,this.leftStick=new u,this.rightStick=new u},getAxisTotal:function(){return this.axes.length},getAxisValue:function(t){return this.axes[t].getValue()},setAxisThreshold:function(t){for(var e=0;e<this.axes.length;e++)this.axes[e].threshold=t},getButtonTotal:function(){return this.buttons.length},getButtonValue:function(t){return this.buttons[t].value},isButtonDown:function(t){return this.buttons[t].pressed},update:function(t){var e,i=this.buttons,n=t.buttons,s=i.length;for(e=0;e<s;e++)i[e].update(n[e].value);var r=this.axes,o=t.axes;for(s=r.length,e=0;e<s;e++)r[e].update(o[e]);2<=s&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),4<=s&&this.rightStick.set(r[2].getValue(),r[3].getValue()))},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t<this.buttons.length;t++)this.buttons[t].destroy();for(t=0;t<this.axes.length;t++)this.axes[t].destroy();this.buttons=[],this.axes=[]},connected:{get:function(){return this.pad.connected}},timestamp:{get:function(){return this.pad.timestamp}},left:{get:function(){return this._LCLeft.pressed}},right:{get:function(){return this._LCRight.pressed}},up:{get:function(){return this._LCTop.pressed}},down:{get:function(){return this._LCBottom.pressed}},A:{get:function(){return this._RCBottom.pressed}},Y:{get:function(){return this._RCTop.pressed}},X:{get:function(){return this._RCLeft.pressed}},B:{get:function(){return this._RCRight.pressed}},L1:{get:function(){return this._FBLeftTop.value}},L2:{get:function(){return this._FBLeftBottom.value}},R1:{get:function(){return this._FBRightTop.value}},R2:{get:function(){return this._FBRightBottom.value}}});t.exports=s},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.pad=t,this.events=t.manager,this.index=e,this.value=0,this.threshold=1,this.pressed=!1},update:function(t){this.value=t;var e=this.pad,i=this.index;t>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit("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=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value)<this.threshold?0:this.value},destroy:function(){this.pad=null,this.events=null}});t.exports=n},function(t,e){t.exports=function(t,e,i){return{gameObject:t,enabled:!0,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragX:0,dragY:0}}},function(t,e,i){var _=i(119),E=i(2);t.exports=function(t,e,i,n,s,r,o){if(!(E.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id)){var a=n.scrollX*e.scrollFactorX,h=n.scrollY*e.scrollFactorY,l=e.x,u=e.y,c=e.scaleX,d=e.scaleY,f=e.rotation,p=e.commandBuffer,g=r||t.currentContext,v=1,y=1,m=0,x=0,w=1,b=0,T=0,S=0;if(t.currentBlendMode!==e.blendMode&&(t.currentBlendMode=e.blendMode,g.globalCompositeOperation=t.blendModes[e.blendMode]),t.currentAlpha!==e.alpha&&(t.currentAlpha=e.alpha,g.globalAlpha=e.alpha),t.currentScaleMode!==e.scaleMode&&(t.currentScaleMode=e.scaleMode),g.save(),s){var A=s.matrix;g.transform(A[0],A[1],A[2],A[3],A[4],A[5])}g.translate(l-a,u-h),g.rotate(f),g.scale(c,d),g.fillStyle="#fff",g.globalAlpha=e.alpha;for(var C=0,M=p.length;C<M;++C)switch(p[C]){case _.ARC:g.arc(p[C+1],p[C+2],p[C+3],p[C+4],p[C+5],p[C+6]),C+=6;break;case _.LINE_STYLE:w=p[C+1],m=p[C+2],v=p[C+3],b=(16711680&m)>>>16,T=(65280&m)>>>8,S=255&m,g.strokeStyle="rgba("+b+","+T+","+S+","+v+")",g.lineWidth=w,C+=3;break;case _.FILL_STYLE:x=p[C+1],y=p[C+2],b=(16711680&x)>>>16,T=(65280&x)>>>8,S=255&x,g.fillStyle="rgba("+b+","+T+","+S+","+y+")",C+=2;break;case _.BEGIN_PATH:g.beginPath();break;case _.CLOSE_PATH:g.closePath();break;case _.FILL_PATH:o||g.fill();break;case _.STROKE_PATH:o||g.stroke();break;case _.FILL_RECT:o?g.rect(p[C+1],p[C+2],p[C+3],p[C+4]):g.fillRect(p[C+1],p[C+2],p[C+3],p[C+4]),C+=4;break;case _.FILL_TRIANGLE:g.beginPath(),g.moveTo(p[C+1],p[C+2]),g.lineTo(p[C+3],p[C+4]),g.lineTo(p[C+5],p[C+6]),g.closePath(),o||g.fill(),C+=6;break;case _.STROKE_TRIANGLE:g.beginPath(),g.moveTo(p[C+1],p[C+2]),g.lineTo(p[C+3],p[C+4]),g.lineTo(p[C+5],p[C+6]),g.closePath(),o||g.stroke(),C+=6;break;case _.LINE_TO:g.lineTo(p[C+1],p[C+2]),C+=2;break;case _.MOVE_TO:g.moveTo(p[C+1],p[C+2]),C+=2;break;case _.LINE_FX_TO:g.lineTo(p[C+1],p[C+2]),C+=5;break;case _.MOVE_FX_TO:g.moveTo(p[C+1],p[C+2]),C+=5;break;case _.SAVE:g.save();break;case _.RESTORE:g.restore();break;case _.TRANSLATE:g.translate(p[C+1],p[C+2]),C+=2;break;case _.SCALE:g.scale(p[C+1],p[C+2]),C+=2;break;case _.ROTATE:g.rotate(p[C+1]),C+=1}g.restore()}}},function(t,e){t.exports=function(t){var e=t.width/2,i=t.height/2,n=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*n/(10+Math.sqrt(4-3*n)))}},function(t,e,i){var o=i(177),a=i(113),h=i(65),l=i(16);t.exports=function(t,e,i,n){void 0===n&&(n=[]),e||(e=o(t)/i);for(var s=0;s<e;s++){var r=h(s/e,0,l.PI2);n.push(a(t,r))}return n}},function(t,e,i){var s=i(113),r=i(65),o=i(16),a=i(5);t.exports=function(t,e,i){void 0===i&&(i=new a);var n=r(e,0,o.PI2);return s(t,n,i)}},function(t,e){var g=function(t,e,i,n,s){for(i=i||0,n=n||t.length-1,s=s||y;i<n;){if(600<n-i){var r=n-i+1,o=e-i+1,a=Math.log(r),h=.5*Math.exp(2*a/3),l=.5*Math.sqrt(a*h*(r-h)/r)*(o-r/2<0?-1:1),u=Math.max(i,Math.floor(e-o*h/r+l)),c=Math.min(n,Math.floor(e+(r-o)*h/r+l));g(t,e,u,c,s)}var d=t[e],f=i,p=n;for(v(t,i,e),0<s(t[n],d)&&v(t,i,n);f<p;){for(v(t,f,p),f++,p--;s(t[f],d)<0;)f++;for(;0<s(t[p],d);)p--}0===s(t[i],d)?v(t,i,p):v(t,++p,n),p<=e&&(i=p+1),e<=p&&(n=p-1)}};function v(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function y(t,e){return t<e?-1:e<t?1:0}t.exports=g},function(t,e){t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),s=0;s<i;s++){n[s]=new Array(e);for(var r=e-1;-1<r;r--)n[s][r]=t[r][s]}return n}},function(t,e,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 n=i(22),s=i(0),r=i(85),o=i(59),a=new s({initialize:function(t,e,i,n){var s=t.manager.game;this.renderer=s.renderer,this.texture=t,this.image=e,this.compressionAlgorithm=null,this.resolution=1,this.width=i||e.naturalWidth||e.width||0,this.height=n||e.naturalHeight||e.height||0,this.scaleMode=o.DEFAULT,this.isCanvas=e instanceof HTMLCanvasElement,this.isPowerOf2=r(this.width,this.height),this.glTexture=null,this.init(s)},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&&n.remove(this.image),this.renderer=null,this.texture=null,this.image=null}});t.exports=a},function(t,e,i){var s=i(22),n=i(515),r=i(0),h=i(30),o=i(20),a=i(9),l=i(276),u=i(4),c=i(182),d=i(117),f=new r({Extends:a,initialize:function(t){a.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(e,t){if(this.checkKey(e)){var i=this,n=new Image;n.onerror=function(){i.emit("onerror",e)},n.onload=function(){var t=i.create(e,n);c.Image(t,0),i.emit("addtexture",e,t),i.emit("onload",e,t)},n.src=t}},addImage:function(t,e,i){var n=null;return this.checkKey(t)&&(n=this.create(t,e),c.Image(n,0),i&&n.setDataSource(i),this.emit("addtexture",t,n)),n},generate:function(t,e){if(this.checkKey(t)){var i=s.create(this,1,1);return e.canvas=i,l(e),this.addCanvas(t,i)}return null},createCanvas:function(t,e,i){if(void 0===e&&(e=256),void 0===i&&(i=256),this.checkKey(t)){var 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,n){return Array.isArray(i.textures)||Array.isArray(i.frames)?this.addAtlasJSONArray(t,e,i,n):this.addAtlasJSONHash(t,e,i,n)},addAtlasJSONArray:function(t,e,i,n){var s=null;if(this.checkKey(t)){if(s=this.create(t,e),Array.isArray(i))for(var r=1===i.length,o=0;o<s.source.length;o++){var a=r?i[0]:i[o];c.JSONArray(s,o,a)}else c.JSONArray(s,0,i);n&&s.setDataSource(n),this.emit("addtexture",t,s)}return s},addAtlasJSONHash:function(t,e,i,n){var s=null;if(this.checkKey(t)){if(s=this.create(t,e),Array.isArray(i))for(var r=0;r<i.length;r++)c.JSONHash(s,r,i[r]);else c.JSONHash(s,0,i);n&&s.setDataSource(n),this.emit("addtexture",t,s)}return s},addAtlasXML:function(t,e,i,n){var s=null;return this.checkKey(t)&&(s=this.create(t,e),c.AtlasXML(s,0,i),n&&s.setDataSource(n),this.emit("addtexture",t,s)),s},addUnityAtlas:function(t,e,i,n){var s=null;return this.checkKey(t)&&(s=this.create(t,e),c.UnityYAML(s,0,i),n&&s.setDataSource(n),this.emit("addtexture",t,s)),s},addSpriteSheet:function(t,e,i){var n=null;if(this.checkKey(t)){var s=(n=this.create(t,e)).source[0].width,r=n.source[0].height;c.SpriteSheet(n,0,0,0,s,r,i),this.emit("addtexture",t,n)}return n},addSpriteSheetFromAtlas:function(t,e){if(!this.checkKey(t))return null;var i=u(e,"atlas",null),n=u(e,"frame",null);if(i&&n){var s=this.get(i).get(n);if(s){var r=this.create(t,s.source.image);return s.trimmed?c.SpriteSheetFromAtlas(r,s,e):c.SpriteSheet(r,0,s.cutX,s.cutY,s.cutWidth,s.cutHeight,e),this.emit("addtexture",t,r),r}}},create:function(t,e,i,n){var s=null;return this.checkKey(t)&&(s=new d(this,t,e,i,n),this.list[t]=s),s},exists:function(t){return this.list.hasOwnProperty(t)},get:function(t){return void 0===t&&(t="__DEFAULT"),this.list[t]?this.list[t]:this.list.__MISSING},cloneFrame:function(t,e){if(this.list[t])return this.list[t].get(e).clone()},getFrame:function(t,e){if(this.list[t])return this.list[t].get(e)},getTextureKeys:function(){var t=[];for(var e in this.list)"__DEFAULT"!==e&&"__MISSING"!==e&&t.push(e);return t},getPixel:function(t,e,i,n){var s=this.getFrame(i,n);if(s){var r=s.source.image;if(0<=t&&t<=r.width&&0<=e&&e<=r.height){t+=s.cutX,e+=s.cutY;var o=this._tempContext;o.clearRect(0,0,1,1),o.drawImage(r,t,e,1,1,0,0,1,1);var a=o.getImageData(0,0,1,1);return new h(a.data[0],a.data[1],a.data[2],a.data[3])}}return null},getPixelAlpha:function(t,e,i,n){var s=this.getFrame(i,n);if(s){var r=s.source.image;if(0<=t&&t<=r.width&&0<=e&&e<=r.height){t+=s.cutX,e+=s.cutY;var o=this._tempContext;return o.clearRect(0,0,1,1),o.drawImage(r,t,e,1,1,0,0,1,1),o.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],n=1;n<arguments.length;n++)i.push(arguments[n]);for(var s in this.list)i[0]=this.list[s],t.apply(e,i)},destroy:function(){for(var t in this.list)this.list[t].destroy();this.list={},this.game=null,s.remove(this._tempCanvas)}});t.exports=f},function(t,e,i){var n=i(78),s=new(i(0))({Extends:n,initialize:function(t,e,i){void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),this.audioBuffer?(this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,n.call(this,t,e,i)):console.warn("Audio cache entry missing: "+e)},play:function(t,e){return!!n.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit("play",this),!0)},pause:function(){return!(this.manager.context.currentTime<this.startTime)&&(!!n.prototype.pause.call(this)&&(this.currentConfig.seek=this.getCurrentTime(),this.stopAndRemoveBufferSource(),this.emit("pause",this),!0))},resume:function(){return!(this.manager.context.currentTime<this.startTime)&&(!!n.prototype.resume.call(this)&&(this.createAndStartBufferSource(),this.emit("resume",this),!0))},stop:function(){return!!n.prototype.stop.call(this)&&(this.stopAndRemoveBufferSource(),this.emit("stop",this),!0)},createAndStartBufferSource:function(){var t=this.currentConfig.seek,e=this.currentConfig.delay,i=this.manager.context.currentTime+e,n=(this.currentMarker?this.currentMarker.start:0)+t,s=this.duration-t;this.playTime=i-t,this.startTime=i,this.source=this.createBufferSource(),this.applyConfig(),this.source.start(Math.max(0,i),Math.max(0,n),Math.max(0,s)),this.resetConfig()},createAndStartLoopBufferSource:function(){var t=this.getLoopTime(),e=this.currentMarker?this.currentMarker.start:0,i=this.duration;this.loopTime=t,this.loopSource=this.createBufferSource(),this.loopSource.playbackRate.setValueAtTime(this.totalRate,0),this.loopSource.start(Math.max(0,t),Math.max(0,e),Math.max(0,i))},createBufferSource:function(){var e=this,t=this.manager.context.createBufferSource();return t.buffer=this.audioBuffer,t.connect(this.muteNode),t.onended=function(t){t.target===e.source&&(e.currentConfig.loop?e.hasLooped=!0:e.hasEnded=!0)},t},stopAndRemoveBufferSource:function(){this.source&&(this.source.stop(),this.source.disconnect(),this.source=null),this.playTime=0,this.startTime=0,this.stopAndRemoveLoopBufferSource()},stopAndRemoveLoopBufferSource:function(){this.loopSource&&(this.loopSource.stop(),this.loopSource.disconnect(),this.loopSource=null),this.loopTime=0},applyConfig:function(){this.rateUpdates.length=0,this.rateUpdates.push({time:0,rate:1}),n.prototype.applyConfig.call(this)},update:function(t,e){this.hasEnded?(this.hasEnded=!1,n.prototype.stop.call(this),this.stopAndRemoveBufferSource(),this.emit("ended",this)):this.hasLooped&&(this.hasLooped=!1,this.source=this.loopSource,this.loopSource=null,this.playTime=this.startTime=this.loopTime,this.rateUpdates.length=0,this.rateUpdates.push({time:0,rate:this.totalRate}),this.createAndStartLoopBufferSource(),this.emit("looped",this))},destroy:function(){n.prototype.destroy.call(this),this.audioBuffer=null,this.stopAndRemoveBufferSource(),this.muteNode.disconnect(),this.muteNode=null,this.volumeNode.disconnect(),this.volumeNode=null,this.rateUpdates.length=0,this.rateUpdates=null},calculateRate:function(){n.prototype.calculateRate.call(this);var t=this.manager.context.currentTime;this.source&&"number"==typeof this.totalRate&&this.source.playbackRate.setValueAtTime(this.totalRate,t),this.isPlaying&&(this.rateUpdates.push({time:Math.max(this.startTime,t)-this.playTime,rate:this.totalRate}),this.loopSource&&(this.stopAndRemoveLoopBufferSource(),this.createAndStartLoopBufferSource()))},getCurrentTime:function(){for(var t=0,e=0;e<this.rateUpdates.length;e++){t+=((e<this.rateUpdates.length-1?this.rateUpdates[e+1].time:this.manager.context.currentTime-this.playTime)-this.rateUpdates[e].time)*this.rateUpdates[e].rate}return t},getLoopTime:function(){for(var t=0,e=0;e<this.rateUpdates.length-1;e++)t+=(this.rateUpdates[e+1].time-this.rateUpdates[e].time)*this.rateUpdates[e].rate;var i=this.rateUpdates[this.rateUpdates.length-1];return this.playTime+i.time+(this.duration-t)/i.rate},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.calculateRate(),this.emit("rate",this,t)}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.calculateRate(),this.emit("detune",this,t)}},setDetune:function(t){return this.detune=t,this},mute:{get:function(){return 0===this.muteNode.gain.value},set:function(t){this.currentConfig.mute=t,this.muteNode.gain.setValueAtTime(t?0:1,0),this.emit("mute",this,t)}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.volumeNode.gain.value},set:function(t){this.currentConfig.volume=t,this.volumeNode.gain.setValueAtTime(t,0),this.emit("volume",this,t)}},setVolume:function(t){return this.volume=t,this},seek:{get:function(){return this.isPlaying?this.manager.context.currentTime<this.startTime?this.startTime-this.playTime:this.getCurrentTime():this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.context.currentTime<this.startTime||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.currentConfig.seek=t,this.isPlaying&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource()),this.emit("seek",this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.isPlaying&&(this.stopAndRemoveLoopBufferSource(),t&&this.createAndStartLoopBufferSource()),this.emit("loop",this,t)}},setLoop:function(t){return this.loop=t,this}});t.exports=s},function(t,e,i){var n=i(79),s=i(0),r=i(185),o=new s({Extends:n,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),n.call(this,t),this.locked&&this.unlock()},createAudioContext:function(t){var e=t.config.audio;return e&&e.context?(e.context.resume(),e.context):new AudioContext},add:function(t,e){var i=new r(this,t,e);return this.sounds.push(i),i},unlock:function(){var t=this,e=function(){t.context.resume().then(function(){document.body.removeEventListener("touchstart",e),document.body.removeEventListener("touchend",e),document.body.removeEventListener("click",e),t.unlocked=!0})};document.body&&(document.body.addEventListener("touchstart",e,!1),document.body.addEventListener("touchend",e,!1),document.body.addEventListener("click",e,!1))},onBlur:function(){this.context.suspend()},onFocus:function(){this.context.resume()},destroy:function(){if(this.destination=null,this.masterVolumeNode.disconnect(),this.masterVolumeNode=null,this.masterMuteNode.disconnect(),this.masterMuteNode=null,this.game.config.audio&&this.game.config.audio.context)this.context.suspend();else{var t=this;this.context.close().then(function(){t.context=null})}n.prototype.destroy.call(this)},setMute:function(t){return this.mute=t,this},mute:{get:function(){return 0===this.masterMuteNode.gain.value},set:function(t){this.masterMuteNode.gain.setValueAtTime(t?0:1,0),this.emit("mute",this,t)}},setVolume:function(t){return this.volume=t,this},volume:{get:function(){return this.masterVolumeNode.gain.value},set:function(t){this.masterVolumeNode.gain.setValueAtTime(t,0),this.emit("volume",this,t)}}});t.exports=o},function(t,e,i){var n=i(78),s=i(0),r=i(9),o=i(17),a=new s({Extends:r,initialize:function(t,e,i){void 0===i&&(i={}),r.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=o({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!1},updateMarker:function(t){return!1},removeMarker:function(t){return null},play:function(t,e){return!1},pause:function(){return!1},resume:function(){return!1},stop:function(){return!1},destroy:function(){this.manager.remove(this),n.prototype.destroy.call(this)}});t.exports=a},function(t,e,i){var n=i(79),s=i(0),r=i(9),o=i(187),a=i(3),h=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return n.prototype.remove.call(this,t)},removeByKey:function(t){return n.prototype.removeByKey.call(this,t)},pauseAll:a,resumeAll:a,stopAll:a,update:a,setRate:a,setDetune:a,setMute:a,setVolume:a,forEachActiveSound:function(t,e){n.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){n.prototype.destroy.call(this)}});t.exports=h},function(t,e,i){var n=i(78),s=new(i(0))({Extends:n,initialize:function(t,e,i){void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),this.tags?(this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,n.call(this,t,e,i)):console.warn("Audio cache entry missing: "+e)},play:function(t,e){return!this.manager.isLocked(this,"play",[t,e])&&(!!n.prototype.play.call(this,t,e)&&(!!this.pickAndPlayAudioTag()&&(this.emit("play",this),!0)))},pause:function(){return!this.manager.isLocked(this,"pause")&&(!(0<this.startTime)&&(!!n.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit("pause",this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(0<this.startTime)&&(!!n.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit("resume",this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!n.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;t<this.tags.length;t++){var e=this.tags[t];if("false"===e.dataset.used)return e.dataset.used="true",this.audio=e,!0}if(!this.manager.override)return!1;var i=[];this.manager.forEachActiveSound(function(t){t.key===this.key&&t.audio&&i.push(t)},this),i.sort(function(t,e){return t.loop===e.loop?e.seek/e.duration-t.seek/t.duration:t.loop?1:-1});var n=i[0];return this.audio=n.audio,n.reset(),n.audio=null,n.startTime=0,!(n.previousTime=0)},playCatchPromise:function(){var t=this.audio.play();t&&t.catch(function(t){console.warn(t)})},stopAndReleaseAudioTag:function(){this.audio.pause(),this.audio.dataset.used="false",this.audio=null,this.startTime=0,this.previousTime=0},reset:function(){n.prototype.stop.call(this)},onBlur:function(){this.isPlaying=!1,this.isPaused=!0,this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.currentConfig.delay=Math.max(0,(this.startTime-window.performance.now())/1e3),this.stopAndReleaseAudioTag()},onFocus:function(){this.isPlaying=!0,this.isPaused=!1,this.pickAndPlayAudioTag()},update:function(t,e){if(this.isPlaying)if(0<this.startTime)this.startTime<t-this.manager.audioPlayDelay&&(this.audio.currentTime+=Math.max(0,t-this.startTime)/1e3,this.startTime=0,this.previousTime=this.audio.currentTime,this.playCatchPromise());else{var i=this.currentMarker?this.currentMarker.start:0,n=i+this.duration,s=this.audio.currentTime;if(this.currentConfig.loop)s>=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):s<i&&(this.audio.currentTime+=i,s=this.audio.currentTime),s<this.previousTime&&this.emit("looped",this);else if(n<=s)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit("ended",this);this.previousTime=s}},destroy:function(){n.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=this.currentConfig.volume*this.manager.volume)},calculateRate:function(){n.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||this.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)||0<this.startTime||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit("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=s},function(t,e,i){var n=i(79),s=i(0),r=i(189),o=new s({Extends:n,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,n.call(this,t)},add:function(t,e){var i=new r(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var n=this;if(this.game.cache.audio.entries.each(function(t,e){for(var i=0;i<e.length;i++)if("true"===e[i].dataset.locked)return!(n.locked=!0);return!0}),this.locked){var e=!1,i=function(){e=!0},r=function(){if(e)e=!1;else{document.body.removeEventListener("touchmove",i),document.body.removeEventListener("touchend",r);var s=[];if(n.game.cache.audio.entries.each(function(t,e){for(var i=0;i<e.length;i++){var n=e[i];"true"===n.dataset.locked&&s.push(n)}return!0}),0!==s.length){var t=s[s.length-1];t.oncanplaythrough=function(){t.oncanplaythrough=null,s.forEach(function(t){t.dataset.locked="false"}),n.unlocked=!0},s.forEach(function(t){t.load()})}}};this.once("unlocked",function(){for(this.forEachActiveSound(function(t){null===t.currentMarker&&0===t.duration&&(t.duration=t.tags[0].duration),t.totalDuration=t.tags[0].duration});this.lockedActionsQueue.length;){var t=this.lockedActionsQueue.shift();t.sound[t.prop].apply?t.sound[t.prop].apply(t.sound,t.value||[]):t.sound[t.prop]=t.value}},this),document.body.addEventListener("touchmove",i,!1),document.body.addEventListener("touchend",r,!1)}},onBlur:function(){this.forEachActiveSound(function(t){t.isPlaying&&(this.onBlurPausedSounds.push(t),t.onBlur())})},onFocus:function(){this.onBlurPausedSounds.forEach(function(t){t.onFocus()}),this.onBlurPausedSounds.length=0},destroy:function(){n.prototype.destroy.call(this),this.onBlurPausedSounds.length=0,this.onBlurPausedSounds=null},isLocked:function(t,e,i){return"true"===t.tags[0].dataset.locked&&(this.lockedActionsQueue.push({sound:t,prop:e,value:i}),!0)},setMute:function(t){return this.mute=t,this},mute:{get:function(){return this._mute},set:function(t){this._mute=t,this.forEachActiveSound(function(t){t.updateMute()}),this.emit("mute",this,t)}},setVolume:function(t){return this.volume=t,this},volume:{get:function(){return this._volume},set:function(t){this._volume=t,this.forEachActiveSound(function(t){t.updateVolume()}),this.emit("volume",this,t)}}});t.exports=o},function(t,e,i){var n=i(190),s=i(188),r=i(186),o={create:function(t){var e=t.config.audio,i=t.device.audio;return e&&e.noAudio||!i.webAudio&&!i.audioData?new s(t):!i.webAudio||e&&e.disableWebAudio?new n(t):new r(t)}};t.exports=o},function(t,e,i){var n=i(55),s=i(4),r=i(94),o=i(516),a={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:n.PENDING,key:s(t,"key",""),active:s(t,"active",!1),visible:s(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:s(t,"pack",!1),cameras:s(t,"cameras",null),map:s(t,"map",r(o,s(t,"mapAdd",{}))),physics:s(t,"physics",{}),loader:s(t,"loader",{}),plugins:s(t,"plugins",!1),input:s(t,"input",{})}}};t.exports=a},function(t,e,i){var n=i(0),s=i(118),r=new n({initialize:function(t){this.sys=new s(this,t),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.cameras3d,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.impact,this.matter},update:function(){}});t.exports=r},function(t,e,i){var n=i(0),r=i(55),l=i(4),s=i(3),u=i(193),o=i(118),a=new n({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this.scenesUpdated=[],this.scenesUpdatedKeys={},this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++)this._pending.push({key:"default",scene:e[i],autoStart:0===i,data:{}})}t.events.once("ready",this.bootQueue,this)},bootQueue:function(){if(!this.isBooted){var t,e,i,n;for(t=0;t<this._pending.length;t++){var s;i=(e=this._pending[t]).key,(n=e.scene)instanceof u?s=this.createSceneFromInstance(i,n):"object"==typeof n?s=this.createSceneFromObject(i,n):"function"==typeof n&&(s=this.createSceneFromFunction(i,n)),i=s.sys.settings.key,this.keys[i]=s,this.scenes.push(s),this._data[i]&&(s.sys.settings.data=this._data[i].data,this._data[i].autoStart&&(e.autoStart=!0)),(e.autoStart||s.sys.settings.active)&&this._start.push(i)}for(this._pending.length=0,this._data={},this.isBooted=!0,t=0;t<this._start.length;t++)e=this._start[t],this.start(e);this._start.length=0}},processQueue:function(){var t=this._pending.length,e=this._queue.length;if(0!==t||0!==e){var i,n;if(t){for(i=0;i<t;i++)n=this._pending[i],this.add(n.key,n.scene,n.autoStart,n.data);for(i=0;i<this._start.length;i++)n=this._start[i],this.start(n);return this._start.length=0,void(this._pending.length=0)}for(i=0;i<this._queue.length;i++)this[(n=this._queue[i]).op](n.keyA,n.keyB);this._queue.length=0}},add:function(t,e,i,n){return void 0===i&&(i=!1),void 0===n&&(n={}),this.isProcessing||!this.isBooted?(this._pending.push({key:t,scene:e,autoStart:i,data:n}),this.isBooted||(this._data[t]={data:n}),null):(t=this.getKey(t,e),e instanceof u?s=this.createSceneFromInstance(t,e):"object"==typeof e?(e.key=t,s=this.createSceneFromObject(t,e)):"function"==typeof e&&(s=this.createSceneFromFunction(t,e)),s.sys.settings.data=n,t=s.sys.settings.key,this.keys[t]=s,this.scenes.push(s),(i||s.sys.settings.active)&&(this._pending.length?this._start.push(t):this.start(t)),s);var s},remove:function(t){if(this.isProcessing)this._queue.push({op:"remove",keyA:t,keyB:null});else{var e=this.getScene(t);if(!e||e.sys.isTransitioning())return this;var i=this.scenes.indexOf(e),n=e.sys.settings.key;-1<i&&(delete this.keys[n],this.scenes.splice(i,1),-1<this._start.indexOf(n)&&(i=this._start.indexOf(n),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,n=i.settings;t.init&&(t.init.call(t,n.data),n.isTransition&&i.events.emit("transitioninit",n.transitionFrom,n.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),0===e.list.size?this.create(t):(n.status=r.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;0<=i;i--){(n=this.scenes[i].sys).settings.status>r.START&&n.settings.status<=r.RUNNING&&void 0===this.scenesUpdatedKeys[n.settings.key]&&n.step(t,e)}if(0<this.scenesUpdated.length){for(i=0;i<this.scenesUpdated.length;i++){var n;(n=this.scenesUpdated[i].sys).step(t,e)}this.scenesUpdated=[],this.scenesUpdatedKeys={}}},resize:function(t,e){for(var i=0;i<this.scenes.length;i++){this.scenes[i].sys.resize(t,e)}},render:function(t){for(var e=0;e<this.scenes.length;e++){var i=this.scenes[e].sys;i.settings.visible&&i.settings.status>=r.LOADING&&i.settings.status<r.SLEEPING&&i.render(t)}this.isProcessing=!1},create:function(t){var e=t.sys,i=e.settings;t.create&&(t.sys.settings.status=r.CREATING,t.create.call(t,t.sys.settings.data),i.isTransition&&(e.events.emit("transitionstart",i.transitionFrom,i.transitionDuration),this.scenesUpdatedKeys[t.sys.settings.key]=!0,this.scenesUpdated.push(t))),t.update&&(e.sceneUpdate=t.update),i.status=r.RUNNING},createSceneFromFunction:function(t,e){var i=new e;if(i instanceof u){var n=i.sys.settings.key;if(""!==n&&(t=n),this.keys.hasOwnProperty(t))throw new Error("Cannot add a Scene with duplicate key: "+t);return this.createSceneFromInstance(t,i)}return i.sys=new o(i),i.sys.settings.key=t,i.sys.init(this.game),i},createSceneFromInstance:function(t,e){var i=e.sys.settings.key;return""!==i?t=i:e.sys.settings.key=t,e.sys.init(this.game),e},createSceneFromObject:function(t,e){var i=new u(e),n=i.sys.settings.key;""!==n?t=n:i.sys.settings.key=t,i.sys.init(this.game);for(var s=["init","preload","create","update","render"],r=0;r<s.length;r++){var o=l(e,s[r],null);o&&(i[s[r]]=o)}if(e.hasOwnProperty("extend"))for(var a in e.extend){var h=e.extend[a];"data"===a&&i.hasOwnProperty("data")&&"object"==typeof h?i.data.merge(h):"sys"!==a&&(i[a]=h)}return i},getKey:function(t,e){if(t||(t="default"),"function"==typeof e)return t;if(e instanceof u?t=e.sys.settings.key:"object"==typeof e&&e.hasOwnProperty("key")&&(t=e.key),this.keys.hasOwnProperty(t))throw new Error("Cannot add a Scene with duplicate key: "+t);return t},getScene:function(t){if("string"==typeof t){if(this.keys[t])return this.keys[t]}else for(var e=0;e<this.scenes.length;e++)if(t===this.scenes[e])return t;return null},isActive:function(t){var e=this.getScene(t);return e?e.sys.isActive():null},isVisible:function(t){var e=this.getScene(t);return e?e.sys.isVisible():null},isSleeping:function(t){var e=this.getScene(t);return e?e.sys.isSleeping():null},pause:function(t){var e=this.getScene(t);return e&&e.sys.pause(),this},resume:function(t){var e=this.getScene(t);return e&&e.sys.resume(),this},sleep:function(t){var e=this.getScene(t);return e&&!e.sys.isTransitioning()&&e.sys.sleep(),this},wake:function(t){var e=this.getScene(t);return e&&e.sys.wake(),this},run:function(t,e){var i=this.getScene(t);if(!i)return this;i.sys.isSleeping()?i.sys.wake():i.sys.isBooted&&!i.sys.isActive()?i.sys.resume():this.start(t,e)},start:function(t,e){if(!this.isBooted)return this._data[t]={autoStart:!0,data:e},this;var i=this.getScene(t);if(i){var n;if(i.sys.start(e),i.sys.load&&(n=i.sys.load),n&&i.sys.settings.hasOwnProperty("pack")&&(n.reset(),n.addPack({payload:i.sys.settings.pack})))return i.sys.settings.status=r.LOADING,n.once("complete",this.payloadComplete,this),n.start(),this;this.bootScene(i)}return this},stop:function(t){var e=this.getScene(t);return e&&!e.sys.isTransitioning()&&e.sys.shutdown(),this},switch:function(t,e){var i=this.getScene(t),n=this.getScene(e);return i&&n&&i!==n&&(this.sleep(t),this.isSleeping(e)?this.wake(e):this.start(e)),this},getAt:function(t){return this.scenes[t]},getIndex:function(t){var e=this.getScene(t);return this.scenes.indexOf(e)},bringToTop:function(t){if(this.isProcessing)this._queue.push({op:"bringToTop",keyA:t,keyB:null});else{var e=this.getIndex(t);if(-1!==e&&e<this.scenes.length){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.push(i)}}return this},sendToBack:function(t){if(this.isProcessing)this._queue.push({op:"sendToBack",keyA:t,keyB:null});else{var e=this.getIndex(t);if(-1!==e&&0<e){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(0<e){var i=e-1,n=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=n}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e<this.scenes.length-1){var i=e+1,n=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=n}}return this},moveAbove:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"moveAbove",keyA:t,keyB:e});else{var i=this.getIndex(t),n=this.getIndex(e);if(-1!==i&&-1!==n){var s=this.getAt(n);this.scenes.splice(n,1),this.scenes.splice(i+1,0,s)}}return this},moveBelow:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"moveBelow",keyA:t,keyB:e});else{var i=this.getIndex(t),n=this.getIndex(e);if(-1!==i&&-1!==n){var s=this.getAt(n);this.scenes.splice(n,1),0===i?this.scenes.unshift(s):this.scenes.splice(i,0,s)}}return this},queueOp:function(t,e,i){return this._queue.push({op:t,keyA:e,keyB:i}),this},swapPosition:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"swapPosition",keyA:t,keyB:e});else{var i=this.getIndex(t),n=this.getIndex(e);if(i!==n&&-1!==i&&-1!==n){var s=this.getAt(i);this.scenes[i]=this.scenes[n],this.scenes[n]=s}}return this},dump:function(){for(var t=[],e=["pending","init","start","loading","creating","running","paused","sleeping","shutdown","destroyed"],i=0;i<this.scenes.length;i++){var n=this.scenes[i].sys,s=!n.settings.visible||n.settings.status!==r.RUNNING&&n.settings.status!==r.PAUSED?"[-] ":"[*] ";s+=n.settings.key+" ("+e[n.settings.status]+")",t.push(s)}console.log(t.join("\n"))},destroy:function(){for(var t=this.scenes.length-1;0<=t;t--){this.scenes[t].sys.destroy()}this.update=s,this.scenes=[],this._pending=[],this._start=[],this._queue=[],this.game=null}});t.exports=a},function(t,e,i){var a=i(56);t.exports=function(t,e,i,n){var s;if(void 0===n&&(n=t),!Array.isArray(e))return-1!==(s=t.indexOf(e))?(a(t,s),i&&i.call(n,e),e):null;for(var r=e.length-1;0<=r;){var o=e[r];-1!==(s=t.indexOf(o))?(a(t,s),i&&i.call(n,o)):e.pop(),r--}return e}},function(t,e,i){var n=i(0),s=i(9),r=i(7),o=i(13),a=i(11),h=i(1),p=i(12),l=i(195),u=new n({Extends:s,initialize:function(t){s.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,n,s,r,o=this.game.config,a=o.installGlobalPlugins;for(a=a.concat(this._pendingGlobal),t=0;t<a.length;t++)e=a[t],i=h(e,"key",null),n=h(e,"plugin",null),s=h(e,"start",!1),r=h(e,"mapping",null),i&&n&&this.install(i,n,s,r);for(a=(a=o.installScenePlugins).concat(this._pendingScene),t=0;t<a.length;t++)e=a[t],i=h(e,"key",null),n=h(e,"plugin",null),r=h(e,"mapping",null),i&&n&&this.installScenePlugin(i,n,r);this._pendingGlobal=[],this._pendingScene=[],this.game.events.once("destroy",this.destroy,this)},addToScene:function(t,e,i){var n,s,r,o=this.game,a=t.scene,h=t.settings.map,l=t.settings.isBooted;for(n=0;n<e.length;n++)o[s=e[n]]&&(t[s]=o[s],h.hasOwnProperty(s)&&(a[h[s]]=t[s]));for(var u=0;u<i.length;u++)for(r=i[u],n=0;n<r.length;n++)if(s=r[n],p.hasCore(s)){var c=p.getCore(s),d=new c.plugin(a,this);t[c.mapping]=d,c.custom?a[c.mapping]=d:h.hasOwnProperty(c.mapping)&&(a[h[c.mapping]]=d),l&&d.boot()}for(r=this.plugins,n=0;n<r.length;n++){var f=r[n];f.mapping&&(a[f.mapping]=f.plugin)}},getDefaultScenePlugins:function(){var t=this.game.config.defaultPlugins;return t=t.concat(this.scenePlugins)},installScenePlugin:function(t,e,i,n){if("function"==typeof e){if(p.hasCore(t))console.warn("Scene Plugin key in use: "+t);else if(p.register(t,e,i,!0),this.scenePlugins.push(t),n){var s=new e(n,this);n.sys[t]=s,i&&""!==i&&(n[i]=s),s.boot()}}else console.warn("Invalid Scene Plugin: "+t)},install:function(t,e,i,n){if(void 0===i&&(i=!1),void 0===n&&(n=null),"function"==typeof e)if(p.hasCustom(t))console.warn("Plugin key in use: "+t);else if(null!==n&&(i=!0),this.game.isBooted){if(p.registerCustom(t,e,n),i)return this.start(t)}else this._pendingGlobal.push({key:t,plugin:e,start:i,mapping:n});else console.warn("Invalid Plugin: "+t)},getIndex:function(t){for(var e=this.plugins,i=0;i<e.length;i++){if(e[i].key===t)return i}return-1},getEntry:function(t){var e=this.getIndex(t);if(-1!==e)return this.plugins[e]},isActive:function(t){var e=this.getEntry(t);return e&&e.active},start:function(t,e){void 0===e&&(e=t);var i=this.getEntry(e);return i&&!i.active?(i.active=!0,i.plugin.start()):i||(i=this.createEntry(t,e)),i?i.plugin:null},createEntry:function(t,e){var i=p.getCustom(t);if(i){var n=new i.plugin(this);i={key:e,plugin:n,active:!0,mapping:i.mapping},this.plugins.push(i),n.init(),n.start()}return i},stop:function(t){var e=this.getEntry(t);return e&&e.active&&(e.active=!1,e.plugin.stop()),this},get:function(t,e){void 0===e&&(e=!0);var i=this.getEntry(t);if(i)return i.plugin;var n=this.getClass(t);return n&&e?(i=this.createEntry(t,t))?i.plugin:null:n||null},getClass:function(t){return p.getCustomClass(t)},removeGlobalPlugin:function(t){var e=this.getEntry(t);e&&l(this.plugins,e),p.removeCustom(t)},removeScenePlugin:function(t){l(this.scenePlugins,t),p.remove(t)},registerGameObject:function(t,e,i){return e&&a.register(t,e),i&&o.register(t,i),this},registerFileType:function(t,e,i){r.register(t,e),i&&i.sys.load&&(i.sys.load[t]=e)},destroy:function(){for(var t=0;t<this.plugins.length;t++)this.plugins[t].plugin.destroy();this.game=null,this.plugins=[],this.scenePlugins=[]}});t.exports=u},function(t,e,i){var n=new(i(0))({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,t.events.once("boot",this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputTouch,this.target=t.inputTouchEventTarget,this.capture=t.inputTouchCapture,this.target||(this.target=this.manager.game.canvas),this.enabled&&this.startListeners()},onTouchStart:function(t){!t.defaultPrevented&&this.enabled&&(this.manager.queueTouchStart(t),this.capture&&t.preventDefault())},onTouchMove:function(t){!t.defaultPrevented&&this.enabled&&(this.manager.queueTouchMove(t),this.capture&&t.preventDefault())},onTouchEnd:function(t){!t.defaultPrevented&&this.enabled&&(this.manager.queueTouchEnd(t),this.capture&&t.preventDefault())},startListeners:function(){var t=this.target,e={passive:!0},i={passive:!1};this.capture?(t.addEventListener("touchstart",this.onTouchStart.bind(this),i),t.addEventListener("touchmove",this.onTouchMove.bind(this),i),t.addEventListener("touchend",this.onTouchEnd.bind(this),i)):(t.addEventListener("touchstart",this.onTouchStart.bind(this),e),t.addEventListener("touchmove",this.onTouchMove.bind(this),e),t.addEventListener("touchend",this.onTouchEnd.bind(this),e))},stopListeners:function(){var t=this.target;t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("touchmove",this.onTouchMove),t.removeEventListener("touchend",this.onTouchEnd)},destroy:function(){this.stopListeners(),this.target=null,this.manager=null}});t.exports=n},function(t,e,i){var n=i(0),s=i(6),r=new n({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.camera=null,this.buttons=0,this.position=new s,this.worldX=0,this.worldY=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.dragState=0,this.isDown=!1,this.dirty=!1,this.justDown=!1,this.justUp=!1,this.justMoved=!1,this.wasTouch=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},reset:function(){this.dirty=!1,this.justDown=!1,this.justUp=!1,this.justMoved=!1,this.movementX=0,this.movementY=0},up:function(t,e){t.buttons&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e),this.justUp=!0,this.isDown=!1,this.dirty=!0,this.wasTouch=!1},down:function(t,e){t.buttons&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e),this.justDown=!0,this.isDown=!0,this.dirty=!0,this.wasTouch=!1},move:function(t){t.buttons&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY),this.manager.mouse.locked&&(this.movementX+=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY+=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.justMoved=!0,this.dirty=!0,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e,this.justDown=!0,this.isDown=!0,this.dirty=!0,this.wasTouch=!0},touchmove:function(t){this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY),this.justMoved=!0,this.dirty=!0,this.wasTouch=!0},touchend:function(t,e){this.buttons=0,this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e,this.justUp=!0,this.isDown=!1,this.dirty=!0,this.wasTouch=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return 1&this.buttons},rightButtonDown:function(){return 2&this.buttons},middleButtonDown:function(){return 4&this.buttons},backButtonDown:function(){return 8&this.buttons},forwardButtonDown:function(){return 16&this.buttons},destroy:function(){this.camera=null,this.manager=null,this.position=null},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}}});t.exports=r},function(t,e,i){var n=i(0),s=i(120),r=new n({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.locked=!1,t.events.once("boot",this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.capture=t.inputMouseCapture,this.target||(this.target=this.manager.game.canvas),t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",function(t){return t.preventDefault(),!1}),this},requestPointerLock:function(){if(s.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},pointerLockChange:function(t){var e=this.target;this.locked=document.pointerLockElement===e||document.mozPointerLockElement===e||document.webkitPointerLockElement===e,this.manager.queue.push(t)},releasePointerLock:function(){s.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},onMouseMove:function(t){!t.defaultPrevented&&this.enabled&&(this.manager.queueMouseMove(t),this.capture&&t.preventDefault())},onMouseDown:function(t){!t.defaultPrevented&&this.enabled&&(this.manager.queueMouseDown(t),this.capture&&t.preventDefault())},onMouseUp:function(t){!t.defaultPrevented&&this.enabled&&(this.manager.queueMouseUp(t),this.capture&&t.preventDefault())},startListeners:function(){var t=this.target,e={passive:!0},i={passive:!1};this.capture?(t.addEventListener("mousemove",this.onMouseMove.bind(this),i),t.addEventListener("mousedown",this.onMouseDown.bind(this),i),t.addEventListener("mouseup",this.onMouseUp.bind(this),i)):(t.addEventListener("mousemove",this.onMouseMove.bind(this),e),t.addEventListener("mousedown",this.onMouseDown.bind(this),e),t.addEventListener("mouseup",this.onMouseUp.bind(this),e)),s.pointerLock&&(this.pointerLockChange=this.pointerLockChange.bind(this),document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),s.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.manager=null}});t.exports=r},function(t,e){t.exports={MOUSE_DOWN:0,MOUSE_MOVE:1,MOUSE_UP:2,TOUCH_START:3,TOUCH_MOVE:4,TOUCH_END:5,POINTER_LOCK_CHANGE:6}},function(t,e,i){var n=i(0),h=i(200),s=i(9),r=i(199),o=i(198),a=i(14),l=i(197),u=i(64),v=i(257),c=new n({initialize:function(t,e){this.game=t,this.canvas,this.config=e,this.enabled=!0,this.events=new s,this.queue=[],this.domCallbacks={up:[],down:[],move:[],upOnce:[],downOnce:[],moveOnce:[]},this._hasUpCallback=!1,this._hasDownCallback=!1,this._hasMoveCallback=!1,this._customCursor="",this._setCursor=0,this.defaultCursor="",this.mouse=e.inputMouse?new r(this):null,this.touch=e.inputTouch?new l(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers,e.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++)this.pointers.push(new o(this,i));this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.dirty=!1,this.scale={x:1,y:1},this.globalTopOnly=!0,this.ignoreEvents=!1,this.bounds=new a,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new u,t.events.once("boot",this.boot,this)},boot:function(){this.canvas=this.game.canvas,this.updateBounds(),this.events.emit("boot"),this.game.events.on("prestep",this.update,this),this.game.events.on("poststep",this.postUpdate,this),this.game.events.once("destroy",this.destroy,this)},updateBounds:function(){var t=this.bounds,e=this.canvas.getBoundingClientRect();t.x=e.left+window.pageXOffset-document.documentElement.clientLeft,t.y=e.top+window.pageYOffset-document.documentElement.clientTop,t.width=e.width,t.height=e.height},resize:function(){this.updateBounds();var t=this.game.config.width,e=this.game.config.height,i=this.bounds.width,n=this.bounds.height;this.scale.x=t/i,this.scale.y=e/n},update:function(t){var e;this._setCursor=0,this.events.emit("update"),this.ignoreEvents=!1,this.dirty=!1;var i=this.queue.length,n=this.pointers;for(e=0;e<this.pointersTotal;e++)n[e].reset();if(this.enabled&&0!==i){this.dirty=!0,this.updateBounds(),this.scale.x=this.game.config.width/this.bounds.width,this.scale.y=this.game.config.height/this.bounds.height;var s=this.queue.splice(0,i),r=this.mousePointer;for(e=0;e<i;e+=2){var o=s[e],a=s[e+1];switch(o){case h.MOUSE_DOWN:r.down(a,t);break;case h.MOUSE_MOVE:r.move(a,t);break;case h.MOUSE_UP:r.up(a,t);break;case h.TOUCH_START:this.startPointer(a,t);break;case h.TOUCH_MOVE:this.updatePointer(a,t);break;case h.TOUCH_END:this.stopPointer(a,t);break;case h.POINTER_LOCK_CHANGE:this.events.emit("pointerlockchange",a,this.mouse.locked)}}}},postUpdate:function(){1===this._setCursor?this.canvas.style.cursor=this._customCursor:2===this._setCursor&&(this.canvas.style.cursor=this.defaultCursor)},setDefaultCursor:function(t){this.defaultCursor=t,this.canvas.style.cursor!==t&&(this.canvas.style.cursor=t)},setCursor:function(t){t.cursor&&(this._setCursor=1,this._customCursor=t.cursor)},resetCursor:function(t){t.cursor&&(this._setCursor=2)},startPointer:function(t,e){for(var i=this.pointers,n=0;n<t.changedTouches.length;n++)for(var s=t.changedTouches[n],r=1;r<this.pointersTotal;r++){var o=i[r];if(!o.active){o.touchstart(s,e),this.activePointer=o;break}}},updatePointer:function(t,e){for(var i=this.pointers,n=0;n<t.changedTouches.length;n++)for(var s=t.changedTouches[n],r=1;r<this.pointersTotal;r++){var o=i[r];if(o.active&&o.identifier===s.identifier){o.touchmove(s,e),this.activePointer=o;break}}},stopPointer:function(t,e){for(var i=this.pointers,n=0;n<t.changedTouches.length;n++)for(var s=t.changedTouches[n],r=1;r<this.pointersTotal;r++){var o=i[r];if(o.active&&o.identifier===s.identifier){o.touchend(s,e);break}}},addPointer:function(t){void 0===t&&(t=1);var e=[];10<this.pointersTotal+t&&(t=10-this.pointersTotal);for(var i=0;i<t;i++){var n=this.pointers.length,s=new o(this,n);this.pointers.push(s),this.pointersTotal++,e.push(s)}return e},processDomCallbacks:function(t,e,i){var n=0;for(n=0;n<t.length;n++)t[n](i);for(n=0;n<e.length;n++)e[n](i);return t=[],0<e.length},queueTouchStart:function(t){if(this.queue.push(h.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(h.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(h.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(h.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(h.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(h.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,n=t.parentContainer;if(n)do{if(!n.visible){i=!1;break}n=n.parentContainer}while(n);return i},hitTest:function(t,e,i,n){void 0===n&&(n=this._tempHitTest);var s=this._tempPoint,r=i.width,o=i.height;n.length=0;var a=t.x,h=t.y;if(!(a>=i.x&&h>=i.y&&a<=i.x+r&&h<=i.y+o))return n;i.getWorldPoint(a,h,s),t.worldX=s.x,t.worldY=s.y;for(var l={x:0,y:0},u=this.game.config.resolution,c=this._tempMatrix,d=0;d<e.length;d++){var f=e[d];if(this.inputCandidate(f)){var p=s.x*u+i.scrollX*f.scrollFactorX-i.scrollX,g=s.y*u+i.scrollY*f.scrollFactorY-i.scrollY;f.parentContainer?(f.getWorldTransformMatrix(c),v(p,g,c.tx,c.ty,c.rotation,c.scaleX,c.scaleY,l)):v(p,g,f.x,f.y,f.rotation,f.scaleX,f.scaleY,l),this.pointWithinHitArea(f,l.x,l.y)&&n.push(f)}}return n},pointWithinHitArea:function(t,e,i){e+=t.displayOriginX,i+=t.displayOriginY;var n=t.input;return!(!n||!n.hitAreaCallback(n.hitArea,e,i,t))&&(n.localX=e,n.localY=i,!0)},pointWithinInteractiveObject:function(t,e,i){return!!t.hitArea&&(e+=t.gameObject.displayOriginX,i+=t.gameObject.displayOriginY,t.localX=e,t.localY=i,t.hitAreaCallback(t.hitArea,e,i,t))},transformPointer:function(t,e,i){t.x=(e-this.bounds.left)*this.scale.x,t.y=(i-this.bounds.top)*this.scale.y},transformX:function(t){return(t-this.bounds.left)*this.scale.x},transformY:function(t){return(t-this.bounds.top)*this.scale.y},getOffsetX:function(){return this.bounds.left},getOffsetY:function(){return this.bounds.top},getScaleX:function(){return this.game.config.width/this.bounds.width},getScaleY:function(){return this.game.config.height/this.bounds.height},destroy:function(){this.events.removeAllListeners(),this.mouse&&this.mouse.destroy(),this.touch&&this.touch.destroy();for(var t=0;t<this.pointers.length;t++)this.pointers[t].destroy();this.domCallbacks={},this.pointers=[],this.queue=[],this._tempHitTest=[],this._tempMatrix.destroy(),this.canvas=null,this.game=null}});t.exports=c},function(t,e){var i={modelMatrixDirty:!1,viewMatrixDirty:!1,projectionMatrixDirty:!1,modelMatrix:null,viewMatrix:null,projectionMatrix:null,mvpInit:function(){return this.modelMatrixDirty=!0,this.viewMatrixDirty=!0,this.projectionMatrixDirty=!0,this.modelMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.viewMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.projectionMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this},mvpUpdate:function(){var t=this.program;return this.modelMatrixDirty&&(this.renderer.setMatrix4(t,"uModelMatrix",!1,this.modelMatrix),this.modelMatrixDirty=!1),this.viewMatrixDirty&&(this.renderer.setMatrix4(t,"uViewMatrix",!1,this.viewMatrix),this.viewMatrixDirty=!1),this.projectionMatrixDirty&&(this.renderer.setMatrix4(t,"uProjectionMatrix",!1,this.projectionMatrix),this.projectionMatrixDirty=!1),this},modelIdentity:function(){var t=this.modelMatrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this.modelMatrixDirty=!0,this},modelScale:function(t,e,i){var n=this.modelMatrix;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this.modelMatrixDirty=!0,this},modelTranslate:function(t,e,i){var n=this.modelMatrix;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this.modelMatrixDirty=!0,this},modelRotateX:function(t){var e=this.modelMatrix,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=s*n+h*i,e[5]=r*n+l*i,e[6]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this.modelMatrixDirty=!0,this},modelRotateY:function(t){var e=this.modelMatrix,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=s*n-h*i,e[1]=r*n-l*i,e[2]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*i+c*n,this.modelMatrixDirty=!0,this},modelRotateZ:function(t){var e=this.modelMatrix,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=s*n+h*i,e[1]=r*n+l*i,e[2]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this.modelMatrixDirty=!0,this},viewIdentity:function(){var t=this.viewMatrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this.viewMatrixDirty=!0,this},viewScale:function(t,e,i){var n=this.viewMatrix;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this.viewMatrixDirty=!0,this},viewTranslate:function(t,e,i){var n=this.viewMatrix;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this.viewMatrixDirty=!0,this},viewRotateX:function(t){var e=this.viewMatrix,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=s*n+h*i,e[5]=r*n+l*i,e[6]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this.viewMatrixDirty=!0,this},viewRotateY:function(t){var e=this.viewMatrix,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=s*n-h*i,e[1]=r*n-l*i,e[2]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*i+c*n,this.viewMatrixDirty=!0,this},viewRotateZ:function(t){var e=this.viewMatrix,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=s*n+h*i,e[1]=r*n+l*i,e[2]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this.viewMatrixDirty=!0,this},viewLoad2D:function(t){var e=this.viewMatrix;return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=0,e[4]=t[2],e[5]=t[3],e[6]=0,e[7]=0,e[8]=t[4],e[9]=t[5],e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this.viewMatrixDirty=!0,this},viewLoad:function(t){var e=this.viewMatrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this.viewMatrixDirty=!0,this},projIdentity:function(){var t=this.projectionMatrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this.projectionMatrixDirty=!0,this},projOrtho:function(t,e,i,n,s,r){var o=this.projectionMatrix,a=1/(t-e),h=1/(i-n),l=1/(s-r);return o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(n+i)*h,o[14]=(r+s)*l,o[15]=1,this.projectionMatrixDirty=!0,this},projPersp:function(t,e,i,n){var s=this.projectionMatrix,r=1/Math.tan(t/2),o=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*o,s[15]=0,this.projectionMatrixDirty=!0,this}};t.exports=i},function(t,e,i){var n,s,r,o=i(22),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=(void 0!==document&&(a.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",s="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var i=new Image;i.onload=function(){var t=o.create(i,6,1).getContext("2d");if(t.globalCompositeOperation="multiply",t.drawImage(r,0,0),t.drawImage(i,2,0),!t.getImageData(2,0,1,1))return!1;var e=t.getImageData(2,0,1,1).data;o.remove(i),a.supportNewBlendModes=255===e[0]&&0===e[1]&&0===e[2]},i.src=n+"/wCKxvRF"+s},r.src=n+"AP804Oa6"+s,!1),a.supportInverseAlpha=function(){var t=o.create(this,2,1).getContext("2d");t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1);return i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3]}()),a)},function(t,e,i){t.exports={Fade:i(565),Flash:i(564),Shake:i(563)}},function(t,e,i){var n=i(206),s=new(i(0))({initialize:function(t){this.game=t,this.binary=new n,this.bitmapFont=new n,this.json=new n,this.physics=new n,this.shader=new n,this.audio=new n,this.text=new n,this.obj=new n,this.tilemap=new n,this.xml=new n,this.custom={},this.game.events.once("destroy",this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new n),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","text","obj","tilemap","xml"],e=0;e<t.length;e++)this[t[e]].destroy(),this[t[e]]=null;for(var i in this.custom)this.custom[i].destroy();this.custom=null,this.game=null}});t.exports=s},function(t,e,i){var n=i(0),s=i(124),r=i(9),o=new n({initialize:function(){this.entries=new s,this.events=new r},add:function(t,e){return this.entries.set(t,e),this.events.emit("add",this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit("remove",this,t,e.data)),this},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=o},function(t,e,i){var n=i(210),s=i(0),r=i(124),o=i(9),f=i(4),p=i(133),a=new s({Extends:o,initialize:function(t){o.call(this),this.game=t,this.textureManager=null,this.globalTimeScale=1,this.anims=new r,this.paused=!1,this.name="AnimationManager",t.events.once("boot",this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once("destroy",this.destroy,this)},add:function(t,e){if(!this.anims.has(t))return e.key=t,this.anims.set(t,e),this.emit("add",t,e),this;console.warn("Animation with key",t,"already exists")},create:function(t){var e=t.key;if(e&&!this.anims.has(e)){var i=new n(this,e,t);return this.anims.set(e,i),this.emit("add",e,i),i}console.warn("Invalid Animation Key, or Key already in use: "+e)},fromJSON:function(t,e){void 0===e&&(e=!1),e&&this.anims.clear(),"string"==typeof t&&(t=JSON.parse(t));var i=[];if(t.hasOwnProperty("anims")&&Array.isArray(t.anims)){for(var n=0;n<t.anims.length;n++)i.push(this.create(t.anims[n]));t.hasOwnProperty("globalTimeScale")&&(this.globalTimeScale=t.globalTimeScale)}else t.hasOwnProperty("key")&&"frame"===t.type&&i.push(this.create(t));return i},generateFrameNames:function(t,e){var i=f(e,"prefix",""),n=f(e,"start",0),s=f(e,"end",0),r=f(e,"suffix",""),o=f(e,"zeroPad",0),a=f(e,"outputArray",[]),h=f(e,"frames",!1),l=this.textureManager.get(t);if(!l)return a;var u,c,d=n<s?1:-1;if(s+=d,e)if(Array.isArray(h))for(u=0;u<h.length;u++)c=i+p(h[u],o,"0",1)+r,l.has(c)&&a.push({key:t,frame:c});else for(u=n;u!==s;u+=d)c=i+p(u,o,"0",1)+r,l.has(c)&&a.push({key:t,frame:c});else for(h=l.getFrameNames(),u=0;u<h.length;u++)a.push({key:t,frame:h[u]});return a},generateFrameNumbers:function(t,e){var i,n=f(e,"start",0),s=f(e,"end",-1),r=f(e,"first",!1),o=f(e,"outputArray",[]),a=f(e,"frames",!1),h=this.textureManager.get(t);if(!h)return o;if(r&&h.has(r)&&o.push({key:t,frame:r}),Array.isArray(a))for(i=0;i<a.length;i++)h.has(a[i])&&o.push({key:t,frame:a[i]});else for(-1===s&&(s=h.frameTotal),i=n;i<=s;i++)h.has(i)&&o.push({key:t,frame:i});return o},get:function(t){return this.anims.get(t)},load:function(t,e,i){var n=this.get(e);return n&&n.load(t,i),t},pauseAll:function(){return this.paused||(this.paused=!0,this.emit("pauseall")),this},play:function(t,e){if(Array.isArray(e)||(e=[e]),this.get(t)){for(var i=0;i<e.length;i++)e[i].anims.play(t);return this}},remove:function(t){var e=this.get(t);return e&&(this.emit("remove",t,e),this.anims.delete(t)),e},resumeAll:function(){return this.paused&&(this.paused=!1,this.emit("resumeall")),this},staggerPlay:function(t,e,i){if(void 0===i&&(i=0),Array.isArray(e)||(e=[e]),this.get(t)){for(var n=0;n<e.length;n++)e[n].anims.delayedPlay(i*n,t);return this}},toJSON:function(t){if(void 0!==t&&""!==t)return this.anims.get(t).toJSON();var i={anims:[],globalTimeScale:this.globalTimeScale};return this.anims.each(function(t,e){i.anims.push(e.toJSON())}),i},destroy:function(){this.anims.clear(),this.textureManager=null,this.game=null}});t.exports=a},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=n,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration}},destroy:function(){this.frame=void 0}});t.exports=n},function(t,e){t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var n,s,r=1;if(i){if(t<e[0][i])return e[0];for(;e[r][i]<t;)r++}else for(;e[r]<t;)r++;return r>e.length&&(r=e.length),i?(n=e[r-1][i],(s=e[r][i])-t<=t-n?e[r]:e[r-1]):(n=e[r-1],(s=e[r])-t<=t-n?s:n)}},function(t,e,i){var n=i(23),s=i(0),r=i(209),g=i(208),v=i(4),o=new s({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,v(i,"frames",[]),v(i,"defaultTextureKey",null)),this.frameRate=v(i,"frameRate",null),this.duration=v(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=v(i,"skipMissedFrames",!0),this.delay=v(i,"delay",0),this.repeat=v(i,"repeat",0),this.repeatDelay=v(i,"repeatDelay",0),this.yoyo=v(i,"yoyo",!1),this.showOnStart=v(i,"showOnStart",!1),this.hideOnComplete=v(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(0<i.length){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var n=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=n.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return 0<=t&&t<this.frames.length},completeAnimation:function(t){this.hideOnComplete&&(t.parent.visible=!1),t.stop()},getFirstTick:function(t,e){void 0===e&&(e=!0),t.accumulator=0,t.nextTick=t.msPerFrame+t.currentFrame.duration,e&&(t.nextTick+=t._delay)},getFrameAt:function(t){return this.frames[t]},getFrames:function(t,i,e){var n,s,r,o,a=[],h=1;if("string"==typeof i){o=i;var l=t.get(o).getFrameNames();i=[],l.forEach(function(t,e){i.push({key:o,frame:e})})}if(!Array.isArray(i)||0===i.length)return a;for(r=0;r<i.length;r++){var u=i[r],c=v(u,"key",e);if(c){var d=v(u,"frame",0),f=t.getFrame(c,d);(s=new g(c,d,h,f)).duration=v(u,"duration",0),s.isFirst=!n,n&&((n.nextFrame=s).prevFrame=n),a.push(s),n=s,h++}}if(0<a.length){s.isLast=!0,s.nextFrame=a[0],a[0].prevFrame=s;var p=1/(a.length-1);for(r=0;r<a.length;r++)a[r].progress=r*p}return a},getNextTick:function(t){t.accumulator-=t.nextTick,t.nextTick=t.msPerFrame+t.currentFrame.duration},load:function(t,e){e>=this.frames.length&&(e=0),t.currentAnim!==this&&(t.currentAnim=this,t.frameRate=this.frameRate,t.duration=this.duration,t.msPerFrame=this.msPerFrame,t.skipMissedFrames=this.skipMissedFrames,t._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=n(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)):0<t.repeatCounter?this.repeatAnimation(t):this.completeAnimation(t):(t.updateFrame(e.nextFrame),this.getNextTick(t))},previousFrame:function(t){var e=t.currentFrame;e.isFirst?0<t.repeatCounter?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);0<t._repeatDelay&&!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 e={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(t){e.frames.push(t.toJSON())}),e},updateFrameSequence:function(){for(var t=this.frames.length,e=1/(t-1),i=0;i<t;i++){var n=this.frames[i];n.index=i+1,n.isFirst=!1,n.isLast=!1,n.progress=i*e,0===i?(n.isFirst=!0,n.isLast=1===t,n.prevFrame=this.frames[t-1],n.nextFrame=this.frames[i+1]):i===t-1?(n.isLast=!0,n.prevFrame=this.frames[t-2],n.nextFrame=this.frames[0]):1<t&&(n.prevFrame=this.frames[i-1],n.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<this.frames.length;t++)this.frames[t].destroy();this.frames=[],this.manager=null}});t.exports=o},function(t,e,i){var n=i(39);t.exports=function(t){return n(t,-180,180)}},function(t,e,i){var n=i(39);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.geometryMask=e},setShape:function(t){this.geometryMask=t},preRenderWebGL:function(t,e,i){var n=t.gl,s=this.geometryMask;t.flush(),n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),n.colorMask(!1,!1,!1,!1),n.stencilFunc(n.NOTEQUAL,1,1),n.stencilOp(n.REPLACE,n.REPLACE,n.REPLACE),s.renderWebGL(t,s,0,i),t.flush(),n.colorMask(!0,!0,!0,!0),n.stencilFunc(n.EQUAL,1,1),n.stencilOp(n.INVERT,n.INVERT,n.INVERT)},postRenderWebGL:function(t){var e=t.gl;t.flush(),e.disable(e.STENCIL_TEST)},preRenderCanvas:function(t,e,i){var n=this.geometryMask;t.currentContext.save(),n.renderCanvas(t,n,0,i,void 0,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){var i=t.sys.game.renderer;if(this.bitmapMask=e,this.maskTexture=null,this.mainTexture=null,this.dirty=!0,this.mainFramebuffer=null,this.maskFramebuffer=null,this.invertAlpha=!1,i&&i.gl){var n=i.width,s=i.height,r=0==(n&n-1)&&0==(s&s-1),o=i.gl,a=r?o.REPEAT:o.CLAMP_TO_EDGE,h=o.LINEAR;this.mainTexture=i.createTexture2D(0,h,h,a,a,o.RGBA,null,n,s),this.maskTexture=i.createTexture2D(0,h,h,a,a,o.RGBA,null,n,s),this.mainFramebuffer=i.createFramebuffer(n,s,this.mainTexture,!1),this.maskFramebuffer=i.createFramebuffer(n,s,this.maskTexture,!1),i.onContextRestored(function(t){var e=t.width,i=t.height,n=0==(e&e-1)&&0==(i&i-1),s=t.gl,r=n?s.REPEAT:s.CLAMP_TO_EDGE,o=s.LINEAR;this.mainTexture=t.createTexture2D(0,o,o,r,r,s.RGBA,null,e,i),this.maskTexture=t.createTexture2D(0,o,o,r,r,s.RGBA,null,e,i),this.mainFramebuffer=t.createFramebuffer(e,i,this.mainTexture,!1),this.maskFramebuffer=t.createFramebuffer(e,i,this.maskTexture,!1)},this)}},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BitmapMaskPipeline.beginMask(this,e,i)},postRenderWebGL:function(t){t.pipelines.BitmapMaskPipeline.endMask(this)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null,this.mainTexture=null,this.maskTexture=null,this.mainFramebuffer=null,this.maskFramebuffer=null}});t.exports=n},function(nSa,oSa){var pSa;pSa=function(){return this}();try{pSa=pSa||Function("return this")()||eval("this")}catch(t){"object"==typeof window&&(pSa=window)}nSa.exports=pSa},function(t,e,i){var u=i(26),c=i(103),d=i(319),f=i(311);t.exports=function(t,e,i,n,s,r,o,a){void 0===i&&(i=32),void 0===n&&(n=32),void 0===s&&(s=10),void 0===r&&(r=10),void 0===a&&(a=!1);var h=null;if(Array.isArray(o))h=d(void 0!==e?e:"map",u.ARRAY_2D,o,i,n,a);else if(void 0!==e){var l=t.cache.tilemap.get(e);l?h=d(e,l.format,l.data,i,n,a):console.warn("No map data found for key "+e)}return null===h&&(h=new c({tileWidth:i,tileHeight:n,width:s,height:r})),new f(t,h)}},function(t,e,i){var p=i(26),g=i(104),v=i(103),y=i(66);t.exports=function(t,e,i,n,s){for(var r=new g({tileWidth:i,tileHeight:n}),o=new v({name:t,tileWidth:i,tileHeight:n,format:p.ARRAY_2D,layers:[r]}),a=[],h=e.length,l=0,u=0;u<e.length;u++){a[u]=[];for(var c=e[u],d=0;d<c.length;d++){var f=parseInt(c[d],10);isNaN(f)||-1===f?a[u][d]=s?null:new y(r,-1,d,u,i,n):a[u][d]=new y(r,f,d,u,i,n)}0===l&&(l=c.length)}return o.width=r.width=l,o.height=r.height=h,o.widthInPixels=r.widthInPixels=l*i,o.heightInPixels=r.heightInPixels=h*n,r.data=a,o}},function(t,e){t.exports=function(t,e,i){var n=i.collideIndexes.indexOf(t);e&&-1===n?i.collideIndexes.push(t):e||-1===n||i.collideIndexes.splice(n,1)}},function(t,e,i){var u=i(66),c=i(105),d=i(220),f=i(67);t.exports=function(t,e,i,n,s){if(!c(e,i,s))return null;void 0===n&&(n=!0);var r=s.data[i][e],o=r&&r.collides;if(t instanceof u)null===s.data[i][e]&&(s.data[i][e]=new u(s,t.index,e,i,t.width,t.height)),s.data[i][e].copy(t);else{var a=t;null===s.data[i][e]?s.data[i][e]=new u(s,a,e,i,s.tileWidth,s.tileHeight):s.data[i][e].index=a}var h=s.data[i][e],l=-1!==s.collideIndexes.indexOf(h.index);return f(h,l),n&&o!==h.collides&&d(e,i,s),h}},function(t,e,i){var l=i(140);t.exports=function(t,e,i){var n=l(t,e,!0,i),s=l(t,e-1,!0,i),r=l(t,e+1,!0,i),o=l(t-1,e,!0,i),a=l(t+1,e,!0,i),h=n&&n.collides;return h&&(n.faceTop=!0,n.faceBottom=!0,n.faceLeft=!0,n.faceRight=!0),s&&s.collides&&(h&&(n.faceTop=!1),s.faceBottom=!h),r&&r.collides&&(h&&(n.faceBottom=!1),r.faceTop=!h),o&&o.collides&&(h&&(n.faceLeft=!1),o.faceRight=!h),a&&a.collides&&(h&&(n.faceRight=!1),a.faceLeft=!h),n&&!n.collides&&n.resetFaces(),n}},function(t,e,i){var c={};t.exports=c;var o=i(301),r=i(41),d=i(74);c.create=function(t){return r.extend({id:r.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{}},t)},c.setModified=function(t,e,i,n){if(t.isModified=e,i&&t.parent&&c.setModified(t.parent,e,i,n),n)for(var s=0;s<t.composites.length;s++){var r=t.composites[s];c.setModified(r,e,i,n)}},c.add=function(t,e){var i=[].concat(e);o.trigger(t,"beforeAdd",{object:e});for(var n=0;n<i.length;n++){var s=i[n];switch(s.type){case"body":if(s.parent!==s){r.warn("Composite.add: skipped adding a compound body part (you must add its parent instead)");break}c.addBody(t,s);break;case"constraint":c.addConstraint(t,s);break;case"composite":c.addComposite(t,s);break;case"mouseConstraint":c.addConstraint(t,s.constraint)}}return o.trigger(t,"afterAdd",{object:e}),t},c.remove=function(t,e,i){var n=[].concat(e);o.trigger(t,"beforeRemove",{object:e});for(var s=0;s<n.length;s++){var r=n[s];switch(r.type){case"body":c.removeBody(t,r,i);break;case"constraint":c.removeConstraint(t,r,i);break;case"composite":c.removeComposite(t,r,i);break;case"mouseConstraint":c.removeConstraint(t,r.constraint)}}return o.trigger(t,"afterRemove",{object:e}),t},c.addComposite=function(t,e){return t.composites.push(e),e.parent=t,c.setModified(t,!0,!0,!1),t},c.removeComposite=function(t,e,i){var n=t.composites.indexOf(e);if(-1!==n&&(c.removeCompositeAt(t,n),c.setModified(t,!0,!0,!1)),i)for(var s=0;s<t.composites.length;s++)c.removeComposite(t.composites[s],e,!0);return t},c.removeCompositeAt=function(t,e){return t.composites.splice(e,1),c.setModified(t,!0,!0,!1),t},c.addBody=function(t,e){return t.bodies.push(e),c.setModified(t,!0,!0,!1),t},c.removeBody=function(t,e,i){var n=t.bodies.indexOf(e);if(-1!==n&&(c.removeBodyAt(t,n),c.setModified(t,!0,!0,!1)),i)for(var s=0;s<t.composites.length;s++)c.removeBody(t.composites[s],e,!0);return t},c.removeBodyAt=function(t,e){return t.bodies.splice(e,1),c.setModified(t,!0,!0,!1),t},c.addConstraint=function(t,e){return t.constraints.push(e),c.setModified(t,!0,!0,!1),t},c.removeConstraint=function(t,e,i){var n=t.constraints.indexOf(e);if(-1!==n&&c.removeConstraintAt(t,n),i)for(var s=0;s<t.composites.length;s++)c.removeConstraint(t.composites[s],e,!0);return t},c.removeConstraintAt=function(t,e){return t.constraints.splice(e,1),c.setModified(t,!0,!0,!1),t},c.clear=function(t,e,i){if(i)for(var n=0;n<t.composites.length;n++)c.clear(t.composites[n],e,!0);return e?t.bodies=t.bodies.filter(function(t){return t.isStatic}):t.bodies.length=0,t.constraints.length=0,t.composites.length=0,c.setModified(t,!0,!0,!1),t},c.allBodies=function(t){for(var e=[].concat(t.bodies),i=0;i<t.composites.length;i++)e=e.concat(c.allBodies(t.composites[i]));return e},c.allConstraints=function(t){for(var e=[].concat(t.constraints),i=0;i<t.composites.length;i++)e=e.concat(c.allConstraints(t.composites[i]));return e},c.allComposites=function(t){for(var e=[].concat(t.composites),i=0;i<t.composites.length;i++)e=e.concat(c.allComposites(t.composites[i]));return e},c.get=function(t,e,i){var n,s;switch(i){case"body":n=c.allBodies(t);break;case"constraint":n=c.allConstraints(t);break;case"composite":n=c.allComposites(t).concat(t)}return n?0===(s=n.filter(function(t){return t.id.toString()===e.toString()})).length?null:s[0]:null},c.move=function(t,e,i){return c.remove(t,e),c.add(i,e),t},c.rebase=function(t){for(var e=c.allBodies(t).concat(c.allConstraints(t)).concat(c.allComposites(t)),i=0;i<e.length;i++)e[i].id=r.nextId();return c.setModified(t,!0,!0,!1),t},c.translate=function(t,e,i){for(var n=i?c.allBodies(t):t.bodies,s=0;s<n.length;s++)d.translate(n[s],e);return c.setModified(t,!0,!0,!1),t},c.rotate=function(t,e,i,n){for(var s=Math.cos(e),r=Math.sin(e),o=n?c.allBodies(t):t.bodies,a=0;a<o.length;a++){var h=o[a],l=h.position.x-i.x,u=h.position.y-i.y;d.setPosition(h,{x:i.x+(l*s-u*r),y:i.y+(l*r+u*s)}),d.rotate(h,e)}return c.setModified(t,!0,!0,!1),t},c.scale=function(t,e,i,n,s){for(var r=s?c.allBodies(t):t.bodies,o=0;o<r.length;o++){var a=r[o],h=a.position.x-n.x,l=a.position.y-n.y;d.setPosition(a,{x:n.x+h*e,y:n.y+l*i}),d.scale(a,e,i)}return c.setModified(t,!0,!0,!1),t},c.bounds=function(t){for(var e=Matter.Composite.allBodies(t),i=[],n=0;n<e.length;n+=1){var s=e[n];i.push(s.bounds.min,s.bounds.max)}return Matter.Bounds.create(i)}},function(t,e,i){var a=i(180);function n(t){if(!(this instanceof n))return new n(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function u(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n<e.length;n++)if(i(t,e[n]))return n;return-1}function f(t,e){y(t,0,t.children.length,e,t)}function y(t,e,i,n,s){s||(s=g(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(var r,o=e;o<i;o++)r=t.children[o],c(s,t.leaf?n(r):r);return s}function c(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function r(t,e){return t.minX-e.minX}function o(t,e){return t.minY-e.minY}function m(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function d(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function l(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=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 v(t,e,i,n,s){for(var r,o=[e,i];o.length;)(i=o.pop())-(e=o.pop())<=n||(r=e+Math.ceil((i-e)/n/2)*n,a(t,r,e,i,s),o.push(e,r,r,i))}n.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!l(t,e))return i;for(var s,r,o,a,h=[];e;){for(s=0,r=e.children.length;s<r;s++)o=e.children[s],l(t,a=e.leaf?n(o):o)&&(e.leaf?i.push(o):p(t,a)?this._all(o,i):h.push(o));e=h.pop()}return i},collides:function(t){var e=this.data,i=this.toBBox;if(!l(t,e))return!1;for(var n,s,r,o,a=[];e;){for(n=0,s=e.children.length;n<s;n++)if(r=e.children[n],l(t,o=e.leaf?i(r):r)){if(e.leaf||p(t,o))return!0;a.push(r)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,i=t.length;e<i;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var s=this.data;this.data=n,n=s}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=g([]),this},remove:function(t,e){if(!t)return this;for(var i,n,s,r,o=this.data,a=this.toBBox(t),h=[],l=[];o||h.length;){if(o||(o=h.pop(),n=h[h.length-1],i=l.pop(),r=!0),o.leaf&&-1!==(s=u(t,o.children,e)))return o.children.splice(s,1),h.push(o),this._condense(h),this;r||o.leaf||!p(o,a)?n?(i++,o=n.children[i],r=!1):o=null:(h.push(o),l.push(i),i=0,o=(n=o).children[0])}return this},toBBox:function(t){return t},compareMinX:r,compareMinY:o,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},_build:function(t,e,i,n){var s,r=i-e+1,o=this._maxEntries;if(r<=o)return f(s=g(t.slice(e,i+1)),this.toBBox),s;n||(n=Math.ceil(Math.log(r)/Math.log(o)),o=Math.ceil(r/Math.pow(o,n-1))),(s=g([])).leaf=!1,s.height=n;var a,h,l,u,c=Math.ceil(r/o),d=c*Math.ceil(Math.sqrt(o));for(v(t,e,i,d,this.compareMinX),a=e;a<=i;a+=d)for(v(t,a,l=Math.min(a+d-1,i),c,this.compareMinY),h=a;h<=l;h+=c)u=Math.min(h+c-1,l),s.children.push(this._build(t,h,u,n-1));return f(s,this.toBBox),s},_chooseSubtree:function(t,e,i,n){for(var s,r,o,a,h,l,u,c,d,f;n.push(e),!e.leaf&&n.length-1!==i;){for(u=c=1/0,s=0,r=e.children.length;s<r;s++)h=m(o=e.children[s]),d=t,f=o,(l=(Math.max(f.maxX,d.maxX)-Math.min(f.minX,d.minX))*(Math.max(f.maxY,d.maxY)-Math.min(f.minY,d.minY))-h)<c?(c=l,u=h<u?h:u,a=o):l===c&&h<u&&(u=h,a=o);e=a||e.children[0]}return e},_insert:function(t,e,i){var n=this.toBBox,s=i?t:n(t),r=[],o=this._chooseSubtree(s,this.data,e,r);for(o.children.push(t),c(o,s);0<=e&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);var r=this._chooseSplitIndex(i,s,n),o=g(i.children.splice(r,i.children.length-r));o.height=i.height,o.leaf=i.leaf,f(i,this.toBBox),f(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,f(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,s,r,o,a,h,l,u,c,d,f,p,g,v;for(h=l=1/0,n=e;n<=i-e;n++)s=y(t,0,n,this.toBBox),r=y(t,n,i,this.toBBox),c=s,d=r,void 0,f=Math.max(c.minX,d.minX),p=Math.max(c.minY,d.minY),g=Math.min(c.maxX,d.maxX),v=Math.min(c.maxY,d.maxY),o=Math.max(0,g-f)*Math.max(0,v-p),a=m(s)+m(r),o<h?(h=o,u=n,l=a<l?a:l):o===h&&a<l&&(l=a,u=n);return u},_chooseSplitAxis:function(t,e,i){var n=t.leaf?this.compareMinX:r,s=t.leaf?this.compareMinY:o;this._allDistMargin(t,e,i,n)<this._allDistMargin(t,e,i,s)&&t.children.sort(n)},_allDistMargin:function(t,e,i,n){t.children.sort(n);var s,r,o=this.toBBox,a=y(t,0,e,o),h=y(t,i-e,i,o),l=d(a)+d(h);for(s=e;s<i-e;s++)r=t.children[s],c(a,t.leaf?o(r):r),l+=d(a);for(s=i-e-1;e<=s;s--)r=t.children[s],c(h,t.leaf?o(r):r),l+=d(h);return l},_adjustParentBBoxes:function(t,e,i){for(var n=i;0<=n;n--)c(e[n],t)},_condense:function(t){for(var e,i=t.length-1;0<=i;i--)0===t[i].children.length?0<i?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():f(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 n=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,n=this._active;for(t=0;t<i.length;t++){e=i[t];var s=n.indexOf(e);-1!==s&&n.splice(s,1)}for(i.length=0,i=this._pending,t=0;t<i.length;t++)e=i[t],this._active.push(e);return i.length=0,this._toProcess=0,this._active},getActive:function(){return this._active},destroy:function(){this._pending=[],this._active=[],this._destroy=[]}});t.exports=n},function(t,e,i){var n=i(0),s=i(18),a=i(19),r=i(7),h=i(1),l=i(8),o=new n({Extends:a,initialize:function(t,e,i,n){var s="txt";if(l(e)){var r=e;e=h(r,"key"),i=h(r,"url"),n=h(r,"xhrSettings"),s=h(r,"extension",s)}var o={type:"text",cache:t.cacheManager.text,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};a.call(this,t,o)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});r.register("text",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new o(this,t[n]));else this.addFile(new o(this,t,e,i));return this}),t.exports=o},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*s-a*r+e,t.y1=o*r+a*s+i,o=t.x2-e,a=t.y2-i,t.x2=o*s-a*r+e,t.y2=o*r+a*s+i,o=t.x3-e,a=t.y3-i,t.x3=o*s-a*r+e,t.y3=o*r+a*s+i,t}},function(t,e,i){var g=i(71),v=i(5);t.exports=function(t,e,i,n){void 0===n&&(n=[]);var s=t.getLineA(),r=t.getLineB(),o=t.getLineC(),a=g(s),h=g(r),l=g(o),u=a+h+l;e||(e=u/i);for(var c=0;c<e;c++){var d=u*(c/e),f=0,p=new v;d<a?(f=d/a,p.x=s.x1+(s.x2-s.x1)*f,p.y=s.y1+(s.y2-s.y1)*f):a+h<d?(f=(d-=a+h)/l,p.x=o.x1+(o.x2-o.x1)*f,p.y=o.y1+(o.y2-o.y1)*f):(f=(d-=a)/h,p.x=r.x1+(r.x2-r.x1)*f,p.y=r.y1+(r.y2-r.y1)*f),n.push(p)}return n}},function(t,e,i){var c=i(5),d=i(71);t.exports=function(t,e,i){void 0===i&&(i=new c);var n=t.getLineA(),s=t.getLineB(),r=t.getLineC();if(e<=0||1<=e)return i.x=n.x1,i.y=n.y1,i;var o=d(n),a=d(s),h=d(r),l=(o+a+h)*e,u=0;return l<o?(u=l/o,i.x=n.x1+(n.x2-n.x1)*u,i.y=n.y1+(n.y2-n.y1)*u):o+a<l?(u=(l-=o+a)/h,i.x=r.x1+(r.x2-r.x1)*u,i.y=r.y1+(r.y2-r.y1)*u):(u=(l-=o)/a,i.x=s.x1+(s.x2-s.x1)*u,i.y=s.y1+(s.y2-s.y1)*u),i}},function(t,e){t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},function(t,e){t.exports=function(t,e,i){for(var n=!1,s=-1,r=t.points.length-1;++s<t.points.length;r=s){var o=t.points[s].x,a=t.points[s].y,h=t.points[r].x,l=t.points[r].y;(a<=i&&i<l||l<=i&&i<a)&&e<(h-o)*(i-a)/(l-a)+o&&(n=!n)}return n}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*s-a*r+e,t.y1=o*r+a*s+i,o=t.x2-e,a=t.y2-i,t.x2=o*s-a*r+e,t.y2=o*r+a*s+i,t}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=!1),void 0===n&&(n=[]);for(var s,r,o,a,h,l,u=t.x3-t.x1,c=t.y3-t.y1,d=t.x2-t.x1,f=t.y2-t.y1,p=u*u+c*c,g=u*d+c*f,v=d*d+f*f,y=p*v-g*g,m=0===y?0:1/y,x=t.x1,w=t.y1,b=0;b<e.length&&(r=(p*(l=d*(o=e[b].x-x)+f*(a=e[b].y-w))-g*(h=u*o+c*a))*m,!(0<=(s=(v*h-g*l)*m)&&0<=r&&s+r<1&&(n.push({x:e[b].x,y:e[b].y}),i)));b++);return n}},function(t,e,i){var n=i(0),r=i(145),s=new n({Extends:r,initialize:function(t,e,i,n,s){r.call(this,t,e,i,[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,1,1,1,0,0,1,1,1,0],[16777215,16777215,16777215,16777215,16777215,16777215],[1,1,1,1,1,1],n,s),this.resetPosition()},topLeftX:{get:function(){return this.x+this.vertices[0]},set:function(t){this.vertices[0]=t-this.x,this.vertices[6]=t-this.x}},topLeftY:{get:function(){return this.y+this.vertices[1]},set:function(t){this.vertices[1]=t-this.y,this.vertices[7]=t-this.y}},topRightX:{get:function(){return this.x+this.vertices[10]},set:function(t){this.vertices[10]=t-this.x}},topRightY:{get:function(){return this.y+this.vertices[11]},set:function(t){this.vertices[11]=t-this.y}},bottomLeftX:{get:function(){return this.x+this.vertices[2]},set:function(t){this.vertices[2]=t-this.x}},bottomLeftY:{get:function(){return this.y+this.vertices[3]},set:function(t){this.vertices[3]=t-this.y}},bottomRightX:{get:function(){return this.x+this.vertices[4]},set:function(t){this.vertices[4]=t-this.x,this.vertices[8]=t-this.x}},bottomRightY:{get:function(){return this.y+this.vertices[5]},set:function(t){this.vertices[5]=t-this.y,this.vertices[9]=t-this.y}},topLeftAlpha:{get:function(){return this.alphas[0]},set:function(t){this.alphas[0]=t,this.alphas[3]=t}},topRightAlpha:{get:function(){return this.alphas[5]},set:function(t){this.alphas[5]=t}},bottomLeftAlpha:{get:function(){return this.alphas[1]},set:function(t){this.alphas[1]=t}},bottomRightAlpha:{get:function(){return this.alphas[2]},set:function(t){this.alphas[2]=t,this.alphas[4]=t}},topLeftColor:{get:function(){return this.colors[0]},set:function(t){this.colors[0]=t,this.colors[3]=t}},topRightColor:{get:function(){return this.colors[5]},set:function(t){this.colors[5]=t}},bottomLeftColor:{get:function(){return this.colors[1]},set:function(t){this.colors[1]=t}},bottomRightColor:{get:function(){return this.colors[2]},set:function(t){this.colors[2]=t,this.colors[4]=t}},setTopLeft:function(t,e){return this.topLeftX=t,this.topLeftY=e,this},setTopRight:function(t,e){return this.topRightX=t,this.topRightY=e,this},setBottomLeft:function(t,e){return this.bottomLeftX=t,this.bottomLeftY=e,this},setBottomRight:function(t,e){return this.bottomRightX=t,this.bottomRightY=e,this},resetPosition:function(){var t=this.x,e=this.y,i=Math.floor(this.width/2),n=Math.floor(this.height/2);return this.setTopLeft(t-i,e-n),this.setTopRight(t+i,e-n),this.setBottomLeft(t-i,e+n),this.setBottomRight(t+i,e+n),this},resetAlpha:function(){var t=this.alphas;return t[0]=1,t[1]=1,t[2]=1,t[3]=1,t[4]=1,t[5]=1,this},resetColors:function(){var t=this.colors;return t[0]=16777215,t[1]=16777215,t[2]=16777215,t[3]=16777215,t[4]=16777215,t[5]=16777215,this},reset:function(){return this.resetPosition(),this.resetAlpha(),this.resetColors()}});t.exports=s},function(t,e,i){var h=i(22),n=i(0),s=i(15),l=i(20),u=i(2),c=i(411),r=i(886),o=new n({Extends:u,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.ScrollFactor,s.Size,s.Texture,s.Tint,s.Transform,s.Visible,r],initialize:function(t,e,i,n,s,r,o){var a=t.sys.game.renderer;u.call(this,t,"TileSprite"),this.tilePositionX=0,this.tilePositionY=0,this.dirty=!0,this.tileTexture=null,this.renderer=a,this.setTexture(r,o),this.setPosition(e,i),this.setSize(n,s),this.setOriginFromFrame(),this.initPipeline("TextureTintPipeline"),this.potWidth=c(this.frame.width),this.potHeight=c(this.frame.height),this.canvasPattern=null,this.canvasBuffer=h.create2D(this,this.potWidth,this.potHeight),this.canvasBufferCtx=this.canvasBuffer.getContext("2d"),this.oldFrame=null,this.updateTileTexture(),t.sys.game.config.renderType===l.WEBGL&&t.sys.game.renderer.onContextRestored(function(t){var e=t.gl;this.tileTexture=null,this.dirty=!0,this.tileTexture=t.createTexture2D(0,e.LINEAR,e.LINEAR,e.REPEAT,e.REPEAT,e.RGBA,this.canvasBuffer,this.potWidth,this.potHeight)},this)},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},updateTileTexture:function(){(this.dirty||this.oldFrame!==this.frame)&&(this.oldFrame=this.frame,this.canvasBufferCtx.clearRect(0,0,this.canvasBuffer.width,this.canvasBuffer.height),this.renderer.gl?(this.canvasBufferCtx.drawImage(this.frame.source.image,this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight,0,0,this.potWidth,this.potHeight),this.tileTexture=this.renderer.canvasToTexture(this.canvasBuffer,this.tileTexture)):(this.canvasBuffer.width=this.frame.cutWidth,this.canvasBuffer.height=this.frame.cutHeight,this.canvasBufferCtx.drawImage(this.frame.source.image,this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight,0,0,this.frame.cutWidth,this.frame.cutHeight),this.canvasPattern=this.canvasBufferCtx.createPattern(this.canvasBuffer,"repeat")),this.dirty=!1)},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.tileTexture),h.remove(this.canvasBuffer),this.canvasPattern=null,this.canvasBufferCtx=null,this.canvasBuffer=null,this.renderer=null}});t.exports=o},function(t,e,i){var o=i(22),n=i(0),s=i(15),a=i(20),h=i(2),r=i(894),l=i(891),u=i(890),c=new n({Extends:h,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Mask,s.MatrixStack,s.Origin,s.Pipeline,s.ScaleMode,s.ScrollFactor,s.Tint,s.Transform,s.Visible,r],initialize:function(t,e,i,n,s){if(void 0===n&&(n=32),void 0===s&&(s=32),h.call(this,t,"RenderTexture"),this.initMatrixStack(),this.renderer=t.sys.game.renderer,this.globalTint=16777215,this.globalAlpha=1,this.canvas=null,this.context=null,this.framebuffer=null,this.renderer.type===a.WEBGL){var r=this.renderer.gl;this.gl=r,this.fill=u.fill,this.clear=u.clear,this.draw=u.draw,this.drawFrame=u.drawFrame,this.texture=this.renderer.createTexture2D(0,r.NEAREST,r.NEAREST,r.CLAMP_TO_EDGE,r.CLAMP_TO_EDGE,r.RGBA,null,n,s,!1),this.framebuffer=this.renderer.createFramebuffer(n,s,this.texture,!1)}else this.renderer.type===a.CANVAS&&(this.fill=l.fill,this.clear=l.clear,this.draw=l.draw,this.drawFrame=l.drawFrame,this.canvas=o.create2D(this,n,s),this.context=this.canvas.getContext("2d"));this.setPosition(e,i),this.setSize(n,s),this.initPipeline("TextureTintPipeline")},resize:function(t,e){if(void 0===e&&(e=t),t!==this.width||e!==this.height){if(this.canvas)this.canvas.width=t,this.canvas.height=e;else{this.renderer.deleteTexture(this.texture),this.renderer.deleteFramebuffer(this.framebuffer);var i=this.renderer.gl;this.texture=this.renderer.createTexture2D(0,i.NEAREST,i.NEAREST,i.CLAMP_TO_EDGE,i.CLAMP_TO_EDGE,i.RGBA,null,t,e,!1),this.framebuffer=this.renderer.createFramebuffer(t,e,this.texture,!1)}this.setSize(t,e)}return this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},preDestroy:function(){this.renderer&&this.renderer.gl&&(this.renderer.deleteTexture(this.texture),this.renderer.deleteFramebuffer(this.framebuffer))}});t.exports=c},function(t,e,i){var n=i(0),s=i(15),r=i(2),o=i(458),a=i(93),h=i(456),l=i(898),u=new n({Extends:r,Mixins:[s.Depth,s.Pipeline,s.Visible,l],initialize:function(t,e,i,n){if(r.call(this,t,"ParticleEmitterManager"),this.blendMode=-1,this.timeScale=1,this.texture=null,this.frame=null,this.frameNames=[],null===i||"object"!=typeof i&&!Array.isArray(i)||(n=i,i=null),this.setTexture(e,i),this.initPipeline("TextureTintPipeline"),this.emitters=new a(this),this.wells=new a(this),n){Array.isArray(n)||(n=[n]);for(var s=0;s<n.length;s++)this.createEmitter(n[s])}},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){return this.frame=this.texture.get(t),this.frameNames=this.texture.getFramesFromTextureSource(this.frame.sourceIndex),this.defaultFrame=this.frame,this},setEmitterFrames:function(t,e){Array.isArray(t)||(t=[t]);for(var i=e.frames,n=i.length=0;n<t.length;n++){var s=t[n];-1!==this.frameNames.indexOf(s)&&i.push(this.texture.get(s))}return 0<i.length?e.defaultFrame=i[0]:e.defaultFrame=this.defaultFrame,this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var n=this.emitters.list,s=0;s<n.length;s++){var r=n[s];r.active&&r.emitParticle(t,e,i)}return this},emitParticleAt:function(t,e,i){return this.emitParticle(i,t,e)},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},getProcessors:function(){return this.wells.getAll("active",!0)},preUpdate:function(t,e){e*=this.timeScale;for(var i=this.emitters.list,n=0;n<i.length;n++){var s=i[n];s.active&&s.preUpdate(t,e)}},setAlpha:function(){},setScrollFactor:function(){}});t.exports=u},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 n=i(114);n.Area=i(472),n.Circumference=i(177),n.CircumferencePoint=i(113),n.Clone=i(471),n.Contains=i(54),n.ContainsPoint=i(470),n.ContainsRect=i(469),n.CopyFrom=i(468),n.Equals=i(467),n.GetBounds=i(466),n.GetPoint=i(179),n.GetPoints=i(178),n.Offset=i(465),n.OffsetPoint=i(464),n.Random=i(134),t.exports=n},function(t,e,i){var n=i(0),s=i(15),a=i(2),r=i(475),o=i(903),h=new n({Extends:a,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Texture,s.Tint,s.Transform,s.Visible,o],initialize:function(t,e,i,n,s,r){void 0===s&&(s=""),a.call(this,t,"DynamicBitmapText"),this.font=n;var o=this.scene.sys.cache.bitmapFont.get(n);this.fontData=o.data,this.text="",this.fontSize=r||this.fontData.size,this.letterSpacing=0,this.setText(s),this.setTexture(o.texture,o.frame),this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline("TextureTintPipeline"),this._bounds=this.getTextBounds(),this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setFontSize:function(t){return this.fontSize=t,this},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this.text&&(this.text=t.toString(),this.updateDisplayOrigin()),this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this},getTextBounds:function(t){return this._bounds=r(this,t),this._bounds},width:{get:function(){return this.getTextBounds(!1),this._bounds.global.width}},height:{get:function(){return this.getTextBounds(!1),this._bounds.global.height}},toJSON:function(){var t=s.ToJSON(this),e={font:this.font,text:this.text,fontSize:this.fontSize};return t.data=e,t}});t.exports=h},function(t,e,i){var r=i(147),n=i(0),s=i(15),o=i(2),a=i(14),h=i(906),l=i(473),u=i(6),c=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.ScrollFactor,s.Transform,s.Visible,h],initialize:function(t,e,i,n){o.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new s.TransformMatrix,this.tempTransformMatrix=new s.TransformMatrix,this._displayList=t.sys.displayList,this._sortKey="",this._sysEvents=t.sys.events,this.setPosition(e,i),this.clearAlpha(),n&&this.add(n)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new a),t.setTo(this.x,this.y,0,0),0<this.list.length)for(var e=this.list,i=new a,n=0;n<e.length;n++){var s=e[n];s.getBounds&&(s.getBounds(i),l(i,t,t))}return t},addHandler:function(t){t.once("destroy",this.remove,this),this.exclusive&&(this._displayList.remove(t),t.parentContainer&&t.parentContainer.remove(t),t.parentContainer=this),this._sysEvents.off("shutdown",t.destroy,t)},removeHandler:function(t){t.off("destroy",this.remove),this.exclusive&&(t.parentContainer=null,this._sysEvents.once("shutdown",t.destroy,t))},pointToContainer:function(t,e){if(void 0===e&&(e=new u),this.parentContainer)return this.parentContainer.pointToContainer(t,e);var i=this.tempTransformMatrix;return i.applyITRS(this.x,this.y,this.rotation,this.scaleX,this.scaleY),i.invert(),i.transformPoint(t.x,t.y,e),e},getBoundsTransformMatrix:function(){return this.getWorldTransformMatrix(this.tempTransformMatrix)},add:function(t){return r.Add(this.list,t,this.maxSize,this.addHandler,this),this},addAt:function(t,e){return r.AddAt(this.list,t,e,this.maxSize,this.addHandler,this),this},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t){return t&&(this._sortKey=t,r.StableSort.inplace(this.list,this.sortHandler)),this},sortHandler:function(t,e){return t[this._sortKey]-e[this._sortKey]},getByName:function(t){return r.GetFirst(this.list,"name",t)},getRandom:function(t,e){return r.GetRandom(this.list,t,e)},getFirst:function(t,e,i,n){return r.GetFirstElement(this.list,t,e,i,n)},getAll:function(t,e,i,n){return r.GetAll(this.list,t,e,i,n)},count:function(t,e,i,n){return r.CountAllMatching(this.list,t,e,i,n)},swap:function(t,e){return r.Swap(this.list,t,e),this},moveTo:function(t,e){return r.MoveTo(this.list,t,e),this},remove:function(t,e){var i=r.Remove(this.list,t,this.removeHandler,this);if(e&&i){Array.isArray(i)||(i=[i]);for(var n=0;n<i.length;n++)i[n].destroy()}return this},removeAt:function(t,e){var i=r.RemoveAt(this.list,t,this.removeHandler,this);return e&&i&&i.destroy(),this},removeBetween:function(t,e,i){var n=r.RemoveBetween(this.list,t,e,this.removeHandler,this);if(i)for(var s=0;s<n.length;s++)n[s].destroy();return this},removeAll:function(t){var e=r.RemoveBetween(this.list,0,this.list.length,this.removeHandler,this);if(t)for(var i=0;i<e.length;i++)e[i].destroy();return this},bringToTop:function(t){return r.BringToTop(this.list,t),this},sendToBack:function(t){return r.SendToBack(this.list,t),this},moveUp:function(t){return r.MoveUp(this.list,t),this},moveDown:function(t){return r.MoveDown(this.list,t),this},reverse:function(){return this.list.reverse(),this},shuffle:function(){return r.Shuffle(this.list),this},replace:function(t,e,i){return r.Replace(this.list,t,e)&&(this.addHandler(e),this.removeHandler(t),i&&t.destroy()),this},exists:function(t){return-1<this.list.indexOf(t)},setAll:function(t,e,i,n){return r.SetAll(this.list,t,e,i,n),this},each:function(t,e){var i,n=[null],s=this.list.slice(),r=s.length;for(i=2;i<arguments.length;i++)n.push(arguments[i]);for(i=0;i<r;i++)n[0]=s[i],t.apply(e,n);return this},iterate:function(t,e){var i,n=[null];for(i=2;i<arguments.length;i++)n.push(arguments[i]);for(i=0;i<this.list.length;i++)n[0]=this.list[i],t.apply(e,n);return this},length:{get:function(){return this.list.length}},first:{get:function(){return(this.position=0)<this.list.length?this.list[0]:null}},last:{get:function(){return 0<this.list.length?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position<this.list.length?(this.position++,this.list[this.position]):null}},previous:{get:function(){return 0<this.position?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null}});t.exports=c},function(t,e,i){var n=i(910),o=i(907),s=i(0),r=i(15),a=i(128),h=i(2),l=i(93),u=new s({Extends:h,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Mask,r.Pipeline,r.ScaleMode,r.ScrollFactor,r.Size,r.Texture,r.Transform,r.Visible,n],initialize:function(t,e,i,n,s){h.call(this,t,"Blitter"),this.setTexture(n,s),this.setPosition(e,i),this.initPipeline("TextureTintPipeline"),this.children=new l,this.renderList=[],this.dirty=!1},create:function(t,e,i,n,s){void 0===n&&(n=!0),void 0===s&&(s=this.children.length),void 0===i?i=this.frame:i instanceof a||(i=this.texture.get(i));var r=new o(this,t,e,i,n);return this.children.addAt(r,s,!1),this.dirty=!0,r},createFromCallback:function(t,e,i,n){for(var s=this.createMultiple(e,i,n),r=0;r<s.length;r++){var o=s[r];t.call(this,o,r)}return s},createMultiple:function(i,t,n){void 0===t&&(t=this.frame.name),void 0===n&&(n=!0),Array.isArray(t)||(t=[t]);var s=[],r=this;return t.forEach(function(t){for(var e=0;e<i;e++)s.push(r.create(0,0,t,n))}),s},childCanRender:function(t){return t.visible&&0<t.alpha},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},function(t,e,i){var n=i(0),s=i(15),a=i(2),r=i(475),o=i(914),h=i(913),l=new n({Extends:a,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.ScrollFactor,s.Texture,s.Tint,s.Transform,s.Visible,h],initialize:function(t,e,i,n,s,r){void 0===s&&(s=""),a.call(this,t,"BitmapText"),this.font=n;var o=this.scene.sys.cache.bitmapFont.get(n);this.fontData=o.data,this.text="",this.fontSize=r||this.fontData.size,this.letterSpacing=0,this.setText(s),this.setTexture(o.texture,o.frame),this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline("TextureTintPipeline"),this._bounds=this.getTextBounds()},setFontSize:function(t){return this.fontSize=t,this},setLetterSpacing:function(t){return void 0===t&&(t=0),this.letterSpacing=t,this},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this.text&&(this.text=t.toString(),this.updateDisplayOrigin()),this},getTextBounds:function(t){return this._bounds=r(this,t),this._bounds},width:{get:function(){return this.getTextBounds(!1),this._bounds.global.width}},height:{get:function(){return this.getTextBounds(!1),this._bounds.global.height}},toJSON:function(){var t=s.ToJSON(this),e={font:this.font,text:this.text,fontSize:this.fontSize,letterSpacing:this.letterSpacing};return t.data=e,t}});l.ParseFromAtlas=o,t.exports=l},function(t,e,i){var f=i(4),p=i(95),g=function(t,e,i){for(var n=[],s=0;s<t.length;s++)for(var r=0;r<e.length;r++)for(var o=0;o<i;o++)n.push({a:t[s],b:e[r]});return n};t.exports=function(t,e,i){var n=f(i,"max",0),s=f(i,"qty",1),r=f(i,"random",!1),o=f(i,"randomB",!1),a=f(i,"repeat",0),h=f(i,"yoyo",!1),l=[];if(o&&p(e),-1===a)if(0===n)a=0;else{var u=t.length*e.length*s;h&&(u*=2),a=Math.ceil(n/u)}for(var c=0;c<=a;c++){var d=g(t,e,s);r&&p(d),l=l.concat(d),h&&(d.reverse(),l=l.concat(d))}return n&&l.splice(n),l}},function(t,e){t.exports=function(t){return 0<t?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 b=i(6);t.exports=function(t,e,i,n,s,r,o,a){void 0===a&&(a=new b);var h=Math.sin(-s),l=Math.cos(-s),u=l*r,c=-h*r,d=h*o,f=l*o,p=u*f-c*d,g=f/p,v=-c/p,y=-d/p,m=u/p,x=(d*n-f*i)/p,w=-(u*n-c*i)/p;return a.x=t*g+e*y+x,a.y=t*v+e*m+w,a}},function(t,e,i){"use strict";function n(t,e,i){i=i||2;var n,s,r,o,a,h,l,u=e&&e.length,c=u?e[0]*i:t.length,d=g(t,0,c,i,!0),f=[];if(!d)return f;if(u&&(d=function(t,e,i,n){var s,r,o,a,h,l=[];for(s=0,r=e.length;s<r;s++)o=e[s]*n,a=s<r-1?e[s+1]*n:t.length,(h=g(t,o,a,n,!1))===h.next&&(h.steiner=!0),l.push(w(h));for(l.sort(m),s=0;s<l.length;s++)x(l[s],i),i=v(i,i.next);return i}(t,e,d,i)),t.length>80*i){n=r=t[0],s=o=t[1];for(var p=i;p<c;p+=i)(a=t[p])<n&&(n=a),(h=t[p+1])<s&&(s=h),r<a&&(r=a),o<h&&(o=h);l=Math.max(r-n,o-s)}return y(d,f,i,n,s,l),f}function g(t,e,i,n,s){var r,o;if(s===0<_(t,e,i,n))for(r=e;r<i;r+=n)o=h(r,t[r],t[r+1],o);else for(r=i-n;e<=r;r-=n)o=h(r,t[r],t[r+1],o);return o&&a(o,o.next)&&(M(o),o=o.next),o}function v(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!a(n,n.next)&&0!==T(n.prev,n,n.next))n=n.next;else{if(M(n),(n=e=n.prev)===n.next)return null;i=!0}}while(i||n!==e);return e}function y(t,e,i,n,s,r,o){if(t){!o&&r&&function(t,e,i,n){var s=t;for(;null===s.z&&(s.z=p(s.x,s.y,e,i,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next,s!==t;);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,n,s,r,o,a,h,l=1;do{for(i=t,r=t=null,o=0;i;){for(o++,n=i,e=a=0;e<l&&(a++,n=n.nextZ);e++);for(h=l;0<a||0<h&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(i=(s=i).nextZ,a--):(n=(s=n).nextZ,h--),r?r.nextZ=s:t=s,s.prevZ=r,r=s;i=n}r.nextZ=null,l*=2}while(1<o)}(s)}(t,n,s,r);for(var a,h,l=t;t.prev!==t.next;)if(a=t.prev,h=t.next,r?c(t,n,s,r):u(t))e.push(a.i/i),e.push(t.i/i),e.push(h.i/i),M(t),t=h.next,l=h.next;else if((t=h)===l){o?1===o?y(t=d(t,e,i),e,i,n,s,r,2):2===o&&f(t,e,i,n,s,r):y(v(t),e,i,n,s,r,1);break}}}function u(t){var e=t.prev,i=t,n=t.next;if(0<=T(e,i,n))return!1;for(var s=t.next.next;s!==t.prev;){if(b(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&0<=T(s.prev,s,s.next))return!1;s=s.next}return!0}function c(t,e,i,n){var s=t.prev,r=t,o=t.next;if(0<=T(s,r,o))return!1;for(var a=s.x<r.x?s.x<o.x?s.x:o.x:r.x<o.x?r.x:o.x,h=s.y<r.y?s.y<o.y?s.y:o.y:r.y<o.y?r.y:o.y,l=s.x>r.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,u=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,c=p(a,h,e,i,n),d=p(l,u,e,i,n),f=t.nextZ;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&b(s.x,s.y,r.x,r.y,o.x,o.y,f.x,f.y)&&0<=T(f.prev,f,f.next))return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=c;){if(f!==t.prev&&f!==t.next&&b(s.x,s.y,r.x,r.y,o.x,o.y,f.x,f.y)&&0<=T(f.prev,f,f.next))return!1;f=f.prevZ}return!0}function d(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!a(s,r)&&S(s,n,n.next,r)&&A(s,r)&&A(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),M(n),M(n.next),n=t=r),n=n.next}while(n!==t);return n}function f(t,e,i,n,s,r){var o,a,h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&(a=l,(o=h).next.i!==a.i&&o.prev.i!==a.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&&S(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(o,a)&&A(o,a)&&A(a,o)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;for(;i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next,i!==t;);return n}(o,a))){var u=C(h,l);return h=v(h,h.next),u=v(u,u.next),y(h,e,i,n,s,r),void y(u,e,i,n,s,r)}l=l.next}h=h.next}while(h!==t)}function m(t,e){return t.x-e.x}function x(t,e){if(e=function(t,e){var i,n=e,s=t.x,r=t.y,o=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=s&&o<a){if((o=a)===s){if(r===n.y)return n;if(r===n.next.y)return n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!i)return null;if(s===o)return i.prev;var h,l=i,u=i.x,c=i.y,d=1/0;n=i.next;for(;n!==l;)s>=n.x&&n.x>=u&&s!==n.x&&b(r<c?s:o,r,u,c,r<c?o:s,r,n.x,n.y)&&((h=Math.abs(r-n.y)/(s-n.x))<d||h===d&&n.x>i.x)&&A(n,t)&&(i=n,d=h),n=n.next;return i}(t,e)){var i=C(e,t);v(i,i.next)}}function p(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)/s)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)/s)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function w(t){for(var e=t,i=t;e.x<i.x&&(i=e),(e=e.next)!==t;);return i}function b(t,e,i,n,s,r,o,a){return 0<=(s-o)*(e-a)-(t-o)*(r-a)&&0<=(t-o)*(n-a)-(i-o)*(e-a)&&0<=(i-o)*(r-a)-(s-o)*(n-a)}function T(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function a(t,e){return t.x===e.x&&t.y===e.y}function S(t,e,i,n){return!!(a(t,e)&&a(i,n)||a(t,n)&&a(i,e))||0<T(t,e,i)!=0<T(t,e,n)&&0<T(i,n,t)!=0<T(i,n,e)}function A(t,e){return T(t.prev,t,t.next)<0?0<=T(t,e,t.next)&&0<=T(t,t.prev,e):T(t,e,t.prev)<0||T(t,t.next,e)<0}function C(t,e){var i=new o(t.i,t.x,t.y),n=new o(e.i,e.x,e.y),s=t.next,r=e.prev;return(t.next=e).prev=t,(i.next=s).prev=i,(n.next=i).prev=n,(r.next=n).prev=r,n}function h(t,e,i,n){var s=new o(t,e,i);return n?(s.next=n.next,(s.prev=n).next.prev=s,n.next=s):(s.prev=s).next=s,s}function M(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 o(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 _(t,e,i,n){for(var s=0,r=e,o=i-n;r<i;r+=n)s+=(t[o]-t[r])*(t[r+1]+t[o+1]),o=r;return s}(t.exports=n).deviation=function(t,e,i,n){var s=e&&e.length,r=s?e[0]*i:t.length,o=Math.abs(_(t,0,r,i));if(s)for(var a=0,h=e.length;a<h;a++){var l=e[a]*i,u=a<h-1?e[a+1]*i:t.length;o-=Math.abs(_(t,l,u,i))}var c=0;for(a=0;a<n.length;a+=3){var d=n[a]*i,f=n[a+1]*i,p=n[a+2]*i;c+=Math.abs((t[d]-t[p])*(t[f+1]-t[d+1])-(t[d]-t[f])*(t[p+1]-t[d+1]))}return 0===o&&0===c?0:Math.abs((c-o)/o)},n.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},n=0,s=0;s<t.length;s++){for(var r=0;r<t[s].length;r++)for(var o=0;o<e;o++)i.vertices.push(t[s][r][o]);0<s&&(n+=t[s-1].length,i.holes.push(n))}return i}},function(t,e,i){var n=i(0),vt=i(119),J=i(258),s=i(202),r=i(529),o=i(528),ot=i(27),a=i(84),yt=function(t,e,i,n,s){this.x=t,this.y=e,this.width=i,this.rgb=n,this.alpha=s},mt=function(t,e,i,n,s){this.points=[],this.pointsLength=1,this.points[0]=new yt(t,e,i,n,s)},xt=new Float32Array([1,0,0,1,0,0]),wt=new Float32Array(6e3),bt=0,Tt=[],h=new n({Extends:a,Mixins:[s],initialize:function(t){a.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:t.topology?t.topology:t.renderer.gl.TRIANGLES,vertShader:t.vertShader?t.vertShader:o,fragShader:t.fragShader?t.fragShader:r,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 a.prototype.onBind.call(this),this.mvpUpdate(),this},resize:function(t,e,i){return a.prototype.resize.call(this,t,e,i),this.projOrtho(0,this.width,this.height,0,-1e3,1e3),this},batchFillRect:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,y){this.renderer.setPipeline(this),this.vertexCount+6>this.vertexCapacity&&this.flush();var m=this.vertexViewF32,x=this.vertexViewU32,w=this.vertexCount*this.vertexComponentCount,b=r+a,T=o+h,S=y[0],A=y[1],C=y[2],M=y[3],_=c*S+d*C,E=c*A+d*M,P=f*S+p*C,k=f*A+p*M,L=g*S+v*C+y[4],F=g*A+v*M+y[5],R=r*_+o*P+L,O=r*E+o*k+F,B=r*_+T*P+L,D=r*E+T*k+F,I=b*_+T*P+L,z=b*E+T*k+F,Y=b*_+o*P+L,X=b*E+o*k+F,N=ot.getTintAppendFloatAlphaAndSwap(l,u);m[w+0]=R,m[w+1]=O,x[w+2]=N,m[w+3]=B,m[w+4]=D,x[w+5]=N,m[w+6]=I,m[w+7]=z,x[w+8]=N,m[w+9]=R,m[w+10]=O,x[w+11]=N,m[w+12]=I,m[w+13]=z,x[w+14]=N,m[w+15]=Y,m[w+16]=X,x[w+17]=N,this.vertexCount+=6},batchFillTriangle:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,y,m,x){this.renderer.setPipeline(this),this.vertexCount+3>this.vertexCapacity&&this.flush();var w=this.vertexViewF32,b=this.vertexViewU32,T=this.vertexCount*this.vertexComponentCount,S=x[0],A=x[1],C=x[2],M=x[3],_=f*S+p*C,E=f*A+p*M,P=g*S+v*C,k=g*A+v*M,L=y*S+m*C+x[4],F=y*A+m*M+x[5],R=r*_+o*P+L,O=r*E+o*k+F,B=a*_+h*P+L,D=a*E+h*k+F,I=l*_+u*P+L,z=l*E+u*k+F,Y=ot.getTintAppendFloatAlphaAndSwap(c,d);w[T+0]=R,w[T+1]=O,b[T+2]=Y,w[T+3]=B,w[T+4]=D,b[T+5]=Y,w[T+6]=I,w[T+7]=z,b[T+8]=Y,this.vertexCount+=3},batchStrokeTriangle:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,y,m,x,w){var b=this.tempTriangle;b[0].x=r,b[0].y=o,b[0].width=c,b[0].rgb=d,b[0].alpha=f,b[1].x=a,b[1].y=h,b[1].width=c,b[1].rgb=d,b[1].alpha=f,b[2].x=l,b[2].y=u,b[2].width=c,b[2].rgb=d,b[2].alpha=f,b[3].x=r,b[3].y=o,b[3].width=c,b[3].rgb=d,b[3].alpha=f,this.batchStrokePath(t,e,i,n,s,b,c,d,f,p,g,v,y,m,x,!1,w)},batchFillPath:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p){this.renderer.setPipeline(this);for(var g,v,y,m,x,w,b,T,S,A,C,M,_,E,P,k,L,F=r.length,R=this.polygonCache,O=this.vertexViewF32,B=this.vertexViewU32,D=0,I=p[0],z=p[1],Y=p[2],X=p[3],N=h*I+l*Y,V=h*z+l*X,U=u*I+c*Y,G=u*z+c*X,W=d*I+f*Y+p[4],H=d*z+f*X+p[5],j=ot.getTintAppendFloatAlphaAndSwap(o,a),q=0;q<F;++q)v=r[q],R.push(v.x,v.y);F=(g=J(R)).length;for(var K=0;K<F;K+=3)y=2*g[K+0],m=2*g[K+1],x=2*g[K+2],this.vertexCount+3>this.vertexCapacity&&this.flush(),D=this.vertexCount*this.vertexComponentCount,M=(w=R[y+0])*N+(b=R[y+1])*U+W,_=w*V+b*G+H,E=(T=R[m+0])*N+(S=R[m+1])*U+W,P=T*V+S*G+H,k=(A=R[x+0])*N+(C=R[x+1])*U+W,L=A*V+C*G+H,O[D+0]=M,O[D+1]=_,B[D+2]=j,O[D+3]=E,O[D+4]=P,B[D+5]=j,O[D+6]=k,O[D+7]=L,B[D+8]=j,this.vertexCount+=3;R.length=0},batchStrokePath:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v){var y,m;this.renderer.setPipeline(this);for(var x,w,b,T,S=r.length,A=this.polygonCache,C=this.vertexViewF32,M=this.vertexViewU32,_=ot.getTintAppendFloatAlphaAndSwap,E=0;E+1<S;E+=1)y=r[E],m=r[E+1],T=this.batchLine(t,e,i,n,s,y.x,y.y,m.x,m.y,y.width/2,m.width/2,y.rgb,m.rgb,h,l,u,c,d,f,p,v),A.push(T);for(var P=1,k=A.length;P<k;++P)this.vertexCount+6>this.vertexCapacity&&this.flush(),x=A[P-1]||A[k-1],w=A[P],C[(b=this.vertexCount*this.vertexComponentCount)+0]=x[6],C[b+1]=x[7],M[b+2]=_(x[8],h),C[b+3]=x[0],C[b+4]=x[1],M[b+5]=_(x[2],h),C[b+6]=w[9],C[b+7]=w[10],M[b+8]=_(w[11],h),C[b+9]=x[0],C[b+10]=x[1],M[b+11]=_(x[2],h),C[b+12]=x[6],C[b+13]=x[7],M[b+14]=_(x[8],h),C[b+15]=w[3],C[b+16]=w[4],M[b+17]=_(w[5],h),this.vertexCount+=6;A.length=0},batchLine:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,y,m,x,w){this.renderer.setPipeline(this),this.vertexCount+6>this.vertexCapacity&&this.flush();var b=w[0],T=w[1],S=w[2],A=w[3],C=p*b+g*S,M=p*T+g*A,_=v*b+y*S,E=v*T+y*A,P=m*b+x*S+w[4],k=m*T+x*A+w[5],L=this.vertexViewF32,F=this.vertexViewU32,R=a-r,O=h-o,B=Math.sqrt(R*R+O*O),D=l*(h-o)/B,I=l*(r-a)/B,z=u*(h-o)/B,Y=u*(r-a)/B,X=a-z,N=h-Y,V=r-D,U=o-I,G=a+z,W=h+Y,H=r+D,j=o+I,q=X*C+N*_+P,K=X*M+N*E+k,J=V*C+U*_+P,Z=V*M+U*E+k,Q=G*C+W*_+P,$=G*M+W*E+k,tt=H*C+j*_+P,et=H*M+j*E+k,it=ot.getTintAppendFloatAlphaAndSwap,nt=it(c,f),st=it(d,f),rt=this.vertexCount*this.vertexComponentCount;return L[rt+0]=q,L[rt+1]=K,F[rt+2]=st,L[rt+3]=J,L[rt+4]=Z,F[rt+5]=nt,L[rt+6]=Q,L[rt+7]=$,F[rt+8]=st,L[rt+9]=J,L[rt+10]=Z,F[rt+11]=nt,L[rt+12]=tt,L[rt+13]=et,F[rt+14]=nt,L[rt+15]=Q,L[rt+16]=$,F[rt+17]=st,this.vertexCount+=6,[q,K,d,J,Z,c,Q,$,d,tt,et,c]},batchGraphics:function(t,e,i){if(!(t.commandBuffer.length<=0)){var n=null;i&&(n=i.matrix),this.renderer.setPipeline(this);var s,r,o,a,h,l,u,c,d=e.scrollX*t.scrollFactorX,f=e.scrollY*t.scrollFactorY,p=t.x,g=t.y,v=t.scaleX,y=t.scaleY,m=t.rotation,x=t.commandBuffer,w=t.alpha,b=1,T=1,S=0,A=0,C=1,M=e.matrix.matrix,_=null,E=0,P=0,k=0,L=0,F=0,R=0,O=0,B=0,D=0,I=0,z=null,Y=Math.sin,X=Math.cos,N=2*Math.PI,V=Y(m),U=X(m),G=U*v,W=V*v,H=-V*y,j=U*y,q=p,K=g,J=M[0],Z=M[1],Q=M[2],$=M[3],tt=M[4],et=M[5];if(n){var it=n[0],nt=n[1],st=n[2],rt=n[3],ot=n[4],at=n[5],ht=-d,lt=-f,ut=it*J+nt*Q,ct=it*Z+nt*$,dt=st*J+rt*Q,ft=st*Z+rt*$;s=G*ut+W*dt,r=G*ct+W*ft,o=H*ut+j*dt,a=H*ct+j*ft,h=q*ut+K*dt+(ot*J+at*Q+(ht*J+lt*Q+tt)),l=q*ct+K*ft+(ot*Z+at*$+(ht*Z+lt*$+et))}else s=G*J+W*Q,r=G*Z+W*$,o=H*J+j*Q,a=H*Z+j*$,h=(q-=d)*J+(K-=f)*Q+tt,l=q*Z+K*$+et;for(var pt=Tt.length=0,gt=x.length;pt<gt;++pt)switch($=x[pt]){case vt.ARC:for(E=0,F=x[pt+1],R=x[pt+2],O=x[pt+3],B=x[pt+4],D=x[pt+5],I=x[pt+6],null===_&&(_=new mt(F+X(B)*O,R+Y(B)*O,C,S,b*w),Tt.push(_),E+=.01),D-=B,I?D<-N?D=-N:0<D&&(D=D%N-N):N<D?D=N:D<0&&(D=N+D%N);E<1;)P=F+X(L=D*E+B)*O,k=R+Y(L)*O,_.points.push(new yt(P,k,C,S,b*w)),E+=.01;P=F+X(L=D+B)*O,k=R+Y(L)*O,_.points.push(new yt(P,k,C,S,b*w)),pt+=6;break;case vt.LINE_STYLE:C=x[pt+1],S=x[pt+2],b=x[pt+3],pt+=3;break;case vt.FILL_STYLE:A=x[pt+1],T=x[pt+2],pt+=2;break;case vt.BEGIN_PATH:Tt.length=0,_=null;break;case vt.CLOSE_PATH:_&&_.points.length&&_.points.push(_.points[0]);break;case vt.FILL_PATH:for(u=0,c=Tt.length;u<c;++u)this.batchFillPath(p,g,v,y,m,Tt[u].points,A,T*w,s,r,o,a,h,l,xt);break;case vt.STROKE_PATH:for(u=0,c=Tt.length;u<c;++u)z=Tt[u],this.batchStrokePath(p,g,v,y,m,z.points,C,S,b*w,s,r,o,a,h,l,z===this._lastPath,xt);break;case vt.FILL_RECT:this.batchFillRect(p,g,v,y,m,x[pt+1],x[pt+2],x[pt+3],x[pt+4],A,T*w,s,r,o,a,h,l,xt),pt+=4;break;case vt.FILL_TRIANGLE:this.batchFillTriangle(p,g,v,y,m,x[pt+1],x[pt+2],x[pt+3],x[pt+4],x[pt+5],x[pt+6],A,T*w,s,r,o,a,h,l,xt),pt+=6;break;case vt.STROKE_TRIANGLE:this.batchStrokeTriangle(p,g,v,y,m,x[pt+1],x[pt+2],x[pt+3],x[pt+4],x[pt+5],x[pt+6],C,S,b*w,s,r,o,a,h,l,xt),pt+=6;break;case vt.LINE_TO:null!==_?_.points.push(new yt(x[pt+1],x[pt+2],C,S,b*w)):(_=new mt(x[pt+1],x[pt+2],C,S,b*w),Tt.push(_)),pt+=2;break;case vt.MOVE_TO:_=new mt(x[pt+1],x[pt+2],C,S,b*w),Tt.push(_),pt+=2;break;case vt.LINE_FX_TO:null!==_?_.points.push(new yt(x[pt+1],x[pt+2],x[pt+3],x[pt+4],x[pt+5]*w)):(_=new mt(x[pt+1],x[pt+2],x[pt+3],x[pt+4],x[pt+5]*w),Tt.push(_)),pt+=5;break;case vt.MOVE_FX_TO:_=new mt(x[pt+1],x[pt+2],x[pt+3],x[pt+4],x[pt+5]*w),Tt.push(_),pt+=5;break;case vt.SAVE:wt[bt+0]=xt[0],wt[bt+1]=xt[1],wt[bt+2]=xt[2],wt[bt+3]=xt[3],wt[bt+4]=xt[4],wt[bt+5]=xt[5],bt+=6;break;case vt.RESTORE:bt-=6,xt[0]=wt[bt+0],xt[1]=wt[bt+1],xt[2]=wt[bt+2],xt[3]=wt[bt+3],xt[4]=wt[bt+4],xt[5]=wt[bt+5];break;case vt.TRANSLATE:F=x[pt+1],R=x[pt+2],xt[4]=xt[0]*F+xt[2]*R+xt[4],xt[5]=xt[1]*F+xt[3]*R+xt[5],pt+=2;break;case vt.SCALE:F=x[pt+1],R=x[pt+2],xt[0]*=F,xt[1]*=F,xt[2]*=R,xt[3]*=R,pt+=2;break;case vt.ROTATE:F=Y(R=x[pt+1]),R=X(R),G=xt[0],W=xt[1],H=xt[2],j=xt[3],xt[0]=R*G+F*H,xt[1]=R*W+F*j,xt[2]=-F*G+R*H,xt[3]=-F*W+R*j,pt+=1;break;default:console.error("Phaser: Invalid Graphics Command ID "+$)}}},drawStaticTilemapLayer:function(){},drawEmitterManager:function(){},drawBlitter:function(){},batchSprite:function(){},batchMesh:function(){},batchBitmapText:function(){},batchDynamicBitmapText:function(){},batchText:function(){},batchDynamicTilemapLayer:function(){},batchTileSprite:function(){}});t.exports=h},function(t,e,i){var n=i(0),s=i(531),r=i(530),o=i(84),a=new n({Extends:o,initialize:function(t){o.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:t.topology?t.topology:t.renderer.gl.TRIANGLES,vertShader:t.vertShader?t.vertShader:r,fragShader:t.fragShader?t.fragShader:s,vertexCapacity:t.vertexCapacity?t.vertexCapacity:3,vertexSize:t.vertexSize?t.vertexSize:2*Float32Array.BYTES_PER_ELEMENT,vertices:new Float32Array([-1,1,-1,-7,7,1]).buffer,attributes:[{name:"inPosition",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:0}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.maxQuads=1,this.resolutionDirty=!0},onBind:function(){o.prototype.onBind.call(this);var t=this.renderer,e=this.program;return this.resolutionDirty&&(t.setFloat2(e,"uResolution",this.width,this.height),t.setInt1(e,"uMainSampler",0),t.setInt1(e,"uMaskSampler",1),this.resolutionDirty=!1),this},resize:function(t,e,i){return o.prototype.resize.call(this,t,e,i),this.resolutionDirty=!0,this},beginMask:function(t,e,i){var n=t.bitmapMask,s=this.renderer,r=this.gl,o=n.visible;n&&r&&(s.setFramebuffer(t.maskFramebuffer),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),n.visible=!0,n.renderWebGL(s,n,0,i),n.visible=o,s.flush(),s.setFramebuffer(t.mainFramebuffer),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT))},endMask:function(t){var e=t.bitmapMask,i=this.renderer,n=this.gl;e&&(i.setFramebuffer(null),i.setPipeline(this),i.setTexture2D(t.maskTexture,1),i.setTexture2D(t.mainTexture,0),i.setInt1(this.program,"uInvertMaskAlpha",t.invertAlpha),n.drawArrays(this.topology,0,3))}});t.exports=a},function(t,e){t.exports=function(t,e,i){e||(e="image/png"),i||(i=.92);var n=t.getContext("experimental-webgl"),s=new Uint8Array(n.drawingBufferWidth*n.drawingBufferHeight*4);n.readPixels(0,0,n.drawingBufferWidth,n.drawingBufferHeight,n.RGBA,n.UNSIGNED_BYTE,s);var r,o=document.createElement("canvas"),a=o.getContext("2d");o.width=n.drawingBufferWidth,o.height=n.drawingBufferHeight;for(var h=(r=a.getImageData(0,0,o.width,o.height)).data,l=0;l<o.height;l+=1)for(var u=0;u<o.width;u+=1){var c=4*((o.height-l)*o.width+u),d=4*(l*o.width+u);h[d+0]=s[c+0],h[d+1]=s[c+1],h[d+2]=s[c+2],h[d+3]=s[c+3]}a.putImageData(r,0,0);var f=o.toDataURL(e,i),p=new Image;return p.src=f,p}},function(t,e,i){var n=i(0),u=i(20),a=i(85),s=i(56),h=i(27),r=i(261),l=i(260),c=i(259),d=i(148),f=i(129),o=new n({initialize:function(t){var n=this,e=t.config,i={alpha:e.transparent,depth:!1,antialias:e.antialias,premultipliedAlpha:e.premultipliedAlpha,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,failIfMajorPerformanceCaveat:e.failIfMajorPerformanceCaveat,powerPreference:e.powerPreference};this.config={clearBeforeRender:e.clearBeforeRender,pixelArt:e.pixelArt,backgroundColor:e.backgroundColor,contextCreation:i,resolution:e.resolution,autoResize:e.autoResize,roundPixels:e.roundPixels,maxTextures:e.maxTextures,maxTextureSize:e.maxTextureSize},this.game=t,this.type=u.WEBGL,this.width=t.config.width,this.height=t.config.height,this.canvas=t.canvas,this.lostContextCallbacks=[],this.restoredContextCallbacks=[],this.blendModes=[],this.nativeTextures=[],this.contextLost=!1,this.pipelines=null,this.snapshotState={callback:null,type:null,encoder:null},this.currentActiveTextureUnit=0,this.currentTextures=new Array(16),this.currentFramebuffer=null,this.currentPipeline=null,this.currentProgram=null,this.currentVertexBuffer=null,this.currentIndexBuffer=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=new Uint32Array([0,0,this.width,this.height]),this.currentScissorIdx=0,this.scissorStack=new Uint32Array(4e3),this.canvas.addEventListener("webglcontextlost",function(t){n.contextLost=!0,t.preventDefault();for(var e=0;e<n.lostContextCallbacks.length;++e){var i=n.lostContextCallbacks[e];i[0].call(i[1],n)}},!1),this.canvas.addEventListener("webglcontextrestored",function(){n.contextLost=!1,n.init(n.config);for(var t=0;t<n.restoredContextCallbacks.length;++t){var e=n.restoredContextCallbacks[t];e[0].call(e[1],n)}},!1),this.gl=null,this.supportedExtensions=null,this.extensions={},this.glFormats=[],this.compression={ETC1:!1,PVRTC:!1,S3TC:!1},this.init(this.config)},init:function(t){var e,i=this.canvas,n=t.backgroundColor;if(!(e=this.game.config.context?this.game.config.context:i.getContext("webgl",t.contextCreation)||i.getContext("experimental-webgl",t.contextCreation))||e.isContextLost())throw this.contextLost=!0,new Error("This browser does not support WebGL. Try using the Canvas pipeline.");this.gl=e,this.game.context=e;for(var s=0;s<=16;s++)this.blendModes.push({func:[e.ONE,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_ADD});this.blendModes[1].func=[e.ONE,e.DST_ALPHA],this.blendModes[2].func=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[e.ONE,e.ONE_MINUS_SRC_COLOR],this.glFormats[0]=e.BYTE,this.glFormats[1]=e.SHORT,this.glFormats[2]=e.UNSIGNED_BYTE,this.glFormats[3]=e.UNSIGNED_SHORT,this.glFormats[4]=e.FLOAT;var r=e.getSupportedExtensions();t.maxTextures||(t.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),t.maxTextureSize||(t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE));var o="WEBGL_compressed_texture_",a="WEBKIT_"+o;this.compression.ETC1=e.getExtension(o+"etc1")||e.getExtension(a+"etc1"),this.compression.PVRTC=e.getExtension(o+"pvrtc")||e.getExtension(a+"pvrtc"),this.compression.S3TC=e.getExtension(o+"s3tc")||e.getExtension(a+"s3tc"),this.supportedExtensions=r,e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),e.disable(e.SCISSOR_TEST),e.enable(e.BLEND),e.clearColor(n.redGL,n.greenGL,n.blueGL,1);for(var h=0;h<this.currentTextures.length;++h)this.currentTextures[h]=null;return this.pipelines={},this.addPipeline("TextureTintPipeline",new f({game:this.game,renderer:this})),this.addPipeline("FlatTintPipeline",new c({game:this.game,renderer:this})),this.addPipeline("BitmapMaskPipeline",new l({game:this.game,renderer:this})),this.addPipeline("Light2D",new d({game:this.game,renderer:this})),this.setBlendMode(u.BlendModes.NORMAL),this.resize(this.width,this.height),this},resize:function(t,e){var i=this.gl,n=this.pipelines,s=this.config.resolution;for(var r in this.width=Math.floor(t*s),this.height=Math.floor(e*s),this.canvas.width=this.width,this.canvas.height=this.height,this.config.autoResize&&(this.canvas.style.width=this.width/s+"px",this.canvas.style.height=this.height/s+"px"),i.viewport(0,0,this.width,this.height),n)n[r].resize(t,e,s);return this.currentScissor.set([0,0,this.width,this.height]),this},onContextRestored:function(t,e){return this.restoredContextCallbacks.push([t,e]),this},onContextLost:function(t,e){return this.lostContextCallbacks.push([t,e]),this},hasExtension:function(t){return!!this.supportedExtensions&&this.supportedExtensions.indexOf(t)},getExtension:function(t){return this.hasExtension(t)?(t in this.extensions||(this.extensions[t]=this.gl.getExtension(t)),this.extensions[t]):null},flush:function(){this.currentPipeline&&this.currentPipeline.flush()},hasPipeline:function(t){return t in this.pipelines},getPipeline:function(t){return this.hasPipeline(t)?this.pipelines[t]:null},removePipeline:function(t){return delete this.pipelines[t],this},addPipeline:function(t,e){return this.hasPipeline(t)?console.warn("Pipeline",t," already exists."):this.pipelines[t]=e,e.name=t,this.pipelines[t].resize(this.width,this.height,this.config.resolution),e},setScissor:function(t,e,i,n){var s=this.gl,r=this.currentScissor,o=0===t&&0===e&&i===s.canvas.width&&n===s.canvas.height&&0<=i&&0<=n;return r[0]===t&&r[1]===e&&r[2]===i&&r[3]===n||this.flush(),r[0]=t,r[1]=e,r[2]=i,r[3]=n,(this.currentScissorEnabled=o)?s.disable(s.SCISSOR_TEST):(s.enable(s.SCISSOR_TEST),s.scissor(t,s.drawingBufferHeight-e-n,i,n)),this},pushScissor:function(t,e,i,n){var s=this.scissorStack,r=this.currentScissorIdx,o=this.currentScissor;return s[r+0]=o[0],s[r+1]=o[1],s[r+2]=o[2],s[r+3]=o[3],this.currentScissorIdx+=4,this.setScissor(t,e,i,n),this},popScissor:function(){var t=this.scissorStack,e=this.currentScissorIdx-4,i=t[e+0],n=t[e+1],s=t[e+2],r=t[e+3];return this.currentScissorIdx=e,this.setScissor(i,n,s,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!==u.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t&&(this.flush(),e.enable(e.BLEND),e.blendEquation(i.equation),2<i.func.length?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 16<t&&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,n){var s=this.gl,r=s.NEAREST,o=s.CLAMP_TO_EDGE;return e=t?t.width:e,i=t?t.height:i,a(e,i)&&(o=s.REPEAT),n===u.ScaleModes.LINEAR?r=s.LINEAR:(n===u.ScaleModes.NEAREST||this.config.pixelArt)&&(r=s.NEAREST),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,r,r,o,o,s.RGBA,t):this.createTexture2D(0,r,r,o,o,s.RGBA,null,e,i)},createTexture2D:function(t,e,i,n,s,r,o,a,h,l){var u=this.gl,c=u.createTexture();return l=null==l||l,this.setTexture2D(c,0),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,e),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,i),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,s),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,n),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),null==o?u.texImage2D(u.TEXTURE_2D,t,r,a,h,0,r,u.UNSIGNED_BYTE,null):(u.texImage2D(u.TEXTURE_2D,t,r,r,u.UNSIGNED_BYTE,o),a=o.width,h=o.height),this.setTexture2D(null,0),c.isAlphaPremultiplied=l,c.isRenderTexture=!1,c.width=a,c.height=h,this.nativeTextures.push(c),c},createFramebuffer:function(t,e,i,n){var s,r=this.gl,o=r.createFramebuffer();if(this.setFramebuffer(o),n){var a=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)}if(i.isRenderTexture=!0,i.isAlphaPremultiplied=!1,r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,i,0),(s=r.checkFramebufferStatus(r.FRAMEBUFFER))!==r.FRAMEBUFFER_COMPLETE){throw new Error("Framebuffer incomplete. Framebuffer status: "+{36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"}[s])}return o.renderTexture=i,this.setFramebuffer(null),o},createProgram:function(t,e){var i=this.gl,n=i.createProgram(),s=i.createShader(i.VERTEX_SHADER),r=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(s,t),i.shaderSource(r,e),i.compileShader(s),i.compileShader(r),!i.getShaderParameter(s,i.COMPILE_STATUS))throw new Error("Failed to compile Vertex Shader:\n"+i.getShaderInfoLog(s));if(!i.getShaderParameter(r,i.COMPILE_STATUS))throw new Error("Failed to compile Fragment Shader:\n"+i.getShaderInfoLog(r));if(i.attachShader(n,s),i.attachShader(n,r),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw new Error("Failed to link program:\n"+i.getProgramInfoLog(n));return n},createVertexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setVertexBuffer(n),i.bufferData(i.ARRAY_BUFFER,t,e),this.setVertexBuffer(null),n},createIndexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setIndexBuffer(n),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t,e),this.setIndexBuffer(null),n},deleteTexture:function(t){var e=this.nativeTextures.indexOf(t);return-1!==e&&s(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),n=Math.floor(t.y*e),s=Math.floor(t.width*e),r=Math.floor(t.height*e);if(this.pushScissor(i,n,s,r),0<t.backgroundColor.alphaGL){var o=t.backgroundColor,a=this.pipelines.FlatTintPipeline;a.batchFillRect(0,0,1,1,0,t.x,t.y,t.width,t.height,h.getTintFromFloats(o.redGL,o.greenGL,o.blueGL,1),o.alphaGL,1,0,0,1,0,0,[1,0,0,1,0,0]),a.flush()}},postRenderCamera:function(t){var e=this.pipelines.FlatTintPipeline,i=t.flashEffect.postRenderWebGL(e,h.getTintFromFloats);(t.fadeEffect.postRenderWebGL(e,h.getTintFromFloats)||i)&&e.flush(),this.popScissor()},preRender:function(){if(!this.contextLost){var t=this.gl,e=this.config.backgroundColor,i=this.pipelines;for(var n 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[n].onPreRender()}},render:function(t,e,i,n){if(!this.contextLost){var s=e.list,r=s.length,o=this.pipelines;for(var a in o)o[a].onRender(t,n);this.preRenderCamera(n);for(var h=0;h<r;++h){var l=s[h];l.willRender()&&(l.blendMode!==this.currentBlendMode&&this.setBlendMode(l.blendMode),l.mask&&l.mask.preRenderWebGL(this,l,n),l.renderWebGL(this,l,i,n),l.mask&&l.mask.postRenderWebGL(this,l))}this.flush(),this.setBlendMode(u.BlendModes.NORMAL),this.postRenderCamera(n)}},postRender:function(){if(!this.contextLost){this.snapshotState.callback&&(this.snapshotState.callback(r(this.canvas,this.snapshotState.type,this.snapshotState.encoder)),this.snapshotState.callback=null);var t=this.pipelines;for(var e in t)t[e].onPostRender()}},snapshot:function(t,e,i){return this.snapshotState.callback=t,this.snapshotState.type=e,this.snapshotState.encoder=i,this},canvasToTexture:function(t,e){var i=this.gl;if(e)this.setTexture2D(e,0),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,t),e.width=t.width,e.height=t.height,this.setTexture2D(null,0);else{var n=i.CLAMP_TO_EDGE;a(t.width,t.height)&&(n=i.REPEAT),e=this.createTexture2D(0,i.NEAREST,i.NEAREST,n,n,i.RGBA,t,t.width,t.height,!0)}return e},setTextureFilter:function(t,e){var i=this.gl,n=[i.LINEAR,i.NEAREST][e];return this.setTexture2D(t,0),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,n),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,n),this.setTexture2D(null,0),this},setFloat1:function(t,e,i){return this.setProgram(t),this.gl.uniform1f(this.gl.getUniformLocation(t,e),i),this},setFloat2:function(t,e,i,n){return this.setProgram(t),this.gl.uniform2f(this.gl.getUniformLocation(t,e),i,n),this},setFloat3:function(t,e,i,n,s){return this.setProgram(t),this.gl.uniform3f(this.gl.getUniformLocation(t,e),i,n,s),this},setFloat4:function(t,e,i,n,s,r){return this.setProgram(t),this.gl.uniform4f(this.gl.getUniformLocation(t,e),i,n,s,r),this},setInt1:function(t,e,i){return this.setProgram(t),this.gl.uniform1i(this.gl.getUniformLocation(t,e),i),this},setInt2:function(t,e,i,n){return this.setProgram(t),this.gl.uniform2i(this.gl.getUniformLocation(t,e),i,n),this},setInt3:function(t,e,i,n,s){return this.setProgram(t),this.gl.uniform3i(this.gl.getUniformLocation(t,e),i,n,s),this},setInt4:function(t,e,i,n,s,r){return this.setProgram(t),this.gl.uniform4i(this.gl.getUniformLocation(t,e),i,n,s,r),this},setMatrix2:function(t,e,i,n){return this.setProgram(t),this.gl.uniformMatrix2fv(this.gl.getUniformLocation(t,e),i,n),this},setMatrix3:function(t,e,i,n){return this.setProgram(t),this.gl.uniformMatrix3fv(this.gl.getUniformLocation(t,e),i,n),this},setMatrix4:function(t,e,i,n){return this.setProgram(t),this.gl.uniformMatrix4fv(this.gl.getUniformLocation(t,e),i,n),this},getMaxTextures:function(){return this.config.maxTextures},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){for(var t in this.pipelines)this.pipelines[t].destroy(),delete this.pipelines[t];for(var e=0;e<this.nativeTextures.length;++e)this.deleteTexture(this.nativeTextures[e]),delete this.nativeTextures[e];delete this.gl,delete this.game,this.contextLost=!0,this.extensions={},this.nativeTextures.length=0}});t.exports=o},function(t,e,i){var n=i(51),s=i(203);t.exports=function(){var t=[],e=s.supportNewBlendModes;return t[n.NORMAL]="source-over",t[n.ADD]="lighter",t[n.MULTIPLY]=e?"multiply":"source-over",t[n.SCREEN]=e?"screen":"source-over",t[n.OVERLAY]=e?"overlay":"source-over",t[n.DARKEN]=e?"darken":"source-over",t[n.LIGHTEN]=e?"lighten":"source-over",t[n.COLOR_DODGE]=e?"color-dodge":"source-over",t[n.COLOR_BURN]=e?"color-burn":"source-over",t[n.HARD_LIGHT]=e?"hard-light":"source-over",t[n.SOFT_LIGHT]=e?"soft-light":"source-over",t[n.DIFFERENCE]=e?"difference":"source-over",t[n.EXCLUSION]=e?"exclusion":"source-over",t[n.HUE]=e?"hue":"source-over",t[n.SATURATION]=e?"saturation":"source-over",t[n.COLOR]=e?"color":"source-over",t[n.LUMINOSITY]=e?"luminosity":"source-over",t}},function(t,e){var f=!1,i=function(t,e,i){var n=this.currentContext,s=t.frame,r=s.canvasData;this.currentBlendMode!==t.blendMode&&(this.currentBlendMode=t.blendMode,n.globalCompositeOperation=this.blendModes[t.blendMode]),this.currentAlpha!==t.alpha&&(this.currentAlpha=t.alpha,n.globalAlpha=t.alpha),this.currentScaleMode!==t.scaleMode&&(this.currentScaleMode=t.scaleMode);var o=s.x,a=s.y,h=1,l=1;t.flipX?(h=-1,o-=r.dWidth-t.displayOriginX):o-=t.displayOriginX,t.flipY?(l=-1,a-=r.dHeight-t.displayOriginY):a-=t.displayOriginY;var u=t.x-e.scrollX*t.scrollFactorX,c=t.y-e.scrollY*t.scrollFactorY;if(f&&(u|=0,c|=0,o|=0,a|=0),n.save(),i){var d=i.matrix;n.transform(d[0],d[1],d[2],d[3],d[4],d[5])}n.translate(u,c),n.rotate(t.rotation),n.scale(t.scaleX,t.scaleY),n.scale(h,l),n.drawImage(s.source.image,r.sx,r.sy,r.sWidth,r.sHeight,o,a,r.dWidth,r.dHeight),n.restore()};t.exports=function(t){return f=t,i}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e="image/png"),void 0===i&&(i=.92);var n=t.toDataURL(e,i),s=new Image;return s.src=n,s}},function(t,e){var r=!1,i=function(t,e,i){var n=this.currentContext,s=i.canvasData;r&&(t|=0,e|=0),n.drawImage(i.source.image,s.sx,s.sy,s.sWidth,s.sHeight,t,e,s.dWidth,s.dHeight)};t.exports=function(t){return r=t,i}},function(t,e,i){var n=i(266),s=i(265),r=i(0),o=i(20),a=i(264),h=i(263),l=i(59),u=i(131),c=new r({initialize:function(t){this.game=t,this.type=o.CANVAS,this.drawCount=0,this.width=t.config.width,this.height=t.config.height,this.config={clearBeforeRender:t.config.clearBeforeRender,pixelArt:t.config.pixelArt,backgroundColor:t.config.backgroundColor,resolution:t.config.resolution,autoResize:t.config.autoResize,roundPixels:t.config.roundPixels},this.scaleMode=t.config.pixelArt?l.NEAREST:l.LINEAR,this.gameCanvas=t.canvas,this.gameContext=this.game.config.context?this.game.config.context:this.gameCanvas.getContext("2d"),this.currentContext=this.gameContext,this.drawImage=a(this.config.roundPixels),this.blitImage=n(this.config.roundPixels),this.blendModes=h(),this.currentAlpha=1,this.currentBlendMode=0,this.currentScaleMode=0,this.snapshotCallback=null,this.snapshotType=null,this.snapshotEncoder=null,this.init()},init:function(){this.resize(this.width,this.height)},resize:function(t,e){var i=this.config.resolution;this.width=t*i,this.height=e*i,this.gameCanvas.width=this.width,this.gameCanvas.height=this.height,this.config.autoResize&&(this.gameCanvas.style.width=this.width/i+"px",this.gameCanvas.style.height=this.height/i+"px"),this.scaleMode===l.NEAREST&&u.disable(this.gameContext)},onContextLost:function(){},onContextRestored:function(){},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentBlendMode!==t&&(this.currentContext.globalCompositeOperation=t,this.currentBlendMode=t),this.currentBlendMode},setAlpha:function(t){return this.currentAlpha!==t&&(this.currentContext.globalAlpha=t,this.currentAlpha=t),this.currentAlpha},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,n=this.height;e.clearBeforeRender&&t.clearRect(0,0,i,n),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,n)),this.drawCount=0},render:function(t,e,i,n){var s=t.sys.context,r=0!==n.x||0!==n.y||n.width!==s.canvas.width||n.height!==s.canvas.height,o=e.list,a=this.config.resolution;this.currentContext=s,n.transparent||(s.fillStyle=n.backgroundColor.rgba,s.fillRect(n.x,n.y,n.width,n.height)),1!==this.currentAlpha&&(s.globalAlpha=1,this.currentAlpha=1),0!==this.currentBlendMode&&(s.globalCompositeOperation="source-over",this.currentBlendMode=0),this.currentScaleMode=0,this.drawCount+=o.length,r&&(s.save(),s.beginPath(),s.rect(n.x*a,n.y*a,n.width*a,n.height*a),s.clip());var h=n.matrix.matrix;s.setTransform(h[0],h[1],h[2],h[3],h[4],h[5]);for(var l=0;l<o.length;l++){var u=o[l];u.mask&&u.mask.preRenderCanvas(this,u,n),u.renderCanvas(this,u,i,n),u.mask&&u.mask.postRenderCanvas(this,u,n)}s.setTransform(1,0,0,1,0,0),s.globalCompositeOperation="source-over",n.flashEffect.postRenderCanvas(s),n.fadeEffect.postRenderCanvas(s),r&&s.restore()},postRender:function(){var t=this.gameContext;t.globalAlpha=1,t.globalCompositeOperation="source-over",this.currentAlpha=1,this.currentBlendMode=0,this.snapshotCallback&&(this.snapshotCallback(s(this.gameCanvas,this.snapshotType,this.snapshotEncoder)),this.snapshotCallback=null)},snapshot:function(t,e,i){this.snapshotCallback=t,this.snapshotType=e,this.snapshotEncoder=i},destroy:function(){this.gameCanvas=null,this.gameContext=null,this.game=null}});t.exports=c},function(t,e,i){var n=i(0),s=i(3),r=new n({initialize:function(){this.isRunning=!1,this.callback=s,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0;var n=this;this.step=function t(e){n.lastTime=n.tick,n.tick=e,n.callback(e),n.timeOutID=window.requestAnimationFrame(t)},this.stepTimeout=function t(){var e=Date.now(),i=Math.max(16+n.lastTime-e,0);n.lastTime=n.tick,n.tick=e,n.callback(e),n.timeOutID=window.setTimeout(t,i)}},start:function(t,e){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=s}});t.exports=r},function(t,e){t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},function(t,e){t.exports=function(t){var e="";try{window.DOMParser?e=(new DOMParser).parseFromString(t,"text/xml"):(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},function(t,e,i){var n=i(57);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?n.cordova&&!n.cocoonJS?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},function(t,e){t.exports={setCrisp:function(e){return["optimizeSpeed","crisp-edges","-moz-crisp-edges","-webkit-optimize-contrast","optimize-contrast","pixelated"].forEach(function(t){e.style["image-rendering"]=t}),e.style.msInterpolationMode="nearest-neighbor",e},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e){t.exports=function(t,e,i,n,s){var r=.5*(n-e),o=.5*(s-i),a=t*t;return(2*i-2*n+r+o)*(t*a)+(-3*i+3*n-2*r-o)*a+r*t+i}},function(t,e,i){var u=i(14);t.exports=function(t,e){if(void 0===e&&(e=new u),0===t.length)return e;for(var i,n,s,r=Number.MAX_VALUE,o=Number.MAX_VALUE,a=Number.MIN_SAFE_INTEGER,h=Number.MIN_SAFE_INTEGER,l=0;l<t.length;l++)i=t[l],Array.isArray(i)?(n=i[0],s=i[1]):(n=i.x,s=i.y),r=Math.min(r,n),o=Math.min(o,s),a=Math.max(a,n),h=Math.max(h,s);return e.x=r,e.y=o,e.width=a-r,e.height=h-o,e}},function(t,e){t.exports={0:"#000",1:"#9D9D9D",2:"#FFF",3:"#BE2633",4:"#E06F8B",5:"#493C2B",6:"#A46422",7:"#EB8931",8:"#F7E26B",9:"#2F484E",A:"#44891A",B:"#A3CE27",C:"#1B2632",D:"#005784",E:"#31A2F2",F:"#B2DCEF"}},function(t,e,i){var y=i(275),m=i(22),x=i(4);t.exports=function(t){var e=x(t,"data",[]),i=x(t,"canvas",null),n=x(t,"palette",y),s=x(t,"pixelWidth",1),r=x(t,"pixelHeight",s),o=x(t,"resizeCanvas",!0),a=x(t,"clearCanvas",!0),h=x(t,"preRender",null),l=x(t,"postRender",null),u=Math.floor(Math.abs(e[0].length*s)),c=Math.floor(Math.abs(e.length*r));i||(i=m.create2D(this,u,c),a=o=!1),o&&(i.width=u,i.height=c);var d=i.getContext("2d");a&&d.clearRect(0,0,u,c),h&&h(i,d);for(var f=0;f<e.length;f++)for(var p=e[f],g=0;g<p.length;g++){var v=p[g];"."!==v&&" "!==v&&(d.fillStyle=n[v],d.fillRect(g*s,f*r,s,r))}return l&&l(i,d),i}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},clone:function(){return new n(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n;return 0<s&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return Math.sqrt(e*e+i*i+n*n+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return e*e+i*i+n*n+s*s},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*n+r[12]*s,this.y=r[1]*e+r[5]*i+r[9]*n+r[13]*s,this.z=r[2]*e+r[6]*i+r[10]*n+r[14]*s,this.w=r[3]*e+r[7]*i+r[11]*n+r[15]*s,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});n.prototype.sub=n.prototype.subtract,n.prototype.mul=n.prototype.multiply,n.prototype.div=n.prototype.divide,n.prototype.dist=n.prototype.distance,n.prototype.distSq=n.prototype.distanceSq,n.prototype.len=n.prototype.length,n.prototype.lenSq=n.prototype.lengthSq,t.exports=n},function(t,e,i){var n=i(0),s=new n({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},xyz:function(t,e,i){this.identity();var n=this.val;return n[12]=t,n[13]=e,n[14]=i,this},scaling:function(t,e,i){this.zero();var n=this.val;return n[0]=t,n[5]=e,n[10]=i,n[15]=1,this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],s=t[6],r=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=s,t[11]=t[14],t[12]=n,t[13]=r,t[14]=o,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15],y=e*o-i*r,m=e*a-n*r,x=e*h-s*r,w=i*a-n*o,b=i*h-s*o,T=n*h-s*a,S=l*p-u*f,A=l*g-c*f,C=l*v-d*f,M=u*g-c*p,_=u*v-d*p,E=c*v-d*g,P=y*E-m*_+x*M+w*C-b*A+T*S;return P?(P=1/P,t[0]=(o*E-a*_+h*M)*P,t[1]=(n*_-i*E-s*M)*P,t[2]=(p*T-g*b+v*w)*P,t[3]=(c*b-u*T-d*w)*P,t[4]=(a*C-r*E-h*A)*P,t[5]=(e*E-n*C+s*A)*P,t[6]=(g*x-f*T-v*m)*P,t[7]=(l*T-c*x+d*m)*P,t[8]=(r*_-o*C+h*S)*P,t[9]=(i*C-e*_-s*S)*P,t[10]=(f*b-p*x+v*y)*P,t[11]=(u*x-l*b-d*y)*P,t[12]=(o*A-r*M-a*S)*P,t[13]=(e*M-i*A+n*S)*P,t[14]=(p*m-f*w-g*y)*P,t[15]=(l*w-u*m+c*y)*P,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return t[0]=o*(c*v-d*g)-u*(a*v-h*g)+p*(a*d-h*c),t[1]=-(i*(c*v-d*g)-u*(n*v-s*g)+p*(n*d-s*c)),t[2]=i*(a*v-h*g)-o*(n*v-s*g)+p*(n*h-s*a),t[3]=-(i*(a*d-h*c)-o*(n*d-s*c)+u*(n*h-s*a)),t[4]=-(r*(c*v-d*g)-l*(a*v-h*g)+f*(a*d-h*c)),t[5]=e*(c*v-d*g)-l*(n*v-s*g)+f*(n*d-s*c),t[6]=-(e*(a*v-h*g)-r*(n*v-s*g)+f*(n*h-s*a)),t[7]=e*(a*d-h*c)-r*(n*d-s*c)+l*(n*h-s*a),t[8]=r*(u*v-d*p)-l*(o*v-h*p)+f*(o*d-h*u),t[9]=-(e*(u*v-d*p)-l*(i*v-s*p)+f*(i*d-s*u)),t[10]=e*(o*v-h*p)-r*(i*v-s*p)+f*(i*h-s*o),t[11]=-(e*(o*d-h*u)-r*(i*d-s*u)+l*(i*h-s*o)),t[12]=-(r*(u*g-c*p)-l*(o*g-a*p)+f*(o*c-a*u)),t[13]=e*(u*g-c*p)-l*(i*g-n*p)+f*(i*c-n*u),t[14]=-(e*(o*g-a*p)-r*(i*g-n*p)+f*(i*a-n*o)),t[15]=e*(o*c-a*u)-r*(i*c-n*u)+l*(i*a-n*o),this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return(e*o-i*r)*(c*v-d*g)-(e*a-n*r)*(u*v-d*p)+(e*h-s*r)*(u*g-c*p)+(i*a-n*o)*(l*v-d*f)-(i*h-s*o)*(l*g-c*f)+(n*h-s*a)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],g=e[13],v=e[14],y=e[15],m=t.val,x=m[0],w=m[1],b=m[2],T=m[3];return e[0]=x*i+w*o+b*u+T*p,e[1]=x*n+w*a+b*c+T*g,e[2]=x*s+w*h+b*d+T*v,e[3]=x*r+w*l+b*f+T*y,x=m[4],w=m[5],b=m[6],T=m[7],e[4]=x*i+w*o+b*u+T*p,e[5]=x*n+w*a+b*c+T*g,e[6]=x*s+w*h+b*d+T*v,e[7]=x*r+w*l+b*f+T*y,x=m[8],w=m[9],b=m[10],T=m[11],e[8]=x*i+w*o+b*u+T*p,e[9]=x*n+w*a+b*c+T*g,e[10]=x*s+w*h+b*d+T*v,e[11]=x*r+w*l+b*f+T*y,x=m[12],w=m[13],b=m[14],T=m[15],e[12]=x*i+w*o+b*u+T*p,e[13]=x*n+w*a+b*c+T*g,e[14]=x*s+w*h+b*d+T*v,e[15]=x*r+w*l+b*f+T*y,this},multiplyLocal:function(t){var e=[],i=this.val,n=t.val;return e[0]=i[0]*n[0]+i[1]*n[4]+i[2]*n[8]+i[3]*n[12],e[1]=i[0]*n[1]+i[1]*n[5]+i[2]*n[9]+i[3]*n[13],e[2]=i[0]*n[2]+i[1]*n[6]+i[2]*n[10]+i[3]*n[14],e[3]=i[0]*n[3]+i[1]*n[7]+i[2]*n[11]+i[3]*n[15],e[4]=i[4]*n[0]+i[5]*n[4]+i[6]*n[8]+i[7]*n[12],e[5]=i[4]*n[1]+i[5]*n[5]+i[6]*n[9]+i[7]*n[13],e[6]=i[4]*n[2]+i[5]*n[6]+i[6]*n[10]+i[7]*n[14],e[7]=i[4]*n[3]+i[5]*n[7]+i[6]*n[11]+i[7]*n[15],e[8]=i[8]*n[0]+i[9]*n[4]+i[10]*n[8]+i[11]*n[12],e[9]=i[8]*n[1]+i[9]*n[5]+i[10]*n[9]+i[11]*n[13],e[10]=i[8]*n[2]+i[9]*n[6]+i[10]*n[10]+i[11]*n[14],e[11]=i[8]*n[3]+i[9]*n[7]+i[10]*n[11]+i[11]*n[15],e[12]=i[12]*n[0]+i[13]*n[4]+i[14]*n[8]+i[15]*n[12],e[13]=i[12]*n[1]+i[13]*n[5]+i[14]*n[9]+i[15]*n[13],e[14]=i[12]*n[2]+i[13]*n[6]+i[14]*n[10]+i[15]*n[14],e[15]=i[12]*n[3]+i[13]*n[7]+i[14]*n[11]+i[15]*n[15],this.fromArray(e)},translate:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[12]=s[0]*e+s[4]*i+s[8]*n+s[12],s[13]=s[1]*e+s[5]*i+s[9]*n+s[13],s[14]=s[2]*e+s[6]*i+s[10]*n+s[14],s[15]=s[3]*e+s[7]*i+s[11]*n+s[15],this},scale:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[0]=s[0]*e,s[1]=s[1]*e,s[2]=s[2]*e,s[3]=s[3]*e,s[4]=s[4]*i,s[5]=s[5]*i,s[6]=s[6]*i,s[7]=s[7]*i,s[8]=s[8]*n,s[9]=s[9]*n,s[10]=s[10]*n,s[11]=s[11]*n,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),s=1-i,r=t.x,o=t.y,a=t.z,h=s*r,l=s*o;return this.fromArray([h*r+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*r,0,h*a-n*o,l*a+n*r,s*a*a+i,0,0,0,0,1]),this},rotate:function(t,e){var i=this.val,n=e.x,s=e.y,r=e.z,o=Math.sqrt(n*n+s*s+r*r);if(Math.abs(o)<1e-6)return null;n*=o=1/o,s*=o,r*=o;var a=Math.sin(t),h=Math.cos(t),l=1-h,u=i[0],c=i[1],d=i[2],f=i[3],p=i[4],g=i[5],v=i[6],y=i[7],m=i[8],x=i[9],w=i[10],b=i[11],T=n*n*l+h,S=s*n*l+r*a,A=r*n*l-s*a,C=n*s*l-r*a,M=s*s*l+h,_=r*s*l+n*a,E=n*r*l+s*a,P=s*r*l-n*a,k=r*r*l+h;return i[0]=u*T+p*S+m*A,i[1]=c*T+g*S+x*A,i[2]=d*T+v*S+w*A,i[3]=f*T+y*S+b*A,i[4]=u*C+p*M+m*_,i[5]=c*C+g*M+x*_,i[6]=d*C+v*M+w*_,i[7]=f*C+y*M+b*_,i[8]=u*E+p*P+m*k,i[9]=c*E+g*P+x*k,i[10]=d*E+v*P+w*k,i[11]=f*E+y*P+b*k,this},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=s*n+h*i,e[5]=r*n+l*i,e[6]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=s*n-h*i,e[1]=r*n-l*i,e[2]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*i+c*n,this},rotateZ:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=s*n+h*i,e[1]=r*n+l*i,e[2]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this},fromRotationTranslation:function(t,e){var i=this.val,n=t.x,s=t.y,r=t.z,o=t.w,a=n+n,h=s+s,l=r+r,u=n*a,c=n*h,d=n*l,f=s*h,p=s*l,g=r*l,v=o*a,y=o*h,m=o*l;return i[0]=1-(f+g),i[1]=c+m,i[2]=d-y,i[3]=0,i[4]=c-m,i[5]=1-(u+g),i[6]=p+v,i[7]=0,i[8]=d+y,i[9]=p-v,i[10]=1-(u+f),i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},fromQuat:function(t){var e=this.val,i=t.x,n=t.y,s=t.z,r=t.w,o=i+i,a=n+n,h=s+s,l=i*o,u=i*a,c=i*h,d=n*a,f=n*h,p=s*h,g=r*o,v=r*a,y=r*h;return e[0]=1-(d+p),e[1]=u+y,e[2]=c-v,e[3]=0,e[4]=u-y,e[5]=1-(l+p),e[6]=f+g,e[7]=0,e[8]=c+v,e[9]=f-g,e[10]=1-(l+d),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,i,n,s,r){var o=this.val,a=1/(e-t),h=1/(n-i),l=1/(s-r);return o[0]=2*s*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*s*h,o[6]=0,o[7]=0,o[8]=(e+t)*a,o[9]=(n+i)*h,o[10]=(r+s)*l,o[11]=-1,o[12]=0,o[13]=0,o[14]=r*s*2*l,o[15]=0,this},perspective:function(t,e,i,n){var s=this.val,r=1/Math.tan(t/2),o=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*o,s[15]=0,this},perspectiveLH:function(t,e,i,n){var s=this.val;return s[0]=2*i/t,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/e,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=-n/(i-n),s[11]=1,s[12]=0,s[13]=0,s[14]=i*n/(i-n),s[15]=0,this},ortho:function(t,e,i,n,s,r){var o=this.val,a=t-e,h=i-n,l=s-r;return a=0===a?a:1/a,h=0===h?h:1/h,l=0===l?l:1/l,o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(n+i)*h,o[14]=(r+s)*l,o[15]=1,this},lookAt:function(t,e,i){var n=this.val,s=t.x,r=t.y,o=t.z,a=i.x,h=i.y,l=i.z,u=e.x,c=e.y,d=e.z;if(Math.abs(s-u)<1e-6&&Math.abs(r-c)<1e-6&&Math.abs(o-d)<1e-6)return this.identity();var f=s-u,p=r-c,g=o-d,v=1/Math.sqrt(f*f+p*p+g*g),y=h*(g*=v)-l*(p*=v),m=l*(f*=v)-a*g,x=a*p-h*f;(v=Math.sqrt(y*y+m*m+x*x))?(y*=v=1/v,m*=v,x*=v):x=m=y=0;var w=p*x-g*m,b=g*y-f*x,T=f*m-p*y;return(v=Math.sqrt(w*w+b*b+T*T))?(w*=v=1/v,b*=v,T*=v):T=b=w=0,n[0]=y,n[1]=w,n[2]=f,n[3]=0,n[4]=m,n[5]=b,n[6]=p,n[7]=0,n[8]=x,n[9]=T,n[10]=g,n[11]=0,n[12]=-(y*s+m*r+x*o),n[13]=-(w*s+b*r+T*o),n[14]=-(f*s+p*r+g*o),n[15]=1,this},yawPitchRoll:function(t,e,i){this.zero(),h.zero(),l.zero();var n=this.val,s=h.val,r=l.val,o=Math.sin(i),a=Math.cos(i);return n[10]=1,n[15]=1,n[0]=a,n[1]=o,n[4]=-o,n[5]=a,o=Math.sin(e),a=Math.cos(e),s[0]=1,s[15]=1,s[5]=a,s[10]=a,s[9]=-o,s[6]=o,o=Math.sin(t),a=Math.cos(t),r[5]=1,r[15]=1,r[0]=a,r[2]=-o,r[8]=o,r[10]=a,this.multiplyLocal(h),this.multiplyLocal(l),this},setWorldMatrix:function(t,e,i,n,s){return this.yawPitchRoll(t.y,t.x,t.z),h.scaling(i.x,i.y,i.z),l.xyz(e.x,e.y,e.z),this.multiplyLocal(h),this.multiplyLocal(l),void 0!==n&&this.multiplyLocal(n),void 0!==s&&this.multiplyLocal(s),this}}),h=new s,l=new s;t.exports=s},function(t,e,i){var n=i(0),s=i(278),r=i(561),o=i(560),a=i(559),h=i(70),l=i(151),u=i(6),c=i(87),d=i(277),f=new c,p=new d,g=new c,v=new c,y=new s,m=new n({initialize:function(t){this.scene=t,this.displayList=t.sys.displayList,this.updateList=t.sys.updateList,this.name="",this.direction=new c(0,0,-1),this.up=new c(0,1,0),this.position=new c,this.pixelScale=128,this.projection=new s,this.view=new s,this.combined=new s,this.invProjectionView=new s,this.near=1,this.far=100,this.ray={origin:new c,direction:new c},this.viewportWidth=0,this.viewportHeight=0,this.billboardMatrixDirty=!0,this.children=new h},setPosition:function(t,e,i){return this.position.set(t,e,i),this.update()},setScene:function(t){return this.scene=t,this},setPixelScale:function(t){return this.pixelScale=t,this.update()},add:function(t){return this.children.set(t),this.updateChildren(),t},remove:function(t){return this.displayList.remove(t.gameObject),this.updateList.remove(t.gameObject),this.children.delete(t),this},clear:function(){for(var t=this.getChildren(),e=0;e<t.length;e++)this.remove(t[e]);return this},getChildren:function(){return this.children.entries},create:function(t,e,i,n,s,r){void 0===r&&(r=!0);var o=new l(this.scene,t,e,i,n,s);return this.displayList.add(o.gameObject),this.updateList.add(o.gameObject),o.visible=r,this.children.set(o),this.updateChildren(),o},createMultiple:function(t,e,i,n){void 0===n&&(n=!0);for(var s=[],r=0;r<t;r++){var o=new l(this.scene,0,0,0,e,i);this.displayList.add(o.gameObject),this.updateList.add(o.gameObject),o.visible=n,this.children.set(o),s.push(o)}return s},createRect:function(t,e,i,n){"number"==typeof t&&(t={x:t,y:t,z:t}),"number"==typeof e&&(e={x:e,y:e,z:e});for(var s=t.x*t.y*t.z,r=this.createMultiple(s,i,n),o=0,a=.5-t.z/2;a<t.z/2;a++)for(var h=.5-t.y/2;h<t.y/2;h++)for(var l=.5-t.x/2;l<t.x/2;l++){var u=l*e.x,c=h*e.y,d=a*e.z;r[o].position.set(u,c,d),o++}return this.update(),r},randomSphere:function(t,e){void 0===e&&(e=this.getChildren());for(var i=0;i<e.length;i++)r(e[i].position,t);return this.update()},randomCube:function(t,e){void 0===e&&(e=this.getChildren());for(var i=0;i<e.length;i++)o(e[i].position,t);return this.update()},translateChildren:function(t,e){void 0===e&&(e=this.getChildren());for(var i=0;i<e.length;i++)e[i].position.add(t);return this.update()},transformChildren:function(t,e){void 0===e&&(e=this.getChildren());for(var i=0;i<e.length;i++)e[i].position.transformMat4(t);return this.update()},setViewport:function(t,e){return this.viewportWidth=t,this.viewportHeight=e,this.update()},translate:function(t,e,i){return"object"==typeof t?(this.position.x+=t.x||0,this.position.y+=t.y||0,this.position.z+=t.z||0):(this.position.x+=t||0,this.position.y+=e||0,this.position.z+=i||0),this.update()},lookAt:function(t,e,i){var n=this.direction,s=this.up;return"object"==typeof t?n.copy(t):n.set(t,e,i),n.subtract(this.position).normalize(),f.copy(n).cross(s).normalize(),s.copy(f).cross(n).normalize(),this.update()},rotate:function(t,e){return a(this.direction,e,t),a(this.up,e,t),this.update()},rotateAround:function(t,e,i){return f.copy(t).subtract(this.position),this.translate(f),this.rotate(e,i),this.translate(f.negate()),this.update()},project:function(t,e){void 0===e&&(e=new d);var i=this.viewportWidth,n=this.viewportHeight,s=m.NEAR_RANGE,r=m.FAR_RANGE;return p.set(t.x,t.y,t.z,1),p.transformMat4(this.combined),0===p.w&&(p.w=1),p.x=p.x/p.w,p.y=p.y/p.w,p.z=p.z/p.w,e.x=i/2*p.x+(0+i/2),e.y=n/2*p.y+(0+n/2),e.z=(r-s)/2*p.z+(r+s)/2,(0===e.w||e.w)&&(e.w=1/p.w),e},unproject:function(t,e){void 0===e&&(e=new c);var i=p.set(0,0,this.viewportWidth,this.viewportHeight);return e.copy(t).unproject(i,this.invProjectionView)},getPickRay:function(t,e){var i=this.ray.origin.set(t,e,0),n=this.ray.direction.set(t,e,1),s=p.set(0,0,this.viewportWidth,this.viewportHeight),r=this.invProjectionView;return i.unproject(s,r),n.unproject(s,r),n.subtract(i).normalize(),this.ray},updateChildren:function(){for(var t=this.children.entries,e=0;e<t.length;e++)t[e].project(this);return this},update:function(){return this.updateChildren()},updateBillboardMatrix:function(){var t=g.set(this.direction).negate(),e=v.set(this.up).cross(t).normalize(),i=f.set(t).cross(e).normalize(),n=y.val;n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=0,n[4]=i.x,n[5]=i.y,n[6]=i.z,n[7]=0,n[8]=t.x,n[9]=t.y,n[10]=t.z,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this.billboardMatrixDirty=!1},getPointSize:function(t,e,i){void 0===i&&(i=new u),this.billboardMatrixDirty&&this.updateBillboardMatrix();var n=f,s=e.x/this.pixelScale/2,r=e.y/this.pixelScale/2;n.set(-s,-r,0).transformMat4(y).add(t),this.project(n,n);var o=n.x,a=n.y;n.set(s,r,0).transformMat4(y).add(t),this.project(n,n);var h=n.x-o,l=n.y-a;return i.set(h,l)},destroy:function(){this.children.clear(),this.scene=void 0,this.children=void 0},setX:function(t){return this.position.x=t,this.update()},setY:function(t){return this.position.y=t,this.update()},setZ:function(t){return this.position.z=t,this.update()},x:{get:function(){return this.position.x},set:function(t){this.position.x=t,this.update()}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t,this.update()}},z:{get:function(){return this.position.z},set:function(t){this.position.z=t,this.update()}}});m.FAR_RANGE=1,m.NEAR_RANGE=0,t.exports=m},function(t,e,i){var a=i(30);t.exports=function(t){var e=new a,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var n=parseInt(i[1],10),s=parseInt(i[2],10),r=parseInt(i[3],10),o=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(n,s,r,255*o)}return e}},function(t,e,i){var n=i(30);t.exports=function(t){return new n(t.r,t.g,t.b,t.a)}},function(t,e){t.exports=function(t){return 16777215<t?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e,i){var n=i(30),s=i(282);t.exports=function(t){var e=s(t);return new n(e.r,e.g,e.b,e.a)}},function(t,e){t.exports=function(t,e,i,n){return n<<24|t<<16|e<<8|i}},function(t,e,i){var o=i(30);t.exports=function(t){var e=new o;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,n){return e+e+i+i+n+n});var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var n=parseInt(i[1],16),s=parseInt(i[2],16),r=parseInt(i[3],16);e.setTo(n,s,r)}return e}},function(t,e){t.exports=function(t,e,i){return t<=e?0:i<=t?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},function(t,e){t.exports=function(t,e,i,n,s){var r=n+Math.atan2(t.y-i,t.x-e);return t.x=e+s*Math.cos(r),t.y=i+s*Math.sin(r),t}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n<e;n++)i=t.pop(),t.unshift(i);return i}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n<e;n++)i=t.shift(),t.push(i);return i}},function(t,e){t.exports={defaultPipeline:null,pipeline:null,initPipeline:function(t){var e=this.scene.sys.game.renderer;return!!(e&&e.gl&&e.hasPipeline(t))&&(this.defaultPipeline=e.getPipeline(t),this.pipeline=this.defaultPipeline,!0)},setPipeline:function(t){var e=this.scene.sys.game.renderer;return!!(e&&e.gl&&e.hasPipeline(t))&&(this.pipeline=e.getPipeline(t),!0)},resetPipeline:function(){return this.pipeline=this.defaultPipeline,null!==this.pipeline},getPipelineName:function(){return this.pipeline.name}}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x-e,a=t.y-i;return t.x=o*s-a*r+e,t.y=o*r+a*s+i,t}},function(t,e,i){var n=i(5);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},function(t,e,i){var o=i(135),a=i(97);t.exports=function(t,e,i,n){void 0===n&&(n=[]),e||(e=a(t)/i);for(var s=0;s<e;s++){var r=s/e;n.push(o(t,r))}return n}},function(t,e){t.exports=function(t){return Math.PI*t.radius*2}},function(t,e,i){var o=i(295),a=i(136),h=i(65),l=i(16);t.exports=function(t,e,i,n){void 0===n&&(n=[]),e||(e=o(t)/i);for(var s=0;s<e;s++){var r=h(s/e,0,l.PI2);n.push(a(t,r))}return n}},function(t,e,i){var n=new(i(0))({initialize:function(t){this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var n=0;n<t.length;n++)e=.02519603282416938*(i+=t.charCodeAt(n)),e-=i=e>>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return 2.3283064365386963e-10*((this.n=i)>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e<t.length&&null!=t[e];e++){var i=t[e];this.s0-=this.hash(i),this.s0+=~~(this.s0<0),this.s1-=this.hash(i),this.s1+=~~(this.s1<0),this.s2-=this.hash(i),this.s2+=~~(this.s2<0)}},integer:function(){return 4294967296*this.rnd()},frac:function(){return this.rnd()+11102230246251565e-32*(2097152*this.rnd()|0)},real:function(){return this.integer()+this.frac()},integerInRange:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},between:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},realInRange:function(t,e){return this.frac()*(e-t)+t},normal:function(){return 1-2*this.frac()},uuid:function(){var t="",e="";for(e=t="";t++<36;e+=~t%5|3*t&4?(15^t?8^this.frac()*(20^t?16:4):4).toString(16):"-");return e},pick:function(t){return t[this.integerInRange(0,t.length-1)]},sign:function(){return this.pick(this.signs)},weightedPick:function(t){return t[~~(Math.pow(this.frac(),2)*(t.length-1)+.5)]},timestamp:function(t,e){return this.realInRange(t||9466848e5,e||1577862e6)},angle:function(){return this.integerInRange(-180,180)},rotation:function(){return this.realInRange(-3.1415926,3.1415926)},state:function(t){return"string"==typeof t&&t.match(/^!rnd/)&&(t=t.split(","),this.c=parseFloat(t[1]),this.s0=parseFloat(t[2]),this.s1=parseFloat(t[3]),this.s2=parseFloat(t[4])),["!rnd",this.c,this.s0,this.s1,this.s2].join(",")},shuffle:function(t){for(var e=t.length-1,i=e;0<i;i--){var n=Math.floor(this.frac()*(e+1)),s=t[n];t[n]=t[i],t[i]=s}return t}});t.exports=n},function(t,e,i){var s=i(136),r=i(65),o=i(16),a=i(5);t.exports=function(t,e,i){void 0===i&&(i=new a);var n=r(e,0,o.PI2);return s(t,n,i)}},function(t,e){t.exports={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12}},function(t,e,i){var b={};t.exports=b;var o=i(126),T=i(106),a=i(331),h=i(125),l=i(680),u=i(41);b._warming=.4,b._torqueDampen=1,b._minLength=1e-6,b.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?T.add(e.bodyA.position,e.pointA):e.pointA,n=e.bodyB?T.add(e.bodyB.position,e.pointB):e.pointB,s=T.magnitude(T.sub(i,n));e.length=void 0!==e.length?e.length:s,e.id=e.id||u.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(0<e.length?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var r={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return 0===e.length&&.1<e.stiffness?(r.type="pin",r.anchors=!1):e.stiffness<.9&&(r.type="spring"),e.render=u.extend(r,e.render),e},b.preSolveAll=function(t){for(var e=0;e<t.length;e+=1){var i=t[e],n=i.constraintImpulse;i.isStatic||0===n.x&&0===n.y&&0===n.angle||(i.position.x+=n.x,i.position.y+=n.y,i.angle+=n.angle)}},b.solveAll=function(t,e){for(var i=0;i<t.length;i+=1){var n=t[i],s=!n.bodyA||n.bodyA&&n.bodyA.isStatic,r=!n.bodyB||n.bodyB&&n.bodyB.isStatic;(s||r)&&b.solve(t[i],e)}for(i=0;i<t.length;i+=1)s=!(n=t[i]).bodyA||n.bodyA&&n.bodyA.isStatic,r=!n.bodyB||n.bodyB&&n.bodyB.isStatic,s||r||b.solve(t[i],e)},b.solve=function(t,e){var i=t.bodyA,n=t.bodyB,s=t.pointA,r=t.pointB;if(i||n){i&&!i.isStatic&&(T.rotate(s,i.angle-t.angleA,s),t.angleA=i.angle),n&&!n.isStatic&&(T.rotate(r,n.angle-t.angleB,r),t.angleB=n.angle);var o=s,a=r;if(i&&(o=T.add(i.position,s)),n&&(a=T.add(n.position,r)),o&&a){var h=T.sub(o,a),l=T.magnitude(h);l<b._minLength&&(l=b._minLength);var u,c,d,f,p,g=(l-t.length)/l,v=t.stiffness<1?t.stiffness*e:t.stiffness,y=T.mult(h,g*v),m=(i?i.inverseMass:0)+(n?n.inverseMass:0),x=m+((i?i.inverseInertia:0)+(n?n.inverseInertia:0));if(t.damping){var w=T.create();d=T.div(h,l),p=T.sub(n&&T.sub(n.position,n.positionPrev)||w,i&&T.sub(i.position,i.positionPrev)||w),f=T.dot(d,p)}i&&!i.isStatic&&(c=i.inverseMass/m,i.constraintImpulse.x-=y.x*c,i.constraintImpulse.y-=y.y*c,i.position.x-=y.x*c,i.position.y-=y.y*c,t.damping&&(i.positionPrev.x-=t.damping*d.x*f*c,i.positionPrev.y-=t.damping*d.y*f*c),u=T.cross(s,y)/x*b._torqueDampen*i.inverseInertia*(1-t.angularStiffness),i.constraintImpulse.angle-=u,i.angle-=u),n&&!n.isStatic&&(c=n.inverseMass/m,n.constraintImpulse.x+=y.x*c,n.constraintImpulse.y+=y.y*c,n.position.x+=y.x*c,n.position.y+=y.y*c,t.damping&&(n.positionPrev.x+=t.damping*d.x*f*c,n.positionPrev.y+=t.damping*d.y*f*c),u=T.cross(r,y)/x*b._torqueDampen*n.inverseInertia*(1-t.angularStiffness),n.constraintImpulse.angle+=u,n.angle+=u)}}},b.postSolveAll=function(t){for(var e=0;e<t.length;e++){var i=t[e],n=i.constraintImpulse;if(!(i.isStatic||0===n.x&&0===n.y&&0===n.angle)){a.set(i,!1);for(var s=0;s<i.parts.length;s++){var r=i.parts[s];o.translate(r.vertices,n),0<s&&(r.position.x+=n.x,r.position.y+=n.y),0!==n.angle&&(o.rotate(r.vertices,n.angle,i.position),l.rotate(r.axes,n.angle),0<s&&T.rotateAbout(r.position,n.angle,i.position,r.position)),h.update(r.bounds,r.vertices,i.velocity)}n.angle*=b._warming,n.x*=b._warming,n.y*=b._warming}}}},function(t,e,i){var n={};t.exports=n;var l=i(41);n.on=function(t,e,i){for(var n,s=e.split(" "),r=0;r<s.length;r++)n=s[r],t.events=t.events||{},t.events[n]=t.events[n]||[],t.events[n].push(i);return i},n.off=function(t,e,i){if(e){"function"==typeof e&&(i=e,e=l.keys(t.events).join(" "));for(var n=e.split(" "),s=0;s<n.length;s++){var r=t.events[n[s]],o=[];if(i&&r)for(var a=0;a<r.length;a++)r[a]!==i&&o.push(r[a]);t.events[n[s]]=o}}else t.events={}},n.trigger=function(t,e,i){var n,s,r,o;if(t.events){i||(i={}),n=e.split(" ");for(var a=0;a<n.length;a++)if(s=n[a],r=t.events[s]){(o=l.clone(i,!1)).name=s,o.source=t;for(var h=0;h<r.length;h++)r[h].apply(t,[o])}}}},function(t,e,i){var n=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 n=this.currentAnim,s=this.parent;return this.repeatCounter=-1===this._repeat?Number.MAX_VALUE:this._repeat,n.getFirstTick(this),this.forward=!0,this.isPlaying=!0,this.pendingRepeat=!1,n.showOnStart&&(s.visible=!0),s.emit("animationstart",this.currentAnim,this.currentFrame),s},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=n},function(t,e,i){var n=i(0),s=i(161),r=i(12),o=i(160),a=i(61),h=i(72),l=new n({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 o(this,t)},timeline:function(t){var e=o(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=s(this,t);return this._add.push(e),this._toProcess++,e},preUpdate:function(){if(0!==this._toProcess){var t,e,i=this._destroy,n=this._active;for(t=0;t<i.length;t++){e=i[t];var s=n.indexOf(e);-1!==s&&(e.state=a.REMOVED,n.splice(s,1))}for(i.length=0,i=this._add,t=0;t<i.length;t++)(e=i[t]).state===a.PENDING_ADD&&(e.init()?(e.play(),this._active.push(e)):this._pending.push(e));i.length=0,this._toProcess=0}},update:function(t,e){var i,n=this._active;e*=this.timeScale;for(var s=0;s<n.length;s++)(i=n[s]).update(t,e)&&(this._destroy.push(i),this._toProcess++)},makeActive:function(t){if(-1===this._add.indexOf(t)&&-1===this._active.indexOf(t)){var e=this._pending.indexOf(t);return-1!==e&&this._pending.splice(e,1),this._add.push(t),t.state=a.PENDING_ADD,this._toProcess++,this}},each:function(t,e){for(var i=[null],n=1;n<arguments.length;n++)i.push(arguments[n]);for(var s in this.list)i[0]=this.list[s],t.apply(e,i)},getAllTweens:function(){for(var t=this._active,e=[],i=0;i<t.length;i++)e.push(t[i]);return e},getGlobalTimeScale:function(){return this.timeScale},getTweensOf:function(t){var e,i,n=this._active,s=[];if(Array.isArray(t))for(i=0;i<n.length;i++){e=n[i];for(var r=0;r<t.length;r++)e.hasTarget(t[r])&&s.push(e)}else for(i=0;i<n.length;i++)(e=n[i]).hasTarget(t)&&s.push(e);return s},isTweening:function(t){for(var e,i=this._active,n=0;n<i.length;n++)if((e=i[n]).hasTarget(t)&&e.isPlaying())return!0;return!1},killAll:function(){for(var t=this.getAllTweens(),e=0;e<t.length;e++)t[e].stop();return this},killTweensOf:function(t){for(var e=this.getTweensOf(t),i=0;i<e.length;i++)e[i].stop();return this},pauseAll:function(){for(var t=this._active,e=0;e<t.length;e++)t[e].pause();return this},resumeAll:function(){for(var t=this._active,e=0;e<t.length;e++)t[e].resume();return this},setGlobalTimeScale:function(t){return this.timeScale=t,this},shutdown:function(){this.killAll(),this._add=[],this._pending=[],this._active=[],this._destroy=[],this._toProcess=0;var t=this.systems.events;t.off("preupdate",this.preUpdate,this),t.off("update",this.update,this),t.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});r.register("TweenManager",l,"tweens"),t.exports=l},function(t,e){t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","loop","loopDelay","offset","onComplete","onCompleteParams","onCompleteScope","onLoop","onLoopParams","onLoopScope","onRepeat","onRepeatParams","onRepeatScope","onStart","onStartParams","onStartScope","onUpdate","onUpdateParams","onUpdateScope","onYoyo","onYoyoParams","onYoyoScope","paused","props","repeat","repeatDelay","targets","useFrames","yoyo"]},function(t,e,i){t.exports={GetBoolean:i(62),GetEaseFunction:i(63),GetNewValue:i(73),GetProps:i(163),GetTargets:i(102),GetTweens:i(162),GetValueOp:i(101),NumberTweenBuilder:i(161),TimelineBuilder:i(160),TweenBuilder:i(72)}},function(t,e,i){var n=i(61),s=i(17),r={Builders:i(305),TweenManager:i(303),Tween:i(99),TweenData:i(98),Timeline:i(159)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(0),s=i(12),r=i(164),o=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.now=Date.now(),this.timeScale=1,this.paused=!1,this._active=[],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)},addEvent:function(t){var e=new r(t);return this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,n){return this.addEvent({delay:t,callback:e,args:i,callbackScope:n})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeAllEvents:function(){return this._pendingRemoval=this._pendingRemoval.concat(this._active),this},preUpdate:function(){var t=this._pendingRemoval.length,e=this._pendingInsertion.length;if(0!==t||0!==e){var i,n;for(i=0;i<t;i++){n=this._pendingRemoval[i];var s=this._active.indexOf(n);-1<s&&this._active.splice(s,1),n.destroy()}for(i=0;i<e;i++)n=this._pendingInsertion[i],this._active.push(n);this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){if(this.now=t,!this.paused){e*=this.timeScale;for(var i=0;i<this._active.length;i++){var n=this._active[i];if(!n.paused&&(n.elapsed+=e*n.timeScale,n.elapsed>=n.delay)){var s=n.elapsed-n.delay;n.elapsed=n.delay,!n.hasDispatched&&n.callback&&(n.hasDispatched=!0,n.callback.apply(n.callbackScope,n.args)),0<n.repeatCount?(n.repeatCount--,n.elapsed=s,n.hasDispatched=!1):this._pendingRemoval.push(n)}}}},shutdown:function(){var t;for(t=0;t<this._pendingInsertion.length;t++)this._pendingInsertion[t].destroy();for(t=0;t<this._active.length;t++)this._active[t].destroy();for(t=0;t<this._pendingRemoval.length;t++)this._pendingRemoval[t].destroy();this._active.length=0,this._pendingRemoval.length=0,this._pendingInsertion.length=0;var e=this.systems.events;e.off("preupdate",this.preUpdate,this),e.off("update",this.update,this),e.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});s.register("Clock",o,"time"),t.exports=o},function(t,e,i){t.exports={Clock:i(307),TimerEvent:i(164)}},function(t,e,i){var n=i(0),s=i(15),o=i(20),a=i(2),r=i(624),h=i(141),z=i(27),l=new n({Extends:a,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.ScaleMode,s.Transform,s.Visible,s.ScrollFactor,r],initialize:function(t,e,i,n,s,r){a.call(this,t,"StaticTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],(this.layer.tilemapLayer=this).tileset=n,this.culledTiles=[],this.vertexBuffer=null,this.renderer=t.sys.game.renderer,this.bufferData=null,this.vertexViewF32=null,this.vertexViewU32=null,this.dirty=!0,this.vertexCount=0,this.setAlpha(this.layer.alpha),this.setPosition(s,r),this.setOrigin(),this.setSize(this.layer.tileWidth*this.layer.width,this.layer.tileHeight*this.layer.height),this.initPipeline("TextureTintPipeline"),t.sys.game.config.renderType===o.WEBGL&&t.sys.game.renderer.onContextRestored(function(){this.dirty=!0,this.vertexBuffer=null},this)},upload:function(t){var e,i,n,s,r=this.tileset,o=this.layer.width,a=this.layer.height,h=r.image.source[0].width,l=r.image.source[0].height,u=this.layer.data,c=this.renderer;if(c.gl){var d=c.pipelines.TextureTintPipeline;if(this.dirty){var f=c.gl,p=this.vertexBuffer,g=this.bufferData,v=0,y=0,m=o*a*d.vertexSize*6;null===g&&(g=new ArrayBuffer(m),this.bufferData=g,this.vertexViewF32=new Float32Array(g),this.vertexViewU32=new Uint32Array(g));var x=this.vertexViewF32,w=this.vertexViewU32;for(i=0;i<a;++i)for(n=0;n<o;++n)if(null!==(e=u[i][n])&&-1!==e.index){var b=e.pixelX,T=e.pixelY,S=b+e.width,A=T+e.height;if(null!==(s=r.getTileTextureCoordinates(e.index))){var C=s.x/h,M=s.y/l,_=(s.x+e.width)/h,E=(s.y+e.height)/l,P=b,k=T,L=b,F=A,R=S,O=A,B=S,D=T,I=z.getTintAppendFloatAlpha(16777215,this.alpha*e.alpha);x[v+0]=P,x[v+1]=k,x[v+2]=C,x[v+3]=M,w[v+4]=I,x[v+5]=L,x[v+6]=F,x[v+7]=C,x[v+8]=E,w[v+9]=I,x[v+10]=R,x[v+11]=O,x[v+12]=_,x[v+13]=E,w[v+14]=I,x[v+15]=P,x[v+16]=k,x[v+17]=C,x[v+18]=M,w[v+19]=I,x[v+20]=R,x[v+21]=O,x[v+22]=_,x[v+23]=E,w[v+24]=I,x[v+25]=B,x[v+26]=D,x[v+27]=_,x[v+28]=M,w[v+29]=I,v+=30,y+=6}}this.vertexCount=y,this.dirty=!1,null===p?(p=c.createVertexBuffer(g,f.STATIC_DRAW),this.vertexBuffer=p):(c.setVertexBuffer(p),f.bufferSubData(f.ARRAY_BUFFER,0,g))}d.modelIdentity(),d.modelTranslate(this.x-t.scrollX*this.scrollFactorX,this.y-t.scrollY*this.scrollFactorY,0),d.modelScale(this.scaleX,this.scaleY,1),d.viewLoad2D(t.matrix.matrix)}return this},calculateFacesAt:function(t,e){return h.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return h.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return h.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return h.CullTiles(this.layer,t,this.culledTiles)},destroy:function(){this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),this.tilemap=void 0,this.layer=void 0,this.tileset=void 0,a.prototype.destroy.call(this)},findByIndex:function(t,e,i){return h.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return h.FindTile(t,e,i,n,s,r,o,this.layer)},filterTiles:function(t,e,i,n,s,r,o){return h.FilterTiles(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return h.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return h.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return h.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return h.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return h.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},getTilesWithinShape:function(t,e,i){return h.GetTilesWithinShape(t,e,i,this.layer)},hasTileAt:function(t,e){return h.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return h.HasTileAtWorldXY(t,e,i,this.layer)},renderDebug:function(t,e){return h.RenderDebug(t,e,this.layer),this},setCollision:function(t,e,i){return h.SetCollision(t,e,i,this.layer),this},setCollisionBetween:function(t,e,i,n){return h.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return h.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return h.SetCollisionByExclusion(t,e,i,this.layer),this},setTileIndexCallback:function(t,e,i){return h.SetTileIndexCallback(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return h.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return h.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return h.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return h.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return h.TileToWorldXY(t,e,i,n,this.layer)},worldToTileX:function(t,e,i){return h.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return h.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return h.WorldToTileXY(t,e,i,n,s,this.layer)}});t.exports=l},function(t,e,i){var n=i(0),s=i(15),r=i(627),o=i(2),a=i(141),h=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.ScaleMode,s.Transform,s.Visible,s.ScrollFactor,r],initialize:function(t,e,i,n,s,r){o.call(this,t,"DynamicTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],(this.layer.tilemapLayer=this).tileset=n,this.culledTiles=[],this.setAlpha(this.layer.alpha),this.setPosition(s,r),this.setOrigin(),this.setSize(this.layer.tileWidth*this.layer.width,this.layer.tileHeight*this.layer.height),this.initPipeline("TextureTintPipeline")},calculateFacesAt:function(t,e){return a.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return a.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return a.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return a.CullTiles(this.layer,t,this.culledTiles)},copy:function(t,e,i,n,s,r,o){return a.Copy(t,e,i,n,s,r,o,this.layer),this},destroy:function(){this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),this.tilemap=void 0,this.layer=void 0,this.tileset=void 0,this.culledTiles.length=0,o.prototype.destroy.call(this)},fill:function(t,e,i,n,s,r){return a.Fill(t,e,i,n,s,r,this.layer),this},filterTiles:function(t,e,i,n,s,r,o){return a.FilterTiles(t,e,i,n,s,r,o,this.layer)},findByIndex:function(t,e,i){return a.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return a.FindTile(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return a.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return a.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return a.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return a.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinShape:function(t,e,i){return a.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return a.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},hasTileAt:function(t,e){return a.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return a.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,n){return a.PutTileAt(t,e,i,n,this.layer)},putTileAtWorldXY:function(t,e,i,n,s){return a.PutTileAtWorldXY(t,e,i,n,s,this.layer)},putTilesAt:function(t,e,i,n){return a.PutTilesAt(t,e,i,n,this.layer),this},randomize:function(t,e,i,n,s){return a.Randomize(t,e,i,n,s,this.layer),this},removeTileAt:function(t,e,i,n){return a.RemoveTileAt(t,e,i,n,this.layer)},removeTileAtWorldXY:function(t,e,i,n,s){return a.RemoveTileAtWorldXY(t,e,i,n,s,this.layer)},renderDebug:function(t,e){return a.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,n,s,r){return a.ReplaceByIndex(t,e,i,n,s,r,this.layer),this},setCollision:function(t,e,i){return a.SetCollision(t,e,i,this.layer),this},setCollisionBetween:function(t,e,i,n){return a.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return a.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return a.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return a.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return a.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return a.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},shuffle:function(t,e,i,n){return a.Shuffle(t,e,i,n,this.layer),this},swapByIndex:function(t,e,i,n,s,r){return a.SwapByIndex(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return a.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return a.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return a.TileToWorldXY(t,e,i,n,this.layer)},weightedRandomize:function(t,e,i,n,s){return a.WeightedRandomize(t,e,i,n,s,this.layer),this},worldToTileX:function(t,e,i){return a.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return a.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return a.WorldToTileXY(t,e,i,n,s,this.layer)}});t.exports=h},function(t,e,i){var n=i(0),p=i(38),f=i(310),g=i(17),u=i(26),v=i(104),y=i(346),a=i(309),m=i(66),h=i(141),c=i(137),s=new n({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0},addTilesetImage:function(t,e,i,n,s,r,o){if(void 0===t)return null;if(null==e&&(e=t),!this.scene.sys.textures.exists(e))return console.warn('Invalid image key given for tileset: "'+e+'"'),null;var a=this.scene.sys.textures.get(e),h=this.getTilesetIndex(t);if(null===h&&this.format===u.TILED_JSON)return console.warn('No data found in the JSON tilemap from Tiled matching the tileset name: "'+t+'"'),null;if(this.tilesets[h])return this.tilesets[h].setTileSize(i,n),this.tilesets[h].setSpacing(s,r),this.tilesets[h].setImage(a),this.tilesets[h];void 0===i&&(i=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0);var l=new c(t,o,i,n,s,r);return l.setImage(a),this.tilesets.push(l),l},convertLayerToStatic:function(t){if(null===(t=this.getLayer(t)))return null;var e=t.tilemapLayer;if(!(e&&e instanceof f))return null;var i=new a(e.scene,e.tilemap,e.layerIndex,e.tileset,e.x,e.y);return this.scene.sys.displayList.add(i),e.destroy(),i},copy:function(t,e,i,n,s,r,o,a){return a=this.getLayer(a),this._isStaticCall(a,"copy")||null!==a&&h.Copy(t,e,i,n,s,r,o,a),this},createBlankDynamicLayer:function(t,e,i,n,s,r,o,a){if(void 0===o&&(o=e.tileWidth),void 0===a&&(a=e.tileHeight),void 0===s&&(s=this.width),void 0===r&&(r=this.height),void 0===i&&(i=0),void 0===n&&(n=0),null!==this.getLayerIndex(t))return console.warn("Cannot create blank layer: layer with matching name already exists "+t),null;for(var h,l=new v({name:t,tileWidth:o,tileHeight:a,width:s,height:r}),u=0;u<r;u++){h=[];for(var c=0;c<s;c++)h.push(new m(l,-1,c,u,o,a,this.tileWidth,this.tileHeight));l.data.push(h)}this.layers.push(l),this.currentLayerIndex=this.layers.length-1;var d=new f(this.scene,this,this.currentLayerIndex,e,i,n);return this.scene.sys.displayList.add(d),d},createDynamicLayer:function(t,e,i,n){var s=this.getLayerIndex(t);if(null===s)return console.warn("Cannot create tilemap layer, invalid layer ID given: "+t),null;var r=this.layers[s];if(r.tilemapLayer)return console.warn("Cannot create dynamic tilemap layer since a static or dynamic tilemap layer exists for layer ID:"+t),null;this.currentLayerIndex=s,r.tileWidth===e.tileWidth&&r.tileHeight===e.tileHeight||this.setLayerTileSize(e.tileWidth,e.tileHeight,s),void 0===i&&this.layers[s].x&&(i=this.layers[s].x),void 0===n&&this.layers[s].y&&(n=this.layers[s].y);var o=new f(this.scene,this,s,e,i,n);return this.scene.sys.displayList.add(o),o},createFromObjects:function(t,e,i,n){void 0===i&&(i={}),void 0===n&&(n=this.scene);var s=this.getObjectLayer(t);if(s){for(var r=s.objects,o=[],a=0;a<r.length;a++){var h=!1,l=r[a];if((void 0!==l.gid&&"number"==typeof e&&l.gid===e||void 0!==l.id&&"number"==typeof e&&l.id===e||void 0!==l.name&&"string"==typeof e&&l.name===e)&&(h=!0),h){var u=g({},i,l.properties);u.x=l.x,u.y=l.y;var c=this.scene.make.sprite(u);c.name=l.name,l.width&&(c.displayWidth=l.width),l.height&&(c.displayHeight=l.height);var d={x:c.originX*c.displayWidth,y:(c.originY-1)*c.displayHeight};if(l.rotation){var f=p(l.rotation);y(d,f),c.rotation=f}c.x+=d.x,c.y+=d.y,void 0===l.flippedHorizontal&&void 0===l.flippedVertical||c.setFlip(l.flippedHorizontal,l.flippedVertical),l.visible||(c.visible=!1),o.push(c)}}return o}console.warn("Cannot create from object. Invalid objectgroup name given: "+t)},createFromTiles:function(t,e,i,n,s,r){return null===(r=this.getLayer(r))?null:h.CreateFromTiles(t,e,i,n,s,r)},createStaticLayer:function(t,e,i,n){var s=this.getLayerIndex(t);if(null===s)return console.warn("Cannot create tilemap layer, invalid layer ID given: "+t),null;var r=this.layers[s];if(r.tilemapLayer)return console.warn("Cannot create static tilemap layer since a static or dynamic tilemap layer exists for layer ID:"+t),null;this.currentLayerIndex=s,r.tileWidth===e.tileWidth&&r.tileHeight===e.tileHeight||this.setLayerTileSize(e.tileWidth,e.tileHeight,s),void 0===i&&this.layers[s].x&&(i=this.layers[s].x),void 0===n&&this.layers[s].y&&(n=this.layers[s].y);var o=new a(this.scene,this,s,e,i,n);return this.scene.sys.displayList.add(o),o},destroy:function(){this.removeAllLayers(),this.tilesets.length=0,this.objects.length=0,this.scene=void 0},fill:function(t,e,i,n,s,r,o){return o=this.getLayer(o),this._isStaticCall(o,"fill")||null!==o&&h.Fill(t,e,i,n,s,r,o),this},filterObjects:function(t,e,i){if("string"==typeof t){var n=t;if(!(t=this.getObjectLayer(t)))return console.warn("No object layer found with the name: "+n),null}return t.objects.filter(e,i)},filterTiles:function(t,e,i,n,s,r,o,a){return null===(a=this.getLayer(a))?null:h.FilterTiles(t,e,i,n,s,r,o,a)},findByIndex:function(t,e,i,n){return null===(n=this.getLayer(n))?null:h.FindByIndex(t,e,i,n)},findObject:function(t,e,i){if("string"==typeof t){var n=t;if(!(t=this.getObjectLayer(t)))return console.warn("No object layer found with the name: "+n),null}return t.objects.find(e,i)||null},findTile:function(t,e,i,n,s,r,o,a){return null===(a=this.getLayer(a))?null:h.FindTile(t,e,i,n,s,r,o,a)},forEachTile:function(t,e,i,n,s,r,o,a){return null!==(a=this.getLayer(a))&&h.ForEachTile(t,e,i,n,s,r,o,a),this},getImageIndex:function(t){return this.getIndex(this.images,t)},getIndex:function(t,e){for(var i=0;i<t.length;i++)if(t[i].name===e)return i;return null},getLayer:function(t){var e=this.getLayerIndex(t);return null!==e?this.layers[e]:null},getObjectLayer:function(t){var e=this.getIndex(this.objects,t);return null!==e?this.objects[e]:null},getLayerIndex:function(t){return void 0===t?this.currentLayerIndex:"string"==typeof t?this.getLayerIndexByName(t):"number"==typeof t&&t<this.layers.length?t:t instanceof a||t instanceof f?t.layerIndex:null},getLayerIndexByName:function(t){return this.getIndex(this.layers,t)},getTileAt:function(t,e,i,n){return null===(n=this.getLayer(n))?null:h.GetTileAt(t,e,i,n)},getTileAtWorldXY:function(t,e,i,n,s){return null===(s=this.getLayer(s))?null:h.GetTileAtWorldXY(t,e,i,n,s)},getTilesWithin:function(t,e,i,n,s,r){return null===(r=this.getLayer(r))?null:h.GetTilesWithin(t,e,i,n,s,r)},getTilesWithinShape:function(t,e,i,n){return null===(n=this.getLayer(n))?null:h.GetTilesWithinShape(t,e,i,n)},getTilesWithinWorldXY:function(t,e,i,n,s,r,o){return null===(o=this.getLayer(o))?null:h.GetTilesWithinWorldXY(t,e,i,n,s,r,o)},getTilesetIndex:function(t){return this.getIndex(this.tilesets,t)},hasTileAt:function(t,e,i){return null===(i=this.getLayer(i))?null:h.HasTileAt(t,e,i)},hasTileAtWorldXY:function(t,e,i,n){return null===(n=this.getLayer(n))?null:h.HasTileAtWorldXY(t,e,i,n)},layer:{get:function(){return this.layers[this.currentLayerIndex]},set:function(t){this.setLayer(t)}},putTileAt:function(t,e,i,n,s){return s=this.getLayer(s),this._isStaticCall(s,"putTileAt")?null:null===s?null:h.PutTileAt(t,e,i,n,s)},putTileAtWorldXY:function(t,e,i,n,s,r){return r=this.getLayer(r),this._isStaticCall(r,"putTileAtWorldXY")?null:null===r?null:h.PutTileAtWorldXY(t,e,i,n,s,r)},putTilesAt:function(t,e,i,n,s){return s=this.getLayer(s),this._isStaticCall(s,"putTilesAt")||null!==s&&h.PutTilesAt(t,e,i,n,s),this},randomize:function(t,e,i,n,s,r){return r=this.getLayer(r),this._isStaticCall(r,"randomize")||null!==r&&h.Randomize(t,e,i,n,s,r),this},calculateFacesAt:function(t,e,i){return null===(i=this.getLayer(i))||h.CalculateFacesAt(t,e,i),this},calculateFacesWithin:function(t,e,i,n,s){return null===(s=this.getLayer(s))||h.CalculateFacesWithin(t,e,i,n,s),this},removeAllLayers:function(){for(var t=0;t<this.layers.length;t++)this.layers[t].tilemapLayer&&this.layers[t].tilemapLayer.destroy();return this.layers.length=0,this.currentLayerIndex=0,this},removeTileAt:function(t,e,i,n,s){return s=this.getLayer(s),this._isStaticCall(s,"removeTileAt")?null:null===s?null:h.RemoveTileAt(t,e,i,n,s)},removeTileAtWorldXY:function(t,e,i,n,s,r){return r=this.getLayer(r),this._isStaticCall(r,"removeTileAtWorldXY")?null:null===r?null:h.RemoveTileAtWorldXY(t,e,i,n,s,r)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))||h.RenderDebug(t,e,i),this},replaceByIndex:function(t,e,i,n,s,r,o){return o=this.getLayer(o),this._isStaticCall(o,"replaceByIndex")||null!==o&&h.ReplaceByIndex(t,e,i,n,s,r,o),this},setCollision:function(t,e,i,n){return null===(n=this.getLayer(n))||h.SetCollision(t,e,i,n),this},setCollisionBetween:function(t,e,i,n,s){return null===(s=this.getLayer(s))||h.SetCollisionBetween(t,e,i,n,s),this},setCollisionByProperty:function(t,e,i,n){return null===(n=this.getLayer(n))||h.SetCollisionByProperty(t,e,i,n),this},setCollisionByExclusion:function(t,e,i,n){return null===(n=this.getLayer(n))||h.SetCollisionByExclusion(t,e,i,n),this},setCollisionFromCollisionGroup:function(t,e,i){return null===(i=this.getLayer(i))||h.SetCollisionFromCollisionGroup(t,e,i),this},setTileIndexCallback:function(t,e,i,n){return null===(n=this.getLayer(n))||h.SetTileIndexCallback(t,e,i,n),this},setTileLocationCallback:function(t,e,i,n,s,r,o){return null===(o=this.getLayer(o))||h.SetTileLocationCallback(t,e,i,n,s,r,o),this},setLayer:function(t){var e=this.getLayerIndex(t);return null!==e&&(this.currentLayerIndex=e),this},setBaseTileSize:function(t,e){this.tileWidth=t,this.tileHeight=e,this.widthInPixels=this.width*t,this.heightInPixels=this.height*e;for(var i=0;i<this.layers.length;i++){this.layers[i].baseWidth=t,this.layers[i].baseHeight=e;for(var n=this.layers[i].data,s=this.layers[i].width,r=this.layers[i].height,o=0;o<r;++o)for(var a=0;a<s;++a){var h=n[o][a];null!==h&&h.setSize(void 0,void 0,t,e)}}return this},setLayerTileSize:function(t,e,i){if(null===(i=this.getLayer(i)))return this;i.tileWidth=t,i.tileHeight=e;for(var n=i.data,s=i.width,r=i.height,o=0;o<r;++o)for(var a=0;a<s;++a){var h=n[o][a];null!==h&&h.setSize(t,e)}return this},shuffle:function(t,e,i,n,s){return s=this.getLayer(s),this._isStaticCall(s,"shuffle")||null!==s&&h.Shuffle(t,e,i,n,s),this},swapByIndex:function(t,e,i,n,s,r,o){return o=this.getLayer(o),this._isStaticCall(o,"swapByIndex")||null!==o&&h.SwapByIndex(t,e,i,n,s,r,o),this},tileToWorldX:function(t,e,i){return null===(i=this.getLayer(i))?null:h.TileToWorldX(t,e,i)},tileToWorldY:function(t,e,i){return null===(i=this.getLayer(i))?null:h.TileToWorldY(t,e,i)},tileToWorldXY:function(t,e,i,n,s){return null===(s=this.getLayer(s))?null:h.TileToWorldXY(t,e,i,n,s)},weightedRandomize:function(t,e,i,n,s,r){return r=this.getLayer(r),this._isStaticCall(r,"weightedRandomize")||null!==r&&h.WeightedRandomize(t,e,i,n,s,r),this},worldToTileX:function(t,e,i,n){return null===(n=this.getLayer(n))?null:h.WorldToTileX(t,e,i,n)},worldToTileY:function(t,e,i,n){return null===(n=this.getLayer(n))?null:h.WorldToTileY(t,e,i,n)},worldToTileXY:function(t,e,i,n,s,r){return null===(r=this.getLayer(r))?null:h.WorldToTileXY(t,e,i,n,s,r)},_isStaticCall:function(t,e){return t.tilemapLayer instanceof a&&(console.warn(e+": You cannot change the tiles in a static tilemap layer"),!0)}});t.exports=s},function(t,e,i){var a=i(26),h=i(103),l=i(629),u=i(628);t.exports=function(t,e,i){if(0===e.layer.length)return console.warn("No layers found in the Weltmeister map: "+t),null;for(var n=0,s=0,r=0;r<e.layer.length;r++)e.layer[r].width>n&&(n=e.layer[r].width),e.layer[r].height>s&&(s=e.layer[r].height);var o=new h({width:n,height:s,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:a.WELTMEISTER});return o.layers=l(e,i),o.tilesets=u(e),o}},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","object layer"),this.opacity=s(t,"opacity",1),this.properties=s(t,"properties",{}),this.propertyTypes=s(t,"propertytypes",{}),this.type=s(t,"type","objectgroup"),this.visible=s(t,"visible",!0),this.objects=s(t,"objects",[])}});t.exports=r},function(t,e,i){var r=i(633),o=i(316),a=function(t){return{x:t.x,y:t.y}},h=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var n=r(t,h);if(n.x+=e,n.y+=i,t.gid){var s=o(t.gid);n.gid=s.gid,n.flippedHorizontal=s.flippedHorizontal,n.flippedVertical=s.flippedVertical,n.flippedAntiDiagonal=s.flippedAntiDiagonal}else t.polyline?n.polyline=t.polyline.map(a):t.polygon?n.polygon=t.polygon.map(a):t.ellipse?(n.ellipse=t.ellipse,n.width=t.width,n.height=t.height):t.text?(n.width=t.width,n.height=t.height,n.text=t.text):(n.rectangle=!0,n.width=t.width,n.height=t.height);return n}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===s&&(s=0),void 0===r&&(r=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|n,this.imageMargin=0|s,this.imageSpacing=0|r,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(t){return t>=this.firstgid&&t<this.firstgid+this.total},addImage:function(t,e){return this.images.push({gid:t,image:e}),this.total++,this}});t.exports=n},function(t,e){t.exports=function(t){var e=Boolean(2147483648&t),i=Boolean(1073741824&t),n=Boolean(536870912&t);t&=536870911;var s=0,r=!1;return e&&i&&n?(s=Math.PI/2,r=!0):e&&i&&!n?(s=Math.PI,r=!1):e&&!i&&n?(s=Math.PI/2,r=!1):!e||i||n?!e&&i&&n?(s=3*Math.PI/2,r=!1):e||!i||n?e||i||!n?e||i||n||(s=0,r=!1):(s=3*Math.PI/2,r=!0):(s=Math.PI,r=!0):r=!(s=0),{gid:t,flippedHorizontal:e,flippedVertical:i,flippedAntiDiagonal:n,rotation:s,flipped:r}}},function(t,e,i){var r=i(26),o=i(103),a=i(637),h=i(635),l=i(634),u=i(632),c=i(631),d=i(630);t.exports=function(t,e,i){if("orthogonal"!==e.orientation)return console.warn("Only orthogonal map types are supported in this version of Phaser"),null;var n=new o({width:e.width,height:e.height,name:t,tileWidth:e.tilewidth,tileHeight:e.tileheight,orientation:e.orientation,format:r.TILED_JSON,version:e.version,properties:e.properties});n.layers=a(e,i),n.images=h(e);var s=l(e);return n.tilesets=s.tilesets,n.imageCollections=s.imageCollections,n.objects=u(e),n.tiles=c(n),d(n),n}},function(t,e,i){var a=i(26),h=i(217);t.exports=function(t,e,i,n,s){var r=e.trim().split("\n").map(function(t){return t.split(",")}),o=h(t,r,i,n,s);return o.format=a.CSV,o}},function(t,e,i){var a=i(26),h=i(217),l=i(318),u=i(317),c=i(312);t.exports=function(t,e,i,n,s,r){var o;switch(e){case a.ARRAY_2D:o=h(t,i,n,s,r);break;case a.CSV:o=l(t,i,n,s,r);break;case a.TILED_JSON:o=u(t,i,r);break;case a.WELTMEISTER:o=c(t,i,r);break;default:console.warn("Unrecognized tilemap data format: "+e),o=null}return o}},function(t,e,i){var o=i(66),a=i(105),h=i(220);t.exports=function(t,e,i,n,s){if(void 0===i&&(i=!1),void 0===n&&(n=!0),!a(t,e,s))return null;var r=s.data[e][t];return null===r?null:(s.data[e][t]=i?null:new o(s,-1,t,e,r.width,r.height),n&&r&&r.collides&&h(t,e,s),r)}},function(t,e,i){var s=i(105);t.exports=function(t,e,i){if(s(t,e,i)){var n=i.data[e][t];return null!==n&&-1<n.index}return!1}},function(t,e,i){var l=i(21);t.exports=function(t,e,i,n,s,r,o){for(var a=l(i,n,s,r,null,o),h=0;h<a.length;h++)a[h]&&a[h].index===t&&(a[h].index=e)}},function(t,e){t.exports={LINEAR:0,NEAREST:1}},function(t,e,i){var n=i(17),s=i(323),r={FilterMode:s,Frame:i(128),Parsers:i(182),Texture:i(117),TextureManager:i(184),TextureSource:i(183)};r=n(!1,r,s),t.exports=r},function(t,e,i){t.exports={List:i(93),Map:i(124),ProcessQueue:i(223),RTree:i(222),Set:i(70)}},function(t,e,i){t.exports={SoundManagerCreator:i(191),BaseSound:i(78),BaseSoundManager:i(79),WebAudioSound:i(185),WebAudioSoundManager:i(186),HTML5AudioSound:i(189),HTML5AudioSoundManager:i(190),NoAudioSound:i(187),NoAudioSoundManager:i(188)}},function(t,e,i){var n=i(23),s=i(0),r=i(55),a=i(1),o=i(12),h=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once("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._target=null,this.systems.events.once("shutdown",this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.settings.status!==r.RUNNING?(this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e)):(this.manager.stop(this.key),this.manager.start(t,e)),this},restart:function(t){var e=this.key;return this.settings.status!==r.RUNNING?(this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t)):(this.manager.stop(e),this.manager.start(e,t)),this},transition:function(t){void 0===t&&(t={});var e=a(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var n=a(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=n,this._willSleep=a(t,"sleep",!1),this._willRemove=a(t,"remove",!1);var s=a(t,"onUpdate",null);s&&(this._onUpdate=s,this._onUpdateScope=a(t,"onUpdateScope",this.scene));var r=a(t,"allowInput",!1);this.settings.transitionAllowInput=r;var o=i.sys.settings;return o.isTransition=!0,o.transitionFrom=this.scene,o.transitionDuration=n,o.transitionAllowInput=r,a(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):a(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake():this.manager.start(e,a(t,"data")),this.systems.events.emit("transitionout",i,n),this.systems.events.on("update",this.step,this),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=n(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off("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 n=i(55),s=i(17),r={SceneManager:i(194),ScenePlugin:i(327),Settings:i(192),Systems:i(118)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(165),s=new(i(0))({Extends:n,initialize:function(t,e){n.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this)},boot:function(){}});t.exports=s},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 u={};t.exports=u;var n=i(301);u._motionWakeThreshold=.18,u._motionSleepThreshold=.08,u._minBias=.9,u.update=function(t,e){for(var i=e*e*e,n=0;n<t.length;n++){var s=t[n],r=s.speed*s.speed+s.angularSpeed*s.angularSpeed;if(0===s.force.x&&0===s.force.y){var o=Math.min(s.motion,r),a=Math.max(s.motion,r);s.motion=u._minBias*o+(1-u._minBias)*a,0<s.sleepThreshold&&s.motion<u._motionSleepThreshold*i?(s.sleepCounter+=1,s.sleepCounter>=s.sleepThreshold&&u.set(s,!0)):0<s.sleepCounter&&(s.sleepCounter-=1)}else u.set(s,!1)}},u.afterCollisions=function(t,e){for(var i=e*e*e,n=0;n<t.length;n++){var s=t[n];if(s.isActive){var r=s.collision,o=r.bodyA.parent,a=r.bodyB.parent;if(!(o.isSleeping&&a.isSleeping||o.isStatic||a.isStatic)&&(o.isSleeping||a.isSleeping)){var h=o.isSleeping&&!o.isStatic?o:a,l=h===o?a:o;!h.isStatic&&l.motion>u._motionWakeThreshold*i&&u.set(h,!1)}}}},u.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||n.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&n.trigger(t,"sleepEnd"))}},function(t,e){t.exports={NONE:0,A:1,B:2,BOTH:3}},function(t,e){t.exports={NEVER:0,LITE:1,PASSIVE:2,ACTIVE:4,FIXED:8}},function(t,e,i){var n=i(32),s=i(0),r=i(42),o=i(31),a=i(6),h=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new a,this.position=new a(e.x-e.displayOriginX,e.y-e.displayOriginY),this.width=i,this.height=n,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new a(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=a.ZERO,this.allowGravity=!1,this.gravity=a.ZERO,this.bounce=a.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=r.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,(t.body=this).gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i,n){return void 0===i&&(i=this.offset.x),void 0===n&&(n=this.offset.y),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),this.offset.set(i,n),this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),0<t?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):o(this,t,e)},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position;this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor,1),t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},function(t,e){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},function(t,e,i){var o=i(42);t.exports=function(t,e,i,n){var s=0,r=t.deltaAbsY()+e.deltaAbsY()+n;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?r<(s=t.bottom-e.y)&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?s=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType===o.STATIC_BODY&&(t.blocked.down=!0),t.physicsType===o.STATIC_BODY&&(e.blocked.up=!0)):t._dy<e._dy&&(r<-(s=t.y-e.bottom)&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?s=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType===o.STATIC_BODY&&(t.blocked.up=!0),t.physicsType===o.STATIC_BODY&&(e.blocked.down=!0))),t.overlapY=s,e.overlapY=s}},function(t,e,i){var o=i(42);t.exports=function(t,e,i,n){var s=0,r=t.deltaAbsX()+e.deltaAbsX()+n;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?r<(s=t.right-e.x)&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?s=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType===o.STATIC_BODY&&(t.blocked.right=!0),t.physicsType===o.STATIC_BODY&&(e.blocked.left=!0)):t._dx<e._dx&&(r<-(s=t.x-e.width-e.x)&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?s=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType===o.STATIC_BODY&&(t.blocked.left=!0),t.physicsType===o.STATIC_BODY&&(e.blocked.right=!0))),t.overlapX=s,e.overlapX=s}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=n,this.collideCallback=s,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=n},function(t,e,i){var n=i(32),s=i(0),r=i(42),a=i(150),o=i(14),h=i(31),l=i(64),u=i(6),c=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new u,this.position=new u(e.x,e.y),this.prev=new u(e.x,e.y),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=n,this.sourceWidth=i,this.sourceHeight=n,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(n/2),this.center=new u(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=new u,this.newVelocity=new u,this.deltaMax=new u,this.acceleration=new u,this.allowDrag=!0,this.drag=new u,this.allowGravity=!0,this.gravity=new u,this.bounce=new u,this.worldBounce=null,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new u(1e4,1e4),this.friction=new u(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=r.FACING_NONE,this.immovable=!1,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.syncBounds=!1,this.isMoving=!1,this.stopVelocityOnCollide=!0,this.physicsType=r.DYNAMIC_BODY,this._reset=!0,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._bounds=new o,this._tempMatrix=new l},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this._tempMatrix);e.x=i.tx,e.y=i.ty,e.rotation=a(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY;var n=!1;if(this.syncBounds){var s=t.getBounds(this._bounds);this.width=s.width,this.height=s.height,n=!0}else{var r=Math.abs(e.scaleX),o=Math.abs(e.scaleY);this._sx===r&&this._sy===o||(this.width=this.sourceWidth*r,this.height=this.sourceHeight*o,this._sx=r,this._sy=o,n=!0)}n&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},update:function(t){this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.blocked.none=!0,this.blocked.up=!1,this.blocked.down=!1,this.blocked.left=!1,this.blocked.right=!1,this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1,this.updateBounds();var e=this.transform;if(this.position.x=e.x+e.scaleX*(this.offset.x-e.displayOriginX),this.position.y=e.y+e.scaleY*(this.offset.y-e.displayOriginY),this.updateCenter(),this.rotation=e.rotation,this.preRotation=this.rotation,this._reset&&(this.prev.x=this.position.x,this.prev.y=this.position.y),this.moves){this.world.updateMotion(this,t);var i=this.velocity.x,n=this.velocity.y;this.newVelocity.set(i*t,n*t),this.position.add(this.newVelocity),this.updateCenter(),this.angle=Math.atan2(n,i),this.speed=Math.sqrt(i*i+n*n),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds&&this.world.emit("worldbounds",this,this.blocked.up,this.blocked.down,this.blocked.left,this.blocked.right)}this._dx=this.deltaX(),this._dy=this.deltaY()},postUpdate:function(){this._dx=this.deltaX(),this._dy=this.deltaY(),this.moves&&(0!==this.deltaMax.x&&0!==this._dx&&(this._dx<0&&this._dx<-this.deltaMax.x?this._dx=-this.deltaMax.x:0<this._dx&&this._dx>this.deltaMax.x&&(this._dx=this.deltaMax.x)),0!==this.deltaMax.y&&0!==this._dy&&(this._dy<0&&this._dy<-this.deltaMax.y?this._dy=-this.deltaMax.y:0<this._dy&&this._dy>this.deltaMax.y&&(this._dy=this.deltaMax.y)),this.gameObject.x+=this._dx,this.gameObject.y+=this._dy,this._reset=!0),this._dx<0?this.facing=r.FACING_LEFT:0<this._dx&&(this.facing=r.FACING_RIGHT),this._dy<0?this.facing=r.FACING_UP:0<this._dy&&(this.facing=r.FACING_DOWN),this.allowRotation&&(this.gameObject.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},checkWorldBounds:function(){var t=this.position,e=this.world.bounds,i=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,s=this.worldBounce?-this.worldBounce.y:-this.bounce.y;return t.x<e.x&&i.left?(t.x=e.x,this.velocity.x*=n,this.blocked.left=!0,this.blocked.none=!1):this.right>e.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,this.blocked.right=!0,this.blocked.none=!1),t.y<e.y&&i.up?(t.y=e.y,this.velocity.y*=s,this.blocked.up=!0,this.blocked.none=!1):this.bottom>e.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=s,this.blocked.down=!0,this.blocked.none=!1),!this.blocked.none},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.offset.set(s-this.halfWidth,r-this.halfHeight)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),0<t?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i.setPosition(t,e),i.getTopLeft(this.position),this.prev.copy(this.position),this.rotation=i.angle,this.preRotation=i.angle,this.updateBounds(),this.updateCenter()},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return 0<this._dx?this._dx:-this._dx},deltaAbsY:function(){return 0<this._dy?this._dy:-this._dy},deltaX:function(){return this.position.x-this.prev.x},deltaY:function(){return this.position.y-this.prev.y},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor),this.isCircle?t.strokeCircle(i,n,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height)),this.debugShowVelocity&&(t.lineStyle(1,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.velocity.x/2,n+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t){return void 0===t&&(t=!0),this.collideWorldBounds=t,this},setVelocity:function(t,e){return this.velocity.set(t,e),this},setVelocityX:function(t){return this.velocity.x=t,this},setVelocityY:function(t){return this.velocity.y=t,this},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=c},function(t,e,i){var n=i(339),f=i(23),s=i(0),o=i(338),p=i(42),S=i(58),r=i(9),g=i(351),v=i(350),y=i(349),A=i(337),C=i(336),a=i(4),h=i(223),m=i(689),l=i(14),u=i(222),x=i(688),w=i(683),b=i(682),c=i(70),d=i(334),T=i(335),M=i(6),_=i(39),E=new s({Extends:r,initialize:function(t,e){r.call(this),this.scene=t,this.bodies=new c,this.staticBodies=new c,this.pendingDestroy=new c,this.colliders=new h,this.gravity=new M(a(e,"gravity.x",0),a(e,"gravity.y",0)),this.bounds=new l(a(e,"x",0),a(e,"y",0),a(e,"width",t.sys.game.config.width),a(e,"height",t.sys.game.config.height)),this.checkCollision={up:a(e,"checkCollision.up",!0),down:a(e,"checkCollision.down",!0),left:a(e,"checkCollision.left",!0),right:a(e,"checkCollision.right",!0)},this.fps=a(e,"fps",60),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=a(e,"timeScale",1),this.OVERLAP_BIAS=a(e,"overlapBias",4),this.TILE_BIAS=a(e,"tileBias",16),this.forceX=a(e,"forceX",!1),this.isPaused=a(e,"isPaused",!1),this._total=0,this.drawDebug=a(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:a(e,"debugShowBody",!0),debugShowStaticBody:a(e,"debugShowStaticBody",!0),debugShowVelocity:a(e,"debugShowVelocity",!0),bodyDebugColor:a(e,"debugBodyColor",16711935),staticBodyDebugColor:a(e,"debugStaticBodyColor",255),velocityDebugColor:a(e,"debugVelocityColor",65280)},this.maxEntries=a(e,"maxEntries",16),this.useTree=a(e,"useTree",!0),this.tree=new u(this.maxEntries),this.staticTree=new u(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=p.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];if(n.isParent)for(var s=n.getChildren(),r=0;r<s.length;r++){var o=s[r];o.isParent?this.enable(o,e):this.enableBody(o,e)}else this.enableBody(n,e)}},enableBody:function(t,e){return void 0===e&&(e=p.DYNAMIC_BODY),t.body||(e===p.DYNAMIC_BODY?t.body=new n(this,t):e===p.STATIC_BODY&&(t.body=new d(this,t))),this.add(t.body),t},add:function(t){return t.physicsType===p.DYNAMIC_BODY?this.bodies.set(t):t.physicsType===p.STATIC_BODY&&(this.staticBodies.set(t),this.staticTree.insert(t)),t.enable=!0,t},disable:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=t[e];if(i.isParent)for(var n=i.getChildren(),s=0;s<n.length;s++){var r=n[s];r.isParent?this.disable(r):this.disableBody(r)}else this.disableBody(i)}},disableBody:function(t){this.remove(t),t.enable=!1},remove:function(t){t.physicsType===p.DYNAMIC_BODY?(this.tree.remove(t),this.bodies.delete(t)):t.physicsType===p.STATIC_BODY&&(this.staticBodies.delete(t),this.staticTree.remove(t))},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},setBounds:function(t,e,i,n,s,r,o,a){return this.bounds.setTo(t,e,i,n),void 0!==s&&this.setBoundsCollision(s,r,o,a),this},setBoundsCollision:function(t,e,i,n){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===n&&(n=!0),this.checkCollision.left=t,this.checkCollision.right=e,this.checkCollision.up=i,this.checkCollision.down=n,this},pause:function(){return this.isPaused=!0,this.emit("pause"),this},resume:function(){return this.isPaused=!1,this.emit("resume"),this},addCollider:function(t,e,i,n,s){void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i);var r=new o(this,!1,t,e,i,n,s);return this.colliders.add(r),r},addOverlap:function(t,e,i,n,s){void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i);var r=new o(this,!0,t,e,i,n,s);return this.colliders.add(r),r},removeCollider:function(t){return this.colliders.remove(t),this},setFPS:function(t){return this.fps=t,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this},update:function(t,e){if(!this.isPaused&&0!==this.bodies.size){var i=0,n=this._frameTime,s=this._frameTimeMS*this.timeScale;for(this._elapsed+=e;this._elapsed>=s;)this._elapsed-=s,i++,this.step(n);this.stepsLastFrame=i}},step:function(t){var e,i,n=this.bodies.entries,s=n.length;for(e=0;e<s;e++)(i=n[e]).enable&&i.update(t);this.useTree&&(this.tree.clear(),this.tree.load(n));var r=this.colliders.update();for(e=0;e<r.length;e++){var o=r[e];o.active&&o.update()}for(s=n.length,e=0;e<s;e++)(i=n[e]).enable&&i.postUpdate()},postUpdate:function(){var t,e,i=this.bodies,n=this.staticBodies,s=this.pendingDestroy,r=i.entries,o=r.length;if(this.drawDebug){var a=this.debugGraphic;for(a.clear(),t=0;t<o;t++)(e=r[t]).willDrawDebug()&&e.drawDebug(a);for(o=(r=n.entries).length,t=0;t<o;t++)(e=r[t]).willDrawDebug()&&e.drawDebug(a)}if(0<s.size){var h=this.tree,l=this.staticTree;for(o=(r=s.entries).length,t=0;t<o;t++)(e=r[t]).physicsType===p.DYNAMIC_BODY?(h.remove(e),i.delete(e)):e.physicsType===p.STATIC_BODY&&(l.remove(e),n.delete(e)),e.world=void 0,e.gameObject=void 0;s.clear()}},updateMotion:function(t,e){t.allowRotation&&this.computeAngularVelocity(t,e),this.computeVelocity(t,e)},computeAngularVelocity:function(t,e){var i=t.angularVelocity,n=t.angularAcceleration,s=t.angularDrag,r=t.maxAngular;n?i+=n*e:t.allowDrag&&s&&(v(i-(s*=e),0,.1)?i-=s:y(i+s,0,.1)?i+=s:i=0);var o=(i=f(i,-r,r))-t.angularVelocity;t.angularVelocity+=o,t.rotation+=t.angularVelocity*e},computeVelocity:function(t,e){var i=t.velocity.x,n=t.acceleration.x,s=t.drag.x,r=t.maxVelocity.x,o=t.velocity.y,a=t.acceleration.y,h=t.drag.y,l=t.maxVelocity.y,u=t.speed,c=t.allowDrag,d=t.useDamping;t.allowGravity&&(i+=(this.gravity.x+t.gravity.x)*e,o+=(this.gravity.y+t.gravity.y)*e),n?i+=n*e:c&&s&&(d?(i*=s,g(u,0,.001)&&(i=0)):v(i-(s*=e),0,.01)?i-=s:y(i+s,0,.01)?i+=s:i=0),a?o+=a*e:c&&h&&(d?(o*=h,g(u,0,.001)&&(o=0)):v(o-(h*=e),0,.01)?o-=h:y(o+h,0,.01)?o+=h:o=0),i=f(i,-r,r),o=f(o,-l,l),t.velocity.set(i,o)},separate:function(t,e,i,n,s){if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return!1;if(i&&!1===i.call(n,t.gameObject,e.gameObject))return!1;if(t.isCircle&&e.isCircle)return this.separateCircle(t,e,s);if(t.isCircle!==e.isCircle){var r=t.isCircle?e:t,o=t.isCircle?t:e,a=r.x,h=r.y,l=r.right,u=r.bottom,c=o.center;if((c.y<h||c.y>u)&&(c.x<a||c.x>l))return this.separateCircle(t,e,s)}var d=!1,f=!1;this.forceX||Math.abs(this.gravity.y+t.gravity.y)<Math.abs(this.gravity.x+t.gravity.x)?(d=w(t,e,s,this.OVERLAP_BIAS),this.intersects(t,e)&&(f=b(t,e,s,this.OVERLAP_BIAS))):(f=b(t,e,s,this.OVERLAP_BIAS),this.intersects(t,e)&&(d=w(t,e,s,this.OVERLAP_BIAS)));var p=d||f;return p&&(s&&(t.onOverlap||e.onOverlap)?this.emit("overlap",t.gameObject,e.gameObject,t,e):(t.onCollide||e.onCollide)&&this.emit("collide",t.gameObject,e.gameObject,t,e)),p},separateCircle:function(t,e,i,n){A(t,e,!1,n),C(t,e,!1,n);var s=e.center.x-t.center.x,r=e.center.y-t.center.y,o=Math.atan2(r,s),a=0;if(t.isCircle!==e.isCircle){var h={x:e.isCircle?t.position.x:e.position.x,y:e.isCircle?t.position.y:e.position.y,right:e.isCircle?t.right:e.right,bottom:e.isCircle?t.bottom:e.bottom},l={x:t.isCircle?t.center.x:e.center.x,y:t.isCircle?t.center.y:e.center.y,radius:t.isCircle?t.halfWidth:e.halfWidth};l.y<h.y?l.x<h.x?a=S(l.x,l.y,h.x,h.y)-l.radius:h.right<l.x&&(a=S(l.x,l.y,h.right,h.y)-l.radius):h.bottom<l.y&&(l.x<h.x?a=S(l.x,l.y,h.x,h.bottom)-l.radius:h.right<l.x&&(a=S(l.x,l.y,h.right,h.bottom)-l.radius)),a*=-1}else a=t.halfWidth+e.halfWidth-S(t.center.x,t.center.y,e.center.x,e.center.y);if(i||0===a||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==a&&(t.onOverlap||e.onOverlap)&&this.emit("overlap",t.gameObject,e.gameObject,t,e),0!==a;var u=t.velocity.x,c=t.velocity.y,d=t.mass,f=e.velocity.x,p=e.velocity.y,g=e.mass,v=u*Math.cos(o)+c*Math.sin(o),y=u*Math.sin(o)-c*Math.cos(o),m=f*Math.cos(o)+p*Math.sin(o),x=f*Math.sin(o)-p*Math.cos(o),w=((d-g)*v+2*g*m)/(d+g),b=(2*d*v+(g-d)*m)/(d+g);t.immovable||(t.velocity.x=(w*Math.cos(o)-y*Math.sin(o))*t.bounce.x,t.velocity.y=(y*Math.cos(o)+w*Math.sin(o))*t.bounce.y,u=t.velocity.x,c=t.velocity.y),e.immovable||(e.velocity.x=(b*Math.cos(o)-x*Math.sin(o))*e.bounce.x,e.velocity.y=(x*Math.cos(o)+b*Math.sin(o))*e.bounce.y,f=e.velocity.x,p=e.velocity.y),Math.abs(o)<Math.PI/2?0<u&&!t.immovable&&u<f?t.velocity.x*=-1:f<0&&!e.immovable&&u<f?e.velocity.x*=-1:0<c&&!t.immovable&&c<p?t.velocity.y*=-1:p<0&&!e.immovable&&c<p&&(e.velocity.y*=-1):Math.abs(o)>Math.PI/2&&(u<0&&!t.immovable&&f<u?t.velocity.x*=-1:0<f&&!e.immovable&&f<u?e.velocity.x*=-1:c<0&&!t.immovable&&p<c?t.velocity.y*=-1:0<p&&!e.immovable&&p<u&&(e.velocity.y*=-1));var T=this._frameTime;return t.immovable||(t.x+=t.velocity.x*T-a*Math.cos(o),t.y+=t.velocity.y*T-a*Math.sin(o)),e.immovable||(e.x+=e.velocity.x*T+a*Math.cos(o),e.y+=e.velocity.y*T+a*Math.sin(o)),(t.onCollide||e.onCollide)&&this.emit("collide",t.gameObject,e.gameObject,t,e),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?S(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=f(t.center.x,e.left,e.right),n=f(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!1)},collideObjects:function(t,e,i,n,s,r){var o;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var a=Array.isArray(t),h=Array.isArray(e);if(this._total=0,a||h)if(!a&&h)for(o=0;o<e.length;o++)this.collideHandler(t,e[o],i,n,s,r);else if(a&&!h)for(o=0;o<t.length;o++)this.collideHandler(t[o],e,i,n,s,r);else for(o=0;o<t.length;o++)for(var l=0;l<e.length;l++)this.collideHandler(t[o],e[l],i,n,s,r);else this.collideHandler(t,e,i,n,s,r);return 0<this._total},collideHandler:function(t,e,i,n,s,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,n,s,r);if(!t||!e)return!1;if(t.body){if(e.body)return this.collideSpriteVsSprite(t,e,i,n,s,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,n,s,r)}else if(t.isParent){if(e.body)return this.collideSpriteVsGroup(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,n,s,r)}else if(t.isTilemap){if(e.body)return this.collideSpriteVsTilemapLayer(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,n,s,r)}},collideSpriteVsSprite:function(t,e,i,n,s,r){return!(!t.body||!e.body)&&(this.separate(t.body,e.body,n,s,r)&&(i&&i.call(s,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,n,s,r){var o,a,h,l=t.body;if(0!==e.length&&l&&l.enable)if(this.useTree){var u=this.treeMinMax;u.minX=l.left,u.minY=l.top,u.maxX=l.right,u.maxY=l.bottom;var c=e.physicsType===p.DYNAMIC_BODY?this.tree.search(u):this.staticTree.search(u);for(a=c.length,o=0;o<a;o++)l!==(h=c[o])&&e.contains(h.gameObject)&&this.separate(l,h,n,s,r)&&(i&&i.call(s,l.gameObject,h.gameObject),this._total++)}else{var d=e.getChildren(),f=e.children.entries.indexOf(t);for(a=d.length,o=0;o<a;o++)(h=d[o].body)&&o!==f&&h.enable&&this.separate(l,h,n,s,r)&&(i&&i.call(s,l.gameObject,h.gameObject),this._total++)}},collideGroupVsTilemapLayer:function(t,e,i,n,s,r){var o=t.getChildren();if(0===o.length)return!1;for(var a=!1,h=0;h<o.length;h++)o[h].body&&this.collideSpriteVsTilemapLayer(o[h],e,i,n,s,r)&&(a=!0);return a},collideSpriteVsTilemapLayer:function(t,e,i,n,s,r){var o=t.body;if(!o.enable)return!1;var a=o.position.x,h=o.position.y,l=o.width,u=o.height,c=e.layer;if(c.tileWidth>c.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var f,p=e.getTilesWithinWorldXY(a,h,l,u);if(0===p.length)return!1;for(var g={left:0,right:0,top:0,bottom:0},v=0;v<p.length;v++)f=p[v],g.left=e.tileToWorldX(f.x),g.top=e.tileToWorldY(f.y),f.baseHeight!==f.height&&(g.top-=(f.height-f.baseHeight)*e.scaleY),g.right=g.left+f.width*e.scaleX,g.bottom=g.top+f.height*e.scaleY,T(g,o)&&(!n||n.call(s,t,f))&&m(f,t)&&(r||x(v,o,f,g,e,this.TILE_BIAS))&&(this._total++,i&&i.call(s,t,f),r&&o.onOverlap?t.emit("overlap",o.gameObject,f,o,null):o.onCollide&&t.emit("collide",o.gameObject,f,o,null))},collideGroupVsGroup:function(t,e,i,n,s,r){if(0!==t.length&&0!==e.length)for(var o=t.getChildren(),a=0;a<o.length;a++)this.collideSpriteVsGroup(o[a],e,i,n,s,r)},wrap:function(t,e){t.body?this.wrapObject(t,e):t.getChildren?this.wrapArray(t.getChildren(),e):Array.isArray(t)?this.wrapArray(t,e):this.wrapObject(t,e)},wrapArray:function(t,e){for(var i=0;i<t.length;i++)this.wrapObject(t[i],e)},wrapObject:function(t,e){void 0===e&&(e=0),t.x=_(t.x,this.bounds.left-e,this.bounds.right+e),t.y=_(t.y,this.bounds.top-e,this.bounds.bottom+e)},shutdown:function(){this.tree.clear(),this.staticTree.clear(),this.bodies.clear(),this.staticBodies.clear(),this.colliders.destroy(),this.removeAllListeners()},destroy:function(){this.shutdown(),this.scene=null}});t.exports=E},function(t,e,i){var s=i(142),n=i(0),r=i(42),o=i(112),a=new n({Extends:o,initialize:function(t,e,i,n){void 0!==n||Array.isArray(i)||"object"!=typeof i?void 0===n&&(n={}):(n=i,i=null),this.world=t,n.createCallback=this.createCallbackHandler,n.removeCallback=this.removeCallbackHandler,n.createMultipleCallback=this.createMultipleCallbackHandler,n.classType=s,this.physicsType=r.STATIC_BODY,o.call(this,e,i,n)},createCallbackHandler:function(t){t.body||this.world.enableBody(t,r.STATIC_BODY)},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=this.children.entries,e=0;e<t.length;e++)t[e].body.reset();return this}});t.exports=a},function(t,e,i){var s=i(142),n=i(0),r=i(42),o=i(1),a=i(112),h=new n({Extends:a,initialize:function(t,e,i,n){void 0!==n||Array.isArray(i)||"object"!=typeof i?void 0===n&&(n={}):(n=i,i=null),this.world=t,n.createCallback=this.createCallbackHandler,n.removeCallback=this.removeCallbackHandler,n.classType=o(n,"classType",s),this.physicsType=r.DYNAMIC_BODY,this.defaults={setCollideWorldBounds:o(n,"collideWorldBounds",!1),setAccelerationX:o(n,"accelerationX",0),setAccelerationY:o(n,"accelerationY",0),setAllowDrag:o(n,"allowDrag",!0),setAllowGravity:o(n,"allowGravity",!0),setAllowRotation:o(n,"allowRotation",!0),setBounceX:o(n,"bounceX",0),setBounceY:o(n,"bounceY",0),setDragX:o(n,"dragX",0),setDragY:o(n,"dragY",0),setGravityX:o(n,"gravityX",0),setGravityY:o(n,"gravityY",0),setFrictionX:o(n,"frictionX",0),setFrictionY:o(n,"frictionY",0),setVelocityX:o(n,"velocityX",0),setVelocityY:o(n,"velocityY",0),setAngularVelocity:o(n,"angularVelocity",0),setAngularAcceleration:o(n,"angularAcceleration",0),setAngularDrag:o(n,"angularDrag",0),setMass:o(n,"mass",1),setImmovable:o(n,"immovable",!1)},a.call(this,e,i,n)},createCallbackHandler:function(t){t.body||this.world.enableBody(t,r.DYNAMIC_BODY);var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var n=this.getChildren(),s=0;s<n.length;s++)n[s].body.velocity.set(t+s*i,e+s*i);return this},setVelocityX:function(t,e){void 0===e&&(e=0);for(var i=this.getChildren(),n=0;n<i.length;n++)i[n].body.velocity.x=t+n*e;return this},setVelocityY:function(t,e){void 0===e&&(e=0);for(var i=this.getChildren(),n=0;n<i.length;n++)i[n].body.velocity.y=t+n*e;return this}});t.exports=h},function(t,e,i){t.exports={Acceleration:i(701),Angular:i(700),Bounce:i(699),Debug:i(698),Drag:i(697),Enable:i(696),Friction:i(695),Gravity:i(694),Immovable:i(693),Mass:i(692),Size:i(691),Velocity:i(690)}},function(t,e,i){var n=i(0),s=i(343),r=i(69),o=new n({Extends:r,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Size,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t,e,i,n,s)}});t.exports=o},function(t,e,i){var r=i(344),o=i(142),n=i(0),a=i(42),s=i(342),h=i(341),l=new n({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,n,s){return this.world.addCollider(t,e,i,n,s)},overlap:function(t,e,i,n,s){return this.world.addOverlap(t,e,i,n,s)},existing:function(t,e){var i=e?a.STATIC_BODY:a.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,n){var s=new r(this.scene,t,e,i,n);return this.sys.displayList.add(s),this.world.enableBody(s,a.STATIC_BODY),s},image:function(t,e,i,n){var s=new r(this.scene,t,e,i,n);return this.sys.displayList.add(s),this.world.enableBody(s,a.DYNAMIC_BODY),s},staticSprite:function(t,e,i,n){var s=new o(this.scene,t,e,i,n);return this.sys.displayList.add(s),this.sys.updateList.add(s),this.world.enableBody(s,a.STATIC_BODY),s},sprite:function(t,e,i,n){var s=new o(this.scene,t,e,i,n);return this.sys.displayList.add(s),this.sys.updateList.add(s),this.world.enableBody(s,a.DYNAMIC_BODY),s},staticGroup:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new s(this.world,this.world.scene,t,e))},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=l},function(t,e){t.exports=function(t,e){var i=t.x,n=t.y;return t.x=i*Math.cos(e)-n*Math.sin(e),t.y=i*Math.sin(e)+n*Math.cos(e),t}},function(t,e){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},function(t,e,i){var n=i(347);t.exports=function(t,e){return n(t)/n(e)/n(t-e)}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t<e+i}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),e-i<t}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)<i}},function(t,e){t.exports=function(t){return 0<=(t%=2*Math.PI)?t:t+2*Math.PI}},function(t,e,i){var n=i(0),s=i(18),r=i(70),o=i(9),a=i(7),v=i(1),h=i(12),l=i(75),u=new n({Extends:o,initialize:function(t){o.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,a.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(v(i,"baseURL",e.loaderBaseURL)),this.setPath(v(i,"path",e.loaderPath)),this.setPrefix(v(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=v(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=l(v(i,"responseType",e.loaderResponseType),v(i,"async",e.loaderAsync),v(i,"user",e.loaderUser),v(i,"password",e.loaderPassword),v(i,"timeout",e.loaderTimeout)),this.crossOrigin=v(i,"crossOrigin",e.loaderCrossOrigin),this.totalToLoad=0,this.progress=0,this.list=new r,this.inflight=new r,this.queue=new r,this._deleteQueue=new r,this.totalFailed=0,this.totalComplete=0,this.state=s.LOADER_IDLE,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;e<t.length;e++){var i=t[e];this.keyExists(i)||(this.list.set(i),this.emit("addfile",i.key,i.type,this,i),this.isLoading()&&(this.totalToLoad++,this.updateProgress()))}},keyExists:function(e){var i=e.hasCacheConflict();return i||this.list.iterate(function(t){if(t.type===e.type&&t.key===e.key)return!(i=!0)}),!i&&this.isLoading()&&(this.inflight.iterate(function(t){if(t.type===e.type&&t.key===e.key)return!(i=!0)}),this.queue.iterate(function(t){if(t.type===e.type&&t.key===e.key)return!(i=!0)})),i},addPack:function(t,e){e&&t.hasOwnProperty(e)&&(t={packKey:t[e]});var i=0,n=this.baseURL,s=this.path,r=this.prefix;for(var o in t){var a=t[o],h=v(a,"baseURL",n),l=v(a,"path",s),u=v(a,"prefix",r),c=v(a,"files",null),d=v(a,"defaultType","void");if(Array.isArray(c)){this.setBaseURL(h),this.setPath(l),this.setPrefix(u);for(var f=0;f<c.length;f++){var p=c[f],g=p.hasOwnProperty("type")?p.type:d;this[g]&&(this[g](p),i++)}}}return this.setBaseURL(n),this.setPath(s),this.setPrefix(r),0<i},isLoading:function(){return this.state===s.LOADER_LOADING||this.state===s.LOADER_PROCESSING},isReady:function(){return this.state===s.LOADER_IDLE||this.state===s.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit("start",this),0===this.list.size?this.loadComplete():(this.state=s.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on("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===s.LOADER_LOADING&&0<this.list.size&&this.inflight.size<this.maxParallelDownloads&&this.checkLoadQueue()},checkLoadQueue:function(){this.list.each(function(t){if((t.state===s.FILE_POPULATED||t.state===s.FILE_PENDING&&this.inflight.size<this.maxParallelDownloads)&&(this.inflight.set(t),this.list.delete(t),t.crossOrigin||(t.crossOrigin=this.crossOrigin),t.load()),this.inflight.size===this.maxParallelDownloads)return!1},this)},nextFile:function(t,e){this.inflight.delete(t),this.updateProgress(),e?(this.totalComplete++,this.queue.set(t),this.emit("load",t),t.onProcess()):(this.totalFailed++,this._deleteQueue.set(t),this.emit("loaderror",t))},fileProcessComplete:function(t){t.state===s.FILE_ERRORED?t.multiFile&&t.multiFile.onFileFailed(t):t.state===s.FILE_COMPLETE&&(t.multiFile?t.multiFile.isReadyToProcess()&&t.multiFile.addToCache():t.addToCache()),this.queue.delete(t),0===this.list.size&&0===this.inflight.size&&0===this.queue.size&&this.loadComplete()},loadComplete:function(){this.emit("loadcomplete",this),this.list.clear(),this.inflight.clear(),this.queue.clear(),this.progress=1,this.state=s.LOADER_COMPLETE,this.systems.events.off("update",this.update,this),this._deleteQueue.iterateLocal("destroy"),this._deleteQueue.clear(),this.emit("complete",this,this.totalComplete,this.totalFailed)},flagForRemoval:function(t){this._deleteQueue.set(t)},saveJSON:function(t,e){return this.save(JSON.stringify(t),e)},save:function(t,e,i){void 0===e&&(e="file.json"),void 0===i&&(i="application/json");var n=new Blob([t],{type:i}),s=URL.createObjectURL(n),r=document.createElement("a");return r.download=e,r.textContent="Download "+e,r.href=s,r.click(),this},reset:function(){this.list.clear(),this.inflight.clear(),this.queue.clear();var t=this.systems.game.config,e=this.systems.settings.loader;this.setBaseURL(v(e,"baseURL",t.loaderBaseURL)),this.setPath(v(e,"path",t.loaderPath)),this.setPrefix(v(e,"prefix",t.loaderPrefix)),this.state=s.LOADER_IDLE},shutdown:function(){this.reset(),this.state=s.LOADER_SHUTDOWN,this.systems.events.off("update",this.update,this),this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.state=s.LOADER_DESTROYED,this.systems.events.off("update",this.update,this),this.systems.events.off("start",this.pluginStart,this),this.list=null,this.inflight=null,this.queue=null,this.scene=null,this.systems=null,this.textureManager=null,this.cacheManager=null}});h.register("Loader",u,"load"),t.exports=u},function(t,e,i){var n=i(0),s=i(7),r=i(37),o=new n({Extends:r,initialize:function(t,e,i,n,s){r.call(this,t,e,i,s,n),this.type="spritesheet"},addToCache:function(){var t=this.cache.addSpriteSheet(this.key,this.data,this.config);this.pendingDestroy(t)}});s.register("spritesheet",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new o(this,t[s]));else this.addFile(new o(this,t,e,i,n));return this}),t.exports=o},function(t,e,i){var n=i(0),s=i(18),a=i(19),r=i(7),h=i(1),l=i(8),o=new n({Extends:a,initialize:function(t,e,i,n){var s="js";if(l(e)){var r=e;e=h(r,"key"),i=h(r,"url"),n=h(r,"xhrSettings"),s=h(r,"extension",s)}var o={type:"script",cache:!1,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};a.call(this,t,o)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});r.register("script",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new o(this,t[n]));else this.addFile(new o(this,t,e,i));return this}),t.exports=o},function(t,e,i){var n=i(0),l=i(18),u=i(19),s=i(7),c=i(1),d=i(8),o=new n({Extends:u,initialize:function(t,e,i,n,s,r){var o="js";if(d(e)){var a=e;e=c(a,"key"),i=c(a,"url"),r=c(a,"xhrSettings"),o=c(a,"extension",o),n=c(a,"start"),s=c(a,"mapping")}var h={type:"plugin",cache:!1,extension:o,responseType:"text",key:e,url:i,xhrSettings:r,config:{start:n,mapping:s}};u.call(this,t,h),"function"==typeof i&&(this.data=i,this.state=l.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=c(e,"start",!1),n=c(e,"mapping",null);this.state===l.FILE_POPULATED?t.install(this.key,this.data,i,n):(this.state=l.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),t.install(this.key,window[this.key],i,n)),this.onProcessComplete()}});s.register("plugin",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new o(this,t[r]));else this.addFile(new o(this,t,e,i,n,s));return this}),t.exports=o},function(t,e,i){var n=i(0),s=i(7),v=i(1),y=i(37),l=i(8),u=i(28),c=i(36),a=new n({Extends:c,initialize:function(t,e,i,n,s,r,o){if(l(e)){var a=e;e=v(a,"key"),i=v(a,"url"),r=v(a,"xhrSettings"),n=v(a,"path"),s=v(a,"baseURL"),o=v(a,"textureXhrSettings")}var h=new u(t,e,i,r);c.call(this,t,"multiatlas",e,[h]),this.config.path=n,this.config.baseURL=s,this.config.textureXhrSettings=o},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,"json"===t.type&&t.data.hasOwnProperty("textures"))){var e=t.data.textures,i=this.config,n=this.loader,s=n.baseURL,r=n.path,o=n.prefix,a=v(i,"baseURL",s),h=v(i,"path",r),l=v(i,"prefix",o),u=v(i,"textureXhrSettings");n.setBaseURL(a),n.setPath(h),n.setPrefix(l);for(var c=0;c<e.length;c++){var d=e[c].image,f="_MA_"+d,p=new y(n,f,d,u);if(this.addToMultiFile(p),n.addFile(p),e[c].normalMap){var g=new y(n,f,e[c].normalMap,u);g.type="normalMap",p.setLink(g),this.addToMultiFile(g),n.addFile(g)}}n.setBaseURL(s),n.setPath(r),n.setPrefix(o)}},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0];t.addToCache();for(var e=[],i=[],n=[],s=1;s<this.files.length;s++){var r=this.files[s];if("normalMap"!==r.type)for(var o=r.key.substr(4),a=r.data,h=0;h<t.data.textures.length;h++){var l=t.data.textures[h];if(l.image===o){i.push(a),e.push(l),r.linkFile&&n.push(r.linkFile.data);break}}}for(0===n.length&&(n=void 0),this.loader.textureManager.addAtlasJSONArray(this.key,i,e,n),this.complete=!0,s=0;s<this.files.length;s++)this.files[s].pendingDestroy()}}});s.register("multiatlas",function(t,e,i,n,s){var r;if(Array.isArray(t))for(var o=0;o<t.length;o++)r=new a(this,t[o]),this.addFile(r.files);else r=new a(this,t,e,i,n,s),this.addFile(r.files);return this}),t.exports=a},function(t,e,i){var u=i(168),n=i(0),s=i(7),c=i(1),d=i(8),f=i(28),p=i(36),g=new n({Extends:p,initialize:function(t,e,i,n,s,r,o){if(d(e)){var a=e;e=c(a,"key"),i=c(a,"jsonURL"),n=c(a,"audioURL"),s=c(a,"audioConfig"),r=c(a,"audioXhrSettings"),o=c(a,"jsonXhrSettings")}var h;if(n){var l=u.create(t,e,n,s,r);l&&(h=new f(t,e,i,o),p.call(this,t,"audiosprite",e,[l,h]),this.config.resourceLoad=!1)}else h=new f(t,e,i,o),p.call(this,t,"audiosprite",e,[h]),this.config.resourceLoad=!0,this.config.audioConfig=s,this.config.audioXhrSettings=r},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,this.config.resourceLoad&&"json"===t.type&&t.data.hasOwnProperty("resources"))){var e=t.data.resources,i=c(this.config,"audioConfig"),n=c(this.config,"audioXhrSettings"),s=u.create(this.loader,t.key,e,i,n);s&&(this.addToMultiFile(s),this.loader.addFile(s))}},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.addToCache(),this.complete=!0}}});s.register("audioSprite",function(t,e,i,n,s,r){var o,a=this.systems.game,h=a.config.audio,l=a.device.audio;if(h&&h.noAudio||!l.webAudio&&!l.audioData)return this;if(Array.isArray(t))for(var u=0;u<t.length;u++)(o=new g(this,t[u])).files&&this.addFile(o.files);else(o=new g(this,t,e,i,n,s,r)).files&&this.addFile(o.files);return this})},function(t,e,i){var n=i(0),s=i(7),l=i(1),u=i(37),c=i(8),d=i(28),f=i(36),a=new n({Extends:f,initialize:function(t,e,i,n,s,r){var o,a;if(c(e)){var h=e;e=l(h,"key"),o=new u(t,{key:e,url:l(h,"textureURL"),extension:l(h,"textureExtension","png"),normalMap:l(h,"normalMap"),xhrSettings:l(h,"textureXhrSettings")}),a=new d(t,{key:e,url:l(h,"atlasURL"),extension:l(h,"atlasExtension","json"),xhrSettings:l(h,"atlasXhrSettings")})}else o=new u(t,e,i,s),a=new d(t,e,n,r);o.linkFile?f.call(this,t,"atlasjson",e,[o,a,o.linkFile]):f.call(this,t,"atlasjson",e,[o,a])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});s.register("atlas",function(t,e,i,n,s){var r;if(Array.isArray(t))for(var o=0;o<t.length;o++)r=new a(this,t[o]),this.addFile(r.files);else r=new a(this,t,e,i,n,s),this.addFile(r.files);return this}),t.exports=a},function(t,e,i){var n=i(0),s=i(7),r=i(28),o=new n({Extends:r,initialize:function(t,e,i,n,s){r.call(this,t,e,i,n,s),this.type="animationJSON"},onProcess:function(){this.loader.once("loadcomplete",this.onLoadComplete,this),r.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data),this.pendingDestroy()}});s.register("animation",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new o(this,t[s]));else this.addFile(new o(this,t,e,n,i));return this}),t.exports=o},function(t,e,i){t.exports={TouchManager:i(197)}},function(t,e,i){t.exports={MouseManager:i(199)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=50),t.isUp&&t.duration<e}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=50),t.isDown&&t.duration<e}},function(t,e){t.exports=function(t){return!!t._justUp&&!(t._justUp=!1)}},function(t,e){t.exports=function(t){return!!t._justDown&&!(t._justDown=!1)}},function(t,e){t.exports=function(t,e){if(t.originalEvent=e,t.preventDefault&&e.preventDefault(),t.enabled)return t.isDown=!1,t.isUp=!0,t.timeUp=e.timeStamp,t.duration=t.timeUp-t.timeDown,t.repeats=0,t._justDown=!1,t._justUp=!0,t}},function(t,e){t.exports=function(t,e){if(t.originalEvent=e,t.preventDefault&&e.preventDefault(),t.enabled)return t.altKey=e.altKey,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.location=e.location,!1===t.isDown&&(t.isDown=!0,t.isUp=!1,t.timeDown=e.timeStamp,t.duration=0,t._justDown=!0,t._justUp=!1),t.repeats++,t}},function(t,e,i){var n=i(109),s={};for(var r in n)s[n[r]]=r;t.exports=s},function(t,e){t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},function(t,e){t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},function(t,e,i){var r=i(371);t.exports=function(t,e){if(e.matched)return!0;var i=!1,n=!1;if(t.keyCode===e.current)if(0<e.index&&0<e.maxKeyDelay){var s=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=s&&(n=!0,i=r(t,e))}else n=!0,i=r(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 n=i(0),s=i(9),r=i(4),o=i(76),a=i(171),h=i(109),l=i(170),u=i(369),c=i(368),d=i(367),f=new n({Extends:s,initialize:function(t){s.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.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 i=this,t=function(t){if(!t.defaultPrevented&&i.isActive()){i.queue.push(t);var e=i.keys[t.keyCode];e&&e.preventDefault&&t.preventDefault()}};this.onKeyHandler=t,this.target.addEventListener("keydown",t,!1),this.target.addEventListener("keyup",t,!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<t.length;i++)e[t[i]]=this.addKey(t[i])}else for(var n in t)e[n]=this.addKey(t[n]);return e},addKey:function(t){var e=this.keys;if(t instanceof a){var i=e.indexOf(t);return-1<i?e[i]=t:e[t.keyCode]=t,t}return"string"==typeof t&&(t=h[t.toUpperCase()]),e[t]||(e[t]=new a(t)),e[t]},removeKey:function(t){var e=this.keys;if(t instanceof a){var i=e.indexOf(t);-1<i&&(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 l(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,n=0;n<t;n++){var s=e[n],r=s.keyCode;"keydown"===s.type?(!u[r]||void 0!==i[r]&&!1!==i[r].isDown||(this.emit(s.type,s),this.emit("keydown_"+u[r],s)),i[r]&&c(i[r],s)):(this.emit(s.type,s),this.emit("keyup_"+u[r],s),i[r]&&d(i[r],s))}},shutdown:function(){this.stopListeners(),this.removeAllListeners()},destroy:function(){this.shutdown(),this.keys=[],this.combos=[],this.queue=[],this.scene=null,this.settings=null,this.sceneInputPlugin=null,this.target=null}});o.register("KeyboardPlugin",f,"keyboard","keyboard","inputKeyboard"),t.exports=f},function(t,e,i){t.exports={KeyboardPlugin:i(373),Key:i(171),KeyCodes:i(109),KeyCombo:i(170),JustDown:i(366),JustUp:i(365),DownDuration:i(364),UpDuration:i(363)}},function(t,e){t.exports=function(r,o){return function(t,e,i,n){var s=r.getPixelAlpha(e,i,n.texture.key,n.frame.key);return s&&o<=s}}},function(t,e,i){var o=i(88),a=i(32),n=i(0),f=i(175),s=i(375),p=i(58),h=i(114),l=i(54),r=i(9),g=i(1),u=i(76),v=i(8),c=i(12),d=i(14),y=i(31),m=i(68),x=i(60),w=new n({Extends:r,initialize:function(t){r.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new r,this.enabled=!0,this.displayList,this.cameras,u.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,n=e.length;if(0!==i||0!==n){for(var s=this._list,r=0;r<i;r++){var o=t[r],a=s.indexOf(o);-1<a&&(s.splice(a,1),this.clear(o))}t.length=0,this._pendingRemoval.length=0,this._list=s.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 n=i.dirty||0===this.pollRate;if(-1<this.pollRate&&(this._pollTimer-=e,this._pollTimer<0&&(n=!0,this._pollTimer=this.pollRate)),n)for(var s=this.manager.pointers,r=0;r<this.manager.pointersTotal;r++){var o=s[r];this._tempZones=[],this._temp=this.hitTestPointer(o),this.sortGameObjects(this._temp),this.sortGameObjects(this._tempZones),this.topOnly&&(this._temp.length&&this._temp.splice(1),this._tempZones.length&&this._tempZones.splice(1));var a=this.processDragEvents(o,t);o.wasTouch||(a+=this.processOverOutEvents(o)),o.justDown&&(a+=this.processDownEvents(o)),o.justUp&&(a+=this.processUpEvents(o)),o.justMoved&&(a+=this.processMoveEvents(o)),0<a&&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-1<i&&this._draggable.splice(i,1),-1<(i=this._drag[0].indexOf(t))&&this._drag[0].splice(i,1),-1<(i=this._over[0].indexOf(t))&&this._over[0].splice(i,1),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,n){return void 0===n&&(n=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&n&&!t.input.dropZone&&(t.input.dropZone=n),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i<e.length;i++){for(var n=e[i],s=this.manager.hitTest(t,this._list,n),r=0;r<s.length;r++){var o=s[r];o.input.dropZone&&this._tempZones.push(o)}if(0<s.length)return t.camera=n,s}return[]},processDownEvents:function(t){var e=this._temp;this.emit("pointerdown",t,e);for(var i=0,n=0;n<e.length;n++){var s=e[n];s.input&&(i++,s.emit("pointerdown",t,s.input.localX,s.input.localY,t.camera),this.emit("gameobjectdown",t,s))}return i},processDragEvents:function(t,e){if(0===this._draggable.length)return 0;var i,n,s,r,o=this._temp;if(0===t.dragState&&t.primaryDown&&t.justDown&&0<o.length?t.dragState=1:0<t.dragState&&!t.primaryDown&&t.justUp&&(t.dragState=5),1===t.dragState){var a=[];for(i=0;i<o.length;i++)(n=o[i]).input.draggable&&a.push(n);if(0===a.length)return t.dragState=0;1<a.length&&(this.sortGameObjects(a),this.topOnly&&a.splice(1)),this._drag[t.id]=a,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?t.dragState=3:t.dragState=2}if(2===t.dragState&&(0<this.dragDistanceThreshold&&p(t.x,t.y,t.downX,t.downY)>=this.dragDistanceThreshold&&(t.dragState=3),0<this.dragTimeThreshold&&e>=t.downTime+this.dragTimeThreshold&&(t.dragState=3)),3===t.dragState){for(s=this._drag[t.id],i=0;i<s.length;i++)(r=(n=s[i]).input).dragState=2,r.dragX=t.x-n.x,r.dragY=t.y-n.y,r.dragStartX=n.x,r.dragStartY=n.y,n.emit("dragstart",t,r.dragX,r.dragY),this.emit("dragstart",t,n);return t.dragState=4,s.length}if(4===t.dragState&&t.justMoved&&!t.justUp){var h=this._tempZones;for(s=this._drag[t.id],i=0;i<s.length;i++){if((r=(n=s[i]).input).target){var l=h.indexOf(r.target);0===l?(n.emit("dragover",t,r.target),this.emit("dragover",t,n,r.target)):0<l?(n.emit("dragleave",t,r.target),this.emit("dragleave",t,n,r.target),r.target=h[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target)):(n.emit("dragleave",t,r.target),this.emit("dragleave",t,n,r.target),h[0]?(r.target=h[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target)):r.target=null)}else!r.target&&h[0]&&(r.target=h[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target));var u=t.x-n.input.dragX,c=t.y-n.input.dragY;n.emit("drag",t,u,c),this.emit("drag",t,n,u,c)}return s.length}if(5===t.dragState){for(s=this._drag[t.id],i=0;i<s.length;i++)if(2===(r=(n=s[i]).input).dragState){r.dragState=0,r.dragX=r.localX-n.displayOriginX,r.dragY=r.localY-n.displayOriginY;var d=!1;r.target&&(n.emit("drop",t,r.target),this.emit("drop",t,n,r.target),d=!(r.target=null)),n.emit("dragend",t,r.dragX,r.dragY,d),this.emit("dragend",t,n,d)}t.dragState=0,s.splice(0)}return 0},processMoveEvents:function(t){var e=this._temp;this.emit("pointermove",t,e);for(var i=0,n=0;n<e.length;n++){var s=e[n];if(s.input&&(i++,s.emit("pointermove",t,s.input.localX,s.input.localY),this.emit("gameobjectmove",t,s),this.topOnly))break}return i},processOverOutEvents:function(t){var e,i,n=this._temp,s=[],r=[],o=[],a=this._over[t.id],h=this._drag[t.id],l=this.manager;for(e=0;e<a.length;e++)i=a[e],-1===n.indexOf(i)&&-1===h.indexOf(i)?s.push(i):o.push(i);for(e=0;e<n.length;e++)i=n[e],-1===a.indexOf(i)&&r.push(i);var u=s.length,c=0;if(0<u)for(this.sortGameObjects(s),this.emit("pointerout",t,s),e=0;e<u;e++)(i=s[e]).input&&(this.emit("gameobjectout",t,i),i.emit("pointerout",t),l.resetCursor(i.input),c++);if(0<(u=r.length))for(this.sortGameObjects(r),this.emit("pointerover",t,r),e=0;e<u;e++)(i=r[e]).input&&(this.emit("gameobjectover",t,i),i.emit("pointerover",t,i.input.localX,i.input.localY),l.setCursor(i.input),c++);return a=o.concat(r),this._over[t.id]=this.sortGameObjects(a),c},processUpEvents:function(t){var e=this._temp;this.emit("pointerup",t,e);for(var i=0;i<e.length;i++){var n=e[i];n.input&&(n.emit("pointerup",t,n.input.localX,n.input.localY),this.emit("gameobjectup",t,n))}return e.length},queueForInsertion:function(t){return-1===this._pendingInsertion.indexOf(t)&&-1===this._list.indexOf(t)&&this._pendingInsertion.push(t),this},queueForRemoval:function(t){return this._pendingRemoval.push(t),this},setDraggable:function(t,e){void 0===e&&(e=!0),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];n.input.draggable=e;var s=this._draggable.indexOf(n);e&&-1===s?this._draggable.push(n):!e&&-1<s&&this._draggable.splice(s,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return s(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var n=!1,s=!1,r=!1,o=!1;if(v(e)){var a=e;e=g(a,"hitArea",null),i=g(a,"hitAreaCallback",null),n=g(a,"draggable",!1),s=g(a,"dropZone",!1),r=g(a,"cursor",!1),o=g(a,"useHandCursor",!1);var h=g(a,"pixelPerfect",!1),l=g(a,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(l)),e&&i||this.setHitAreaFromTexture(t)}else"function"!=typeof e||i||(i=e,e={});for(var u=0;u<t.length;u++){var c=t[u],d=c.input?c.input:f(c,e,i);d.dropZone=s,d.cursor=o?"pointer":r,c.input=d,n&&this.setDraggable(c),this.queueForInsertion(c)}return this},setHitAreaCircle:function(t,e,i,n,s){void 0===s&&(s=a);var r=new o(e,i,n);return this.setHitArea(t,r,s)},setHitAreaEllipse:function(t,e,i,n,s,r){void 0===r&&(r=l);var o=new h(e,i,n,s);return this.setHitArea(t,o,r)},setHitAreaFromTexture:function(t,e){void 0===e&&(e=y),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i],s=n.frame,r=0,o=0;s?(r=s.realWidth,o=s.realHeight):n.width&&(r=n.width,o=n.height),"Container"!==n.type||0!==r&&0!==o?0!==r&&0!==o&&(n.input=f(n,new d(0,0,r,o),e),this.queueForInsertion(n)):console.warn("Container.setInteractive() must specify a Shape or call setSize() first")}return this},setHitAreaRectangle:function(t,e,i,n,s,r){void 0===r&&(r=y);var o=new d(e,i,n,s);return this.setHitArea(t,o,r)},setHitAreaTriangle:function(t,e,i,n,s,r,o,a){void 0===a&&(a=x);var h=new m(e,i,n,s,r,o);return this.setHitArea(t,h,a)},setPollAlways:function(){return this.pollRate=0,this._pollTimer=0,this},setPollOnMove:function(){return this.pollRate=-1,this._pollTimer=0,this},setPollRate:function(t){return this.pollRate=t,this._pollTimer=0,this},setGlobalTopOnly:function(t){return this.manager.globalTopOnly=t,this},setTopOnly:function(t){return this.topOnly=t,this},sortGameObjects:function(t){return t.length<2?t:(this.scene.sys.depthSort(),t.sort(this.sortHandlerGO.bind(this)))},sortHandlerGO:function(t,e){if(!t.parentContainer&&!e.parentContainer)return this.displayList.getIndex(e)-this.displayList.getIndex(t);if(t.parentContainer===e.parentContainer)return e.parentContainer.getIndex(e)-t.parentContainer.getIndex(t);if(t.parentContainer===e)return-1;if(e.parentContainer===t)return 1;for(var i=t.getIndexList(),n=e.getIndexList(),s=Math.min(i.length,n.length),r=0;r<s;r++){var o=i[r],a=n[r];if(o!==a)return a-o}return 0},stopPropagation:function(){return this.manager.globalTopOnly&&(this.manager.ignoreEvents=!0),this},addUpCallback:function(t,e){return this.manager.addUpCallback(t,e),this},addDownCallback:function(t,e){return this.manager.addDownCallback(t,e),this},addMoveCallback:function(t,e){return this.manager.addMoveCallback(t,e),this},addPointer:function(t){return this.manager.addPointer(t)},setDefaultCursor:function(t){return this.manager.setDefaultCursor(t),this},transitionIn:function(){this.enabled=this.settings.transitionAllowInput},transitionComplete:function(){this.settings.transitionAllowInput||(this.enabled=!0)},transitionOut:function(){this.enabled=this.settings.transitionAllowInput},shutdown:function(){this.pluginEvents.emit("shutdown"),this._temp.length=0,this._list.length=0,this._draggable.length=0,this._pendingRemoval.length=0;for(var t=this._pendingInsertion.length=0;t<10;t++)this._drag[t]=[],this._over[t]=[];this.removeAllListeners();var e=this.systems.events;e.off("transitionstart",this.transitionIn,this),e.off("transitionout",this.transitionOut,this),e.off("transitioncomplete",this.transitionComplete,this),e.off("preupdate",this.preUpdate,this),e.off("update",this.update,this),e.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.pluginEvents.emit("destroy"),this.pluginEvents.removeAllListeners(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.cameras=null,this.manager=null,this.events=null,this.mouse=null},x:{get:function(){return this.manager.activePointer.x}},y:{get:function(){return this.manager.activePointer.y}},mousePointer:{get:function(){return this.manager.mousePointer}},activePointer:{get:function(){return this.manager.activePointer}},pointer1:{get:function(){return this.manager.pointers[1]}},pointer2:{get:function(){return this.manager.pointers[2]}},pointer3:{get:function(){return this.manager.pointers[3]}},pointer4:{get:function(){return this.manager.pointers[4]}},pointer5:{get:function(){return this.manager.pointers[5]}},pointer6:{get:function(){return this.manager.pointers[6]}},pointer7:{get:function(){return this.manager.pointers[7]}},pointer8:{get:function(){return this.manager.pointers[8]}},pointer9:{get:function(){return this.manager.pointers[9]}},pointer10:{get:function(){return this.manager.pointers[10]}}});c.register("InputPlugin",w,"input"),t.exports=w},function(t,e){t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,MENU:16,A:0,B:1,X:2,Y:3,LB:4,RB:5,LT:6,RT:7,BACK:8,START:9,LS:10,RS:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},function(t,e){t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SELECT:8,START:9,B:0,A:1,Y:2,X:3,LEFT_SHOULDER:4,RIGHT_SHOULDER:5}},function(t,e){t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SHARE:8,OPTIONS:9,PS:16,TOUCHBAR:17,X:0,CIRCLE:1,SQUARE:2,TRIANGLE:3,L1:4,R1:5,L2:6,R2:7,L3:10,R3:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},function(t,e,i){t.exports={DUALSHOCK_4:i(379),SNES_USB:i(378),XBOX_360:i(377)}},function(t,e,i){var n=i(0),s=i(9),h=i(172),r=i(4),o=i(76),a=new n({Extends:s,initialize:function(t){s.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,t.pluginEvents.once("boot",this.boot,this),t.pluginEvents.on("start",this.start,this)},boot:function(){var t=this.scene.sys.game,e=this.settings.input,i=t.config;this.enabled=r(e,"gamepad",i.inputGamepad)&&t.device.input.gamepads,this.target=r(e,"gamepad.target",i.inputGamepadEventTarget),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 e=this,t=this.target,i=function(t){!t.defaultPrevented&&e.isActive()&&(e.refreshPads(),e.queue.push(t))};this.onGamepadHandler=i,t.addEventListener("gamepadconnected",i,!1),t.addEventListener("gamepaddisconnected",i,!1),this.sceneInputPlugin.pluginEvents.on("update",this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off("update",this.update)},disconnectAll:function(){for(var t=0;t<this.gamepads.length;t++)this.gamepads.connected=!1},refreshPads:function(){var t=navigator.getGamepads();if(t)for(var e=this.gamepads,i=0;i<t.length;i++){var n=t[i];if(n){var s=n.id,r=n.index,o=e[r];if(o)o.id!==s?(o.destroy(),e[r]=new h(this,n)):o.update(n);else{var a=new h(this,n);e[r]=a,this._pad1?this._pad2?this._pad3?this._pad4||(this._pad4=a):this._pad3=a:this._pad2=a:this._pad1=a}}}else this.disconnectAll()},getAll:function(){for(var t=[],e=this.gamepads,i=0;i<e.length;i++)e[i]&&t.push(e[i]);return t},getPad:function(t){for(var e=this.gamepads,i=0;i<e.length;i++)if(e[i]&&e[i].index===t)return e[i]},update:function(){if(this.enabled){this.refreshPads();var t=this.queue.length;if(0!==t)for(var e=this.queue.splice(0,t),i=0;i<t;i++){var n=e[i],s=this.getPad(n.gamepad.index);"gamepadconnected"===n.type?this.emit("connected",s,n):"gamepaddisconnected"===n.type&&this.emit("disconnected",s,n)}}},shutdown:function(){this.stopListeners(),this.disconnectAll(),this.removeAllListeners()},destroy:function(){this.shutdown();for(var t=0;t<this.gamepads.length;t++)this.gamepads[t]&&this.gamepads[t].destroy();this.gamepads=[],this.scene=null,this.settings=null,this.sceneInputPlugin=null,this.target=null},total:{get:function(){return this.gamepads.length}},pad1:{get:function(){return this._pad1}},pad2:{get:function(){return this._pad2}},pad3:{get:function(){return this._pad3}},pad4:{get:function(){return this._pad4}}});o.register("GamepadPlugin",a,"gamepad","gamepad","inputGamepad"),t.exports=a},function(t,e,i){t.exports={Axis:i(174),Button:i(173),Gamepad:i(172),GamepadPlugin:i(381),Configs:i(380)}},function(t,e,i){var n=i(200),s=i(17),r={CreateInteractiveObject:i(175),Gamepad:i(382),InputManager:i(201),InputPlugin:i(376),InputPluginCache:i(76),Keyboard:i(374),Mouse:i(362),Pointer:i(198),Touch:i(361)};r=s(!1,r,n),t.exports=r},function(t,e,i){var d=i(5);function f(t,e,i,n){var s=t-i,r=e-n,o=s*s+r*r;return Math.sqrt(o)}t.exports=function(t,e){void 0===e&&(e=new d);var i=t.x1,n=t.y1,s=t.x2,r=t.y2,o=t.x3,a=t.y3,h=f(o,a,s,r),l=f(i,n,o,a),u=f(s,r,i,n),c=h+l+u;return e.x=(i*h+s*l+o*u)/c,e.y=(n*h+r*l+a*u)/c,e}},function(t,e){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t.x3+=e,t.y3+=i,t}},function(t,e,i){var n=i(5);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=(t.x1+t.x2+t.x3)/3,e.y=(t.y1+t.y2+t.y3)/3,e}},function(t,e){t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&e.x>t.x&&e.x<t.right&&e.right>t.x&&e.right<t.right&&e.y>t.y&&e.y<t.bottom&&e.bottom>t.y&&e.bottom<t.bottom}},function(t,e){t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},function(t,e,i){var n=i(14);n.Area=i(797),n.Ceil=i(796),n.CeilAll=i(795),n.CenterOn=i(388),n.Clone=i(794),n.Contains=i(31),n.ContainsPoint=i(793),n.ContainsRect=i(387),n.CopyFrom=i(792),n.Decompose=i(395),n.Equals=i(791),n.FitInside=i(790),n.FitOutside=i(789),n.Floor=i(788),n.FloorAll=i(787),n.FromPoints=i(274),n.GetAspectRatio=i(228),n.GetCenter=i(786),n.GetPoint=i(135),n.GetPoints=i(294),n.GetSize=i(785),n.Inflate=i(784),n.MarchingAnts=i(570),n.MergePoints=i(783),n.MergeRect=i(782),n.MergeXY=i(781),n.Offset=i(780),n.OffsetPoint=i(779),n.Overlaps=i(778),n.Perimeter=i(97),n.PerimeterPoint=i(777),n.Random=i(154),n.RandomOutside=i(776),n.Scale=i(775),n.Union=i(473),t.exports=n},function(t,e,i){var n=i(0),s=i(229),r=new n({initialize:function(t){this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return s(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],!Array.isArray(t))return this;for(var e,i=Number.MAX_VALUE,n=0;n<t.length;n++)e={x:0,y:0},"number"==typeof t[n]?(e.x=t[n],e.y=t[n+1],n++):Array.isArray(t[n])?(e.x=t[n][0],e.y=t[n][1]):(e.x=t[n].x,e.y=t[n].y),this.points.push(e),e.y<i&&(i=e.y);return this.calculateArea(i),this},calculateArea:function(){if(this.points.length<3)return this.area=0,this.area;for(var t,e,i=0,n=0;n<this.points.length-1;n++)t=this.points[n],i+=((e=this.points[n+1]).x-t.x)*(t.y+e.y);return t=this.points[0],e=this.points[this.points.length-1],i+=(t.x-e.x)*(e.y+t.y),this.area=.5*-i,this.area}});t.exports=r},function(t,e){t.exports=function(t){return t.x*t.x+t.y*t.y}},function(t,e){t.exports=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}},function(t,e,i){var n=i(16),s=i(39),r=i(82);t.exports=function(t){var e=r(t)-n.TAU;return s(e,-Math.PI,Math.PI)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},function(t,e){t.exports=function(t,e){return(t.x-e.x1)*(e.y2-e.y1)==(e.x2-e.x1)*(t.y-e.y1)}},function(t,e,i){var c=i(32),d=new(i(5));t.exports=function(t,e,i){if(void 0===i&&(i=d),c(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(c(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var n=t.x2-t.x1,s=t.y2-t.y1,r=e.x-t.x1,o=e.y-t.y1,a=n*n+s*s,h=n,l=s;if(0<a){var u=(r*n+o*s)/a;h*=u,l*=u}return i.x=t.x1+h,i.y=t.y1+l,h*h+l*l<=a&&0<=h*n+l*s&&c(e,i.x,i.y)}},function(t,e){t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0||t.right<e.x||t.bottom<e.y||t.x>e.right||t.y>e.bottom)}},function(t,e,i){t.exports={CircleToCircle:i(844),CircleToRectangle:i(843),GetRectangleIntersection:i(842),LineToCircle:i(397),LineToLine:i(144),LineToRectangle:i(841),PointToLine:i(396),PointToLineSegment:i(840),RectangleToRectangle:i(398),RectangleToTriangle:i(839),RectangleToValues:i(838),TriangleToCircle:i(837),TriangleToLine:i(836),TriangleToTriangle:i(835)}},function(t,e,i){t.exports={Circle:i(854),Ellipse:i(249),Intersects:i(399),Line:i(834),Point:i(816),Polygon:i(802),Rectangle:i(389),Triangle:i(774)}},function(t,e,i){var n=i(0),a=i(402),p=i(148),h=i(27),s=new n({initialize:function(){this.lightPool=[],this.lights=[],this.culledLights=[],this.ambientColor={r:.1,g:.1,b:.1},this.active=!1},enable:function(){return this.active=!0,this},disable:function(){return this.active=!1,this},cull:function(t){for(var e=this.lights,i=this.culledLights,n=e.length,s=t.x+t.width/2,r=t.y+t.height/2,o=(t.width+t.height)/2,a={x:0,y:0},h=t.matrix,l=this.systems.game.config.height,u=i.length=0;u<n&&i.length<p.LIGHT_COUNT;++u){var c=e[u];h.transformPoint(c.x,c.y,a);var d=s-(a.x-t.scrollX*c.scrollFactorX*t.zoom),f=r-(l-(a.y-t.scrollY*c.scrollFactorY*t.zoom));Math.sqrt(d*d+f*f)<c.radius+o&&i.push(e[u])}return i},forEachLight:function(t){if(t){for(var e=this.lights,i=e.length,n=0;n<i;++n)t(e[n]);return this}},setAmbientColor:function(t){var e=h.getFloatsFromUintRGB(t);return this.ambientColor.r=e[0],this.ambientColor.g=e[1],this.ambientColor.b=e[2],this},getMaxVisibleLights:function(){return 10},getLightCount:function(){return this.lights.length},addLight:function(t,e,i,n,s){var r,o=null;return t=void 0===t?0:t,e=void 0===e?0:e,n=void 0===n?16777215:n,i=void 0===i?100:i,s=void 0===s?1:s,r=h.getFloatsFromUintRGB(n),o=null,0<this.lightPool.length?(o=this.lightPool.pop()).set(t,e,i,r[0],r[1],r[2],s):o=new a(t,e,i,r[0],r[1],r[2],s),this.lights.push(o),o},removeLight:function(t){var e=this.lights.indexOf(t);return 0<=e&&(this.lightPool.push(t),this.lights.splice(e,1)),this},shutdown:function(){for(;0<this.lights.length;)this.lightPool.push(this.lights.pop());this.ambientColor={r:.1,g:.1,b:.1},this.culledLights.length=0,this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=s},function(t,e,i){var n=i(0),s=i(27),r=new n({initialize:function(t,e,i,n,s,r,o){this.x=t,this.y=e,this.radius=i,this.r=n,this.g=s,this.b=r,this.intensity=o,this.scrollFactorX=1,this.scrollFactorY=1},set:function(t,e,i,n,s,r,o){return this.x=t,this.y=e,this.radius=i,this.r=n,this.g=s,this.b=r,this.intensity=o,this.scrollFactorX=1,this.scrollFactorY=1,this},setScrollFactor:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this},setColor:function(t){var e=s.getFloatsFromUintRGB(t);return this.r=e[0],this.g=e[1],this.b=e[2],this},setIntensity:function(t){return this.intensity=t,this},setPosition:function(t,e){return this.x=t,this.y=e,this},setRadius:function(t){return this.radius=t,this}});t.exports=r},function(t,e,i){var o=i(24),n=i(13),a=i(10),h=i(110);n.register("text",function(t,e){void 0===t&&(t={});var i=a(t,"text",""),n=a(t,"style",null),s=a(t,"padding",null);null!==s&&(n.padding=s);var r=new h(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),o(this.scene,r,t),r.autoRound=a(t,"autoRound",!0),r.resolution=a(t,"resolution",1),r})},function(t,e,i){var r=i(24),o=i(127),n=i(13),a=i(10),h=i(34);n.register("sprite",function(t,e){void 0===t&&(t={});var i=a(t,"key",null),n=a(t,"frame",null),s=new h(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),r(this.scene,s,t),o(s,t),s})},function(t,e,i){var r=i(24),n=i(13),o=i(10),a=i(69);n.register("image",function(t,e){void 0===t&&(t={});var i=o(t,"key",null),n=o(t,"frame",null),s=new a(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),r(this.scene,s,t),s})},function(t,e,i){var n=i(13),s=i(115);n.register("graphics",function(t,e){void 0===t&&(t={}),void 0!==e&&(t.add=e);var i=new s(this.scene,t);return t.add&&this.scene.sys.displayList.add(i),i})},function(t,e,i){var s=i(110);i(11).register("text",function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))})},function(t,e,i){var n=i(11),r=i(34);n.register("sprite",function(t,e,i,n){var s=new r(this.scene,t,e,i,n);return this.displayList.add(s),this.updateList.add(s),s})},function(t,e,i){var s=i(69);i(11).register("image",function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))})},function(t,e,i){var n=i(115);i(11).register("graphics",function(t){return this.displayList.add(new n(this.scene,t))})},function(t,e){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<<Math.ceil(e)}},function(t,e,i){var p=i(22);t.exports=function(t){var e=p.create(this),i=e.getContext("2d");t.syncFont(e,i);var n=Math.ceil(i.measureText(t.testString).width*t.baselineX),s=n,r=2*s;s=s*t.baselineY|0,e.width=n,e.height=r,i.fillStyle="#f00",i.fillRect(0,0,n,r),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,s);var o={ascent:0,descent:0,fontSize:0};if(!i.getImageData(0,0,n,r))return o.ascent=s,o.descent=s+6,o.fontSize=o.ascent+o.descent,p.remove(e),o;var a,h,l=i.getImageData(0,0,n,r).data,u=l.length,c=4*n,d=0,f=!1;for(a=0;a<s;a++){for(h=0;h<c;h+=4)if(255!==l[d+h]){f=!0;break}if(f)break;d+=c}for(o.ascent=s-a,d=u-c,f=!1,a=r;s<a;a--){for(h=0;h<c;h+=4)if(255!==l[d+h]){f=!0;break}if(f)break;d-=c}return o.descent=a-s,o.fontSize=o.ascent+o.descent,p.remove(e),o}},function(t,e,i){var n=i(0),r=i(10),o=i(4),s=i(412),a={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},h=new n({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.rtl,this.testString,this.baselineX,this.baselineY,this._font,this.setStyle(e,!1);var i=o(e,"metrics",!1);this.metrics=i?{ascent:o(i,"ascent",0),descent:o(i,"descent",0),fontSize:o(i,"fontSize",0)}:s(this)},setStyle:function(t,e){for(var i in void 0===e&&(e=!0),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),a)this[i]="wordWrapCallback"===i||"wordWrapCallbackScope"===i?o(t,a[i][0],a[i][1]):r(t,a[i][0],a[i][1]);var n=o(t,"font",null);this._font=null===n?[this.fontStyle,this.fontSize,this.fontFamily].join(" "):n;var s=o(t,"fill",null);return null!==s&&(this.color=s),e?this.update(!0):this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" "),this.metrics=s(this)),this.parent.updateText()},setFont:function(t){return"string"==typeof t?(this.fontFamily=t,this.fontSize="",this.fontStyle=""):(this.fontFamily=o(t,"fontFamily","Courier"),this.fontSize=o(t,"fontSize","16px"),this.fontStyle=o(t,"fontStyle","")),this.update(!0)},setFontFamily:function(t){return this.fontFamily=t,this.update(!0)},setFontStyle:function(t){return this.fontStyle=t,this.update(!0)},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize=t,this.update(!0)},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setStroke:function(t,e){return void 0===t?this.strokeThickness=0:(void 0===e&&(e=this.strokeThickness),this.stroke=t,this.strokeThickness=e),this.update(!0)},setShadow:function(t,e,i,n,s,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===s&&(s=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=n,this.shadowStroke=s,this.shadowFill=r,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in a)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},function(t,e,i){var u=i(2);t.exports=function(t,e,i,n,s){if(!(u.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id||""===e.text)){var r=t.currentContext;t.currentBlendMode!==e.blendMode&&(t.currentBlendMode=e.blendMode,r.globalCompositeOperation=t.blendModes[e.blendMode]),t.currentAlpha!==e.alpha&&(t.currentAlpha=e.alpha,r.globalAlpha=e.alpha),t.currentScaleMode!==e.scaleMode&&(t.currentScaleMode=e.scaleMode);var o=e.canvas;if(r.save(),void 0!==s){var a=s.matrix;r.transform(a[0],a[1],a[2],a[3],a[4],a[5])}var h=e.x-n.scrollX*e.scrollFactorX,l=e.y-n.scrollY*e.scrollFactorY;t.config.roundPixels&&(h|=0,l|=0),r.translate(h,l),r.rotate(e.rotation),r.scale(e.scaleX,e.scaleY),r.translate(o.width*(e.flipX?1:0),o.height*(e.flipY?1:0)),r.scale(e.flipX?-1:1,e.flipY?-1:1),r.drawImage(o,0,0,o.width,o.height,-e.displayOriginX,-e.displayOriginY,o.width,o.height),r.restore()}}},function(t,e,i){var r=i(2);t.exports=function(t,e,i,n,s){r.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id||""===e.text||(e.dirty&&(e.canvasTexture=t.canvasToTexture(e.canvas,e.canvasTexture),e.dirty=!1),this.pipeline.batchText(this,n,s))}},function(t,e,i){var n=i(3),s=i(3);n=i(415),s=i(414),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i){var n=t.canvas,s=t.context,r=t.style,o=[],a=0,h=i.length;0<r.maxLines&&r.maxLines<i.length&&(h=r.maxLines),r.syncFont(n,s);for(var l=0;l<h;l++){var u=r.strokeThickness;u+=s.measureText(i[l]).width,r.wordWrap&&(u-=s.measureText(" ").width),o[l]=Math.ceil(u),a=Math.max(a,o[l])}var c=e.fontSize+r.strokeThickness,d=c*h,f=t._lineSpacing||0;return f<0&&Math.abs(f)>c&&(f=-c),0!==f&&(d+=0<f?f*i.length:f*(i.length-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:f,lineHeight:c}}},function(t,e,i){var n=i(0),l=i(38),r=i(62),o=i(4),a=i(34),u=i(61),h=i(6),s=new n({Extends:a,initialize:function(t,e,i,n,s,r){a.call(this,t,i,n,s,r),this.path=e,this.rotateToPath=!1,this.pathRotationVerticalAdjust=!1,this.pathRotationOffset=0,this.pathOffset=new h(i,n),this.pathVector=new h,this.pathTween,this.pathConfig=null,this._prevDirection=u.PLAYING_FORWARD},setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=!1),this.rotateToPath=t,this.pathRotationOffset=e,this.pathRotationVerticalAdjust=i,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=0,t.to=1;var n=r(t,"positionOnPath",!1);if(this.rotateToPath=r(t,"rotateToPath",!1),this.pathRotationOffset=o(t,"rotationOffset",0),this.pathRotationVerticalAdjust=r(t,"verticalAdjust",!1),this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),n&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=u.PLAYING_FORWARD,this.rotateToPath){var s=this.path.getPoint(.1);this.rotation=Math.atan2(s.y-this.y,s.x-this.x)+l(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},preUpdate:function(t,e){this.anims.update(t,e);var i=this.pathTween;if(i){var n=i.data[0];if(n.state!==u.PLAYING_FORWARD&&n.state!==u.PLAYING_BACKWARD)return;var s=this.pathVector;this.path.getPoint(i.getValue(),s),s.add(this.pathOffset);var r=this.x,o=this.y;this.setPosition(s.x,s.y);var a=this.x-r,h=this.y-o;if(0===a&&0===h)return;if(n.state!==this._prevDirection)return void(this._prevDirection=n.state);this.rotateToPath&&(this.rotation=Math.atan2(h,a)+l(this.pathRotationOffset),this.pathRotationVerticalAdjust&&(this.flipY=0!==this.rotation&&n.state===u.PLAYING_BACKWARD))}}});t.exports=s},function(t,e,i){var n=i(0),s=i(6),r=new n({initialize:function(t){this.source=t,this._tempVec=new s},getPoint:function(t){var e=this._tempVec;this.source.getRandomPoint(e),t.x=e.x,t.y=e.y}});t.exports=r},function(t,e){t.exports=function(t,e){for(var i=0;i<e.length;i++)if(t.hasOwnProperty(e[i]))return!0;return!1}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:1<=t?1:1/e*(1+(e*t|0))}},function(t,e){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 n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*.5+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-n)*(2*Math.PI)/i)+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(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 n=i(247),s=i(246),r=i(245),o=i(244),a=i(243),h=i(242),l=i(241),u=i(240),c=i(239),d=i(238),f=i(237),p=i(236);t.exports={Power0:l,Power1:u.Out,Power2:o.Out,Power3:c.Out,Power4:d.Out,Linear:l,Quad:u.Out,Cubic:o.Out,Quart:c.Out,Quint:d.Out,Sine:f.Out,Expo:h.Out,Circ:r.Out,Elastic:a.Out,Back:n.Out,Bounce:s.Out,Stepped:p,"Quad.easeIn":u.In,"Cubic.easeIn":o.In,"Quart.easeIn":c.In,"Quint.easeIn":d.In,"Sine.easeIn":f.In,"Expo.easeIn":h.In,"Circ.easeIn":r.In,"Elastic.easeIn":a.In,"Back.easeIn":n.In,"Bounce.easeIn":s.In,"Quad.easeOut":u.Out,"Cubic.easeOut":o.Out,"Quart.easeOut":c.Out,"Quint.easeOut":d.Out,"Sine.easeOut":f.Out,"Expo.easeOut":h.Out,"Circ.easeOut":r.Out,"Elastic.easeOut":a.Out,"Back.easeOut":n.Out,"Bounce.easeOut":s.Out,"Quad.easeInOut":u.InOut,"Cubic.easeInOut":o.InOut,"Quart.easeInOut":c.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":f.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":r.InOut,"Elastic.easeInOut":a.InOut,"Back.easeInOut":n.InOut,"Bounce.easeInOut":s.InOut}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s){void 0===n&&(n=!1),void 0===s&&(s=!0),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=n,this.counter=-1,this.seamless=s,this._length=0,this._direction=0,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._length<i&&this.counter>this._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=n},function(t,e,i){var n=i(51),s=i(0),r=i(15),o=i(455),a=i(454),h=i(899),l=i(1),u=i(146),c=i(420),d=i(111),f=i(457),p=i(419),g=i(14),v=i(83),y=i(6),m=i(39),x=new s({Mixins:[r.BlendMode,r.Mask,r.ScrollFactor,r.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=f,this.x=new h(e,"x",0),this.y=new h(e,"y",0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",0,!0),this.moveToY=new h(e,"moveToY",0,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",4294967295),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3),this.angle=new h(e,"angle",{min:0,max:360}),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=n.NORMAL,this.follow=null,this.followOffset=new y,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e<this.configFastMap.length;e++)i=this.configFastMap[e],d(t,i)&&(this[i]=l(t,i));for(e=0;e<this.configOpMap.length;e++)i=this.configOpMap[e],d(t,i)&&this[i].loadConfig(t);if(this.acceleration=0!==this.accelerationX.propertyValue||0!==this.accelerationY.propertyValue,this.moveTo=0!==this.moveToX.propertyValue||0!==this.moveToY.propertyValue,d(t,"speed")&&(this.speedX.loadConfig(t,"speed"),this.speedY=null),(c(t,["speedX","speedY"])||this.moveTo)&&(this.radial=!1),d(t,"scale")&&(this.scaleX.loadConfig(t,"scale"),this.scaleY=null),d(t,"callbackScope")){var n=l(t,"callbackScope",null);this.emitCallbackScope=n,this.deathCallbackScope=n}return d(t,"emitZone")&&this.setEmitZone(t.emitZone),d(t,"deathZone")&&this.setDeathZone(t.deathZone),d(t,"bounds")&&this.setBounds(t.bounds),d(t,"followOffset")&&this.followOffset.setFromObject(l(t,"followOffset",0)),d(t,"frame")&&this.setFrame(t.frame),this},toJSON:function(t){void 0===t&&(t={});var e=0,i="";for(e=0;e<this.configFastMap.length;e++)t[i=this.configFastMap[e]]=this[i];for(e=0;e<this.configOpMap.length;e++)this[i=this.configOpMap[e]]&&(t[i]=this[i].toJSON());return this.speedY||(delete t.speedX,t.speed=this.speedX.toJSON()),this.scaleY||(delete t.scaleX,t.scale=this.scaleX.toJSON()),t},startFollow:function(t,e,i,n){return void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=!1),this.follow=t,this.followOffset.set(e,i),this.trackVisible=n,this},stopFollow:function(){return this.follow=null,this.followOffset.set(0,0),this.trackVisible=!1,this},getFrame:function(){if(1===this.frames.length)return this.defaultFrame;if(this.randomFrame)return u(this.frames);var t=this.frames[this.currentFrame];return this._frameCounter++,this._frameCounter===this.frameQuantity&&(this._frameCounter=0,this.currentFrame=m(this.currentFrame+1,0,this._frameLength)),t},setFrame:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=1),this.randomFrame=e,this.frameQuantity=i,this.currentFrame=0,this._frameCounter=0;var n=typeof t;if(Array.isArray(t)||"string"===n||"number"===n)this.manager.setEmitterFrames(t,this);else if("object"===n){var s=t;(t=l(s,"frames",null))&&this.manager.setEmitterFrames(t,this);var r=l(s,"cycle",!1);this.randomFrame=!r,this.frameQuantity=l(s,"quantity",i)}return this._frameLength=this.frames.length,1===this._frameLength&&(this.frameQuantity=1,this.randomFrame=!1),this},setRadial:function(t){return void 0===t&&(t=!0),this.radial=t,this},setPosition:function(t,e){return this.x.onChange(t),this.y.onChange(e),this},setBounds:function(t,e,i,n){if("object"==typeof t){var s=t;t=s.x,e=s.y,i=d(s,"w")?s.w:s.width,n=d(s,"h")?s.h:s.height}return this.bounds?this.bounds.setTo(t,e,i,n):this.bounds=new g(t,e,i,n),this},setSpeedX:function(t){return this.speedX.onChange(t),this.radial=!1,this},setSpeedY:function(t){return this.speedY&&(this.speedY.onChange(t),this.radial=!1),this},setSpeed:function(t){return this.speedX.onChange(t),this.speedY=null,this.radial=!0,this},setScaleX:function(t){return this.scaleX.onChange(t),this},setScaleY:function(t){return this.scaleY.onChange(t),this},setScale:function(t){return this.scaleX.onChange(t),this.scaleY=null,this},setGravityX:function(t){return this.gravityX=t,this},setGravityY:function(t){return this.gravityY=t,this},setGravity:function(t,e){return this.gravityX=t,this.gravityY=e,this},setAlpha:function(t){return this.alpha.onChange(t),this},setEmitterAngle:function(t){return this.angle.onChange(t),this},setAngle:function(t){return this.angle.onChange(t),this},setLifespan:function(t){return this.lifespan.onChange(t),this},setQuantity:function(t){return this.quantity.onChange(t),this},setFrequency:function(t,e){return this.frequency=t,this._counter=0,e&&this.quantity.onChange(e),this},setEmitZone:function(t){if(void 0===t)this.emitZone=null;else{var e=l(t,"type","random"),i=l(t,"source",null);switch(e){case"random":this.emitZone=new p(i);break;case"edge":var n=l(t,"quantity",1),s=l(t,"stepRate",0),r=l(t,"yoyo",!1),o=l(t,"seamless",!0);this.emitZone=new a(i,n,s,r,o)}}return this},setDeathZone:function(t){if(void 0===t)this.deathZone=null;else{var e=l(t,"type","onEnter"),i=l(t,"source",null);if(i&&"function"==typeof i.contains){var n="onEnter"===e;this.deathZone=new o(i,n)}}return this},reserve:function(t){for(var e=this.dead,i=0;i<t;i++)e.push(new this.particleClass(this));return this},getAliveParticleCount:function(){return this.alive.length},getDeadParticleCount:function(){return this.dead.length},getParticleCount:function(){return this.getAliveParticleCount()+this.getDeadParticleCount()},atLimit:function(){return 0<this.maxParticles&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;0<e.length;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,n=i.length,s=0;s<n;++s)t.call(e,i[s],this);return this},forEachDead:function(t,e){for(var i=this.dead,n=i.length,s=0;s<n;++s)t.call(e,i[s],this);return this},start:function(){return this.on=!0,this._counter=0,this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},depthSort:function(){return v.inplace(this.alive,this.depthSortCallback),this},flow:function(t,e){return void 0===e&&(e=1),this.frequency=t,this.quantity.onChange(e),this.start()},explode:function(t,e,i){return this.frequency=-1,this.emitParticle(t,e,i)},emitParticleAt:function(t,e,i){return this.emitParticle(i,t,e)},emitParticle:function(t,e,i){if(!this.atLimit()){void 0===t&&(t=this.quantity.onEmit());for(var n=this.dead,s=0;s<t;s++){var r;if((r=0<n.length?n.pop():new this.particleClass(this)).fire(e,i),this.particleBringToTop?this.alive.push(r):this.alive.unshift(r),this.emitCallback&&this.emitCallback.call(this.emitCallbackScope,r,this),this.atLimit())break}return r}},preUpdate:function(t,e){var i=(e*=this.timeScale)/1e3;this.trackVisible&&(this.visible=this.follow.visible);for(var n=this.manager.getProcessors(),s=this.alive,r=s.length,o=0;o<r;o++){var a=s[o];if(a.update(e,i,n)){var h=s[r-1];s[r-1]=a,s[o]=h,o-=1,r-=1}}var l=s.length-r;if(0<l){var u=s.splice(s.length-l,l),c=this.deathCallback,d=this.deathCallbackScope;if(c)for(var f=0;f<u.length;f++)c.call(d,u[f]);this.dead.concat(u),v.inplace(s,this.indexSortCallback)}this.on&&(0===this.frequency?this.emitParticle():0<this.frequency&&(this._counter-=e,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(t,e){return t.y-e.y},indexSortCallback:function(t,e){return t.index-e.index}});t.exports=x},function(t,e,i){var n=i(0),c=i(38),d=i(58),f=function(t){return(t>>16)+(65280&t)+((255&t)<<16)},s=new n({initialize:function(t){this.emitter=t,this.frame=null,this.index=0,this.x=0,this.y=0,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.color=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215,current:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1}}},isAlive:function(){return 0<this.lifeCurrent},fire:function(t,e){var i=this.emitter;this.frame=i.getFrame(),i.emitZone&&i.emitZone.getPoint(this),void 0===t?(i.follow&&(this.x+=i.follow.x+i.followOffset.x),this.x+=i.x.onEmit(this,"x")):this.x+=t,void 0===e?(i.follow&&(this.y+=i.follow.y+i.followOffset.y),this.y+=i.y.onEmit(this,"y")):this.y+=e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var n=i.speedX.onEmit(this,"speedX"),s=i.speedY?i.speedY.onEmit(this,"speedY"):n;if(i.radial){var r=c(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(r)*Math.abs(n),this.velocityY=Math.sin(r)*Math.abs(s)}else if(i.moveTo){var o=i.moveToX.onEmit(this,"moveToX"),a=i.moveToY?i.moveToY.onEmit(this,"moveToY"):o,h=Math.atan2(a-this.y,o-this.x),l=d(this.x,this.y,o,a)/(this.life/1e3);this.velocityX=Math.cos(h)*l,this.velocityY=Math.sin(h)*l}else this.velocityX=n,this.velocityY=s;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY?i.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=c(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint");var u=255&(255*this.alpha|0);this.color=(u<<24|f(this.tint))>>>0,this.index=i.alive.length},computeVelocity:function(t,e,i,n){var s=this.velocityX,r=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;s+=t.gravityX*i,r+=t.gravityY*i,o&&(s+=o*i),a&&(r+=a*i),h<s?s=h:s<-h&&(s=-h),l<r?r=l:r<-l&&(r=-l),this.velocityX=s,this.velocityY=r;for(var u=0;u<n.length;u++)n[u].update(this,e,i)},checkBounds:function(t){var e=t.bounds,i=-this.bounce;this.x<e.x&&t.collideLeft?(this.x=e.x,this.velocityX*=i):this.x>e.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.y<e.y&&t.collideTop?(this.y=e.y,this.velocityY*=i):this.y>e.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(0<this.delayCurrent)return this.delayCurrent-=t,!1;var n=this.emitter,s=1-this.lifeCurrent/this.life;if(this.lifeT=s,this.computeVelocity(n,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,n.bounds&&this.checkBounds(n),n.deathZone&&n.deathZone.willKill(this))return!(this.lifeCurrent=0);this.scaleX=n.scaleX.onUpdate(this,"scaleX",s,this.scaleX),n.scaleY?this.scaleY=n.scaleY.onUpdate(this,"scaleY",s,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",s,this.angle),this.rotation=c(this.angle),this.alpha=n.alpha.onUpdate(this,"alpha",s,this.alpha),this.tint=n.tint.onUpdate(this,"tint",s,this.tint);var r=255&(255*this.alpha|0);return this.color=(r<<24|f(this.tint))>>>0,this.lifeCurrent-=t,this.lifeCurrent<=0}});t.exports=s},function(t,e,i){var n=i(0),o=i(1),s=new n({initialize:function(t,e,i,n,s){if("object"==typeof t){var r=t;t=o(r,"x",0),e=o(r,"y",0),i=o(r,"power",0),n=o(r,"epsilon",100),s=o(r,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===s&&(s=50);this.x=t,this.y=e,this.active=!0,this._gravity=s,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i=this.x-t.x,n=this.y-t.y,s=i*i+n*n;if(0!==s){var r=Math.sqrt(s);s<this._epsilon&&(s=this._epsilon);var o=this._power*e/(s*r)*100;t.velocityX+=i*o,t.velocityY+=n*o}},epsilon:{get:function(){return Math.sqrt(this._epsilon)},set:function(t){this._epsilon=t*t}},power:{get:function(){return this._power/this._gravity},set:function(t){this._power=t*this._gravity}},gravity:{get:function(){return this._gravity},set:function(t){var e=this.power;this._gravity=t,this.power=e}}});t.exports=s},function(t,e,i){var r=i(2);t.exports=function(t,e,i,n,s){r.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id||t.drawImage(e,n,s)}},function(t,e,i){var r=i(2);t.exports=function(t,e,i,n,s){r.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id||this.pipeline.batchSprite(e,n,s)}},function(t,e,i){var n=i(3),s=i(3);n=i(460),s=i(459),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var r=i(2);t.exports=function(t,e,i,n,s){r.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id||this.pipeline.batchGraphics(this,n,s)}},function(t,e,i){var n=i(3),s=i(3);n=i(462),s=i(176),s=i(176),t.exports={renderWebGL:n,renderCanvas:s}},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 n=i(14);t.exports=function(t,e){return void 0===e&&(e=new n),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 n=i(54);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e,i){var n=i(54);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(114);t.exports=function(t){return new n(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 a=i(14);t.exports=function(t,e,i){void 0===i&&(i=new a);var n=Math.min(t.x,e.x),s=Math.min(t.y,e.y),r=Math.max(t.right,e.right)-n,o=Math.max(t.bottom,e.bottom)-s;return i.setTo(n,s,r,o)}},function(t,e){function C(t,e){return parseInt(t.getAttribute(e),10)}t.exports=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=0);var s={},r=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0];s.font=r.getAttribute("face"),s.size=C(r,"size"),s.lineHeight=C(o,"lineHeight")+i,s.chars={};var a=t.getElementsByTagName("char"),h=void 0!==n&&n.trimmed;if(h)var l=n.height,u=n.width;for(var c=0;c<a.length;c++){var d=a[c],f=C(d,"id"),p=C(d,"x"),g=C(d,"y"),v=C(d,"width"),y=C(d,"height");h&&(p<u&&(u=p),g<l&&(l=g)),s.chars[f]={x:p,y:g,width:v,height:y,centerX:Math.floor(v/2),centerY:Math.floor(y/2),xOffset:C(d,"xoffset"),yOffset:C(d,"yoffset"),xAdvance:C(d,"xadvance")+e,data:{},kerning:{}}}if(h&&0!==l&&0!==u)for(var m in s.chars){var x=s.chars[m];x.x-=n.x,x.y-=n.y}var w=t.getElementsByTagName("kerning");for(c=0;c<w.length;c++){var b=w[c],T=C(b,"first"),S=C(b,"second"),A=C(b,"amount");s.chars[S].kerning[T]=A}return s}},function(t,e){t.exports=function(t,e){for(var i=t.text,n=i.length,s=Number.MAX_VALUE,r=Number.MAX_VALUE,o=0,a=0,h=t.fontData.chars,l=t.fontData.lineHeight,u=t.letterSpacing,c=0,d=0,f=0,p=0,g=null,v=0,y=0,m=0,x=0,w=null,b=0,T=0;T<n;++T)if(10!==(p=i.charCodeAt(T))){if(g=h[p]){if(v=g.width,y=g.height,m=f+g.xOffset+c,x=g.yOffset+d,null!==w){var S=g.kerning[b];m+=void 0!==S?S:0}m<s&&(s=m),x<r&&(r=x);var A=m+v-s,C=x+y-r;o<A&&(o=A),a<C&&(a=C),c+=g.xAdvance+u,f+=1,w=g,b=p}}else f=c=0,d+=l,w=null;var M=t.fontSize/t.fontData.size,_=M*t.scaleX,E=M*t.scaleY,P={local:{x:s*M,y:r*M,width:o*M,height:a*M},global:{x:t.x+s*_,y:t.y+r*E,width:o*_,height:a*E}};return e&&(P.local.x=Math.round(P.local.x),P.local.y=Math.round(P.local.y),P.local.width=Math.round(P.local.width),P.local.height=Math.round(P.local.height),P.global.x=Math.round(P.global.x),P.global.y=Math.round(P.global.y),P.global.width=Math.round(P.global.width),P.global.height=Math.round(P.global.height)),P}},function(t,e,i){var n=i(0),s=i(12),r=new n({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,n;for(i=0;i<t;i++){n=this._pendingRemoval[i];var s=this._list.indexOf(n);-1<s&&this._list.splice(s,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;i<this._list.length;i++){var n=this._list[i];n.active&&n.preUpdate.call(n,t,e)}},remove:function(t){var e=this._list.indexOf(t);return-1!==e&&this._list.splice(e,1),t},removeAll:function(){for(var t=this._list.length;t--;)this.remove(this._list[t]);return this},shutdown:function(){this.removeAll(),this._list.length=0,this._pendingRemoval.length=0,this._pendingInsertion.length=0;var t=this.systems.events;t.off("preupdate",this.preUpdate,this),t.off("update",this.update,this),t.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null},length:{get:function(){return this._list.length}}});s.register("UpdateList",r,"updateList"),t.exports=r},function(t,e){t.exports=function(t,e,i){if(e!==i){var n=t.indexOf(e),s=t.indexOf(i);if(n<0||s<0)throw new Error("Supplied items must be elements of the same array");return t[n]=i,t[s]=e,t}}},function(t,e,i){var a=i(29);t.exports=function(t,e,i,n,s){if(void 0===n&&(n=0),void 0===s&&(s=t.length),a(t,n,s))for(var r=n;r<s;r++){var o=t[r];o.hasOwnProperty(e)&&(o[e]=i)}return t}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&0<i&&(t.splice(i,1),t.unshift(e)),e}},function(t,e){t.exports=function(t,e,i){var n=t.indexOf(e),s=t.indexOf(i);return-1!==n&&-1===s&&(t[n]=i,!0)}},function(t,e,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 l=i(29);t.exports=function(t,e,i,n,s){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===s&&(s=t),l(t,e,i)){var r=i-e,o=t.splice(e,r);if(n)for(var a=0;a<o.length;a++){var h=o[a];n.call(s,h)}return o}return[]}},function(t,e,i){var r=i(56);t.exports=function(t,e,i,n){if(void 0===n&&(n=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var s=r(t,e);return i&&i.call(n,s),s}},function(t,e,i){var o=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=[],s=Math.max(o((e-t)/(i||1)),0),r=0;r<s;r++)n.push(t),t+=i;return n}},function(t,e){t.exports=function(t,e,i,n){for(var s=[],r=t;r<=e;r++)if(i||n){var o=i?i+r.toString():r.toString();n&&(o=o.concat(n)),s.push(o)}else s.push(r);return s}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i<t.length-2){var n=t[i+1],s=t.indexOf(n);t[i]=n,t[s]=e}return t}},function(t,e){t.exports=function(t,e,i){var n=t.indexOf(e);if(-1===n||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(0<i){var n=t[i-1],s=t.indexOf(n);t[i]=n,t[s]=e}return t}},function(t,e,i){var a=i(29);t.exports=function(t,e,i,n,s){if(void 0===n&&(n=0),void 0===s&&(s=t.length),a(t,n,s))for(var r=n;r<s;r++){var o=t[r];if(!e||e&&void 0===i&&o.hasOwnProperty(e)||e&&void 0!==i&&o[e]===i)return o}return null}},function(t,e,i){var h=i(29);t.exports=function(t,e,i,n,s){void 0===n&&(n=0),void 0===s&&(s=t.length);var r=[];if(h(t,n,s))for(var o=n;o<s;o++){var a=t[o];(!e||e&&void 0===i&&a.hasOwnProperty(e)||e&&void 0!==i&&a[e]===i)&&r.push(a)}return r}},function(t,e,i){var a=i(29);t.exports=function(t,e,i,n,s){if(void 0===n&&(n=0),void 0===s&&(s=t.length),a(t,n,s)){var r,o=[null];for(r=5;r<arguments.length;r++)o.push(arguments[r]);for(r=n;r<s;r++)o[0]=t[r],e.apply(i,o)}return t}},function(t,e){t.exports=function(t,e,i){var n,s=[null];for(n=2;n<arguments.length;n++)s.push(arguments[n]);for(n=0;n<t.length;n++)s[0]=t[n],e.apply(i,s);return t}},function(t,e,i){var a=i(29);t.exports=function(t,e,i,n,s){void 0===n&&(n=0),void 0===s&&(s=t.length);var r=0;if(a(t,n,s))for(var o=n;o<s;o++)t[o][e]===i&&r++;return r}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i<t.length&&(t.splice(i,1),t.push(e)),e}},function(t,e){t.exports=function(t,e,i,n,s,r){if(void 0===i&&(i=0),void 0===r&&(r=t),0<n){var o=n-t.length;if(o<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),s&&s.call(r,e),e):null;for(var a=e.length-1;0<=a;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;0<n&&o<a&&(e.splice(o),a=o);for(var h=a;0<h;h--){var l=e[h];t.splice(i,0,l),s&&s.call(r,l)}return e}},function(t,e){t.exports=function(t,e,i,n,s){if(void 0===s&&(s=t),0<i){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),n&&n.call(s,e),e):null;for(var o=e.length-1;0<=o;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;0<i&&r<o&&(e.splice(r),o=r);for(var a=0;a<o;a++){var h=e[a];t.push(h),n&&n.call(s,h)}return e}},function(t,e,i){var n=i(77);t.exports=function(t){return n(t,-90)}},function(t,e,i){var n=i(77);t.exports=function(t){return n(t,90)}},function(t,e,i){var n=i(77);t.exports=function(t){return n(t,180)}},function(t,e){t.exports=function(t){return t.reverse()}},function(t,e){t.exports=function(t){for(var e=0;e<t.length;e++)t[e].reverse();return t}},function(t,e,i){var o=i(133),a=i(116);t.exports=function(t){var e="";if(!a(t))return e;for(var i=0;i<t.length;i++){for(var n=0;n<t[i].length;n++){var s=t[i][n].toString();e+="undefined"!==s?o(s,2):"?",n<t[i].length-1&&(e+=" |")}if(i<t.length-1){e+="\n";for(var r=0;r<t[i].length;r++)e+="---",r<t[i].length-1&&(e+="+");e+="\n"}}return e}},function(t,e,i){t.exports={CheckMatrix:i(116),MatrixToString:i(502),ReverseColumns:i(501),ReverseRows:i(500),Rotate180:i(499),RotateLeft:i(498),RotateMatrix:i(77),RotateRight:i(497),TransposeMatrix:i(181)}},function(t,e,i){var n=i(0),s=i(93),r=i(12),o=i(83),a=new n({Extends:s,initialize:function(t){s.call(this,t),this.sortChildrenFlag=!1,this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.systems.events.once("destroy",this.destroy,this)},start:function(){this.systems.events.once("shutdown",this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(o.inplace(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},sortGameObjects:function(t){return void 0===t&&(t=this.list),this.scene.sys.depthSort(),t.sort(this.sortIndexHandler.bind(this))},getTopGameObject:function(t){return this.sortGameObjects(t),t[t.length-1]},shutdown:function(){this.removeAll(),this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});r.register("DisplayList",a,"displayList"),t.exports=a},function(t,e){t.exports=function(t){var e,i=t.events;void 0!==document.hidden?e="visibilitychange":["webkit","moz","ms"].forEach(function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")});e&&document.addEventListener(e,function(t){document.hidden||"pause"===t.type?i.emit("hidden"):i.emit("visible")},!1),window.onblur=function(){i.emit("blur")},window.onfocus=function(){i.emit("focus")},window.focus&&t.config.autoFocus&&(window.focus(),t.canvas.addEventListener("mousedown",function(){window.focus()},{passive:!0})),t.canvas&&(t.canvas.onmouseout=function(){t.isOver=!1,i.emit("mouseout")},t.canvas.onmouseover=function(){t.isOver=!0,i.emit("mouseover")})}},function(t,e,i){var n=i(0),s=i(4),r=i(3),o=i(268),a=new n({initialize:function(t,e){this.game=t,this.raf=new o,this.started=!1,this.running=!1,this.minFps=s(e,"min",5),this.targetFps=s(e,"target",60),this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=r,this.forceSetTimeOut=s(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=s(e,"deltaHistory",10),this.panicMax=s(e,"panicMax",120),this.rawDelta=0},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=this.frame=0;e<this.deltaSmoothingMax;e++)this.deltaHistory[e]=Math.min(this._target,this.deltaHistory[e]);this.delta=0,this.deltaIndex=0,this._coolDown=this.panicMax},start:function(t){if(this.started)return this;this.started=!0,this.running=!0;for(var e=0;e<this.deltaSmoothingMax;e++)this.deltaHistory[e]=this._target;this.resetDelta(),this.startTime=window.performance.now(),this.callback=t,this.raf.start(this.step.bind(this),this.forceSetTimeOut)},step:function(t){this.frame++;var e=t-this.lastTime;e<0&&(e=0),this.rawDelta=e;var i=this.deltaIndex,n=this.deltaHistory,s=this.deltaSmoothingMax,r=e;(0<this._coolDown||!this.inFocus)&&(this._coolDown--,r=Math.min(r,this._target)),r>this._min&&(r=n[i],r=Math.min(r,this._min)),n[i]=r,this.deltaIndex++,this.deltaIndex>s&&(this.deltaIndex=0);for(var o=0,a=0;a<s;a++)o+=n[a];o/=s,this.delta=o,this.time+=this.rawDelta,t>this.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,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=a},function(t,e){var p=0,g=function(t,e,i,n){var s=p-n.y-n.height;t.add(i,e,n.x,s,n.width,n.height)};t.exports=function(t,e,i){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height),p=n.height;for(var s=i.split("\n"),r=/^[ ]*(- )*(\w+)+[: ]+(.*)/,o="",a="",h={x:0,y:0,width:0,height:0},l=0;l<s.length;l++){var u=s[l].match(r);if(u){var c="- "===u[1],d=u[2],f=u[3];if(c&&(a!==o&&(g(t,e,a,h),o=a),h={x:0,y:0,width:0,height:0}),"name"!==d)switch(d){case"x":case"y":case"width":case"height":h[d]=parseInt(f,10)}else a=f}}return a!==o&&g(t,e,a,h),t}},function(t,e,i){var Y=i(1);t.exports=function(t,e,i){var n=Y(i,"frameWidth",null),s=Y(i,"frameHeight",n);if(!n)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var r,o=Y(i,"startFrame",0),a=Y(i,"endFrame",-1),h=Y(i,"margin",0),l=Y(i,"spacing",0),u=e.cutX,c=e.cutY,d=e.cutWidth,f=e.cutHeight,p=e.realWidth,g=e.realHeight,v=Math.floor((p-h+l)/(n+l)),y=Math.floor((g-h+l)/(s+l)),m=v*y,x=e.x,w=n-x,b=n-(p-d-x),T=e.y,S=s-T,A=s-(g-f-T);(m<o||o<-m)&&(o=0),o<0&&(o=m+o),-1!==a&&(m=o+(a+1));for(var C=h,M=h,_=0,E=e.sourceIndex,P=0;P<y;P++){for(var k=0===P,L=P===y-1,F=0;F<v;F++){var R=0===F,O=F===v-1;if(r=t.add(_,E,u+C,c+M,n,s),R||k||O||L){var B=R?x:0,D=k?T:0,I=n,z=s;R?I=w:O&&(I=b),k?z=S:L&&(z=A),r.cutWidth=I,r.cutHeight=z,r.setTrim(n,s,B,D,I,z)}C+=l,C+=R?w:O||n,_++}C=h,M+=l,M+=k?S:L?A:s}return t}},function(t,e,i){var T=i(1);t.exports=function(t,e,i,n,s,r,o){var a=T(o,"frameWidth",null),h=T(o,"frameHeight",a);if(null===a)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var l=t.source[e];t.add("__BASE",e,0,0,l.width,l.height);var u=T(o,"startFrame",0),c=T(o,"endFrame",-1),d=T(o,"margin",0),f=T(o,"spacing",0),p=Math.floor((s-d+f)/(a+f))*Math.floor((r-d+f)/(h+f));(p<u||u<-p)&&(u=0),u<0&&(u=p+u),-1!==c&&(p=u+(c+1));for(var g=d,v=d,y=0,m=0,x=0;x<p;x++){m=y=0;var w=g+a,b=v+h;s<w&&(y=w-s),r<b&&(m=b-r),t.add(x,e,i+g,n+v,a-y,h-m),s<(g+=a+f)+a&&(g=d,v+=h+f)}return t}},function(t,e,i){var l=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 s,r=i.frames;for(var o in r){var a=r[o];s=t.add(o,e,a.frame.x,a.frame.y,a.frame.w,a.frame.h),a.trimmed&&s.setTrim(a.sourceSize.w,a.sourceSize.h,a.spriteSourceSize.x,a.spriteSourceSize.y,a.spriteSourceSize.w,a.spriteSourceSize.h),a.rotated&&(s.rotated=!0,s.updateUVsInverted()),s.customData=l(a)}for(var h in i)"frames"!==h&&(Array.isArray(i[h])?t.customData[h]=i[h].slice(0):t.customData[h]=i[h]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},function(t,e,i){var l=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 s,r=Array.isArray(i.textures)?i.textures[e].frames:i.frames,o=0;o<r.length;o++){var a=r[o];s=t.add(a.filename,e,a.frame.x,a.frame.y,a.frame.w,a.frame.h),a.trimmed&&s.setTrim(a.sourceSize.w,a.sourceSize.h,a.spriteSourceSize.x,a.spriteSourceSize.y,a.spriteSourceSize.w,a.spriteSourceSize.h),a.rotated&&(s.rotated=!0,s.updateUVsInverted()),a.anchor&&(s.customPivot=!0,s.pivotX=a.anchor.x,s.pivotY=a.anchor.y),s.customData=l(a)}for(var h in i)"frames"!==h&&(Array.isArray(i[h])?t.customData[h]=i[h].slice(0):t.customData[h]=i[h]);return t}console.warn("Invalid Texture Atlas JSON Array")}},function(t,e){t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},function(t,e){t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},function(t,e){t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var s,r=i.getElementsByTagName("SubTexture"),o=0;o<r.length;o++){var a=r[o].attributes,h=a.name.value,l=parseInt(a.x.value,10),u=parseInt(a.y.value,10),c=parseInt(a.width.value,10),d=parseInt(a.height.value,10);if(s=t.add(h,e,l,u,c,d),a.frameX){var f=Math.abs(parseInt(a.frameX.value,10)),p=Math.abs(parseInt(a.frameY.value,10)),g=parseInt(a.frameWidth.value,10),v=parseInt(a.frameHeight.value,10);s.setTrim(c,d,f,p,g,v)}}return t}console.warn("Invalid Texture Atlas XML given")}},function(t,e,i){var n=i(0),s=i(85),r=i(117),o=new n({Extends:r,initialize:function(t,e,i,n,s){r.call(this,t,e,i,n,s),this.add("__BASE",0,0,0,n,s),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d"),this.width=n,this.height=s},refresh:function(){return this._source.update(),this},getCanvas:function(){return this.canvas},getContext:function(){return this.context},clear:function(){return this.context.clearRect(0,0,this.width,this.height),this},setSize:function(t,e){return void 0===e&&(e=t),t===this.width&&e===this.height||(this.canvas.width=t,this.canvas.height=e,this._source.width=t,this._source.height=e,this._source.isPowerOf2=s(t,e),this.frames.__BASE.setSize(t,e,0,0),this.refresh()),this}});t.exports=o},function(t,e){t.exports={game:"game",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",sound:"sound",textures:"textures",events:"events",cameras:"cameras",cameras3d:"cameras3d",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},function(t,e,i){var n=i(1);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=n(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},function(t,e,i){var r=i(1),o=i(256);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=r(t.settings,"physics",!1);if(e||i){var n=[];if(e&&n.push(o(e+"Physics")),i)for(var s in i)s=o(s.concat("Physics")),-1===n.indexOf(s)&&n.push(s);return n}}},function(t,e){var s={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){var t,e=["requestFullscreen","requestFullScreen","webkitRequestFullscreen","webkitRequestFullScreen","msRequestFullscreen","msRequestFullScreen","mozRequestFullScreen","mozRequestFullscreen"],i=document.createElement("div");for(t=0;t<e.length;t++)if(i[e[t]]){s.available=!0,s.request=e[t];break}var n=["cancelFullScreen","exitFullscreen","webkitCancelFullScreen","webkitExitFullscreen","msCancelFullScreen","msExitFullscreen","mozCancelFullScreen","mozExitFullscreen"];if(s.available)for(t=0;t<n.length;t++)if(document[n[t]]){s.cancel=n[t];break}return window.Element&&Element.ALLOW_KEYBOARD_INPUT&&(s.keyboard=!0),s}()},function(t,e){var i={h264Video:!1,hlsVideo:!1,mp4Video:!1,oggVideo:!1,vp9Video:!1,webmVideo:!1};t.exports=function(){var t=document.createElement("video"),e=!!t.canPlayType;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"")&&(i.oggVideo=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.h264Video=!0,i.mp4Video=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")&&(i.webmVideo=!0),t.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,"")&&(i.vp9Video=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.hlsVideo=!0))}catch(t){}return i}()},function(t,e,i){var s=i(80),r={audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){r.audioData=!!window.Audio,r.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e&&(t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(r.ogg=!0),(t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")||t.canPlayType("audio/opus;").replace(/^no$/,""))&&(r.opus=!0),t.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(r.mp3=!0),t.canPlayType('audio/wav; codecs="1"').replace(/^no$/,"")&&(r.wav=!0),(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/aac;").replace(/^no$/,""))&&(r.m4a=!0),t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")&&(r.webm=!0),""!==t.canPlayType('audio/mp4;codecs="ec-3"')))if(s.edge)r.dolby=!0;else if(s.safari&&9<=s.safariVersion&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var i=parseInt(RegExp.$1,10),n=parseInt(RegExp.$2,10);(10===i&&11<=n||10<i)&&(r.dolby=!0)}}catch(t){}return r}()},function(t,e,i){var n=i(57),s=i(80),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&1<=navigator.maxTouchPoints)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),n.cocoonJS||("onwheel"in window||s.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":s.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 l=i(20);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===l.CANVAS?i="Canvas":e.renderType===l.HEADLESS&&(i="Headless");var n,s=e.audio,r=t.device.audio;if(n=!r.webAudio||s&&s.disableWebAudio?s&&s.noAudio||!r.webAudio&&!r.audioData?"No Audio":"HTML5 Audio":"Web Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+l.VERSION+" / https://phaser.io");else{var o,a="",h=[a];Array.isArray(e.bannerBackgroundColor)?(e.bannerBackgroundColor.forEach(function(t){a=a.concat("%c "),h.push("background: "+t),o=t}),h[h.length-1]="color: "+e.bannerTextColor+"; background: "+o):(a=a.concat("%c "),h.push("color: "+e.bannerTextColor+"; background: "+e.bannerBackgroundColor)),h.push("background: #fff"),e.gameTitle&&(a=a.concat(e.gameTitle),e.gameVersion&&(a=a.concat(" v"+e.gameVersion)),e.hidePhaser||(a=a.concat(" / "))),e.hidePhaser||(a=a.concat("Phaser v"+l.VERSION+" ("+i+" | "+n+")")),a=a.concat(" %c "+e.gameURL),h[0]=a,console.log.apply(console,h)}}}},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,s){var r=s(272),o=s(22),a=s(20),h=s(120);t.exports=function(t){var e,i,n=t.config;if(n.renderType!==a.HEADLESS)if(n.renderType===a.CANVAS||n.renderType!==a.CANVAS&&!h.webGL){if(!h.canvas)throw new Error("Cannot create Canvas or WebGL context, aborting.");n.renderType=a.CANVAS}else n.renderType=a.WEBGL;n.pixelArt&&o.disableSmoothing(),n.canvas?t.canvas=n.canvas:t.canvas=o.create(t,n.width,n.height,n.renderType),n.canvasStyle&&(t.canvas.style=n.canvasStyle),n.pixelArt&&r.setCrisp(t.canvas),1!==n.zoom&&(t.canvas.style.width=(n.width*n.zoom).toString()+"px",t.canvas.style.height=(n.height*n.zoom).toString()+"px"),n.renderType!==a.HEADLESS&&(e=s(267),i=s(262),n.renderType===a.WEBGL?(t.renderer=new i(t),t.context=null):(t.renderer=new e(t),t.context=t.renderer.gameContext))}},function(t,e,i){var n=i(0),o=i(20),a=i(1),h=i(4),l=i(8),u=i(16),c=i(3),d=i(121),f=i(132),s=new n({initialize:function(t){void 0===t&&(t={});this.width=h(t,"width",1024),this.height=h(t,"height",768),this.zoom=h(t,"zoom",1),this.resolution=h(t,"resolution",1),this.renderType=h(t,"type",o.AUTO),this.parent=h(t,"parent",null),this.canvas=h(t,"canvas",null),this.context=h(t,"context",null),this.canvasStyle=h(t,"canvasStyle",null),this.sceneConfig=h(t,"scene",null),this.seed=h(t,"seed",[(Date.now()*Math.random()).toString()]),u.RND.init(this.seed),this.gameTitle=h(t,"title",""),this.gameURL=h(t,"url","https://phaser.io"),this.gameVersion=h(t,"version",""),this.autoFocus=h(t,"autoFocus",!0),this.inputKeyboard=h(t,"input.keyboard",!0),this.inputKeyboardEventTarget=h(t,"input.keyboard.target",window),this.inputMouse=h(t,"input.mouse",!0),this.inputMouseEventTarget=h(t,"input.mouse.target",null),this.inputMouseCapture=h(t,"input.mouse.capture",!0),this.inputTouch=h(t,"input.touch",!0),this.inputTouchEventTarget=h(t,"input.touch.target",null),this.inputTouchCapture=h(t,"input.touch.capture",!0),this.inputActivePointers=h(t,"input.activePointers",1),this.inputGamepad=h(t,"input.gamepad",!1),this.inputGamepadEventTarget=h(t,"input.gamepad.target",window),this.disableContextMenu=h(t,"disableContextMenu",!1),this.audio=h(t,"audio"),this.hideBanner=!1===h(t,"banner",null),this.hidePhaser=h(t,"banner.hidePhaser",!1),this.bannerTextColor=h(t,"banner.text","#ffffff"),this.bannerBackgroundColor=h(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=h(t,"fps",null);var e=h(t,"render",t);this.antialias=h(e,"antialias",!0),this.pixelArt=h(e,"pixelArt",!1),this.autoResize=h(e,"autoResize",!1),this.roundPixels=h(e,"roundPixels",!1),this.transparent=h(e,"transparent",!1),this.clearBeforeRender=h(e,"clearBeforeRender",!0),this.premultipliedAlpha=h(e,"premultipliedAlpha",!0),this.preserveDrawingBuffer=h(e,"preserveDrawingBuffer",!1),this.failIfMajorPerformanceCaveat=h(e,"failIfMajorPerformanceCaveat",!1),this.powerPreference=h(e,"powerPreference","default");var i=h(t,"backgroundColor",0);this.backgroundColor=f(i),0===i&&this.transparent&&(this.backgroundColor.alpha=0),this.preBoot=h(t,"callbacks.preBoot",c),this.postBoot=h(t,"callbacks.postBoot",c),this.physics=h(t,"physics",{}),this.defaultPhysicsSystem=h(this.physics,"default",!1),this.loaderBaseURL=h(t,"loader.baseURL",""),this.loaderPath=h(t,"loader.path",""),this.loaderMaxParallelDownloads=h(t,"loader.maxParallelDownloads",32),this.loaderCrossOrigin=h(t,"loader.crossOrigin",void 0),this.loaderResponseType=h(t,"loader.responseType",""),this.loaderAsync=h(t,"loader.async",!0),this.loaderUser=h(t,"loader.user",""),this.loaderPassword=h(t,"loader.password",""),this.loaderTimeout=h(t,"loader.timeout",0),this.installGlobalPlugins=[],this.installScenePlugins=[];var n=h(t,"plugins",null),s=d.DefaultScene;n&&(Array.isArray(n)?this.defaultPlugins=n:l(n)&&(this.installGlobalPlugins=a(n,"global",[]),this.installScenePlugins=a(n,"scene",[]),Array.isArray(n.default)?s=n.default:Array.isArray(n.defaultMerge)&&(s=s.concat(n.defaultMerge)))),this.defaultPlugins=s;var r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=h(t,"images.default",r+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=h(t,"images.missing",r+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg==")}});t.exports=s},function(t,e,i){var n=i(130),s=i(207),r=i(205),o=i(22),a=i(0),h=i(533),l=i(532),u=i(81),c=i(524),d=i(523),f=i(271),p=i(9),g=i(201),v=i(196),y=i(194),m=i(191),x=i(184),w=i(506),b=i(505),T=new a({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 s(this),this.textures=new x(this),this.cache=new r(this),this.registry=new u(this),this.input=new g(this,this.config),this.scene=new y(this,this.config.sceneConfig),this.device=d,this.sound=m.create(this),this.loop=new w(this,this.config.fps),this.plugins=new v(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),l(this),c(this),n(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)),b(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 n=this.renderer;n.preRender(),i.emit("prerender",n,t,e),this.scene.render(n),n.postRender(),i.emit("postrender",n,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&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=T},function(t,e,i){var n=i(0),s=i(9),r=i(12),o=new n({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){t.exports={EventEmitter:i(535)}},function(t,e){var i,n,s=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(i===setTimeout)return setTimeout(e,0);if((i===r||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:r}catch(t){i=r}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var h,l=[],u=!1,c=-1;function d(){u&&h&&(u=!1,h.length?l=h.concat(l):c=-1,l.length&&f())}function f(){if(!u){var t=a(d);u=!0;for(var e=l.length;e;){for(h=l,l=[];++c<e;)h&&h[c].run();c=-1,e=l.length}h=null,u=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}s.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];l.push(new p(t,e)),1!==l.length||u||a(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=g,s.addListener=g,s.once=g,s.off=g,s.removeListener=g,s.removeAllListeners=g,s.emit=g,s.prependListener=g,s.prependOnceListener=g,s.listeners=function(t){return[]},s.binding=function(t){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(t){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},function(t,e,i){t.exports={BitmapMask:i(214),GeometryMask:i(213)}},function(t,e,i){var u=i(152);t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=1);var n=Math.floor(6*t),s=6*t-n,r=Math.floor(i*(1-e)*255),o=Math.floor(i*(1-s*e)*255),a=Math.floor(i*(1-(1-s)*e)*255),h={r:i=Math.floor(i*=255),g:i,b:i,color:0},l=n%6;return 0===l?(h.g=a,h.b=r):1===l?(h.r=o,h.b=r):2===l?(h.r=r,h.b=a):3===l?(h.r=r,h.g=o):4===l?(h.r=a,h.g=r):5===l&&(h.g=r,h.b=o),h.color=u(h.r,h.g,h.b),h}},function(t,e){t.exports=function(t,e,i){return i<0&&(i+=1),1<i&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},function(t,e){t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},function(t,e,i){var n=i(30);n.ColorToRGBA=i(923),n.ComponentToHex=i(541),n.GetColor=i(152),n.GetColor32=i(284),n.HexStringToColor=i(285),n.HSLToColor=i(922),n.HSVColorWheel=i(921),n.HSVToRGB=i(539),n.HueToComponent=i(540),n.IntegerToColor=i(283),n.IntegerToRGB=i(282),n.Interpolate=i(920),n.ObjectToColor=i(281),n.RandomRGB=i(919),n.RGBStringToColor=i(280),n.RGBToHSV=i(918),n.RGBToString=i(917),n.ValueToColor=i(132),t.exports=n},function(t,e,i){var n=i(0),s=i(81),r=i(12),o=new n({Extends:s,initialize:function(t){s.call(this,t,t.sys.events),this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.events=this.systems.events,this.events.once("destroy",this.destroy,this)},start:function(){this.events.once("shutdown",this.shutdown,this)},shutdown:function(){this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){s.prototype.destroy.call(this),this.events.off("start",this.start,this),this.scene=null,this.systems=null}});r.register("DataManagerPlugin",o,"data"),t.exports=o},function(t,e,i){t.exports={DataManager:i(81),DataManagerPlugin:i(543)}},function(t,e,i){var u=i(273),n=i(0),s=i(86),c=i(6),r=new n({Extends:s,initialize:function(t){void 0===t&&(t=[]),s.call(this,"SplineCurve"),this.points=[],this.addPoints(t)},addPoints:function(t){for(var e=0;e<t.length;e++){var i=new c;"number"==typeof t[e]?(i.x=t[e],i.y=t[e+1],e++):Array.isArray(t[e])?(i.x=t[e][0],i.y=t[e][1]):(i.x=t[e].x,i.y=t[e].y),this.points.push(i)}return this},addPoint:function(t,e){var i=new c(t,e);return this.points.push(i),i},getStartPoint:function(t){return void 0===t&&(t=new c),t.copy(this.points[0])},getResolution:function(t){return t*this.points.length},getPoint:function(t,e){void 0===e&&(e=new c);var i=this.points,n=(i.length-1)*t,s=Math.floor(n),r=n-s,o=i[0===s?s:s-1],a=i[s],h=i[s>i.length-2?i.length-1:s+1],l=i[s>i.length-3?i.length-1:s+2];return e.set(u(r,o.x,a.x,h.x,l.x),u(r,o.y,a.y,h.y,l.y))},toJSON:function(){for(var t=[],e=0;e<this.points.length;e++)t.push(this.points[e].x),t.push(this.points[e].y);return{type:this.type,points:t}}});r.fromJSON=function(t){return new r(t.points)},t.exports=r},function(t,e){t.exports=function(t,e,i,n){return(o=1-t)*o*e+2*(1-(r=t))*r*i+(s=t)*s*n;var s,r,o}},function(t,e,i){var n=i(0),s=i(86),r=i(546),o=i(6),a=new n({Extends:s,initialize:function(t,e,i){s.call(this,"QuadraticBezier"),Array.isArray(t)&&(i=new o(t[4],t[5]),e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.p0,n=this.p1,s=this.p2;return e.set(r(t,i.x,n.x,s.x),r(t,i.y,n.y,s.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var n=1;n<i.length;n++)t.lineTo(i[n].x,i[n].y);return t.strokePath(),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y,this.p2.x,this.p2.y]}}});a.fromJSON=function(t){var e=t.points,i=new o(e[0],e[1]),n=new o(e[2],e[3]),s=new o(e[4],e[5]);return new a(i,n,s)},t.exports=a},function(t,e,i){var n=i(0),s=i(86),r=i(274),o=i(14),a=i(6),h=new a,l=new n({Extends:s,initialize:function(t,e){s.call(this,"LineCurve"),Array.isArray(t)&&(e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e},getBounds:function(t){return void 0===t&&(t=new o),r([this.p0,this.p1],t)},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return void 0===t&&(t=1),t},getPoint:function(t,e){return void 0===e&&(e=new a),1===t?e.copy(this.p1):(e.copy(this.p1).subtract(this.p0).scale(t).add(this.p0),e)},getPointAt:function(t,e){return this.getPoint(t,e)},getTangent:function(){return h.copy(this.p1).subtract(this.p0).normalize()},draw:function(t){return t.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});l.fromJSON=function(t){var e=t.points,i=new a(e[0],e[1]),n=new a(e[2],e[3]);return new l(i,n)},t.exports=l},function(t,e,i){var n=i(0),l=i(86),u=i(38),c=i(4),s=i(150),d=i(6),r=new n({Extends:l,initialize:function(t,e,i,n,s,r,o,a){if("object"==typeof t){var h=t;t=c(h,"x",0),e=c(h,"y",0),i=c(h,"xRadius",0),n=c(h,"yRadius",i),s=c(h,"startAngle",0),r=c(h,"endAngle",360),o=c(h,"clockwise",!1),a=c(h,"rotation",0)}else void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=360),void 0===o&&(o=!1),void 0===a&&(a=0);l.call(this,"EllipseCurve"),this.p0=new d(t,e),this._xRadius=i,this._yRadius=n,this._startAngle=u(s),this._endAngle=u(r),this._clockwise=o,this._rotation=u(a)},getStartPoint:function(t){return void 0===t&&(t=new d),this.getPoint(0,t)},getResolution:function(t){return 2*t},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=2*Math.PI,n=this._endAngle-this._startAngle,s=Math.abs(n)<Number.EPSILON;n<0;)n+=i;for(;i<n;)n-=i;n<Number.EPSILON&&(n=s?0:i),this._clockwise&&!s&&(n===i?n=-i:n-=i);var r=this._startAngle+t*n,o=this.p0.x+this._xRadius*Math.cos(r),a=this.p0.y+this._yRadius*Math.sin(r);if(0!==this._rotation){var h=Math.cos(this._rotation),l=Math.sin(this._rotation),u=o-this.p0.x,c=a-this.p0.y;o=u*h-c*l+this.p0.x,a=u*l+c*h+this.p0.y}return e.set(o,a)},setXRadius:function(t){return this.xRadius=t,this},setYRadius:function(t){return this.yRadius=t,this},setWidth:function(t){return this.xRadius=2*t,this},setHeight:function(t){return this.yRadius=2*t,this},setStartAngle:function(t){return this.startAngle=t,this},setEndAngle:function(t){return this.endAngle=t,this},setClockwise:function(t){return this.clockwise=t,this},setRotation:function(t){return this.rotation=t,this},x:{get:function(){return this.p0.x},set:function(t){this.p0.x=t}},y:{get:function(){return this.p0.y},set:function(t){this.p0.y=t}},xRadius:{get:function(){return this._xRadius},set:function(t){this._xRadius=t}},yRadius:{get:function(){return this._yRadius},set:function(t){this._yRadius=t}},startAngle:{get:function(){return s(this._startAngle)},set:function(t){this._startAngle=u(t)}},endAngle:{get:function(){return s(this._endAngle)},set:function(t){this._endAngle=u(t)}},clockwise:{get:function(){return this._clockwise},set:function(t){this._clockwise=t}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=u(t)}},toJSON:function(){return{type:this.type,x:this.p0.x,y:this.p0.y,xRadius:this._xRadius,yRadius:this._yRadius,startAngle:s(this._startAngle),endAngle:s(this._endAngle),clockwise:this._clockwise,rotation:s(this._rotation)}}});r.fromJSON=function(t){return new r(t)},t.exports=r},function(t,e){t.exports=function(t,e,i,n,s){return(l=1-t)*l*l*e+3*(h=1-(a=t))*h*a*i+3*(1-(o=t))*o*o*n+(r=t)*r*r*s;var r,o,a,h,l}},function(t,e,i){var n=i(0),o=i(550),s=i(86),a=i(6),h=new n({Extends:s,initialize:function(t,e,i,n){s.call(this,"CubicBezierCurve"),Array.isArray(t)&&(n=new a(t[6],t[7]),i=new a(t[4],t[5]),e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i,this.p3=n},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new a);var i=this.p0,n=this.p1,s=this.p2,r=this.p3;return e.set(o(t,i.x,n.x,s.x,r.x),o(t,i.y,n.y,s.y,r.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var n=1;n<i.length;n++)t.lineTo(i[n].x,i[n].y);return t.strokePath(),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y,this.p2.x,this.p2.y,this.p3.x,this.p3.y]}}});h.fromJSON=function(t){var e=t.points,i=new a(e[0],e[1]),n=new a(e[2],e[3]),s=new a(e[4],e[5]),r=new a(e[6],e[7]);return new h(i,n,s,r)},t.exports=h},function(t,e,i){var s=i(279),n=i(0),r=new(i(87)),o=new n({Extends:s,initialize:function(t,e,i,n){void 0===e&&(e=80),void 0===i&&(i=0),void 0===n&&(n=0),s.call(this,t),this.viewportWidth=i,this.viewportHeight=n,this.fieldOfView=e*Math.PI/180,this.update()},setFOV:function(t){return this.fieldOfView=t*Math.PI/180,this},update:function(){var t=this.viewportWidth/this.viewportHeight;return this.projection.perspective(this.fieldOfView,t,Math.abs(this.near),Math.abs(this.far)),r.copy(this.position).add(this.direction),this.view.lookAt(this.position,r,this.up),this.combined.copy(this.projection).multiply(this.view),this.invProjectionView.copy(this.combined).invert(),this.billboardMatrixDirty=!0,this.updateChildren(),this}});t.exports=o},function(t,e,i){var n=i(279),s=i(0),r=new(i(87)),o=new s({Extends:n,initialize:function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0),n.call(this,t),this.viewportWidth=e,this.viewportHeight=i,this._zoom=1,this.near=0,this.update()},setToOrtho:function(t,e,i){void 0===e&&(e=this.viewportWidth),void 0===i&&(i=this.viewportHeight);var n=this.zoom;return this.up.set(0,t?-1:1,0),this.direction.set(0,0,t?1:-1),this.position.set(n*e/2,n*i/2,0),this.viewportWidth=e,this.viewportHeight=i,this.update()},update:function(){var t=this.viewportWidth,e=this.viewportHeight,i=Math.abs(this.near),n=Math.abs(this.far),s=this.zoom;return 0===t||0===e||(this.projection.ortho(s*-t/2,s*t/2,s*-e/2,s*e/2,i,n),r.copy(this.position).add(this.direction),this.view.lookAt(this.position,r,this.up),this.combined.copy(this.projection).multiply(this.view),this.invProjectionView.copy(this.combined).invert(),this.billboardMatrixDirty=!0,this.updateChildren()),this},zoom:{get:function(){return this._zoom},set:function(t){this._zoom=t,this.update()}}});t.exports=o},function(t,e,i){var r=i(2);t.exports=function(t,e,i,n,s){r.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id||t.drawImage(e,n,s)}},function(t,e,i){var r=i(2);t.exports=function(t,e,i,n,s){r.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id||this.pipeline.batchSprite(e,n,s)}},function(t,e,i){var n=i(3),s=i(3);n=i(555),s=i(554),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=n,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*s+o*a,d=h*s-r*a,f=e*u+i*c+n*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+n*h)*f,t[2]=(o*i-n*r)*f,t[3]=c*f,t[4]=(l*e-n*a)*f,t[5]=(-o*e+n*s)*f,t[6]=d*f,t[7]=(-h*e+i*a)*f,t[8]=(r*e-i*s)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=n*h-i*l,t[2]=i*o-n*r,t[3]=o*a-s*l,t[4]=e*l-n*a,t[5]=n*s-e*o,t[6]=s*h-r*a,t[7]=i*a-e*h,t[8]=e*r-i*s,this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*s+o*a)+n*(h*s-r*a)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],g=c[3],v=c[4],y=c[5],m=c[6],x=c[7],w=c[8];return e[0]=d*i+f*r+p*h,e[1]=d*n+f*o+p*l,e[2]=d*s+f*a+p*u,e[3]=g*i+v*r+y*h,e[4]=g*n+v*o+y*l,e[5]=g*s+v*a+y*u,e[6]=m*i+x*r+w*h,e[7]=m*n+x*o+w*l,e[8]=m*s+x*a+w*u,this},translate:function(t){var e=this.val,i=t.x,n=t.y;return e[6]=i*e[0]+n*e[3]+e[6],e[7]=i*e[1]+n*e[4]+e[7],e[8]=i*e[2]+n*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*n+h*o,e[2]=l*s+h*a,e[3]=l*r-h*i,e[4]=l*o-h*n,e[5]=l*a-h*s,this},scale:function(t){var e=this.val,i=t.x,n=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=n*e[3],e[4]=n*e[4],e[5]=n*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,s=t.w,r=e+e,o=i+i,a=n+n,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,f=n*a,p=s*r,g=s*o,v=s*a,y=this.val;return y[0]=1-(c+f),y[3]=l+v,y[6]=u-g,y[1]=l-v,y[4]=1-(h+f),y[7]=d+p,y[2]=u+g,y[5]=d-p,y[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],y=e[14],m=e[15],x=n*h-s*a,w=n*l-r*a,b=n*u-o*a,T=s*l-r*h,S=s*u-o*h,A=r*u-o*l,C=c*v-d*g,M=c*y-f*g,_=c*m-p*g,E=d*y-f*v,P=d*m-p*v,k=f*m-p*y,L=x*k-w*P+b*E+T*_-S*M+A*C;return L?(L=1/L,i[0]=(h*k-l*P+u*E)*L,i[1]=(l*_-a*k-u*M)*L,i[2]=(a*P-h*_+u*C)*L,i[3]=(r*P-s*k-o*E)*L,i[4]=(n*k-r*_+o*M)*L,i[5]=(s*_-n*P-o*C)*L,i[6]=(v*A-y*S+m*T)*L,i[7]=(y*b-g*A-m*w)*L,i[8]=(g*S-v*b+m*x)*L,this):null}});t.exports=n},function(t,e,i){var n=i(0),s=i(87),r=i(557),a=new Int8Array([1,2,0]),h=new Float32Array([0,0,0]),o=new s(1,0,0),l=new s(0,1,0),u=new s,c=new r,d=new n({initialize:function(t,e,i,n){"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n;return 0<s&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(o).cross(t).length()<1e-6&&u.copy(l).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):.999999<i?(this.x=0,this.y=0,this.z=0,this.w=1,this):(u.copy(t).cross(e),this.x=u.x,this.y=u.y,this.z=u.z,this.w=1+i,this.normalize())},setAxes:function(t,e,i){var n=c.val;return n[0]=e.x,n[3]=e.y,n[6]=e.z,n[1]=i.x,n[4]=i.y,n[7]=i.z,n[2]=-t.x,n[5]=-t.y,n[8]=-t.z,this.fromMat3(c).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.x=i*t.x,this.y=i*t.y,this.z=i*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.x=e*h+s*r+i*a-n*o,this.y=i*h+s*o+n*r-e*a,this.z=n*h+s*a+e*o-i*r,this.w=s*h-e*r-i*o-n*a,this},slerp:function(t,e){var i=this.x,n=this.y,s=this.z,r=this.w,o=t.x,a=t.y,h=t.z,l=t.w,u=i*o+n*a+s*h+r*l;u<0&&(u=-u,o=-o,a=-a,h=-h,l=-l);var c=1-e,d=e;if(1e-6<1-u){var f=Math.acos(u),p=Math.sin(f);c=Math.sin((1-e)*f)/p,d=Math.sin(e*f)/p}return this.x=c*i+d*o,this.y=c*n+d*a,this.z=c*s+d*h,this.w=c*r+d*l,this},invert:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n,r=s?1/s:0;return this.x=-t*r,this.y=-e*r,this.z=-i*r,this.w=n*r,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+s*r,this.y=i*o+n*r,this.z=n*o-i*r,this.w=s*o-e*r,this},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o-n*r,this.y=i*o+s*r,this.z=n*o+e*r,this.w=s*o-i*r,this},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+i*r,this.y=i*o-e*r,this.z=n*o+s*r,this.w=s*o-n*r,this},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},fromMat3:function(t){var e,i=t.val,n=i[0]+i[4]+i[8];if(0<n)e=Math.sqrt(n+1),this.w=.5*e,e=.5/e,this.x=(i[7]-i[5])*e,this.y=(i[2]-i[6])*e,this.z=(i[3]-i[1])*e;else{var s=0;i[4]>i[0]&&(s=1),i[8]>i[3*s+s]&&(s=2);var r=a[s],o=a[r];e=Math.sqrt(i[3*s+s]-i[3*r+r]-i[3*o+o]+1),h[s]=.5*e,e=.5/e,h[r]=(i[3*r+s]+i[3*s+r])*e,h[o]=(i[3*o+s]+i[3*s+o])*e,this.x=h[0],this.y=h[1],this.z=h[2],this.w=(i[3*o+r]-i[3*r+o])*e}return this}});t.exports=d},function(t,e,i){var n=i(87),s=i(278),r=i(558),o=new s,a=new r,h=new n;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,n=2*Math.random()-1,s=Math.sqrt(1-n*n)*e;return t.x=Math.cos(i)*s,t.y=Math.sin(i)*s,t.z=n*e,t}},function(t,e,i){var a=i(123),n=i(0),v=i(1),s=i(12),h=i(31),r=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,s,r){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===s&&(s=!1),void 0===r&&(r="");var o=null;return 0<this.cameraPool.length?(o=this.cameraPool.pop()).setViewport(t,e,i,n):o=new a(t,e,i,n),o.setName(r),o.setScene(this.scene),this.cameras.push(o),s&&(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&&0<=i?(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,n=0;n<t.length;n++){var s=t[n],r=v(s,"x",0),o=v(s,"y",0),a=v(s,"width",e),h=v(s,"height",i),l=this.add(r,o,a,h);l.name=v(s,"name",""),l.zoom=v(s,"zoom",1),l.rotation=v(s,"rotation",0),l.scrollX=v(s,"scrollX",0),l.scrollY=v(s,"scrollY",0),l.roundPixels=v(s,"roundPixels",!1),l.visible=v(s,"visible",!0);var u=v(s,"backgroundColor",!1);u&&l.setBackgroundColor(u);var c=v(s,"bounds",null);if(c){var d=v(c,"x",0),f=v(c,"y",0),p=v(c,"width",e),g=v(c,"height",i);l.setBounds(d,f,p,g)}}return this},getCamera:function(t){for(var e=0;e<this.cameras.length;e++)if(this.cameras[e].name===t)return this.cameras[e];return null},getCamerasBelowPointer:function(t){for(var e=this.cameras,i=t.x,n=t.y,s=[],r=0;r<e.length;r++){var o=e[r];o.visible&&o.inputEnabled&&h(o,i,n)&&s.unshift(o)}return s},remove:function(t){var e=this.cameras.indexOf(t);0<=e&&1<this.cameras.length&&(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 n=this.cameras,s=this.baseScale,r=0,o=n.length;r<o;++r){var a=n[r];a.visible&&(a.preRender(s,t.config.resolution),t.render(this.scene,e,i,a))}},resetAll:function(){for(;0<this.cameras.length;)this.cameraPool.push(this.cameras.pop());return this.main=this.add(),this.main},update:function(t,e){for(var i=0,n=this.cameras.length;i<n;++i)this.cameras[i].update(t,e)},resize:function(t,e){for(var i=0,n=this.cameras.length;i<n;++i)this.cameras[i].setSize(t,e)},shutdown:function(){this.main=void 0;for(var t=0;t<this.cameras.length;t++)this.cameras[t].destroy();for(t=0;t<this.cameraPool.length;t++)this.cameraPool[t].destroy();this.cameras=[],this.cameraPool=[];var e=this.systems.events;e.off("update",this.update,this),e.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});s.register("CameraManager",r,"cameras"),t.exports=r},function(t,e,i){var o=i(23),n=i(0),s=i(6),r=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new s,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===n&&(n=null),void 0===s&&(s=this.camera.scene),!i&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=n,this._onUpdateScope=s,this.camera.emit("camerashakestart",this.camera,this,t,e)),this.camera},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=o(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration){var i=this.intensity,n=this.camera.width,s=this.camera.height,r=this.camera.zoom;this._offsetX=(Math.random()*i.x*n*2-i.x*n)*r,this._offsetY=(Math.random()*i.y*s*2-i.y*s)*r,this.camera.roundPixels&&(this._offsetX|=0,this._offsetY|=0)}else this.effectComplete()},effectComplete:function(){this._offsetX=0,this._offsetY=0,this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit("camerashakecomplete",this.camera,this)},reset:function(){this.isRunning=!1,this._offsetX=0,this._offsetY=0,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.intensity=null}});t.exports=r},function(t,e,i){var n=i(23),s=new(i(0))({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,r,o){return void 0===t&&(t=250),void 0===e&&(e=255),void 0===i&&(i=255),void 0===n&&(n=255),void 0===s&&(s=!1),void 0===r&&(r=null),void 0===o&&(o=this.camera.scene),!s&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,this.red=e,this.green=i,this.blue=n,this.alpha=1,this._elapsed=0,this._onUpdate=r,this._onUpdateScope=o,this.camera.emit("cameraflashstart",this.camera,this,t,e,i,n)),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration?this.alpha=1-this.progress:this.effectComplete())},postRenderCanvas:function(t){if(!this.isRunning)return!1;var e=this.camera;return t.fillStyle="rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")",t.fillRect(e.x,e.y,e.width,e.height),!0},postRenderWebGL:function(t,e){if(!this.isRunning)return!1;var i=this.camera,n=this.red/255,s=this.blue/255,r=this.green/255;return t.batchFillRect(0,0,1,1,0,i.x,i.y,i.width,i.height,e(n,r,s,1),this.alpha,1,0,0,1,0,0,[1,0,0,1,0,0]),!0},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit("cameraflashcomplete",this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=s},function(t,e,i){var n=i(23),s=new(i(0))({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,r,o,a){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=!1),void 0===o&&(o=null),void 0===a&&(a=this.camera.scene),!r&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=n,this.blue=s,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=a;var h=t?"camerafadeoutstart":"camerafadeinstart";return this.camera.emit(h,this.camera,this,e,i,n,s),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration?this.alpha=this.direction?this.progress:1-this.progress:this.effectComplete())},postRenderCanvas:function(t){if(!this.isRunning&&!this.isComplete)return!1;var e=this.camera;return t.fillStyle="rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")",t.fillRect(e.x,e.y,e.width,e.height),!0},postRenderWebGL:function(t,e){if(!this.isRunning&&!this.isComplete)return!1;var i=this.camera,n=this.red/255,s=this.blue/255,r=this.green/255;return t.batchFillRect(0,0,1,1,0,i.x,i.y,i.width,i.height,e(n,r,s,1),this.alpha,1,0,0,1,0,0,[1,0,0,1,0,0]),!0},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.isComplete=!0;var t=this.direction?"camerafadeoutcomplete":"camerafadeincomplete";this.camera.emit(t,this.camera,this)},reset:function(){this.isRunning=!1,this.isComplete=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=s},function(t,e,i){t.exports={Camera:i(123),CameraManager:i(562),Effects:i(204)}},function(t,e,i){t.exports={BaseCache:i(206),CacheManager:i(205)}},function(t,e,i){t.exports={Animation:i(210),AnimationFrame:i(208),AnimationManager:i(207)}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var n=Math.round(t.x1),s=Math.round(t.y1),r=Math.round(t.x2),o=Math.round(t.y2),a=Math.abs(r-n),h=Math.abs(o-s),l=n<r?1:-1,u=s<o?1:-1,c=a-h;i.push({x:n,y:s});for(var d=1;n!==r||s!==o;){var f=c<<1;-h<f&&(c-=h,n+=l),f<a&&(c+=a,s+=u),d%e==0&&i.push({x:n,y:s}),d++}return i}},function(t,e,i){var h=i(97),l=i(5);t.exports=function(t,e,i,n){if(void 0===n&&(n=[]),!e&&!i)return n;e?i=Math.round(h(t)/e):e=h(t)/i;for(var s=t.x,r=t.y,o=0,a=0;a<i;a++)switch(n.push(new l(s,r)),o){case 0:(s+=e)>=t.right&&(o=1,r+=s-t.right,s=t.right);break;case 1:(r+=e)>=t.bottom&&(o=2,s-=r-t.bottom,r=t.bottom);break;case 2:(s-=e)<=t.left&&(o=3,r-=t.left-s,s=t.left);break;case 3:(r-=e)<=t.top&&(o=0,r=t.top)}return n}},function(t,e){var i={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=i},function(t,e,i){var n=i(16),r=i(64),s=i(212),o=i(211),a={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return o(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=s(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.game.config.width),void 0===n&&(n=this.scene.sys.game.config.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t){void 0===t&&(t=new r);var e=this.parentContainer;if(!e)return this.getLocalTransformMatrix(t);for(var i=[];e;)i.unshift(e),e=e.parentContainer;t.loadIdentity();for(var n=i.length,s=0;s<n;++s)e=i[s],t.translate(e.x,e.y),t.rotate(e.rotation),t.scale(e.scaleX,e.scaleY);return t.translate(this.x,this.y),t.rotate(this._rotation),t.scale(this._scaleX,this._scaleY),t}};t.exports=a},function(t,e){t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,scaleMode:t.scaleMode,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e){var s=function(t){return(t>>16)+(65280&t)+((255&t)<<16)},i={_tintTL:16777215,_tintTR:16777215,_tintBL:16777215,_tintBR:16777215,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,n){return void 0===t&&(t=16777215),void 0===e&&(n=i=e=t),this._tintTL=s(t),this._tintTR=s(e),this._tintBL=s(i),this._tintBR=s(n),this},tintTopLeft:{get:function(){return this._tintTL},set:function(t){this._tintTL=s(t)}},tintTopRight:{get:function(){return this._tintTR},set:function(t){this._tintTR=s(t)}},tintBottomLeft:{get:function(){return this._tintBL},set:function(t){this._tintBL=s(t)}},tintBottomRight:{get:function(){return this._tintBR},set:function(t){this._tintBR=s(t)}},tint:{set:function(t){this.setTint(t,t,t,t)}}};t.exports=i},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 n=i(59),s={_scaleMode:n.DEFAULT,scaleMode:{get:function(){return this._scaleMode},set:function(t){t!==n.LINEAR&&t!==n.NEAREST||(this._scaleMode=t)}},setScaleMode:function(t){return this.scaleMode=t,this}};t.exports=s},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,n,s,r){var o=this.currentMatrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=a*t+l*e,o[1]=h*t+u*e,o[2]=a*i+l*n,o[3]=h*i+u*n,o[4]=a*s+l*r+c,o[5]=h*s+u*r+d,this},setTransform:function(t,e,i,n,s,r){var o=this.currentMatrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=n,o[4]=s,o[5]=r,this},translate:function(t,e){var i=this.currentMatrix,n=i[0],s=i[1],r=i[2],o=i[3],a=i[4],h=i[5];return i[4]=n*t+r*e+a,i[5]=s*t+o*e+h,this},scale:function(t,e){var i=this.currentMatrix,n=i[0],s=i[1],r=i[2],o=i[3];return i[0]=n*t,i[1]=s*t,i[2]=r*e,i[3]=o*e,this},rotate:function(t){var e=this.currentMatrix,i=e[0],n=e[1],s=e[2],r=e[3],o=Math.sin(t),a=Math.cos(t);return e[0]=i*a+s*o,e[1]=n*a+r*o,e[2]=i*-o+s*a,e[3]=n*-o+r*a,this}};t.exports=i},function(t,e,i){var n=i(214),s=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 n(this.scene,t)},createGeometryMask:function(t){return void 0===t&&"Graphics"===this.type&&(t=this),new s(this.scene,t)}};t.exports=r},function(t,e,i){var u=i(14),n=i(292),s=i(6),r={getCenter:function(t){return void 0===t&&(t=new s),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 s),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 s),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 s),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 s),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,s,r,o,a,h;if(void 0===t&&(t=new u),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,s=t.y,this.getBottomLeft(t),l.transformPoint(t.x,t.y,t),r=t.x,o=t.y,this.getBottomRight(t),l.transformPoint(t.x,t.y,t),a=t.x,h=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),n=t.x,s=t.y,this.getBottomLeft(t),r=t.x,o=t.y,this.getBottomRight(t),a=t.x,h=t.y;return t.x=Math.min(e,n,r,a),t.y=Math.min(i,s,o,h),t.width=Math.max(e,n,r,a)-t.x,t.height=Math.max(i,s,o,h)-t.y,t}};t.exports=r},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 n=i(51),s={_blendMode:n.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=n[t]),0<=(t|=0)&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=s},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,0===(this._alphaBR=e)?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=s(t,0,1);0!==(this._alphaTL=e)&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=s(t,0,1);0!==(this._alphaTR=e)&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=s(t,0,1);0!==(this._alphaBL=e)&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=s(t,0,1);0!==(this._alphaBR=e)&&(this.renderFlags|=2)}}};t.exports=n},function(t,e,i){var s=i(46),r=i(44),o=i(45),a=i(43);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),o(t,s(e)+i),a(t,r(e)-n),t}},function(t,e,i){var s=i(48),r=i(44),o=i(47),a=i(43);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),o(t,s(e)-i),a(t,r(e)-n),t}},function(t,e,i){var s=i(92),r=i(44),o=i(91),a=i(43);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),o(t,s(e)+i),a(t,r(e)-n),t}},function(t,e,i){var s=i(89),r=i(46),o=i(90),a=i(45);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,r(e)+i),o(t,s(e)+n),t}},function(t,e,i){var s=i(89),r=i(48),o=i(90),a=i(47);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,r(e)-i),o(t,s(e)+n),t}},function(t,e,i){var n=i(91),s=i(90);t.exports=function(t,e,i){return n(t,e),s(t,i)}},function(t,e,i){var s=i(593),r=i(92),o=i(89);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),s(t,r(e)+i,o(e)+n),t}},function(t,e,i){var s=i(50),r=i(46),o=i(49),a=i(45);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,r(e)+i),o(t,s(e)+n),t}},function(t,e,i){var s=i(50),r=i(48),o=i(49),a=i(47);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,r(e)-i),o(t,s(e)+n),t}},function(t,e,i){var s=i(50),r=i(92),o=i(49),a=i(91);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,r(e)+i),o(t,s(e)+n),t}},function(t,e,i){var n=i(299),r=[];r[n.BOTTOM_CENTER]=i(597),r[n.BOTTOM_LEFT]=i(596),r[n.BOTTOM_RIGHT]=i(595),r[n.CENTER]=i(594),r[n.LEFT_CENTER]=i(592),r[n.RIGHT_CENTER]=i(591),r[n.TOP_CENTER]=i(590),r[n.TOP_LEFT]=i(589),r[n.TOP_RIGHT]=i(588);t.exports=function(t,e,i,n,s){return r[i](t,e,n,s)}},function(t,e,i){t.exports={Angle:i(1007),Call:i(1006),GetFirst:i(1005),GetLast:i(1004),GridAlign:i(1003),IncAlpha:i(1002),IncX:i(1001),IncXY:i(1e3),IncY:i(999),PlaceOnCircle:i(998),PlaceOnEllipse:i(997),PlaceOnLine:i(996),PlaceOnRectangle:i(995),PlaceOnTriangle:i(994),PlayAnimation:i(993),PropertyValueInc:i(35),PropertyValueSet:i(25),RandomCircle:i(992),RandomEllipse:i(991),RandomLine:i(990),RandomRectangle:i(989),RandomTriangle:i(988),Rotate:i(987),RotateAround:i(986),RotateAroundDistance:i(985),ScaleX:i(984),ScaleXY:i(983),ScaleY:i(982),SetAlpha:i(981),SetBlendMode:i(980),SetDepth:i(979),SetHitArea:i(978),SetOrigin:i(977),SetRotation:i(976),SetScale:i(975),SetScaleX:i(974),SetScaleY:i(973),SetTint:i(972),SetVisible:i(971),SetX:i(970),SetXY:i(969),SetY:i(968),ShiftPosition:i(967),Shuffle:i(966),SmootherStep:i(965),SmoothStep:i(964),Spread:i(963),ToggleVisible:i(962),WrapInRectangle:i(961)}},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<this.length;e++)this[e]=0}else{Array.call(this,t.length),this.length=t.length;for(e=0;e<this.length;e++)this[e]=t[e]}},window[t].prototype=e,window[t].constructor=window[t]};i("Float32Array"),i("Uint32Array"),i("Uint16Array"),i("Int16Array"),i("ArrayBuffer")}},function(t,e,i){(function(t){if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!t.performance||!t.performance.now){var e=Date.now();t.performance||(t.performance={}),t.performance.now=function(){return Date.now()-e}}for(var n=Date.now(),i=["ms","moz","webkit","o"],s=0;s<i.length&&!t.requestAnimationFrame;++s)t.requestAnimationFrame=t[i[s]+"RequestAnimationFrame"],t.cancelAnimationFrame=t[i[s]+"CancelAnimationFrame"]||t[i[s]+"CancelRequestAnimationFrame"];t.requestAnimationFrame||(t.requestAnimationFrame=function(t){if("function"!=typeof t)throw new TypeError(t+"is not a function");var e=Date.now(),i=16+n-e;return i<0&&(i=0),n=e,setTimeout(function(){n=Date.now(),t(performance.now())},i)}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(t){clearTimeout(t)})}).call(this,i(215))},function(t,e){!function(){if("performance"in window==!1&&(window.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in window.performance==!1){var t=Date.now();performance.timing&&performance.timing.navigationStart&&(t=performance.timing.navigationStart),window.performance.now=function(){return Date.now()-t}}}()},function(t,e){Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)})},function(t,e){var r;Function.prototype.bind||(Function.prototype.bind=(r=Array.prototype.slice,function(e){var i=this,n=r.call(arguments,1);if("function"!=typeof i)throw new TypeError;function s(){var t=n.concat(r.call(arguments));i.apply(this instanceof s?this:e,t)}return s.prototype=function t(e){if(e&&(t.prototype=e),!(this instanceof t))return new t}(i.prototype),s}))},function(t,e){window.console||(window.console={},window.console.log=window.console.assert=function(){},window.console.warn=window.console.assert=function(){})},function(t,e){!function(){function i(t){t&&(t.setTargetAtTime||(t.setTargetAtTime=t.setTargetValueAtTime))}window.hasOwnProperty("webkitAudioContext")&&!window.hasOwnProperty("AudioContext")&&(window.AudioContext=webkitAudioContext,AudioContext.prototype.hasOwnProperty("createGain")||(AudioContext.prototype.createGain=AudioContext.prototype.createGainNode),AudioContext.prototype.hasOwnProperty("createDelay")||(AudioContext.prototype.createDelay=AudioContext.prototype.createDelayNode),AudioContext.prototype.hasOwnProperty("createScriptProcessor")||(AudioContext.prototype.createScriptProcessor=AudioContext.prototype.createJavaScriptNode),AudioContext.prototype.hasOwnProperty("createPeriodicWave")||(AudioContext.prototype.createPeriodicWave=AudioContext.prototype.createWaveTable),AudioContext.prototype.internal_createGain=AudioContext.prototype.createGain,AudioContext.prototype.createGain=function(){var t=this.internal_createGain();return i(t.gain),t},AudioContext.prototype.internal_createDelay=AudioContext.prototype.createDelay,AudioContext.prototype.createDelay=function(t){var e=t?this.internal_createDelay(t):this.internal_createDelay();return i(e.delayTime),e},AudioContext.prototype.internal_createBufferSource=AudioContext.prototype.createBufferSource,AudioContext.prototype.createBufferSource=function(){var n=this.internal_createBufferSource();return n.start?(n.internal_start=n.start,n.start=function(t,e,i){void 0!==i?n.internal_start(t||0,e,i):n.internal_start(t||0,e||0)}):n.start=function(t,e,i){e||i?this.noteGrainOn(t||0,e,i):this.noteOn(t||0)},n.stop?(n.internal_stop=n.stop,n.stop=function(t){n.internal_stop(t||0)}):n.stop=function(t){this.noteOff(t||0)},i(n.playbackRate),n},AudioContext.prototype.internal_createDynamicsCompressor=AudioContext.prototype.createDynamicsCompressor,AudioContext.prototype.createDynamicsCompressor=function(){var t=this.internal_createDynamicsCompressor();return i(t.threshold),i(t.knee),i(t.ratio),i(t.reduction),i(t.attack),i(t.release),t},AudioContext.prototype.internal_createBiquadFilter=AudioContext.prototype.createBiquadFilter,AudioContext.prototype.createBiquadFilter=function(){var t=this.internal_createBiquadFilter();return i(t.frequency),i(t.detune),i(t.Q),i(t.gain),t},AudioContext.prototype.hasOwnProperty("createOscillator")&&(AudioContext.prototype.internal_createOscillator=AudioContext.prototype.createOscillator,AudioContext.prototype.createOscillator=function(){var e=this.internal_createOscillator();return e.start?(e.internal_start=e.start,e.start=function(t){e.internal_start(t||0)}):e.start=function(t){this.noteOn(t||0)},e.stop?(e.internal_stop=e.stop,e.stop=function(t){e.internal_stop(t||0)}):e.stop=function(t){this.noteOff(t||0)},e.setPeriodicWave||(e.setPeriodicWave=e.setWaveTable),i(e.frequency),i(e.detune),e})),window.hasOwnProperty("webkitOfflineAudioContext")&&!window.hasOwnProperty("OfflineAudioContext")&&(window.OfflineAudioContext=webkitOfflineAudioContext)}()},function(t,e){Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)})},function(t,e){Array.prototype.forEach||(Array.prototype.forEach=function(t){"use strict";if(null==this)throw new TypeError;var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var n=2<=arguments.length?arguments[1]:void 0,s=0;s<i;s++)s in e&&t.call(n,e[s],s,e)})},function(t,e,i){i(608),i(607),i(606),i(605),i(604),i(603),i(602),i(601),i(600)},function(t,e){var l={};(t.exports=l).create=function(t,e){var i=t.bodyA,n=t.bodyB,s={id:l.id(i,n),bodyA:i,bodyB:n,activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:i.isSensor||n.isSensor,timeCreated:e,timeUpdated:e,collision:null,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return l.update(s,t,e),s},l.update=function(t,e,i){if((t.collision=e).collided){var n=e.supports,s=t.activeContacts,r=e.parentA,o=e.parentB;t.inverseMass=r.inverseMass+o.inverseMass,t.friction=Math.min(r.friction,o.friction),t.frictionStatic=Math.max(r.frictionStatic,o.frictionStatic),t.restitution=Math.max(r.restitution,o.restitution),t.slop=Math.max(r.slop,o.slop);for(var a=0;a<n.length;a++)s[a]=n[a].contact;var h=n.length;h<s.length&&(s.length=h),t.separation=e.depth,l.setActive(t,!0,i)}else!0===t.isActive&&l.setActive(t,!1,i)},l.setActive=function(t,e,i){e?(t.isActive=!0,t.timeUpdated=i):(t.isActive=!1,t.activeContacts.length=0)},l.id=function(t,e){return t.id<e.id?"A"+t.id+"B"+e.id:"A"+e.id+"B"+t.id}},function(t,e,i){t.exports={Bounce:i(1047),Collision:i(1046),Force:i(1045),Friction:i(1044),Gravity:i(1043),Mass:i(1042),Static:i(1041),Sensor:i(1040),SetBody:i(1039),Sleep:i(1037),Transform:i(1036),Velocity:i(1035)}},function(t,e){t.exports=function(t){return t.split("").reverse().join("")}},function(t,e){t.exports=function(t,i){return t.replace(/%([0-9]+)/g,function(t,e){return i[Number(e)-1]})}},function(t,e,i){t.exports={Format:i(613),Pad:i(133),Reverse:i(612),UppercaseFirst:i(256)}},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,e){for(var i=0;i<e.length;i++)if(!t.hasOwnProperty(e[i]))return!1;return!0}},function(t,e,i){var o=i(4),a=i(23);t.exports=function(t,e,i,n,s){void 0===s&&(s=i);var r=o(t,e,s);return a(r,i,n)}},function(t,e,i){t.exports={Clone:i(33),Extend:i(17),GetAdvancedValue:i(10),GetFastValue:i(1),GetMinMaxValue:i(617),GetValue:i(4),HasAll:i(616),HasAny:i(420),HasValue:i(111),IsPlainObject:i(8),Merge:i(94),MergeRight:i(615)}},function(t,e,i){t.exports={Array:i(147),Objects:i(618),String:i(614)}},function(t,e,i){var n=i(11),a=i(216);n.register("tilemap",function(t,e,i,n,s,r,o){return null===t&&(t=void 0),null===e&&(e=void 0),null===i&&(i=void 0),null===n&&(n=void 0),null===s&&(s=void 0),a(this.scene,t,e,i,n,s,r,o)})},function(t,e,i){var n=i(13),s=i(216);n.register("tilemap",function(t){var e=void 0!==t?t:{};return s(this.scene,e.key,e.tileWidth,e.tileHeight,e.width,e.height,e.data,e.insertNull)})},function(t,e,i){var p=i(2);t.exports=function(t,e,i,n){if(!(p.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id)){e.cull(n);var s=e.culledTiles,r=this.tileset,o=t.gameContext,a=s.length,h=r.image.getSourceImage(),l=e.x-n.scrollX*e.scrollFactorX,u=e.y-n.scrollY*e.scrollFactorY;o.save(),o.translate(l,u),o.rotate(e.rotation),o.scale(e.scaleX,e.scaleY),o.scale(e.flipX?-1:1,e.flipY?-1:1),o.globalAlpha=e.alpha;for(var c=0;c<a;++c){var d=s[c],f=r.getTileTextureCoordinates(d.index);null!==f&&o.drawImage(h,f.x,f.y,d.width,d.height,d.pixelX,d.pixelY,d.width,d.height)}o.restore()}}},function(t,e,i){var s=i(2);t.exports=function(t,e,i,n){s.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id||(e.upload(n),this.pipeline.drawStaticTilemapLayer(e,n))}},function(t,e,i){var n=i(3),s=i(3);n=i(623),s=i(622),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var v=i(2);t.exports=function(t,e,i,n){if(!(v.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id)){e.cull(n);var s=e.culledTiles,r=s.length,o=e.tileset.image.getSourceImage(),a=this.tileset,h=e.x-n.scrollX*e.scrollFactorX,l=e.y-n.scrollY*e.scrollFactorY,u=t.gameContext;u.save(),u.translate(h,l),u.rotate(e.rotation),u.scale(e.scaleX,e.scaleY),u.scale(e.flipX?-1:1,e.flipY?-1:1);for(var c=0;c<r;++c){var d=s[c],f=a.getTileTextureCoordinates(d.index);if(null!==f){var p=d.width/2,g=d.height/2;u.save(),u.translate(d.pixelX+p,d.pixelY+g),0!==d.rotation&&u.rotate(d.rotation),(d.flipX||d.flipY)&&u.scale(d.flipX?-1:1,d.flipY?-1:1),u.globalAlpha=e.alpha*d.alpha,u.drawImage(o,f.x,f.y,d.width,d.height,-p,-g,d.width,d.height),u.restore()}}u.restore()}}},function(t,e,i){var s=i(2);t.exports=function(t,e,i,n){s.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id||(e.cull(n),this.pipeline.batchDynamicTilemapLayer(e,n))}},function(t,e,i){var n=i(3),s=i(3);n=i(626),s=i(625),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var o=i(137);t.exports=function(t){for(var e=[],i=[],n=0;n<t.layer.length;n++){var s=t.layer[n],r=s.tilesetName;""!==r&&-1===i.indexOf(r)&&(i.push(r),e.push(new o(r,0,s.tilesize,s.tilesize,0,0)))}return e}},function(t,e,i){var d=i(104),f=i(66);t.exports=function(t,e){for(var i=[],n=0;n<t.layer.length;n++){for(var s=t.layer[n],r=new d({name:s.name,width:s.width,height:s.height,tileWidth:s.tilesize,tileHeight:s.tilesize,visible:1===s.visible}),o=[],a=[],h=0;h<s.data.length;h++){for(var l=0;l<s.data[h].length;l++){var u,c=s.data[h][l]-1;u=-1<c?new f(r,c,l,h,s.tilesize,s.tilesize):e?null:new f(r,-1,l,h,s.tilesize,s.tilesize),o.push(u)}a.push(o),o=[]}r.data=a,i.push(r)}return i}},function(t,e,i){var l=i(17);t.exports=function(t){for(var e,i,n,s,r,o=0;o<t.layers.length;o++){e=t.layers[o],s=null;for(var a=0;a<e.data.length;a++){r=e.data[a];for(var h=0;h<r.length;h++)null===(i=r[h])||i.index<0||(n=t.tiles[i.index][2],s=t.tilesets[n],i.width=s.tileWidth,i.height=s.tileHeight,s.tileProperties&&s.tileProperties[i.index-s.firstgid]&&(i.properties=l(i.properties,s.tileProperties[i.index-s.firstgid])))}}}},function(t,e){t.exports=function(t){for(var e=[],i=0;i<t.tilesets.length;i++)for(var n=t.tilesets[i],s=n.tileMargin,r=n.tileMargin,o=0,a=0,h=0,l=n.firstgid;l<n.firstgid+n.total&&(e[l]=[s,r,i],s+=n.tileWidth+n.tileSpacing,++o!==n.total)&&(++a!==n.columns||(s=n.tileMargin,r+=n.tileHeight+n.tileSpacing,a=0,++h!==n.rows));l++);return e}},function(t,e,i){var u=i(1),c=i(314),d=i(313);t.exports=function(t){for(var e=[],i=0;i<t.layers.length;i++)if("objectgroup"===t.layers[i].type){for(var n=t.layers[i],s=u(n,"offsetx",0),r=u(n,"offsety",0),o=[],a=0;a<n.objects.length;a++){var h=c(n.objects[a],s,r);o.push(h)}var l=new d(n);l.objects=o,e.push(l)}return e}},function(t,e,i){var r=i(111);t.exports=function(t,e){for(var i={},n=0;n<e.length;n++){var s=e[n];r(t,s)&&(i[s]=t[s])}return i}},function(t,e,i){var f=i(137),p=i(315),g=i(314);t.exports=function(t){for(var e,i=[],n=[],s=null,r=0;r<t.tilesets.length;r++){var o=t.tilesets[r];if(o.source)console.warn("Phaser can't load external tilesets. Use the Embed Tileset button and then export the map again.");else if(o.image){var a=new f(o.name,o.firstgid,o.tilewidth,o.tileheight,o.margin,o.spacing);if(o.tileproperties&&(a.tileProperties=o.tileproperties),o.tiles)for(e in a.tileData=o.tiles,a.tileData){var h=a.tileData[e].objectgroup;if(h&&h.objects){var l=h.objects.map(function(t){return g(t)});a.tileData[e].objectgroup.objects=l}}a.updateTileData(o.imagewidth,o.imageheight),i.push(a)}else{var u=new p(o.name,o.firstgid,o.tilewidth,o.tileheight,o.margin,o.spacing,o.properties);for(e in o.tiles){var c=o.tiles[e].image,d=o.firstgid+parseInt(e,10);u.addImage(d,c)}n.push(u)}s&&(s.lastgid=o.firstgid-1),s=o}return{tilesets:i,imageCollections:n}}},function(t,e,i){var s=i(1);t.exports=function(t){for(var e=[],i=0;i<t.layers.length;i++)if("imagelayer"===t.layers[i].type){var n=t.layers[i];e.push({name:n.name,image:n.image,x:s(n,"offsetx",0)+n.x,y:s(n,"offsety",0)+n.y,alpha:n.opacity,visible:n.visible,properties:s(n,"properties",{})})}return e}},function(t,e){t.exports=function(t){for(var e=window.atob(t),i=e.length,n=new Array(i/4),s=0;s<i;s+=4)n[s/4]=(e.charCodeAt(s)|e.charCodeAt(s+1)<<8|e.charCodeAt(s+2)<<16|e.charCodeAt(s+3)<<24)>>>0;return n}},function(t,e,i){var p=i(636),g=i(1),v=i(104),y=i(316),m=i(66);t.exports=function(t,e){for(var i=[],n=0;n<t.layers.length;n++)if("tilelayer"===t.layers[n].type){var s=t.layers[n];if(s.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+s.name+"'");else{s.encoding&&"base64"===s.encoding&&(s.data=p(s.data),delete s.encoding);for(var r=new v({name:s.name,x:g(s,"offsetx",0)+s.x,y:g(s,"offsety",0)+s.y,width:s.width,height:s.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:s.opacity,visible:s.visible,properties:g(s,"properties",{})}),o=0,a=[],h=[],l=0,u=s.data.length;l<u;l++){var c=y(s.data[l]);if(0<c.gid){var d=new m(r,c.gid,o,h.length,t.tilewidth,t.tileheight);d.rotation=c.rotation,d.flipX=c.flipped,a.push(d)}else{var f=e?null:new m(r,-1,o,h.length,t.tilewidth,t.tileheight);a.push(f)}++o===s.width&&(h.push(a),o=0,a=[])}r.data=h,i.push(r)}}return i}},function(t,e,i){t.exports={Parse:i(319),Parse2DArray:i(217),ParseCSV:i(318),Impact:i(312),Tiled:i(317)}},function(t,e,i){var o=i(53),a=i(52),h=i(6);t.exports=function(t,e,i,n,s,r){return void 0===n&&(n=new h(0,0)),n.x=o(t,i,s,r),n.y=a(e,i,s,r),n}},function(t,e,i){var p=i(21);t.exports=function(t,e,i,n,s,r){if(void 0!==s){var o,a=p(t,e,i,n,null,r),h=0;for(o=0;o<s.length;o++)h+=s[o].weight;if(!(h<=0))for(o=0;o<a.length;o++){for(var l=Math.random()*h,u=0,c=-1,d=0;d<s.length;d++)if(l<=(u+=s[d].weight)){var f=s[d].index;c=Array.isArray(f)?f[Math.floor(Math.random()*f.length)]:f;break}a[o].index=c}}}},function(t,e,i){var r=i(139),o=i(138),a=i(6);t.exports=function(t,e,i,n,s){return void 0===i&&(i=new a(0,0)),i.x=r(t,n,s),i.y=o(e,n,s),i}},function(t,e,i){var l=i(21);t.exports=function(t,e,i,n,s,r,o){for(var a=l(i,n,s,r,null,o),h=0;h<a.length;h++)a[h]&&(a[h].index===t?a[h].index=e:a[h].index===e&&(a[h].index=t))}},function(t,e,i){var h=i(21),l=i(95);t.exports=function(t,e,i,n,s){var r=h(t,e,i,n,null,s),o=r.map(function(t){return t.index});l(o);for(var a=0;a<r.length;a++)r[a].index=o[a]}},function(t,e,i){var l=i(21);t.exports=function(t,e,i,n,s,r,o){for(var a=l(t,e,i,n,null,o),h=0;h<a.length;h++)a[h].setCollisionCallback(s,r)}},function(t,e){t.exports=function(t,e,i,n){if("number"==typeof t)n.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var s=0,r=t.length;s<r;s++)n.callbacks[t[s]]=null!==e?{callback:e,callbackContext:i}:void 0}},function(t,e,i){var a=i(67),h=i(40);t.exports=function(t,e,i){void 0===t&&(t=!0),void 0===e&&(e=!0);for(var n=0;n<i.height;n++)for(var s=0;s<i.width;s++){var r=i.data[n][s];if(r){var o=r.getCollisionGroup();o&&o.objects&&0<o.objects.length&&a(r,t)}}e&&h(0,0,i.width,i.height,i)}},function(t,e,i){var u=i(67),c=i(40),d=i(111);t.exports=function(t,e,i,n){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var s=0;s<n.height;s++)for(var r=0;r<n.width;r++){var o=n.data[s][r];if(o)for(var a in t)if(d(o.properties,a)){var h=t[a];Array.isArray(h)||(h=[h]);for(var l=0;l<h.length;l++)o.properties[a]===h[l]&&u(o,e)}}i&&c(0,0,n.width,n.height,n)}},function(t,e,i){var a=i(67),h=i(40),l=i(218);t.exports=function(t,e,i,n){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var s=0;s<n.height;s++)for(var r=0;r<n.width;r++){var o=n.data[s][r];o&&-1===t.indexOf(o.index)&&(a(o,e),l(o.index,e,n))}i&&h(0,0,n.width,n.height,n)}},function(t,e,i){var l=i(67),u=i(40),c=i(218);t.exports=function(t,e,i,n,s){if(void 0===i&&(i=!0),void 0===n&&(n=!0),!(e<t)){for(var r=t;r<=e;r++)c(r,i,s);for(var o=0;o<s.height;o++)for(var a=0;a<s.width;a++){var h=s.data[o][a];h&&h.index>=t&&h.index<=e&&l(h,i)}n&&u(0,0,s.width,s.height,s)}}},function(t,e,i){var h=i(67),l=i(40),u=i(218);t.exports=function(t,e,i,n){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var s=0;s<t.length;s++)u(t[s],e,n);for(var r=0;r<n.height;r++)for(var o=0;o<n.width;o++){var a=n.data[r][o];a&&-1!==t.indexOf(a.index)&&h(a,e)}i&&l(0,0,n.width,n.height,n)}},function(t,e,i){var p=i(21),g=i(542);t.exports=function(t,e,i){void 0===e&&(e={});for(var n=void 0!==e.tileColor?e.tileColor:new g(105,210,231,150),s=void 0!==e.collidingTileColor?e.collidingTileColor:new g(243,134,48,200),r=void 0!==e.faceColor?e.faceColor:new g(40,39,37,150),o=p(0,0,i.width,i.height,null,i),a=0;a<o.length;a++){var h=o[a],l=h.width,u=h.height,c=h.pixelX,d=h.pixelY,f=h.collides?s:n;null!==f&&(t.fillStyle(f.color,f.alpha/255),t.fillRect(c,d,l,u)),c+=1,d+=1,l-=2,u-=2,null!==r&&(t.lineStyle(1,r.color,r.alpha/255),h.faceTop&&t.lineBetween(c,d,c+l,d),h.faceRight&&t.lineBetween(c+l,d,c+l,d+u),h.faceBottom&&t.lineBetween(c,d+u,c+l,d+u),h.faceLeft&&t.lineBetween(c,d,c,d+u))}}},function(t,e,i){var h=i(320),l=i(53),u=i(52);t.exports=function(t,e,i,n,s,r){var o=l(t,!0,s,r),a=u(e,!0,s,r);return h(o,a,i,n,r)}},function(t,e,i){var h=i(21),l=i(146);t.exports=function(t,e,i,n,s,r){var o,a=h(t,e,i,n,null,r);if(void 0===s)for(s=[],o=0;o<a.length;o++)-1===s.indexOf(a[o].index)&&s.push(a[o].index);for(o=0;o<a.length;o++)a[o].index=l(s)}},function(t,e,i){var u=i(40),c=i(219);t.exports=function(t,e,i,n,s){if(!Array.isArray(t))return null;void 0===n&&(n=!0),Array.isArray(t[0])||(t=[t]);for(var r=t.length,o=t[0].length,a=0;a<r;a++)for(var h=0;h<o;h++){var l=t[a][h];c(l,e+h,i+a,!1,s)}n&&u(e-1,i-1,o+2,r+2,s)}},function(t,e,i){var h=i(219),l=i(53),u=i(52);t.exports=function(t,e,i,n,s,r){var o=l(e,!0,s,r),a=u(i,!0,s,r);return h(t,o,a,n,r)}},function(t,e,i){var o=i(321),a=i(53),h=i(52);t.exports=function(t,e,i,n){var s=a(t,!0,i,n),r=h(e,!0,i,n);return o(s,r,n)}},function(t,e,i){var c=i(21),d=i(53),f=i(52);t.exports=function(t,e,i,n,s,r,o){var a=d(t,!0,r,o),h=f(e,!0,r,o),l=Math.ceil(d(t+i,!1,r,o)),u=Math.ceil(f(e+n,!1,r,o));return c(a,h,l-a,u-h,s,o)}},function(t,e,i){var m=i(400),x=i(21),w=i(399),b=i(3),T=i(139),S=i(138),A=i(53),C=i(52),M=function(t,e){return w.RectangleToTriangle(e,t)};t.exports=function(t,e,i,n){if(void 0===t)return[];var s=b;t instanceof m.Circle?s=w.CircleToRectangle:t instanceof m.Rectangle?s=w.RectangleToRectangle:t instanceof m.Triangle?s=M:t instanceof m.Line&&(s=w.LineToRectangle);var r=A(t.left,!0,i,n),o=C(t.top,!0,i,n),a=Math.ceil(A(t.right,!1,i,n)),h=Math.ceil(C(t.bottom,!1,i,n)),l=Math.max(a-r,1),u=Math.max(h-o,1),c=x(r,o,l,u,e,n),d=n.tileWidth,f=n.tileHeight;n.tilemapLayer&&(d*=n.tilemapLayer.scaleX,f*=n.tilemapLayer.scaleY);for(var p=[],g=new m.Rectangle(0,0,d,f),v=0;v<c.length;v++){var y=c[v];g.x=T(y.x,i,n),g.y=S(y.y,i,n),s(t,g)&&p.push(y)}return p}},function(t,e,i){var a=i(140),h=i(53),l=i(52);t.exports=function(t,e,i,n,s){var r=h(t,!0,n,s),o=l(e,!0,n,s);return a(r,o,i,s)}},function(t,e,i){var h=i(21);t.exports=function(t,e,i,n,s,r,o,a){h(i,n,s,r,o,a).forEach(t,e)}},function(t,e,i){var h=i(21);t.exports=function(t,e,i,n,s,r,o,a){return h(i,n,s,r,o,a).find(t,e)||null}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=!1);var s,r,o,a=0;if(i){for(r=n.height-1;0<=r;r--)for(s=n.width-1;0<=s;s--)if((o=n.data[r][s])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;r<n.height;r++)for(s=0;s<n.width;s++)if((o=n.data[r][s])&&o.index===t){if(a===e)return o;a+=1}return null}},function(t,e,i){var h=i(21);t.exports=function(t,e,i,n,s,r,o,a){return h(i,n,s,r,o,a).filter(t,e)}},function(t,e,i){var u=i(21),c=i(40),d=i(67);t.exports=function(t,e,i,n,s,r,o){void 0===r&&(r=!0);for(var a=-1!==o.collideIndexes.indexOf(t),h=u(e,i,n,s,null,o),l=0;l<h.length;l++)h[l].index=t,d(h[l],a);r&&c(e-1,i-1,n+2,s+2,o)}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i=[]),i.length=0;var n=e.zoom,s=e.width/2,r=e.height/2;e.matrix.loadIdentity(),e.matrix.translate(e.x+s,e.y+r),e.matrix.rotate(e.rotation),e.matrix.scale(n,n),e.matrix.translate(-s,-r),e.matrix.invert(),e.shakeEffect.preRender();for(var o=t.tilemapLayer,a=t.tileWidth,h=t.tileHeight,l=e.scrollX*o.scrollFactorX-a,u=e.scrollY*o.scrollFactorY-h,c=l+(e.width+2*a),d=u+(e.height+2*h),f=t.data,p=t.width,g=t.height,v=e.matrix.matrix,y=v[0],m=v[1],x=v[2],w=v[3],b=v[4],T=v[5],S=l*y+u*x+b,A=l*m+u*w+T,C=c*y+d*x+b,M=c*m+d*w+T,_=0;_<g;++_)for(var E=0;E<p;++E){var P=f[_][E];if(null!==P&&-1!==P.index){var k=P.pixelX*y+P.pixelY*x+b,L=P.pixelX*m+P.pixelY*w+T;P.visible&&S<=k&&A<=L&&k+a<=C&&L+h<=M&&i.push(P)}}return i}},function(t,e,i){var d=i(139),f=i(138),p=i(21),g=i(322);t.exports=function(t,e,i,n,s,r){void 0===i&&(i={}),Array.isArray(t)||(t=[t]);var o=r.tilemapLayer;void 0===n&&(n=o.scene),void 0===s&&(s=n.cameras.main);var a,h=p(0,0,r.width,r.height,null,r),l=[];for(a=0;a<h.length;a++){var u=h[a];if(-1!==t.indexOf(u.index)){i.x=d(u.x,s,r),i.y=f(u.y,s,r);var c=n.make.sprite(i);l.push(c)}}if("number"==typeof e)for(a=0;a<t.length;a++)g(t[a],e,0,0,r.width,r.height,r);else if(Array.isArray(e))for(a=0;a<t.length;a++)g(t[a],e[a],0,0,r.width,r.height,r);return l}},function(t,e,i){var p=i(21),g=i(40);t.exports=function(t,e,i,n,s,r,o,a){t<0&&(t=0),e<0&&(e=0),void 0===o&&(o=!0);for(var h=p(t,e,i,n,null,a),l=s-t,u=r-e,c=0;c<h.length;c++){var d=h[c].x+l,f=h[c].y+u;0<=d&&d<a.width&&0<=f&&f<a.height&&a.data[f][d]&&a.data[f][d].copy(h[c])}o&&g(s-1,r-1,i+2,n+2,a)}},function(t,e,i){t.exports={Components:i(141),Parsers:i(638),Formats:i(26),ImageCollection:i(315),ParseToTilemap:i(216),Tile:i(66),Tilemap:i(311),TilemapCreator:i(621),TilemapFactory:i(620),Tileset:i(137),LayerData:i(104),MapData:i(103),ObjectLayer:i(313),DynamicTilemapLayer:i(310),StaticTilemapLayer:i(309)}},function(t,e,i){t.exports={BitmapMaskPipeline:i(260),FlatTintPipeline:i(259),ForwardDiffuseLightPipeline:i(148),TextureTintPipeline:i(129)}},function(t,e,i){t.exports={Utils:i(27),WebGLPipeline:i(84),WebGLRenderer:i(262),Pipelines:i(669),BYTE:0,SHORT:1,UNSIGNED_BYTE:2,UNSIGNED_SHORT:3,FLOAT:4}},function(t,e,i){t.exports={Canvas:i(265),WebGL:i(261)}},function(t,e,i){t.exports={BlitImage:i(266),CanvasRenderer:i(267),DrawImage:i(264),GetBlendModes:i(263)}},function(t,e,i){t.exports={Canvas:i(672),Snapshot:i(671),WebGL:i(670)}},function(t,e,i){var n={};t.exports=n;var s=i(221),r=(i(300),i(41));n.create=function(t){var e=s.create(),i={label:"World",gravity:{x:0,y:1,scale:.001},bounds:{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}};return r.extend(e,i,t)}},function(t,e,i){var a={};t.exports=a;var h=i(41);a._registry={},a.register=function(t){if(a.isPlugin(t)||h.warn("Plugin.register:",a.toString(t),"does not implement all required fields."),t.name in a._registry){var e=a._registry[t.name],i=a.versionParse(t.version).number,n=a.versionParse(e.version).number;n<i?(h.warn("Plugin.register:",a.toString(e),"was upgraded to",a.toString(t)),a._registry[t.name]=t):i<n?h.warn("Plugin.register:",a.toString(e),"can not be downgraded to",a.toString(t)):t!==e&&h.warn("Plugin.register:",a.toString(t),"is already registered to different plugin object")}else a._registry[t.name]=t;return t},a.resolve=function(t){return a._registry[a.dependencyParse(t).name]},a.toString=function(t){return"string"==typeof t?t:(t.name||"anonymous")+"@"+(t.version||t.range||"0.0.0")},a.isPlugin=function(t){return t&&t.name&&t.version&&t.install},a.isUsed=function(t,e){return-1<t.used.indexOf(e)},a.isFor=function(t,e){var i=t.for&&a.dependencyParse(t.for);return!t.for||e.name===i.name&&a.versionSatisfies(e.version,i.range)},a.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=a.dependencies(t),n=h.topologicalSort(i),s=[],r=0;r<n.length;r+=1)if(n[r]!==t.name){var o=a.resolve(n[r]);o?a.isUsed(t,o.name)||(a.isFor(o,t)||(h.warn("Plugin.use:",a.toString(o),"is for",o.for,"but installed on",a.toString(t)+"."),o._warned=!0),o.install?o.install(t):(h.warn("Plugin.use:",a.toString(o),"does not specify an install function."),o._warned=!0),o._warned?(s.push("🔶 "+a.toString(o)),delete o._warned):s.push("✅ "+a.toString(o)),t.used.push(o.name)):s.push("❌ "+n[r])}0<s.length&&!o.silent&&h.info(s.join(" "))}else h.warn("Plugin.use:",a.toString(t),"does not specify any dependencies to install.")},a.dependencies=function(n,t){var s=a.dependencyParse(n),e=s.name;if(!(e in(t=t||{}))){n=a.resolve(n)||n,t[e]=h.map(n.uses||[],function(t){a.isPlugin(t)&&a.register(t);var e=a.dependencyParse(t),i=a.resolve(t);return i&&!a.versionSatisfies(i.version,e.range)?(h.warn("Plugin.dependencies:",a.toString(i),"does not satisfy",a.toString(e),"used by",a.toString(s)+"."),i._warned=!0,n._warned=!0):i||(h.warn("Plugin.dependencies:",a.toString(t),"used by",a.toString(s),"could not be resolved."),n._warned=!0),e.name});for(var i=0;i<t[e].length;i+=1)a.dependencies(t[e][i],t);return t}},a.dependencyParse=function(t){return h.isString(t)?(/^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?))?$/.test(t)||h.warn("Plugin.dependencyParse:",t,"is not a valid dependency string."),{name:t.split("@")[0],range:t.split("@")[1]||"*"}):{name:t.name,range:t.range||t.version}},a.versionParse=function(t){/^\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?$/.test(t)||h.warn("Plugin.versionParse:",t,"is not a valid version or range.");var e=t.split("-");t=e[0];var i=isNaN(Number(t[0])),n=i?t.substr(1):t,s=h.map(n.split("."),function(t){return Number(t)});return{isRange:i,version:n,range:t,operator:i?t[0]:"",parts:s,prerelease:e[1],number:1e8*s[0]+1e4*s[1]+s[2]}},a.versionSatisfies=function(t,e){e=e||"*";var i=a.versionParse(e),n=i.parts,s=a.versionParse(t),r=s.parts;if(i.isRange){if("*"===i.operator||"*"===t)return!0;if("~"===i.operator)return r[0]===n[0]&&r[1]===n[1]&&r[2]>=n[2];if("^"===i.operator)return 0<n[0]?r[0]===n[0]&&s.number>=i.number:0<n[1]?r[1]===n[1]&&r[2]>=n[2]:r[2]===n[2]}return t===e||"*"===t}},function(t,e,i){var n=i(1013);n.Body=i(74),n.Composite=i(221),n.World=i(674),n.Detector=i(678),n.Grid=i(1012),n.Pairs=i(1011),n.Pair=i(610),n.Query=i(1033),n.Resolver=i(1010),n.SAT=i(677),n.Constraint=i(300),n.Common=i(41),n.Engine=i(1009),n.Events=i(301),n.Sleeping=i(331),n.Plugin=i(675),n.Bodies=i(166),n.Composites=i(1016),n.Axes=i(680),n.Bounds=i(125),n.Svg=i(1031),n.Vector=i(106),n.Vertices=i(126),n.World.add=n.Composite.add,n.World.remove=n.Composite.remove,n.World.addComposite=n.Composite.addComposite,n.World.addBody=n.Composite.addBody,n.World.addConstraint=n.Composite.addConstraint,n.World.clear=n.Composite.clear,t.exports=n},function(t,e,i){var n={};t.exports=n;var x=i(126),w=i(106);!function(){n.collides=function(t,e,i){var n,s,r,o,a=!1;if(i){var h=t.parent,l=e.parent,u=h.speed*h.speed+h.angularSpeed*h.angularSpeed+l.speed*l.speed+l.angularSpeed*l.angularSpeed;a=i&&i.collided&&u<.2,o=i}else o={collided:!1,bodyA:t,bodyB:e};if(i&&a){var c=o.axisBody,d=c===t?e:t,f=[c.axes[i.axisNumber]];if(r=y(c.vertices,d.vertices,f),o.reused=!0,r.overlap<=0)return o.collided=!1,o}else{if((n=y(t.vertices,e.vertices,t.axes)).overlap<=0)return o.collided=!1,o;if((s=y(e.vertices,t.vertices,e.axes)).overlap<=0)return o.collided=!1,o;n.overlap<s.overlap?(r=n,o.axisBody=t):(r=s,o.axisBody=e),o.axisNumber=r.axisNumber}o.bodyA=t.id<e.id?t:e,o.bodyB=t.id<e.id?e:t,o.collided=!0,o.depth=r.overlap,o.parentA=o.bodyA.parent,o.parentB=o.bodyB.parent,t=o.bodyA,e=o.bodyB,w.dot(r.axis,w.sub(e.position,t.position))<0?o.normal={x:r.axis.x,y:r.axis.y}:o.normal={x:-r.axis.x,y:-r.axis.y},o.tangent=w.perp(o.normal),o.penetration=o.penetration||{},o.penetration.x=o.normal.x*o.depth,o.penetration.y=o.normal.y*o.depth;var p=m(t,e,o.normal),g=[];if(x.contains(t.vertices,p[0])&&g.push(p[0]),x.contains(t.vertices,p[1])&&g.push(p[1]),g.length<2){var v=m(e,t,w.neg(o.normal));x.contains(e.vertices,v[0])&&g.push(v[0]),g.length<2&&x.contains(e.vertices,v[1])&&g.push(v[1])}return g.length<1&&(g=[p[0]]),o.supports=g,o};var y=function(t,e,i){for(var n,s,r=w._temp[0],o=w._temp[1],a={overlap:Number.MAX_VALUE},h=0;h<i.length;h++){if(s=i[h],l(r,t,s),l(o,e,s),(n=Math.min(r.max-o.min,o.max-r.min))<=0)return a.overlap=n,a;n<a.overlap&&(a.overlap=n,a.axis=s,a.axisNumber=h)}return a},l=function(t,e,i){for(var n=w.dot(e[0],i),s=n,r=1;r<e.length;r+=1){var o=w.dot(e[r],i);s<o?s=o:o<n&&(n=o)}t.min=n,t.max=s},m=function(t,e,i){for(var n,s,r,o,a=Number.MAX_VALUE,h=w._temp[0],l=e.vertices,u=t.position,c=0;c<l.length;c++)s=l[c],h.x=s.x-u.x,h.y=s.y-u.y,(n=-w.dot(i,h))<a&&(a=n,r=s);return s=l[0<=r.index-1?r.index-1:l.length-1],h.x=s.x-u.x,h.y=s.y-u.y,a=-w.dot(i,h),o=s,s=l[(r.index+1)%l.length],h.x=s.x-u.x,h.y=s.y-u.y,(n=-w.dot(i,h))<a&&(o=s),[r,o]}}()},function(t,e,i){var g={};t.exports=g;var v=i(677),y=i(610),m=i(125);g.collisions=function(t,e){for(var i=[],n=e.pairs.table,s=e.metrics,r=0;r<t.length;r++){var o=t[r][0],a=t[r][1];if((!o.isStatic&&!o.isSleeping||!a.isStatic&&!a.isSleeping)&&g.canCollide(o.collisionFilter,a.collisionFilter)&&(s.midphaseTests+=1,m.overlaps(o.bounds,a.bounds)))for(var h=1<o.parts.length?1:0;h<o.parts.length;h++)for(var l=o.parts[h],u=1<a.parts.length?1:0;u<a.parts.length;u++){var c=a.parts[u];if(l===o&&c===a||m.overlaps(l.bounds,c.bounds)){var d,f=n[y.id(l,c)];d=f&&f.isActive?f.collision:null;var p=v.collides(l,c,d);s.narrowphaseTests+=1,p.reused&&(s.narrowReuseCount+=1),p.collided&&(i.push(p),s.narrowDetections+=1)}}}return i},g.canCollide=function(t,e){return t.group===e.group&&0!==t.group?0<t.group:0!=(t.mask&e.category)&&0!=(e.mask&t.category)}},function(t,e,i){var m=i(166),x=i(74),n=i(0),s=i(611),w=i(1),b=i(111),T=i(126),r=new n({Mixins:[s.Bounce,s.Collision,s.Friction,s.Gravity,s.Mass,s.Sensor,s.Sleep,s.Static],initialize:function(t,e,i){this.tile=e,this.world=t,e.physics.matterBody&&e.physics.matterBody.destroy(),e.physics.matterBody=this;var n=w(i,"body",null),s=w(i,"addToWorld",!0);if(n)this.setBody(n,s);else{var r=e.getCollisionGroup();0<w(r,"objects",[]).length?this.setFromTileCollision(i):this.setFromTileRectangle(i)}},setFromTileRectangle:function(t){void 0===t&&(t={}),b(t,"isStatic")||(t.isStatic=!0),b(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,n=e.y+e.height/2,s=m.rectangle(i,n,e.width,e.height,t);return this.setBody(s,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),b(t,"isStatic")||(t.isStatic=!0),b(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,n=this.tile.getLeft(),s=this.tile.getTop(),r=this.tile.getCollisionGroup(),o=w(r,"objects",[]),a=[],h=0;h<o.length;h++){var l=o[h],u=n+l.x*e,c=s+l.y*i,d=l.width*e,f=l.height*i,p=null;if(l.rectangle)p=m.rectangle(u+d/2,c+f/2,d,f,t);else if(l.ellipse)p=m.circle(u+d/2,c+f/2,d/2,t);else if(l.polygon||l.polyline){var g=(l.polygon?l.polygon:l.polyline).map(function(t){return{x:t.x*e,y:t.y*i}}),v=T.create(g);if(T.isConvex(g)){var y=T.centre(v);u+=y.x,c+=y.y}p=m.fromVertices(u,c,v,t)}p&&a.push(p)}return 1===a.length?this.setBody(a[0],t.addToWorld):1<a.length&&(t.parts=a,this.setBody(x.create(t),t.addToWorld)),this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0}});t.exports=r},function(t,e,i){var n={};t.exports=n;var o=i(106),a=i(41);n.fromVertices=function(t){for(var e={},i=0;i<t.length;i++){var n=(i+1)%t.length,s=o.normalise({x:t[n].y-t[i].y,y:t[i].x-t[n].x}),r=0===s.y?1/0:s.x/s.y;e[r=r.toFixed(3).toString()]=s}return a.values(e)},n.rotate=function(t,e){if(0!==e)for(var i=Math.cos(e),n=Math.sin(e),s=0;s<t.length;s++){var r,o=t[s];r=o.x*i-o.y*n,o.y=o.x*n+o.y*i,o.x=r}}},function(t,e,i){t.exports={Acceleration:i(1065),BodyScale:i(1064),BodyType:i(1063),Bounce:i(1062),CheckAgainst:i(1061),Collides:i(1060),Debug:i(1059),Friction:i(1058),Gravity:i(1057),Offset:i(1056),SetGameObject:i(1055),Velocity:i(1054)}},function(t,e,i){var u=i(336);t.exports=function(t,e,i,n){var s=u(t,e,i,n);if(i||0===s||t.immovable&&e.immovable||t.customSeparateY||e.customSeparateY)return 0!==s||t.embedded&&e.embedded;var r=t.velocity.y,o=e.velocity.y;if(t.immovable||e.immovable)t.immovable?(e.y+=s,e.velocity.y=r-o*e.bounce.y,t.moves&&(e.x+=(t.x-t.prev.x)*t.friction.x)):(t.y-=s,t.velocity.y=o-r*t.bounce.y,e.moves&&(t.x+=(e.x-e.prev.x)*e.friction.x));else{s*=.5,t.y-=s,e.y+=s;var a=Math.sqrt(o*o*e.mass/t.mass)*(0<o?1:-1),h=Math.sqrt(r*r*t.mass/e.mass)*(0<r?1:-1),l=.5*(a+h);a-=l,h-=l,t.velocity.y=l+a*t.bounce.y,e.velocity.y=l+h*e.bounce.y}return!0}},function(t,e,i){var u=i(337);t.exports=function(t,e,i,n){var s=u(t,e,i,n);if(i||0===s||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==s||t.embedded&&e.embedded;var r=t.velocity.x,o=e.velocity.x;if(t.immovable||e.immovable)t.immovable?(e.x+=s,e.velocity.x=r-o*e.bounce.x,t.moves&&(e.y+=(t.y-t.prev.y)*t.friction.y)):(t.x-=s,t.velocity.x=o-r*t.bounce.x,e.moves&&(t.y+=(e.y-e.prev.y)*e.friction.y));else{s*=.5,t.x-=s,e.x+=s;var a=Math.sqrt(o*o*e.mass/t.mass)*(0<o?1:-1),h=Math.sqrt(r*r*t.mass/e.mass)*(0<r?1:-1),l=.5*(a+h);a-=l,h-=l,t.velocity.x=l+a*t.bounce.x,e.velocity.x=l+h*e.bounce.x}return!0}},function(t,e){t.exports=function(t,e){e<0?t.blocked.up=!0:0<e&&(t.blocked.down=!0),t.position.y-=e,0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},function(t,e,i){var o=i(684);t.exports=function(t,e,i,n,s){var r=0;return t.deltaY()<0&&!t.blocked.up&&e.collideDown&&t.checkCollision.up?e.faceBottom&&t.y<n&&(r=t.y-n)<-s&&(r=0):0<t.deltaY()&&!t.blocked.down&&e.collideUp&&t.checkCollision.down&&e.faceTop&&t.bottom>i&&s<(r=t.bottom-i)&&(r=0),0!==r&&(t.customSeparateY?t.overlapY=r:o(t,r)),r}},function(t,e){t.exports=function(t,e){e<0?t.blocked.left=!0:0<e&&(t.blocked.right=!0),t.position.x-=e,0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},function(t,e,i){var o=i(686);t.exports=function(t,e,i,n,s){var r=0;return t.deltaX()<0&&!t.blocked.left&&e.collideRight&&t.checkCollision.left?e.faceRight&&t.x<n&&(r=t.x-n)<-s&&(r=0):0<t.deltaX()&&!t.blocked.right&&e.collideLeft&&t.checkCollision.right&&e.faceLeft&&t.right>i&&s<(r=t.right-i)&&(r=0),0!==r&&(t.customSeparateX?t.overlapX=r:o(t,r)),r}},function(t,e,i){var v=i(687),y=i(685),m=i(335);t.exports=function(t,e,i,n,s,r){var o=n.left,a=n.top,h=n.right,l=n.bottom,u=i.faceLeft||i.faceRight,c=i.faceTop||i.faceBottom;if(!u&&!c)return!1;var d=0,f=0,p=0,g=1;if(e.deltaAbsX()>e.deltaAbsY()?p=-1:e.deltaAbsX()<e.deltaAbsY()&&(g=-1),0!==e.deltaX()&&0!==e.deltaY()&&u&&c&&(p=Math.min(Math.abs(e.position.x-h),Math.abs(e.right-o)),g=Math.min(Math.abs(e.position.y-l),Math.abs(e.bottom-a))),p<g){if(u&&0!==(d=v(e,i,o,h,r))&&!m(n,e))return!0;c&&(f=y(e,i,a,l,r))}else{if(c&&0!==(f=y(e,i,a,l,r))&&!m(n,e))return!0;u&&(d=v(e,i,o,h,r))}return 0!==d||0!==f}},function(t,e){t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},function(t,e){t.exports={setVelocity:function(t,e){return this.body.velocity.set(t,e),this},setVelocityX:function(t){return this.body.velocity.x=t,this},setVelocityY:function(t){return this.body.velocity.y=t,this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},function(t,e){t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},function(t,e){t.exports={setMass:function(t){return this.body.mass=t,this}}},function(t,e){var i={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}};t.exports=i},function(t,e){t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},function(t,e){t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},function(t,e){var i={enableBody:function(t,e,i,n,s){return t&&this.body.reset(e,i),n&&(this.body.gameObject.active=!0),s&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};t.exports=i},function(t,e){t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},function(t,e){t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},function(t,e){t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t){return this.body.collideWorldBounds=t,this}}},function(t,e){t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},function(t,e){t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},function(t,e,i){var n=i(0),s=i(38),l=i(58),r=i(345),o=i(1),a=i(94),h=i(12),u=i(6),c=i(340),d=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.world=new c(this.scene,this.config),this.add=new r(this.world),this.systems.events.once("destroy",this.destroy,this)},start:function(){this.world||(this.world=new c(this.scene,this.config),this.add=new r(this.world));var t=this.systems.events;t.on("update",this.world.update,this.world),t.on("postupdate",this.world.postUpdate,this.world),t.once("shutdown",this.shutdown,this)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return a(o(e,"arcade",{}),o(t,"arcade",{}))},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.world.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.world.collideObjects(t,e,i,n,s,!1)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,n,s,r){void 0===n&&(n=60);var o=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(o,n),void 0!==s&&void 0!==r&&t.body.maxVelocity.set(s,r),o},accelerateToObject:function(t,e,i,n,s){return this.accelerateTo(t,e.x,e.y,i,n,s)},closest:function(t){for(var e=this.tree.all(),i=Number.MAX_VALUE,n=null,s=t.x,r=t.y,o=e.length-1;0<=o;o--){var a=e[o],h=l(s,r,a.x,a.y);h<i&&(n=a,i=h)}return n},furthest:function(t){for(var e=this.tree.all(),i=-1,n=null,s=t.x,r=t.y,o=e.length-1;0<=o;o--){var a=e[o],h=l(s,r,a.x,a.y);i<h&&(n=a,i=h)}return n},moveTo:function(t,e,i,n,s){void 0===n&&(n=60),void 0===s&&(s=0);var r=Math.atan2(i-t.y,e-t.x);return 0<s&&(n=l(t.x,t.y,e,i)/(s/1e3)),t.body.velocity.setToPolar(r,n),r},moveToObject:function(t,e,i,n){return this.moveTo(t,e.x,e.y,i,n)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new u),i.setToPolar(s(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new u),i.setToPolar(t,e)},shutdown:function(){var t=this.systems.events;t.off("update",this.world.update,this.world),t.off("postupdate",this.world.postUpdate,this.world),t.off("shutdown",this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});h.register("ArcadePhysics",d,"arcadePhysics"),t.exports=d},function(t,e,i){var n=i(42),s=i(17),r={ArcadePhysics:i(702),Body:i(339),Collider:i(338),Factory:i(345),Group:i(342),Image:i(344),Sprite:i(142),StaticBody:i(334),StaticGroup:i(341),World:i(340)};r=s(!1,r,n),t.exports=r},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),n*=Math.PI/t;for(var s=[],r=[],o=0;o<t;o++)e+=(i-=e*n)*n,s[o]=i,r[o]=e;return{sin:r,cos:s,length:t}}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.round(t*n)/n}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=e+1);var s=(t-e)/(i-e);return 1<s?void 0!==n?(s=(n-t)/(n-i))<0&&(s=0):s=1:s<0&&(s=0),s}},function(t,e){t.exports=function(t,e,i){return Math.max(t-e,i)}},function(t,e){t.exports=function(t,e,i){return Math.min(t+e,i)}},function(t,e){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t,e){return t/e/1e3}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.floor(t*n)/n}},function(t,e){t.exports=function(t,e){return Math.abs(t-e)}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.ceil(t*n)/n}},function(t,e){t.exports=function(t){for(var e=0,i=0;i<t.length;i++)e+=+t[i];return e/t.length}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=0),0===e?t:(t-=i,i+(t=e*Math.round(t/e)))}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=0),0===e?t:(t-=i,i+(t=e*Math.floor(t/e)))}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=0),0===e?t:(t-=i,i+(t=e*Math.ceil(t/e)))}},function(t,e,i){t.exports={Ceil:i(720),Floor:i(719),To:i(718)}},function(t,e){t.exports=function(t){return 0<t&&0==(t&t-1)}},function(t,e,i){t.exports={GetNext:i(411),IsSize:i(85),IsValue:i(722)}},function(t,e,i){var n=i(287);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){var n=i(286);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){var r=i(122);t.exports=function(t,e){var i=t.length-1,n=i*e,s=Math.floor(n);return e<0?r(t[0],t[1],n):1<e?r(t[i],t[i-1],i-n):r(t[s],t[i<s+1?i:s+1],n-s)}},function(t,e,i){var r=i(273);t.exports=function(t,e){var i=t.length-1,n=i*e,s=Math.floor(n);return t[0]===t[i]?(e<0&&(s=Math.floor(n=i*(1+e))),r(n-s,t[(s-1+i)%i],t[s],t[(s+1)%i],t[(s+2)%i])):e<0?t[0]-(r(-n,t[0],t[0],t[1],t[1])-t[0]):1<e?t[i]-(r(n-i,t[i],t[i],t[i-1],t[i-1])-t[i]):r(n-s,t[s?s-1:0],t[s],t[i<s+1?i:s+1],t[i<s+2?i:s+2])}},function(t,e,i){var r=i(348);t.exports=function(t,e){for(var i=0,n=t.length-1,s=0;s<=n;s++)i+=Math.pow(1-e,n-s)*Math.pow(e,s)*t[s]*r(n,s);return i}},function(t,e,i){t.exports={Bezier:i(728),CatmullRom:i(727),CubicBezier:i(550),Linear:i(726),QuadraticBezier:i(546),SmoothStep:i(725),SmootherStep:i(724)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},function(t,e,i){t.exports={Ceil:i(731),Equal:i(351),Floor:i(730),GreaterThan:i(350),LessThan:i(349)}},function(t,e,i){t.exports={Back:i(247),Bounce:i(246),Circular:i(245),Cubic:i(244),Elastic:i(243),Expo:i(242),Linear:i(241),Quadratic:i(240),Quartic:i(239),Quintic:i(238),Sine:i(237),Stepped:i(236)}},function(t,e){t.exports=function(t,e,i,n){var s=t-i,r=e-n;return s*s+r*r}},function(t,e){t.exports=function(t,e,i,n,s){return void 0===s&&(s=2),Math.sqrt(Math.pow(i-t,s)+Math.pow(n-e,s))}},function(t,e,i){t.exports={Between:i(58),Power:i(735),Squared:i(734)}},function(t,e){t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},function(t,e,i){var n=i(16);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(e<t?e+=n.PI2:e-=n.PI2),t<e?t+=i:e<t&&(t-=i))),t}},function(t,e,i){var n=i(352);t.exports=function(t){return n(t+Math.PI)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},function(t,e){t.exports=function(t,e,i,n){return Math.atan2(i-t,n-e)}},function(t,e){t.exports=function(t,e,i,n){return Math.atan2(n-e,i-t)}},function(t,e,i){t.exports={Between:i(743),BetweenY:i(742),BetweenPoints:i(741),BetweenPointsY:i(740),Reverse:i(739),RotateTo:i(738),ShortestBetween:i(737),Normalize:i(352),Wrap:i(212),WrapDegrees:i(211)}},function(t,e,i){var n=i(16),s=i(17),r={Angle:i(744),Distance:i(736),Easing:i(733),Fuzzy:i(732),Interpolation:i(729),Pow2:i(723),Snap:i(721),RandomDataGenerator:i(297),Average:i(717),Bernstein:i(348),Between:i(149),CatmullRom:i(273),CeilTo:i(716),Clamp:i(23),DegToRad:i(38),Difference:i(715),Factorial:i(347),FloatBetween:i(248),FloorTo:i(714),FromPercent:i(65),GetSpeed:i(713),IsEven:i(712),IsEvenStrict:i(711),Linear:i(122),MaxAdd:i(710),MinSub:i(709),Percent:i(708),RadToDeg:i(150),RandomXY:i(707),RandomXYZ:i(561),RandomXYZW:i(560),Rotate:i(346),RotateAround:i(292),RotateAroundDistance:i(288),RoundAwayFromZero:i(255),RoundTo:i(706),SinCosTableGenerator:i(705),SmootherStep:i(287),SmoothStep:i(286),TransformXY:i(257),Within:i(704),Wrap:i(39),Vector2:i(6),Vector3:i(87),Vector4:i(277),Matrix3:i(557),Matrix4:i(278),Quaternion:i(558),RotateVec3:i(559)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(0),s=i(7),l=i(1),u=i(37),c=i(8),d=i(36),f=i(224),a=new n({Extends:d,initialize:function(t,e,i,n,s,r){var o,a;if(c(e)){var h=e;o=new u(t,{key:e,url:l(h,"textureURL"),extension:l(h,"textureExtension","png"),normalMap:l(h,"normalMap"),xhrSettings:l(h,"textureXhrSettings")}),a=new f(t,{key:e,url:l(h,"atlasURL"),extension:l(h,"atlasExtension","txt"),xhrSettings:l(h,"atlasXhrSettings")})}else o=new u(t,e,i,s),a=new f(t,e,n,r);o.linkFile?d.call(this,t,"unityatlas",e,[o,a,o.linkFile]):d.call(this,t,"unityatlas",e,[o,a])},addToCache:function(){if(0===this.failed&&!this.complete){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});s.register("unityAtlas",function(t,e,i,n,s){var r;if(Array.isArray(t))for(var o=0;o<t.length;o++)r=new a(this,t[o]),this.addFile(r.files);else r=new a(this,t,e,i,n,s),this.addFile(r.files);return this}),t.exports=a},function(t,e,i){var n=i(0),s=i(7),r=i(28),o=i(26),a=new n({Extends:r,initialize:function(t,e,i,n){r.call(this,t,e,i,n),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.TILED_JSON,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});s.register("tilemapTiledJSON",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new a(this,t[n]));else this.addFile(new a(this,t,e,i));return this}),t.exports=a},function(t,e,i){var n=i(0),s=i(7),r=i(28),o=i(26),a=new n({Extends:r,initialize:function(t,e,i,n){r.call(this,t,e,i,n),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.WELTMEISTER,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});s.register("tilemapImpact",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new a(this,t[n]));else this.addFile(new a(this,t,e,i));return this}),t.exports=a},function(t,e,i){var n=i(0),s=i(18),a=i(19),r=i(7),h=i(1),l=i(8),u=i(26),o=new n({Extends:a,initialize:function(t,e,i,n){var s="csv";if(l(e)){var r=e;e=h(r,"key"),i=h(r,"url"),n=h(r,"xhrSettings"),s=h(r,"extension",s)}var o={type:"tilemapCSV",cache:t.cacheManager.tilemap,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};a.call(this,t,o),this.tilemapFormat=u.CSV},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});r.register("tilemapCSV",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new o(this,t[n]));else this.addFile(new o(this,t,e,i));return this}),t.exports=o},function(t,e,i){var n=i(0),s=i(18),a=i(19),r=i(7),h=i(1),l=i(8),o=new n({Extends:a,initialize:function(t,e,i,n){var s="svg";if(l(e)){var r=e;e=h(r,"key"),i=h(r,"url"),n=h(r,"xhrSettings"),s=h(r,"extension",s)}var o={type:"svg",cache:t.textureManager,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};a.call(this,t,o)},onProcess:function(){this.state=s.FILE_PROCESSING;var t=[this.xhrLoader.responseText];try{var e=new window.Blob(t,{type:"image/svg+xml;charset=utf-8"})}catch(t){return void this.onProcessError()}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var i=this,n=!1;this.data.onload=function(){n||a.revokeObjectURL(i.data),i.onProcessComplete()},this.data.onerror=function(){n?i.onProcessError():(n=!0,a.revokeObjectURL(i.data),i.data.src="data:image/svg+xml,"+encodeURIComponent(t.join("")))},a.createObjectURL(this.data,e,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});r.register("svg",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new o(this,t[n]));else this.addFile(new o(this,t,e,i));return this}),t.exports=o},function(t,e,i){var n=i(0),l=i(18),u=i(19),s=i(7),c=i(1),d=i(8),o=new n({Extends:u,initialize:function(t,e,i,n,s,r){var o="js";if(d(e)){var a=e;e=c(a,"key"),i=c(a,"url"),r=c(a,"xhrSettings"),o=c(a,"extension",o),n=c(a,"systemKey"),s=c(a,"sceneKey")}var h={type:"scenePlugin",cache:!1,extension:o,responseType:"text",key:e,url:i,xhrSettings:r,config:{systemKey:n,sceneKey:s}};u.call(this,t,h),"function"==typeof i&&(this.data=i,this.state=l.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=this.key,n=c(e,"systemKey",i),s=c(e,"sceneKey",i);this.state===l.FILE_POPULATED?t.installScenePlugin(n,this.data,s,this.loader.scene):(this.state=l.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),t.installScenePlugin(n,window[this.key],s,this.loader.scene)),this.onProcessComplete()}});s.register("scenePlugin",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new o(this,t[r]));else this.addFile(new o(this,t,e,i,n,s));return this}),t.exports=o},function(t,e,i){var n=i(0),s=i(18),r=i(7),o=i(28),a=new n({Extends:o,initialize:function(t,e,i,n,s){o.call(this,t,e,i,n,s),this.type="packfile"},onProcess:function(){this.state!==s.FILE_POPULATED&&(this.state=s.FILE_PROCESSING,this.data=JSON.parse(this.xhrLoader.responseText)),this.loader.addPack(this.data,this.config),this.onProcessComplete()}});r.register("pack",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new a(this,t[s]));else this.addFile(new a(this,t,e,n,i));return this}),t.exports=a},function(t,e,i){var n=i(0),o=i(18),l=i(19),s=i(7),u=i(1),c=i(8),a=new n({Extends:l,initialize:function(t,e,i,n,s,r){void 0===n&&(n=512),void 0===s&&(s=512);var o="html";if(c(e)){var a=e;e=u(a,"key"),i=u(a,"url"),r=u(a,"xhrSettings"),o=u(a,"extension",o),n=u(a,"width",n),s=u(a,"height",s)}var h={type:"html",cache:t.textureManager,extension:o,responseType:"text",key:e,url:i,xhrSettings:r,config:{width:n,height:s}};l.call(this,t,h)},onProcess:function(){this.state=o.FILE_PROCESSING;var t=this.config.width,e=this.config.height,i=[];i.push('<svg width="'+t+'px" height="'+e+'px" viewBox="0 0 '+t+" "+e+'" xmlns="http://www.w3.org/2000/svg">'),i.push('<foreignObject width="100%" height="100%">'),i.push('<body xmlns="http://www.w3.org/1999/xhtml">'),i.push(this.xhrLoader.responseText),i.push("</body>"),i.push("</foreignObject>"),i.push("</svg>");var n=[i.join("\n")],s=this;try{var r=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return s.state=o.FILE_ERRORED,void s.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){l.revokeObjectURL(s.data),s.onProcessComplete()},this.data.onerror=function(){l.revokeObjectURL(s.data),s.onProcessError()},l.createObjectURL(this.data,r,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});s.register("html",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new a(this,t[r]));else this.addFile(new a(this,t,e,i,n,s));return this}),t.exports=a},function(t,e,i){var n=i(0),s=i(18),a=i(19),r=i(7),h=i(1),l=i(8),o=new n({Extends:a,initialize:function(t,e,i,n){var s="glsl";if(l(e)){var r=e;e=h(r,"key"),i=h(r,"url"),n=h(r,"xhrSettings"),s=h(r,"extension",s)}var o={type:"glsl",cache:t.cacheManager.shader,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};a.call(this,t,o)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});r.register("glsl",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new o(this,t[n]));else this.addFile(new o(this,t,e,i));return this}),t.exports=o},function(t,e,i){var n=i(0),s=i(7),l=i(1),u=i(37),c=i(8),d=i(36),r=i(474),f=i(143),a=new n({Extends:d,initialize:function(t,e,i,n,s,r){var o,a;if(c(e)){var h=e;e=l(h,"key"),o=new u(t,{key:e,url:l(h,"textureURL"),extension:l(h,"textureExtension","png"),normalMap:l(h,"normalMap"),xhrSettings:l(h,"textureXhrSettings")}),a=new f(t,{key:e,url:l(h,"fontDataURL"),extension:l(h,"fontDataExtension","xml"),xhrSettings:l(h,"fontDataXhrSettings")})}else o=new u(t,e,i,s),a=new f(t,e,n,r);o.linkFile?d.call(this,t,"bitmapfont",e,[o,a,o.linkFile]):d.call(this,t,"bitmapfont",e,[o,a])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.addToCache(),this.loader.cacheManager.bitmapFont.add(t.key,{data:r(e.data),texture:t.key,frame:null}),this.complete=!0}}});s.register("bitmapFont",function(t,e,i,n,s){var r;if(Array.isArray(t))for(var o=0;o<t.length;o++)r=new a(this,t[o]),this.addFile(r.files);else r=new a(this,t,e,i,n,s),this.addFile(r.files);return this}),t.exports=a},function(t,e,i){var n=i(0),s=i(18),h=i(19),r=i(7),l=i(1),u=i(8),o=new n({Extends:h,initialize:function(t,e,i,n,s){var r="bin";if(u(e)){var o=e;e=l(o,"key"),i=l(o,"url"),n=l(o,"xhrSettings"),r=l(o,"extension",r),s=l(o,"dataType",s)}var a={type:"binary",cache:t.cacheManager.binary,extension:r,responseType:"arraybuffer",key:e,url:i,xhrSettings:n,config:{dataType:s}};h.call(this,t,a)},onProcess:function(){this.state=s.FILE_PROCESSING;var t=this.config.dataType;this.data=t?new t(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});r.register("binary",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new o(this,t[s]));else this.addFile(new o(this,t,e,n,i));return this}),t.exports=o},function(t,e,i){var n=i(0),s=i(7),l=i(1),u=i(37),c=i(8),d=i(36),f=i(143),a=new n({Extends:d,initialize:function(t,e,i,n,s,r){var o,a;if(c(e)){var h=e;e=l(h,"key"),o=new u(t,{key:e,url:l(h,"textureURL"),extension:l(h,"textureExtension","png"),normalMap:l(h,"normalMap"),xhrSettings:l(h,"textureXhrSettings")}),a=new f(t,{key:e,url:l(h,"atlasURL"),extension:l(h,"atlasExtension","xml"),xhrSettings:l(h,"atlasXhrSettings")})}else o=new u(t,e,i,s),a=new f(t,e,n,r);o.linkFile?d.call(this,t,"atlasxml",e,[o,a,o.linkFile]):d.call(this,t,"atlasxml",e,[o,a])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});s.register("atlasXML",function(t,e,i,n,s){var r;if(Array.isArray(t))for(var o=0;o<t.length;o++)r=new a(this,t[o]),this.addFile(r.files);else r=new a(this,t,e,i,n,s),this.addFile(r.files);return this}),t.exports=a},function(t,e,i){t.exports={AnimationJSONFile:i(360),AtlasJSONFile:i(359),AtlasXMLFile:i(757),AudioFile:i(168),AudioSpriteFile:i(358),BinaryFile:i(756),BitmapFontFile:i(755),GLSLFile:i(754),HTML5AudioFile:i(167),HTMLFile:i(753),ImageFile:i(37),JSONFile:i(28),MultiAtlasFile:i(357),PackFile:i(752),PluginFile:i(356),ScenePluginFile:i(751),ScriptFile:i(355),SpriteSheetFile:i(354),SVGFile:i(750),TextFile:i(224),TilemapCSVFile:i(749),TilemapImpactFile:i(748),TilemapJSONFile:i(747),UnityAtlasFile:i(746),XMLFile:i(143)}},function(t,e,i){var n=i(18),s=i(17),r={FileTypes:i(758),File:i(19),FileTypesManager:i(7),GetURL:i(108),LoaderPlugin:i(353),MergeXHRSettings:i(107),MultiFile:i(36),XHRLoader:i(169),XHRSettings:i(75)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(225);t.exports=function(t,e,i){return n(t,e.x,e.y,i)}},function(t,e,i){var n=i(225),s=i(384);t.exports=function(t,e){var i=s(t);return n(t,i.x,i.y,e)}},function(t,e,i){var s=i(71);t.exports=function(t){var e=t.getLineA(),i=t.getLineB(),n=t.getLineC();return s(e)+s(i)+s(n)}},function(t,e){t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2&&t.x3===e.x3&&t.y3===e.y3}},function(t,e){t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},function(t,e,i){var n=i(60);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(68);t.exports=function(t){return new n(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},function(t,e,i){var x=i(88);t.exports=function(t,e){void 0===e&&(e=new x);var i,n,s=t.x1,r=t.y1,o=t.x2,a=t.y2,h=t.x3,l=t.y3,u=o-s,c=a-r,d=h-s,f=l-r,p=u*(s+o)+c*(r+a),g=d*(s+h)+f*(r+l),v=2*(u*(l-a)-c*(h-o));if(Math.abs(v)<1e-6){var y=Math.min(s,o,h),m=Math.min(r,a,l);i=.5*(Math.max(s,o,h)-y),n=.5*(Math.max(r,a,l)-m),e.x=y+i,e.y=m+n,e.radius=Math.sqrt(i*i+n*n)}else e.x=(f*p-c*g)/v,e.y=(u*g-d*p)/v,i=e.x-s,n=e.y-r,e.radius=Math.sqrt(i*i+n*n);return e}},function(t,e,i){var c=i(6);function d(t,e,i,n){return t*n-e*i}t.exports=function(t,e){void 0===e&&(e=new c);var i=t.x3,n=t.y3,s=t.x1-i,r=t.y1-n,o=t.x2-i,a=t.y2-n,h=2*d(s,r,o,a),l=d(r,s*s+r*r,a,o*o+a*a),u=d(s,s*s+r*r,o,o*o+a*a);return e.x=i-l/h,e.y=n+u/h,e}},function(t,e,i){var a=i(386),h=i(385);t.exports=function(t,e,i,n){void 0===n&&(n=a);var s=n(t),r=e-s.x,o=i-s.y;return h(t,r,o)}},function(t,e,i){var s=i(68);t.exports=function(t,e,i,n){return void 0===n&&(n=i),new s(t,e,t,e-n,t+i,e)}},function(t,e,i){var v=i(258),y=i(68);t.exports=function(t,e,i,n,s){void 0===e&&(e=null),void 0===i&&(i=1),void 0===n&&(n=1),void 0===s&&(s=[]);for(var r,o,a,h,l,u,c,d,f,p=v(t,e),g=0;g<p.length;g+=3)r=p[g],o=p[g+1],a=p[g+2],h=t[2*r]*i,l=t[2*r+1]*n,u=t[2*o]*i,c=t[2*o+1]*n,d=t[2*a]*i,f=t[2*a+1]*n,s.push(new y(h,l,u,c,d,f));return s}},function(t,e,i){var s=i(68);t.exports=function(t,e,i){var n=i*(Math.sqrt(3)/2);return new s(t,e,t+i/2,e+n,t-i/2,e+n)}},function(t,e){t.exports=function(t){var e=t.x1,i=t.y1,n=t.x2,s=t.y2,r=t.x3,o=t.y3;return Math.abs(((r-e)*(s-i)-(n-e)*(o-i))/2)}},function(t,e,i){var n=i(68);n.Area=i(773),n.BuildEquilateral=i(772),n.BuildFromPolygon=i(771),n.BuildRight=i(770),n.CenterOn=i(769),n.Centroid=i(386),n.CircumCenter=i(768),n.CircumCircle=i(767),n.Clone=i(766),n.Contains=i(60),n.ContainsArray=i(231),n.ContainsPoint=i(765),n.CopyFrom=i(764),n.Decompose=i(394),n.Equals=i(763),n.GetPoint=i(227),n.GetPoints=i(226),n.InCenter=i(384),n.Perimeter=i(762),n.Offset=i(385),n.Random=i(153),n.Rotate=i(761),n.RotateAroundPoint=i(760),n.RotateAroundXY=i(225),t.exports=n},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=e),t.width*=e,t.height*=i,t}},function(t,e,i){var n=i(149),s=i(387),r=i(5);t.exports=function(t,e,i){if(void 0===i&&(i=new r),s(t,e))switch(n(0,3)){case 0:i.x=t.x+Math.random()*(e.right-t.x),i.y=t.y+Math.random()*(e.top-t.y);break;case 1:i.x=e.x+Math.random()*(t.right-e.x),i.y=e.bottom+Math.random()*(t.bottom-e.bottom);break;case 2:i.x=t.x+Math.random()*(e.x-t.x),i.y=e.y+Math.random()*(t.bottom-e.y);break;case 3:i.x=e.right+Math.random()*(t.right-e.right),i.y=t.y+Math.random()*(e.bottom-t.y)}return i}},function(t,e,i){var a=i(5),h=i(38);t.exports=function(t,e,i){void 0===i&&(i=new a),e=h(e);var n=Math.sin(e),s=Math.cos(e),r=0<s?t.width/2:t.width/-2,o=0<n?t.height/2:t.height/-2;return Math.abs(r*n)<Math.abs(o*s)?o=r*n/s:r=o*s/n,i.x=r+t.centerX,i.y=o+t.centerY,i}},function(t,e){t.exports=function(t,e){return t.x<e.right&&t.right>e.x&&t.y<e.bottom&&t.bottom>e.y}},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){t.exports=function(t,e,i){var n=Math.min(t.x,e),s=Math.max(t.right,e);t.x=n,t.width=s-n;var r=Math.min(t.y,i),o=Math.max(t.bottom,i);return t.y=r,t.height=o-r,t}},function(t,e){t.exports=function(t,e){var i=Math.min(t.x,e.x),n=Math.max(t.right,e.right);t.x=i,t.width=n-i;var s=Math.min(t.y,e.y),r=Math.max(t.bottom,e.bottom);return t.y=s,t.height=r-s,t}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,s=t.y,r=t.bottom,o=0;o<e.length;o++)i=Math.min(i,e[o].x),n=Math.max(n,e[o].x),s=Math.min(s,e[o].y),r=Math.max(r,e[o].y);return t.x=i,t.y=s,t.width=n-i,t.height=r-s,t}},function(t,e,i){var r=i(388);t.exports=function(t,e,i){var n=t.centerX,s=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),r(t,n,s)}},function(t,e,i){var n=i(5);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.width,e.y=t.height,e}},function(t,e,i){var n=i(5);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.centerX,e.y=t.centerY,e}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},function(t,e,i){var n=i(228);t.exports=function(t,e){var i=n(t);return i>n(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e,i){var n=i(228);t.exports=function(t,e){var i=n(t);return i<n(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},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 n=i(31);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(14);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t.width=Math.ceil(t.width),t.height=Math.ceil(t.height),t}},function(t,e){t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t}},function(t,e){t.exports=function(t){return t.width*t.height}},function(t,e){t.exports=function(t,e){void 0===e&&(e=[]);for(var i=0;i<t.points.length;i++)e.push(t.points[i].x),e.push(t.points[i].y);return e}},function(t,e,i){var h=i(14);t.exports=function(t,e){void 0===e&&(e=new h);for(var i,n=1/0,s=1/0,r=-n,o=-s,a=0;a<t.points.length;a++)i=t.points[a],n=Math.min(n,i.x),s=Math.min(s,i.y),r=Math.max(r,i.x),o=Math.max(o,i.y);return e.x=n,e.y=s,e.width=r-n,e.height=o-s,e}},function(t,e,i){var n=i(229);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(390);t.exports=function(t){return new n(t.points)}},function(t,e,i){var n=i(390);n.Clone=i(801),n.Contains=i(229),n.ContainsPoint=i(800),n.GetAABB=i(799),n.GetNumberArray=i(798),t.exports=n},function(t,e,i){var n=i(392);t.exports=function(t,e){if(0!==t.x||0!==t.y){var i=n(t);t.x/=i,t.y/=i}return t.x*=e,t.y*=e,t}},function(t,e,i){var s=i(5);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x*e.x+t.y*e.y;return 0!==n&&(i.x=n*e.x,i.y=n*e.y),i}},function(t,e,i){var s=i(5),r=i(391);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=(t.x*e.x+t.y*e.y)/r(e);return 0!==n&&(i.x=n*e.x,i.y=n*e.y),i}},function(t,e,i){var n=i(5);t.exports=function(t,e){return void 0===e&&(e=new n),e.setTo(-t.x,-t.y)}},function(t,e){t.exports=function(t){return t.setTo(t.y,t.x)}},function(t,e,i){var s=i(5);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=new s),n.x=t.x+(e.x-t.x)*i,n.y=t.y+(e.y-t.y)*i,n}},function(t,e,i){var h=i(14);t.exports=function(t,e){void 0===e&&(e=new h);for(var i=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=0;o<t.length;o++){var a=t[o];a.x>i&&(i=a.x),a.x<n&&(n=a.x),a.y>s&&(s=a.y),a.y<r&&(r=a.y)}return e.x=n,e.y=r,e.width=i-n,e.height=s-r,e}},function(t,e,i){var s=i(5);t.exports=function(t,e){if(void 0===e&&(e=new s),!Array.isArray(t))throw new Error("GetCentroid points argument must be an array");var i=t.length;if(i<1)throw new Error("GetCentroid points array must not be empty");if(1===i)e.x=t[0].x,e.y=t[0].y;else{for(var n=0;n<i;n++)e.x+=t[n].x,e.y+=t[n].y;e.x/=i,e.y/=i}return e}},function(t,e){t.exports=function(t){return t.setTo(Math.floor(t.x),Math.floor(t.y))}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y)}},function(t,e,i){var n=i(5);t.exports=function(t){return new n(t.x,t.y)}},function(t,e){t.exports=function(t){return t.setTo(Math.ceil(t.x),Math.ceil(t.y))}},function(t,e,i){var n=i(5);n.Ceil=i(815),n.Clone=i(814),n.CopyFrom=i(813),n.Equals=i(812),n.Floor=i(811),n.GetCentroid=i(810),n.GetMagnitude=i(392),n.GetMagnitudeSq=i(391),n.GetRectangleFromPoints=i(809),n.Interpolate=i(808),n.Invert=i(807),n.Negative=i(806),n.Project=i(805),n.ProjectUnit=i(804),n.SetMagnitude=i(803),t.exports=n},function(t,e){t.exports=function(t){return Math.abs(t.x1-t.x2)}},function(t,e){t.exports=function(t){return(t.y2-t.y1)/(t.x2-t.x1)}},function(t,e){t.exports=function(t,e,i,n,s){return t.x1=e,t.y1=i,t.x2=e+Math.cos(n)*s,t.y2=i+Math.sin(n)*s,t}},function(t,e,i){var n=i(230);t.exports=function(t,e,i){return n(t,e.x,e.y,i)}},function(t,e,i){var s=i(230);t.exports=function(t,e){var i=(t.x1+t.x2)/2,n=(t.y1+t.y2)/2;return s(t,i,n,e)}},function(t,e,i){var n=i(82),s=i(393);t.exports=function(t,e){return 2*s(e)-Math.PI-n(t)}},function(t,e){t.exports=function(t){return-(t.x2-t.x1)/(t.y2-t.y1)}},function(t,e){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t}},function(t,e,i){var n=i(16),s=i(82);t.exports=function(t){return Math.sin(s(t)-n.TAU)}},function(t,e,i){var n=i(16),s=i(82);t.exports=function(t){return Math.cos(s(t)-n.TAU)}},function(t,e){t.exports=function(t){return Math.abs(t.y1-t.y2)}},function(t,e,i){var n=i(16),s=i(82),r=i(5);t.exports=function(t,e){void 0===e&&(e=new r);var i=s(t)-n.TAU;return e.x=Math.cos(i),e.y=Math.sin(i),e}},function(t,e,i){var n=i(5);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=(t.x1+t.x2)/2,e.y=(t.y1+t.y2)/2,e}},function(t,e){t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2}},function(t,e){t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2)}},function(t,e,i){var n=i(96);t.exports=function(t){return new n(t.x1,t.y1,t.x2,t.y2)}},function(t,e){t.exports=function(t,e,i){var n=e-(t.x1+t.x2)/2,s=i-(t.y1+t.y2)/2;return t.x1+=n,t.y1+=s,t.x2+=n,t.y2+=s,t}},function(t,e,i){var n=i(96);n.Angle=i(82),n.BresenhamPoints=i(569),n.CenterOn=i(833),n.Clone=i(832),n.CopyFrom=i(831),n.Equals=i(830),n.GetMidPoint=i(829),n.GetNormal=i(828),n.GetPoint=i(293),n.GetPoints=i(156),n.Height=i(827),n.Length=i(71),n.NormalAngle=i(393),n.NormalX=i(826),n.NormalY=i(825),n.Offset=i(824),n.PerpSlope=i(823),n.Random=i(155),n.ReflectAngle=i(822),n.Rotate=i(821),n.RotateAroundPoint=i(820),n.RotateAroundXY=i(230),n.SetToAngle=i(819),n.Slope=i(818),n.Width=i(817),t.exports=n},function(t,e,i){var u=i(231),c=i(394),d=i(144);t.exports=function(t,e){if(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top)return!1;var i=t.getLineA(),n=t.getLineB(),s=t.getLineC(),r=e.getLineA(),o=e.getLineB(),a=e.getLineC();if(d(i,r)||d(i,o)||d(i,a))return!0;if(d(n,r)||d(n,o)||d(n,a))return!0;if(d(s,r)||d(s,o)||d(s,a))return!0;var h=c(t),l=u(e,h,!0);return 0<l.length||(h=c(e),0<(l=u(t,h,!0)).length)}},function(t,e,i){var n=i(60),s=i(144);t.exports=function(t,e){return!!(n(t,e.getPointA())||n(t,e.getPointB())||s(t.getLineA(),e)||s(t.getLineB(),e)||s(t.getLineC(),e))}},function(t,e,i){var n=i(397),s=i(60);t.exports=function(t,e){return!(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top||!s(t,e.x,e.y)&&!n(t.getLineA(),e)&&!n(t.getLineB(),e)&&!n(t.getLineC(),e))}},function(t,e){t.exports=function(t,e,i,n,s,r){return void 0===r&&(r=0),!(e>t.right+r||i<t.left-r||n>t.bottom+r||s<t.top-r)}},function(t,e,i){var u=i(144),c=i(31),d=i(231),f=i(395);t.exports=function(t,e){if(e.left>t.right||e.right<t.left||e.top>t.bottom||e.bottom<t.top)return!1;var i=e.getLineA(),n=e.getLineB(),s=e.getLineC();if(c(t,i.x1,i.y1)||c(t,i.x2,i.y2))return!0;if(c(t,n.x1,n.y1)||c(t,n.x2,n.y2))return!0;if(c(t,s.x1,s.y1)||c(t,s.x2,s.y2))return!0;var r=t.getLineA(),o=t.getLineB(),a=t.getLineC(),h=t.getLineD();if(u(i,r)||u(i,o)||u(i,a)||u(i,h))return!0;if(u(n,r)||u(n,o)||u(n,a)||u(n,h))return!0;if(u(s,r)||u(s,o)||u(s,a)||u(s,h))return!0;var l=f(t);return 0<d(e,l,!0).length}},function(t,e,i){var o=i(396);t.exports=function(t,e){if(!o(t,e))return!1;var i=Math.min(e.x1,e.x2),n=Math.max(e.x1,e.x2),s=Math.min(e.y1,e.y2),r=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=n&&t.y>=s&&t.y<=r}},function(t,e){t.exports=function(t,e){var i=t.x1,n=t.y1,s=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(o<=i&&i<=h&&a<=n&&n<=l||o<=s&&s<=h&&a<=r&&r<=l)return!0;if(i<o&&o<=s){if(a<(u=n+(r-n)*(o-i)/(s-i))&&u<=l)return!0}else if(h<i&&s<=h&&a<=(u=n+(r-n)*(h-i)/(s-i))&&u<=l)return!0;if(n<a&&a<=r){if(o<=(u=i+(s-i)*(a-n)/(r-n))&&u<=h)return!0}else if(l<n&&r<=l&&o<=(u=i+(s-i)*(l-n)/(r-n))&&u<=h)return!0;return!1}},function(t,e,i){var n=i(14),s=i(398);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},function(t,e){t.exports=function(t,e){var i=e.width/2,n=e.height/2,s=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-n),o=i+t.radius,a=n+t.radius;if(o<s||a<r)return!1;if(s<=i||r<=n)return!0;var h=s-i,l=r-n;return h*h+l*l<=t.radius*t.radius}},function(t,e,i){var n=i(58);t.exports=function(t,e){return n(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},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 n=i(14);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},function(t,e,i){var n=i(32);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e,i){var n=i(32);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(88);t.exports=function(t){return new n(t.x,t.y,t.radius)}},function(t,e){t.exports=function(t){return 0<t.radius?Math.PI*t.radius*t.radius:0}},function(t,e,i){var n=i(88);n.Area=i(853),n.Circumference=i(295),n.CircumferencePoint=i(136),n.Clone=i(852),n.Contains=i(32),n.ContainsPoint=i(851),n.ContainsRect=i(850),n.CopyFrom=i(849),n.Equals=i(848),n.GetBounds=i(847),n.GetPoint=i(298),n.GetPoints=i(296),n.Offset=i(846),n.OffsetPoint=i(845),n.Random=i(157),t.exports=n},function(t,e,i){var n=i(0),s=i(401),r=i(12),o=new n({Extends:s,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once("boot",this.boot,this),s.call(this)},boot:function(){var t=this.systems.events;t.on("shutdown",this.shutdown,this),t.on("destroy",this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});r.register("LightsPlugin",o,"lights"),t.exports=o},function(t,e,i){var a=i(24),n=i(13),h=i(10),l=i(232);n.register("quad",function(t,e){void 0===t&&(t={});var i=h(t,"x",0),n=h(t,"y",0),s=h(t,"key",null),r=h(t,"frame",null),o=new l(this.scene,i,n,s,r);return void 0!==e&&(t.add=e),a(this.scene,o,t),o})},function(t,e,i){var l=i(24),n=i(13),u=i(10),c=i(4),d=i(145);n.register("mesh",function(t,e){void 0===t&&(t={});var i=u(t,"key",null),n=u(t,"frame",null),s=c(t,"vertices",[]),r=c(t,"colors",[]),o=c(t,"alphas",[]),a=c(t,"uv",[]),h=new d(this.scene,0,0,s,a,r,o,i,n);return void 0!==e&&(t.add=e),l(this.scene,h,t),h})},function(t,e,i){var s=i(232);i(11).register("quad",function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))})},function(t,e,i){var h=i(145);i(11).register("mesh",function(t,e,i,n,s,r,o,a){return this.displayList.add(new h(this.scene,t,e,i,n,s,r,o,a))})},function(t,e){t.exports=function(){}},function(t,e,i){var r=i(2);t.exports=function(t,e,i,n,s){r.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id||this.pipeline.batchMesh(e,n,s)}},function(t,e,i){var n=i(3),s=i(3);n=i(861),s=i(860),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(13),r=i(10),o=i(158);n.register("zone",function(t){var e=r(t,"x",0),i=r(t,"y",0),n=r(t,"width",1),s=r(t,"height",n);return new o(this.scene,e,i,n,s)})},function(t,e,i){var l=i(24),n=i(13),u=i(10),c=i(233);n.register("tileSprite",function(t,e){void 0===t&&(t={});var i=u(t,"x",0),n=u(t,"y",0),s=u(t,"width",512),r=u(t,"height",512),o=u(t,"key",""),a=u(t,"frame",""),h=new c(this.scene,i,n,s,r,o,a);return void 0!==e&&(t.add=e),l(this.scene,h,t),h})},function(t,e,i){var o=i(253),a=i(24),n=i(13),h=i(10),l=i(4);n.register("bitmapText",function(t,e){void 0===t&&(t={});var i=l(t,"font",""),n=h(t,"text",""),s=h(t,"size",!1),r=new o(this.scene,0,0,i,n,s);return void 0!==e&&(t.add=e),a(this.scene,r,t),r})},function(t,e,i){var r=i(24),o=i(127),n=i(13),a=i(10),h=i(151);n.register("sprite3D",function(t,e){void 0===t&&(t={});var i=a(t,"key",null),n=a(t,"frame",null),s=new h(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),r(this.scene,s,t),o(s,t),s})},function(t,e,i){var a=i(24),n=i(13),h=i(10),l=i(234);n.register("renderTexture",function(t,e){void 0===t&&(t={});var i=h(t,"x",0),n=h(t,"y",0),s=h(t,"width",32),r=h(t,"height",32),o=new l(this.scene,i,n,s,r);return void 0!==e&&(t.add=e),a(this.scene,o,t),o})},function(t,e,i){var n=i(13),o=i(10),a=i(1),h=i(235);n.register("particles",function(t,e){void 0===t&&(t={});var i=o(t,"key",null),n=o(t,"frame",null),s=a(t,"emitters",null),r=new h(this.scene,i,n,s);return void 0!==e&&(t.add=e),a(t,"add",!1)&&this.displayList.add(r),this.updateList.add(r),r})},function(t,e,i){var n=i(13),s=i(112);n.register("group",function(t){return new s(this.scene,null,t)})},function(t,e,i){var o=i(250),a=i(24),n=i(13),h=i(10);n.register("dynamicBitmapText",function(t,e){void 0===t&&(t={});var i=h(t,"font",""),n=h(t,"text",""),s=h(t,"size",!1),r=new o(this.scene,0,0,i,n,s);return void 0!==e&&(t.add=e),a(this.scene,r,t),r})},function(t,e,i){var r=i(24),o=i(251),n=i(13),a=i(10);n.register("container",function(t,e){void 0===t&&(t={});var i=a(t,"x",0),n=a(t,"y",0),s=new o(this.scene,i,n);return void 0!==e&&(t.add=e),r(this.scene,s,t),s})},function(t,e,i){var r=i(252),o=i(24),n=i(13),a=i(10);n.register("blitter",function(t,e){void 0===t&&(t={});var i=a(t,"key",null),n=a(t,"frame",null),s=new r(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),o(this.scene,s,t),s})},function(t,e,i){var s=i(158);i(11).register("zone",function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))})},function(t,e,i){var o=i(233);i(11).register("tileSprite",function(t,e,i,n,s,r){return this.displayList.add(new o(this.scene,t,e,i,n,s,r))})},function(t,e,i){var r=i(253);i(11).register("bitmapText",function(t,e,i,n,s){return this.displayList.add(new r(this.scene,t,e,i,n,s))})},function(t,e,i){var o=i(151);i(11).register("sprite3D",function(t,e,i,n,s){var r=new o(this.scene,t,e,i,n,s);return this.displayList.add(r.gameObject),this.updateList.add(r.gameObject),r})},function(t,e,i){var n=i(11),s=i(234);n.register("renderTexture",function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))})},function(t,e,i){var n=i(11),o=i(418);n.register("follower",function(t,e,i,n,s){var r=new o(this.scene,t,e,i,n,s);return this.displayList.add(r),this.updateList.add(r),r})},function(t,e,i){var n=i(11),s=i(235);n.register("particles",function(t,e,i){var n=new s(this.scene,t,e,i);return this.displayList.add(n),this.updateList.add(n),n})},function(t,e,i){var n=i(112);i(11).register("group",function(t,e){return"object"==typeof t&&void 0===e&&(e=t,t=[]),this.updateList.add(new n(this.scene,t,e))})},function(t,e,i){var r=i(250);i(11).register("dynamicBitmapText",function(t,e,i,n,s){return this.displayList.add(new r(this.scene,t,e,i,n,s))})},function(t,e,i){var n=i(251);i(11).register("container",function(t,e,i){return this.displayList.add(new n(this.scene,t,e,i))})},function(t,e,i){var s=i(252);i(11).register("blitter",function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))})},function(t,e,i){var p=i(2);t.exports=function(t,e,i,n,s){if(!(p.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id)){var r=t.currentContext,o=e.frame;e.updateTileTexture(),t.currentBlendMode!==e.blendMode&&(t.currentBlendMode=e.blendMode,r.globalCompositeOperation=t.blendModes[e.blendMode]),t.currentAlpha!==e.alpha&&(t.currentAlpha=e.alpha,r.globalAlpha=e.alpha),t.currentScaleMode!==e.scaleMode&&(t.currentScaleMode=e.scaleMode);var a=o.x-e.originX*e.width,h=o.y-e.originY*e.height,l=e.x-n.scrollX*e.scrollFactorX,u=e.y-n.scrollY*e.scrollFactorY,c=1,d=1;if(e.flipX&&(c=-1,a+=e.width),e.flipY&&(d=-1,h+=e.height),t.config.roundPixels&&(a|=0,h|=0,l|=0,u|=0),r.save(),void 0!==s){var f=s.matrix;r.transform(f[0],f[1],f[2],f[3],f[4],f[5])}r.translate(a,h),r.translate(l,u),r.scale(c,d),r.translate(e.originX*e.width,e.originY*e.height),r.rotate(c*d*e.rotation),r.scale(this.scaleX,this.scaleY),r.translate(-e.originX*e.width,-e.originY*e.height),r.translate(-this.tilePositionX,-this.tilePositionY),r.fillStyle=e.canvasPattern,r.fillRect(this.tilePositionX,this.tilePositionY,e.width,e.height),r.restore()}}},function(t,e,i){var r=i(2);t.exports=function(t,e,i,n,s){r.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id||(e.updateTileTexture(),this.pipeline.batchTileSprite(this,n,s))}},function(t,e,i){var n=i(3),s=i(3);n=i(885),s=i(884),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var x=i(4);t.exports=function(t,e){var i=e.width,n=e.height,s=Math.floor(i/2),r=Math.floor(n/2),o=x(e,"chars","");if(""!==o){var a=x(e,"image",""),h=x(e,"offset.x",0),l=x(e,"offset.y",0),u=x(e,"spacing.x",0),c=x(e,"spacing.y",0),d=x(e,"charsPerRow",null);null===d&&(d=t.sys.textures.getFrame(a).width/i)>o.length&&(d=o.length);for(var f=h,p=l,g={retroFont:!0,font:a,size:i,lineHeight:n,chars:{}},v=0,y=0;y<o.length;y++){var m=o.charCodeAt(y);g.chars[m]={x:f,y:p,width:i,height:n,centerX:s,centerY:r,xOffset:0,yOffset:0,xAdvance:i,data:{},kerning:{}},++v===d?(v=0,f=h,p+=n+c):f+=i+u}return{data:g,frame:null,texture:a}}}},function(t,e){t.exports={TEXT_SET1:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){var n=i(888),s=i(17),r={Parse:i(887)};r=s(!1,r,n),t.exports=r},function(t,e){t.exports={fill:function(t){var e=255&(t>>16|0),i=255&(t>>8|0),n=255&(0|t);this.renderer.setFramebuffer(this.framebuffer);var s=this.gl;return s.clearColor(e/255,i/255,n/255,1),s.clear(s.COLOR_BUFFER_BIT),this.renderer.setFramebuffer(null),this},clear:function(){this.renderer.setFramebuffer(this.framebuffer);var t=this.gl;return t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),this.renderer.setFramebuffer(null),this},draw:function(t,e,i,n){var s=t.source[e.sourceIndex].glTexture,r=(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16);return this.renderer.setFramebuffer(this.framebuffer),this.renderer.pipelines.TextureTintPipeline.projOrtho(0,this.renderer.pipelines.TextureTintPipeline.width,0,this.renderer.pipelines.TextureTintPipeline.height,-1e3,1e3),this.renderer.pipelines.TextureTintPipeline.drawTexture(s,i,n,r,this.globalAlpha,e.cutX,e.cutY,e.cutWidth,e.cutHeight,this.currentMatrix,null,this),this.renderer.setFramebuffer(null),this.renderer.pipelines.TextureTintPipeline.projOrtho(0,this.renderer.pipelines.TextureTintPipeline.width,this.renderer.pipelines.TextureTintPipeline.height,0,-1e3,1e3),this}}},function(t,e){t.exports={fill:function(t){var e=255&(t>>16|0),i=255&(t>>8|0),n=255&(0|t);return this.context.fillStyle="rgb("+e+","+i+","+n+")",this.context.fillRect(0,0,this.canvas.width,this.canvas.height),this},clear:function(){return this.context.save(),this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.restore(),this},draw:function(t,e,i,n){var s=e.canvasData,r=e.source.image,o=this.currentMatrix;return this.context.globalAlpha=this.globalAlpha,this.context.setTransform(o[0],o[1],o[2],o[3],o[4],o[5]),this.context.drawImage(r,s.sx,s.sy,s.sWidth,s.sHeight,i,n,s.dWidth,s.dHeight),this}}},function(t,e,i){var c=i(2);t.exports=function(t,e,i,n,s){if(!(c.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id)){var r=t.currentContext;t.currentBlendMode!==e.blendMode&&(t.currentBlendMode=e.blendMode,r.globalCompositeOperation=t.blendModes[e.blendMode]),t.currentAlpha!==e.alpha&&(t.currentAlpha=e.alpha,r.globalAlpha=e.alpha),t.currentScaleMode!==e.scaleMode&&(t.currentScaleMode=e.scaleMode);var o=0,a=0,h=1,l=1;if(e.flipX?(h=-1,o-=e.canvas.width-e.displayOriginX):o-=e.displayOriginX,e.flipY?(l=-1,a-=e.canvas.height-e.displayOriginY):a-=e.displayOriginY,r.save(),void 0!==s){var u=s.matrix;r.transform(u[0],u[1],u[2],u[3],u[4],u[5])}r.translate(e.x-n.scrollX*e.scrollFactorX,e.y-n.scrollY*e.scrollFactorY),r.rotate(e.rotation),r.scale(e.scaleX,e.scaleY),r.scale(h,l),r.drawImage(e.canvas,o,a),r.restore()}}},function(t,e,i){var r=i(2),o=i(27);t.exports=function(t,e,i,n,s){r.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id||this.pipeline.batchTexture(e,e.texture,e.texture.width,e.texture.height,e.x,e.y,e.width,e.height,e.scaleX,e.scaleY,e.rotation,e.flipX,!e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,e.texture.width,e.texture.height,o.getTintAppendFloatAlpha(e.tintTopLeft,e.alphaTopLeft),o.getTintAppendFloatAlpha(e.tintTopRight,e.alphaTopRight),o.getTintAppendFloatAlpha(e.tintBottomLeft,e.alphaBottomLeft),o.getTintAppendFloatAlpha(e.tintBottomRight,e.alphaBottomRight),0,0,n,s)}},function(t,e,i){var n=i(3),s=i(3);n=i(893),s=i(892),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){t.exports={DeathZone:i(455),EdgeZone:i(454),RandomZone:i(419)}},function(t,e,i){var _=i(2);t.exports=function(t,e,i,n,s){var r=e.emitters.list;if(!(0===r.length||_.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id)){var o=t.currentContext;if(o.save(),void 0!==s){var a=s.matrix;o.transform(a[0],a[1],a[2],a[3],a[4],a[5])}for(var h=0;h<r.length;h++){var l=r[h],u=l.alive,c=u.length;if(l.visible&&0!==c){var d=o.globalAlpha,f=n.scrollX*l.scrollFactorX,p=n.scrollY*l.scrollFactorY;t.currentBlendMode!==l.blendMode&&(t.currentBlendMode=l.blendMode,o.globalCompositeOperation=t.blendModes[l.blendMode]);for(var g=t.config.roundPixels,v=0;v<c;++v){var y=u[v],m=(y.color>>24&255)/255;if(!(m<=0)){var x=y.frame,w=.5*x.width,b=.5*x.height,T=x.canvasData,S=-w,A=-b,C=y.x-f,M=y.y-p;g&&(C|=0,M|=0),o.globalAlpha=m,o.save(),o.translate(C,M),o.rotate(y.rotation),o.scale(y.scaleX,y.scaleY),o.drawImage(x.source.image,T.sx,T.sy,T.sWidth,T.sHeight,S,A,T.dWidth,T.dHeight),o.restore()}}o.globalAlpha=d}}o.restore()}}},function(t,e,i){var r=i(2);t.exports=function(t,e,i,n,s){0===e.emitters.length||r.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id||this.pipeline.drawEmitterManager(e,n,s)}},function(t,e,i){var n=i(3),s=i(3);n=i(897),s=i(896),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(0),s=i(248),r=i(63),o=i(1),a=i(39),h=new n({initialize:function(t,e,i,n){void 0===n&&(n=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=n,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=o(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t=this.propertyValue,e=typeof t;if("number"===e)this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate;else if(Array.isArray(t))this.onEmit=this.randomStaticValueEmit;else if("function"===e)this.emitOnly?this.onEmit=t:this.onUpdate=t;else if("object"===e&&(this.has(t,"random")||this.hasBoth(t,"start","end")||this.hasBoth(t,"min","max"))){this.start=this.has(t,"start")?t.start:t.min,this.end=this.has(t,"end")?t.end:t.max;var i=this.hasBoth(t,"min","max")||this.has(t,"random");if(i){var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),this.onEmit=this.randomRangedValueEmit}if(this.has(t,"steps"))this.steps=t.steps,this.counter=this.start,this.onEmit=this.steppedEmit;else{var s=this.has(t,"ease")?t.ease:"Linear";this.ease=r(s),i||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate}}else"object"===e&&this.hasEither(t,"onEmit","onUpdate")&&(this.has(t,"onEmit")&&(this.onEmit=t.onEmit),this.has(t,"onUpdate")&&(this.onUpdate=t.onUpdate));return this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,n){return n},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=s(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=a(e,this.start,this.end),t},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.start},easeValueUpdate:function(t,e,i){var n=t.data[e];return(n.max-n.min)*this.ease(i)+n.min}});t.exports=h},function(t,e,i){t.exports={GravityWell:i(458),Particle:i(457),ParticleEmitter:i(456),ParticleEmitterManager:i(235),Zones:i(895)}},function(t,e,i){var I=i(2);t.exports=function(t,e,i,n,s){var r=e.text,o=r.length;if(!(I.RENDER_MASK!==e.renderFlags||0===o||0<e.cameraFilter&&e.cameraFilter&n._id)){var a=e.frame,h=e.displayCallback,l=n.scrollX*e.scrollFactorX,u=n.scrollY*e.scrollFactorY,c=e.fontData.chars,d=e.fontData.lineHeight,f=0,p=0,g=0,v=0,y=null,m=0,x=0,w=0,b=0,T=0,S=0,A=null,C=0,M=t.currentContext,_=e.frame.source.image,E=a.cutX,P=a.cutY,k=0,L=e.fontSize/e.fontData.size;if(t.currentBlendMode!==e.blendMode&&(t.currentBlendMode=e.blendMode,M.globalCompositeOperation=t.blendModes[e.blendMode]),t.currentAlpha!==e.alpha&&(t.currentAlpha=e.alpha,M.globalAlpha=e.alpha),t.currentScaleMode!==e.scaleMode&&(t.currentScaleMode=e.scaleMode),M.save(),void 0!==s){var F=s.matrix;M.transform(F[0],F[1],F[2],F[3],F[4],F[5])}M.translate(e.x,e.y),M.rotate(e.rotation),M.translate(-e.displayOriginX,-e.displayOriginY),M.scale(e.scaleX,e.scaleY),0<e.cropWidth&&0<e.cropHeight&&(M.save(),M.beginPath(),M.rect(0,0,e.cropWidth,e.cropHeight),M.clip());for(var R=t.config.roundPixels,O=0;O<o;++O)if(L=e.fontSize/e.fontData.size,k=0,10!==(v=r.charCodeAt(O))){if(y=c[v]){if(m=E+y.x,x=P+y.y,w=y.width,b=y.height,T=g+y.xOffset+f-e.scrollX,S=y.yOffset+p-e.scrollY,null!==A){var B=y.kerning[C];T+=void 0!==B?B:0}if(h){var D=h({tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:O,charCode:v,x:T,y:S,scale:L,rotation:0,data:y.data});T=D.x,S=D.y,L=D.scale,k=D.rotation}T*=L,S*=L,T-=l,S-=u,R&&(T|=0,S|=0),M.save(),M.translate(T,S),M.rotate(k),M.scale(L,L),M.drawImage(_,m,x,w,b,0,0,w,b),M.restore(),f+=y.xAdvance,g+=1,A=y,C=v}}else g=f=0,p+=d,A=null;0<e.cropWidth&&0<e.cropHeight&&M.restore(),M.restore()}}},function(t,e,i){var o=i(2);t.exports=function(t,e,i,n,s){var r=e.text.length;o.RENDER_MASK!==e.renderFlags||0===r||0<e.cameraFilter&&e.cameraFilter&n._id||this.pipeline.batchDynamicBitmapText(e,n,s)}},function(t,e,i){var n=i(3),s=i(3);n=i(902),s=i(901),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var g=i(2);t.exports=function(t,e,i,n,s){if(!(g.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id)){var r=e.list,o=e.localTransform;void 0===s?o.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY):(o.loadIdentity(),o.multiply(s),o.translate(e.x,e.y),o.rotate(e.rotation),o.scale(e.scaleX,e.scaleY));for(var a=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY,u=0;u<r.length;++u){var c=r[u],d=c._alpha,f=c.scrollFactorX,p=c.scrollFactorY;c.setScrollFactor(f*h,p*l),c.setAlpha(d*a),c.renderCanvas(t,c,i,n,o),c.setAlpha(d),c.setScrollFactor(f,p)}}}},function(t,e,i){var g=i(2);t.exports=function(t,e,i,n,s){if(!(g.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id)){var r=e.list,o=e.localTransform;void 0===s?o.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY):(o.loadIdentity(),o.multiply(s),o.translate(e.x,e.y),o.rotate(e.rotation),o.scale(e.scaleX,e.scaleY));for(var a=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY,u=0;u<r.length;++u){var c=r[u],d=c._alpha,f=c.scrollFactorX,p=c.scrollFactorY;c.setScrollFactor(f*h,p*l),c.setAlpha(d*a),c.renderWebGL(t,c,i,n,o),c.setAlpha(d),c.setScrollFactor(f,p)}}}},function(t,e,i){var n=i(3),s=i(3);n=i(905),s=i(904),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s){this.parent=t,this.x=e,this.y=i,this.frame=n,this.data={},this._visible=s,this._alpha=1,this.flipX=!1,this.flipY=!1},setFrame:function(t){return t=void 0===t?this.parent.frame:this.parent.texture.get(t),this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this},reset:function(t,e,i){return this.x=t,this.y=e,this.flipX=!1,this.flipY=!1,this._alpha=1,this._visible=!0,this.parent.dirty=!0,i&&this.setFrame(i),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},setVisible:function(t){return this.visible=t,this},setAlpha:function(t){return this.alpha=t,this},destroy:function(){this.parent.dirty=!0,this.parent.children.remove(this),this.parent=void 0,this.frame=void 0,this.data=void 0},visible:{get:function(){return this._visible},set:function(t){this._visible=t,this.parent.dirty=!0}},alpha:{get:function(){return this._alpha},set:function(t){this._alpha=t,this.parent.dirty=!0}}});t.exports=n},function(t,e,i){var x=i(2);t.exports=function(t,e,i,n,s){if(!(x.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id)){var r=e.getRenderList();t.setBlendMode(e.blendMode);var o=t.gameContext,a=e.x-n.scrollX*e.scrollFactorX,h=e.y-n.scrollY*e.scrollFactorY;if(o.save(),void 0!==s){var l=s.matrix;o.transform(l[0],l[1],l[2],l[3],l[4],l[5])}for(var u=0;u<r.length;u++){var c=r[u],d=c.flipX||c.flipY,f=c.frame,p=f.canvasData,g=f.x,v=f.y,y=1,m=1;d?(c.flipX&&(y=-1,g-=p.dWidth),c.flipY&&(m=-1,v-=p.dHeight),o.save(),o.translate(c.x+a,c.y+h),o.scale(y,m),o.drawImage(f.source.image,p.sx,p.sy,p.sWidth,p.sHeight,g,v,p.dWidth,p.dHeight),o.restore()):t.blitImage(g+c.x+a,v+c.y+h,c.frame)}o.restore()}}},function(t,e,i){var r=i(2);t.exports=function(t,e,i,n,s){r.RENDER_MASK!==e.renderFlags||0<e.cameraFilter&&e.cameraFilter&n._id||this.pipeline.drawBlitter(e,n,s)}},function(t,e,i){var n=i(3),s=i(3);n=i(909),s=i(908),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var B=i(2);t.exports=function(t,e,i,n,s){var r=e.text,o=r.length;if(!(B.RENDER_MASK!==e.renderFlags||0===o||0<e.cameraFilter&&e.cameraFilter&n._id)){var a=e.frame,h=e.fontData.chars,l=e.fontData.lineHeight,u=e.letterSpacing,c=0,d=0,f=0,p=0,g=null,v=0,y=0,m=0,x=0,w=0,b=0,T=null,S=0,A=t.currentContext,C=e.frame.source.image,M=a.cutX,_=a.cutY,E=e.fontSize/e.fontData.size;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 P=t.config.roundPixels,k=e.x-n.scrollX*e.scrollFactorX+e.frame.x,L=e.y-n.scrollY*e.scrollFactorY+e.frame.y;if(P&&(k|=0,L|=0),A.save(),void 0!==s){var F=s.matrix;A.transform(F[0],F[1],F[2],F[3],F[4],F[5])}A.translate(k,L),A.rotate(e.rotation),A.translate(-e.displayOriginX,-e.displayOriginY),A.scale(e.scaleX,e.scaleY);for(var R=0;R<o;++R)if(10!==(p=r.charCodeAt(R))){if(g=h[p]){if(v=M+g.x,y=_+g.y,m=g.width,x=g.height,w=f+g.xOffset+c,b=g.yOffset+d,null!==T){var O=g.kerning[S];w+=void 0!==O?O:0}w*=E,b*=E,c+=g.xAdvance+u,f+=1,T=g,S=p,0!==m&&0!==x&&32!==p&&(P&&(w|=0,b|=0),A.save(),A.translate(w,b),A.scale(E,E),A.drawImage(C,v,y,m,x,0,0,m,x),A.restore())}}else f=c=0,d+=l,T=null;A.restore()}}},function(t,e,i){var o=i(2);t.exports=function(t,e,i,n,s){var r=e.text.length;o.RENDER_MASK!==e.renderFlags||0===r||0<e.cameraFilter&&e.cameraFilter&n._id||this.pipeline.batchBitmapText(this,n,s)}},function(t,e,i){var n=i(3),s=i(3);n=i(912),s=i(911),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var u=i(474);t.exports=function(t,e,i,n,s,r,o){var a=t.sys.textures.getFrame(i,n),h=t.sys.cache.xml.get(s);if(a&&h){var l=u(h,r,o,a);return t.sys.cache.bitmapFont.add(e,{data:l,texture:i,frame:n}),!0}return!1}},function(t,e,i){var n={DisplayList:i(504),GameObjectCreator:i(13),GameObjectFactory:i(11),UpdateList:i(476),Components:i(15),BuildGameObject:i(24),BuildGameObjectAnimation:i(127),GameObject:i(2),BitmapText:i(253),Blitter:i(252),Container:i(251),DynamicBitmapText:i(250),Graphics:i(115),Group:i(112),Image:i(69),Particles:i(900),PathFollower:i(418),RenderTexture:i(234),RetroFont:i(889),Sprite3D:i(151),Sprite:i(34),Text:i(110),TileSprite:i(233),Zone:i(158),Factories:{Blitter:i(883),Container:i(882),DynamicBitmapText:i(881),Graphics:i(410),Group:i(880),Image:i(409),Particles:i(879),PathFollower:i(878),RenderTexture:i(877),Sprite3D:i(876),Sprite:i(408),StaticBitmapText:i(875),Text:i(407),TileSprite:i(874),Zone:i(873)},Creators:{Blitter:i(872),Container:i(871),DynamicBitmapText:i(870),Graphics:i(406),Group:i(869),Image:i(405),Particles:i(868),RenderTexture:i(867),Sprite3D:i(866),Sprite:i(404),StaticBitmapText:i(865),Text:i(403),TileSprite:i(864),Zone:i(863)}};n.Mesh=i(145),n.Quad=i(232),n.Factories.Mesh=i(859),n.Factories.Quad=i(858),n.Creators.Mesh=i(857),n.Creators.Quad=i(856),n.Light=i(402),i(401),i(855),t.exports=n},function(t,e,i){t.exports={AddToDOM:i(130),DOMContentLoaded:i(271),ParseXML:i(270),RemoveFromDOM:i(269),RequestAnimationFrame:i(268)}},function(t,e,i){var r=i(541);t.exports=function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s="#"),"#"===s?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1):"0x"+r(n)+r(t)+r(e)+r(i)}},function(t,e){t.exports=function(t,e,i){t/=255,e/=255,i/=255;var n=Math.min(t,e,i),s=Math.max(t,e,i),r=s-n,o=0;return s!==n&&(s===t?o=(e-i)/r+(e<i?6:0):s===e?o=(i-t)/r+2:s===i&&(o=(t-e)/r+4),o/=6),{h:o,s:0===s?0:r/s,v:s}}},function(t,e,i){var n=i(149),s=i(30);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new s(n(t,e),n(t,e),n(t,e))}},function(t,e,i){var l=i(122),o=function(t,e,i,n,s,r,o,a){void 0===o&&(o=100),void 0===a&&(a=0);var h=a/o;return{r:l(t,n,h),g:l(e,s,h),b:l(i,r,h)}};t.exports={RGBWithRGB:o,ColorWithRGB:function(t,e,i,n,s,r){return void 0===s&&(s=100),void 0===r&&(r=0),o(t.r,t.g,t.b,e,i,n,s,r)},ColorWithColor:function(t,e,i,n){return void 0===i&&(i=100),void 0===n&&(n=0),o(t.r,t.g,t.b,e.r,e.g,e.b,i,n)}}},function(t,e,i){var s=i(539);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],n=0;n<=359;n++)i.push(s(n/359,t,e));return i}},function(t,e,i){var h=i(30),l=i(540);t.exports=function(t,e,i){var n=i,s=i,r=i;if(0!==e){var o=i<.5?i*(1+e):i+e-i*e,a=2*i-o;n=l(a,o,t+1/3),s=l(a,o,t),r=l(a,o,t-1/3)}return(new h).setGLTo(n,s,r,1)}},function(t,e){t.exports=function(t){var e={r:t>>16&255,g:t>>8&255,b:255&t,a:255};return 16777215<t&&(e.a=t>>>24),e}},function(t,e){t.exports=function(e,i){void 0===i&&(i="none");return["-webkit-","-khtml-","-moz-","-ms-",""].forEach(function(t){e.style[t+"user-select"]=i}),e.style["-webkit-touch-callout"]=i,e.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",e}},function(t,e){t.exports=function(t,e){return void 0===e&&(e="none"),t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t}},function(t,e,i){t.exports={Interpolation:i(272),Pool:i(22),Smoothing:i(131),TouchAction:i(925),UserSelect:i(924)}},function(t,e){t.exports=function(t){return t.height*t.originY}},function(t,e){t.exports=function(t){return t.width*t.originX}},function(t,e,i){t.exports={CenterOn:i(593),GetBottom:i(50),GetCenterX:i(92),GetCenterY:i(89),GetLeft:i(48),GetOffsetX:i(928),GetOffsetY:i(927),GetRight:i(46),GetTop:i(44),SetBottom:i(49),SetCenterX:i(91),SetCenterY:i(90),SetLeft:i(47),SetRight:i(45),SetTop:i(43)}},function(t,e,i){var s=i(46),r=i(44),o=i(49),a=i(45);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,s(e)+i),o(t,r(e)-n),t}},function(t,e,i){var s=i(48),r=i(44),o=i(49),a=i(47);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,s(e)-i),o(t,r(e)-n),t}},function(t,e,i){var s=i(92),r=i(44),o=i(49),a=i(91);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,s(e)+i),o(t,r(e)-n),t}},function(t,e,i){var s=i(46),r=i(44),o=i(47),a=i(43);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),o(t,s(e)+i),a(t,r(e)-n),t}},function(t,e,i){var s=i(89),r=i(46),o=i(90),a=i(47);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,r(e)+i),o(t,s(e)+n),t}},function(t,e,i){var s=i(50),r=i(46),o=i(49),a=i(47);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,r(e)+i),o(t,s(e)+n),t}},function(t,e,i){var s=i(48),r=i(44),o=i(45),a=i(43);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),o(t,s(e)-i),a(t,r(e)-n),t}},function(t,e,i){var s=i(89),r=i(48),o=i(90),a=i(45);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,r(e)-i),o(t,s(e)+n),t}},function(t,e,i){var s=i(50),r=i(48),o=i(49),a=i(45);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,r(e)-i),o(t,s(e)+n),t}},function(t,e,i){var s=i(50),r=i(46),o=i(45),a=i(43);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),o(t,r(e)+i),a(t,s(e)+n),t}},function(t,e,i){var s=i(50),r=i(48),o=i(47),a=i(43);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),o(t,r(e)-i),a(t,s(e)+n),t}},function(t,e,i){var s=i(50),r=i(92),o=i(91),a=i(43);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),o(t,r(e)+i),a(t,s(e)+n),t}},function(t,e,i){t.exports={BottomCenter:i(941),BottomLeft:i(940),BottomRight:i(939),LeftBottom:i(938),LeftCenter:i(937),LeftTop:i(936),RightBottom:i(935),RightCenter:i(934),RightTop:i(933),TopCenter:i(932),TopLeft:i(931),TopRight:i(930)}},function(t,e,i){t.exports={BottomCenter:i(597),BottomLeft:i(596),BottomRight:i(595),Center:i(594),LeftCenter:i(592),QuickSet:i(598),RightCenter:i(591),TopCenter:i(590),TopLeft:i(589),TopRight:i(588)}},function(t,e,i){var n=i(299),s=i(17),r={In:i(943),To:i(942)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={Align:i(944),Bounds:i(929),Canvas:i(926),Color:i(542),Masks:i(538)}},function(t,e,i){var n=i(0),s=i(6),r=new n({initialize:function(t,e){this.active=!1,this.p0=new s(t,e)},getPoint:function(t,e){return void 0===e&&(e=new s),e.copy(this.p0)},getPointAt:function(t,e){return this.getPoint(t,e)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});t.exports=r},function(t,e,i){var n=i(0),u=i(551),l=i(549),s=i(11),r=i(548),o=i(946),a=i(547),h=i(14),c=i(545),d=i(6),f=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new r(e,t)),this},cubicBezierTo:function(t,e,i,n,s,r){var o,a,h,l=this.getEndPoint();return t instanceof d?(o=t,a=e,h=i):(o=new d(i,n),a=new d(s,r),h=new d(t,e)),this.add(new u(l,o,a,h))},quadraticBezierTo:function(t,e,i,n){var s,r,o=this.getEndPoint();return t instanceof d?(s=t,r=e):(s=new d(i,n),r=new d(t,e)),this.add(new a(o,s,r))},draw:function(t,e){for(var i=0;i<this.curves.length;i++){var n=this.curves[i];n.active&&n.draw(t,e)}return t},ellipseTo:function(t,e,i,n,s,r){var o=new l(0,0,t,e,i,n,s,r),a=this.getEndPoint(this._tmpVec2A),h=o.getStartPoint(this._tmpVec2B);return a.subtract(h),o.x=a.x,o.y=a.y,this.add(o)},fromJSON:function(t){this.curves=[],this.cacheLengths=[],this.startPoint.set(t.x,t.y),this.autoClose=t.autoClose;for(var e=0;e<t.curves.length;e++){var i=t.curves[e];switch(i.type){case"LineCurve":this.add(r.fromJSON(i));break;case"EllipseCurve":this.add(l.fromJSON(i));break;case"SplineCurve":this.add(c.fromJSON(i));break;case"CubicBezierCurve":this.add(u.fromJSON(i));break;case"QuadraticBezierCurve":this.add(a.fromJSON(i))}}return this},getBounds:function(t,e){void 0===t&&(t=new h),void 0===e&&(e=16),t.x=Number.MAX_VALUE,t.y=Number.MAX_VALUE;for(var i=new h,n=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,r=0;r<this.curves.length;r++){var o=this.curves[r];o.active&&(o.getBounds(i,e),t.x=Math.min(t.x,i.x),t.y=Math.min(t.y,i.y),n=Math.max(n,i.right),s=Math.max(s,i.bottom))}return t.right=n,t.bottom=s,t},getCurveLengths:function(){if(this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,i=0;i<this.curves.length;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t},getEndPoint:function(t){return void 0===t&&(t=new d),0<this.curves.length?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),n=this.getCurveLengths(),s=0;s<n.length;){if(n[s]>=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}s++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n<this.curves.length;n++){var s=this.curves[n];if(s.active)for(var r=s.getResolution(t),o=s.getPoints(r),a=0;a<o.length;a++){var h=o[a];e&&e.equals(h)||(i.push(h),e=h)}}return this.autoClose&&1<i.length&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new r([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return this.add(new o(t,e))},toJSON:function(){for(var t=[],e=0;e<this.curves.length;e++)t.push(this.curves[e].toJSON());return{type:"Path",x:this.startPoint.x,y:this.startPoint.y,autoClose:this.autoClose,curves:t}},updateArcLengths:function(){this.cacheLengths=[],this.getCurveLengths()},destroy:function(){this.curves.length=0,this.cacheLengths.length=0,this.startPoint=void 0}});s.register("path",function(t,e){return new f(t,e)}),t.exports=f},function(t,e,i){t.exports={Path:i(947),CubicBezier:i(551),Curve:i(86),Ellipse:i(549),Line:i(548),QuadraticBezier:i(547),Spline:i(545)}},function(t,e){t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},function(t,e){t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},function(t,e){t.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},function(t,e){t.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},function(t,e,i){t.exports={ARNE16:i(275),C64:i(952),CGA:i(951),JMP:i(950),MSX:i(949)}},function(t,e,i){t.exports={GenerateTexture:i(276),Palettes:i(953)}},function(t,e,i){var n=i(0),s=i(553),r=i(552),o=i(12),a=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.cameras=[],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("update",this.update,this),t.once("shutdown",this.shutdown,this)},add:function(t,e,i){return this.addPerspectiveCamera(t,e,i)},addOrthographicCamera:function(t,e){var i=this.scene.sys.game.config;void 0===t&&(t=i.width),void 0===e&&(e=i.height);var n=new s(this.scene,t,e);return this.cameras.push(n),n},addPerspectiveCamera:function(t,e,i){var n=this.scene.sys.game.config;void 0===t&&(t=80),void 0===e&&(e=n.width),void 0===i&&(i=n.height);var s=new r(this.scene,t,e,i);return this.cameras.push(s),s},getCamera:function(t){for(var e=0;e<this.cameras.length;e++)if(this.cameras[e].name===t)return this.cameras[e];return null},removeCamera:function(t){var e=this.cameras.indexOf(t);-1!==e&&this.cameras.splice(e,1)},removeAll:function(){for(;0<this.cameras.length;){this.cameras.pop().destroy()}return this.main},update:function(t,e){for(var i=0,n=this.cameras.length;i<n;++i)this.cameras[i].update(t,e)},shutdown:function(){var t=this.systems.events;t.off("update",this.update,this),t.off("shutdown",this.shutdown,this),this.removeAll()},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});o.register("CameraManager3D",a,"cameras3d"),t.exports=a},function(t,e,i){t.exports={Camera:i(279),CameraManager:i(955),OrthographicCamera:i(553),PerspectiveCamera:i(552)}},function(t,e,i){var n=i(0),s=i(4),r=new n({initialize:function(t){this.camera=s(t,"camera",null),this.left=s(t,"left",null),this.right=s(t,"right",null),this.up=s(t,"up",null),this.down=s(t,"down",null),this.zoomIn=s(t,"zoomIn",null),this.zoomOut=s(t,"zoomOut",null),this.zoomSpeed=s(t,"zoomSpeed",.01),this.accelX=0,this.accelY=0;var e=s(t,"acceleration",null);"number"==typeof e?(this.accelX=e,this.accelY=e):(this.accelX=s(t,"acceleration.x",0),this.accelY=s(t,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=s(t,"drag",null);"number"==typeof i?(this.dragX=i,this.dragY=i):(this.dragX=s(t,"drag.x",0),this.dragY=s(t,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var n=s(t,"maxSpeed",null);"number"==typeof n?(this.maxSpeedX=n,this.maxSpeedY=n):(this.maxSpeedX=s(t,"maxSpeed.x",0),this.maxSpeedY=s(t,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;0<this._speedX?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,0<this._speedX&&(this._speedX=0)),0<this._speedY?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,0<this._speedY&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.1&&(e.zoom=.1))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){var n=i(0),s=i(4),r=new n({initialize:function(t){this.camera=s(t,"camera",null),this.left=s(t,"left",null),this.right=s(t,"right",null),this.up=s(t,"up",null),this.down=s(t,"down",null),this.zoomIn=s(t,"zoomIn",null),this.zoomOut=s(t,"zoomOut",null),this.zoomSpeed=s(t,"zoomSpeed",.01),this.speedX=0,this.speedY=0;var e=s(t,"speed",null);"number"==typeof e?(this.speedX=e,this.speedY=e):(this.speedX=s(t,"speed.x",0),this.speedY=s(t,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this.up&&this.up.isDown?e.scrollY-=this.speedY*t|0:this.down&&this.down.isDown&&(e.scrollY+=this.speedY*t|0),this.left&&this.left.isDown?e.scrollX-=this.speedX*t|0:this.right&&this.right.isDown&&(e.scrollX+=this.speedX*t|0),this.zoomIn&&this.zoomIn.isDown?(e.zoom-=this.zoomSpeed,e.zoom<.1&&(e.zoom=.1)):this.zoomOut&&this.zoomOut.isDown&&(e.zoom+=this.zoomSpeed)}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){t.exports={FixedKeyControl:i(958),SmoothedKeyControl:i(957)}},function(t,e,i){t.exports={Controls:i(959),Scene2D:i(566),Sprite3D:i(956)}},function(t,e,i){var r=i(39);t.exports=function(t,e,i){void 0===i&&(i=0);for(var n=0;n<t.length;n++){var s=t[n];s.x=r(s.x,e.left-i,e.right+i),s.y=r(s.y,e.top-i,e.bottom+i)}return t}},function(t,e){t.exports=function(t){for(var e=0;e<t.length;e++)t[e].visible=!t[e].visible;return t}},function(t,e){t.exports=function(t,e,i,n,s){void 0===s&&(s=!1);var r,o=Math.abs(n-i)/t.length;if(s)for(r=0;r<t.length;r++)t[r][e]+=r*o;else for(r=0;r<t.length;r++)t[r][e]=r*o;return t}},function(t,e,i){var a=i(286);t.exports=function(t,e,i,n,s){void 0===s&&(s=!1);var r,o=Math.abs(n-i)/t.length;if(s)for(r=0;r<t.length;r++)t[r][e]+=a(r*o,i,n);else for(r=0;r<t.length;r++)t[r][e]=a(r*o,i,n);return t}},function(t,e,i){var a=i(287);t.exports=function(t,e,i,n,s){void 0===s&&(s=!1);var r,o=Math.abs(n-i)/t.length;if(s)for(r=0;r<t.length;r++)t[r][e]+=a(r*o,i,n);else for(r=0;r<t.length;r++)t[r][e]=a(r*o,i,n);return t}},function(t,e,i){var n=i(95);t.exports=function(t){return n(t)}},function(t,e,i){var d=i(6);t.exports=function(t,e,i,n,s){var r,o,a,h,l,u;if(void 0===n&&(n=0),void 0===s&&(s=new d),1<t.length)if(0===n){var c=t.length-1;for(r=t[c].x,o=t[c].y,a=c-1;0<=a;a--)h=(u=t[a]).x,l=u.y,u.x=r,u.y=o,r=h,o=l;t[c].x=e,t[c].y=i}else{for(r=t[0].x,o=t[0].y,a=1;a<t.length;a++)h=(u=t[a]).x,l=u.y,u.x=r,u.y=o,r=h,o=l;t[0].x=e,t[0].y=i}else r=t[0].x,o=t[0].y,t[0].x=e,t[0].y=i;return s.x=r,s.y=o,s}},function(t,e,i){var r=i(25);t.exports=function(t,e,i,n,s){return r(t,"y",e,i,n,s)}},function(t,e,i){var a=i(25);t.exports=function(t,e,i,n,s,r,o){return null==i&&(i=e),a(t,"x",e,n,r,o),a(t,"y",i,s,r,o)}},function(t,e,i){var r=i(25);t.exports=function(t,e,i,n,s){return r(t,"x",e,i,n,s)}},function(t,e,i){var s=i(25);t.exports=function(t,e,i,n){return s(t,"visible",e,0,i,n)}},function(t,e){t.exports=function(t,e,i,n,s){for(var r=0;r<t.length;r++)t[r].setTint(e,i,n,s);return t}},function(t,e,i){var r=i(25);t.exports=function(t,e,i,n,s){return r(t,"scaleY",e,i,n,s)}},function(t,e,i){var r=i(25);t.exports=function(t,e,i,n,s){return r(t,"scaleX",e,i,n,s)}},function(t,e,i){var a=i(25);t.exports=function(t,e,i,n,s,r,o){return null==i&&(i=e),a(t,"scaleX",e,n,r,o),a(t,"scaleY",i,s,r,o)}},function(t,e,i){var r=i(25);t.exports=function(t,e,i,n,s){return r(t,"rotation",e,i,n,s)}},function(t,e,i){var a=i(25);t.exports=function(t,e,i,n,s,r,o){return null==i&&(i=e),a(t,"originX",e,n,r,o),a(t,"originY",i,s,r,o)}},function(t,e){t.exports=function(t,e,i){for(var n=0;n<t.length;n++)t[n].setInteractive(e,i);return t}},function(t,e,i){var r=i(25);t.exports=function(t,e,i,n,s){return r(t,"depth",e,i,n,s)}},function(t,e,i){var s=i(25);t.exports=function(t,e,i,n){return s(t,"blendMode",e,0,i,n)}},function(t,e,i){var r=i(25);t.exports=function(t,e,i,n,s){return r(t,"alpha",e,i,n,s)}},function(t,e,i){var r=i(35);t.exports=function(t,e,i,n,s){return r(t,"scaleY",e,i,n,s)}},function(t,e,i){var a=i(35);t.exports=function(t,e,i,n,s,r,o){return null==i&&(i=e),a(t,"scaleX",e,n,r,o),a(t,"scaleY",i,s,r,o)}},function(t,e,i){var r=i(35);t.exports=function(t,e,i,n,s){return r(t,"scaleX",e,i,n,s)}},function(t,e,i){var a=i(288);t.exports=function(t,e,i,n){var s=e.x,r=e.y;if(0===n)return t;for(var o=0;o<t.length;o++)a(t[o],s,r,i,n);return t}},function(t,e,i){var a=i(288),h=i(58);t.exports=function(t,e,i){for(var n=e.x,s=e.y,r=0;r<t.length;r++){var o=t[r];a(o,n,s,i,Math.max(1,h(o.x,o.y,n,s)))}return t}},function(t,e,i){var r=i(35);t.exports=function(t,e,i,n,s){return r(t,"rotation",e,i,n,s)}},function(t,e,i){var n=i(153);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){var n=i(154);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){var n=i(155);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){var n=i(134);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){var n=i(157);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e){t.exports=function(t,e,i){for(var n=0;n<t.length;n++)t[n].anims.play(e,i);return t}},function(t,e,i){var c=i(569);t.exports=function(t,e,i){var n=c({x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},i),s=c({x1:e.x2,y1:e.y2,x2:e.x3,y2:e.y3},i),r=c({x1:e.x3,y1:e.y3,x2:e.x1,y2:e.y1},i);n.pop(),s.pop(),r.pop();for(var o=(n=n.concat(s,r)).length/t.length,a=0,h=0;h<t.length;h++){var l=t[h],u=n[Math.floor(a)];l.x=u.x,l.y=u.y,a+=o}return t}},function(t,e,i){var r=i(570),o=i(290),a=i(289);t.exports=function(t,e,i){void 0===i&&(i=0);var n=r(e,!1,t.length);0<i?o(n,i):i<0&&a(n,Math.abs(i));for(var s=0;s<t.length;s++)t[s].x=n[s].x,t[s].y=n[s].y;return t}},function(t,e,i){var o=i(156);t.exports=function(t,e){for(var i=o(e,t.length),n=0;n<t.length;n++){var s=t[n],r=i[n];s.x=r.x,s.y=r.y}return t}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=6.28);for(var s=i,r=(n-i)/t.length,o=e.width/2,a=e.height/2,h=0;h<t.length;h++)t[h].x=e.x+o*Math.cos(s),t[h].y=e.y+a*Math.sin(s),s+=r;return t}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=6.28);for(var s=i,r=(n-i)/t.length,o=0;o<t.length;o++)t[o].x=e.x+e.radius*Math.cos(s),t[o].y=e.y+e.radius*Math.sin(s),s+=r;return t}},function(t,e,i){var r=i(35);t.exports=function(t,e,i,n,s){return r(t,"y",e,i,n,s)}},function(t,e,i){var a=i(35);t.exports=function(t,e,i,n,s,r,o){return null==i&&(i=e),a(t,"x",e,n,r,o),a(t,"y",i,s,r,o)}},function(t,e,i){var r=i(35);t.exports=function(t,e,i,n,s){return r(t,"x",e,i,n,s)}},function(t,e,i){var r=i(35);t.exports=function(t,e,i,n,s){return r(t,"alpha",e,i,n,s)}},function(t,e,i){var p=i(598),g=i(299),v=i(1),n=i(3),y=new(i(158))({sys:{queueDepthSort:n,events:{once:n}}},0,0,1,1);t.exports=function(t,e){void 0===e&&(e={});var i=v(e,"width",-1),n=v(e,"height",-1),s=v(e,"cellWidth",1),r=v(e,"cellHeight",s),o=v(e,"position",g.TOP_LEFT),a=v(e,"x",0),h=v(e,"y",0),l=0,u=0,c=i*s,d=n*r;y.setPosition(a,h),y.setSize(s,r);for(var f=0;f<t.length;f++)if(p(t[f],y,o),-1===i)u+=r,y.y+=r,u===d&&(u=0,y.x+=s,y.y=h);else if(-1===n)l+=s,y.x+=s,l===c&&(l=0,y.x=a,y.y+=r);else if(l+=s,y.x+=s,l===c&&(l=0,u+=r,y.x=a,y.y+=r,u===d))break;return t}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i=0);for(var n=i;n<t.length;n++){var s=t[n],r=!0;for(var o in e)s[o]!==e[o]&&(r=!1);if(r)return s}return null}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i=0);for(var n=i;n<t.length;n++){var s=t[n],r=!0;for(var o in e)s[o]!==e[o]&&(r=!1);if(r)return s}return null}},function(t,e){t.exports=function(t,e,i){for(var n=0;n<t.length;n++){var s=t[n];e.call(i,s)}return t}},function(t,e,i){var r=i(35);t.exports=function(t,e,i,n,s){return r(t,"angle",e,i,n,s)}},function(t,e,i){var o=i(166),n=i(0),v=i(41),y=i(221),f=i(1009),p=i(9),g=i(1),m=i(4),s=i(74),r=i(301),a=i(679),h=i(674),x=i(106),l=new n({Extends:p,initialize:function(t,e){p.call(this),this.scene=t,this.engine=f.create(e),this.localWorld=this.engine.world;var i=m(e,"gravity",null);if(i&&this.setGravity(i.x,i.y,i.scale),this.walls={left:null,right:null,top:null,bottom:null},g(e,"setBounds",!1)){var n=e.setBounds;if("boolean"==typeof n)this.setBounds();else{var s=g(n,"x",0),r=g(n,"y",0),o=g(n,"width",t.sys.game.config.width),a=g(n,"height",t.sys.game.config.height),h=g(n,"thickness",64),l=g(n,"left",!0),u=g(n,"right",!0),c=g(n,"top",!0),d=g(n,"bottom",!0);this.setBounds(s,r,o,a,h,l,u,c,d)}}this.enabled=m(e,"enabled",!0),this.correction=m(e,"correction",1),this.getDelta=m(e,"getDelta",this.update60Hz),this.autoUpdate=m(e,"autoUpdate",!0),this.drawDebug=m(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:m(e,"debugShowBody",!0),debugShowStaticBody:m(e,"debugShowStaticBody",!0),debugShowVelocity:m(e,"debugShowVelocity",!0),bodyDebugColor:m(e,"debugBodyColor",16711935),staticBodyDebugColor:m(e,"debugBodyColor",255),velocityDebugColor:m(e,"debugVelocityColor",65280),debugShowJoint:m(e,"debugShowJoint",!0),jointDebugColor:m(e,"debugJointColor",0)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy()},setEventsProxy:function(){var s=this,t=this.engine;r.on(t,"beforeUpdate",function(t){s.emit("beforeupdate",t)}),r.on(t,"afterUpdate",function(t){s.emit("afterupdate",t)}),r.on(t,"collisionStart",function(t){var e,i,n=t.pairs;0<n.length&&(e=n[0].bodyA,i=n[0].bodyB),s.emit("collisionstart",t,e,i)}),r.on(t,"collisionActive",function(t){var e,i,n=t.pairs;0<n.length&&(e=n[0].bodyA,i=n[0].bodyB),s.emit("collisionactive",t,e,i)}),r.on(t,"collisionEnd",function(t){var e,i,n=t.pairs;0<n.length&&(e=n[0].bodyA,i=n[0].bodyB),s.emit("collisionend",t,e,i)})},setBounds:function(t,e,i,n,s,r,o,a,h){return 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===s&&(s=128),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-s,e,s,n),this.updateWall(o,"right",t+i,e,s,n),this.updateWall(a,"top",t,e-s,i,s),this.updateWall(h,"bottom",t,e+n,i,s),this},updateWall:function(t,e,i,n,s,r){var o=this.walls[e];t?(o&&h.remove(this.localWorld,o),i+=s/2,n+=r/2,this.walls[e]=this.create(i,n,s,r,{isStatic:!0,friction:0,frictionStatic:0})):(o&&h.remove(this.localWorld,o),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,void 0!==i&&(this.localWorld.gravity.scale=i),this},create:function(t,e,i,n,s){var r=o.rectangle(t,e,i,n,s);return h.add(this.localWorld,r),r},add:function(t){return h.add(this.localWorld,t),this},remove:function(t,e){var i=t.body?t.body:t;return y.removeBody(this.localWorld,i,e),this},removeConstraint:function(t,e){return y.remove(this.localWorld,t,e),this},convertTilemapLayer:function(t,e){var i=t.layer,n=t.getTilesWithin(0,0,i.width,i.height,{isColliding:!0});return this.convertTiles(n,e),this},convertTiles:function(t,e){if(0===t.length)return this;for(var i=0;i<t.length;i++)new a(this,t[i],e);return this},nextGroup:function(t){return s.nextGroup(t)},nextCategory:function(){return s.nextCategory()},pause:function(){return this.enabled=!1,this.emit("pause"),this},resume:function(){return this.enabled=!0,this.emit("resume"),this},update:function(t,e){this.enabled&&this.autoUpdate&&f.update(this.engine,this.getDelta(t,e),this.correction)},step:function(t,e){f.update(this.engine,t,e)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},postUpdate:function(){if(this.drawDebug){var t,e,i=this.debugGraphic,n=y.allBodies(this.localWorld);for(i.clear(),i.lineStyle(1,this.defaults.bodyDebugColor),i.beginPath(),t=0;t<n.length;t++){if(!n[t].render.visible)return;for(e=0;e<n[t].parts.length;e++){var s=n[t].parts[e].vertices;i.moveTo(s[0].x,s[0].y);for(var r=1;r<s.length;r++)i.lineTo(s[r].x,s[r].y);i.lineTo(s[0].x,s[0].y),i.strokePath()}}if(i.closePath(),this.defaults.debugShowJoint){i.lineStyle(2,this.defaults.jointDebugColor);var o=y.allConstraints(this.localWorld);for(t=0;t<o.length;t++){var a=o[t];if(a.render.visible&&a.pointA&&a.pointB){a.render.lineWidth&&i.lineStyle(a.render.lineWidth,v.colorToNumber(a.render.strokeStyle));var h,l,u=a.bodyA,c=a.bodyB;if(h=u?x.add(u.position,a.pointA):a.pointA,"pin"===a.render.type)i.beginPath(),i.arc(h.x,h.y,3,0,2*Math.PI),i.closePath();else{if(l=c?x.add(c.position,a.pointB):a.pointB,i.beginPath(),i.moveTo(h.x,h.y),"spring"===a.render.type){var d,f=x.sub(l,h),p=x.perp(x.normalise(f)),g=Math.ceil(v.clamp(a.length/5,12,20));for(e=1;e<g;e+=1)d=e%2==0?1:-1,i.lineTo(h.x+f.x*(e/g)+p.x*d*4,h.y+f.y*(e/g)+p.y*d*4)}i.lineTo(l.x,l.y)}a.render.lineWidth&&i.strokePath(),a.render.anchors&&(i.fillStyle(v.colorToNumber(a.render.strokeStyle)),i.beginPath(),i.arc(h.x,h.y,6,0,2*Math.PI),i.arc(l.x,l.y,6,0,2*Math.PI),i.closePath(),i.fillPath())}}}}},fromPath:function(t,n){void 0===n&&(n=[]);return t.replace(/L?\s*([\-\d\.e]+)[\s,]*([\-\d\.e]+)*/gi,function(t,e,i){n.push({x:parseFloat(e),y:parseFloat(i)})}),n},shutdown:function(){r.off(this.engine),this.removeAllListeners(),h.clear(this.localWorld,!1),f.clear(this.engine)},destroy:function(){this.shutdown()}});t.exports=l},function(t,e,i){var r={};t.exports=r;var s=i(674),y=i(331),m=i(1010),x=i(1011),w=i(1032),o=i(1012),b=i(301),T=i(221),S=i(300),a=i(41),h=i(74);!function(){r.create=function(t,e){e=(e=a.isElement(t)?e:t)||{},((t=a.isElement(t)?t:null)||e.render)&&a.warn("Engine.create: engine.render is deprecated (see docs)");var i={positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},timing:{timestamp:0,timeScale:1},broadphase:{controller:o}},n=a.extend(i,e);return n.world=e.world||s.create(n.world),n.pairs=x.create(),n.broadphase=n.broadphase.controller.create(n.broadphase),n.metrics=n.metrics||{extended:!1},n.metrics=w.create(n.metrics),n},r.update=function(t,e,i){e=e||1e3/60,i=i||1;var n,s=t.world,r=t.timing,o=t.broadphase,a=[];r.timestamp+=e*r.timeScale;var h={timestamp:r.timestamp};b.trigger(t,"beforeUpdate",h);var l=T.allBodies(s),u=T.allConstraints(s);for(w.reset(t.metrics),t.enableSleeping&&y.update(l,r.timeScale),g(l,s.gravity),v(l,e,r.timeScale,i,s.bounds),S.preSolveAll(l),n=0;n<t.constraintIterations;n++)S.solveAll(u,r.timeScale);S.postSolveAll(l),o.controller?(s.isModified&&o.controller.clear(o),o.controller.update(o,l,t,s.isModified),a=o.pairsList):a=l,s.isModified&&T.setModified(s,!1,!1,!0);var c=o.detector(a,t),d=t.pairs,f=r.timestamp;for(x.update(d,c,f),x.removeOld(d,f),t.enableSleeping&&y.afterCollisions(d.list,r.timeScale),0<d.collisionStart.length&&b.trigger(t,"collisionStart",{pairs:d.collisionStart}),m.preSolvePosition(d.list),n=0;n<t.positionIterations;n++)m.solvePosition(d.list,l,r.timeScale);for(m.postSolvePosition(l),S.preSolveAll(l),n=0;n<t.constraintIterations;n++)S.solveAll(u,r.timeScale);for(S.postSolveAll(l),m.preSolveVelocity(d.list),n=0;n<t.velocityIterations;n++)m.solveVelocity(d.list,r.timeScale);return 0<d.collisionActive.length&&b.trigger(t,"collisionActive",{pairs:d.collisionActive}),0<d.collisionEnd.length&&b.trigger(t,"collisionEnd",{pairs:d.collisionEnd}),w.update(t.metrics,t),p(l),b.trigger(t,"afterUpdate",h),t},r.merge=function(t,e){if(a.extend(t,e),e.world){t.world=e.world,r.clear(t);for(var i=T.allBodies(t.world),n=0;n<i.length;n++){var s=i[n];y.set(s,!1),s.id=a.nextId()}}},r.clear=function(t){var e=t.world;x.clear(t.pairs);var i=t.broadphase;if(i.controller){var n=T.allBodies(e);i.controller.clear(i),i.controller.update(i,n,t,!0)}};var p=function(t){for(var e=0;e<t.length;e++){var i=t[e];i.force.x=0,i.force.y=0,i.torque=0}},g=function(t,e){var i=void 0!==e.scale?e.scale:.001;if((0!==e.x||0!==e.y)&&0!==i)for(var n=0;n<t.length;n++){var s=t[n];s.ignoreGravity||s.isStatic||s.isSleeping||(s.force.y+=s.mass*e.y*i,s.force.x+=s.mass*e.x*i)}},v=function(t,e,i,n,s){for(var r=0;r<t.length;r++){var o=t[r];o.isStatic||o.isSleeping||h.update(o,e,i,n)}}}()},function(t,e,i){var Y={};t.exports=Y;var r=i(126),X=i(106),N=i(41),o=i(125);Y._restingThresh=4,Y._restingThreshTangent=6,Y._positionDampen=.9,Y._positionWarming=.8,Y._frictionNormalMultiplier=5,Y.preSolvePosition=function(t){var e,i,n;for(e=0;e<t.length;e++)(i=t[e]).isActive&&(n=i.activeContacts.length,i.collision.parentA.totalContacts+=n,i.collision.parentB.totalContacts+=n)},Y.solvePosition=function(t,e,i){var n,s,r,o,a,h,l,u,c,d,f,p,g,v,y,m,x=i*Y._positionDampen;for(n=0;n<e.length;n++){var w=e[n];w.previousPositionImpulse.x=w.positionImpulse.x,w.previousPositionImpulse.y=w.positionImpulse.y}for(n=0;n<t.length;n++)(o=t[n]).isActive&&!o.isSensor&&(h=(a=o.collision).parentA,l=a.parentB,u=a.normal,f=h.previousPositionImpulse,p=l.previousPositionImpulse,d=a.penetration,v=p.x-f.x+d.x,y=p.y-f.y+d.y,c=(s=u.x)*v+(r=u.y)*y,m=((o.separation=c)-o.slop)*x,(h.isStatic||l.isStatic)&&(m*=2),h.isStatic||h.isSleeping||(g=m/h.totalContacts,h.positionImpulse.x+=s*g,h.positionImpulse.y+=r*g),l.isStatic||l.isSleeping||(g=m/l.totalContacts,l.positionImpulse.x-=s*g,l.positionImpulse.y-=r*g))},Y.postSolvePosition=function(t){for(var e=0;e<t.length;e++){var i=t[e];if((i.totalContacts=0)!==i.positionImpulse.x||0!==i.positionImpulse.y){for(var n=0;n<i.parts.length;n++){var s=i.parts[n];r.translate(s.vertices,i.positionImpulse),o.update(s.bounds,s.vertices,i.velocity),s.position.x+=i.positionImpulse.x,s.position.y+=i.positionImpulse.y}i.positionPrev.x+=i.positionImpulse.x,i.positionPrev.y+=i.positionImpulse.y,X.dot(i.positionImpulse,i.velocity)<0?(i.positionImpulse.x=0,i.positionImpulse.y=0):(i.positionImpulse.x*=Y._positionWarming,i.positionImpulse.y*=Y._positionWarming)}}},Y.preSolveVelocity=function(t){var e,i,n,s,r,o,a,h,l,u,c,d,f,p,g=X._temp[0],v=X._temp[1];for(e=0;e<t.length;e++)if((n=t[e]).isActive&&!n.isSensor)for(s=n.activeContacts,o=(r=n.collision).parentA,a=r.parentB,h=r.normal,l=r.tangent,i=0;i<s.length;i++)c=(u=s[i]).vertex,d=u.normalImpulse,f=u.tangentImpulse,0===d&&0===f||(g.x=h.x*d+l.x*f,g.y=h.y*d+l.y*f,o.isStatic||o.isSleeping||(p=X.sub(c,o.position,v),o.positionPrev.x+=g.x*o.inverseMass,o.positionPrev.y+=g.y*o.inverseMass,o.anglePrev+=X.cross(p,g)*o.inverseInertia),a.isStatic||a.isSleeping||(p=X.sub(c,a.position,v),a.positionPrev.x-=g.x*a.inverseMass,a.positionPrev.y-=g.y*a.inverseMass,a.anglePrev-=X.cross(p,g)*a.inverseInertia))},Y.solveVelocity=function(t,e){for(var i=e*e,n=X._temp[0],s=X._temp[1],r=X._temp[2],o=X._temp[3],a=X._temp[4],h=X._temp[5],l=0;l<t.length;l++){var u=t[l];if(u.isActive&&!u.isSensor){var c=u.collision,d=c.parentA,f=c.parentB,p=c.normal,g=c.tangent,v=u.activeContacts,y=1/v.length;d.velocity.x=d.position.x-d.positionPrev.x,d.velocity.y=d.position.y-d.positionPrev.y,f.velocity.x=f.position.x-f.positionPrev.x,f.velocity.y=f.position.y-f.positionPrev.y,d.angularVelocity=d.angle-d.anglePrev,f.angularVelocity=f.angle-f.anglePrev;for(var m=0;m<v.length;m++){var x=v[m],w=x.vertex,b=X.sub(w,d.position,s),T=X.sub(w,f.position,r),S=X.add(d.velocity,X.mult(X.perp(b),d.angularVelocity),o),A=X.add(f.velocity,X.mult(X.perp(T),f.angularVelocity),a),C=X.sub(S,A,h),M=X.dot(p,C),_=X.dot(g,C),E=Math.abs(_),P=N.sign(_),k=(1+u.restitution)*M,L=N.clamp(u.separation+M,0,1)*Y._frictionNormalMultiplier,F=_,R=1/0;E>u.friction*u.frictionStatic*L*i&&(R=E,F=N.clamp(u.friction*P*i,-R,R));var O=X.cross(b,p),B=X.cross(T,p),D=y/(d.inverseMass+f.inverseMass+d.inverseInertia*O*O+f.inverseInertia*B*B);if(k*=D,F*=D,M<0&&M*M>Y._restingThresh*i)x.normalImpulse=0;else{var I=x.normalImpulse;x.normalImpulse=Math.min(x.normalImpulse+k,0),k=x.normalImpulse-I}if(_*_>Y._restingThreshTangent*i)x.tangentImpulse=0;else{var z=x.tangentImpulse;x.tangentImpulse=N.clamp(x.tangentImpulse+F,-R,R),F=x.tangentImpulse-z}n.x=p.x*k+g.x*F,n.y=p.y*k+g.y*F,d.isStatic||d.isSleeping||(d.positionPrev.x+=n.x*d.inverseMass,d.positionPrev.y+=n.y*d.inverseMass,d.anglePrev+=X.cross(b,n)*d.inverseInertia),f.isStatic||f.isSleeping||(f.positionPrev.x-=n.x*f.inverseMass,f.positionPrev.y-=n.y*f.inverseMass,f.anglePrev-=X.cross(T,n)*f.inverseInertia)}}}}},function(t,e,i){var n={};t.exports=n;var d=i(610),s=i(41);n.create=function(t){return s.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},n.update=function(t,e,i){var n,s,r,o,a=t.list,h=t.table,l=t.collisionStart,u=t.collisionEnd,c=t.collisionActive;for(l.length=0,u.length=0,o=c.length=0;o<a.length;o++)a[o].confirmedActive=!1;for(o=0;o<e.length;o++)(n=e[o]).collided&&((r=h[s=d.id(n.bodyA,n.bodyB)])?(r.isActive?c.push(r):l.push(r),d.update(r,n,i),r.confirmedActive=!0):(r=d.create(n,i),h[s]=r,l.push(r),a.push(r)));for(o=0;o<a.length;o++)(r=a[o]).confirmedActive||(d.setActive(r,!1,i),u.push(r))},n.removeOld=function(t,e){var i,n,s,r,o=t.list,a=t.table,h=[];for(r=0;r<o.length;r++)(n=(i=o[r]).collision).bodyA.isSleeping||n.bodyB.isSleeping?i.timeUpdated=e:1e3<e-i.timeUpdated&&h.push(r);for(r=0;r<h.length;r++)delete a[(i=o[s=h[r]-r]).id],o.splice(s,1)},n.clear=function(t){return t.table={},t.list.length=0,t.collisionStart.length=0,t.collisionActive.length=0,t.collisionEnd.length=0,t}},function(t,e,i){var n={};t.exports=n;var h=i(610),s=i(678),r=i(41);!function(){n.create=function(t){var e={controller:n,detector:s.collisions,buckets:{},pairs:{},pairsList:[],bucketWidth:48,bucketHeight:48};return r.extend(e,t)},n.update=function(t,e,i,n){var s,r,o,a,h,l=i.world,u=t.buckets,c=!1,d=i.metrics;for(s=d.broadphaseTests=0;s<e.length;s++){var f=e[s];if((!f.isSleeping||n)&&!(f.bounds.max.x<l.bounds.min.x||f.bounds.min.x>l.bounds.max.x||f.bounds.max.y<l.bounds.min.y||f.bounds.min.y>l.bounds.max.y)){var p=x(t,f);if(!f.region||p.id!==f.region.id||n){d.broadphaseTests+=1,f.region&&!n||(f.region=p);var g=m(p,f.region);for(r=g.startCol;r<=g.endCol;r++)for(o=g.startRow;o<=g.endRow;o++){a=u[h=w(r,o)];var v=r>=p.startCol&&r<=p.endCol&&o>=p.startRow&&o<=p.endRow,y=r>=f.region.startCol&&r<=f.region.endCol&&o>=f.region.startRow&&o<=f.region.endRow;!v&&y&&y&&a&&S(t,a,f),(f.region===p||v&&!y||n)&&(a||(a=b(u,h)),T(t,a,f))}f.region=p,c=!0}}}c&&(t.pairsList=A(t))},n.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]};var m=function(t,e){var i=Math.min(t.startCol,e.startCol),n=Math.max(t.endCol,e.endCol),s=Math.min(t.startRow,e.startRow),r=Math.max(t.endRow,e.endRow);return a(i,n,s,r)},x=function(t,e){var i=e.bounds,n=Math.floor(i.min.x/t.bucketWidth),s=Math.floor(i.max.x/t.bucketWidth),r=Math.floor(i.min.y/t.bucketHeight),o=Math.floor(i.max.y/t.bucketHeight);return a(n,s,r,o)},a=function(t,e,i,n){return{id:t+","+e+","+i+","+n,startCol:t,endCol:e,startRow:i,endRow:n}},w=function(t,e){return"C"+t+"R"+e},b=function(t,e){return t[e]=[]},T=function(t,e,i){for(var n=0;n<e.length;n++){var s=e[n];if(!(i.id===s.id||i.isStatic&&s.isStatic)){var r=h.id(i,s),o=t.pairs[r];o?o[2]+=1:t.pairs[r]=[i,s,1]}}e.push(i)},S=function(t,e,i){e.splice(e.indexOf(i),1);for(var n=0;n<e.length;n++){var s=e[n],r=h.id(i,s),o=t.pairs[r];o&&(o[2]-=1)}},A=function(t){var e,i,n=[];e=r.keys(t.pairs);for(var s=0;s<e.length;s++)0<(i=t.pairs[e[s]])[2]?n.push(i):delete t.pairs[e[s]];return n}}()},function(t,e,i){var n={};t.exports=n;var s=i(675),r=i(41);n.name="matter-js",n.version="0.13.1",n.uses=[],n.used=[],n.use=function(){s.use(n,Array.prototype.slice.call(arguments))},n.before=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathBefore(n,t,e)},n.after=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathAfter(n,t,e)}},function(t,e,i){var a=i(302),n=i(0),s=i(611),h=i(2),l=i(1),r=i(291),o=i(34),u=i(6),c=new n({Extends:o,Mixins:[s.Bounce,s.Collision,s.Force,s.Friction,s.Gravity,s.Mass,s.Sensor,s.SetBody,s.Sleep,s.Static,s.Transform,s.Velocity,r],initialize:function(t,e,i,n,s,r){h.call(this,t.scene,"Image"),this.anims=new a(this),this.setTexture(n,s),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new u(e,i);var o=l(r,"shape",null);o?this.setBody(o,r):this.setRectangle(this.width,this.height,r),this.setPosition(e,i),this.initPipeline("TextureTintPipeline")}});t.exports=c},function(t,e,i){var n=i(0),s=i(611),a=i(2),h=i(1),r=i(69),o=i(291),l=i(6),u=new n({Extends:r,Mixins:[s.Bounce,s.Collision,s.Force,s.Friction,s.Gravity,s.Mass,s.Sensor,s.SetBody,s.Sleep,s.Static,s.Transform,s.Velocity,o],initialize:function(t,e,i,n,s,r){a.call(this,t.scene,"Image"),this.setTexture(n,s),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new l(e,i);var o=h(r,"shape",null);o?this.setBody(o,r):this.setRectangle(this.width,this.height,r),this.setPosition(e,i),this.initPipeline("TextureTintPipeline")}});t.exports=u},function(t,e,i){var f={};t.exports=f;var m=i(221),g=i(300),v=i(41),x=i(74),p=i(166);f.stack=function(t,e,i,n,s,r,o){for(var a,h=m.create({label:"Stack"}),l=t,u=e,c=0,d=0;d<n;d++){for(var f=0,p=0;p<i;p++){var g=o(l,u,p,d,a,c);if(g){var v=g.bounds.max.y-g.bounds.min.y,y=g.bounds.max.x-g.bounds.min.x;f<v&&(f=v),x.translate(g,{x:.5*y,y:.5*v}),l=g.bounds.max.x+s,m.addBody(h,g),a=g,c+=1}else l+=s}u+=f+r,l=t}return h},f.chain=function(t,e,i,n,s,r){for(var o=t.bodies,a=1;a<o.length;a++){var h=o[a-1],l=o[a],u=h.bounds.max.y-h.bounds.min.y,c=h.bounds.max.x-h.bounds.min.x,d=l.bounds.max.y-l.bounds.min.y,f={bodyA:h,pointA:{x:c*e,y:u*i},bodyB:l,pointB:{x:(l.bounds.max.x-l.bounds.min.x)*n,y:d*s}},p=v.extend(f,r);m.addConstraint(t,g.create(p))}return t.label+=" Chain",t},f.mesh=function(t,e,i,n,s){var r,o,a,h,l,u=t.bodies;for(r=0;r<i;r++){for(o=1;o<e;o++)a=u[o-1+r*e],h=u[o+r*e],m.addConstraint(t,g.create(v.extend({bodyA:a,bodyB:h},s)));if(0<r)for(o=0;o<e;o++)a=u[o+(r-1)*e],h=u[o+r*e],m.addConstraint(t,g.create(v.extend({bodyA:a,bodyB:h},s))),n&&0<o&&(l=u[o-1+(r-1)*e],m.addConstraint(t,g.create(v.extend({bodyA:l,bodyB:h},s)))),n&&o<e-1&&(l=u[o+1+(r-1)*e],m.addConstraint(t,g.create(v.extend({bodyA:l,bodyB:h},s))))}return t.label+=" Mesh",t},f.pyramid=function(h,t,l,u,c,e,d){return f.stack(h,t,l,u,c,e,function(t,e,i,n,s,r){var o=Math.min(u,Math.ceil(l/2)),a=s?s.bounds.max.x-s.bounds.min.x:0;if(!(o<n||i<(n=o-n)||l-1-n<i))return 1===r&&x.translate(s,{x:(i+(l%2==1?1:-1))*a,y:0}),d(h+(s?i*a:0)+i*c,e,i,n,s,r)})},f.newtonsCradle=function(t,e,i,n,s){for(var r=m.create({label:"Newtons Cradle"}),o=0;o<i;o++){var a=p.circle(t+o*(1.9*n),e+s,n,{inertia:1/0,restitution:1,friction:0,frictionAir:1e-4,slop:1}),h=g.create({pointA:{x:t+o*(1.9*n),y:e},bodyB:a});m.addBody(r,a),m.addConstraint(r,h)}return r},f.car=function(t,e,i,n,s){var r=x.nextGroup(!0),o=.5*-i+20,a=.5*i-20,h=m.create({label:"Car"}),l=p.rectangle(t,e,i,n,{collisionFilter:{group:r},chamfer:{radius:.5*n},density:2e-4}),u=p.circle(t+o,e+0,s,{collisionFilter:{group:r},friction:.8}),c=p.circle(t+a,e+0,s,{collisionFilter:{group:r},friction:.8}),d=g.create({bodyB:l,pointB:{x:o,y:0},bodyA:u,stiffness:1,length:0}),f=g.create({bodyB:l,pointB:{x:a,y:0},bodyA:c,stiffness:1,length:0});return m.addBody(h,l),m.addBody(h,u),m.addBody(h,c),m.addConstraint(h,d),m.addConstraint(h,f),h},f.softBody=function(t,e,i,n,s,r,o,a,h,l){h=v.extend({inertia:1/0},h),l=v.extend({stiffness:.2,render:{type:"line",anchors:!1}},l);var u=f.stack(t,e,i,n,s,r,function(t,e){return p.circle(t,e,a,h)});return f.mesh(u,i,n,o,l),u.label="Soft Body",u}},function(t,e){function h(t,e,i){i=i||0;var n,s,r,o,a,h,l,u=[0,0];return n=t[1][1]-t[0][1],s=t[0][0]-t[1][0],r=n*t[0][0]+s*t[0][1],o=e[1][1]-e[0][1],a=e[0][0]-e[1][0],h=o*e[0][0]+a*e[0][1],v(l=n*a-o*s,0,i)||(u[0]=(a*r-s*h)/l,u[1]=(n*h-o*r)/l),u}function s(t,e,i,n){var s=e[0]-t[0],r=e[1]-t[1],o=n[0]-i[0],a=n[1]-i[1];if(o*r-a*s==0)return!1;var h=(s*(i[1]-t[1])+r*(t[0]-i[0]))/(o*r-a*s),l=(o*(t[1]-i[1])+a*(i[0]-t[0]))/(a*s-o*r);return 0<=h&&h<=1&&0<=l&&l<=1}function l(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function A(t,e,i){return 0<l(t,e,i)}function C(t,e,i){return 0<=l(t,e,i)}function M(t,e,i){return l(t,e,i)<0}function _(t,e,i){return l(t,e,i)<=0}t.exports={decomp:function(t){var e=function t(e){var i=[],n=[],s=[],r=[];var o=Number.MAX_VALUE;for(var a=0;a<e.length;++a)if(L(e,a))for(var h=0;h<e.length;++h)if(p(e,a,h)){n=t(g(e,a,h,r)),s=t(g(e,h,a,r));for(var l=0;l<s.length;l++)n.push(s[l]);n.length<o&&(o=(i=n).length,i.push([P(e,a),P(e,h)]))}return i}(t);return 0<e.length?function t(e,i){if(0===i.length)return[e];{if(i instanceof Array&&i.length&&i[0]instanceof Array&&2===i[0].length&&i[0][0]instanceof Array){for(var n=[e],s=0;s<i.length;s++)for(var r=i[s],o=0;o<n.length;o++){var a=n[o],h=t(a,r);if(h){n.splice(o,1),n.push(h[0],h[1]);break}}return n}var r=i,s=e.indexOf(r[0]),o=e.indexOf(r[1]);return-1!==s&&-1!==o&&[g(e,s,o),g(e,o,s)]}}(t,e):[t]},quickDecomp:function t(e,i,n,s,r,o,a){o=o||100;a=a||0;r=r||25;i=void 0!==i?i:[];n=n||[];s=s||[];var h=[0,0],l=[0,0],u=[0,0];var c=0,d=0,f=0,p=0;var g=0,v=0,y=0;var m=[],x=[];var w=e,b=e;if(b.length<3)return i;a++;if(o<a)return console.warn("quickDecomp: max level ("+o+") reached."),i;for(var T=0;T<e.length;++T)if(L(w,T)){n.push(w[T]),c=d=Number.MAX_VALUE;for(var S=0;S<e.length;++S)A(P(w,T-1),P(w,T),P(w,S))&&_(P(w,T-1),P(w,T),P(w,S-1))&&(u=F(P(w,T-1),P(w,T),P(w,S),P(w,S-1)),M(P(w,T+1),P(w,T),u)&&(f=E(w[T],u))<d&&(d=f,l=u,v=S)),A(P(w,T+1),P(w,T),P(w,S+1))&&_(P(w,T+1),P(w,T),P(w,S))&&(u=F(P(w,T+1),P(w,T),P(w,S),P(w,S+1)),A(P(w,T-1),P(w,T),u)&&(f=E(w[T],u))<c&&(c=f,h=u,g=S));if(v===(g+1)%e.length)u[0]=(l[0]+h[0])/2,u[1]=(l[1]+h[1])/2,s.push(u),T<g?(k(m,w,T,g+1),m.push(u),x.push(u),0!==v&&k(x,w,v,w.length),k(x,w,0,T+1)):(0!==T&&k(m,w,T,w.length),k(m,w,0,g+1),m.push(u),x.push(u),k(x,w,v,T+1));else{if(g<v&&(g+=e.length),p=Number.MAX_VALUE,g<v)return i;for(var S=v;S<=g;++S)C(P(w,T-1),P(w,T),P(w,S))&&_(P(w,T+1),P(w,T),P(w,S))&&(f=E(P(w,T),P(w,S)))<p&&(p=f,y=S%e.length);T<y?(k(m,w,T,y+1),0!==y&&k(x,w,y,b.length),k(x,w,0,T+1)):(0!==T&&k(m,w,T,b.length),k(m,w,0,y+1),k(x,w,y,T+1))}return m.length<x.length?(t(m,i,n,s,r,o,a),t(x,i,n,s,r,o,a)):(t(x,i,n,s,r,o,a),t(m,i,n,s,r,o,a)),i}i.push(e);return i},isSimple:function(t){var e,i=t;for(e=0;e<i.length-1;e++)for(var n=0;n<e-1;n++)if(s(i[e],i[e+1],i[n],i[n+1]))return!1;for(e=1;e<i.length-2;e++)if(s(i[0],i[i.length-1],i[e],i[e+1]))return!1;return!0},removeCollinearPoints:function(t,e){for(var i=0,n=t.length-1;3<t.length&&0<=n;--n)r(P(t,n-1),P(t,n),P(t,n+1),e)&&(t.splice(n%t.length,1),i++);return i},makeCCW:function(t){for(var e=0,i=t,n=1;n<t.length;++n)(i[n][1]<i[e][1]||i[n][1]===i[e][1]&&i[n][0]>i[e][0])&&(e=n);A(P(t,e-1),P(t,e),P(t,e+1))||function(t){for(var e=[],i=t.length,n=0;n!==i;n++)e.push(t.pop());for(var n=0;n!==i;n++)t[n]=e[n]}(t)}};var u=[],c=[];function r(t,e,i,n){if(n){var s=u,r=c;s[0]=e[0]-t[0],s[1]=e[1]-t[1],r[0]=i[0]-e[0],r[1]=i[1]-e[1];var o=s[0]*r[0]+s[1]*r[1],a=Math.sqrt(s[0]*s[0]+s[1]*s[1]),h=Math.sqrt(r[0]*r[0]+r[1]*r[1]);return Math.acos(o/(a*h))<n}return 0===l(t,e,i)}function E(t,e){var i=e[0]-t[0],n=e[1]-t[1];return i*i+n*n}function P(t,e){var i=t.length;return t[e<0?e%i+i:e%i]}function k(t,e,i,n){for(var s=i;s<n;s++)t.push(e[s])}function L(t,e){return M(P(t,e-1),P(t,e),P(t,e+1))}var d=[],f=[];function p(t,e,i){var n,s,r=d,o=f;if(C(P(t,e+1),P(t,e),P(t,i))&&_(P(t,e-1),P(t,e),P(t,i)))return!1;s=E(P(t,e),P(t,i));for(var a=0;a!==t.length;++a)if((a+1)%t.length!==e&&a!==e&&C(P(t,e),P(t,i),P(t,a+1))&&_(P(t,e),P(t,i),P(t,a))&&(r[0]=P(t,e),r[1]=P(t,i),o[0]=P(t,a),o[1]=P(t,a+1),n=h(r,o),E(P(t,e),n)<s))return!1;return!0}function g(t,e,i,n){var s=n||[];if(s.length=0,e<i)for(var r=e;r<=i;r++)s.push(t[r]);else{for(r=0;r<=i;r++)s.push(t[r]);for(r=e;r<t.length;r++)s.push(t[r])}return s}function F(t,e,i,n,s){s=s||0;var r=e[1]-t[1],o=t[0]-e[0],a=r*t[0]+o*t[1],h=n[1]-i[1],l=i[0]-n[0],u=h*i[0]+l*i[1],c=r*l-h*o;return v(c,0,s)?[0,0]:[(l*a-o*u)/c,(r*u-h*a)/c]}function v(t,e,i){return i=i||0,Math.abs(t-e)<i}},function(t,e,i){var h=i(166),n=i(0),d=i(1016),o=i(300),s=i(1048),f=i(1015),a=i(1014),r=i(679),l=i(1034),u=new n({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},rectangle:function(t,e,i,n,s){var r=h.rectangle(t,e,i,n,s);return this.world.add(r),r},trapezoid:function(t,e,i,n,s,r){var o=h.trapezoid(t,e,i,n,s,r);return this.world.add(o),o},circle:function(t,e,i,n,s){var r=h.circle(t,e,i,n,s);return this.world.add(r),r},polygon:function(t,e,i,n,s){var r=h.polygon(t,e,i,n,s);return this.world.add(r),r},fromVertices:function(t,e,i,n,s,r,o){var a=h.fromVertices(t,e,i,n,s,r,o);return this.world.add(a),a},imageStack:function(n,s,t,e,i,r,o,a,h){void 0===o&&(o=0),void 0===a&&(a=0),void 0===h&&(h={});var l=this.world,u=this.sys.displayList;h.addToWorld=!1;var c=d.stack(t,e,i,r,o,a,function(t,e){var i=new f(l,t,e,n,s,h);return u.add(i),i.body});return l.add(c),c},stack:function(t,e,i,n,s,r,o){var a=d.stack(t,e,i,n,s,r,o);return this.world.add(a),a},pyramid:function(t,e,i,n,s,r,o){var a=d.pyramid(t,e,i,n,s,r,o);return this.world.add(a),a},chain:function(t,e,i,n,s,r){return d.chain(t,e,i,n,s,r)},mesh:function(t,e,i,n,s){return d.mesh(t,e,i,n,s)},newtonsCradle:function(t,e,i,n,s){var r=d.newtonsCradle(t,e,i,n,s);return this.world.add(r),r},car:function(t,e,i,n,s){var r=d.car(t,e,i,n,s);return this.world.add(r),r},softBody:function(t,e,i,n,s,r,o,a,h,l){var u=d.softBody(t,e,i,n,s,r,o,a,h,l);return this.world.add(u),u},joint:function(t,e,i,n,s){return this.constraint(t,e,i,n,s)},spring:function(t,e,i,n,s){return this.constraint(t,e,i,n,s)},constraint:function(t,e,i,n,s){void 0===n&&(n=1),void 0===s&&(s={}),s.bodyA="body"===t.type?t:t.body,s.bodyB="body"===e.type?e:e.body,s.length=i,s.stiffness=n;var r=o.create(s);return this.world.add(r),r},worldConstraint:function(t,e,i,n){void 0===i&&(i=1),void 0===n&&(n={}),n.bodyB="body"===t.type?t:t.body,n.length=e,n.stiffness=i;var s=o.create(n);return this.world.add(s),s},mouseSpring:function(t){return this.pointerConstraint(t)},pointerConstraint:function(t){void 0===t&&(t={}),t.hasOwnProperty("render")||(t.render={visible:!1});var e=new l(this.scene,this.world,t);return this.world.add(e.constraint),e},image:function(t,e,i,n,s){var r=new f(this.world,t,e,i,n,s);return this.sys.displayList.add(r),r},tileBody:function(t,e){return new r(this.world,t,e)},sprite:function(t,e,i,n,s){var r=new a(this.world,t,e,i,n,s);return this.sys.displayList.add(r),this.sys.updateList.add(r),r},gameObject:function(t,e){return s(this.world,t,e)},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=u},function(t,e,i){var r=i(1025),n=i(0),a=i(333),f=i(1024),p=i(9),g=i(1),d=i(111),v=i(70),s=i(1052),o=i(26),h=i(332),l=new n({Extends:p,initialize:function(t,e){p.call(this),this.scene=t,this.bodies=new v,this.gravity=g(e,"gravity",0),this.cellSize=g(e,"cellSize",64),this.collisionMap=new f,this.timeScale=g(e,"timeScale",1),this.maxStep=g(e,"maxStep",.05),this.enabled=!0,this.drawDebug=g(e,"debug",!1),this.debugGraphic;var i=g(e,"maxVelocity",100);if(this.defaults={debugShowBody:g(e,"debugShowBody",!0),debugShowVelocity:g(e,"debugShowVelocity",!0),bodyDebugColor:g(e,"debugBodyColor",16711935),velocityDebugColor:g(e,"debugVelocityColor",65280),maxVelocityX:g(e,"maxVelocityX",i),maxVelocityY:g(e,"maxVelocityY",i),minBounceVelocity:g(e,"minBounceVelocity",40),gravityFactor:g(e,"gravityFactor",1),bounciness:g(e,"bounciness",0)},this.walls={left:null,right:null,top:null,bottom:null},this.delta=0,this._lastId=0,g(e,"setBounds",!1)){var n=e.setBounds;if("boolean"==typeof n)this.setBounds();else{var s=g(n,"x",0),r=g(n,"y",0),o=g(n,"width",t.sys.game.config.width),a=g(n,"height",t.sys.game.config.height),h=g(n,"thickness",64),l=g(n,"left",!0),u=g(n,"right",!0),c=g(n,"top",!0),d=g(n,"bottom",!0);this.setBounds(s,r,o,a,h,l,u,c,d)}}this.drawDebug&&this.createDebugGraphic()},setCollisionMap:function(t,e){if("string"==typeof t){var i=this.scene.cache.tilemap.get(t);if(!i||i.format!==o.WELTMEISTER)return console.warn("The specified key does not correspond to a Weltmeister tilemap: "+t),null;for(var n,s=i.data.layer,r=0;r<s.length;r++)if("collision"===s[r].name){n=s[r];break}void 0===e&&(e=n.tilesize),this.collisionMap=new f(e,n.data)}else Array.isArray(t)?this.collisionMap=new f(e,t):console.warn("Invalid Weltmeister collision map data: "+t);return this.collisionMap},setCollisionMapFromTilemapLayer:function(t,e){void 0===e&&(e={});for(var i=g(e,"slopeProperty",null),n=g(e,"slopeMap",null),s=g(e,"defaultCollidingSlope",null),r=g(e,"defaultNonCollidingSlope",0),o=t.layer,a=o.baseTileWidth,h=[],l=0;l<o.height;l++){h[l]=[];for(var u=0;u<o.width;u++){var c=o.data[l][u];c&&c.collides?null!==i&&d(c.properties,i)?h[l][u]=parseInt(c.properties[i],10):null!==n&&d(n,c.index)?h[l][u]=n[c.index]:h[l][u]=null!==s?s:c.index:h[l][u]=r}}return this.collisionMap=new f(a,h),this.collisionMap},setBounds:function(t,e,i,n,s,r,o,a,h){return 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===s&&(s=64),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-s,e,s,n),this.updateWall(o,"right",t+i,e,s,n),this.updateWall(a,"top",t,e-s,i,s),this.updateWall(h,"bottom",t,e+n,i,s),this},updateWall:function(t,e,i,n,s,r){var o=this.walls[e];t?o?o.resetSize(i,n,s,r):(this.walls[e]=this.create(i,n,s,r),this.walls[e].name=e,this.walls[e].gravityFactor=0,this.walls[e].collides=a.FIXED):(o&&this.bodies.remove(o),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},getNextID:function(){return this._lastId++},create:function(t,e,i,n){var s=new r(this,t,e,i,n);return this.bodies.set(s),s},remove:function(t){this.bodies.delete(t)},pause:function(){return this.enabled=!1,this.emit("pause"),this},resume:function(){return this.enabled=!0,this.emit("resume"),this},update:function(t,e){if(this.enabled&&0!==this.bodies.size){var i,n,s=Math.min(e/1e3,this.maxStep)*this.timeScale;this.delta=s;var r=this.bodies.entries,o=r.length,a={},h=this.cellSize;for(i=0;i<o;i++)(n=r[i]).enabled&&n.update(s);for(i=0;i<o;i++)(n=r[i])&&!n.skipHash()&&this.checkHash(n,a,h);if(this.drawDebug){var l=this.debugGraphic;for(l.clear(),i=0;i<o;i++)(n=r[i])&&n.willDrawDebug()&&n.drawDebug(l)}}},checkHash:function(t,e,i){for(var n={},s=Math.floor(t.pos.x/i),r=Math.floor(t.pos.y/i),o=Math.floor((t.pos.x+t.size.x)/i)+1,a=Math.floor((t.pos.y+t.size.y)/i)+1,h=s;h<o;h++)for(var l=r;l<a;l++)if(e[h])if(e[h][l]){for(var u=e[h][l],c=0;c<u.length;c++)t.touches(u[c])&&!n[u[c].id]&&(n[u[c].id]=!0,this.checkBodies(t,u[c]));u.push(t)}else e[h][l]=[t];else e[h]={},e[h][l]=[t]},checkBodies:function(t,e){t.collides===a.FIXED&&e.collides===a.FIXED||(t.checkAgainst&e.type&&t.check(e),e.checkAgainst&t.type&&e.check(t),t.collides&&e.collides&&t.collides+e.collides>a.ACTIVE&&s(this,t,e))},setCollidesNever:function(t){for(var e=0;e<t.length;e++)t[e].collides=a.NEVER;return this},setLite:function(t){for(var e=0;e<t.length;e++)t[e].collides=a.LITE;return this},setPassive:function(t){for(var e=0;e<t.length;e++)t[e].collides=a.PASSIVE;return this},setActive:function(t){for(var e=0;e<t.length;e++)t[e].collides=a.ACTIVE;return this},setFixed:function(t){for(var e=0;e<t.length;e++)t[e].collides=a.FIXED;return this},setTypeNone:function(t){for(var e=0;e<t.length;e++)t[e].type=h.NONE;return this},setTypeA:function(t){for(var e=0;e<t.length;e++)t[e].type=h.A;return this},setTypeB:function(t){for(var e=0;e<t.length;e++)t[e].type=h.B;return this},setAvsB:function(t){for(var e=0;e<t.length;e++)t[e].type=h.A,t[e].checkAgainst=h.B;return this},setBvsA:function(t){for(var e=0;e<t.length;e++)t[e].type=h.B,t[e].checkAgainst=h.A;return this},setCheckAgainstNone:function(t){for(var e=0;e<t.length;e++)t[e].checkAgainst=h.NONE;return this},setCheckAgainstA:function(t){for(var e=0;e<t.length;e++)t[e].checkAgainst=h.A;return this},setCheckAgainstB:function(t){for(var e=0;e<t.length;e++)t[e].checkAgainst=h.B;return this},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners(),this.scene=null,this.bodies.clear(),this.bodies=null,this.collisionMap=null}});t.exports=l},function(t,e,i){var n=i(0),s=i(681),r=i(34),o=new n({Extends:r,Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t.scene,e,i,n,s),this.body=t.create(e-this.frame.centerX,i-this.frame.centerY,this.width,this.height),((this.body.parent=this).body.gameObject=this).size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=o},function(t,e,i){var n=i(0),s=i(681),r=i(69),o=new n({Extends:r,Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t.scene,e,i,n,s),this.body=t.create(e-this.frame.centerX,i-this.frame.centerY,this.width,this.height),((this.body.parent=this).body.gameObject=this).size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=o},function(t,e,i){var n=i(0),s=i(681),r=new n({Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){this.body=t.create(e,i,n,s),(this.body.parent=this).size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=r},function(t,e,i){var n=i(0),s=i(1022),r=i(1021),o=i(1020),a=new n({initialize:function(t){this.world=t,this.sys=t.scene.sys},body:function(t,e,i,n){return new s(this.world,t,e,i,n)},existing:function(t){var e=t.x-t.frame.centerX,i=t.y-t.frame.centerY,n=t.width,s=t.height;return t.body=this.world.create(e,i,n,s),(t.body.parent=t).body.gameObject=t},image:function(t,e,i,n){var s=new r(this.world,t,e,i,n);return this.sys.displayList.add(s),s},sprite:function(t,e,i,n){var s=new o(this.world,t,e,i,n);return this.sys.displayList.add(s),this.sys.updateList.add(s),s},destroy:function(){this.world=null,this.sys=null}});t.exports=a},function(t,e,i){var n=i(0),s=i(1066),r=new n({initialize:function(t,e){void 0===t&&(t=32),this.tilesize=t,this.data=Array.isArray(e)?e:[],this.width=Array.isArray(e)?e[0].length:0,this.height=Array.isArray(e)?e.length:0,this.lastSlope=55,this.tiledef=s},trace:function(t,e,i,n,s,r){var o={collision:{x:!1,y:!1,slope:!1},pos:{x:t+i,y:e+n},tile:{x:0,y:0}};if(!this.data)return o;var a=Math.ceil(Math.max(Math.abs(i),Math.abs(n))/this.tilesize);if(1<a)for(var h=i/a,l=n/a,u=0;u<a&&(h||l)&&(this.step(o,t,e,h,l,s,r,i,n,u),t=o.pos.x,e=o.pos.y,o.collision.x&&(i=h=0),o.collision.y&&(n=l=0),!o.collision.slope);u++);else this.step(o,t,e,i,n,s,r,i,n,0);return o},step:function(t,e,i,n,s,r,o,a,h,l){var u,c,d=0,f=this.tilesize,p=this.width,g=this.height;if(n){var v=0<n?r:0,y=n<0?f:0,m=Math.max(Math.floor(i/f),0),x=Math.min(Math.ceil((i+o)/f),g);u=Math.floor((t.pos.x+v)/f);var w=Math.floor((e+v)/f);if((0<l||u===w||w<0||p<=w)&&(w=-1),0<=u&&u<p)for(c=m;c<x&&!(-1!==w&&1<(d=this.data[c][w])&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,w,c));c++)if(1===(d=this.data[c][u])||d>this.lastSlope||1<d&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(1<d&&d<=this.lastSlope&&t.collision.slope)break;t.collision.x=!0,t.tile.x=d,t.pos.x=u*f-v+y,e=t.pos.x,a=0;break}}if(s){var b=0<s?o:0,T=s<0?f:0,S=Math.max(Math.floor(t.pos.x/f),0),A=Math.min(Math.ceil((t.pos.x+r)/f),p);c=Math.floor((t.pos.y+b)/f);var C=Math.floor((i+b)/f);if((0<l||c===C||C<0||g<=C)&&(C=-1),0<=c&&c<g)for(u=S;u<A&&!(-1!==C&&1<(d=this.data[C][u])&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,u,C));u++)if(1===(d=this.data[c][u])||d>this.lastSlope||1<d&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(1<d&&d<=this.lastSlope&&t.collision.slope)break;t.collision.y=!0,t.tile.y=d,t.pos.y=c*f-b+T;break}}},checkDef:function(t,e,i,n,s,r,o,a,h,l){var u=this.tiledef[e];if(!u)return!1;var c=this.tilesize,d=(h+u[0])*c,f=(l+u[1])*c,p=(u[2]-u[0])*c,g=(u[3]-u[1])*c,v=u[4],y=i+s+(g<0?o:0)-d,m=n+r+(0<p?a:0)-f;if(0<p*m-g*y){if(s*-g+r*p<0)return v;var x=Math.sqrt(p*p+g*g),w=g/x,b=-p/x,T=y*w+m*b,S=w*T,A=b*T;return s*s+r*r<=S*S+A*A?v||p*(m-r)-g*(y-s)<.5:(t.pos.x=i+s-S,t.pos.y=n+r-A,t.collision.slope={x:p,y:g,nx:w,ny:b},!0)}return!1}});t.exports=r},function(t,e,i){var n=i(0),r=i(333),o=i(1068),a=i(332),h=i(1067),s=new n({initialize:function(t,e,i,n,s){void 0===n&&(n=16),void 0===s&&(s=n),this.world=t,this.gameObject=null,this.enabled=!0,this.parent,this.id=t.getNextID(),this.name="",this.size={x:n,y:s},this.offset={x:0,y:0},this.pos={x:e,y:i},this.last={x:e,y:i},this.vel={x:0,y:0},this.accel={x:0,y:0},this.friction={x:0,y:0},this.maxVel={x:t.defaults.maxVelocityX,y:t.defaults.maxVelocityY},this.standing=!1,this.gravityFactor=t.defaults.gravityFactor,this.bounciness=t.defaults.bounciness,this.minBounceVelocity=t.defaults.minBounceVelocity,this.accelGround=0,this.accelAir=0,this.jumpSpeed=0,this.type=a.NONE,this.checkAgainst=a.NONE,this.collides=r.NEVER,this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.updateCallback,this.slopeStanding={min:.767944870877505,max:2.3736477827122884}},reset:function(t,e){this.pos={x:t,y:e},this.last={x:t,y:e},this.vel={x:0,y:0},this.accel={x:0,y:0},this.friction={x:0,y:0},this.maxVel={x:100,y:100},this.standing=!1,this.gravityFactor=1,this.bounciness=0,this.minBounceVelocity=40,this.accelGround=0,this.accelAir=0,this.jumpSpeed=0,this.type=a.NONE,this.checkAgainst=a.NONE,this.collides=r.NEVER},update:function(t){var e=this.pos;this.last.x=e.x,this.last.y=e.y,this.vel.y+=this.world.gravity*t*this.gravityFactor,this.vel.x=o(t,this.vel.x,this.accel.x,this.friction.x,this.maxVel.x),this.vel.y=o(t,this.vel.y,this.accel.y,this.friction.y,this.maxVel.y);var i=this.vel.x*t,n=this.vel.y*t,s=this.world.collisionMap.trace(e.x,e.y,i,n,this.size.x,this.size.y);this.handleMovementTrace(s)&&h(this,s);var r=this.gameObject;r&&(r.x=e.x-this.offset.x+r.displayOriginX*r.scaleX,r.y=e.y-this.offset.y+r.displayOriginY*r.scaleY),this.updateCallback&&this.updateCallback(this)},drawDebug:function(t){var e=this.pos;if(this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor,1),t.strokeRect(e.x,e.y,this.size.x,this.size.y)),this.debugShowVelocity){var i=e.x+this.size.x/2,n=e.y+this.size.y/2;t.lineStyle(1,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.vel.x,n+this.vel.y)}},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},skipHash:function(){return!this.enabled||0===this.type&&0===this.checkAgainst&&0===this.collides},touches:function(t){return!(this.pos.x>=t.pos.x+t.size.x||this.pos.x+this.size.x<=t.pos.x||this.pos.y>=t.pos.y+t.size.y||this.pos.y+this.size.y<=t.pos.y)},resetSize:function(t,e,i,n){return this.pos.x=t,this.pos.y=e,this.size.x=i,this.size.y=n,this},toJSON:function(){return{name:this.name,size:{x:this.size.x,y:this.size.y},pos:{x:this.pos.x,y:this.pos.y},vel:{x:this.vel.x,y:this.vel.y},accel:{x:this.accel.x,y:this.accel.y},friction:{x:this.friction.x,y:this.friction.y},maxVel:{x:this.maxVel.x,y:this.maxVel.y},gravityFactor:this.gravityFactor,bounciness:this.bounciness,minBounceVelocity:this.minBounceVelocity,type:this.type,checkAgainst:this.checkAgainst,collides:this.collides}},fromJSON:function(){},check:function(){},collideWith:function(t,e){this.parent&&this.parent._collideCallback&&this.parent._collideCallback.call(this.parent._callbackScope,this,t,e)},handleMovementTrace:function(){return!0},destroy:function(){this.world.remove(this),this.enabled=!1,this.world=null,this.gameObject=null,this.parent=null}});t.exports=s},,,function(t,e,i){var a=i(676),h={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.13.1",silent:!0,install:function(t){t.after("Engine.update",function(){h.Engine.update(this)})},Engine:{update:function(t){for(var e=t.world,i=a.Composite.allBodies(e),n=a.Composite.allComposites(e),s=0;s<i.length;s+=1){var r=i[s];r.plugin.wrap&&h.Body.wrap(r,r.plugin.wrap)}for(s=0;s<n.length;s+=1){var o=n[s];o.plugin.wrap&&h.Composite.wrap(o,o.plugin.wrap)}}},Bounds:{wrap:function(t,e){var i=null,n=null;if(void 0!==e.min.x&&void 0!==e.max.x&&(t.min.x>e.max.x?i=e.min.x-t.max.x:t.max.x<e.min.x&&(i=e.max.x-t.min.x)),void 0!==e.min.y&&void 0!==e.max.y&&(t.min.y>e.max.y?n=e.min.y-t.max.y:t.max.y<e.min.y&&(n=e.max.y-t.min.y)),null!==i||null!==n)return{x:i||0,y:n||0}}},Body:{wrap:function(t,e){var i=h.Bounds.wrap(t.bounds,e);return i&&a.Body.translate(t,i),i}},Composite:{bounds:function(t){for(var e=a.Composite.allBodies(t),i=[],n=0;n<e.length;n+=1){var s=e[n];i.push(s.bounds.min,s.bounds.max)}return a.Bounds.create(i)},wrap:function(t,e){var i=h.Bounds.wrap(h.Composite.bounds(t),e);return i&&a.Composite.translate(t,i),i}}};t.exports=h},function(t,e,i){var c=i(676),a={name:"matter-attractors",version:"0.1.7",for:"matter-js@^0.13.1",silent:!0,install:function(t){t.after("Body.create",function(){a.Body.init(this)}),t.before("Engine.update",function(t){a.Engine.update(t)})},Body:{init:function(t){t.plugin.attractors=t.plugin.attractors||[]}},Engine:{update:function(t){for(var e=t.world,i=c.Composite.allBodies(e),n=0;n<i.length;n+=1){var s=i[n],r=s.plugin.attractors;if(r&&0<r.length)for(var o=n+1;o<i.length;o+=1)for(var a=i[o],h=0;h<r.length;h+=1){var l=r[h],u=l;c.Common.isFunction(l)&&(u=l(s,a)),u&&c.Body.applyForce(a,a.position,u)}}}},Attractors:{gravityConstant:.001,gravity:function(t,e){var i=c.Vector.sub(e.position,t.position),n=c.Vector.magnitudeSquared(i)||1e-4,s=c.Vector.normalise(i),r=-a.Attractors.gravityConstant*(t.mass*e.mass/n),o=c.Vector.mult(s,r);c.Body.applyForce(t,t.position,c.Vector.neg(o)),c.Body.applyForce(e,e.position,o)}}};t.exports=a},function(t,e,i){var n=i(0),s=i(1018),r=i(1),o=i(4),a=i(1029),h=i(1013),l=i(1028),u=i(94),c=i(675),d=i(12),f=i(1008),p=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,o(this.config,"plugins.attractors",!1)&&(c.register(a),c.use(h,a)),o(this.config,"plugins.wrap",!1)&&(c.register(l),c.use(h,l)),t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.world=new f(this.scene,this.config),this.add=new s(this.world),this.systems.events.once("destroy",this.destroy,this)},start:function(){this.world||(this.world=new f(this.scene,this.config),this.add=new s(this.world));var t=this.systems.events;t.on("update",this.world.update,this.world),t.on("postupdate",this.world.postUpdate,this.world),t.once("shutdown",this.shutdown,this)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return u(r(e,"matter",{}),r(t,"matter",{}))},enableAttractorPlugin:function(){return c.register(a),c.use(h,a),this},enableWrapPlugin:function(){return c.register(l),c.use(h,l),this},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},set60Hz:function(){return this.world.getDelta=this.world.update60Hz,this.world.autoUpdate=!0,this},set30Hz:function(){return this.world.getDelta=this.world.update30Hz,this.world.autoUpdate=!0,this},step:function(t,e){this.world.step(t,e)},shutdown:function(){var t=this.systems.events;t.off("update",this.world.update,this.world),t.off("postupdate",this.world.postUpdate,this.world),t.off("shutdown",this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});d.register("MatterPhysics",p,"matterPhysics"),t.exports=p},function(t,e,i){var n={};t.exports=n;i(125);!function(){n.pathToVertices=function(t,e){var i,n,s,r,o,a,h,l,u,c,d,f=[],p=0,g=0,v=0;e=e||15;var y=function(t,e,i){var n=i%2==1&&1<i;if(!u||t!=u.x||e!=u.y){u&&n?(c=u.x,d=u.y):d=c=0;var s={x:c+t,y:d+e};!n&&u||(u=s),f.push(s),g=c+t,v=d+e}},m=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":g=t.x,v=t.y;break;case"H":g=t.x;break;case"V":v=t.y}y(g,v,t.pathSegType)}};for(x(t),s=t.getTotalLength(),a=[],i=0;i<t.pathSegList.numberOfItems;i+=1)a.push(t.pathSegList.getItem(i));for(h=a.concat();p<s;){if((o=a[t.getPathSegAtLength(p)])!=l){for(;h.length&&h[0]!=o;)m(h.shift());l=o}switch(o.pathSegTypeAsLetter.toUpperCase()){case"C":case"T":case"S":case"Q":case"A":r=t.getPointAtLength(p),y(r.x,r.y,0)}p+=e}for(i=0,n=h.length;i<n;++i)m(h[i]);return f};var x=function(t){for(var e,i,n,s,r,o,a=t.pathSegList,h=0,l=0,u=a.numberOfItems,c=0;c<u;++c){var d=a.getItem(c),f=d.pathSegTypeAsLetter;if(/[MLHVCSQTA]/.test(f))"x"in d&&(h=d.x),"y"in d&&(l=d.y);else switch("x1"in d&&(n=h+d.x1),"x2"in d&&(r=h+d.x2),"y1"in d&&(s=l+d.y1),"y2"in d&&(o=l+d.y2),"x"in d&&(h+=d.x),"y"in d&&(l+=d.y),f){case"m":a.replaceItem(t.createSVGPathSegMovetoAbs(h,l),c);break;case"l":a.replaceItem(t.createSVGPathSegLinetoAbs(h,l),c);break;case"h":a.replaceItem(t.createSVGPathSegLinetoHorizontalAbs(h),c);break;case"v":a.replaceItem(t.createSVGPathSegLinetoVerticalAbs(l),c);break;case"c":a.replaceItem(t.createSVGPathSegCurvetoCubicAbs(h,l,n,s,r,o),c);break;case"s":a.replaceItem(t.createSVGPathSegCurvetoCubicSmoothAbs(h,l,r,o),c);break;case"q":a.replaceItem(t.createSVGPathSegCurvetoQuadraticAbs(h,l,n,s),c);break;case"t":a.replaceItem(t.createSVGPathSegCurvetoQuadraticSmoothAbs(h,l),c);break;case"a":a.replaceItem(t.createSVGPathSegArcAbs(h,l,d.r1,d.r2,d.angle,d.largeArcFlag,d.sweepFlag),c);break;case"z":case"Z":h=e,l=i}"M"!=f&&"m"!=f||(e=h,i=l)}}}()},function(t,e,i){var n={};t.exports=n;var s=i(221),r=i(41);n.create=function(t){return r.extend({extended:!1,narrowDetections:0,narrowphaseTests:0,narrowReuse:0,narrowReuseCount:0,midphaseTests:0,broadphaseTests:0,narrowEff:1e-4,midEff:1e-4,broadEff:1e-4,collisions:0,buckets:0,bodies:0,pairs:0},!1,t)},n.reset=function(t){t.extended&&(t.narrowDetections=0,t.narrowphaseTests=0,t.narrowReuse=0,t.narrowReuseCount=0,t.midphaseTests=0,t.broadphaseTests=0,t.narrowEff=0,t.midEff=0,t.broadEff=0,t.collisions=0,t.buckets=0,t.pairs=0,t.bodies=0)},n.update=function(t,e){if(t.extended){var i=e.world,n=s.allBodies(i);t.collisions=t.narrowDetections,t.pairs=e.pairs.list.length,t.bodies=n.length,t.midEff=(t.narrowDetections/(t.midphaseTests||1)).toFixed(2),t.narrowEff=(t.narrowDetections/(t.narrowphaseTests||1)).toFixed(2),t.broadEff=(1-t.broadphaseTests/(n.length||1)).toFixed(2),t.narrowReuse=(t.narrowReuseCount/(t.narrowphaseTests||1)).toFixed(2)}}},function(t,e,i){var n={};t.exports=n;var g=i(106),v=i(677),y=i(125),m=i(166),a=i(126);n.ray=function(t,e,i,n){n=n||1e-100;for(var s=g.angle(e,i),r=g.magnitude(g.sub(e,i)),o=.5*(i.x+e.x),a=.5*(i.y+e.y),h=m.rectangle(o,a,r,n,{angle:s}),l=[],u=0;u<t.length;u++){var c=t[u];if(y.overlaps(c.bounds,h.bounds))for(var d=1===c.parts.length?0:1;d<c.parts.length;d++){var f=c.parts[d];if(y.overlaps(f.bounds,h.bounds)){var p=v.collides(f,h);if(p.collided){p.body=p.bodyA=p.bodyB=c,l.push(p);break}}}}return l},n.region=function(t,e,i){for(var n=[],s=0;s<t.length;s++){var r=t[s],o=y.overlaps(r.bounds,e);(o&&!i||!o&&i)&&n.push(r)}return n},n.point=function(t,e){for(var i=[],n=0;n<t.length;n++){var s=t[n];if(y.contains(s.bounds,e))for(var r=1===s.parts.length?0:1;r<s.parts.length;r++){var o=s.parts[r];if(y.contains(o.bounds,e)&&a.contains(o.vertices,e)){i.push(s);break}}}return i}},function(t,e,i){var o=i(125),n=i(0),a=i(221),s=i(300),h=i(678),r=i(1),l=i(94),u=i(331),c=i(6),d=i(126),f=new n({initialize:function(t,e,i){void 0===i&&(i={});this.scene=t,this.world=e;var n=r(i,"camera",null);n?(this.camera=n,delete i.camera):this.camera=t.sys.cameras.main,this.pointer=null,this.active=!0,this.position=new c,this.constraint=s.create(l(i,{label:"Pointer Constraint",pointA:{x:0,y:0},pointB:{x:0,y:0},damping:0,length:.01,stiffness:.1,angularStiffness:1,collisionFilter:{category:1,mask:4294967295,group:0}})),this.world.on("beforeupdate",this.update,this),t.sys.input.on("pointerdown",this.onDown,this),t.sys.input.on("pointerup",this.onUp,this)},onDown:function(t){this.pointer=t},onUp:function(){this.pointer=null},getBodyPart:function(t,e){for(var i=this.constraint,n=1<t.parts.length?1:0;n<t.parts.length;n++){var s=t.parts[n];if(d.contains(s.vertices,e))return i.bodyB=t,i.pointA.x=e.x,i.pointA.y=e.y,i.pointB.x=e.x-t.position.x,i.pointB.y=e.y-t.position.y,i.angleB=t.angle,u.set(t,!1),!0}return!1},update:function(){if(this.active){var t=this.pointer,e=this.constraint;if(t){var i=this.position;if(this.camera.getWorldPoint(t.x,t.y,i),e.bodyB)u.set(e.bodyB,!1),e.pointA.x=i.x,e.pointA.y=i.y;else for(var n=a.allBodies(this.world.localWorld),s=0;s<n.length;s++){var r=n[s];if(!r.ignorePointer&&o.contains(r.bounds,i)&&h.canCollide(r.collisionFilter,e.collisionFilter)&&this.getBodyPart(r,i))break}}else e.bodyB&&(e.bodyB=null)}},destroy:function(){this.world.removeConstraint(this.constraint),this.constraint=null,this.world.off("beforeupdate",this.update),this.scene.sys.input.off("pointerdown",this.onDown,this),this.scene.sys.input.off("pointerup",this.onUp,this)}});t.exports=f},function(t,e,i){var n=i(74),s={setAngularVelocity:function(t){return n.setAngularVelocity(this.body,t),this},setVelocityX:function(t){return this._tempVec2.set(t,this.body.velocity.y),n.setVelocity(this.body,this._tempVec2),this},setVelocityY:function(t){return this._tempVec2.set(this.body.velocity.x,t),n.setVelocity(this.body,this._tempVec2),this},setVelocity:function(t,e){return this._tempVec2.set(t,e),n.setVelocity(this.body,this._tempVec2),this}};t.exports=s},function(t,e,i){var n=i(74),s=i(16),r=i(212),o=i(211),a={x:{get:function(){return this.body.position.x},set:function(t){this._tempVec2.set(t,this.y),n.setPosition(this.body,this._tempVec2)}},y:{get:function(){return this.body.position.y},set:function(t){this._tempVec2.set(this.x,t),n.setPosition(this.body,this._tempVec2)}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4,n.scale(this.body,t,this._scaleY)}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4,n.scale(this.body,this._scaleX,t)}},angle:{get:function(){return o(this.body.angle*s.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*s.DEG_TO_RAD}},rotation:{get:function(){return this.body.angle},set:function(t){this._rotation=r(t),n.setAngle(this.body,this._rotation)}},setPosition:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._tempVec2.set(t,e),n.setPosition(this.body,this._tempVec2),this},setRotation:function(t){return void 0===t&&(t=0),this._rotation=r(t),n.setAngle(this.body,t),this},setFixedRotation:function(){return n.setInertia(this.body,1/0),this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,n.setAngle(this.body,this.rotation),this},setScale:function(t,e,i){return void 0===t&&(t=1),void 0===e&&(e=t),this._scaleX=t,this._scaleY=e,n.scale(this.body,t,e,i),this}};t.exports=a},function(t,e,i){var n=i(301),s={setSleepThreshold:function(t){return void 0===t&&(t=60),this.body.sleepThreshold=t,this},setSleepEvents:function(t,e){return this.setSleepStartEvent(t),this.setSleepEndEvent(e),this},setSleepStartEvent:function(t){if(t){var e=this.world;n.on(this.body,"sleepStart",function(t){e.emit("sleepstart",t,this)})}else n.off(this.body,"sleepStart");return this},setSleepEndEvent:function(t){if(t){var e=this.world;n.on(this.body,"sleepEnd",function(t){e.emit("sleepend",t,this)})}else n.off(this.body,"sleepEnd");return this}};t.exports=s},function(t,e,i){var o=i(166),p=i(74),g=i(125),v=i(41),d=i(1),y=i(106),m=i(126),n={parseBody:function(t,e,i,n,s){for(var r=d(s,"fixtures",[]),o=[],a=0;a<r.length;a++)for(var h=this.parseFixture(r[a]),l=0;l<h.length;l++)o.push(h[l]);var u=v.extend({},!1,s);delete u.fixtures,delete u.type;var c=p.create(u);return p.setParts(c,o),c.render.sprite.xOffset=c.position.x/i,c.render.sprite.yOffset=c.position.y/n,p.setPosition(c,{x:t,y:e}),c},parseFixture:function(t){var e,i=v.extend({},!1,t);if(delete i.circle,delete i.vertices,t.circle){var n=d(t.circle,"x"),s=d(t.circle,"y"),r=d(t.circle,"radius");e=[o.circle(n,s,r,i)]}else t.vertices&&(e=this.parseVertices(t.vertices,i));return e},parseVertices:function(t,e){var i,n,s,r,o,a=[];for(e=e||{},r=0;r<t.length;r+=1)a.push(p.create(v.extend({position:m.centre(t[r]),vertices:t[r]},e)));for(i=0;i<a.length;i++){var h=a[i];for(n=i+1;n<a.length;n++){var l=a[n];if(g.overlaps(h.bounds,l.bounds)){var u=h.vertices,c=l.vertices;for(s=0;s<h.vertices.length;s++)for(o=0;o<l.vertices.length;o++){var d=y.magnitudeSquared(y.sub(u[(s+1)%u.length],c[o])),f=y.magnitudeSquared(y.sub(u[s],c[(o+1)%c.length]));d<5&&f<5&&(u[s].isInternal=!0,c[o].isInternal=!0)}}}}return a}};t.exports=n},function(t,e,i){var y=i(166),m=i(74),x=i(1),w=i(1038),n={setRectangle:function(t,e,i){return this.setBody({type:"rectangle",width:t,height:e},i)},setCircle:function(t,e){return this.setBody({type:"circle",radius:t},e)},setPolygon:function(t,e,i){return this.setBody({type:"polygon",sides:e,radius:t},i)},setTrapezoid:function(t,e,i,n){return this.setBody({type:"trapezoid",width:t,height:e,slope:i},n)},setExistingBody:function(t,e){void 0===e&&(e=!0),this.body&&this.world.remove(this.body),this.body=t;var i=this.body.gameObject=this;return t.destroy=function(){i.world.remove(i.body),i.body.gameObject=null},e&&this.world.add(t),this._originComponent&&this.setOrigin(t.render.sprite.xOffset,t.render.sprite.yOffset),this},setBody:function(t,e){if(!t)return this;var i;"string"==typeof t&&(t={type:t});var n=x(t,"type","rectangle"),s=x(t,"x",this._tempVec2.x),r=x(t,"y",this._tempVec2.y),o=x(t,"width",this.width),a=x(t,"height",this.height);switch(n){case"rectangle":i=y.rectangle(s,r,o,a,e);break;case"circle":var h=x(t,"radius",Math.max(o,a)/2),l=x(t,"maxSides",25);i=y.circle(s,r,h,e,l);break;case"trapezoid":var u=x(t,"slope",.5);i=y.trapezoid(s,r,o,a,u,e);break;case"polygon":var c=x(t,"sides",5),d=x(t,"radius",Math.max(o,a)/2);i=y.polygon(s,r,c,d,e);break;case"fromVertices":case"fromVerts":var f=x(t,"verts",[]);if(this.body)m.setVertices(this.body,f),i=this.body;else{var p=x(t,"flagInternal",!1),g=x(t,"removeCollinear",.01),v=x(t,"minimumArea",10);i=y.fromVertices(s,r,f,e,p,g,v)}break;case"fromPhysicsEditor":i=w.parseBody(s,r,o,a,t)}return this.setExistingBody(i,t.addToWorld),this}};t.exports=n},function(t,e){t.exports={setSensor:function(t){return this.body.isSensor=t,this},isSensor:function(){return this.body.isSensor}}},function(t,e,i){var n=i(74),s={setStatic:function(t){return n.setStatic(this.body,t),this},isStatic:function(){return this.body.isStatic}};t.exports=s},function(t,e,i){var n=i(74),s=i(6),r={setMass:function(t){return n.setMass(this.body,t),this},setDensity:function(t){return n.setDensity(this.body,t),this},centerOfMass:{get:function(){return new s(this.body.render.sprite.xOffset*this.width,this.body.render.sprite.yOffset*this.height)}}};t.exports=r},function(t,e){t.exports={setIgnoreGravity:function(t){return this.body.ignoreGravity=t,this}}},function(t,e){var i={setFriction:function(t,e,i){return this.body.friction=t,void 0!==e&&(this.body.frictionAir=e),void 0!==i&&(this.body.frictionStatic=i),this},setFrictionAir:function(t){return this.body.frictionAir=t,this},setFrictionStatic:function(t){return this.body.frictionStatic=t,this}};t.exports=i},function(t,e,i){var n=i(74),s={applyForce:function(t){return this._tempVec2.set(this.body.position.x,this.body.position.y),n.applyForce(this.body,this._tempVec2,t),this},applyForceFrom:function(t,e){return n.applyForce(this.body,t,e),this},thrust:function(t){var e=this.body.angle;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustLeft:function(t){var e=this.body.angle-Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustRight:function(t){var e=this.body.angle+Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustBack:function(t){var e=this.body.angle-Math.PI;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this}};t.exports=s},function(t,e){var i={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i<t.length;i++)e|=t[i];else e=t;return this.body.collisionFilter.mask=e,this}};t.exports=i},function(t,e){t.exports={setBounce:function(t){return this.body.restitution=t,this}}},function(t,e,i){var o=i(611),a=i(1),h=i(6);t.exports=function(t,n,e){void 0===e&&(e={});var i=n.x,s=n.y;n.body={position:{x:i,y:s}},[o.Bounce,o.Collision,o.Force,o.Friction,o.Gravity,o.Mass,o.Sensor,o.SetBody,o.Sleep,o.Static,o.Transform,o.Velocity].forEach(function(t){for(var e in t)(i=t[e]).get&&"function"==typeof i.get||i.set&&"function"==typeof i.set?Object.defineProperty(n,e,{get:t[e].get,set:t[e].set}):Object.defineProperty(n,e,{value:t[e]});var i}),n.world=t,n._tempVec2=new h(i,s);var r=a(e,"shape",null);return r||(r="rectangle"),n.setBody(r,e),n}},function(t,e,i){t.exports={Factory:i(1018),Image:i(1015),Matter:i(676),MatterPhysics:i(1030),PolyDecomp:i(1017),Sprite:i(1014),TileBody:i(679),World:i(1008)}},function(t,e){t.exports=function(t,e,i,n){var s,r,o=e.pos.y+e.size.y-i.pos.y;if(n){var a=e===n?i:e;n.vel.y=-n.vel.y*n.bounciness+a.vel.y,s=0,n===e&&Math.abs(n.vel.y-a.vel.y)<n.minBounceVelocity&&(n.standing=!0,s=a.vel.x*t.delta);var h=t.collisionMap.trace(n.pos.x,n.pos.y,s,n===e?-o:o,n.size.x,n.size.y);n.pos.y=h.pos.y,n.pos.x=h.pos.x}else if(t.gravity&&(i.standing||0<e.vel.y))r=t.collisionMap.trace(e.pos.x,e.pos.y,0,-(e.pos.y+e.size.y-i.pos.y),e.size.x,e.size.y),e.pos.y=r.pos.y,0<e.bounciness&&e.vel.y>e.minBounceVelocity?e.vel.y*=-e.bounciness:(e.standing=!0,e.vel.y=0);else{var l=(e.vel.y-i.vel.y)/2;e.vel.y=-l,i.vel.y=l,s=i.vel.x*t.delta,r=t.collisionMap.trace(e.pos.x,e.pos.y,s,-o/2,e.size.x,e.size.y),e.pos.y=r.pos.y;var u=t.collisionMap.trace(i.pos.x,i.pos.y,0,o/2,i.size.x,i.size.y);i.pos.y=u.pos.y}}},function(t,e){t.exports=function(t,e,i,n){var s=e.pos.x+e.size.x-i.pos.x;if(n){var r=e===n?i:e;n.vel.x=-n.vel.x*n.bounciness+r.vel.x;var o=t.collisionMap.trace(n.pos.x,n.pos.y,n===e?-s:s,0,n.size.x,n.size.y);n.pos.x=o.pos.x}else{var a=(e.vel.x-i.vel.x)/2;e.vel.x=-a,i.vel.x=a;var h=t.collisionMap.trace(e.pos.x,e.pos.y,-s/2,0,e.size.x,e.size.y);e.pos.x=Math.floor(h.pos.x);var l=t.collisionMap.trace(i.pos.x,i.pos.y,s/2,0,i.size.x,i.size.y);i.pos.x=Math.ceil(l.pos.x)}}},function(t,e,i){var s=i(333),r=i(1051),o=i(1050);t.exports=function(t,e,i){var n=null;e.collides===s.LITE||i.collides===s.FIXED?n=e:i.collides!==s.LITE&&e.collides!==s.FIXED||(n=i),e.last.x+e.size.x>i.last.x&&e.last.x<i.last.x+i.size.x?(e.last.y<i.last.y?o(t,e,i,n):o(t,i,e,n),e.collideWith(i,"y"),i.collideWith(e,"y"),t.emit("collide",e,i,"y")):e.last.y+e.size.y>i.last.y&&e.last.y<i.last.y+i.size.y&&(e.last.x<i.last.x?r(t,e,i,n):r(t,i,e,n),e.collideWith(i,"x"),i.collideWith(e,"x"),t.emit("collide",e,i,"x"))}},function(t,e,i){var n=i(0),s=i(1023),r=i(1),o=i(94),a=i(12),h=i(1019),l=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.world=new h(this.scene,this.config),this.add=new s(this.world),this.systems.events.once("destroy",this.destroy,this)},start:function(){this.world||(this.world=new h(this.scene,this.config),this.add=new s(this.world));var t=this.systems.events;t.on("update",this.world.update,this.world),t.once("shutdown",this.shutdown,this)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return o(r(e,"impact",{}),r(t,"impact",{}))},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},shutdown:function(){var t=this.systems.events;t.off("update",this.world.update,this.world),t.off("shutdown",this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});a.register("ImpactPhysics",l,"impactPhysics"),t.exports=l},function(t,e){var i={setVelocityX:function(t){return this.vel.x=t,this},setVelocityY:function(t){return this.vel.y=t,this},setVelocity:function(t,e){return void 0===e&&(e=t),this.vel.x=t,this.vel.y=e,this},setMaxVelocity:function(t,e){return void 0===e&&(e=t),this.maxVel.x=t,this.maxVel.y=e,this}};t.exports=i},function(t,e){var i={setGameObject:function(t,e){return void 0===e&&(e=!0),t?(this.body.gameObject=t,e&&this.syncGameObject()):this.body.gameObject=null,this},syncGameObject:function(){var t=this.body.gameObject;return t&&this.setBodySize(t.width*t.scaleX,t.height*t.scaleY),this}};t.exports=i},function(t,e){t.exports={setOffset:function(t,e,i,n){return this.body.offset.x=t,this.body.offset.y=e,i&&this.setBodySize(i,n),this}}},function(t,e){t.exports={setGravity:function(t){return this.body.gravityFactor=t,this},gravity:{get:function(){return this.body.gravityFactor},set:function(t){this.body.gravityFactor=t}}}},function(t,e){t.exports={setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setFriction:function(t,e){return this.friction.x=t,this.friction.y=e,this}}},function(t,e){t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},function(t,e,i){var n=i(333),s={_collideCallback:null,_callbackScope:null,setCollideCallback:function(t,e){return this._collideCallback=t,e&&(this._callbackScope=e),this},setCollidesNever:function(){return this.body.collides=n.NEVER,this},setLiteCollision:function(){return this.body.collides=n.LITE,this},setPassiveCollision:function(){return this.body.collides=n.PASSIVE,this},setActiveCollision:function(){return this.body.collides=n.ACTIVE,this},setFixedCollision:function(){return this.body.collides=n.FIXED,this},collides:{get:function(){return this.body.collides},set:function(t){this.body.collides=t}}};t.exports=s},function(t,e,i){var n=i(332),s={setAvsB:function(){return this.setTypeA(),this.setCheckAgainstB()},setBvsA:function(){return this.setTypeB(),this.setCheckAgainstA()},setCheckAgainstNone:function(){return this.body.checkAgainst=n.NONE,this},setCheckAgainstA:function(){return this.body.checkAgainst=n.A,this},setCheckAgainstB:function(){return this.body.checkAgainst=n.B,this},checkAgainst:{get:function(){return this.body.checkAgainst},set:function(t){this.body.checkAgainst=t}}};t.exports=s},function(t,e){t.exports={setBounce:function(t){return this.body.bounciness=t,this},setMinBounceVelocity:function(t){return this.body.minBounceVelocity=t,this},bounce:{get:function(){return this.body.bounciness},set:function(t){this.body.bounciness=t}}}},function(t,e,i){var n=i(332),s={getBodyType:function(){return this.body.type},setTypeNone:function(){return this.body.type=n.NONE,this},setTypeA:function(){return this.body.type=n.A,this},setTypeB:function(){return this.body.type=n.B,this}};t.exports=s},function(t,e){var i={setBodySize:function(t,e){return void 0===e&&(e=t),this.body.size.x=Math.round(t),this.body.size.y=Math.round(e),this},setBodyScale:function(t,e){void 0===e&&(e=t);var i=this.body.gameObject;return i?(i.setScale(t,e),this.setBodySize(i.width*i.scaleX,i.height*i.scaleY)):this.setBodySize(this.body.size.x*t,this.body.size.y*e)}};t.exports=i},function(t,e){t.exports={setAccelerationX:function(t){return this.accel.x=t,this},setAccelerationY:function(t){return this.accel.y=t,this},setAcceleration:function(t,e){return this.accel.x=t,this.accel.y=e,this}}},function(t,e){t.exports={2:[0,1,1,0,!0],3:[0,1,1,.5,!0],4:[0,.5,1,0,!0],5:[0,1,1,2/3,!0],6:[0,2/3,1,1/3,!0],7:[0,1/3,1,0,!0],8:[.5,1,0,0,!0],9:[1,0,.5,1,!0],10:[.5,1,1,0,!0],11:[0,0,.5,1,!0],12:[0,0,1,0,!1],13:[1,1,0,0,!0],14:[1,.5,0,0,!0],15:[1,1,0,.5,!0],16:[1,1/3,0,0,!0],17:[1,2/3,0,1/3,!0],18:[1,1,0,2/3,!0],19:[1,1,.5,0,!0],20:[.5,0,0,1,!0],21:[0,1,.5,0,!0],22:[.5,0,1,1,!0],23:[1,1,0,1,!1],24:[0,0,1,1,!0],25:[0,0,1,.5,!0],26:[0,.5,1,1,!0],27:[0,0,1,1/3,!0],28:[0,1/3,1,2/3,!0],29:[0,2/3,1,1,!0],30:[1/3,1,0,0,!0],31:[1,0,2/3,1,!0],32:[2/3,1,1,0,!0],33:[0,0,1/3,1,!0],34:[1,0,1,1,!1],35:[1,0,0,1,!0],36:[1,.5,0,1,!0],37:[1,0,0,.5,!0],38:[1,2/3,0,1,!0],39:[1,1/3,0,2/3,!0],40:[1,0,0,1/3,!0],41:[2/3,1,1/3,0,!0],42:[2/3,0,1/3,1,!0],43:[1/3,1,2/3,0,!0],44:[1/3,0,2/3,1,!0],45:[0,1,0,0,!1],52:[1,1,2/3,0,!0],53:[1/3,0,0,1,!0],54:[0,1,1/3,0,!0],55:[2/3,0,1,1,!0]}},function(t,e){t.exports=function(t,e){if(t.standing=!1,e.collision.y&&(0<t.bounciness&&Math.abs(t.vel.y)>t.minBounceVelocity?t.vel.y*=-t.bounciness:(0<t.vel.y&&(t.standing=!0),t.vel.y=0)),e.collision.x&&(0<t.bounciness&&Math.abs(t.vel.x)>t.minBounceVelocity?t.vel.x*=-t.bounciness:t.vel.x=0),e.collision.slope){var i=e.collision.slope;if(0<t.bounciness){var n=t.vel.x*i.nx+t.vel.y*i.ny;t.vel.x=(t.vel.x-i.nx*n*2)*t.bounciness,t.vel.y=(t.vel.y-i.ny*n*2)*t.bounciness}else{var s=i.x*i.x+i.y*i.y,r=(t.vel.x*i.x+t.vel.y*i.y)/s;t.vel.x=i.x*r,t.vel.y=i.y*r;var o=Math.atan2(i.x,i.y);o>t.slopeStanding.min&&o<t.slopeStanding.max&&(t.standing=!0)}}t.pos.x=e.pos.x,t.pos.y=e.pos.y}},function(t,e,i){var o=i(23);t.exports=function(t,e,i,n,s){if(i)return o(e+i*t,-s,s);if(n){var r=n*t;return 0<e-r?e-r:e+r<0?e+r:0}return o(e,-s,s)}},function(t,e,i){t.exports={Body:i(1025),COLLIDES:i(333),CollisionMap:i(1024),Factory:i(1023),Image:i(1021),ImpactBody:i(1022),ImpactPhysics:i(1053),Sprite:i(1020),TYPE:i(332),World:i(1019)}},function(t,e,i){t.exports={Arcade:i(703),Impact:i(1069),Matter:i(1049)}},function(s,t,r){(function(t){r(609);var e=r(20),i=r(17),n={Actions:r(599),Animation:r(568),Cache:r(567),Cameras:r(960),Class:r(0),Create:r(954),Curves:r(948),Data:r(544),Display:r(945),DOM:r(916),Events:r(536),Game:r(534),GameObjects:r(915),Geom:r(400),Input:r(383),Loader:r(759),Math:r(745),Physics:r(1070),Plugins:r(330),Renderer:r(673),Scene:r(193),Scenes:r(328),Sound:r(326),Structs:r(325),Textures:r(324),Tilemaps:r(668),Time:r(308),Tweens:r(306),Utils:r(619)};n=i(!1,n,e),s.exports=n,t.Phaser=n}).call(this,r(215))}])});