phaser3-rex-plugins
Version:
1 lines • 53.8 kB
JavaScript
!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).rextransitionimageplugin=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 i(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,v(n.key),n);}}function n(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(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 r(t){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},r(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,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 function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(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 i,n=r(t);if(e){var s=r(this).constructor;i=Reflect.construct(n,arguments,s);}else i=n.apply(this,arguments);return o(this,i)}}function l(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=r(t)););return t}function u(){return u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,i){var n=l(t,e);if(n){var s=Object.getOwnPropertyDescriptor(n,e);return s.get?s.get.call(arguments.length<3?t:i):s.value}},u.apply(this,arguments)}function c(t,e,i,n){return c="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,e,i,n){var s,r=l(t,e);if(r){if((s=Object.getOwnPropertyDescriptor(r,e)).set)return s.set.call(n,i),!0;if(!s.writable)return !1}if(s=Object.getOwnPropertyDescriptor(n,e)){if(!s.writable)return !1;s.value=i,Object.defineProperty(n,e,s);}else !function(t,e,i){(e=v(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i;}(n,e,i);return !0},c(t,e,i,n)}function d(t,e,i,n,s){if(!c(t,e,i,n||t)&&s)throw new TypeError("failed to set property");return i}function f(t){return function(t){if(Array.isArray(t))return p(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 p(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return p(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 p(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function v(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return ("string"===e?String:Number)(t)}(t,"string");return "symbol"==typeof e?e:String(e)}var y,g=!1;g||(void 0===y&&(y=60),parseInt(Phaser.VERSION.match(/\.(\d+)\./)[1])<y&&console.error("Minimum supported version : 3.".concat(y)),g=!0);var m=Phaser.GameObjects.Zone,k=Phaser.Utils.Array.Add,b=Phaser.Utils.Array.Remove,C=function(t){s(a,t);var i=h(a);function a(t,n,s,r,o){var h;return e(this,a),void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=1),void 0===o&&(o=1),(h=i.call(this,t,n,s,r,o)).children=[],h}return n(a,[{key:"destroy",value:function(t){if(this.scene&&!this.ignoreDestroy){if(t)for(var e,i=this.children.length-1;i>=0;i--)(e=this.children[i]).parentContainer||e.displayList||e.destroy(t);this.clear(!t),u(r(a.prototype),"destroy",this).call(this,t);}}},{key:"contains",value:function(t){return -1!==this.children.indexOf(t)}},{key:"add",value:function(t){var e=this;return k(this.children,t,0,(function(t){t.once("destroy",e.onChildDestroy,e);}),this),this}},{key:"remove",value:function(t,e){var i=this;return b(this.children,t,(function(t){t.off("destroy",i.onChildDestroy,i),e&&t.destroy();})),this}},{key:"onChildDestroy",value:function(t,e){this.remove(t,!1);}},{key:"clear",value:function(t){for(var e,i=0,n=this.children.length;i<n;i++)(e=this.children[i]).off("destroy",this.onChildDestroy,this),t&&e.destroy();return this.children.length=0,this}}]),a}(m),P=Phaser.GameObjects.Components;Phaser.Class.mixin(C,[P.Alpha,P.Flip]);var S,x=function t(e,i){var n;if(void 0===i)e.hasOwnProperty("rexContainer")&&(n=e.rexContainer.parent);else for(n=t(e);n&&n.name!==i;)n=t(n);return n},T=Phaser.Math.DegToRad,w=Phaser.Math.RadToDeg,E=function(t){if(!t.hasOwnProperty("rexContainer")){var e={parent:null,self:null,layer:null,x:0,y:0,syncPosition:!0,rotation:0,syncRotation:!0,scaleX:0,scaleY:0,syncScale:!0,alpha:0,syncAlpha:!0,visible:!0,active:!0};Object.defineProperty(e,"angle",{get:function(){return w(this.rotation)},set:function(t){this.rotation=T(t);}}),Object.defineProperty(e,"displayWidth",{get:function(){return t.width*this.scaleX},set:function(e){this.scaleX=e/t.width;}}),Object.defineProperty(e,"displayHeight",{get:function(){return t.height*this.scaleY},set:function(e){this.scaleY=e/t.height;}}),t.rexContainer=e;}return t.rexContainer},O={setParent:function(t,e){void 0===e&&(e=this);var i=E(t);return e?(i.parent=e,i.self=t):(i.parent=null,i.self=null),this},getParent:function(t,e){return "string"==typeof t&&(e=t,t=void 0),void 0===t&&(t=this),x(t,e)},getTopmostParent:function(t){return void 0===t&&(t=this),function(t){for(var e=x(t);e;)t=e,e=x(e);return t}(t)}},R=Phaser.Utils.Objects.GetValue,A=C.prototype.add,j=function(t,e){this.setParent(t);var i=E(t);return _(i,e),this.resetChildState(t).updateChildVisible(t).updateChildActive(t).updateChildScrollFactor(t).updateChildMask(t),A.call(this,t),this.addToParentContainer(t),this.addToRenderLayer(t),this},L=function(t,e){this.setParent(t);var i=E(t);return _(i,e),i.x=t.x,i.y=t.y,i.rotation=t.rotation,i.scaleX=t.scaleX,i.scaleY=t.scaleY,i.alpha=t.alpha,i.visible=t.visible,i.active=t.active,this.updateChildPosition(t).updateChildAlpha(t).updateChildVisible(t).updateChildActive(t).updateChildScrollFactor(t).updateChildMask(t),A.call(this,t),this.addToRenderLayer(t),this},_=function(t,e){void 0===e&&(e=!0),"boolean"==typeof e?(t.syncPosition=e,t.syncRotation=e,t.syncScale=e,t.syncAlpha=e,t.syncScrollFactor=e):(t.syncPosition=R(e,"syncPosition",!0),t.syncRotation=R(e,"syncRotation",!0),t.syncScale=R(e,"syncScale",!0),t.syncAlpha=R(e,"syncAlpha",!0),t.syncScrollFactor=R(e,"syncScrollFactor",!0));},M={add:function(t){return Array.isArray(t)?this.addMultiple(t):j.call(this,t),this},pin:function(t,e){return Array.isArray(t)?this.addMultiple(t,e):j.call(this,t,e),this},addMultiple:function(t){for(var e=0,i=t.length;e<i;e++)j.call(this,t[e]);return this},addLocal:function(t){return Array.isArray(t)?this.addMultiple(t):L.call(this,t),this},pinLocal:function(t,e){return Array.isArray(t)?this.addMultiple(t,e):L.call(this,t,e),this},addLocalMultiple:function(t){for(var e=0,i=t.length;e<i;e++)L.call(this,t[e]);return this}},I=C.prototype.remove,V=C.prototype.clear,F={remove:function(t,e){return x(t)!==this||(this.setParent(t,null),e||this.removeFromRenderLayer(t),I.call(this,t,e)),this},unpin:function(t,e){return x(t)!==this||(this.setParent(t,null),e||this.removeFromRenderLayer(t),I.call(this,t,e)),this},clear:function(t){for(var e=this.children,i=0,n=e.length;i<n;i++){var s=e[i];this.setParent(s,null),t||this.removeFromRenderLayer(s);}return V.call(this,t),this}},D={getLocalState:function(t){return E(t)},resetChildState:function(t){return this.resetChildPositionState(t).resetChildVisibleState(t).resetChildAlphaState(t).resetChildActiveState(t),this},resetChildrenState:function(t){for(var e=0,i=t.length;e<i;e++)this.resetChildState(t[e]);return this},syncProperties:function(){return this.syncPosition().syncVisible().syncAlpha().syncActive().syncScrollFactor().syncMask(),this}},X=Phaser.Math.RotateAround,Y={worldToLocal:function(t){return t.x-=this.x,t.y-=this.y,X(t,0,0,-this.rotation),t.x/=this.scaleX,t.y/=this.scaleY,t},localToWorld:function(t){return t.x*=this.scaleX,t.y*=this.scaleY,X(t,0,0,this.rotation),t.x+=this.x,t.y+=this.y,t}},G=function(t,e){return t===e?1:t/e},U={updateChildPosition:function(t){t.isRexContainerLite&&(t.syncChildrenEnable=!1);var e=E(t),i=e.parent;return e.syncPosition&&(t.x=e.x,t.y=e.y,i.localToWorld(t)),e.syncRotation&&(t.rotation=e.rotation+i.rotation),e.syncScale&&(t.scaleX=e.scaleX*i.scaleX,t.scaleY=e.scaleY*i.scaleY),t.isRexContainerLite&&(t.syncChildrenEnable=!0,t.syncPosition()),this},syncPosition:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildPosition,this),this},resetChildPositionState:function(t){var e=E(t),i=e.parent;return e.x=t.x,e.y=t.y,i.worldToLocal(e),e.scaleX=G(t.scaleX,i.scaleX),e.scaleY=G(t.scaleY,i.scaleY),e.rotation=t.rotation-i.rotation,this},setChildPosition:function(t,e,i){return t.x=e,t.y=i,this.resetChildPositionState(t),this},setChildLocalPosition:function(t,e,i){var n=E(t);return n.x=e,n.y=i,this.updateChildPosition(t),this},resetLocalPositionState:function(){var t=E(this).parent;return t&&t.resetChildPositionState(this),this}},B=Phaser.Math.DegToRad,N={updateChildRotation:function(t){var e=E(t),i=e.parent;return e.syncRotation&&(t.rotation=i.rotation+e.rotation),this},syncRotation:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildRotation,this),this},resetChildRotationState:function(t){var e=E(t),i=e.parent;return e.rotation=t.rotation-i.rotation,this},setChildRotation:function(t,e){return t.rotation=e,this.resetChildRotationState(t),this},setChildAngle:function(t,e){return t.angle=e,this.resetChildRotationState(t),this},setChildLocalRotation:function(t,e){return E(t).rotation=e,this.updateChildRotation(t),this},setChildLocalAngle:function(t,e){return E(t).rotation=B(e),this.updateChildRotation(t),this},resetLocalRotationState:function(){var t=E(this).parent;return t&&t.resetChildRotationState(this),this}},W={updateChildScale:function(t){var e=E(t),i=e.parent;return e.syncScale&&(t.scaleX=i.scaleX*e.scaleX,t.scaleY=i.scaleY*e.scaleY),this},syncScale:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildScale,this),this},resetChildScaleState:function(t){var e=E(t),i=e.parent;return e.scaleX=G(t.scaleX,i.scaleX),e.scaleY=G(t.scaleY,i.scaleY),this},setChildScale:function(t,e,i){return void 0===i&&(i=e),t.scaleX=e,t.scaleY=i,this.resetChildScaleState(t),this},setChildLocalScale:function(t,e,i){void 0===i&&(i=e);var n=E(t);return n.scaleX=e,n.scaleY=i,this.updateChildScale(t),this},setChildDisplaySize:function(t,e,i){return t.setDisplaySize(e,i),this.resetChildScaleState(t),this},resetLocalScaleState:function(){var t=E(this).parent;return t&&t.resetChildScaleState(this),this}},z={updateChildVisible:function(t){var e=E(t),i=e.parent,n=!e.hasOwnProperty("maskVisible")||e.maskVisible;return t.visible=i.visible&&e.visible&&n,this},syncVisible:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildVisible,this),this},resetChildVisibleState:function(t){var e=E(t);return e.hasOwnProperty("maskVisible")&&delete e.maskVisible,e.visible=t.visible,this},setChildVisible:function(t,e){return this.setChildLocalVisible(t,e),this},setChildLocalVisible:function(t,e){return void 0===e&&(e=!0),E(t).visible=e,this.updateChildVisible(t),this},setChildMaskVisible:function(t,e){return void 0===e&&(e=!0),E(t).maskVisible=e,this.updateChildVisible(t),this},resetLocalVisibleState:function(){var t=E(this).parent;return t&&t.resetChildVisibleState(this),this}},H={updateChildAlpha:function(t){var e=E(t),i=e.parent;return e.syncAlpha&&(t.alpha=i.alpha*e.alpha),this},syncAlpha:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildAlpha,this),this},resetChildAlphaState:function(t){var e=E(t),i=e.parent;return e.alpha=G(t.alpha,i.alpha),this},setChildAlpha:function(t,e){return t.alpha=e,this.resetChildAlphaState(t),this},setChildLocalAlpha:function(t,e){return E(t).alpha=e,this.updateChildAlpha(t),this},resetLocalAlphaState:function(){var t=E(this).parent;return t&&t.resetChildAlphaState(this),this}},J={updateChildActive:function(t){var e=E(t),i=e.parent;return t.active=i.active&&e.active,this},syncActive:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildActive,this),this},resetChildActiveState:function(t){return E(t).active=t.active,this},setChildActive:function(t,e){return t.active=e,this.resetChildActiveState(t),this},setChildLocalActive:function(t,e){return void 0===e&&(e=!0),E(t).active=e,this.updateChildActive(t),this},resetLocalActiveState:function(){var t=E(this).parent;return t&&t.resetChildActiveState(this),this}},K={updateChildScrollFactor:function(t){var e=E(t),i=e.parent;return e.syncScrollFactor&&(t.scrollFactorX=i.scrollFactorX,t.scrollFactorY=i.scrollFactorY),this},syncScrollFactor:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildScrollFactor,this),this}},Z={updateChildMask:function(t){return null==this.mask||(this.mask.hasOwnProperty("geometryMask")?this.mask.geometryMask:this.mask.bitmapMask)!==t&&(t.mask=this.mask),this},syncMask:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildMask,this),this},setMask:function(t){return this.mask=t,this},clearMask:function(t){void 0===t&&(t=!1);var e=this;return this._mask=null,this.setChildMaskVisible(this),this.children.forEach((function(t){t.clearMask&&t.clearMask(!1),t.hasOwnProperty("isRexContainerLite")||e.setChildMaskVisible(t);})),t&&this.mask&&this.mask.destroy(),this}},$=function(t,e){if(t.length<=1)return t;var i;void 0===e&&(e=!1);var n=t[0];return (i=n.displayList?n.displayList:n.parentContainer?n.parentContainer.list:n.scene.sys.displayList).depthSort&&(i.depthSort(),i=i.list),e?t.sort((function(t,e){return i.indexOf(e)-i.indexOf(t)})):t.sort((function(t,e){return i.indexOf(t)-i.indexOf(e)})),t},q={setDepth:function(t,e){if(this.depth=t,!e&&this.children)for(var i=this.getAllChildren(),n=0,s=i.length;n<s;n++)i[n].depth=t;return this},swapDepth:function(t){var e=this.depth,i=t.depth;return this.setDepth(i),t.setDepth(e),this},incDepth:function(t){if(this.depth+=t,this.children)for(var e=this.getAllChildren(),i=0,n=e.length;i<n;i++)e[i].depth+=t;return this},bringToTop:function(){var t=this.displayList,e=this.getAllChildren([this]);$(e,!1);for(var i=0,n=e.length;i<n;i++){var s=e[i];t.exists(s)&&t.bringToTop(s);}return this},moveDepthBelow:function(t){var e=this.displayList;if(t.displayList!==e)return this;var i=this.getAllChildren([this]);$(i,!1);for(var n=0,s=i.length;n<s;n++){var r=i[n];if(e.exists(r)){e.moveBelow(t,r);break}}return this},moveDepthAbove:function(t){var e=this.displayList;if(t.displayList!==e)return this;var i=this.getAllChildren([this]);$(i,!0);for(var n=0,s=i.length;n<s;n++){var r=i[n];if(e.exists(r)){e.moveAbove(t,r);break}}return this},bringChildToTop:function(t){var e=this.getAllChildren([this]);$(e,!0);var i=e[0];return i===t||i.displayList!==t.displayList||i.displayList.moveAbove(t,i),this},sendChildToBack:function(t){var e=this.getAllChildren([this]);$(e,!1);var i=e[0];return i===t||i.displayList!==t.displayList||i.displayList.moveBelow(t,i),this}},Q=function t(e,i){if(!i(e)&&e.isRexContainerLite)for(var n=e.children,s=0,r=n.length;s<r;s++)t(n[s],i);},tt=function(t,e){for(var i=[t];i.length>0;){var n=i.shift();!e(n)&&n.isRexContainerLite&&i.push.apply(i,f(n.children));}},et=Phaser.Utils.Array,it={getChildren:function(t){if(t)for(var e=0,i=this.children.length;e<i;e++)t.push(this.children[e]);else t=this.children;return t},getAllChildren:function(t){void 0===t&&(t=[]);var e=this;return tt(e,(function(i){i!==e&&t.push(i);})),t},getAllVisibleChildren:function(t){void 0===t&&(t=[]);var e=this;return tt(e,(function(i){if(i!==e)return !i.visible||void t.push(i)})),t},bfs:function(t,e){return void 0===e&&(e=this),tt(e,t),this},dfs:function(t,e){return void 0===e&&(e=this),Q(e,t),this},contains:function(t){var e=x(t);return !!e&&(e===this||this.contains(e))},getByName:function(t,e){if(e){for(var i,n,s=[this];s.length;)for(var r=0,a=(i=s.shift()).children.length;r<a;r++){if((n=i.children[r]).name===t)return n;n.isRexContainerLite&&s.push(n);}return null}return et.GetFirst(this.children,"name",t)},getRandom:function(t,e){return et.GetRandom(this.children,t,e)},getFirst:function(t,e,i,n){return et.GetFirstElement(this.children,t,e,i,n)},getAll:function(t,e,i,n){return et.GetAll(this.children,t,e,i,n)},count:function(t,e,i,n){return et.CountAllMatching(this.children,t,e,i,n)},swap:function(t,e){return et.Swap(this.children,t,e),this},setAll:function(t,e,i,n){return et.SetAll(this.children,t,e,i,n),this}},nt=function(t){for(var e=[],i=0,n=t.length;i<n;i++){var s=t[i];s.hasOwnProperty("rexContainer")&&e.push(s.rexContainer);}return e},st=function(t,e,i){if(i.parent){var n=i.parent,s=i.self;switch(e){case"x":case"y":n.updateChildPosition(s);break;case"angle":case"rotation":n.updateChildRotation(s);break;case"scaleX":case"scaleY":case"displayWidth":case"displayHeight":n.updateChildScale(s);break;case"alpha":n.updateChildAlpha(s);break;default:n.updateChildPosition(s),n.updateChildRotation(s),n.updateChildScale(s),n.updateChildAlpha(s);}}else t.remove();},rt={tweenChild:function(t){var e=t.targets;Array.isArray(e)||(e=[e]);var i=this.scene||function(t){for(var e=0,i=t.length;e<i;e++){var n=t[e].scene;if(n)return n}return null}(e);if(i){t.targets=nt(e);var n=i.tweens.add(t);return n.on("update",st),n}},tweenSelf:function(t){return t.targets=[this],this.tweenChild(t)},createTweenChildConfig:function(t){var e=t.targets;e&&(Array.isArray(e)||(e=[e]),t.targets=nt(e));var i=t.onUpdate;return t.onUpdate=function(t,e){i&&i(t,e),st(t,void 0,e);},t},tween:function(t){var e=this.scene;return t.targets||(t.targets=this),e.tweens.add(t)}},at=Phaser.GameObjects.Container,ot=Phaser.GameObjects.Layer,ht=function(t){return t instanceof ot},lt=function(t){var e=t.getAllChildren([t]);return e=e.filter((function(t){return !!t.displayList||!!t.parentContainer}))},ut=function(t){var e=lt(this);return $(e),t.add(e),this},ct=function(t,e,i){var n=lt(this);return $(n,e),t.remove(n),i&&n.forEach((function(t){t.addToDisplayList();})),this},dt={addToContainer:function(t){return t instanceof at?(this._setParentContainerFlag=!0,ut.call(this,t),this._setParentContainerFlag=!1,this):this},addToLayer:function(t){return ht(t)?(ut.call(this,t),this):this},removeFromContainer:function(){return this.parentContainer?(this._setParentContainerFlag=!0,ct.call(this,this.parentContainer,!0,!1),this._setParentContainerFlag=!1,this):this},removeFromLayer:function(t){return void 0===t&&(t=!0),ht(this.displayList)?(ct.call(this,this.displayList,!1,t),this):this},getParentContainer:function(){if(this.parentContainer)return this.parentContainer;for(var t=this.getParent();t;){var e=t.parentContainer;if(e)return e;t=t.getParent();}return null},addToParentContainer:function(t){if(!t.displayList)return this;var e=this.getParentContainer();return e?(t.isRexContainerLite?t.addToContainer(e):e.add(t),this):this}},ft={hasLayer:function(){return !!this.privateRenderLayer},enableLayer:function(){if(this.hasLayer())return this;var t=this.scene.add.layer();return this.moveDepthBelow(t),this.addToLayer(t),this.privateRenderLayer=t,this},getLayer:function(){return this.hasLayer()||this.enableLayer(),this.privateRenderLayer},getRenderLayer:function(){if(this.hasLayer())return this.privateRenderLayer;for(var t=this.getParent();t;){var e=t.privateRenderLayer;if(e)return e;t=t.getParent();}return null},addToRenderLayer:function(t){if(!t.displayList)return this;var e=this.getRenderLayer();return e?(t.isRexContainerLite?t.addToLayer(e):e.add(t),E(t).layer=e,this):this},removeFromRenderLayer:function(t){var e=E(t),i=e.layer;return i?(t.isRexContainerLite?t.removeFromLayer(!0):i.remove(t),e.layer=null,this):this}},pt=function(t){return void 0!==t.displayWidth?t.displayWidth:t.width},vt=function(t){return void 0!==t.displayHeight?t.displayHeight:t.height},yt=Phaser.Geom.Rectangle,gt=Phaser.Math.Vector2,mt=Phaser.Math.RotateAround,kt=function(t,e){if(void 0===e?e=new yt:!0===e&&(void 0===bt&&(bt=new yt),e=bt),t.getBounds)return t.getBounds(e);var i,n,s,r,a,o,h,l;if(t.parentContainer){var u=t.parentContainer.getBoundsTransformMatrix();Ct(t,e),u.transformPoint(e.x,e.y,e),i=e.x,n=e.y,Pt(t,e),u.transformPoint(e.x,e.y,e),s=e.x,r=e.y,St(t,e),u.transformPoint(e.x,e.y,e),a=e.x,o=e.y,xt(t,e),u.transformPoint(e.x,e.y,e),h=e.x,l=e.y;}else Ct(t,e),i=e.x,n=e.y,Pt(t,e),s=e.x,r=e.y,St(t,e),a=e.x,o=e.y,xt(t,e),h=e.x,l=e.y;return e.x=Math.min(i,s,a,h),e.y=Math.min(n,r,o,l),e.width=Math.max(i,s,a,h)-e.x,e.height=Math.max(n,r,o,l)-e.y,e},bt=void 0,Ct=function(t,e,i){return void 0===e?e=new gt:!0===e&&(void 0===Tt&&(Tt=new gt),e=Tt),t.getTopLeft?t.getTopLeft(e):(e.x=t.x-pt(t)*t.originX,e.y=t.y-vt(t)*t.originY,wt(t,e,i))},Pt=function(t,e,i){return void 0===e?e=new gt:!0===e&&(void 0===Tt&&(Tt=new gt),e=Tt),t.getTopRight?t.getTopRight(e):(e.x=t.x-pt(t)*t.originX+pt(t),e.y=t.y-vt(t)*t.originY,wt(t,e,i))},St=function(t,e,i){return void 0===e?e=new gt:!0===e&&(void 0===Tt&&(Tt=new gt),e=Tt),t.getBottomLeft?t.getBottomLeft(e):(e.x=t.x-pt(t)*t.originX,e.y=t.y-vt(t)*t.originY+vt(t),wt(t,e,i))},xt=function(t,e,i){return void 0===e?e=new gt:!0===e&&(void 0===Tt&&(Tt=new gt),e=Tt),t.getBottomRight?t.getBottomRight(e):(e.x=t.x-pt(t)*t.originX+pt(t),e.y=t.y-vt(t)*t.originY+vt(t),wt(t,e,i))},Tt=void 0,wt=function(t,e,i){(void 0===i&&(i=!1),0!==t.rotation&&mt(e,t.x,t.y,t.rotation),i&&t.parentContainer)&&t.parentContainer.getBoundsTransformMatrix().transformPoint(e.x,e.y,e);return e},Et=Phaser.Geom.Rectangle,Ot=Phaser.Geom.Rectangle.Union,Rt=function(e,i){var n=Array.isArray(e);if(void 0===i?i=n?[]:{}:function(e){if("object"!==t(e)||null===e)return e;if(Array.isArray(e))e.length=0;else for(var i in e)delete e[i];}(i),n){i.length=e.length;for(var s=0,r=e.length;s<r;s++)i[s]=e[s];}else for(var a in e)i[a]=e[a];return i},At=Phaser.GameObjects.GameObject,jt=Phaser.Utils.Objects.GetValue,Lt=Phaser.Textures.DynamicTexture,_t=Phaser.Utils.String.UUID,Mt=function(t){if(t){var e,i,n=t.gameObjects,s=t.renderTexture,r=jt(t,"x",void 0),a=jt(t,"y",void 0),o=jt(t,"width",void 0),h=jt(t,"height",void 0),l=jt(t,"originX",0),u=jt(t,"originY",0),c=jt(t,"padding",0);if(void 0===o||void 0===h||void 0===r||void 0===a){var d=function(t,e){var i;void 0===e?e=new Et:!0===e&&(void 0===S&&(S=new Et),e=S),e.setTo(0,0,0,0);for(var n=!0,s=0,r=t.length;s<r;s++)if((i=t[s]).getBounds){var a=kt(i,!0);n?(e.setTo(a.x,a.y,a.width,a.height),n=!1):Ot(a,e,e);}return e}(n,!0);void 0!==r&&void 0!==a?(o=2*Math.max(r-d.left,d.right-r),h=2*Math.max(a-d.top,d.bottom-a),l=.5,u=.5):(r=d.x,a=d.y,o=d.width,h=d.height,l=0,u=0),e=d.x,i=d.y;}else e=r+(0-l)*o,i=a+(0-u)*h;e-=c,i-=c,o+=2*c,h+=2*c;var f=n[0].scene;p&&!s&&(s=new Lt(f.sys.textures,_t(),o,h)),s||(s=f.add.renderTexture(0,0,o,h)),s.setPosition&&s.setPosition(r,a),s.width===o&&s.height===h||s.setSize(o,h),s.setOrigin&&s.setOrigin(l,u),s.camera.setScroll(e,i),n=$(Rt(n)),s.draw(n);var p=t.saveTexture;if(p)if(s instanceof At)s.saveTexture(p);else {var v=s,y=v.manager;y.exists(v.key)?y.renameTexture(v.key,key):(v.key=key,y.list[key]=v,y.emit("addtexture",key,v),y.emit("addtexture-".concat(key),v));}return s}},It={snapshot:function(t){var e=this.scaleX,i=this.scaleY,n=1===e&&1===i;n||this.setScale(1),void 0===t&&(t={}),t.gameObjects=this.getAllVisibleChildren(),t.x=this.x,t.y=this.y,t.originX=this.originX,t.originY=this.originY;var s=Mt(t),r=!!s.scene;return n||(this.setScale(e,i),r&&s.setScale(e,i)),r?s:this}},Vt=Phaser.Utils.Objects.GetValue,Ft=function(t,e,i,n,s,r,a){if(t.getBounds||void 0!==t.width&&void 0!==t.height){void 0===i&&(i=16777215),void 0===n&&(n=1),void 0===s&&(s=null),void 0===r&&(r=1),void 0===a&&(a=0);var o=Ct(t,Dt[0]);o.x-=a,o.y-=a;var h=Pt(t,Dt[1]);h.x+=a,h.y-=a;var l=xt(t,Dt[2]);l.x+=a,l.y+=a;var u=St(t,Dt[3]);u.x-=a,u.y+=a,null!==s&&e.fillStyle(s,r).fillPoints(Dt,!0,!0),null!==i&&e.lineStyle(n,i).strokePoints(Dt,!0,!0);}},Dt=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Xt=Phaser.Utils.Objects.GetValue,Yt=Phaser.Math.RotateAround,Gt={changeOrigin:function(t,e){this.syncChildrenEnable=!1,function(t,e,i){void 0===i&&(i=e);var n={x:(e-t.originX)*t.displayWidth,y:(i-t.originY)*t.displayHeight};Yt(n,0,0,t.rotation),t.originX=e,t.originY=i,t.x=t.x+n.x,t.y=t.y+n.y;}(this,t,e),this.syncChildrenEnable=!0;for(var i=this.getAllChildren(),n=0,s=i.length;n<s;n++)this.resetChildPositionState(i[n]);return this},drawBounds:function(t,e){var i=Xt(e,"drawContainer",!0),n=Xt(e,"children");return void 0===n&&(n=this.getAllVisibleChildren([this])),i||(n=n.filter((function(t){return !t.isRexContainerLite}))),function(t,e,i){var n,s,r,a,o;if("number"==typeof i?n=i:(n=Vt(i,"color"),s=Vt(i,"lineWidth"),r=Vt(i,"fillColor"),a=Vt(i,"fillAlpha",1),o=Vt(i,"padding",0)),Array.isArray(t))for(var h=0,l=t.length;h<l;h++)Ft(t[h],e,n,s,r,a,o);else Ft(t,e,n,s,r,a,o);}(n,t,e),this}};Object.assign(Gt,O,M,F,D,Y,U,N,W,z,H,J,K,Z,q,it,rt,dt,ft,It);var Ut=function(t){s(a,t);var i=h(a);function a(t,n,s,r,o,h){var l;return e(this,a),Array.isArray(r)&&(h=r,r=void 0,o=void 0),(l=i.call(this,t,n,s,r,o)).type="rexContainerLite",l.isRexContainerLite=!0,l.syncChildrenEnable=!0,l._active=!0,l._mask=null,l._scrollFactorX=1,l._scrollFactorY=1,l.privateRenderLayer=void 0,h&&l.add(h),l}return n(a,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.syncChildrenEnable=!1,u(r(a.prototype),"destroy",this).call(this,t),this.privateRenderLayer&&(this.privateRenderLayer.list.length=0,this.privateRenderLayer.destroy()));}},{key:"resize",value:function(t,e){return this.setSize(t,e),this}},{key:"x",get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.syncPosition());}},{key:"y",get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.syncPosition());}},{key:"rotation",get:function(){return u(r(a.prototype),"rotation",this)},set:function(t){this.rotation!==t&&(d(r(a.prototype),"rotation",t,this,!0),this.syncPosition());}},{key:"scaleX",get:function(){return u(r(a.prototype),"scaleX",this)},set:function(t){this.scaleX!==t&&(d(r(a.prototype),"scaleX",t,this,!0),this.syncPosition());}},{key:"scaleY",get:function(){return u(r(a.prototype),"scaleY",this)},set:function(t){this.scaleY!==t&&(d(r(a.prototype),"scaleY",t,this,!0),this.syncPosition());}},{key:"scale",get:function(){return u(r(a.prototype),"scale",this)},set:function(t){this.scale!==t&&(d(r(a.prototype),"scale",t,this,!0),this.syncPosition());}},{key:"visible",get:function(){return u(r(a.prototype),"visible",this)},set:function(t){u(r(a.prototype),"visible",this)!==t&&(d(r(a.prototype),"visible",t,this,!0),this.syncVisible());}},{key:"alpha",get:function(){return u(r(a.prototype),"alpha",this)},set:function(t){u(r(a.prototype),"alpha",this)!==t&&(d(r(a.prototype),"alpha",t,this,!0),this.syncAlpha());}},{key:"active",get:function(){return this._active},set:function(t){this._active!==t&&(this._active=t,this.syncActive());}},{key:"mask",get:function(){return this._mask},set:function(t){this._mask!==t&&(this._mask=t,this.syncMask());}},{key:"scrollFactorX",get:function(){return this._scrollFactorX},set:function(t){this._scrollFactorX!==t&&(this._scrollFactorX=t,this.syncScrollFactor());}},{key:"scrollFactorY",get:function(){return this._scrollFactorY},set:function(t){this._scrollFactorY!==t&&(this._scrollFactorY=t,this.syncScrollFactor());}},{key:"list",get:function(){return this.children}},{key:"parentContainer",get:function(){return this._parentContainer},set:function(t){this._parentContainer||t?this.setParentContainerFlag?this._parentContainer=t:this._parentContainer&&!t?(this.removeFromContainer(),this._parentContainer=t):t?(this._parentContainer=t,this.addToContainer(t)):this._parentContainer=t:this._parentContainer=t;}},{key:"setParentContainerFlag",get:function(){if(this._setParentContainerFlag)return !0;var t=x(this);return !!t&&t.setParentContainerFlag}}],[{key:"GetParent",value:function(t){return x(t)}}]),a}(C);Object.assign(Ut.prototype,Gt);var Bt={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):[]}},Nt=Phaser.Scene,Wt=function(t){return t instanceof Nt},zt=Phaser.Game,Ht=function(t){return t instanceof zt},Jt=Phaser.Utils.Objects.GetValue,Kt=function(){function i(t,n){e(this,i),this.setParent(t),this.isShutdown=!1,this.setEventEmitter(Jt(n,"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 n(i,[{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 i;return this.parent=e,this.scene=null==(i=e)||"object"!==t(i)?null:Wt(i)?i:i.scene&&Wt(i.scene)?i.scene:i.parent&&i.parent.scene&&Wt(i.parent.scene)?i.parent.scene:null,this.game=function(e){return null==e||"object"!==t(e)?null:Ht(e)?e:Ht(e.game)?e.game:Wt(e)?e.sys.game:Wt(e.scene)?e.scene.sys.game:void 0}(e),this}}]),i}();Object.assign(Kt.prototype,Bt);var Zt=Phaser.Utils.Objects.GetValue,$t=function(t){s(a,t);var i=h(a);function a(t,n){var s;return e(this,a),(s=i.call(this,t,n))._isRunning=!1,s.isPaused=!1,s.tickingState=!1,s.setTickingMode(Zt(n,"tickingMode",1)),s}return n(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(),u(r(a.prototype),"shutdown",this).call(this,t));}},{key:"setTickingMode",value:function(t){"string"==typeof t&&(t=qt[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}(Kt),qt={no:0,lazy:1,always:2},Qt=Phaser.Utils.Objects.GetValue,te=function(t){s(a,t);var i=h(a);function a(t,n){var s;e(this,a);var r=(s=i.call(this,t,n)).scene?"update":"step";return s.tickEventName=Qt(n,"tickEventName",r),s.isSceneTicker=!ee(s.tickEventName),s}return n(a,[{key:"startTicking",value:function(){u(r(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(){u(r(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}($t),ee=function(t){return "step"===t||"poststep"===t},ie=Phaser.Utils.Objects.GetValue,ne=Phaser.Math.Clamp,se=function(){function t(i){e(this,t),this.resetFromJSON(i);}return n(t,[{key:"resetFromJSON",value:function(t){this.state=ie(t,"state",re),this.timeScale=ie(t,"timeScale",1),this.delay=ie(t,"delay",0),this.repeat=ie(t,"repeat",0),this.repeatCounter=ie(t,"repeatCounter",0),this.repeatDelay=ie(t,"repeatDelay",0),this.duration=ie(t,"duration",0),this.nowTime=ie(t,"nowTime",0),this.justRestart=ie(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?oe:ae,this.repeatCounter=0,this}},{key:"stop",value:function(){return this.state=re,this}},{key:"update",value:function(t,e){this.state!==re&&this.state!==le&&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=he)):(this.nowTime=this.duration,this.state=le):this.nowTime>=0&&(this.state=oe));}},{key:"t",get:function(){var t;switch(this.state){case re:case ae:case he:t=0;break;case oe:t=this.nowTime/this.duration;break;case le:t=1;}return ne(t,0,1)},set:function(t){(t=ne(t,-1,1))<0?(this.state=ae,this.nowTime=-this.delay*t):(this.state=oe,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===re}},{key:"isDelay",get:function(){return this.state===ae}},{key:"isCountDown",get:function(){return this.state===oe}},{key:"isRunning",get:function(){return this.state===ae||this.state===oe}},{key:"isDone",get:function(){return this.state===le}},{key:"isOddIteration",get:function(){return 1==(1&this.repeatCounter)}},{key:"isEvenIteration",get:function(){return 0==(1&this.repeatCounter)}}]),t}(),re=0,ae=1,oe=2,he=3,le=-1,ue=function(t){s(a,t);var i=h(a);function a(t,n){var s;return e(this,a),(s=i.call(this,t,n)).timer=new se,s}return n(a,[{key:"shutdown",value:function(t){this.isShutdown||(u(r(a.prototype),"shutdown",this).call(this,t),this.timer.destroy(),this.timer=void 0);}},{key:"start",value:function(){return this.timer.start(),u(r(a.prototype),"start",this).call(this),this}},{key:"stop",value:function(){return this.timer.stop(),u(r(a.prototype),"stop",this).call(this),this}},{key:"complete",value:function(){return this.timer.stop(),u(r(a.prototype),"complete",this).call(this),this}}]),a}(te),ce=Phaser.Utils.Objects.GetValue,de=Phaser.Utils.Objects.GetAdvancedValue,fe=Phaser.Tweens.Builders.GetEaseFunction,pe=function(t){s(a,t);var i=h(a);function a(){return e(this,a),i.apply(this,arguments)}return n(a,[{key:"resetFromJSON",value:function(t){return this.timer.resetFromJSON(ce(t,"timer")),this.setEnable(ce(t,"enable",!0)),this.setTarget(ce(t,"target",this.parent)),this.setDelay(de(t,"delay",0)),this.setDuration(de(t,"duration",1e3)),this.setEase(ce(t,"ease","Linear")),this.setRepeat(ce(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=fe(t),this}},{key:"start",value:function(){return this.timer.isRunning||u(r(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),u(r(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 i=this.target,n=this.timer;return n.update(t,e),n.isDelay||this.updateGameObject(i,n),this.emit("update",i,this),n.isDone&&this.complete(),this}},{key:"updateGameObject",value:function(t,e){}}]),a}(ue),ve=Phaser.Utils.Objects.GetValue,ye=Phaser.Math.Linear,ge=function(t){s(a,t);var i=h(a);function a(t,n){var s;return e(this,a),(s=i.call(this,t,n)).resetFromJSON(),s.boot(),s}return n(a,[{key:"start",value:function(t){if(this.timer.isRunning)return this;var e=this.target;this.propertyKey=ve(t,"key","value");var i=e[this.propertyKey];return this.fromValue=ve(t,"from",i),this.toValue=ve(t,"to",i),this.setEase(ve(t,"ease",this.ease)),this.setDuration(ve(t,"duration",this.duration)),this.setRepeat(ve(t,"repeat",0)),this.setDelay(ve(t,"delay",0)),this.setRepeatDelay(ve(t,"repeatDelay",0)),this.timer.setDuration(this.duration).setRepeat(this.repeat).setDelay(this.delay).setRepeatDelay(this.repeatDelay),e[this.propertyKey]=this.fromValue,u(r(a.prototype),"start",this).call(this),this}},{key:"updateGameObject",value:function(t,e){var i=e.t;i=this.easeFn(i),t[this.propertyKey]=ye(this.fromValue,this.toValue,i);}}]),a}(pe),me=Phaser.Utils.Objects.IsPlainObject,ke=Phaser.Utils.Objects.GetValue,be=Phaser.Utils.Array.GetRandom,Ce={out:0,in:1},Pe=function(t,e){for(var i=0,n=arguments.length<=2?0:arguments.length-2;i<n;i++){var s=i+2<2||arguments.length<=i+2?void 0:arguments[i+2];if(s&&s.hasOwnProperty(t))return s[t]}return e},Se={setTransitionDirection:function(t){return "string"==typeof t&&(t=Ce[t]),this.dir=t,this},setDuration:function(t){return this.duration=t,this},setEaseFunction:function(t){return this.easeFunction=t,this},setNextTexture:function(t,e){return this.nextImage.setTexture(t,e),this},transit:function(t,e,i){if(this.isRunning&&(this.ignoreCompleteEvent=!0,this.stop(),this.ignoreCompleteEvent=!1),void 0!==i&&(t={key:t,frame:e,mode:i}),this.currentTransitionMode=void 0,me(t)){var n,s=t;t=ke(s,"key",void 0),e=ke(s,"frame",void 0),i=ke(s,"mode"),Array.isArray(i)&&(i=be(i)),this.transitionModes&&this.transitionModes.hasOwnProperty(i)&&(n=this.transitionModes[i],this.currentTransitionMode=i),this.setDuration(Pe("duration",this.duration,s,n)).setEaseFunction(Pe("ease",this.easeFunction,s,n)).setTransitionDirection(Pe("dir",this.dir,s,n));var r=Pe("mask",void 0,s,n);r&&this.setMaskGameObject(r),this.setMaskEnable(!0===r);var a=Pe("onStart",void 0,s,n),o=Pe("onProgress",void 0,s,n),h=Pe("onComplete",void 0,s,n);void 0===a&&void 0===o&&void 0===h||this.setTransitionStartCallback(a,Pe("onStartScope",void 0,s,n)).setTransitionProgressCallback(o,Pe("onProgressScope",void 0,s,n)).setTransitionCompleteCallback(h,Pe("onCompleteScope",void 0,s,n));}return this.setNextTexture(t,e),this.start(),this},addTransitionMode:function(t,e){return void 0===this.transitionModes&&(this.transitionModes={}),me(t)&&(t=(e=t).name,delete e.name),this.transitionModes[t]=e,this},start:function(){return void 0===this.easeValueTask&&(this.easeValueTask=new ge(this,{eventEmitter:null})),this.easeValueTask.restart({key:"t",from:0,to:1,duration:this.duration,ease:this.easeFunction}),this},pause:function(){return this.easeValueTask&&this.easeValueTask.pause(),this},resume:function(){return this.easeValueTask&&this.easeValueTask.resume(),this},stop:function(){return this.easeValueTask&&this.easeValueTask.stop(),this.setT(1),this}},xe=function(t,e,i,n,s){if(this.clear().fillStyle(16777215),1===this.shapeType){i=i.left;var r=Math.min(t,e)/2;this.fillCircle(-t*(n-.5),-e*(s-.5),r+i);}else this.fillRect(-t*n-i.left,-e*s-i.top,t+i.left+i.right,e+i.top+i.bottom);},Te=Phaser.Utils.Objects.GetValue,we=function(t,e){return void 0===t&&(t=0),void 0===e&&(e={}),"number"==typeof t?(e.left=t,e.right=t,e.top=t,e.bottom=t):(e.left=Te(t,"left",0),e.right=Te(t,"right",0),e.top=Te(t,"top",0),e.bottom=Te(t,"bottom",0)),e},Ee=function(t){s(a,t);var i=h(a);function a(t,n,s){var r;return e(this,a),void 0===n&&(n=0),"string"==typeof n&&(n=Oe[n]),(r=i.call(this,t.scene)).parent=t,r.shapeType=n,r.padding=we(s),r.setPosition().resize().setVisible(!1),r}return n(a,[{key:"destroy",value:function(){return this.parent=void 0,u(r(a.prototype),"destroy",this).call(this),this}},{key:"setPosition",value:function(t,e){var i=this.parent;return void 0===t&&(t=i.x),void 0===e&&(e=i.y),u(r(a.prototype),"setPosition",this).call(this,t,e),this}},{key:"resize",value:function(t,e,i){var n=this.parent;void 0===t&&(t=n.width),void 0===e&&(e=n.height),void 0===i?i=this.padding:"number"==typeof i&&(i=we(i));var s=this.width!==t||this.height!==e,r=this.padding!==i&&!function(t,e){for(var i in t){if(!(i in e))return !1;if(t[i]!==e[i])return !1}for(var i in e)if(!(i in t))return !1;return !0}(this.padding,i);return s||r?(this.width=t,this.height=e,r&&Rt(i,this.padding),this.originX=n.originX,this.originY=n.originY,xe.call(this,t,e,i,n.originX,n.originY),this):this}},{key:"setOrigin",value:function(t,e){void 0===e&&(e=t);var i=this.parent;return void 0===t&&(t=i.originX),void 0===e&&(e=i.originY),this.originX===t&&this.originY===e||(this.originX=t,this.originY=e,xe.call(this,this.width,this.height,this.padding,t,e)),this}}]),a}(Phaser.GameObjects.Graphics),Oe={rectangle:0,circle:1},Re={setMaskGameObject:function(t){if(!t)return this.removeMaskGameObject(),this;if(this.maskGameObject){if(!0===t&&this.maskGameObject instanceof Ee)return this;if(this.maskGameObject===t)return this;this.removeMaskGameObject();}return !0===t&&(t=new Ee(this)),t.resize(this.width,this.height).setOrigin(this.originX,this.originY).setPosition(0,0).setScale(1).setVisible(!1),this.addLocal(t),this.maskGameObject=t,t._maskObject||(t._maskObject=t.createGeometryMask(),t.once("destroy",(function(){t._maskObject.destroy(),t._maskObject=void 0;}))),this.childrenMask=t._maskObject,this},removeMaskGameObject:function(t){return void 0===t&&(t=!0),this.backImage.clearMask(),this.frontImage.clearMask(),this.childrenMask=void 0,this.remove(this.maskGameObject,t),this.maskGameObject=void 0,this},setImageMaskEnable:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!1),e?(this.childrenMask||this.setMaskGameObject(!0),t.setMask(this.childrenMask),this.childrenMask.setInvertAlpha(i)):t.clearMask(),this},setCurrentImageMaskEnable:function(t,e){return this.setImageMaskEnable(this.currentImage,t,e),this},setNextImageMaskEnable:function(t,e){return this.setImageMaskEnable(this.nextImage,t,e),this},setCellImagesMaskEnable:function(t,e){for(var i=this.getCellImages(),n=0,s=i.length;n<s;n++)this.setImageMaskEnable(i[n],t,e);return this},setMaskEnable:function(t,e){return this.setImageMaskEnable(this.backImage,t,e),this.setImageMaskEnable(this.frontImage,t,e),this.setCellImagesMaskEnable(t,e),this}},Ae=function(e,i,n,s,r,a){var o,h;null==n&&(n="__BASE"),a||(h=a,"object"===t(o=n)&&(o=o.name),void 0===h&&(h=","),a="__BASE"===o?function(t,e){return "".concat(t).concat(h).concat(e)}:function(t,e){return "".concat(o,"_").concat(t).concat(h).concat(e)});for(var l,u,c,d=e.sys.textures.get(i),f="object"===t(n)?n:d.get(n),p=f.width/s,v=f.height/r,y=f.cutX,g=f.cutY,m=0,k=0,b=0;b<r;b++){m=0;for(var C=0;C<s;C++)c=a(C,b),l=m+y,u=k+g,d.add(c,0,l,u,p,v),m+=p;k+=v;}return {getFrameNameCallback:a,cellWidth:p,cellHeight:v,columns:s,rows:r}},je=Phaser.Utils.Objects.GetValue,Le=Phaser.GameObjects.Image,_e=Phaser.Utils.Objects.IsPlainObject,Me=Phaser.Math.RotateAround,Ie={gridCutImage:function(t,e,i,n){void 0===n&&(n={}),n.objectPool=this.imagesPool;for(var s,r=function(t,e,i,n){_e(e)&&(e=je(n=e,"columns",1),i=je(n,"rows",1));var s=je(n,"createImageCallback");if(!s){var r=je(n,"ImageClass",Le);s=function(t,e,i){return new r(t,0,0,e,i)};}for(var a=je(n,"originX",.5),o=je(n,"originY",.5),h=je(n,"add",!0),l=je(n,"align",h),u=je(n,"objectPool",void 0),c=t.scene,d=t.texture,f=t.frame,p=Ae(c,d,f,e,i),v=p.getFrameNameCallback,y=t.scaleX,g=t.scaleY,m=t.rotation,k=t.getTopLeft(),b=k.x,C=k.y,P=[],S=p.cellWidth*y,x=p.cellHeight*g,T=0;T<i;T++)for(var w=0;w<e;w++){var E,O=v(w,T);if(E=u&&u.length>0?u.pop().setTexture(d,O):s(c,d,O),h&&c.add.existing(E),l){var R=b+S*w+a*S,A=C+x*T+o*x;E.setOrigin(a,o).setPosition(R,A).setScale(y,g).setRotation(m),Me(E,b,C,m);}P.push(E);}return P}(t,e,i,n),a=0,o=r.length;a<o;a++)(s=r[a]).setVisible(!0),this.add(s);return this.cellImages=r,this.setChildLocalVisible(t,!1),r},gridCutCurrentImage:function(t,e,i){return this.gridCutImage(this.currentImage,t,e,i)},gridCutNextImage:function(t,e,i){return this.gridCutImage(this.nextImage,t,e,i)},getCellImages:function(){return this.cellImages},freeCellImages:function(){var t;if(0===this.cellImages.length)return this;for(var e,i,n=this.cellImages[0].texture,s=this.cellImages,r=0,a=s.length;r<a;r++)e=s[r],this.setChildLocalAlpha(e,1).setChildLocalScale(e,1).setChildLocalVisible(e,!1),e.clearMask(),i=e.frame.name,e.setTexture(),n.remove(i);return (t=this.imagesPool).push.apply(t,f(s)),s.length=0,this}},Ve={};Object.assign(Ve,{setTransitionStartCallback:function(t,e){return this.onStartCallback=t,this.onStartCallbackScope=e,this},setTransitionProgressCallback:function(t,e){return this.onProgressCallback=t,this.onProgressCallbackScope=e,this},setTransitionCompleteCallback:function(t,e){return this.onCompleteCallback=t,this.onCompleteCallbackScope=e,this}},Se,Re,Ie,{setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}});var Fe=function(t,e,i,n){},De=function(t,e,i,n){t.setChildLocalAlpha(e,1-n).setChildLocalAlpha(i,n);},Xe=function(t,e,i,n){t.setChildLocalAlpha(e,1);},Ye=Phaser.Utils.Objects.IsPlainObject,Ge=Phaser.Utils.Objects.GetValue,Ue=Phaser.Math.Clamp,Be=function(t){s(a,t);var i=h(a);function a(t,n,s,r,o,h){var l;e(this,a),Ye(n)?(n=Ge(h=n,"x",0),s=Ge(h,"y",0),r=Ge(h,"key",void 0),o=Ge(h,"frame",void 0)):Ye(o)&&(h=o,o=void 0);var u=Ge(h,"back",void 0),c=Ge(h,"front",void 0);u||(u=t.add.image(n,s,r,o)),c||(c=t.add.image(n,s,r,o));var d=Ge(h,"width",c.width),f=Ge(h,"height",c.height);(l=i.call(this,t,n,s,d,f)).type="rexTransitionImage",u.setVisible(!1),l.addMultiple([u,c]),l.backImage=u,l.frontImage=c,l.maskGameObject=void 0,l.cellImages=[],l.imagesPool=[],l.transitionModes=void 0,l.currentTransitionMode=void 0;var p=Ge(h,"onStart",void 0),v=Ge(h,"onProgress",void 0),y=Ge(h,"onComplete",void 0),g=Ge(h,"dir",0);void 0===p&&void 0===v&&void 0===y&&(p=Fe,v=De,y=Xe,g=0),l.setTransitionStartCallback(p,Ge(h,"onStartScope",void 0)).setTransitionProgressCallback(v,Ge(h,"onProgressScope",void 0)).setTransitionCompleteCallback(y,Ge(h,