text: !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).rextabs=e()}(this,function(){"use strict";function u(t){return(u="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)}function w(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(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,n.key,n)}}function t(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t}function e(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}}),e&&i(t,e)}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(o){var s=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 t,e,i,n=l(o);if(s){var r=l(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return e=this,!(i=t)||"object"!=typeof i&&"function"!=typeof i?_(e):i}}function c(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=l(t)););return t}function f(t,e,i){return(f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=c(t,e);if(n){var r=Object.getOwnPropertyDescriptor(n,e);return r.get?r.get.call(i):r.value}})(t,e,i||t)}function s(t,e,i,n){return(s="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,e,i,n){var r,o,s,h,a=c(t,e);if(a){if((r=Object.getOwnPropertyDescriptor(a,e)).set)return r.set.call(n,i),!0;if(!r.writable)return!1}if(r=Object.getOwnPropertyDescriptor(n,e)){if(!r.writable)return!1;r.value=i,Object.defineProperty(n,e,r)}else h=i,(s=e)in(o=n)?Object.defineProperty(o,s,{value:h,enumerable:!0,configurable:!0,writable:!0}):o[s]=h;return!0})(t,e,i,n)}function r(t,e,i,n,r){if(!s(t,e,i,n||t)&&r)throw new Error("failed to set property");return i}function a(t){return function(t){if(Array.isArray(t))return h(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return h(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 h(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 h(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}var d=Phaser.GameObjects.Zone,p=Phaser.Utils.Array.Add,v=Phaser.Utils.Array.Remove,g=function(){e(h,d);var s=o(h);function h(t,e,i,n,r){var o;return w(this,h),void 0===n&&(n=1),void 0===r&&(r=1),(o=s.call(this,t,e,i,n,r)).children=[],o}return t(h,[{key:"destroy",value:function(t){this.scene&&(this.clear(!t),f(l(h.prototype),"destroy",this).call(this,t))}},{key:"contains",value:function(t){return-1!==this.children.indexOf(t)}},{key:"add",value:function(t){return p(this.children,t,0,function(t){t.on("destroy",this.remove,this)},this),this}},{key:"remove",value:function(t,e){return v(this.children,t,function(t){t.off("destroy",this.remove,this),e&&t.destroy()}),this}},{key:"clear",value:function(t){for(var e,i=0,n=this.children.length;i<n;i++)(e=this.children[i]).off("destroy",this.remove,this),t&&e.destroy();return this.children.length=0,this}}]),h}(),y=Phaser.GameObjects.Components;Phaser.Class.mixin(g,[y.Alpha,y.Flip]);function m(t){var e;return t.hasOwnProperty("rexContainer")&&(e=t.rexContainer.parent),e}function b(t){return this.setParent(t),this.resetChildState(t).updateChildVisible(t).updateChildActive(t).updateChildScrollFactor(t).updateChildMask(t),P.call(this,t),this}function C(t){this.setParent(t);var e=this.getLocalState(t);return e.x=t.x,e.y=t.y,e.rotation=t.rotation,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.flipX=t.flipX,e.flipY=t.flipY,e.alpha=t.alpha,e.visible=t.visible,e.active=t.active,this.updateChildPosition(t).updateChildAlpha(t).updateChildVisible(t).updateChildActive(t).updateChildScrollFactor(t).updateChildMask(t),P.call(this,t),this}function S(t,e){return t===e?1:t/e}function k(t){return"[object Array]"===Object.prototype.toString.call(t)}var B={setParent:function(t,e){void 0===e&&(e=this);var i=this.getLocalState(t);return e?(i.parent=e,i.self=t):(i.parent=null,i.self=null),this},getParent:function(t){return void 0===t&&(t=this),m(t)},getTopmostParent:function(t){return void 0===t&&(t=this),function(t){for(var e=m(t);e;)e=m(t=e);return t}(t)}},P=g.prototype.add,E={add:function(t){return Array.isArray(t)?this.addMultiple(t):b.call(this,t),this},addMultiple:function(t){for(var e=0,i=t.length;e<i;e++)b.call(this,t[e]);return this},addLocal:function(t){return Array.isArray(t)?this.addMultiple(t):C.call(this,t),this},addLocalMultiple:function(t){for(var e=0,i=t.length;e<i;e++)C.call(this,t[e]);return this}},x=g.prototype.remove,O=g.prototype.clear,z={remove:function(t,e){return this.getParent(t)!==this||(this.setParent(t,null),x.call(this,t,e)),this},clear:function(t){for(var e=0,i=this.children.length;e<i;e++)this.setParent(this.children[e],null);return O.call(this,t),this}},M=Phaser.Math.RotateAround,j={worldToLocal:function(t){return t.x-=this.x,t.y-=this.y,M(t,0,0,-this.rotation),t.x/=this.scaleX,t.y/=this.scaleY,t.x*=this.flipX?-1:1,t.y*=this.flipY?-1:1,t},localToWorld:function(t){return t.x*=this.flipX?-1:1,t.y*=this.flipY?-1:1,t.x*=this.scaleX,t.y*=this.scaleY,M(t,0,0,this.rotation),t.x+=this.x,t.y+=this.y,t}},X={updateChildPosition:function(t){t.isRexContainerLite&&(t.syncChildrenEnable=!1);var e=this.getLocalState(t);return t.x=e.x,t.y=e.y,this.localToWorld(t),t.scaleX=e.scaleX*this.scaleX,t.scaleY=e.scaleY*this.scaleY,void 0!==t.flipX&&(t.flipX=this.flipX?!e.flipX:e.flipX,t.flipY=this.flipY?!e.flipY:e.flipY),t.rotation=e.rotation+this.rotation,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=this.getLocalState(t);return e.x=t.x,e.y=t.y,this.worldToLocal(e),e.scaleX=S(t.scaleX,this.scaleX),e.scaleY=S(t.scaleY,this.scaleY),void 0!==t.flipX&&(e.flipX=t.flipX,e.flipY=t.flipY),e.rotation=t.rotation-this.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=this.getLocalState(t);return n.x=e,n.y=i,this.updateChildPosition(t),this}},Y={updateChildScale:function(t){return t.scaleX=this.scaleX*this.getLocalState(t).scaleX,t.scaleY=this.scaleY*this.getLocalState(t).scaleY,this},syncScale:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildScale,this),this},resetChildScaleState:function(t){return this.getLocalState(t).scaleX=S(t.scaleX,this.scaleX),this.getLocalState(t).scaleY=S(t.scaleY,this.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){return void 0===i&&(i=e),this.getLocalState(t).scaleX=e,this.getLocalState(t).scaleY=i,this.updateChildScale(t),this}},R={updateChildVisible:function(t){var e=this.getLocalState(t),i=!e.hasOwnProperty("maskVisible")||e.maskVisible;return t.visible=this.visible&&e.visible&&i,this},syncVisible:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildVisible,this),this},resetChildVisibleState:function(t){var e=this.getLocalState(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),this.getLocalState(t).visible=e,this.updateChildVisible(t),this},setChildMaskVisible:function(t,e){return void 0===e&&(e=!0),this.getLocalState(t).maskVisible=e,this.updateChildVisible(t),this}},T={updateChildAlpha:function(t){return t.alpha=this.alpha*this.getLocalState(t).alpha,this},syncAlpha:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildAlpha,this),this},resetChildAlphaState:function(t){return this.getLocalState(t).alpha=S(t.alpha,this.alpha),this},setChildAlpha:function(t,e){return t.alpha=e,this.resetChildAlphaState(t),this},setChildLocalAlpha:function(t,e){return this.getLocalState(t).alpha=e,this.updateChildAlpha(t),this}},A={updateChildActive:function(t){return t.active=this.active&&this.getLocalState(t).active,this},syncActive:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildActive,this),this},resetChildActiveState:function(t){return this.getLocalState(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),this.getLocalState(t).active=e,this.updateChildActive(t),this}},L={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){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this}},F=Phaser.Utils.Array,D={getChildren:function(){return this.children},getAllChildren:function(t){void 0===t&&(t=[]);for(var e,i=this.children,n=0,r=i.length;n<r;n++){if(e=i[n],t.push(e),e.hasOwnProperty("isRexContainerLite"))t.push.apply(t,a(e.getAllChildren()))}return t},getAllVisibleChildren:function(t){void 0===t&&(t=[]);for(var e,i=this.children,n=0,r=i.length;n<r;n++){if((e=i[n]).visible)if(t.push(e),e.hasOwnProperty("isRexContainerLite"))t.push.apply(t,a(e.getAllVisibleChildren()))}return t},contains:function(t){var e=this.getParent(t);return!!e&&(e===this||this.contains(e))},getByName:function(t,e){if(e){for(var i,n,r=[this];r.length;)for(var o=0,s=(i=r.shift()).children.length;o<s;o++){if((n=i.children[o]).name===t)return n;n.isRexContainerLite&&r.push(n)}return null}return F.GetFirst(this.children,"name",t)},getRandom:function(t,e){return F.GetRandom(this.children,t,e)},getFirst:function(t,e,i,n){return F.GetFirstElement(this.children,t,e,i,n)},getAll:function(t,e,i,n){return F.GetAll(this.children,t,e,i,n)},count:function(t,e,i,n){return F.CountAllMatching(this.children,t,e,i,n)},swap:function(t,e){return F.Swap(this.children,t,e),this},moveTo:function(t,e){return F.MoveTo(this.children,t,e),this},setAll:function(t,e,i,n){return F.SetAll(this.children,t,e,i,n),this}},N={tweenChild:function(t){var e=t.targets;k(e)||(e=[e]);for(var i,n,r=[],o=0,s=e.length;o<s;o++)(n=e[o]).hasOwnProperty("rexContainer")&&(i=n.scene,r.push(n.rexContainer));if(i){t.targets=r;var h=i.tweens.add(t);return h.on("update",function(t,e,i){var n=i.parent,r=i.self;switch(e){case"x":case"y":n.updateChildPosition(r);break;case"angle":case"rotation":n.updateChildRotation(r);break;case"scaleX":case"scaleY":n.updateChildScale(r);break;case"alpha":n.updateChildAlpha(r)}}),h}},tween:function(t){var e=this.scene;return t.targets||(t.targets=this),e.tweens.add(t)}},V={};Object.assign(V,B,E,z,{getLocalState:function(t){return t.hasOwnProperty("rexContainer")||(t.rexContainer={}),t.rexContainer},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}},j,X,{updateChildRotation:function(t){return t.rotation=this.rotation+this.getLocalState(t).rotation,this},syncRotation:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildRotation,this),this},resetChildRotationState:function(t){return this.getLocalState(t).rotation=t.rotation-this.rotation,this},setChildRotation:function(t,e){return t.rotation=e,this.resetChildRotationState(t),this},setChildLocalRotation:function(t,e){return this.getLocalState(t).rotation=e,this.updateChildRotation(t),this}},Y,R,T,A,{updateChildScrollFactor:function(t){return t.setScrollFactor(this.scrollFactorX,this.scrollFactorY),this},syncScrollFactor:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildScrollFactor,this),this}},L,{setDepth:function(t,e){if(this.depth=t,!e&&this.children)for(var i=this.getAllChildren(),n=0,r=i.length;n<r;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}},D,N);var G=function(){e(a,g);var h=o(a);function a(t,e,i,n,r,o){var s;return w(this,a),(s=h.call(this,t,e,i,n,r)).type="rexContainerLite",s.isRexContainerLite=!0,s.syncChildrenEnable=!0,s._active=!0,s._mask=null,s._scrollFactorX=1,s._scrollFactorY=1,o&&s.add(o),s}return t(a,[{key:"destroy",value:function(t){this.scene&&(this.syncChildrenEnable=!1,f(l(a.prototype),"destroy",this).call(this,t))}},{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 f(l(a.prototype),"rotation",this)},set:function(t){this.rotation!==t&&(r(l(a.prototype),"rotation",t,this,!0),this.syncPosition())}},{key:"scaleX",get:function(){return f(l(a.prototype),"scaleX",this)},set:function(t){this.scaleX!==t&&(r(l(a.prototype),"scaleX",t,this,!0),this.syncPosition())}},{key:"scaleY",get:function(){return f(l(a.prototype),"scaleY",this)},set:function(t){this.scaleY!==t&&(r(l(a.prototype),"scaleY",t,this,!0),this.syncPosition())}},{key:"flipX",get:function(){return f(l(a.prototype),"flipX",this)},set:function(t){f(l(a.prototype),"flipX",this)!==t&&(r(l(a.prototype),"flipX",t,this,!0),this.syncPosition())}},{key:"flipY",get:function(){return f(l(a.prototype),"flipY",this)},set:function(t){f(l(a.prototype),"flipY",this)!==t&&(r(l(a.prototype),"flipY",t,this,!0),this.syncPosition())}},{key:"visible",get:function(){return f(l(a.prototype),"visible",this)},set:function(t){f(l(a.prototype),"visible",this)!==t&&(r(l(a.prototype),"visible",t,this,!0),this.syncVisible())}},{key:"alpha",get:function(){return f(l(a.prototype),"alpha",this)},set:function(t){f(l(a.prototype),"alpha",this)!==t&&(r(l(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}}]),a}();Object.assign(G.prototype,V);function H(t){return t.hasOwnProperty("rexSizer")||(t.rexSizer={}),t.rexSizer}function W(){}var U,I=Phaser.Display.Align,J={center:I.CENTER,left:I.LEFT_CENTER,right:I.RIGHT_CENTER,top:I.TOP_CENTER,bottom:I.BOTTOM_CENTER,"left-top":I.TOP_LEFT,"left-center":I.LEFT_CENTER,"left-bottom":I.BOTTOM_LEFT,"center-top":I.TOP_CENTER,"center-center":I.CENTER,"center-bottom":I.BOTTOM_CENTER,"right-top":I.TOP_RIGHT,"right-center":I.RIGHT_CENTER,"right-bottom":I.BOTTOM_RIGHT},Z=new Phaser.GameObjects.Zone({sys:{queueDepthSort:W,events:{once:W}}},0,0,1,1);Z.setOrigin(0);function q(t){return void 0!==t.displayWidth?t.displayWidth:t.width}function $(t){return void 0!==t.displayHeight?t.displayHeight:t.height}function K(t){var e=$(t);return t.y+e-e*t.originY}function Q(t){var e=q(t);return t.x-e*t.originX+.5*e}function tt(t,e){var i=$(t);return t.y=e-i+i*t.originY,t}function et(t,e){var i=q(t),n=i*t.originX;return t.x=e+n-.5*i,t}function it(t){var e=q(t);return t.x-e*t.originX}function nt(t,e){var i=q(t);return t.x=e+i*t.originX,t}function rt(t){var e=q(t);return t.x+e-e*t.originX}function ot(t,e){var i=q(t);return t.x=e-i+i*t.originX,t}function st(t,e){var i=$(t),n=i*t.originY;return t.y=e+n-.5*i,t}function ht(t){var e=$(t);return t.y-e*t.originY+.5*e}function at(t){var e=$(t);return t.y-e*t.originY}function ut(t,e){var i=$(t);return t.y=e+i*t.originY,t}var lt=0,ct=1,dt=2,ft=4,pt=6,vt=8,gt=10,yt=12,mt=[];mt[11]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),et(t,Q(e)+i),tt(t,K(e)+n),t},mt[gt]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),nt(t,it(e)-i),tt(t,K(e)+n),t},mt[yt]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),ot(t,rt(e)+i),tt(t,K(e)+n),t},mt[pt]=function(t,e,i,n){var r,o,s;return void 0===i&&(i=0),void 0===n&&(n=0),r=t,o=Q(e)+i,s=ht(e)+n,et(r,o),st(r,s),t},mt[ft]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),nt(t,it(e)-i),st(t,ht(e)+n),t},mt[vt]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),ot(t,rt(e)+i),st(t,ht(e)+n),t},mt[ct]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),et(t,Q(e)+i),ut(t,at(e)-n),t},mt[lt]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),nt(t,it(e)-i),ut(t,at(e)-n),t},mt[dt]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),ot(t,rt(e)+i),ut(t,at(e)-n),t};function bt(t,e,i,n,r){return mt[i](t,e,n,r)}function Ct(t,e){return void 0===e&&(e={}),"number"==typeof t?(e.left=t,e.right=t,e.top=t,e.bottom=t):(e.left=wt(t,"left",0),e.right=wt(t,"right",0),e.top=wt(t,"top",0),e.bottom=wt(t,"bottom",0)),e}function St(t,e){return void 0===this.childrenMap&&(this.childrenMap={}),this.childrenMap[t]=e,this}function kt(){this._childrenWidth=void 0,this._childrenHeight=void 0}function Bt(t){return t instanceof At}function Pt(t){return Bt(t)?t:t.scene&&Bt(t.scene)?t.scene:t.parent&&t.parent.scene&&Bt(t.parent.scene)?t.parent.scene:void 0}var Et=Phaser.Utils.Objects.GetValue,xt=Phaser.GameObjects.Group,Ot=function(t){return t.add.text(0,0,"")},zt=new Phaser.Geom.Rectangle,wt=Phaser.Utils.Objects.GetValue,_t=G.prototype.add,Mt={pin:function(t){return _t.call(this,t),this},addBackground:function(t,e,i){return void 0===this.backgroundChildren&&(this.backgroundChildren=[]),"string"==typeof e&&(i=e,e=void 0),void 0===e&&(e=0),this.pin(t),this.backgroundChildren.push(t),this.getSizerConfig(t).padding=Ct(e),void 0!==i&&this.addChildrenMap(i,t),this},isBackground:function(t){return void 0!==this.backgroundChildren&&-1!==this.backgroundChildren.indexOf(t)}},jt=/(\S+)\[(\d+)\]/i,Xt=Phaser.Geom.Rectangle,Yt=new Xt,Rt=function(){function i(t,e){w(this,i),this.gameObject=t,this.scene=t.scene,this.resetFromJSON(e),this.boot()}return t(i,[{key:"resetFromJSON",value:function(t){var e,i,n,r,o,s,h,a;return void 0!==t.x?(e=null,i=t.x):void 0!==t.left?(e=0,i=t.left):void 0!==t.right?(e=1,i=t.right):void 0!==t.centerX&&(e=.5,i=t.centerX),void 0!==t.y?(n=null,r=t.y):void 0!==t.top?(n=0,r=t.top):void 0!==t.bottom?(n=1,r=t.bottom):void 0!==t.centerY&&(n=.5,r=t.centerY),void 0!==i&&(i=i.replace("left","0%").replace("right","100%").replace("center","50%").split("%"),o=parseFloat(i[0])/100,s=""===i[1]?0:parseFloat(i[1])),void 0!==r&&(r=r.replace("top","0%").replace("bottom","100%").replace("center","50%").split("%"),h=parseFloat(r[0])/100,a=""===r[1]?0:parseFloat(r[1])),this.setAlign(e,n),this.setPercentage(o,h),this.setOffset(s,a),this}},{key:"boot",value:function(){this.scene.scale.on("resize",this.anchor,this),this.gameObject.on("destroy",this.destroy,this),this.anchor()}},{key:"shutdown",value:function(){this.scene.scale.off("resize",this.anchor,this),this.gameObject=void 0,this.scene=void 0}},{key:"destroy",value:function(){this.shutdown()}},{key:"setAlign",value:function(t,e){return this.alignX=t,this.alignY=e,this}},{key:"setPercentage",value:function(t,e){return this.percentageX=t,this.percentageY=e,this}},{key:"setOffset",value:function(t,e){return this.offsetX=t,this.offsetY=e,this}},{key:"anchor",value:function(){return this.viewport=function(t,e){void 0===e?e=new Xt:!0===e&&(e=Yt);var i=t.scale,n=i.canvasBounds,r=i.displayScale,o=i.autoCenter;return e.x=0<=n.x?0:-(n.x*r.x),e.y=0<=n.y?0:-(n.y*r.y),e.width=n.width*r.x-e.x,e.height=n.height*r.y-e.y,1!==o&&2!==o||(e.width-=e.x),1!==o&&3!==o||(e.height-=e.y),e}(this.scene,!0),this.updatePosition(),this}},{key:"updatePosition",value:function(){var t=this.gameObject;return null===this.alignX?t.x=this.anchorX:void 0!==this.alignX&&(t.x=this.anchorX+t.displayWidth*(t.originX-this.alignX)),null===this.alignY?this.gameObject.y=this.anchorY:void 0!==this.alignY&&(t.y=this.anchorY+t.displayHeight*(t.originY-this.alignY)),this}},{key:"anchorX",get:function(){return this.viewport.x+this.viewport.width*this.percentageX+this.offsetX}},{key:"anchorY",get:function(){return this.viewport.y+this.viewport.height*this.percentageY+this.offsetY}}]),i}(),Tt={setEventEmitter:function(t,e){return void 0===e&&(e=Phaser.Events.EventEmitter),this._privateEE=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):[]}},At=Phaser.Scene,Lt=Phaser.GameObjects.GameObject,Ft=Phaser.Utils.Objects.GetValue,Dt=function(){function n(t,e){w(this,n),this.parent=t,this.scene=Pt(t);var i=Ft(e,"eventEmitter",!1);!0===i&&(i=void 0),this.setEventEmitter(i),this.boot()}return t(n,[{key:"boot",value:function(){this.parent instanceof Lt?this.parent.once&&this.parent.on("destroy",this.destroy,this):Bt(this.parent)&&this.parent.events.once("shutdown",this.destroy,this)}},{key:"shutdown",value:function(){return this.stop(),Bt(this.parent)&&this.parent.events.off("shutdown",this.destroy,this),this.destroyEventEmitter(),this.parent=void 0,this.scene=void 0,this}},{key:"destroy",value:function(){return this.shutdown(),this}},{key:"start",value:function(t){return this.isRunning||(this.tween=this.scene.tweens.add(t).on("complete",this.complete,this),!1===this.getEventEmitter()&&this.setEventEmitter(this.tween)),this}},{key:"restart",value:function(){return this.stop().start(),this}},{key:"stop",value:function(){return this.tween&&(this.getEventEmitter()===this.tween&&this.setEventEmitter(!1),this.tween.remove(),this.tween=void 0),this}},{key:"complete",value:function(){return this.stop(),this.getEventEmitter()&&this.emit("complete"),this}},{key:"isRunning",get:function(){return!!this.tween}}]),n}();Object.assign(Dt.prototype,Tt);function Nt(t){return i=t,n="complete",new Promise(function(t,e){i.once(n,function(){t()})});var i,n}function Vt(t,e,i,n,r){return!(!t||!t.getBounds)&&(!(n&&!n(t,e,i))&&(!!(ve=t.getBounds(ve)).contains(e,i)&&!(r&&!r(t,e,i))))}function Gt(t,e,i,n,r){return Vt(t,e,i,ge(n),ye(r))}function Ht(t){return!(t.rexSizer&&t.rexSizer.hidden)}function Wt(t,e,i){!t||void 0===e&&void 0===i||(t.resize?(void 0===e&&(e=t.width),void 0===i&&(i=t.height),t.resize(e,i)):(void 0!==e&&(t.displayWidth=e),void 0!==i&&(t.displayHeight=i)))}var Ut=Phaser.Utils.Objects.GetValue,It=Phaser.Utils.Objects.GetAdvancedValue,Jt=function(){e(r,Dt);var n=o(r);function r(t,e){var i;return w(this,r),(i=n.call(this,t)).gameObject=t,i.scaleStart={},i.scaleEnd={},i.resetFromJSON(e),i}return t(r,[{key:"resetFromJSON",value:function(t){return this.setMode(Ut(t,"mode",0)),this.setScaleRange(It(t,"start",void 0),It(t,"end",0)),this.setDelay(It(t,"delay",0)),this.setDuration(It(t,"duration",1e3)),this.setEase(Ut(t,"ease",void 0)),this}},{key:"toJSON",value:function(){return{mode:this.mode,startX:this.startX,startY:this.startY,endX:this.endX,endY:this.endY,delay:this.delay,duration:this.duration}}},{key:"setMode",value:function(t){return"string"==typeof t&&(t=Zt[t]),this.mode=t,this}},{key:"setScaleRange",value:function(t,e){return"number"==typeof t?(this.startX=t,this.startY=t):(this.startX=It(t,"x",this.gameObject.scaleX),this.startY=It(t,"y",this.gameObject.scaleY)),"number"==typeof e?(this.endX=e,this.endY=e):(this.endX=It(e,"x",void 0),this.endY=It(e,"y",void 0)),this}},{key:"setDelay",value:function(t){return this.delay=t,this}},{key:"setDuration",value:function(t){return this.duration=t,this}},{key:"setEase",value:function(t){return void 0===t&&(t="Linear"),this.ease=t,this}},{key:"start",value:function(){if(this.isRunning)return this;var t={targets:this.gameObject,delay:this.delay,duration:this.duration,ease:this.ease,yoyo:2==this.mode,repeat:2==this.mode?-1:0,onComplete:function(){1===this.mode&&this.gameObject.destroy()},onCompleteScope:this};return void 0!==this.startX&&void 0!==this.endX&&(this.gameObject.scaleX=this.startX,t.scaleX=this.endX),void 0!==this.startY&&void 0!==this.endY&&(this.gameObject.scaleY=this.startY,t.scaleY=this.endY),f(l(r.prototype),"start",this).call(this,t),this}}]),r}(),Zt={stop:0,destroy:1,yoyo:2},qt={},$t=Phaser.Utils.Objects.IsPlainObject,Kt={popUp:function(t,e,i){if($t(t)){var n=t;t=n.duration,e=n.orientation,i=n.ease}this._scale=function(t,e,i,n,r){switch(i){case qt.mode=0:case"x":qt.start={x:0};break;case 1:case"y":qt.start={y:0};break;default:qt.start=0}return qt.end=1,qt.duration=e,qt.ease=void 0===n?"Cubic":n,void 0===r?r=new Jt(t,qt):r.resetFromJSON(qt),r.restart(),r}(this,t,e,i,this._scale),this._scale.once("complete",function(){this.emit("popup.complete",this)},this);var r=this.getParentSizer();if(r){var o=this;this._scale.on("update",function(){r.resetChildPositionState(o)})}return this},popUpPromise:function(t,e,i){return this.popUp(t,e,i),Nt(this._scale)},scaleDownDestroy:function(t,e,i,n){if($t(t)){var r=t;t=r.duration,e=r.orientation,i=r.ease,n=r.destroy}this._scale=function(t,e,i,n,r,o){r instanceof Jt&&(o=r,r=void 0),void 0===r&&(r=!0);var s={};switch(s.mode=r?1:0,i){case 0:case"x":s.end={x:0};break;case 1:case"y":s.end={y:0};break;default:s.end=0}return s.duration=e,s.ease=void 0===n?"Linear":n,void 0===o?o=new Jt(t,s):o.resetFromJSON(s),o.restart(),o}(this,t,e,i,n,this._scale),this._scale.once("complete",function(){this.emit("scaledown.complete",this)},this);var o=this.getParentSizer();if(o){var s=this;this._scale.on("update",function(){o.resetChildPositionState(s)})}return this},scaleDownDestroyPromise:function(t,e,i,n){return this.scaleDownDestroy(t,e,i,n),Nt(this._scale)},scaleDown:function(t,e,i){return this.scaleDownDestroy(t,e,i,!1),this},scaleDownPromise:function(t,e,i){return this.scaleDown(t,e,i),Nt(this._scale)}},Qt=Phaser.Utils.Objects.GetValue,te=Phaser.Utils.Objects.GetAdvancedValue,ee=function(){e(r,Dt);var n=o(r);function r(t,e){var i;return w(this,r),(i=n.call(this,t)).gameObject=t,i.alphaStart=void 0,i.alphaEnd=void 0,i.resetFromJSON(e),i}return t(r,[{key:"resetFromJSON",value:function(t){return this.setMode(Qt(t,"mode",0)),this.setAlphaRange(te(t,"start",this.gameObject.alpha),te(t,"end",0)),this.setDelay(te(t,"delay",0)),this.setDuration(te(t,"duration",1e3)),this}},{key:"toJSON",value:function(){return{mode:this.mode,start:this.alphaStart,end:this.alphaEnd,delay:this.delay,duration:this.duration}}},{key:"shutdown",value:function(){return f(l(r.prototype),"shutdown",this).call(this),this.gameObject=void 0,this}},{key:"setMode",value:function(t){return"string"==typeof t&&(t=ie[t]),this.mode=t,this}},{key:"setAlphaRange",value:function(t,e){return this.alphaStart=t,this.alphaEnd=e,this}},{key:"setDelay",value:function(t){return this.delay=t,this}},{key:"setDuration",value:function(t){return this.duration=t,this}},{key:"start",value:function(){if(this.isRunning)return this;this.gameObject.setAlpha(this.alphaStart);var t={targets:this.gameObject,alpha:this.alphaEnd,delay:this.delay,duration:this.duration,ease:"Linear",yoyo:2==this.mode,repeat:2==this.mode?-1:0,onComplete:function(){1===this.mode&&this.gameObject.destroy()},onCompleteScope:this};return f(l(r.prototype),"start",this).call(this,t),this}}]),r}(),ie={stop:0,destroy:1,yoyo:2},ne=Phaser.Utils.Objects.IsPlainObject,re={},oe={},se=Phaser.Utils.Objects.IsPlainObject,he={fadeIn:function(t,e){var i,n,r,o,s,h;se(t)&&(t=t.duration);this._fade=(n=t,r=e,o=(i=this)._fade,h=ne(r)?(s=r.start,r.end):r,void 0===s&&(s=0),void 0===h&&(h=i.alpha),re.mode=0,re.start=s,re.end=h,re.duration=n,void 0===o?o=new ee(i,re):o.resetFromJSON(re),o.restart(),o),this._fade.once("complete",function(){this.emit("fadein.complete",this)},this);var a=this.getParentSizer();if(a){var u=this;this._fade.on("update",function(){a.resetChildAlphaState(u)})}return this},fadeInPromoise:function(t,e){return this.fadeIn(t,e),Nt(this._fade)},fadeOutDestroy:function(t,e){if(se(t)){var i=t;t=i.duration,e=i.destroy}var n,r,o,s;this._fade=(r=t,o=e,s=(n=this)._fade,o instanceof ee&&(s=o,o=void 0),void 0===o&&(o=!0),oe.mode=o?1:0,oe.end=0,oe.duration=r,void 0===s?s=new ee(n,oe):s.resetFromJSON(oe),s.restart(),s),this._fade.once("complete",function(){this.emit("fadeout.complete",this)},this);var h=this.getParentSizer();if(h){var a=this;this._fade.on("update",function(){h.resetChildAlphaState(a)})}return this},fadeOutDestroyPromise:function(t,e){return this.fadeOutDestroy(t,e),Nt(this._fade)},fadeOut:function(t){return this.fadeOutDestroy(t,!1),this},fadeOutPromise:function(t){return this.fadeOut(t),Nt(this._fade)}},ae=Phaser.Utils.Objects.GetValue,ue=Phaser.Utils.Objects.GetAdvancedValue,le=function(){e(r,Dt);var n=o(r);function r(t,e){var i;return w(this,r),(i=n.call(this,t)).gameObject=t,i.resetFromJSON(e),i}return t(r,[{key:"resetFromJSON",value:function(t){if(this.setMode(ae(t,"mode",0)),t&&(t.hasOwnProperty("x")||t.hasOwnProperty("y"))){var e=ue(t,"x",void 0),i=ue(t,"y",void 0);this.setTargetPosition(e,i)}else this.setTargetPosition(t);return this.setDelay(ue(t,"delay",0)),this.setDuration(ue(t,"duration",1e3)),this.setEase(ae(t,"ease",void 0)),this}},{key:"toJSON",value:function(){return{mode:this.mode,startX:this.startX,startY:this.startY,endX:this.endX,endY:this.endY,delay:this.delay,duration:this.duration}}},{key:"setMode",value:function(t){return"string"==typeof t&&(t=ce[t]),this.mode=t,this}},{key:"setTargetPosition",value:function(t,e){if("number"==typeof t||"number"==typeof e)this.startX=this.gameObject.x,this.startY=this.gameObject.y,this.endX=t,this.endY=e;else{var i=t;this.startX=ue(i,"startX",void 0),this.startY=ue(i,"startY",void 0),this.endX=ue(i,"endX",void 0),this.endY=ue(i,"endY",void 0)}return this}},{key:"setDelay",value:function(t){return this.delay=t,this}},{key:"setDuration",value:function(t){return this.duration=t,this}},{key:"setEase",value:function(t){return void 0===t&&(t="Linear"),this.ease=t,this}},{key:"start",value:function(){if(this.isRunning)return this;var t={targets:this.gameObject,delay:this.delay,duration:this.duration,ease:this.ease,yoyo:2==this.mode,repeat:2==this.mode?-1:0,onComplete:function(){1===this.mode&&this.gameObject.destroy()},onCompleteScope:this};return void 0!==this.startX&&void 0!==this.endX&&(this.gameObject.setX(this.startX),t.x=this.endX),void 0!==this.startY&&void 0!==this.endY&&(this.gameObject.setY(this.startY),t.y=this.endY),f(l(r.prototype),"start",this).call(this,t),this}}]),r}(),ce={stop:0,destroy:1,yoyo:2},de=function(t,e){if("number"==typeof t)return t;var i=t[0],n=parseFloat(t.substr(2));switch(i){case"+":return e+n;case"-":return e-n;case"*":return e*n;case"/":return e/n}},fe=Phaser.Utils.Objects.IsPlainObject,pe={moveFrom:function(t,e,i,n,r){if(fe(e)){var o=e;e=o.x,i=o.y,t=o.duration,n=o.ease}this._easeMove=function(t,e,i,n,r,o,s){o instanceof le&&(s=o,o=void 0),void 0===o&&(o=!1);var h={};return h.mode=o?1:0,void 0!==i&&(h.startX=de(i,t.x),h.endX=t.x),void 0!==n&&(h.startY=de(n,t.y),h.endY=t.y),h.duration=e,h.ease=void 0===r?"Linear":r,void 0===s?s=new le(t,h):s.resetFromJSON(h),s.restart(),s}(this,t,e,i,n,r,this._easeMove),this._easeMove.once("complete",function(){this.emit("movefrom.complete",this)},this);var s=this.getParentSizer();if(s){var h=this;this._easeMove.on("update",function(){s.resetChildPositionState(h)})}return this},moveFromPromise:function(t,e,i,n,r){return this.moveFrom(t,e,i,n,r),Nt(this._easeMove)},moveFromDestroy:function(t,e,i,n){return this.moveFrom(t,e,i,n,!0),this},moveFromDestroyPromise:function(t,e,i,n){return this.moveFromDestroy(t,e,i,n),Nt(this._easeMove)},moveTo:function(t,e,i,n,r){if(fe(e)){var o=e;e=o.x,i=o.y,t=o.duration,n=o.ease}this._easeMove=function(t,e,i,n,r,o,s){o instanceof le&&(s=o,o=void 0),void 0===o&&(o=!1);var h={};return h.mode=o?1:0,void 0!==i&&(h.startX=t.x,h.endX=de(i,t.x)),void 0!==n&&(h.startY=t.y,h.endY=de(n,t.y)),h.duration=e,h.ease=void 0===r?"Linear":r,void 0===s?s=new le(t,h):s.resetFromJSON(h),s.restart(),s}(this,t,e,i,n,r,this._easeMove),this._easeMove.once("complete",function(){this.emit("moveto.complete",this)},this);var s=this.getParentSizer();if(s){var h=this;this._easeMove.on("update",function(){s.resetChildPositionState(h)})}return this},moveToPromise:function(t,e,i,n,r){return this.moveTo(t,e,i,n,r),Nt(this._easeMove)},moveToDestroy:function(t,e,i,n){return this.moveTo(t,e,i,n,!0),this},moveToDestroyPromise:function(t,e,i,n){return this.moveToDestroy(t,e,i,n,!0),Nt(this._easeMove)}},ve=void 0,ge=function(n){return n?function(t,e,i){return!!Ht(t)&&(n(t,e,i),!0)}:Ht},ye=function(t){return t},me=Phaser.Display.Align.CENTER,be={getSizerConfig:H,pushIntoBounds:function(t){return void 0===t&&(t=function(t,e){void 0===e&&(void 0===U&&(U=new Phaser.Geom.Rectangle),e=U);var i=t.game.config;return e.setTo(0,0,i.width,i.height),e}(this.scene)),this.left=Math.max(this.left,t.left),this.right=Math.min(this.right,t.right),this.top=Math.max(this.top,t.top),this.bottom=Math.min(this.bottom,t.bottom),this},drawBounds:function(t,e){var i,n,r,o,s=t.scene;if("number"==typeof e)i=e;else{i=Et(e,"color",16777215);var h=Et(e,"name",!1);h&&(n=Et(h,"createTextCallback",Ot),r=Et(h,"createTextCallbackScope",void 0),"string"==typeof(o=Et(h,"align","left-top"))&&(o=J[o]))}if(n&&!t.children){t.children=new xt(s),t.on("destroy",function(){t.children.destroy(!0),t.children=void 0});var a=t.clear.bind(t);t.clear=function(){a(),t.children.clear(!1,!0)}}for(var u,l,c=this.getAllChildren([this]),d=0,f=c.length;d<f;d++)(u=c[d]).getBounds&&(i&&t.lineStyle(1,i).strokeRectShape(u.getBounds(zt)),u.name&&n&&(l=r?n.call(r,s):n(s))&&(l.setText(u.name),t.children.add(l),Z.setPosition(zt.x,zt.y).setSize(zt.width,zt.height),bt(l,Z,o)));return this},getChildrenWidth:function(){return 0},getChildrenHeight:function(){return 0},addChildrenMap:St,addElement:St,getElement:function(t,e){if("string"==typeof t&&(t=t.split(".")),0!==t.length){var i=t.shift(),n=null;if("#"===i.charAt(0))i=i.substring(1),n=this.getByName(i,e);else if(-1===i.indexOf("["))this.childrenMap&&(n=this.childrenMap[i]);else{var r=i.match(jt);if(null!=r&&this.childrenMap){var o=this.childrenMap[r[1]];o&&(n=o[r[2]])}}return 0===t.length?n:n&&n.childrenMap?n.getElement(t):null}},getAllChildrenSizers:function(t){void 0===t&&(t=[]);for(var e=t.length,i=this.getChildrenSizers(t),n=t.length,r=e;r<n;r++)i[r].getAllChildrenSizers(t);return t},getChildrenSizers:function(t){return void 0===t&&(t=[]),t},preLayout:function(t){if(!t){this._layoutInit();for(var e,i=this.getChildrenSizers(),n=0,r=i.length;n<r;n++)!(e=i[n]).rexSizer.hidden&&e.dirty&&e.preLayout()}},_layoutInit:kt,layout:function(){return this._layout(),this},_layout:function(t,e,i){return this.rexSizer.hidden||!this.dirty?this:(this.preLayout(t),void 0===e&&(e=Math.max(this.childrenWidth,this.minWidth)),void 0===i&&(i=Math.max(this.childrenHeight,this.minHeight)),this.resize(e,i),this.layoutBackgrounds(),this.postLayout())},layoutBackgrounds:function(){if(void 0!==this.backgroundChildren)for(var t,e,i,n,r,o,s,h=this.backgroundChildren,a=this.left,u=this.top,l=this.width,c=this.height,d=0,f=h.length;d<f;d++)(e=(t=h[d]).rexSizer).hidden||(n=a+(i=e.padding).left,r=u+i.top,o=l-i.left-i.right,s=c-i.top-i.bottom,Wt(t,o,s),Z.setPosition(n,r).setSize(o,s),bt(t,Z,me),this.resetChildPositionState(t))},postLayout:function(){return this._anchor&&this._anchor.updatePosition(),this},setAnchor:function(t){return void 0===this._anchor?this._anchor=new Rt(this,t):this._anchor.resetFromJSON(t),this},isInTouching:function(t,e){return void 0===e&&(e=this),function(t,e,i,n){if(e)return Vt(t,e.x,e.y,i,n);for(var r=t.scene.input.manager,o=r.pointersTotal,s=r.pointers,h=0;h<o;h++)if(e=s[h],Vt(t,e.x,e.y,i,n))return!0;return!1}(e,t)},pointToChild:function(t,e,i,n,r){var o;if((o=i)&&"function"==typeof o||(r=i,n=i=void 0),void 0===r&&(r=this.sizerChildren?this.sizerChildren:this.children),k(r)){for(var s,h=0,a=r.length;h<a;h++)if(s=r[h],Gt(s,t,e,i,n))return s}else for(var u in r)if(s=r[u],Gt(s,t,e,i,n))return s;return null},setDraggable:function(r,t){var e=u(r);return"string"===e?r=this.getElement(r):void 0!==r&&"object"==e||(t=r,r=this),void 0===t&&(t=!0),r.input&&r.input.hasOwnProperty("draggable")?r.input.draggable=t:t&&(r.setInteractive(),r.scene.input.setDraggable(r),r.on("drag",function(t,e,i){var n=this.getTopmostSizer();n.x+=e-r.x,n.y+=i-r.y},this)),this}};Object.assign(be,Mt,{getParentSizer:function(t){return this.getParent(t)},getTopmostSizer:function(t){return this.getTopmostParent(t)}},Kt,he,pe);var Ce=Phaser.Utils.Objects.GetValue,Se=function(){e(u,G);var a=o(u);function u(t,e,i,n,r,o){var s;w(this,u),(s=a.call(this,t,e,i,2,2)).isRexSizer=!0,s.setMinSize(n,r),s.setName(Ce(o,"name","")),s.rexSizer={},s.backgroundChildren=void 0,s.sizerChildren=void 0;var h=Ce(o,"anchor",void 0);return h&&s.setAnchor(h),s.space=Ct(Ce(o,"space",0)),s.setDraggable(Ce(o,"draggable",!1)),s.setDirty(!0),s}return t(u,[{key:"destroy",value:function(t){this.scene&&(void 0!==this.backgroundChildren&&(this.backgroundChildren.length=0),f(l(u.prototype),"destroy",this).call(this,t))}},{key:"setMinSize",value:function(t,e){return this.setMinWidth(t).setMinHeight(e),this}},{key:"setMinWidth",value:function(t){return null==t&&(t=0),this.minWidth=t,this}},{key:"setMinHeight",value:function(t){return null==t&&(t=0),this.minHeight=t,this}},{key:"setDirty",value:function(t){return void 0===t&&(t=!0),this.dirty=t,this}},{key:"childrenWidth",get:function(){return void 0===this._childrenWidth&&(this._childrenWidth=this.getChildrenWidth()),this._childrenWidth}},{key:"childrenHeight",get:function(){return void 0===this._childrenHeight&&(this._childrenHeight=this.getChildrenHeight()),this._childrenHeight}},{key:"left",get:function(){return this.x-q(this)*this.originX},set:function(t){this.x+=t-this.left}},{key:"alignLeft",value:function(t){return this.left=t,this}},{key:"right",get:function(){return this.left+q(this)},set:function(t){this.x+=t-this.right}},{key:"alignRight",value:function(t){return this.right=t,this}},{key:"centerX",get:function(){return this.left+q(this)/2},set:function(t){this.x+=t-this.centerX}},{key:"alignCenterX",value:function(t){return this.centerX=t,this}},{key:"top",get:function(){return this.y-$(this)*this.originY},set:function(t){this.y+=t-this.top}},{key:"alignTop",value:function(t){return this.top=t,this}},{key:"bottom",get:function(){return this.top+$(this)},set:function(t){this.y+=t-this.bottom}},{key:"alignBottom",value:function(t){return this.bottom=t,this}},{key:"centerY",get:function(){return this.top+$(this)/2},set:function(t){this.y+=t-this.centerY}},{key:"alignCenterY",value:function(t){return this.centerY=t,this}},{key:"innerLeft",get:function(){return this.left+this.space.left}},{key:"innerRight",get:function(){return this.right-this.space.right}},{key:"innerTop",get:function(){return this.top+this.space.top}},{key:"innerBottom",get:function(){return this.bottom-this.space.bottom}},{key:"innerWidth",get:function(){return this.width-this.space.left-this.space.right}},{key:"innerHeight",get:function(){return this.height-this.space.top-this.space.bottom}}]),u}();Object.assign(Se.prototype,be);function ke(){return Array.prototype.reduce.call(arguments,xe,0)}function Be(t,e){var i,n=t.rexSizer;if(n.expand){var r=n.padding;i=e-r.left-r.right}return i}function Pe(t,e){var i,n=t.rexSizer;if(n.expand){var r=n.padding;i=e-r.top-r.bottom}return i}function Ee(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=t.length-1);for(var r=i;r<=n;r++)t[r]=e;return t}var xe=function(t,e){return t+e},Oe=Phaser.Utils.Objects.IsPlainObject,ze=Phaser.Utils.Objects.GetValue,we=Phaser.Display.Align.CENTER,_e={add:function(t,e,i,n,r,o,s){this.pin(t),Oe(e)&&(e=ze(h=e,"column",void 0),i=ze(h,"row",void 0),n=ze(h,"align",we),r=ze(h,"padding",0),o=ze(h,"expand",!1),s=ze(h,"key",void 0));var h,a=function(t,e,i,n,r){if("number"==typeof t||"number"==typeof e)if(void 0===t){for(var o=0;o<n;o++)if(!i[s=e*n+o])return s}else if(void 0===e){for(o=0;o<r;o++)if(!i[s=o*n+t])return s}else{if(!i[s=e*n+t])return s}else if(!0===e){var s;for(o=0;o<n;o++)for(var h=0;h<r;h++)if(!i[s=h*n+o])return s}else{o=0;for(var a=i.length;o<a;o++)if(!i[o])return o}return null}(e,i,this.sizerChildren,this.columnCount,this.rowCount);return null===a||("string"==typeof n&&(n=J[n]),void 0===n&&(n=we),void 0===r&&(r=0),void 0===o&&(o=!0),(h=this.getSizerConfig(t)).align=n,h.padding=Ct(r),h.expand=o,this.sizerChildren[a]=t,void 0!==s&&this.addChildrenMap(s,t)),this}},Me=Phaser.Utils.Array.Remove,je=G.prototype.remove,Xe=G.prototype.clear,Ye={remove:function(t,e){if(this.getParentSizer(t)!==this)return this;if(this.isBackground(t))Me(this.backgroundChildren,t);else{var i=this.sizerChildren.indexOf(t);-1!==i&&(this.sizerChildren[i]=null)}return je.call(this,t,e),this},removeAt:function(t,e,i){var n=this.getChildAt(t,e);return n&&this.remove(n,i),this},removeAll:function(t){for(var e=0,i=this.sizerChildren;e<i;e++)this.sizerChildren[e]&&this.remove(this.sizerChildren[e],t);return this},clear:function(t){return Ee(this.sizerChildren,null),this.backgroundChildren&&(this.backgroundChildren.length=0),Xe.call(this,t),this}},Re=Phaser.Utils.Objects.GetValue,Te={getChildrenWidth:function(){if(this.rexSizer.hidden)return 0;for(var t,e,i,n,r=0,o=this.sizerChildren,s=0;s<this.columnCount;s++){if((t=0)===this.columnProportions[s]){for(var h=0;h<this.rowCount;h++)(e=o[h*this.columnCount+s])&&(e.rexSizer.hidden||(n=e.isRexSizer?Math.max(e.minWidth,e.childrenWidth):q(e),n+=(i=e.rexSizer.padding).left+i.right,t=Math.max(t,n)));r+=t}this.columnWidth[s]=t}return r+ke.apply(void 0,[this.space.left].concat(a(this.space.column),[this.space.right]))},getChildrenHeight:function(){if(this.rexSizer.hidden)return 0;for(var t,e,i,n,r=0,o=this.sizerChildren,s=0;s<this.rowCount;s++){if((t=0)===this.rowProportions[s]){for(var h=0;h<this.columnCount;h++)(e=o[s*this.columnCount+h])&&(e.rexSizer.hidden||(n=e.isRexSizer?Math.max(e.minHeight,e.childrenHeight):$(e),n+=(i=e.rexSizer.padding).top+i.bottom,t=Math.max(t,n)));r+=t}this.rowHeight[s]=t}return r+ke.apply(void 0,[this.space.top].concat(a(this.space.row),[this.space.bottom]))},getChildrenSizers:function(t){void 0===t&&(t=[]);for(var e,i=this.sizerChildren,n=0,r=i.length;n<r;n++)(e=i[n])&&e.isRexSizer&&t.push(e);return t},_layout:function(t,e,i){if(this.rexSizer.hidden||!this.dirty)return this;this.preLayout(t);var n,r,o,s,h=this.totalColumnProportions,a=this.totalRowProportions;if(void 0===e)if(t&&0<h){var u=this.rexSizer.padding;e=t.width-u.left-u.right}else e=Math.max(this.childrenWidth,this.minWidth);if(void 0===i)if(t&&0<a){var u=this.rexSizer.padding;i=t.height-u.top-u.bottom}else i=Math.max(this.childrenHeight,this.minHeight);this.resize(e,i),n=0<h?(this.width-this.childrenWidth)/h:0,r=0<a?(this.height-this.childrenHeight)/a:0;for(var l,c,d,f,p,v,g,y,m,b,C=this.innerLeft,S=C,k=this.innerTop,B=this.space.column,P=this.space.row,E=0;E<this.rowCount;E++){b=0===(y=this.rowProportions[E])?this.rowHeight[E]:y*r,S=C;for(var x=0;x<this.columnCount;x++)m=0===(g=this.columnProportions[x])?this.columnWidth[x]:g*n,(o=this.getChildAt(x,E))&&!o.rexSizer.hidden&&(p=Be(o,m),v=Pe(o,b),o.isRexSizer?o._layout(this,p,v):Wt(o,p,v),l=S+(u=(s=o.rexSizer).padding).left,d=m-u.left-u.right,c=k+u.top,f=b-u.top-u.bottom,Z.setPosition(l,c).setSize(d,f),bt(o,Z,s.align),this.resetChildPositionState(o)),S+=m+B[x];k+=b+P[E]}return this.layoutBackgrounds(),this.postLayout()},resetGrid:function(t,e,i,n,r){if(void 0===i&&(i=0),void 0===n&&(n=0),this.columnCount=t,this.rowCount=e,void 0===this.sizerChildren?this.sizerChildren=[]:this.removeAll(),this.sizerChildren.length=t*e,Ee(this.sizerChildren,null),this.columnProportions=[],this.columnProportions.length=t,"number"==typeof i)Ee(this.columnProportions,i);else for(var o=0;o<t;o++)this.columnProportions[o]=i[o]||0;if(this.rowProportions=[],this.rowProportions.length=e,"number"==typeof n)Ee(this.rowProportions,n);else for(o=0;o<e;o++)this.rowProportions[o]=n[o]||0;this.columnWidth=[],this.columnWidth.length=t,this.rowHeight=[],this.rowHeight.length=e,this.space.column=[],this.space.column.length=t-1;var s=Re(r,"column",0);if("number"==typeof s)Ee(this.space.column,s);else{o=0;for(var h=this.space.column.length;o<h;o++)this.space.column[o]=s[o]||0}this.space.row=[],this.space.row.length=e-1;var a=Re(r,"row",0);if("number"==typeof a)Ee(this.space.row,a);else for(o=0,h=this.space.row.length;o<h;o++)this.space.row[o]=a[o]||0;return this}};Object.assign(Te,_e,Ye);var Ae=Phaser.Utils.Objects.IsPlainObject,Le=Phaser.Utils.Objects.GetValue,Fe=function(){e(d,Se);var c=o(d);function d(t,e,i,n,r,o,s,h,a,u){var l;return w(this,d),Ae(e)?(e=Le(u=e,"x",0),i=Le(u,"y",0),n=Le(u,"width",void 0),r=Le(u,"height",void 0),o=Le(u,"column",0),s=Le(u,"row",0),h=Le(u,"columnProportions",0),a=Le(u,"rowProportions",0)):Ae(n)?(n=Le(u=n,"width",void 0),r=Le(u,"height",void 0),o=Le(u,"column",0),s=Le(u,"row",0),h=Le(u,"columnProportions",0),a=Le(u,"rowProportions",0)):Ae(o)?(o=Le(u=o,"column",0),s=Le(u,"row",0),h=Le(u,"columnProportions",0),a=Le(u,"rowProportions",0)):Ae(h)&&(h=Le(u=h,"columnProportions",0),a=Le(u,"rowProportions",0)),(l=c.call(this,t,e,i,n,r,u)).type="rexGridSizer",l.resetGrid(o,s,h,a,Le(u,"space",void 0)),l.addChildrenMap("items",l.sizerChildren),l}return t(d,[{key:"destroy",value:function(t){this.scene&&(this.sizerChildren.length=0,f(l(d.prototype),"destroy",this).call(this,t))}},{key:"setColumnProportion",value:function(t,e){return t>=this.columnProportions.length||(this.columnProportions[t]=e),this}},{key:"setRowProportion",value:function(t,e){return t>=this.rowProportions.length||(this.rowProportions[t]=e),this}},{key:"totalColumnProportions",get:function(){for(var t,e=0,i=0;i<this.columnCount;i++)0<(t=this.columnProportions[i])&&(e+=t);return e}},{key:"totalRowProportions",get:function(){for(var t,e=0,i=0;i<this.rowCount;i++)0<(t=this.rowProportions[i])&&(e+=t);return e}},{key:"getChildAt",value:function(t,e){return this.sizerChildren[e*this.columnCount+t]}},{key:"childToGridIndex",value:function(t,e){if(!t)return null;var i=this.sizerChildren.indexOf(t);return-1===i?null:(void 0===e&&(e={}),e.x=i%this.columnCount,e.y=Math.floor(i/this.columnCount),e)}}]),d}();Object.assign(Fe.prototype,Te);function De(t,e,i,n,r,o,s){this.pin(t);var h=u(e);if(null===e)return this;if("number"!==h)if("string"===h)e=He[e];else if(Ne(e)){var a;e=Ve(a=e,"proportion",0),i=Ve(a,"align",Ge),n=Ve(a,"padding",0),r=Ve(a,"expand",!1),o=Ve(a,"key",void 0),s=Ve(a,"index",void 0)}return"string"==typeof i&&(i=J[i]),void 0===e&&(e=0),void 0===i&&(i=Ge),void 0===n&&(n=0),void 0===r&&(r=!1),(a=this.getSizerConfig(t)).proportion=e,a.align=i,a.padding=Ct(n),a.expand=r,void 0===s||s>=this.sizerChildren.length?this.sizerChildren.push(t):this.sizerChildren.splice(s,0,t),void 0!==o&&this.addChildrenMap(o,t),this}var Ne=Phaser.Utils.Objects.IsPlainObject,Ve=Phaser.Utils.Objects.GetValue,Ge=Phaser.Display.Align.CENTER,He={min:0,full:-1},We={add:De,addSpace:function(t){var e,i;return void 0===t&&(t=1),De.call(this,(e=this.scene,(i=e.add.zone(0,0,1,1)).isRexSpace=!0,i),t),this},insert:function(t,e,i,n,r,o,s){return De.call(this,e,i,n,r,o,s,t),this}},Ue=Phaser.Utils.Array.Remove,Ie=G.prototype.remove,Je=G.prototype.clear,Ze={remove:function(t,e){return this.getParentSizer(t)!==this||(Ue(this.sizerChildren,t),Ie.call(this,t,e)),this},removeAll:function(t){for(var e=0,i=this.sizerChildren;e<i;e++)this.remove(this.sizerChildren[e],t);return this.sizerChildren.length=0,this},clear:function(t){return this.sizerChildren.length=0,this.backgroundChildren&&(this.backgroundChildren.length=0),Je.call(this,t),this}},qe={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);var e,i,n,r=0,o=this.sizerChildren;if(0===this.orientation)for(var s=0,h=o.length;s<h;s++)(e=o[s]).rexSizer.hidden||(n=0===e.rexSizer.proportion||t&&!e.isRexSpace&&0<e.rexSizer.proportion?e.isRexSizer?Math.max(e.minWidth,e.childrenWidth):q(e):0,n+=(i=e.rexSizer.padding).left+i.right,0<s&&(n+=this.space.item),r+=n);else for(s=0,h=o.length;s<h;s++)(e=o[s]).hasOwnProperty("rexSizer")&&(e.rexSizer.hidden||(n=e.isRexSizer?Math.max(e.minWidth,e.childrenWidth):q(e),n+=(i=e.rexSizer.padding).left+i.right,r=Math.max(n,r)));return r+this.space.left+this.space.right},getChildrenHeight:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);var e,i,n,r=0,o=this.sizerChildren;if(0===this.orientation)for(var s=0,h=o.length;s<h;s++)(e=o[s]).rexSizer.hidden||(n=e.isRexSizer?Math.max(e.minHeight,e.childrenHeight):$(e),n+=(i=e.rexSizer.padding).top+i.bottom,r=Math.max(n,r));else for(s=0,h=o.length;s<h;s++)(e=o[s]).hasOwnProperty("rexSizer")&&(e.rexSizer.hidden||(n=0===e.rexSizer.proportion||t&&!e.isRexSpace&&0<e.rexSizer.proportion?e.isRexSizer?Math.max(e.minHeight,e.childrenHeight):$(e):0,n+=(i=e.rexSizer.padding).top+i.bottom,0<s&&(n+=this.space.item),r+=n));return r+this.space.top+this.space.bottom},getChildrenProportion:function(){for(var t,e,i=0,n=this.sizerChildren,r=0,o=n.length;r<o;r++)(t=n[r]).rexSizer.hidden||0<(e=t.rexSizer.proportion)&&(i+=e);return i},getChildrenSizers:function(t){void 0===t&&(t=[]);for(var e,i=this.sizerChildren,n=0,r=i.length;n<r;n++)(e=i[n]).isRexSizer&&t.push(e);return t},_layout:function(t,e,i){if(this.rexSizer.hidden||!this.dirty)return this;var n;if(this.preLayout(t),void 0===e&&(e=Math.max(this.childrenWidth,this.minWidth)),void 0===i&&(i=Math.max(this.childrenHeight,this.minHeight)),this.resize(e,i),0<this.childrenProportion){var r=0===this.orientation?this.width-this.childrenWidth:this.height-this.childrenHeight;n=0<r?(r=0===this.orientation?this.width-this.getChildrenWidth(!1):this.height-this.getChildrenHeight(!1))/this.childrenProportion:0}else n=0;this.proportionLength=n;for(var o,s,h,a,u,l,c,d,f,p,v,g,y,m,b,C,S,k=this.sizerChildren,B=this.innerLeft,P=this.innerTop,E=this.innerWidth,x=this.innerHeight,O=B,z=P,w=0,_=k.length;w<_;w++)(o=k[w]).rexSizer.hidden||(h=(s=o.rexSizer).padding,m=this,b=void 0,C=o.rexSizer,S=C.padding,0===m.orientation?0<C.proportion&&0<m.proportionLength&&(b=C.proportion*m.proportionLength):C.expand&&(b=m.innerWidth-S.left-S.right),d=b,p=this,v=void 0,g=o.rexSizer,y=g.padding,0===p.orientation?g.expand&&(v=p.innerHeight-y.top-y.bottom):0<g.proportion&&0<p.proportionLength&&(v=g.proportion*p.proportionLength),f=v,o.isRexSizer?o._layout(this,d,f):Wt(o,d,f),void 0===d&&(d=q(o)),void 0===f&&(f=$(o)),c=0===this.orientation?(a=O+h.left,l=0===s.proportion||0===n?d:s.proportion*n,u=z+h.top,x-h.top-h.bottom):(a=O+h.left,l=E-h.left-h.right,u=z+h.top,0===s.proportion||0===n?f:s.proportion*n),Z.setPosition(a,u).setSize(l,c),bt(o,Z,s.align),this.resetChildPositionState(o),0===this.orientation?O+=l+h.left+h.right+this.space.item:z+=c+h.top+h.bottom+this.space.item);return this.layoutBackgrounds(),this.postLayout()},_layoutInit:function(){kt.call(this),this._childrenProportion=void 0}};Object.assign(qe,We,Ze);var $e={x:0,h:0,horizontal:0,"left-to-right":0,y:1,v:1,vertical:1,"top-to-bottom":1},Ke=Phaser.Utils.Objects.IsPlainObject,Qe=Phaser.Utils.Objects.GetValue,ti=function(){e(u,Se);var a=o(u);function u(t,e,i,n,r,o,s){var h;return w(this,u),Ke(e)?(e=Qe(s=e,"x",0),i=Qe(s,"y",0),n=Qe(s,"width",void 0),r=Qe(s,"height",void 0),o=Qe(s,"orientation",0)):Ke(n)?(n=Qe(s=n,"width",void 0),r=Qe(s,"height",void 0),o=Qe(s,"orientation",0)):Ke(o)&&(o=Qe(s=o,"orientation",0)),void 0===o&&(o=0),(h=a.call(this,t,e,i,n,r,s)).type="rexSizer",h.sizerChildren=[],h.setOrientation(o),h.setItemSpacing(Qe(s,"space.item",0)),h.addChildrenMap("items",h.sizerChildren),h}return t(u,[{key:"destroy",value:function(t){this.scene&&(this.sizerChildren.length=0,f(l(u.prototype),"destroy",this).call(this,t))}},{key:"setOrientation",value:function(t){var e;return this.orientation=("string"==typeof(e=t)&&(e=$e[e]),e),this}},{key:"setItemSpacing",value:function(t){return this.space.item=t,this}},{key:"childrenProportion",get:function(){return void 0===this._childrenProportion&&(this._childrenProportion=this.getChildrenProportion()),this._childrenProportion}}]),u}();Object.assign(ti.prototype,qe);var ei=Phaser.Utils.Objects.GetValue,ii=function(){function i(t,e){w(this,i),this.gameObject=t,this.scene=Pt(t),this.setEventEmitter(ei(e,"eventEmitter",void 0)),this._enable=void 0,t.setInteractive(ei(e,"inputConfig",void 0)),this.resetFromJSON(e),this.boot()}return t(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.lastClickTime=void 0,this.setEnable(ei(t,"enable",!0)),this.setMode(ei(t,"mode",1)),this.setClickInterval(ei(t,"clickInterval",100)),this.setDragThreshold(ei(t,"threshold",void 0)),this}},{key:"boot",value:function(){this.gameObject.on("pointerdown",this.onPress,this),this.gameObject.on("pointerup",this.onRelease,this),this.gameObject.on("pointerout",this.onPointOut,this),this.gameObject.on("pointermove",this.onMove,this),this.gameObject.on("destroy",this.destroy,this)}},{key:"shutdown",value:function(){this.destroyEventEmitter(),this.pointer=null,this.gameObject=null,this.scene=null}},{key:"destroy",value:function(){this.shutdown()}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t){t||this.cancel();var e=(this._enable=t)?"enable":"disable";this.emit(e,this,this.gameObject)}}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"setMode",value:function(t){return"string"==typeof t&&(t=ai[t]),this.mode=t,this}},{key:"setClickInterval",value:function(t){return this.clickInterval=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"onPress",value:function(t,e,i,n){void 0===this.pointer&&(this.pointer=t,0===this.mode&&this.click(t.downTime,t,n))}},{key:"onRelease",value:function(t,e,i,n){this.pointer===t&&(1===this.mode&&this.click(t.upTime,t,n),this.pointer=void 0)}},{key:"onPointOut",value:function(t){this.pointer===t&&this.cancel()}},{key:"onMove",value:function(t){this.pointer===t&&void 0!==this.dragThreshold&&t.getDistance()>=this.dragThreshold&&this.cancel()}},{key:"click",value:function(t,e,i){if(!this.enable)return this;if(void 0===t)return this.emit("click",this,this.gameObject,e,i),this;this.pointer=void 0;var n=this.lastClickTime;return void 0!==n&&t-n<=this.clickInterval||(this.lastClickTime=t,this.emit("click",this,this.gameObject,e,i)),this}},{key:"cancel",value:function(){return this.pointer=void 0,this}}]),i}();Object.assign(ii.prototype,Tt);function ni(t){if(0===this.buttons.length){if(!this.buttonsExpand)switch(this.buttonsAlign){case"right":case"bottom":case"center":ci.call(this)}li.call(this,t,this.buttonProportion,"center",0,!0),this.buttonsExpand||"center"===this.buttonsAlign&&ci.call(this)}else{var e=this.sizerChildren.length-1;this.sizerChildren[e].isRexSpace?di.call(this,e,t,this.buttonProportion,"center",0,!0):li.call(this,t,this.buttonProportion,"center",0,!0)}return this.buttons.push(t),function(r,t){r._buttonBehavior=new ii(r,t),r._buttonBehavior.on("click",function(t,e,i,n){ui.call(this,"button.click",e,i,n)},this).on("enable",function(t,e){ui.call(this,"button.enable",e)},this).on("disable",function(t,e){ui.call(this,"button.disable",e)},this),r.on("pointerover",function(t,e,i,n){ui.call(this,"button.over",r,t,n)},this).on("pointerout",function(t,e){ui.call(this,"button.out",r,t,e)},this)}.call(this,t,this.clickConfig),this}function ri(t,e){return(t=this.getButton(t))&&(1===this.buttons.length?this.clear(e):(pi(this.buttons,t),vi.call(this,t,e))),this}function oi(t){bi(t,!1)}function si(t){bi(t,!0)}function hi(t,e){void 0===e&&(e=!1);var i=Si(t,"dataManager",void 0),r=Si(t,"setValueCallback",void 0),o=Si(t,"setValueCallbackScope",void 0);void 0===i&&(this.setDataEnabled(),i=this.data),this.buttons.forEach(function(n){var t=n.name;r&&i.events.on("changedata-".concat(t),function(t,e,i){o?r.call(o,n,e,i):r(n,e,i)},this),i.set(t,void 0),i.set(t,e)}),this._dataManager=i}var ai={press:0,pointerdown:0,release:1,pointerup:1},ui=function(t,e,i,n){var r;if("number"==typeof e){if(r=e,!(e=this.buttons[r]))return}else if(-1===(r=this.buttons.indexOf(e)))return;this.eventEmitter!==this&&this.emit(t,e,r,i,n),void 0!==this.groupName?this.eventEmitter.emit(t,e,this.groupName,r,i,n):this.eventEmitter.emit(t,e,r,i,n)},li=ti.prototype.add,ci=ti.prototype.addSpace,di=ti.prototype.insert,fi={addButton:function(t){if(k(t))for(var e=t,i=0,n=e.length;i<n;i++)ni.call(this,e[i]);else ni.call(this,t);return this},addButtons:function(t){for(var e=0,i=t.length;e<i;e++)ni.call(this,t[e]);return this}},pi=Phaser.Utils.Array.Remove,vi=ti.prototype.remove,gi=ti.prototype.clear,yi={remove:function(t,e){if(k(t))for(var i=t,n=0,r=i.length;n<r;n++)ri.call(this,i[n],e);else ri.call(this,t,e);return this},clear:function(t){return this.buttons.length=0,gi.call(this,t),this},removeButton:function(t,e){return this.remove(t,e),this},clearButtons:function(t){return this.clear(t),this}},mi=function(t,e){return t?t.hasOwnProperty("name")?t.name===e?t:null:GetElementByName(t,e):null},bi=function(t,e){t&&(H(t).hidden=e,t.setVisible(!e))},Ci={getButton:function(t){var e;switch(u(t)){case"number":e=this.buttons[t];break;case"string":e=function(t,e){if(!t)return null;if(k(t)){for(var i,n=0,r=t.length;n<r;n++)if(i=mi(t[n],e))return i}else for(var o in t)if(i=mi(t[o],e))return i}(this.buttons,t);break;default:e=t,-1===this.buttons.indexOf(e)&&(e=void 0)}return e},setButtonEnable:function(t,e){if(void 0===t||"boolean"==typeof t){e=t;for(var i=0,n=this.buttons.length;i<n;i++)this.buttons[i]._buttonBehavior.setEnable(e)}else this.getButton(t)._buttonBehavior.setEnable(e);return this},toggleButtonEnable:function(t){if(void 0===t||"boolean"==typeof t)for(var e=0,i=this.buttons.length;e<i;e++)this.buttons[e]._buttonBehavior.toggleEnable();else this.getButton(t)._buttonBehavior.toggleEnable();return this},getButtonEnable:function(t){return void 0===t&&(t=0),this.getButton(t)._buttonBehavior.enable},emitButtonClick:function(t){return ui.call(this,"button.click",t),this},showButton:function(t){return oi(this.getButton(t)),this},hideButton:function(t){return si(this.getButton(t)),this},isButtonShown:function(t){var e;return(e=this.getButton(t))&&H(e).hidden,this},forEachButtton:function(t,e){for(var i=0,n=this.buttons.length;i<n;i++)e?t.call(e,this.buttons[i],i,this.buttons):t(this.buttons[i],i,this.buttons);return this}},Si=Phaser.Utils.Objects.GetValue,ki=Phaser.Utils.Objects.GetValue,Bi={radio:function(t){hi.call(this,t),this._value=void 0,Object.defineProperty(this,"value",{get:function(){return this._value}.bind(this),set:function(n){if(n!==this._value){this._value=n;var r=this._dataManager;this.buttons.forEach(function(t){var e=t.name,i=r.get(e);e===n?i||r.set(e,!0):i&&r.set(e,!1)})}}.bind(this),enumerable:!0,configurable:!0}),this.on("button.click",function(t){this.value=t.name},this)},checkboxes:function(t){hi.call(this,t),this.on("button.click",function(t){var e=this._dataManager,i=t.name,n=e.get(i);e.set(i,!n)},this)}},Pi=Phaser.Utils.Objects.GetValue,Ei=function(){e(h,ti);var s=o(h);function h(t,e){var i;w(this,h),void 0===e&&(e={});var n=e.space;"number"==typeof n&&(e.space={item:n}),(i=s.call(this,t,e)).type="rexButtons",i.eventEmitter=Pi(e,"eventEmitter",_(i)),i.groupName=Pi(e,"groupName",void 0),i.buttons=[];var r=Pi(e,"background",void 0),o=Pi(e,"buttons",void 0);return i.buttonsExpand=Pi(e,"expand",!1),i.buttonsAlign=Pi(e,"align",void 0),i.buttonProportion=i.buttonsExpand?1:0,i.clickConfig=Pi(e,"click",void 0),r&&i.addBackground(r),o&&i.addButtons(o),function(t){var e=ki(t,"type",void 0);e&&Bi.hasOwnProperty(e)&&Bi[e].call(this,t)}.call(_(i),e),i.addChildrenMap("background",r),i.addChildrenMap("buttons",i.buttons),i}return h}();Object.assign(Ei.prototype,fi,yi,Ci);var xi={getButtonsSizer:function(t){return this.childrenMap["".concat(t,"ButtonsSizer")]},getButton:function(t,e){var i=this.getButtonsSizer(t);return i?i.getButton(e):void 0},setButtonEnable:function(t,e,i){return this.getButtonsSizer(t).setButtonEnable(e,i),this},setLeftButtonEnable:function(t,e){return this.childrenMap.leftButtonsSizer.setButtonEnable(t,e),this},setRightButtonEnable:function(t,e){return this.childrenMap.rightButtonsSizer.setButtonEnable(t,e),this},setTopButtonEnable:function(t,e){return this.childrenMap.topButtonsSizer.setButtonEnable(t,e),this},setBottomButtonEnable:function(t,e){return this.childrenMap.bottomButtonsSizer.setButtonEnable(t,e),this},toggleButtonEnable:function(t,e){return this.getButtonsSizer(t).toggleButtonEnable(e),this},toggleLeftButtonEnable:function(t){return this.childrenMap.leftButtonsSizer.toggleButtonEnable(t),this},toggleRightButtonEnable:function(t){return this.childrenMap.rightButtonsSizer.toggleButtonEnable(t),this},toggleTopButtonEnable:function(t){return this.childrenMap.topButtonsSizer.toggleButtonEnable(t),this},toggleBottomButtonEnable:function(t){return this.childrenMap.bottomButtonsSizer.toggleButtonEnable(t),this},getButtonEnable:function(t,e){return this.getButtonsSizer(t).getButtonEnable(e)},getLeftButtonEnable:function(t){return this.childrenMap.leftButtonsSizer.getButtonEnable(t)},getRightButtonEnable:function(t){return this.childrenMap.rightButtonsSizer.getButtonEnable(t)},getTopButtonEnable:function(t){return this.childrenMap.topButtonsSizer.getButtonEnable(t)},getBottomButtonEnable:function(t){return this.childrenMap.bottomButtonsSizer.getButtonEnable(t)},emitButtonClick:function(t,e){var i=this.getButtonsSizer(t);return i&&i.emitButtonClick(e),this},emitLeftButtonClick:function(t){return this.childrenMap.leftButtonsSizer.emitButtonClick(t),this},emitRightButtonClick:function(t){return this.childrenMap.rightButtonsSizer.emitButtonClick(t),this},emitTopButtonClick:function(t){return this.childrenMap.topButtonsSizer.emitButtonClick(t),this},emitBottomButtonClick:function(t){return this.childrenMap.bottomButtonsSizer.emitButtonClick(t),this},getLeftButton:function(t){return this.childrenMap.leftButtonsSizer.getButton(t)},getRightButton:function(t){return this.childrenMap.rightButtonsSizer.getButton(t)},getTopButton:function(t){return this.childrenMap.topButtonsSizer.getButton(t)},getBottomButton:function(t){return this.childrenMap.bottomButtonsSizer.getButton(t)},showButton:function(t,e){return oi(this.getButton(t,e)),this},showLeftButton:function(t){return oi(this.getLeftButton(t)),this},showRightButton:function(t){return oi(this.getRightButton(t)),this},showTopButton:function(t){return oi(this.getTopButton(t)),this},showBottomButton:function(t){return oi(this.getBottomButton(t)),this},hideButton:function(t,e){return si(this.getButton(t,e)),this},hideLeftButton:function(t){return si(this.getLeftButton(t)),this},hideRightButton:function(t){return si(this.getRightButton(t)),this},hideTopButton:function(t){return si(this.getTopButton(t)),this},hideBottomButton:function(t){return si(this.getBottomButton(t)),this},addButton:function(t,e){return this.getButtonsSizer(t).addButton(e),this},addLeftButton:function(t){return this.addButton("left",t),this},addRightButton:function(t){return this.addButton("right",t),this},addTopButton:function(t){return this.addButton("top",t),this},removeButton:function(t,e,i){return this.getButtonsSizer(t).removeButton(e,i),this},removeLeftButton:function(t,e){return this.removeButton("left",t,e),this},removeRightButton:function(t,e){return this.removeButton("right",t,e),this},removeTopButton:function(t,e){return this.removeButton("top",t,e),this},removeBottomButton:function(t,e){return this.removeButton("bottom",t,e),this},clearButtons:function(t,e){return this.getButtonsSizer(t).clearButtons(e),this},clearLeftButtons:function(t){return this.clearButtons("left",t),this},clearRightButtons:function(t){return this.clearButtons("right",t),this},clearTopButtons:function(t){return this.clearButtons("top",t),this},clearBottomButtonss:function(t){return this.clearButtons("bottom",t),this},forEachLeftButton:function(t,e){return this.childrenMap.leftButtonsSizer.forEachButtton(t,e),this},forEachRightButton:function(t,e){return this.childrenMap.rightButtonsSizer.forEachButtton(t,e),this},forEachTopButton:function(t,e){return this.childrenMap.topButtonsSizer.forEachButtton(t,e),this},forEachBottomButton:function(t,e){return this.childrenMap.bottomButtonsSizer.forEachButtton(t,e),this}},Oi=Phaser.Utils.Objects.GetValue,zi=function(){e(z,Fe);var O=o(z);function z(t,e){var i;w(this,z),void 0===e&&(e={}),e.column=3,e.row=3,(i=O.call(this,t,e)).type="rexTabs",i.eventEmitter=Oi(e,"eventEmitter",_(i));var n,r,o,s,h=Oi(e,"background",void 0),a=Oi(e,"panel",void 0),u=Oi(e,"leftButtons",void 0),l=Oi(e,"leftButtonsBackground",void 0),c=Oi(e,"rightButtons",void 0),d=Oi(e,"rightButtonsBackground",void 0),f=Oi(e,"topButtons",void 0),p=Oi(e,"topButtonsBackground",void 0),v=Oi(e,"bottomButtons",void 0),g=Oi(e,"bottomButtonsBackground",void 0),y=Oi(e,"click",void 0);if(h&&i.addBackground(h),a&&i.add(a,1,1,"center",0,!0),u){var m=Oi(e,"space.leftButtonsOffset",0),b=Oi(e,"space.leftButton",0);n=new Ei(t,{groupName:"left",background:l,buttons:u,orientation:1,space:{item:b},align:Oi(e,"align.leftButtons",void 0),click:y,eventEmitter:i.eventEmitter});var C={top:m};i.add(n,0,1,"top",C,!1)}if(c){var S=Oi(e,"space.rightButtonsOffset",0),k=Oi(e,"space.rightButton",0);r=new Ei(t,{groupName:"right",background:d,buttons:c,orientation:1,space:{item:k},align:Oi(e,"align.rightButtons",void 0),click:y,eventEmitter:i.eventEmitter});C={top:S};i.add(r,2,1,"top",C,!1)}if(f){var B=Oi(e,"space.topButtonsOffset",0),P=Oi(e,"space.topButton",0);o=new Ei(t,{groupName:"top",background:p,buttons:f,orientation:0,space:{item:P},align:Oi(e,"align.topButtons",void 0),click:y,eventEmitter:i.eventEmitter});C={left:B};i.add(o,1,0,"left",C,!1)}if(v){var E=Oi(e,"space.bottomButtonsOffset",0),x=Oi(e,"space.bottomButton",0);s=new Ei(t,{groupName:"bottom",background:g,buttons:v,orientation:0,space:{item:x},align:Oi(e,"align.bottomButtons",void 0),click:y,eventEmitter:i.eventEmitter});C={left:E};i.add(s,1,2,"left",C,!1)}return i.addChildrenMap("background",h),i.addChildrenMap("panel",a),i.addChildrenMap("leftButtons",u),i.addChildrenMap("rightButtons",c),i.addChildrenMap("topButtons",f),i.addChildrenMap("bottomButtons",v),i.addChildrenMap("leftButtonsSizer",n),i.addChildrenMap("rightButtonsSizer",r),i.addChildrenMap("topButtonsSizer",o),i.addChildrenMap("bottomButtonsSizer",s),i}return z}();return Object.assign(zi.prototype,xi),zi});
  