UNPKG

phaser3-rex-plugins

Version:
1 lines 103 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).rextagplayerplugin=e();}(undefined,(function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(r=i.key,s=void 0,"symbol"==typeof(s=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return ("string"===e?String:Number)(t)}(r,"string"))?s:String(s)),i);}var r,s;}function i(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&a(t,e);}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}function a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}function o(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if("function"==typeof Proxy)return !0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return !1}}();return function(){var n,i=s(t);if(e){var r=s(this).constructor;n=Reflect.construct(i,arguments,r);}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return o(t)}(this,n)}}function c(){return c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=s(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},c.apply(this,arguments)}function h(t){return function(t){if(Array.isArray(t))return f(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return f(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var l={setEventEmitter:function(t,e){return void 0===e&&(e=Phaser.Events.EventEmitter),this._privateEE=!0===t||void 0===t,this._eventEmitter=this._privateEE?new e:t,this},destroyEventEmitter:function(){return this._eventEmitter&&this._privateEE&&this._eventEmitter.shutdown(),this},getEventEmitter:function(){return this._eventEmitter},on:function(){return this._eventEmitter&&this._eventEmitter.on.apply(this._eventEmitter,arguments),this},once:function(){return this._eventEmitter&&this._eventEmitter.once.apply(this._eventEmitter,arguments),this},off:function(){return this._eventEmitter&&this._eventEmitter.off.apply(this._eventEmitter,arguments),this},emit:function(t){return this._eventEmitter&&t&&this._eventEmitter.emit.apply(this._eventEmitter,arguments),this},addListener:function(){return this._eventEmitter&&this._eventEmitter.addListener.apply(this._eventEmitter,arguments),this},removeListener:function(){return this._eventEmitter&&this._eventEmitter.removeListener.apply(this._eventEmitter,arguments),this},removeAllListeners:function(){return this._eventEmitter&&this._eventEmitter.removeAllListeners.apply(this._eventEmitter,arguments),this},listenerCount:function(){return this._eventEmitter?this._eventEmitter.listenerCount.apply(this._eventEmitter,arguments):0},listeners:function(){return this._eventEmitter?this._eventEmitter.listeners.apply(this._eventEmitter,arguments):[]},eventNames:function(){return this._eventEmitter?this._eventEmitter.eventNames.apply(this._eventEmitter,arguments):[]}},d={hasProperty:function(t){var e=this.gameObject;return !!e.hasOwnProperty(t)||void 0!==e[t]},getProperty:function(t){return this.gameObject[t]},setProperty:function(t,e){return this.gameObject[t]=e,this},easeProperty:function(t,e,n,i,r,s,a,o){void 0===o&&(o=this.gameObject);var u=this.tweens,c=u[t];c&&c.remove();var h={targets:o,duration:n,ease:i,repeat:r,yoyo:s,onComplete:function(){u[t].remove(),u[t]=null,a&&a(o,t);},onCompleteScope:this};return h[t]=e,(c=this.scene.tweens.add(h)).timeScale=this.timeScale,u[t]=c,this},getTweenTask:function(t){return this.tweens[t]},freeTweens:function(){var t,e=this.tweens;for(var n in e)(t=e[n])&&t.remove(),e[n]=null;return this}},g={hasMethod:function(t){return "function"==typeof this.gameObject[t]},call:function(t){if(!this.hasMethod(t))return this;for(var e=this.gameObject,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return e[t].apply(e,i),this}},p=function(){function t(n,i,r){e(this,t),this.GOManager=n,this.tweens={},this.effects={},this.setGO(i,r);}return i(t,[{key:"scene",get:function(){return this.GOManager.scene}},{key:"timeScale",get:function(){return this.GOManager.timeScale}},{key:"destroy",value:function(){this.freeGO(),this.GOManager=void 0;}},{key:"freeGO",value:function(){return this.freeTweens(),this.gameObject.destroy(),this.gameObject=void 0,this}},{key:"setGO",value:function(t,e){return t.setName(e),this.gameObject=t,this.name=e,this.freeTweens(),this}},{key:"setTimeScale",value:function(t){var e=this.tweens;for(var n in e){var i=e[n];i&&(i.timeScale=t);}return this}}]),t}();Object.assign(p.prototype,d,g,{hasData:function(t){var e=this.gameObject;return !!e.data&&e.data.has(t)},getData:function(t){return this.gameObject.getData(t)},setData:function(t,e){return this.gameObject.setData(t,e),this}});var v=function(t,e){if(!t)return !1;if(t.hasOwnProperty(e))return !0;for(;t;){if(Object.getOwnPropertyDescriptor(t,e))return !0;t=t.__proto__;}return !1},m=function(t){return t.preFX?t.preFX:t.postFX?t.postFX:null},y=function(t,e){t._effectSwitchNames||(t._effectSwitchNames=[],t.clearAllEffects=function(){for(var e=t._effectSwitchNames,n=0,i=e.length;n<i;n++)t[e[n]]=null;return t},t.on("destroy",t.clearAllEffects,t)),t._effectSwitchNames.push(e);},b=function(t,e,n){if(v(t,e))return t;var i=m(t);if(!i)return t;var r,s="_".concat(e,"Effect");return Object.defineProperty(t,e,{get:function(){return r},set:function(a){r!==a&&(null===(r=a)||!1===r?t[s]&&(i.remove(t[s]),t[s]=void 0):(t[s]||(t[s]=i.addColorMatrix()),t[s][e](1===n?a:void 0)));}}),t[e]=null,y(t,e),t},k={barrel:function(t){if(v(t,"barrel"))return t;var e,n=m(t);return n?(Object.defineProperty(t,"barrel",{get:function(){return e},set:function(i){e!==i&&(null===(e=i)||!1===e?t._barrelEffect&&(n.remove(t._barrelEffect),t._barrelEffect=void 0):(t._barrelEffect||(t._barrelEffect=n.addBarrel()),t._barrelEffect.amount=e));}}),t.barrel=null,y(t,"barrel"),t):t},blackWhite:function(t){return b(t,"blackWhite"),t},bloom:function(t){if(v(t,"bloomColor"))return t;var e=m(t);if(!e)return t;var n,i=1,r=1,s=1,a=1,o=4;return Object.defineProperty(t,"bloomColor",{get:function(){return n},set:function(u){n!==u&&(null===(n=u)||!1===n?t._bloom&&(e.remove(t._bloom),t._bloom=void 0,e.setPadding(0)):(t._bloom||(t._bloom=e.addBloom(n,i,r,s,a,o),e.setPadding(Math.max(i,r)+1)),t._bloom.color=n));}}),Object.defineProperty(t,"bloomOffsetX",{get:function(){return i},set:function(n){if(i!==n&&(i=n,t._bloom)){var s=Math.max(i,r);e.setPadding(s+1),t._bloom.offsetX=i;}}}),Object.defineProperty(t,"bloomOffsetY",{get:function(){return r},set:function(n){if(r!==n&&(r=n,t._bloom)){var s=Math.max(i,r);e.setPadding(s+1),t._bloom.offsetY=r;}}}),Object.defineProperty(t,"bloomBlurStrength",{get:function(){return s},set:function(e){s!==e&&(s=e,t._bloom&&(t._bloom.blurStrength=s));}}),Object.defineProperty(t,"bloomStrength",{get:function(){return a},set:function(e){a!==e&&(a=e,t._bloom&&(t._bloom.strength=a));}}),Object.defineProperty(t,"bloomSteps",{get:function(){return o},set:function(e){o!==e&&(o=e,t._bloom&&(t._bloom.steps=o));}}),t.bloomColor=null,y(t,"bloomColor"),t},blur:function(t){if(v(t,"blurColor"))return t;var e=m(t);if(!e)return t;var n,i=0,r=1,s=1,a=1,o=4;return Object.defineProperty(t,"blurColor",{get:function(){return n},set:function(u){n!==u&&(null===(n=u)||!1===n?t._blur&&(e.remove(t._blur),t._blur=void 0,e.setPadding(0)):(t._blur||(t._blur=e.addBlur(i,r,s,a,n,o),e.setPadding(Math.max(r,s)+1)),t._blur.color=n));}}),Object.defineProperty(t,"blurQuality",{get:function(){return i},set:function(e){i!==e&&(i=e,t._blur&&(t._blur.quality=i));}}),Object.defineProperty(t,"blurX",{get:function(){return r},set:function(n){if(r!==n&&(r=n,t._blur)){var i=Math.max(r,s);e.setPadding(i+1),t._blur.x=r;}}}),Object.defineProperty(t,"blurY",{get:function(){return s},set:function(n){if(s!==n&&(s=n,t._blur)){var i=Math.max(r,s);e.setPadding(i+1),t._blur.y=s;}}}),Object.defineProperty(t,"blurStrength",{get:function(){return a},set:function(e){a!==e&&(a=e,t._blur&&(t._blur.strength=a));}}),Object.defineProperty(t,"blurSteps",{get:function(){return o},set:function(e){o!==e&&(o=e,t._blur&&(t._blur.steps=o));}}),t.blurColor=null,y(t,"blurColor"),t},bokeh:function(t){if(v(t,"bokehRadius"))return t;var e=m(t);if(!e)return t;var n,i=1,r=.2;return Object.defineProperty(t,"bokehRadius",{get:function(){return n},set:function(s){n!==s&&(null===(n=s)||!1===n?t._bokeh&&(e.remove(t._bokeh),t._bokeh=void 0):(t._bokeh||(t._bokeh=e.addBokeh(n,i,r)),t._bokeh.radius=n));}}),Object.defineProperty(t,"bokehAmount",{get:function(){return i},set:function(e){i!==e&&(i=e,t._bokeh&&(t._bokeh.amount=i));}}),Object.defineProperty(t,"bokehContrast",{get:function(){return r},set:function(e){r!==e&&(r=e,t._bokeh&&(t._bokeh.contrast=r));}}),t.bokehRadius=null,y(t,"bokehRadius"),t},brightness:function(t){return b(t,"brightness",1),t},brown:function(t){return b(t,"brown"),t},circle:function(t){if(v(t,"circleColor"))return t;var e=m(t);if(!e)return t;var n,i=8,r=0,s=.4,a=1,o=.005;return Object.defineProperty(t,"circleColor",{get:function(){return n},set:function(u){n!==u&&(null===(n=u)||!1===n?t._circle&&(e.remove(t._circle),t._circle=void 0):(t._circle||(t._circle=e.addCircle(i,n,r,a,o),t.circleBackgroundAlpha=s),t._circle.color=n));}}),Object.defineProperty(t,"circleThickness",{get:function(){return i},set:function(e){i!==e&&(i=e,t._circle&&(t._circle.thickness=i));}}),Object.defineProperty(t,"circleBackgroundColor",{get:function(){return r},set:function(e){r!==e&&(r=e,t._circle&&(t._circle.backgroundColor=r));}}),Object.defineProperty(t,"circleBackgroundAlpha",{get:function(){return s},set:function(e){s!==e&&(s=e,t._circle&&(t._circle.glcolor2[3]=s));}}),Object.defineProperty(t,"circleScale",{get:function(){return a},set:function(e){a!==e&&(a=e,t._circle&&(t._circle.scale=a));}}),Object.defineProperty(t,"circleFeather",{get:function(){return o},set:function(e){o!==e&&(o=e,t._circle&&(t._circle.feather=o));}}),t.circleColor=null,y(t,"circleColor"),t},contrast:function(t){return b(t,"contrast",1),t},desaturate:function(t){return b(t,"desaturate",1),t},desaturateLuminance:function(t){return b(t,"desaturateLuminance"),t},displacement:function(t){if(v(t,"displacementKey"))return t;var e=m(t);if(!e)return t;var n,i=.005,r=.005;return Object.defineProperty(t,"displacementKey",{get:function(){return n},set:function(s){n!==s&&(null===(n=s)||!1===n?t._displacement&&(e.remove(t._displacement),t._displacement=void 0):(t._displacement||(t._displacement=e.addDisplacement(n,i,r)),t._displacement.setTexture(n)));}}),Object.defineProperty(t,"displacementX",{get:function(){return i},set:function(e){i!==e&&(i=e,t._displacement&&(t._displacement.x=i));}}),Object.defineProperty(t,"displacementY",{get:function(){return r},set:function(e){r!==e&&(r=e,t._displacement&&(t._displacement.y=r));}}),t.displacementKey=null,y(t,"displacementKey"),t},glow:function(t){if(v(t,"glowColor"))return t;var e=m(t);if(!e)return t;var n,i=4,r=0;return Object.defineProperty(t,"glowColor",{get:function(){return n},set:function(s){n!==s&&(null===(n=s)||!1===n?t._glow&&(e.remove(t._glow),t._glow=void 0,e.setPadding(0)):(t._glow||(t._glow=e.addGlow(n,i,r),e.setPadding(i+1)),t._glow.color=n));}}),Object.defineProperty(t,"glowOuterStrength",{get:function(){return i},set:function(n){i!==n&&(i=n,t._glow&&(e.setPadding(i+1),t._glow.outerStrength=i));}}),Object.defineProperty(t,"glowInnerStrength",{get:function(){return r},set:function(e){r!==e&&(r=e,t._glow&&(t._glow.innerStrength=r));}}),t.glowColor=null,y(t,"glowColor"),t},gradient:function(t){if(v(t,"gradientColor"))return t;var e=m(t);if(!e)return t;var n,i,r=.5,s=0,a=0,o=0,u=1,c=0;return Object.defineProperty(t,"gradientColor",{get:function(){return [n,i]},set:function(h){var f,l;null===h||!1===h?(f=null,l=null):(f=h[0],l=h[1]),n===f&&i===l||(i=l,null===(n=f)||!1===n?t._gradient&&(e.remove(t._gradient),t._gradient=void 0):(t._gradient||(t._gradient=e.addGradient(n,i,r,s,a,o,u,c)),t._gradient.color1=n,t._gradient.color2=i));}}),Object.defineProperty(t,"gradientColor1",{get:function(){return n},set:function(e){null!==e&&!1!==e?n!==e&&(n=e,t._gradient&&(t._gradient.color1=n)):t.gradientColor=e;}}),Object.defineProperty(t,"gradientColor2",{get:function(){return i},set:function(e){null!==e&&!1!==e?i!==e&&(i=e,t._gradient&&(t._gradient.color2=i)):t.gradientColor=e;}}),Object.defineProperty(t,"gradientAlpha",{get:function(){return r},set:function(e){r!==e&&(r=e,t._gradient&&(t._gradient.alpha=r));}}),Object.defineProperty(t,"gradientFromX",{get:function(){return s},set:function(e){s!==e&&(s=e,t._gradient&&(t._gradient.fromX=s));}}),Object.defineProperty(t,"gradientFromY",{get:function(){return a},set:function(e){a!==e&&(a=e,t._gradient&&(t._gradient.fromY=a));}}),Object.defineProperty(t,"gradientToX",{get:function(){return o},set:function(e){o!==e&&(o=e,t._gradient&&(t._gradient.toX=o));}}),Object.defineProperty(t,"gradientToY",{get:function(){return u},set:function(e){u!==e&&(u=e,t._gradient&&(t._gradient.toY=u));}}),Object.defineProperty(t,"gradientSize",{get:function(){return c},set:function(e){c!==e&&(c=e,t._gradient&&(t._gradient.size=c));}}),t.gradientColor=null,y(t,"gradientColor"),t},grayscale:function(t){return b(t,"grayscale",1),t},hue:function(t){return b(t,"hue",1),t},kodachrome:function(t){return b(t,"kodachrome"),t},lsd:function(t){return b(t,"lsd"),t},negative:function(t){return b(t,"negative"),t},pixelate:function(t){if(v(t,"pixelate"))return t;var e,n=m(t);return n?(Object.defineProperty(t,"pixelate",{get:function(){return e},set:function(i){e!==i&&(null===(e=i)||!1===e?t._pixelateEffect&&(n.remove(t._pixelateEffect),t._pixelateEffect=void 0):(t._pixelateEffect||(t._pixelateEffect=n.addPixelate()),t._pixelateEffect.amount=e));}}),t.pixelate=null,y(t,"pixelate"),t):t},polaroid:function(t){return b(t,"polaroid"),t},reveal:function(t){if(v(t,"revealLeft"))return t;var e=m(t);if(!e)return t;var n,i,r,s,a=.1,o=function(){n=null,i=null,r=null,s=null;},u=function(t){t._revealEffect&&(e.remove(t._revealEffect),t._revealEffect=void 0);};return Object.defineProperty(t,"revealLeft",{get:function(){return n},set:function(i){n!==i&&(o(),null===(n=i)||!1===n?u(t):(t._revealEffect||(t._revealEffect=e.addReveal(a,0,0)),t._revealEffect.direction=1,t._revealEffect.axis=0,t._revealEffect.progress=n));}}),Object.defineProperty(t,"revealRight",{get:function(){return i},set:function(n){i!==n&&(o(),null===(i=n)||!1===i?u(t):(t._revealEffect||(t._revealEffect=e.addReveal(a,0,0)),t._revealEffect.direction=0,t._revealEffect.axis=0,t._revealEffect.progress=i));}}),Object.defineProperty(t,"revealUp",{get:function(){return r},set:function(n){r!==n&&(o(),null===(r=n)||!1===r?u(t):(t._revealEffect||(t._revealEffect=e.addReveal(a,0,0)),t._revealEffect.direction=1,t._revealEffect.axis=1,t._revealEffect.progress=r));}}),Object.defineProperty(t,"revealDown",{get:function(){return s},set:function(n){s!==n&&(o(),null===(s=n)||!1===s?u(t):(t._revealEffect||(t._revealEffect=e.addReveal(a,0,0)),t._revealEffect.direction=0,t._revealEffect.axis=1,t._revealEffect.progress=s));}}),Object.defineProperty(t,"revealWidth",{get:function(){return a},set:function(e){a!==e&&(a=e,t._revealEffect&&(t._revealEffect.wipeWidth=a));}}),t.revealLeft=null,y(t,"revealLeft"),y(t,"revealRight"),y(t,"revealUp"),y(t,"revealDown"),t},saturate:function(t){return b(t,"saturate",1),t},sepia:function(t){return b(t,"sepia"),t},shadow:function(t){if(v(t,"shadowColor"))return t;var e=m(t);if(!e)return t;var n,i=0,r=0,s=.1,a=1,o=6,u=1;return Object.defineProperty(t,"shadowColor",{get:function(){return n},set:function(c){n!==c&&(null===(n=c)||!1===n?t._shadow&&(e.remove(t._shadow),t._shadow=void 0):(t._shadow||(t._shadow=e.addShadow(i,r,s,a,n,o,u)),t._shadow.color=n));}}),Object.defineProperty(t,"shadowX",{get:function(){return i},set:function(e){i!==e&&(i=e,t._shadow&&(t._shadow.x=i));}}),Object.defineProperty(t,"shadowY",{get:function(){return r},set:function(e){r!==e&&(r=e,t._shadow&&(t._shadow.y=r));}}),Object.defineProperty(t,"decay",{get:function(){return s},set:function(e){s!==e&&(s=e,t._shadow&&(t._shadow.decay=s));}}),Object.defineProperty(t,"shadowPower",{get:function(){return a},set:function(e){a!==e&&(a=e,t._shadow&&(t._shadow.power=a));}}),Object.defineProperty(t,"shadowSamples",{get:function(){return o},set:function(e){o!==e&&(o=e,t._shadow&&(t._shadow.samples=o));}}),Object.defineProperty(t,"shadowIntensity",{get:function(){return u},set:function(e){u!==e&&(u=e,t._shadow&&(t._shadow.intensity=u));}}),t.shadowColor=null,y(t,"shadowColor"),t},shiftToBGR:function(t){return b(t,"shiftToBGR"),t},shine:function(t){if(v(t,"shineSpeed"))return t;var e=m(t);if(!e)return t;var n,i=.5,r=3;return Object.defineProperty(t,"shineSpeed",{get:function(){return n},set:function(s){n!==s&&(null===(n=s)||!1===n?t._shine&&(e.remove(t._shine),t._shine=void 0):(t._shine||(t._shine=e.addShine(n,i,r)),t._shine.speed=n));}}),Object.defineProperty(t,"shineLineWidth",{get:function(){return i},set:function(e){i!==e&&(i=e,t._shine&&(t._shine.lineWidth=i));}}),Object.defineProperty(t,"shineGradient",{get:function(){return r},set:function(e){r!==e&&(r=e,t._shine&&(t._shine.gradient=r));}}),t.shineSpeed=null,y(t,"shineSpeed"),t},technicolor:function(t){return b(t,"technicolor"),t},tiltShift:function(t){if(v(t,"tiltShiftRadius"))return t;var e=m(t);if(!e)return t;var n,i=1,r=.2,s=1,a=1,o=1;return Object.defineProperty(t,"tiltShiftRadius",{get:function(){return n},set:function(u){n!==u&&(null===(n=u)||!1===n?t._tiltShift&&(e.remove(t._tiltShift),t._tiltShift=void 0):(t._tiltShift||(t._tiltShift=e.addTiltShift(n,i,r,s,a,o)),t._tiltShift.radius=n));}}),Object.defineProperty(t,"tiltShiftAmount",{get:function(){return i},set:function(e){i!==e&&(i=e,t._tiltShift&&(t._tiltShift.amount=i));}}),Object.defineProperty(t,"tiltShiftContrast",{get:function(){return r},set:function(e){r!==e&&(r=e,t._tiltShift&&(t._tiltShift.contrast=r));}}),Object.defineProperty(t,"tiltShiftBlurX",{get:function(){return s},set:function(e){s!==e&&(s=e,t._tiltShift&&(t._tiltShift.blurX=s));}}),Object.defineProperty(t,"tiltShiftBlurY",{get:function(){return a},set:function(e){a!==e&&(a=e,t._tiltShift&&(t._tiltShift.blurY=a));}}),Object.defineProperty(t,"tiltShiftStrength",{get:function(){return o},set:function(e){o!==e&&(o=e,t._tiltShift&&(t._tiltShift.strength=o));}}),t.tiltShiftRadius=null,y(t,"tiltShiftRadius"),t},vignette:function(t){if(v(t,"vignetteColor"))return t;var e=m(t);if(!e)return t;var n,i=.5,r=.5,s=.5;return Object.defineProperty(t,"vignetteRadius",{get:function(){return n},set:function(a){n!==a&&(null===(n=a)||!1===n?t._vignette&&(e.remove(t._vignette),t._vignette=void 0):(t._vignette||(t._vignette=e.addVignette(i,r,n,s)),t._vignette.radius=n));}}),Object.defineProperty(t,"vignetteX",{get:function(){return i},set:function(e){i!==e&&(i=e,t._vignette&&(t._vignette.x=i));}}),Object.defineProperty(t,"vignetteY",{get:function(){return r},set:function(e){r!==e&&(r=e,t._vignette&&(t._vignette.y=r));}}),Object.defineProperty(t,"vignetteStrength",{get:function(){return s},set:function(e){s!==e&&(s=e,t._vignette&&(t._vignette.strength=s));}}),t.vignetteRadius=null,y(t,"vignetteRadius"),t},vintagePinhole:function(t){return b(t,"vintagePinhole"),t},wipe:function(t){if(v(t,"wipeLeft"))return t;var e=m(t);if(!e)return t;var n,i,r,s,a=.1,o=function(){n=null,i=null,r=null,s=null;},u=function(t){t._wipeEffect&&(e.remove(t._wipeEffect),t._wipeEffect=void 0);};return Object.defineProperty(t,"wipeLeft",{get:function(){return n},set:function(i){n!==i&&(o(),null===(n=i)||!1===n?u(t):(t._wipeEffect||(t._wipeEffect=e.addWipe(a,0,0)),t._wipeEffect.direction=1,t._wipeEffect.axis=0,t._wipeEffect.progress=n));}}),Object.defineProperty(t,"wipeRight",{get:function(){return i},set:function(n){i!==n&&(o(),null===(i=n)||!1===i?u(t):(t._wipeEffect||(t._wipeEffect=e.addWipe(a,0,0)),t._wipeEffect.direction=0,t._wipeEffect.axis=0,t._wipeEffect.progress=i));}}),Object.defineProperty(t,"wipeUp",{get:function(){return r},set:function(n){r!==n&&(o(),null===(r=n)||!1===r?u(t):(t._wipeEffect||(t._wipeEffect=e.addWipe(a,0,0)),t._wipeEffect.direction=1,t._wipeEffect.axis=1,t._wipeEffect.progress=r));}}),Object.defineProperty(t,"wipeDown",{get:function(){return s},set:function(n){s!==n&&(o(),null===(s=n)||!1===s?u(t):(t._wipeEffect||(t._wipeEffect=e.addWipe(a,0,0)),t._wipeEffect.direction=0,t._wipeEffect.axis=1,t._wipeEffect.progress=s));}}),Object.defineProperty(t,"wipeWidth",{get:function(){return a},set:function(e){a!==e&&(a=e,t._wipeEffect&&(t._wipeEffect.wipeWidth=a));}}),t.wipeLeft=null,y(t,"wipeLeft"),y(t,"wipeRight"),y(t,"wipeUp"),y(t,"wipeDown"),t}},E=function(t,e){if(void 0===e)e=!0;else if("string"==typeof e)e={config:!0};else if(Array.isArray(e))for(var n=e,i=(e={},0),r=n.length;i<r;i++)e[n[i]]=!0;if(!0===e)for(var s in k)k[s](t);else for(var s in e)e[s]&&k[s]&&k[s](t);return t},M={tint:0,alpha:1,revealUp:2,revealDown:3,revealLeft:4,revealRight:5},w={setGOFadeMode:function(t){return "string"==typeof t&&(t=M[t]),this.fadeMode=t,this},setGOFadeTime:function(t){return this.fadeTime=t,this},useTintFadeEffect:function(t){return (void 0===this.fadeMode||0===this.fadeMode)&&this.fadeTime>0&&void 0!==t.setTint},useAlphaFadeEffect:function(t){return (void 0===this.fadeMode||1===this.fadeMode)&&this.fadeTime>0&&void 0!==t.setAlpha},useRevealEffect:function(t){return this.fadeMode>=2&&this.fadeMode<=5&&this.fadeTime>0&&(t.preFX||t.postFX)},fadeBob:function(t,e,n,i){var r=t.gameObject;if(this.useTintFadeEffect(r))void 0!==e&&t.setProperty("tintGray",255*e),t.easeProperty("tintGray",Math.floor(255*n),this.fadeTime,"Linear",0,!1,i);else if(this.useAlphaFadeEffect(r))void 0!==e&&t.setProperty("alpha",e),t.easeProperty("alpha",n,this.fadeTime,"Linear",0,!1,i);else if(this.useRevealEffect(r)){var s;switch(E(r,"reveal"),this.fadeMode){case 2:s="revealUp";break;case 3:s="revealDown";break;case 4:s="revealLeft";break;case 5:s="revealRight";}void 0===e&&(e=0),r[s]=e,t.easeProperty(s,n,this.fadeTime,"Linear",0,!1,i),t.getTweenTask(s).once("complete",(function(){r[s]=null;}));}else i&&i(r);return this}},O=function(t){return t>>16&255},T=function(t){return t>>8&255},_=function(t){return 255&t},j=Phaser.Events.EventEmitter,S=function(t,e,n,i,r,s){return void 0===s?s={}:!0===s&&(s=P),"number"!=typeof n&&(n=0,i=0),s.x=r.x+r.width*t+n,s.y=r.y+r.height*e+i,s},P={},C=function(t,e,n,i,r,s,a){if(t.hasOwnProperty("vp"))return t;"function"==typeof n&&(a=n,n=void 0),"function"==typeof r&&(a=r,r=void 0),void 0===n&&(n=.5),void 0===i&&(i=.5),void 0===r&&(r=0),void 0===s&&(s=0),void 0===a&&(a=S),function(t){if(t.events)return t;var e=new j,n=t.x;Object.defineProperty(t,"x",{get:function(){return n},set:function(i){n!==i&&(n=i,e.emit("update",t));}});var i=t.y;Object.defineProperty(t,"y",{get:function(){return i},set:function(n){i!==n&&(i=n,e.emit("update",t));}});var r=t.width;Object.defineProperty(t,"width",{get:function(){return r},set:function(n){r!==n&&(r=n,e.emit("update",t));}});var s=t.height;Object.defineProperty(t,"height",{get:function(){return s},set:function(n){s!==n&&(s=n,e.emit("update",t));}}),t.events=e;}(e);var o=e.events;t.vp=e;var u=function(){a(n,i,r,s,e,t);};o.on("update",u),t.once("destroy",(function(){o.off("update",u),t.vp=void 0;})),Object.defineProperty(t,"vpx",{get:function(){return n},set:function(t){n!==t&&(n=t,u());}}),Object.defineProperty(t,"vpy",{get:function(){return i},set:function(t){i!==t&&(i=t,u());}}),Object.defineProperty(t,"vpxOffset",{get:function(){return r},set:function(t){r!==t&&(r=t,u());}}),Object.defineProperty(t,"vpyOffset",{get:function(){return s},set:function(t){s!==t&&(s=t,u());}}),u();},x=Phaser.Utils.Array.Remove,G={has:function(t){return this.bobs.hasOwnProperty(t)},exists:function(t){return this.bobs.hasOwnProperty(t)},get:function(t){return this.bobs[t]},getGO:function(t){var e=this.get(t);return e?e.gameObject:null},addGO:function(t,e){this.remove(t,!0),this.useTintFadeEffect(e)&&function(t,e){if(t.hasOwnProperty("tintR"))return t;void 0===e&&(e=16777215);var n=O(e),i=T(e),r=_(e);Object.defineProperty(t,"tint",{get:function(){return e},set:function(s){s=16777215&Math.floor(s),t.setTint&&t.setTint(s),e!==s&&(n=O(e=s),i=T(e),r=_(e));}}),Object.defineProperty(t,"tintR",{get:function(){return n},set:function(i){i=255&Math.floor(i),n!==i&&(n=i,t.tint=(255&i)<<16|65535&e);}}),Object.defineProperty(t,"tintG",{get:function(){return i},set:function(n){n=255&Math.floor(n),i!==n&&(i=n,t.tint=(255&n)<<8|16711935&e);}}),Object.defineProperty(t,"tintB",{get:function(){return r},set:function(n){n=255&Math.floor(n),r!==n&&(r=n,t.tint=255&n|16776960&e);}}),Object.defineProperty(t,"tintGray",{get:function(){return Math.floor((n+i+r)/3)},set:function(e){e=255&Math.floor(e),n===e&&i===e&&r===e||(n=e,i=e,r=e,t.tint=(255&e)<<16|(255&e)<<8|255&e);}}),t.tint=e;}(e),this.viewportCoordinateEnable&&C(e,this.viewport),this.effectPropertiesConfig&&E(e,this.effectPropertiesConfig),e.once("destroy",(function(){x(this.removedGOs,e),this.isEmpty&&this.emit("empty");}),this);var n=new this.BobClass(this,e,t);return this.bobs[t]=n,this},add:function(t){for(var e=this.createGameObjectCallback,n=this.createGameObjectScope,i=arguments.length,r=new Array(i>1?i-1:0),s=1;s<i;s++)r[s-1]=arguments[s];var a=e.call.apply(e,[n,this.scene].concat(r));this.addGO(t,a);var o=this.get(t);return this.fadeBob(o,0,1),this},forEachGO:function(t,e){for(var n in this.bobs){var i=this.bobs[n].gameObject;if(e?t.call(e,i,n,this):t(i,n,this))break}return this}},B={remove:function(t,e){if(!this.has(t))return this;var n=this.get(t);return delete this.bobs[t],this.removedGOs.push(n.gameObject),e?n.destroy():this.fadeBob(n,void 0,0,(function(){n.destroy();})),this},removeAll:function(){var t=this.bobs;for(var e in t)this.remove(e);return this},clear:function(t){void 0===t&&(t=!0);var e=this.bobs;for(var n in e)t&&e[n].destroy(),delete e[n];return this.removedGOs.length=0,this}},R={hasProperty:function(t,e){return !!this.has(t)&&this.get(t).hasProperty(e)},getProperty:function(t,e){if(this.has(t))return this.get(t).getProperty(e)},isNumberProperty:function(t,e){return "number"==typeof this.getProperty(t,e)},setProperty:function(t,e,n){return this.has(t)?(this.symbols&&"string"==typeof n&&this.isNumberProperty(t,e)&&(n in this.symbols?n=this.symbols[n]:console.warn("Can't find symbol ".concat(n))),this.get(t).setProperty(e,n),this):this},easeProperty:function(t,e,n,i,r,s,a,o){return this.has(t)?(void 0===i&&(i=1e3),void 0===r&&(r="Linear"),void 0===s&&(s=0),void 0===a&&(a=!1),this.symbols&&"string"==typeof n&&this.isNumberProperty(t,e)&&(n in this.symbols?n=this.symbols[n]:console.warn("Can't find symbol ".concat(n))),this.get(t).easeProperty(e,n,i,r,s,a,o),this):this},hasTweenTask:function(t,e){return !!this.has(t)&&this.get(t).tweens.hasOwnProperty(e)},getTweenTask:function(t,e){if(!this.has(t))return null;var n=this.get(t).tweens[e];return n||null}},L={hasMethod:function(t,e){return !!this.has(t)&&this.get(t).hasMethod(e)},call:function(t,e){var n;if(!this.has(t))return this;for(var i=arguments.length,r=new Array(i>2?i-2:0),s=2;s<i;s++)r[s-2]=arguments[s];return (n=this.get(t)).call.apply(n,[e].concat(r)),this}},D={hasData:function(t,e){return !!this.has(t)&&this.get(t).hasData(e)},getData:function(t,e){if(this.has(t))return this.get(t).getData(e)},setData:function(t,e,n){return this.has(t)?(this.get(t).setData(e,n),this):this}},F=function(t){return void 0!==t.displayWidth?t.displayWidth:t.width},V=function(t){return void 0!==t.displayHeight?t.displayHeight:t.height};Phaser.Geom.Rectangle;var A=Phaser.Math.Vector2,I=Phaser.Math.RotateAround,W=void 0,N=function(t,e,n){(void 0===n&&(n=!1),0!==t.rotation&&I(e,t.x,t.y,t.rotation),n&&t.parentContainer)&&t.parentContainer.getBoundsTransformMatrix().transformPoint(e.x,e.y,e);return e},U=Phaser.Utils.Objects.GetValue,X=function(t,e,n,i,r,s,a){if(t.getBounds||void 0!==t.width&&void 0!==t.height){void 0===n&&(n=16777215),void 0===i&&(i=1),void 0===r&&(r=null),void 0===s&&(s=1),void 0===a&&(a=0);var o=function(t,e,n){return void 0===e?e=new A:!0===e&&(void 0===W&&(W=new A),e=W),t.getTopLeft?t.getTopLeft(e):(e.x=t.x-F(t)*t.originX,e.y=t.y-V(t)*t.originY,N(t,e,n))}(t,Y[0]);o.x-=a,o.y-=a;var u=function(t,e,n){return void 0===e?e=new A:!0===e&&(void 0===W&&(W=new A),e=W),t.getTopRight?t.getTopRight(e):(e.x=t.x-F(t)*t.originX+F(t),e.y=t.y-V(t)*t.originY,N(t,e,n))}(t,Y[1]);u.x+=a,u.y-=a;var c=function(t,e,n){return void 0===e?e=new A:!0===e&&(void 0===W&&(W=new A),e=W),t.getBottomRight?t.getBottomRight(e):(e.x=t.x-F(t)*t.originX+F(t),e.y=t.y-V(t)*t.originY+V(t),N(t,e,n))}(t,Y[2]);c.x+=a,c.y+=a;var h=function(t,e,n){return void 0===e?e=new A:!0===e&&(void 0===W&&(W=new A),e=W),t.getBottomLeft?t.getBottomLeft(e):(e.x=t.x-F(t)*t.originX,e.y=t.y-V(t)*t.originY+V(t),N(t,e,n))}(t,Y[3]);h.x-=a,h.y+=a,null!==r&&e.fillStyle(r,s).fillPoints(Y,!0,!0),null!==n&&e.lineStyle(i,n).strokePoints(Y,!0,!0);}},Y=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],J={drawGameObjectsBounds:function(t,e){return this.forEachGO((function(n){n.drawBounds?n.drawBounds(t,e):function(t,e,n){var i,r,s,a,o;if("number"==typeof n?i=n:(i=U(n,"color"),r=U(n,"lineWidth"),s=U(n,"fillColor"),a=U(n,"fillAlpha",1),o=U(n,"padding",0)),Array.isArray(t))for(var u=0,c=t.length;u<c;u++)X(t[u],e,i,r,s,a,o);else X(t,e,i,r,s,a,o);}(n,t,e);})),this}};Object.assign(J,w,G,B,R,L,D);var z=Phaser.Cameras.Scene2D.BaseCamera,K=Phaser.Geom.Rectangle,$=function(t,e,n){return e instanceof z||(n=e,e=void 0),void 0===n?n=new K:!0===n&&(n=q),e?t.scale.getViewPort(e,n):t.scale.getViewPort(n)},q=new K,H=Phaser.Utils.Objects.GetValue,Q=function(){function t(n,i){e(this,t),this.scene=n,this.BobClass=H(i,"BobClass",p),this.setCreateGameObjectCallback(H(i,"createGameObject"),H(i,"createGameObjectScope")),this.setEventEmitter(H(i,"eventEmitter",void 0));var r=H(i,"fade",500);"number"==typeof r?(this.setGOFadeMode(),this.setGOFadeTime(r)):(this.setGOFadeMode(H(r,"mode")),this.setGOFadeTime(H(r,"time",500)));var s=H(i,"viewportCoordinate",!1);!1!==s?(this.setViewportCoordinateEnable(H(i,"enable",!0)),this.setViewport(H(s,"viewport"))):this.setViewportCoordinateEnable(!1);var a=H(i,"effectProperties",!1);this.setEffectPropertiesConfig(a),this.setSymbols(H(i,"symbols")),this.bobs={},this.removedGOs=[],this._timeScale=1;}return i(t,[{key:"destroy",value:function(t){this.clear(!t),this.createGameObjectCallback=void 0,this.viewport=void 0,this.scene=void 0;}},{key:"timeScale",get:function(){return this._timeScale},set:function(t){if(this._timeScale!==t){this._timeScale=t;var e=this.bobs;for(var n in e)e[n].setTimeScale(t);}}},{key:"setTimeScale",value:function(t){return this.timeScale=t,this}},{key:"setCreateGameObjectCallback",value:function(t,e){return this.createGameObjectCallback=t,this.createGameObjectScope=e,this}},{key:"setViewportCoordinateEnable",value:function(t){return void 0===t&&(t=!0),this.viewportCoordinateEnable=t,this}},{key:"setEffectPropertiesConfig",value:function(t){return void 0===t&&(t=!0),this.effectPropertiesConfig=t,this}},{key:"setViewport",value:function(t){return void 0===t&&(t=$(this.scene,this.scene.cameras.main)),this.viewport=t,this}},{key:"setSymbols",value:function(t){return this.symbols=t,this}},{key:"isEmpty",get:function(){return function(t){for(var e in t)return !1;return !0}(this.bobs)&&0===this.removedGOs.length}}]),t}();Object.assign(Q.prototype,l,J);var Z=Phaser.Utils.Objects.GetValue,tt=function(t){r(a,t);var n=u(a);function a(t,i){var r;e(this,a),void 0===i?i={}:Array.isArray(i)&&(i={layers:i}),i.hasOwnProperty("fade")||(i.fade=0),i.viewportCoordinate=!1,r=n.call(this,t,i);var s=Z(i,"layers");if(s)for(var o=0,u=s.length;o<u;o++)r.add(s[o]);return r}return i(a,[{key:"setCreateGameObjectCallback",value:function(t,e){return t||(t=et),c(s(a.prototype),"setCreateGameObjectCallback",this).call(this,t,e),this}},{key:"addGO",value:function(t,e){return c(s(a.prototype),"addGO",this).call(this,t,e),e.name=t,this}},{key:"getLayer",value:function(t){return this.getGO(t)}},{key:"getLayers",value:function(t){return void 0===t&&(t=[]),this.forEachGO((function(e){t.push(e);})),function(t,e){if(t.length<=1)return t;var n;void 0===e&&(e=!1);var i=t[0];(n=i.displayList?i.displayList:i.parentContainer?i.parentContainer.list:i.scene.sys.displayList).depthSort&&(n.depthSort(),n=n.list),e?t.sort((function(t,e){return n.indexOf(e)-n.indexOf(t)})):t.sort((function(t,e){return n.indexOf(t)-n.indexOf(e)}));}(t,!1),t}},{key:"addToLayer",value:function(t,e){var n=this.getGO(t);if(n)return e.isRexContainerLite?e.addToLayer(n):n.add(e),this;console.warn("Can't get layer \"".concat(t,'"'));}},{key:"removeFromLayer",value:function(t,e,n){var i=this.getGO(t);if(i)return void 0===n&&(n=!0),e.isRexContainerLite?e.removeFromLayer(i,n):(i.remove(e),n&&e.addToDisplayList()),this;console.warn("Can't get layer \"".concat(t,'"'));}},{key:"clearLayer",value:function(t,e){void 0===e&&(e=!0);var n=this.getGO(t);if(n){if(e)for(var i=n.getAll(),r=0,s=i.length;r<s;r++)i.destroy();else n.removeAll();return this}console.warn("Can't get layer \"".concat(t,'"'));}}]),a}(Q),et=function(t,e){var n=t.add.layer();return void 0!==e&&n.setDepth(e),n},nt=Phaser.Scene,it=function(t){return t instanceof nt},rt=function(e){return null==e||"object"!==t(e)?null:it(e)?e:e.scene&&it(e.scene)?e.scene:e.parent&&e.parent.scene&&it(e.parent.scene)?e.parent.scene:null},st=Phaser.Game,at=function(t){return t instanceof st},ot=Phaser.Utils.Objects.GetValue,ut=function(){function n(t,i){e(this,n),this.setParent(t),this.isShutdown=!1,this.setEventEmitter(ot(i,"eventEmitter",!0)),this.parent&&(this.parent===this.scene?this.scene.sys.events.once("shutdown",this.onEnvDestroy,this):this.parent===this.game?this.game.events.once("shutdown",this.onEnvDestroy,this):this.parent.once&&this.parent.once("destroy",this.onParentDestroy,this));}return i(n,[{key:"shutdown",value:function(t){this.isShutdown||(this.parent&&(this.parent===this.scene?this.scene.sys.events.off("shutdown",this.onEnvDestroy,this):this.parent===this.game?this.game.events.off("shutdown",this.onEnvDestroy,this):this.parent.once&&this.parent.off("destroy",this.onParentDestroy,this)),this.destroyEventEmitter(),this.parent=void 0,this.scene=void 0,this.game=void 0,this.isShutdown=!0);}},{key:"destroy",value:function(t){this.shutdown(t);}},{key:"onEnvDestroy",value:function(){this.destroy(!0);}},{key:"onParentDestroy",value:function(t,e){this.destroy(e);}},{key:"setParent",value:function(e){var n;return this.parent=e,this.scene=rt(e),this.game=null==(n=e)||"object"!==t(n)?null:at(n)?n:at(n.game)?n.game:it(n)?n.sys.game:it(n.scene)?n.scene.sys.game:void 0,this}}]),n}();Object.assign(ut.prototype,l);var ct=Phaser.Utils.Objects.GetValue,ht=function(t){r(a,t);var n=u(a);function a(t,i){var r;return e(this,a),(r=n.call(this,t,i))._isRunning=!1,r.isPaused=!1,r.tickingState=!1,r.setTickingMode(ct(i,"tickingMode",1)),r}return i(a,[{key:"boot",value:function(){2!==this.tickingMode||this.tickingState||this.startTicking();}},{key:"shutdown",value:function(t){this.isShutdown||(this.stop(),this.tickingState&&this.stopTicking(),c(s(a.prototype),"shutdown",this).call(this,t));}},{key:"setTickingMode",value:function(t){"string"==typeof t&&(t=ft[t]),this.tickingMode=t;}},{key:"startTicking",value:function(){this.tickingState=!0;}},{key:"stopTicking",value:function(){this.tickingState=!1;}},{key:"isRunning",get:function(){return this._isRunning},set:function(t){this._isRunning!==t&&(this._isRunning=t,1===this.tickingMode&&t!=this.tickingState&&(t?this.startTicking():this.stopTicking()));}},{key:"start",value:function(){return this.isPaused=!1,this.isRunning=!0,this}},{key:"pause",value:function(){return this.isRunning&&(this.isPaused=!0,this.isRunning=!1),this}},{key:"resume",value:function(){return this.isPaused&&(this.isRunning=!0),this}},{key:"stop",value:function(){return this.isPaused=!1,this.isRunning=!1,this}},{key:"complete",value:function(){this.isPaused=!1,this.isRunning=!1,this.emit("complete",this.parent,this);}}]),a}(ut),ft={no:0,lazy:1,always:2},lt=Phaser.Utils.Objects.GetValue,dt=function(t){r(a,t);var n=u(a);function a(t,i){var r;e(this,a);var s=(r=n.call(this,t,i)).scene?"update":"step";return r.tickEventName=lt(i,"tickEventName",s),r.isSceneTicker=!gt(r.tickEventName),r}return i(a,[{key:"startTicking",value:function(){c(s(a.prototype),"startTicking",this).call(this),this.isSceneTicker?this.scene.sys.events.on(this.tickEventName,this.update,this):this.game.events.on(this.tickEventName,this.update,this);}},{key:"stopTicking",value:function(){c(s(a.prototype),"stopTicking",this).call(this),this.isSceneTicker&&this.scene?this.scene.sys.events.off(this.tickEventName,this.update,this):this.game&&this.game.events.off(this.tickEventName,this.update,this);}}]),a}(ht),gt=function(t){return "step"===t||"poststep"===t},pt=Phaser.Utils.Objects.GetValue,vt=Phaser.Math.Clamp,mt=function(){function t(n){e(this,t),this.resetFromJSON(n);}return i(t,[{key:"resetFromJSON",value:function(t){this.state=pt(t,"state",yt),this.timeScale=pt(t,"timeScale",1),this.delay=pt(t,"delay",0),this.repeat=pt(t,"repeat",0),this.repeatCounter=pt(t,"repeatCounter",0),this.repeatDelay=pt(t,"repeatDelay",0),this.duration=pt(t,"duration",0),this.nowTime=pt(t,"nowTime",0),this.justRestart=pt(t,"justRestart",!1);}},{key:"toJSON",value:function(){return {state:this.state,timeScale:this.timeScale,delay:this.delay,repeat:this.repeat,repeatCounter:this.repeatCounter,repeatDelay:this.repeatDelay,duration:this.duration,nowTime:this.nowTime,justRestart:this.justRestart}}},{key:"destroy",value:function(){}},{key:"setTimeScale",value:function(t){return this.timeScale=t,this}},{key:"setDelay",value:function(t){return void 0===t&&(t=0),this.delay=t,this}},{key:"setDuration",value:function(t){return this.duration=t,this}},{key:"setRepeat",value:function(t){return this.repeat=t,this}},{key:"setRepeatInfinity",value:function(){return this.repeat=-1,this}},{key:"setRepeatDelay",value:function(t){return this.repeatDelay=t,this}},{key:"start",value:function(){return this.nowTime=this.delay>0?-this.delay:0,this.state=this.nowTime>=0?kt:bt,this.repeatCounter=0,this}},{key:"stop",value:function(){return this.state=yt,this}},{key:"update",value:function(t,e){this.state!==yt&&this.state!==Mt&&0!==e&&0!==this.timeScale&&(this.nowTime+=e*this.timeScale,this.justRestart=!1,this.nowTime>=this.duration?-1===this.repeat||this.repeatCounter<this.repeat?(this.repeatCounter++,this.justRestart=!0,this.nowTime-=this.duration,this.repeatDelay>0&&(this.nowTime-=this.repeatDelay,this.state=Et)):(this.nowTime=this.duration,this.state=Mt):this.nowTime>=0&&(this.state=kt));}},{key:"t",get:function(){var t;switch(this.state){case yt:case bt:case Et:t=0;break;case kt:t=this.nowTime/this.duration;break;case Mt:t=1;}return vt(t,0,1)},set:function(t){(t=vt(t,-1,1))<0?(this.state=bt,this.nowTime=-this.delay*t):(this.state=kt,this.nowTime=this.duration*t,1===t&&0!==this.repeat&&this.repeatCounter++);}},{key:"setT",value:function(t){return this.t=t,this}},{key:"isIdle",get:function(){return this.state===yt}},{key:"isDelay",get:function(){return this.state===bt}},{key:"isCountDown",get:function(){return this.state===kt}},{key:"isRunning",get:function(){return this.state===bt||this.state===kt}},{key:"isDone",get:function(){return this.state===Mt}},{key:"isOddIteration",get:function(){return 1==(1&this.repeatCounter)}},{key:"isEvenIteration",get:function(){return 0==(1&this.repeatCounter)}}]),t}(),yt=0,bt=1,kt=2,Et=3,Mt=-1,wt=function(t){r(a,t);var n=u(a);function a(t,i){var r;return e(this,a),(r=n.call(this,t,i)).timer=new mt,r}return i(a,[{key:"shutdown",value:function(t){this.isShutdown||(c(s(a.prototype),"shutdown",this).call(this,t),this.timer.destroy(),this.timer=void 0);}},{key:"start",value:function(){return this.timer.start(),c(s(a.prototype),"start",this).call(this),this}},{key:"stop",value:function(){return this.timer.stop(),c(s(a.prototype),"stop",this).call(this),this}},{key:"complete",value:function(){return this.timer.stop(),c(s(a.prototype),"complete",this).call(this),this}}]),a}(dt),Ot=Phaser.Utils.Objects.GetValue,Tt=Phaser.Utils.Objects.GetAdvancedValue,_t=Phaser.Tweens.Builders.GetEaseFunction,jt=function(t){r(a,t);var n=u(a);function a(){return e(this,a),n.apply(this,arguments)}return i(a,[{key:"resetFromJSON",value:function(t){return this.timer.resetFromJSON(Ot(t,"timer")),this.setEnable(Ot(t,"enable",!0)),this.setTarget(Ot(t,"target",this.parent)),this.setDelay(Tt(t,"delay",0)),this.setDuration(Tt(t,"duration",1e3)),this.setEase(Ot(t,"ease","Linear")),this.setRepeat(Ot(t,"repeat",0)),this}},{key:"setEnable",value:function(t){return null==t&&(t=!0),this.enable=t,this}},{key:"setTarget",value:function(t){return void 0===t&&(t=this.parent),this.target=t,this}},{key:"setDelay",value:function(t){return this.delay=t,this}},{key:"setDuration",value:function(t){return this.duration=t,this}},{key:"setRepeat",value:function(t){return this.repeat=t,this}},{key:"setRepeatDelay",value:function(t){return this.repeatDelay=t,this}},{key:"setEase",value:function(t){return void 0===t&&(t="Linear"),this.ease=t,this.easeFn=_t(t),this}},{key:"start",value:function(){return this.timer.isRunning||c(s(a.prototype),"start",this).call(this),this}},{key:"restart",value:function(){return this.timer.stop(),this.start.apply(this,arguments),this}},{key:"stop",value:function(t){return void 0===t&&(t=!1),c(s(a.prototype),"stop",this).call(this),t&&(this.timer.setT(1),this.updateGameObject(this.target,this.timer),this.complete()),this}},{key:"update",value:function(t,e){if(!this.isRunning||!this.enable||!this.parent.active)return this;var n=this.target,i=this.timer;return i.update(t,e),i.isDelay||this.updateGameObject(n,i),this.emit("update",n,this),i.isDone&&this.complete(),this}},{key:"updateGameObject",value:function(t,e){}}]),a}(wt),St=Phaser.Sound.BaseSound,Pt=function(t){return t instanceof St},Ct=Phaser.Utils.Objects.GetValue,xt=Phaser.Utils.Objects.GetAdvancedValue,Gt=Phaser.Math.Linear,Bt=function(t){r(a,t);var n=u(a);function a(t,i,r){var s;return e(this,a),Pt(t)&&(r=i,i=t,t=void 0),i.active=!0,i.scene=t,i.game=i.manager.game,(s=n.call(this,i,r)).volume={},s.resetFromJSON(r),s}return i(a,[{key:"resetFromJSON",value:function(t){return c(s(a.prototype),"resetFromJSON",this).call(this,t),this.setMode(Ct(t,"mode",0)),this.setEnable(Ct(t,"enable",!0)),this.setVolumeRange(xt(t,"volume.start",this.parent.volume),xt(t,"volume.end",0)),this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=Rt[t]),this.mode=t,this}},{key:"setVolumeRange",value:function(t,e){return this.volume.start=t,this.volume.end=e,this}},{key:"start",value:function(){return this.timer.isRunning||(this.parent.setVolume(this.volume.start),this.timer.setDelay(this.delay).setDuration(this.duration),c(s(a.prototype),"start",this).call(this)),this}},{key:"updateGameObject",value:function(t,e){t.volume=Gt(this.volume.start,this.volume.end,e.t);}},{key:"complete",value:function(){switch(c(s(a.prototype),"complete",this).call(this),this.mode){case 1:this.parent.stop();break;case 2:this.parent.destroy();}return this}}]),a}(jt),Rt={stop:1,destroy:2},Lt=function(t,e,n,i,r){Pt(t)&&(r=i,i=n,n=e,e=t,t=void 0),void 0===i&&(i=1),void 0===r&&(r=0);var s,a={mode:0,volume:{start:r,end:i},duration:n};return "string"==typeof e&&(e=t.sys.sound.add(e)),e.hasOwnProperty("_fade")?(s=e._fade).stop().resetFromJSON(a):(s=new Bt(t,e,a),e._fade=s),s.start(),e.isPlaying||e.setVolume(r).play(),e},Dt=function(t,e,n,i){Pt(t)&&(i=n,n=e,e=t,t=void 0),void 0===i&&(i=!0);var r,s={mode:i?2:1,volume:{start:e.volume,end:0},duration:n};return e.hasOwnProperty("_fade")?(r=e._fade).stop().resetFromJSON(s):(r=new Bt(t,e,s),e._fade=r),r.start(),e.isPlaying||e.play(),e},Ft=Phaser.Utils.Objects.GetValue,Vt={setBackgroundMusicLoop:function(t){return void 0===t&&(t=!0),this.backgroundMusicLoop=t,this},setBackgroundMusicFadeTime:function(t){return this.backgroundMusicFadeTime=t,this},getBackgroundMusic:function(){return this.backgroundMusic},setCurrentBackgroundMusic:function(t){return this.backgroundMusic=t,t&&(t.once("complete",(function(){this.backgroundMusic===t&&(this.backgroundMusic.destroy(),this.backgroundMusic=void 0);}),this).once("destroy",(function(){this.backgroundMusic===t&&(this.backgroundMusic=void 0);}),this),t.isPlaying||t.play()),this},playBackgroundMusic:function(t,e){if(this.backgroundMusic&&this.backgroundMusic.key===t)return this;this.stopBackgroundMusic();var n=this.sound.add(t,{loop:Ft(e,"loop",this.backgroundMusicLoop),mute:Ft(e,"mute",this.backgroundMusicMute),volume:Ft(e,"volume",this.backgroundMusicVolume),detune:Ft(e,"detune",0),rate:Ft(e,"rate",1)});return this.setCurrentBackgroundMusic(n),this.backgroundMusicFadeTime>0&&this.fadeInBackgroundMusic(this.backgroundMusicFadeTime),this},pauseBackgroundMusic:function(){return this.backgroundMusic&&this.backgroundMusic.pause(),this},resumeBackgroundMusic:function(){return this.backgroundMusic&&this.backgroundMusic.resume(),this},stopBackgroundMusic:function(){return this.backgroundMusic&&(this.backgroundMusicFadeTime>0?this.fadeOutBackgroundMusic(this.backgroundMusicFadeTime,!0):(this.backgroundMusic.stop(),this.backgroundMusic.destroy(),this.backgroundMusic=void 0)),this},fadeInBackgroundMusic:function(t){return this.backgroundMusic&&Lt(this.backgroundMusic,t,this.backgroundMusicVolume,0),this},fadeOutBackgroundMusic:function(t,e){return this.backgroundMusic&&Dt(this.backgroundMusic,t,e),this},crossFadeBackgroundMusic:function(t,e){var n=this.backgroundMusicFadeTime;return this.backgroundMusicFadeTime=0,this.fadeOutBackgroundMusic(e,!0).playBackgroundMusic(t).fadeInBackgroundMusic(e),this.backgroundMusicFadeTime=n,this},setBackgroundMusicMute:function(t){return void 0===t&&(t=!0),this.backgroundMusicMute=t,this},setBackgroundMusicVolume:function(t){return this.backgroundMusicVolume=t,this},setBackgroundMusicRate:function(t){return this.backgroundMusic&&this.backgroundMusic.setRate(t),this},setBackgroundMusicDetune:function(t){return this.backgroundMusic&&this.backgroundMusic.setDetune(t),this}},At=Phaser.Utils.Objects.GetValue,It={setBackgroundMusic2Loop:function(t){return void 0===t&&(t=!0),this.backgroundMusic2Loop=t,this},setBackgroundMusic2FadeTime:function(t){return this.backgroundMusic2FadeTime=t,this},getBackgroundMusic2:function(){return this.backgroundMusic2},setCurrentBackgroundMusic2:function(t){return this.backgroundMusic2=t,t&&(t.once("complete",(function(){this.backgroundMusic2===t&&(this.backgroundMusic2.destroy(),this.backgroundMusic2=void 0);}),this).once("destroy",(function(){this.backgroundMusic2===t&&(this.backgroundMusic2=void 0);}),this),t.isPlaying||t.play()),this},playBackgroundMusic2:function(t,e){if(this.backgroundMusic2&&this.backgroundMusic2.key===t)return this;this.stopBackgroundMusic2();var n=this.sound.add(t,{loop:At(e,"loop",this.backgroundMusicLoop),mute:At(e,"mute",this.backgroundMusic2Mute),volume:At(e,"volume",this.backgroundMusic2Volume),detune:At(e,"detune",0),rate:At(e,"rate",1)});return this.setCurrentBackgroundMusic2(n),this.backgroundMusic2FadeTime>0&&this.fadeInBackgroundMusic2(this.backgroundMusic2FadeTime),this},pauseBackgroundMusic2:function(){return this.backgroundMusic2&&this.backgroundMusic2.pause(),this},resumeBackgroundMusic2:function(){return this.backgroundMusic2&&this.backgroundMusic2.resume(),this},stopBackgroundMusic2:function(){return this.backgroundMusic2&&(this.backgroundMusic2FadeTime>0?this.fadeOutBackgroundMusic2(this.backgroundMusic2FadeTime,!0):(this.backgroundMusic2.stop(),this.backgroundMusic2.destroy(),this.backgroundMusic2=void 0)),this},fadeInBackgroundMusic2:function(t){return this.backgroundMusic2&&Lt(this.backgroundMusic2,t,this.backgroundMusic2Volume,0),this},fadeOutBackgroundMusic2:function(t,e){return this.backgroundMusic2&&Dt(this.backgroundMusic