From 44995e78115a696a7eae57e8638de1d206ff467e Mon Sep 17 00:00:00 2001 From: Rex Date: Sun, 17 Sep 2023 11:34:27 +0800 Subject: [PATCH] Export plugins --- dist/rexgameobjectshellplugin.js | 21 +++++-------- dist/rexgameobjectshellplugin.min.js | 2 +- dist/rexgridcutimageplugin.js | 21 +++++-------- dist/rexgridcutimageplugin.min.js | 2 +- dist/rexjigsaw.js | 38 ++++++++++-------------- dist/rexjigsaw.min.js | 2 +- dist/rextransitionimagepackplugin.js | 21 +++++-------- dist/rextransitionimagepackplugin.min.js | 2 +- dist/rextransitionimageplugin.js | 21 +++++-------- dist/rextransitionimageplugin.min.js | 2 +- dist/rexuiplugin.js | 21 +++++-------- dist/rexuiplugin.min.js | 2 +- 12 files changed, 62 insertions(+), 93 deletions(-) diff --git a/dist/rexgameobjectshellplugin.js b/dist/rexgameobjectshellplugin.js index 79c9bb11a0..43eb09085a 100644 --- a/dist/rexgameobjectshellplugin.js +++ b/dist/rexgameobjectshellplugin.js @@ -36130,7 +36130,7 @@ return callback; }; - var GenerateFrames = function GenerateFrames(scene, key, frame, columns, rows, overlapX, overlapY, getFrameNameCallback) { + var GenerateFrames = function GenerateFrames(scene, key, frame, columns, rows, getFrameNameCallback) { if (frame == null) { frame = '__BASE'; } @@ -36142,8 +36142,8 @@ var baseWidth = baseFrame.width, baseHeight = baseFrame.height; var cellX, cellY, cellName; - var cellWidth = (baseWidth + (columns - 1) * overlapX) / columns, - cellHeight = (baseHeight + (rows - 1) * overlapY) / rows; + var cellWidth = baseWidth / columns, + cellHeight = baseHeight / rows; var frameCutX = baseFrame.cutX, frameCutY = baseFrame.cutY; var offsetX = 0, @@ -36155,9 +36155,9 @@ cellX = offsetX + frameCutX; cellY = offsetY + frameCutY; texture.add(cellName, 0, cellX, cellY, cellWidth, cellHeight); - offsetX += cellWidth - overlapX; + offsetX += cellWidth; } - offsetY += cellHeight - overlapY; + offsetY += cellHeight; } return { getFrameNameCallback: getFrameNameCallback, @@ -36187,16 +36187,13 @@ } var originX = GetValue$1w(config, 'originX', 0.5); var originY = GetValue$1w(config, 'originY', 0.5); - var overlap = GetValue$1w(config, 'overlap', 0); - var overlapX = GetValue$1w(config, 'overlapX', overlap); - var overlapY = GetValue$1w(config, 'overlapY', overlap); var addToScene = GetValue$1w(config, 'add', true); var align = GetValue$1w(config, 'align', addToScene); var imageObjectPool = GetValue$1w(config, 'objectPool', undefined); var scene = gameObject.scene; var texture = gameObject.texture; var frame = gameObject.frame; - var result = GenerateFrames(scene, texture, frame, columns, rows, overlapX, overlapY); + var result = GenerateFrames(scene, texture, frame, columns, rows); var getFrameNameCallback = result.getFrameNameCallback; var scaleX = gameObject.scaleX, scaleY = gameObject.scaleY; @@ -36207,8 +36204,6 @@ var cellGameObjects = []; var scaleCellWidth = result.cellWidth * scaleX, scaleCellHeight = result.cellHeight * scaleY; - var scaleOverlapX = overlapX * scaleX, - scaleOverlapY = overlapY * scaleY; for (var y = 0; y < rows; y++) { for (var x = 0; x < columns; x++) { var cellGameObject; @@ -36222,8 +36217,8 @@ scene.add.existing(cellGameObject); } if (align) { - var cellTLX = startX + scaleCellWidth * x - scaleOverlapX * (x - 1); - var cellTLY = startY + scaleCellHeight * y - scaleOverlapY * (y - 1); + var cellTLX = startX + scaleCellWidth * x; + var cellTLY = startY + scaleCellHeight * y; var cellX = cellTLX + originX * scaleCellWidth; var cellY = cellTLY + originY * scaleCellHeight; cellGameObject.setOrigin(originX, originY).setPosition(cellX, cellY).setScale(scaleX, scaleY).setRotation(rotation); diff --git a/dist/rexgameobjectshellplugin.min.js b/dist/rexgameobjectshellplugin.min.js index 597891fad9..e9a804b282 100644 --- a/dist/rexgameobjectshellplugin.min.js +++ b/dist/rexgameobjectshellplugin.min.js @@ -19,4 +19,4 @@ var Pn=Phaser.Renderer.WebGL.Utils,Tn={renderWebGL:function(t,e,i,n){if(0!==e.wi * @author Richard Davey * @copyright 2018 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */Object.assign(ms.prototype,Hn,bs);var Cs=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"freeLine",value:function(t){if(t)return this.push(t),this}},{key:"freeLines",value:function(t){if(t)return this.pushMultiple(t),this}},{key:"getLine",value:function(t,e,i){var n=this.pop();return null===n&&(n={}),n.text=t,n.width=e,n.newLineMode=i,n}}]),i}(hi),xs=Phaser.Utils.Objects.IsPlainObject,ws=Phaser.Utils.Objects.GetValue,Ss=function(t,e){xs(t)?t=(e=t).key:void 0===e&&(e={key:t}),e.hasOwnProperty("key")||(e.key=t);var i=e.key,n=e.frame,s=e.width,r=e.height;if(void 0===s||void 0===r){var o=this.textureManager.getFrame(i,n),a=o?o.cutWidth:0,h=o?o.cutHeight:0;void 0===s&&void 0===r?(s=a,r=h):void 0===s?s=a*(r/h):void 0===r&&(r=h*(s/a));}this.images[t]={key:i,frame:n,width:s,height:r,y:ws(e,"y",0),left:ws(e,"left",0),right:ws(e,"right",0),originX:ws(e,"originX",0),originY:ws(e,"originY",0)};},Os=function(){function t(e){n(this,t),this.textureManager=e.sys.textures,this.images={};}return r(t,[{key:"destroy",value:function(){this.textureManager=void 0,this.images=void 0;}},{key:"add",value:function(t,e){if("string"==typeof t)Ss.call(this,t,e);else if(Array.isArray(t))for(var i=0,n=(s=t).length;i0}},{key:"drawX",get:function(){var t=this.x+this.leftSpace+this.offsetX-this.originX*this.width;return this.parent._textOX*this.scrollFactorX+t}},{key:"drawY",get:function(){var t=this.y+this.offsetY;return this.parent._textOY*this.scrollFactorY+t}},{key:"drawTLX",get:function(){return 0}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return 0}},{key:"drawBLY",get:function(){return 0}},{key:"drawTRX",get:function(){return 0}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return 0}},{key:"drawBRY",get:function(){return 0}},{key:"drawCenterX",get:function(){return (this.drawTRX+this.drawTLX)/2}},{key:"drawCenterY",get:function(){return (this.drawBLY+this.drawTLY)/2}}]),i}(fr);Object.assign(Br.prototype,Er);var jr=function(t,e,i){return e.hasOwnProperty(t)?e[t]:i[t]},Dr=Phaser.Utils.Objects.GetValue,Ar=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,"background")).setScrollFactor(0),r.setColor(Dr(s,"color",null),Dr(s,"color2",null),Dr(s,"horizontalGradient",!0)),r.setStroke(Dr(s,"stroke",null),Dr(s,"strokeThickness",2)),r.setCornerRadius(Dr(s,"cornerRadius",0),Dr(s,"cornerIteration",null)),r}return r(i,[{key:"color",get:function(){return this._color},set:function(t){t=mn(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=mn(t,this.canvas,this.context),this.setDirty(this._color2!=t),this._color2=t;}},{key:"horizontalGradient",get:function(){return this._horizontalGradient},set:function(t){this.setDirty(this._horizontalGradient!=t),this._horizontalGradient=t;}},{key:"setColor",value:function(t,e,i){return void 0===i&&(i=!0),this.color=t,this.color2=e,this.horizontalGradient=i,this}},{key:"stroke",get:function(){return this._stroke},set:function(t){t=mn(t,this.canvas,this.context),this.setDirty(this._stroke!=t),this._stroke=t;}},{key:"strokeThickness",get:function(){return this._strokeThickness},set:function(t){this.setDirty(this._strokeThickness!=t),this._strokeThickness=t;}},{key:"setStroke",value:function(t,e){return null!=t&&void 0===e&&(e=2),this.stroke=t,this.strokeThickness=e,this}},{key:"cornerRadius",get:function(){return this._cornerRadius},set:function(t){this.setDirty(this._cornerRadius!=t),this._cornerRadius=t;}},{key:"cornerIteration",get:function(){return this._cornerIteration},set:function(t){this.setDirty(this._cornerIteration!=t),this._cornerIteration=t;}},{key:"modifyStyle",value:function(t){return t.hasOwnProperty("color")&&this.setColor(t.color,jr("color2",t,this),jr("horizontalGradient",t,this)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,jr("strokeThickness",t,this)),t.hasOwnProperty("cornerRadius")&&this.setCornerRadius(t.cornerRadius,jr("cornerIteration",t,this)),this}},{key:"modifyPorperties",value:function(t){return p(h(i.prototype),"modifyPorperties",this).call(this,t),this.modifyStyle(t),this}},{key:"setCornerRadius",value:function(t,e){return this.cornerRadius=t,this.cornerIteration=e,this}},{key:"renderContent",value:function(){On(this.parent,this.color,this.stroke,this.strokeThickness,this.cornerRadius,this.color2,this.horizontalGradient,this.cornerIteration);}}]),i}(Br),Ir=Phaser.Utils.Objects.GetValue,zr=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,"innerbounds")).setScrollFactor(0),r.setColor(Ir(s,"color",null),Ir(s,"color2",null),Ir(s,"horizontalGradient",!0)),r.setStroke(Ir(s,"stroke",null),Ir(s,"strokeThickness",2)),r}return r(i,[{key:"color",get:function(){return this._color},set:function(t){t=mn(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=mn(t,this.canvas,this.context),this.setDirty(this._color2!=t),this._color2=t;}},{key:"horizontalGradient",get:function(){return this._horizontalGradient},set:function(t){this.setDirty(this._horizontalGradient!=t),this._horizontalGradient=t;}},{key:"setColor",value:function(t,e,i){return void 0===i&&(i=!0),this.color=t,this.color2=e,this.horizontalGradient=i,this}},{key:"stroke",get:function(){return this._stroke},set:function(t){t=mn(t,this.canvas,this.context),this.setDirty(this._stroke!=t),this._stroke=t;}},{key:"strokeThickness",get:function(){return this._strokeThickness},set:function(t){this.setDirty(this._strokeThickness!=t),this._strokeThickness=t;}},{key:"setStroke",value:function(t,e){return null!=t&&void 0===e&&(e=2),this.stroke=t,this.strokeThickness=e,this}},{key:"modifyPorperties",value:function(t){p(h(i.prototype),"modifyPorperties",this).call(this,t),t.hasOwnProperty("color")&&this.setColor(t.color,Ir(t,"color2",null),Ir(t,"horizontalGradient",!0)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,Ir(t,"strokeThickness",2));}},{key:"renderContent",value:function(){var t=this.parent.padding,e=t.left,i=t.top,n=this.parent.width-t.left-t.right,s=this.parent.height-t.top-t.bottom,r=this.context;if(null!=this.color){var o,a;if(null!=this.color2)(a=this.horizontalGradient?r.createLinearGradient(0,0,n,0):r.createLinearGradient(0,0,0,s)).addColorStop(0,this.color),a.addColorStop(1,this.color2),o=a;else o=this.color;r.fillStyle=o,r.fillRect(e,i,n,s);}null!=this.stroke&&this.strokeThickness>0&&(r.strokeStyle=this.stroke,r.lineWidth=this.strokeThickness,r.strokeRect(e,i,n,s));}}]),i}(Br),Fr=Phaser.Utils.Objects.GetValue,Yr=function(){function t(e,i){n(this,t),this.parent=e,this.set(i);}return r(t,[{key:"toJSON",value:function(){return {bold:this.bold,italic:this.italic,fontSize:this.fontSize,fontFamily:this.fontFamily,color:this.color,stroke:this.stroke,strokeThickness:this.strokeThickness,shaodwColor:this.shadowColor,shadowBlur:this.shadowBlur,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,offsetX:this.offsetX,offsetY:this.offsetY,leftSpace:this.leftSpace,rightSpace:this.rightSpace,backgroundHeight:this.backgroundHeight,backgroundBottomY:this.backgroundBottomY,align:this.align}}},{key:"set",value:function(t){return this.setBold(Fr(t,"bold",!1)),this.setItalic(Fr(t,"italic",!1)),this.setFontSize(Fr(t,"fontSize","16px")),this.setFontFamily(Fr(t,"fontFamily","Courier")),this.setColor(Fr(t,"color","#fff")),this.setStrokeStyle(Fr(t,"stroke",null),Fr(t,"strokeThickness",0)),this.setShadow(Fr(t,"shadowColor",null),Fr(t,"shadowOffsetX",0),Fr(t,"shadowOffsetY",0),Fr(t,"shadowBlur",0)),this.setOffset(Fr(t,"offsetX",0),Fr(t,"offsetY",0)),this.setSpace(Fr(t,"leftSpace",0),Fr(t,"rightSpace",0)),this.setAlign(Fr(t,"align",void 0)),this.setBackgroundColor(Fr(t,"backgroundColor",null)),this.setBackgroundHeight(Fr(t,"backgroundHeight",void 0)),this.setBackgroundBottomY(Fr(t,"backgroundBottomY",void 0)),this}},{key:"modify",value:function(t){return t.hasOwnProperty("bold")&&this.setBold(t.bold),t.hasOwnProperty("italic")&&this.setItalic(t.italic),t.hasOwnProperty("fontSize")&&this.setFontSize(t.fontSize),t.hasOwnProperty("fontFamily")&&this.setFontFamily(t.fontFamily),t.hasOwnProperty("color")&&this.setColor(t.color),(t.hasOwnProperty("stroke")||t.hasOwnProperty("strokeThickness"))&&this.setStrokeStyle(jr("stroke",t,this),jr("strokeThickness",t,this)),t.hasOwnProperty("shadowColor")&&this.setShadowColor(t.shadowColor),(t.hasOwnProperty("shadowOffsetX")||t.hasOwnProperty("shadowOffsetY"))&&this.setShadowOffset(jr("shadowOffsetX",t,this),jr("shadowOffsetY",t,this)),t.hasOwnProperty("shadowBlur")&&this.setShadowBlur(t.shaodwBlur),t.hasOwnProperty("offsetX")&&this.setOffsetX(t.offsetX),t.hasOwnProperty("offsetY")&&this.setOffsetY(t.offsetY),t.hasOwnProperty("leftSpace")&&this.setLeftSpace(t.leftSpace),t.hasOwnProperty("rightSpace")&&this.setRightSpace(t.rightSpace),t.hasOwnProperty("align")&&this.setAlign(t.align),t.hasOwnProperty("backgroundColor")&&this.setBackgroundColor(t.backgroundColor),t.hasOwnProperty("backgroundHeight")&&this.setBackgroundHeight(t.backgroundHeight),t.hasOwnProperty("backgroundBottomY")&&this.setBackgroundBottomY(t.backgroundBottomY),this}},{key:"setUpdateTextFlag",value:function(){return this.parent&&(this.parent.updateTextFlag=!0),this}},{key:"clone",value:function(){return new t(null,this.toJSON())}},{key:"copyFrom",value:function(t){return this.set(t.toJSON()),this}},{key:"copyTo",value:function(t){return t.set(this.toJSON()),this}},{key:"setBold",value:function(t){return void 0===t&&(t=!0),this.bold=t,this.setUpdateTextFlag(),this}},{key:"setItalic",value:function(t){return void 0===t&&(t=!0),this.italic=t,this.setUpdateTextFlag(),this}},{key:"fontStyle",get:function(){return this.bold&&this.italic?"bold italic":this.bold?"bold":this.italic?"italic":""}},{key:"setFontSize",value:function(t){return "number"==typeof t&&(t="".concat(t,"px")),this.fontSize=t,this.setUpdateTextFlag(),this}},{key:"setFontFamily",value:function(t){return this.fontFamily=t,this.setUpdateTextFlag(),this}},{key:"font",get:function(){return "".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily)}},{key:"setColor",value:function(t){return this.color=mn(t),this}},{key:"hasFill",get:function(){return null!=this.color}},{key:"setStrokeStyle",value:function(t,e){return this.stroke=mn(t),void 0!==e&&(this.strokeThickness=e),this}},{key:"setStrokeThickness",value:function(t){return this.strokeThickness=t,this}},{key:"hasStroke",get:function(){return null!=this.stroke&&this.strokeThickness>0}},{key:"setShadowColor",value:function(t){return this.shadowColor=mn(t),this}},{key:"setShadowOffset",value:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.shadowOffsetX=t,this.shadowOffsetY=e,this}},{key:"setShadowBlur",value:function(t){return void 0===t&&(t=0),this.shaodwBlur=t,this}},{key:"setShadow",value:function(t,e,i,n){return this.setShadowColor(t).setShadowOffset(e,i).setShadowBlur(n),this}},{key:"setBackgroundColor",value:function(t){return this.backgroundColor=mn(t),this}},{key:"hasBackgroundColor",get:function(){return null!=this.backgroundColor}},{key:"setBackgroundHeight",value:function(t){return this.backgroundHeight=t,this}},{key:"setBackgroundBottomY",value:function(t){return this.backgroundBottomY=t,this}},{key:"setOffsetX",value:function(t){return void 0===t&&(t=0),this.offsetX=t,this}},{key:"setOffsetY",value:function(t){return void 0===t&&(t=0),this.offsetY=t,this}},{key:"setOffset",value:function(t,e){return this.setOffsetX(t).setOffsetY(e),this}},{key:"setLeftSpace",value:function(t){return void 0===t&&(t=0),this.leftSpace=t,this}},{key:"setRightSpace",value:function(t){return void 0===t&&(t=0),this.rightSpace=t,this}},{key:"setSpace",value:function(t,e){return this.setLeftSpace(t).setRightSpace(e),this}},{key:"setAlign",value:function(t){return this.align=t,this}},{key:"syncFont",value:function(t){return t.font=this.font,this}},{key:"syncStyle",value:function(t){t.textBaseline="alphabetic";var e=this.hasFill,i=this.hasStroke;return t.fillStyle=e?this.color:"#000",t.strokeStyle=i?this.stroke:"#000",t.lineWidth=i?this.strokeThickness:0,t.lineCap="round",t.lineJoin="round",this}},{key:"syncShadow",value:function(t){null!=t.shadowColor?(t.shadowColor=this.shadowColor,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowBlur=this.shadowBlur):(t.shadowColor=0,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0);}},{key:"getTextMetrics",value:function(t,e){return this.syncFont(t).syncStyle(t),t.measureText(e)}}]),t}(),Wr=Phaser.Utils.Array.Remove,Vr=Phaser.Utils.Array.Remove,Xr="text",Gr="image",Hr="drawer",Ur="space",Nr="command",Kr=function(t){return t.type===Xr&&"\n"===t.text},Jr=function(t){return t.type===Xr&&"\f"===t.text},Zr=function(t){return t.type===Xr},qr=function(t){return t.type===Nr},$r=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;return n(this,i),(o=e.call(this,t,Xr)).updateTextFlag=!1,o.style=new Yr(u(o),r),o.setText(s),o}return r(i,[{key:"autoRound",get:function(){return this.parent.autoRound}},{key:"offsetX",get:function(){return this.style.offsetX},set:function(t){this.style&&(this.style.offsetX=t);}},{key:"offsetY",get:function(){return this.style.offsetY},set:function(t){this.style&&(this.style.offsetY=t);}},{key:"leftSpace",get:function(){return this.style.leftSpace*this.scaleX},set:function(t){this.style&&(this.style.leftSpace=t),g(h(i.prototype),"leftSpace",t,this,!0);}},{key:"rightSpace",get:function(){return this.style.rightSpace*this.scaleX},set:function(t){this.style&&(this.style.rightSpace=t),g(h(i.prototype),"rightSpace",t,this,!0);}},{key:"align",get:function(){return this.style.align},set:function(t){this.style&&(this.style.align=t);}},{key:"modifyStyle",value:function(t){return this.setDirty(!0),this.style.modify(t),this.updateTextFlag&&this.updateTextSize(),this}},{key:"modifyPorperties",value:function(t){return t?(this.modifyStyle(t),p(h(i.prototype),"modifyPorperties",this).call(this,t),this):this}},{key:"setText",value:function(t){return this.setDirty(this.text!=t),this.text=t,this.updateTextSize(),this}},{key:"updateTextSize",value:function(){var t=this.text;if("\n"===t||"\f"===t||""===t)this.clearTextSize();else {var e,i,n=this.style.getTextMetrics(this.context,this.text);this.textWidth=n.width,"actualBoundingBoxAscent"in n?(e=n.actualBoundingBoxAscent,i=n.actualBoundingBoxDescent):(e=0,i=0),this.textHeight=e+i,this.ascent=e,this.descent=i;}return this.updateTextFlag=!1,this}},{key:"clearTextSize",value:function(){return this.textWidth=0,this.textHeight=0,this.ascent=0,this.descent=0,this}},{key:"copyTextSize",value:function(t){return this.textWidth=t.textWidth,this.textHeight=t.textHeight,this.ascent=t.ascent,this.descent=t.descent,this}},{key:"width",get:function(){return this.textWidth*this.scaleX},set:function(t){this.textWidth>0?this.scaleX=t/this.textWidth:this.scaleX=1;}},{key:"height",get:function(){return this.textHeight*this.scaleY},set:function(t){this.textHeight>0?this.scaleY=t/this.textHeight:this.scaleY=1;}},{key:"willRender",get:function(){return 0!==this.textWidth&&p(h(i.prototype),"willRender",this)}},{key:"renderContent",value:function(){var t=this.context,e=this.style;if(e.hasBackgroundColor){t.fillStyle=e.backgroundColor;var i=this.drawTLX,n=this.drawTRX-i,s=e.backgroundBottomY;null==s&&(s=this.drawBLY);var r=e.backgroundHeight;null==r&&(r=s-this.drawTLY);var o=s-r;t.fillRect(i,o,n,r);}var a=e.hasFill,h=e.hasStroke;(a||h)&&(e.syncFont(t).syncStyle(t),h&&(e.syncShadow(t),t.strokeText(this.text,0,0)),a&&(e.syncShadow(t),t.fillText(this.text,0,0)));}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return -this.ascent}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.descent}},{key:"drawTRX",get:function(){return this.textWidth+this.rightSpace}},{key:"drawTRY",get:function(){return -this.ascent}},{key:"drawBRX",get:function(){return this.textWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.descent}}]),i}(Br),Qr=function(t,e){var i=this.createCharChildren(t,e);return this.addChild(i),this},to=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;return n(this,i),(o=e.call(this,t,Gr)).setTexture(s,r),o}return r(i,[{key:"frameWidth",get:function(){return this.frameObj?this.frameObj.cutWidth:0}},{key:"frameHeight",get:function(){return this.frameObj?this.frameObj.cutHeight:0}},{key:"offsetY",get:function(){return -this.height},set:function(t){}},{key:"key",get:function(){return this._key},set:function(t){this.setDirty(this._key!=t),this._key=t;}},{key:"frame",get:function(){return this._frame},set:function(t){this.setDirty(this._frame!=t),this._frame=t;}},{key:"setTexture",value:function(t,e){return this.key=t,this.frame=e,this.frameObj=this.scene.sys.textures.getFrame(t,e),this}},{key:"width",get:function(){return this.frameWidth*this.scaleX},set:function(t){this.setDirty(this.width!==t),this.scaleX=t/this.frameWidth;}},{key:"height",get:function(){return this.frameHeight*this.scaleY},set:function(t){this.setDirty(this.height!==t),this.scaleY=t/this.frameHeight;}},{key:"setHeight",value:function(t,e){return void 0===e&&(e=!1),this.height=t,e&&(this.scaleX=this.scaleY),this}},{key:"renderContent",value:function(){var t=this.context,e=this.frameObj,i=this.frameWidth,n=this.frameHeight;t.drawImage(e.source.image,e.cutX,e.cutY,i,n,0,0,i,n);}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.frameHeight}},{key:"drawTRX",get:function(){return this.frameWidth+this.rightSpace}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return this.frameWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.frameHeight}}]),i}(Br),eo=function(t,e,i){var n=this.createImageChild(t,e,i);return this.addChild(n),this},io=function(t){a(i,t);var e=d(i);function i(t,s,r,o){var a;return n(this,i),(a=e.call(this,t,Hr)).setRenderCallback(s),a.setDrawerSize(r,o),a}return r(i,[{key:"setRenderCallback",value:function(t){return t?this.renderContent=t.bind(this):delete this.renderContent,this}},{key:"setDrawerSize",value:function(t,e){return !0===t?(this.toLocalPosition=!1,t=void 0,e=void 0):this.toLocalPosition=!0,void 0===t&&(t=0),void 0===e&&(e=t),this.drawerWidth=t,this.drawerHeight=e,this}},{key:"onFree",value:function(){p(h(i.prototype),"onFree",this).call(this),this.setRenderCallback();}},{key:"width",get:function(){return this.drawerWidth*this.scaleX},set:function(t){this.setDirty(this.width!==t),this.scaleX=this.drawerWidth>0?t/this.drawerWidth:1;}},{key:"height",get:function(){return this.drawerHeight*this.scaleY},set:function(t){this.setDirty(this.height!==t),this.scaleY=this.drawerHeight>0?t/this.drawerHeight:1;}},{key:"offsetY",get:function(){return -this.height},set:function(t){}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.drawerHeight}},{key:"drawTRX",get:function(){return this.drawerWidth+this.rightSpace}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return this.drawerWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.drawerHeight}}]),i}(Br),no=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,Ur)).setSpaceWidth(s),r}return r(i,[{key:"width",get:function(){return this.spaceWidth*this.scaleX},set:function(t){this.spaceWidth>0?this.scaleX=t/this.spaceWidth:this.scaleX=1;}},{key:"setSpaceWidth",value:function(t){return this.spaceWidth=t,this}}]),i}(Br),so=function(t){var e=this.createSpaceChild(t);return this.addChild(e),this},ro=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a){var h;return n(this,i),(h=e.call(this,t,Nr)).setName(s).setParameter(o).setCallback(r,a),h}return r(i,[{key:"setName",value:function(t){return this.name=t,this}},{key:"setParameter",value:function(t){return this.param=t,this}},{key:"setCallback",value:function(t,e){return this.callback=t,this.scope=e,this}},{key:"exec",value:function(){return this.scope?this.callback.call(this.scope,this.param,this.name):this.callback(this.param,this.name)}},{key:"onFree",value:function(){p(h(i.prototype),"onFree",this).call(this),this.setName().setCallback().setParameter();}}]),i}(fr),oo=function(t,e,i,n){var s=this.createCommandChild(t,e,i,n);return this.addChild(s),this},ao=function(t){var e={callback:void 0,start:0,isLastPage:!1,maxLines:void 0,padding:void 0,letterSpacing:void 0,hAlign:void 0,vAlign:void 0,children:[],lines:[],maxLineWidth:0,linesHeight:0,lineHeight:void 0,maxLineHeight:0,linesWidth:0,lineWidth:void 0};return Object.assign(e,t)},ho=function(t,e,i,n){void 0===n&&(n={word:[],width:0}),n.word.length=0;for(var s=t.length,r=e,o=n.word,a=0;r0&&!a){var h=this.fixedHeight-n;if(i>0)r=h/i;else r=(l=co.call(this)).height,o=l.ascent,i=Math.floor((h-o)/r);}else {var l;r=(l=co.call(this)).height,o=l.ascent;}}else if(this.fixedHeight>0){if(void 0===(i=po(t,"maxLines"))){h=this.fixedHeight-n;i=Math.floor(h/r);}}else i=po(t,"maxLines",0);void 0===o&&(o=r);var u=0===i,c=po(t,"wrapWidth",void 0);void 0===c&&(c=this.fixedWidth>0?this.fixedWidth-s:1/0);for(var d=po(t,"letterSpacing",0),f=po(t,"hAlign",0),p=po(t,"vAlign",0),v=po(t,"charWrap",!1),g=ao({callback:"runWordWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:f,vAlign:p,ascent:o,lineHeight:r,wrapWidth:c,charWrap:v}),y=this.children,k=0,m=y.length;k0&&(M.push({children:E,width:_}),L=Math.max(L,_)),g.start+=T.length,g.isLastPage=!R&&g.start===P,g.maxLineWidth=L,g.linesHeight=M.length*r;var F=this.fixedWidth>0?this.fixedWidth:g.maxLineWidth+s,Y=this.fixedHeight>0?this.fixedHeight:g.linesHeight+n;!function(t,e,i){var n,s,r=t.hAlign,o=t.vAlign,a=t.linesHeight;switch(o){case 1:case"center":s=(i-a)/2;break;case 2:case"bottom":s=i-a;break;default:s=0;}for(var h=t.lines,l=0,u=h.length;l0?(o=this.fixedWidth-s)/i:0;else if(this.fixedWidth>0){if(void 0===(i=yo(t,"maxLines",void 0))){var o=this.fixedWidth-s;i=Math.floor(o/r)+1;}}else i=yo(t,"maxLines",0);var a=0===i,h=yo(t,"fixedCharacterHeight",void 0);if(void 0===h){var l=yo(t,"charPerLine",void 0);if(void 0!==l){var u=this.fixedHeight-n;h=Math.floor(u/l);}}var c=yo(t,"wrapHeight",void 0);void 0===c&&(c=this.fixedHeight>0?this.fixedHeight-n:1/0);for(var d=yo(t,"letterSpacing",0),f=yo(t,"rtl",!0),p=yo(t,"hAlign",f?2:0),v=yo(t,"vAlign",0),g=ao({callback:"runVerticalWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:p,vAlign:v,lineWidth:r,fixedCharacterHeight:h,wrapHeight:c,rtl:f}),y=this.children,k=0,m=y.length;k0&&(M.push({children:E,height:_}),L=Math.max(L,_)),g.start+=T.length,g.isLastPage=g.start===P,g.maxLineHeight=L,g.linesWidth=M.length*r;var I=this.fixedWidth>0?this.fixedWidth:g.linesWidth+s,z=this.fixedHeight>0?this.fixedHeight:g.maxLineHeight+n;!function(t,e,i){var n,s,r=t.hAlign,o=t.vAlign,a=t.rtl,h=t.lines,l=t.lineWidth,u=t.linesWidth;switch(r){case 1:case"center":n=(e-u)/2;break;case 2:case"right":n=e-u;break;default:n=0;}a&&(n+=l);for(var c=0,d=h.length;c0?t:this.width,e>0?e:this.height)),this},setPadding:function(t,e){var i=this.padding,n=i.left,s=i.right,r=i.top,o=i.bottom;return dr(i,t,e),this.dirty=this.dirty||n!=i.left||s!=i.right||r!=i.top||o!=i.bottom,this},getPadding:function(t){return cr(this.padding,t)},modifyTextStyle:function(t){return this.textStyle.modify(t),this},modifyDefaultTextStyle:function(t){return this.defaultTextStyle.modify(t),this},resetTextStyle:function(){return this.textStyle.copyFrom(this.defaultTextStyle),this},setTestString:function(t){return this.testString=t,this},removeChild:function(t){return this.poolManager.free(t),Wr(this.children,t),this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},removeChildren:function(){return this.poolManager.freeMultiple(this.children),this.children.length=0,this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},popChild:function(t){return Vr(this.children,t),this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},clearContent:function(){return this.setText(),this},addChild:function(t,e){var i,n,s,r=Array.isArray(t);void 0===e||e===this.children.length?r?(i=this.children).push.apply(i,m(t)):this.children.push(t):r?(n=this.children).splice.apply(n,[e,0].concat(m(t))):this.children.splice(e,0,t);(this.lastAppendedChildren.length=0,r)?(s=this.lastAppendedChildren).push.apply(s,m(t)):this.lastAppendedChildren.push(t);return this},createCharChild:function(t,e){e&&this.textStyle.modify(e);var i=this.poolManager.allocate(Xr);return null===i?i=new $r(this,t,this.textStyle):i.setParent(this).setActive().modifyStyle(this.textStyle).setText(t),i},createCharChildren:function(t,e){e&&this.textStyle.modify(e);for(var i=[],n=0,s=t.length;ne&&(n=e,s=t);})),s},getCharWorldPosition:function(t,e,i,n){return "number"==typeof t&&(t=this.getCharChild(t,!0)),Mr(this,t,e,i,n)},setToMinSize:function(){for(var t=this.children,e=0,i=0,n=0,s=t.length;n=i.length&&(t=i.length);for(var n=0,s=0;s1?i-1:0),s=1;s0&&void 0!==t.setTint},useAlphaFadeEffect:function(t){return (void 0===this.fadeMode||1===this.fadeMode)&&this.fadeTime>0&&void 0!==t.setAlpha},useRevealEffect:function(t){return this.fadeMode>=2&&this.fadeMode<=5&&this.fadeTime>0&&(t.preFX||t.postFX)},fadeBob:function(t,e,i,n){var s=t.gameObject;if(this.useTintFadeEffect(s))void 0!==e&&t.setProperty("tintGray",255*e),t.easeProperty("tintGray",Math.floor(255*i),this.fadeTime,"Linear",0,!1,n);else if(this.useAlphaFadeEffect(s))void 0!==e&&t.setProperty("alpha",e),t.easeProperty("alpha",i,this.fadeTime,"Linear",0,!1,n);else if(this.useRevealEffect(s)){var r;switch(Qo(s,"reveal"),this.fadeMode){case 2:r="revealUp";break;case 3:r="revealDown";break;case 4:r="revealLeft";break;case 5:r="revealRight";}void 0===e&&(e=0),s[r]=e,t.easeProperty(r,i,this.fadeTime,"Linear",0,!1,n),t.getTweenTask(r).once("complete",(function(){s[r]=null;}));}else n&&n(s);return this}},ia=function(t){return t>>16&255},na=function(t){return t>>8&255},sa=function(t){return 255&t},ra=Phaser.Events.EventEmitter,oa=function(t,e,i,n,s,r){return void 0===r?r={}:!0===r&&(r=aa),"number"!=typeof i&&(i=0,n=0),r.x=s.x+s.width*t+i,r.y=s.y+s.height*e+n,r},aa={},ha=function(t,e,i,n,s,r,o){if(t.hasOwnProperty("vp"))return t;"function"==typeof i&&(o=i,i=void 0),"function"==typeof s&&(o=s,s=void 0),void 0===i&&(i=.5),void 0===n&&(n=.5),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=oa),function(t){if(t.events)return t;var e=new ra,i=t.x;Object.defineProperty(t,"x",{get:function(){return i},set:function(n){i!==n&&(i=n,e.emit("update",t));}});var n=t.y;Object.defineProperty(t,"y",{get:function(){return n},set:function(i){n!==i&&(n=i,e.emit("update",t));}});var s=t.width;Object.defineProperty(t,"width",{get:function(){return s},set:function(i){s!==i&&(s=i,e.emit("update",t));}});var r=t.height;Object.defineProperty(t,"height",{get:function(){return r},set:function(i){r!==i&&(r=i,e.emit("update",t));}}),t.events=e;}(e);var a=e.events;t.vp=e;var h=function(){o(i,n,s,r,e,t);};a.on("update",h),t.once("destroy",(function(){a.off("update",h),t.vp=void 0;})),Object.defineProperty(t,"vpx",{get:function(){return i},set:function(t){i!==t&&(i=t,h());}}),Object.defineProperty(t,"vpy",{get:function(){return n},set:function(t){n!==t&&(n=t,h());}}),Object.defineProperty(t,"vpxOffset",{get:function(){return s},set:function(t){s!==t&&(s=t,h());}}),Object.defineProperty(t,"vpyOffset",{get:function(){return r},set:function(t){r!==t&&(r=t,h());}}),h();},la=Phaser.Utils.Array.Remove,ua={has:function(t){return this.bobs.hasOwnProperty(t)},exists:function(t){return this.bobs.hasOwnProperty(t)},get:function(t){return this.bobs[t]},getGO:function(t){var e=this.get(t);return e?e.gameObject:null},addGO:function(t,e){this.remove(t,!0),this.useTintFadeEffect(e)&&function(t,e){if(t.hasOwnProperty("tintR"))return t;void 0===e&&(e=16777215);var i=ia(e),n=na(e),s=sa(e);Object.defineProperty(t,"tint",{get:function(){return e},set:function(r){r=16777215&Math.floor(r),t.setTint&&t.setTint(r),e!==r&&(i=ia(e=r),n=na(e),s=sa(e));}}),Object.defineProperty(t,"tintR",{get:function(){return i},set:function(n){n=255&Math.floor(n),i!==n&&(i=n,t.tint=(255&n)<<16|65535&e);}}),Object.defineProperty(t,"tintG",{get:function(){return n},set:function(i){i=255&Math.floor(i),n!==i&&(n=i,t.tint=(255&i)<<8|16711935&e);}}),Object.defineProperty(t,"tintB",{get:function(){return s},set:function(i){i=255&Math.floor(i),s!==i&&(s=i,t.tint=255&i|16776960&e);}}),Object.defineProperty(t,"tintGray",{get:function(){return Math.floor((i+n+s)/3)},set:function(e){e=255&Math.floor(e),i===e&&n===e&&s===e||(i=e,n=e,s=e,t.tint=(255&e)<<16|(255&e)<<8|255&e);}}),t.tint=e;}(e),this.viewportCoordinateEnable&&ha(e,this.viewport),this.effectPropertiesConfig&&Qo(e,this.effectPropertiesConfig),e.once("destroy",(function(){la(this.removedGOs,e),this.isEmpty&&this.emit("empty");}),this);var i=new this.BobClass(this,e,t);return this.bobs[t]=i,this},add:function(t){for(var e=this.createGameObjectCallback,i=this.createGameObjectScope,n=arguments.length,s=new Array(n>1?n-1:0),r=1;r2?n-2:0),r=2;r0?-this.delay:0,this.state=this.nowTime>=0?Fa:za,this.repeatCounter=0,this}},{key:"stop",value:function(){return this.state=Ia,this}},{key:"update",value:function(t,e){this.state!==Ia&&this.state!==Wa&&0!==e&&0!==this.timeScale&&(this.nowTime+=e*this.timeScale,this.justRestart=!1,this.nowTime>=this.duration?-1===this.repeat||this.repeatCounter0&&(this.nowTime-=this.repeatDelay,this.state=Ya)):(this.nowTime=this.duration,this.state=Wa):this.nowTime>=0&&(this.state=Fa));}},{key:"t",get:function(){var t;switch(this.state){case Ia:case za:case Ya:t=0;break;case Fa:t=this.nowTime/this.duration;break;case Wa:t=1;}return Da(t,0,1)},set:function(t){(t=Da(t,-1,1))<0?(this.state=za,this.nowTime=-this.delay*t):(this.state=Fa,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===Ia}},{key:"isDelay",get:function(){return this.state===za}},{key:"isCountDown",get:function(){return this.state===Fa}},{key:"isRunning",get:function(){return this.state===za||this.state===Fa}},{key:"isDone",get:function(){return this.state===Wa}},{key:"isOddIteration",get:function(){return 1==(1&this.repeatCounter)}},{key:"isEvenIteration",get:function(){return 0==(1&this.repeatCounter)}}]),t}(),Ia=0,za=1,Fa=2,Ya=3,Wa=-1,Va=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).timer=new Aa,r}return r(i,[{key:"shutdown",value:function(t){this.isShutdown||(p(h(i.prototype),"shutdown",this).call(this,t),this.timer.destroy(),this.timer=void 0);}},{key:"start",value:function(){return this.timer.start(),p(h(i.prototype),"start",this).call(this),this}},{key:"stop",value:function(){return this.timer.stop(),p(h(i.prototype),"stop",this).call(this),this}},{key:"complete",value:function(){return this.timer.stop(),p(h(i.prototype),"complete",this).call(this),this}}]),i}(Ra),Xa=Phaser.Utils.Objects.GetValue,Ga=Phaser.Utils.Objects.GetAdvancedValue,Ha=Phaser.Tweens.Builders.GetEaseFunction,Ua=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"resetFromJSON",value:function(t){return this.timer.resetFromJSON(Xa(t,"timer")),this.setEnable(Xa(t,"enable",!0)),this.setTarget(Xa(t,"target",this.parent)),this.setDelay(Ga(t,"delay",0)),this.setDuration(Ga(t,"duration",1e3)),this.setEase(Xa(t,"ease","Linear")),this.setRepeat(Xa(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=Ha(t),this}},{key:"start",value:function(){return this.timer.isRunning||p(h(i.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),p(h(i.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){}}]),i}(Va),Na=Phaser.Sound.BaseSound,Ka=function(t){return t instanceof Na},Ja=Phaser.Utils.Objects.GetValue,Za=Phaser.Utils.Objects.GetAdvancedValue,qa=Phaser.Math.Linear,$a=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;return n(this,i),Ka(t)&&(r=s,s=t,t=void 0),s.active=!0,s.scene=t,s.game=s.manager.game,(o=e.call(this,s,r)).volume={},o.resetFromJSON(r),o}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setMode(Ja(t,"mode",0)),this.setEnable(Ja(t,"enable",!0)),this.setVolumeRange(Za(t,"volume.start",this.parent.volume),Za(t,"volume.end",0)),this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=Qa[t]),this.mode=t,this}},{key:"setVolumeRange",value:function(t,e){return this.volume.start=t,this.volume.end=e,this}},{key:"start",value:function(){return this.timer.isRunning||(this.parent.setVolume(this.volume.start),this.timer.setDelay(this.delay).setDuration(this.duration),p(h(i.prototype),"start",this).call(this)),this}},{key:"updateGameObject",value:function(t,e){t.volume=qa(this.volume.start,this.volume.end,e.t);}},{key:"complete",value:function(){switch(p(h(i.prototype),"complete",this).call(this),this.mode){case 1:this.parent.stop();break;case 2:this.parent.destroy();}return this}}]),i}(Ua),Qa={stop:1,destroy:2},th=function(t,e,i,n,s){Ka(t)&&(s=n,n=i,i=e,e=t,t=void 0),void 0===n&&(n=1),void 0===s&&(s=0);var r,o={mode:0,volume:{start:s,end:n},duration:i};return "string"==typeof e&&(e=t.sys.sound.add(e)),e.hasOwnProperty("_fade")?(r=e._fade).stop().resetFromJSON(o):(r=new $a(t,e,o),e._fade=r),r.start(),e.isPlaying||e.setVolume(s).play(),e},eh=function(t,e,i,n){Ka(t)&&(n=i,i=e,e=t,t=void 0),void 0===n&&(n=!0);var s,r={mode:n?2:1,volume:{start:e.volume,end:0},duration:i};return e.hasOwnProperty("_fade")?(s=e._fade).stop().resetFromJSON(r):(s=new $a(t,e,r),e._fade=s),s.start(),e.isPlaying||e.play(),e},ih=Phaser.Utils.Objects.GetValue,nh={setBackgroundMusicLoop:function(t){return void 0===t&&(t=!0),this.backgroundMusicLoop=t,this},setBackgroundMusicFadeTime:function(t){return this.backgroundMusicFadeTime=t,this},getBackgroundMusic:function(){return this.backgroundMusic},setCurrentBackgroundMusic:function(t){return this.backgroundMusic=t,t&&(t.once("complete",(function(){this.backgroundMusic===t&&(this.backgroundMusic.destroy(),this.backgroundMusic=void 0);}),this).once("destroy",(function(){this.backgroundMusic===t&&(this.backgroundMusic=void 0);}),this),t.isPlaying||t.play()),this},playBackgroundMusic:function(t,e){if(this.backgroundMusic&&this.backgroundMusic.key===t)return this;this.stopBackgroundMusic();var i=this.sound.add(t,{loop:ih(e,"loop",this.backgroundMusicLoop),mute:ih(e,"mute",this.backgroundMusicMute),volume:ih(e,"volume",this.backgroundMusicVolume),detune:ih(e,"detune",0),rate:ih(e,"rate",1)});return this.setCurrentBackgroundMusic(i),this.backgroundMusicFadeTime>0&&this.fadeInBackgroundMusic(this.backgroundMusicFadeTime),this},pauseBackgroundMusic:function(){return this.backgroundMusic&&this.backgroundMusic.pause(),this},resumeBackgroundMusic:function(){return this.backgroundMusic&&this.backgroundMusic.resume(),this},stopBackgroundMusic:function(){return this.backgroundMusic&&(this.backgroundMusicFadeTime>0?this.fadeOutBackgroundMusic(this.backgroundMusicFadeTime,!0):(this.backgroundMusic.stop(),this.backgroundMusic.destroy(),this.backgroundMusic=void 0)),this},fadeInBackgroundMusic:function(t){return this.backgroundMusic&&th(this.backgroundMusic,t,this.backgroundMusicVolume,0),this},fadeOutBackgroundMusic:function(t,e){return this.backgroundMusic&&eh(this.backgroundMusic,t,e),this},crossFadeBackgroundMusic:function(t,e){var i=this.backgroundMusicFadeTime;return this.backgroundMusicFadeTime=0,this.fadeOutBackgroundMusic(e,!0).playBackgroundMusic(t).fadeInBackgroundMusic(e),this.backgroundMusicFadeTime=i,this},setBackgroundMusicMute:function(t){return void 0===t&&(t=!0),this.backgroundMusicMute=t,this},setBackgroundMusicVolume:function(t){return this.backgroundMusicVolume=t,this},setBackgroundMusicRate:function(t){return this.backgroundMusic&&this.backgroundMusic.setRate(t),this},setBackgroundMusicDetune:function(t){return this.backgroundMusic&&this.backgroundMusic.setDetune(t),this}},sh=Phaser.Utils.Objects.GetValue,rh={setBackgroundMusic2Loop:function(t){return void 0===t&&(t=!0),this.backgroundMusic2Loop=t,this},setBackgroundMusic2FadeTime:function(t){return this.backgroundMusic2FadeTime=t,this},getBackgroundMusic2:function(){return this.backgroundMusic2},setCurrentBackgroundMusic2:function(t){return this.backgroundMusic2=t,t&&(t.once("complete",(function(){this.backgroundMusic2===t&&(this.backgroundMusic2.destroy(),this.backgroundMusic2=void 0);}),this).once("destroy",(function(){this.backgroundMusic2===t&&(this.backgroundMusic2=void 0);}),this),t.isPlaying||t.play()),this},playBackgroundMusic2:function(t,e){if(this.backgroundMusic2&&this.backgroundMusic2.key===t)return this;this.stopBackgroundMusic2();var i=this.sound.add(t,{loop:sh(e,"loop",this.backgroundMusicLoop),mute:sh(e,"mute",this.backgroundMusic2Mute),volume:sh(e,"volume",this.backgroundMusic2Volume),detune:sh(e,"detune",0),rate:sh(e,"rate",1)});return this.setCurrentBackgroundMusic2(i),this.backgroundMusic2FadeTime>0&&this.fadeInBackgroundMusic2(this.backgroundMusic2FadeTime),this},pauseBackgroundMusic2:function(){return this.backgroundMusic2&&this.backgroundMusic2.pause(),this},resumeBackgroundMusic2:function(){return this.backgroundMusic2&&this.backgroundMusic2.resume(),this},stopBackgroundMusic2:function(){return this.backgroundMusic2&&(this.backgroundMusic2FadeTime>0?this.fadeOutBackgroundMusic2(this.backgroundMusic2FadeTime,!0):(this.backgroundMusic2.stop(),this.backgroundMusic2.destroy(),this.backgroundMusic2=void 0)),this},fadeInBackgroundMusic2:function(t){return this.backgroundMusic2&&th(this.backgroundMusic2,t,this.backgroundMusic2Volume,0),this},fadeOutBackgroundMusic2:function(t,e){return this.backgroundMusic2&&eh(this.backgroundMusic2,t,e),this},crossFadeBackgroundMusic2:function(t,e){var i=this.backgroundMusic2FadeTime;return this.backgroundMusic2FadeTime=0,this.fadeOutBackgroundMusic2(e,!0).playBackgroundMusic2(t).fadeInBackgroundMusic2(e),this.backgroundMusic2FadeTime=i,this},setBackgroundMusic2Mute:function(t){return void 0===t&&(t=!0),this.backgroundMusic2Mute=t,this},setBackgroundMusic2Volume:function(t){return this.backgroundMusic2Volume=t,this},setBackgroundMusic2Rate:function(t){return this.backgroundMusic2&&this.backgroundMusic2.setRate(t),this},setBackgroundMusic2Detune:function(t){return this.backgroundMusic2&&this.backgroundMusic2.setDetune(t),this}},oh=Phaser.Utils.Array.Remove,ah=Phaser.Utils.Objects.GetValue,hh={getSoundEffects:function(){return this.soundEffects},getLastSoundEffect:function(){return this.soundEffects[this.soundEffects.length-1]},playSoundEffect:function(t,e){var i=this.sound.add(t,{mute:ah(e,"mute",this.soundEffectsMute),volume:ah(e,"volume",this.soundEffectsVolume),detune:ah(e,"detune",0),rate:ah(e,"rate",1)});return this.soundEffects.push(i),i.once("complete",(function(){i.destroy(),this.sound&&oh(this.soundEffects,i);}),this).once("destroy",(function(){this.sound&&oh(this.soundEffects,i);}),this).play(),this},stopAllSoundEffects:function(){for(var t=this.soundEffects.length-1;t>=0;t--){var e=this.soundEffects[t];e.stop(),e.destroy();}return this},fadeInSoundEffect:function(t){var e=this.getLastSoundEffect();return e&&th(e,t,this.soundEffectsVolume,0),this},fadeOutSoundEffect:function(t,e){var i=this.getLastSoundEffect();return i&&eh(i,t,e),this},fadeOutAllSoundEffects:function(t,e){for(var i=this.soundEffects.length-1;i>=0;i--)eh(this.soundEffects[i],t,e);return this},setSoundEffectMute:function(t,e){if(void 0===t&&(t=!0),void 0===e&&(e=!1),e){var i=this.getLastSoundEffect();i&&i.setMute(t);}else this.soundEffectsMute=t;return this},setSoundEffectVolume:function(t,e){if(void 0===e&&(e=!1),e){var i=this.getLastSoundEffect();i&&i.setVolume(t);}else this.soundEffectsVolume=t;return this},setSoundEffectDetune:function(t,e){var i;void 0===e&&(e=!1);for(var n=0,s=(i=e?[this.getLastSoundEffect()]:this.soundEffects).length;n=0;t--){var e=this.soundEffects[t];e.stop(),e.destroy();}return this},fadeInSoundEffect2:function(t){var e=this.getLastSoundEffect2();return e&&th(e,t,this.soundEffects2Volume,0),this},fadeOutSoundEffect2:function(t,e){var i=this.getLastSoundEffect2();return i&&eh(i,t,e),this},fadeOutAllSoundEffects2:function(t,e){for(var i=this.soundEffects2.length-1;i>=0;i--)eh(this.soundEffects2[i],t,e);return this},setSoundEffect2Mute:function(t,e){if(void 0===t&&(t=!0),void 0===e&&(e=!1),e){var i=this.getLastSoundEffect2();i&&i.setMute(t);}else this.soundEffects2Mute=t;return this},setSoundEffect2Volume:function(t,e){if(void 0===e&&(e=!1),e){var i=this.getLastSoundEffect2();i&&i.setVolume(t);}else this.soundEffects2Volume=t;return this},setSoundEffect2Detune:function(t,e){var i;void 0===e&&(e=!1);for(var n=0,s=(i=e?[this.getLastSoundEffect2()]:this.soundEffects2).length;n=0;t--)this.soundEffects[t].destroy();if(this.soundEffects.length=0,this.soundEffects2.length)for(t=this.soundEffects2.length-1;t>=0;t--)this.soundEffects2[t].destroy();return this.soundEffects2.length=0,this.sound=void 0,this}},{key:"backgroundMusicMute",get:function(){return this._backgroundMusicMute},set:function(t){this._backgroundMusicMute=t,this.backgroundMusic&&this.backgroundMusic.setMute(mute);}},{key:"backgroundMusicVolume",get:function(){return this._backgroundMusicVolume},set:function(t){this._backgroundMusicVolume=t,this.backgroundMusic&&this.backgroundMusic.setVolume(t);}},{key:"backgroundMusic2Mute",get:function(){return this._backgroundMusic2Mute},set:function(t){this._backgroundMusic2Mute=t,this.backgroundMusic2&&this.backgroundMusic2.setMute(mute);}},{key:"backgroundMusic2Volume",get:function(){return this._backgroundMusic2Volume},set:function(t){this._backgroundMusic2Volume=t,this.backgroundMusic2&&this.backgroundMusic2.setVolume(t);}},{key:"soundEffectsMute",get:function(){return this._soundEffectsMute},set:function(t){this._soundEffectsMute=t;for(var e=this.soundEffects,i=0,n=e.length;i2?n-2:0),r=2;r3?s-3:0),o=3;o");this.setDelimiters(i[0],i[1]),this.setTranslateTagNameCallback(xi(e,"translateTagNameCallback")),this.isRunning=!1,this.isPaused=!1,this.skipEventFlag=!1,this.justCompleted=!1,this.lastTagStart=null,this.lastTagEnd=null,this.lastContent=null;}return r(t,[{key:"shutdown",value:function(){this.destroyEventEmitter();}},{key:"destroy",value:function(){this.shutdown();}},{key:"setMultipleLinesTagEnable",value:function(t){return void 0===t&&(t=!0),this.multipleLinesTagEnable=t,this}},{key:"setDelimiters",value:function(t,e){void 0===e&&(e=t[1],t=t[0]),this.delimiterLeft=t,this.delimiterRight=e,t=Js(this.delimiterLeft),e=Js(this.delimiterRight);var i=this.multipleLinesTagEnable?"gs":"gi";return this.reSplit=RegExp("".concat(t,"(.+?)").concat(e),i),this}},{key:"setTranslateTagNameCallback",value:function(t){return this.translateTagNameCallback=t,this}},{key:"setValueConverter",value:function(t){return !0===t?t=Ah:t||(t=zh),this.valueConverter=t,this}},{key:"setLoopEnable",value:function(t){return void 0===t&&(t=!0),this.loopEnable=t,this}},{key:"setSource",value:function(t){return this.source=t,this}},{key:"resetIndex",value:function(t){return void 0===t&&(t=0),this.progressIndex=t,this.reSplit.lastIndex=t,this.lastTagStart=null,this.lastTagEnd=null,this.lastContent=null,this.justCompleted=!1,this.isRunning=!1,this}},{key:"start",value:function(t){return this.setSource(t).restart(),this}},{key:"restart",value:function(){this.resetIndex().next();}},{key:"next",value:function(){if(this.isPaused&&this.onResume(),this.isRunning)return this;if(this.isRunning=!0,this.justCompleted)return this.isRunning=!1,this;0===this.reSplit.lastIndex&&this.onStart();var t=this.source,e=t.length;for(this.reSplit.lastIndex=this.progressIndex;;){var i=this.reSplit.exec(t);if(!i){if(this.progressIndex");return s.setDelimiters(r[0],r[1]),s}return r(i,[{key:"setTagExpression",value:function(t){return t||(t=Yh),this.tagExpression=t,this}},{key:"setValueExpression",value:function(t){return t||(t=Yh),this.valueExpression=t,this}},{key:"setDelimiters",value:function(t,e){p(h(i.prototype),"setDelimiters",this).call(this,t,e);var n="(".concat(this.tagExpression,")(=(").concat(this.valueExpression,"))?");if(this.reTag=RegExp(n,"i"),this.tagExpression!==Yh||this.valueExpression!==Yh){var s="".concat(this.tagExpression,"(=").concat(this.valueExpression,")?"),r="/".concat(this.tagExpression);t=Js(this.delimiterLeft),e=Js(this.delimiterRight);var o=this.multipleLinesTagEnable?"gs":"gi";this.reSplit=RegExp("".concat(t,"((").concat(s,")|(").concat(r,"))").concat(e),o);}return this}},{key:"onTag",value:function(t){var e=t.match(this.reTag),i=e[1],n="/"===i.charAt(0);if(n&&(i=i.substring(1,i.length)),this.translateTagNameCallback&&(i=this.translateTagNameCallback(i)),this.skipEventFlag=!1,n)this.emit("-".concat(i)),this.skipEventFlag||this.emit("-",i),this.lastTagEnd=i;else {var s=function(t,e){if(null==t)return [];void 0===e&&(e=Ah);for(var i=t.split(","),n=0,s=i.length;n1?s-1:0),o=1;o1&&-1!==e.indexOf("|")?e.split("|"):[e]).length;r0){var o=this.timeline.addTimer({name:Hl,target:s,duration:r.duration,yoyo:r.yoyo,onStart:r.onStart,onProgress:r.onProgress,onComplete:r.onComplete});this.skipTypingAnimation&&o.seek(1);}else r.onStart&&r.onStart(s,0);this.minSizeEnable&&this.textPlayer.setToMinSize(),this.textPlayer.emit("typing",s);var a=this.nextChild;if(a)if(this.skipSpaceEnable&&((i=a).type===Xr&&" "===i.text));else if(n+=this.speed+e,e=0,n>0){this.typingTimer=this.timeline.addTimer({name:"delay",target:this,duration:n,onComplete:function(e,i,n){e.typingTimer=void 0,t.call(e,n.remainder);}});break}}else qr(s)&&s.exec();}this.minSizeEnable&&this.textPlayer.setToMinSize(),this.inTypingProcessLoop=!1;},pause:function(){return this.timeline.pause(),this},resume:function(){return this.timeline.resume(),this},pauseTyping:function(){return this.isTypingPaused||(this.typingTimer?(this.typingTimer.pause(),this.isTypingPaused=!0):this.inTypingProcessLoop&&(this.inTypingProcessLoop=!1,this.isTypingPaused=!0)),this},resumeTyping:function(t){return this.isTypingPaused?(void 0===t&&(t=0),this.typingTimer?(this.isTypingPaused=!1,this.typingTimer.resume(),this.typingTimer.remainder+=t):this.isTypingPaused&&(this.isTypingPaused=!1,this.typing(t)),this):this},wait:function(t){return this.ignoreWait||(this.pauseTyping(),Zl(this.textPlayer,t,this.resumeTyping,this)),this},setIgnoreWait:function(t){return void 0===t&&(t=!0),this.ignoreWait=t,this},setSkipSpaceEnable:function(t){return void 0===t&&(t=!0),this.skipSpaceEnable=t,this},setSkipTypingAnimation:function(t){if(void 0===t&&(t=!0),this.skipTypingAnimation=t,t)for(var e=this.timeline.getTimers(Hl),i=0,n=e.length;i0&&o.chainAnimation(i,n);},lu=function(t){var e,i,n=k(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.stopAnimation.apply(s,m(i));},uu=function(t){var e,i,n=k(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.pauseAnimation.apply(s,m(i));},cu=function(t){var e,i,n=k(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.chainAnimation.apply(s,m(i));},du=[function(t,e,i){var n=i.name;e.on("+",(function(i){if(!e.skipEventFlag){var s,r=i.split(".");if(au(r,n)){s=r[1];for(var o=arguments.length,a=new Array(o>1?o-1:0),h=1;h0)){var a=this.getGameObjectManager(e);a.hasMethod(i,n)?a.call.apply(a,[i,n].concat(m(s))):a.setProperty(i,n,s[0]);}},mu={to:!0,yoyo:!0,from:!0,toLeft:!0,toRight:!0,toUp:!0,toDown:!0,yoyoLeft:!0,yoyoRight:!0,yoyoUp:!0,yoyoDown:!0,fromLeft:!0,fromRight:!0,fromUp:!0,fromDown:!0},bu=function(t){var e,i,n,s,r,o,a,h,l=y(t,8);e=l[0],i=l[1],n=l[2],s=l[3],r=l[4],o=l[5],a=l[6],h=l[7];var u=this.getGameObjectManager(e),c=u.getProperty(i,n);if("number"==typeof c){h.endsWith("Left")||h.endsWith("Up")?h.startsWith("to")||h.startsWith("yoyo")?s=c-s:h.startsWith("from")&&(u.setProperty(i,n,c-s),s=c):h.endsWith("Right")||h.endsWith("Down")?h.startsWith("to")||h.startsWith("yoyo")?s=c+s:h.startsWith("from")&&(u.setProperty(i,n,c+s),s=c):"from"===h&&(u.setProperty(i,n,s),s=c);var d=h.startsWith("yoyo");u.easeProperty(i,n,s,r,o,a,d);}},Cu=[function(t,e,i){var n=i.name;e.on("+",(function(i){if(!e.skipEventFlag){var s,r=i.split(".");if(pu(r,n)){s=r[1];for(var o=arguments.length,a=new Array(o>1?o-1:0),h=1;h1?a-1:0),l=1;l0)return Au.length=0,!0;return Au.length=0,!1},Au=[],Iu=void 0,zu=Phaser.Utils.Objects.GetValue,Fu=function(t,e,i){var n,s;for(var r in void 0===i&&(i={}),t)n=t[r],void 0!==(s=zu(e,r,n[1]))&&(i[n[0]]=s);return i},Yu=function(t){t.addEventListener("touchstart",Wu,!1),t.addEventListener("touchmove",Wu,!1),t.addEventListener("touchend",Wu,!1),t.addEventListener("mousedown",Wu,!1),t.addEventListener("mouseup",Wu,!1),t.addEventListener("mousemove",Wu,!1);},Wu=function(t){t.stopPropagation();},Vu=Phaser.Utils.Objects.GetValue,Xu=function(){return this.close(),this.emit("keydown-ENTER",this.parent,this),this},Gu={open:function(){return this.isOpened||this.readOnly||((t=this)!==Iu&&(void 0!==Iu&&Iu.close(),Iu=t),this.isOpened=!0,this.node||(this.node=function(t,e){var i,n=Vu(e,"inputType",void 0);void 0===n&&(n=Vu(e,"type","text")),"textarea"===n?(i=document.createElement("textarea")).style.resize="none":(i=document.createElement("input")).type=n;var s=Vu(e,"style",void 0),r=i.style;Fu(Ru,s,r),r.position="absolute",r.opacity=0,r.pointerEvents="none",r.zIndex=0,r.transform="scale(0)",Fu(Lu,e,i),Yu(i);var o=t.scene.sys.scale;return (o.isFullscreen?o.fullscreenTarget:document.body).appendChild(i),i}(this,this.nodeConfig)),this.setFocus(),this.initText(),this.enterCloseEnable&&this.scene.input.keyboard.once("keydown-ENTER",Xu,this),this.scene.sys.events.on("postupdate",this.updateText,this),this.scene.input.on("pointerdown",this.onClickOutside,this),this.onOpenCallback&&this.onOpenCallback(this.parent,this),this.emit("open",this)),this;var t;},close:function(){return this.isOpened?(this===Iu&&(Iu=void 0),this.setBlur(),this.isOpened=!1,this.updateText(),this.scene.sys.events.off("postupdate",this.updateText,this),this.scene.input.off("pointerdown",this.onClickOutside,this),this.onCloseCallback&&this.onCloseCallback(this.parent,this),function(t){if(t){var e=t.parentElement;e&&e.removeChild(t);}}(this.node),this.node=void 0,this.emit("close",this),this):this}},Hu=Phaser.Utils.Objects.GetValue,Uu=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),r=e.call(this,t);var o=Hu(s,"inputType",void 0);void 0===o&&(o=Hu(s,"type","text")),r.setEnterCloseEnable(Hu(s,"enterClose","textarea"!==o));var a=Hu(s,"onOpen",void 0);a||(a=Hu(s,"onFocus",void 0)),r.onOpenCallback=a;var h=Hu(s,"onClose",void 0);return h||(h=Hu(s,"onBlur",void 0)),r.onCloseCallback=h,r.onUpdateCallback=Hu(s,"onUpdate",void 0),r.isOpened=!1,t.on("pointerdown",(function(){this.open();}),u(r)).setInteractive(),r.nodeConfig=function(t){void 0===t&&(t={});var e={};return Bu(t,e,"inputType"),Bu(t,e,"type"),Bu(t,e,"style"),Bu(t,e,Ru),Bu(t,e,Lu),e}(s),r.node=void 0,r}return r(i,[{key:"destroy",value:function(){this.close(),p(h(i.prototype),"destroy",this).call(this);}},{key:"onClickOutside",value:function(t){ju(this.parent,t)||this.close();}},{key:"setEnterCloseEnable",value:function(t){return void 0===t&&(t=!0),this.enterCloseEnable=t,this}},{key:"initText",value:function(){}},{key:"updateText",value:function(){}},{key:"text",get:function(){return this.node?this.node.value:""},set:function(t){this.node&&(this.node.value=t);}},{key:"setText",value:function(t){return this.text=t,this}},{key:"maxLength",get:function(){return this.nodeConfig.maxLength},set:function(t){this.nodeConfig.maxLength=t,this.node&&(this.node.maxLength=t);}},{key:"setMaxLength",value:function(t){return this.maxLength=t,this}},{key:"minLength",get:function(){return this.nodeConfig.minLength},set:function(t){this.nodeConfig.minLength=t,this.node&&(this.node.minLength=t);}},{key:"setMinLength",value:function(t){return this.minLength=t,this}},{key:"placeholder",get:function(){return this.node.placeholder},set:function(t){this.node&&(this.node.placeholder=t);}},{key:"setPlaceholder",value:function(t){return this.placeholder=t,this}},{key:"selectText",value:function(t,e){return this.node?(void 0===t?this.node.select():this.node.setSelectionRange(t,e),this):this}},{key:"selectAll",value:function(){return this.selectText(),this}},{key:"selectionStart",get:function(){return this.node?this.node.selectionStart:0}},{key:"selectionEnd",get:function(){return this.node?this.node.selectionEnd:0}},{key:"selectedText",get:function(){if(!this.node)return "";var t=this.node;return t.value.substring(t.selectionStart,t.selectionEnd)}},{key:"cursorPosition",get:function(){return this.node?this.node.selectionStart:0},set:function(t){this.node&&this.node.setSelectionRange(t,t);}},{key:"setCursorPosition",value:function(t){return void 0===t?t=this.text.length:t<0&&(t=this.text.length+t),this.cursorPosition=t,this}},{key:"tooltip",get:function(){return this.node?this.node.title:""},set:function(t){if(!this.node)return this;this.node.title=t;}},{key:"setTooltip",value:function(t){return this.tooltip=t,this}},{key:"setTextChangedCallback",value:function(t){return this.onTextChanged=t,this}},{key:"readOnly",get:function(){return this.nodeConfig.readOnly},set:function(t){this.nodeConfig.readOnly=t,this.node&&(this.node.readOnly=t);}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}},{key:"spellCheck",get:function(){return this.node?this.node.spellcheck:""},set:function(t){this.node&&(this.node.spellcheck=t);}},{key:"setSpellCheck",value:function(t){return this.spellCheck=t,this}},{key:"fontColor",get:function(){if(this.node)return this.node.style.color},set:function(t){this.node&&(this.node.style.color=t);}},{key:"setFontColor",value:function(t){return this.fontColor=t,this}},{key:"setStyle",value:function(t,e){return this.node?(this.node.style[t]=e,this):this}},{key:"getStyle",value:function(t){if(this.node)return this.node.style[t]}},{key:"scrollToBottom",value:function(){return this.node?(this.node.scrollTop=this.node.scrollHeight,this):this}},{key:"setEnabled",value:function(t){return this.node?(void 0===t&&(t=!0),this.node.disabled=!t,this):this}},{key:"setBlur",value:function(){return this.node?(this.node.blur(),this):this}},{key:"setFocus",value:function(){return this.node?(this.node.focus(),this):this}},{key:"isFocused",get:function(){return this.isOpened}}]),i}(Ta);Object.assign(Uu.prototype,Gu);var Nu=function(t,e,i){t=t.replace(" ","");var n=i.previousText;if(t===n)return t;if(isNaN(t)){i.emit("nan",t,i),t=n;var s=i.cursorPosition-1;i.setText(t),i.setCursorPosition(s);}else i.previousText=t;return t},Ku=function(t){var e=t.prevSelectionStart;if(null!==e){for(var i=t.prevSelectionEnd,n=t.parent,s=e;s=s&&h=i&&hi.length&&(t.prevCursorPosition=null),null!==t.prevCursorPosition&&(s=e.getCharChild(t.prevCursorPosition))&&("\n"===s.text&&s.clearTextSize(),e.emit("cursorout",s,t.prevCursorPosition,e)),null!=n&&(s=e.getCharChild(n))&&("\n"===s.text&&s.copyTextSize(e.lastInsertCursor),function(t){var e,i,n=t.parent,s=n.width,r=n.height,o=t.drawX,a=t.drawY,h=o+t.drawTLX,l=o+t.drawTRX,u=a+t.drawTLY,c=a+t.drawBLY;e=h<0?0-h:l>s?s-l:0,i=u<0?0-u:c>r?r-c:0,n._textOX+=e,n._textOY+=i;}(s),e.emit("cursorin",s,n,e)),e.emit("movecursor",n,t.prevCursorPosition,e),t.prevCursorPosition=n;}}(this)):(Ku(this),Ju(this)),this}},{key:"setNumberInput",value:function(){return this.onUpdateCallback=Nu,this}},{key:"setSelectAllWhenFocusEnable",value:function(t){return void 0===t&&(t=!0),this.selectAllWhenFocus=t,this}}]),i}(Uu),$u=Phaser.Utils.Objects.GetValue,Qu=["inputType","onOpen","onFocus","onClose","onBlur","onUpdate","enterClose","readOnly","maxLength","minLength","selectAll"],tc=function(t,e){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return !0;if(-1!==e.indexOf(".")){for(var i=e.split("."),n=t,s=0;st.length?i:t})),l.value=t.join(c);}else l.value=t.join(i.slice(a,a+l.count));a+=l.count,l.added||(h+=l.count);}}var d=e[o-1];return o>1&&"string"==typeof d.value&&(d.added||d.removed)&&t.equals("",d.value)&&(e[o-2].value+=d.value,e.pop()),e}oc.prototype={diff:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.callback;"function"==typeof i&&(n=i,i={}),this.options=i;var s=this;function r(t){return n?(setTimeout((function(){n(void 0,t);}),0),!0):t}t=this.castInput(t),e=this.castInput(e),t=this.removeEmpty(this.tokenize(t));var o=(e=this.removeEmpty(this.tokenize(e))).length,a=t.length,h=1,l=o+a;i.maxEditLength&&(l=Math.min(l,i.maxEditLength));var u=[{newPos:-1,components:[]}],c=this.extractCommon(u[0],e,t,0);if(u[0].newPos+1>=o&&c+1>=a)return r([{value:this.join(e),count:e.length}]);function d(){for(var i=-1*h;i<=h;i+=2){var n=void 0,l=u[i-1],c=u[i+1],d=(c?c.newPos:0)-i;l&&(u[i-1]=void 0);var f=l&&l.newPos+1=o&&d+1>=a)return r(ac(s,n.components,e,t,s.useLongestToken));u[i]=n;}else u[i]=void 0;}var v;h++;}if(n)!function t(){setTimeout((function(){if(h>l)return n();d()||t();}),0);}();else for(;h<=l;){var f=d();if(f)return f}},pushComponent:function(t,e,i){var n=t[t.length-1];n&&n.added===e&&n.removed===i?t[t.length-1]={count:n.count+1,added:e,removed:i}:t.push({count:1,added:e,removed:i});},extractCommon:function(t,e,i,n){for(var s=e.length,r=i.length,o=t.newPos,a=o-n,h=0;o+10,o=0,a=e.length;o0;this.dirty=this.dirty||this._radiusTL!==t||this._convexTL!==e,this._convexTL=e,this._radiusTL=Math.abs(t);}},{key:"radiusTR",get:function(){return this._radiusTR},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusTR!==t||this._convexTR!==e,this._convexTR=e,this._radiusTR=Math.abs(t);}},{key:"radiusBL",get:function(){return this._radiusBL},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusBL!==t||this._convexBL!==e,this._convexBL=e,this._radiusBL=Math.abs(t);}},{key:"radiusBR",get:function(){return this._radiusBR},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusBR!==t||this._convexBR!==e,this._convexBR=e,this._radiusBR=Math.abs(t);}},{key:"radius",get:function(){return Math.max(this.radiusTL,this.radiusTR,this.radiusBL,this.radiusBR)},set:function(t){"number"==typeof t?(this.radiusTL=t,this.radiusTR=t,this.radiusBL=t,this.radiusBR=t):(this.radiusTL=ld(t,"tl",0),this.radiusTR=ld(t,"tr",0),this.radiusBL=ld(t,"bl",0),this.radiusBR=ld(t,"br",0));}},{key:"setRadius",value:function(t){return void 0===t&&(t=0),this.radius=t,this}},{key:"iterations",get:function(){return this._iterations},set:function(t){this.dirty=this.dirty||this._iterations!==t,this._iterations=t;}},{key:"setIterations",value:function(t){return this.iterations=t,this}},{key:"updateData",value:function(){var t=this.pathData;t.length=0;var e,n=this.width,s=this.height,r=this.iterations+1;(e=this.radiusTL)>0?this._convexTL?Hi(e,e,e,e,180,270,!1,r,t):Hi(0,0,e,e,90,0,!0,r,t):Xi(0,0,t);(e=this.radiusTR)>0?this._convexTR?Hi(n-e,e,e,e,270,360,!1,r,t):Hi(n,0,e,e,180,90,!0,r,t):Xi(n,0,t);(e=this.radiusBR)>0?this._convexBR?Hi(n-e,s-e,e,e,0,90,!1,r,t):Hi(n,s,e,e,270,180,!0,r,t):Xi(n,s,t);(e=this.radiusBL)>0?this._convexBL?Hi(e,s-e,e,e,90,180,!1,r,t):Hi(0,s,e,e,360,270,!0,r,t):Xi(0,s,t);return t.push(t[0],t[1]),Hc(this.x,this.y,t),p(h(i.prototype),"updateData",this).call(this),this}}]),i}(Bc),cd=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,dd=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;return n(this,i),void 0===t&&(t=0),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===h&&(h=0),(l=e.call(this)).pathData=[],l.closePath=!0,l.setP0(t,s),l.setP1(r,o),l.setP2(a,h),l}return r(i,[{key:"x0",get:function(){return this._x0},set:function(t){this.dirty=this.dirty||this._x0!==t,this._x0=t;}},{key:"y0",get:function(){return this._y0},set:function(t){this.dirty=this.dirty||this._y0!==t,this._y0=t;}},{key:"setP0",value:function(t,e){return this.x0=t,this.y0=e,this}},{key:"x1",get:function(){return this._x1},set:function(t){this.dirty=this.dirty||this._x1!==t,this._x1=t;}},{key:"y1",get:function(){return this._y1},set:function(t){this.dirty=this.dirty||this._y1!==t,this._y1=t;}},{key:"setP1",value:function(t,e){return this.x1=t,this.y1=e,this}},{key:"x2",get:function(){return this._x2},set:function(t){this.dirty=this.dirty||this._x2!==t,this._x2=t;}},{key:"y2",get:function(){return this._y2},set:function(t){this.dirty=this.dirty||this._y2!==t,this._y2=t;}},{key:"setP2",value:function(t,e){return this.dirty=this.dirty||this.x2!==t||this.y2!==e,this.x2=t,this.y2=e,this}},{key:"updateData",value:function(){return this.pathData.length=0,this.pathData.push(this.x0,this.y0),this.pathData.push(this.x1,this.y1),this.pathData.push(this.x2,this.y2),this.pathData.push(this.x0,this.y0),p(h(i.prototype),"updateData",this).call(this),this}},{key:"webglRender",value:function(t,e,i,n,s){if(this.isFilled){var r=cd(this.fillColor,this.fillAlpha*i),o=this.x0-n,a=this.y0-s,h=this.x1-n,l=this.y1-s,u=this.x2-n,c=this.y2-s,d=e.getX(o,a),f=e.getY(o,a),p=e.getX(h,l),v=e.getY(h,l),g=e.getX(u,c),y=e.getY(u,c);t.batchTri(d,f,p,v,g,y,r,r,r);}this.isStroked&&Ji(t,this,i,n,s);}},{key:"canvasRender",value:function(t,e,i){var n=this.x1-e,s=this.y1-i,r=this.x2-e,o=this.y2-i,a=this.x3-e,h=this.y3-i;t.beginPath(),t.moveTo(n,s),t.lineTo(r,o),t.lineTo(a,h),t.closePath(),this.isFilled&&(qi(t,this),t.fill()),this.isStroked&&($i(t,this),t.stroke());}}]),i}(Lc),fd={buildShapes:function(){this.addShape((new ud).setName("box")).addShape((new od).setName("checker"));},updateShapes:function(){var t=this.width/2,e=this.height/2,i=Math.min(t,e),n=2*i,s=t-i,r=e-i,o=this.boxLineWidth,a=Math.max(n/10,2),h=this.getShape("box"),l=this.getShape("checker");if(this.isSizeChanged){var u=n*(1-this.boxSize)/2,c=o/2,d=n*this.boxSize-o;h.setTopLeftPosition(s+c+u,r+c+u).setSize(d,d),this.isCircleShape?h.setRadius(d/2):h.setRadius(0);u=n*(1-this.checkerSize)/2;var f=n*this.checkerSize/4,p=1*f,v=2*f,g=3*f;l.startAt(p,v).lineTo(v,g).lineTo(g,p).offset(s+u,r+u).end();}this.checked?(h.fillStyle(this.boxFillColor,this.boxFillAlpha).lineStyle(o,this.boxStrokeColor,this.boxStrokeAlpha),l.lineStyle(a,this.checkerColor)):(h.fillStyle(this.uncheckedBoxFillColor,this.uncheckedBoxFillAlpha).lineStyle(o,this.uncheckedBoxStrokeColor,this.uncheckedBoxStrokeAlpha),l.lineStyle()),this.checked&&l.setDisplayPathSegment(this.checkerAnimProgress);}},pd=Phaser.Utils.Objects.GetValue,vd=Phaser.Math.Linear,gd=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).resetFromJSON(),r.boot(),r}return r(i,[{key:"start",value:function(t){if(this.timer.isRunning)return this;var e=this.target;this.propertyKey=pd(t,"key","value");var n=e[this.propertyKey];return this.fromValue=pd(t,"from",n),this.toValue=pd(t,"to",n),this.setEase(pd(t,"ease",this.ease)),this.setDuration(pd(t,"duration",this.duration)),this.setRepeat(pd(t,"repeat",0)),this.setDelay(pd(t,"delay",0)),this.setRepeatDelay(pd(t,"repeatDelay",0)),this.timer.setDuration(this.duration).setRepeat(this.repeat).setDelay(this.delay).setRepeatDelay(this.repeatDelay),e[this.propertyKey]=this.fromValue,p(h(i.prototype),"start",this).call(this),this}},{key:"updateGameObject",value:function(t,e){var i=e.t;i=this.easeFn(i),t[this.propertyKey]=vd(this.fromValue,this.toValue,i);}}]),i}(Ua),yd={setCheckerAnimationDuration:function(t){return void 0===t&&(t=0),this.checkerAnimDuration=t,this},playCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask&&(this.checkerAnimProgressTask=new gd(this,{eventEmitter:null})),this.checkerAnimProgressTask.restart({key:"checkerAnimProgress",from:0,to:1,duration:this.checkerAnimDuration}),this},stopCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask||this.checkerAnimProgressTask.stop(),this}},kd={};Object.assign(kd,Ec,{setBoxSize:function(t){return this.dirty=this.dirty||this.boxSize!==t,this.boxSize=t,this},setCheckerSize:function(t){return this.dirty=this.dirty||this.checkerSize!==t,this.checkerSize=t,this}},fd,yd);var md=Phaser.Utils.Objects.GetValue,bd=Phaser.Utils.Objects.IsPlainObject,Cd=23730,xd=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),bd(s)?(s=md(l=s,"x",0),r=md(l,"y",0),o=md(l,"width",2),a=md(l,"height",2),h=md(l,"color",Cd)):bd(h)&&(h=md(l=h,"color",Cd)),(u=e.call(this,t,s,r,o,a)).type="rexCheckbox",void 0===h&&(h=Cd),u.setBoxShape(md(l,"circleBox",!1)),u.setBoxFillStyle(h,md(l,"boxFillAlpha",1)),u.setUncheckedBoxFillStyle(md(l,"uncheckedColor",null),md(l,"uncheckedBoxFillAlpha",1)),u.setBoxStrokeStyle(md(l,"boxLineWidth",4),md(l,"boxStrokeColor",h),md(l,"boxStrokeAlpha",1)),u.setUncheckedBoxStrokeStyle(u.boxLineWidth,md(l,"uncheckedBoxStrokeColor",u.boxStrokeColor),md(l,"uncheckedBoxStrokeAlpha",u.boxStrokeAlpha)),u.setCheckerStyle(md(l,"checkerColor",16777215),md(l,"checkerAlpha",1)),u.setBoxSize(md(l,"boxSize",1)),u.setCheckerSize(md(l,"checkerSize",1)),u.setCheckerAnimationDuration(md(l,"animationDuration",150)),u.buildShapes();var c=md(l,"checked");return void 0===c&&(c=md(l,"value",!1)),u.setValue(c),u}return r(i,[{key:"value",get:function(){return this._value},set:function(t){t=!!t,this._value!==t&&(this.dirty=!0,this._value=t,t?this.playCheckerAnimation():this.stopCheckerAnimation(),this.emit("valuechange",t));}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"toggleValue",value:function(){return this.setValue(!this.value),this}},{key:"checked",get:function(){return this.value},set:function(t){this.value=t;}},{key:"setChecked",value:function(t){return void 0===t&&(t=!0),this.setValue(t),this}},{key:"toggleChecked",value:function(){return this.toggleValue(),this}},{key:"checkerAnimProgress",get:function(){return this._checkerAnimProgress},set:function(t){this._checkerAnimProgress!==t&&(this._checkerAnimProgress=t,this.dirty=!0);}}]),i}(Mc);Object.assign(xd.prototype,kd);var wd=Phaser.Utils.Objects.GetValue,Sd=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s))._enable=void 0,t.setInteractive(wd(s,"inputConfig",void 0)),r.resetFromJSON(s),r.boot(),r}return r(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.lastClickTime=void 0,this.setEnable(wd(t,"enable",!0)),this.setMode(wd(t,"mode",1)),this.setClickInterval(wd(t,"clickInterval",100)),this.setDragThreshold(wd(t,"threshold",void 0)),this}},{key:"boot",value:function(){var t=this.parent;t.on("pointerdown",this.onPress,this),t.on("pointerup",this.onRelease,this),t.on("pointerout",this.onPointOut,this),t.on("pointermove",this.onMove,this),t.on("pointerover",this.onOver,this),t.on("pointerout",this.onOut,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.pointer=null,p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t){t||this.cancel(),this._enable=t;var e=t?"enable":"disable";this.emit(e,this,this.parent);}}},{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=Od[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,this.emit("down",this,this.parent,t,n),0===this.mode&&this.click(t.downTime,t,n));}},{key:"onRelease",value:function(t,e,i,n){this.pointer===t&&(this.emit("up",this,this.parent,t,n),1===this.mode&&this.click(t.upTime,t,n),this.pointer=void 0);}},{key:"onPointOut",value:function(t,e){this.pointer===t&&this.cancel();}},{key:"onMove",value:function(t,e,i,n){this.pointer===t&&void 0!==this.dragThreshold&&1===this.mode&&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.parent,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.parent,e,i)),this}},{key:"cancel",value:function(){return this.pointer=void 0,this}},{key:"onOver",value:function(t,e,i,n){return this.enable?(this.emit("over",this,this.parent,t,n),this):this}},{key:"onOut",value:function(t,e){return this.enable?(this.emit("out",this,this.parent,t,e),this):this}}]),i}(Ta),Od={press:0,pointerdown:0,release:1,pointerup:1},Pd=Phaser.Utils.Objects.GetValue,Td=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var c;return n(this,i),(c=e.call(this,t,s,r,o,a,h,l))._click=new Sd(u(c),Pd(l,"click")),c._click.on("click",(function(){this.toggleValue();}),u(c)),c.setReadOnly(Pd(l,"readOnly",!1)),c}return r(i,[{key:"readOnly",get:function(){return !this._click.enable},set:function(t){this._click.enable=!t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}}]),i}(xd),Md={setTrackFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.trackFillColor!==t||this.trackFillAlpha!==e,this.trackFillColor=t,this.trackFillAlpha=e,this},setFalseValueTrackFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.falseValueTrackColor!==t||this.uncheckedTrackFillAlpha!==e,this.falseValueTrackColor=t,this.falseValueTrackFillAlpha=e,this},setThumbStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.thumbColor!==t||this.checkAlpha!==e,this.thumbColor=t,this.thumbAlpha=e,this}},Ed={setTrackSize:function(t,e){return this.dirty=this.dirty||this.trackWidth!==t||this.trackHeight!==e,this.trackWidth=t,this.trackHeight=e,this},setTrackRadius:function(t){return this.dirty=this.dirty||this.trackRadius!==t,this.trackRadius=t,this},setThumbSize:function(t,e){return void 0===e&&(e=t),this.dirty=this.dirty||this.thumbWidth!==t||this.thumbHeight!==e,this.thumbWidth=t,this.thumbHeight=e,this},setThumbRadius:function(t){return this.dirty=this.dirty||this.thumbRadius!==t,this.thumbRadius=t,this}},_d={setThumbPosition:function(t,e){return void 0===e&&(e=1-t),this.thumbLeftX=t,this.thumbRightX=e,this},setRTL:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},Ld=function(t,e,i){return (e-t)*i+t},Rd=Phaser.Math.Linear,Bd={buildShapes:function(){this.addShape((new ud).setName("track")).addShape((new ud).setName("thumb"));},updateShapes:function(){var t=this.width,e=this.height,i=this.value?this.toggleAnimProgress:1-this.toggleAnimProgress,n=this.getShape("track");if(this.isSizeChanged){var s=t*this.trackWidth,r=e*this.trackHeight,o=(t-s)/2,a=(e-r)/2,h=e*this.trackRadius;n.setTopLeftPosition(o,a).setSize(s,r).setRadius(h);}var l,u,c,d=(l=this.falseValueTrackColor,u=this.trackFillColor,c=i,(255&Ld(ia(l),ia(u),c))<<16|(255&Ld(na(l),na(u),c))<<8|255&Ld(sa(l),sa(u),c)),f=Rd(this.falseValueTrackFillAlpha,this.trackFillAlpha,i);n.fillStyle(d,f);var p=this.getShape("thumb");if(this.isSizeChanged){var v=t*this.thumbWidth,g=e*this.thumbHeight,y=e*this.thumbRadius;p.setSize(v,g).setRadius(y);}var k=Rd(this.thumbLeftX,this.thumbRightX,i)*t;this.rtl&&(k=t-k);var m=e/2;p.setCenterPosition(k,m),p.fillStyle(this.thumbColor,this.thumbAlpha);}},jd={setToggleAnimationDuration:function(t){return void 0===t&&(t=0),this.toggleAnimDuration=t,this},playToggleAnimation:function(){return void 0===this.toggleAnimProgressTask&&(this.toggleAnimProgressTask=new gd(this,{eventEmitter:null})),this.toggleAnimProgressTask.restart({key:"toggleAnimProgress",from:0,to:1,duration:this.toggleAnimDuration}),this},stopToggleAnimation:function(){return void 0===this.toggleAnimProgressTask||this.toggleAnimProgressTask.stop(),this}},Dd={};Object.assign(Dd,Md,Ed,_d,Bd,jd);var Ad=Phaser.Utils.Objects.GetValue,Id=Phaser.Utils.Objects.IsPlainObject,zd=23730,Fd=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),Id(s)?(s=Ad(l=s,"x",0),r=Ad(l,"y",0),o=Ad(l,"width",2),a=Ad(l,"height",2),h=Ad(l,"color",zd)):Id(h)&&(h=Ad(l=h,"color",zd)),(u=e.call(this,t,s,r,o,a)).type="rexToggleSwitch",void 0===h&&(h=zd),u.setTrackFillStyle(h,Ad(l,"trackFillAlpha",1)),u.setFalseValueTrackFillStyle(Ad(l,"falseValueTrackColor",function(t){var e=.3*ia(t)+.59*na(t)+.11*sa(t);return (255&e)<<16|(255&e)<<8|255&e}(h)),Ad(l,"falseValueTrackFillAlpha",1)),u.setThumbStyle(Ad(l,"thumbColor",16777215),Ad(l,"thumbAlpha",1)),u.setTrackSize(Ad(l,"trackWidth",.9),Ad(l,"trackHeight",.5)),u.setTrackRadius(Ad(l,"trackRadius",.5*u.trackHeight));var c=Ad(l,"thumbHeight",void 0),d=Ad(l,"thumbWidth",c);return void 0===d&&(d=.9*u.trackHeight),u.setThumbSize(d,c),u.setThumbRadius(Ad(l,"thumbRadius",.5*u.thumbHeight)),u.setThumbPosition(Ad(l,"thumbLeft",.3),Ad(l,"thumbRight",void 0)),u.setRTL(Ad(l,"rtl",!1)),u.setToggleAnimationDuration(Ad(l,"animationDuration",150)),u.buildShapes(),u.setValue(Ad(l,"value",!1),0),u}return r(i,[{key:"value",get:function(){return this._value},set:function(t){t=!!t,this._value!==t&&(this.dirty=!0,this._value=t,this.playToggleAnimation(),this.emit("valuechange",t));}},{key:"setValue",value:function(t,e){void 0===e&&(e=this.toggleAnimDuration);var i=this.toggleAnimDuration;return this.toggleAnimDuration=e,this.value=t,this.toggleAnimDuration=i,this}},{key:"toggleValue",value:function(t){return this.setValue(!this.value,t),this}},{key:"toggleAnimProgress",get:function(){return this._toggleAnimProgress},set:function(t){this._toggleAnimProgress!==t&&(this._toggleAnimProgress=t,this.dirty=!0);}}]),i}(Mc);Object.assign(Fd.prototype,Dd);var Yd=Phaser.Utils.Objects.GetValue,Wd=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var c;return n(this,i),(c=e.call(this,t,s,r,o,a,h,l))._click=new Sd(u(c),Yd(l,"click")),c._click.on("click",(function(){this.toggleValue();}),u(c)),c.setReadOnly(Yd(l,"readOnly",!1)),c}return r(i,[{key:"readOnly",get:function(){return !this._click.enable},set:function(t){this._click.enable=!t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}}]),i}(Fd),Vd={loadFromURL:function(t,e){var i=this,n=new Image;return n.onload=function(){i.width!==n.width||i.height!==n.height?i.resize(n.width,n.height):i.clear(),i.context.drawImage(n,0,0),i.updateTexture(),e&&e(),n.onload=null,n.src="",n.remove();},n.src=t,this},loadFromURLPromise:function(t){var e=this;return new Promise((function(i,n){e.loadFromURL(t,i);}))},loadFromFile:function(t,e){var i=URL.createObjectURL(t);return this.loadFromURL(i,(function(){URL.revokeObjectURL(i),e&&e();})),this},loadFromFilePromise:function(t){var e=this;return new Promise((function(i,n){e.loadFromFile(t,i);}))}},Xd=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i)}(gn);Object.assign(Xd.prototype,Vd),Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue;var Gd=Phaser.Math.Linear,Hd=Phaser.Math.Percent,Ud={setValue:function(t,e,i){return null==t||(void 0!==e&&(t=Hd(t,e,i)),this.value=t),this},addValue:function(t,e,i){return void 0!==e&&(t=Hd(t,e,i)),this.value+=t,this},getValue:function(t,e){var i=this.value;return void 0!==t&&(i=Gd(t,e,i)),i}},Nd=Phaser.Math.Percent,Kd={setEaseValuePropName:function(t){return this.easeValuePropName=t,this},setEaseValueDuration:function(t){return this.easeValueDuration=t,this},setEaseValueFunction:function(t){return this.easeFunction=t,this},stopEaseValue:function(){return this.easeValueTask&&this.easeValueTask.stop(),this},easeValueTo:function(t,e,i){return null==t||(void 0!==e&&(t=Nd(t,e,i)),void 0===this.easeValueTask&&(this.easeValueTask=new gd(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,to:t,duration:this.easeValueDuration,ease:this.easeFunction})),this},easeValueRepeat:function(t,e,i,n){return void 0===i&&(i=-1),void 0===n&&(n=0),void 0===this.easeValueTask&&(this.easeValueTask=new gd(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,from:t,to:e,duration:this.easeValueDuration,ease:this.easeFunction,repeat:i,repeatDelay:n}),this}},Jd=Phaser.Utils.Objects.GetValue,Zd=Phaser.Math.Clamp;function qd(t){var e=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"bootProgressBase",value:function(t){this.eventEmitter=Jd(t,"eventEmitter",this);var e=Jd(t,"valuechangeCallback",null);if(null!==e){var i=Jd(t,"valuechangeCallbackScope",void 0);this.eventEmitter.on("valuechange",e,i);}return this.setEaseValuePropName("value").setEaseValueDuration(Jd(t,"easeValue.duration",0)).setEaseValueFunction(Jd(t,"easeValue.ease","Linear")),this}},{key:"value",get:function(){return this._value},set:function(t){t=Zd(t,0,1);var e=this._value,i=e!=t;this.dirty=this.dirty||i,this._value=t,i&&this.eventEmitter.emit("valuechange",this._value,e,this.eventEmitter);}}]),i}(t);return Object.assign(e.prototype,Ud,Kd),e}var $d=Phaser.Math.RadToDeg,Qd=Phaser.Math.DegToRad,tf=function(t,e,i,n,s,r,o,a){var h=360===Math.abs(o-r),l=Qd(r),u=Qd(o),c=Math.cos(l),d=Math.sin(l),f=Math.cos(u),p=Math.sin(u);return t.startAt(e+c*n,i+d*n),t.arc(e,i,n,r,o,a),h&&0===s||(t.lineTo(e+f*s,i+p*s),s>0&&t.arc(e,i,s,o,r,!a)),t.close(),t},ef={buildShapes:function(){this.addShape((new od).setName("track")).addShape((new od).setName("bar")).addShape((new Ac).setName("center"));},updateShapes:function(){var t=this.radius,e=this.thickness*this.radius,i=this.radius,n=i-e,s=this.getShape("track");null!=this.trackColor&&this.thickness>0?(s.fillStyle(this.trackColor),tf(s,t,t,i,n,0,360,!1)):s.reset();var r=this.getShape("bar");if(null!=this.barColor&&this.thickness>0){var o,a,h;if(1===this.value)o=!1,a=0,h=360;else o=this.anticlockwise,a=$d(this.startAngle),h=360*(o?1-this.value:this.value)+a;r.fillStyle(this.barColor),tf(r,t,t,i,n,a,h,!1);}else r.reset();var l=this.getShape("center");this.centerColor&&n>0?l.setCenterPosition(t,t).setRadius(n).fillStyle(this.centerColor):l.reset();}},nf=Phaser.Utils.Objects.GetValue,sf=Phaser.Utils.Objects.IsPlainObject,rf=Phaser.Math.Clamp,of=Phaser.Math.DegToRad(270),af=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),sf(s)&&(s=nf(l=s,"x",0),r=nf(l,"y",0),o=nf(l,"radius",1),a=nf(l,"barColor",void 0),h=nf(l,"value",0)),void 0===o&&(o=1);var c=2*o;return (u=e.call(this,t,s,r,c,c)).type="rexCircularProgress",u.bootProgressBase(l),u.setRadius(o),u.setTrackColor(nf(l,"trackColor",void 0)),u.setBarColor(a),u.setCenterColor(nf(l,"centerColor",void 0)),u.setThickness(nf(l,"thickness",.2)),u.setStartAngle(nf(l,"startAngle",of)),u.setAnticlockwise(nf(l,"anticlockwise",!1)),u.buildShapes(),u.setValue(h),u}return r(i,[{key:"resize",value:function(t,e){return (t=Math.floor(Math.min(t,e)))===this.width||(p(h(i.prototype),"resize",this).call(this,t,t),this.setRadius(t/2)),this}},{key:"radius",get:function(){return this._radius},set:function(t){this.dirty=this.dirty||this._radius!=t,this._radius=t;var e=2*t;this.resize(e,e);}},{key:"setRadius",value:function(t){return this.radius=t,this}},{key:"trackColor",get:function(){return this._trackColor},set:function(t){this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"setBarColor",value:function(t){return this.barColor=t,this}},{key:"startAngle",get:function(){return this._startAngle},set:function(t){this.dirty=this.dirty||this._startAngle!=t,this._startAngle=t;}},{key:"setStartAngle",value:function(t){return this.startAngle=t,this}},{key:"anticlockwise",get:function(){return this._anticlockwise},set:function(t){this.dirty=this.dirty||this._anticlockwise!=t,this._anticlockwise=t;}},{key:"setAnticlockwise",value:function(t){return void 0===t&&(t=!0),this.anticlockwise=t,this}},{key:"thickness",get:function(){return this._thickness},set:function(t){t=rf(t,0,1),this.dirty=this.dirty||this._thickness!=t,this._thickness=t;}},{key:"setThickness",value:function(t){return this.thickness=t,this}},{key:"centerColor",get:function(){return this._centerColor},set:function(t){this.dirty=this.dirty||this._centerColor!=t,this._centerColor=t;}},{key:"setCenterColor",value:function(t){return this.centerColor=t,this}}]),i}(qd(Mc));Object.assign(af.prototype,ef);Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.IsPlainObject,Phaser.Math.Clamp,Phaser.Math.DegToRad(270);qd(gn);var hf=function(t,e,i,n,s,r){var o=(e+n)/2;return r>=0?t.startAt(o+r,i).lineTo(n+r,i).lineTo(n,s).lineTo(e,s).lineTo(e+r,i).lineTo(o+r,i):t.startAt(o,i).lineTo(n,i).lineTo(n-r,s).lineTo(e-r,s).lineTo(e,i).lineTo(o,i),t},lf=Phaser.Utils.Objects.GetValue,uf=Phaser.Utils.Objects.IsPlainObject,cf=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l,u){var c;return n(this,i),uf(s)?(s=lf(u=s,"x",0),r=lf(u,"y",0),o=lf(u,"width",2),a=lf(u,"height",2),h=lf(u,"barColor",void 0),l=lf(u,"value",0)):uf(o)?(o=lf(u=o,"width",2),a=lf(u,"height",2),h=lf(u,"barColor",void 0),l=lf(u,"value",0)):uf(h)&&(h=lf(u=h,"barColor",void 0),l=lf(u,"value",0)),(c=e.call(this,t,s,r,o,a,u)).type="rexLineProgress",c.bootProgressBase(u),c.addShape((new od).setName("trackFill")).addShape((new od).setName("bar")).addShape((new od).setName("trackStroke")),c.setTrackColor(lf(u,"trackColor",void 0)),c.setBarColor(h),c.setTrackStroke(lf(u,"trackStrokeThickness",2),lf(u,"trackStrokeColor",void 0)),c.setSkewX(lf(u,"skewX",0)),c.setRTL(lf(u,"rtl",!1)),c.setValue(l),c}return r(i,[{key:"trackColor",get:function(){return this._trackColor},set:function(t){this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"trackStrokeColor",get:function(){return this._trackStrokeColor},set:function(t){this.dirty=this.dirty||this._trackStrokeColor!=t,this._trackStrokeColor=t;}},{key:"trackStrokeThickness",get:function(){return this._trackStrokeThickness},set:function(t){this.dirty=this.dirty||this._trackStrokeThickness!=t,this._trackStrokeThickness=t;}},{key:"setTrackStroke",value:function(t,e){return this.trackStrokeThickness=t,this.trackStrokeColor=e,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"setBarColor",value:function(t){return this.barColor=t,this}},{key:"skewX",get:function(){return this._skewX},set:function(t){this.dirty=this.dirty||this._skewX!=t,this._skewX=t;}},{key:"setSkewX",value:function(t){return this.skewX=t,this}},{key:"rtl",get:function(){return this._rtl},set:function(t){t=!!t,this.dirty=this.dirty||this._rtl!=t,this._rtl=t;}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}}]),i}(qd(Mc)),df={updateShapes:function(){var t=this.skewX,e=this.width-Math.abs(t),i=this.height,n=this.getShape("trackFill");n.fillStyle(this.trackColor),n.isFilled&&hf(n,0,0,e,i,t).close();var s,r,o=this.getShape("bar");(o.fillStyle(this.barColor),o.isFilled)&&(this.rtl?(s=e*(1-this.value),r=e):(s=0,r=e*this.value),hf(o,s,0,r,i,t).close());var a=this.getShape("trackStroke");a.lineStyle(this.trackStrokeThickness,this.trackStrokeColor),a.isStroked&&hf(a,0,0,e,i,t).end();}};Object.assign(cf.prototype,df);var ff=function(t,e,i,n,s,r,o){void 0===o&&(o="round"),function(t,e){t.save(),t.beginPath();var i=e[0];t.moveTo(i.x,i.y);for(var n=1,s=e.length;n0&&(r.save(),ff(0,r,this.trackPoints,void 0,this.trackStrokeColor,this.trackStrokeThickness),r.restore());},vf=function(t,e,i,n,s,r){void 0===r&&(r=[]),r.length=4;for(var o=0;o<4;o++)r[o]||(r[o]={});var a;return s>=0?((a=r[0]).x=t+s,a.y=e,(a=r[1]).x=i+s,a.y=e,(a=r[2]).x=i,a.y=n,(a=r[3]).x=t,a.y=n):((a=r[0]).x=t,a.y=e,(a=r[1]).x=i,a.y=e,(a=r[2]).x=i-s,a.y=n,(a=r[3]).x=t-s,a.y=n),r},gf=Phaser.Utils.Objects.GetValue,yf=Phaser.Utils.Objects.IsPlainObject,kf=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l,u){var c;return n(this,i),yf(s)?(s=gf(u=s,"x",0),r=gf(u,"y",0),o=gf(u,"width",2),a=gf(u,"height",2),h=gf(u,"barColor",void 0),l=gf(u,"value",0)):yf(o)?(o=gf(u=o,"width",2),a=gf(u,"height",2),h=gf(u,"barColor",void 0),l=gf(u,"value",0)):yf(h)&&(h=gf(u=h,"barColor",void 0),l=gf(u,"value",0)),(c=e.call(this,t,s,r,o,a)).type="rexLineProgressCanvas",c.trackPoints=[],c.barPoints=[],c.bootProgressBase(u),c.setTrackColor(gf(u,"trackColor",void 0)),c.setBarColor(h,gf(u,"barColor2",void 0),gf(u,"isHorizontalGradient",void 0)),c.setTrackStroke(gf(u,"trackStrokeThickness",2),gf(u,"trackStrokeColor",void 0)),c.setSkewX(gf(u,"skewX",0)),c.setRTL(gf(u,"rtl",!1)),c.setValue(l),c}return r(i,[{key:"trackColor",get:function(){return this._trackColor},set:function(t){t=mn(t,this.canvas,this.context),this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"trackStrokeColor",get:function(){return this._trackStrokeColor},set:function(t){t=mn(t,this.canvas,this.context),this.dirty=this.dirty||this._trackStrokeColor!=t,this._trackStrokeColor=t;}},{key:"trackStrokeThickness",get:function(){return this._trackStrokeThickness},set:function(t){this.dirty=this.dirty||this._trackStrokeThickness!=t,this._trackStrokeThickness=t;}},{key:"setTrackStroke",value:function(t,e){return this.trackStrokeThickness=t,this.trackStrokeColor=e,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){t=mn(t,this.canvas,this.context),this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"barColor2",get:function(){return this._barColor2},set:function(t){t=mn(t,this.canvas,this.context),this.dirty=this.dirty||this._barColor2!=t,this._barColor2=t;}},{key:"isHorizontalGradient",get:function(){return this._isHorizontalGradient},set:function(t){this.dirty|=this._isHorizontalGradient!=t,this._isHorizontalGradient=t;}},{key:"setBarColor",value:function(t,e,i){return void 0===i&&(i=!0),this.barColor=t,this.barColor2=e,this.isHorizontalGradient=i,this}},{key:"skewX",get:function(){return this._skewX},set:function(t){this.dirty=this.dirty||this._skewX!=t,this._skewX=t;}},{key:"setSkewX",value:function(t){return this.skewX=t,this}},{key:"rtl",get:function(){return this._rtl},set:function(t){t=!!t,this.dirty=this.dirty||this._rtl!=t,this._rtl=t;}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},{key:"updateTexture",value:function(){return this.clear(),pf.call(this),p(h(i.prototype),"updateTexture",this).call(this),this}}]),i}(qd(gn));Phaser.Math.Wrap;var mf=Phaser.Math.Linear,bf=function(){var t,e,i,n,s,r,o=this.getShape("triangle"),a=this.padding,h=this.width-a.right,l=0+a.left,u=this.height-a.bottom,c=0+a.top,d=(l+h)/2,f=(c+u)/2,p={0:{a:{x:l,y:c},b:{x:h,y:f},c:{x:l,y:u}},1:{a:{x:l,y:c},b:{x:d,y:u},c:{x:h,y:c}},2:{a:{x:h,y:c},b:{x:l,y:f},c:{x:h,y:u}},3:{a:{x:l,y:u},b:{x:d,y:c},c:{x:h,y:u}}};if(void 0===this.previousDirection){var v=p[this.direction],g=v.a,y=v.b,k=v.c;t=g.x,e=g.y,i=y.x,n=y.y,s=k.x,r=k.y;}else {var m=p[this.previousDirection],b=p[this.direction],C=this.easeDirectionProgress;t=mf(m.a.x,b.a.x,C),e=mf(m.a.y,b.a.y,C),i=mf(m.b.x,b.b.x,C),n=mf(m.b.y,b.b.y,C),s=mf(m.c.x,b.c.x,C),r=mf(m.c.y,b.c.y,C);}o.startAt(t,e).lineTo(i,n).lineTo(s,r),this.arrowOnly?o.end():o.close();},Cf=(0, Phaser.Math.DegToRad)(120),xf=function(t){t=this.getShape("triangle");var e=this.width/2,i=this.height/2,n=Math.min(e,i)*this.radius,s=this.verticeRotation;t.startAt(e+n*Math.cos(s+Cf),i+n*Math.sin(s+Cf)).lineTo(e+n*Math.cos(s),i+n*Math.sin(s)).lineTo(e+n*Math.cos(s-Cf),i+n*Math.sin(s-Cf)),this.arrowOnly?t.end():t.close();},wf={buildShapes:function(){this.addShape((new od).setName("triangle"));},updateShapes:function(){var t=this.getShape("triangle");this.arrowOnly?t.fillStyle().lineStyle(this.lineWidth,this.strokeColor,this.strokeAlpha):t.fillStyle(this.fillColor,this.fillAlpha).lineStyle(this.lineWidth,this.strokeColor,this.strokeAlpha),0===this.shapeMode?bf.call(this):xf.call(this);}},Sf={setEaseDuration:function(t){return void 0===t&&(t=0),this.easeDuration=t,this},playEaseDirectionation:function(){return void 0===this.easeDirectionProgressTask&&(this.easeDirectionProgressTask=new gd(this,{eventEmitter:null})),this.easeDirectionProgressTask.restart({key:"easeDirectionProgress",from:0,to:1,duration:this.easeDuration}),this},stopEaseDirection:function(){return void 0===this.easeDirectionProgressTask||this.easeDirectionProgressTask.stop(),this}},Of=Phaser.Utils.Objects.GetValue,Pf=Phaser.Utils.Objects.IsPlainObject,Tf=Phaser.Math.DegToRad,Mf=Phaser.Math.RadToDeg,Ef=function(t){a(s,t);var e=d(s);function s(t,i,r,o,a,h,l){var u,c,d,f,p,v,g,y,k;if(n(this,s),Pf(i)){var m=i;i=m.x,r=m.y,o=m.width,a=m.height,h=m.color,l=m.alpha,c=m.strokeColor,d=m.strokeAlpha,f=m.strokeWidth,p=m.arrowOnly,v=m.direction,g=m.easeDuration,y=m.padding,k=m.radius;}return void 0===i&&(i=0),void 0===r&&(r=0),void 0===o&&(o=1),void 0===a&&(a=o),void 0===p&&(p=!1),void 0===v&&(v=0),void 0===g&&(g=0),void 0===y&&(y=0),void 0===k&&(k=void 0),(u=e.call(this,t,i,r,o,a)).type="rexTriangle",u.setFillStyle(h,l),void 0!==c&&void 0===f&&(f=2),u.setStrokeStyle(f,c,d),u.setArrowOnly(p),u.setDirection(v,g),u.setPadding(y),u.setRadius(k),u.buildShapes(),u}return r(s,[{key:"arrowOnly",get:function(){return this._arrowOnly},set:function(t){this.dirty=this.dirty||this._arrowOnly!=t,this._arrowOnly=t;}},{key:"setArrowOnly",value:function(t){return void 0===t&&(t=!0),this.arrowOnly=t,this}},{key:"direction",get:function(){return this._direction},set:function(t){t=Lf(t),this._direction!==t&&(this.easeDuration>0&&void 0!==this._direction?this.previousDirection=this._direction:this.previousDirection=void 0,this._direction=t,this.verticeAngle=90*t,this.dirty=!0,void 0!==this.previousDirection?this.playEaseDirectionation():this.stopEaseDirection());}},{key:"setDirection",value:function(t,e){return void 0!==e&&this.setEaseDuration(e),this.direction=t,this}},{key:"toggleDirection",value:function(t){return this.setDirection(this.direction+2,t),this}},{key:"easeDirectionProgress",get:function(){return this._easeDirectionProgress},set:function(t){this._easeDirectionProgress!==t&&(this._easeDirectionProgress=t,this.dirty=!0);}},{key:"setPadding",value:function(t,e,n,s){if("object"===i(t)){var r=t,o=Of(r,"x",null);null!==o?(t=o,n=o):(t=Of(r,"left",0),n=Of(r,"right",t));var a=Of(r,"y",null);null!==a?(e=a,s=a):(e=Of(r,"top",0),s=Of(r,"bottom",e));}else void 0===t&&(t=0),void 0===e&&(e=t),void 0===n&&(n=t),void 0===s&&(s=e);return void 0===this.padding&&(this.padding={}),this.dirty=this.dirty||this.padding.left!=t||this.padding.top!=e||this.padding.right!=n||this.padding.bottom!=s,this.padding.left=t,this.padding.top=e,this.padding.right=n,this.padding.bottom=s,this.setRadius(),this}},{key:"radius",get:function(){return this._radius},set:function(t){this.dirty=this.dirty||this._radius!=t,this._radius=t;}},{key:"setRadius",value:function(t){return this.radius=t,this.shapeMode=null==t?0:1,this}},{key:"verticeRotation",get:function(){return this._verticeRotation},set:function(t){this.dirty=this.dirty||this._verticeRotation!=t,this._verticeRotation=t;}},{key:"setVerticeRotation",value:function(t){return this.verticeRotation=t,this}},{key:"verticeAngle",get:function(){return Mf(this.verticeRotation)},set:function(t){this.verticeRotation=Tf(t);}},{key:"setVerticeAngle",value:function(t){return this.verticeAngle=t,this}}]),s}(Mc),_f={right:0,down:1,left:2,up:3},Lf=function(t){return "string"==typeof t&&(t=_f[t]),t%=4};Object.assign(Ef.prototype,wf,Sf);var Rf=function(t){return t.hasOwnProperty("rexSizer")||(t.rexSizer={}),t.rexSizer};var Bf=Phaser.Display.Align,jf={center:Bf.CENTER,left:Bf.LEFT_CENTER,right:Bf.RIGHT_CENTER,top:Bf.TOP_CENTER,bottom:Bf.BOTTOM_CENTER,"left-top":Bf.TOP_LEFT,"top-left":Bf.TOP_LEFT,"left-center":Bf.LEFT_CENTER,"center-left":Bf.LEFT_CENTER,"left-bottom":Bf.BOTTOM_LEFT,"bottom-left":Bf.BOTTOM_LEFT,"center-top":Bf.TOP_CENTER,"top-center":Bf.TOP_CENTER,"center-center":Bf.CENTER,"center-bottom":Bf.BOTTOM_CENTER,"bottom-center":Bf.BOTTOM_CENTER,"right-top":Bf.TOP_RIGHT,"top-right":Bf.TOP_RIGHT,"right-center":Bf.RIGHT_CENTER,"center-right":Bf.RIGHT_CENTER,"right-bottom":Bf.BOTTOM_RIGHT,"bottom-right":Bf.BOTTOM_RIGHT},Df=new Phaser.GameObjects.Zone({sys:{queueDepthSort:Ye,events:{once:Ye}}},0,0,1,1);Df.setOrigin(0);var Af=0,If=1,zf=2,Ff=4,Yf=6,Wf=8,Vf=10,Xf=12,Gf=function(t){var e=Pt(t);return t.y+e-e*t.originY},Hf=function(t){var e=Ot(t);return t.x-e*t.originX+.5*e},Uf=function(t,e){var i=Pt(t);return t.y=e-i+i*t.originY,t},Nf=function(t,e){var i=Ot(t),n=i*t.originX;return t.x=e+n-.5*i,t},Kf=function(t){var e=Ot(t);return t.x-e*t.originX},Jf=function(t,e){var i=Ot(t);return t.x=e+i*t.originX,t},Zf=function(t){var e=Ot(t);return t.x+e-e*t.originX},qf=function(t,e){var i=Ot(t);return t.x=e-i+i*t.originX,t},$f=function(t,e){var i=Pt(t),n=i*t.originY;return t.y=e+n-.5*i,t},Qf=function(t){var e=Pt(t);return t.y-e*t.originY+.5*e},tp=function(t){var e=Pt(t);return t.y-e*t.originY},ep=function(t,e){var i=Pt(t);return t.y=e+i*t.originY,t},ip=[];ip[11]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Nf(t,Hf(e)+i),Uf(t,Gf(e)+n),t},ip[Vf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Jf(t,Kf(e)-i),Uf(t,Gf(e)+n),t},ip[Xf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),qf(t,Zf(e)+i),Uf(t,Gf(e)+n),t},ip[Yf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),function(t,e,i){Nf(t,e),$f(t,i);}(t,Hf(e)+i,Qf(e)+n),t},ip[Ff]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Jf(t,Kf(e)-i),$f(t,Qf(e)+n),t},ip[Wf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),qf(t,Zf(e)+i),$f(t,Qf(e)+n),t},ip[If]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Nf(t,Hf(e)+i),ep(t,tp(e)-n),t},ip[Af]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Jf(t,Kf(e)-i),ep(t,tp(e)-n),t},ip[zf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),qf(t,Zf(e)+i),ep(t,tp(e)-n),t};var np=function(t,e,i,n,s){return ip[i](t,e,n,s)},sp=function(t,e,i,n,s,r){Df.setPosition(e,i).setSize(n,s),np(t,Df,r);},rp=Phaser.Utils.Objects.GetValue,op=Phaser.GameObjects.Group,ap=function(t,e,i){return t.add.text(0,0,"")},hp=void 0,lp=Phaser.Utils.Objects.GetValue,up=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=lp(t,"left",0),e.right=lp(t,"right",0),e.top=lp(t,"top",0),e.bottom=lp(t,"bottom",0)),e},cp=ie.prototype.add,dp=function(t){return cp.call(this,t),this.sizerEventsEnable&&(t.emit("sizer.add",t,this),this.emit("add",t,this)),this},fp={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),dp.call(this,t),this.backgroundChildren.push(t),this.getSizerConfig(t).padding=up(e),void 0!==i&&this.addChildrenMap(i,t),this},isBackground:function(t){return void 0!==this.backgroundChildren&&-1!==this.backgroundChildren.indexOf(t)}},pp=function t(e,i){var n=null;if(void 0===i)e.hasOwnProperty("rexContainer")&&((n=e.rexContainer.parent)?n.isRexSizer||(n=t(n)):n=null);else for(n=t(e);n&&n.name!==i;)n=t(n);return n},vp={getParentSizer:function(t,e){return "string"==typeof t&&(e=t,t=void 0),void 0===t&&(t=this),pp(t,e)},getTopmostSizer:function(t){return void 0===t&&(t=this),function(t){for(var e=pp(t);e;)t=e,e=pp(e);return t}(t)},hasParentSizer:function(t,e){void 0===e&&(e=this);for(var i=pp(e);i;){if(i===t)return !0;i=pp(i);}return !1},hasChild:function(t,e){return void 0===e&&(e=this),this.hasParentSizer(e,t)}},gp=Phaser.Utils.Array.Remove,yp=ie.prototype.remove,kp=vp.getParentSizer,mp=function(t,e){for(var i=kp(t);i;)i.removeChildCallback&&i.removeChildCallback(t,e),i=kp(i);return this.isBackground(t)&&gp(this.backgroundChildren,t),yp.call(this,t,e),!e&&this.sizerEventsEnable&&(t.emit("sizer.remove",t,this),this.emit("remove",t,this)),this},bp=Phaser.Utils.Array.Remove,Cp=vp.getParentSizer,xp={removeFromParentSizer:function(){var t=Cp(gameObject);return t&&t.remove(this),this},removeBackground:function(t,e){return void 0===this.backgroundChildren||this.getParentSizer(t)!==this||(bp(this.backgroundChildren,t),mp.call(this,t,e)),this},removeAllBackgrounds:function(t){if(void 0===this.backgroundChildren)return this;for(var e=this.backgroundChildren.length-1;e>=0;e--)this.remove(this.backgroundChildren[e],t);return this}},wp={getInnerPadding:function(t){return cr(this.space,t)},setInnerPadding:function(t,e){return dr(this.space,t,e),this},getOuterPadding:function(t){return cr(this.getSizerConfig(this).padding,t)},setOuterPadding:function(t,e){return dr(this.getSizerConfig(this).padding,t,e),this},getChildOuterPadding:function(t,e){return "string"==typeof t&&(t=this.getElement(t)),cr(this.getSizerConfig(t).padding,e)},setChildOuterPadding:function(t,e,i){return "string"==typeof t&&(t=this.getElement(t)),dr(this.getSizerConfig(t).padding,e,i),this}},Sp=function(t){var e=this.childrenWidth,i=void 0!==this.minWidth?this.minWidth:0;return void 0===t?(t=Math.max(i,e),this.layoutWarnEnable&&i>0&&e>i&&console.warn("Layout width warn: ".concat(this.constructor.name,"'s minWidth (").concat(i,") < childrenWidth (").concat(e,")"))):this.layoutWarnEnable&&(i>t||e>t)&&console.warn("Layout width warn: ".concat(this.constructor.name,"'s minWidth (").concat(i,") or childrenWidth (").concat(e," > targetWidth ").concat(t,")")),t},Op=function(t){var e=this.childrenHeight,i=void 0!==this.minHeight?this.minHeight:0;return void 0===t?(t=Math.max(i,e),this.layoutWarnEnable&&i>0&&e>i&&console.warn("Layout height warn: ".concat(this.constructor.name,"'s minHeight (").concat(i,") < childrenHeight (").concat(e,")"))):this.layoutWarnEnable&&(i>t||e>t)&&console.warn("Layout height warn: ".concat(this.constructor.name,"'s minHeight (").concat(i,") or childrenHeight (").concat(e,") > targetHeight (").concat(t,")")),t},Pp={getShownChildren:function(t){void 0===t&&(t=[]);for(var e,i=this.children,n=0,s=i.length;n0;){var i=e.shift();i.rexSizer&&i.rexSizer.hidden||(i!==this&&t.push(i),i.isRexContainerLite&&e.push.apply(e,m(i.children)));}return t}},Tp=function(){this._childrenWidth=void 0,this._childrenHeight=void 0;for(var t,e=this.getChildrenSizers(),i=0,n=e.length;i0){var e=t.runTransitionInCallback();t.delayCall(e,this.next,this);}else this.next();}},{key:"exit_TRANS_OPNE",value:function(){this.parent.removeDelayCall();}},{key:"next_OPEN",value:function(){return "TRANS_CLOSE"}},{key:"enter_OPEN",value:function(){this.parent.onOpen();}},{key:"exit_OPEN",value:function(){this.parent.removeDelayCall();}},{key:"next_TRANS_CLOSE",value:function(){return "CLOSE"}},{key:"enter_TRANS_CLOSE",value:function(){var t=this.parent;if(t.transitOutTime>0){var e=t.runTransitionOutCallback();t.delayCall(e,this.next,this);}else this.next();}},{key:"exit_TRANS_CLOSE",value:function(){this.parent.removeDelayCall();}},{key:"next_CLOSE",value:function(){return "TRANS_OPNE"}},{key:"enter_CLOSE",value:function(){this.parent.onClose();}},{key:"exit_CLOSE",value:function(){}},{key:"canOpen",value:function(){return "IDLE"===this.state||"CLOSE"===this.state}},{key:"canClose",value:function(){return "IDLE"===this.state||"OPEN"===this.state}}]),i}(_v),Rv={delayCall:function(t,e,i){return this.delayCallTimer=function(t,e,i,n,s){var r=Oa(t);return r.time.delayedCall(e,(function(){r.game.events.once("poststep",(function(){i.call(n,s);}));}))}(this,t,e,i),this},removeDelayCall:function(){return this.delayCallTimer&&(this.delayCallTimer.remove(!1),this.delayCallTimer=void 0),this}},Bv={setTransitInTime:function(t){return this.transitInTime=t,this},setTransitOutTime:function(t){return this.transitOutTime=t,this},setTransitInCallback:function(t){return t||(t=Ye),this.transitInCallback=t,this},setTransitOutCallback:function(t){return t||(t=Ye),this.transitOutCallback=t,this}},jv={runTransitionInCallback:function(){return this.transitInCallback(this.parent,this.transitInTime),this.transitInTime},onOpen:function(){},requestOpen:function(t,e){if(!this._state.canOpen())return this;this.openEventData=arguments.length>0?t:this.parent;var i=this.transitInTime;return void 0!==e&&(this.transitInTime=e),this._state.goto("TRANS_OPNE"),this.transitInTime=i,this}},Dv={runTransitionOutCallback:function(){return this.transitOutCallback(this.parent,this.transitOutTime),this.transitOutTime},onClose:function(){this.oneShotMode&&this.parent.destroy();},requestClose:function(t,e){if(!this._state.canClose)return this;this.closeEventData=arguments.length>0?t:this.parent;var i=this.transitOutTime;return void 0!==e&&(this.transitOutTime=e),this._state.goto("TRANS_CLOSE"),this.transitOutTime=i,this}},Av={};Object.assign(Av,Rv,Bv,jv,Dv);var Iv=Phaser.Utils.Objects.GetValue,zv=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).setTransitInTime(Iv(s,"duration.in",200)),r.setTransitOutTime(Iv(s,"duration.out",200)),r.setTransitInCallback(Iv(s,"transitIn")),r.setTransitOutCallback(Iv(s,"transitOut")),r.oneShotMode=Iv(s,"destroy",!1),r.delayCallTimer=void 0,r._state=new Lv(u(r),{eventEmitter:!1,initState:Iv(s,"initState","IDLE")}),r.openEventData=void 0,r.closeEventData=void 0,r}return r(i,[{key:"state",get:function(){return this._state.state}},{key:"shutdown",value:function(t){this.isShutdown||(this.transitInCallback=void 0,this.transitOutCallback=void 0,this.openEventData=void 0,this.closeEventData=void 0,this.removeDelayCall(),p(h(i.prototype),"shutdown",this).call(this,t));}}]),i}(Ta);Object.assign(zv.prototype,Av);var Fv=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;return n(this,i),(o=e.call(this,t,0,0,2,2,s,1)).setAlpha(r),o.setScrollFactor(0),o.boot(),o}return r(i,[{key:"boot",value:function(){this.scene.sys.events.on("prerender",this.resize,this);}},{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.scene.sys.events.off("prerender",this.resize,this),p(h(i.prototype),"destroy",this).call(this,t));}},{key:"tint",get:function(){return this.fillColor},set:function(t){this.setFillStyle(t,this.fillAlpha);}},{key:"resize",value:function(){var t=this.scene,e=t.sys.scale.gameSize,i=t.sys.cameras.main,n=e.width,s=e.height,r=1/i.zoom,o=n/2,a=s/2,h=n*r,l=s*r;this.x===o&&this.y===a||this.setPosition(o,a),this.width===h&&this.height===l||this.setSize(h,l).setOrigin(.5);}}]),i}(Phaser.GameObjects.Rectangle),Yv=Phaser.Utils.Objects.GetValue,Wv=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,{eventEmitter:!1})).resetFromJSON(s),r.boot(),r}return r(i,[{key:"resetFromJSON",value:function(t){return this.setHitAreaMode(Yv(t,"hitAreaMode",0)),this.setEnable(Yv(t,"enable",!0)),this.setStopMode(Yv(t,"stopAllLevels",!0)),this}},{key:"boot",value:function(){this.parent.on("pointerdown",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerup",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointermove",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerover",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerout",(function(t,e){this.stopAllLevels&&e.stopPropagation();}),this);}},{key:"setHitAreaMode",value:function(t){"string"==typeof t&&(t=Vv[t]);var e=this.parent;return e.input&&e.removeInteractive(),0===t?e.setInteractive():e.setInteractive({hitArea:{},hitAreaCallback:function(){return !0}}),this}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),t?this.parent.setInteractive():this.parent.disableInteractive(),this.enable=t,this}},{key:"setStopMode",value:function(t){return void 0===t&&(t=!0),this.stopAllLevels=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}}]),i}(Ta),Vv={default:0,fullWindow:1},Xv=Phaser.Utils.Objects.GetValue,Gv=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=Xv(s,"color",0),a=Xv(s,"alpha",.8);return (r=e.call(this,t,o,a)).touchEventStop=new Wv(u(r),{hitAreaMode:1}),r}return r(i)}(Fv),Hv=function(t,e){void 0!==t._modalScaleSave?(t.scaleX=t._modalScaleSave,t.scaleY=t._modalScaleSave):t._modalScaleSave=t.scaleX,Dp(t,e);},Uv=function(t,e){Ap(t,e,void 0,void 0,!1);},Nv=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,Up(t,e);},Kv=function(t,e){Np(t,e,!1);},Jv=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,Up(t,e,t.alpha);},Zv=function(t,e){Np(t,e,!1);},qv=function(t,e,i,n,s){return !!t&&(!(n&&!n(t,e,i))&&(!!_t(t,!0).contains(e,i)&&!(s&&!s(t,e,i))))},$v=Phaser.Utils.Objects.GetValue,Qv=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),null==s.transitIn&&(s.transitIn=tg.popUp),null==s.transitOut&&(s.transitOut=tg.scaleDown),s.destroy=$v(s,"destroy",!0),r=e.call(this,t,s);var o=$v(s,"cover");r.cover=!1!==o?function(t,e){var i=t.scene,n=new Gv(i,e);return i.add.existing(n),t.isRexContainerLite?(t.pin(n,{syncPosition:!1,syncRotation:!1,syncScale:!1,syncAlpha:!1,syncScrollFactor:!1}),t.moveDepthBelow(n)):i.children.moveBelow(n,t),n}(t,o):void 0,r.cover&&(r.setCoverTransitInCallback($v(o,"transitIn",Jv)),r.setCoverTransitOutCallback($v(o,"transitOut",Zv)));var a=$v(s,"touchOutsideClose",!1),h=$v(s,"duration.hold",-1),l=$v(s,"timeOutClose",h>=0),c=$v(s,"anyTouchClose",!1);return $v(s,"manualClose",!1)&&(a=!1,c=!1,l=!1),c&&(a=!1),l?r.setDisplayTime(h):r.setDisplayTime(-1),c?r.once("open",r.anyTouchClose,u(r)):a&&r.once("open",r.touchOutsideClose,u(r)),$v(s,"openOnStart",!0)&&r.delayCall(0,r.requestOpen,u(r)),r}return r(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.cover||this.scene.input.off("pointerup",this.touchCloseCallback,this),this.cover&&!t&&(this.cover.destroy(),this.cover=void 0),p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"touchOutsideClose",value:function(){return this.cover?this.cover.on("pointerup",this.touchCloseCallback,this):this.scene.input.on("pointerup",this.touchCloseCallback,this),this.clickOutsideTest=!0,this}},{key:"anyTouchClose",value:function(){return this.cover?this.cover.once("pointerup",this.touchCloseCallback,this):this.scene.input.once("pointerup",this.touchCloseCallback,this),this}},{key:"touchCloseCallback",value:function(t){this.clickOutsideTest&&qv(this.parent,t.worldX,t.worldY)||this.requestClose();}},{key:"runTransitionInCallback",value:function(){var t=p(h(i.prototype),"runTransitionInCallback",this).call(this),e=this.cover;return e&&this.coverTransitInCallback&&this.coverTransitInCallback(e,t),t}},{key:"runTransitionOutCallback",value:function(){var t=p(h(i.prototype),"runTransitionOutCallback",this).call(this),e=this.cover;return e&&this.coverTransitOutCallback&&this.coverTransitOutCallback(e,t),t}},{key:"onOpen",value:function(){var t=this.displayTime;t>=0&&this.delayCall(t,this.requestClose,this),this.emit("open",this.parent,this),p(h(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.closeEventData),p(h(i.prototype),"onClose",this).call(this);}},{key:"setDisplayTime",value:function(t){return this.displayTime=t,this}},{key:"setTransitInCallback",value:function(t){switch("string"==typeof t&&(t=tg[t]),t){case tg.popUp:t=Hv;break;case tg.fadeIn:t=Nv;}return p(h(i.prototype),"setTransitInCallback",this).call(this,t),this}},{key:"setTransitOutCallback",value:function(t){switch("string"==typeof t&&(t=tg[t]),t){case tg.scaleDown:t=Uv;break;case tg.fadeOut:t=Kv;}return p(h(i.prototype),"setTransitOutCallback",this).call(this,t),this}},{key:"setCoverTransitInCallback",value:function(t){return this.coverTransitInCallback=t,this}},{key:"setCoverTransitOutCallback",value:function(t){return this.coverTransitOutCallback=t,this}}]),i}(zv),tg={popUp:0,fadeIn:1,scaleDown:0,fadeOut:1},eg={modal:function(t,e){return we(t)&&(e=t,t=void 0),void 0===this._modalBehavior&&(this.onCreateModalBehavior&&this.onCreateModalBehavior(this,t),this._modalBehavior=function(t,e){var i=new Qv(t,e);return i.on("open",(function(){t.emit("modal.open",i);})),i.on("close",(function(e){t.emit("modal.close",e,i);})),t.on("modal.requestClose",i.requestClose,i),i}(this,t)),e&&this._modalBehavior.once("close",e),this._modalBehavior.requestOpen(),this},modalPromise:function(t){var e=this;return new Promise((function(i,n){e.modal(t,i);}))},modalClose:function(t){return function(t,e){t.emit("modal.requestClose",e);}(this,t),this}},ig=function(t,e,i,n){if(e)return qv(t,e.worldX,e.worldY,i,n);for(var s=t.scene.input.manager,r=s.pointersTotal,o=s.pointers,a=0;a=this.dragThreshold||this.isPointerInside(t))&&this.cancel();}},{key:"click",value:function(t,e){if(!this.enable)return this;if(void 0===t)return this.emit("clickoutside",this,this.parent,e),this;this.pointer=void 0;var i=this.lastClickTime;return void 0!==i&&t-i<=this.clickInterval||(this.lastClickTime=t,this.emit("clickoutside",this,this.parent,e)),this}},{key:"cancel",value:function(){return this.pointer=void 0,this}}]),i}(Ta),mg={press:0,pointerdown:0,release:1,pointerup:1},bg={onClickOutside:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._clickOutside&&(t._clickOutside=new kg(t,n)),t._clickOutside.on("clickoutside",e,i),this):this},offClickOutside:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._clickOutside||t._clickOutside.off("clickoutside",e,i),this},enableClickOutside:function(t,e){return t&&"object"!==i(t)&&(e=t,t=this),void 0===t._clickOutside||t._clickOutside.setEnable(e),this},disableClickOutside:function(t){return t&&"object"!==i(t)&&(t=this),void 0===t._clickOutside||t._clickOutside.setEnable(!1),this}},Cg=function(t){a(i,t);var e=d(i);function i(){var t;return n(this,i),(t=e.call(this,{eventEmitter:!1})).goto("IDLE"),t}return r(i,[{key:"setCooldownTime",value:function(t){return this.cooldownTime=t,this.cooldownMode=void 0!==t,this}},{key:"request",value:function(){return this.runMethod("request")}},{key:"update_IDLE",value:function(){this.compensationTime=0;}},{key:"request_IDLE",value:function(){return this.next(),!0}},{key:"next_IDLE",value:function(){if(this.cooldownMode)return "COOLDOWN"}},{key:"enter_COOLDOWN",value:function(){this.remainderTime=this.cooldownTime+this.compensationTime;}},{key:"update_COOLDOWN",value:function(t,e){this.remainderTime-=e,this.remainderTime<0&&(this.compensationTime=this.cooldownTime>e?-this.remainderTime:0,this.goto("IDLE"));}},{key:"request_COOLDOWN",value:function(){return !1}}]),i}(_v),xg=Phaser.Utils.Objects.GetValue,wg=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s))._enable=void 0,r.cooldown=new Cg,r.parent.setInteractive(xg(s,"inputConfig",void 0)),r.resetFromJSON(s),r.boot(),r}return r(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.prevIsInTouch=!1,this.isInTouching=!1,this.setEnable(xg(t,"enable",!0)),this.setCooldown(xg(t,"cooldown",void 0)),this}},{key:"boot",value:function(){var t=this.parent;t.on("pointerdown",this.onPointIn,this),t.on("pointerover",this.onPointIn,this),t.on("pointerup",this.onPointOut,this),t.on("pointerout",this.onPointOut,this),this.scene.sys.events.on("preupdate",this.preupdate,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.scene.sys.events.off("preupdate",this.preupdate,this),this.pointer=void 0,p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t)return t||(this.prevIsInTouch=!1,this.isInTouching=!1,this.pointer=void 0),this._enable=t,this}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"cooldownTime",get:function(){return this.cooldown.cooldownTime},set:function(t){this.cooldown.setCooldownTime(t);}},{key:"setCooldown",value:function(t){return this.cooldownTime=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"onPointIn",value:function(t,e,i){this.enable&&t.isDown&&void 0===this.pointer&&(this.pointer=t,this.isInTouching=!0);}},{key:"onPointOut",value:function(t){this.enable&&this.pointer===t&&(this.pointer=void 0,this.isInTouching=!1);}},{key:"preupdate",value:function(t,e){this.cooldown.update(t,e),!this.prevIsInTouch&&this.isInTouching&&this.emit("touchstart",this,this.parent),this.isInTouching&&this.cooldown.request()&&this.emit("intouch",this,this.parent,this.pointer),this.prevIsInTouch&&!this.isInTouching&&this.emit("touchend",this,this.parent),this.prevIsInTouch=this.isInTouching;}}]),i}(Ta),Sg={isPointerInBounds:function(t){return void 0===t?t=this:"string"==typeof t&&(t=this.getElement(t)),!!t&&ig(t)},onTouching:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._inTouching&&(t._inTouching=new wg(t,n)),t._inTouching.on("intouch",e,i),this):this},offTouching:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._inTouching||t._inTouching.off("intouch",e,i),this},onTouchingEnd:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._inTouching&&(t._inTouching=new wg(t,n)),t._inTouching.on("touchend",e,i),this):this},offTouchingEnd:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._inTouching||t._inTouching.off("touchend",e,i),this},enableTouching:function(t,e){return t&&"object"!==i(t)&&(e=t,t=this),void 0===t._inTouching||t._inTouching.setEnable(e),this},disableTouching:function(t){return t&&"object"!==i(t)&&(t=this),void 0===t._inTouching||t._inTouching.setEnable(!1),this}},Og=function(t,e,i){for(var n,s=0,r=t.length;s0),this.onDragStart()));}},{key:"onPointerUp",value:function(t){this.enable&&((!this.bounds||this.bounds.contains(t.x,t.y))&&this.pointer===t&&(this.pointer=void 0,this.movedState=!1,this.tracerState=Wg,this.onDragEnd()));}},{key:"onPointerMove",value:function(t){if(this.enable&&t.isDown){var e=!this.bounds||this.bounds.contains(t.x,t.y),i=this.pointer===t;!i&&e||(i&&!e?this.onPointerUp(t):(this.movedState||(this.movedState=t.x!==t.downX||t.y!==t.downY),this.movedState&&this.onDrag()));}}},{key:"dragCancel",value:function(){return this.tracerState===Vg&&this.onDragEnd(),this.pointer=void 0,this.tracerState=Wg,this}},{key:"onDragStart",value:function(){this.emit("dragstart",this);}},{key:"onDragEnd",value:function(){this.emit("dragend",this);}},{key:"onDrag",value:function(){this.emit("drag",this);}},{key:"preUpdate",value:function(t,e){}},{key:"postUpdate",value:function(t,e){}},{key:"startTicking",value:function(){p(h(i.prototype),"startTicking",this).call(this),this.scene.sys.events.on("preupdate",this.preUpdate,this),this.scene.sys.events.on("postupdate",this.postUpdate,this);}},{key:"stopTicking",value:function(){p(h(i.prototype),"stopTicking",this).call(this),this.scene&&(this.scene.sys.events.off("preupdate",this.preUpdate,this),this.scene.sys.events.off("postupdate",this.postUpdate,this));}},{key:"setRecongizedStateObject",value:function(t){return this.recongizedState=t,this}},{key:"state",get:function(){return this.recongizedState.state},set:function(t){this.recongizedState.state=t;}},{key:"cancel",value:function(){return this.state=Xg,this}}]),i}(Ea),Wg=0,Vg=1,Xg="IDLE",Gg=Phaser.Utils.Objects.GetValue,Hg=Phaser.Math.Distance.Between,Ug=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=u(r=e.call(this,t,s)),a={states:{IDLE:{enter:function(){o.stop(),o.tapsCount=0,o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.start(),o.tapsCount=0,o.emit("tappingstart",o,o.gameObject,o.lastPointer);}},RECOGNIZED:{enter:function(){o.start(),o.emit("tap",o,o.gameObject,o.lastPointer),o.emit("".concat(o.tapsCount,"tap"),o,o.gameObject,o.lastPointer);}}},init:function(){this.state=Ng;},eventEmitter:!1};return r.setRecongizedStateObject(new _v(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setHoldTime(Gg(t,"time",250)),this.setTapInterval(Gg(t,"tapInterval",200)),this.setDragThreshold(Gg(t,"threshold",9)),this.setTapOffset(Gg(t,"tapOffset",10));var e=Gg(t,"taps",void 0);return void 0!==e?this.setTaps(e):(this.setMaxTaps(Gg(t,"maxTaps",void 0)),this.setMinTaps(Gg(t,"minTaps",void 0))),this}},{key:"onDragStart",value:function(){switch(this.state){case Ng:this.state=Kg;break;case Kg:var t=this.lastPointer;Hg(t.upX,t.upY,t.x,t.y)>this.tapOffset&&(this.state=Jg,this.state=Kg);break;case Jg:this.state=Kg;}}},{key:"onDragEnd",value:function(){this.state===Kg&&(this.tapsCount++,this.emit("tapping",this,this.gameObject,this.lastPointer),void 0!==this.maxTaps&&this.tapsCount===this.maxTaps&&(this.state=Jg));}},{key:"onDrag",value:function(){this.state!==Ng&&this.pointer.getDistance()>this.dragThreshold&&(this.state=Ng);}},{key:"preUpdate",value:function(t,e){if(this.isRunning&&this.enable&&this.state===Kg){var i=this.lastPointer;if(i.isDown)t-i.downTime>this.holdTime&&(this.state=Ng);else t-i.upTime>this.tapInterval&&(void 0===this.minTaps||this.tapsCount>=this.minTaps?this.state=Jg:this.state=Ng);}}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===Jg&&(this.state=Ng);}},{key:"isTapped",get:function(){return this.state===Jg}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setTapInterval",value:function(t){return this.tapInterval=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"setTapOffset",value:function(t){return this.tapOffset=t,this}},{key:"setMaxTaps",value:function(t){return this.maxTaps=t,this}},{key:"setMinTaps",value:function(t){return this.minTaps=t,this}},{key:"setTaps",value:function(t,e){return void 0===e&&(e=t),this.setMinTaps(t).setMaxTaps(e),this}}]),i}(Yg),Ng="IDLE",Kg="BEGIN",Jg="RECOGNIZED",Zg=Phaser.Utils.Objects.GetValue,qg=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=u(r=e.call(this,t,s)),a={states:{IDLE:{enter:function(){o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.start();},exit:function(){o.stop();}},RECOGNIZED:{enter:function(){o.emit("pressstart",o,o.gameObject,o.lastPointer);},exit:function(){o.emit("pressend",o,o.gameObject,o.lastPointer);}}},init:function(){this.state=$g;},eventEmitter:!1};return r.setRecongizedStateObject(new _v(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Zg(t,"threshold",9)),this.setHoldTime(Zg(t,"time",251)),this}},{key:"onDragStart",value:function(){this.state=Qg,0===this.holdTime&&(this.state=ty);}},{key:"onDragEnd",value:function(){this.state=$g;}},{key:"onDrag",value:function(){this.state!==$g&&this.pointer.getDistance()>this.dragThreshold&&(this.state=$g);}},{key:"preUpdate",value:function(t,e){this.isRunning&&this.enable&&(this.state===Qg&&t-this.pointer.downTime>=this.holdTime&&(this.state=ty));}},{key:"isPressed",get:function(){return this.state===ty}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Yg),$g="IDLE",Qg="BEGIN",ty="RECOGNIZED";Phaser.Utils.Objects.GetValue;var ey=Phaser.Math.Distance.Between,iy=Phaser.Math.Angle.Between,ny={getDt:function(){return xc(this.scene)},getVelocity:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return ey(e.x,e.y,t.x,t.y)/(.001*this.getDt())},getVelocityX:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Math.abs(t.x-e.x)/(.001*this.getDt())},getVelocityY:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Math.abs(t.y-e.y)/(.001*this.getDt())},getVelocityAngle:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return iy(e.x,e.y,t.x,t.y)}},sy={"up&down":0,"left&right":1,"4dir":2,"8dir":3},ry={},oy=Phaser.Utils.Objects.GetValue,ay=Phaser.Math.RadToDeg,hy=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=u(r=e.call(this,t,s)),a={states:{IDLE:{enter:function(){o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.validDrag=!1;}},RECOGNIZED:{enter:function(){o.start(),o.updateDirectionStates(),o.emit("swipe",o,o.gameObject,o.lastPointer);},exit:function(){o.stop(),o.clearDirectionStates();}}},init:function(){this.state=ly;},eventEmitter:!1};return r.setRecongizedStateObject(new _v(a)),r.clearDirectionStates(),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(oy(t,"threshold",10)),this.setVelocityThreshold(oy(t,"velocityThreshold",1e3)),this.setDirectionMode(oy(t,"dir","8dir")),this}},{key:"onDragStart",value:function(){this.state=uy;}},{key:"onDragEnd",value:function(){this.state=ly;}},{key:"onDrag",value:function(){this.state===uy&&(this.validDrag||(this.validDrag=0===this.dragThreshold||this.pointer.getDistance()>=this.dragThreshold),this.validDrag&&this.dragVelocity>this.velocityThreshold&&(this.state=cy));}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===cy&&(this.state=ly);}},{key:"isSwiped",get:function(){return this.state===cy}},{key:"dragVelocity",get:function(){var t;switch(this.dirMode){case 0:t=this.getVelocityY();break;case 1:t=this.getVelocityX();break;default:t=this.getVelocity();}return t}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"setVelocityThreshold",value:function(t){return this.velocityThreshold=t,this}},{key:"setDirectionMode",value:function(t){return "string"==typeof t&&(t=sy[t]),this.dirMode=t,this}},{key:"updateDirectionStates",value:function(){return function(t,e,i){switch(void 0===i?i={}:!0===i&&(i=ry),i.left=!1,i.right=!1,i.up=!1,i.down=!1,t=(t+360)%360,e){case 0:t<180?i.down=!0:i.up=!0;break;case 1:t>90&&t<=270?i.left=!0:i.right=!0;break;case 2:t>45&&t<=135?i.down=!0:t>135&&t<=225?i.left=!0:t>225&&t<=315?i.up=!0:i.right=!0;break;case 3:t>22.5&&t<=67.5?(i.down=!0,i.right=!0):t>67.5&&t<=112.5?i.down=!0:t>112.5&&t<=157.5?(i.down=!0,i.left=!0):t>157.5&&t<=202.5?i.left=!0:t>202.5&&t<=247.5?(i.left=!0,i.up=!0):t>247.5&&t<=292.5?i.up=!0:t>292.5&&t<=337.5?(i.up=!0,i.right=!0):i.right=!0;}}(ay(this.getVelocityAngle()),this.dirMode,this),this}},{key:"clearDirectionStates",value:function(){return this.left=!1,this.right=!1,this.up=!1,this.down=!1,this}}]),i}(Yg);Object.assign(hy.prototype,ny);var ly="IDLE",uy="BEGIN",cy="RECOGNIZED",dy=Phaser.Utils.Objects.GetValue,fy=Phaser.Utils.Array.SpliceOne,py=Phaser.Math.Distance.Between,vy=Phaser.Math.Angle.Between,gy=function(){function t(e,i){n(this,t);var s=e.input.manager.pointersTotal-1;s<2&&e.input.addPointer(2-s),this.scene=e,this.setEventEmitter(dy(i,"eventEmitter",void 0)),this._enable=void 0,this.pointers=[],this.movedState={},this.resetFromJSON(i),this.boot();}return r(t,[{key:"resetFromJSON",value:function(t){return this.setEnable(dy(t,"enable",!0)),this.bounds=dy(t,"bounds",void 0),this.tracerState=ky,this.pointers.length=0,Yt(this.movedState),this}},{key:"boot",value:function(){this.scene.input.on("pointerdown",this.onPointerDown,this),this.scene.input.on("pointerup",this.onPointerUp,this),this.scene.input.on("gameout",this.dragCancel,this),this.scene.input.on("pointermove",this.onPointerMove,this),this.scene.sys.events.once("shutdown",this.destroy,this);}},{key:"shutdown",value:function(){this.scene&&(this.destroyEventEmitter(),this.pointers.length=0,Yt(this.movedState),this.scene.input.off("pointerdown",this.onPointerDown,this),this.scene.input.off("pointerup",this.onPointerUp,this),this.scene.input.off("gameout",this.dragCancel,this),this.scene.input.off("pointermove",this.onPointerMove,this),this.scene.sys.events.off("shutdown",this.destroy,this),this.scene=void 0);}},{key:"destroy",value:function(){this.shutdown();}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t)return t||this.dragCancel(),this._enable=t,this}},{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:"onPointerDown",value:function(t){if(this.enable&&(2!==this.pointers.length&&(!this.bounds||this.bounds.contains(t.x,t.y))&&-1===this.pointers.indexOf(t)))switch(this.movedState[t.id]=!1,this.pointers.push(t),this.tracerState){case ky:this.tracerState=my,this.onDrag1Start();break;case my:this.tracerState=by,this.onDrag2Start();}}},{key:"onPointerUp",value:function(t){if(this.enable&&(!this.bounds||this.bounds.contains(t.x,t.y))){var e=this.pointers.indexOf(t);if(-1!==e)switch(delete this.movedState[t.id],fy(this.pointers,e),this.tracerState){case my:this.tracerState=ky,this.onDrag1End();break;case by:this.tracerState=my,this.onDrag2End(),this.onDrag1Start();}}}},{key:"onPointerMove",value:function(t){if(this.enable&&t.isDown){var e=!this.bounds||this.bounds.contains(t.x,t.y),i=-1!==this.pointers.indexOf(t);if(!i&&e);else if(i&&!e)this.onPointerUp(t);else if(this.movedState[t.id]||(this.movedState[t.id]=t.x!==t.downX||t.y!==t.downY),this.movedState[t.id])switch(this.tracerState){case my:this.onDrag1();break;case by:this.onDrag2();}}}},{key:"dragCancel",value:function(){return this.tracerState===by&&this.onDrag2End(),this.pointers.length=0,Yt(this.movedState),this.tracerState=ky,this}},{key:"onDrag1Start",value:function(){this.emit("drag1start",this);}},{key:"onDrag1End",value:function(){this.emit("drag1end",this);}},{key:"onDrag1",value:function(){this.emit("drag1",this);}},{key:"onDrag2Start",value:function(){this.emit("drag2start",this);}},{key:"onDrag2End",value:function(){this.emit("drag2end",this);}},{key:"onDrag2",value:function(){this.emit("drag2",this);}},{key:"distanceBetween",get:function(){if(this.tracerState!==by)return 0;var t=this.pointers[0],e=this.pointers[1];return py(t.x,t.y,e.x,e.y)}},{key:"angleBetween",get:function(){if(this.tracerState!==by)return 0;var t=this.pointers[0],e=this.pointers[1];return vy(t.x,t.y,e.x,e.y)}},{key:"drag1Vector",get:function(){var t=this.pointers[0];if(t&&this.movedState[t.id]){var e=t.position,i=t.prevPosition;yy.x=e.x-i.x,yy.y=e.y-i.y;}else yy.x=0,yy.y=0;return yy}},{key:"centerX",get:function(){if(this.tracerState!==by)return 0;var t=this.pointers[0].position,e=this.pointers[1].position;return (t.x+e.x)/2}},{key:"centerY",get:function(){if(this.tracerState!==by)return 0;var t=this.pointers[0].position,e=this.pointers[1].position;return (t.y+e.y)/2}},{key:"prevCenterX",get:function(){if(this.tracerState!==by)return 0;var t=this.movedState[this.pointers[0].id]?this.pointers[0].prevPosition:this.pointers[0].position,e=this.movedState[this.pointers[1].id]?this.pointers[1].prevPosition:this.pointers[1].position;return (t.x+e.x)/2}},{key:"prevCenterY",get:function(){if(this.tracerState!==by)return 0;var t=this.movedState[this.pointers[0].id]?this.pointers[0].prevPosition:this.pointers[0].position,e=this.movedState[this.pointers[1].id]?this.pointers[1].prevPosition:this.pointers[1].position;return (t.y+e.y)/2}},{key:"movementCenterX",get:function(){return this.centerX-this.prevCenterX}},{key:"movementCenterY",get:function(){return this.centerY-this.prevCenterY}},{key:"setRecongizedStateObject",value:function(t){return this.recongizedState=t,this}},{key:"state",get:function(){return this.recongizedState.state},set:function(t){this.recongizedState.state=t;}},{key:"cancel",value:function(){return this.state=Cy,this}}]),t}();Object.assign(gy.prototype,Xo);var yy={},ky=0,my=1,by=2,Cy="IDLE";Phaser.Utils.Objects.GetValue;var xy=Phaser.Math.RotateAround,wy=function(t,e,i,n){return xy(t,e,i,n),t.rotation+=n,t},Sy={},Oy=Phaser.Utils.Objects.GetValue,Py=Phaser.Math.Angle.WrapDegrees,Ty=Phaser.Math.Angle.ShortestBetween,My=Phaser.Math.RadToDeg,Ey=Phaser.Math.DegToRad,_y=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=u(r=e.call(this,t,s)),a={states:{IDLE:{enter:function(){o.prevAngle=void 0,o.angle=0;}},BEGIN:{},RECOGNIZED:{enter:function(){o.emit("rotatestart",o);},exit:function(){o.emit("rotateend",o);}}},init:function(){this.state=Ry;},eventEmitter:!1};return r.setRecongizedStateObject(new _v(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Oy(t,"threshold",0)),this}},{key:"onDrag2Start",value:function(){this.prevAngle=Py(My(this.angleBetween)),this.state=By,0===this.dragThreshold&&(this.state=jy);}},{key:"onDrag2End",value:function(){this.state=Ry;}},{key:"onDrag2",value:function(){switch(this.state){case By:if(this.pointers[0].getDistance()>=this.dragThreshold&&this.pointers[1].getDistance()>=this.dragThreshold){var t=Py(My(this.angleBetween));this.angle=Ty(this.prevAngle,t),this.prevAngle=t,this.state=jy;}break;case jy:t=Py(My(this.angleBetween));this.angle=Ty(this.prevAngle,t),this.prevAngle=t,this.emit("rotate",this);}}},{key:"isRotated",get:function(){return this.state===jy}},{key:"rotation",get:function(){return Ey(this.angle)}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(gy),Ly={spinObject:function(t,e){if(!this.isRotation)return this;void 0===e&&(e=this.pointers[0].camera);var i=this.movementCenterX,n=this.movementCenterY,s=function(t,e,i,n){return void 0===n?n={}:!0===n&&(n=Sy),i.getWorldPoint(t,e,n),n}(this.centerX,this.centerY,e,!0),r=s.x,o=s.y,a=this.rotation;if(Array.isArray(t))for(var h=t,l=0,u=h.length;l0?f.pop().setTexture(v,B):s(p,v,B),c&&p.add.existing(R),d){var j=w+P*L-M*(L-1)+o*P,D=S+T*_-E*(_-1)+a*T;R.setOrigin(o,a).setPosition(j,D).setScale(m,b).setRotation(C),im(R,w,S,C);}O.push(R);}return O}(t,e,i,n),o=0,a=r.length;on&&(i.width=i.height*n),i}(t,{width:this.width,height:this.height},!0);return t.setDisplaySize(e.width,e.height),this.resetChildScaleState(t),this}},{key:"resize",value:function(t,e){return p(h(i.prototype),"resize",this).call(this,t,e),this.scaleImage(),this}},{key:"setTexture",value:function(t,e){var i=this.image;return i.setTexture(t,e),null!==t?(this.setChildVisible(i,!0),this.scaleImage()):this.setChildVisible(i,!1),this}}]),i}(ie);Object.assign(ym.prototype,sm);var km=function(t,e){if(this.scene.sys.scale.autoRound&&(t=Math.floor(t),e=Math.floor(e)),this.width===t&&this.height===e)return this;var i=this.node.style;return i.width="".concat(t,"px"),i.height="".concat(e,"px"),this.updateSize(),this},mm={id:["id",void 0],text:["value",void 0],maxLength:["maxLength",void 0],minLength:["minLength",void 0],placeholder:["placeholder",void 0],tooltip:["title",void 0],readOnly:["readOnly",!1],spellCheck:["spellcheck",!1],autoComplete:["autocomplete","off"]},bm={align:["textAlign",void 0],paddingLeft:["padding-left",void 0],paddingRight:["padding-right",void 0],paddingTop:["padding-top",void 0],paddingBottom:["padding-bottom",void 0],fontFamily:["fontFamily",void 0],fontSize:["font-size",void 0],color:["color","#ffffff"],backgroundColor:["backgroundColor","transparent"],border:["border",0],borderColor:["borderColor","transparent"],outline:["outline","none"],direction:["direction",void 0]},Cm={input:"textchange",click:"click",dblclick:"dblclick",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",keydown:"keydown",keyup:"keyup",keypress:"keypress",compositionstart:"compositionStart",compositionend:"compositionEnd",compositionupdate:"compositionUpdate",focus:"focus",blur:"blur",select:"select"},xm=Phaser.Utils.Objects.GetValue,wm=function(t,e,i,n){var s=xm(n,"preventDefault",!1),r=xm(n,"preTest"),o=function(n){e.addEventListener(n,(function(e){r&&!r(t,n)||t.emit(i[n],t,e),s&&e.preventDefault();}));};for(var a in i)o(a);},Sm=Phaser.GameObjects.DOMElement,Om=Phaser.Utils.Objects.IsPlainObject,Pm=Phaser.Utils.Objects.GetValue,Tm=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l,c;n(this,i),Om(s)?(s=Pm(h=s,"x",0),r=Pm(h,"y",0),o=Pm(h,"width",0),a=Pm(h,"height",0)):Om(o)&&(o=Pm(h=o,"width",0),a=Pm(h,"height",0)),void 0===h&&(h={});var d=Pm(h,"inputType",void 0);void 0===d&&(d=Pm(h,"type","text")),"textarea"===d?(c=document.createElement("textarea")).style.resize="none":(c=document.createElement("input")).type=d,Fu(mm,h,c);var f=Pm(h,"style",void 0);f=Fu(bm,h,f);var p=c.style;for(var v in h)v in mm||v in bm||v in p&&(f[v]=h[v]);return f["box-sizing"]="border-box",(l=e.call(this,t,s,r,c,f)).type="rexInputText",l.resize(o,a),wm(u(l),c,Cm),Yu(c),Pm(h,"selectAll",!1)&&l.selectAll(),l._isFocused=!1,l.on("focus",(function(){this._isFocused=!0;}),u(l)).on("blur",(function(){this._isFocused=!1;}),u(l)),l}return r(i,[{key:"inputType",get:function(){return "textarea"===this.node.tagName.toLowerCase()?"textarea":this.node.type}},{key:"text",get:function(){return this.node.value},set:function(t){this.node.value=t;}},{key:"setText",value:function(t){return this.text=t,this}},{key:"maxLength",get:function(){return this.node.maxLength},set:function(t){this.node.maxLength=t;}},{key:"setMaxLength",value:function(t){return this.maxLength=t,this}},{key:"minLength",get:function(){return this.node.minLength},set:function(t){this.node.minLength=t;}},{key:"setMinLength",value:function(t){return this.minLength=t,this}},{key:"placeholder",get:function(){return this.node.placeholder},set:function(t){this.node.placeholder=t;}},{key:"setPlaceholder",value:function(t){return this.placeholder=t,this}},{key:"selectText",value:function(t,e){return void 0===t?this.node.select():this.node.setSelectionRange(t,e),this}},{key:"selectAll",value:function(){return this.selectText(),this}},{key:"selectionStart",get:function(){return this.node.selectionStart}},{key:"selectionEnd",get:function(){return this.node.selectionEnd}},{key:"selectedText",get:function(){var t=this.node;return t.value.substring(t.selectionStart,t.selectionEnd)}},{key:"cursorPosition",get:function(){return this.node.selectionStart},set:function(t){this.node.setSelectionRange(t,t);}},{key:"setCursorPosition",value:function(t){return void 0===t?t=this.text.length:t<0&&(t=this.text.length+t),this.cursorPosition=t,this}},{key:"tooltip",get:function(){return this.node.title},set:function(t){this.node.title=t;}},{key:"setTooltip",value:function(t){return this.tooltip=t,this}},{key:"setTextChangedCallback",value:function(t){return this.onTextChanged=t,this}},{key:"readOnly",get:function(){return this.node.readOnly},set:function(t){this.node.readOnly=t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}},{key:"spellCheck",get:function(){return this.node.spellcheck},set:function(t){this.node.spellcheck=t;}},{key:"setSpellCheck",value:function(t){return this.spellCheck=t,this}},{key:"fontColor",get:function(){return this.node.style.color},set:function(t){this.node.style.color=t;}},{key:"setFontColor",value:function(t){return this.fontColor=t,this}},{key:"setStyle",value:function(t,e){return this.node.style[t]=e,this}},{key:"getStyle",value:function(t){return this.node.style[t]}},{key:"scrollToBottom",value:function(){return this.node.scrollTop=this.node.scrollHeight,this}},{key:"setEnabled",value:function(t){return void 0===t&&(t=!0),this.node.disabled=!t,this}},{key:"setBlur",value:function(){return this.node.blur(),this}},{key:"setFocus",value:function(){return this.node.focus(),this}},{key:"isFocused",get:function(){return this._isFocused}}]),i}(Sm),Mm={resize:km};Object.assign(Tm.prototype,Mm),Phaser.Utils.Objects.GetValue;var Em=function(t){var e=t.game,i=t.fileInput,n=t.closeDelay;return Xl(Je(e).events,"focus").then((function(){return void 0===(t=n)&&(t=0),new Promise((function(i,n){setTimeout((function(){i(e);}),t);}));var t,e;})).then((function(){var t={files:i.files};return Promise.resolve(t)}))};Phaser.Utils.Objects.GetValue;var _m=function(t){return this.setOrigin(t.originX,t.originY),this.setPosition(t.x,t.y),this.resize(t.displayWidth,t.displayHeight),this},Lm=function(t,e,i,n,s,r){if(null===s||!1===s);else if(we(s))s();else {var o=function(t,e,i){if(void 0===i)switch(e){case"image":case"svg":i="textures";break;case"animation":i="json";break;case"tilemapTiledJSON":case"tilemapCSV":i="tilemap";break;case"glsl":i="shader";break;default:i=e;}return t=Je(t),"textures"===i?t.textures:t.cache[i]}(t,i,s);o.exists(n)&&o.remove(n);}var a=t.load;if(r&&a.once("filecomplete-".concat(i,"-").concat(n),(function(t,e,i){r(i);})),we(e))e();else {var h=window.URL.createObjectURL(e);a[i](n,h);}a.start();},Rm={loadFile:function(t,e,i,n,s){var r=this.scene;return Lm(r,t,e,i,n,s),this},loadFilePromise:function(t,e,i,n){var s=this.scene;return new Promise((function(r,o){Lm(s,t,e,i,n,(function(t){r(t);}));}))}},Bm=Phaser.GameObjects.DOMElement,jm=Phaser.Utils.Objects.IsPlainObject,Dm=Phaser.Utils.Objects.GetValue,Am=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),jm(s)?(s=Dm(h=s,"x",0),r=Dm(h,"y",0),o=Dm(h,"width",0),a=Dm(h,"height",0)):jm(o)&&(o=Dm(h=o,"width",0),a=Dm(h,"height",0));var c=document.createElement("input");c.type="file",c.style.display="none";var d=document.createElement("label");d.appendChild(c);var f=Dm(h,"style",void 0);(l=e.call(this,t,s,r,d,f)).type="rexFileChooser",l.resetFromJSON(h),l.resize(o,a);var p=u(l);return c.onchange=function(){p.emit("change",p);},l.setCloseDelay(Dm(h,"closeDelay",200)),c.onclick=function(){Em({game:t,fileInput:c,closeDelay:p.closeDelay}).then((function(){p.emit("select",p);}));},l}return r(i,[{key:"resetFromJSON",value:function(t){return this.setAccept(Dm(t,"accept","")),this.setMultiple(Dm(t,"multiple",!1)),this}},{key:"setAccept",value:function(t){return void 0===t&&(t=""),this.fileInput.setAttribute("accept",t),this}},{key:"setMultiple",value:function(t){return void 0===t&&(t=!0),t?this.fileInput.setAttribute("multiple",""):this.fileInput.removeAttribute("multiple"),this}},{key:"setCloseDelay",value:function(t){return void 0===t&&(t=200),this.closeDelay=t,this}},{key:"fileInput",get:function(){return this.node.children[0]}},{key:"open",value:function(){return this.fileInput.click(),this}},{key:"files",get:function(){return this.fileInput.files}}]),i}(Bm),Im={resize:km,syncTo:_m};Object.assign(Am.prototype,Im,Rm);var zm={setDropEnable:function(t){return void 0===t&&(t=!0),this.dropEnable=t,this},toggleDropEnable:function(){return this.dropEnable=!this.dropEnable,this}},Fm={resize:km,syncTo:_m};Object.assign(Fm,zm,{addFilter:function(t,e){return this.filters||(this.filters={}),this.filters[t]=e,this},addFilters:function(t){for(var e in this.filters||(this.filters={}),t)this.filters[e]=t[e];return this}},Rm);var Ym={dragenter:"dragenter",dragleave:"dragleave",dragover:"dragover",drop:"drop"},Wm=Phaser.GameObjects.DOMElement,Vm=Phaser.Utils.Objects.IsPlainObject,Xm=Phaser.Utils.Objects.GetValue,Gm=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),Vm(s)?(s=Xm(h=s,"x",0),r=Xm(h,"y",0),o=Xm(h,"width",0),a=Xm(h,"height",0)):Vm(o)&&(o=Xm(h=o,"width",0),a=Xm(h,"height",0)),void 0===h&&(h={});var c=document.createElement("div"),d=Xm(h,"style",void 0);(l=e.call(this,t,s,r,c,d)).type="rexFileDropZone",l.resize(o,a),l._files=[],l.setDropEnable(Xm(h,"dropEnable",!0));var f=Xm(h,"filters");return f&&l.addFilters(f),wm(u(l),c,Ym,{preventDefault:!0,preTest:function(t){return t.dropEnable}}),l.on("drop",(function(t,e){this._files=e.dataTransfer.files;var i=this._files;if(i&&this.filters)for(var n in this.filters){for(var s=this.filters[n],r=[],o=0,a=i.length;o0&&this.emit("drop.".concat(n),r);}}),u(l)),l}return r(i,[{key:"files",get:function(){return this._files}}]),i}(Wm);Object.assign(Gm.prototype,Fm);var Hm=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),c(r=e.call(this,t),new Proxy(u(r),u(r)))}return r(i,[{key:"get",value:function(t,e){if(Ko(t,e))return t[e];var i=t.parent;return Ko(i,e)?i[e]:void 0}},{key:"set",value:function(t,e,i){return Ko(t,e)?t[e]=i:Ko(t.parent,e)&&(t.parent[e]=i),!0}},{key:"key",get:function(){return this.parent.texture.key},set:function(t){this.parent.setTexture(t,this.frame);}},{key:"frame",get:function(){return this.parent.frame.name},set:function(t){this.parent.setFrame(t);}},{key:"scale",get:function(){return this.parent.scaleX},set:function(t){this.parent.setScale(t);}}]),i}(Ta),Um=Phaser.Utils.Objects.GetValue,Nm=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),(r=e.call(this,t,s)).style=Um(s,"style",u(r));var o=Um(s,"propertiesMap");return r.activeStyle=Km(s,"active",o),r.hoverStyle=Km(s,"hover",o),r.disableStyle=Km(s,"disable",o),r.onModifyStyle=Um(s,"onModifyStyle"),r}return r(i,[{key:"getStyle",value:function(t){return ic(this.style,t)}},{key:"modifyStyle",value:function(t){for(var e in t)this.style[e]=t[e];return this.onModifyStyle&&this.onModifyStyle(this.parent,t),this}},{key:"applyStyle",value:function(t){if(t){var e=this.getStyle(t);return nc(e,t)?void 0:(this.modifyStyle(t),e)}}},{key:"setActiveState",value:function(t){return Jm.call(this,"active",t),this}},{key:"setHoverState",value:function(t){return Jm.call(this,"hover",t),this}},{key:"setDisableState",value:function(t){return Jm.call(this,"disable",t),this}}]),i}(Ta),Km=function(t,e,i){var n=ec(t,e);if(i)for(var s in n)i.hasOwnProperty(s)&&(n[i[s]]=n[s],delete n[s]);return n},Jm=function(t,e){void 0===e&&(e=!0);var i="".concat(t,"State"),n="".concat(t,"Style"),s="".concat(t,"StyleSave");this[i]!==e&&(this[i]=e,e?this[s]=this.applyStyle(this[n]):(this.applyStyle(this[s]),this[s]=void 0));},Zm={addStyleManager:function(t){return this.styleManager=new Nm(this,t),this},setActiveState:function(t){return this.styleManager.setActiveState(t),this},setHoverState:function(t){return this.styleManager.setHoverState(t),this},setDisableState:function(t){return this.styleManager.setDisableState(t),this}},qm=Phaser.GameObjects.Image,$m=Phaser.Utils.Objects.GetValue,Qm=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=$m(s,"x",0),a=$m(s,"y",0),h=$m(s,"key",""),l=$m(s,"frame",void 0);(r=e.call(this,t,o,a,h,l)).type="rexStatesImage";var c=$m(s,"effects",!0);return c&&Qo(u(r),c),r.style=new Hm(u(r),s),s.style=r.style,r.addStyleManager(s),delete s.style,r}return r(i)}(qm);Object.assign(Qm.prototype,Zm);var tb=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),c(r=e.call(this,t),new Proxy(u(r),u(r)))}return r(i,[{key:"get",value:function(t,e){if(Ko(t,e))return t[e];var i=t.parent;return Ko(i,e)?i[e]:void 0}},{key:"set",value:function(t,e,i){return Ko(t,e)?t[e]=i:Ko(t.parent,e)&&(t.parent[e]=i),!0}},{key:"key",get:function(){return this.parent.texture.key},set:function(t){this.parent.setTexture(t,this.frame);}},{key:"frame",get:function(){return this.parent.frame.name},set:function(t){this.parent.setFrame(t);}},{key:"leftWidth",get:function(){return this.parent.leftWidth},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,t,e.rightWidth,e.topHeight,e.bottomHeight);}},{key:"rightWidth",get:function(){return this.parent.rightWidth},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,t,e.topHeight,e.bottomHeight);}},{key:"topHeight",get:function(){return this.parent.topHeight},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,e.rightWidth,t,e.bottomHeight);}},{key:"bottomHeight",get:function(){return this.parent.bottomHeight},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,e.rightWidth,e.topHeight,t);}}]),i}(Ta),eb=Phaser.GameObjects.NineSlice,ib=Phaser.Utils.Objects.GetValue,nb=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=ib(s,"x",0),a=ib(s,"y",0),h=ib(s,"key",null),l=ib(s,"frame",null),c=ib(s,"width",0),d=ib(s,"height",0),f=ib(s,"leftWidth",0),p=ib(s,"rightWidth",0),v=ib(s,"topHeight",0),g=ib(s,"bottomHeight",0);(r=e.call(this,t,o,a,h,l,c,d,f,p,v,g)).type="rexStatesNineSlice";var y=ib(s,"effects",!0);return y&&Qo(u(r),y),r.style=new tb(u(r),s),s.style=r.style,r.addStyleManager(s),delete s.style,r}return r(i)}(eb);Object.assign(nb.prototype,Zm);var sb=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),void 0===s&&(s={}),(r=e.call(this,t,s)).type="rexStatesRoundRectangleShape",s.style=u(r),s.propertiesMap=rb,r.addStyleManager(s),delete s.style,delete s.propertiesMap,r}return r(i)}(on),rb={color:"fillColor",alpha:"fillAlpha",strokeWidth:"lineWidth"};Object.assign(sb.prototype,Zm);var ob=Phaser.GameObjects.Text,ab=Phaser.Utils.Objects.GetValue,hb=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=ab(s,"x",0),a=ab(s,"y",0),h=ab(s,"text","");return (r=e.call(this,t,o,a,h,s)).type="rexStatesText",s.style=r.style,s.onModifyStyle=function(t,e){var i=e.hasOwnProperty("fontStyle")||e.hasOwnProperty("fontSize")||e.hasOwnProperty("fontFamily");t.style.update(i);},r.addStyleManager(s),delete s.style,r}return r(i)}(ob);Object.assign(hb.prototype,Zm);var lb=function(t,e){void 0===e&&(e={}),void 0===e.options&&(e.options={});var i=e.options;i.responsive=!1,i.maintainAspectRatio=!1,i.hasOwnProperty("devicePixelRatio")||(i.devicePixelRatio=1);var n=!1;void 0===i.animation?i.animation={}:!1===i.animation&&(n=!0,i.animation={});var s=i.animation;n&&(s.duration=0);var r=s.onProgress;s.onProgress=function(e){r&&r(e),t.needRedraw();};var o=s.onComplete;return s.onComplete=function(e){o&&o(e),t.needRedraw();},e},ub=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;return n(this,i),(l=e.call(this,t,s,r,o,a)).type="rexChart",l.chart=void 0,void 0!==h&&l.setChart(h),l}return r(i,[{key:"destroy",value:function(t){this.scene&&(this.chart&&(this.chart.destroy(),this.chart=void 0),p(h(i.prototype),"destroy",this).call(this,t));}},{key:"resize",value:function(t,e){if(t===this.width&&e===this.height)return this;if(p(h(i.prototype),"resize",this).call(this,t,e),this.chart){var n=this.chart;n.height=this.canvas.height,n.width=this.canvas.width,n.aspectRatio=n.height?n.width/n.height:null,n.update();}return this}}]),i}(Xd),cb={setChart:function(t){if(!window.Chart){return console.error("Can not find chartjs! Load chartjs in preload stage.\nscene.load.script('chartjs', 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.8.0/Chart.min.js');"),this}return this.chart&&this.chart.destroy(),this.chart=new Chart(this.context,lb(this,t)),this},getChartDataset:function(t){if(void 0!==this.chart){if("string"!=typeof t)return this.chart.data.datasets[t];for(var e,i=this.chart.data.datasets,n=0,s=i.length;n(h=0===this.orientation?Math.abs(a.left-t):Math.abs(a.top-e))&&(s=h,n=r);}var h;a=i[i.length-1];return s>(h=0===this.orientation?Math.abs(a.right-t):Math.abs(a.bottom-e))&&(s=h,n=r+1),n},vb=Phaser.Utils.Objects.IsPlainObject,gb=Phaser.Utils.Objects.GetValue,yb=Phaser.Display.Align.CENTER,kb={min:0,full:-1},mb=function(t,e,n,s,r,o,a,h,l,u){dp.call(this,t);var c=t.isRexSpace,d=i(e);if(null===e)return this;if("number"===d);else if("string"===d)e=kb[e];else if(vb(e)){var f;e=gb(f=e,"proportion",void 0),n=gb(f,"align",yb),s=gb(f,"padding",0),r=gb(f,"expand",!1),o=gb(f,"key",void 0),a=gb(f,"index",void 0),t.isRexSizer||(h=gb(f,"minWidth",void 0),l=gb(f,"minHeight",void 0)),u=gb(f,"fitRatio",0);}return "string"==typeof n&&(n=jf[n]),void 0===e&&(e=c?1:0),void 0===n&&(n=yb),void 0===s&&(s=0),void 0===r&&(r=!1),void 0===h&&(c?h=0:t.isRexSizer||(h=t._minWidth)),void 0===l&&(c?l=0:t.isRexSizer||(l=t._minHeight)),void 0===u&&(u=0),(f=this.getSizerConfig(t)).proportion=e,f.align=n,f.padding=up(s),f.expand=r,f.fitRatio=0===e?u:0,void 0===a||a>=this.sizerChildren.length?this.sizerChildren.push(t):this.sizerChildren.splice(a,0,t),t.isRexSizer||(e>0&&(0===this.orientation?t.minWidth=void 0===h?Ot(t):h:t.minHeight=void 0===l?Pt(t):l),r&&(0===this.orientation?t.minHeight=l:t.minWidth=h)),void 0!==o&&this.addChildrenMap(o,t),this},bb={add:mb,addSpace:function(t){return this.insertSpace(void 0,t),this},insertSpace:function(t,e){return void 0===e&&(e=1),mb.call(this,new fb(this.scene),{proportion:e,minWidth:0,minHeight:0,index:t}),this},insert:function(t,e,i,n,s,r,o,a){return vb(i)&&(i.index=t),mb.call(this,e,i,n,s,r,o,t,a),this},insertAtPosition:function(t,e,i,n,s,r,o,a,h){var l=pb.call(this,t,e);return -1===l&&(l=void 0),this.insert(l,i,n,s,r,o,a,h),this}},Cb=Phaser.Utils.Array.Remove,xb={remove:function(t,e){return this.getParentSizer(t)!==this||(Cb(this.sizerChildren,t),mp.call(this,t,e)),this},removeAll:function(t){for(var e=this.sizerChildren.length-1;e>=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,Qy.call(this,t),this}},wb={getChildAlign:function(t){return this.getSizerConfig(t).align},setChildAlign:function(t,e){return "string"==typeof e&&(e=jf[e]),this.getSizerConfig(t).align=e,this}},Sb={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);var e,i,n,s=0,r=this.sizerChildren;if(0===this.orientation)for(var o=this.space.item,a=!0,h=0,l=r.length;h0&&this.proportionLength>0&&(i=n.proportion*this.proportionLength):n.expand&&(i=e-this.space.left-this.space.right-s.left-s.right);return i},getExpandedChildHeight:function(t,e){var i;void 0===e&&(e=this.height);var n=t.rexSizer,s=n.padding;0===this.orientation?n.expand&&(i=e-this.space.top-this.space.bottom-s.top-s.bottom):n.proportion>0&&this.proportionLength>0&&(i=n.proportion*this.proportionLength);return i},getChildrenSizers:function(t){void 0===t&&(t=[]);for(var e,i=this.sizerChildren,n=0,s=i.length;n0?(e=t-this.getChildrenWidth(!1),this.proportionLength=e/this.childrenProportion):this.proportionLength=0;}return t},resolveHeight:function(t){t=Op.call(this,t);if(void 0===this.proportionLength&&1===this.orientation){var e=t-this.childrenHeight;e>0?(e=t-this.getChildrenHeight(!1),this.proportionLength=e/this.childrenProportion):this.proportionLength=0;}return t}};Object.assign(Sb,bb,xb,wb,{getChildProportion:function(t){return this.getSizerConfig(t).proportion},setChildProportion:function(t,e){return this.getSizerConfig(t).proportion=e,this}},{getChildExpand:function(t){return this.getSizerConfig(t).expand},setChildExpand:function(t,e){return this.getSizerConfig(t).expand=e,this}});var Ob=function(){for(var t,e,i=0,n=this.sizerChildren,s=0,r=n.length;s0&&(i+=e);return i},Pb={x:0,h:0,horizontal:0,"left-to-right":0,y:1,v:1,vertical:1,"top-to-bottom":1},Tb=function(t){return "string"==typeof t&&(t=Pb[t]),t},Mb=Phaser.Utils.Objects.IsPlainObject,Eb=Phaser.Utils.Objects.GetValue,_b=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;return n(this,i),Mb(s)?(s=Eb(l=s,"x",0),r=Eb(l,"y",0),o=Eb(l,"width",void 0),a=Eb(l,"height",void 0),h=Eb(l,"orientation",0)):Mb(o)?(o=Eb(l=o,"width",void 0),a=Eb(l,"height",void 0),h=Eb(l,"orientation",0)):Mb(h)&&(h=Eb(l=h,"orientation",0)),void 0===h&&(h=0),(u=e.call(this,t,s,r,o,a,l)).type="rexSizer",u.sizerChildren=[],u.setOrientation(h),u.setItemSpacing(Eb(l,"space.item",0)),u.setStartChildIndex(Eb(l,"startChildIndex",0)),u.setRTL(Eb(l,"rtl",!1)),u.addChildrenMap("items",u.sizerChildren),u}return r(i,[{key:"setOrientation",value:function(t){return this.orientation=Tb(t),this}},{key:"setItemSpacing",value:function(t){return this.space.item=t,this}},{key:"setStartChildIndex",value:function(t){return this.startChildIndex=t,this}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},{key:"childrenProportion",get:function(){return void 0===this._childrenProportion&&(this._childrenProportion=Ob.call(this)),this._childrenProportion}}]),i}(Hy);Object.assign(_b.prototype,Sb);var Lb=function(){return Array.prototype.reduce.call(arguments,Rb,0)},Rb=function(t,e){return t+e},Bb=Phaser.Utils.Objects.IsPlainObject,jb=Phaser.Utils.Objects.GetValue,Db=Phaser.Display.Align.CENTER,Ab=function(t,e,i,n,s){if("number"==typeof t||"number"==typeof e)if(void 0===t){for(var r=0;r=0;e--){var i=this.sizerChildren[e];i&&this.remove(i,t);}return this},clear:function(t){return zb(this.sizerChildren,null),Qy.call(this,t),this}},Yb={setColumnSpace:function(t){if(this.space.column||(this.space.column=[]),this.space.column.length=this.columnCount-1,"number"==typeof t)zb(this.space.column,t);else for(var e=0,i=this.columnCount-1;e=0;n--){var s=n*this.columnCount+t;this.sizerChildren.splice(s,0,null);}return this.columnProportions.push(e),this.columnWidth.length+=1,this.space.column.splice(t,0,i),this},Gb={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);for(var e,i,n,s,r=0,o=this.sizerChildren,a=0;a0){var i=t-this.getChildrenWidth(!1);i>=0&&(this.proportionWidthLength=i/e);}else this.proportionWidthLength=0;}return t},resolveHeight:function(t){t=Op.call(this,t);if(void 0===this.proportionHeightLength){var e=this.totalRowProportions;if(e>0){var i=t-this.getChildrenHeight(!1);i>=0&&(this.proportionHeightLength=i/e);}else this.proportionHeightLength=0;}return t},resolveChildrenWidth:function(t){var e,i,n;for(var s in this.sizerChildren)(e=this.sizerChildren[s])&&e.isRexSizer&&!e.ignoreLayout&&(n=this.getColumnWidth(parseInt(s)%this.columnCount),i=this.getExpandedChildWidth(e,n),i=e.resolveWidth(i),e.resolveChildrenWidth(i));},runWidthWrap:function(t){var e,i,n;for(var s in this.sizerChildren)!(e=this.sizerChildren[s])||e.isRexSizer&&e.ignoreLayout||!e.runWidthWrap||(n=this.getColumnWidth(parseInt(s)%this.columnCount),i=this.getExpandedChildWidth(e,n),e.isRexSizer&&(i=e.resolveWidth(i)),e.runWidthWrap(i));return this},resetGrid:function(t,e,i,n,s){if(void 0===i&&(i=0),void 0===n&&(n=0),this.columnCount=t,this.rowCount=e,this.gridCount=t*e,this.removeAll(),this.sizerChildren.length=t*e,zb(this.sizerChildren,null),this.columnProportions=[],this.columnProportions.length=t,"number"==typeof i)zb(this.columnProportions,i);else for(var r=0;r0&&(e+=t);return e},Ub=function(){for(var t,e=0,i=0;i0&&(e+=t);return e},Nb=Phaser.Utils.Objects.IsPlainObject,Kb=Phaser.Utils.Objects.GetValue,Jb=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l,u,c,d){var f;return n(this,i),Nb(s)?(s=Kb(d=s,"x",0),r=Kb(d,"y",0),o=Kb(d,"width",void 0),a=Kb(d,"height",void 0),h=Kb(d,"column",d.col||0),l=Kb(d,"row",0),u=Kb(d,"columnProportions",0),c=Kb(d,"rowProportions",0)):Nb(o)?(o=Kb(d=o,"width",void 0),a=Kb(d,"height",void 0),h=Kb(d,"column",d.col||0),l=Kb(d,"row",0),u=Kb(d,"columnProportions",0),c=Kb(d,"rowProportions",0)):Nb(h)?(h=Kb(d=h,"column",d.col||0),l=Kb(d,"row",0),u=Kb(d,"columnProportions",0),c=Kb(d,"rowProportions",0)):Nb(u)&&(u=Kb(d=u,"columnProportions",0),c=Kb(d,"rowProportions",0)),(f=e.call(this,t,s,r,o,a,d)).type="rexGridSizer",f.sizerChildren=[],f.addChildrenMap("items",f.sizerChildren),f.setCreateCellContainerCallback(Kb(d,"createCellContainerCallback")),f.setIndentLeft(Kb(d,"space.indentLeftOdd",0),Kb(d,"space.indentLeftEven",0)),f.setIndentTop(Kb(d,"space.indentTopOdd",0),Kb(d,"space.indentTopEven",0)),f.resetGrid(h,l,u,c,Kb(d,"space",void 0)),f}return r(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(p(h(i.prototype),"destroy",this).call(this,t),this.columnProportions=void 0,this.rowProportions=void 0,this.columnWidth=void 0,this.rowHeight=void 0,this.createCellContainerCallback=void 0);}},{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(){return void 0===this._totalColumnProportions&&(this._totalColumnProportions=Hb.call(this)),this._totalColumnProportions}},{key:"totalRowProportions",get:function(){return void 0===this._totalRowProportions&&(this._totalRowProportions=Ub.call(this)),this._totalRowProportions}},{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)}},{key:"getColumnWidth",value:function(t){var e=this.columnProportions[t];return 0===e?this.columnWidth[t]:e*this.proportionWidthLength}},{key:"getRowHeight",value:function(t){var e=this.rowProportions[t];return 0===e?this.rowHeight[t]:e*this.proportionHeightLength}},{key:"setCreateCellContainerCallback",value:function(t){return this.createCellContainerCallback=t,this}}]),i}(Hy);Object.assign(Jb.prototype,Gb);var Zb=function(t,e,i,n){return e/t<=i?e/(n-1):0},qb=function(t,e){void 0===e?e={lines:[],width:0,height:0}:(e.lines.length=0,e.width=0,e.height=0);for(var i,n,s,r,o=this.sizerChildren,a=this.space.item,h=this.space.line,l=this.space.indentLeftOdd,u=this.space.indentLeftEven,c=this.space.indentTopOdd,d=this.space.indentTopEven,f=0,p=e.lines,v=void 0,g=0,y=o.length;ga.height/2)){s>(h=tC(a.left,a.centerY,t,e))&&(s=h,n=r);var h,l=i[r+1];if(!l||l.y!==a.y)s>(h=tC(a.right,a.centerY,t,e))&&(s=h,n=r+1);}}return n},iC=Phaser.Utils.Objects.IsPlainObject,nC=Phaser.Utils.Objects.GetValue,sC=Phaser.Display.Align.CENTER,rC=function(t,e,i,n){if("\n"===t)return this.addNewLine(),this;var s;(dp.call(this,t),iC(e))&&(e=nC(s=e,"padding",0),i=nC(s,"key",void 0),n=nC(s,"index",void 0));return void 0===e&&(e=0),(s=this.getSizerConfig(t)).align=sC,s.padding=up(e),void 0===n||n>=this.sizerChildren.length?this.sizerChildren.push(t):this.sizerChildren.splice(n,0,t),void 0!==i&&this.addChildrenMap(i,t),this},oC={add:function(t,e,i){if(ng(t))for(var n=t,s=0,r=n.length;s=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,Qy.call(this,t),this}},lC={getChildrenWidth:function(){return this.rexSizer.hidden?0:this.maxChildWidth+this.space.left+this.space.right},getChildrenHeight:function(){return this.rexSizer.hidden?0:this.widthWrapResult.height+this.space.top+this.space.bottom},getChildrenSizers:function(t){void 0===t&&(t=[]);for(var e,i=this.sizerChildren,n=0,s=i.length;n=0;i--)JC.call(this,e[i],t);return this}},qC=function(t,e,i){if(t){var n=this.setValueCallback,s=this.setValueCallbackScope;n&&(s?n.call(s,t,e,i):n(t,e,i)),this.fireEvent("button.statechange",t,e,i);}},$C=function(t){var e=this;t._selected=void 0,Object.defineProperty(t,"selected",{get:function(){return t._selected},set:function(i){if(t._selected!==i){var n=t._selected;t._selected=i,qC.call(e,t,i,n);}},enumerable:!0,configurable:!0}),t.selected=!1;},QC={add:function(t){return this.buttons.push(t),t._click||(t._click=new Sd(t,this.clickConfig),t._click.on("click",(function(t,e,i,n){this.fireEvent("button.click",e,i,n);}),this).on("enable",(function(t,e){this.fireEvent("button.enable",e);}),this).on("disable",(function(t,e){this.fireEvent("button.disable",e);}),this),t.on("pointerover",(function(e,i,n,s){this.fireEvent("button.over",t,e,s);}),this).on("pointerout",(function(e,i){this.fireEvent("button.out",t,e,i);}),this).on("pointerdown",(function(e,i,n,s){this.fireEvent("button.down",t,e,s);}),this).on("pointerup",(function(e,i){this.fireEvent("button.up",t,e,i);}),this)),this.buttonsType&&(void 0===t.name&&console.error("".concat(this.parent.constructor.name,": Option button miss value")),$C.call(this,t)),this},addMultiple:function(t){for(var e=0,i=t.length;e2?o-2:0),h=2;h=0;i--)vx.call(this,e[i],t);return this}},yx=Phaser.Utils.Objects.GetValue,kx=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=yx(s,"row",0),a=yx(s,"column",s.col||0),h=yx(s,"createCellContainerCallback"),l=yx(s,"buttons",void 0),c=yx(s,"expand",!0),d=c?1:0;if(h&&(s.createCellContainerCallback=void 0),void 0!==l){o=Math.max(o,l.length);for(var f=0,p=l.length;fs&&mx.addNewLine(this);}else for(r=0,o=t.length;r=0;i--)Sx.call(this,e[i],t);return this}},Px=Phaser.Utils.Objects.GetValue,Tx=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=s.space;"number"==typeof o&&(s.space={item:o,line:o}),(r=e.call(this,t,s)).type="rexFixWidthButtons",r.buttonGroup=new ox({parent:u(r),eventEmitter:Px(s,"eventEmitter",u(r)),groupName:Px(s,"groupName",void 0),clickConfig:Px(s,"click",void 0)}).setButtonsType(s);var a=Px(s,"background",void 0),h=Px(s,"buttons",void 0);return r.buttonsAlign=Px(s,"align",void 0),a&&r.addBackground(a),h&&r.addButtons(h),r.addChildrenMap("background",a),r.addChildrenMap("buttons",r.buttonGroup.buttons),r}return r(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(p(h(i.prototype),"destroy",this).call(this,t),this.buttonGroup.destroy(),this.buttonGroup=void 0);}},{key:"buttons",get:function(){return this.buttonGroup.buttons}},{key:"groupName",get:function(){return this.buttonGroup.groupName},set:function(t){this.buttonGroup.groupName=t;}},{key:"eventEmitter",get:function(){return this.buttonGroup.eventEmitter}}]),i}(pC);Object.assign(Tx.prototype,Cx,Ox,rx,hx);var Mx=Phaser.Utils.Objects.GetValue,Ex=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),(r=e.call(this,t,s)).type="rexFileSelectorButton";var o=new Am(t);return t.add.existing(o),r.addBackground(o),r.addChildrenMap("fileChooser",o),r.setAccept(Mx(s,"accept","")),r.setMultiple(Mx(s,"multiple",!1)),o.on("change",(function(t){var e=t.files;0!==e.length&&(e=Array.from(e),this.emit("select",e,this));}),u(r)),r}return r(i,[{key:"files",get:function(){return this.childrenMap.fileChooser.files}}]),i}(CC);Object.assign(Ex.prototype,{setAccept:function(t){return this.childrenMap.fileChooser.setAccept(t),this},setMultiple:function(t){return this.childrenMap.fileChooser.setMultiple(t),this},loadFile:function(t,e,i,n,s){return this.childrenMap.fileChooser.loadFile(t,e,i,n,s),this},loadFilePromise:function(t,e,i,n){return this.childrenMap.fileChooser.loadFilePromise(t,e,i,n)}});var _x={getChoice:function(t){var e=this.childrenMap.choicesSizer;return e?e.getButton(t):void 0},getAction:function(t){return this.childrenMap.actionsSizer.getButton(t)},getToolbar:function(t){return this.childrenMap.toolbarSizer.getButton(t)},getLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.getButton(t)},setChoiceEnable:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.setButtonEnable(t,e),this},setActionEnable:function(t,e){return this.childrenMap.actionsSizer.setButtonEnable(t,e),this},setToolbarEnable:function(t,e){return this.childrenMap.toolbarSizer.setButtonEnable(t,e),this},setLeftToolbarEnable:function(t,e){return this.childrenMap.leftToolbarSizer.setButtonEnable(t,e),this},toggleChoiceEnable:function(t){var e=this.childrenMap.choicesSizer;return e&&e.toggleButtonEnable(t),this},toggleActionEnable:function(t){return this.childrenMap.actionsSizer.toggleButtonEnable(t),this},toggleToolbarEnable:function(t){return this.childrenMap.toolbarSizer.toggleButtonEnable(t),this},toggleLeftToolbarEnable:function(t){return this.childrenMap.leftToolbarSizer.toggleButtonEnable(t),this},getChoiceEnable:function(t){var e=this.childrenMap.choicesSizer;return !!e&&e.getButtonEnable(t)},getActionEnable:function(t){return this.childrenMap.actionsSizer.getButtonEnable(t)},getToolbarEnable:function(t){return this.childrenMap.toolbarSizer.getButtonEnable(t)},getLeftToolbarEnable:function(t){return this.childrenMap.leftToolbarSizer.getButtonEnable(t)},emitChoiceClick:function(t){var e=this.childrenMap.choicesSizer;return e&&e.emitButtonClick(t),this},emitActionClick:function(t){return this.childrenMap.actionsSizer.emitButtonClick(t),this},emitToolbarClick:function(t){return this.childrenMap.toolbarSizer.emitButtonClick(t),this},emitLeftToolbarClick:function(t){return this.childrenMap.leftToolbarSizer.emitButtonClick(t),this},showChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.showButton(t),this},showAction:function(t){return this.childrenMap.actionsSizer.showButton(t),this},showToolbar:function(t){return this.childrenMap.toolbarSizer.showButton(t),this},showLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.showButton(t),this},hideChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.hideButton(t),this},hideAction:function(t){return this.childrenMap.actionsSizer.hideButton(t),this},hideToolbar:function(t){return this.childrenMap.toolbarSizer.hideButton(t),this},hideLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.hideButton(t),this},addChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.addButton(t),this},addAction:function(t){return this.childrenMap.actionsSizer.addButton(t),this},addToolbar:function(t){return this.childrenMap.toolbarSizer.addButton(t),this},addLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.addButton(t),this},removeChoice:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.removeButton(t,e),this},removeAction:function(t,e){return this.childrenMap.actionsSizer.removeButton(t,e),this},removeToolbar:function(t,e){return this.childrenMap.toolbarSizer.removeButton(t,e),this},removeLeftToolbar:function(t,e){return this.childrenMap.leftToolbarSizer.removeButton(t,e),this},clearChoices:function(t){var e=this.childrenMap.choicesSizer;return e&&e.clearButtons(t),this},clearActions:function(t){return this.childrenMap.actionsSizer.clearButtons(t),this},clearToolbar:function(t){return this.childrenMap.toolbarSizer.clearButtons(t),this},clearLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.clearButtons(t),this},forEachChoice:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.forEachButtton(t,e),this},forEachAction:function(t,e){return this.childrenMap.actionsSizer.forEachButtton(t,e),this},forEachToolbar:function(t,e){return this.childrenMap.toolbarSizer.forEachButtton(t,e),this},forEachLeftToolbar:function(t,e){return this.childrenMap.leftToolbarSizer.forEachButtton(t,e),this},setAllButtonsEnable:function(t){return void 0===t&&(t=!0),this.childrenMap.toolbarSizer&&this.setToolbarEnable(t),this.childrenMap.leftToolbarSizer&&this.setLeftToolbarEnable(t),this.childrenMap.actionsSizer&&this.setActionEnable(t),this.childrenMap.choicesSizer&&this.setChoiceEnable(t),this},getChoicesButtonStates:function(){var t=this.childrenMap.choicesSizer;return t?t.getAllButtonsState():{}},getChoicesButtonState:function(t){var e=this.childrenMap.choicesSizer;return void 0===t?e?e.getAllButtonsState():{}:!!e&&e.getButtonState(t)},setChoicesButtonState:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.setButtonState(t,e),this},clearChoicesButtonStates:function(){var t=this.childrenMap.choicesSizer;return t&&t.clearAllButtonsState(),this},getChoicesSelectedButtonName:function(){var t=this.childrenMap.choicesSizer;return t?t.getSelectedButtonName():""},setChoicesSelectedButtonName:function(t){var e=this.childrenMap.choicesSizer;return e&&e.setSelectedButtonName(t),this}},Lx={onCreateModalBehavior:function(t){t.on("button.click",(function(e,i,n,s,r){if("actions"===i){var o={index:n,text:e.text,button:e,dialog:t};switch(t.buttonsType){case"radio":o.value=t.getChoicesSelectedButtonName();break;case"checkboxes":o.value=t.getChoicesButtonStates();break;default:o.value=void 0;}t.modalClose(o);}}));},modal:function(t,e){return t&&!1===t.defaultBehavior?this.onCreateModalBehavior=!1:delete this.onCreateModalBehavior,eg.modal.call(this,t,e),this}},Rx={};Object.assign(Rx,_x,Lx);var Bx=Phaser.Utils.Objects.GetValue,jx=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),s.orientation=1,(r=e.call(this,t,s)).type="rexDialog",r.eventEmitter=Bx(s,"eventEmitter",u(r));var o,a,h,l,c=Bx(s,"background",void 0),d=Bx(s,"title",void 0),f=Bx(s,"toolbar",void 0),p=Bx(s,"toolbarBackground",void 0),v=Bx(s,"leftToolbar",void 0),g=Bx(s,"leftToolbarBackground",void 0),y=Bx(s,"content",void 0),k=Bx(s,"description",void 0),m=Bx(s,"choices",void 0),b=Bx(s,"choicesBackground",void 0),C=Bx(s,"actions",void 0),x=Bx(s,"actionsBackground",void 0),w=Bx(s,"click",void 0);if(c&&r.addBackground(c),f&&(h=new ux(t,{groupName:"toolbar",background:p,buttons:f,orientation:0,space:{item:Bx(s,"space.toolbarItem",0)},click:w,eventEmitter:r.eventEmitter})),v&&(l=new ux(t,{groupName:"leftToolbar",background:g,buttons:v,orientation:0,space:{item:Bx(s,"space.leftToolbarItem",0)},click:w,eventEmitter:r.eventEmitter})),d||f||v){var S,O=!!d&&Bx(s,"expand.title",!0),P=Bx(s,"align.title","center"),T=!(d&&!O&&"center"===P||!d&&(f||v));S=T?new _b(t,{orientation:0}):new rk(t);var M=!!T||{height:!0};if(l&&S.add(l,{align:"left",expand:M}),d){T&&!O&&"right"===P&&S.addSpace();var E={left:Bx(s,"space.titleLeft",0),right:Bx(s,"space.titleRight",0)},_=O?1:0;S.add(d,{align:P,proportion:_,expand:M,padding:E}),T&&!O&&"left"===P&&S.addSpace();}h&&(T&&!d&&S.addSpace(),S.add(h,{align:"right",expand:M})),(y||k||m||C)&&(E={bottom:Bx(s,"space.title",0),top:Bx(s,"space.titleTop",0)});_=Bx(s,"proportion.title",0);r.add(S,{padding:E,proportion:_,expand:!0});}if(y){var L=Bx(s,"align.content","center"),R=Bx(s,"space.content",0),B=(E={left:Bx(s,"space.contentLeft",0),right:Bx(s,"space.contentRight",0),bottom:k||m||C?R:0},_=Bx(s,"proportion.content",0),Bx(s,"expand.content",!0));r.add(y,{align:L,padding:E,proportion:_,expand:B});}if(k){L=Bx(s,"align.description","center");var j=Bx(s,"space.description",0);E={left:Bx(s,"space.descriptionLeft",0),right:Bx(s,"space.descriptionRight",0),bottom:m||C?j:0},_=Bx(s,"proportion.description",0),B=Bx(s,"expand.description",!0);r.add(k,{align:L,padding:E,proportion:_,expand:B});}if(m){var D=Bx(s,"choicesType","").split("-"),A=Dx(D,"wrap")?Tx:Dx(D,"grid")?kx:ux,I=Dx(D,"radio")?"radio":Dx(D,"checkboxes")?"checkboxes":void 0,z={left:Bx(s,"space.choicesBackgroundLeft",0),right:Bx(s,"space.choicesBackgroundRight",0),top:Bx(s,"space.choicesBackgroundTop",0),bottom:Bx(s,"space.choicesBackgroundBottom",0)},F=Bx(s,"space.choice",0);A===ux?z.item=F:A===Tx?(z.item=F,z.line=Bx(s,"space.choiceLine",F)):(z.column=Bx(s,"space.choiceColumn",F),z.row=Bx(s,"space.choiceRow",F));var Y={width:Bx(s,"choicesWidth",void 0),height:Bx(s,"choicesHeight",void 0),groupName:"choices",buttonsType:I,background:b,buttons:m,space:z,click:w,eventEmitter:r.eventEmitter,setValueCallback:Bx(s,"choicesSetValueCallback",void 0),setValueCallbackScope:Bx(s,"choicesSetValueCallbackScope",void 0)};A===ux&&(Y.orientation=Dx(D,"x")?0:1),o=new A(t,Y);var W=Bx(s,"space.choices",0);E={left:Bx(s,"space.choicesLeft",0),right:Bx(s,"space.choicesRight",0),bottom:C?W:0},L=Bx(s,"align.choices","center"),_=Bx(s,"proportion.choices",0),B=Bx(s,"expand.choices",!0);r.add(o,{align:L,padding:E,proportion:_,expand:B}),r.buttonsType=I;}if(C){a=new ux(t,{groupName:"actions",background:x,buttons:C,orientation:0,space:{item:Bx(s,"space.action",0)},expand:Bx(s,"expand.actions",!1),align:Bx(s,"align.actions","center"),click:w,eventEmitter:r.eventEmitter});E={left:Bx(s,"space.actionsLeft",0),right:Bx(s,"space.actionsRight",0),bottom:Bx(s,"space.actionsBottom",0)},_=Bx(s,"proportion.action",0);r.add(a,{align:"center",padding:E,proportion:_,expand:!0});}return Ix(u(r),"click"),Ix(u(r),"over"),Ix(u(r),"out"),Ix(u(r),"enable"),Ix(u(r),"disable"),r.addChildrenMap("background",c),r.addChildrenMap("title",d),r.addChildrenMap("toolbar",f),r.addChildrenMap("leftToolbar",v),r.addChildrenMap("content",y),r.addChildrenMap("description",k),r.addChildrenMap("choices",o?o.buttons:void 0),r.addChildrenMap("actions",a?a.buttons:void 0),r.addChildrenMap("choicesSizer",o),r.addChildrenMap("actionsSizer",a),r.addChildrenMap("toolbarSizer",h),r.addChildrenMap("leftToolbarSizer",l),r}return r(i)}(_b),Dx=function(t,e){return -1!==t.indexOf(e)},Ax={actions:"action",choices:"choice",toolbar:"toolbar",leftToolbar:"leftToolbar"},Ix=function(t,e){t.on("button.".concat(e),(function(i,n,s,r,o){Ax.hasOwnProperty(n)&&t.emit("".concat(Ax[n],".").concat(e),i,s,r,o);}));};Object.assign(jx.prototype,Rx);var zx=function(t,e,i){var n=new jC(t,e,i);return t.add.existing(n),n},Fx=function(t){this.childrenMap.title.resetDisplayContent(t.title);},Yx=function(t){var e=this.childrenMap.content;if(e.resetDisplayContent)e.resetDisplayContent(t.content);else {var i=t.content||"";e.setText(i);}},Wx=function(t){var e=this.childrenMap.actions;if(e){var i=t.buttons;if(i){for(var n=this.scene,s=this.defaultActionConfig,r=this.defaultActionButtonCreator,o=0,a=i.length;o=t.dragThreshold?"DRAG":"DRAGBEGIN":"IDLE"}},{key:"update_DRAGBEGIN",value:function(t,e){this.next();}},{key:"next_DRAG",value:function(){var t,e=this.parent;return e.dragState.isUp&&(t=e.outOfBounds?"BACK":e.slidingEnable?"SLIDE":"IDLE"),t}},{key:"update_DRAG",value:function(t,e){var i=this.parent;i.dragState.justMoved&&i.dragging(),this.next();}},{key:"enter_DRAG",value:function(){this.parent.onDragStart();}},{key:"exit_DRAG",value:function(){this.parent.onDragEnd();}},{key:"next_SLIDE",value:function(){var t,e=this.parent;return e.dragState.isDown?t="DRAG":e.isSliding||(t="IDLE"),t}},{key:"enter_SLIDE",value:function(){this.parent.onSliding();}},{key:"exit_SLIDE",value:function(){this.parent.stop();}},{key:"update_SLIDE",value:function(t,e){this.parent.sliding(t,e),this.next();}},{key:"next_BACK",value:function(){var t,e=this.parent;return e.dragState.isDown?t="DRAG":e.isPullBack||(t="IDLE"),t}},{key:"enter_BACK",value:function(){this.parent.onPullBack();}},{key:"exit_BACK",value:function(){this.parent.stop();}},{key:"update_BACK",value:function(t,e){this.parent.pullBack(t,e),this.next();}}]),i}(_v),_w=Phaser.Utils.Objects.GetValue,Lw=Phaser.Math.Distance.Between,Rw=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s))._enable=void 0,t.setInteractive(_w(s,"inputConfig",void 0)),r.resetFromJSON(s),r.boot(),r}return r(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.isInTouched=!1,this.holdStartTime=void 0,this.x=void 0,this.y=void 0,this.preX=void 0,this.preY=void 0,this.localX=void 0,this.localY=void 0,this.justMoved=!1,this.setEnable(_w(t,"enable",!0)),this.holdThreshold=_w(t,"holdThreshold",50),this.pointerOutReleaseEnable=_w(t,"pointerOutRelease",!0),this}},{key:"boot",value:function(){this.parent.on("pointerdown",this.onPointIn,this),this.parent.on("pointerup",this.onPointOut,this),this.pointerOutReleaseEnable&&this.parent.on("pointerout",this.onPointOut,this),this.parent.on("pointermove",this.onPointerMove,this),this.scene.sys.events.on("preupdate",this.preupdate,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.scene.sys.events.off("preupdate",this.preupdate,this),this.pointer=void 0,p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){this._enable!==t&&(t||(this.isInTouched=!1,this.pointer=void 0),this._enable=t);}},{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:"setPointerOutReleaseEnable",value:function(t){return void 0===t&&(t=!0),this.pointerOutReleaseEnable=t,this}},{key:"isDown",get:function(){return this.pointer&&this.pointer.isDown}},{key:"isUp",get:function(){return !this.isDown}},{key:"dx",get:function(){return this.x-this.preX}},{key:"dy",get:function(){return this.y-this.preY}},{key:"dt",get:function(){return xc(this.scene)}},{key:"speed",get:function(){return this.x===this.preX&&this.y===this.preY?0:Lw(this.preX,this.preY,this.x,this.y)/(.001*this.dt)}},{key:"speedX",get:function(){return this.dx/(.001*this.dt)}},{key:"speedY",get:function(){return this.dy/(.001*this.dt)}},{key:"onPointIn",value:function(t,e,i){this.enable&&t.isDown&&void 0===this.pointer&&(this.pointer=t,this.localX=e,this.localY=i);}},{key:"onPointOut",value:function(t){this.enable&&this.pointer===t&&(this.pointer=void 0);}},{key:"onPointerMove",value:function(t,e,i){this.enable&&t.isDown&&this.pointer===t&&(this.localX=e,this.localY=i);}},{key:"preupdate",value:function(t,e){if(this.enable){var i=this.pointer;this.justMoved=!1,i&&!this.isInTouched?(this.x=i.worldX,this.y=i.worldY,this.preX=i.worldX,this.preY=i.worldY,this.isInTouched=!0,this.holdStartTime=void 0,this.emit("touchstart",i,this.localX,this.localY)):i&&this.isInTouched?this.x===i.x&&this.y===i.y?void 0===this.holdStartTime?this.holdStartTime=t:t-this.holdStartTime>this.holdThreshold&&(this.preX=this.x,this.preY=this.y):(this.preX=this.x,this.preY=this.y,this.x=i.worldX,this.y=i.worldY,this.holdStartTime=void 0,this.justMoved=!0,this.emit("touchmove",i,this.localX,this.localY)):!i&&this.isInTouched&&(this.isInTouched=!1,this.holdStartTime=void 0,this.emit("touchend",i));}}}]),i}(Ta),Bw=Phaser.Utils.Objects.GetValue,jw=function(){function t(e){n(this,t),this.resetFromJSON(e);}return r(t,[{key:"resetFromJSON",value:function(t){return this.setValue(Bw(t,"value",0)),this.setSpeed(Bw(t,"speed",0)),this.setAcceleration(Bw(t,"acceleration",0)),this}},{key:"reset",value:function(){this.setValue(0),this.setSpeed(0),this.setAcceleration(0);}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"setSpeed",value:function(t){return this.speed=t,this}},{key:"setAcceleration",value:function(t){return this.acceleration=t,this}},{key:"updateSpeed",value:function(t){return 0!==this.acceleration&&(this.speed+=this.acceleration*t,this.speed<0&&(this.speed=0)),this}},{key:"getDeltaValue",value:function(t){return this.updateSpeed(t),this.speed<=0?0:this.speed*t}},{key:"update",value:function(t){return this.updateSpeed(t),this.speed>0&&(this.value+=this.getDeltaValue(t)),this}},{key:"isMoving",get:function(){return this.speed>0}}]),t}(),Dw=function(){function t(){n(this,t),this.value,this.dir,this.movement=new jw;}return r(t,[{key:"init",value:function(t,e,i,n,s){return this.value=t,this.end=s,this.dir=void 0!==s?tthis.end&&(this.value=this.end):this.valuethis.maxValue}},{key:"overMin",value:function(t){return null!=this.minValue&&t0,Math.abs(e),i);}},{key:"sliding",value:function(t,e){e*=.001;var i=this._slowDown.update(e).value;this.overMax(i)?(this.value=this.maxValue,this._slowDown.stop()):this.overMin(i)?(this.value=this.minValue,this._slowDown.stop()):this.value=i;}},{key:"onPullBack",value:function(){var t=this.value,e=this.outOfMinBound?this.minValue:this.maxValue,i=Math.abs(e-t),n=this.backDeceleration,s=Math.sqrt(2*n*i);this._slowDown.init(t,void 0,s,n,e);}},{key:"pullBack",value:function(t,e){e*=.001,this.value=this._slowDown.update(e).value,this._slowDown.isMoving||this._state.next();}},{key:"stop",value:function(){this._slowDown.stop();}}]),i}(Ta),Fw={y:0,v:0,vertical:0,x:1,h:1,horizontal:1},Yw=Phaser.Utils.Objects.GetValue,Ww=function(t){a(i,t);var e=d(i);function i(t,s){var r;(n(this,i),(r=e.call(this,t,s)).parent!==r.scene?r.focusMode=Yw(s,"focus",!0):r.focusMode=!1,r.setSpeed(Yw(s,"speed",.1)),r.setEnable(Yw(s,"enable",!0)),r.focusMode)?(t=r.parent).setInteractive(Yw(s,"inputConfig",void 0)).on("wheel",(function(t,e,i,n,s){this.enable&&this.scroll(i);}),u(r)):r.scene.input.on("wheel",r.onSceneScroll,u(r));return r}return r(i,[{key:"destroy",value:function(){this.focusMode||this.scene.input.off("wheel",this.onSceneScroll,this);}},{key:"onSceneScroll",value:function(t,e,i,n,s,r){this.enable&&this.scroll(n);}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"setSpeed",value:function(t){return this.speed=t,this}},{key:"scroll",value:function(t){t*=this.speed,this.emit("scroll",t,this.parent,this);}}]),i}(Ta),Vw=Phaser.Utils.Objects.GetValue,Xw=function(t,e,i,n){var s,r,o,a,h="Y"===(i=i.toUpperCase()),l=2===t.scrollMode,u=t.childrenMap.child,c="slider".concat(i);if(s=l||n.hasOwnProperty(c)?Vw(n,c,void 0):Vw(n,"slider",void 0)){var d,f,p;!0===s&&(s={}),s.orientation=h?1:0,r=function(t,e){void 0===e&&(e={});var i=Wt(e);(e={slider:i}).orientation=i.orientation,delete i.orientation,e.background=i.background,delete i.background,e.buttons=i.buttons,delete i.buttons;var n=new Mw(t,e);t.add.existing(n);var s=n.childrenMap.slider;return n.addChildrenMap("track",s.childrenMap.track),n.addChildrenMap("indicator",s.childrenMap.indicator),n.addChildrenMap("thumb",s.childrenMap.thumb),n}(t.scene,s);var v=Vw(s,"position",0);"string"==typeof v&&(v=Gw[v]);var g=Vw(n,"space.slider".concat(i),void 0);void 0===g&&void 0===(g=Vw(n,"space.slider",void 0))&&(g=l?0:Vw(n,"space.child",0));var y="number"==typeof g;h?0===v?(d=2,f=1,p=y?{left:g}:g):(d=0,f=1,p=y?{right:g}:g):0===v?(d=1,f=2,p=y?{top:g}:g):(d=1,f=0,p=y?{bottom:g}:g),e.add(r,{column:d,row:f,align:"center",padding:p,expand:!0}),t["hideUnscrollableSlider".concat(i)]=Vw(s,"hideUnscrollableSlider",!1),t["adaptThumb".concat(i,"SizeMode")]=Vw(s,"adaptThumbSize",!1),t["minThumb".concat(i,"Size")]=Vw(s,"minThumbSize",void 0);}else t["hideUnscrollableSlider".concat(i)]=!1,t["adaptThumb".concat(i,"SizeMode")]=!1,t["minThumb".concat(i,"Size")]=void 0;var k="scroller".concat(i);(o=l||n.hasOwnProperty(k)?Vw(n,k,!0):Vw(n,"scroller",!0))&&u&&(!0===o&&(o={}),o.orientation=h?0:1,a=new zw(u,o));var m,b,C,x,w=Vw(n,l?"mouseWheelScroller".concat(i):"mouseWheelScroller",!1);(w&&u&&(m=new Ww(u,w)),t.addChildrenMap("slider".concat(i),r),t.addChildrenMap("scroller".concat(i),a),t.addChildrenMap("mouseWheelScroller".concat(i),m),l&&!h||(t.hideUnscrollableSlider=t["hideUnscrollableSlider".concat(i)],t.adaptThumbSizeMode=t["adaptThumb".concat(i,"SizeMode")],t.minThumbSize=t["minThumb".concat(i,"Size")],t.addChildrenMap("slider",r),t.addChildrenMap("scroller",a),t.addChildrenMap("mouseWheelScroller",m)),r)&&(l?(b=h?"t":"s",x="scroll".concat(i)):(b="t",x="scroll"),r.on("valuechange",(function(e){t[b]=e,t.emit(x,t);})));a&&(l?(C="childO".concat(i),x="scroll".concat(i)):(C="childOY",x="scroll"),a.on("valuechange",(function(e){t[C]=e,t.emit(x,t);})));if(m){var S="addChildO".concat(i);m.on("scroll",(function(e){t[S](-e,!0);}));}},Gw={right:0,left:1,bottom:0,top:1},Hw=Phaser.Utils.Objects.GetValue,Uw=function(t,e){var i=t.scene,n=[0,1,0],s=[0,1,0],r=Hw(e,"width"),o=Hw(e,"height");r||(Hw(e,"child.expandWidth",!0)||(n[1]=0));o||(Hw(e,"child.expandHeight",!0)||(s[1]=0));var a=new Jb(i,{column:3,row:3,columnProportions:n,rowProportions:s});switch(function(t,e,i){var n=Qx(i,"child"),s=Qx(n,"gameObject",void 0);if(s){var r=Qx(i,"space.child",0);t.childMargin={};var o=t.childMargin,a={};if("number"==typeof r)switch(t.scrollMode){case 0:case 1:o.top=0,o.bottom=0,o.left=0,o.right=0;break;default:o.top=r,o.bottom=r,o.left=r,o.right=r;}else switch(t.scrollMode){case 0:o.top=Qx(r,"top",0),o.bottom=Qx(r,"bottom",0),a.left=Qx(r,"left",0),a.right=Qx(r,"right",0);break;case 1:o.top=Qx(r,"left",0),o.bottom=Qx(r,"right",0),a.top=Qx(r,"top",0),a.bottom=Qx(r,"bottom",0);break;default:o.top=Qx(r,"top",0),o.bottom=Qx(r,"bottom",0),o.left=Qx(r,"left",0),o.right=Qx(r,"right",0);}e.add(s,{column:1,row:1,align:Qx(n,"align","center"),padding:a,expand:{width:Qx(n,"expandWidth",!0),height:Qx(n,"expandHeight",!0)}});}t.addChildrenMap("child",s);}(t,a,e),t.scrollMode){case 0:Xw(t,a,"y",e);break;case 1:Xw(t,a,"x",e);break;default:Xw(t,a,"y",e),Xw(t,a,"x",e);}return a},Nw=function(t){var e,i,n,s;switch(this.scrollMode){case 0:case 1:e=this.topChildOY,i=this.bottomChildOY,n=this.childrenMap.scroller,s=this.childrenMap.slider;break;default:"Y"===(t=t.toUpperCase())?(e=this.topChildOY,i=this.bottomChildOY):(e=this.leftChildOX,i=this.rightChildOX),n=this.childrenMap["scroller".concat(t)],s=this.childrenMap["slider".concat(t)];}n&&n.setBounds(e,i),s&&s.setEnable(e!==i);},Kw=function(t){switch(this.scrollMode){case 0:case 1:(e=this.childrenMap.slider)&&this.hideUnscrollableSlider&&this.setChildVisible(e,this.isOverflow);break;default:t=t.toUpperCase();var e=this.childrenMap["slider".concat(t)],i=this["hideUnscrollableSlider".concat(t)],n=this["isOverflow".concat(t)];e&&i&&this.setChildVisible(e,n);}},Jw=function(t){switch(this.scrollMode){case 0:case 1:if(!this.adaptThumbSizeMode)return;if(!(a=this.childrenMap.slider))return;var e=Math.min(this.childVisibleHeight/this.childHeight,1),i=a.childrenMap.track,n=a.childrenMap.thumb,s=this.minThumbSize;if(0===this.scrollMode){var r=i.displayHeight*e;void 0!==s&&r0?t.setText(e).getTextBounds().wrappedText.split("\n"):e.split("\n");}return i},nS=function(t){return (t-this.textLineSpacing)/(this.textLineHeight+this.textLineSpacing)},sS=function(t){return t*(this.textLineHeight+this.textLineSpacing)-this.textLineSpacing},rS=function(t){var e,i=t+this.visibleLinesCount+1;switch(this.textObjectType){case 0:case 2:e=this.lines.slice(t,i).join("\n");break;case 1:var n=this.lines.getLineStartIndex(t),s=this.lines.getLineEndIndex(i-1);e=this.lines.getSliceTagText(n,s,!0);}return e},oS=function(t,e){switch(eS(t)){case 0:var i=(s=t.style).wordWrapWidth,n=s.wordWrapCallback;s.wordWrapWidth=0,s.wordWrapCallback=void 0,t.setText(e),s.wordWrapWidth=i,s.wordWrapCallback=n;break;case 1:var s,r=(s=t.style).wrapMode;s.wrapMode=0,t.setText(e),s.wrapMode=r;break;case 2:var o=t._maxWidth;t._maxWidth=0,t.setText(e),t._maxWidth=o;}},aS=function(){var t=this.textObject.rexSizer;this.textObject.y+=t.offsetY-t.preOffsetY,t.preOffsetY=t.offsetY,this.resetChildPositionState(this.textObject),this.textCropEnable&&hS.call(this);},hS=function(){if(this.textObject.setCrop){var t,e,i=this.textObject.rexSizer.offsetY;i<=0?(t=-i,e=this.height):(t=0,e=this.height-i),this.textObject.setCrop(0,t,this.width,e);}},lS=function(t,e,i){if(i+=this.textLineHeight+this.textLineSpacing,this.textObjectWidth!==e||this._textObjectRealHeight!==i){switch(this.textObjectWidth=e,this._textObjectRealHeight=i,this.textObjectType){case 0:case 1:t.setFixedSize(e,i);var n=t.style,s=Math.max(e,0);0===this.textObjectType?n.wordWrapWidth=s:(0===n.wrapMode&&(n.wrapMode=1),n.wrapWidth=s);break;case 2:t.setMaxWidth(e);}this.setText();}},uS={setText:function(t){return void 0!==t&&(this.text=t),this.lines=iS(this.textObject,this.text,this.lines),this.linesCount=this.lines.length,this._textHeight=void 0,this._textVisibleHeight=void 0,this.updateTextObject(),this},updateTextObject:function(){var t=Math.max(Math.floor(nS.call(this,-this.textOY)),0),e=sS.call(this,t)+this.textOY,i=rS.call(this,t);return oS(this.textObject,i),this.textObject.rexSizer.offsetY=e,aS.call(this),this},preLayout:function(){return this._textLineHeight=void 0,this._textLineSpacing=void 0,this._visibleLinesCount=void 0,this._textHeight=void 0,this._textVisibleHeight=void 0,Tp.call(this),this},layoutChildren:function(){var t,e,i,n,s,r,o,a=this.left,h=this.top;(t=this.textObject).rexSizer.hidden||(n=a+(i=(e=t.rexSizer).padding).left,s=h+i.top,r=this.width-i.left-i.right,o=this.height-i.top-i.bottom,lS.call(this,t,r,o),sp(t,n,s,r,o,e.align),e.preOffsetY=0,aS.call(this),this.textMask&&(this.textMask.setPosition().resize(),this.resetChildPositionState(this.textMask)));}},cS=Phaser.Utils.Objects.IsPlainObject,dS=Phaser.Utils.Objects.GetValue,fS=Phaser.Display.Align.TOP_LEFT,pS=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),cS(s)?(s=dS(h=s,"x",0),r=dS(h,"y",0),o=dS(h,"width",void 0),a=dS(h,"height",void 0)):cS(o)&&(o=dS(h=o,"width",void 0),a=dS(h,"height",void 0)),(l=e.call(this,t,s,r,o,a,h)).type="rexTextBlock",l.textObject=void 0,l.linesCount=0,l.textMask=void 0,l.textObjectType=void 0,l._textLineHeight=void 0,l._textLineSpacing=void 0,l._visibleLinesCount=void 0,l._textHeight=void 0,l._textVisibleHeight=void 0,l._textObjectRealHeight=0,l.lines=void 0,l.text=dS(h,"content",""),l._textOY=0,l.execeedTopState=!1,l.execeedBottomState=!1,l.setClampMode(dS(h,"clamplTextOY",!0)),l.alwaysScrollable=dS(h,"alwaysScrollable",!1);var c=dS(h,"background",void 0),d=dS(h,"text",void 0);void 0===d&&(d=vS(t)),l.textCropEnable=dS(h,"textCrop",!!d.setCrop);var f=dS(h,"textMask",!l.textCropEnable);c&&l.addBackground(c),l.add(d),l.sizerChildren=[d];var p=l.getSizerConfig(d);return p.align=fS,p.padding=up(0),p.expand=!0,l.textObject=d,l.textObjectType=eS(d),p.preOffsetY=0,p.offsetY=0,f&&(l.textMask=mC.call(u(l),l.textObject,u(l))),l.addChildrenMap("background",c),l.addChildrenMap("text",d),l}return r(i,[{key:"destroy",value:function(t){if(this.scene&&!this.ignoreDestroy){if(this.textObject=void 0,this.textMask=void 0,this.lines){switch(this.textObjectType){case 0:case 2:this.lines.length=0;break;case 1:this.lines.destroy();}this.lines=void 0;}p(h(i.prototype),"destroy",this).call(this,t);}}},{key:"setClampMode",value:function(t){return void 0===t&&(t=!0),this.clampTextOY=t,this}},{key:"textLineHeight",get:function(){if(void 0===this._textLineHeight){var t;switch(this.textObjectType){case 0:case 1:var e=this.textObject.style;t=e.metrics.fontSize+e.strokeThickness;break;case 2:var i=this.textObject.fontSize/this.textObject.fontData.size;t=this.textObject.fontData.lineHeight*i;}this._textLineHeight=t;}return this._textLineHeight}},{key:"textLineSpacing",get:function(){if(void 0===this._textLineSpacing){var t;switch(this.textObjectType){case 0:case 1:t=this.textObject.lineSpacing;break;case 2:t=0;}this._textLineSpacing=t;}return this._textLineSpacing}},{key:"visibleLinesCount",get:function(){return void 0===this._visibleLinesCount&&(this._visibleLinesCount=Math.floor(nS.call(this,this._textObjectRealHeight))),this._visibleLinesCount}},{key:"topTextOY",get:function(){return 0}},{key:"bottomTextOY",get:function(){return -this.textVisibleHeight}},{key:"textHeight",get:function(){return void 0===this._textHeight&&(this._textHeight=sS.call(this,this.linesCount)),this._textHeight}},{key:"textObjectHeight",get:function(){return this._textObjectRealHeight-(this.textLineHeight+this.textLineSpacing)}},{key:"textVisibleHeight",get:function(){if(void 0===this._textVisibleHeight){var t=this.textHeight-this.textObjectHeight;!this.alwaysScrollable&&t<0&&(t=0),this._textVisibleHeight=t;}return this._textVisibleHeight}},{key:"textOYExceedTop",value:function(t){return void 0===t&&(t=this.textOY),t>this.topTextOY}},{key:"textOYExeceedBottom",value:function(t){return void 0===t&&(t=this.textOY),tthis.linesCount?t=0:n?t=e:s&&(t=i)),this._textOY!==t&&(this._textOY=t,this.updateTextObject()),n&&(this.execeedTopState||this.emit("execeedtop",this,t,e)),this.execeedTopState=n,s&&(this.execeedBottomState||this.emit("execeedbottom",this,t,i)),this.execeedBottomState=s;}},{key:"setTextOY",value:function(t){return this.textOY=t,this}},{key:"t",get:function(){var t=this.textVisibleHeight;return 0===t?0:this.textOY/-t},set:function(t){this.textOY=-this.textVisibleHeight*t;}},{key:"setTextOYByPercentage",value:function(t){return this.t=t,this}}]),i}(Hy),vS=function(t){return t.add.text(0,0,"")};Object.assign(pS.prototype,uS);var gS={scrollToLine:function(t){return this.setChildOY(-this.lineHeight*t),this},scrollToNextLine:function(t){void 0===t&&(t=1);var e=this.lineIndex+t;return this.scrollToLine(e),this}},yS=Phaser.Utils.Objects.GetValue,kS=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=yS(s,"text",void 0),a=yS(s,"textWidth",void 0),h=yS(s,"textHeight",void 0),l=yS(s,"textCrop",!!o.setCrop),u=yS(s,"textMask",!l),c=yS(s,"content",""),d=new pS(t,{width:a,height:h,text:o,textMask:u,textCrop:l&&!u,content:c,clamplTextOY:yS(s,"clamplChildOY",!1),alwaysScrollable:yS(s,"alwaysScrollable",!1)});t.add.existing(d),function(t){Object.defineProperty(t,"childOY",{configurable:!0,get:function(){return t.textOY},set:function(e){t.textOY=e;}}),Object.defineProperty(t,"topChildOY",{get:function(){return t.topTextOY}}),Object.defineProperty(t,"bottomChildOY",{get:function(){return t.bottomTextOY}}),Object.defineProperty(t,"childVisibleHeight",{get:function(){return t.textObjectHeight}}),Object.defineProperty(t,"childHeight",{get:function(){return t.textHeight}});}(d),s.scrollMode=0,s.type="rexTextArea",s.child={gameObject:d,expandWidth:void 0===a,expandHeight:void 0===h};var f=yS(s,"space",void 0);return f&&(f.child=yS(f,"text",0)),(r=e.call(this,t,s)).addChildrenMap("text",o),r}return r(i,[{key:"text",get:function(){return this.childrenMap.child.text}},{key:"lineHeight",get:function(){var t=this.childrenMap.child;return t.textLineHeight+t.textLineSpacing}},{key:"lineIndex",get:function(){return Math.floor(-this.childOY/this.lineHeight)}},{key:"linesCount",get:function(){return this.childrenMap.child.linesCount}},{key:"contentHeight",get:function(){return this.childrenMap.child.textHeight}}]),i}(Qw);Object.assign(kS.prototype,{setText:function(t){return this.childrenMap.child.setText(t),this.resizeController(),this},appendText:function(t){return this.setText(this.text+t),this}},gS);var mS=Phaser.Utils.Objects.GetValue,bS=function(t,e,i){e=e?xe(e):{};var n=mS(i,"background",xC),s=mS(i,"text",OC),r=mS(i,"track",xC),o=mS(i,"thumb",xC);n?e.background=n(t,e.background):delete e.background,s?e.text=s(t,e.text):delete e.text;var a=e.slider;!1!==a&&(void 0===a&&(a={}),r?a.track=r(t,a.track):delete a.track,o?a.thumb=o(t,a.thumb):delete a.thumb,e.slider=a);var h=new kS(t,e);return t.add.existing(h),h},CS=Phaser.Utils.Objects.GetValue,xS=Phaser.Utils.Objects.GetValue,wS=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;n(this,i),s=s?xe(s):{},void 0===r&&(r={});var a=xS(r,"background",xC);a?s.background=a(t,s.background):delete s.background,s.title=zx(t,s.title,r.title),s.content=function(t,e,i){var n,s=CS(e,"$type");void 0===s&&e&&(e.hasOwnProperty("slider")||e.hasOwnProperty("scroller"))&&(s="textarea"),n="textarea"===s?new bS(t,e,i):new zx(t,e,i);return t.add.existing(n),n}(t,s.content,r.content),s.content instanceof kS&&tc(s,"height")&&!tc(s,"proportion.content")&&Be(s,"proportion.content",1);var h=s.button,l=s.buttonA||h,c=s.buttonB||h,d=s.buttonMode;void 0===d&&(d=l&&c?2:l?1:0);var f=r.button,p=r.buttonA||f,v=r.buttonB||f;switch(d){case 2:s.actions=[zx(t,l,p),zx(t,c,v)];break;case 1:s.actions=[zx(t,l,p)];break;case 0:break;default:s.actions=[];}var g=s.choice;g&&(s.choices=[]),(o=e.call(this,t,s)).type="rexConfirmDialog",o.buttonMode=d,o.defaultActionConfig=h,o.defaultActionButtonCreator=f,o.defaultChoiceConfig=g,o.defaultChoiceCreator=r.choice;var y=o.childrenMap.actions;return o.addChildrenMap("buttonA",y?y[0]:null),o.addChildrenMap("buttonB",y?y[1]:null),Jx.call(u(o)),o}return r(i)}(jx);Object.assign(wS.prototype,Xx);var SS=Phaser.Utils.Objects.GetValue,OS=function(t,e,i){var n=SS(t,"proportion.".concat(e),i.proportion),s=SS(t,"align.".concat(e),"center"),r=SS(t,"space.".concat(e),void 0);if("number"==typeof r&&i.paddingKey){var o=r;(r={})[i.paddingKey]=o;}return {proportion:n,align:s,padding:r,expand:SS(t,"expand.".concat(e),!0)}},PS=function(t){return OS(t,"header",{proportion:0,paddingKey:"bottom"})},TS=function(t){return OS(t,"leftSide",{proportion:0,paddingKey:"right"})},MS=function(t){return OS(t,"content",{proportion:1})},ES=function(t){return OS(t,"rightSide",{proportion:0,paddingKey:"left"})},_S=function(t){return OS(t,"footer",{proportion:0,paddingKey:"top"})},LS=function(t,e){var i=new _b(t,{orientation:e});return t.add.existing(i),i},RS=Phaser.Utils.Objects.GetValue,BS=[function(t){var e=this.scene,i=t.header;i&&this.add(i,PS(t));var n=LS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,TS(t));var r=t.content;r&&n.add(r,MS(t));var o=t.rightSide;o&&n.add(o,ES(t));var a=t.footer;a&&this.add(a,_S(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,PS(t));var n=LS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,TS(t));var r=LS(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=LS(e,0);r.add(o,{proportion:1,align:"center",padding:0,expand:!0});var a=t.content;a&&o.add(a,MS(t));var h=t.rightSide;h&&o.add(h,ES(t));var l=t.footer;l&&r.add(l,_S(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,PS(t));var n=LS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=LS(e,1);n.add(s,{proportion:1,align:"center",padding:0,expand:!0});var r=LS(e,0);s.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.leftSide;o&&r.add(o,TS(t));var a=t.content;a&&r.add(a,MS(t));var h=t.footer;h&&s.add(h,_S(t));var l=t.rightSide;l&&n.add(l,ES(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,PS(t));var n=LS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,TS(t));var r=LS(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.content;o&&r.add(o,MS(t));var a=t.footer;a&&r.add(a,_S(t));var h=t.rightSide;h&&n.add(h,ES(t));}],jS={FFF:0,LFF:1,FFR:2,LFR:3},DS=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),void 0===s&&(s={}),s.orientation=1,(r=e.call(this,t,s)).type="rexHolyGrail",r.build(s),r}return r(i)}(_b),AS={build:function(t){this.clear(!0);var e=RS(t,"background",void 0);e&&this.addBackground(e);var i=RS(t,"layoutMode",0);"string"==typeof i&&(i=jS[i.toUpperCase()]),(BS[i]||BS[0]).call(this,t),this.addChildrenMap("background",t.background),this.addChildrenMap("header",t.header),this.addChildrenMap("leftSide",t.leftSide),this.addChildrenMap("content",t.content),this.addChildrenMap("rightSide",t.rightSide),this.addChildrenMap("footer",t.footer);}};Object.assign(DS.prototype,AS);var IS={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):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 yv(this.getButton(t,e)),this},showLeftButton:function(t){return yv(this.getLeftButton(t)),this},showRightButton:function(t){return yv(this.getRightButton(t)),this},showTopButton:function(t){return yv(this.getTopButton(t)),this},showBottomButton:function(t){return yv(this.getBottomButton(t)),this},hideButton:function(t,e){return kv(this.getButton(t,e)),this},hideLeftButton:function(t){return kv(this.getLeftButton(t)),this},hideRightButton:function(t){return kv(this.getRightButton(t)),this},hideTopButton:function(t){return kv(this.getTopButton(t)),this},hideBottomButton:function(t){return kv(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},forEachButton:function(t,e,i){return this.getButtonsSizer(t).forEachButtton(e,i),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}},zS=Phaser.Utils.Objects.GetValue,FS=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),s.column=3,s.row=3,(r=e.call(this,t,s)).type="rexTabs",r.eventEmitter=zS(s,"eventEmitter",u(r));var o,a,h,l,c=zS(s,"background",void 0),d=zS(s,"panel",void 0),f=zS(s,"leftButtons",void 0),p=zS(s,"leftButtonsBackground",void 0),v=zS(s,"rightButtons",void 0),g=zS(s,"rightButtonsBackground",void 0),y=zS(s,"topButtons",void 0),k=zS(s,"topButtonsBackground",void 0),m=zS(s,"bottomButtons",void 0),b=zS(s,"bottomButtonsBackground",void 0),C=zS(s,"click",void 0);if(c&&r.addBackground(c),d&&r.add(d,1,1,"center",0,!0),f){var x=zS(s,"space.leftButtonsOffset",0),w=zS(s,"space.leftButton",0);o=new ux(t,{groupName:"left",background:p,buttons:f,orientation:1,space:{item:w},align:zS(s,"align.leftButtons",void 0),click:C,eventEmitter:r.eventEmitter});var S={top:x};r.add(o,0,1,"top",S,!1);}if(v){var O=zS(s,"space.rightButtonsOffset",0),P=zS(s,"space.rightButton",0);a=new ux(t,{groupName:"right",background:g,buttons:v,orientation:1,space:{item:P},align:zS(s,"align.rightButtons",void 0),click:C,eventEmitter:r.eventEmitter});S={top:O};r.add(a,2,1,"top",S,!1);}if(y){var T=zS(s,"space.topButtonsOffset",0),M=zS(s,"space.topButton",0);h=new ux(t,{groupName:"top",background:k,buttons:y,orientation:0,space:{item:M},align:zS(s,"align.topButtons",void 0),click:C,eventEmitter:r.eventEmitter});S={left:T};r.add(h,1,0,"left",S,!1);}if(m){var E=zS(s,"space.bottomButtonsOffset",0),_=zS(s,"space.bottomButton",0);l=new ux(t,{groupName:"bottom",background:b,buttons:m,orientation:0,space:{item:_},align:zS(s,"align.bottomButtons",void 0),click:C,eventEmitter:r.eventEmitter});S={left:E};r.add(l,1,2,"left",S,!1);}return r.addChildrenMap("background",c),r.addChildrenMap("panel",d),r.addChildrenMap("leftButtons",f),r.addChildrenMap("rightButtons",v),r.addChildrenMap("topButtons",y),r.addChildrenMap("bottomButtons",m),r.addChildrenMap("leftButtonsSizer",o),r.addChildrenMap("rightButtonsSizer",a),r.addChildrenMap("topButtonsSizer",h),r.addChildrenMap("bottomButtonsSizer",l),r}return r(i)}(Jb);Object.assign(FS.prototype,IS);var YS=function(){function t(e,i){n(this,t),this.container=null,this._deltaHeight=0,this.setParent(e);}return r(t,[{key:"setParent",value:function(t){this.parent=t,this.parentContainer=t.getParentContainer();}},{key:"destroy",value:function(t){void 0===t&&(t=!1),t||this.destroyContainer(),this.deltaHeight=0,this.data=void 0,this.container=null,this.parent=void 0,this.parentContainer=void 0;}},{key:"table",get:function(){return this.parent}},{key:"scrollMode",get:function(){return this.parentContainer.scrollMode}},{key:"colIndx",get:function(){return this.parent.cellIndxeToColIndex(this.index)}},{key:"rowIndx",get:function(){return this.parent.cellIndxeToRowIndex(this.index)}},{key:"getContainer",value:function(){return this.container}},{key:"setContainer",value:function(t){return t?(this.container&&this.container.destroy(),this.container=t,this.parentContainer.add(t),this):(this.destroyContainer(),this)}},{key:"destroyContainer",value:function(){return this.container&&(this.container.destroy(),this.container=null),this}},{key:"popContainer",value:function(){if(this.container){var t=this.container;return this.container=null,this.parentContainer.remove(t),t}return null}},{key:"setXY",value:function(t,e){return this.container&&this.parentContainer.setChildLocalPosition(this.container,t,e),this}},{key:"setCellContainerAlign",value:function(t){return "string"==typeof t&&(t=jf[t]),this.cellContainerAlign=t,this}},{key:"deltaHeight",get:function(){return this._deltaHeight},set:function(t){null==t&&(t=0);var e=this.parent;0===this._deltaHeight&&0!==t?e.nonZeroDeltaHeightCount++:0!==this._deltaHeight&&0===t&&e.nonZeroDeltaHeightCount--;var i=this._deltaHeight!==t;if(this._deltaHeight=t,i){e.resetTotalRowsHeight();var n=0===this.scrollMode?"cellheightchange":"cellwidthchange";this.parentContainer.emit(n,this,this.container,this.parentContainer);}}},{key:"deltaWidth",get:function(){return this.deltaHeight},set:function(t){this.deltaHeight=t;}},{key:"setDeltaHeight",value:function(t){return this.deltaHeight=t,this}},{key:"setDeltaWidth",value:function(t){return this.deltaHeight=t,this}},{key:"height",get:function(){return 0===this.scrollMode?this.deltaHeight+this.parent.defaultCellHeight:this.parent.defaultCellWidth},set:function(t){1!==this.scrollMode&&this.setDeltaHeight(t-this.parent.defaultCellHeight);}},{key:"setHeight",value:function(t){return this.height=t,this}},{key:"width",get:function(){return 0===this.scrollMode?this.parent.defaultCellWidth:this.deltaHeight+this.parent.defaultCellHeight},set:function(t){0!==this.scrollMode&&this.setDeltaHeight(t-this.parent.defaultCellHeight);}},{key:"setWidth",value:function(t){return this.width=t,this}},{key:"scene",get:function(){return this.parentContainer.scene}}]),t}();Object.assign(YS.prototype,wi);var WS=Phaser.Utils.Objects.GetValue,VS=Phaser.Utils.Array.SpliceOne,XS=function(){function t(e,i){n(this,t),this.parent=e,this.cells=[],this.cellPool=new hi,this.resetFromJSON(i);}return r(t,[{key:"resetFromJSON",value:function(t){void 0===t&&(t={}),this.colCount=void 0,this.nonZeroDeltaHeightCount=0,this.resetTotalRowsHeight();var e=t.cellHeight;void 0===e&&(e=30);var i=t.cellWidth;return void 0===i&&(i=30),this.setDefaultCellHeight(e),this.setDefaultCellWidth(i),this.initCells(WS(t,"cellsCount",0)),this.setColumnCount(WS(t,"columns",1)),this}},{key:"destroy",value:function(t){this.cellPool.destroy(),this.cells=void 0,this.parent=void 0;}},{key:"defaultCellHeightMode",get:function(){return 0===this.nonZeroDeltaHeightCount}},{key:"setDefaultCellHeight",value:function(t){return this.defaultCellHeight=t,this}},{key:"setDefaultCellWidth",value:function(t){return this.defaultCellWidth=t,this}},{key:"initCells",value:function(t){var e=this.cells;e.length=t;for(var i=0;i=0&&t=0&&i0&&n)){if(0===r)return 2===e&&(i+=1),i;if(1===e){var o=i;(n=(i+=1)>=0&&i=this.colCount?null:e*this.colCount+t}},{key:"rowIndexToHeight",value:function(t,e){if(this.defaultCellHeightMode)return (e-t+1)*this.defaultCellHeight;for(var i=0,n=t;n<=e;n++)i+=this.getRowHeight(n);return i}},{key:"colIndexToWidth",value:function(t,e){return (e-t+1)*this.defaultCellWidth}},{key:"getRowHeight",value:function(t){var e=this.colCount;if(e<=1)return this.getCellHeight(this.colRowToCellIndex(0,t));for(var i,n=0,s=0;sthis.topTableOY,r=tthis.leftTableOX,r=tt?this.removeCells(t,e-t):this.insertNewCells(e,t-e)),this},insertNewCells:function(t,e){return "object"===i(t)&&(t=t.index),void 0===e&&(e=1),e<=0||(t=rO(t,0,this.cellsCount),this.table.insertNewCells(t,e)),this},removeCells:function(t,e){if("object"===i(t)&&(t=t.index),void 0===e&&(e=1),t<0&&(e+=t,t=0),e<=0)return this;if(t>this.cellsCount)return this;for(var n,s=t,r=t+e;sb.bottom&&(l=c.getTopLeft().y,t.setOrigin(0,1).setPosition(h+d,l+f));},ZO={down:0,up:1},qO=Phaser.Utils.Objects.GetValue,$O=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),null==s.transitIn&&(s.transitIn=function(t,e){Dp(t,e,"y","Cubic");}),null==s.transitOut&&(s.transitOut=function(t,e){!function(t,e,i,n,s){void 0===n&&(n="Linear");var r={mode:0};switch(i){case 0:case"x":r.end={x:0};break;case 1:case"y":r.end={y:0};break;default:r.end=0;}r.duration=e,r.ease=n,void 0===s?s=new Bp(t,r):s.resetFromJSON(r),s.restart();}(t,e,"y","Linear");}),s.manualClose=!0,s.clickOutsideClose=!0,s.destroy=!0,r=e.call(this,t,s),JO(t,s),t.isRexSizer&&t.layout();var o=qO(s,"touchOutsideClose",!1),a=qO(s,"anyTouchClose",!1);return a&&(o=!1),a?r.once("open",r.anyTouchClose,u(r)):o&&r.once("open",r.touchOutsideClose,u(r)),r.requestOpen(),r}return r(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.scene.input.off("pointerup",this.touchCloseCallback,this),p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"touchOutsideClose",value:function(){return this.scene.input.on("pointerup",this.touchCloseCallback,this),this.clickOutsideTest=!0,this}},{key:"anyTouchClose",value:function(){return this.scene.input.once("pointerup",this.touchCloseCallback,this),this}},{key:"touchCloseCallback",value:function(t){this.clickOutsideTest&&qv(this.parent,t.worldX,t.worldY)||this.requestClose();}},{key:"onOpen",value:function(){this.emit("open",this.parent,this),p(h(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.parent,this),p(h(i.prototype),"onClose",this).call(this);}}]),i}(zv),QO={openListPanel:function(){if(this.listPanel)return this;var t,e=NO.call(this);e.on("button.over",(function(t,i,n,s){this.listOnButtonOver&&this.listOnButtonOver.call(this,t,i,n,s),this.emit("button.over",this,e,t,i,n,s);}),this).on("button.out",(function(t,i,n,s){this.listOnButtonOut&&this.listOnButtonOut.call(this,t,i,n,s),this.emit("button.out",this,e,t,i,n,s);}),this),t=this.listAlignMode&&"label"!==this.listAlignMode?this.getElement(this.listAlignMode):this;var i=new $O(e,{duration:{in:this.listEaseInDuration,out:this.listEaseOutDuration},transitIn:this.listTransitInCallback,transitOut:this.listTransitOutCallback,expandDirection:this.listExpandDirection,alignTargetX:t,alignTargetY:this,alignSide:this.listAlignSide,bounds:this.listBounds,anyTouchClose:!0}).on("open",(function(){e.on("button.click",(function(t,i,n,s){this.listOnButtonClick&&this.listOnButtonClick.call(this,t,i,n,s),this.emit("button.click",this,e,t,i,n,s);}),this),this.emit("list.open",this,e);}),this).on("close",(function(){this.listPanel=void 0,this.dropDownBehavior=void 0;}),this);return this.listPanel=e,this.dropDownBehavior=i,this.pin(e),this},closeListPanel:function(){return this.dropDownBehavior?(this.dropDownBehavior.requestClose(),this):this},toggleListPanel:function(){return this.listPanel?this.closeListPanel():this.openListPanel(),this}};Object.assign(QO,HO);var tP=Phaser.Utils.Objects.GetValue,eP=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),(r=e.call(this,t,s)).type="rexDropDownList",r.timer=void 0,r.setOptions(tP(s,"options"));var o=tP(s,"list");return r.setWrapEnable(tP(o,"wrap",!1)),r.setCreateButtonCallback(tP(o,"createButtonCallback")),r.setCreateListBackgroundCallback(tP(o,"createBackgroundCallback")),r.setButtonClickCallback(tP(o,"onButtonClick")),r.setButtonOverCallback(tP(o,"onButtonOver")),r.setButtonOutCallback(tP(o,"onButtonOut")),r.setListExpandDirection(tP(o,"expandDirection")),r.setListEaseInDuration(tP(o,"easeIn",500)),r.setListEaseOutDuration(tP(o,"easeOut",100)),r.setListTransitInCallback(tP(o,"transitIn")),r.settListTransitOutCallback(tP(o,"transitOut")),r.setListSize(tP(o,"width"),tP(o,"height")),r.setListAlignmentMode(tP(o,"alignParent","text")),r.setListAlignmentSide(tP(o,"alignSide","")),r.setListBounds(tP(o,"bounds")),r.setListSpace(tP(o,"space")),r.setListDraggable(tP(o,"draggable",!1)),r.setValueChangeCallback(tP(s,"setValueCallback"),tP(s,"setValueCallbackScope")),r.setValue(tP(s,"value")),r.onClick(r.toggleListPanel,u(r)),r}return r(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.listPanel&&(this.listPanel.destroy(t),this.listPanel=void 0),p(h(i.prototype),"destroy",this).call(this,t));}},{key:"setOptions",value:function(t){return void 0===t&&(t=[]),this.options=t,this}},{key:"setValueChangeCallback",value:function(t,e){return this.valueChangeCallback=t,this.valueChangeCallbackScope=e,this}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"value",get:function(){return this._value},set:function(t){if(this._value!==t){var e=this._value;this._value=t;var i=this.valueChangeCallback,n=this.valueChangeCallbackScope;i&&(n?i.call(n,this,t,e):i(this,t,e)),this.emit("valuechange",this,t,e);}}},{key:"emitButtonClick",value:function(t){var e=this.options[t];return e?(this.emit("button.click",this,void 0,e,t),this):this}}]),i}(CC);Object.assign(eP.prototype,QO);var iP=function(t){return Array.isArray(t)?t=t.join("\n"):"number"==typeof t&&(t=t.toString()),t},nP={clearText:function(){return this.sections.length=0,this.pageStartIndexes.length=0,this.lines.length=0,this},appendPage:function(t){var e=this.totalLinesCount;this.sections.push(iP(t));t=this.sections.join("\n");this.lines=iS(this.parent,t,this.lines);for(var i=this.totalLinesCount-e,n=Math.ceil(i/this.pageLinesCount),s=0;s=this.pageCount-1}},{key:"totalLinesCount",get:function(){return this.lines?this.lines.length:0}},{key:"startLineIndex",get:function(){return this._startLineIndex},set:function(t){t=lP(t,0,this.totalLinesCount-1),this._startLineIndex=t;}},{key:"setStartLineIndex",value:function(t){return this.startLineIndex=t,this}},{key:"pageLinesCount",get:function(){if(void 0!==this.maxLines)return this.maxLines;var t;switch(this.textObjectType){case 0:case 1:var e=this.parent.style.maxLines;t=e>0?e:Math.floor(function(t){var e,i,n;switch(eS(t)){case 0:case 1:e=t.height-t.padding.top-t.padding.bottom,i=t.lineSpacing,n=t.style.metrics.fontSize+t.style.strokeThickness;break;case 2:e=t.height,i=0;var s=t.fontSize/t.fontData.size;n=t.fontData.lineHeight*s;}return (e-i)/(n+i)}(this.parent));break;case 2:t=this.totalLinesCount;}return t}},{key:"content",get:function(){return this.sections.join(this.pageBreak)}}]),i}(Ta);Object.assign(uP.prototype,aP),Phaser.Utils.Objects.GetFastValue,Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue;var cP=rk.prototype.add,dP=function(t,e,i,n,s,r,o,a,h){return t.setVisible(!1),cP.call(this,t,e,i,n,s,r,o,a,h),this},fP={add:dP,addPage:dP},pP=ie.prototype.setChildVisible,vP={getPage:function(t){return void 0===t?null:this.sizerChildren.hasOwnProperty(t)?this.sizerChildren[t]:null},swapPage:function(t,e){this._previousKey=this._currentKey;var i=this.previousPage;i&&(0===this.swapMode?(pP.call(this,i,!1),this.emit("pageinvisible",i,this._previousKey,this)):i.destroy()),t&&!this.sizerChildren.hasOwnProperty(t)&&this.emit("createpage",t,this),this._currentKey=t;var n=this.currentPage;return n&&(pP.call(this,n,!0),this.emit("pagevisible",n,this._currentKey,this),void 0===e&&(e=this.fadeInDuration),e>0&&n.setAlpha(0).fadeIn(e,1)),this},hasPage:function(t){return this.sizerChildren.hasOwnProperty(t)}};Object.assign(vP,fP);var gP=Phaser.Utils.Objects.GetValue,yP=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).type="rexPages",r.childrenMap=r.sizerChildren,r._previousKey=void 0,r._currentKey=void 0,r.setSwapMode(gP(s,"swapMode",0)),r.setFadeInDuration(gP(s,"fadeIn",0)),r}return r(i,[{key:"setSwapMode",value:function(t){return "string"==typeof t&&(t=kP[t]),this.swapMode=t,this}},{key:"setFadeInDuration",value:function(t){return this.fadeInDuration=t,this}},{key:"previousKey",get:function(){return this._previousKey}},{key:"currentKey",get:function(){return this._currentKey},set:function(t){this.swapPage(t);}},{key:"currentPage",get:function(){return this.getPage(this.currentKey)}},{key:"previousPage",get:function(){return this.getPage(this.previousKey)}},{key:"keys",get:function(){return Object.keys(this.sizerChildren)}}]),i}(rk);Object.assign(yP.prototype,vP);var kP={invisible:0,destroy:1},mP=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"tint",get:function(){return 0===this.vertices.length?16777215:this.vertices[0].color}},{key:"setInteractive",value:function(){var t=function(t,e,i){for(var n=this.faces,s=0;s=e.length))return e[t].name},getPageIndex:function(t){for(var e=this.getElement("tabs.buttons"),i=0,n=e.length;ithis.topChildOY}},{key:"childOYExeceedBottom",value:function(t){return void 0===t&&(t=this.childOY),tthis.leftChildOX}},{key:"childOXExeceedRight",value:function(t){return void 0===t&&(t=this.childOX),tthis.childHeight?t=0:n?t=e:s&&(t=i)),this._childOY!==t&&(this._childOY=t,this.resetChildPosition()),n&&(this.execeedTopState||this.emit("execeedtop",this,t,e)),this.execeedTopState=n,s&&(this.execeedBottomState||this.emit("execeedbottom",this,t,i)),this.execeedBottomState=s;}},{key:"childOX",get:function(){return this._childOX},set:function(t){var e=this.leftChildOX,i=this.rightChildOX,n=this.childOXExceedLeft(t),s=this.childOXExeceedRight(t);this.clampChildOX&&(this.childVisibleWidth>this.childWidth?t=0:n?t=e:s&&(t=i)),this._childOX!==t&&(this._childOX=t,this.resetChildPosition()),n&&(this.execeedLeftState||this.emit("execeedleft",this,t,e)),this.execeedLeftState=n,s&&(this.execeedRightState||this.emit("execeedright",this,t,i)),this.execeedRightState=s;}},{key:"setChildOY",value:function(t){return this.childOY=t,this}},{key:"setChildOX",value:function(t){return this.childOX=t,this}},{key:"t",get:function(){var t=this.visibleHeight;return 0===t?0:this.childOY/-t},set:function(t){this.childOY=-this.visibleHeight*t;}},{key:"s",get:function(){var t=this.visibleWidth;return 0===t?0:this.childOX/-t},set:function(t){this.childOX=-this.visibleWidth*t;}},{key:"setChildOYByPercentage",value:function(t){return this.t=t,this}},{key:"setChildOXByPercentage",value:function(t){return this.s=t,this}}]),i}(Hy);Object.assign(_T.prototype,PT);var LT=["top","bottom","centerY","center"],RT=["left","right","centerX","center"],BT=function(t,e,i){var n,s="Y"===(e=e.toUpperCase()),r=this.childrenMap.child;if(s){if(i)for(var o=0,a=LT.length;o=0?0:Math.abs(l)<=Math.abs(u)?l:u;}}else {if(i)for(o=0,a=RT.length;o=0?0:Math.abs(c)<=Math.abs(d)?c:d;}}switch(this.scrollMode){case 0:case 1:this.childOY+=n;break;default:this["childO".concat(e)]+=n;}},jT=Phaser.Utils.Objects.GetValue,DT=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=qx(s),a=jT(s,"panel",void 0);void 0===a&&(a={}),a.scrollMode=o,a.clamplChildOY=jT(s,"clamplChildOY",!1),a.clamplChildOX=jT(s,"clamplChildOX",!1);var h,l,u=new _T(t,a);switch(t.add.existing(u),o){case 0:h=jT(s,"expand.panel",!0),l=!0;break;case 1:h=!0,l=jT(s,"expand.panel",!0);break;default:h=!0,l=!0;}s.type="rexScrollablePanel",s.child={gameObject:u,expandWidth:h,expandHeight:l,align:jT(s,"align.panel","center")};var c=jT(s,"space",void 0);return c&&(c.child=jT(c,"panel",0)),(r=e.call(this,t,s)).addChildrenMap("panel",u.child),r.addChildrenMap("panelLayer",u.maskLayer),r.addChildrenMap("mask",u.maskGameObject),r.addChildrenMap("scrollableBlock",u),r}return r(i,[{key:"setChildrenInteractive",value:function(t){return void 0===t&&(t={}),t.hasOwnProperty("eventEmitter")||(t.eventEmitter=this),t.hasOwnProperty("targets")||(t.targets=[this.childrenMap.panel]),Vy(this.childrenMap.child,t),this}}]),i}(Qw),AT={scrollToChild:function(t,e){if(!this.hasChild(t))return this;switch(this.scrollMode){case 0:BT.call(this,t,"y",e);break;case 1:BT.call(this,t,"x",e);break;default:BT.call(this,t,"y",e),BT.call(this,t,"x",e);}return this}};Object.assign(DT.prototype,AT),Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue;for(var IT,zT=function(t,e,i){void 0===i&&(i=!0),i?e=e?xe(e):{}:e||(e={});var n=new bc(t,e);return t.add.existing(n),n},FT=Phaser.Utils.Objects.GetValue,YT=Phaser.Display.Color,WT=Phaser.Display.Color.ColorToRGBA,VT=Phaser.Display.Color.HSVToRGB,XT=Phaser.Math.Clamp,GT=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),s.orientation=0,(r=e.call(this,t,s)).type="rexColorComponents",r.colorObject=new YT;var o=FT(s,"background",void 0),a=FT(s,"formatLabel",void 0);Xt(a)||(a=zx(t,a).resetDisplayContent());var h=[];if(s.inputText0&&s.inputText1&&s.inputText2)h.push(s.inputText0),h.push(s.inputText1),h.push(s.inputText2);else for(var l=FT(s,"inputText"),c=0;c<3;c++){var d=zT(t,l).setMaxLength(3).setNumberInput();h.push(d);}o&&r.addBackground(o);var f=FT(s,"proportion.formatLabel",0),p=!!a.isRexContainerLite,v=FT(s,"expand.formatLabel",p);r.add(a,{proportion:f,expand:v});f=void 0===FT(l,"width")?1:0,v=void 0===FT(l,"height"),c=0;for(var g=h.length;c0&&{height:this.colorComponentsHeight,formatLabel:this.colorComponentsFormatLabelConfig,inputText:this.colorComponentsInputTextConfig,space:this.colorComponentsSpace};var o=new MM(t,{width:n,height:r,background:e,space:this.colorPickerSpace,hPalette:{position:this.colorPickerHPalettePosition},colorComponents:s,value:this.value});return t.add.existing(o),o},_M={openColorPicker:function(){if(!this.colorPicker){var t=EM.call(this).layout(),e=new $O(t,{duration:{in:this.colorPickerEaseInDuration,out:this.colorPickerEaseOutDuration},transitIn:this.colorPickerTransitInCallback,transitOut:this.colorPickerTransitOutCallback,expandDirection:this.colorPickerExpandDirection,alignTargetX:this,alignTargetY:this,bounds:this.colorPickerBounds,touchOutsideClose:!0}).on("open",(function(){t.on("valuechange",(function(t){this.setValue(t);}),this);}),this).on("close",(function(){this.colorPicker=void 0,this.dropDownBehavior=void 0;}),this);return this.colorPicker=t,this.dropDownBehavior=e,this.pin(t),this}}};Object.assign(_M,sM);var LM=Phaser.Utils.Objects.GetValue,RM=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),(r=e.call(this,t,s)).type="rexColorInput",s.hasOwnProperty("colorPicker")||(s.colorPicker={background:{color:0}});var o=s.colorPicker,a=!1!==o&&null!==o;if(a){var h;r.setColorPickerSize(LM(o,"width",160),LM(o,"height",170));var l=LM(o,"background");h=l?function(t){return xC(t,l)}:LM(o,"createBackgroundCallback"),r.setCreateColorPickerBackgroundCallback(h),r.setColorPickerHPalettePosition(LM(o,"hPalettePosition",0)),r.setColorPickerExpandDirection(LM(o,"expandDirection")),r.setColorPickerEaseInDuration(LM(o,"easeIn",200)),r.setColorPickerEaseOutDuration(LM(o,"easeOut",200)),r.setColorPickerTransitInCallback(LM(o,"transitIn")),r.setColorPickerTransitOutCallback(LM(o,"transitOut")),r.setColorPickerBounds(LM(o,"bounds"));var c=LM(o,"space");void 0===c&&(c={left:10,right:10,top:10,bottom:10,item:8}),r.setColorPickerSpace(c);}var d=s.colorComponents;if(a&&(!1!==d&&null!==d)){r.setColorComponentsHeight(LM(d,"height",30)),r.setColorComponentsFormatLabelConfig(LM(d,"formatLabel"));var f=LM(d,"inputText");f||(f=LM(s,"inputText")),r.setColorComponentsInputTextConfig(f);var p=LM(d,"space");void 0===p&&(p={item:8}),r.setColorComponentsSpace(p);}var v=r.childrenMap.swatch;return v&&a&&r.onClick(v,r.openColorPicker,u(r)),r}return r(i)}(nM);Object.assign(RM.prototype,_M);var BM=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),s=BC(t,s),(r=e.call(this,t,s)).type="rexTweaker.Title",r}return r(i,[{key:"setTitle",value:function(t){return (t=t?xe(t):{}).hasOwnProperty("text")||(t.hasOwnProperty("title")?t.text=t.title:t.text=""),this.resetDisplayContent(t),this}}]),i}(CC),jM=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),(r=e.call(this,t,s)).type="rexTweaker.FolderTitle";var o=new Ef(t,s.expandedIcon);return t.add.existing(o),r.addSpace().add(o,{proportion:0,expand:!1,padding:1,fitRatio:1}),r.addChildrenMap("expandedIcon",o),r}return r(i,[{key:"setExpandedState",value:function(t){void 0===t&&(t=!0);var e=t?"down":"right";return this.childrenMap.expandedIcon.setDirection(e),this}}]),i}(BM),DM=function(t,e){var i=new _E(t,e);return t.add.existing(i),i},AM=function(t,e,i){return xC(t,i)},IM=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).type="rexTweaker.Folder",r}return r(i,[{key:"setTitle",value:function(t){return this.childrenMap.title.setTitle(t),this}}]),i}(xT);Object.assign(IM.prototype,{setBindingTarget:function(t){return this.childrenMap.child.setBindingTarget(t),this}},{getMaxInputRowTitleWidth:function(){return this.childrenMap.child.getMaxInputRowTitleWidth()+this.getInnerPadding("left")},setInputRowTitleWidth:function(t){return t-=this.getInnerPadding("left"),this.childrenMap.child.setInputRowTitleWidth(t),this}});var zM=Phaser.Utils.Objects.GetValue,FM=Phaser.Utils.Objects.GetValue,YM={getMaxInputRowTitleWidth:function(){for(var t=0,e=this.childrenMap.pages.children,i=0,n=e.length;i1?e-1:0),n=1;n0?0:1,o.setMinWidth(this.itemWidth)),this.add(o,{proportion:r,expand:!0}),n.onValueChange&&a.on("valuechange",n.onValueChange),n.onValidate&&a.setValidateCallback(n.onValidate),o.setAutoUpdateEnable(n.autoUpdate),o.setBindingTarget(t,e),n.monitor&&o.startMonitorTarget(),n.key&&this.root.addChildrenMap(n.key,o),this},addButton:PE,addButtons:PE,addSeparator:function(t){var e=this.scene,i=TE(this.styles,"separator"),n=AM(e,0,i);return this.add(n,{expand:!0}),this},setBindingTarget:function(t){for(var e=this.sizerChildren,i=0,n=e.length;i0}},{key:"drawX",get:function(){var t=this.x+this.leftSpace+this.offsetX-this.originX*this.width;return this.parent._textOX*this.scrollFactorX+t}},{key:"drawY",get:function(){var t=this.y+this.offsetY;return this.parent._textOY*this.scrollFactorY+t}},{key:"drawTLX",get:function(){return 0}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return 0}},{key:"drawBLY",get:function(){return 0}},{key:"drawTRX",get:function(){return 0}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return 0}},{key:"drawBRY",get:function(){return 0}},{key:"drawCenterX",get:function(){return (this.drawTRX+this.drawTLX)/2}},{key:"drawCenterY",get:function(){return (this.drawBLY+this.drawTLY)/2}}]),i}(fr);Object.assign(Br.prototype,Er);var jr=function(t,e,i){return e.hasOwnProperty(t)?e[t]:i[t]},Dr=Phaser.Utils.Objects.GetValue,Ar=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,"background")).setScrollFactor(0),r.setColor(Dr(s,"color",null),Dr(s,"color2",null),Dr(s,"horizontalGradient",!0)),r.setStroke(Dr(s,"stroke",null),Dr(s,"strokeThickness",2)),r.setCornerRadius(Dr(s,"cornerRadius",0),Dr(s,"cornerIteration",null)),r}return r(i,[{key:"color",get:function(){return this._color},set:function(t){t=mn(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=mn(t,this.canvas,this.context),this.setDirty(this._color2!=t),this._color2=t;}},{key:"horizontalGradient",get:function(){return this._horizontalGradient},set:function(t){this.setDirty(this._horizontalGradient!=t),this._horizontalGradient=t;}},{key:"setColor",value:function(t,e,i){return void 0===i&&(i=!0),this.color=t,this.color2=e,this.horizontalGradient=i,this}},{key:"stroke",get:function(){return this._stroke},set:function(t){t=mn(t,this.canvas,this.context),this.setDirty(this._stroke!=t),this._stroke=t;}},{key:"strokeThickness",get:function(){return this._strokeThickness},set:function(t){this.setDirty(this._strokeThickness!=t),this._strokeThickness=t;}},{key:"setStroke",value:function(t,e){return null!=t&&void 0===e&&(e=2),this.stroke=t,this.strokeThickness=e,this}},{key:"cornerRadius",get:function(){return this._cornerRadius},set:function(t){this.setDirty(this._cornerRadius!=t),this._cornerRadius=t;}},{key:"cornerIteration",get:function(){return this._cornerIteration},set:function(t){this.setDirty(this._cornerIteration!=t),this._cornerIteration=t;}},{key:"modifyStyle",value:function(t){return t.hasOwnProperty("color")&&this.setColor(t.color,jr("color2",t,this),jr("horizontalGradient",t,this)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,jr("strokeThickness",t,this)),t.hasOwnProperty("cornerRadius")&&this.setCornerRadius(t.cornerRadius,jr("cornerIteration",t,this)),this}},{key:"modifyPorperties",value:function(t){return p(h(i.prototype),"modifyPorperties",this).call(this,t),this.modifyStyle(t),this}},{key:"setCornerRadius",value:function(t,e){return this.cornerRadius=t,this.cornerIteration=e,this}},{key:"renderContent",value:function(){On(this.parent,this.color,this.stroke,this.strokeThickness,this.cornerRadius,this.color2,this.horizontalGradient,this.cornerIteration);}}]),i}(Br),Ir=Phaser.Utils.Objects.GetValue,zr=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,"innerbounds")).setScrollFactor(0),r.setColor(Ir(s,"color",null),Ir(s,"color2",null),Ir(s,"horizontalGradient",!0)),r.setStroke(Ir(s,"stroke",null),Ir(s,"strokeThickness",2)),r}return r(i,[{key:"color",get:function(){return this._color},set:function(t){t=mn(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=mn(t,this.canvas,this.context),this.setDirty(this._color2!=t),this._color2=t;}},{key:"horizontalGradient",get:function(){return this._horizontalGradient},set:function(t){this.setDirty(this._horizontalGradient!=t),this._horizontalGradient=t;}},{key:"setColor",value:function(t,e,i){return void 0===i&&(i=!0),this.color=t,this.color2=e,this.horizontalGradient=i,this}},{key:"stroke",get:function(){return this._stroke},set:function(t){t=mn(t,this.canvas,this.context),this.setDirty(this._stroke!=t),this._stroke=t;}},{key:"strokeThickness",get:function(){return this._strokeThickness},set:function(t){this.setDirty(this._strokeThickness!=t),this._strokeThickness=t;}},{key:"setStroke",value:function(t,e){return null!=t&&void 0===e&&(e=2),this.stroke=t,this.strokeThickness=e,this}},{key:"modifyPorperties",value:function(t){p(h(i.prototype),"modifyPorperties",this).call(this,t),t.hasOwnProperty("color")&&this.setColor(t.color,Ir(t,"color2",null),Ir(t,"horizontalGradient",!0)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,Ir(t,"strokeThickness",2));}},{key:"renderContent",value:function(){var t=this.parent.padding,e=t.left,i=t.top,n=this.parent.width-t.left-t.right,s=this.parent.height-t.top-t.bottom,r=this.context;if(null!=this.color){var o,a;if(null!=this.color2)(a=this.horizontalGradient?r.createLinearGradient(0,0,n,0):r.createLinearGradient(0,0,0,s)).addColorStop(0,this.color),a.addColorStop(1,this.color2),o=a;else o=this.color;r.fillStyle=o,r.fillRect(e,i,n,s);}null!=this.stroke&&this.strokeThickness>0&&(r.strokeStyle=this.stroke,r.lineWidth=this.strokeThickness,r.strokeRect(e,i,n,s));}}]),i}(Br),Fr=Phaser.Utils.Objects.GetValue,Yr=function(){function t(e,i){n(this,t),this.parent=e,this.set(i);}return r(t,[{key:"toJSON",value:function(){return {bold:this.bold,italic:this.italic,fontSize:this.fontSize,fontFamily:this.fontFamily,color:this.color,stroke:this.stroke,strokeThickness:this.strokeThickness,shaodwColor:this.shadowColor,shadowBlur:this.shadowBlur,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,offsetX:this.offsetX,offsetY:this.offsetY,leftSpace:this.leftSpace,rightSpace:this.rightSpace,backgroundHeight:this.backgroundHeight,backgroundBottomY:this.backgroundBottomY,align:this.align}}},{key:"set",value:function(t){return this.setBold(Fr(t,"bold",!1)),this.setItalic(Fr(t,"italic",!1)),this.setFontSize(Fr(t,"fontSize","16px")),this.setFontFamily(Fr(t,"fontFamily","Courier")),this.setColor(Fr(t,"color","#fff")),this.setStrokeStyle(Fr(t,"stroke",null),Fr(t,"strokeThickness",0)),this.setShadow(Fr(t,"shadowColor",null),Fr(t,"shadowOffsetX",0),Fr(t,"shadowOffsetY",0),Fr(t,"shadowBlur",0)),this.setOffset(Fr(t,"offsetX",0),Fr(t,"offsetY",0)),this.setSpace(Fr(t,"leftSpace",0),Fr(t,"rightSpace",0)),this.setAlign(Fr(t,"align",void 0)),this.setBackgroundColor(Fr(t,"backgroundColor",null)),this.setBackgroundHeight(Fr(t,"backgroundHeight",void 0)),this.setBackgroundBottomY(Fr(t,"backgroundBottomY",void 0)),this}},{key:"modify",value:function(t){return t.hasOwnProperty("bold")&&this.setBold(t.bold),t.hasOwnProperty("italic")&&this.setItalic(t.italic),t.hasOwnProperty("fontSize")&&this.setFontSize(t.fontSize),t.hasOwnProperty("fontFamily")&&this.setFontFamily(t.fontFamily),t.hasOwnProperty("color")&&this.setColor(t.color),(t.hasOwnProperty("stroke")||t.hasOwnProperty("strokeThickness"))&&this.setStrokeStyle(jr("stroke",t,this),jr("strokeThickness",t,this)),t.hasOwnProperty("shadowColor")&&this.setShadowColor(t.shadowColor),(t.hasOwnProperty("shadowOffsetX")||t.hasOwnProperty("shadowOffsetY"))&&this.setShadowOffset(jr("shadowOffsetX",t,this),jr("shadowOffsetY",t,this)),t.hasOwnProperty("shadowBlur")&&this.setShadowBlur(t.shaodwBlur),t.hasOwnProperty("offsetX")&&this.setOffsetX(t.offsetX),t.hasOwnProperty("offsetY")&&this.setOffsetY(t.offsetY),t.hasOwnProperty("leftSpace")&&this.setLeftSpace(t.leftSpace),t.hasOwnProperty("rightSpace")&&this.setRightSpace(t.rightSpace),t.hasOwnProperty("align")&&this.setAlign(t.align),t.hasOwnProperty("backgroundColor")&&this.setBackgroundColor(t.backgroundColor),t.hasOwnProperty("backgroundHeight")&&this.setBackgroundHeight(t.backgroundHeight),t.hasOwnProperty("backgroundBottomY")&&this.setBackgroundBottomY(t.backgroundBottomY),this}},{key:"setUpdateTextFlag",value:function(){return this.parent&&(this.parent.updateTextFlag=!0),this}},{key:"clone",value:function(){return new t(null,this.toJSON())}},{key:"copyFrom",value:function(t){return this.set(t.toJSON()),this}},{key:"copyTo",value:function(t){return t.set(this.toJSON()),this}},{key:"setBold",value:function(t){return void 0===t&&(t=!0),this.bold=t,this.setUpdateTextFlag(),this}},{key:"setItalic",value:function(t){return void 0===t&&(t=!0),this.italic=t,this.setUpdateTextFlag(),this}},{key:"fontStyle",get:function(){return this.bold&&this.italic?"bold italic":this.bold?"bold":this.italic?"italic":""}},{key:"setFontSize",value:function(t){return "number"==typeof t&&(t="".concat(t,"px")),this.fontSize=t,this.setUpdateTextFlag(),this}},{key:"setFontFamily",value:function(t){return this.fontFamily=t,this.setUpdateTextFlag(),this}},{key:"font",get:function(){return "".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily)}},{key:"setColor",value:function(t){return this.color=mn(t),this}},{key:"hasFill",get:function(){return null!=this.color}},{key:"setStrokeStyle",value:function(t,e){return this.stroke=mn(t),void 0!==e&&(this.strokeThickness=e),this}},{key:"setStrokeThickness",value:function(t){return this.strokeThickness=t,this}},{key:"hasStroke",get:function(){return null!=this.stroke&&this.strokeThickness>0}},{key:"setShadowColor",value:function(t){return this.shadowColor=mn(t),this}},{key:"setShadowOffset",value:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.shadowOffsetX=t,this.shadowOffsetY=e,this}},{key:"setShadowBlur",value:function(t){return void 0===t&&(t=0),this.shaodwBlur=t,this}},{key:"setShadow",value:function(t,e,i,n){return this.setShadowColor(t).setShadowOffset(e,i).setShadowBlur(n),this}},{key:"setBackgroundColor",value:function(t){return this.backgroundColor=mn(t),this}},{key:"hasBackgroundColor",get:function(){return null!=this.backgroundColor}},{key:"setBackgroundHeight",value:function(t){return this.backgroundHeight=t,this}},{key:"setBackgroundBottomY",value:function(t){return this.backgroundBottomY=t,this}},{key:"setOffsetX",value:function(t){return void 0===t&&(t=0),this.offsetX=t,this}},{key:"setOffsetY",value:function(t){return void 0===t&&(t=0),this.offsetY=t,this}},{key:"setOffset",value:function(t,e){return this.setOffsetX(t).setOffsetY(e),this}},{key:"setLeftSpace",value:function(t){return void 0===t&&(t=0),this.leftSpace=t,this}},{key:"setRightSpace",value:function(t){return void 0===t&&(t=0),this.rightSpace=t,this}},{key:"setSpace",value:function(t,e){return this.setLeftSpace(t).setRightSpace(e),this}},{key:"setAlign",value:function(t){return this.align=t,this}},{key:"syncFont",value:function(t){return t.font=this.font,this}},{key:"syncStyle",value:function(t){t.textBaseline="alphabetic";var e=this.hasFill,i=this.hasStroke;return t.fillStyle=e?this.color:"#000",t.strokeStyle=i?this.stroke:"#000",t.lineWidth=i?this.strokeThickness:0,t.lineCap="round",t.lineJoin="round",this}},{key:"syncShadow",value:function(t){null!=t.shadowColor?(t.shadowColor=this.shadowColor,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowBlur=this.shadowBlur):(t.shadowColor=0,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0);}},{key:"getTextMetrics",value:function(t,e){return this.syncFont(t).syncStyle(t),t.measureText(e)}}]),t}(),Wr=Phaser.Utils.Array.Remove,Vr=Phaser.Utils.Array.Remove,Xr="text",Gr="image",Hr="drawer",Ur="space",Nr="command",Kr=function(t){return t.type===Xr&&"\n"===t.text},Jr=function(t){return t.type===Xr&&"\f"===t.text},Zr=function(t){return t.type===Xr},qr=function(t){return t.type===Nr},$r=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;return n(this,i),(o=e.call(this,t,Xr)).updateTextFlag=!1,o.style=new Yr(u(o),r),o.setText(s),o}return r(i,[{key:"autoRound",get:function(){return this.parent.autoRound}},{key:"offsetX",get:function(){return this.style.offsetX},set:function(t){this.style&&(this.style.offsetX=t);}},{key:"offsetY",get:function(){return this.style.offsetY},set:function(t){this.style&&(this.style.offsetY=t);}},{key:"leftSpace",get:function(){return this.style.leftSpace*this.scaleX},set:function(t){this.style&&(this.style.leftSpace=t),g(h(i.prototype),"leftSpace",t,this,!0);}},{key:"rightSpace",get:function(){return this.style.rightSpace*this.scaleX},set:function(t){this.style&&(this.style.rightSpace=t),g(h(i.prototype),"rightSpace",t,this,!0);}},{key:"align",get:function(){return this.style.align},set:function(t){this.style&&(this.style.align=t);}},{key:"modifyStyle",value:function(t){return this.setDirty(!0),this.style.modify(t),this.updateTextFlag&&this.updateTextSize(),this}},{key:"modifyPorperties",value:function(t){return t?(this.modifyStyle(t),p(h(i.prototype),"modifyPorperties",this).call(this,t),this):this}},{key:"setText",value:function(t){return this.setDirty(this.text!=t),this.text=t,this.updateTextSize(),this}},{key:"updateTextSize",value:function(){var t=this.text;if("\n"===t||"\f"===t||""===t)this.clearTextSize();else {var e,i,n=this.style.getTextMetrics(this.context,this.text);this.textWidth=n.width,"actualBoundingBoxAscent"in n?(e=n.actualBoundingBoxAscent,i=n.actualBoundingBoxDescent):(e=0,i=0),this.textHeight=e+i,this.ascent=e,this.descent=i;}return this.updateTextFlag=!1,this}},{key:"clearTextSize",value:function(){return this.textWidth=0,this.textHeight=0,this.ascent=0,this.descent=0,this}},{key:"copyTextSize",value:function(t){return this.textWidth=t.textWidth,this.textHeight=t.textHeight,this.ascent=t.ascent,this.descent=t.descent,this}},{key:"width",get:function(){return this.textWidth*this.scaleX},set:function(t){this.textWidth>0?this.scaleX=t/this.textWidth:this.scaleX=1;}},{key:"height",get:function(){return this.textHeight*this.scaleY},set:function(t){this.textHeight>0?this.scaleY=t/this.textHeight:this.scaleY=1;}},{key:"willRender",get:function(){return 0!==this.textWidth&&p(h(i.prototype),"willRender",this)}},{key:"renderContent",value:function(){var t=this.context,e=this.style;if(e.hasBackgroundColor){t.fillStyle=e.backgroundColor;var i=this.drawTLX,n=this.drawTRX-i,s=e.backgroundBottomY;null==s&&(s=this.drawBLY);var r=e.backgroundHeight;null==r&&(r=s-this.drawTLY);var o=s-r;t.fillRect(i,o,n,r);}var a=e.hasFill,h=e.hasStroke;(a||h)&&(e.syncFont(t).syncStyle(t),h&&(e.syncShadow(t),t.strokeText(this.text,0,0)),a&&(e.syncShadow(t),t.fillText(this.text,0,0)));}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return -this.ascent}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.descent}},{key:"drawTRX",get:function(){return this.textWidth+this.rightSpace}},{key:"drawTRY",get:function(){return -this.ascent}},{key:"drawBRX",get:function(){return this.textWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.descent}}]),i}(Br),Qr=function(t,e){var i=this.createCharChildren(t,e);return this.addChild(i),this},to=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;return n(this,i),(o=e.call(this,t,Gr)).setTexture(s,r),o}return r(i,[{key:"frameWidth",get:function(){return this.frameObj?this.frameObj.cutWidth:0}},{key:"frameHeight",get:function(){return this.frameObj?this.frameObj.cutHeight:0}},{key:"offsetY",get:function(){return -this.height},set:function(t){}},{key:"key",get:function(){return this._key},set:function(t){this.setDirty(this._key!=t),this._key=t;}},{key:"frame",get:function(){return this._frame},set:function(t){this.setDirty(this._frame!=t),this._frame=t;}},{key:"setTexture",value:function(t,e){return this.key=t,this.frame=e,this.frameObj=this.scene.sys.textures.getFrame(t,e),this}},{key:"width",get:function(){return this.frameWidth*this.scaleX},set:function(t){this.setDirty(this.width!==t),this.scaleX=t/this.frameWidth;}},{key:"height",get:function(){return this.frameHeight*this.scaleY},set:function(t){this.setDirty(this.height!==t),this.scaleY=t/this.frameHeight;}},{key:"setHeight",value:function(t,e){return void 0===e&&(e=!1),this.height=t,e&&(this.scaleX=this.scaleY),this}},{key:"renderContent",value:function(){var t=this.context,e=this.frameObj,i=this.frameWidth,n=this.frameHeight;t.drawImage(e.source.image,e.cutX,e.cutY,i,n,0,0,i,n);}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.frameHeight}},{key:"drawTRX",get:function(){return this.frameWidth+this.rightSpace}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return this.frameWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.frameHeight}}]),i}(Br),eo=function(t,e,i){var n=this.createImageChild(t,e,i);return this.addChild(n),this},io=function(t){a(i,t);var e=d(i);function i(t,s,r,o){var a;return n(this,i),(a=e.call(this,t,Hr)).setRenderCallback(s),a.setDrawerSize(r,o),a}return r(i,[{key:"setRenderCallback",value:function(t){return t?this.renderContent=t.bind(this):delete this.renderContent,this}},{key:"setDrawerSize",value:function(t,e){return !0===t?(this.toLocalPosition=!1,t=void 0,e=void 0):this.toLocalPosition=!0,void 0===t&&(t=0),void 0===e&&(e=t),this.drawerWidth=t,this.drawerHeight=e,this}},{key:"onFree",value:function(){p(h(i.prototype),"onFree",this).call(this),this.setRenderCallback();}},{key:"width",get:function(){return this.drawerWidth*this.scaleX},set:function(t){this.setDirty(this.width!==t),this.scaleX=this.drawerWidth>0?t/this.drawerWidth:1;}},{key:"height",get:function(){return this.drawerHeight*this.scaleY},set:function(t){this.setDirty(this.height!==t),this.scaleY=this.drawerHeight>0?t/this.drawerHeight:1;}},{key:"offsetY",get:function(){return -this.height},set:function(t){}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.drawerHeight}},{key:"drawTRX",get:function(){return this.drawerWidth+this.rightSpace}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return this.drawerWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.drawerHeight}}]),i}(Br),no=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,Ur)).setSpaceWidth(s),r}return r(i,[{key:"width",get:function(){return this.spaceWidth*this.scaleX},set:function(t){this.spaceWidth>0?this.scaleX=t/this.spaceWidth:this.scaleX=1;}},{key:"setSpaceWidth",value:function(t){return this.spaceWidth=t,this}}]),i}(Br),so=function(t){var e=this.createSpaceChild(t);return this.addChild(e),this},ro=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a){var h;return n(this,i),(h=e.call(this,t,Nr)).setName(s).setParameter(o).setCallback(r,a),h}return r(i,[{key:"setName",value:function(t){return this.name=t,this}},{key:"setParameter",value:function(t){return this.param=t,this}},{key:"setCallback",value:function(t,e){return this.callback=t,this.scope=e,this}},{key:"exec",value:function(){return this.scope?this.callback.call(this.scope,this.param,this.name):this.callback(this.param,this.name)}},{key:"onFree",value:function(){p(h(i.prototype),"onFree",this).call(this),this.setName().setCallback().setParameter();}}]),i}(fr),oo=function(t,e,i,n){var s=this.createCommandChild(t,e,i,n);return this.addChild(s),this},ao=function(t){var e={callback:void 0,start:0,isLastPage:!1,maxLines:void 0,padding:void 0,letterSpacing:void 0,hAlign:void 0,vAlign:void 0,children:[],lines:[],maxLineWidth:0,linesHeight:0,lineHeight:void 0,maxLineHeight:0,linesWidth:0,lineWidth:void 0};return Object.assign(e,t)},ho=function(t,e,i,n){void 0===n&&(n={word:[],width:0}),n.word.length=0;for(var s=t.length,r=e,o=n.word,a=0;r0&&!a){var h=this.fixedHeight-n;if(i>0)r=h/i;else r=(l=co.call(this)).height,o=l.ascent,i=Math.floor((h-o)/r);}else {var l;r=(l=co.call(this)).height,o=l.ascent;}}else if(this.fixedHeight>0){if(void 0===(i=po(t,"maxLines"))){h=this.fixedHeight-n;i=Math.floor(h/r);}}else i=po(t,"maxLines",0);void 0===o&&(o=r);var u=0===i,c=po(t,"wrapWidth",void 0);void 0===c&&(c=this.fixedWidth>0?this.fixedWidth-s:1/0);for(var d=po(t,"letterSpacing",0),f=po(t,"hAlign",0),p=po(t,"vAlign",0),v=po(t,"charWrap",!1),g=ao({callback:"runWordWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:f,vAlign:p,ascent:o,lineHeight:r,wrapWidth:c,charWrap:v}),y=this.children,k=0,m=y.length;k0&&(M.push({children:E,width:_}),L=Math.max(L,_)),g.start+=T.length,g.isLastPage=!R&&g.start===P,g.maxLineWidth=L,g.linesHeight=M.length*r;var F=this.fixedWidth>0?this.fixedWidth:g.maxLineWidth+s,Y=this.fixedHeight>0?this.fixedHeight:g.linesHeight+n;!function(t,e,i){var n,s,r=t.hAlign,o=t.vAlign,a=t.linesHeight;switch(o){case 1:case"center":s=(i-a)/2;break;case 2:case"bottom":s=i-a;break;default:s=0;}for(var h=t.lines,l=0,u=h.length;l0?(o=this.fixedWidth-s)/i:0;else if(this.fixedWidth>0){if(void 0===(i=yo(t,"maxLines",void 0))){var o=this.fixedWidth-s;i=Math.floor(o/r)+1;}}else i=yo(t,"maxLines",0);var a=0===i,h=yo(t,"fixedCharacterHeight",void 0);if(void 0===h){var l=yo(t,"charPerLine",void 0);if(void 0!==l){var u=this.fixedHeight-n;h=Math.floor(u/l);}}var c=yo(t,"wrapHeight",void 0);void 0===c&&(c=this.fixedHeight>0?this.fixedHeight-n:1/0);for(var d=yo(t,"letterSpacing",0),f=yo(t,"rtl",!0),p=yo(t,"hAlign",f?2:0),v=yo(t,"vAlign",0),g=ao({callback:"runVerticalWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:p,vAlign:v,lineWidth:r,fixedCharacterHeight:h,wrapHeight:c,rtl:f}),y=this.children,k=0,m=y.length;k0&&(M.push({children:E,height:_}),L=Math.max(L,_)),g.start+=T.length,g.isLastPage=g.start===P,g.maxLineHeight=L,g.linesWidth=M.length*r;var I=this.fixedWidth>0?this.fixedWidth:g.linesWidth+s,z=this.fixedHeight>0?this.fixedHeight:g.maxLineHeight+n;!function(t,e,i){var n,s,r=t.hAlign,o=t.vAlign,a=t.rtl,h=t.lines,l=t.lineWidth,u=t.linesWidth;switch(r){case 1:case"center":n=(e-u)/2;break;case 2:case"right":n=e-u;break;default:n=0;}a&&(n+=l);for(var c=0,d=h.length;c0?t:this.width,e>0?e:this.height)),this},setPadding:function(t,e){var i=this.padding,n=i.left,s=i.right,r=i.top,o=i.bottom;return dr(i,t,e),this.dirty=this.dirty||n!=i.left||s!=i.right||r!=i.top||o!=i.bottom,this},getPadding:function(t){return cr(this.padding,t)},modifyTextStyle:function(t){return this.textStyle.modify(t),this},modifyDefaultTextStyle:function(t){return this.defaultTextStyle.modify(t),this},resetTextStyle:function(){return this.textStyle.copyFrom(this.defaultTextStyle),this},setTestString:function(t){return this.testString=t,this},removeChild:function(t){return this.poolManager.free(t),Wr(this.children,t),this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},removeChildren:function(){return this.poolManager.freeMultiple(this.children),this.children.length=0,this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},popChild:function(t){return Vr(this.children,t),this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},clearContent:function(){return this.setText(),this},addChild:function(t,e){var i,n,s,r=Array.isArray(t);void 0===e||e===this.children.length?r?(i=this.children).push.apply(i,m(t)):this.children.push(t):r?(n=this.children).splice.apply(n,[e,0].concat(m(t))):this.children.splice(e,0,t);(this.lastAppendedChildren.length=0,r)?(s=this.lastAppendedChildren).push.apply(s,m(t)):this.lastAppendedChildren.push(t);return this},createCharChild:function(t,e){e&&this.textStyle.modify(e);var i=this.poolManager.allocate(Xr);return null===i?i=new $r(this,t,this.textStyle):i.setParent(this).setActive().modifyStyle(this.textStyle).setText(t),i},createCharChildren:function(t,e){e&&this.textStyle.modify(e);for(var i=[],n=0,s=t.length;ne&&(n=e,s=t);})),s},getCharWorldPosition:function(t,e,i,n){return "number"==typeof t&&(t=this.getCharChild(t,!0)),Mr(this,t,e,i,n)},setToMinSize:function(){for(var t=this.children,e=0,i=0,n=0,s=t.length;n=i.length&&(t=i.length);for(var n=0,s=0;s1?i-1:0),s=1;s0&&void 0!==t.setTint},useAlphaFadeEffect:function(t){return (void 0===this.fadeMode||1===this.fadeMode)&&this.fadeTime>0&&void 0!==t.setAlpha},useRevealEffect:function(t){return this.fadeMode>=2&&this.fadeMode<=5&&this.fadeTime>0&&(t.preFX||t.postFX)},fadeBob:function(t,e,i,n){var s=t.gameObject;if(this.useTintFadeEffect(s))void 0!==e&&t.setProperty("tintGray",255*e),t.easeProperty("tintGray",Math.floor(255*i),this.fadeTime,"Linear",0,!1,n);else if(this.useAlphaFadeEffect(s))void 0!==e&&t.setProperty("alpha",e),t.easeProperty("alpha",i,this.fadeTime,"Linear",0,!1,n);else if(this.useRevealEffect(s)){var r;switch(Qo(s,"reveal"),this.fadeMode){case 2:r="revealUp";break;case 3:r="revealDown";break;case 4:r="revealLeft";break;case 5:r="revealRight";}void 0===e&&(e=0),s[r]=e,t.easeProperty(r,i,this.fadeTime,"Linear",0,!1,n),t.getTweenTask(r).once("complete",(function(){s[r]=null;}));}else n&&n(s);return this}},ia=function(t){return t>>16&255},na=function(t){return t>>8&255},sa=function(t){return 255&t},ra=Phaser.Events.EventEmitter,oa=function(t,e,i,n,s,r){return void 0===r?r={}:!0===r&&(r=aa),"number"!=typeof i&&(i=0,n=0),r.x=s.x+s.width*t+i,r.y=s.y+s.height*e+n,r},aa={},ha=function(t,e,i,n,s,r,o){if(t.hasOwnProperty("vp"))return t;"function"==typeof i&&(o=i,i=void 0),"function"==typeof s&&(o=s,s=void 0),void 0===i&&(i=.5),void 0===n&&(n=.5),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=oa),function(t){if(t.events)return t;var e=new ra,i=t.x;Object.defineProperty(t,"x",{get:function(){return i},set:function(n){i!==n&&(i=n,e.emit("update",t));}});var n=t.y;Object.defineProperty(t,"y",{get:function(){return n},set:function(i){n!==i&&(n=i,e.emit("update",t));}});var s=t.width;Object.defineProperty(t,"width",{get:function(){return s},set:function(i){s!==i&&(s=i,e.emit("update",t));}});var r=t.height;Object.defineProperty(t,"height",{get:function(){return r},set:function(i){r!==i&&(r=i,e.emit("update",t));}}),t.events=e;}(e);var a=e.events;t.vp=e;var h=function(){o(i,n,s,r,e,t);};a.on("update",h),t.once("destroy",(function(){a.off("update",h),t.vp=void 0;})),Object.defineProperty(t,"vpx",{get:function(){return i},set:function(t){i!==t&&(i=t,h());}}),Object.defineProperty(t,"vpy",{get:function(){return n},set:function(t){n!==t&&(n=t,h());}}),Object.defineProperty(t,"vpxOffset",{get:function(){return s},set:function(t){s!==t&&(s=t,h());}}),Object.defineProperty(t,"vpyOffset",{get:function(){return r},set:function(t){r!==t&&(r=t,h());}}),h();},la=Phaser.Utils.Array.Remove,ua={has:function(t){return this.bobs.hasOwnProperty(t)},exists:function(t){return this.bobs.hasOwnProperty(t)},get:function(t){return this.bobs[t]},getGO:function(t){var e=this.get(t);return e?e.gameObject:null},addGO:function(t,e){this.remove(t,!0),this.useTintFadeEffect(e)&&function(t,e){if(t.hasOwnProperty("tintR"))return t;void 0===e&&(e=16777215);var i=ia(e),n=na(e),s=sa(e);Object.defineProperty(t,"tint",{get:function(){return e},set:function(r){r=16777215&Math.floor(r),t.setTint&&t.setTint(r),e!==r&&(i=ia(e=r),n=na(e),s=sa(e));}}),Object.defineProperty(t,"tintR",{get:function(){return i},set:function(n){n=255&Math.floor(n),i!==n&&(i=n,t.tint=(255&n)<<16|65535&e);}}),Object.defineProperty(t,"tintG",{get:function(){return n},set:function(i){i=255&Math.floor(i),n!==i&&(n=i,t.tint=(255&i)<<8|16711935&e);}}),Object.defineProperty(t,"tintB",{get:function(){return s},set:function(i){i=255&Math.floor(i),s!==i&&(s=i,t.tint=255&i|16776960&e);}}),Object.defineProperty(t,"tintGray",{get:function(){return Math.floor((i+n+s)/3)},set:function(e){e=255&Math.floor(e),i===e&&n===e&&s===e||(i=e,n=e,s=e,t.tint=(255&e)<<16|(255&e)<<8|255&e);}}),t.tint=e;}(e),this.viewportCoordinateEnable&&ha(e,this.viewport),this.effectPropertiesConfig&&Qo(e,this.effectPropertiesConfig),e.once("destroy",(function(){la(this.removedGOs,e),this.isEmpty&&this.emit("empty");}),this);var i=new this.BobClass(this,e,t);return this.bobs[t]=i,this},add:function(t){for(var e=this.createGameObjectCallback,i=this.createGameObjectScope,n=arguments.length,s=new Array(n>1?n-1:0),r=1;r2?n-2:0),r=2;r0?-this.delay:0,this.state=this.nowTime>=0?Fa:za,this.repeatCounter=0,this}},{key:"stop",value:function(){return this.state=Ia,this}},{key:"update",value:function(t,e){this.state!==Ia&&this.state!==Wa&&0!==e&&0!==this.timeScale&&(this.nowTime+=e*this.timeScale,this.justRestart=!1,this.nowTime>=this.duration?-1===this.repeat||this.repeatCounter0&&(this.nowTime-=this.repeatDelay,this.state=Ya)):(this.nowTime=this.duration,this.state=Wa):this.nowTime>=0&&(this.state=Fa));}},{key:"t",get:function(){var t;switch(this.state){case Ia:case za:case Ya:t=0;break;case Fa:t=this.nowTime/this.duration;break;case Wa:t=1;}return Da(t,0,1)},set:function(t){(t=Da(t,-1,1))<0?(this.state=za,this.nowTime=-this.delay*t):(this.state=Fa,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===Ia}},{key:"isDelay",get:function(){return this.state===za}},{key:"isCountDown",get:function(){return this.state===Fa}},{key:"isRunning",get:function(){return this.state===za||this.state===Fa}},{key:"isDone",get:function(){return this.state===Wa}},{key:"isOddIteration",get:function(){return 1==(1&this.repeatCounter)}},{key:"isEvenIteration",get:function(){return 0==(1&this.repeatCounter)}}]),t}(),Ia=0,za=1,Fa=2,Ya=3,Wa=-1,Va=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).timer=new Aa,r}return r(i,[{key:"shutdown",value:function(t){this.isShutdown||(p(h(i.prototype),"shutdown",this).call(this,t),this.timer.destroy(),this.timer=void 0);}},{key:"start",value:function(){return this.timer.start(),p(h(i.prototype),"start",this).call(this),this}},{key:"stop",value:function(){return this.timer.stop(),p(h(i.prototype),"stop",this).call(this),this}},{key:"complete",value:function(){return this.timer.stop(),p(h(i.prototype),"complete",this).call(this),this}}]),i}(Ra),Xa=Phaser.Utils.Objects.GetValue,Ga=Phaser.Utils.Objects.GetAdvancedValue,Ha=Phaser.Tweens.Builders.GetEaseFunction,Ua=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"resetFromJSON",value:function(t){return this.timer.resetFromJSON(Xa(t,"timer")),this.setEnable(Xa(t,"enable",!0)),this.setTarget(Xa(t,"target",this.parent)),this.setDelay(Ga(t,"delay",0)),this.setDuration(Ga(t,"duration",1e3)),this.setEase(Xa(t,"ease","Linear")),this.setRepeat(Xa(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=Ha(t),this}},{key:"start",value:function(){return this.timer.isRunning||p(h(i.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),p(h(i.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){}}]),i}(Va),Na=Phaser.Sound.BaseSound,Ka=function(t){return t instanceof Na},Ja=Phaser.Utils.Objects.GetValue,Za=Phaser.Utils.Objects.GetAdvancedValue,qa=Phaser.Math.Linear,$a=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;return n(this,i),Ka(t)&&(r=s,s=t,t=void 0),s.active=!0,s.scene=t,s.game=s.manager.game,(o=e.call(this,s,r)).volume={},o.resetFromJSON(r),o}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setMode(Ja(t,"mode",0)),this.setEnable(Ja(t,"enable",!0)),this.setVolumeRange(Za(t,"volume.start",this.parent.volume),Za(t,"volume.end",0)),this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=Qa[t]),this.mode=t,this}},{key:"setVolumeRange",value:function(t,e){return this.volume.start=t,this.volume.end=e,this}},{key:"start",value:function(){return this.timer.isRunning||(this.parent.setVolume(this.volume.start),this.timer.setDelay(this.delay).setDuration(this.duration),p(h(i.prototype),"start",this).call(this)),this}},{key:"updateGameObject",value:function(t,e){t.volume=qa(this.volume.start,this.volume.end,e.t);}},{key:"complete",value:function(){switch(p(h(i.prototype),"complete",this).call(this),this.mode){case 1:this.parent.stop();break;case 2:this.parent.destroy();}return this}}]),i}(Ua),Qa={stop:1,destroy:2},th=function(t,e,i,n,s){Ka(t)&&(s=n,n=i,i=e,e=t,t=void 0),void 0===n&&(n=1),void 0===s&&(s=0);var r,o={mode:0,volume:{start:s,end:n},duration:i};return "string"==typeof e&&(e=t.sys.sound.add(e)),e.hasOwnProperty("_fade")?(r=e._fade).stop().resetFromJSON(o):(r=new $a(t,e,o),e._fade=r),r.start(),e.isPlaying||e.setVolume(s).play(),e},eh=function(t,e,i,n){Ka(t)&&(n=i,i=e,e=t,t=void 0),void 0===n&&(n=!0);var s,r={mode:n?2:1,volume:{start:e.volume,end:0},duration:i};return e.hasOwnProperty("_fade")?(s=e._fade).stop().resetFromJSON(r):(s=new $a(t,e,r),e._fade=s),s.start(),e.isPlaying||e.play(),e},ih=Phaser.Utils.Objects.GetValue,nh={setBackgroundMusicLoop:function(t){return void 0===t&&(t=!0),this.backgroundMusicLoop=t,this},setBackgroundMusicFadeTime:function(t){return this.backgroundMusicFadeTime=t,this},getBackgroundMusic:function(){return this.backgroundMusic},setCurrentBackgroundMusic:function(t){return this.backgroundMusic=t,t&&(t.once("complete",(function(){this.backgroundMusic===t&&(this.backgroundMusic.destroy(),this.backgroundMusic=void 0);}),this).once("destroy",(function(){this.backgroundMusic===t&&(this.backgroundMusic=void 0);}),this),t.isPlaying||t.play()),this},playBackgroundMusic:function(t,e){if(this.backgroundMusic&&this.backgroundMusic.key===t)return this;this.stopBackgroundMusic();var i=this.sound.add(t,{loop:ih(e,"loop",this.backgroundMusicLoop),mute:ih(e,"mute",this.backgroundMusicMute),volume:ih(e,"volume",this.backgroundMusicVolume),detune:ih(e,"detune",0),rate:ih(e,"rate",1)});return this.setCurrentBackgroundMusic(i),this.backgroundMusicFadeTime>0&&this.fadeInBackgroundMusic(this.backgroundMusicFadeTime),this},pauseBackgroundMusic:function(){return this.backgroundMusic&&this.backgroundMusic.pause(),this},resumeBackgroundMusic:function(){return this.backgroundMusic&&this.backgroundMusic.resume(),this},stopBackgroundMusic:function(){return this.backgroundMusic&&(this.backgroundMusicFadeTime>0?this.fadeOutBackgroundMusic(this.backgroundMusicFadeTime,!0):(this.backgroundMusic.stop(),this.backgroundMusic.destroy(),this.backgroundMusic=void 0)),this},fadeInBackgroundMusic:function(t){return this.backgroundMusic&&th(this.backgroundMusic,t,this.backgroundMusicVolume,0),this},fadeOutBackgroundMusic:function(t,e){return this.backgroundMusic&&eh(this.backgroundMusic,t,e),this},crossFadeBackgroundMusic:function(t,e){var i=this.backgroundMusicFadeTime;return this.backgroundMusicFadeTime=0,this.fadeOutBackgroundMusic(e,!0).playBackgroundMusic(t).fadeInBackgroundMusic(e),this.backgroundMusicFadeTime=i,this},setBackgroundMusicMute:function(t){return void 0===t&&(t=!0),this.backgroundMusicMute=t,this},setBackgroundMusicVolume:function(t){return this.backgroundMusicVolume=t,this},setBackgroundMusicRate:function(t){return this.backgroundMusic&&this.backgroundMusic.setRate(t),this},setBackgroundMusicDetune:function(t){return this.backgroundMusic&&this.backgroundMusic.setDetune(t),this}},sh=Phaser.Utils.Objects.GetValue,rh={setBackgroundMusic2Loop:function(t){return void 0===t&&(t=!0),this.backgroundMusic2Loop=t,this},setBackgroundMusic2FadeTime:function(t){return this.backgroundMusic2FadeTime=t,this},getBackgroundMusic2:function(){return this.backgroundMusic2},setCurrentBackgroundMusic2:function(t){return this.backgroundMusic2=t,t&&(t.once("complete",(function(){this.backgroundMusic2===t&&(this.backgroundMusic2.destroy(),this.backgroundMusic2=void 0);}),this).once("destroy",(function(){this.backgroundMusic2===t&&(this.backgroundMusic2=void 0);}),this),t.isPlaying||t.play()),this},playBackgroundMusic2:function(t,e){if(this.backgroundMusic2&&this.backgroundMusic2.key===t)return this;this.stopBackgroundMusic2();var i=this.sound.add(t,{loop:sh(e,"loop",this.backgroundMusicLoop),mute:sh(e,"mute",this.backgroundMusic2Mute),volume:sh(e,"volume",this.backgroundMusic2Volume),detune:sh(e,"detune",0),rate:sh(e,"rate",1)});return this.setCurrentBackgroundMusic2(i),this.backgroundMusic2FadeTime>0&&this.fadeInBackgroundMusic2(this.backgroundMusic2FadeTime),this},pauseBackgroundMusic2:function(){return this.backgroundMusic2&&this.backgroundMusic2.pause(),this},resumeBackgroundMusic2:function(){return this.backgroundMusic2&&this.backgroundMusic2.resume(),this},stopBackgroundMusic2:function(){return this.backgroundMusic2&&(this.backgroundMusic2FadeTime>0?this.fadeOutBackgroundMusic2(this.backgroundMusic2FadeTime,!0):(this.backgroundMusic2.stop(),this.backgroundMusic2.destroy(),this.backgroundMusic2=void 0)),this},fadeInBackgroundMusic2:function(t){return this.backgroundMusic2&&th(this.backgroundMusic2,t,this.backgroundMusic2Volume,0),this},fadeOutBackgroundMusic2:function(t,e){return this.backgroundMusic2&&eh(this.backgroundMusic2,t,e),this},crossFadeBackgroundMusic2:function(t,e){var i=this.backgroundMusic2FadeTime;return this.backgroundMusic2FadeTime=0,this.fadeOutBackgroundMusic2(e,!0).playBackgroundMusic2(t).fadeInBackgroundMusic2(e),this.backgroundMusic2FadeTime=i,this},setBackgroundMusic2Mute:function(t){return void 0===t&&(t=!0),this.backgroundMusic2Mute=t,this},setBackgroundMusic2Volume:function(t){return this.backgroundMusic2Volume=t,this},setBackgroundMusic2Rate:function(t){return this.backgroundMusic2&&this.backgroundMusic2.setRate(t),this},setBackgroundMusic2Detune:function(t){return this.backgroundMusic2&&this.backgroundMusic2.setDetune(t),this}},oh=Phaser.Utils.Array.Remove,ah=Phaser.Utils.Objects.GetValue,hh={getSoundEffects:function(){return this.soundEffects},getLastSoundEffect:function(){return this.soundEffects[this.soundEffects.length-1]},playSoundEffect:function(t,e){var i=this.sound.add(t,{mute:ah(e,"mute",this.soundEffectsMute),volume:ah(e,"volume",this.soundEffectsVolume),detune:ah(e,"detune",0),rate:ah(e,"rate",1)});return this.soundEffects.push(i),i.once("complete",(function(){i.destroy(),this.sound&&oh(this.soundEffects,i);}),this).once("destroy",(function(){this.sound&&oh(this.soundEffects,i);}),this).play(),this},stopAllSoundEffects:function(){for(var t=this.soundEffects.length-1;t>=0;t--){var e=this.soundEffects[t];e.stop(),e.destroy();}return this},fadeInSoundEffect:function(t){var e=this.getLastSoundEffect();return e&&th(e,t,this.soundEffectsVolume,0),this},fadeOutSoundEffect:function(t,e){var i=this.getLastSoundEffect();return i&&eh(i,t,e),this},fadeOutAllSoundEffects:function(t,e){for(var i=this.soundEffects.length-1;i>=0;i--)eh(this.soundEffects[i],t,e);return this},setSoundEffectMute:function(t,e){if(void 0===t&&(t=!0),void 0===e&&(e=!1),e){var i=this.getLastSoundEffect();i&&i.setMute(t);}else this.soundEffectsMute=t;return this},setSoundEffectVolume:function(t,e){if(void 0===e&&(e=!1),e){var i=this.getLastSoundEffect();i&&i.setVolume(t);}else this.soundEffectsVolume=t;return this},setSoundEffectDetune:function(t,e){var i;void 0===e&&(e=!1);for(var n=0,s=(i=e?[this.getLastSoundEffect()]:this.soundEffects).length;n=0;t--){var e=this.soundEffects[t];e.stop(),e.destroy();}return this},fadeInSoundEffect2:function(t){var e=this.getLastSoundEffect2();return e&&th(e,t,this.soundEffects2Volume,0),this},fadeOutSoundEffect2:function(t,e){var i=this.getLastSoundEffect2();return i&&eh(i,t,e),this},fadeOutAllSoundEffects2:function(t,e){for(var i=this.soundEffects2.length-1;i>=0;i--)eh(this.soundEffects2[i],t,e);return this},setSoundEffect2Mute:function(t,e){if(void 0===t&&(t=!0),void 0===e&&(e=!1),e){var i=this.getLastSoundEffect2();i&&i.setMute(t);}else this.soundEffects2Mute=t;return this},setSoundEffect2Volume:function(t,e){if(void 0===e&&(e=!1),e){var i=this.getLastSoundEffect2();i&&i.setVolume(t);}else this.soundEffects2Volume=t;return this},setSoundEffect2Detune:function(t,e){var i;void 0===e&&(e=!1);for(var n=0,s=(i=e?[this.getLastSoundEffect2()]:this.soundEffects2).length;n=0;t--)this.soundEffects[t].destroy();if(this.soundEffects.length=0,this.soundEffects2.length)for(t=this.soundEffects2.length-1;t>=0;t--)this.soundEffects2[t].destroy();return this.soundEffects2.length=0,this.sound=void 0,this}},{key:"backgroundMusicMute",get:function(){return this._backgroundMusicMute},set:function(t){this._backgroundMusicMute=t,this.backgroundMusic&&this.backgroundMusic.setMute(mute);}},{key:"backgroundMusicVolume",get:function(){return this._backgroundMusicVolume},set:function(t){this._backgroundMusicVolume=t,this.backgroundMusic&&this.backgroundMusic.setVolume(t);}},{key:"backgroundMusic2Mute",get:function(){return this._backgroundMusic2Mute},set:function(t){this._backgroundMusic2Mute=t,this.backgroundMusic2&&this.backgroundMusic2.setMute(mute);}},{key:"backgroundMusic2Volume",get:function(){return this._backgroundMusic2Volume},set:function(t){this._backgroundMusic2Volume=t,this.backgroundMusic2&&this.backgroundMusic2.setVolume(t);}},{key:"soundEffectsMute",get:function(){return this._soundEffectsMute},set:function(t){this._soundEffectsMute=t;for(var e=this.soundEffects,i=0,n=e.length;i2?n-2:0),r=2;r3?s-3:0),o=3;o");this.setDelimiters(i[0],i[1]),this.setTranslateTagNameCallback(xi(e,"translateTagNameCallback")),this.isRunning=!1,this.isPaused=!1,this.skipEventFlag=!1,this.justCompleted=!1,this.lastTagStart=null,this.lastTagEnd=null,this.lastContent=null;}return r(t,[{key:"shutdown",value:function(){this.destroyEventEmitter();}},{key:"destroy",value:function(){this.shutdown();}},{key:"setMultipleLinesTagEnable",value:function(t){return void 0===t&&(t=!0),this.multipleLinesTagEnable=t,this}},{key:"setDelimiters",value:function(t,e){void 0===e&&(e=t[1],t=t[0]),this.delimiterLeft=t,this.delimiterRight=e,t=Js(this.delimiterLeft),e=Js(this.delimiterRight);var i=this.multipleLinesTagEnable?"gs":"gi";return this.reSplit=RegExp("".concat(t,"(.+?)").concat(e),i),this}},{key:"setTranslateTagNameCallback",value:function(t){return this.translateTagNameCallback=t,this}},{key:"setValueConverter",value:function(t){return !0===t?t=Ah:t||(t=zh),this.valueConverter=t,this}},{key:"setLoopEnable",value:function(t){return void 0===t&&(t=!0),this.loopEnable=t,this}},{key:"setSource",value:function(t){return this.source=t,this}},{key:"resetIndex",value:function(t){return void 0===t&&(t=0),this.progressIndex=t,this.reSplit.lastIndex=t,this.lastTagStart=null,this.lastTagEnd=null,this.lastContent=null,this.justCompleted=!1,this.isRunning=!1,this}},{key:"start",value:function(t){return this.setSource(t).restart(),this}},{key:"restart",value:function(){this.resetIndex().next();}},{key:"next",value:function(){if(this.isPaused&&this.onResume(),this.isRunning)return this;if(this.isRunning=!0,this.justCompleted)return this.isRunning=!1,this;0===this.reSplit.lastIndex&&this.onStart();var t=this.source,e=t.length;for(this.reSplit.lastIndex=this.progressIndex;;){var i=this.reSplit.exec(t);if(!i){if(this.progressIndex");return s.setDelimiters(r[0],r[1]),s}return r(i,[{key:"setTagExpression",value:function(t){return t||(t=Yh),this.tagExpression=t,this}},{key:"setValueExpression",value:function(t){return t||(t=Yh),this.valueExpression=t,this}},{key:"setDelimiters",value:function(t,e){p(h(i.prototype),"setDelimiters",this).call(this,t,e);var n="(".concat(this.tagExpression,")(=(").concat(this.valueExpression,"))?");if(this.reTag=RegExp(n,"i"),this.tagExpression!==Yh||this.valueExpression!==Yh){var s="".concat(this.tagExpression,"(=").concat(this.valueExpression,")?"),r="/".concat(this.tagExpression);t=Js(this.delimiterLeft),e=Js(this.delimiterRight);var o=this.multipleLinesTagEnable?"gs":"gi";this.reSplit=RegExp("".concat(t,"((").concat(s,")|(").concat(r,"))").concat(e),o);}return this}},{key:"onTag",value:function(t){var e=t.match(this.reTag),i=e[1],n="/"===i.charAt(0);if(n&&(i=i.substring(1,i.length)),this.translateTagNameCallback&&(i=this.translateTagNameCallback(i)),this.skipEventFlag=!1,n)this.emit("-".concat(i)),this.skipEventFlag||this.emit("-",i),this.lastTagEnd=i;else {var s=function(t,e){if(null==t)return [];void 0===e&&(e=Ah);for(var i=t.split(","),n=0,s=i.length;n1?s-1:0),o=1;o1&&-1!==e.indexOf("|")?e.split("|"):[e]).length;r0){var o=this.timeline.addTimer({name:Hl,target:s,duration:r.duration,yoyo:r.yoyo,onStart:r.onStart,onProgress:r.onProgress,onComplete:r.onComplete});this.skipTypingAnimation&&o.seek(1);}else r.onStart&&r.onStart(s,0);this.minSizeEnable&&this.textPlayer.setToMinSize(),this.textPlayer.emit("typing",s);var a=this.nextChild;if(a)if(this.skipSpaceEnable&&((i=a).type===Xr&&" "===i.text));else if(n+=this.speed+e,e=0,n>0){this.typingTimer=this.timeline.addTimer({name:"delay",target:this,duration:n,onComplete:function(e,i,n){e.typingTimer=void 0,t.call(e,n.remainder);}});break}}else qr(s)&&s.exec();}this.minSizeEnable&&this.textPlayer.setToMinSize(),this.inTypingProcessLoop=!1;},pause:function(){return this.timeline.pause(),this},resume:function(){return this.timeline.resume(),this},pauseTyping:function(){return this.isTypingPaused||(this.typingTimer?(this.typingTimer.pause(),this.isTypingPaused=!0):this.inTypingProcessLoop&&(this.inTypingProcessLoop=!1,this.isTypingPaused=!0)),this},resumeTyping:function(t){return this.isTypingPaused?(void 0===t&&(t=0),this.typingTimer?(this.isTypingPaused=!1,this.typingTimer.resume(),this.typingTimer.remainder+=t):this.isTypingPaused&&(this.isTypingPaused=!1,this.typing(t)),this):this},wait:function(t){return this.ignoreWait||(this.pauseTyping(),Zl(this.textPlayer,t,this.resumeTyping,this)),this},setIgnoreWait:function(t){return void 0===t&&(t=!0),this.ignoreWait=t,this},setSkipSpaceEnable:function(t){return void 0===t&&(t=!0),this.skipSpaceEnable=t,this},setSkipTypingAnimation:function(t){if(void 0===t&&(t=!0),this.skipTypingAnimation=t,t)for(var e=this.timeline.getTimers(Hl),i=0,n=e.length;i0&&o.chainAnimation(i,n);},lu=function(t){var e,i,n=k(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.stopAnimation.apply(s,m(i));},uu=function(t){var e,i,n=k(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.pauseAnimation.apply(s,m(i));},cu=function(t){var e,i,n=k(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.chainAnimation.apply(s,m(i));},du=[function(t,e,i){var n=i.name;e.on("+",(function(i){if(!e.skipEventFlag){var s,r=i.split(".");if(au(r,n)){s=r[1];for(var o=arguments.length,a=new Array(o>1?o-1:0),h=1;h0)){var a=this.getGameObjectManager(e);a.hasMethod(i,n)?a.call.apply(a,[i,n].concat(m(s))):a.setProperty(i,n,s[0]);}},mu={to:!0,yoyo:!0,from:!0,toLeft:!0,toRight:!0,toUp:!0,toDown:!0,yoyoLeft:!0,yoyoRight:!0,yoyoUp:!0,yoyoDown:!0,fromLeft:!0,fromRight:!0,fromUp:!0,fromDown:!0},bu=function(t){var e,i,n,s,r,o,a,h,l=y(t,8);e=l[0],i=l[1],n=l[2],s=l[3],r=l[4],o=l[5],a=l[6],h=l[7];var u=this.getGameObjectManager(e),c=u.getProperty(i,n);if("number"==typeof c){h.endsWith("Left")||h.endsWith("Up")?h.startsWith("to")||h.startsWith("yoyo")?s=c-s:h.startsWith("from")&&(u.setProperty(i,n,c-s),s=c):h.endsWith("Right")||h.endsWith("Down")?h.startsWith("to")||h.startsWith("yoyo")?s=c+s:h.startsWith("from")&&(u.setProperty(i,n,c+s),s=c):"from"===h&&(u.setProperty(i,n,s),s=c);var d=h.startsWith("yoyo");u.easeProperty(i,n,s,r,o,a,d);}},Cu=[function(t,e,i){var n=i.name;e.on("+",(function(i){if(!e.skipEventFlag){var s,r=i.split(".");if(pu(r,n)){s=r[1];for(var o=arguments.length,a=new Array(o>1?o-1:0),h=1;h1?a-1:0),l=1;l0)return Au.length=0,!0;return Au.length=0,!1},Au=[],Iu=void 0,zu=Phaser.Utils.Objects.GetValue,Fu=function(t,e,i){var n,s;for(var r in void 0===i&&(i={}),t)n=t[r],void 0!==(s=zu(e,r,n[1]))&&(i[n[0]]=s);return i},Yu=function(t){t.addEventListener("touchstart",Wu,!1),t.addEventListener("touchmove",Wu,!1),t.addEventListener("touchend",Wu,!1),t.addEventListener("mousedown",Wu,!1),t.addEventListener("mouseup",Wu,!1),t.addEventListener("mousemove",Wu,!1);},Wu=function(t){t.stopPropagation();},Vu=Phaser.Utils.Objects.GetValue,Xu=function(){return this.close(),this.emit("keydown-ENTER",this.parent,this),this},Gu={open:function(){return this.isOpened||this.readOnly||((t=this)!==Iu&&(void 0!==Iu&&Iu.close(),Iu=t),this.isOpened=!0,this.node||(this.node=function(t,e){var i,n=Vu(e,"inputType",void 0);void 0===n&&(n=Vu(e,"type","text")),"textarea"===n?(i=document.createElement("textarea")).style.resize="none":(i=document.createElement("input")).type=n;var s=Vu(e,"style",void 0),r=i.style;Fu(Ru,s,r),r.position="absolute",r.opacity=0,r.pointerEvents="none",r.zIndex=0,r.transform="scale(0)",Fu(Lu,e,i),Yu(i);var o=t.scene.sys.scale;return (o.isFullscreen?o.fullscreenTarget:document.body).appendChild(i),i}(this,this.nodeConfig)),this.setFocus(),this.initText(),this.enterCloseEnable&&this.scene.input.keyboard.once("keydown-ENTER",Xu,this),this.scene.sys.events.on("postupdate",this.updateText,this),this.scene.input.on("pointerdown",this.onClickOutside,this),this.onOpenCallback&&this.onOpenCallback(this.parent,this),this.emit("open",this)),this;var t;},close:function(){return this.isOpened?(this===Iu&&(Iu=void 0),this.setBlur(),this.isOpened=!1,this.updateText(),this.scene.sys.events.off("postupdate",this.updateText,this),this.scene.input.off("pointerdown",this.onClickOutside,this),this.onCloseCallback&&this.onCloseCallback(this.parent,this),function(t){if(t){var e=t.parentElement;e&&e.removeChild(t);}}(this.node),this.node=void 0,this.emit("close",this),this):this}},Hu=Phaser.Utils.Objects.GetValue,Uu=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),r=e.call(this,t);var o=Hu(s,"inputType",void 0);void 0===o&&(o=Hu(s,"type","text")),r.setEnterCloseEnable(Hu(s,"enterClose","textarea"!==o));var a=Hu(s,"onOpen",void 0);a||(a=Hu(s,"onFocus",void 0)),r.onOpenCallback=a;var h=Hu(s,"onClose",void 0);return h||(h=Hu(s,"onBlur",void 0)),r.onCloseCallback=h,r.onUpdateCallback=Hu(s,"onUpdate",void 0),r.isOpened=!1,t.on("pointerdown",(function(){this.open();}),u(r)).setInteractive(),r.nodeConfig=function(t){void 0===t&&(t={});var e={};return Bu(t,e,"inputType"),Bu(t,e,"type"),Bu(t,e,"style"),Bu(t,e,Ru),Bu(t,e,Lu),e}(s),r.node=void 0,r}return r(i,[{key:"destroy",value:function(){this.close(),p(h(i.prototype),"destroy",this).call(this);}},{key:"onClickOutside",value:function(t){ju(this.parent,t)||this.close();}},{key:"setEnterCloseEnable",value:function(t){return void 0===t&&(t=!0),this.enterCloseEnable=t,this}},{key:"initText",value:function(){}},{key:"updateText",value:function(){}},{key:"text",get:function(){return this.node?this.node.value:""},set:function(t){this.node&&(this.node.value=t);}},{key:"setText",value:function(t){return this.text=t,this}},{key:"maxLength",get:function(){return this.nodeConfig.maxLength},set:function(t){this.nodeConfig.maxLength=t,this.node&&(this.node.maxLength=t);}},{key:"setMaxLength",value:function(t){return this.maxLength=t,this}},{key:"minLength",get:function(){return this.nodeConfig.minLength},set:function(t){this.nodeConfig.minLength=t,this.node&&(this.node.minLength=t);}},{key:"setMinLength",value:function(t){return this.minLength=t,this}},{key:"placeholder",get:function(){return this.node.placeholder},set:function(t){this.node&&(this.node.placeholder=t);}},{key:"setPlaceholder",value:function(t){return this.placeholder=t,this}},{key:"selectText",value:function(t,e){return this.node?(void 0===t?this.node.select():this.node.setSelectionRange(t,e),this):this}},{key:"selectAll",value:function(){return this.selectText(),this}},{key:"selectionStart",get:function(){return this.node?this.node.selectionStart:0}},{key:"selectionEnd",get:function(){return this.node?this.node.selectionEnd:0}},{key:"selectedText",get:function(){if(!this.node)return "";var t=this.node;return t.value.substring(t.selectionStart,t.selectionEnd)}},{key:"cursorPosition",get:function(){return this.node?this.node.selectionStart:0},set:function(t){this.node&&this.node.setSelectionRange(t,t);}},{key:"setCursorPosition",value:function(t){return void 0===t?t=this.text.length:t<0&&(t=this.text.length+t),this.cursorPosition=t,this}},{key:"tooltip",get:function(){return this.node?this.node.title:""},set:function(t){if(!this.node)return this;this.node.title=t;}},{key:"setTooltip",value:function(t){return this.tooltip=t,this}},{key:"setTextChangedCallback",value:function(t){return this.onTextChanged=t,this}},{key:"readOnly",get:function(){return this.nodeConfig.readOnly},set:function(t){this.nodeConfig.readOnly=t,this.node&&(this.node.readOnly=t);}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}},{key:"spellCheck",get:function(){return this.node?this.node.spellcheck:""},set:function(t){this.node&&(this.node.spellcheck=t);}},{key:"setSpellCheck",value:function(t){return this.spellCheck=t,this}},{key:"fontColor",get:function(){if(this.node)return this.node.style.color},set:function(t){this.node&&(this.node.style.color=t);}},{key:"setFontColor",value:function(t){return this.fontColor=t,this}},{key:"setStyle",value:function(t,e){return this.node?(this.node.style[t]=e,this):this}},{key:"getStyle",value:function(t){if(this.node)return this.node.style[t]}},{key:"scrollToBottom",value:function(){return this.node?(this.node.scrollTop=this.node.scrollHeight,this):this}},{key:"setEnabled",value:function(t){return this.node?(void 0===t&&(t=!0),this.node.disabled=!t,this):this}},{key:"setBlur",value:function(){return this.node?(this.node.blur(),this):this}},{key:"setFocus",value:function(){return this.node?(this.node.focus(),this):this}},{key:"isFocused",get:function(){return this.isOpened}}]),i}(Ta);Object.assign(Uu.prototype,Gu);var Nu=function(t,e,i){t=t.replace(" ","");var n=i.previousText;if(t===n)return t;if(isNaN(t)){i.emit("nan",t,i),t=n;var s=i.cursorPosition-1;i.setText(t),i.setCursorPosition(s);}else i.previousText=t;return t},Ku=function(t){var e=t.prevSelectionStart;if(null!==e){for(var i=t.prevSelectionEnd,n=t.parent,s=e;s=s&&h=i&&hi.length&&(t.prevCursorPosition=null),null!==t.prevCursorPosition&&(s=e.getCharChild(t.prevCursorPosition))&&("\n"===s.text&&s.clearTextSize(),e.emit("cursorout",s,t.prevCursorPosition,e)),null!=n&&(s=e.getCharChild(n))&&("\n"===s.text&&s.copyTextSize(e.lastInsertCursor),function(t){var e,i,n=t.parent,s=n.width,r=n.height,o=t.drawX,a=t.drawY,h=o+t.drawTLX,l=o+t.drawTRX,u=a+t.drawTLY,c=a+t.drawBLY;e=h<0?0-h:l>s?s-l:0,i=u<0?0-u:c>r?r-c:0,n._textOX+=e,n._textOY+=i;}(s),e.emit("cursorin",s,n,e)),e.emit("movecursor",n,t.prevCursorPosition,e),t.prevCursorPosition=n;}}(this)):(Ku(this),Ju(this)),this}},{key:"setNumberInput",value:function(){return this.onUpdateCallback=Nu,this}},{key:"setSelectAllWhenFocusEnable",value:function(t){return void 0===t&&(t=!0),this.selectAllWhenFocus=t,this}}]),i}(Uu),$u=Phaser.Utils.Objects.GetValue,Qu=["inputType","onOpen","onFocus","onClose","onBlur","onUpdate","enterClose","readOnly","maxLength","minLength","selectAll"],tc=function(t,e){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return !0;if(-1!==e.indexOf(".")){for(var i=e.split("."),n=t,s=0;st.length?i:t})),l.value=t.join(c);}else l.value=t.join(i.slice(a,a+l.count));a+=l.count,l.added||(h+=l.count);}}var d=e[o-1];return o>1&&"string"==typeof d.value&&(d.added||d.removed)&&t.equals("",d.value)&&(e[o-2].value+=d.value,e.pop()),e}oc.prototype={diff:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.callback;"function"==typeof i&&(n=i,i={}),this.options=i;var s=this;function r(t){return n?(setTimeout((function(){n(void 0,t);}),0),!0):t}t=this.castInput(t),e=this.castInput(e),t=this.removeEmpty(this.tokenize(t));var o=(e=this.removeEmpty(this.tokenize(e))).length,a=t.length,h=1,l=o+a;i.maxEditLength&&(l=Math.min(l,i.maxEditLength));var u=[{newPos:-1,components:[]}],c=this.extractCommon(u[0],e,t,0);if(u[0].newPos+1>=o&&c+1>=a)return r([{value:this.join(e),count:e.length}]);function d(){for(var i=-1*h;i<=h;i+=2){var n=void 0,l=u[i-1],c=u[i+1],d=(c?c.newPos:0)-i;l&&(u[i-1]=void 0);var f=l&&l.newPos+1=o&&d+1>=a)return r(ac(s,n.components,e,t,s.useLongestToken));u[i]=n;}else u[i]=void 0;}var v;h++;}if(n)!function t(){setTimeout((function(){if(h>l)return n();d()||t();}),0);}();else for(;h<=l;){var f=d();if(f)return f}},pushComponent:function(t,e,i){var n=t[t.length-1];n&&n.added===e&&n.removed===i?t[t.length-1]={count:n.count+1,added:e,removed:i}:t.push({count:1,added:e,removed:i});},extractCommon:function(t,e,i,n){for(var s=e.length,r=i.length,o=t.newPos,a=o-n,h=0;o+10,o=0,a=e.length;o0;this.dirty=this.dirty||this._radiusTL!==t||this._convexTL!==e,this._convexTL=e,this._radiusTL=Math.abs(t);}},{key:"radiusTR",get:function(){return this._radiusTR},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusTR!==t||this._convexTR!==e,this._convexTR=e,this._radiusTR=Math.abs(t);}},{key:"radiusBL",get:function(){return this._radiusBL},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusBL!==t||this._convexBL!==e,this._convexBL=e,this._radiusBL=Math.abs(t);}},{key:"radiusBR",get:function(){return this._radiusBR},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusBR!==t||this._convexBR!==e,this._convexBR=e,this._radiusBR=Math.abs(t);}},{key:"radius",get:function(){return Math.max(this.radiusTL,this.radiusTR,this.radiusBL,this.radiusBR)},set:function(t){"number"==typeof t?(this.radiusTL=t,this.radiusTR=t,this.radiusBL=t,this.radiusBR=t):(this.radiusTL=ld(t,"tl",0),this.radiusTR=ld(t,"tr",0),this.radiusBL=ld(t,"bl",0),this.radiusBR=ld(t,"br",0));}},{key:"setRadius",value:function(t){return void 0===t&&(t=0),this.radius=t,this}},{key:"iterations",get:function(){return this._iterations},set:function(t){this.dirty=this.dirty||this._iterations!==t,this._iterations=t;}},{key:"setIterations",value:function(t){return this.iterations=t,this}},{key:"updateData",value:function(){var t=this.pathData;t.length=0;var e,n=this.width,s=this.height,r=this.iterations+1;(e=this.radiusTL)>0?this._convexTL?Hi(e,e,e,e,180,270,!1,r,t):Hi(0,0,e,e,90,0,!0,r,t):Xi(0,0,t);(e=this.radiusTR)>0?this._convexTR?Hi(n-e,e,e,e,270,360,!1,r,t):Hi(n,0,e,e,180,90,!0,r,t):Xi(n,0,t);(e=this.radiusBR)>0?this._convexBR?Hi(n-e,s-e,e,e,0,90,!1,r,t):Hi(n,s,e,e,270,180,!0,r,t):Xi(n,s,t);(e=this.radiusBL)>0?this._convexBL?Hi(e,s-e,e,e,90,180,!1,r,t):Hi(0,s,e,e,360,270,!0,r,t):Xi(0,s,t);return t.push(t[0],t[1]),Hc(this.x,this.y,t),p(h(i.prototype),"updateData",this).call(this),this}}]),i}(Bc),cd=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,dd=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;return n(this,i),void 0===t&&(t=0),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===h&&(h=0),(l=e.call(this)).pathData=[],l.closePath=!0,l.setP0(t,s),l.setP1(r,o),l.setP2(a,h),l}return r(i,[{key:"x0",get:function(){return this._x0},set:function(t){this.dirty=this.dirty||this._x0!==t,this._x0=t;}},{key:"y0",get:function(){return this._y0},set:function(t){this.dirty=this.dirty||this._y0!==t,this._y0=t;}},{key:"setP0",value:function(t,e){return this.x0=t,this.y0=e,this}},{key:"x1",get:function(){return this._x1},set:function(t){this.dirty=this.dirty||this._x1!==t,this._x1=t;}},{key:"y1",get:function(){return this._y1},set:function(t){this.dirty=this.dirty||this._y1!==t,this._y1=t;}},{key:"setP1",value:function(t,e){return this.x1=t,this.y1=e,this}},{key:"x2",get:function(){return this._x2},set:function(t){this.dirty=this.dirty||this._x2!==t,this._x2=t;}},{key:"y2",get:function(){return this._y2},set:function(t){this.dirty=this.dirty||this._y2!==t,this._y2=t;}},{key:"setP2",value:function(t,e){return this.dirty=this.dirty||this.x2!==t||this.y2!==e,this.x2=t,this.y2=e,this}},{key:"updateData",value:function(){return this.pathData.length=0,this.pathData.push(this.x0,this.y0),this.pathData.push(this.x1,this.y1),this.pathData.push(this.x2,this.y2),this.pathData.push(this.x0,this.y0),p(h(i.prototype),"updateData",this).call(this),this}},{key:"webglRender",value:function(t,e,i,n,s){if(this.isFilled){var r=cd(this.fillColor,this.fillAlpha*i),o=this.x0-n,a=this.y0-s,h=this.x1-n,l=this.y1-s,u=this.x2-n,c=this.y2-s,d=e.getX(o,a),f=e.getY(o,a),p=e.getX(h,l),v=e.getY(h,l),g=e.getX(u,c),y=e.getY(u,c);t.batchTri(d,f,p,v,g,y,r,r,r);}this.isStroked&&Ji(t,this,i,n,s);}},{key:"canvasRender",value:function(t,e,i){var n=this.x1-e,s=this.y1-i,r=this.x2-e,o=this.y2-i,a=this.x3-e,h=this.y3-i;t.beginPath(),t.moveTo(n,s),t.lineTo(r,o),t.lineTo(a,h),t.closePath(),this.isFilled&&(qi(t,this),t.fill()),this.isStroked&&($i(t,this),t.stroke());}}]),i}(Lc),fd={buildShapes:function(){this.addShape((new ud).setName("box")).addShape((new od).setName("checker"));},updateShapes:function(){var t=this.width/2,e=this.height/2,i=Math.min(t,e),n=2*i,s=t-i,r=e-i,o=this.boxLineWidth,a=Math.max(n/10,2),h=this.getShape("box"),l=this.getShape("checker");if(this.isSizeChanged){var u=n*(1-this.boxSize)/2,c=o/2,d=n*this.boxSize-o;h.setTopLeftPosition(s+c+u,r+c+u).setSize(d,d),this.isCircleShape?h.setRadius(d/2):h.setRadius(0);u=n*(1-this.checkerSize)/2;var f=n*this.checkerSize/4,p=1*f,v=2*f,g=3*f;l.startAt(p,v).lineTo(v,g).lineTo(g,p).offset(s+u,r+u).end();}this.checked?(h.fillStyle(this.boxFillColor,this.boxFillAlpha).lineStyle(o,this.boxStrokeColor,this.boxStrokeAlpha),l.lineStyle(a,this.checkerColor)):(h.fillStyle(this.uncheckedBoxFillColor,this.uncheckedBoxFillAlpha).lineStyle(o,this.uncheckedBoxStrokeColor,this.uncheckedBoxStrokeAlpha),l.lineStyle()),this.checked&&l.setDisplayPathSegment(this.checkerAnimProgress);}},pd=Phaser.Utils.Objects.GetValue,vd=Phaser.Math.Linear,gd=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).resetFromJSON(),r.boot(),r}return r(i,[{key:"start",value:function(t){if(this.timer.isRunning)return this;var e=this.target;this.propertyKey=pd(t,"key","value");var n=e[this.propertyKey];return this.fromValue=pd(t,"from",n),this.toValue=pd(t,"to",n),this.setEase(pd(t,"ease",this.ease)),this.setDuration(pd(t,"duration",this.duration)),this.setRepeat(pd(t,"repeat",0)),this.setDelay(pd(t,"delay",0)),this.setRepeatDelay(pd(t,"repeatDelay",0)),this.timer.setDuration(this.duration).setRepeat(this.repeat).setDelay(this.delay).setRepeatDelay(this.repeatDelay),e[this.propertyKey]=this.fromValue,p(h(i.prototype),"start",this).call(this),this}},{key:"updateGameObject",value:function(t,e){var i=e.t;i=this.easeFn(i),t[this.propertyKey]=vd(this.fromValue,this.toValue,i);}}]),i}(Ua),yd={setCheckerAnimationDuration:function(t){return void 0===t&&(t=0),this.checkerAnimDuration=t,this},playCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask&&(this.checkerAnimProgressTask=new gd(this,{eventEmitter:null})),this.checkerAnimProgressTask.restart({key:"checkerAnimProgress",from:0,to:1,duration:this.checkerAnimDuration}),this},stopCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask||this.checkerAnimProgressTask.stop(),this}},kd={};Object.assign(kd,Ec,{setBoxSize:function(t){return this.dirty=this.dirty||this.boxSize!==t,this.boxSize=t,this},setCheckerSize:function(t){return this.dirty=this.dirty||this.checkerSize!==t,this.checkerSize=t,this}},fd,yd);var md=Phaser.Utils.Objects.GetValue,bd=Phaser.Utils.Objects.IsPlainObject,Cd=23730,xd=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),bd(s)?(s=md(l=s,"x",0),r=md(l,"y",0),o=md(l,"width",2),a=md(l,"height",2),h=md(l,"color",Cd)):bd(h)&&(h=md(l=h,"color",Cd)),(u=e.call(this,t,s,r,o,a)).type="rexCheckbox",void 0===h&&(h=Cd),u.setBoxShape(md(l,"circleBox",!1)),u.setBoxFillStyle(h,md(l,"boxFillAlpha",1)),u.setUncheckedBoxFillStyle(md(l,"uncheckedColor",null),md(l,"uncheckedBoxFillAlpha",1)),u.setBoxStrokeStyle(md(l,"boxLineWidth",4),md(l,"boxStrokeColor",h),md(l,"boxStrokeAlpha",1)),u.setUncheckedBoxStrokeStyle(u.boxLineWidth,md(l,"uncheckedBoxStrokeColor",u.boxStrokeColor),md(l,"uncheckedBoxStrokeAlpha",u.boxStrokeAlpha)),u.setCheckerStyle(md(l,"checkerColor",16777215),md(l,"checkerAlpha",1)),u.setBoxSize(md(l,"boxSize",1)),u.setCheckerSize(md(l,"checkerSize",1)),u.setCheckerAnimationDuration(md(l,"animationDuration",150)),u.buildShapes();var c=md(l,"checked");return void 0===c&&(c=md(l,"value",!1)),u.setValue(c),u}return r(i,[{key:"value",get:function(){return this._value},set:function(t){t=!!t,this._value!==t&&(this.dirty=!0,this._value=t,t?this.playCheckerAnimation():this.stopCheckerAnimation(),this.emit("valuechange",t));}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"toggleValue",value:function(){return this.setValue(!this.value),this}},{key:"checked",get:function(){return this.value},set:function(t){this.value=t;}},{key:"setChecked",value:function(t){return void 0===t&&(t=!0),this.setValue(t),this}},{key:"toggleChecked",value:function(){return this.toggleValue(),this}},{key:"checkerAnimProgress",get:function(){return this._checkerAnimProgress},set:function(t){this._checkerAnimProgress!==t&&(this._checkerAnimProgress=t,this.dirty=!0);}}]),i}(Mc);Object.assign(xd.prototype,kd);var wd=Phaser.Utils.Objects.GetValue,Sd=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s))._enable=void 0,t.setInteractive(wd(s,"inputConfig",void 0)),r.resetFromJSON(s),r.boot(),r}return r(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.lastClickTime=void 0,this.setEnable(wd(t,"enable",!0)),this.setMode(wd(t,"mode",1)),this.setClickInterval(wd(t,"clickInterval",100)),this.setDragThreshold(wd(t,"threshold",void 0)),this}},{key:"boot",value:function(){var t=this.parent;t.on("pointerdown",this.onPress,this),t.on("pointerup",this.onRelease,this),t.on("pointerout",this.onPointOut,this),t.on("pointermove",this.onMove,this),t.on("pointerover",this.onOver,this),t.on("pointerout",this.onOut,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.pointer=null,p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t){t||this.cancel(),this._enable=t;var e=t?"enable":"disable";this.emit(e,this,this.parent);}}},{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=Od[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,this.emit("down",this,this.parent,t,n),0===this.mode&&this.click(t.downTime,t,n));}},{key:"onRelease",value:function(t,e,i,n){this.pointer===t&&(this.emit("up",this,this.parent,t,n),1===this.mode&&this.click(t.upTime,t,n),this.pointer=void 0);}},{key:"onPointOut",value:function(t,e){this.pointer===t&&this.cancel();}},{key:"onMove",value:function(t,e,i,n){this.pointer===t&&void 0!==this.dragThreshold&&1===this.mode&&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.parent,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.parent,e,i)),this}},{key:"cancel",value:function(){return this.pointer=void 0,this}},{key:"onOver",value:function(t,e,i,n){return this.enable?(this.emit("over",this,this.parent,t,n),this):this}},{key:"onOut",value:function(t,e){return this.enable?(this.emit("out",this,this.parent,t,e),this):this}}]),i}(Ta),Od={press:0,pointerdown:0,release:1,pointerup:1},Pd=Phaser.Utils.Objects.GetValue,Td=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var c;return n(this,i),(c=e.call(this,t,s,r,o,a,h,l))._click=new Sd(u(c),Pd(l,"click")),c._click.on("click",(function(){this.toggleValue();}),u(c)),c.setReadOnly(Pd(l,"readOnly",!1)),c}return r(i,[{key:"readOnly",get:function(){return !this._click.enable},set:function(t){this._click.enable=!t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}}]),i}(xd),Md={setTrackFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.trackFillColor!==t||this.trackFillAlpha!==e,this.trackFillColor=t,this.trackFillAlpha=e,this},setFalseValueTrackFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.falseValueTrackColor!==t||this.uncheckedTrackFillAlpha!==e,this.falseValueTrackColor=t,this.falseValueTrackFillAlpha=e,this},setThumbStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.thumbColor!==t||this.checkAlpha!==e,this.thumbColor=t,this.thumbAlpha=e,this}},Ed={setTrackSize:function(t,e){return this.dirty=this.dirty||this.trackWidth!==t||this.trackHeight!==e,this.trackWidth=t,this.trackHeight=e,this},setTrackRadius:function(t){return this.dirty=this.dirty||this.trackRadius!==t,this.trackRadius=t,this},setThumbSize:function(t,e){return void 0===e&&(e=t),this.dirty=this.dirty||this.thumbWidth!==t||this.thumbHeight!==e,this.thumbWidth=t,this.thumbHeight=e,this},setThumbRadius:function(t){return this.dirty=this.dirty||this.thumbRadius!==t,this.thumbRadius=t,this}},_d={setThumbPosition:function(t,e){return void 0===e&&(e=1-t),this.thumbLeftX=t,this.thumbRightX=e,this},setRTL:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},Ld=function(t,e,i){return (e-t)*i+t},Rd=Phaser.Math.Linear,Bd={buildShapes:function(){this.addShape((new ud).setName("track")).addShape((new ud).setName("thumb"));},updateShapes:function(){var t=this.width,e=this.height,i=this.value?this.toggleAnimProgress:1-this.toggleAnimProgress,n=this.getShape("track");if(this.isSizeChanged){var s=t*this.trackWidth,r=e*this.trackHeight,o=(t-s)/2,a=(e-r)/2,h=e*this.trackRadius;n.setTopLeftPosition(o,a).setSize(s,r).setRadius(h);}var l,u,c,d=(l=this.falseValueTrackColor,u=this.trackFillColor,c=i,(255&Ld(ia(l),ia(u),c))<<16|(255&Ld(na(l),na(u),c))<<8|255&Ld(sa(l),sa(u),c)),f=Rd(this.falseValueTrackFillAlpha,this.trackFillAlpha,i);n.fillStyle(d,f);var p=this.getShape("thumb");if(this.isSizeChanged){var v=t*this.thumbWidth,g=e*this.thumbHeight,y=e*this.thumbRadius;p.setSize(v,g).setRadius(y);}var k=Rd(this.thumbLeftX,this.thumbRightX,i)*t;this.rtl&&(k=t-k);var m=e/2;p.setCenterPosition(k,m),p.fillStyle(this.thumbColor,this.thumbAlpha);}},jd={setToggleAnimationDuration:function(t){return void 0===t&&(t=0),this.toggleAnimDuration=t,this},playToggleAnimation:function(){return void 0===this.toggleAnimProgressTask&&(this.toggleAnimProgressTask=new gd(this,{eventEmitter:null})),this.toggleAnimProgressTask.restart({key:"toggleAnimProgress",from:0,to:1,duration:this.toggleAnimDuration}),this},stopToggleAnimation:function(){return void 0===this.toggleAnimProgressTask||this.toggleAnimProgressTask.stop(),this}},Dd={};Object.assign(Dd,Md,Ed,_d,Bd,jd);var Ad=Phaser.Utils.Objects.GetValue,Id=Phaser.Utils.Objects.IsPlainObject,zd=23730,Fd=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),Id(s)?(s=Ad(l=s,"x",0),r=Ad(l,"y",0),o=Ad(l,"width",2),a=Ad(l,"height",2),h=Ad(l,"color",zd)):Id(h)&&(h=Ad(l=h,"color",zd)),(u=e.call(this,t,s,r,o,a)).type="rexToggleSwitch",void 0===h&&(h=zd),u.setTrackFillStyle(h,Ad(l,"trackFillAlpha",1)),u.setFalseValueTrackFillStyle(Ad(l,"falseValueTrackColor",function(t){var e=.3*ia(t)+.59*na(t)+.11*sa(t);return (255&e)<<16|(255&e)<<8|255&e}(h)),Ad(l,"falseValueTrackFillAlpha",1)),u.setThumbStyle(Ad(l,"thumbColor",16777215),Ad(l,"thumbAlpha",1)),u.setTrackSize(Ad(l,"trackWidth",.9),Ad(l,"trackHeight",.5)),u.setTrackRadius(Ad(l,"trackRadius",.5*u.trackHeight));var c=Ad(l,"thumbHeight",void 0),d=Ad(l,"thumbWidth",c);return void 0===d&&(d=.9*u.trackHeight),u.setThumbSize(d,c),u.setThumbRadius(Ad(l,"thumbRadius",.5*u.thumbHeight)),u.setThumbPosition(Ad(l,"thumbLeft",.3),Ad(l,"thumbRight",void 0)),u.setRTL(Ad(l,"rtl",!1)),u.setToggleAnimationDuration(Ad(l,"animationDuration",150)),u.buildShapes(),u.setValue(Ad(l,"value",!1),0),u}return r(i,[{key:"value",get:function(){return this._value},set:function(t){t=!!t,this._value!==t&&(this.dirty=!0,this._value=t,this.playToggleAnimation(),this.emit("valuechange",t));}},{key:"setValue",value:function(t,e){void 0===e&&(e=this.toggleAnimDuration);var i=this.toggleAnimDuration;return this.toggleAnimDuration=e,this.value=t,this.toggleAnimDuration=i,this}},{key:"toggleValue",value:function(t){return this.setValue(!this.value,t),this}},{key:"toggleAnimProgress",get:function(){return this._toggleAnimProgress},set:function(t){this._toggleAnimProgress!==t&&(this._toggleAnimProgress=t,this.dirty=!0);}}]),i}(Mc);Object.assign(Fd.prototype,Dd);var Yd=Phaser.Utils.Objects.GetValue,Wd=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var c;return n(this,i),(c=e.call(this,t,s,r,o,a,h,l))._click=new Sd(u(c),Yd(l,"click")),c._click.on("click",(function(){this.toggleValue();}),u(c)),c.setReadOnly(Yd(l,"readOnly",!1)),c}return r(i,[{key:"readOnly",get:function(){return !this._click.enable},set:function(t){this._click.enable=!t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}}]),i}(Fd),Vd={loadFromURL:function(t,e){var i=this,n=new Image;return n.onload=function(){i.width!==n.width||i.height!==n.height?i.resize(n.width,n.height):i.clear(),i.context.drawImage(n,0,0),i.updateTexture(),e&&e(),n.onload=null,n.src="",n.remove();},n.src=t,this},loadFromURLPromise:function(t){var e=this;return new Promise((function(i,n){e.loadFromURL(t,i);}))},loadFromFile:function(t,e){var i=URL.createObjectURL(t);return this.loadFromURL(i,(function(){URL.revokeObjectURL(i),e&&e();})),this},loadFromFilePromise:function(t){var e=this;return new Promise((function(i,n){e.loadFromFile(t,i);}))}},Xd=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i)}(gn);Object.assign(Xd.prototype,Vd),Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue;var Gd=Phaser.Math.Linear,Hd=Phaser.Math.Percent,Ud={setValue:function(t,e,i){return null==t||(void 0!==e&&(t=Hd(t,e,i)),this.value=t),this},addValue:function(t,e,i){return void 0!==e&&(t=Hd(t,e,i)),this.value+=t,this},getValue:function(t,e){var i=this.value;return void 0!==t&&(i=Gd(t,e,i)),i}},Nd=Phaser.Math.Percent,Kd={setEaseValuePropName:function(t){return this.easeValuePropName=t,this},setEaseValueDuration:function(t){return this.easeValueDuration=t,this},setEaseValueFunction:function(t){return this.easeFunction=t,this},stopEaseValue:function(){return this.easeValueTask&&this.easeValueTask.stop(),this},easeValueTo:function(t,e,i){return null==t||(void 0!==e&&(t=Nd(t,e,i)),void 0===this.easeValueTask&&(this.easeValueTask=new gd(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,to:t,duration:this.easeValueDuration,ease:this.easeFunction})),this},easeValueRepeat:function(t,e,i,n){return void 0===i&&(i=-1),void 0===n&&(n=0),void 0===this.easeValueTask&&(this.easeValueTask=new gd(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,from:t,to:e,duration:this.easeValueDuration,ease:this.easeFunction,repeat:i,repeatDelay:n}),this}},Jd=Phaser.Utils.Objects.GetValue,Zd=Phaser.Math.Clamp;function qd(t){var e=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"bootProgressBase",value:function(t){this.eventEmitter=Jd(t,"eventEmitter",this);var e=Jd(t,"valuechangeCallback",null);if(null!==e){var i=Jd(t,"valuechangeCallbackScope",void 0);this.eventEmitter.on("valuechange",e,i);}return this.setEaseValuePropName("value").setEaseValueDuration(Jd(t,"easeValue.duration",0)).setEaseValueFunction(Jd(t,"easeValue.ease","Linear")),this}},{key:"value",get:function(){return this._value},set:function(t){t=Zd(t,0,1);var e=this._value,i=e!=t;this.dirty=this.dirty||i,this._value=t,i&&this.eventEmitter.emit("valuechange",this._value,e,this.eventEmitter);}}]),i}(t);return Object.assign(e.prototype,Ud,Kd),e}var $d=Phaser.Math.RadToDeg,Qd=Phaser.Math.DegToRad,tf=function(t,e,i,n,s,r,o,a){var h=360===Math.abs(o-r),l=Qd(r),u=Qd(o),c=Math.cos(l),d=Math.sin(l),f=Math.cos(u),p=Math.sin(u);return t.startAt(e+c*n,i+d*n),t.arc(e,i,n,r,o,a),h&&0===s||(t.lineTo(e+f*s,i+p*s),s>0&&t.arc(e,i,s,o,r,!a)),t.close(),t},ef={buildShapes:function(){this.addShape((new od).setName("track")).addShape((new od).setName("bar")).addShape((new Ac).setName("center"));},updateShapes:function(){var t=this.radius,e=this.thickness*this.radius,i=this.radius,n=i-e,s=this.getShape("track");null!=this.trackColor&&this.thickness>0?(s.fillStyle(this.trackColor),tf(s,t,t,i,n,0,360,!1)):s.reset();var r=this.getShape("bar");if(null!=this.barColor&&this.thickness>0){var o,a,h;if(1===this.value)o=!1,a=0,h=360;else o=this.anticlockwise,a=$d(this.startAngle),h=360*(o?1-this.value:this.value)+a;r.fillStyle(this.barColor),tf(r,t,t,i,n,a,h,!1);}else r.reset();var l=this.getShape("center");this.centerColor&&n>0?l.setCenterPosition(t,t).setRadius(n).fillStyle(this.centerColor):l.reset();}},nf=Phaser.Utils.Objects.GetValue,sf=Phaser.Utils.Objects.IsPlainObject,rf=Phaser.Math.Clamp,of=Phaser.Math.DegToRad(270),af=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),sf(s)&&(s=nf(l=s,"x",0),r=nf(l,"y",0),o=nf(l,"radius",1),a=nf(l,"barColor",void 0),h=nf(l,"value",0)),void 0===o&&(o=1);var c=2*o;return (u=e.call(this,t,s,r,c,c)).type="rexCircularProgress",u.bootProgressBase(l),u.setRadius(o),u.setTrackColor(nf(l,"trackColor",void 0)),u.setBarColor(a),u.setCenterColor(nf(l,"centerColor",void 0)),u.setThickness(nf(l,"thickness",.2)),u.setStartAngle(nf(l,"startAngle",of)),u.setAnticlockwise(nf(l,"anticlockwise",!1)),u.buildShapes(),u.setValue(h),u}return r(i,[{key:"resize",value:function(t,e){return (t=Math.floor(Math.min(t,e)))===this.width||(p(h(i.prototype),"resize",this).call(this,t,t),this.setRadius(t/2)),this}},{key:"radius",get:function(){return this._radius},set:function(t){this.dirty=this.dirty||this._radius!=t,this._radius=t;var e=2*t;this.resize(e,e);}},{key:"setRadius",value:function(t){return this.radius=t,this}},{key:"trackColor",get:function(){return this._trackColor},set:function(t){this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"setBarColor",value:function(t){return this.barColor=t,this}},{key:"startAngle",get:function(){return this._startAngle},set:function(t){this.dirty=this.dirty||this._startAngle!=t,this._startAngle=t;}},{key:"setStartAngle",value:function(t){return this.startAngle=t,this}},{key:"anticlockwise",get:function(){return this._anticlockwise},set:function(t){this.dirty=this.dirty||this._anticlockwise!=t,this._anticlockwise=t;}},{key:"setAnticlockwise",value:function(t){return void 0===t&&(t=!0),this.anticlockwise=t,this}},{key:"thickness",get:function(){return this._thickness},set:function(t){t=rf(t,0,1),this.dirty=this.dirty||this._thickness!=t,this._thickness=t;}},{key:"setThickness",value:function(t){return this.thickness=t,this}},{key:"centerColor",get:function(){return this._centerColor},set:function(t){this.dirty=this.dirty||this._centerColor!=t,this._centerColor=t;}},{key:"setCenterColor",value:function(t){return this.centerColor=t,this}}]),i}(qd(Mc));Object.assign(af.prototype,ef);Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.IsPlainObject,Phaser.Math.Clamp,Phaser.Math.DegToRad(270);qd(gn);var hf=function(t,e,i,n,s,r){var o=(e+n)/2;return r>=0?t.startAt(o+r,i).lineTo(n+r,i).lineTo(n,s).lineTo(e,s).lineTo(e+r,i).lineTo(o+r,i):t.startAt(o,i).lineTo(n,i).lineTo(n-r,s).lineTo(e-r,s).lineTo(e,i).lineTo(o,i),t},lf=Phaser.Utils.Objects.GetValue,uf=Phaser.Utils.Objects.IsPlainObject,cf=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l,u){var c;return n(this,i),uf(s)?(s=lf(u=s,"x",0),r=lf(u,"y",0),o=lf(u,"width",2),a=lf(u,"height",2),h=lf(u,"barColor",void 0),l=lf(u,"value",0)):uf(o)?(o=lf(u=o,"width",2),a=lf(u,"height",2),h=lf(u,"barColor",void 0),l=lf(u,"value",0)):uf(h)&&(h=lf(u=h,"barColor",void 0),l=lf(u,"value",0)),(c=e.call(this,t,s,r,o,a,u)).type="rexLineProgress",c.bootProgressBase(u),c.addShape((new od).setName("trackFill")).addShape((new od).setName("bar")).addShape((new od).setName("trackStroke")),c.setTrackColor(lf(u,"trackColor",void 0)),c.setBarColor(h),c.setTrackStroke(lf(u,"trackStrokeThickness",2),lf(u,"trackStrokeColor",void 0)),c.setSkewX(lf(u,"skewX",0)),c.setRTL(lf(u,"rtl",!1)),c.setValue(l),c}return r(i,[{key:"trackColor",get:function(){return this._trackColor},set:function(t){this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"trackStrokeColor",get:function(){return this._trackStrokeColor},set:function(t){this.dirty=this.dirty||this._trackStrokeColor!=t,this._trackStrokeColor=t;}},{key:"trackStrokeThickness",get:function(){return this._trackStrokeThickness},set:function(t){this.dirty=this.dirty||this._trackStrokeThickness!=t,this._trackStrokeThickness=t;}},{key:"setTrackStroke",value:function(t,e){return this.trackStrokeThickness=t,this.trackStrokeColor=e,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"setBarColor",value:function(t){return this.barColor=t,this}},{key:"skewX",get:function(){return this._skewX},set:function(t){this.dirty=this.dirty||this._skewX!=t,this._skewX=t;}},{key:"setSkewX",value:function(t){return this.skewX=t,this}},{key:"rtl",get:function(){return this._rtl},set:function(t){t=!!t,this.dirty=this.dirty||this._rtl!=t,this._rtl=t;}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}}]),i}(qd(Mc)),df={updateShapes:function(){var t=this.skewX,e=this.width-Math.abs(t),i=this.height,n=this.getShape("trackFill");n.fillStyle(this.trackColor),n.isFilled&&hf(n,0,0,e,i,t).close();var s,r,o=this.getShape("bar");(o.fillStyle(this.barColor),o.isFilled)&&(this.rtl?(s=e*(1-this.value),r=e):(s=0,r=e*this.value),hf(o,s,0,r,i,t).close());var a=this.getShape("trackStroke");a.lineStyle(this.trackStrokeThickness,this.trackStrokeColor),a.isStroked&&hf(a,0,0,e,i,t).end();}};Object.assign(cf.prototype,df);var ff=function(t,e,i,n,s,r,o){void 0===o&&(o="round"),function(t,e){t.save(),t.beginPath();var i=e[0];t.moveTo(i.x,i.y);for(var n=1,s=e.length;n0&&(r.save(),ff(0,r,this.trackPoints,void 0,this.trackStrokeColor,this.trackStrokeThickness),r.restore());},vf=function(t,e,i,n,s,r){void 0===r&&(r=[]),r.length=4;for(var o=0;o<4;o++)r[o]||(r[o]={});var a;return s>=0?((a=r[0]).x=t+s,a.y=e,(a=r[1]).x=i+s,a.y=e,(a=r[2]).x=i,a.y=n,(a=r[3]).x=t,a.y=n):((a=r[0]).x=t,a.y=e,(a=r[1]).x=i,a.y=e,(a=r[2]).x=i-s,a.y=n,(a=r[3]).x=t-s,a.y=n),r},gf=Phaser.Utils.Objects.GetValue,yf=Phaser.Utils.Objects.IsPlainObject,kf=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l,u){var c;return n(this,i),yf(s)?(s=gf(u=s,"x",0),r=gf(u,"y",0),o=gf(u,"width",2),a=gf(u,"height",2),h=gf(u,"barColor",void 0),l=gf(u,"value",0)):yf(o)?(o=gf(u=o,"width",2),a=gf(u,"height",2),h=gf(u,"barColor",void 0),l=gf(u,"value",0)):yf(h)&&(h=gf(u=h,"barColor",void 0),l=gf(u,"value",0)),(c=e.call(this,t,s,r,o,a)).type="rexLineProgressCanvas",c.trackPoints=[],c.barPoints=[],c.bootProgressBase(u),c.setTrackColor(gf(u,"trackColor",void 0)),c.setBarColor(h,gf(u,"barColor2",void 0),gf(u,"isHorizontalGradient",void 0)),c.setTrackStroke(gf(u,"trackStrokeThickness",2),gf(u,"trackStrokeColor",void 0)),c.setSkewX(gf(u,"skewX",0)),c.setRTL(gf(u,"rtl",!1)),c.setValue(l),c}return r(i,[{key:"trackColor",get:function(){return this._trackColor},set:function(t){t=mn(t,this.canvas,this.context),this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"trackStrokeColor",get:function(){return this._trackStrokeColor},set:function(t){t=mn(t,this.canvas,this.context),this.dirty=this.dirty||this._trackStrokeColor!=t,this._trackStrokeColor=t;}},{key:"trackStrokeThickness",get:function(){return this._trackStrokeThickness},set:function(t){this.dirty=this.dirty||this._trackStrokeThickness!=t,this._trackStrokeThickness=t;}},{key:"setTrackStroke",value:function(t,e){return this.trackStrokeThickness=t,this.trackStrokeColor=e,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){t=mn(t,this.canvas,this.context),this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"barColor2",get:function(){return this._barColor2},set:function(t){t=mn(t,this.canvas,this.context),this.dirty=this.dirty||this._barColor2!=t,this._barColor2=t;}},{key:"isHorizontalGradient",get:function(){return this._isHorizontalGradient},set:function(t){this.dirty|=this._isHorizontalGradient!=t,this._isHorizontalGradient=t;}},{key:"setBarColor",value:function(t,e,i){return void 0===i&&(i=!0),this.barColor=t,this.barColor2=e,this.isHorizontalGradient=i,this}},{key:"skewX",get:function(){return this._skewX},set:function(t){this.dirty=this.dirty||this._skewX!=t,this._skewX=t;}},{key:"setSkewX",value:function(t){return this.skewX=t,this}},{key:"rtl",get:function(){return this._rtl},set:function(t){t=!!t,this.dirty=this.dirty||this._rtl!=t,this._rtl=t;}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},{key:"updateTexture",value:function(){return this.clear(),pf.call(this),p(h(i.prototype),"updateTexture",this).call(this),this}}]),i}(qd(gn));Phaser.Math.Wrap;var mf=Phaser.Math.Linear,bf=function(){var t,e,i,n,s,r,o=this.getShape("triangle"),a=this.padding,h=this.width-a.right,l=0+a.left,u=this.height-a.bottom,c=0+a.top,d=(l+h)/2,f=(c+u)/2,p={0:{a:{x:l,y:c},b:{x:h,y:f},c:{x:l,y:u}},1:{a:{x:l,y:c},b:{x:d,y:u},c:{x:h,y:c}},2:{a:{x:h,y:c},b:{x:l,y:f},c:{x:h,y:u}},3:{a:{x:l,y:u},b:{x:d,y:c},c:{x:h,y:u}}};if(void 0===this.previousDirection){var v=p[this.direction],g=v.a,y=v.b,k=v.c;t=g.x,e=g.y,i=y.x,n=y.y,s=k.x,r=k.y;}else {var m=p[this.previousDirection],b=p[this.direction],C=this.easeDirectionProgress;t=mf(m.a.x,b.a.x,C),e=mf(m.a.y,b.a.y,C),i=mf(m.b.x,b.b.x,C),n=mf(m.b.y,b.b.y,C),s=mf(m.c.x,b.c.x,C),r=mf(m.c.y,b.c.y,C);}o.startAt(t,e).lineTo(i,n).lineTo(s,r),this.arrowOnly?o.end():o.close();},Cf=(0, Phaser.Math.DegToRad)(120),xf=function(t){t=this.getShape("triangle");var e=this.width/2,i=this.height/2,n=Math.min(e,i)*this.radius,s=this.verticeRotation;t.startAt(e+n*Math.cos(s+Cf),i+n*Math.sin(s+Cf)).lineTo(e+n*Math.cos(s),i+n*Math.sin(s)).lineTo(e+n*Math.cos(s-Cf),i+n*Math.sin(s-Cf)),this.arrowOnly?t.end():t.close();},wf={buildShapes:function(){this.addShape((new od).setName("triangle"));},updateShapes:function(){var t=this.getShape("triangle");this.arrowOnly?t.fillStyle().lineStyle(this.lineWidth,this.strokeColor,this.strokeAlpha):t.fillStyle(this.fillColor,this.fillAlpha).lineStyle(this.lineWidth,this.strokeColor,this.strokeAlpha),0===this.shapeMode?bf.call(this):xf.call(this);}},Sf={setEaseDuration:function(t){return void 0===t&&(t=0),this.easeDuration=t,this},playEaseDirectionation:function(){return void 0===this.easeDirectionProgressTask&&(this.easeDirectionProgressTask=new gd(this,{eventEmitter:null})),this.easeDirectionProgressTask.restart({key:"easeDirectionProgress",from:0,to:1,duration:this.easeDuration}),this},stopEaseDirection:function(){return void 0===this.easeDirectionProgressTask||this.easeDirectionProgressTask.stop(),this}},Of=Phaser.Utils.Objects.GetValue,Pf=Phaser.Utils.Objects.IsPlainObject,Tf=Phaser.Math.DegToRad,Mf=Phaser.Math.RadToDeg,Ef=function(t){a(s,t);var e=d(s);function s(t,i,r,o,a,h,l){var u,c,d,f,p,v,g,y,k;if(n(this,s),Pf(i)){var m=i;i=m.x,r=m.y,o=m.width,a=m.height,h=m.color,l=m.alpha,c=m.strokeColor,d=m.strokeAlpha,f=m.strokeWidth,p=m.arrowOnly,v=m.direction,g=m.easeDuration,y=m.padding,k=m.radius;}return void 0===i&&(i=0),void 0===r&&(r=0),void 0===o&&(o=1),void 0===a&&(a=o),void 0===p&&(p=!1),void 0===v&&(v=0),void 0===g&&(g=0),void 0===y&&(y=0),void 0===k&&(k=void 0),(u=e.call(this,t,i,r,o,a)).type="rexTriangle",u.setFillStyle(h,l),void 0!==c&&void 0===f&&(f=2),u.setStrokeStyle(f,c,d),u.setArrowOnly(p),u.setDirection(v,g),u.setPadding(y),u.setRadius(k),u.buildShapes(),u}return r(s,[{key:"arrowOnly",get:function(){return this._arrowOnly},set:function(t){this.dirty=this.dirty||this._arrowOnly!=t,this._arrowOnly=t;}},{key:"setArrowOnly",value:function(t){return void 0===t&&(t=!0),this.arrowOnly=t,this}},{key:"direction",get:function(){return this._direction},set:function(t){t=Lf(t),this._direction!==t&&(this.easeDuration>0&&void 0!==this._direction?this.previousDirection=this._direction:this.previousDirection=void 0,this._direction=t,this.verticeAngle=90*t,this.dirty=!0,void 0!==this.previousDirection?this.playEaseDirectionation():this.stopEaseDirection());}},{key:"setDirection",value:function(t,e){return void 0!==e&&this.setEaseDuration(e),this.direction=t,this}},{key:"toggleDirection",value:function(t){return this.setDirection(this.direction+2,t),this}},{key:"easeDirectionProgress",get:function(){return this._easeDirectionProgress},set:function(t){this._easeDirectionProgress!==t&&(this._easeDirectionProgress=t,this.dirty=!0);}},{key:"setPadding",value:function(t,e,n,s){if("object"===i(t)){var r=t,o=Of(r,"x",null);null!==o?(t=o,n=o):(t=Of(r,"left",0),n=Of(r,"right",t));var a=Of(r,"y",null);null!==a?(e=a,s=a):(e=Of(r,"top",0),s=Of(r,"bottom",e));}else void 0===t&&(t=0),void 0===e&&(e=t),void 0===n&&(n=t),void 0===s&&(s=e);return void 0===this.padding&&(this.padding={}),this.dirty=this.dirty||this.padding.left!=t||this.padding.top!=e||this.padding.right!=n||this.padding.bottom!=s,this.padding.left=t,this.padding.top=e,this.padding.right=n,this.padding.bottom=s,this.setRadius(),this}},{key:"radius",get:function(){return this._radius},set:function(t){this.dirty=this.dirty||this._radius!=t,this._radius=t;}},{key:"setRadius",value:function(t){return this.radius=t,this.shapeMode=null==t?0:1,this}},{key:"verticeRotation",get:function(){return this._verticeRotation},set:function(t){this.dirty=this.dirty||this._verticeRotation!=t,this._verticeRotation=t;}},{key:"setVerticeRotation",value:function(t){return this.verticeRotation=t,this}},{key:"verticeAngle",get:function(){return Mf(this.verticeRotation)},set:function(t){this.verticeRotation=Tf(t);}},{key:"setVerticeAngle",value:function(t){return this.verticeAngle=t,this}}]),s}(Mc),_f={right:0,down:1,left:2,up:3},Lf=function(t){return "string"==typeof t&&(t=_f[t]),t%=4};Object.assign(Ef.prototype,wf,Sf);var Rf=function(t){return t.hasOwnProperty("rexSizer")||(t.rexSizer={}),t.rexSizer};var Bf=Phaser.Display.Align,jf={center:Bf.CENTER,left:Bf.LEFT_CENTER,right:Bf.RIGHT_CENTER,top:Bf.TOP_CENTER,bottom:Bf.BOTTOM_CENTER,"left-top":Bf.TOP_LEFT,"top-left":Bf.TOP_LEFT,"left-center":Bf.LEFT_CENTER,"center-left":Bf.LEFT_CENTER,"left-bottom":Bf.BOTTOM_LEFT,"bottom-left":Bf.BOTTOM_LEFT,"center-top":Bf.TOP_CENTER,"top-center":Bf.TOP_CENTER,"center-center":Bf.CENTER,"center-bottom":Bf.BOTTOM_CENTER,"bottom-center":Bf.BOTTOM_CENTER,"right-top":Bf.TOP_RIGHT,"top-right":Bf.TOP_RIGHT,"right-center":Bf.RIGHT_CENTER,"center-right":Bf.RIGHT_CENTER,"right-bottom":Bf.BOTTOM_RIGHT,"bottom-right":Bf.BOTTOM_RIGHT},Df=new Phaser.GameObjects.Zone({sys:{queueDepthSort:Ye,events:{once:Ye}}},0,0,1,1);Df.setOrigin(0);var Af=0,If=1,zf=2,Ff=4,Yf=6,Wf=8,Vf=10,Xf=12,Gf=function(t){var e=Pt(t);return t.y+e-e*t.originY},Hf=function(t){var e=Ot(t);return t.x-e*t.originX+.5*e},Uf=function(t,e){var i=Pt(t);return t.y=e-i+i*t.originY,t},Nf=function(t,e){var i=Ot(t),n=i*t.originX;return t.x=e+n-.5*i,t},Kf=function(t){var e=Ot(t);return t.x-e*t.originX},Jf=function(t,e){var i=Ot(t);return t.x=e+i*t.originX,t},Zf=function(t){var e=Ot(t);return t.x+e-e*t.originX},qf=function(t,e){var i=Ot(t);return t.x=e-i+i*t.originX,t},$f=function(t,e){var i=Pt(t),n=i*t.originY;return t.y=e+n-.5*i,t},Qf=function(t){var e=Pt(t);return t.y-e*t.originY+.5*e},tp=function(t){var e=Pt(t);return t.y-e*t.originY},ep=function(t,e){var i=Pt(t);return t.y=e+i*t.originY,t},ip=[];ip[11]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Nf(t,Hf(e)+i),Uf(t,Gf(e)+n),t},ip[Vf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Jf(t,Kf(e)-i),Uf(t,Gf(e)+n),t},ip[Xf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),qf(t,Zf(e)+i),Uf(t,Gf(e)+n),t},ip[Yf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),function(t,e,i){Nf(t,e),$f(t,i);}(t,Hf(e)+i,Qf(e)+n),t},ip[Ff]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Jf(t,Kf(e)-i),$f(t,Qf(e)+n),t},ip[Wf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),qf(t,Zf(e)+i),$f(t,Qf(e)+n),t},ip[If]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Nf(t,Hf(e)+i),ep(t,tp(e)-n),t},ip[Af]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Jf(t,Kf(e)-i),ep(t,tp(e)-n),t},ip[zf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),qf(t,Zf(e)+i),ep(t,tp(e)-n),t};var np=function(t,e,i,n,s){return ip[i](t,e,n,s)},sp=function(t,e,i,n,s,r){Df.setPosition(e,i).setSize(n,s),np(t,Df,r);},rp=Phaser.Utils.Objects.GetValue,op=Phaser.GameObjects.Group,ap=function(t,e,i){return t.add.text(0,0,"")},hp=void 0,lp=Phaser.Utils.Objects.GetValue,up=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=lp(t,"left",0),e.right=lp(t,"right",0),e.top=lp(t,"top",0),e.bottom=lp(t,"bottom",0)),e},cp=ie.prototype.add,dp=function(t){return cp.call(this,t),this.sizerEventsEnable&&(t.emit("sizer.add",t,this),this.emit("add",t,this)),this},fp={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),dp.call(this,t),this.backgroundChildren.push(t),this.getSizerConfig(t).padding=up(e),void 0!==i&&this.addChildrenMap(i,t),this},isBackground:function(t){return void 0!==this.backgroundChildren&&-1!==this.backgroundChildren.indexOf(t)}},pp=function t(e,i){var n=null;if(void 0===i)e.hasOwnProperty("rexContainer")&&((n=e.rexContainer.parent)?n.isRexSizer||(n=t(n)):n=null);else for(n=t(e);n&&n.name!==i;)n=t(n);return n},vp={getParentSizer:function(t,e){return "string"==typeof t&&(e=t,t=void 0),void 0===t&&(t=this),pp(t,e)},getTopmostSizer:function(t){return void 0===t&&(t=this),function(t){for(var e=pp(t);e;)t=e,e=pp(e);return t}(t)},hasParentSizer:function(t,e){void 0===e&&(e=this);for(var i=pp(e);i;){if(i===t)return !0;i=pp(i);}return !1},hasChild:function(t,e){return void 0===e&&(e=this),this.hasParentSizer(e,t)}},gp=Phaser.Utils.Array.Remove,yp=ie.prototype.remove,kp=vp.getParentSizer,mp=function(t,e){for(var i=kp(t);i;)i.removeChildCallback&&i.removeChildCallback(t,e),i=kp(i);return this.isBackground(t)&&gp(this.backgroundChildren,t),yp.call(this,t,e),!e&&this.sizerEventsEnable&&(t.emit("sizer.remove",t,this),this.emit("remove",t,this)),this},bp=Phaser.Utils.Array.Remove,Cp=vp.getParentSizer,xp={removeFromParentSizer:function(){var t=Cp(gameObject);return t&&t.remove(this),this},removeBackground:function(t,e){return void 0===this.backgroundChildren||this.getParentSizer(t)!==this||(bp(this.backgroundChildren,t),mp.call(this,t,e)),this},removeAllBackgrounds:function(t){if(void 0===this.backgroundChildren)return this;for(var e=this.backgroundChildren.length-1;e>=0;e--)this.remove(this.backgroundChildren[e],t);return this}},wp={getInnerPadding:function(t){return cr(this.space,t)},setInnerPadding:function(t,e){return dr(this.space,t,e),this},getOuterPadding:function(t){return cr(this.getSizerConfig(this).padding,t)},setOuterPadding:function(t,e){return dr(this.getSizerConfig(this).padding,t,e),this},getChildOuterPadding:function(t,e){return "string"==typeof t&&(t=this.getElement(t)),cr(this.getSizerConfig(t).padding,e)},setChildOuterPadding:function(t,e,i){return "string"==typeof t&&(t=this.getElement(t)),dr(this.getSizerConfig(t).padding,e,i),this}},Sp=function(t){var e=this.childrenWidth,i=void 0!==this.minWidth?this.minWidth:0;return void 0===t?(t=Math.max(i,e),this.layoutWarnEnable&&i>0&&e>i&&console.warn("Layout width warn: ".concat(this.constructor.name,"'s minWidth (").concat(i,") < childrenWidth (").concat(e,")"))):this.layoutWarnEnable&&(i>t||e>t)&&console.warn("Layout width warn: ".concat(this.constructor.name,"'s minWidth (").concat(i,") or childrenWidth (").concat(e," > targetWidth ").concat(t,")")),t},Op=function(t){var e=this.childrenHeight,i=void 0!==this.minHeight?this.minHeight:0;return void 0===t?(t=Math.max(i,e),this.layoutWarnEnable&&i>0&&e>i&&console.warn("Layout height warn: ".concat(this.constructor.name,"'s minHeight (").concat(i,") < childrenHeight (").concat(e,")"))):this.layoutWarnEnable&&(i>t||e>t)&&console.warn("Layout height warn: ".concat(this.constructor.name,"'s minHeight (").concat(i,") or childrenHeight (").concat(e,") > targetHeight (").concat(t,")")),t},Pp={getShownChildren:function(t){void 0===t&&(t=[]);for(var e,i=this.children,n=0,s=i.length;n0;){var i=e.shift();i.rexSizer&&i.rexSizer.hidden||(i!==this&&t.push(i),i.isRexContainerLite&&e.push.apply(e,m(i.children)));}return t}},Tp=function(){this._childrenWidth=void 0,this._childrenHeight=void 0;for(var t,e=this.getChildrenSizers(),i=0,n=e.length;i0){var e=t.runTransitionInCallback();t.delayCall(e,this.next,this);}else this.next();}},{key:"exit_TRANS_OPNE",value:function(){this.parent.removeDelayCall();}},{key:"next_OPEN",value:function(){return "TRANS_CLOSE"}},{key:"enter_OPEN",value:function(){this.parent.onOpen();}},{key:"exit_OPEN",value:function(){this.parent.removeDelayCall();}},{key:"next_TRANS_CLOSE",value:function(){return "CLOSE"}},{key:"enter_TRANS_CLOSE",value:function(){var t=this.parent;if(t.transitOutTime>0){var e=t.runTransitionOutCallback();t.delayCall(e,this.next,this);}else this.next();}},{key:"exit_TRANS_CLOSE",value:function(){this.parent.removeDelayCall();}},{key:"next_CLOSE",value:function(){return "TRANS_OPNE"}},{key:"enter_CLOSE",value:function(){this.parent.onClose();}},{key:"exit_CLOSE",value:function(){}},{key:"canOpen",value:function(){return "IDLE"===this.state||"CLOSE"===this.state}},{key:"canClose",value:function(){return "IDLE"===this.state||"OPEN"===this.state}}]),i}(_v),Rv={delayCall:function(t,e,i){return this.delayCallTimer=function(t,e,i,n,s){var r=Oa(t);return r.time.delayedCall(e,(function(){r.game.events.once("poststep",(function(){i.call(n,s);}));}))}(this,t,e,i),this},removeDelayCall:function(){return this.delayCallTimer&&(this.delayCallTimer.remove(!1),this.delayCallTimer=void 0),this}},Bv={setTransitInTime:function(t){return this.transitInTime=t,this},setTransitOutTime:function(t){return this.transitOutTime=t,this},setTransitInCallback:function(t){return t||(t=Ye),this.transitInCallback=t,this},setTransitOutCallback:function(t){return t||(t=Ye),this.transitOutCallback=t,this}},jv={runTransitionInCallback:function(){return this.transitInCallback(this.parent,this.transitInTime),this.transitInTime},onOpen:function(){},requestOpen:function(t,e){if(!this._state.canOpen())return this;this.openEventData=arguments.length>0?t:this.parent;var i=this.transitInTime;return void 0!==e&&(this.transitInTime=e),this._state.goto("TRANS_OPNE"),this.transitInTime=i,this}},Dv={runTransitionOutCallback:function(){return this.transitOutCallback(this.parent,this.transitOutTime),this.transitOutTime},onClose:function(){this.oneShotMode&&this.parent.destroy();},requestClose:function(t,e){if(!this._state.canClose)return this;this.closeEventData=arguments.length>0?t:this.parent;var i=this.transitOutTime;return void 0!==e&&(this.transitOutTime=e),this._state.goto("TRANS_CLOSE"),this.transitOutTime=i,this}},Av={};Object.assign(Av,Rv,Bv,jv,Dv);var Iv=Phaser.Utils.Objects.GetValue,zv=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).setTransitInTime(Iv(s,"duration.in",200)),r.setTransitOutTime(Iv(s,"duration.out",200)),r.setTransitInCallback(Iv(s,"transitIn")),r.setTransitOutCallback(Iv(s,"transitOut")),r.oneShotMode=Iv(s,"destroy",!1),r.delayCallTimer=void 0,r._state=new Lv(u(r),{eventEmitter:!1,initState:Iv(s,"initState","IDLE")}),r.openEventData=void 0,r.closeEventData=void 0,r}return r(i,[{key:"state",get:function(){return this._state.state}},{key:"shutdown",value:function(t){this.isShutdown||(this.transitInCallback=void 0,this.transitOutCallback=void 0,this.openEventData=void 0,this.closeEventData=void 0,this.removeDelayCall(),p(h(i.prototype),"shutdown",this).call(this,t));}}]),i}(Ta);Object.assign(zv.prototype,Av);var Fv=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;return n(this,i),(o=e.call(this,t,0,0,2,2,s,1)).setAlpha(r),o.setScrollFactor(0),o.boot(),o}return r(i,[{key:"boot",value:function(){this.scene.sys.events.on("prerender",this.resize,this);}},{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.scene.sys.events.off("prerender",this.resize,this),p(h(i.prototype),"destroy",this).call(this,t));}},{key:"tint",get:function(){return this.fillColor},set:function(t){this.setFillStyle(t,this.fillAlpha);}},{key:"resize",value:function(){var t=this.scene,e=t.sys.scale.gameSize,i=t.sys.cameras.main,n=e.width,s=e.height,r=1/i.zoom,o=n/2,a=s/2,h=n*r,l=s*r;this.x===o&&this.y===a||this.setPosition(o,a),this.width===h&&this.height===l||this.setSize(h,l).setOrigin(.5);}}]),i}(Phaser.GameObjects.Rectangle),Yv=Phaser.Utils.Objects.GetValue,Wv=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,{eventEmitter:!1})).resetFromJSON(s),r.boot(),r}return r(i,[{key:"resetFromJSON",value:function(t){return this.setHitAreaMode(Yv(t,"hitAreaMode",0)),this.setEnable(Yv(t,"enable",!0)),this.setStopMode(Yv(t,"stopAllLevels",!0)),this}},{key:"boot",value:function(){this.parent.on("pointerdown",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerup",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointermove",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerover",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerout",(function(t,e){this.stopAllLevels&&e.stopPropagation();}),this);}},{key:"setHitAreaMode",value:function(t){"string"==typeof t&&(t=Vv[t]);var e=this.parent;return e.input&&e.removeInteractive(),0===t?e.setInteractive():e.setInteractive({hitArea:{},hitAreaCallback:function(){return !0}}),this}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),t?this.parent.setInteractive():this.parent.disableInteractive(),this.enable=t,this}},{key:"setStopMode",value:function(t){return void 0===t&&(t=!0),this.stopAllLevels=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}}]),i}(Ta),Vv={default:0,fullWindow:1},Xv=Phaser.Utils.Objects.GetValue,Gv=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=Xv(s,"color",0),a=Xv(s,"alpha",.8);return (r=e.call(this,t,o,a)).touchEventStop=new Wv(u(r),{hitAreaMode:1}),r}return r(i)}(Fv),Hv=function(t,e){void 0!==t._modalScaleSave?(t.scaleX=t._modalScaleSave,t.scaleY=t._modalScaleSave):t._modalScaleSave=t.scaleX,Dp(t,e);},Uv=function(t,e){Ap(t,e,void 0,void 0,!1);},Nv=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,Up(t,e);},Kv=function(t,e){Np(t,e,!1);},Jv=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,Up(t,e,t.alpha);},Zv=function(t,e){Np(t,e,!1);},qv=function(t,e,i,n,s){return !!t&&(!(n&&!n(t,e,i))&&(!!_t(t,!0).contains(e,i)&&!(s&&!s(t,e,i))))},$v=Phaser.Utils.Objects.GetValue,Qv=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),null==s.transitIn&&(s.transitIn=tg.popUp),null==s.transitOut&&(s.transitOut=tg.scaleDown),s.destroy=$v(s,"destroy",!0),r=e.call(this,t,s);var o=$v(s,"cover");r.cover=!1!==o?function(t,e){var i=t.scene,n=new Gv(i,e);return i.add.existing(n),t.isRexContainerLite?(t.pin(n,{syncPosition:!1,syncRotation:!1,syncScale:!1,syncAlpha:!1,syncScrollFactor:!1}),t.moveDepthBelow(n)):i.children.moveBelow(n,t),n}(t,o):void 0,r.cover&&(r.setCoverTransitInCallback($v(o,"transitIn",Jv)),r.setCoverTransitOutCallback($v(o,"transitOut",Zv)));var a=$v(s,"touchOutsideClose",!1),h=$v(s,"duration.hold",-1),l=$v(s,"timeOutClose",h>=0),c=$v(s,"anyTouchClose",!1);return $v(s,"manualClose",!1)&&(a=!1,c=!1,l=!1),c&&(a=!1),l?r.setDisplayTime(h):r.setDisplayTime(-1),c?r.once("open",r.anyTouchClose,u(r)):a&&r.once("open",r.touchOutsideClose,u(r)),$v(s,"openOnStart",!0)&&r.delayCall(0,r.requestOpen,u(r)),r}return r(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.cover||this.scene.input.off("pointerup",this.touchCloseCallback,this),this.cover&&!t&&(this.cover.destroy(),this.cover=void 0),p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"touchOutsideClose",value:function(){return this.cover?this.cover.on("pointerup",this.touchCloseCallback,this):this.scene.input.on("pointerup",this.touchCloseCallback,this),this.clickOutsideTest=!0,this}},{key:"anyTouchClose",value:function(){return this.cover?this.cover.once("pointerup",this.touchCloseCallback,this):this.scene.input.once("pointerup",this.touchCloseCallback,this),this}},{key:"touchCloseCallback",value:function(t){this.clickOutsideTest&&qv(this.parent,t.worldX,t.worldY)||this.requestClose();}},{key:"runTransitionInCallback",value:function(){var t=p(h(i.prototype),"runTransitionInCallback",this).call(this),e=this.cover;return e&&this.coverTransitInCallback&&this.coverTransitInCallback(e,t),t}},{key:"runTransitionOutCallback",value:function(){var t=p(h(i.prototype),"runTransitionOutCallback",this).call(this),e=this.cover;return e&&this.coverTransitOutCallback&&this.coverTransitOutCallback(e,t),t}},{key:"onOpen",value:function(){var t=this.displayTime;t>=0&&this.delayCall(t,this.requestClose,this),this.emit("open",this.parent,this),p(h(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.closeEventData),p(h(i.prototype),"onClose",this).call(this);}},{key:"setDisplayTime",value:function(t){return this.displayTime=t,this}},{key:"setTransitInCallback",value:function(t){switch("string"==typeof t&&(t=tg[t]),t){case tg.popUp:t=Hv;break;case tg.fadeIn:t=Nv;}return p(h(i.prototype),"setTransitInCallback",this).call(this,t),this}},{key:"setTransitOutCallback",value:function(t){switch("string"==typeof t&&(t=tg[t]),t){case tg.scaleDown:t=Uv;break;case tg.fadeOut:t=Kv;}return p(h(i.prototype),"setTransitOutCallback",this).call(this,t),this}},{key:"setCoverTransitInCallback",value:function(t){return this.coverTransitInCallback=t,this}},{key:"setCoverTransitOutCallback",value:function(t){return this.coverTransitOutCallback=t,this}}]),i}(zv),tg={popUp:0,fadeIn:1,scaleDown:0,fadeOut:1},eg={modal:function(t,e){return we(t)&&(e=t,t=void 0),void 0===this._modalBehavior&&(this.onCreateModalBehavior&&this.onCreateModalBehavior(this,t),this._modalBehavior=function(t,e){var i=new Qv(t,e);return i.on("open",(function(){t.emit("modal.open",i);})),i.on("close",(function(e){t.emit("modal.close",e,i);})),t.on("modal.requestClose",i.requestClose,i),i}(this,t)),e&&this._modalBehavior.once("close",e),this._modalBehavior.requestOpen(),this},modalPromise:function(t){var e=this;return new Promise((function(i,n){e.modal(t,i);}))},modalClose:function(t){return function(t,e){t.emit("modal.requestClose",e);}(this,t),this}},ig=function(t,e,i,n){if(e)return qv(t,e.worldX,e.worldY,i,n);for(var s=t.scene.input.manager,r=s.pointersTotal,o=s.pointers,a=0;a=this.dragThreshold||this.isPointerInside(t))&&this.cancel();}},{key:"click",value:function(t,e){if(!this.enable)return this;if(void 0===t)return this.emit("clickoutside",this,this.parent,e),this;this.pointer=void 0;var i=this.lastClickTime;return void 0!==i&&t-i<=this.clickInterval||(this.lastClickTime=t,this.emit("clickoutside",this,this.parent,e)),this}},{key:"cancel",value:function(){return this.pointer=void 0,this}}]),i}(Ta),mg={press:0,pointerdown:0,release:1,pointerup:1},bg={onClickOutside:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._clickOutside&&(t._clickOutside=new kg(t,n)),t._clickOutside.on("clickoutside",e,i),this):this},offClickOutside:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._clickOutside||t._clickOutside.off("clickoutside",e,i),this},enableClickOutside:function(t,e){return t&&"object"!==i(t)&&(e=t,t=this),void 0===t._clickOutside||t._clickOutside.setEnable(e),this},disableClickOutside:function(t){return t&&"object"!==i(t)&&(t=this),void 0===t._clickOutside||t._clickOutside.setEnable(!1),this}},Cg=function(t){a(i,t);var e=d(i);function i(){var t;return n(this,i),(t=e.call(this,{eventEmitter:!1})).goto("IDLE"),t}return r(i,[{key:"setCooldownTime",value:function(t){return this.cooldownTime=t,this.cooldownMode=void 0!==t,this}},{key:"request",value:function(){return this.runMethod("request")}},{key:"update_IDLE",value:function(){this.compensationTime=0;}},{key:"request_IDLE",value:function(){return this.next(),!0}},{key:"next_IDLE",value:function(){if(this.cooldownMode)return "COOLDOWN"}},{key:"enter_COOLDOWN",value:function(){this.remainderTime=this.cooldownTime+this.compensationTime;}},{key:"update_COOLDOWN",value:function(t,e){this.remainderTime-=e,this.remainderTime<0&&(this.compensationTime=this.cooldownTime>e?-this.remainderTime:0,this.goto("IDLE"));}},{key:"request_COOLDOWN",value:function(){return !1}}]),i}(_v),xg=Phaser.Utils.Objects.GetValue,wg=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s))._enable=void 0,r.cooldown=new Cg,r.parent.setInteractive(xg(s,"inputConfig",void 0)),r.resetFromJSON(s),r.boot(),r}return r(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.prevIsInTouch=!1,this.isInTouching=!1,this.setEnable(xg(t,"enable",!0)),this.setCooldown(xg(t,"cooldown",void 0)),this}},{key:"boot",value:function(){var t=this.parent;t.on("pointerdown",this.onPointIn,this),t.on("pointerover",this.onPointIn,this),t.on("pointerup",this.onPointOut,this),t.on("pointerout",this.onPointOut,this),this.scene.sys.events.on("preupdate",this.preupdate,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.scene.sys.events.off("preupdate",this.preupdate,this),this.pointer=void 0,p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t)return t||(this.prevIsInTouch=!1,this.isInTouching=!1,this.pointer=void 0),this._enable=t,this}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"cooldownTime",get:function(){return this.cooldown.cooldownTime},set:function(t){this.cooldown.setCooldownTime(t);}},{key:"setCooldown",value:function(t){return this.cooldownTime=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"onPointIn",value:function(t,e,i){this.enable&&t.isDown&&void 0===this.pointer&&(this.pointer=t,this.isInTouching=!0);}},{key:"onPointOut",value:function(t){this.enable&&this.pointer===t&&(this.pointer=void 0,this.isInTouching=!1);}},{key:"preupdate",value:function(t,e){this.cooldown.update(t,e),!this.prevIsInTouch&&this.isInTouching&&this.emit("touchstart",this,this.parent),this.isInTouching&&this.cooldown.request()&&this.emit("intouch",this,this.parent,this.pointer),this.prevIsInTouch&&!this.isInTouching&&this.emit("touchend",this,this.parent),this.prevIsInTouch=this.isInTouching;}}]),i}(Ta),Sg={isPointerInBounds:function(t){return void 0===t?t=this:"string"==typeof t&&(t=this.getElement(t)),!!t&&ig(t)},onTouching:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._inTouching&&(t._inTouching=new wg(t,n)),t._inTouching.on("intouch",e,i),this):this},offTouching:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._inTouching||t._inTouching.off("intouch",e,i),this},onTouchingEnd:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._inTouching&&(t._inTouching=new wg(t,n)),t._inTouching.on("touchend",e,i),this):this},offTouchingEnd:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._inTouching||t._inTouching.off("touchend",e,i),this},enableTouching:function(t,e){return t&&"object"!==i(t)&&(e=t,t=this),void 0===t._inTouching||t._inTouching.setEnable(e),this},disableTouching:function(t){return t&&"object"!==i(t)&&(t=this),void 0===t._inTouching||t._inTouching.setEnable(!1),this}},Og=function(t,e,i){for(var n,s=0,r=t.length;s0),this.onDragStart()));}},{key:"onPointerUp",value:function(t){this.enable&&((!this.bounds||this.bounds.contains(t.x,t.y))&&this.pointer===t&&(this.pointer=void 0,this.movedState=!1,this.tracerState=Wg,this.onDragEnd()));}},{key:"onPointerMove",value:function(t){if(this.enable&&t.isDown){var e=!this.bounds||this.bounds.contains(t.x,t.y),i=this.pointer===t;!i&&e||(i&&!e?this.onPointerUp(t):(this.movedState||(this.movedState=t.x!==t.downX||t.y!==t.downY),this.movedState&&this.onDrag()));}}},{key:"dragCancel",value:function(){return this.tracerState===Vg&&this.onDragEnd(),this.pointer=void 0,this.tracerState=Wg,this}},{key:"onDragStart",value:function(){this.emit("dragstart",this);}},{key:"onDragEnd",value:function(){this.emit("dragend",this);}},{key:"onDrag",value:function(){this.emit("drag",this);}},{key:"preUpdate",value:function(t,e){}},{key:"postUpdate",value:function(t,e){}},{key:"startTicking",value:function(){p(h(i.prototype),"startTicking",this).call(this),this.scene.sys.events.on("preupdate",this.preUpdate,this),this.scene.sys.events.on("postupdate",this.postUpdate,this);}},{key:"stopTicking",value:function(){p(h(i.prototype),"stopTicking",this).call(this),this.scene&&(this.scene.sys.events.off("preupdate",this.preUpdate,this),this.scene.sys.events.off("postupdate",this.postUpdate,this));}},{key:"setRecongizedStateObject",value:function(t){return this.recongizedState=t,this}},{key:"state",get:function(){return this.recongizedState.state},set:function(t){this.recongizedState.state=t;}},{key:"cancel",value:function(){return this.state=Xg,this}}]),i}(Ea),Wg=0,Vg=1,Xg="IDLE",Gg=Phaser.Utils.Objects.GetValue,Hg=Phaser.Math.Distance.Between,Ug=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=u(r=e.call(this,t,s)),a={states:{IDLE:{enter:function(){o.stop(),o.tapsCount=0,o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.start(),o.tapsCount=0,o.emit("tappingstart",o,o.gameObject,o.lastPointer);}},RECOGNIZED:{enter:function(){o.start(),o.emit("tap",o,o.gameObject,o.lastPointer),o.emit("".concat(o.tapsCount,"tap"),o,o.gameObject,o.lastPointer);}}},init:function(){this.state=Ng;},eventEmitter:!1};return r.setRecongizedStateObject(new _v(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setHoldTime(Gg(t,"time",250)),this.setTapInterval(Gg(t,"tapInterval",200)),this.setDragThreshold(Gg(t,"threshold",9)),this.setTapOffset(Gg(t,"tapOffset",10));var e=Gg(t,"taps",void 0);return void 0!==e?this.setTaps(e):(this.setMaxTaps(Gg(t,"maxTaps",void 0)),this.setMinTaps(Gg(t,"minTaps",void 0))),this}},{key:"onDragStart",value:function(){switch(this.state){case Ng:this.state=Kg;break;case Kg:var t=this.lastPointer;Hg(t.upX,t.upY,t.x,t.y)>this.tapOffset&&(this.state=Jg,this.state=Kg);break;case Jg:this.state=Kg;}}},{key:"onDragEnd",value:function(){this.state===Kg&&(this.tapsCount++,this.emit("tapping",this,this.gameObject,this.lastPointer),void 0!==this.maxTaps&&this.tapsCount===this.maxTaps&&(this.state=Jg));}},{key:"onDrag",value:function(){this.state!==Ng&&this.pointer.getDistance()>this.dragThreshold&&(this.state=Ng);}},{key:"preUpdate",value:function(t,e){if(this.isRunning&&this.enable&&this.state===Kg){var i=this.lastPointer;if(i.isDown)t-i.downTime>this.holdTime&&(this.state=Ng);else t-i.upTime>this.tapInterval&&(void 0===this.minTaps||this.tapsCount>=this.minTaps?this.state=Jg:this.state=Ng);}}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===Jg&&(this.state=Ng);}},{key:"isTapped",get:function(){return this.state===Jg}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setTapInterval",value:function(t){return this.tapInterval=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"setTapOffset",value:function(t){return this.tapOffset=t,this}},{key:"setMaxTaps",value:function(t){return this.maxTaps=t,this}},{key:"setMinTaps",value:function(t){return this.minTaps=t,this}},{key:"setTaps",value:function(t,e){return void 0===e&&(e=t),this.setMinTaps(t).setMaxTaps(e),this}}]),i}(Yg),Ng="IDLE",Kg="BEGIN",Jg="RECOGNIZED",Zg=Phaser.Utils.Objects.GetValue,qg=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=u(r=e.call(this,t,s)),a={states:{IDLE:{enter:function(){o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.start();},exit:function(){o.stop();}},RECOGNIZED:{enter:function(){o.emit("pressstart",o,o.gameObject,o.lastPointer);},exit:function(){o.emit("pressend",o,o.gameObject,o.lastPointer);}}},init:function(){this.state=$g;},eventEmitter:!1};return r.setRecongizedStateObject(new _v(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Zg(t,"threshold",9)),this.setHoldTime(Zg(t,"time",251)),this}},{key:"onDragStart",value:function(){this.state=Qg,0===this.holdTime&&(this.state=ty);}},{key:"onDragEnd",value:function(){this.state=$g;}},{key:"onDrag",value:function(){this.state!==$g&&this.pointer.getDistance()>this.dragThreshold&&(this.state=$g);}},{key:"preUpdate",value:function(t,e){this.isRunning&&this.enable&&(this.state===Qg&&t-this.pointer.downTime>=this.holdTime&&(this.state=ty));}},{key:"isPressed",get:function(){return this.state===ty}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Yg),$g="IDLE",Qg="BEGIN",ty="RECOGNIZED";Phaser.Utils.Objects.GetValue;var ey=Phaser.Math.Distance.Between,iy=Phaser.Math.Angle.Between,ny={getDt:function(){return xc(this.scene)},getVelocity:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return ey(e.x,e.y,t.x,t.y)/(.001*this.getDt())},getVelocityX:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Math.abs(t.x-e.x)/(.001*this.getDt())},getVelocityY:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Math.abs(t.y-e.y)/(.001*this.getDt())},getVelocityAngle:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return iy(e.x,e.y,t.x,t.y)}},sy={"up&down":0,"left&right":1,"4dir":2,"8dir":3},ry={},oy=Phaser.Utils.Objects.GetValue,ay=Phaser.Math.RadToDeg,hy=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=u(r=e.call(this,t,s)),a={states:{IDLE:{enter:function(){o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.validDrag=!1;}},RECOGNIZED:{enter:function(){o.start(),o.updateDirectionStates(),o.emit("swipe",o,o.gameObject,o.lastPointer);},exit:function(){o.stop(),o.clearDirectionStates();}}},init:function(){this.state=ly;},eventEmitter:!1};return r.setRecongizedStateObject(new _v(a)),r.clearDirectionStates(),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(oy(t,"threshold",10)),this.setVelocityThreshold(oy(t,"velocityThreshold",1e3)),this.setDirectionMode(oy(t,"dir","8dir")),this}},{key:"onDragStart",value:function(){this.state=uy;}},{key:"onDragEnd",value:function(){this.state=ly;}},{key:"onDrag",value:function(){this.state===uy&&(this.validDrag||(this.validDrag=0===this.dragThreshold||this.pointer.getDistance()>=this.dragThreshold),this.validDrag&&this.dragVelocity>this.velocityThreshold&&(this.state=cy));}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===cy&&(this.state=ly);}},{key:"isSwiped",get:function(){return this.state===cy}},{key:"dragVelocity",get:function(){var t;switch(this.dirMode){case 0:t=this.getVelocityY();break;case 1:t=this.getVelocityX();break;default:t=this.getVelocity();}return t}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"setVelocityThreshold",value:function(t){return this.velocityThreshold=t,this}},{key:"setDirectionMode",value:function(t){return "string"==typeof t&&(t=sy[t]),this.dirMode=t,this}},{key:"updateDirectionStates",value:function(){return function(t,e,i){switch(void 0===i?i={}:!0===i&&(i=ry),i.left=!1,i.right=!1,i.up=!1,i.down=!1,t=(t+360)%360,e){case 0:t<180?i.down=!0:i.up=!0;break;case 1:t>90&&t<=270?i.left=!0:i.right=!0;break;case 2:t>45&&t<=135?i.down=!0:t>135&&t<=225?i.left=!0:t>225&&t<=315?i.up=!0:i.right=!0;break;case 3:t>22.5&&t<=67.5?(i.down=!0,i.right=!0):t>67.5&&t<=112.5?i.down=!0:t>112.5&&t<=157.5?(i.down=!0,i.left=!0):t>157.5&&t<=202.5?i.left=!0:t>202.5&&t<=247.5?(i.left=!0,i.up=!0):t>247.5&&t<=292.5?i.up=!0:t>292.5&&t<=337.5?(i.up=!0,i.right=!0):i.right=!0;}}(ay(this.getVelocityAngle()),this.dirMode,this),this}},{key:"clearDirectionStates",value:function(){return this.left=!1,this.right=!1,this.up=!1,this.down=!1,this}}]),i}(Yg);Object.assign(hy.prototype,ny);var ly="IDLE",uy="BEGIN",cy="RECOGNIZED",dy=Phaser.Utils.Objects.GetValue,fy=Phaser.Utils.Array.SpliceOne,py=Phaser.Math.Distance.Between,vy=Phaser.Math.Angle.Between,gy=function(){function t(e,i){n(this,t);var s=e.input.manager.pointersTotal-1;s<2&&e.input.addPointer(2-s),this.scene=e,this.setEventEmitter(dy(i,"eventEmitter",void 0)),this._enable=void 0,this.pointers=[],this.movedState={},this.resetFromJSON(i),this.boot();}return r(t,[{key:"resetFromJSON",value:function(t){return this.setEnable(dy(t,"enable",!0)),this.bounds=dy(t,"bounds",void 0),this.tracerState=ky,this.pointers.length=0,Yt(this.movedState),this}},{key:"boot",value:function(){this.scene.input.on("pointerdown",this.onPointerDown,this),this.scene.input.on("pointerup",this.onPointerUp,this),this.scene.input.on("gameout",this.dragCancel,this),this.scene.input.on("pointermove",this.onPointerMove,this),this.scene.sys.events.once("shutdown",this.destroy,this);}},{key:"shutdown",value:function(){this.scene&&(this.destroyEventEmitter(),this.pointers.length=0,Yt(this.movedState),this.scene.input.off("pointerdown",this.onPointerDown,this),this.scene.input.off("pointerup",this.onPointerUp,this),this.scene.input.off("gameout",this.dragCancel,this),this.scene.input.off("pointermove",this.onPointerMove,this),this.scene.sys.events.off("shutdown",this.destroy,this),this.scene=void 0);}},{key:"destroy",value:function(){this.shutdown();}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t)return t||this.dragCancel(),this._enable=t,this}},{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:"onPointerDown",value:function(t){if(this.enable&&(2!==this.pointers.length&&(!this.bounds||this.bounds.contains(t.x,t.y))&&-1===this.pointers.indexOf(t)))switch(this.movedState[t.id]=!1,this.pointers.push(t),this.tracerState){case ky:this.tracerState=my,this.onDrag1Start();break;case my:this.tracerState=by,this.onDrag2Start();}}},{key:"onPointerUp",value:function(t){if(this.enable&&(!this.bounds||this.bounds.contains(t.x,t.y))){var e=this.pointers.indexOf(t);if(-1!==e)switch(delete this.movedState[t.id],fy(this.pointers,e),this.tracerState){case my:this.tracerState=ky,this.onDrag1End();break;case by:this.tracerState=my,this.onDrag2End(),this.onDrag1Start();}}}},{key:"onPointerMove",value:function(t){if(this.enable&&t.isDown){var e=!this.bounds||this.bounds.contains(t.x,t.y),i=-1!==this.pointers.indexOf(t);if(!i&&e);else if(i&&!e)this.onPointerUp(t);else if(this.movedState[t.id]||(this.movedState[t.id]=t.x!==t.downX||t.y!==t.downY),this.movedState[t.id])switch(this.tracerState){case my:this.onDrag1();break;case by:this.onDrag2();}}}},{key:"dragCancel",value:function(){return this.tracerState===by&&this.onDrag2End(),this.pointers.length=0,Yt(this.movedState),this.tracerState=ky,this}},{key:"onDrag1Start",value:function(){this.emit("drag1start",this);}},{key:"onDrag1End",value:function(){this.emit("drag1end",this);}},{key:"onDrag1",value:function(){this.emit("drag1",this);}},{key:"onDrag2Start",value:function(){this.emit("drag2start",this);}},{key:"onDrag2End",value:function(){this.emit("drag2end",this);}},{key:"onDrag2",value:function(){this.emit("drag2",this);}},{key:"distanceBetween",get:function(){if(this.tracerState!==by)return 0;var t=this.pointers[0],e=this.pointers[1];return py(t.x,t.y,e.x,e.y)}},{key:"angleBetween",get:function(){if(this.tracerState!==by)return 0;var t=this.pointers[0],e=this.pointers[1];return vy(t.x,t.y,e.x,e.y)}},{key:"drag1Vector",get:function(){var t=this.pointers[0];if(t&&this.movedState[t.id]){var e=t.position,i=t.prevPosition;yy.x=e.x-i.x,yy.y=e.y-i.y;}else yy.x=0,yy.y=0;return yy}},{key:"centerX",get:function(){if(this.tracerState!==by)return 0;var t=this.pointers[0].position,e=this.pointers[1].position;return (t.x+e.x)/2}},{key:"centerY",get:function(){if(this.tracerState!==by)return 0;var t=this.pointers[0].position,e=this.pointers[1].position;return (t.y+e.y)/2}},{key:"prevCenterX",get:function(){if(this.tracerState!==by)return 0;var t=this.movedState[this.pointers[0].id]?this.pointers[0].prevPosition:this.pointers[0].position,e=this.movedState[this.pointers[1].id]?this.pointers[1].prevPosition:this.pointers[1].position;return (t.x+e.x)/2}},{key:"prevCenterY",get:function(){if(this.tracerState!==by)return 0;var t=this.movedState[this.pointers[0].id]?this.pointers[0].prevPosition:this.pointers[0].position,e=this.movedState[this.pointers[1].id]?this.pointers[1].prevPosition:this.pointers[1].position;return (t.y+e.y)/2}},{key:"movementCenterX",get:function(){return this.centerX-this.prevCenterX}},{key:"movementCenterY",get:function(){return this.centerY-this.prevCenterY}},{key:"setRecongizedStateObject",value:function(t){return this.recongizedState=t,this}},{key:"state",get:function(){return this.recongizedState.state},set:function(t){this.recongizedState.state=t;}},{key:"cancel",value:function(){return this.state=Cy,this}}]),t}();Object.assign(gy.prototype,Xo);var yy={},ky=0,my=1,by=2,Cy="IDLE";Phaser.Utils.Objects.GetValue;var xy=Phaser.Math.RotateAround,wy=function(t,e,i,n){return xy(t,e,i,n),t.rotation+=n,t},Sy={},Oy=Phaser.Utils.Objects.GetValue,Py=Phaser.Math.Angle.WrapDegrees,Ty=Phaser.Math.Angle.ShortestBetween,My=Phaser.Math.RadToDeg,Ey=Phaser.Math.DegToRad,_y=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=u(r=e.call(this,t,s)),a={states:{IDLE:{enter:function(){o.prevAngle=void 0,o.angle=0;}},BEGIN:{},RECOGNIZED:{enter:function(){o.emit("rotatestart",o);},exit:function(){o.emit("rotateend",o);}}},init:function(){this.state=Ry;},eventEmitter:!1};return r.setRecongizedStateObject(new _v(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Oy(t,"threshold",0)),this}},{key:"onDrag2Start",value:function(){this.prevAngle=Py(My(this.angleBetween)),this.state=By,0===this.dragThreshold&&(this.state=jy);}},{key:"onDrag2End",value:function(){this.state=Ry;}},{key:"onDrag2",value:function(){switch(this.state){case By:if(this.pointers[0].getDistance()>=this.dragThreshold&&this.pointers[1].getDistance()>=this.dragThreshold){var t=Py(My(this.angleBetween));this.angle=Ty(this.prevAngle,t),this.prevAngle=t,this.state=jy;}break;case jy:t=Py(My(this.angleBetween));this.angle=Ty(this.prevAngle,t),this.prevAngle=t,this.emit("rotate",this);}}},{key:"isRotated",get:function(){return this.state===jy}},{key:"rotation",get:function(){return Ey(this.angle)}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(gy),Ly={spinObject:function(t,e){if(!this.isRotation)return this;void 0===e&&(e=this.pointers[0].camera);var i=this.movementCenterX,n=this.movementCenterY,s=function(t,e,i,n){return void 0===n?n={}:!0===n&&(n=Sy),i.getWorldPoint(t,e,n),n}(this.centerX,this.centerY,e,!0),r=s.x,o=s.y,a=this.rotation;if(Array.isArray(t))for(var h=t,l=0,u=h.length;l0?u.pop().setTexture(d,M):s(c,d,M),h&&c.add.existing(T),l){var E=b+w*P+o*w,_=C+S*O+a*S;T.setOrigin(o,a).setPosition(E,_).setScale(g,y).setRotation(k),im(T,b,C,k);}x.push(T);}return x}(t,e,i,n),o=0,a=r.length;on&&(i.width=i.height*n),i}(t,{width:this.width,height:this.height},!0);return t.setDisplaySize(e.width,e.height),this.resetChildScaleState(t),this}},{key:"resize",value:function(t,e){return p(h(i.prototype),"resize",this).call(this,t,e),this.scaleImage(),this}},{key:"setTexture",value:function(t,e){var i=this.image;return i.setTexture(t,e),null!==t?(this.setChildVisible(i,!0),this.scaleImage()):this.setChildVisible(i,!1),this}}]),i}(ie);Object.assign(ym.prototype,sm);var km=function(t,e){if(this.scene.sys.scale.autoRound&&(t=Math.floor(t),e=Math.floor(e)),this.width===t&&this.height===e)return this;var i=this.node.style;return i.width="".concat(t,"px"),i.height="".concat(e,"px"),this.updateSize(),this},mm={id:["id",void 0],text:["value",void 0],maxLength:["maxLength",void 0],minLength:["minLength",void 0],placeholder:["placeholder",void 0],tooltip:["title",void 0],readOnly:["readOnly",!1],spellCheck:["spellcheck",!1],autoComplete:["autocomplete","off"]},bm={align:["textAlign",void 0],paddingLeft:["padding-left",void 0],paddingRight:["padding-right",void 0],paddingTop:["padding-top",void 0],paddingBottom:["padding-bottom",void 0],fontFamily:["fontFamily",void 0],fontSize:["font-size",void 0],color:["color","#ffffff"],backgroundColor:["backgroundColor","transparent"],border:["border",0],borderColor:["borderColor","transparent"],outline:["outline","none"],direction:["direction",void 0]},Cm={input:"textchange",click:"click",dblclick:"dblclick",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",keydown:"keydown",keyup:"keyup",keypress:"keypress",compositionstart:"compositionStart",compositionend:"compositionEnd",compositionupdate:"compositionUpdate",focus:"focus",blur:"blur",select:"select"},xm=Phaser.Utils.Objects.GetValue,wm=function(t,e,i,n){var s=xm(n,"preventDefault",!1),r=xm(n,"preTest"),o=function(n){e.addEventListener(n,(function(e){r&&!r(t,n)||t.emit(i[n],t,e),s&&e.preventDefault();}));};for(var a in i)o(a);},Sm=Phaser.GameObjects.DOMElement,Om=Phaser.Utils.Objects.IsPlainObject,Pm=Phaser.Utils.Objects.GetValue,Tm=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l,c;n(this,i),Om(s)?(s=Pm(h=s,"x",0),r=Pm(h,"y",0),o=Pm(h,"width",0),a=Pm(h,"height",0)):Om(o)&&(o=Pm(h=o,"width",0),a=Pm(h,"height",0)),void 0===h&&(h={});var d=Pm(h,"inputType",void 0);void 0===d&&(d=Pm(h,"type","text")),"textarea"===d?(c=document.createElement("textarea")).style.resize="none":(c=document.createElement("input")).type=d,Fu(mm,h,c);var f=Pm(h,"style",void 0);f=Fu(bm,h,f);var p=c.style;for(var v in h)v in mm||v in bm||v in p&&(f[v]=h[v]);return f["box-sizing"]="border-box",(l=e.call(this,t,s,r,c,f)).type="rexInputText",l.resize(o,a),wm(u(l),c,Cm),Yu(c),Pm(h,"selectAll",!1)&&l.selectAll(),l._isFocused=!1,l.on("focus",(function(){this._isFocused=!0;}),u(l)).on("blur",(function(){this._isFocused=!1;}),u(l)),l}return r(i,[{key:"inputType",get:function(){return "textarea"===this.node.tagName.toLowerCase()?"textarea":this.node.type}},{key:"text",get:function(){return this.node.value},set:function(t){this.node.value=t;}},{key:"setText",value:function(t){return this.text=t,this}},{key:"maxLength",get:function(){return this.node.maxLength},set:function(t){this.node.maxLength=t;}},{key:"setMaxLength",value:function(t){return this.maxLength=t,this}},{key:"minLength",get:function(){return this.node.minLength},set:function(t){this.node.minLength=t;}},{key:"setMinLength",value:function(t){return this.minLength=t,this}},{key:"placeholder",get:function(){return this.node.placeholder},set:function(t){this.node.placeholder=t;}},{key:"setPlaceholder",value:function(t){return this.placeholder=t,this}},{key:"selectText",value:function(t,e){return void 0===t?this.node.select():this.node.setSelectionRange(t,e),this}},{key:"selectAll",value:function(){return this.selectText(),this}},{key:"selectionStart",get:function(){return this.node.selectionStart}},{key:"selectionEnd",get:function(){return this.node.selectionEnd}},{key:"selectedText",get:function(){var t=this.node;return t.value.substring(t.selectionStart,t.selectionEnd)}},{key:"cursorPosition",get:function(){return this.node.selectionStart},set:function(t){this.node.setSelectionRange(t,t);}},{key:"setCursorPosition",value:function(t){return void 0===t?t=this.text.length:t<0&&(t=this.text.length+t),this.cursorPosition=t,this}},{key:"tooltip",get:function(){return this.node.title},set:function(t){this.node.title=t;}},{key:"setTooltip",value:function(t){return this.tooltip=t,this}},{key:"setTextChangedCallback",value:function(t){return this.onTextChanged=t,this}},{key:"readOnly",get:function(){return this.node.readOnly},set:function(t){this.node.readOnly=t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}},{key:"spellCheck",get:function(){return this.node.spellcheck},set:function(t){this.node.spellcheck=t;}},{key:"setSpellCheck",value:function(t){return this.spellCheck=t,this}},{key:"fontColor",get:function(){return this.node.style.color},set:function(t){this.node.style.color=t;}},{key:"setFontColor",value:function(t){return this.fontColor=t,this}},{key:"setStyle",value:function(t,e){return this.node.style[t]=e,this}},{key:"getStyle",value:function(t){return this.node.style[t]}},{key:"scrollToBottom",value:function(){return this.node.scrollTop=this.node.scrollHeight,this}},{key:"setEnabled",value:function(t){return void 0===t&&(t=!0),this.node.disabled=!t,this}},{key:"setBlur",value:function(){return this.node.blur(),this}},{key:"setFocus",value:function(){return this.node.focus(),this}},{key:"isFocused",get:function(){return this._isFocused}}]),i}(Sm),Mm={resize:km};Object.assign(Tm.prototype,Mm),Phaser.Utils.Objects.GetValue;var Em=function(t){var e=t.game,i=t.fileInput,n=t.closeDelay;return Xl(Je(e).events,"focus").then((function(){return void 0===(t=n)&&(t=0),new Promise((function(i,n){setTimeout((function(){i(e);}),t);}));var t,e;})).then((function(){var t={files:i.files};return Promise.resolve(t)}))};Phaser.Utils.Objects.GetValue;var _m=function(t){return this.setOrigin(t.originX,t.originY),this.setPosition(t.x,t.y),this.resize(t.displayWidth,t.displayHeight),this},Lm=function(t,e,i,n,s,r){if(null===s||!1===s);else if(we(s))s();else {var o=function(t,e,i){if(void 0===i)switch(e){case"image":case"svg":i="textures";break;case"animation":i="json";break;case"tilemapTiledJSON":case"tilemapCSV":i="tilemap";break;case"glsl":i="shader";break;default:i=e;}return t=Je(t),"textures"===i?t.textures:t.cache[i]}(t,i,s);o.exists(n)&&o.remove(n);}var a=t.load;if(r&&a.once("filecomplete-".concat(i,"-").concat(n),(function(t,e,i){r(i);})),we(e))e();else {var h=window.URL.createObjectURL(e);a[i](n,h);}a.start();},Rm={loadFile:function(t,e,i,n,s){var r=this.scene;return Lm(r,t,e,i,n,s),this},loadFilePromise:function(t,e,i,n){var s=this.scene;return new Promise((function(r,o){Lm(s,t,e,i,n,(function(t){r(t);}));}))}},Bm=Phaser.GameObjects.DOMElement,jm=Phaser.Utils.Objects.IsPlainObject,Dm=Phaser.Utils.Objects.GetValue,Am=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),jm(s)?(s=Dm(h=s,"x",0),r=Dm(h,"y",0),o=Dm(h,"width",0),a=Dm(h,"height",0)):jm(o)&&(o=Dm(h=o,"width",0),a=Dm(h,"height",0));var c=document.createElement("input");c.type="file",c.style.display="none";var d=document.createElement("label");d.appendChild(c);var f=Dm(h,"style",void 0);(l=e.call(this,t,s,r,d,f)).type="rexFileChooser",l.resetFromJSON(h),l.resize(o,a);var p=u(l);return c.onchange=function(){p.emit("change",p);},l.setCloseDelay(Dm(h,"closeDelay",200)),c.onclick=function(){Em({game:t,fileInput:c,closeDelay:p.closeDelay}).then((function(){p.emit("select",p);}));},l}return r(i,[{key:"resetFromJSON",value:function(t){return this.setAccept(Dm(t,"accept","")),this.setMultiple(Dm(t,"multiple",!1)),this}},{key:"setAccept",value:function(t){return void 0===t&&(t=""),this.fileInput.setAttribute("accept",t),this}},{key:"setMultiple",value:function(t){return void 0===t&&(t=!0),t?this.fileInput.setAttribute("multiple",""):this.fileInput.removeAttribute("multiple"),this}},{key:"setCloseDelay",value:function(t){return void 0===t&&(t=200),this.closeDelay=t,this}},{key:"fileInput",get:function(){return this.node.children[0]}},{key:"open",value:function(){return this.fileInput.click(),this}},{key:"files",get:function(){return this.fileInput.files}}]),i}(Bm),Im={resize:km,syncTo:_m};Object.assign(Am.prototype,Im,Rm);var zm={setDropEnable:function(t){return void 0===t&&(t=!0),this.dropEnable=t,this},toggleDropEnable:function(){return this.dropEnable=!this.dropEnable,this}},Fm={resize:km,syncTo:_m};Object.assign(Fm,zm,{addFilter:function(t,e){return this.filters||(this.filters={}),this.filters[t]=e,this},addFilters:function(t){for(var e in this.filters||(this.filters={}),t)this.filters[e]=t[e];return this}},Rm);var Ym={dragenter:"dragenter",dragleave:"dragleave",dragover:"dragover",drop:"drop"},Wm=Phaser.GameObjects.DOMElement,Vm=Phaser.Utils.Objects.IsPlainObject,Xm=Phaser.Utils.Objects.GetValue,Gm=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),Vm(s)?(s=Xm(h=s,"x",0),r=Xm(h,"y",0),o=Xm(h,"width",0),a=Xm(h,"height",0)):Vm(o)&&(o=Xm(h=o,"width",0),a=Xm(h,"height",0)),void 0===h&&(h={});var c=document.createElement("div"),d=Xm(h,"style",void 0);(l=e.call(this,t,s,r,c,d)).type="rexFileDropZone",l.resize(o,a),l._files=[],l.setDropEnable(Xm(h,"dropEnable",!0));var f=Xm(h,"filters");return f&&l.addFilters(f),wm(u(l),c,Ym,{preventDefault:!0,preTest:function(t){return t.dropEnable}}),l.on("drop",(function(t,e){this._files=e.dataTransfer.files;var i=this._files;if(i&&this.filters)for(var n in this.filters){for(var s=this.filters[n],r=[],o=0,a=i.length;o0&&this.emit("drop.".concat(n),r);}}),u(l)),l}return r(i,[{key:"files",get:function(){return this._files}}]),i}(Wm);Object.assign(Gm.prototype,Fm);var Hm=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),c(r=e.call(this,t),new Proxy(u(r),u(r)))}return r(i,[{key:"get",value:function(t,e){if(Ko(t,e))return t[e];var i=t.parent;return Ko(i,e)?i[e]:void 0}},{key:"set",value:function(t,e,i){return Ko(t,e)?t[e]=i:Ko(t.parent,e)&&(t.parent[e]=i),!0}},{key:"key",get:function(){return this.parent.texture.key},set:function(t){this.parent.setTexture(t,this.frame);}},{key:"frame",get:function(){return this.parent.frame.name},set:function(t){this.parent.setFrame(t);}},{key:"scale",get:function(){return this.parent.scaleX},set:function(t){this.parent.setScale(t);}}]),i}(Ta),Um=Phaser.Utils.Objects.GetValue,Nm=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),(r=e.call(this,t,s)).style=Um(s,"style",u(r));var o=Um(s,"propertiesMap");return r.activeStyle=Km(s,"active",o),r.hoverStyle=Km(s,"hover",o),r.disableStyle=Km(s,"disable",o),r.onModifyStyle=Um(s,"onModifyStyle"),r}return r(i,[{key:"getStyle",value:function(t){return ic(this.style,t)}},{key:"modifyStyle",value:function(t){for(var e in t)this.style[e]=t[e];return this.onModifyStyle&&this.onModifyStyle(this.parent,t),this}},{key:"applyStyle",value:function(t){if(t){var e=this.getStyle(t);return nc(e,t)?void 0:(this.modifyStyle(t),e)}}},{key:"setActiveState",value:function(t){return Jm.call(this,"active",t),this}},{key:"setHoverState",value:function(t){return Jm.call(this,"hover",t),this}},{key:"setDisableState",value:function(t){return Jm.call(this,"disable",t),this}}]),i}(Ta),Km=function(t,e,i){var n=ec(t,e);if(i)for(var s in n)i.hasOwnProperty(s)&&(n[i[s]]=n[s],delete n[s]);return n},Jm=function(t,e){void 0===e&&(e=!0);var i="".concat(t,"State"),n="".concat(t,"Style"),s="".concat(t,"StyleSave");this[i]!==e&&(this[i]=e,e?this[s]=this.applyStyle(this[n]):(this.applyStyle(this[s]),this[s]=void 0));},Zm={addStyleManager:function(t){return this.styleManager=new Nm(this,t),this},setActiveState:function(t){return this.styleManager.setActiveState(t),this},setHoverState:function(t){return this.styleManager.setHoverState(t),this},setDisableState:function(t){return this.styleManager.setDisableState(t),this}},qm=Phaser.GameObjects.Image,$m=Phaser.Utils.Objects.GetValue,Qm=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=$m(s,"x",0),a=$m(s,"y",0),h=$m(s,"key",""),l=$m(s,"frame",void 0);(r=e.call(this,t,o,a,h,l)).type="rexStatesImage";var c=$m(s,"effects",!0);return c&&Qo(u(r),c),r.style=new Hm(u(r),s),s.style=r.style,r.addStyleManager(s),delete s.style,r}return r(i)}(qm);Object.assign(Qm.prototype,Zm);var tb=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),c(r=e.call(this,t),new Proxy(u(r),u(r)))}return r(i,[{key:"get",value:function(t,e){if(Ko(t,e))return t[e];var i=t.parent;return Ko(i,e)?i[e]:void 0}},{key:"set",value:function(t,e,i){return Ko(t,e)?t[e]=i:Ko(t.parent,e)&&(t.parent[e]=i),!0}},{key:"key",get:function(){return this.parent.texture.key},set:function(t){this.parent.setTexture(t,this.frame);}},{key:"frame",get:function(){return this.parent.frame.name},set:function(t){this.parent.setFrame(t);}},{key:"leftWidth",get:function(){return this.parent.leftWidth},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,t,e.rightWidth,e.topHeight,e.bottomHeight);}},{key:"rightWidth",get:function(){return this.parent.rightWidth},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,t,e.topHeight,e.bottomHeight);}},{key:"topHeight",get:function(){return this.parent.topHeight},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,e.rightWidth,t,e.bottomHeight);}},{key:"bottomHeight",get:function(){return this.parent.bottomHeight},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,e.rightWidth,e.topHeight,t);}}]),i}(Ta),eb=Phaser.GameObjects.NineSlice,ib=Phaser.Utils.Objects.GetValue,nb=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=ib(s,"x",0),a=ib(s,"y",0),h=ib(s,"key",null),l=ib(s,"frame",null),c=ib(s,"width",0),d=ib(s,"height",0),f=ib(s,"leftWidth",0),p=ib(s,"rightWidth",0),v=ib(s,"topHeight",0),g=ib(s,"bottomHeight",0);(r=e.call(this,t,o,a,h,l,c,d,f,p,v,g)).type="rexStatesNineSlice";var y=ib(s,"effects",!0);return y&&Qo(u(r),y),r.style=new tb(u(r),s),s.style=r.style,r.addStyleManager(s),delete s.style,r}return r(i)}(eb);Object.assign(nb.prototype,Zm);var sb=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),void 0===s&&(s={}),(r=e.call(this,t,s)).type="rexStatesRoundRectangleShape",s.style=u(r),s.propertiesMap=rb,r.addStyleManager(s),delete s.style,delete s.propertiesMap,r}return r(i)}(on),rb={color:"fillColor",alpha:"fillAlpha",strokeWidth:"lineWidth"};Object.assign(sb.prototype,Zm);var ob=Phaser.GameObjects.Text,ab=Phaser.Utils.Objects.GetValue,hb=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=ab(s,"x",0),a=ab(s,"y",0),h=ab(s,"text","");return (r=e.call(this,t,o,a,h,s)).type="rexStatesText",s.style=r.style,s.onModifyStyle=function(t,e){var i=e.hasOwnProperty("fontStyle")||e.hasOwnProperty("fontSize")||e.hasOwnProperty("fontFamily");t.style.update(i);},r.addStyleManager(s),delete s.style,r}return r(i)}(ob);Object.assign(hb.prototype,Zm);var lb=function(t,e){void 0===e&&(e={}),void 0===e.options&&(e.options={});var i=e.options;i.responsive=!1,i.maintainAspectRatio=!1,i.hasOwnProperty("devicePixelRatio")||(i.devicePixelRatio=1);var n=!1;void 0===i.animation?i.animation={}:!1===i.animation&&(n=!0,i.animation={});var s=i.animation;n&&(s.duration=0);var r=s.onProgress;s.onProgress=function(e){r&&r(e),t.needRedraw();};var o=s.onComplete;return s.onComplete=function(e){o&&o(e),t.needRedraw();},e},ub=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;return n(this,i),(l=e.call(this,t,s,r,o,a)).type="rexChart",l.chart=void 0,void 0!==h&&l.setChart(h),l}return r(i,[{key:"destroy",value:function(t){this.scene&&(this.chart&&(this.chart.destroy(),this.chart=void 0),p(h(i.prototype),"destroy",this).call(this,t));}},{key:"resize",value:function(t,e){if(t===this.width&&e===this.height)return this;if(p(h(i.prototype),"resize",this).call(this,t,e),this.chart){var n=this.chart;n.height=this.canvas.height,n.width=this.canvas.width,n.aspectRatio=n.height?n.width/n.height:null,n.update();}return this}}]),i}(Xd),cb={setChart:function(t){if(!window.Chart){return console.error("Can not find chartjs! Load chartjs in preload stage.\nscene.load.script('chartjs', 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.8.0/Chart.min.js');"),this}return this.chart&&this.chart.destroy(),this.chart=new Chart(this.context,lb(this,t)),this},getChartDataset:function(t){if(void 0!==this.chart){if("string"!=typeof t)return this.chart.data.datasets[t];for(var e,i=this.chart.data.datasets,n=0,s=i.length;n(h=0===this.orientation?Math.abs(a.left-t):Math.abs(a.top-e))&&(s=h,n=r);}var h;a=i[i.length-1];return s>(h=0===this.orientation?Math.abs(a.right-t):Math.abs(a.bottom-e))&&(s=h,n=r+1),n},vb=Phaser.Utils.Objects.IsPlainObject,gb=Phaser.Utils.Objects.GetValue,yb=Phaser.Display.Align.CENTER,kb={min:0,full:-1},mb=function(t,e,n,s,r,o,a,h,l,u){dp.call(this,t);var c=t.isRexSpace,d=i(e);if(null===e)return this;if("number"===d);else if("string"===d)e=kb[e];else if(vb(e)){var f;e=gb(f=e,"proportion",void 0),n=gb(f,"align",yb),s=gb(f,"padding",0),r=gb(f,"expand",!1),o=gb(f,"key",void 0),a=gb(f,"index",void 0),t.isRexSizer||(h=gb(f,"minWidth",void 0),l=gb(f,"minHeight",void 0)),u=gb(f,"fitRatio",0);}return "string"==typeof n&&(n=jf[n]),void 0===e&&(e=c?1:0),void 0===n&&(n=yb),void 0===s&&(s=0),void 0===r&&(r=!1),void 0===h&&(c?h=0:t.isRexSizer||(h=t._minWidth)),void 0===l&&(c?l=0:t.isRexSizer||(l=t._minHeight)),void 0===u&&(u=0),(f=this.getSizerConfig(t)).proportion=e,f.align=n,f.padding=up(s),f.expand=r,f.fitRatio=0===e?u:0,void 0===a||a>=this.sizerChildren.length?this.sizerChildren.push(t):this.sizerChildren.splice(a,0,t),t.isRexSizer||(e>0&&(0===this.orientation?t.minWidth=void 0===h?Ot(t):h:t.minHeight=void 0===l?Pt(t):l),r&&(0===this.orientation?t.minHeight=l:t.minWidth=h)),void 0!==o&&this.addChildrenMap(o,t),this},bb={add:mb,addSpace:function(t){return this.insertSpace(void 0,t),this},insertSpace:function(t,e){return void 0===e&&(e=1),mb.call(this,new fb(this.scene),{proportion:e,minWidth:0,minHeight:0,index:t}),this},insert:function(t,e,i,n,s,r,o,a){return vb(i)&&(i.index=t),mb.call(this,e,i,n,s,r,o,t,a),this},insertAtPosition:function(t,e,i,n,s,r,o,a,h){var l=pb.call(this,t,e);return -1===l&&(l=void 0),this.insert(l,i,n,s,r,o,a,h),this}},Cb=Phaser.Utils.Array.Remove,xb={remove:function(t,e){return this.getParentSizer(t)!==this||(Cb(this.sizerChildren,t),mp.call(this,t,e)),this},removeAll:function(t){for(var e=this.sizerChildren.length-1;e>=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,Qy.call(this,t),this}},wb={getChildAlign:function(t){return this.getSizerConfig(t).align},setChildAlign:function(t,e){return "string"==typeof e&&(e=jf[e]),this.getSizerConfig(t).align=e,this}},Sb={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);var e,i,n,s=0,r=this.sizerChildren;if(0===this.orientation)for(var o=this.space.item,a=!0,h=0,l=r.length;h0&&this.proportionLength>0&&(i=n.proportion*this.proportionLength):n.expand&&(i=e-this.space.left-this.space.right-s.left-s.right);return i},getExpandedChildHeight:function(t,e){var i;void 0===e&&(e=this.height);var n=t.rexSizer,s=n.padding;0===this.orientation?n.expand&&(i=e-this.space.top-this.space.bottom-s.top-s.bottom):n.proportion>0&&this.proportionLength>0&&(i=n.proportion*this.proportionLength);return i},getChildrenSizers:function(t){void 0===t&&(t=[]);for(var e,i=this.sizerChildren,n=0,s=i.length;n0?(e=t-this.getChildrenWidth(!1),this.proportionLength=e/this.childrenProportion):this.proportionLength=0;}return t},resolveHeight:function(t){t=Op.call(this,t);if(void 0===this.proportionLength&&1===this.orientation){var e=t-this.childrenHeight;e>0?(e=t-this.getChildrenHeight(!1),this.proportionLength=e/this.childrenProportion):this.proportionLength=0;}return t}};Object.assign(Sb,bb,xb,wb,{getChildProportion:function(t){return this.getSizerConfig(t).proportion},setChildProportion:function(t,e){return this.getSizerConfig(t).proportion=e,this}},{getChildExpand:function(t){return this.getSizerConfig(t).expand},setChildExpand:function(t,e){return this.getSizerConfig(t).expand=e,this}});var Ob=function(){for(var t,e,i=0,n=this.sizerChildren,s=0,r=n.length;s0&&(i+=e);return i},Pb={x:0,h:0,horizontal:0,"left-to-right":0,y:1,v:1,vertical:1,"top-to-bottom":1},Tb=function(t){return "string"==typeof t&&(t=Pb[t]),t},Mb=Phaser.Utils.Objects.IsPlainObject,Eb=Phaser.Utils.Objects.GetValue,_b=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;return n(this,i),Mb(s)?(s=Eb(l=s,"x",0),r=Eb(l,"y",0),o=Eb(l,"width",void 0),a=Eb(l,"height",void 0),h=Eb(l,"orientation",0)):Mb(o)?(o=Eb(l=o,"width",void 0),a=Eb(l,"height",void 0),h=Eb(l,"orientation",0)):Mb(h)&&(h=Eb(l=h,"orientation",0)),void 0===h&&(h=0),(u=e.call(this,t,s,r,o,a,l)).type="rexSizer",u.sizerChildren=[],u.setOrientation(h),u.setItemSpacing(Eb(l,"space.item",0)),u.setStartChildIndex(Eb(l,"startChildIndex",0)),u.setRTL(Eb(l,"rtl",!1)),u.addChildrenMap("items",u.sizerChildren),u}return r(i,[{key:"setOrientation",value:function(t){return this.orientation=Tb(t),this}},{key:"setItemSpacing",value:function(t){return this.space.item=t,this}},{key:"setStartChildIndex",value:function(t){return this.startChildIndex=t,this}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},{key:"childrenProportion",get:function(){return void 0===this._childrenProportion&&(this._childrenProportion=Ob.call(this)),this._childrenProportion}}]),i}(Hy);Object.assign(_b.prototype,Sb);var Lb=function(){return Array.prototype.reduce.call(arguments,Rb,0)},Rb=function(t,e){return t+e},Bb=Phaser.Utils.Objects.IsPlainObject,jb=Phaser.Utils.Objects.GetValue,Db=Phaser.Display.Align.CENTER,Ab=function(t,e,i,n,s){if("number"==typeof t||"number"==typeof e)if(void 0===t){for(var r=0;r=0;e--){var i=this.sizerChildren[e];i&&this.remove(i,t);}return this},clear:function(t){return zb(this.sizerChildren,null),Qy.call(this,t),this}},Yb={setColumnSpace:function(t){if(this.space.column||(this.space.column=[]),this.space.column.length=this.columnCount-1,"number"==typeof t)zb(this.space.column,t);else for(var e=0,i=this.columnCount-1;e=0;n--){var s=n*this.columnCount+t;this.sizerChildren.splice(s,0,null);}return this.columnProportions.push(e),this.columnWidth.length+=1,this.space.column.splice(t,0,i),this},Gb={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);for(var e,i,n,s,r=0,o=this.sizerChildren,a=0;a0){var i=t-this.getChildrenWidth(!1);i>=0&&(this.proportionWidthLength=i/e);}else this.proportionWidthLength=0;}return t},resolveHeight:function(t){t=Op.call(this,t);if(void 0===this.proportionHeightLength){var e=this.totalRowProportions;if(e>0){var i=t-this.getChildrenHeight(!1);i>=0&&(this.proportionHeightLength=i/e);}else this.proportionHeightLength=0;}return t},resolveChildrenWidth:function(t){var e,i,n;for(var s in this.sizerChildren)(e=this.sizerChildren[s])&&e.isRexSizer&&!e.ignoreLayout&&(n=this.getColumnWidth(parseInt(s)%this.columnCount),i=this.getExpandedChildWidth(e,n),i=e.resolveWidth(i),e.resolveChildrenWidth(i));},runWidthWrap:function(t){var e,i,n;for(var s in this.sizerChildren)!(e=this.sizerChildren[s])||e.isRexSizer&&e.ignoreLayout||!e.runWidthWrap||(n=this.getColumnWidth(parseInt(s)%this.columnCount),i=this.getExpandedChildWidth(e,n),e.isRexSizer&&(i=e.resolveWidth(i)),e.runWidthWrap(i));return this},resetGrid:function(t,e,i,n,s){if(void 0===i&&(i=0),void 0===n&&(n=0),this.columnCount=t,this.rowCount=e,this.gridCount=t*e,this.removeAll(),this.sizerChildren.length=t*e,zb(this.sizerChildren,null),this.columnProportions=[],this.columnProportions.length=t,"number"==typeof i)zb(this.columnProportions,i);else for(var r=0;r0&&(e+=t);return e},Ub=function(){for(var t,e=0,i=0;i0&&(e+=t);return e},Nb=Phaser.Utils.Objects.IsPlainObject,Kb=Phaser.Utils.Objects.GetValue,Jb=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l,u,c,d){var f;return n(this,i),Nb(s)?(s=Kb(d=s,"x",0),r=Kb(d,"y",0),o=Kb(d,"width",void 0),a=Kb(d,"height",void 0),h=Kb(d,"column",d.col||0),l=Kb(d,"row",0),u=Kb(d,"columnProportions",0),c=Kb(d,"rowProportions",0)):Nb(o)?(o=Kb(d=o,"width",void 0),a=Kb(d,"height",void 0),h=Kb(d,"column",d.col||0),l=Kb(d,"row",0),u=Kb(d,"columnProportions",0),c=Kb(d,"rowProportions",0)):Nb(h)?(h=Kb(d=h,"column",d.col||0),l=Kb(d,"row",0),u=Kb(d,"columnProportions",0),c=Kb(d,"rowProportions",0)):Nb(u)&&(u=Kb(d=u,"columnProportions",0),c=Kb(d,"rowProportions",0)),(f=e.call(this,t,s,r,o,a,d)).type="rexGridSizer",f.sizerChildren=[],f.addChildrenMap("items",f.sizerChildren),f.setCreateCellContainerCallback(Kb(d,"createCellContainerCallback")),f.setIndentLeft(Kb(d,"space.indentLeftOdd",0),Kb(d,"space.indentLeftEven",0)),f.setIndentTop(Kb(d,"space.indentTopOdd",0),Kb(d,"space.indentTopEven",0)),f.resetGrid(h,l,u,c,Kb(d,"space",void 0)),f}return r(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(p(h(i.prototype),"destroy",this).call(this,t),this.columnProportions=void 0,this.rowProportions=void 0,this.columnWidth=void 0,this.rowHeight=void 0,this.createCellContainerCallback=void 0);}},{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(){return void 0===this._totalColumnProportions&&(this._totalColumnProportions=Hb.call(this)),this._totalColumnProportions}},{key:"totalRowProportions",get:function(){return void 0===this._totalRowProportions&&(this._totalRowProportions=Ub.call(this)),this._totalRowProportions}},{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)}},{key:"getColumnWidth",value:function(t){var e=this.columnProportions[t];return 0===e?this.columnWidth[t]:e*this.proportionWidthLength}},{key:"getRowHeight",value:function(t){var e=this.rowProportions[t];return 0===e?this.rowHeight[t]:e*this.proportionHeightLength}},{key:"setCreateCellContainerCallback",value:function(t){return this.createCellContainerCallback=t,this}}]),i}(Hy);Object.assign(Jb.prototype,Gb);var Zb=function(t,e,i,n){return e/t<=i?e/(n-1):0},qb=function(t,e){void 0===e?e={lines:[],width:0,height:0}:(e.lines.length=0,e.width=0,e.height=0);for(var i,n,s,r,o=this.sizerChildren,a=this.space.item,h=this.space.line,l=this.space.indentLeftOdd,u=this.space.indentLeftEven,c=this.space.indentTopOdd,d=this.space.indentTopEven,f=0,p=e.lines,v=void 0,g=0,y=o.length;ga.height/2)){s>(h=tC(a.left,a.centerY,t,e))&&(s=h,n=r);var h,l=i[r+1];if(!l||l.y!==a.y)s>(h=tC(a.right,a.centerY,t,e))&&(s=h,n=r+1);}}return n},iC=Phaser.Utils.Objects.IsPlainObject,nC=Phaser.Utils.Objects.GetValue,sC=Phaser.Display.Align.CENTER,rC=function(t,e,i,n){if("\n"===t)return this.addNewLine(),this;var s;(dp.call(this,t),iC(e))&&(e=nC(s=e,"padding",0),i=nC(s,"key",void 0),n=nC(s,"index",void 0));return void 0===e&&(e=0),(s=this.getSizerConfig(t)).align=sC,s.padding=up(e),void 0===n||n>=this.sizerChildren.length?this.sizerChildren.push(t):this.sizerChildren.splice(n,0,t),void 0!==i&&this.addChildrenMap(i,t),this},oC={add:function(t,e,i){if(ng(t))for(var n=t,s=0,r=n.length;s=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,Qy.call(this,t),this}},lC={getChildrenWidth:function(){return this.rexSizer.hidden?0:this.maxChildWidth+this.space.left+this.space.right},getChildrenHeight:function(){return this.rexSizer.hidden?0:this.widthWrapResult.height+this.space.top+this.space.bottom},getChildrenSizers:function(t){void 0===t&&(t=[]);for(var e,i=this.sizerChildren,n=0,s=i.length;n=0;i--)JC.call(this,e[i],t);return this}},qC=function(t,e,i){if(t){var n=this.setValueCallback,s=this.setValueCallbackScope;n&&(s?n.call(s,t,e,i):n(t,e,i)),this.fireEvent("button.statechange",t,e,i);}},$C=function(t){var e=this;t._selected=void 0,Object.defineProperty(t,"selected",{get:function(){return t._selected},set:function(i){if(t._selected!==i){var n=t._selected;t._selected=i,qC.call(e,t,i,n);}},enumerable:!0,configurable:!0}),t.selected=!1;},QC={add:function(t){return this.buttons.push(t),t._click||(t._click=new Sd(t,this.clickConfig),t._click.on("click",(function(t,e,i,n){this.fireEvent("button.click",e,i,n);}),this).on("enable",(function(t,e){this.fireEvent("button.enable",e);}),this).on("disable",(function(t,e){this.fireEvent("button.disable",e);}),this),t.on("pointerover",(function(e,i,n,s){this.fireEvent("button.over",t,e,s);}),this).on("pointerout",(function(e,i){this.fireEvent("button.out",t,e,i);}),this).on("pointerdown",(function(e,i,n,s){this.fireEvent("button.down",t,e,s);}),this).on("pointerup",(function(e,i){this.fireEvent("button.up",t,e,i);}),this)),this.buttonsType&&(void 0===t.name&&console.error("".concat(this.parent.constructor.name,": Option button miss value")),$C.call(this,t)),this},addMultiple:function(t){for(var e=0,i=t.length;e2?o-2:0),h=2;h=0;i--)vx.call(this,e[i],t);return this}},yx=Phaser.Utils.Objects.GetValue,kx=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=yx(s,"row",0),a=yx(s,"column",s.col||0),h=yx(s,"createCellContainerCallback"),l=yx(s,"buttons",void 0),c=yx(s,"expand",!0),d=c?1:0;if(h&&(s.createCellContainerCallback=void 0),void 0!==l){o=Math.max(o,l.length);for(var f=0,p=l.length;fs&&mx.addNewLine(this);}else for(r=0,o=t.length;r=0;i--)Sx.call(this,e[i],t);return this}},Px=Phaser.Utils.Objects.GetValue,Tx=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=s.space;"number"==typeof o&&(s.space={item:o,line:o}),(r=e.call(this,t,s)).type="rexFixWidthButtons",r.buttonGroup=new ox({parent:u(r),eventEmitter:Px(s,"eventEmitter",u(r)),groupName:Px(s,"groupName",void 0),clickConfig:Px(s,"click",void 0)}).setButtonsType(s);var a=Px(s,"background",void 0),h=Px(s,"buttons",void 0);return r.buttonsAlign=Px(s,"align",void 0),a&&r.addBackground(a),h&&r.addButtons(h),r.addChildrenMap("background",a),r.addChildrenMap("buttons",r.buttonGroup.buttons),r}return r(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(p(h(i.prototype),"destroy",this).call(this,t),this.buttonGroup.destroy(),this.buttonGroup=void 0);}},{key:"buttons",get:function(){return this.buttonGroup.buttons}},{key:"groupName",get:function(){return this.buttonGroup.groupName},set:function(t){this.buttonGroup.groupName=t;}},{key:"eventEmitter",get:function(){return this.buttonGroup.eventEmitter}}]),i}(pC);Object.assign(Tx.prototype,Cx,Ox,rx,hx);var Mx=Phaser.Utils.Objects.GetValue,Ex=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),(r=e.call(this,t,s)).type="rexFileSelectorButton";var o=new Am(t);return t.add.existing(o),r.addBackground(o),r.addChildrenMap("fileChooser",o),r.setAccept(Mx(s,"accept","")),r.setMultiple(Mx(s,"multiple",!1)),o.on("change",(function(t){var e=t.files;0!==e.length&&(e=Array.from(e),this.emit("select",e,this));}),u(r)),r}return r(i,[{key:"files",get:function(){return this.childrenMap.fileChooser.files}}]),i}(CC);Object.assign(Ex.prototype,{setAccept:function(t){return this.childrenMap.fileChooser.setAccept(t),this},setMultiple:function(t){return this.childrenMap.fileChooser.setMultiple(t),this},loadFile:function(t,e,i,n,s){return this.childrenMap.fileChooser.loadFile(t,e,i,n,s),this},loadFilePromise:function(t,e,i,n){return this.childrenMap.fileChooser.loadFilePromise(t,e,i,n)}});var _x={getChoice:function(t){var e=this.childrenMap.choicesSizer;return e?e.getButton(t):void 0},getAction:function(t){return this.childrenMap.actionsSizer.getButton(t)},getToolbar:function(t){return this.childrenMap.toolbarSizer.getButton(t)},getLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.getButton(t)},setChoiceEnable:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.setButtonEnable(t,e),this},setActionEnable:function(t,e){return this.childrenMap.actionsSizer.setButtonEnable(t,e),this},setToolbarEnable:function(t,e){return this.childrenMap.toolbarSizer.setButtonEnable(t,e),this},setLeftToolbarEnable:function(t,e){return this.childrenMap.leftToolbarSizer.setButtonEnable(t,e),this},toggleChoiceEnable:function(t){var e=this.childrenMap.choicesSizer;return e&&e.toggleButtonEnable(t),this},toggleActionEnable:function(t){return this.childrenMap.actionsSizer.toggleButtonEnable(t),this},toggleToolbarEnable:function(t){return this.childrenMap.toolbarSizer.toggleButtonEnable(t),this},toggleLeftToolbarEnable:function(t){return this.childrenMap.leftToolbarSizer.toggleButtonEnable(t),this},getChoiceEnable:function(t){var e=this.childrenMap.choicesSizer;return !!e&&e.getButtonEnable(t)},getActionEnable:function(t){return this.childrenMap.actionsSizer.getButtonEnable(t)},getToolbarEnable:function(t){return this.childrenMap.toolbarSizer.getButtonEnable(t)},getLeftToolbarEnable:function(t){return this.childrenMap.leftToolbarSizer.getButtonEnable(t)},emitChoiceClick:function(t){var e=this.childrenMap.choicesSizer;return e&&e.emitButtonClick(t),this},emitActionClick:function(t){return this.childrenMap.actionsSizer.emitButtonClick(t),this},emitToolbarClick:function(t){return this.childrenMap.toolbarSizer.emitButtonClick(t),this},emitLeftToolbarClick:function(t){return this.childrenMap.leftToolbarSizer.emitButtonClick(t),this},showChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.showButton(t),this},showAction:function(t){return this.childrenMap.actionsSizer.showButton(t),this},showToolbar:function(t){return this.childrenMap.toolbarSizer.showButton(t),this},showLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.showButton(t),this},hideChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.hideButton(t),this},hideAction:function(t){return this.childrenMap.actionsSizer.hideButton(t),this},hideToolbar:function(t){return this.childrenMap.toolbarSizer.hideButton(t),this},hideLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.hideButton(t),this},addChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.addButton(t),this},addAction:function(t){return this.childrenMap.actionsSizer.addButton(t),this},addToolbar:function(t){return this.childrenMap.toolbarSizer.addButton(t),this},addLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.addButton(t),this},removeChoice:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.removeButton(t,e),this},removeAction:function(t,e){return this.childrenMap.actionsSizer.removeButton(t,e),this},removeToolbar:function(t,e){return this.childrenMap.toolbarSizer.removeButton(t,e),this},removeLeftToolbar:function(t,e){return this.childrenMap.leftToolbarSizer.removeButton(t,e),this},clearChoices:function(t){var e=this.childrenMap.choicesSizer;return e&&e.clearButtons(t),this},clearActions:function(t){return this.childrenMap.actionsSizer.clearButtons(t),this},clearToolbar:function(t){return this.childrenMap.toolbarSizer.clearButtons(t),this},clearLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.clearButtons(t),this},forEachChoice:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.forEachButtton(t,e),this},forEachAction:function(t,e){return this.childrenMap.actionsSizer.forEachButtton(t,e),this},forEachToolbar:function(t,e){return this.childrenMap.toolbarSizer.forEachButtton(t,e),this},forEachLeftToolbar:function(t,e){return this.childrenMap.leftToolbarSizer.forEachButtton(t,e),this},setAllButtonsEnable:function(t){return void 0===t&&(t=!0),this.childrenMap.toolbarSizer&&this.setToolbarEnable(t),this.childrenMap.leftToolbarSizer&&this.setLeftToolbarEnable(t),this.childrenMap.actionsSizer&&this.setActionEnable(t),this.childrenMap.choicesSizer&&this.setChoiceEnable(t),this},getChoicesButtonStates:function(){var t=this.childrenMap.choicesSizer;return t?t.getAllButtonsState():{}},getChoicesButtonState:function(t){var e=this.childrenMap.choicesSizer;return void 0===t?e?e.getAllButtonsState():{}:!!e&&e.getButtonState(t)},setChoicesButtonState:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.setButtonState(t,e),this},clearChoicesButtonStates:function(){var t=this.childrenMap.choicesSizer;return t&&t.clearAllButtonsState(),this},getChoicesSelectedButtonName:function(){var t=this.childrenMap.choicesSizer;return t?t.getSelectedButtonName():""},setChoicesSelectedButtonName:function(t){var e=this.childrenMap.choicesSizer;return e&&e.setSelectedButtonName(t),this}},Lx={onCreateModalBehavior:function(t){t.on("button.click",(function(e,i,n,s,r){if("actions"===i){var o={index:n,text:e.text,button:e,dialog:t};switch(t.buttonsType){case"radio":o.value=t.getChoicesSelectedButtonName();break;case"checkboxes":o.value=t.getChoicesButtonStates();break;default:o.value=void 0;}t.modalClose(o);}}));},modal:function(t,e){return t&&!1===t.defaultBehavior?this.onCreateModalBehavior=!1:delete this.onCreateModalBehavior,eg.modal.call(this,t,e),this}},Rx={};Object.assign(Rx,_x,Lx);var Bx=Phaser.Utils.Objects.GetValue,jx=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),s.orientation=1,(r=e.call(this,t,s)).type="rexDialog",r.eventEmitter=Bx(s,"eventEmitter",u(r));var o,a,h,l,c=Bx(s,"background",void 0),d=Bx(s,"title",void 0),f=Bx(s,"toolbar",void 0),p=Bx(s,"toolbarBackground",void 0),v=Bx(s,"leftToolbar",void 0),g=Bx(s,"leftToolbarBackground",void 0),y=Bx(s,"content",void 0),k=Bx(s,"description",void 0),m=Bx(s,"choices",void 0),b=Bx(s,"choicesBackground",void 0),C=Bx(s,"actions",void 0),x=Bx(s,"actionsBackground",void 0),w=Bx(s,"click",void 0);if(c&&r.addBackground(c),f&&(h=new ux(t,{groupName:"toolbar",background:p,buttons:f,orientation:0,space:{item:Bx(s,"space.toolbarItem",0)},click:w,eventEmitter:r.eventEmitter})),v&&(l=new ux(t,{groupName:"leftToolbar",background:g,buttons:v,orientation:0,space:{item:Bx(s,"space.leftToolbarItem",0)},click:w,eventEmitter:r.eventEmitter})),d||f||v){var S,O=!!d&&Bx(s,"expand.title",!0),P=Bx(s,"align.title","center"),T=!(d&&!O&&"center"===P||!d&&(f||v));S=T?new _b(t,{orientation:0}):new rk(t);var M=!!T||{height:!0};if(l&&S.add(l,{align:"left",expand:M}),d){T&&!O&&"right"===P&&S.addSpace();var E={left:Bx(s,"space.titleLeft",0),right:Bx(s,"space.titleRight",0)},_=O?1:0;S.add(d,{align:P,proportion:_,expand:M,padding:E}),T&&!O&&"left"===P&&S.addSpace();}h&&(T&&!d&&S.addSpace(),S.add(h,{align:"right",expand:M})),(y||k||m||C)&&(E={bottom:Bx(s,"space.title",0),top:Bx(s,"space.titleTop",0)});_=Bx(s,"proportion.title",0);r.add(S,{padding:E,proportion:_,expand:!0});}if(y){var L=Bx(s,"align.content","center"),R=Bx(s,"space.content",0),B=(E={left:Bx(s,"space.contentLeft",0),right:Bx(s,"space.contentRight",0),bottom:k||m||C?R:0},_=Bx(s,"proportion.content",0),Bx(s,"expand.content",!0));r.add(y,{align:L,padding:E,proportion:_,expand:B});}if(k){L=Bx(s,"align.description","center");var j=Bx(s,"space.description",0);E={left:Bx(s,"space.descriptionLeft",0),right:Bx(s,"space.descriptionRight",0),bottom:m||C?j:0},_=Bx(s,"proportion.description",0),B=Bx(s,"expand.description",!0);r.add(k,{align:L,padding:E,proportion:_,expand:B});}if(m){var D=Bx(s,"choicesType","").split("-"),A=Dx(D,"wrap")?Tx:Dx(D,"grid")?kx:ux,I=Dx(D,"radio")?"radio":Dx(D,"checkboxes")?"checkboxes":void 0,z={left:Bx(s,"space.choicesBackgroundLeft",0),right:Bx(s,"space.choicesBackgroundRight",0),top:Bx(s,"space.choicesBackgroundTop",0),bottom:Bx(s,"space.choicesBackgroundBottom",0)},F=Bx(s,"space.choice",0);A===ux?z.item=F:A===Tx?(z.item=F,z.line=Bx(s,"space.choiceLine",F)):(z.column=Bx(s,"space.choiceColumn",F),z.row=Bx(s,"space.choiceRow",F));var Y={width:Bx(s,"choicesWidth",void 0),height:Bx(s,"choicesHeight",void 0),groupName:"choices",buttonsType:I,background:b,buttons:m,space:z,click:w,eventEmitter:r.eventEmitter,setValueCallback:Bx(s,"choicesSetValueCallback",void 0),setValueCallbackScope:Bx(s,"choicesSetValueCallbackScope",void 0)};A===ux&&(Y.orientation=Dx(D,"x")?0:1),o=new A(t,Y);var W=Bx(s,"space.choices",0);E={left:Bx(s,"space.choicesLeft",0),right:Bx(s,"space.choicesRight",0),bottom:C?W:0},L=Bx(s,"align.choices","center"),_=Bx(s,"proportion.choices",0),B=Bx(s,"expand.choices",!0);r.add(o,{align:L,padding:E,proportion:_,expand:B}),r.buttonsType=I;}if(C){a=new ux(t,{groupName:"actions",background:x,buttons:C,orientation:0,space:{item:Bx(s,"space.action",0)},expand:Bx(s,"expand.actions",!1),align:Bx(s,"align.actions","center"),click:w,eventEmitter:r.eventEmitter});E={left:Bx(s,"space.actionsLeft",0),right:Bx(s,"space.actionsRight",0),bottom:Bx(s,"space.actionsBottom",0)},_=Bx(s,"proportion.action",0);r.add(a,{align:"center",padding:E,proportion:_,expand:!0});}return Ix(u(r),"click"),Ix(u(r),"over"),Ix(u(r),"out"),Ix(u(r),"enable"),Ix(u(r),"disable"),r.addChildrenMap("background",c),r.addChildrenMap("title",d),r.addChildrenMap("toolbar",f),r.addChildrenMap("leftToolbar",v),r.addChildrenMap("content",y),r.addChildrenMap("description",k),r.addChildrenMap("choices",o?o.buttons:void 0),r.addChildrenMap("actions",a?a.buttons:void 0),r.addChildrenMap("choicesSizer",o),r.addChildrenMap("actionsSizer",a),r.addChildrenMap("toolbarSizer",h),r.addChildrenMap("leftToolbarSizer",l),r}return r(i)}(_b),Dx=function(t,e){return -1!==t.indexOf(e)},Ax={actions:"action",choices:"choice",toolbar:"toolbar",leftToolbar:"leftToolbar"},Ix=function(t,e){t.on("button.".concat(e),(function(i,n,s,r,o){Ax.hasOwnProperty(n)&&t.emit("".concat(Ax[n],".").concat(e),i,s,r,o);}));};Object.assign(jx.prototype,Rx);var zx=function(t,e,i){var n=new jC(t,e,i);return t.add.existing(n),n},Fx=function(t){this.childrenMap.title.resetDisplayContent(t.title);},Yx=function(t){var e=this.childrenMap.content;if(e.resetDisplayContent)e.resetDisplayContent(t.content);else {var i=t.content||"";e.setText(i);}},Wx=function(t){var e=this.childrenMap.actions;if(e){var i=t.buttons;if(i){for(var n=this.scene,s=this.defaultActionConfig,r=this.defaultActionButtonCreator,o=0,a=i.length;o=t.dragThreshold?"DRAG":"DRAGBEGIN":"IDLE"}},{key:"update_DRAGBEGIN",value:function(t,e){this.next();}},{key:"next_DRAG",value:function(){var t,e=this.parent;return e.dragState.isUp&&(t=e.outOfBounds?"BACK":e.slidingEnable?"SLIDE":"IDLE"),t}},{key:"update_DRAG",value:function(t,e){var i=this.parent;i.dragState.justMoved&&i.dragging(),this.next();}},{key:"enter_DRAG",value:function(){this.parent.onDragStart();}},{key:"exit_DRAG",value:function(){this.parent.onDragEnd();}},{key:"next_SLIDE",value:function(){var t,e=this.parent;return e.dragState.isDown?t="DRAG":e.isSliding||(t="IDLE"),t}},{key:"enter_SLIDE",value:function(){this.parent.onSliding();}},{key:"exit_SLIDE",value:function(){this.parent.stop();}},{key:"update_SLIDE",value:function(t,e){this.parent.sliding(t,e),this.next();}},{key:"next_BACK",value:function(){var t,e=this.parent;return e.dragState.isDown?t="DRAG":e.isPullBack||(t="IDLE"),t}},{key:"enter_BACK",value:function(){this.parent.onPullBack();}},{key:"exit_BACK",value:function(){this.parent.stop();}},{key:"update_BACK",value:function(t,e){this.parent.pullBack(t,e),this.next();}}]),i}(_v),_w=Phaser.Utils.Objects.GetValue,Lw=Phaser.Math.Distance.Between,Rw=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s))._enable=void 0,t.setInteractive(_w(s,"inputConfig",void 0)),r.resetFromJSON(s),r.boot(),r}return r(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.isInTouched=!1,this.holdStartTime=void 0,this.x=void 0,this.y=void 0,this.preX=void 0,this.preY=void 0,this.localX=void 0,this.localY=void 0,this.justMoved=!1,this.setEnable(_w(t,"enable",!0)),this.holdThreshold=_w(t,"holdThreshold",50),this.pointerOutReleaseEnable=_w(t,"pointerOutRelease",!0),this}},{key:"boot",value:function(){this.parent.on("pointerdown",this.onPointIn,this),this.parent.on("pointerup",this.onPointOut,this),this.pointerOutReleaseEnable&&this.parent.on("pointerout",this.onPointOut,this),this.parent.on("pointermove",this.onPointerMove,this),this.scene.sys.events.on("preupdate",this.preupdate,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.scene.sys.events.off("preupdate",this.preupdate,this),this.pointer=void 0,p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){this._enable!==t&&(t||(this.isInTouched=!1,this.pointer=void 0),this._enable=t);}},{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:"setPointerOutReleaseEnable",value:function(t){return void 0===t&&(t=!0),this.pointerOutReleaseEnable=t,this}},{key:"isDown",get:function(){return this.pointer&&this.pointer.isDown}},{key:"isUp",get:function(){return !this.isDown}},{key:"dx",get:function(){return this.x-this.preX}},{key:"dy",get:function(){return this.y-this.preY}},{key:"dt",get:function(){return xc(this.scene)}},{key:"speed",get:function(){return this.x===this.preX&&this.y===this.preY?0:Lw(this.preX,this.preY,this.x,this.y)/(.001*this.dt)}},{key:"speedX",get:function(){return this.dx/(.001*this.dt)}},{key:"speedY",get:function(){return this.dy/(.001*this.dt)}},{key:"onPointIn",value:function(t,e,i){this.enable&&t.isDown&&void 0===this.pointer&&(this.pointer=t,this.localX=e,this.localY=i);}},{key:"onPointOut",value:function(t){this.enable&&this.pointer===t&&(this.pointer=void 0);}},{key:"onPointerMove",value:function(t,e,i){this.enable&&t.isDown&&this.pointer===t&&(this.localX=e,this.localY=i);}},{key:"preupdate",value:function(t,e){if(this.enable){var i=this.pointer;this.justMoved=!1,i&&!this.isInTouched?(this.x=i.worldX,this.y=i.worldY,this.preX=i.worldX,this.preY=i.worldY,this.isInTouched=!0,this.holdStartTime=void 0,this.emit("touchstart",i,this.localX,this.localY)):i&&this.isInTouched?this.x===i.x&&this.y===i.y?void 0===this.holdStartTime?this.holdStartTime=t:t-this.holdStartTime>this.holdThreshold&&(this.preX=this.x,this.preY=this.y):(this.preX=this.x,this.preY=this.y,this.x=i.worldX,this.y=i.worldY,this.holdStartTime=void 0,this.justMoved=!0,this.emit("touchmove",i,this.localX,this.localY)):!i&&this.isInTouched&&(this.isInTouched=!1,this.holdStartTime=void 0,this.emit("touchend",i));}}}]),i}(Ta),Bw=Phaser.Utils.Objects.GetValue,jw=function(){function t(e){n(this,t),this.resetFromJSON(e);}return r(t,[{key:"resetFromJSON",value:function(t){return this.setValue(Bw(t,"value",0)),this.setSpeed(Bw(t,"speed",0)),this.setAcceleration(Bw(t,"acceleration",0)),this}},{key:"reset",value:function(){this.setValue(0),this.setSpeed(0),this.setAcceleration(0);}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"setSpeed",value:function(t){return this.speed=t,this}},{key:"setAcceleration",value:function(t){return this.acceleration=t,this}},{key:"updateSpeed",value:function(t){return 0!==this.acceleration&&(this.speed+=this.acceleration*t,this.speed<0&&(this.speed=0)),this}},{key:"getDeltaValue",value:function(t){return this.updateSpeed(t),this.speed<=0?0:this.speed*t}},{key:"update",value:function(t){return this.updateSpeed(t),this.speed>0&&(this.value+=this.getDeltaValue(t)),this}},{key:"isMoving",get:function(){return this.speed>0}}]),t}(),Dw=function(){function t(){n(this,t),this.value,this.dir,this.movement=new jw;}return r(t,[{key:"init",value:function(t,e,i,n,s){return this.value=t,this.end=s,this.dir=void 0!==s?tthis.end&&(this.value=this.end):this.valuethis.maxValue}},{key:"overMin",value:function(t){return null!=this.minValue&&t0,Math.abs(e),i);}},{key:"sliding",value:function(t,e){e*=.001;var i=this._slowDown.update(e).value;this.overMax(i)?(this.value=this.maxValue,this._slowDown.stop()):this.overMin(i)?(this.value=this.minValue,this._slowDown.stop()):this.value=i;}},{key:"onPullBack",value:function(){var t=this.value,e=this.outOfMinBound?this.minValue:this.maxValue,i=Math.abs(e-t),n=this.backDeceleration,s=Math.sqrt(2*n*i);this._slowDown.init(t,void 0,s,n,e);}},{key:"pullBack",value:function(t,e){e*=.001,this.value=this._slowDown.update(e).value,this._slowDown.isMoving||this._state.next();}},{key:"stop",value:function(){this._slowDown.stop();}}]),i}(Ta),Fw={y:0,v:0,vertical:0,x:1,h:1,horizontal:1},Yw=Phaser.Utils.Objects.GetValue,Ww=function(t){a(i,t);var e=d(i);function i(t,s){var r;(n(this,i),(r=e.call(this,t,s)).parent!==r.scene?r.focusMode=Yw(s,"focus",!0):r.focusMode=!1,r.setSpeed(Yw(s,"speed",.1)),r.setEnable(Yw(s,"enable",!0)),r.focusMode)?(t=r.parent).setInteractive(Yw(s,"inputConfig",void 0)).on("wheel",(function(t,e,i,n,s){this.enable&&this.scroll(i);}),u(r)):r.scene.input.on("wheel",r.onSceneScroll,u(r));return r}return r(i,[{key:"destroy",value:function(){this.focusMode||this.scene.input.off("wheel",this.onSceneScroll,this);}},{key:"onSceneScroll",value:function(t,e,i,n,s,r){this.enable&&this.scroll(n);}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"setSpeed",value:function(t){return this.speed=t,this}},{key:"scroll",value:function(t){t*=this.speed,this.emit("scroll",t,this.parent,this);}}]),i}(Ta),Vw=Phaser.Utils.Objects.GetValue,Xw=function(t,e,i,n){var s,r,o,a,h="Y"===(i=i.toUpperCase()),l=2===t.scrollMode,u=t.childrenMap.child,c="slider".concat(i);if(s=l||n.hasOwnProperty(c)?Vw(n,c,void 0):Vw(n,"slider",void 0)){var d,f,p;!0===s&&(s={}),s.orientation=h?1:0,r=function(t,e){void 0===e&&(e={});var i=Wt(e);(e={slider:i}).orientation=i.orientation,delete i.orientation,e.background=i.background,delete i.background,e.buttons=i.buttons,delete i.buttons;var n=new Mw(t,e);t.add.existing(n);var s=n.childrenMap.slider;return n.addChildrenMap("track",s.childrenMap.track),n.addChildrenMap("indicator",s.childrenMap.indicator),n.addChildrenMap("thumb",s.childrenMap.thumb),n}(t.scene,s);var v=Vw(s,"position",0);"string"==typeof v&&(v=Gw[v]);var g=Vw(n,"space.slider".concat(i),void 0);void 0===g&&void 0===(g=Vw(n,"space.slider",void 0))&&(g=l?0:Vw(n,"space.child",0));var y="number"==typeof g;h?0===v?(d=2,f=1,p=y?{left:g}:g):(d=0,f=1,p=y?{right:g}:g):0===v?(d=1,f=2,p=y?{top:g}:g):(d=1,f=0,p=y?{bottom:g}:g),e.add(r,{column:d,row:f,align:"center",padding:p,expand:!0}),t["hideUnscrollableSlider".concat(i)]=Vw(s,"hideUnscrollableSlider",!1),t["adaptThumb".concat(i,"SizeMode")]=Vw(s,"adaptThumbSize",!1),t["minThumb".concat(i,"Size")]=Vw(s,"minThumbSize",void 0);}else t["hideUnscrollableSlider".concat(i)]=!1,t["adaptThumb".concat(i,"SizeMode")]=!1,t["minThumb".concat(i,"Size")]=void 0;var k="scroller".concat(i);(o=l||n.hasOwnProperty(k)?Vw(n,k,!0):Vw(n,"scroller",!0))&&u&&(!0===o&&(o={}),o.orientation=h?0:1,a=new zw(u,o));var m,b,C,x,w=Vw(n,l?"mouseWheelScroller".concat(i):"mouseWheelScroller",!1);(w&&u&&(m=new Ww(u,w)),t.addChildrenMap("slider".concat(i),r),t.addChildrenMap("scroller".concat(i),a),t.addChildrenMap("mouseWheelScroller".concat(i),m),l&&!h||(t.hideUnscrollableSlider=t["hideUnscrollableSlider".concat(i)],t.adaptThumbSizeMode=t["adaptThumb".concat(i,"SizeMode")],t.minThumbSize=t["minThumb".concat(i,"Size")],t.addChildrenMap("slider",r),t.addChildrenMap("scroller",a),t.addChildrenMap("mouseWheelScroller",m)),r)&&(l?(b=h?"t":"s",x="scroll".concat(i)):(b="t",x="scroll"),r.on("valuechange",(function(e){t[b]=e,t.emit(x,t);})));a&&(l?(C="childO".concat(i),x="scroll".concat(i)):(C="childOY",x="scroll"),a.on("valuechange",(function(e){t[C]=e,t.emit(x,t);})));if(m){var S="addChildO".concat(i);m.on("scroll",(function(e){t[S](-e,!0);}));}},Gw={right:0,left:1,bottom:0,top:1},Hw=Phaser.Utils.Objects.GetValue,Uw=function(t,e){var i=t.scene,n=[0,1,0],s=[0,1,0],r=Hw(e,"width"),o=Hw(e,"height");r||(Hw(e,"child.expandWidth",!0)||(n[1]=0));o||(Hw(e,"child.expandHeight",!0)||(s[1]=0));var a=new Jb(i,{column:3,row:3,columnProportions:n,rowProportions:s});switch(function(t,e,i){var n=Qx(i,"child"),s=Qx(n,"gameObject",void 0);if(s){var r=Qx(i,"space.child",0);t.childMargin={};var o=t.childMargin,a={};if("number"==typeof r)switch(t.scrollMode){case 0:case 1:o.top=0,o.bottom=0,o.left=0,o.right=0;break;default:o.top=r,o.bottom=r,o.left=r,o.right=r;}else switch(t.scrollMode){case 0:o.top=Qx(r,"top",0),o.bottom=Qx(r,"bottom",0),a.left=Qx(r,"left",0),a.right=Qx(r,"right",0);break;case 1:o.top=Qx(r,"left",0),o.bottom=Qx(r,"right",0),a.top=Qx(r,"top",0),a.bottom=Qx(r,"bottom",0);break;default:o.top=Qx(r,"top",0),o.bottom=Qx(r,"bottom",0),o.left=Qx(r,"left",0),o.right=Qx(r,"right",0);}e.add(s,{column:1,row:1,align:Qx(n,"align","center"),padding:a,expand:{width:Qx(n,"expandWidth",!0),height:Qx(n,"expandHeight",!0)}});}t.addChildrenMap("child",s);}(t,a,e),t.scrollMode){case 0:Xw(t,a,"y",e);break;case 1:Xw(t,a,"x",e);break;default:Xw(t,a,"y",e),Xw(t,a,"x",e);}return a},Nw=function(t){var e,i,n,s;switch(this.scrollMode){case 0:case 1:e=this.topChildOY,i=this.bottomChildOY,n=this.childrenMap.scroller,s=this.childrenMap.slider;break;default:"Y"===(t=t.toUpperCase())?(e=this.topChildOY,i=this.bottomChildOY):(e=this.leftChildOX,i=this.rightChildOX),n=this.childrenMap["scroller".concat(t)],s=this.childrenMap["slider".concat(t)];}n&&n.setBounds(e,i),s&&s.setEnable(e!==i);},Kw=function(t){switch(this.scrollMode){case 0:case 1:(e=this.childrenMap.slider)&&this.hideUnscrollableSlider&&this.setChildVisible(e,this.isOverflow);break;default:t=t.toUpperCase();var e=this.childrenMap["slider".concat(t)],i=this["hideUnscrollableSlider".concat(t)],n=this["isOverflow".concat(t)];e&&i&&this.setChildVisible(e,n);}},Jw=function(t){switch(this.scrollMode){case 0:case 1:if(!this.adaptThumbSizeMode)return;if(!(a=this.childrenMap.slider))return;var e=Math.min(this.childVisibleHeight/this.childHeight,1),i=a.childrenMap.track,n=a.childrenMap.thumb,s=this.minThumbSize;if(0===this.scrollMode){var r=i.displayHeight*e;void 0!==s&&r0?t.setText(e).getTextBounds().wrappedText.split("\n"):e.split("\n");}return i},nS=function(t){return (t-this.textLineSpacing)/(this.textLineHeight+this.textLineSpacing)},sS=function(t){return t*(this.textLineHeight+this.textLineSpacing)-this.textLineSpacing},rS=function(t){var e,i=t+this.visibleLinesCount+1;switch(this.textObjectType){case 0:case 2:e=this.lines.slice(t,i).join("\n");break;case 1:var n=this.lines.getLineStartIndex(t),s=this.lines.getLineEndIndex(i-1);e=this.lines.getSliceTagText(n,s,!0);}return e},oS=function(t,e){switch(eS(t)){case 0:var i=(s=t.style).wordWrapWidth,n=s.wordWrapCallback;s.wordWrapWidth=0,s.wordWrapCallback=void 0,t.setText(e),s.wordWrapWidth=i,s.wordWrapCallback=n;break;case 1:var s,r=(s=t.style).wrapMode;s.wrapMode=0,t.setText(e),s.wrapMode=r;break;case 2:var o=t._maxWidth;t._maxWidth=0,t.setText(e),t._maxWidth=o;}},aS=function(){var t=this.textObject.rexSizer;this.textObject.y+=t.offsetY-t.preOffsetY,t.preOffsetY=t.offsetY,this.resetChildPositionState(this.textObject),this.textCropEnable&&hS.call(this);},hS=function(){if(this.textObject.setCrop){var t,e,i=this.textObject.rexSizer.offsetY;i<=0?(t=-i,e=this.height):(t=0,e=this.height-i),this.textObject.setCrop(0,t,this.width,e);}},lS=function(t,e,i){if(i+=this.textLineHeight+this.textLineSpacing,this.textObjectWidth!==e||this._textObjectRealHeight!==i){switch(this.textObjectWidth=e,this._textObjectRealHeight=i,this.textObjectType){case 0:case 1:t.setFixedSize(e,i);var n=t.style,s=Math.max(e,0);0===this.textObjectType?n.wordWrapWidth=s:(0===n.wrapMode&&(n.wrapMode=1),n.wrapWidth=s);break;case 2:t.setMaxWidth(e);}this.setText();}},uS={setText:function(t){return void 0!==t&&(this.text=t),this.lines=iS(this.textObject,this.text,this.lines),this.linesCount=this.lines.length,this._textHeight=void 0,this._textVisibleHeight=void 0,this.updateTextObject(),this},updateTextObject:function(){var t=Math.max(Math.floor(nS.call(this,-this.textOY)),0),e=sS.call(this,t)+this.textOY,i=rS.call(this,t);return oS(this.textObject,i),this.textObject.rexSizer.offsetY=e,aS.call(this),this},preLayout:function(){return this._textLineHeight=void 0,this._textLineSpacing=void 0,this._visibleLinesCount=void 0,this._textHeight=void 0,this._textVisibleHeight=void 0,Tp.call(this),this},layoutChildren:function(){var t,e,i,n,s,r,o,a=this.left,h=this.top;(t=this.textObject).rexSizer.hidden||(n=a+(i=(e=t.rexSizer).padding).left,s=h+i.top,r=this.width-i.left-i.right,o=this.height-i.top-i.bottom,lS.call(this,t,r,o),sp(t,n,s,r,o,e.align),e.preOffsetY=0,aS.call(this),this.textMask&&(this.textMask.setPosition().resize(),this.resetChildPositionState(this.textMask)));}},cS=Phaser.Utils.Objects.IsPlainObject,dS=Phaser.Utils.Objects.GetValue,fS=Phaser.Display.Align.TOP_LEFT,pS=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),cS(s)?(s=dS(h=s,"x",0),r=dS(h,"y",0),o=dS(h,"width",void 0),a=dS(h,"height",void 0)):cS(o)&&(o=dS(h=o,"width",void 0),a=dS(h,"height",void 0)),(l=e.call(this,t,s,r,o,a,h)).type="rexTextBlock",l.textObject=void 0,l.linesCount=0,l.textMask=void 0,l.textObjectType=void 0,l._textLineHeight=void 0,l._textLineSpacing=void 0,l._visibleLinesCount=void 0,l._textHeight=void 0,l._textVisibleHeight=void 0,l._textObjectRealHeight=0,l.lines=void 0,l.text=dS(h,"content",""),l._textOY=0,l.execeedTopState=!1,l.execeedBottomState=!1,l.setClampMode(dS(h,"clamplTextOY",!0)),l.alwaysScrollable=dS(h,"alwaysScrollable",!1);var c=dS(h,"background",void 0),d=dS(h,"text",void 0);void 0===d&&(d=vS(t)),l.textCropEnable=dS(h,"textCrop",!!d.setCrop);var f=dS(h,"textMask",!l.textCropEnable);c&&l.addBackground(c),l.add(d),l.sizerChildren=[d];var p=l.getSizerConfig(d);return p.align=fS,p.padding=up(0),p.expand=!0,l.textObject=d,l.textObjectType=eS(d),p.preOffsetY=0,p.offsetY=0,f&&(l.textMask=mC.call(u(l),l.textObject,u(l))),l.addChildrenMap("background",c),l.addChildrenMap("text",d),l}return r(i,[{key:"destroy",value:function(t){if(this.scene&&!this.ignoreDestroy){if(this.textObject=void 0,this.textMask=void 0,this.lines){switch(this.textObjectType){case 0:case 2:this.lines.length=0;break;case 1:this.lines.destroy();}this.lines=void 0;}p(h(i.prototype),"destroy",this).call(this,t);}}},{key:"setClampMode",value:function(t){return void 0===t&&(t=!0),this.clampTextOY=t,this}},{key:"textLineHeight",get:function(){if(void 0===this._textLineHeight){var t;switch(this.textObjectType){case 0:case 1:var e=this.textObject.style;t=e.metrics.fontSize+e.strokeThickness;break;case 2:var i=this.textObject.fontSize/this.textObject.fontData.size;t=this.textObject.fontData.lineHeight*i;}this._textLineHeight=t;}return this._textLineHeight}},{key:"textLineSpacing",get:function(){if(void 0===this._textLineSpacing){var t;switch(this.textObjectType){case 0:case 1:t=this.textObject.lineSpacing;break;case 2:t=0;}this._textLineSpacing=t;}return this._textLineSpacing}},{key:"visibleLinesCount",get:function(){return void 0===this._visibleLinesCount&&(this._visibleLinesCount=Math.floor(nS.call(this,this._textObjectRealHeight))),this._visibleLinesCount}},{key:"topTextOY",get:function(){return 0}},{key:"bottomTextOY",get:function(){return -this.textVisibleHeight}},{key:"textHeight",get:function(){return void 0===this._textHeight&&(this._textHeight=sS.call(this,this.linesCount)),this._textHeight}},{key:"textObjectHeight",get:function(){return this._textObjectRealHeight-(this.textLineHeight+this.textLineSpacing)}},{key:"textVisibleHeight",get:function(){if(void 0===this._textVisibleHeight){var t=this.textHeight-this.textObjectHeight;!this.alwaysScrollable&&t<0&&(t=0),this._textVisibleHeight=t;}return this._textVisibleHeight}},{key:"textOYExceedTop",value:function(t){return void 0===t&&(t=this.textOY),t>this.topTextOY}},{key:"textOYExeceedBottom",value:function(t){return void 0===t&&(t=this.textOY),tthis.linesCount?t=0:n?t=e:s&&(t=i)),this._textOY!==t&&(this._textOY=t,this.updateTextObject()),n&&(this.execeedTopState||this.emit("execeedtop",this,t,e)),this.execeedTopState=n,s&&(this.execeedBottomState||this.emit("execeedbottom",this,t,i)),this.execeedBottomState=s;}},{key:"setTextOY",value:function(t){return this.textOY=t,this}},{key:"t",get:function(){var t=this.textVisibleHeight;return 0===t?0:this.textOY/-t},set:function(t){this.textOY=-this.textVisibleHeight*t;}},{key:"setTextOYByPercentage",value:function(t){return this.t=t,this}}]),i}(Hy),vS=function(t){return t.add.text(0,0,"")};Object.assign(pS.prototype,uS);var gS={scrollToLine:function(t){return this.setChildOY(-this.lineHeight*t),this},scrollToNextLine:function(t){void 0===t&&(t=1);var e=this.lineIndex+t;return this.scrollToLine(e),this}},yS=Phaser.Utils.Objects.GetValue,kS=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=yS(s,"text",void 0),a=yS(s,"textWidth",void 0),h=yS(s,"textHeight",void 0),l=yS(s,"textCrop",!!o.setCrop),u=yS(s,"textMask",!l),c=yS(s,"content",""),d=new pS(t,{width:a,height:h,text:o,textMask:u,textCrop:l&&!u,content:c,clamplTextOY:yS(s,"clamplChildOY",!1),alwaysScrollable:yS(s,"alwaysScrollable",!1)});t.add.existing(d),function(t){Object.defineProperty(t,"childOY",{configurable:!0,get:function(){return t.textOY},set:function(e){t.textOY=e;}}),Object.defineProperty(t,"topChildOY",{get:function(){return t.topTextOY}}),Object.defineProperty(t,"bottomChildOY",{get:function(){return t.bottomTextOY}}),Object.defineProperty(t,"childVisibleHeight",{get:function(){return t.textObjectHeight}}),Object.defineProperty(t,"childHeight",{get:function(){return t.textHeight}});}(d),s.scrollMode=0,s.type="rexTextArea",s.child={gameObject:d,expandWidth:void 0===a,expandHeight:void 0===h};var f=yS(s,"space",void 0);return f&&(f.child=yS(f,"text",0)),(r=e.call(this,t,s)).addChildrenMap("text",o),r}return r(i,[{key:"text",get:function(){return this.childrenMap.child.text}},{key:"lineHeight",get:function(){var t=this.childrenMap.child;return t.textLineHeight+t.textLineSpacing}},{key:"lineIndex",get:function(){return Math.floor(-this.childOY/this.lineHeight)}},{key:"linesCount",get:function(){return this.childrenMap.child.linesCount}},{key:"contentHeight",get:function(){return this.childrenMap.child.textHeight}}]),i}(Qw);Object.assign(kS.prototype,{setText:function(t){return this.childrenMap.child.setText(t),this.resizeController(),this},appendText:function(t){return this.setText(this.text+t),this}},gS);var mS=Phaser.Utils.Objects.GetValue,bS=function(t,e,i){e=e?xe(e):{};var n=mS(i,"background",xC),s=mS(i,"text",OC),r=mS(i,"track",xC),o=mS(i,"thumb",xC);n?e.background=n(t,e.background):delete e.background,s?e.text=s(t,e.text):delete e.text;var a=e.slider;!1!==a&&(void 0===a&&(a={}),r?a.track=r(t,a.track):delete a.track,o?a.thumb=o(t,a.thumb):delete a.thumb,e.slider=a);var h=new kS(t,e);return t.add.existing(h),h},CS=Phaser.Utils.Objects.GetValue,xS=Phaser.Utils.Objects.GetValue,wS=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;n(this,i),s=s?xe(s):{},void 0===r&&(r={});var a=xS(r,"background",xC);a?s.background=a(t,s.background):delete s.background,s.title=zx(t,s.title,r.title),s.content=function(t,e,i){var n,s=CS(e,"$type");void 0===s&&e&&(e.hasOwnProperty("slider")||e.hasOwnProperty("scroller"))&&(s="textarea"),n="textarea"===s?new bS(t,e,i):new zx(t,e,i);return t.add.existing(n),n}(t,s.content,r.content),s.content instanceof kS&&tc(s,"height")&&!tc(s,"proportion.content")&&Be(s,"proportion.content",1);var h=s.button,l=s.buttonA||h,c=s.buttonB||h,d=s.buttonMode;void 0===d&&(d=l&&c?2:l?1:0);var f=r.button,p=r.buttonA||f,v=r.buttonB||f;switch(d){case 2:s.actions=[zx(t,l,p),zx(t,c,v)];break;case 1:s.actions=[zx(t,l,p)];break;case 0:break;default:s.actions=[];}var g=s.choice;g&&(s.choices=[]),(o=e.call(this,t,s)).type="rexConfirmDialog",o.buttonMode=d,o.defaultActionConfig=h,o.defaultActionButtonCreator=f,o.defaultChoiceConfig=g,o.defaultChoiceCreator=r.choice;var y=o.childrenMap.actions;return o.addChildrenMap("buttonA",y?y[0]:null),o.addChildrenMap("buttonB",y?y[1]:null),Jx.call(u(o)),o}return r(i)}(jx);Object.assign(wS.prototype,Xx);var SS=Phaser.Utils.Objects.GetValue,OS=function(t,e,i){var n=SS(t,"proportion.".concat(e),i.proportion),s=SS(t,"align.".concat(e),"center"),r=SS(t,"space.".concat(e),void 0);if("number"==typeof r&&i.paddingKey){var o=r;(r={})[i.paddingKey]=o;}return {proportion:n,align:s,padding:r,expand:SS(t,"expand.".concat(e),!0)}},PS=function(t){return OS(t,"header",{proportion:0,paddingKey:"bottom"})},TS=function(t){return OS(t,"leftSide",{proportion:0,paddingKey:"right"})},MS=function(t){return OS(t,"content",{proportion:1})},ES=function(t){return OS(t,"rightSide",{proportion:0,paddingKey:"left"})},_S=function(t){return OS(t,"footer",{proportion:0,paddingKey:"top"})},LS=function(t,e){var i=new _b(t,{orientation:e});return t.add.existing(i),i},RS=Phaser.Utils.Objects.GetValue,BS=[function(t){var e=this.scene,i=t.header;i&&this.add(i,PS(t));var n=LS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,TS(t));var r=t.content;r&&n.add(r,MS(t));var o=t.rightSide;o&&n.add(o,ES(t));var a=t.footer;a&&this.add(a,_S(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,PS(t));var n=LS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,TS(t));var r=LS(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=LS(e,0);r.add(o,{proportion:1,align:"center",padding:0,expand:!0});var a=t.content;a&&o.add(a,MS(t));var h=t.rightSide;h&&o.add(h,ES(t));var l=t.footer;l&&r.add(l,_S(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,PS(t));var n=LS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=LS(e,1);n.add(s,{proportion:1,align:"center",padding:0,expand:!0});var r=LS(e,0);s.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.leftSide;o&&r.add(o,TS(t));var a=t.content;a&&r.add(a,MS(t));var h=t.footer;h&&s.add(h,_S(t));var l=t.rightSide;l&&n.add(l,ES(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,PS(t));var n=LS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,TS(t));var r=LS(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.content;o&&r.add(o,MS(t));var a=t.footer;a&&r.add(a,_S(t));var h=t.rightSide;h&&n.add(h,ES(t));}],jS={FFF:0,LFF:1,FFR:2,LFR:3},DS=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),void 0===s&&(s={}),s.orientation=1,(r=e.call(this,t,s)).type="rexHolyGrail",r.build(s),r}return r(i)}(_b),AS={build:function(t){this.clear(!0);var e=RS(t,"background",void 0);e&&this.addBackground(e);var i=RS(t,"layoutMode",0);"string"==typeof i&&(i=jS[i.toUpperCase()]),(BS[i]||BS[0]).call(this,t),this.addChildrenMap("background",t.background),this.addChildrenMap("header",t.header),this.addChildrenMap("leftSide",t.leftSide),this.addChildrenMap("content",t.content),this.addChildrenMap("rightSide",t.rightSide),this.addChildrenMap("footer",t.footer);}};Object.assign(DS.prototype,AS);var IS={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):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 yv(this.getButton(t,e)),this},showLeftButton:function(t){return yv(this.getLeftButton(t)),this},showRightButton:function(t){return yv(this.getRightButton(t)),this},showTopButton:function(t){return yv(this.getTopButton(t)),this},showBottomButton:function(t){return yv(this.getBottomButton(t)),this},hideButton:function(t,e){return kv(this.getButton(t,e)),this},hideLeftButton:function(t){return kv(this.getLeftButton(t)),this},hideRightButton:function(t){return kv(this.getRightButton(t)),this},hideTopButton:function(t){return kv(this.getTopButton(t)),this},hideBottomButton:function(t){return kv(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},forEachButton:function(t,e,i){return this.getButtonsSizer(t).forEachButtton(e,i),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}},zS=Phaser.Utils.Objects.GetValue,FS=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),s.column=3,s.row=3,(r=e.call(this,t,s)).type="rexTabs",r.eventEmitter=zS(s,"eventEmitter",u(r));var o,a,h,l,c=zS(s,"background",void 0),d=zS(s,"panel",void 0),f=zS(s,"leftButtons",void 0),p=zS(s,"leftButtonsBackground",void 0),v=zS(s,"rightButtons",void 0),g=zS(s,"rightButtonsBackground",void 0),y=zS(s,"topButtons",void 0),k=zS(s,"topButtonsBackground",void 0),m=zS(s,"bottomButtons",void 0),b=zS(s,"bottomButtonsBackground",void 0),C=zS(s,"click",void 0);if(c&&r.addBackground(c),d&&r.add(d,1,1,"center",0,!0),f){var x=zS(s,"space.leftButtonsOffset",0),w=zS(s,"space.leftButton",0);o=new ux(t,{groupName:"left",background:p,buttons:f,orientation:1,space:{item:w},align:zS(s,"align.leftButtons",void 0),click:C,eventEmitter:r.eventEmitter});var S={top:x};r.add(o,0,1,"top",S,!1);}if(v){var O=zS(s,"space.rightButtonsOffset",0),P=zS(s,"space.rightButton",0);a=new ux(t,{groupName:"right",background:g,buttons:v,orientation:1,space:{item:P},align:zS(s,"align.rightButtons",void 0),click:C,eventEmitter:r.eventEmitter});S={top:O};r.add(a,2,1,"top",S,!1);}if(y){var T=zS(s,"space.topButtonsOffset",0),M=zS(s,"space.topButton",0);h=new ux(t,{groupName:"top",background:k,buttons:y,orientation:0,space:{item:M},align:zS(s,"align.topButtons",void 0),click:C,eventEmitter:r.eventEmitter});S={left:T};r.add(h,1,0,"left",S,!1);}if(m){var E=zS(s,"space.bottomButtonsOffset",0),_=zS(s,"space.bottomButton",0);l=new ux(t,{groupName:"bottom",background:b,buttons:m,orientation:0,space:{item:_},align:zS(s,"align.bottomButtons",void 0),click:C,eventEmitter:r.eventEmitter});S={left:E};r.add(l,1,2,"left",S,!1);}return r.addChildrenMap("background",c),r.addChildrenMap("panel",d),r.addChildrenMap("leftButtons",f),r.addChildrenMap("rightButtons",v),r.addChildrenMap("topButtons",y),r.addChildrenMap("bottomButtons",m),r.addChildrenMap("leftButtonsSizer",o),r.addChildrenMap("rightButtonsSizer",a),r.addChildrenMap("topButtonsSizer",h),r.addChildrenMap("bottomButtonsSizer",l),r}return r(i)}(Jb);Object.assign(FS.prototype,IS);var YS=function(){function t(e,i){n(this,t),this.container=null,this._deltaHeight=0,this.setParent(e);}return r(t,[{key:"setParent",value:function(t){this.parent=t,this.parentContainer=t.getParentContainer();}},{key:"destroy",value:function(t){void 0===t&&(t=!1),t||this.destroyContainer(),this.deltaHeight=0,this.data=void 0,this.container=null,this.parent=void 0,this.parentContainer=void 0;}},{key:"table",get:function(){return this.parent}},{key:"scrollMode",get:function(){return this.parentContainer.scrollMode}},{key:"colIndx",get:function(){return this.parent.cellIndxeToColIndex(this.index)}},{key:"rowIndx",get:function(){return this.parent.cellIndxeToRowIndex(this.index)}},{key:"getContainer",value:function(){return this.container}},{key:"setContainer",value:function(t){return t?(this.container&&this.container.destroy(),this.container=t,this.parentContainer.add(t),this):(this.destroyContainer(),this)}},{key:"destroyContainer",value:function(){return this.container&&(this.container.destroy(),this.container=null),this}},{key:"popContainer",value:function(){if(this.container){var t=this.container;return this.container=null,this.parentContainer.remove(t),t}return null}},{key:"setXY",value:function(t,e){return this.container&&this.parentContainer.setChildLocalPosition(this.container,t,e),this}},{key:"setCellContainerAlign",value:function(t){return "string"==typeof t&&(t=jf[t]),this.cellContainerAlign=t,this}},{key:"deltaHeight",get:function(){return this._deltaHeight},set:function(t){null==t&&(t=0);var e=this.parent;0===this._deltaHeight&&0!==t?e.nonZeroDeltaHeightCount++:0!==this._deltaHeight&&0===t&&e.nonZeroDeltaHeightCount--;var i=this._deltaHeight!==t;if(this._deltaHeight=t,i){e.resetTotalRowsHeight();var n=0===this.scrollMode?"cellheightchange":"cellwidthchange";this.parentContainer.emit(n,this,this.container,this.parentContainer);}}},{key:"deltaWidth",get:function(){return this.deltaHeight},set:function(t){this.deltaHeight=t;}},{key:"setDeltaHeight",value:function(t){return this.deltaHeight=t,this}},{key:"setDeltaWidth",value:function(t){return this.deltaHeight=t,this}},{key:"height",get:function(){return 0===this.scrollMode?this.deltaHeight+this.parent.defaultCellHeight:this.parent.defaultCellWidth},set:function(t){1!==this.scrollMode&&this.setDeltaHeight(t-this.parent.defaultCellHeight);}},{key:"setHeight",value:function(t){return this.height=t,this}},{key:"width",get:function(){return 0===this.scrollMode?this.parent.defaultCellWidth:this.deltaHeight+this.parent.defaultCellHeight},set:function(t){0!==this.scrollMode&&this.setDeltaHeight(t-this.parent.defaultCellHeight);}},{key:"setWidth",value:function(t){return this.width=t,this}},{key:"scene",get:function(){return this.parentContainer.scene}}]),t}();Object.assign(YS.prototype,wi);var WS=Phaser.Utils.Objects.GetValue,VS=Phaser.Utils.Array.SpliceOne,XS=function(){function t(e,i){n(this,t),this.parent=e,this.cells=[],this.cellPool=new hi,this.resetFromJSON(i);}return r(t,[{key:"resetFromJSON",value:function(t){void 0===t&&(t={}),this.colCount=void 0,this.nonZeroDeltaHeightCount=0,this.resetTotalRowsHeight();var e=t.cellHeight;void 0===e&&(e=30);var i=t.cellWidth;return void 0===i&&(i=30),this.setDefaultCellHeight(e),this.setDefaultCellWidth(i),this.initCells(WS(t,"cellsCount",0)),this.setColumnCount(WS(t,"columns",1)),this}},{key:"destroy",value:function(t){this.cellPool.destroy(),this.cells=void 0,this.parent=void 0;}},{key:"defaultCellHeightMode",get:function(){return 0===this.nonZeroDeltaHeightCount}},{key:"setDefaultCellHeight",value:function(t){return this.defaultCellHeight=t,this}},{key:"setDefaultCellWidth",value:function(t){return this.defaultCellWidth=t,this}},{key:"initCells",value:function(t){var e=this.cells;e.length=t;for(var i=0;i=0&&t=0&&i0&&n)){if(0===r)return 2===e&&(i+=1),i;if(1===e){var o=i;(n=(i+=1)>=0&&i=this.colCount?null:e*this.colCount+t}},{key:"rowIndexToHeight",value:function(t,e){if(this.defaultCellHeightMode)return (e-t+1)*this.defaultCellHeight;for(var i=0,n=t;n<=e;n++)i+=this.getRowHeight(n);return i}},{key:"colIndexToWidth",value:function(t,e){return (e-t+1)*this.defaultCellWidth}},{key:"getRowHeight",value:function(t){var e=this.colCount;if(e<=1)return this.getCellHeight(this.colRowToCellIndex(0,t));for(var i,n=0,s=0;sthis.topTableOY,r=tthis.leftTableOX,r=tt?this.removeCells(t,e-t):this.insertNewCells(e,t-e)),this},insertNewCells:function(t,e){return "object"===i(t)&&(t=t.index),void 0===e&&(e=1),e<=0||(t=rO(t,0,this.cellsCount),this.table.insertNewCells(t,e)),this},removeCells:function(t,e){if("object"===i(t)&&(t=t.index),void 0===e&&(e=1),t<0&&(e+=t,t=0),e<=0)return this;if(t>this.cellsCount)return this;for(var n,s=t,r=t+e;sb.bottom&&(l=c.getTopLeft().y,t.setOrigin(0,1).setPosition(h+d,l+f));},ZO={down:0,up:1},qO=Phaser.Utils.Objects.GetValue,$O=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),null==s.transitIn&&(s.transitIn=function(t,e){Dp(t,e,"y","Cubic");}),null==s.transitOut&&(s.transitOut=function(t,e){!function(t,e,i,n,s){void 0===n&&(n="Linear");var r={mode:0};switch(i){case 0:case"x":r.end={x:0};break;case 1:case"y":r.end={y:0};break;default:r.end=0;}r.duration=e,r.ease=n,void 0===s?s=new Bp(t,r):s.resetFromJSON(r),s.restart();}(t,e,"y","Linear");}),s.manualClose=!0,s.clickOutsideClose=!0,s.destroy=!0,r=e.call(this,t,s),JO(t,s),t.isRexSizer&&t.layout();var o=qO(s,"touchOutsideClose",!1),a=qO(s,"anyTouchClose",!1);return a&&(o=!1),a?r.once("open",r.anyTouchClose,u(r)):o&&r.once("open",r.touchOutsideClose,u(r)),r.requestOpen(),r}return r(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.scene.input.off("pointerup",this.touchCloseCallback,this),p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"touchOutsideClose",value:function(){return this.scene.input.on("pointerup",this.touchCloseCallback,this),this.clickOutsideTest=!0,this}},{key:"anyTouchClose",value:function(){return this.scene.input.once("pointerup",this.touchCloseCallback,this),this}},{key:"touchCloseCallback",value:function(t){this.clickOutsideTest&&qv(this.parent,t.worldX,t.worldY)||this.requestClose();}},{key:"onOpen",value:function(){this.emit("open",this.parent,this),p(h(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.parent,this),p(h(i.prototype),"onClose",this).call(this);}}]),i}(zv),QO={openListPanel:function(){if(this.listPanel)return this;var t,e=NO.call(this);e.on("button.over",(function(t,i,n,s){this.listOnButtonOver&&this.listOnButtonOver.call(this,t,i,n,s),this.emit("button.over",this,e,t,i,n,s);}),this).on("button.out",(function(t,i,n,s){this.listOnButtonOut&&this.listOnButtonOut.call(this,t,i,n,s),this.emit("button.out",this,e,t,i,n,s);}),this),t=this.listAlignMode&&"label"!==this.listAlignMode?this.getElement(this.listAlignMode):this;var i=new $O(e,{duration:{in:this.listEaseInDuration,out:this.listEaseOutDuration},transitIn:this.listTransitInCallback,transitOut:this.listTransitOutCallback,expandDirection:this.listExpandDirection,alignTargetX:t,alignTargetY:this,alignSide:this.listAlignSide,bounds:this.listBounds,anyTouchClose:!0}).on("open",(function(){e.on("button.click",(function(t,i,n,s){this.listOnButtonClick&&this.listOnButtonClick.call(this,t,i,n,s),this.emit("button.click",this,e,t,i,n,s);}),this),this.emit("list.open",this,e);}),this).on("close",(function(){this.listPanel=void 0,this.dropDownBehavior=void 0;}),this);return this.listPanel=e,this.dropDownBehavior=i,this.pin(e),this},closeListPanel:function(){return this.dropDownBehavior?(this.dropDownBehavior.requestClose(),this):this},toggleListPanel:function(){return this.listPanel?this.closeListPanel():this.openListPanel(),this}};Object.assign(QO,HO);var tP=Phaser.Utils.Objects.GetValue,eP=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),(r=e.call(this,t,s)).type="rexDropDownList",r.timer=void 0,r.setOptions(tP(s,"options"));var o=tP(s,"list");return r.setWrapEnable(tP(o,"wrap",!1)),r.setCreateButtonCallback(tP(o,"createButtonCallback")),r.setCreateListBackgroundCallback(tP(o,"createBackgroundCallback")),r.setButtonClickCallback(tP(o,"onButtonClick")),r.setButtonOverCallback(tP(o,"onButtonOver")),r.setButtonOutCallback(tP(o,"onButtonOut")),r.setListExpandDirection(tP(o,"expandDirection")),r.setListEaseInDuration(tP(o,"easeIn",500)),r.setListEaseOutDuration(tP(o,"easeOut",100)),r.setListTransitInCallback(tP(o,"transitIn")),r.settListTransitOutCallback(tP(o,"transitOut")),r.setListSize(tP(o,"width"),tP(o,"height")),r.setListAlignmentMode(tP(o,"alignParent","text")),r.setListAlignmentSide(tP(o,"alignSide","")),r.setListBounds(tP(o,"bounds")),r.setListSpace(tP(o,"space")),r.setListDraggable(tP(o,"draggable",!1)),r.setValueChangeCallback(tP(s,"setValueCallback"),tP(s,"setValueCallbackScope")),r.setValue(tP(s,"value")),r.onClick(r.toggleListPanel,u(r)),r}return r(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.listPanel&&(this.listPanel.destroy(t),this.listPanel=void 0),p(h(i.prototype),"destroy",this).call(this,t));}},{key:"setOptions",value:function(t){return void 0===t&&(t=[]),this.options=t,this}},{key:"setValueChangeCallback",value:function(t,e){return this.valueChangeCallback=t,this.valueChangeCallbackScope=e,this}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"value",get:function(){return this._value},set:function(t){if(this._value!==t){var e=this._value;this._value=t;var i=this.valueChangeCallback,n=this.valueChangeCallbackScope;i&&(n?i.call(n,this,t,e):i(this,t,e)),this.emit("valuechange",this,t,e);}}},{key:"emitButtonClick",value:function(t){var e=this.options[t];return e?(this.emit("button.click",this,void 0,e,t),this):this}}]),i}(CC);Object.assign(eP.prototype,QO);var iP=function(t){return Array.isArray(t)?t=t.join("\n"):"number"==typeof t&&(t=t.toString()),t},nP={clearText:function(){return this.sections.length=0,this.pageStartIndexes.length=0,this.lines.length=0,this},appendPage:function(t){var e=this.totalLinesCount;this.sections.push(iP(t));t=this.sections.join("\n");this.lines=iS(this.parent,t,this.lines);for(var i=this.totalLinesCount-e,n=Math.ceil(i/this.pageLinesCount),s=0;s=this.pageCount-1}},{key:"totalLinesCount",get:function(){return this.lines?this.lines.length:0}},{key:"startLineIndex",get:function(){return this._startLineIndex},set:function(t){t=lP(t,0,this.totalLinesCount-1),this._startLineIndex=t;}},{key:"setStartLineIndex",value:function(t){return this.startLineIndex=t,this}},{key:"pageLinesCount",get:function(){if(void 0!==this.maxLines)return this.maxLines;var t;switch(this.textObjectType){case 0:case 1:var e=this.parent.style.maxLines;t=e>0?e:Math.floor(function(t){var e,i,n;switch(eS(t)){case 0:case 1:e=t.height-t.padding.top-t.padding.bottom,i=t.lineSpacing,n=t.style.metrics.fontSize+t.style.strokeThickness;break;case 2:e=t.height,i=0;var s=t.fontSize/t.fontData.size;n=t.fontData.lineHeight*s;}return (e-i)/(n+i)}(this.parent));break;case 2:t=this.totalLinesCount;}return t}},{key:"content",get:function(){return this.sections.join(this.pageBreak)}}]),i}(Ta);Object.assign(uP.prototype,aP),Phaser.Utils.Objects.GetFastValue,Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue;var cP=rk.prototype.add,dP=function(t,e,i,n,s,r,o,a,h){return t.setVisible(!1),cP.call(this,t,e,i,n,s,r,o,a,h),this},fP={add:dP,addPage:dP},pP=ie.prototype.setChildVisible,vP={getPage:function(t){return void 0===t?null:this.sizerChildren.hasOwnProperty(t)?this.sizerChildren[t]:null},swapPage:function(t,e){this._previousKey=this._currentKey;var i=this.previousPage;i&&(0===this.swapMode?(pP.call(this,i,!1),this.emit("pageinvisible",i,this._previousKey,this)):i.destroy()),t&&!this.sizerChildren.hasOwnProperty(t)&&this.emit("createpage",t,this),this._currentKey=t;var n=this.currentPage;return n&&(pP.call(this,n,!0),this.emit("pagevisible",n,this._currentKey,this),void 0===e&&(e=this.fadeInDuration),e>0&&n.setAlpha(0).fadeIn(e,1)),this},hasPage:function(t){return this.sizerChildren.hasOwnProperty(t)}};Object.assign(vP,fP);var gP=Phaser.Utils.Objects.GetValue,yP=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).type="rexPages",r.childrenMap=r.sizerChildren,r._previousKey=void 0,r._currentKey=void 0,r.setSwapMode(gP(s,"swapMode",0)),r.setFadeInDuration(gP(s,"fadeIn",0)),r}return r(i,[{key:"setSwapMode",value:function(t){return "string"==typeof t&&(t=kP[t]),this.swapMode=t,this}},{key:"setFadeInDuration",value:function(t){return this.fadeInDuration=t,this}},{key:"previousKey",get:function(){return this._previousKey}},{key:"currentKey",get:function(){return this._currentKey},set:function(t){this.swapPage(t);}},{key:"currentPage",get:function(){return this.getPage(this.currentKey)}},{key:"previousPage",get:function(){return this.getPage(this.previousKey)}},{key:"keys",get:function(){return Object.keys(this.sizerChildren)}}]),i}(rk);Object.assign(yP.prototype,vP);var kP={invisible:0,destroy:1},mP=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"tint",get:function(){return 0===this.vertices.length?16777215:this.vertices[0].color}},{key:"setInteractive",value:function(){var t=function(t,e,i){for(var n=this.faces,s=0;s=e.length))return e[t].name},getPageIndex:function(t){for(var e=this.getElement("tabs.buttons"),i=0,n=e.length;ithis.topChildOY}},{key:"childOYExeceedBottom",value:function(t){return void 0===t&&(t=this.childOY),tthis.leftChildOX}},{key:"childOXExeceedRight",value:function(t){return void 0===t&&(t=this.childOX),tthis.childHeight?t=0:n?t=e:s&&(t=i)),this._childOY!==t&&(this._childOY=t,this.resetChildPosition()),n&&(this.execeedTopState||this.emit("execeedtop",this,t,e)),this.execeedTopState=n,s&&(this.execeedBottomState||this.emit("execeedbottom",this,t,i)),this.execeedBottomState=s;}},{key:"childOX",get:function(){return this._childOX},set:function(t){var e=this.leftChildOX,i=this.rightChildOX,n=this.childOXExceedLeft(t),s=this.childOXExeceedRight(t);this.clampChildOX&&(this.childVisibleWidth>this.childWidth?t=0:n?t=e:s&&(t=i)),this._childOX!==t&&(this._childOX=t,this.resetChildPosition()),n&&(this.execeedLeftState||this.emit("execeedleft",this,t,e)),this.execeedLeftState=n,s&&(this.execeedRightState||this.emit("execeedright",this,t,i)),this.execeedRightState=s;}},{key:"setChildOY",value:function(t){return this.childOY=t,this}},{key:"setChildOX",value:function(t){return this.childOX=t,this}},{key:"t",get:function(){var t=this.visibleHeight;return 0===t?0:this.childOY/-t},set:function(t){this.childOY=-this.visibleHeight*t;}},{key:"s",get:function(){var t=this.visibleWidth;return 0===t?0:this.childOX/-t},set:function(t){this.childOX=-this.visibleWidth*t;}},{key:"setChildOYByPercentage",value:function(t){return this.t=t,this}},{key:"setChildOXByPercentage",value:function(t){return this.s=t,this}}]),i}(Hy);Object.assign(_T.prototype,PT);var LT=["top","bottom","centerY","center"],RT=["left","right","centerX","center"],BT=function(t,e,i){var n,s="Y"===(e=e.toUpperCase()),r=this.childrenMap.child;if(s){if(i)for(var o=0,a=LT.length;o=0?0:Math.abs(l)<=Math.abs(u)?l:u;}}else {if(i)for(o=0,a=RT.length;o=0?0:Math.abs(c)<=Math.abs(d)?c:d;}}switch(this.scrollMode){case 0:case 1:this.childOY+=n;break;default:this["childO".concat(e)]+=n;}},jT=Phaser.Utils.Objects.GetValue,DT=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=qx(s),a=jT(s,"panel",void 0);void 0===a&&(a={}),a.scrollMode=o,a.clamplChildOY=jT(s,"clamplChildOY",!1),a.clamplChildOX=jT(s,"clamplChildOX",!1);var h,l,u=new _T(t,a);switch(t.add.existing(u),o){case 0:h=jT(s,"expand.panel",!0),l=!0;break;case 1:h=!0,l=jT(s,"expand.panel",!0);break;default:h=!0,l=!0;}s.type="rexScrollablePanel",s.child={gameObject:u,expandWidth:h,expandHeight:l,align:jT(s,"align.panel","center")};var c=jT(s,"space",void 0);return c&&(c.child=jT(c,"panel",0)),(r=e.call(this,t,s)).addChildrenMap("panel",u.child),r.addChildrenMap("panelLayer",u.maskLayer),r.addChildrenMap("mask",u.maskGameObject),r.addChildrenMap("scrollableBlock",u),r}return r(i,[{key:"setChildrenInteractive",value:function(t){return void 0===t&&(t={}),t.hasOwnProperty("eventEmitter")||(t.eventEmitter=this),t.hasOwnProperty("targets")||(t.targets=[this.childrenMap.panel]),Vy(this.childrenMap.child,t),this}}]),i}(Qw),AT={scrollToChild:function(t,e){if(!this.hasChild(t))return this;switch(this.scrollMode){case 0:BT.call(this,t,"y",e);break;case 1:BT.call(this,t,"x",e);break;default:BT.call(this,t,"y",e),BT.call(this,t,"x",e);}return this}};Object.assign(DT.prototype,AT),Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue;for(var IT,zT=function(t,e,i){void 0===i&&(i=!0),i?e=e?xe(e):{}:e||(e={});var n=new bc(t,e);return t.add.existing(n),n},FT=Phaser.Utils.Objects.GetValue,YT=Phaser.Display.Color,WT=Phaser.Display.Color.ColorToRGBA,VT=Phaser.Display.Color.HSVToRGB,XT=Phaser.Math.Clamp,GT=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),s.orientation=0,(r=e.call(this,t,s)).type="rexColorComponents",r.colorObject=new YT;var o=FT(s,"background",void 0),a=FT(s,"formatLabel",void 0);Xt(a)||(a=zx(t,a).resetDisplayContent());var h=[];if(s.inputText0&&s.inputText1&&s.inputText2)h.push(s.inputText0),h.push(s.inputText1),h.push(s.inputText2);else for(var l=FT(s,"inputText"),c=0;c<3;c++){var d=zT(t,l).setMaxLength(3).setNumberInput();h.push(d);}o&&r.addBackground(o);var f=FT(s,"proportion.formatLabel",0),p=!!a.isRexContainerLite,v=FT(s,"expand.formatLabel",p);r.add(a,{proportion:f,expand:v});f=void 0===FT(l,"width")?1:0,v=void 0===FT(l,"height"),c=0;for(var g=h.length;c0&&{height:this.colorComponentsHeight,formatLabel:this.colorComponentsFormatLabelConfig,inputText:this.colorComponentsInputTextConfig,space:this.colorComponentsSpace};var o=new MM(t,{width:n,height:r,background:e,space:this.colorPickerSpace,hPalette:{position:this.colorPickerHPalettePosition},colorComponents:s,value:this.value});return t.add.existing(o),o},_M={openColorPicker:function(){if(!this.colorPicker){var t=EM.call(this).layout(),e=new $O(t,{duration:{in:this.colorPickerEaseInDuration,out:this.colorPickerEaseOutDuration},transitIn:this.colorPickerTransitInCallback,transitOut:this.colorPickerTransitOutCallback,expandDirection:this.colorPickerExpandDirection,alignTargetX:this,alignTargetY:this,bounds:this.colorPickerBounds,touchOutsideClose:!0}).on("open",(function(){t.on("valuechange",(function(t){this.setValue(t);}),this);}),this).on("close",(function(){this.colorPicker=void 0,this.dropDownBehavior=void 0;}),this);return this.colorPicker=t,this.dropDownBehavior=e,this.pin(t),this}}};Object.assign(_M,sM);var LM=Phaser.Utils.Objects.GetValue,RM=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),(r=e.call(this,t,s)).type="rexColorInput",s.hasOwnProperty("colorPicker")||(s.colorPicker={background:{color:0}});var o=s.colorPicker,a=!1!==o&&null!==o;if(a){var h;r.setColorPickerSize(LM(o,"width",160),LM(o,"height",170));var l=LM(o,"background");h=l?function(t){return xC(t,l)}:LM(o,"createBackgroundCallback"),r.setCreateColorPickerBackgroundCallback(h),r.setColorPickerHPalettePosition(LM(o,"hPalettePosition",0)),r.setColorPickerExpandDirection(LM(o,"expandDirection")),r.setColorPickerEaseInDuration(LM(o,"easeIn",200)),r.setColorPickerEaseOutDuration(LM(o,"easeOut",200)),r.setColorPickerTransitInCallback(LM(o,"transitIn")),r.setColorPickerTransitOutCallback(LM(o,"transitOut")),r.setColorPickerBounds(LM(o,"bounds"));var c=LM(o,"space");void 0===c&&(c={left:10,right:10,top:10,bottom:10,item:8}),r.setColorPickerSpace(c);}var d=s.colorComponents;if(a&&(!1!==d&&null!==d)){r.setColorComponentsHeight(LM(d,"height",30)),r.setColorComponentsFormatLabelConfig(LM(d,"formatLabel"));var f=LM(d,"inputText");f||(f=LM(s,"inputText")),r.setColorComponentsInputTextConfig(f);var p=LM(d,"space");void 0===p&&(p={item:8}),r.setColorComponentsSpace(p);}var v=r.childrenMap.swatch;return v&&a&&r.onClick(v,r.openColorPicker,u(r)),r}return r(i)}(nM);Object.assign(RM.prototype,_M);var BM=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),s=BC(t,s),(r=e.call(this,t,s)).type="rexTweaker.Title",r}return r(i,[{key:"setTitle",value:function(t){return (t=t?xe(t):{}).hasOwnProperty("text")||(t.hasOwnProperty("title")?t.text=t.title:t.text=""),this.resetDisplayContent(t),this}}]),i}(CC),jM=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),(r=e.call(this,t,s)).type="rexTweaker.FolderTitle";var o=new Ef(t,s.expandedIcon);return t.add.existing(o),r.addSpace().add(o,{proportion:0,expand:!1,padding:1,fitRatio:1}),r.addChildrenMap("expandedIcon",o),r}return r(i,[{key:"setExpandedState",value:function(t){void 0===t&&(t=!0);var e=t?"down":"right";return this.childrenMap.expandedIcon.setDirection(e),this}}]),i}(BM),DM=function(t,e){var i=new _E(t,e);return t.add.existing(i),i},AM=function(t,e,i){return xC(t,i)},IM=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).type="rexTweaker.Folder",r}return r(i,[{key:"setTitle",value:function(t){return this.childrenMap.title.setTitle(t),this}}]),i}(xT);Object.assign(IM.prototype,{setBindingTarget:function(t){return this.childrenMap.child.setBindingTarget(t),this}},{getMaxInputRowTitleWidth:function(){return this.childrenMap.child.getMaxInputRowTitleWidth()+this.getInnerPadding("left")},setInputRowTitleWidth:function(t){return t-=this.getInnerPadding("left"),this.childrenMap.child.setInputRowTitleWidth(t),this}});var zM=Phaser.Utils.Objects.GetValue,FM=Phaser.Utils.Objects.GetValue,YM={getMaxInputRowTitleWidth:function(){for(var t=0,e=this.childrenMap.pages.children,i=0,n=e.length;i1?e-1:0),n=1;n0?0:1,o.setMinWidth(this.itemWidth)),this.add(o,{proportion:r,expand:!0}),n.onValueChange&&a.on("valuechange",n.onValueChange),n.onValidate&&a.setValidateCallback(n.onValidate),o.setAutoUpdateEnable(n.autoUpdate),o.setBindingTarget(t,e),n.monitor&&o.startMonitorTarget(),n.key&&this.root.addChildrenMap(n.key,o),this},addButton:PE,addButtons:PE,addSeparator:function(t){var e=this.scene,i=TE(this.styles,"separator"),n=AM(e,0,i);return this.add(n,{expand:!0}),this},setBindingTarget:function(t){for(var e=this.sizerChildren,i=0,n=e.length;i0?m.pop().setTexture(j,F):o(g,j,F),v&&g.add.existing(N),h){var G=T+C*A-I*(A-1)+s*C,H=E+B*Y-X*(Y-1)+p*B;N.setOrigin(s,p).setPosition(G,H).setScale(_,S).setRotation(x),l(N,T,E,x);}k.push(N);}return k}(t,e,r,n)}}])&&e(r.prototype,o),Object.defineProperty(r,"prototype",{writable:!1}),y}()})); +!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).rexgridcutimageplugin=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){for(var r=0;r0?d.pop().setTexture(m,I):o(h,m,I),y&&h.add.existing(B),b){var A=S+T*C+s*T,N=x+E*k+p*E;B.setOrigin(s,p).setPosition(A,N).setScale(P,O).setRotation(w),l(B,S,x,w);}R.push(B);}return R}(t,e,r,n)}}])&&e(r.prototype,o),Object.defineProperty(r,"prototype",{writable:!1}),y}()})); diff --git a/dist/rexjigsaw.js b/dist/rexjigsaw.js index a99a99ba7c..246817bea4 100644 --- a/dist/rexjigsaw.js +++ b/dist/rexjigsaw.js @@ -35,20 +35,6 @@ }); return Constructor; } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); @@ -797,7 +783,6 @@ return "".concat(c, ",").concat(r); }; var GenerateFrames = function GenerateFrames(scene, _ref) { - var _JigsawPiece; var sourceKey = _ref.sourceKey, destinationKey = _ref.destinationKey, columns = _ref.columns, @@ -841,11 +826,14 @@ useDynamicTexture: true, fillColor: 0x888888 }); - var sample = new JigsawPiece(scene, (_JigsawPiece = { + var sample = new JigsawPiece(scene, { width: frameWidth, height: frameHeight, - edgeWidth: edgeWidth - }, _defineProperty(_JigsawPiece, "edgeWidth", edgeHeight), _defineProperty(_JigsawPiece, "key", sourceKey), _defineProperty(_JigsawPiece, "drawShapeCallback", drawShapeCallback), _JigsawPiece)); + edgeWidth: edgeWidth, + edgeHeight: edgeHeight, + key: sourceKey, + drawShapeCallback: drawShapeCallback + }); var startX = -edgeWidth, startY = -edgeHeight; var scrollX = startX, @@ -922,6 +910,12 @@ }); piecesKey = result.destinationKey; var getFrameNameCallback = result.getFrameNameCallback; + var frameWidth = result.frameWidth, + frameHeight = result.frameHeight; + var pieceWidth = (frameWidth - edgeWidth * 2) * scaleX, + pieceHeight = (frameHeight - edgeHeight * 2) * scaleY; + var pieceDisplayOriginX = originX * frameWidth * scaleX, + pieceDisplayOriginY = originY * frameHeight * scaleY; if (!createImageCallback) { createImageCallback = function createImageCallback(scene, key, frame) { return new ImageClass(scene, 0, 0, key, frame); @@ -945,16 +939,16 @@ scene.add.existing(pieceGameObject); } if (align) { - var pieceX = pieceTopLeftX + originX * pieceGameObject.width * scaleX; - var pieceY = pieceTopLeftY + originY * pieceGameObject.height * scaleY; + var pieceX = pieceTopLeftX + pieceDisplayOriginX; + var pieceY = pieceTopLeftY + pieceDisplayOriginY; pieceGameObject.setOrigin(originX, originY).setPosition(pieceX, pieceY).setScale(scaleX, scaleY).setRotation(rotation); RotateAround(pieceGameObject, topLeftX, topLeftY, rotation); } - pieceTopLeftX += (pieceGameObject.width - edgeWidth * 2) * scaleX; + pieceTopLeftX += pieceWidth; pieceGameObjects.push(pieceGameObject); } pieceTopLeftX = topLeftX; - pieceTopLeftY += (pieceGameObject.height - edgeHeight * 2) * scaleY; + pieceTopLeftY += pieceHeight; } return pieceGameObjects; }; diff --git a/dist/rexjigsaw.min.js b/dist/rexjigsaw.min.js index bfe0e2756c..22ceaf0e5d 100644 --- a/dist/rexjigsaw.min.js +++ b/dist/rexjigsaw.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).rexjigsaw=t();}(undefined,(function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var i=0;i.5?2:1,n=h===t-1?0:Math.random()>.5?2:1,o[s][h]={left:i,right:r,top:a,bottom:n};return o}(o,s)),void 0===n&&(n="".concat(r,"_pieces"));var w=p/o+2*l,x=b/s+2*u;m.exists(n)&&m.remove(n);for(var k=new O(e,{key:n,cellWidth:w,cellHeight:x,cellPadding:c,columns:o,rows:s,useDynamicTexture:!0,fillColor:8947848}),P=new D(e,(a(i={width:w,height:x,edgeWidth:l},"edgeWidth",u),a(i,"key",r),a(i,"drawShapeCallback",f),i)),C=-l,W=C,T=-u,H=0;H0?d.pop().setTexture(i,Y):c(x,i,Y),g&&x.add.existing(X),m){var G=M+p*X.width*O,E=N+w*X.height*T;X.setOrigin(p,w).setPosition(G,E).setScale(O,T).setRotation(H),K(X,C,W,H);}M+=(X.width-2*n)*O,F.push(X);}M=C,N+=(X.height-2*o)*T;}return F}}})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).rexjigsaw=t();}(undefined,(function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var i=0;i.5?2:1,o=h===t-1?0:Math.random()>.5?2:1,n[s][h]={left:i,right:r,top:a,bottom:o};return n}(a,o)),void 0===r&&(r="".concat(i,"_pieces"));var p=m/a+2*h,b=y/o+2*c;g.exists(r)&&g.remove(r);for(var w=new C(e,{key:r,cellWidth:p,cellHeight:b,cellPadding:s,columns:a,rows:o,useDynamicTexture:!0,fillColor:8947848}),x=new M(e,{width:p,height:b,edgeWidth:h,edgeHeight:c,key:i,drawShapeCallback:u}),k=-h,P=k,W=-c,H=0;H0?d.pop().setTexture(i,U):c(x,i,U),g&&x.add.existing(L),m){var z=G+K,V=E+X;L.setOrigin(p,w).setPosition(z,V).setScale(H,O).setRotation(T),_(L,C,W,T);}G+=N,Y.push(L);}G=C,E+=I;}return Y}}})); diff --git a/dist/rextransitionimagepackplugin.js b/dist/rextransitionimagepackplugin.js index 388a439dc2..0cf000822a 100644 --- a/dist/rextransitionimagepackplugin.js +++ b/dist/rextransitionimagepackplugin.js @@ -3624,7 +3624,7 @@ return callback; }; - var GenerateFrames = function GenerateFrames(scene, key, frame, columns, rows, overlapX, overlapY, getFrameNameCallback) { + var GenerateFrames = function GenerateFrames(scene, key, frame, columns, rows, getFrameNameCallback) { if (frame == null) { frame = '__BASE'; } @@ -3636,8 +3636,8 @@ var baseWidth = baseFrame.width, baseHeight = baseFrame.height; var cellX, cellY, cellName; - var cellWidth = (baseWidth + (columns - 1) * overlapX) / columns, - cellHeight = (baseHeight + (rows - 1) * overlapY) / rows; + var cellWidth = baseWidth / columns, + cellHeight = baseHeight / rows; var frameCutX = baseFrame.cutX, frameCutY = baseFrame.cutY; var offsetX = 0, @@ -3649,9 +3649,9 @@ cellX = offsetX + frameCutX; cellY = offsetY + frameCutY; texture.add(cellName, 0, cellX, cellY, cellWidth, cellHeight); - offsetX += cellWidth - overlapX; + offsetX += cellWidth; } - offsetY += cellHeight - overlapY; + offsetY += cellHeight; } return { getFrameNameCallback: getFrameNameCallback, @@ -3681,16 +3681,13 @@ } var originX = GetValue$8(config, 'originX', 0.5); var originY = GetValue$8(config, 'originY', 0.5); - var overlap = GetValue$8(config, 'overlap', 0); - var overlapX = GetValue$8(config, 'overlapX', overlap); - var overlapY = GetValue$8(config, 'overlapY', overlap); var addToScene = GetValue$8(config, 'add', true); var align = GetValue$8(config, 'align', addToScene); var imageObjectPool = GetValue$8(config, 'objectPool', undefined); var scene = gameObject.scene; var texture = gameObject.texture; var frame = gameObject.frame; - var result = GenerateFrames(scene, texture, frame, columns, rows, overlapX, overlapY); + var result = GenerateFrames(scene, texture, frame, columns, rows); var getFrameNameCallback = result.getFrameNameCallback; var scaleX = gameObject.scaleX, scaleY = gameObject.scaleY; @@ -3701,8 +3698,6 @@ var cellGameObjects = []; var scaleCellWidth = result.cellWidth * scaleX, scaleCellHeight = result.cellHeight * scaleY; - var scaleOverlapX = overlapX * scaleX, - scaleOverlapY = overlapY * scaleY; for (var y = 0; y < rows; y++) { for (var x = 0; x < columns; x++) { var cellGameObject; @@ -3716,8 +3711,8 @@ scene.add.existing(cellGameObject); } if (align) { - var cellTLX = startX + scaleCellWidth * x - scaleOverlapX * (x - 1); - var cellTLY = startY + scaleCellHeight * y - scaleOverlapY * (y - 1); + var cellTLX = startX + scaleCellWidth * x; + var cellTLY = startY + scaleCellHeight * y; var cellX = cellTLX + originX * scaleCellWidth; var cellY = cellTLY + originY * scaleCellHeight; cellGameObject.setOrigin(originX, originY).setPosition(cellX, cellY).setScale(scaleX, scaleY).setRotation(rotation); diff --git a/dist/rextransitionimagepackplugin.min.js b/dist/rextransitionimagepackplugin.min.js index bbfc2faf94..0eacbc8a66 100644 --- a/dist/rextransitionimagepackplugin.min.js +++ b/dist/rextransitionimagepackplugin.min.js @@ -1 +1 @@ -!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).rextransitionimagepackplugin=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;it.length)&&(e=t.length);for(var i=0,n=new Array(e);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;i0;){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;e0?-this.delay:0,this.state=this.nowTime>=0?le:he,this.repeatCounter=0,this}},{key:"stop",value:function(){return this.state=oe,this}},{key:"update",value:function(t,e){this.state!==oe&&this.state!==ce&&0!==e&&0!==this.timeScale&&(this.nowTime+=e*this.timeScale,this.justRestart=!1,this.nowTime>=this.duration?-1===this.repeat||this.repeatCounter0&&(this.nowTime-=this.repeatDelay,this.state=ue)):(this.nowTime=this.duration,this.state=ce):this.nowTime>=0&&(this.state=le));}},{key:"t",get:function(){var t;switch(this.state){case oe:case he:case ue:t=0;break;case le:t=this.nowTime/this.duration;break;case ce:t=1;}return re(t,0,1)},set:function(t){(t=re(t,-1,1))<0?(this.state=he,this.nowTime=-this.delay*t):(this.state=le,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===oe}},{key:"isDelay",get:function(){return this.state===he}},{key:"isCountDown",get:function(){return this.state===le}},{key:"isRunning",get:function(){return this.state===he||this.state===le}},{key:"isDone",get:function(){return this.state===ce}},{key:"isOddIteration",get:function(){return 1==(1&this.repeatCounter)}},{key:"isEvenIteration",get:function(){return 0==(1&this.repeatCounter)}}]),t}(),oe=0,he=1,le=2,ue=3,ce=-1,de=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 ae,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}(ie),fe=Phaser.Utils.Objects.GetValue,ve=Phaser.Utils.Objects.GetAdvancedValue,pe=Phaser.Tweens.Builders.GetEaseFunction,ye=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(fe(t,"timer")),this.setEnable(fe(t,"enable",!0)),this.setTarget(fe(t,"target",this.parent)),this.setDelay(ve(t,"delay",0)),this.setDuration(ve(t,"duration",1e3)),this.setEase(fe(t,"ease","Linear")),this.setRepeat(fe(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=pe(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}(de),ge=Phaser.Utils.Objects.GetValue,me=Phaser.Math.Linear,ke=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=ge(t,"key","value");var i=e[this.propertyKey];return this.fromValue=ge(t,"from",i),this.toValue=ge(t,"to",i),this.setEase(ge(t,"ease",this.ease)),this.setDuration(ge(t,"duration",this.duration)),this.setRepeat(ge(t,"repeat",0)),this.setDelay(ge(t,"delay",0)),this.setRepeatDelay(ge(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]=me(this.fromValue,this.toValue,i);}}]),a}(ye),be=Phaser.Utils.Objects.IsPlainObject,Ce=Phaser.Utils.Objects.GetValue,Pe=Phaser.Utils.Array.GetRandom,xe={out:0,in:1},Se=function(t,e){for(var i=0,n=arguments.length<=2?0:arguments.length-2;i0?f.pop().setTexture(p,R):s(v,p,R),c&&v.add.existing(O),d){var A=x+_*E-w*(E-1)+a*_,j=S+L*D-M*(D-1)+o*L;O.setOrigin(a,o).setPosition(A,j).setScale(k,b).setRotation(C),Xe(O,x,S,C);}T.push(O);}return T}(t,e,i,n),a=0,o=r.length;a>>16,o=(65280&s)>>>8,h=255&s;t.fillStyle="rgba("+a+","+o+","+h+","+r+")";},oi=function(t,e,i,n){var s=i||e.strokeColor,r=n||e.strokeAlpha,a=(16711680&s)>>>16,o=(65280&s)>>>8,h=255&s;t.strokeStyle="rgba("+a+","+o+","+h+","+r+")",t.lineWidth=e.lineWidth;},hi=Phaser.Geom.Polygon.Earcut,li=function(t){s(a,t);var i=h(a);function a(){var t;return e(this,a),(t=i.call(this)).pathData=[],t.pathIndexes=[],t.closePath=!1,t}return n(a,[{key:"updateData",value:function(){return this.pathIndexes=hi(this.pathData),u(r(a.prototype),"updateData",this).call(this),this}},{key:"webglRender",value:function(t,e,i,n,s){this.isFilled&&function(t,e,i,n,s,r){for(var a=ni.getTintAppendFloatAlpha(i.fillColor,i.fillAlpha*n),o=i.pathData,h=i.pathIndexes,l=0;l=2){var s=i[n-2],r=i[n-1];if(t===s&&e===r)return i}return i.push(t,e),i},ci=Phaser.Math.DegToRad,di=function(t,e,i,n,s,r,a,o,h){a&&r>s?r-=360:!a&&r0,a=0,o=e.length;a0;this.dirty=this.dirty||this._radiusTL!==t||this._convexTL!==e,this._convexTL=e,this._radiusTL=Math.abs(t);}},{key:"radiusTR",get:function(){return this._radiusTR},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusTR!==t||this._convexTR!==e,this._convexTR=e,this._radiusTR=Math.abs(t);}},{key:"radiusBL",get:function(){return this._radiusBL},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusBL!==t||this._convexBL!==e,this._convexBL=e,this._radiusBL=Math.abs(t);}},{key:"radiusBR",get:function(){return this._radiusBR},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusBR!==t||this._convexBR!==e,this._convexBR=e,this._radiusBR=Math.abs(t);}},{key:"radius",get:function(){return Math.max(this.radiusTL,this.radiusTR,this.radiusBL,this.radiusBR)},set:function(t){"number"==typeof t?(this.radiusTL=t,this.radiusTR=t,this.radiusBL=t,this.radiusBR=t):(this.radiusTL=Ui(t,"tl",0),this.radiusTR=Ui(t,"tr",0),this.radiusBL=Ui(t,"bl",0),this.radiusBR=Ui(t,"br",0));}},{key:"setRadius",value:function(t){return void 0===t&&(t=0),this.radius=t,this}},{key:"iterations",get:function(){return this._iterations},set:function(t){this.dirty=this.dirty||this._iterations!==t,this._iterations=t;}},{key:"setIterations",value:function(t){return this.iterations=t,this}},{key:"updateData",value:function(){var t=this.pathData;t.length=0;var e,i=this.width,n=this.height,s=this.iterations+1;(e=this.radiusTL)>0?this._convexTL?di(e,e,e,e,180,270,!1,s,t):di(0,0,e,e,90,0,!0,s,t):ui(0,0,t);(e=this.radiusTR)>0?this._convexTR?di(i-e,e,e,e,270,360,!1,s,t):di(i,0,e,e,180,90,!0,s,t):ui(i,0,t);(e=this.radiusBR)>0?this._convexBR?di(i-e,n-e,e,e,0,90,!1,s,t):di(i,n,e,e,270,180,!0,s,t):ui(i,n,t);(e=this.radiusBL)>0?this._convexBL?di(e,n-e,e,e,90,180,!1,s,t):di(0,n,e,e,360,270,!0,s,t):ui(0,n,t);return t.push(t[0],t[1]),Si(this.x,this.y,t),u(r(a.prototype),"updateData",this).call(this),this}}]),a}(li),Ni=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,Hi={arc:vi,circle:pi,curve:yi,ellipse:gi,line:mi,lines:Gi,rectangle:Bi,roundRectangle:Wi,triangle:function(t){s(a,t);var i=h(a);function a(t,n,s,r,o,h){var l;return e(this,a),void 0===t&&(t=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0),void 0===h&&(h=0),(l=i.call(this)).pathData=[],l.closePath=!0,l.setP0(t,n),l.setP1(s,r),l.setP2(o,h),l}return n(a,[{key:"x0",get:function(){return this._x0},set:function(t){this.dirty=this.dirty||this._x0!==t,this._x0=t;}},{key:"y0",get:function(){return this._y0},set:function(t){this.dirty=this.dirty||this._y0!==t,this._y0=t;}},{key:"setP0",value:function(t,e){return this.x0=t,this.y0=e,this}},{key:"x1",get:function(){return this._x1},set:function(t){this.dirty=this.dirty||this._x1!==t,this._x1=t;}},{key:"y1",get:function(){return this._y1},set:function(t){this.dirty=this.dirty||this._y1!==t,this._y1=t;}},{key:"setP1",value:function(t,e){return this.x1=t,this.y1=e,this}},{key:"x2",get:function(){return this._x2},set:function(t){this.dirty=this.dirty||this._x2!==t,this._x2=t;}},{key:"y2",get:function(){return this._y2},set:function(t){this.dirty=this.dirty||this._y2!==t,this._y2=t;}},{key:"setP2",value:function(t,e){return this.dirty=this.dirty||this.x2!==t||this.y2!==e,this.x2=t,this.y2=e,this}},{key:"updateData",value:function(){return this.pathData.length=0,this.pathData.push(this.x0,this.y0),this.pathData.push(this.x1,this.y1),this.pathData.push(this.x2,this.y2),this.pathData.push(this.x0,this.y0),u(r(a.prototype),"updateData",this).call(this),this}},{key:"webglRender",value:function(t,e,i,n,s){if(this.isFilled){var r=Ni(this.fillColor,this.fillAlpha*i),a=this.x0-n,o=this.y0-s,h=this.x1-n,l=this.y1-s,u=this.x2-n,c=this.y2-s,d=e.getX(a,o),f=e.getY(a,o),v=e.getX(h,l),p=e.getY(h,l),y=e.getX(u,c),g=e.getY(u,c);t.batchTri(d,f,v,p,y,g,r,r,r);}this.isStroked&&ri(t,this,i,n,s);}},{key:"canvasRender",value:function(t,e,i){var n=this.x1-e,s=this.y1-i,r=this.x2-e,a=this.y2-i,o=this.x3-e,h=this.y3-i;t.beginPath(),t.moveTo(n,s),t.lineTo(r,a),t.lineTo(o,h),t.closePath(),this.isFilled&&(ai(t,this),t.fill()),this.isStroked&&(oi(t,this),t.stroke());}}]),a}(ii)},qi=Phaser.Utils.Objects.GetValue,Ji=Phaser.Utils.Objects.IsPlainObject,Zi=function(){for(var t=this.getShapes(),e=0,i=t.length;e=0;n--)(a=s[n])instanceof e&&(a.destroy(),Cn(s,n));else {n=0;for(var s,r=(s=t.postPipelines).length;nt.length)&&(e=t.length);for(var i=0,n=new Array(e);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;i0;){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;e0?-this.delay:0,this.state=this.nowTime>=0?le:he,this.repeatCounter=0,this}},{key:"stop",value:function(){return this.state=oe,this}},{key:"update",value:function(t,e){this.state!==oe&&this.state!==ce&&0!==e&&0!==this.timeScale&&(this.nowTime+=e*this.timeScale,this.justRestart=!1,this.nowTime>=this.duration?-1===this.repeat||this.repeatCounter0&&(this.nowTime-=this.repeatDelay,this.state=ue)):(this.nowTime=this.duration,this.state=ce):this.nowTime>=0&&(this.state=le));}},{key:"t",get:function(){var t;switch(this.state){case oe:case he:case ue:t=0;break;case le:t=this.nowTime/this.duration;break;case ce:t=1;}return re(t,0,1)},set:function(t){(t=re(t,-1,1))<0?(this.state=he,this.nowTime=-this.delay*t):(this.state=le,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===oe}},{key:"isDelay",get:function(){return this.state===he}},{key:"isCountDown",get:function(){return this.state===le}},{key:"isRunning",get:function(){return this.state===he||this.state===le}},{key:"isDone",get:function(){return this.state===ce}},{key:"isOddIteration",get:function(){return 1==(1&this.repeatCounter)}},{key:"isEvenIteration",get:function(){return 0==(1&this.repeatCounter)}}]),t}(),oe=0,he=1,le=2,ue=3,ce=-1,de=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 ae,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}(ie),fe=Phaser.Utils.Objects.GetValue,ve=Phaser.Utils.Objects.GetAdvancedValue,pe=Phaser.Tweens.Builders.GetEaseFunction,ye=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(fe(t,"timer")),this.setEnable(fe(t,"enable",!0)),this.setTarget(fe(t,"target",this.parent)),this.setDelay(ve(t,"delay",0)),this.setDuration(ve(t,"duration",1e3)),this.setEase(fe(t,"ease","Linear")),this.setRepeat(fe(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=pe(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}(de),ge=Phaser.Utils.Objects.GetValue,me=Phaser.Math.Linear,ke=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=ge(t,"key","value");var i=e[this.propertyKey];return this.fromValue=ge(t,"from",i),this.toValue=ge(t,"to",i),this.setEase(ge(t,"ease",this.ease)),this.setDuration(ge(t,"duration",this.duration)),this.setRepeat(ge(t,"repeat",0)),this.setDelay(ge(t,"delay",0)),this.setRepeatDelay(ge(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]=me(this.fromValue,this.toValue,i);}}]),a}(ye),be=Phaser.Utils.Objects.IsPlainObject,Ce=Phaser.Utils.Objects.GetValue,Pe=Phaser.Utils.Array.GetRandom,xe={out:0,in:1},Se=function(t,e){for(var i=0,n=arguments.length<=2?0:arguments.length-2;i0?u.pop().setTexture(d,w):s(c,d,w),h&&c.add.existing(L),l){var M=b+x*_+a*x,D=C+S*T+o*S;L.setOrigin(a,o).setPosition(M,D).setScale(y,g).setRotation(m),Xe(L,b,C,m);}P.push(L);}return P}(t,e,i,n),a=0,o=r.length;a>>16,o=(65280&s)>>>8,h=255&s;t.fillStyle="rgba("+a+","+o+","+h+","+r+")";},oi=function(t,e,i,n){var s=i||e.strokeColor,r=n||e.strokeAlpha,a=(16711680&s)>>>16,o=(65280&s)>>>8,h=255&s;t.strokeStyle="rgba("+a+","+o+","+h+","+r+")",t.lineWidth=e.lineWidth;},hi=Phaser.Geom.Polygon.Earcut,li=function(t){s(a,t);var i=h(a);function a(){var t;return e(this,a),(t=i.call(this)).pathData=[],t.pathIndexes=[],t.closePath=!1,t}return n(a,[{key:"updateData",value:function(){return this.pathIndexes=hi(this.pathData),u(r(a.prototype),"updateData",this).call(this),this}},{key:"webglRender",value:function(t,e,i,n,s){this.isFilled&&function(t,e,i,n,s,r){for(var a=ni.getTintAppendFloatAlpha(i.fillColor,i.fillAlpha*n),o=i.pathData,h=i.pathIndexes,l=0;l=2){var s=i[n-2],r=i[n-1];if(t===s&&e===r)return i}return i.push(t,e),i},ci=Phaser.Math.DegToRad,di=function(t,e,i,n,s,r,a,o,h){a&&r>s?r-=360:!a&&r0,a=0,o=e.length;a0;this.dirty=this.dirty||this._radiusTL!==t||this._convexTL!==e,this._convexTL=e,this._radiusTL=Math.abs(t);}},{key:"radiusTR",get:function(){return this._radiusTR},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusTR!==t||this._convexTR!==e,this._convexTR=e,this._radiusTR=Math.abs(t);}},{key:"radiusBL",get:function(){return this._radiusBL},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusBL!==t||this._convexBL!==e,this._convexBL=e,this._radiusBL=Math.abs(t);}},{key:"radiusBR",get:function(){return this._radiusBR},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusBR!==t||this._convexBR!==e,this._convexBR=e,this._radiusBR=Math.abs(t);}},{key:"radius",get:function(){return Math.max(this.radiusTL,this.radiusTR,this.radiusBL,this.radiusBR)},set:function(t){"number"==typeof t?(this.radiusTL=t,this.radiusTR=t,this.radiusBL=t,this.radiusBR=t):(this.radiusTL=Ui(t,"tl",0),this.radiusTR=Ui(t,"tr",0),this.radiusBL=Ui(t,"bl",0),this.radiusBR=Ui(t,"br",0));}},{key:"setRadius",value:function(t){return void 0===t&&(t=0),this.radius=t,this}},{key:"iterations",get:function(){return this._iterations},set:function(t){this.dirty=this.dirty||this._iterations!==t,this._iterations=t;}},{key:"setIterations",value:function(t){return this.iterations=t,this}},{key:"updateData",value:function(){var t=this.pathData;t.length=0;var e,i=this.width,n=this.height,s=this.iterations+1;(e=this.radiusTL)>0?this._convexTL?di(e,e,e,e,180,270,!1,s,t):di(0,0,e,e,90,0,!0,s,t):ui(0,0,t);(e=this.radiusTR)>0?this._convexTR?di(i-e,e,e,e,270,360,!1,s,t):di(i,0,e,e,180,90,!0,s,t):ui(i,0,t);(e=this.radiusBR)>0?this._convexBR?di(i-e,n-e,e,e,0,90,!1,s,t):di(i,n,e,e,270,180,!0,s,t):ui(i,n,t);(e=this.radiusBL)>0?this._convexBL?di(e,n-e,e,e,90,180,!1,s,t):di(0,n,e,e,360,270,!0,s,t):ui(0,n,t);return t.push(t[0],t[1]),Si(this.x,this.y,t),u(r(a.prototype),"updateData",this).call(this),this}}]),a}(li),Ni=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,Hi={arc:vi,circle:pi,curve:yi,ellipse:gi,line:mi,lines:Gi,rectangle:Bi,roundRectangle:Wi,triangle:function(t){s(a,t);var i=h(a);function a(t,n,s,r,o,h){var l;return e(this,a),void 0===t&&(t=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0),void 0===h&&(h=0),(l=i.call(this)).pathData=[],l.closePath=!0,l.setP0(t,n),l.setP1(s,r),l.setP2(o,h),l}return n(a,[{key:"x0",get:function(){return this._x0},set:function(t){this.dirty=this.dirty||this._x0!==t,this._x0=t;}},{key:"y0",get:function(){return this._y0},set:function(t){this.dirty=this.dirty||this._y0!==t,this._y0=t;}},{key:"setP0",value:function(t,e){return this.x0=t,this.y0=e,this}},{key:"x1",get:function(){return this._x1},set:function(t){this.dirty=this.dirty||this._x1!==t,this._x1=t;}},{key:"y1",get:function(){return this._y1},set:function(t){this.dirty=this.dirty||this._y1!==t,this._y1=t;}},{key:"setP1",value:function(t,e){return this.x1=t,this.y1=e,this}},{key:"x2",get:function(){return this._x2},set:function(t){this.dirty=this.dirty||this._x2!==t,this._x2=t;}},{key:"y2",get:function(){return this._y2},set:function(t){this.dirty=this.dirty||this._y2!==t,this._y2=t;}},{key:"setP2",value:function(t,e){return this.dirty=this.dirty||this.x2!==t||this.y2!==e,this.x2=t,this.y2=e,this}},{key:"updateData",value:function(){return this.pathData.length=0,this.pathData.push(this.x0,this.y0),this.pathData.push(this.x1,this.y1),this.pathData.push(this.x2,this.y2),this.pathData.push(this.x0,this.y0),u(r(a.prototype),"updateData",this).call(this),this}},{key:"webglRender",value:function(t,e,i,n,s){if(this.isFilled){var r=Ni(this.fillColor,this.fillAlpha*i),a=this.x0-n,o=this.y0-s,h=this.x1-n,l=this.y1-s,u=this.x2-n,c=this.y2-s,d=e.getX(a,o),f=e.getY(a,o),v=e.getX(h,l),p=e.getY(h,l),y=e.getX(u,c),g=e.getY(u,c);t.batchTri(d,f,v,p,y,g,r,r,r);}this.isStroked&&ri(t,this,i,n,s);}},{key:"canvasRender",value:function(t,e,i){var n=this.x1-e,s=this.y1-i,r=this.x2-e,a=this.y2-i,o=this.x3-e,h=this.y3-i;t.beginPath(),t.moveTo(n,s),t.lineTo(r,a),t.lineTo(o,h),t.closePath(),this.isFilled&&(ai(t,this),t.fill()),this.isStroked&&(oi(t,this),t.stroke());}}]),a}(ii)},qi=Phaser.Utils.Objects.GetValue,Ji=Phaser.Utils.Objects.IsPlainObject,Zi=function(){for(var t=this.getShapes(),e=0,i=t.length;e=0;n--)(a=s[n])instanceof e&&(a.destroy(),Cn(s,n));else {n=0;for(var s,r=(s=t.postPipelines).length;nt.length)&&(e=t.length);for(var i=0,n=new Array(e);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;i0;){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;e0?-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.repeatCounter0&&(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;i0?f.pop().setTexture(v,_):s(p,v,_),c&&p.add.existing(L),d){var M=S+w*j-O*(j-1)+a*w,I=x+E*A-R*(A-1)+o*E;L.setOrigin(a,o).setPosition(M,I).setScale(k,b).setRotation(C),Me(L,S,x,C);}T.push(L);}return T}(t,e,i,n),a=0,o=r.length;at.length)&&(e=t.length);for(var i=0,n=new Array(e);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;i0;){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;e0?-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.repeatCounter0&&(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;i0?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 * @copyright 2018 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */Object.assign(xi.prototype,He,Ci);var wi=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"freeLine",value:function(t){if(t)return this.push(t),this}},{key:"freeLines",value:function(t){if(t)return this.pushMultiple(t),this}},{key:"getLine",value:function(t,e,i){var n=this.pop();return null===n&&(n={}),n.text=t,n.width=e,n.newLineMode=i,n}}]),i}(st),Si=Phaser.Utils.Objects.IsPlainObject,Pi=Phaser.Utils.Objects.GetValue,Ti=function(t,e){Si(t)?t=(e=t).key:void 0===e&&(e={key:t}),e.hasOwnProperty("key")||(e.key=t);var i=e.key,n=e.frame,s=e.width,r=e.height;if(void 0===s||void 0===r){var o=this.textureManager.getFrame(i,n),a=o?o.cutWidth:0,h=o?o.cutHeight:0;void 0===s&&void 0===r?(s=a,r=h):void 0===s?s=a*(r/h):void 0===r&&(r=h*(s/a));}this.images[t]={key:i,frame:n,width:s,height:r,y:Pi(e,"y",0),left:Pi(e,"left",0),right:Pi(e,"right",0),originX:Pi(e,"originX",0),originY:Pi(e,"originY",0)};},Oi=function(){function t(e){n(this,t),this.textureManager=e.sys.textures,this.images={};}return r(t,[{key:"destroy",value:function(){this.textureManager=void 0,this.images=void 0;}},{key:"add",value:function(t,e){if("string"==typeof t)Ti.call(this,t,e);else if(Array.isArray(t))for(var i=0,n=(s=t).length;i").concat(t,""):e.hasOwnProperty("_style")?"").concat(t,""):t}},{key:"destroy",value:function(){this.tags=void 0;}},{key:"isTextTag",value:function(t){var e=this.tags[t];return !!e&&null==e.img}}]),t}(),gn=function(t){for(var e,i,n,s={},r=0,o=(t=t.split(";")).length;r=1&&(n.color=a[0]),h>=2&&(n.thickness=parseInt(a[1].replace("px","")));break;case"shadow":a=n.split(" ");n={},(h=a.length)>=1&&(n.color=a[0]),h>=2&&(n.offsetX=parseInt(a[1].replace("px",""))),h>=3&&(n.offsetY=parseInt(a[2].replace("px",""))),h>=4&&(n.blur=parseInt(a[3].replace("px","")));break;case"u":case"underline":case"s":case"strikethrough":var h;a=n.split(" ");n={},(h=a.length)>=1&&(n.color=a[0]),h>=2&&(n.thickness=parseInt(a[1].replace("px",""))),h>=3&&(n.offset=parseInt(a[2].replace("px",""))),"underline"===i?i="u":"strikethrough"===i&&(i="s");break;case"y":n=parseFloat(n);}s[i]=n;}return s},yn=function(t){return 0===(t=t.replace(wn,"")).length},kn=/<\s*class=["|']([^"|']+)["|']\s*\>([\s\S]*?)<\s*\/class\s*\>|<\s*style=["|']([^"|']+)["|']\s*\>([\s\S]*?)<\s*\/style\s*\>/g,mn=/<\s*class=/i,bn=/<\s*class=["|']([^"|']+)["|']\s*\>([\s\S]*?)<\s*\/class\s*\>/,xn=/<\s*style=/i,Cn=/<\s*style=["|']([^"|']+)["|']\s*\>([\s\S]*?)<\s*\/style\s*\>/,wn=/^\s+|\s+$/,Sn=Phaser.Utils.Objects.GetValue,Pn=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a){n(this,i);var h=Sn(a,"tags",void 0),l=new vn(h);return e.call(this,t,s,r,o,a,"rexTagText",l)}return r(i,[{key:"addTag",value:function(t,e){return this.parser.addTag(t,e),this.updateText(!0)}},{key:"addTags",value:function(t){for(var e in t)this.parser.addTag(e,t[e]);return this.updateText(!0)}},{key:"getTag",value:function(t){return this.parser.getTag(t)}},{key:"preDestroy",value:function(){p(h(i.prototype),"preDestroy",this).call(this),this.parser.destroy(),this.parser=void 0;}}]),i}(Wi);T.register("tagText",(function(t,e,i,n){var s=new Pn(this.scene,t,e,i,n);return this.scene.add.existing(s),s})),Z(window,"RexPlugins.UI.TagText",Pn);var Tn=Phaser.Utils.Objects.GetValue,On=function(t,e){return void 0===e?t:t[e]},Mn=function(t,e,n){void 0===t&&(t={}),void 0===e&&(e=0);var s=i(e);return "string"===s?t[e]=n:"number"===s?(t.left=e,t.right=e,t.top=e,t.bottom=e):(t.left=Tn(e,"left",0),t.right=Tn(e,"right",0),t.top=Tn(e,"top",0),t.bottom=Tn(e,"bottom",0)),t},En=function(){function t(e,i){n(this,t),this.setParent(e),this.type=i,this.renderable=!1,this.reset().setActive();}return r(t,[{key:"destroy",value:function(){this.parent.removeChild(this);}},{key:"setParent",value:function(t){return this.parent=t,this}},{key:"scene",get:function(){return this.parent.scene}},{key:"canvas",get:function(){return this.parent?this.parent.canvas:null}},{key:"context",get:function(){return this.parent?this.parent.context:null}},{key:"setDirty",value:function(t){return t&&this.parent&&(this.parent.dirty=!0),this}},{key:"active",get:function(){return this._active},set:function(t){this.setDirty(this._active!=t),this._active=t;}},{key:"setActive",value:function(t){return void 0===t&&(t=!0),this.active=t,this}},{key:"modifyPorperties",value:function(t){return this}},{key:"onFree",value:function(){this.reset().setParent();}},{key:"reset",value:function(){return this}},{key:"render",value:function(){}},{key:"contains",value:function(t,e){return !1}}]),t}();Object.assign(En.prototype,Ct);var _n,Rn,Ln,Bn,Dn,In={renderContent:function(){},render:function(){if(!this.willRender)return this;var t=this.context;if(t.save(),t.globalAlpha=this.alpha,this.toLocalPosition){var e=this.drawX,i=this.drawY;this.autoRound&&(e=Math.round(e),i=Math.round(i)),t.translate(e,i),t.scale(this.scaleX,this.scaleY),t.rotate(this.rotation);}return this.drawBelowCallback&&this.drawBelowCallback(this),this.renderContent(),this.drawAboveCallback&&this.drawAboveCallback(this),t.restore(),this}},jn=Phaser.Math.RotateAround,zn=Phaser.Geom.Rectangle,An=function(t){void 0===Rn&&(Rn=new zn);var e=t.drawTLX,i=t.drawTLY;return Rn.setTo(e,i,t.drawTRX-e,t.drawBLY-i),Rn},Fn=Phaser.Math.RotateAround,Wn=function(t,e,i,n){return void 0===n?n={}:!0===n&&(void 0===Ln&&(Ln={}),n=Ln),n.x=e,n.y=i,0!==t.rotation&&Fn(n,0,0,t.rotation),n.x=n.x*t.scaleX+t.drawX,n.y=n.y*t.scaleY+t.drawY,n},Yn=Phaser.GameObjects.Components.TransformMatrix,Vn={},Xn=function(t,e,i,n,s){var r=Wn(e,i,n,!0),o=function(t,e,i,n){void 0===n?n={}:!0===n&&(n=Vn);var s=e-t.width*t.originX,r=i-t.height*t.originY;return void 0===Bn&&(Bn=new Yn,Dn=new Yn),t.parentContainer?t.getWorldTransformMatrix(Bn,Dn):Bn.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),Bn.transformPoint(s,r,n),n}(t,r.x,r.y,s);return o},Gn=function(t,e,i,n,s){"number"!=typeof i&&(s=i,i=0,n=0);var r=e.drawCenterX+i,o=e.drawCenterY+n;return Xn(t,e,r,o,s)},Un={contains:function(t,e){if(0===this.width||0===this.height)return !1;var i=function(t,e,i,n){return void 0===n?n={}:!0===n&&(void 0===_n&&(_n={}),n=_n),n.x=(t-i.drawX)/i.scaleX,n.y=(e-i.drawY)/i.scaleY,0!==i.rotation&&jn(n,0,0,-i.rotation),n}(t,e,this,!0);return An(this).contains(i.x,i.y)},getWorldPosition:function(t,e,i){return Gn(this.parent,this,t,e,i)}};Object.assign(Un,In);var Hn=Phaser.Math.DegToRad,Nn=Phaser.Math.RadToDeg,Kn=Phaser.Utils.Objects.GetValue,Jn=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).renderable=!0,r.scrollFactorX=1,r.scrollFactorY=1,r.toLocalPosition=!0,r.originX=0,r.offsetX=0,r.offsetY=0,r}return r(i,[{key:"visible",get:function(){return this._visible},set:function(t){this.setDirty(this._visible!=t),this._visible=t;}},{key:"setVisible",value:function(t){return void 0===t&&(t=!0),this.visible=t,this}},{key:"alpha",get:function(){return this._alpha},set:function(t){this.setDirty(this._alpha!=t),this._alpha=t;}},{key:"setAlpha",value:function(t){return this.alpha=t,this}},{key:"x",get:function(){return this._x},set:function(t){this.setDirty(this._x!=t),this._x=t;}},{key:"setX",value:function(t){return this.x=t,this}},{key:"y",get:function(){return this._y},set:function(t){this.setDirty(this._y!=t),this._y=t;}},{key:"setY",value:function(t){return this.y=t,this}},{key:"setPosition",value:function(t,e){return this.x=t,this.y=e,this}},{key:"setInitialPosition",value:function(t,e){return this.x0=t,this.y0=e,this}},{key:"setScrollFactorX",value:function(t){return this.scrollFactorX=t,this}},{key:"setScrollFactorY",value:function(t){return this.scrollFactorY=t,this}},{key:"setScrollFactor",value:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}},{key:"rotation",get:function(){return this._rotation},set:function(t){this.setDirty(this._rotation!=t),this._rotation=t;}},{key:"setRotation",value:function(t){return this.rotation=t,this}},{key:"angle",get:function(){return Nn(this._rotation)},set:function(t){this.rotation=Hn(t);}},{key:"setAngle",value:function(t){return this.angle=t,this}},{key:"scaleX",get:function(){return this._scaleX},set:function(t){this.setDirty(this._scaleX!==t),this._scaleX=t;}},{key:"setScaleX",value:function(t){return this.scaleX=t,this}},{key:"width",get:function(){return 0},set:function(t){}},{key:"setWidth",value:function(t,e){return void 0===e&&(e=!1),this.width=t,e&&(this.scaleY=this.scaleX),this}},{key:"leftSpace",get:function(){return this._leftSpace},set:function(t){this.setDirty(this._leftSpace!==t),this._leftSpace=t;}},{key:"setLeftSpace",value:function(t){return this.leftSpace=t,this}},{key:"rightSpace",get:function(){return this._rightSpace},set:function(t){this.setDirty(this._rightSpace!==t),this._rightSpace=t;}},{key:"setRightSpace",value:function(t){return this.rightSpace=t,this}},{key:"outerWidth",get:function(){return this.width+this.leftSpace+this.rightSpace}},{key:"scaleY",get:function(){return this._scaleY},set:function(t){this.setDirty(this._scaleY!==t),this._scaleY=t;}},{key:"setScaleY",value:function(t){return this.scaleY=t,this}},{key:"height",get:function(){return 0},set:function(t){}},{key:"setHeight",value:function(t,e){return void 0===e&&(e=!1),this.height=t,e&&(this.scaleX=this.scaleY),this}},{key:"setScale",value:function(t,e){return void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this}},{key:"setOrigin",value:function(t){return this.originX=t,this}},{key:"setAlign",value:function(t){return this.align=t,this}},{key:"modifyPorperties",value:function(t){if(!t)return this;t.hasOwnProperty("x")&&this.setX(t.x),t.hasOwnProperty("y")&&this.setY(t.y),t.hasOwnProperty("rotation")?this.setRotation(t.rotation):t.hasOwnProperty("angle")&&this.setAngle(t.angle),t.hasOwnProperty("alpha")&&this.setAlpha(t.alpha);var e=Kn(t,"width",void 0),i=Kn(t,"height",void 0),n=Kn(t,"scaleX",void 0),s=Kn(t,"scaleY",void 0);return void 0!==e?void 0===i&&void 0===s?this.setWidth(e,!0):this.setWidth(e):void 0!==n&&this.setScaleX(n),void 0!==i?void 0===e&&void 0===n?this.setHeight(i,!0):this.setHeight(i):void 0!==s&&this.setScaleY(s),t.hasOwnProperty("leftSpace")&&this.setLeftSpace(t.leftSpace),t.hasOwnProperty("rightSpace")&&this.setRightSpace(t.rightSpace),t.hasOwnProperty("align")&&this.setAlign(t.align),this}},{key:"setDrawBelowCallback",value:function(t){return this.drawBelowCallback=t,this}},{key:"setDrawAboveCallback",value:function(t){return this.drawAboveCallback=t,this}},{key:"reset",value:function(){return this.setVisible().setAlpha(1).setPosition(0,0).setRotation(0).setScale(1,1).setLeftSpace(0).setRightSpace(0).setOrigin(0).setAlign().setDrawBelowCallback().setDrawAboveCallback(),this}},{key:"willRender",get:function(){return this.visible&&this.alpha>0}},{key:"drawX",get:function(){var t=this.x+this.leftSpace+this.offsetX-this.originX*this.width;return this.parent._textOX*this.scrollFactorX+t}},{key:"drawY",get:function(){var t=this.y+this.offsetY;return this.parent._textOY*this.scrollFactorY+t}},{key:"drawTLX",get:function(){return 0}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return 0}},{key:"drawBLY",get:function(){return 0}},{key:"drawTRX",get:function(){return 0}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return 0}},{key:"drawBRY",get:function(){return 0}},{key:"drawCenterX",get:function(){return (this.drawTRX+this.drawTLX)/2}},{key:"drawCenterY",get:function(){return (this.drawBLY+this.drawTLY)/2}}]),i}(En);Object.assign(Jn.prototype,Un);var Zn=function(t,e,i){return e.hasOwnProperty(t)?e[t]:i[t]},qn=Phaser.Utils.Objects.GetValue,$n=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,"background")).setScrollFactor(0),r.setColor(qn(s,"color",null),qn(s,"color2",null),qn(s,"horizontalGradient",!0)),r.setStroke(qn(s,"stroke",null),qn(s,"strokeThickness",2)),r.setCornerRadius(qn(s,"cornerRadius",0),qn(s,"cornerIteration",null)),r}return r(i,[{key:"color",get:function(){return this._color},set:function(t){t=ye(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=ye(t,this.canvas,this.context),this.setDirty(this._color2!=t),this._color2=t;}},{key:"horizontalGradient",get:function(){return this._horizontalGradient},set:function(t){this.setDirty(this._horizontalGradient!=t),this._horizontalGradient=t;}},{key:"setColor",value:function(t,e,i){return void 0===i&&(i=!0),this.color=t,this.color2=e,this.horizontalGradient=i,this}},{key:"stroke",get:function(){return this._stroke},set:function(t){t=ye(t,this.canvas,this.context),this.setDirty(this._stroke!=t),this._stroke=t;}},{key:"strokeThickness",get:function(){return this._strokeThickness},set:function(t){this.setDirty(this._strokeThickness!=t),this._strokeThickness=t;}},{key:"setStroke",value:function(t,e){return null!=t&&void 0===e&&(e=2),this.stroke=t,this.strokeThickness=e,this}},{key:"cornerRadius",get:function(){return this._cornerRadius},set:function(t){this.setDirty(this._cornerRadius!=t),this._cornerRadius=t;}},{key:"cornerIteration",get:function(){return this._cornerIteration},set:function(t){this.setDirty(this._cornerIteration!=t),this._cornerIteration=t;}},{key:"modifyStyle",value:function(t){return t.hasOwnProperty("color")&&this.setColor(t.color,Zn("color2",t,this),Zn("horizontalGradient",t,this)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,Zn("strokeThickness",t,this)),t.hasOwnProperty("cornerRadius")&&this.setCornerRadius(t.cornerRadius,Zn("cornerIteration",t,this)),this}},{key:"modifyPorperties",value:function(t){return p(h(i.prototype),"modifyPorperties",this).call(this,t),this.modifyStyle(t),this}},{key:"setCornerRadius",value:function(t,e){return this.cornerRadius=t,this.cornerIteration=e,this}},{key:"renderContent",value:function(){we(this.parent,this.color,this.stroke,this.strokeThickness,this.cornerRadius,this.color2,this.horizontalGradient,this.cornerIteration);}}]),i}(Jn),Qn=Phaser.Utils.Objects.GetValue,ts=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,"innerbounds")).setScrollFactor(0),r.setColor(Qn(s,"color",null),Qn(s,"color2",null),Qn(s,"horizontalGradient",!0)),r.setStroke(Qn(s,"stroke",null),Qn(s,"strokeThickness",2)),r}return r(i,[{key:"color",get:function(){return this._color},set:function(t){t=ye(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=ye(t,this.canvas,this.context),this.setDirty(this._color2!=t),this._color2=t;}},{key:"horizontalGradient",get:function(){return this._horizontalGradient},set:function(t){this.setDirty(this._horizontalGradient!=t),this._horizontalGradient=t;}},{key:"setColor",value:function(t,e,i){return void 0===i&&(i=!0),this.color=t,this.color2=e,this.horizontalGradient=i,this}},{key:"stroke",get:function(){return this._stroke},set:function(t){t=ye(t,this.canvas,this.context),this.setDirty(this._stroke!=t),this._stroke=t;}},{key:"strokeThickness",get:function(){return this._strokeThickness},set:function(t){this.setDirty(this._strokeThickness!=t),this._strokeThickness=t;}},{key:"setStroke",value:function(t,e){return null!=t&&void 0===e&&(e=2),this.stroke=t,this.strokeThickness=e,this}},{key:"modifyPorperties",value:function(t){p(h(i.prototype),"modifyPorperties",this).call(this,t),t.hasOwnProperty("color")&&this.setColor(t.color,Qn(t,"color2",null),Qn(t,"horizontalGradient",!0)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,Qn(t,"strokeThickness",2));}},{key:"renderContent",value:function(){var t=this.parent.padding,e=t.left,i=t.top,n=this.parent.width-t.left-t.right,s=this.parent.height-t.top-t.bottom,r=this.context;if(null!=this.color){var o,a;if(null!=this.color2)(a=this.horizontalGradient?r.createLinearGradient(0,0,n,0):r.createLinearGradient(0,0,0,s)).addColorStop(0,this.color),a.addColorStop(1,this.color2),o=a;else o=this.color;r.fillStyle=o,r.fillRect(e,i,n,s);}null!=this.stroke&&this.strokeThickness>0&&(r.strokeStyle=this.stroke,r.lineWidth=this.strokeThickness,r.strokeRect(e,i,n,s));}}]),i}(Jn),es=Phaser.Utils.Objects.GetValue,is=function(){function t(e,i){n(this,t),this.parent=e,this.set(i);}return r(t,[{key:"toJSON",value:function(){return {bold:this.bold,italic:this.italic,fontSize:this.fontSize,fontFamily:this.fontFamily,color:this.color,stroke:this.stroke,strokeThickness:this.strokeThickness,shaodwColor:this.shadowColor,shadowBlur:this.shadowBlur,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,offsetX:this.offsetX,offsetY:this.offsetY,leftSpace:this.leftSpace,rightSpace:this.rightSpace,backgroundHeight:this.backgroundHeight,backgroundBottomY:this.backgroundBottomY,align:this.align}}},{key:"set",value:function(t){return this.setBold(es(t,"bold",!1)),this.setItalic(es(t,"italic",!1)),this.setFontSize(es(t,"fontSize","16px")),this.setFontFamily(es(t,"fontFamily","Courier")),this.setColor(es(t,"color","#fff")),this.setStrokeStyle(es(t,"stroke",null),es(t,"strokeThickness",0)),this.setShadow(es(t,"shadowColor",null),es(t,"shadowOffsetX",0),es(t,"shadowOffsetY",0),es(t,"shadowBlur",0)),this.setOffset(es(t,"offsetX",0),es(t,"offsetY",0)),this.setSpace(es(t,"leftSpace",0),es(t,"rightSpace",0)),this.setAlign(es(t,"align",void 0)),this.setBackgroundColor(es(t,"backgroundColor",null)),this.setBackgroundHeight(es(t,"backgroundHeight",void 0)),this.setBackgroundBottomY(es(t,"backgroundBottomY",void 0)),this}},{key:"modify",value:function(t){return t.hasOwnProperty("bold")&&this.setBold(t.bold),t.hasOwnProperty("italic")&&this.setItalic(t.italic),t.hasOwnProperty("fontSize")&&this.setFontSize(t.fontSize),t.hasOwnProperty("fontFamily")&&this.setFontFamily(t.fontFamily),t.hasOwnProperty("color")&&this.setColor(t.color),(t.hasOwnProperty("stroke")||t.hasOwnProperty("strokeThickness"))&&this.setStrokeStyle(Zn("stroke",t,this),Zn("strokeThickness",t,this)),t.hasOwnProperty("shadowColor")&&this.setShadowColor(t.shadowColor),(t.hasOwnProperty("shadowOffsetX")||t.hasOwnProperty("shadowOffsetY"))&&this.setShadowOffset(Zn("shadowOffsetX",t,this),Zn("shadowOffsetY",t,this)),t.hasOwnProperty("shadowBlur")&&this.setShadowBlur(t.shaodwBlur),t.hasOwnProperty("offsetX")&&this.setOffsetX(t.offsetX),t.hasOwnProperty("offsetY")&&this.setOffsetY(t.offsetY),t.hasOwnProperty("leftSpace")&&this.setLeftSpace(t.leftSpace),t.hasOwnProperty("rightSpace")&&this.setRightSpace(t.rightSpace),t.hasOwnProperty("align")&&this.setAlign(t.align),t.hasOwnProperty("backgroundColor")&&this.setBackgroundColor(t.backgroundColor),t.hasOwnProperty("backgroundHeight")&&this.setBackgroundHeight(t.backgroundHeight),t.hasOwnProperty("backgroundBottomY")&&this.setBackgroundBottomY(t.backgroundBottomY),this}},{key:"setUpdateTextFlag",value:function(){return this.parent&&(this.parent.updateTextFlag=!0),this}},{key:"clone",value:function(){return new t(null,this.toJSON())}},{key:"copyFrom",value:function(t){return this.set(t.toJSON()),this}},{key:"copyTo",value:function(t){return t.set(this.toJSON()),this}},{key:"setBold",value:function(t){return void 0===t&&(t=!0),this.bold=t,this.setUpdateTextFlag(),this}},{key:"setItalic",value:function(t){return void 0===t&&(t=!0),this.italic=t,this.setUpdateTextFlag(),this}},{key:"fontStyle",get:function(){return this.bold&&this.italic?"bold italic":this.bold?"bold":this.italic?"italic":""}},{key:"setFontSize",value:function(t){return "number"==typeof t&&(t="".concat(t,"px")),this.fontSize=t,this.setUpdateTextFlag(),this}},{key:"setFontFamily",value:function(t){return this.fontFamily=t,this.setUpdateTextFlag(),this}},{key:"font",get:function(){return "".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily)}},{key:"setColor",value:function(t){return this.color=ye(t),this}},{key:"hasFill",get:function(){return null!=this.color}},{key:"setStrokeStyle",value:function(t,e){return this.stroke=ye(t),void 0!==e&&(this.strokeThickness=e),this}},{key:"setStrokeThickness",value:function(t){return this.strokeThickness=t,this}},{key:"hasStroke",get:function(){return null!=this.stroke&&this.strokeThickness>0}},{key:"setShadowColor",value:function(t){return this.shadowColor=ye(t),this}},{key:"setShadowOffset",value:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.shadowOffsetX=t,this.shadowOffsetY=e,this}},{key:"setShadowBlur",value:function(t){return void 0===t&&(t=0),this.shaodwBlur=t,this}},{key:"setShadow",value:function(t,e,i,n){return this.setShadowColor(t).setShadowOffset(e,i).setShadowBlur(n),this}},{key:"setBackgroundColor",value:function(t){return this.backgroundColor=ye(t),this}},{key:"hasBackgroundColor",get:function(){return null!=this.backgroundColor}},{key:"setBackgroundHeight",value:function(t){return this.backgroundHeight=t,this}},{key:"setBackgroundBottomY",value:function(t){return this.backgroundBottomY=t,this}},{key:"setOffsetX",value:function(t){return void 0===t&&(t=0),this.offsetX=t,this}},{key:"setOffsetY",value:function(t){return void 0===t&&(t=0),this.offsetY=t,this}},{key:"setOffset",value:function(t,e){return this.setOffsetX(t).setOffsetY(e),this}},{key:"setLeftSpace",value:function(t){return void 0===t&&(t=0),this.leftSpace=t,this}},{key:"setRightSpace",value:function(t){return void 0===t&&(t=0),this.rightSpace=t,this}},{key:"setSpace",value:function(t,e){return this.setLeftSpace(t).setRightSpace(e),this}},{key:"setAlign",value:function(t){return this.align=t,this}},{key:"syncFont",value:function(t){return t.font=this.font,this}},{key:"syncStyle",value:function(t){t.textBaseline="alphabetic";var e=this.hasFill,i=this.hasStroke;return t.fillStyle=e?this.color:"#000",t.strokeStyle=i?this.stroke:"#000",t.lineWidth=i?this.strokeThickness:0,t.lineCap="round",t.lineJoin="round",this}},{key:"syncShadow",value:function(t){null!=t.shadowColor?(t.shadowColor=this.shadowColor,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowBlur=this.shadowBlur):(t.shadowColor=0,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0);}},{key:"getTextMetrics",value:function(t,e){return this.syncFont(t).syncStyle(t),t.measureText(e)}}]),t}(),ns=Phaser.Utils.Array.Remove,ss=Phaser.Utils.Array.Remove,rs="text",os="image",as="drawer",hs="space",ls="command",us=function(t){return t.type===rs&&"\n"===t.text},cs=function(t){return t.type===rs&&"\f"===t.text},ds=function(t){return t.type===rs},fs=function(t){return t.type===ls},ps=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;return n(this,i),(o=e.call(this,t,rs)).updateTextFlag=!1,o.style=new is(u(o),r),o.setText(s),o}return r(i,[{key:"autoRound",get:function(){return this.parent.autoRound}},{key:"offsetX",get:function(){return this.style.offsetX},set:function(t){this.style&&(this.style.offsetX=t);}},{key:"offsetY",get:function(){return this.style.offsetY},set:function(t){this.style&&(this.style.offsetY=t);}},{key:"leftSpace",get:function(){return this.style.leftSpace*this.scaleX},set:function(t){this.style&&(this.style.leftSpace=t),g(h(i.prototype),"leftSpace",t,this,!0);}},{key:"rightSpace",get:function(){return this.style.rightSpace*this.scaleX},set:function(t){this.style&&(this.style.rightSpace=t),g(h(i.prototype),"rightSpace",t,this,!0);}},{key:"align",get:function(){return this.style.align},set:function(t){this.style&&(this.style.align=t);}},{key:"modifyStyle",value:function(t){return this.setDirty(!0),this.style.modify(t),this.updateTextFlag&&this.updateTextSize(),this}},{key:"modifyPorperties",value:function(t){return t?(this.modifyStyle(t),p(h(i.prototype),"modifyPorperties",this).call(this,t),this):this}},{key:"setText",value:function(t){return this.setDirty(this.text!=t),this.text=t,this.updateTextSize(),this}},{key:"updateTextSize",value:function(){var t=this.text;if("\n"===t||"\f"===t||""===t)this.clearTextSize();else {var e,i,n=this.style.getTextMetrics(this.context,this.text);this.textWidth=n.width,"actualBoundingBoxAscent"in n?(e=n.actualBoundingBoxAscent,i=n.actualBoundingBoxDescent):(e=0,i=0),this.textHeight=e+i,this.ascent=e,this.descent=i;}return this.updateTextFlag=!1,this}},{key:"clearTextSize",value:function(){return this.textWidth=0,this.textHeight=0,this.ascent=0,this.descent=0,this}},{key:"copyTextSize",value:function(t){return this.textWidth=t.textWidth,this.textHeight=t.textHeight,this.ascent=t.ascent,this.descent=t.descent,this}},{key:"width",get:function(){return this.textWidth*this.scaleX},set:function(t){this.textWidth>0?this.scaleX=t/this.textWidth:this.scaleX=1;}},{key:"height",get:function(){return this.textHeight*this.scaleY},set:function(t){this.textHeight>0?this.scaleY=t/this.textHeight:this.scaleY=1;}},{key:"willRender",get:function(){return 0!==this.textWidth&&p(h(i.prototype),"willRender",this)}},{key:"renderContent",value:function(){var t=this.context,e=this.style;if(e.hasBackgroundColor){t.fillStyle=e.backgroundColor;var i=this.drawTLX,n=this.drawTRX-i,s=e.backgroundBottomY;null==s&&(s=this.drawBLY);var r=e.backgroundHeight;null==r&&(r=s-this.drawTLY);var o=s-r;t.fillRect(i,o,n,r);}var a=e.hasFill,h=e.hasStroke;(a||h)&&(e.syncFont(t).syncStyle(t),h&&(e.syncShadow(t),t.strokeText(this.text,0,0)),a&&(e.syncShadow(t),t.fillText(this.text,0,0)));}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return -this.ascent}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.descent}},{key:"drawTRX",get:function(){return this.textWidth+this.rightSpace}},{key:"drawTRY",get:function(){return -this.ascent}},{key:"drawBRX",get:function(){return this.textWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.descent}}]),i}(Jn),vs=function(t,e){var i=this.createCharChildren(t,e);return this.addChild(i),this},gs=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;return n(this,i),(o=e.call(this,t,os)).setTexture(s,r),o}return r(i,[{key:"frameWidth",get:function(){return this.frameObj?this.frameObj.cutWidth:0}},{key:"frameHeight",get:function(){return this.frameObj?this.frameObj.cutHeight:0}},{key:"offsetY",get:function(){return -this.height},set:function(t){}},{key:"key",get:function(){return this._key},set:function(t){this.setDirty(this._key!=t),this._key=t;}},{key:"frame",get:function(){return this._frame},set:function(t){this.setDirty(this._frame!=t),this._frame=t;}},{key:"setTexture",value:function(t,e){return this.key=t,this.frame=e,this.frameObj=this.scene.sys.textures.getFrame(t,e),this}},{key:"width",get:function(){return this.frameWidth*this.scaleX},set:function(t){this.setDirty(this.width!==t),this.scaleX=t/this.frameWidth;}},{key:"height",get:function(){return this.frameHeight*this.scaleY},set:function(t){this.setDirty(this.height!==t),this.scaleY=t/this.frameHeight;}},{key:"setHeight",value:function(t,e){return void 0===e&&(e=!1),this.height=t,e&&(this.scaleX=this.scaleY),this}},{key:"renderContent",value:function(){var t=this.context,e=this.frameObj,i=this.frameWidth,n=this.frameHeight;t.drawImage(e.source.image,e.cutX,e.cutY,i,n,0,0,i,n);}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.frameHeight}},{key:"drawTRX",get:function(){return this.frameWidth+this.rightSpace}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return this.frameWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.frameHeight}}]),i}(Jn),ys=function(t,e,i){var n=this.createImageChild(t,e,i);return this.addChild(n),this},ks=function(t){a(i,t);var e=d(i);function i(t,s,r,o){var a;return n(this,i),(a=e.call(this,t,as)).setRenderCallback(s),a.setDrawerSize(r,o),a}return r(i,[{key:"setRenderCallback",value:function(t){return t?this.renderContent=t.bind(this):delete this.renderContent,this}},{key:"setDrawerSize",value:function(t,e){return !0===t?(this.toLocalPosition=!1,t=void 0,e=void 0):this.toLocalPosition=!0,void 0===t&&(t=0),void 0===e&&(e=t),this.drawerWidth=t,this.drawerHeight=e,this}},{key:"onFree",value:function(){p(h(i.prototype),"onFree",this).call(this),this.setRenderCallback();}},{key:"width",get:function(){return this.drawerWidth*this.scaleX},set:function(t){this.setDirty(this.width!==t),this.scaleX=this.drawerWidth>0?t/this.drawerWidth:1;}},{key:"height",get:function(){return this.drawerHeight*this.scaleY},set:function(t){this.setDirty(this.height!==t),this.scaleY=this.drawerHeight>0?t/this.drawerHeight:1;}},{key:"offsetY",get:function(){return -this.height},set:function(t){}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.drawerHeight}},{key:"drawTRX",get:function(){return this.drawerWidth+this.rightSpace}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return this.drawerWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.drawerHeight}}]),i}(Jn),ms=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,hs)).setSpaceWidth(s),r}return r(i,[{key:"width",get:function(){return this.spaceWidth*this.scaleX},set:function(t){this.spaceWidth>0?this.scaleX=t/this.spaceWidth:this.scaleX=1;}},{key:"setSpaceWidth",value:function(t){return this.spaceWidth=t,this}}]),i}(Jn),bs=function(t){var e=this.createSpaceChild(t);return this.addChild(e),this},xs=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a){var h;return n(this,i),(h=e.call(this,t,ls)).setName(s).setParameter(o).setCallback(r,a),h}return r(i,[{key:"setName",value:function(t){return this.name=t,this}},{key:"setParameter",value:function(t){return this.param=t,this}},{key:"setCallback",value:function(t,e){return this.callback=t,this.scope=e,this}},{key:"exec",value:function(){return this.scope?this.callback.call(this.scope,this.param,this.name):this.callback(this.param,this.name)}},{key:"onFree",value:function(){p(h(i.prototype),"onFree",this).call(this),this.setName().setCallback().setParameter();}}]),i}(En),Cs=function(t,e,i,n){var s=this.createCommandChild(t,e,i,n);return this.addChild(s),this},ws=function(t){var e={callback:void 0,start:0,isLastPage:!1,maxLines:void 0,padding:void 0,letterSpacing:void 0,hAlign:void 0,vAlign:void 0,children:[],lines:[],maxLineWidth:0,linesHeight:0,lineHeight:void 0,maxLineHeight:0,linesWidth:0,lineWidth:void 0};return Object.assign(e,t)},Ss=function(t,e,i,n){void 0===n&&(n={word:[],width:0}),n.word.length=0;for(var s=t.length,r=e,o=n.word,a=0;r0&&!a){var h=this.fixedHeight-n;if(i>0)r=h/i;else r=(l=Os.call(this)).height,o=l.ascent,i=Math.floor((h-o)/r);}else {var l;r=(l=Os.call(this)).height,o=l.ascent;}}else if(this.fixedHeight>0){if(void 0===(i=Es(t,"maxLines"))){h=this.fixedHeight-n;i=Math.floor(h/r);}}else i=Es(t,"maxLines",0);void 0===o&&(o=r);var u=0===i,c=Es(t,"wrapWidth",void 0);void 0===c&&(c=this.fixedWidth>0?this.fixedWidth-s:1/0);for(var d=Es(t,"letterSpacing",0),f=Es(t,"hAlign",0),p=Es(t,"vAlign",0),v=Es(t,"charWrap",!1),g=ws({callback:"runWordWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:f,vAlign:p,ascent:o,lineHeight:r,wrapWidth:c,charWrap:v}),y=this.children,k=0,m=y.length;k0&&(M.push({children:E,width:_}),R=Math.max(R,_)),g.start+=O.length,g.isLastPage=!L&&g.start===T,g.maxLineWidth=R,g.linesHeight=M.length*r;var F=this.fixedWidth>0?this.fixedWidth:g.maxLineWidth+s,W=this.fixedHeight>0?this.fixedHeight:g.linesHeight+n;!function(t,e,i){var n,s,r=t.hAlign,o=t.vAlign,a=t.linesHeight;switch(o){case 1:case"center":s=(i-a)/2;break;case 2:case"bottom":s=i-a;break;default:s=0;}for(var h=t.lines,l=0,u=h.length;l0?(o=this.fixedWidth-s)/i:0;else if(this.fixedWidth>0){if(void 0===(i=Ls(t,"maxLines",void 0))){var o=this.fixedWidth-s;i=Math.floor(o/r)+1;}}else i=Ls(t,"maxLines",0);var a=0===i,h=Ls(t,"fixedCharacterHeight",void 0);if(void 0===h){var l=Ls(t,"charPerLine",void 0);if(void 0!==l){var u=this.fixedHeight-n;h=Math.floor(u/l);}}var c=Ls(t,"wrapHeight",void 0);void 0===c&&(c=this.fixedHeight>0?this.fixedHeight-n:1/0);for(var d=Ls(t,"letterSpacing",0),f=Ls(t,"rtl",!0),p=Ls(t,"hAlign",f?2:0),v=Ls(t,"vAlign",0),g=ws({callback:"runVerticalWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:p,vAlign:v,lineWidth:r,fixedCharacterHeight:h,wrapHeight:c,rtl:f}),y=this.children,k=0,m=y.length;k0&&(M.push({children:E,height:_}),R=Math.max(R,_)),g.start+=O.length,g.isLastPage=g.start===T,g.maxLineHeight=R,g.linesWidth=M.length*r;var z=this.fixedWidth>0?this.fixedWidth:g.linesWidth+s,A=this.fixedHeight>0?this.fixedHeight:g.maxLineHeight+n;!function(t,e,i){var n,s,r=t.hAlign,o=t.vAlign,a=t.rtl,h=t.lines,l=t.lineWidth,u=t.linesWidth;switch(r){case 1:case"center":n=(e-u)/2;break;case 2:case"right":n=e-u;break;default:n=0;}a&&(n+=l);for(var c=0,d=h.length;c0?t:this.width,e>0?e:this.height)),this},setPadding:function(t,e){var i=this.padding,n=i.left,s=i.right,r=i.top,o=i.bottom;return Mn(i,t,e),this.dirty=this.dirty||n!=i.left||s!=i.right||r!=i.top||o!=i.bottom,this},getPadding:function(t){return On(this.padding,t)},modifyTextStyle:function(t){return this.textStyle.modify(t),this},modifyDefaultTextStyle:function(t){return this.defaultTextStyle.modify(t),this},resetTextStyle:function(){return this.textStyle.copyFrom(this.defaultTextStyle),this},setTestString:function(t){return this.testString=t,this},removeChild:function(t){return this.poolManager.free(t),ns(this.children,t),this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},removeChildren:function(){return this.poolManager.freeMultiple(this.children),this.children.length=0,this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},popChild:function(t){return ss(this.children,t),this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},clearContent:function(){return this.setText(),this},addChild:function(t,e){var i,n,s,r=Array.isArray(t);void 0===e||e===this.children.length?r?(i=this.children).push.apply(i,m(t)):this.children.push(t):r?(n=this.children).splice.apply(n,[e,0].concat(m(t))):this.children.splice(e,0,t);(this.lastAppendedChildren.length=0,r)?(s=this.lastAppendedChildren).push.apply(s,m(t)):this.lastAppendedChildren.push(t);return this},createCharChild:function(t,e){e&&this.textStyle.modify(e);var i=this.poolManager.allocate(rs);return null===i?i=new ps(this,t,this.textStyle):i.setParent(this).setActive().modifyStyle(this.textStyle).setText(t),i},createCharChildren:function(t,e){e&&this.textStyle.modify(e);for(var i=[],n=0,s=t.length;ne&&(n=e,s=t);})),s},getCharWorldPosition:function(t,e,i,n){return "number"==typeof t&&(t=this.getCharChild(t,!0)),Gn(this,t,e,i,n)},setToMinSize:function(){for(var t=this.children,e=0,i=0,n=0,s=t.length;n=i.length&&(t=i.length);for(var n=0,s=0;s1?i-1:0),s=1;s0&&void 0!==t.setTint},useAlphaFadeEffect:function(t){return (void 0===this.fadeMode||1===this.fadeMode)&&this.fadeTime>0&&void 0!==t.setAlpha},useRevealEffect:function(t){return this.fadeMode>=2&&this.fadeMode<=5&&this.fadeTime>0&&(t.preFX||t.postFX)},fadeBob:function(t,e,i,n){var s=t.gameObject;if(this.useTintFadeEffect(s))void 0!==e&&t.setProperty("tintGray",255*e),t.easeProperty("tintGray",Math.floor(255*i),this.fadeTime,"Linear",0,!1,n);else if(this.useAlphaFadeEffect(s))void 0!==e&&t.setProperty("alpha",e),t.easeProperty("alpha",i,this.fadeTime,"Linear",0,!1,n);else if(this.useRevealEffect(s)){var r;switch(pr(s,"reveal"),this.fadeMode){case 2:r="revealUp";break;case 3:r="revealDown";break;case 4:r="revealLeft";break;case 5:r="revealRight";}void 0===e&&(e=0),s[r]=e,t.easeProperty(r,i,this.fadeTime,"Linear",0,!1,n),t.getTweenTask(r).once("complete",(function(){s[r]=null;}));}else n&&n(s);return this}},yr=function(t){return t>>16&255},kr=function(t){return t>>8&255},mr=function(t){return 255&t},br=Phaser.Events.EventEmitter,xr=function(t,e,i,n,s,r){return void 0===r?r={}:!0===r&&(r=Cr),"number"!=typeof i&&(i=0,n=0),r.x=s.x+s.width*t+i,r.y=s.y+s.height*e+n,r},Cr={},wr=function(t,e,i,n,s,r,o){if(t.hasOwnProperty("vp"))return t;"function"==typeof i&&(o=i,i=void 0),"function"==typeof s&&(o=s,s=void 0),void 0===i&&(i=.5),void 0===n&&(n=.5),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=xr),function(t){if(t.events)return t;var e=new br,i=t.x;Object.defineProperty(t,"x",{get:function(){return i},set:function(n){i!==n&&(i=n,e.emit("update",t));}});var n=t.y;Object.defineProperty(t,"y",{get:function(){return n},set:function(i){n!==i&&(n=i,e.emit("update",t));}});var s=t.width;Object.defineProperty(t,"width",{get:function(){return s},set:function(i){s!==i&&(s=i,e.emit("update",t));}});var r=t.height;Object.defineProperty(t,"height",{get:function(){return r},set:function(i){r!==i&&(r=i,e.emit("update",t));}}),t.events=e;}(e);var a=e.events;t.vp=e;var h=function(){o(i,n,s,r,e,t);};a.on("update",h),t.once("destroy",(function(){a.off("update",h),t.vp=void 0;})),Object.defineProperty(t,"vpx",{get:function(){return i},set:function(t){i!==t&&(i=t,h());}}),Object.defineProperty(t,"vpy",{get:function(){return n},set:function(t){n!==t&&(n=t,h());}}),Object.defineProperty(t,"vpxOffset",{get:function(){return s},set:function(t){s!==t&&(s=t,h());}}),Object.defineProperty(t,"vpyOffset",{get:function(){return r},set:function(t){r!==t&&(r=t,h());}}),h();},Sr=Phaser.Utils.Array.Remove,Pr={has:function(t){return this.bobs.hasOwnProperty(t)},exists:function(t){return this.bobs.hasOwnProperty(t)},get:function(t){return this.bobs[t]},getGO:function(t){var e=this.get(t);return e?e.gameObject:null},addGO:function(t,e){this.remove(t,!0),this.useTintFadeEffect(e)&&function(t,e){if(t.hasOwnProperty("tintR"))return t;void 0===e&&(e=16777215);var i=yr(e),n=kr(e),s=mr(e);Object.defineProperty(t,"tint",{get:function(){return e},set:function(r){r=16777215&Math.floor(r),t.setTint&&t.setTint(r),e!==r&&(i=yr(e=r),n=kr(e),s=mr(e));}}),Object.defineProperty(t,"tintR",{get:function(){return i},set:function(n){n=255&Math.floor(n),i!==n&&(i=n,t.tint=(255&n)<<16|65535&e);}}),Object.defineProperty(t,"tintG",{get:function(){return n},set:function(i){i=255&Math.floor(i),n!==i&&(n=i,t.tint=(255&i)<<8|16711935&e);}}),Object.defineProperty(t,"tintB",{get:function(){return s},set:function(i){i=255&Math.floor(i),s!==i&&(s=i,t.tint=255&i|16776960&e);}}),Object.defineProperty(t,"tintGray",{get:function(){return Math.floor((i+n+s)/3)},set:function(e){e=255&Math.floor(e),i===e&&n===e&&s===e||(i=e,n=e,s=e,t.tint=(255&e)<<16|(255&e)<<8|255&e);}}),t.tint=e;}(e),this.viewportCoordinateEnable&&wr(e,this.viewport),this.effectPropertiesConfig&&pr(e,this.effectPropertiesConfig),e.once("destroy",(function(){Sr(this.removedGOs,e),this.isEmpty&&this.emit("empty");}),this);var i=new this.BobClass(this,e,t);return this.bobs[t]=i,this},add:function(t){for(var e=this.createGameObjectCallback,i=this.createGameObjectScope,n=arguments.length,s=new Array(n>1?n-1:0),r=1;r2?n-2:0),r=2;r0?-this.delay:0,this.state=this.nowTime>=0?mo:ko,this.repeatCounter=0,this}},{key:"stop",value:function(){return this.state=yo,this}},{key:"update",value:function(t,e){this.state!==yo&&this.state!==xo&&0!==e&&0!==this.timeScale&&(this.nowTime+=e*this.timeScale,this.justRestart=!1,this.nowTime>=this.duration?-1===this.repeat||this.repeatCounter0&&(this.nowTime-=this.repeatDelay,this.state=bo)):(this.nowTime=this.duration,this.state=xo):this.nowTime>=0&&(this.state=mo));}},{key:"t",get:function(){var t;switch(this.state){case yo:case ko:case bo:t=0;break;case mo:t=this.nowTime/this.duration;break;case xo:t=1;}return vo(t,0,1)},set:function(t){(t=vo(t,-1,1))<0?(this.state=ko,this.nowTime=-this.delay*t):(this.state=mo,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===yo}},{key:"isDelay",get:function(){return this.state===ko}},{key:"isCountDown",get:function(){return this.state===mo}},{key:"isRunning",get:function(){return this.state===ko||this.state===mo}},{key:"isDone",get:function(){return this.state===xo}},{key:"isOddIteration",get:function(){return 1==(1&this.repeatCounter)}},{key:"isEvenIteration",get:function(){return 0==(1&this.repeatCounter)}}]),t}(),yo=0,ko=1,mo=2,bo=3,xo=-1,Co=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).timer=new go,r}return r(i,[{key:"shutdown",value:function(t){this.isShutdown||(p(h(i.prototype),"shutdown",this).call(this,t),this.timer.destroy(),this.timer=void 0);}},{key:"start",value:function(){return this.timer.start(),p(h(i.prototype),"start",this).call(this),this}},{key:"stop",value:function(){return this.timer.stop(),p(h(i.prototype),"stop",this).call(this),this}},{key:"complete",value:function(){return this.timer.stop(),p(h(i.prototype),"complete",this).call(this),this}}]),i}(co),wo=Phaser.Utils.Objects.GetValue,So=Phaser.Utils.Objects.GetAdvancedValue,Po=Phaser.Tweens.Builders.GetEaseFunction,To=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"resetFromJSON",value:function(t){return this.timer.resetFromJSON(wo(t,"timer")),this.setEnable(wo(t,"enable",!0)),this.setTarget(wo(t,"target",this.parent)),this.setDelay(So(t,"delay",0)),this.setDuration(So(t,"duration",1e3)),this.setEase(wo(t,"ease","Linear")),this.setRepeat(wo(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=Po(t),this}},{key:"start",value:function(){return this.timer.isRunning||p(h(i.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),p(h(i.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){}}]),i}(Co),Oo=Phaser.Sound.BaseSound,Mo=function(t){return t instanceof Oo},Eo=Phaser.Utils.Objects.GetValue,_o=Phaser.Utils.Objects.GetAdvancedValue,Ro=Phaser.Math.Linear,Lo=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;return n(this,i),Mo(t)&&(r=s,s=t,t=void 0),s.active=!0,s.scene=t,s.game=s.manager.game,(o=e.call(this,s,r)).volume={},o.resetFromJSON(r),o}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setMode(Eo(t,"mode",0)),this.setEnable(Eo(t,"enable",!0)),this.setVolumeRange(_o(t,"volume.start",this.parent.volume),_o(t,"volume.end",0)),this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=Bo[t]),this.mode=t,this}},{key:"setVolumeRange",value:function(t,e){return this.volume.start=t,this.volume.end=e,this}},{key:"start",value:function(){return this.timer.isRunning||(this.parent.setVolume(this.volume.start),this.timer.setDelay(this.delay).setDuration(this.duration),p(h(i.prototype),"start",this).call(this)),this}},{key:"updateGameObject",value:function(t,e){t.volume=Ro(this.volume.start,this.volume.end,e.t);}},{key:"complete",value:function(){switch(p(h(i.prototype),"complete",this).call(this),this.mode){case 1:this.parent.stop();break;case 2:this.parent.destroy();}return this}}]),i}(To),Bo={stop:1,destroy:2},Do=function(t,e,i,n,s){Mo(t)&&(s=n,n=i,i=e,e=t,t=void 0),void 0===n&&(n=1),void 0===s&&(s=0);var r,o={mode:0,volume:{start:s,end:n},duration:i};return "string"==typeof e&&(e=t.sys.sound.add(e)),e.hasOwnProperty("_fade")?(r=e._fade).stop().resetFromJSON(o):(r=new Lo(t,e,o),e._fade=r),r.start(),e.isPlaying||e.setVolume(s).play(),e},Io=function(t,e,i,n){Mo(t)&&(n=i,i=e,e=t,t=void 0),void 0===n&&(n=!0);var s,r={mode:n?2:1,volume:{start:e.volume,end:0},duration:i};return e.hasOwnProperty("_fade")?(s=e._fade).stop().resetFromJSON(r):(s=new Lo(t,e,r),e._fade=s),s.start(),e.isPlaying||e.play(),e},jo=Phaser.Utils.Objects.GetValue,zo={setBackgroundMusicLoop:function(t){return void 0===t&&(t=!0),this.backgroundMusicLoop=t,this},setBackgroundMusicFadeTime:function(t){return this.backgroundMusicFadeTime=t,this},getBackgroundMusic:function(){return this.backgroundMusic},setCurrentBackgroundMusic:function(t){return this.backgroundMusic=t,t&&(t.once("complete",(function(){this.backgroundMusic===t&&(this.backgroundMusic.destroy(),this.backgroundMusic=void 0);}),this).once("destroy",(function(){this.backgroundMusic===t&&(this.backgroundMusic=void 0);}),this),t.isPlaying||t.play()),this},playBackgroundMusic:function(t,e){if(this.backgroundMusic&&this.backgroundMusic.key===t)return this;this.stopBackgroundMusic();var i=this.sound.add(t,{loop:jo(e,"loop",this.backgroundMusicLoop),mute:jo(e,"mute",this.backgroundMusicMute),volume:jo(e,"volume",this.backgroundMusicVolume),detune:jo(e,"detune",0),rate:jo(e,"rate",1)});return this.setCurrentBackgroundMusic(i),this.backgroundMusicFadeTime>0&&this.fadeInBackgroundMusic(this.backgroundMusicFadeTime),this},pauseBackgroundMusic:function(){return this.backgroundMusic&&this.backgroundMusic.pause(),this},resumeBackgroundMusic:function(){return this.backgroundMusic&&this.backgroundMusic.resume(),this},stopBackgroundMusic:function(){return this.backgroundMusic&&(this.backgroundMusicFadeTime>0?this.fadeOutBackgroundMusic(this.backgroundMusicFadeTime,!0):(this.backgroundMusic.stop(),this.backgroundMusic.destroy(),this.backgroundMusic=void 0)),this},fadeInBackgroundMusic:function(t){return this.backgroundMusic&&Do(this.backgroundMusic,t,this.backgroundMusicVolume,0),this},fadeOutBackgroundMusic:function(t,e){return this.backgroundMusic&&Io(this.backgroundMusic,t,e),this},crossFadeBackgroundMusic:function(t,e){var i=this.backgroundMusicFadeTime;return this.backgroundMusicFadeTime=0,this.fadeOutBackgroundMusic(e,!0).playBackgroundMusic(t).fadeInBackgroundMusic(e),this.backgroundMusicFadeTime=i,this},setBackgroundMusicMute:function(t){return void 0===t&&(t=!0),this.backgroundMusicMute=t,this},setBackgroundMusicVolume:function(t){return this.backgroundMusicVolume=t,this},setBackgroundMusicRate:function(t){return this.backgroundMusic&&this.backgroundMusic.setRate(t),this},setBackgroundMusicDetune:function(t){return this.backgroundMusic&&this.backgroundMusic.setDetune(t),this}},Ao=Phaser.Utils.Objects.GetValue,Fo={setBackgroundMusic2Loop:function(t){return void 0===t&&(t=!0),this.backgroundMusic2Loop=t,this},setBackgroundMusic2FadeTime:function(t){return this.backgroundMusic2FadeTime=t,this},getBackgroundMusic2:function(){return this.backgroundMusic2},setCurrentBackgroundMusic2:function(t){return this.backgroundMusic2=t,t&&(t.once("complete",(function(){this.backgroundMusic2===t&&(this.backgroundMusic2.destroy(),this.backgroundMusic2=void 0);}),this).once("destroy",(function(){this.backgroundMusic2===t&&(this.backgroundMusic2=void 0);}),this),t.isPlaying||t.play()),this},playBackgroundMusic2:function(t,e){if(this.backgroundMusic2&&this.backgroundMusic2.key===t)return this;this.stopBackgroundMusic2();var i=this.sound.add(t,{loop:Ao(e,"loop",this.backgroundMusicLoop),mute:Ao(e,"mute",this.backgroundMusic2Mute),volume:Ao(e,"volume",this.backgroundMusic2Volume),detune:Ao(e,"detune",0),rate:Ao(e,"rate",1)});return this.setCurrentBackgroundMusic2(i),this.backgroundMusic2FadeTime>0&&this.fadeInBackgroundMusic2(this.backgroundMusic2FadeTime),this},pauseBackgroundMusic2:function(){return this.backgroundMusic2&&this.backgroundMusic2.pause(),this},resumeBackgroundMusic2:function(){return this.backgroundMusic2&&this.backgroundMusic2.resume(),this},stopBackgroundMusic2:function(){return this.backgroundMusic2&&(this.backgroundMusic2FadeTime>0?this.fadeOutBackgroundMusic2(this.backgroundMusic2FadeTime,!0):(this.backgroundMusic2.stop(),this.backgroundMusic2.destroy(),this.backgroundMusic2=void 0)),this},fadeInBackgroundMusic2:function(t){return this.backgroundMusic2&&Do(this.backgroundMusic2,t,this.backgroundMusic2Volume,0),this},fadeOutBackgroundMusic2:function(t,e){return this.backgroundMusic2&&Io(this.backgroundMusic2,t,e),this},crossFadeBackgroundMusic2:function(t,e){var i=this.backgroundMusic2FadeTime;return this.backgroundMusic2FadeTime=0,this.fadeOutBackgroundMusic2(e,!0).playBackgroundMusic2(t).fadeInBackgroundMusic2(e),this.backgroundMusic2FadeTime=i,this},setBackgroundMusic2Mute:function(t){return void 0===t&&(t=!0),this.backgroundMusic2Mute=t,this},setBackgroundMusic2Volume:function(t){return this.backgroundMusic2Volume=t,this},setBackgroundMusic2Rate:function(t){return this.backgroundMusic2&&this.backgroundMusic2.setRate(t),this},setBackgroundMusic2Detune:function(t){return this.backgroundMusic2&&this.backgroundMusic2.setDetune(t),this}},Wo=Phaser.Utils.Array.Remove,Yo=Phaser.Utils.Objects.GetValue,Vo={getSoundEffects:function(){return this.soundEffects},getLastSoundEffect:function(){return this.soundEffects[this.soundEffects.length-1]},playSoundEffect:function(t,e){var i=this.sound.add(t,{mute:Yo(e,"mute",this.soundEffectsMute),volume:Yo(e,"volume",this.soundEffectsVolume),detune:Yo(e,"detune",0),rate:Yo(e,"rate",1)});return this.soundEffects.push(i),i.once("complete",(function(){i.destroy(),this.sound&&Wo(this.soundEffects,i);}),this).once("destroy",(function(){this.sound&&Wo(this.soundEffects,i);}),this).play(),this},stopAllSoundEffects:function(){for(var t=this.soundEffects.length-1;t>=0;t--){var e=this.soundEffects[t];e.stop(),e.destroy();}return this},fadeInSoundEffect:function(t){var e=this.getLastSoundEffect();return e&&Do(e,t,this.soundEffectsVolume,0),this},fadeOutSoundEffect:function(t,e){var i=this.getLastSoundEffect();return i&&Io(i,t,e),this},fadeOutAllSoundEffects:function(t,e){for(var i=this.soundEffects.length-1;i>=0;i--)Io(this.soundEffects[i],t,e);return this},setSoundEffectMute:function(t,e){if(void 0===t&&(t=!0),void 0===e&&(e=!1),e){var i=this.getLastSoundEffect();i&&i.setMute(t);}else this.soundEffectsMute=t;return this},setSoundEffectVolume:function(t,e){if(void 0===e&&(e=!1),e){var i=this.getLastSoundEffect();i&&i.setVolume(t);}else this.soundEffectsVolume=t;return this},setSoundEffectDetune:function(t,e){var i;void 0===e&&(e=!1);for(var n=0,s=(i=e?[this.getLastSoundEffect()]:this.soundEffects).length;n=0;t--){var e=this.soundEffects[t];e.stop(),e.destroy();}return this},fadeInSoundEffect2:function(t){var e=this.getLastSoundEffect2();return e&&Do(e,t,this.soundEffects2Volume,0),this},fadeOutSoundEffect2:function(t,e){var i=this.getLastSoundEffect2();return i&&Io(i,t,e),this},fadeOutAllSoundEffects2:function(t,e){for(var i=this.soundEffects2.length-1;i>=0;i--)Io(this.soundEffects2[i],t,e);return this},setSoundEffect2Mute:function(t,e){if(void 0===t&&(t=!0),void 0===e&&(e=!1),e){var i=this.getLastSoundEffect2();i&&i.setMute(t);}else this.soundEffects2Mute=t;return this},setSoundEffect2Volume:function(t,e){if(void 0===e&&(e=!1),e){var i=this.getLastSoundEffect2();i&&i.setVolume(t);}else this.soundEffects2Volume=t;return this},setSoundEffect2Detune:function(t,e){var i;void 0===e&&(e=!1);for(var n=0,s=(i=e?[this.getLastSoundEffect2()]:this.soundEffects2).length;n=0;t--)this.soundEffects[t].destroy();if(this.soundEffects.length=0,this.soundEffects2.length)for(t=this.soundEffects2.length-1;t>=0;t--)this.soundEffects2[t].destroy();return this.soundEffects2.length=0,this.sound=void 0,this}},{key:"backgroundMusicMute",get:function(){return this._backgroundMusicMute},set:function(t){this._backgroundMusicMute=t,this.backgroundMusic&&this.backgroundMusic.setMute(mute);}},{key:"backgroundMusicVolume",get:function(){return this._backgroundMusicVolume},set:function(t){this._backgroundMusicVolume=t,this.backgroundMusic&&this.backgroundMusic.setVolume(t);}},{key:"backgroundMusic2Mute",get:function(){return this._backgroundMusic2Mute},set:function(t){this._backgroundMusic2Mute=t,this.backgroundMusic2&&this.backgroundMusic2.setMute(mute);}},{key:"backgroundMusic2Volume",get:function(){return this._backgroundMusic2Volume},set:function(t){this._backgroundMusic2Volume=t,this.backgroundMusic2&&this.backgroundMusic2.setVolume(t);}},{key:"soundEffectsMute",get:function(){return this._soundEffectsMute},set:function(t){this._soundEffectsMute=t;for(var e=this.soundEffects,i=0,n=e.length;i2?n-2:0),r=2;r3?s-3:0),o=3;o");this.setDelimiters(i[0],i[1]),this.setTranslateTagNameCallback(bt(e,"translateTagNameCallback")),this.isRunning=!1,this.isPaused=!1,this.skipEventFlag=!1,this.justCompleted=!1,this.lastTagStart=null,this.lastTagEnd=null,this.lastContent=null;}return r(t,[{key:"shutdown",value:function(){this.destroyEventEmitter();}},{key:"destroy",value:function(){this.shutdown();}},{key:"setMultipleLinesTagEnable",value:function(t){return void 0===t&&(t=!0),this.multipleLinesTagEnable=t,this}},{key:"setDelimiters",value:function(t,e){void 0===e&&(e=t[1],t=t[0]),this.delimiterLeft=t,this.delimiterRight=e,t=qi(this.delimiterLeft),e=qi(this.delimiterRight);var i=this.multipleLinesTagEnable?"gs":"gi";return this.reSplit=RegExp("".concat(t,"(.+?)").concat(e),i),this}},{key:"setTranslateTagNameCallback",value:function(t){return this.translateTagNameCallback=t,this}},{key:"setValueConverter",value:function(t){return !0===t?t=ya:t||(t=ma),this.valueConverter=t,this}},{key:"setLoopEnable",value:function(t){return void 0===t&&(t=!0),this.loopEnable=t,this}},{key:"setSource",value:function(t){return this.source=t,this}},{key:"resetIndex",value:function(t){return void 0===t&&(t=0),this.progressIndex=t,this.reSplit.lastIndex=t,this.lastTagStart=null,this.lastTagEnd=null,this.lastContent=null,this.justCompleted=!1,this.isRunning=!1,this}},{key:"start",value:function(t){return this.setSource(t).restart(),this}},{key:"restart",value:function(){this.resetIndex().next();}},{key:"next",value:function(){if(this.isPaused&&this.onResume(),this.isRunning)return this;if(this.isRunning=!0,this.justCompleted)return this.isRunning=!1,this;0===this.reSplit.lastIndex&&this.onStart();var t=this.source,e=t.length;for(this.reSplit.lastIndex=this.progressIndex;;){var i=this.reSplit.exec(t);if(!i){if(this.progressIndex");return s.setDelimiters(r[0],r[1]),s}return r(i,[{key:"setTagExpression",value:function(t){return t||(t=xa),this.tagExpression=t,this}},{key:"setValueExpression",value:function(t){return t||(t=xa),this.valueExpression=t,this}},{key:"setDelimiters",value:function(t,e){p(h(i.prototype),"setDelimiters",this).call(this,t,e);var n="(".concat(this.tagExpression,")(=(").concat(this.valueExpression,"))?");if(this.reTag=RegExp(n,"i"),this.tagExpression!==xa||this.valueExpression!==xa){var s="".concat(this.tagExpression,"(=").concat(this.valueExpression,")?"),r="/".concat(this.tagExpression);t=qi(this.delimiterLeft),e=qi(this.delimiterRight);var o=this.multipleLinesTagEnable?"gs":"gi";this.reSplit=RegExp("".concat(t,"((").concat(s,")|(").concat(r,"))").concat(e),o);}return this}},{key:"onTag",value:function(t){var e=t.match(this.reTag),i=e[1],n="/"===i.charAt(0);if(n&&(i=i.substring(1,i.length)),this.translateTagNameCallback&&(i=this.translateTagNameCallback(i)),this.skipEventFlag=!1,n)this.emit("-".concat(i)),this.skipEventFlag||this.emit("-",i),this.lastTagEnd=i;else {var s=function(t,e){if(null==t)return [];void 0===e&&(e=ya);for(var i=t.split(","),n=0,s=i.length;n1?s-1:0),o=1;o1&&-1!==e.indexOf("|")?e.split("|"):[e]).length;r0){var o=this.timeline.addTimer({name:Th,target:s,duration:r.duration,yoyo:r.yoyo,onStart:r.onStart,onProgress:r.onProgress,onComplete:r.onComplete});this.skipTypingAnimation&&o.seek(1);}else r.onStart&&r.onStart(s,0);this.minSizeEnable&&this.textPlayer.setToMinSize(),this.textPlayer.emit("typing",s);var a=this.nextChild;if(a)if(this.skipSpaceEnable&&((i=a).type===rs&&" "===i.text));else if(n+=this.speed+e,e=0,n>0){this.typingTimer=this.timeline.addTimer({name:"delay",target:this,duration:n,onComplete:function(e,i,n){e.typingTimer=void 0,t.call(e,n.remainder);}});break}}else fs(s)&&s.exec();}this.minSizeEnable&&this.textPlayer.setToMinSize(),this.inTypingProcessLoop=!1;},pause:function(){return this.timeline.pause(),this},resume:function(){return this.timeline.resume(),this},pauseTyping:function(){return this.isTypingPaused||(this.typingTimer?(this.typingTimer.pause(),this.isTypingPaused=!0):this.inTypingProcessLoop&&(this.inTypingProcessLoop=!1,this.isTypingPaused=!0)),this},resumeTyping:function(t){return this.isTypingPaused?(void 0===t&&(t=0),this.typingTimer?(this.isTypingPaused=!1,this.typingTimer.resume(),this.typingTimer.remainder+=t):this.isTypingPaused&&(this.isTypingPaused=!1,this.typing(t)),this):this},wait:function(t){return this.ignoreWait||(this.pauseTyping(),Rh(this.textPlayer,t,this.resumeTyping,this)),this},setIgnoreWait:function(t){return void 0===t&&(t=!0),this.ignoreWait=t,this},setSkipSpaceEnable:function(t){return void 0===t&&(t=!0),this.skipSpaceEnable=t,this},setSkipTypingAnimation:function(t){if(void 0===t&&(t=!0),this.skipTypingAnimation=t,t)for(var e=this.timeline.getTimers(Th),i=0,n=e.length;i0&&o.chainAnimation(i,n);},Gh=function(t){var e,i,n=k(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.stopAnimation.apply(s,m(i));},Uh=function(t){var e,i,n=k(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.pauseAnimation.apply(s,m(i));},Hh=function(t){var e,i,n=k(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.chainAnimation.apply(s,m(i));},Nh=[function(t,e,i){var n=i.name;e.on("+",(function(i){if(!e.skipEventFlag){var s,r=i.split(".");if(Vh(r,n)){s=r[1];for(var o=arguments.length,a=new Array(o>1?o-1:0),h=1;h0)){var a=this.getGameObjectManager(e);a.hasMethod(i,n)?a.call.apply(a,[i,n].concat(m(s))):a.setProperty(i,n,s[0]);}},tl={to:!0,yoyo:!0,from:!0,toLeft:!0,toRight:!0,toUp:!0,toDown:!0,yoyoLeft:!0,yoyoRight:!0,yoyoUp:!0,yoyoDown:!0,fromLeft:!0,fromRight:!0,fromUp:!0,fromDown:!0},el=function(t){var e,i,n,s,r,o,a,h,l=y(t,8);e=l[0],i=l[1],n=l[2],s=l[3],r=l[4],o=l[5],a=l[6],h=l[7];var u=this.getGameObjectManager(e),c=u.getProperty(i,n);if("number"==typeof c){h.endsWith("Left")||h.endsWith("Up")?h.startsWith("to")||h.startsWith("yoyo")?s=c-s:h.startsWith("from")&&(u.setProperty(i,n,c-s),s=c):h.endsWith("Right")||h.endsWith("Down")?h.startsWith("to")||h.startsWith("yoyo")?s=c+s:h.startsWith("from")&&(u.setProperty(i,n,c+s),s=c):"from"===h&&(u.setProperty(i,n,s),s=c);var d=h.startsWith("yoyo");u.easeProperty(i,n,s,r,o,a,d);}},il=[function(t,e,i){var n=i.name;e.on("+",(function(i){if(!e.skipEventFlag){var s,r=i.split(".");if(Jh(r,n)){s=r[1];for(var o=arguments.length,a=new Array(o>1?o-1:0),h=1;h1?a-1:0),l=1;l0)return yl.length=0,!0;return yl.length=0,!1},yl=[],kl=void 0,ml=Phaser.Utils.Objects.GetValue,bl=function(t,e,i){var n,s;for(var r in void 0===i&&(i={}),t)n=t[r],void 0!==(s=ml(e,r,n[1]))&&(i[n[0]]=s);return i},xl=function(t){t.addEventListener("touchstart",Cl,!1),t.addEventListener("touchmove",Cl,!1),t.addEventListener("touchend",Cl,!1),t.addEventListener("mousedown",Cl,!1),t.addEventListener("mouseup",Cl,!1),t.addEventListener("mousemove",Cl,!1);},Cl=function(t){t.stopPropagation();},wl=Phaser.Utils.Objects.GetValue,Sl=function(){return this.close(),this.emit("keydown-ENTER",this.parent,this),this},Pl={open:function(){return this.isOpened||this.readOnly||((t=this)!==kl&&(void 0!==kl&&kl.close(),kl=t),this.isOpened=!0,this.node||(this.node=function(t,e){var i,n=wl(e,"inputType",void 0);void 0===n&&(n=wl(e,"type","text")),"textarea"===n?(i=document.createElement("textarea")).style.resize="none":(i=document.createElement("input")).type=n;var s=wl(e,"style",void 0),r=i.style;bl(fl,s,r),r.position="absolute",r.opacity=0,r.pointerEvents="none",r.zIndex=0,r.transform="scale(0)",bl(dl,e,i),xl(i);var o=t.scene.sys.scale;return (o.isFullscreen?o.fullscreenTarget:document.body).appendChild(i),i}(this,this.nodeConfig)),this.setFocus(),this.initText(),this.enterCloseEnable&&this.scene.input.keyboard.once("keydown-ENTER",Sl,this),this.scene.sys.events.on("postupdate",this.updateText,this),this.scene.input.on("pointerdown",this.onClickOutside,this),this.onOpenCallback&&this.onOpenCallback(this.parent,this),this.emit("open",this)),this;var t;},close:function(){return this.isOpened?(this===kl&&(kl=void 0),this.setBlur(),this.isOpened=!1,this.updateText(),this.scene.sys.events.off("postupdate",this.updateText,this),this.scene.input.off("pointerdown",this.onClickOutside,this),this.onCloseCallback&&this.onCloseCallback(this.parent,this),function(t){if(t){var e=t.parentElement;e&&e.removeChild(t);}}(this.node),this.node=void 0,this.emit("close",this),this):this}},Tl=Phaser.Utils.Objects.GetValue,Ol=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),r=e.call(this,t);var o=Tl(s,"inputType",void 0);void 0===o&&(o=Tl(s,"type","text")),r.setEnterCloseEnable(Tl(s,"enterClose","textarea"!==o));var a=Tl(s,"onOpen",void 0);a||(a=Tl(s,"onFocus",void 0)),r.onOpenCallback=a;var h=Tl(s,"onClose",void 0);return h||(h=Tl(s,"onBlur",void 0)),r.onCloseCallback=h,r.onUpdateCallback=Tl(s,"onUpdate",void 0),r.isOpened=!1,t.on("pointerdown",(function(){this.open();}),u(r)).setInteractive(),r.nodeConfig=function(t){void 0===t&&(t={});var e={};return pl(t,e,"inputType"),pl(t,e,"type"),pl(t,e,"style"),pl(t,e,fl),pl(t,e,dl),e}(s),r.node=void 0,r}return r(i,[{key:"destroy",value:function(){this.close(),p(h(i.prototype),"destroy",this).call(this);}},{key:"onClickOutside",value:function(t){vl(this.parent,t)||this.close();}},{key:"setEnterCloseEnable",value:function(t){return void 0===t&&(t=!0),this.enterCloseEnable=t,this}},{key:"initText",value:function(){}},{key:"updateText",value:function(){}},{key:"text",get:function(){return this.node?this.node.value:""},set:function(t){this.node&&(this.node.value=t);}},{key:"setText",value:function(t){return this.text=t,this}},{key:"maxLength",get:function(){return this.nodeConfig.maxLength},set:function(t){this.nodeConfig.maxLength=t,this.node&&(this.node.maxLength=t);}},{key:"setMaxLength",value:function(t){return this.maxLength=t,this}},{key:"minLength",get:function(){return this.nodeConfig.minLength},set:function(t){this.nodeConfig.minLength=t,this.node&&(this.node.minLength=t);}},{key:"setMinLength",value:function(t){return this.minLength=t,this}},{key:"placeholder",get:function(){return this.node.placeholder},set:function(t){this.node&&(this.node.placeholder=t);}},{key:"setPlaceholder",value:function(t){return this.placeholder=t,this}},{key:"selectText",value:function(t,e){return this.node?(void 0===t?this.node.select():this.node.setSelectionRange(t,e),this):this}},{key:"selectAll",value:function(){return this.selectText(),this}},{key:"selectionStart",get:function(){return this.node?this.node.selectionStart:0}},{key:"selectionEnd",get:function(){return this.node?this.node.selectionEnd:0}},{key:"selectedText",get:function(){if(!this.node)return "";var t=this.node;return t.value.substring(t.selectionStart,t.selectionEnd)}},{key:"cursorPosition",get:function(){return this.node?this.node.selectionStart:0},set:function(t){this.node&&this.node.setSelectionRange(t,t);}},{key:"setCursorPosition",value:function(t){return void 0===t?t=this.text.length:t<0&&(t=this.text.length+t),this.cursorPosition=t,this}},{key:"tooltip",get:function(){return this.node?this.node.title:""},set:function(t){if(!this.node)return this;this.node.title=t;}},{key:"setTooltip",value:function(t){return this.tooltip=t,this}},{key:"setTextChangedCallback",value:function(t){return this.onTextChanged=t,this}},{key:"readOnly",get:function(){return this.nodeConfig.readOnly},set:function(t){this.nodeConfig.readOnly=t,this.node&&(this.node.readOnly=t);}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}},{key:"spellCheck",get:function(){return this.node?this.node.spellcheck:""},set:function(t){this.node&&(this.node.spellcheck=t);}},{key:"setSpellCheck",value:function(t){return this.spellCheck=t,this}},{key:"fontColor",get:function(){if(this.node)return this.node.style.color},set:function(t){this.node&&(this.node.style.color=t);}},{key:"setFontColor",value:function(t){return this.fontColor=t,this}},{key:"setStyle",value:function(t,e){return this.node?(this.node.style[t]=e,this):this}},{key:"getStyle",value:function(t){if(this.node)return this.node.style[t]}},{key:"scrollToBottom",value:function(){return this.node?(this.node.scrollTop=this.node.scrollHeight,this):this}},{key:"setEnabled",value:function(t){return this.node?(void 0===t&&(t=!0),this.node.disabled=!t,this):this}},{key:"setBlur",value:function(){return this.node?(this.node.blur(),this):this}},{key:"setFocus",value:function(){return this.node?(this.node.focus(),this):this}},{key:"isFocused",get:function(){return this.isOpened}}]),i}(oo);Object.assign(Ol.prototype,Pl);var Ml=function(t,e,i){t=t.replace(" ","");var n=i.previousText;if(t===n)return t;if(isNaN(t)){i.emit("nan",t,i),t=n;var s=i.cursorPosition-1;i.setText(t),i.setCursorPosition(s);}else i.previousText=t;return t},El=function(t){var e=t.prevSelectionStart;if(null!==e){for(var i=t.prevSelectionEnd,n=t.parent,s=e;s=s&&h=i&&hi.length&&(t.prevCursorPosition=null),null!==t.prevCursorPosition&&(s=e.getCharChild(t.prevCursorPosition))&&("\n"===s.text&&s.clearTextSize(),e.emit("cursorout",s,t.prevCursorPosition,e)),null!=n&&(s=e.getCharChild(n))&&("\n"===s.text&&s.copyTextSize(e.lastInsertCursor),function(t){var e,i,n=t.parent,s=n.width,r=n.height,o=t.drawX,a=t.drawY,h=o+t.drawTLX,l=o+t.drawTRX,u=a+t.drawTLY,c=a+t.drawBLY;e=h<0?0-h:l>s?s-l:0,i=u<0?0-u:c>r?r-c:0,n._textOX+=e,n._textOY+=i;}(s),e.emit("cursorin",s,n,e)),e.emit("movecursor",n,t.prevCursorPosition,e),t.prevCursorPosition=n;}}(this)):(El(this),_l(this)),this}},{key:"setNumberInput",value:function(){return this.onUpdateCallback=Ml,this}},{key:"setSelectAllWhenFocusEnable",value:function(t){return void 0===t&&(t=!0),this.selectAllWhenFocus=t,this}}]),i}(Ol),Bl=Phaser.Utils.Objects.GetValue,Dl=["inputType","onOpen","onFocus","onClose","onBlur","onUpdate","enterClose","readOnly","maxLength","minLength","selectAll"],Il=function(t,e){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return !0;if(-1!==e.indexOf(".")){for(var i=e.split("."),n=t,s=0;st.length?i:t})),l.value=t.join(c);}else l.value=t.join(i.slice(a,a+l.count));a+=l.count,l.added||(h+=l.count);}}var d=e[o-1];return o>1&&"string"==typeof d.value&&(d.added||d.removed)&&t.equals("",d.value)&&(e[o-2].value+=d.value,e.pop()),e}Yl.prototype={diff:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.callback;"function"==typeof i&&(n=i,i={}),this.options=i;var s=this;function r(t){return n?(setTimeout((function(){n(void 0,t);}),0),!0):t}t=this.castInput(t),e=this.castInput(e),t=this.removeEmpty(this.tokenize(t));var o=(e=this.removeEmpty(this.tokenize(e))).length,a=t.length,h=1,l=o+a;i.maxEditLength&&(l=Math.min(l,i.maxEditLength));var u=[{newPos:-1,components:[]}],c=this.extractCommon(u[0],e,t,0);if(u[0].newPos+1>=o&&c+1>=a)return r([{value:this.join(e),count:e.length}]);function d(){for(var i=-1*h;i<=h;i+=2){var n=void 0,l=u[i-1],c=u[i+1],d=(c?c.newPos:0)-i;l&&(u[i-1]=void 0);var f=l&&l.newPos+1=o&&d+1>=a)return r(Vl(s,n.components,e,t,s.useLongestToken));u[i]=n;}else u[i]=void 0;}var v;h++;}if(n)!function t(){setTimeout((function(){if(h>l)return n();d()||t();}),0);}();else for(;h<=l;){var f=d();if(f)return f}},pushComponent:function(t,e,i){var n=t[t.length-1];n&&n.added===e&&n.removed===i?t[t.length-1]={count:n.count+1,added:e,removed:i}:t.push({count:1,added:e,removed:i});},extractCommon:function(t,e,i,n){for(var s=e.length,r=i.length,o=t.newPos,a=o-n,h=0;o+10,o=0,a=e.length;o0;this.dirty=this.dirty||this._radiusTL!==t||this._convexTL!==e,this._convexTL=e,this._radiusTL=Math.abs(t);}},{key:"radiusTR",get:function(){return this._radiusTR},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusTR!==t||this._convexTR!==e,this._convexTR=e,this._radiusTR=Math.abs(t);}},{key:"radiusBL",get:function(){return this._radiusBL},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusBL!==t||this._convexBL!==e,this._convexBL=e,this._radiusBL=Math.abs(t);}},{key:"radiusBR",get:function(){return this._radiusBR},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusBR!==t||this._convexBR!==e,this._convexBR=e,this._radiusBR=Math.abs(t);}},{key:"radius",get:function(){return Math.max(this.radiusTL,this.radiusTR,this.radiusBL,this.radiusBR)},set:function(t){"number"==typeof t?(this.radiusTL=t,this.radiusTR=t,this.radiusBL=t,this.radiusBR=t):(this.radiusTL=Ku(t,"tl",0),this.radiusTR=Ku(t,"tr",0),this.radiusBL=Ku(t,"bl",0),this.radiusBR=Ku(t,"br",0));}},{key:"setRadius",value:function(t){return void 0===t&&(t=0),this.radius=t,this}},{key:"iterations",get:function(){return this._iterations},set:function(t){this.dirty=this.dirty||this._iterations!==t,this._iterations=t;}},{key:"setIterations",value:function(t){return this.iterations=t,this}},{key:"updateData",value:function(){var t=this.pathData;t.length=0;var e,n=this.width,s=this.height,r=this.iterations+1;(e=this.radiusTL)>0?this._convexTL?Gt(e,e,e,e,180,270,!1,r,t):Gt(0,0,e,e,90,0,!0,r,t):Vt(0,0,t);(e=this.radiusTR)>0?this._convexTR?Gt(n-e,e,e,e,270,360,!1,r,t):Gt(n,0,e,e,180,90,!0,r,t):Vt(n,0,t);(e=this.radiusBR)>0?this._convexBR?Gt(n-e,s-e,e,e,0,90,!1,r,t):Gt(n,s,e,e,270,180,!0,r,t):Vt(n,s,t);(e=this.radiusBL)>0?this._convexBL?Gt(e,s-e,e,e,90,180,!1,r,t):Gt(0,s,e,e,360,270,!0,r,t):Vt(0,s,t);return t.push(t[0],t[1]),Eu(this.x,this.y,t),p(h(i.prototype),"updateData",this).call(this),this}}]),i}(yu),Zu=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,qu=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;return n(this,i),void 0===t&&(t=0),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===h&&(h=0),(l=e.call(this)).pathData=[],l.closePath=!0,l.setP0(t,s),l.setP1(r,o),l.setP2(a,h),l}return r(i,[{key:"x0",get:function(){return this._x0},set:function(t){this.dirty=this.dirty||this._x0!==t,this._x0=t;}},{key:"y0",get:function(){return this._y0},set:function(t){this.dirty=this.dirty||this._y0!==t,this._y0=t;}},{key:"setP0",value:function(t,e){return this.x0=t,this.y0=e,this}},{key:"x1",get:function(){return this._x1},set:function(t){this.dirty=this.dirty||this._x1!==t,this._x1=t;}},{key:"y1",get:function(){return this._y1},set:function(t){this.dirty=this.dirty||this._y1!==t,this._y1=t;}},{key:"setP1",value:function(t,e){return this.x1=t,this.y1=e,this}},{key:"x2",get:function(){return this._x2},set:function(t){this.dirty=this.dirty||this._x2!==t,this._x2=t;}},{key:"y2",get:function(){return this._y2},set:function(t){this.dirty=this.dirty||this._y2!==t,this._y2=t;}},{key:"setP2",value:function(t,e){return this.dirty=this.dirty||this.x2!==t||this.y2!==e,this.x2=t,this.y2=e,this}},{key:"updateData",value:function(){return this.pathData.length=0,this.pathData.push(this.x0,this.y0),this.pathData.push(this.x1,this.y1),this.pathData.push(this.x2,this.y2),this.pathData.push(this.x0,this.y0),p(h(i.prototype),"updateData",this).call(this),this}},{key:"webglRender",value:function(t,e,i,n,s){if(this.isFilled){var r=Zu(this.fillColor,this.fillAlpha*i),o=this.x0-n,a=this.y0-s,h=this.x1-n,l=this.y1-s,u=this.x2-n,c=this.y2-s,d=e.getX(o,a),f=e.getY(o,a),p=e.getX(h,l),v=e.getY(h,l),g=e.getX(u,c),y=e.getY(u,c);t.batchTri(d,f,p,v,g,y,r,r,r);}this.isStroked&&Kt(t,this,i,n,s);}},{key:"canvasRender",value:function(t,e,i){var n=this.x1-e,s=this.y1-i,r=this.x2-e,o=this.y2-i,a=this.x3-e,h=this.y3-i;t.beginPath(),t.moveTo(n,s),t.lineTo(r,o),t.lineTo(a,h),t.closePath(),this.isFilled&&(Zt(t,this),t.fill()),this.isStroked&&(qt(t,this),t.stroke());}}]),i}(vu),$u={buildShapes:function(){this.addShape((new Ju).setName("box")).addShape((new Uu).setName("checker"));},updateShapes:function(){var t=this.width/2,e=this.height/2,i=Math.min(t,e),n=2*i,s=t-i,r=e-i,o=this.boxLineWidth,a=Math.max(n/10,2),h=this.getShape("box"),l=this.getShape("checker");if(this.isSizeChanged){var u=n*(1-this.boxSize)/2,c=o/2,d=n*this.boxSize-o;h.setTopLeftPosition(s+c+u,r+c+u).setSize(d,d),this.isCircleShape?h.setRadius(d/2):h.setRadius(0);u=n*(1-this.checkerSize)/2;var f=n*this.checkerSize/4,p=1*f,v=2*f,g=3*f;l.startAt(p,v).lineTo(v,g).lineTo(g,p).offset(s+u,r+u).end();}this.checked?(h.fillStyle(this.boxFillColor,this.boxFillAlpha).lineStyle(o,this.boxStrokeColor,this.boxStrokeAlpha),l.lineStyle(a,this.checkerColor)):(h.fillStyle(this.uncheckedBoxFillColor,this.uncheckedBoxFillAlpha).lineStyle(o,this.uncheckedBoxStrokeColor,this.uncheckedBoxStrokeAlpha),l.lineStyle()),this.checked&&l.setDisplayPathSegment(this.checkerAnimProgress);}},Qu=Phaser.Utils.Objects.GetValue,tc=Phaser.Math.Linear,ec=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).resetFromJSON(),r.boot(),r}return r(i,[{key:"start",value:function(t){if(this.timer.isRunning)return this;var e=this.target;this.propertyKey=Qu(t,"key","value");var n=e[this.propertyKey];return this.fromValue=Qu(t,"from",n),this.toValue=Qu(t,"to",n),this.setEase(Qu(t,"ease",this.ease)),this.setDuration(Qu(t,"duration",this.duration)),this.setRepeat(Qu(t,"repeat",0)),this.setDelay(Qu(t,"delay",0)),this.setRepeatDelay(Qu(t,"repeatDelay",0)),this.timer.setDuration(this.duration).setRepeat(this.repeat).setDelay(this.delay).setRepeatDelay(this.repeatDelay),e[this.propertyKey]=this.fromValue,p(h(i.prototype),"start",this).call(this),this}},{key:"updateGameObject",value:function(t,e){var i=e.t;i=this.easeFn(i),t[this.propertyKey]=tc(this.fromValue,this.toValue,i);}}]),i}(To),ic={setCheckerAnimationDuration:function(t){return void 0===t&&(t=0),this.checkerAnimDuration=t,this},playCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask&&(this.checkerAnimProgressTask=new ec(this,{eventEmitter:null})),this.checkerAnimProgressTask.restart({key:"checkerAnimProgress",from:0,to:1,duration:this.checkerAnimDuration}),this},stopCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask||this.checkerAnimProgressTask.stop(),this}},nc={};Object.assign(nc,fu,{setBoxSize:function(t){return this.dirty=this.dirty||this.boxSize!==t,this.boxSize=t,this},setCheckerSize:function(t){return this.dirty=this.dirty||this.checkerSize!==t,this.checkerSize=t,this}},$u,ic);var sc=Phaser.Utils.Objects.GetValue,rc=Phaser.Utils.Objects.IsPlainObject,oc=23730,ac=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),rc(s)?(s=sc(l=s,"x",0),r=sc(l,"y",0),o=sc(l,"width",2),a=sc(l,"height",2),h=sc(l,"color",oc)):rc(h)&&(h=sc(l=h,"color",oc)),(u=e.call(this,t,s,r,o,a)).type="rexCheckbox",void 0===h&&(h=oc),u.setBoxShape(sc(l,"circleBox",!1)),u.setBoxFillStyle(h,sc(l,"boxFillAlpha",1)),u.setUncheckedBoxFillStyle(sc(l,"uncheckedColor",null),sc(l,"uncheckedBoxFillAlpha",1)),u.setBoxStrokeStyle(sc(l,"boxLineWidth",4),sc(l,"boxStrokeColor",h),sc(l,"boxStrokeAlpha",1)),u.setUncheckedBoxStrokeStyle(u.boxLineWidth,sc(l,"uncheckedBoxStrokeColor",u.boxStrokeColor),sc(l,"uncheckedBoxStrokeAlpha",u.boxStrokeAlpha)),u.setCheckerStyle(sc(l,"checkerColor",16777215),sc(l,"checkerAlpha",1)),u.setBoxSize(sc(l,"boxSize",1)),u.setCheckerSize(sc(l,"checkerSize",1)),u.setCheckerAnimationDuration(sc(l,"animationDuration",150)),u.buildShapes();var c=sc(l,"checked");return void 0===c&&(c=sc(l,"value",!1)),u.setValue(c),u}return r(i,[{key:"value",get:function(){return this._value},set:function(t){t=!!t,this._value!==t&&(this.dirty=!0,this._value=t,t?this.playCheckerAnimation():this.stopCheckerAnimation(),this.emit("valuechange",t));}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"toggleValue",value:function(){return this.setValue(!this.value),this}},{key:"checked",get:function(){return this.value},set:function(t){this.value=t;}},{key:"setChecked",value:function(t){return void 0===t&&(t=!0),this.setValue(t),this}},{key:"toggleChecked",value:function(){return this.toggleValue(),this}},{key:"checkerAnimProgress",get:function(){return this._checkerAnimProgress},set:function(t){this._checkerAnimProgress!==t&&(this._checkerAnimProgress=t,this.dirty=!0);}}]),i}(du);Object.assign(ac.prototype,nc);var hc=Phaser.Utils.Objects.GetValue,lc=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s))._enable=void 0,t.setInteractive(hc(s,"inputConfig",void 0)),r.resetFromJSON(s),r.boot(),r}return r(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.lastClickTime=void 0,this.setEnable(hc(t,"enable",!0)),this.setMode(hc(t,"mode",1)),this.setClickInterval(hc(t,"clickInterval",100)),this.setDragThreshold(hc(t,"threshold",void 0)),this}},{key:"boot",value:function(){var t=this.parent;t.on("pointerdown",this.onPress,this),t.on("pointerup",this.onRelease,this),t.on("pointerout",this.onPointOut,this),t.on("pointermove",this.onMove,this),t.on("pointerover",this.onOver,this),t.on("pointerout",this.onOut,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.pointer=null,p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t){t||this.cancel(),this._enable=t;var e=t?"enable":"disable";this.emit(e,this,this.parent);}}},{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=uc[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,this.emit("down",this,this.parent,t,n),0===this.mode&&this.click(t.downTime,t,n));}},{key:"onRelease",value:function(t,e,i,n){this.pointer===t&&(this.emit("up",this,this.parent,t,n),1===this.mode&&this.click(t.upTime,t,n),this.pointer=void 0);}},{key:"onPointOut",value:function(t,e){this.pointer===t&&this.cancel();}},{key:"onMove",value:function(t,e,i,n){this.pointer===t&&void 0!==this.dragThreshold&&1===this.mode&&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.parent,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.parent,e,i)),this}},{key:"cancel",value:function(){return this.pointer=void 0,this}},{key:"onOver",value:function(t,e,i,n){return this.enable?(this.emit("over",this,this.parent,t,n),this):this}},{key:"onOut",value:function(t,e){return this.enable?(this.emit("out",this,this.parent,t,e),this):this}}]),i}(oo),uc={press:0,pointerdown:0,release:1,pointerup:1},cc=Phaser.Utils.Objects.GetValue,dc=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var c;return n(this,i),(c=e.call(this,t,s,r,o,a,h,l))._click=new lc(u(c),cc(l,"click")),c._click.on("click",(function(){this.toggleValue();}),u(c)),c.setReadOnly(cc(l,"readOnly",!1)),c}return r(i,[{key:"readOnly",get:function(){return !this._click.enable},set:function(t){this._click.enable=!t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}}]),i}(ac);T.register("checkbox",(function(t,e,i,n,s,r){var o=new dc(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.Checkbox",dc);var fc={setTrackFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.trackFillColor!==t||this.trackFillAlpha!==e,this.trackFillColor=t,this.trackFillAlpha=e,this},setFalseValueTrackFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.falseValueTrackColor!==t||this.uncheckedTrackFillAlpha!==e,this.falseValueTrackColor=t,this.falseValueTrackFillAlpha=e,this},setThumbStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.thumbColor!==t||this.checkAlpha!==e,this.thumbColor=t,this.thumbAlpha=e,this}},pc={setTrackSize:function(t,e){return this.dirty=this.dirty||this.trackWidth!==t||this.trackHeight!==e,this.trackWidth=t,this.trackHeight=e,this},setTrackRadius:function(t){return this.dirty=this.dirty||this.trackRadius!==t,this.trackRadius=t,this},setThumbSize:function(t,e){return void 0===e&&(e=t),this.dirty=this.dirty||this.thumbWidth!==t||this.thumbHeight!==e,this.thumbWidth=t,this.thumbHeight=e,this},setThumbRadius:function(t){return this.dirty=this.dirty||this.thumbRadius!==t,this.thumbRadius=t,this}},vc={setThumbPosition:function(t,e){return void 0===e&&(e=1-t),this.thumbLeftX=t,this.thumbRightX=e,this},setRTL:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},gc=function(t,e,i){return (e-t)*i+t},yc=Phaser.Math.Linear,kc={buildShapes:function(){this.addShape((new Ju).setName("track")).addShape((new Ju).setName("thumb"));},updateShapes:function(){var t=this.width,e=this.height,i=this.value?this.toggleAnimProgress:1-this.toggleAnimProgress,n=this.getShape("track");if(this.isSizeChanged){var s=t*this.trackWidth,r=e*this.trackHeight,o=(t-s)/2,a=(e-r)/2,h=e*this.trackRadius;n.setTopLeftPosition(o,a).setSize(s,r).setRadius(h);}var l,u,c,d=(l=this.falseValueTrackColor,u=this.trackFillColor,c=i,(255&gc(yr(l),yr(u),c))<<16|(255&gc(kr(l),kr(u),c))<<8|255&gc(mr(l),mr(u),c)),f=yc(this.falseValueTrackFillAlpha,this.trackFillAlpha,i);n.fillStyle(d,f);var p=this.getShape("thumb");if(this.isSizeChanged){var v=t*this.thumbWidth,g=e*this.thumbHeight,y=e*this.thumbRadius;p.setSize(v,g).setRadius(y);}var k=yc(this.thumbLeftX,this.thumbRightX,i)*t;this.rtl&&(k=t-k);var m=e/2;p.setCenterPosition(k,m),p.fillStyle(this.thumbColor,this.thumbAlpha);}},mc={setToggleAnimationDuration:function(t){return void 0===t&&(t=0),this.toggleAnimDuration=t,this},playToggleAnimation:function(){return void 0===this.toggleAnimProgressTask&&(this.toggleAnimProgressTask=new ec(this,{eventEmitter:null})),this.toggleAnimProgressTask.restart({key:"toggleAnimProgress",from:0,to:1,duration:this.toggleAnimDuration}),this},stopToggleAnimation:function(){return void 0===this.toggleAnimProgressTask||this.toggleAnimProgressTask.stop(),this}},bc={};Object.assign(bc,fc,pc,vc,kc,mc);var xc=Phaser.Utils.Objects.GetValue,Cc=Phaser.Utils.Objects.IsPlainObject,wc=23730,Sc=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),Cc(s)?(s=xc(l=s,"x",0),r=xc(l,"y",0),o=xc(l,"width",2),a=xc(l,"height",2),h=xc(l,"color",wc)):Cc(h)&&(h=xc(l=h,"color",wc)),(u=e.call(this,t,s,r,o,a)).type="rexToggleSwitch",void 0===h&&(h=wc),u.setTrackFillStyle(h,xc(l,"trackFillAlpha",1)),u.setFalseValueTrackFillStyle(xc(l,"falseValueTrackColor",function(t){var e=.3*yr(t)+.59*kr(t)+.11*mr(t);return (255&e)<<16|(255&e)<<8|255&e}(h)),xc(l,"falseValueTrackFillAlpha",1)),u.setThumbStyle(xc(l,"thumbColor",16777215),xc(l,"thumbAlpha",1)),u.setTrackSize(xc(l,"trackWidth",.9),xc(l,"trackHeight",.5)),u.setTrackRadius(xc(l,"trackRadius",.5*u.trackHeight));var c=xc(l,"thumbHeight",void 0),d=xc(l,"thumbWidth",c);return void 0===d&&(d=.9*u.trackHeight),u.setThumbSize(d,c),u.setThumbRadius(xc(l,"thumbRadius",.5*u.thumbHeight)),u.setThumbPosition(xc(l,"thumbLeft",.3),xc(l,"thumbRight",void 0)),u.setRTL(xc(l,"rtl",!1)),u.setToggleAnimationDuration(xc(l,"animationDuration",150)),u.buildShapes(),u.setValue(xc(l,"value",!1),0),u}return r(i,[{key:"value",get:function(){return this._value},set:function(t){t=!!t,this._value!==t&&(this.dirty=!0,this._value=t,this.playToggleAnimation(),this.emit("valuechange",t));}},{key:"setValue",value:function(t,e){void 0===e&&(e=this.toggleAnimDuration);var i=this.toggleAnimDuration;return this.toggleAnimDuration=e,this.value=t,this.toggleAnimDuration=i,this}},{key:"toggleValue",value:function(t){return this.setValue(!this.value,t),this}},{key:"toggleAnimProgress",get:function(){return this._toggleAnimProgress},set:function(t){this._toggleAnimProgress!==t&&(this._toggleAnimProgress=t,this.dirty=!0);}}]),i}(du);Object.assign(Sc.prototype,bc);var Pc=Phaser.Utils.Objects.GetValue,Tc=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var c;return n(this,i),(c=e.call(this,t,s,r,o,a,h,l))._click=new lc(u(c),Pc(l,"click")),c._click.on("click",(function(){this.toggleValue();}),u(c)),c.setReadOnly(Pc(l,"readOnly",!1)),c}return r(i,[{key:"readOnly",get:function(){return !this._click.enable},set:function(t){this._click.enable=!t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}}]),i}(Sc);T.register("toggleSwitch",(function(t,e,i,n,s,r){var o=new Tc(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.ToggleSwitch",Tc);var Oc={loadFromURL:function(t,e){var i=this,n=new Image;return n.onload=function(){i.width!==n.width||i.height!==n.height?i.resize(n.width,n.height):i.clear(),i.context.drawImage(n,0,0),i.updateTexture(),e&&e(),n.onload=null,n.src="",n.remove();},n.src=t,this},loadFromURLPromise:function(t){var e=this;return new Promise((function(i,n){e.loadFromURL(t,i);}))},loadFromFile:function(t,e){var i=URL.createObjectURL(t);return this.loadFromURL(i,(function(){URL.revokeObjectURL(i),e&&e();})),this},loadFromFilePromise:function(t){var e=this;return new Promise((function(i,n){e.loadFromFile(t,i);}))}},Mc=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i)}(pe);Object.assign(Mc.prototype,Oc),T.register("canvas",(function(t,e,i,n){var s=new Mc(this.scene,t,e,i,n);return this.scene.add.existing(s),s})),Z(window,"RexPlugins.UI.Canvas",Mc);var Ec=Phaser.Utils.Objects.GetValue,_c=function(t){a(s,t);var e=d(s);function s(t,i,r,o,a,h){var l;return n(this,s),(l=e.call(this,t,i,r)).type="rexCircleMaskImage",l.setTexture(o,a,h),l}return r(s,[{key:"setTexture",value:function(t,e,n){"object"===i(e)&&(n=e,e=void 0),"string"==typeof n&&(n={maskType:n});var s=Ec(n,"maskType",0),r=Ec(n,"backgroundColor",void 0),o=Ec(n,"strokeColor",void 0),a=Ec(n,"strokeWidth",null!=o?10:0);if(void 0===s?s=0:"string"==typeof s&&(s=Rc[s]),this._textureKey=t,this._frameName=e,null===s)return this.loadTexture(t,e),this.dirty=!0,this;var h=this.scene.sys.textures.getFrame(t,e);if(!h)return this;h.cutWidth!==this.width||h.cutHeight!==this.height?this.setCanvasSize(h.cutWidth,h.cutHeight):this.clear();var l=this.canvas,u=this.context,c=l.width,d=l.height;null!=r&&(u.fillStyle=r,u.fillRect(0,0,c,d)),u.save(),u.beginPath();var f=a/2;switch(s){case 1:var p=(k=Math.floor(c/2))-f,v=(m=Math.floor(d/2))-f;u.ellipse(k,m,p,v,0,0,2*Math.PI);break;case 2:var g=Ec(n,"radius",0),y=Ec(n,"iteration",void 0);me(u,f,f,c-a,d-a,g,y);break;default:var k=Math.floor(c/2),m=Math.floor(d/2),b=Math.min(k,m)-f;u.arc(k,m,b,0,2*Math.PI);}return null!=o&&(u.strokeStyle=o,u.lineWidth=a,u.stroke()),u.clip(),this.loadTexture(t,e),u.restore(),this.dirty=!0,this}},{key:"resize",value:function(t,e){return this.setDisplaySize(t,e),this}}]),s}(pe),Rc={circle:0,ellipse:1,roundRectangle:2};T.register("circleMaskImage",(function(t,e,i,n,s){var r=new _c(this.scene,t,e,i,n,s);return this.scene.add.existing(r),r})),Z(window,"RexPlugins.UI.CircleMaskImage",_c);var Lc=Phaser.Utils.Objects.GetValue,Bc=function(t){a(s,t);var e=d(s);function s(t,i,r,o,a,h){var l;return n(this,s),(l=e.call(this,t,i,r)).type="rexAlphaMaskImage",l.maskFrame=null,l.setTexture(o,a,h),l}return r(s,[{key:"setTexture",value:function(t,e,n){"object"===i(e)&&(n=e,e=void 0),"string"==typeof n&&(n={mask:{key:n}});var s=Lc(n,"mask.key"),r=Lc(n,"mask.frame"),o=Lc(n,"mask.invertAlpha",!1),a=Lc(n,"mask.scale"),h=Lc(n,"backgroundColor");if(s){this._maskKey=s,this._maskFrame=r,this._maskScale=a;var l=s?this.scene.sys.textures.get(s):null;this.maskFrame=l?l.get(r):null;}this._textureKey=t,this._frameName=e;var u=this.maskFrame;if(null===u)return this.loadTexture(t,e),this.dirty=!0,this;var c=null!=h;this.loadTexture(t,e);var d,f,p=this.canvas,v=this.context,g=p.width,y=p.height;v.save(),v.globalCompositeOperation=o?"destination-out":"destination-in",null!=this._maskScale?(d=u.cutWidth*this._maskScale,f=u.cutHeight*this._maskScale):(d=g,f=y);var k=(g-d)/2,m=(y-f)/2;return this.drawFrame(this._maskKey,this._maskFrame,k,m,d,f),v.restore(),c&&(v.save(),v.globalCompositeOperation="destination-over",v.fillStyle=h,v.fillRect(0,0,g,y),v.restore()),this.dirty=!0,this}},{key:"resize",value:function(t,e){return this.setDisplaySize(t,e),this}}]),s}(pe);T.register("alphaMaskImage",(function(t,e,i,n,s){var r=new Bc(this.scene,t,e,i,n,s);return this.scene.add.existing(r),r})),Z(window,"RexPlugins.UI.AlphaMaskImage",Bc);var Dc=Phaser.Math.Linear,Ic=Phaser.Math.Percent,jc={setValue:function(t,e,i){return null==t||(void 0!==e&&(t=Ic(t,e,i)),this.value=t),this},addValue:function(t,e,i){return void 0!==e&&(t=Ic(t,e,i)),this.value+=t,this},getValue:function(t,e){var i=this.value;return void 0!==t&&(i=Dc(t,e,i)),i}},zc=Phaser.Math.Percent,Ac={setEaseValuePropName:function(t){return this.easeValuePropName=t,this},setEaseValueDuration:function(t){return this.easeValueDuration=t,this},setEaseValueFunction:function(t){return this.easeFunction=t,this},stopEaseValue:function(){return this.easeValueTask&&this.easeValueTask.stop(),this},easeValueTo:function(t,e,i){return null==t||(void 0!==e&&(t=zc(t,e,i)),void 0===this.easeValueTask&&(this.easeValueTask=new ec(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,to:t,duration:this.easeValueDuration,ease:this.easeFunction})),this},easeValueRepeat:function(t,e,i,n){return void 0===i&&(i=-1),void 0===n&&(n=0),void 0===this.easeValueTask&&(this.easeValueTask=new ec(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,from:t,to:e,duration:this.easeValueDuration,ease:this.easeFunction,repeat:i,repeatDelay:n}),this}},Fc=Phaser.Utils.Objects.GetValue,Wc=Phaser.Math.Clamp;function Yc(t){var e=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"bootProgressBase",value:function(t){this.eventEmitter=Fc(t,"eventEmitter",this);var e=Fc(t,"valuechangeCallback",null);if(null!==e){var i=Fc(t,"valuechangeCallbackScope",void 0);this.eventEmitter.on("valuechange",e,i);}return this.setEaseValuePropName("value").setEaseValueDuration(Fc(t,"easeValue.duration",0)).setEaseValueFunction(Fc(t,"easeValue.ease","Linear")),this}},{key:"value",get:function(){return this._value},set:function(t){t=Wc(t,0,1);var e=this._value,i=e!=t;this.dirty=this.dirty||i,this._value=t,i&&this.eventEmitter.emit("valuechange",this._value,e,this.eventEmitter);}}]),i}(t);return Object.assign(e.prototype,jc,Ac),e}var Vc=Phaser.Math.RadToDeg,Xc=Phaser.Math.DegToRad,Gc=function(t,e,i,n,s,r,o,a){var h=360===Math.abs(o-r),l=Xc(r),u=Xc(o),c=Math.cos(l),d=Math.sin(l),f=Math.cos(u),p=Math.sin(u);return t.startAt(e+c*n,i+d*n),t.arc(e,i,n,r,o,a),h&&0===s||(t.lineTo(e+f*s,i+p*s),s>0&&t.arc(e,i,s,o,r,!a)),t.close(),t},Uc={buildShapes:function(){this.addShape((new Uu).setName("track")).addShape((new Uu).setName("bar")).addShape((new bu).setName("center"));},updateShapes:function(){var t=this.radius,e=this.thickness*this.radius,i=this.radius,n=i-e,s=this.getShape("track");null!=this.trackColor&&this.thickness>0?(s.fillStyle(this.trackColor),Gc(s,t,t,i,n,0,360,!1)):s.reset();var r=this.getShape("bar");if(null!=this.barColor&&this.thickness>0){var o,a,h;if(1===this.value)o=!1,a=0,h=360;else o=this.anticlockwise,a=Vc(this.startAngle),h=360*(o?1-this.value:this.value)+a;r.fillStyle(this.barColor),Gc(r,t,t,i,n,a,h,!1);}else r.reset();var l=this.getShape("center");this.centerColor&&n>0?l.setCenterPosition(t,t).setRadius(n).fillStyle(this.centerColor):l.reset();}},Hc=Phaser.Utils.Objects.GetValue,Nc=Phaser.Utils.Objects.IsPlainObject,Kc=Phaser.Math.Clamp,Jc=Phaser.Math.DegToRad(270),Zc=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),Nc(s)&&(s=Hc(l=s,"x",0),r=Hc(l,"y",0),o=Hc(l,"radius",1),a=Hc(l,"barColor",void 0),h=Hc(l,"value",0)),void 0===o&&(o=1);var c=2*o;return (u=e.call(this,t,s,r,c,c)).type="rexCircularProgress",u.bootProgressBase(l),u.setRadius(o),u.setTrackColor(Hc(l,"trackColor",void 0)),u.setBarColor(a),u.setCenterColor(Hc(l,"centerColor",void 0)),u.setThickness(Hc(l,"thickness",.2)),u.setStartAngle(Hc(l,"startAngle",Jc)),u.setAnticlockwise(Hc(l,"anticlockwise",!1)),u.buildShapes(),u.setValue(h),u}return r(i,[{key:"resize",value:function(t,e){return (t=Math.floor(Math.min(t,e)))===this.width||(p(h(i.prototype),"resize",this).call(this,t,t),this.setRadius(t/2)),this}},{key:"radius",get:function(){return this._radius},set:function(t){this.dirty=this.dirty||this._radius!=t,this._radius=t;var e=2*t;this.resize(e,e);}},{key:"setRadius",value:function(t){return this.radius=t,this}},{key:"trackColor",get:function(){return this._trackColor},set:function(t){this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"setBarColor",value:function(t){return this.barColor=t,this}},{key:"startAngle",get:function(){return this._startAngle},set:function(t){this.dirty=this.dirty||this._startAngle!=t,this._startAngle=t;}},{key:"setStartAngle",value:function(t){return this.startAngle=t,this}},{key:"anticlockwise",get:function(){return this._anticlockwise},set:function(t){this.dirty=this.dirty||this._anticlockwise!=t,this._anticlockwise=t;}},{key:"setAnticlockwise",value:function(t){return void 0===t&&(t=!0),this.anticlockwise=t,this}},{key:"thickness",get:function(){return this._thickness},set:function(t){t=Kc(t,0,1),this.dirty=this.dirty||this._thickness!=t,this._thickness=t;}},{key:"setThickness",value:function(t){return this.thickness=t,this}},{key:"centerColor",get:function(){return this._centerColor},set:function(t){this.dirty=this.dirty||this._centerColor!=t,this._centerColor=t;}},{key:"setCenterColor",value:function(t){return this.centerColor=t,this}}]),i}(Yc(du));Object.assign(Zc.prototype,Uc),T.register("circularProgress",(function(t,e,i,n,s,r){var o=new Zc(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.CircularProgress",Zc);var qc=function(t,e,i,n,s,r,o,a,h,l,u,c){void 0===l&&(l=0),void 0===u&&(u=2*Math.PI),void 0===c&&(c=!1),e.beginPath(),e.ellipse(i,n,s,r,0,l,u,c),null!=o&&(e.fillStyle=o,e.fill()),null!=a&&(e.strokeStyle=a,e.lineWidth=h,e.stroke());},$c=function(){var t,e=this.radius,i=this.thickness*this.radius,n=this.radius-i/2,s=this.radius-i,r=(this.canvas,this.context);if(this.trackColor&&i>0&&(r.save(),qc(0,r,e,e,n,n,void 0,this.trackColor,i),r.restore()),this.barColor&&n>0){var o,a,h;if(1===this.value)o=!1,a=0,h=2*Math.PI;else o=this.anticlockwise,a=this.startAngle,h=2*Math.PI*(o?1-this.value:this.value)+a;r.save(),qc(0,r,e,e,n,n,void 0,this.barColor,i,a,h,o),r.restore();}this.centerColor&&s>0&&(this.centerColor2?((t=this.context.createRadialGradient(e,e,0,e,e,s)).addColorStop(0,this.centerColor),t.addColorStop(1,this.centerColor2)):t=this.centerColor,r.save(),qc(0,r,e,e,s,s,t),r.restore());this.textFormatCallback&&(this.textColor||this.textStrokeColor)&&(r.save(),function(t,e,i,n,s,r,o,a,h,l,u){void 0===h&&null!=a&&(h=2),void 0===l&&(l="start"),void 0===u&&(u="alphabetic"),e.font=r,e.textAlign=l,e.textBaseline=u,e.fillStyle=o,e.strokeStyle=a,e.lineWidth=h,e.lineCap="round",e.lineJoin="round",null!=a&&"none"!==a&&h>0&&e.strokeText(s,i,n),null!=o&&"none"!==o&&e.fillText(s,i,n);}(0,r,e,e,this.getFormatText(),this.textFont,this.textColor,this.textStrokeColor,this.textStrokeThickness,"center","middle"),r.restore());},Qc=Phaser.Utils.Objects.GetValue,td=Phaser.Utils.Objects.IsPlainObject,ed=Phaser.Math.Clamp,id=Phaser.Math.DegToRad(270),nd=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),td(s)&&(s=Qc(l=s,"x",0),r=Qc(l,"y",0),o=Qc(l,"radius",1),a=Qc(l,"barColor",void 0),h=Qc(l,"value",0));var c=2*o;(u=e.call(this,t,s,r,c,c)).type="rexCircularProgressCanvas",u.bootProgressBase(l),u.setRadius(o),u.setTrackColor(Qc(l,"trackColor",void 0)),u.setBarColor(a),u.setCenterColor(Qc(l,"centerColor",void 0)),u.setThickness(Qc(l,"thickness",.2)),u.setStartAngle(Qc(l,"startAngle",id)),u.setAnticlockwise(Qc(l,"anticlockwise",!1)),u.setTextColor(Qc(l,"textColor",void 0)),u.setTextStrokeColor(Qc(l,"textStrokeColor",void 0),Qc(l,"textStrokeThickness",void 0));var d=Qc(l,"textFont",void 0);return d?u.setTextFont(d):u.setTextFont(Qc(l,"textSize","16px"),Qc(l,"textFamily","Courier"),Qc(l,"textStyle","")),u.setTextFormatCallback(Qc(l,"textFormatCallback",void 0),Qc(l,"textFormatCallbackScope",void 0)),u.setValue(h),u}return r(i,[{key:"resize",value:function(t,e){return (t=Math.floor(Math.min(t,e)))===this.width||(p(h(i.prototype),"resize",this).call(this,t,t),this.setRadius(t/2)),this}},{key:"radius",get:function(){return this._radius},set:function(t){this.dirty=this.dirty||this._radius!=t,this._radius=t;var e=2*t;this.resize(e,e);}},{key:"setRadius",value:function(t){return this.radius=t,this}},{key:"trackColor",get:function(){return this._trackColor},set:function(t){t=ye(t,this.canvas,this.context),this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){t=ye(t,this.canvas,this.context),this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"setBarColor",value:function(t){return this.barColor=t,this}},{key:"startAngle",get:function(){return this._startAngle},set:function(t){this.dirty=this.dirty||this._startAngle!=t,this._startAngle=t;}},{key:"setStartAngle",value:function(t){return this.startAngle=t,this}},{key:"anticlockwise",get:function(){return this._anticlockwise},set:function(t){this.dirty=this.dirty||this._anticlockwise!=t,this._anticlockwise=t;}},{key:"setAnticlockwise",value:function(t){return void 0===t&&(t=!0),this.anticlockwise=t,this}},{key:"thickness",get:function(){return this._thickness},set:function(t){t=ed(t,0,1),this.dirty=this.dirty||this._thickness!=t,this._thickness=t;}},{key:"setThickness",value:function(t){return this.thickness=t,this}},{key:"centerColor",get:function(){return this._centerColor},set:function(t){t=ye(t,this.canvas,this.context),this.dirty=this.dirty||this._centerColor!=t,this._centerColor=t;}},{key:"centerColor2",get:function(){return this._centerColor2},set:function(t){t=ye(t,this.canvas,this.context),this.dirty=this.dirty||this._centerColor2!=t,this._centerColor2=t;}},{key:"setCenterColor",value:function(t,e){return this.centerColor=t,this.centerColor2=e,this}},{key:"textColor",get:function(){return this._textColor},set:function(t){t=ye(t,this.canvas,this.context),this.dirty=this.dirty||this._textColor!=t,this._textColor=t;}},{key:"setTextColor",value:function(t){return this.textColor=t,this}},{key:"textStrokeColor",get:function(){return this._textStrokeColor},set:function(t){t=ye(t,this.canvas,this.context),this.dirty=this.dirty||this._textStrokeColor!=t,this._textStrokeColor=t;}},{key:"textStrokeThickness",get:function(){return this._textStrokeThickness},set:function(t){this.dirty=this.dirty||this._textStrokeThickness!=t,this._textStrokeThickness=t;}},{key:"setTextStrokeColor",value:function(t,e){return void 0===e&&(e=2),this.textStrokeColor=t,this.textStrokeThickness=e,this}},{key:"textFont",get:function(){return this._textFont},set:function(t){this.dirty=this.dirty||this._textFont!=t,this._textFont=t;}},{key:"setTextFont",value:function(t,e,i){var n;return n=void 0===e?t:i+" "+t+" "+e,this.textFont=n,this}},{key:"setTextFormatCallback",value:function(t,e){return this.textFormatCallback=t,this.textFormatCallbackScope=e,this}},{key:"updateTexture",value:function(){return this.clear(),$c.call(this),p(h(i.prototype),"updateTexture",this).call(this),this}},{key:"getFormatText",value:function(t){return void 0===t&&(t=this.value),this.textFormatCallbackScope?this.textFormatCallback(t):this.textFormatCallback.call(this.textFormatCallbackScope,t)}}]),i}(Yc(pe));T.register("circularProgressCanvas",(function(t,e,i,n,s,r){var o=new nd(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.CircularProgressCanvas",nd);var sd=function(t,e,i,n,s,r){var o=(e+n)/2;return r>=0?t.startAt(o+r,i).lineTo(n+r,i).lineTo(n,s).lineTo(e,s).lineTo(e+r,i).lineTo(o+r,i):t.startAt(o,i).lineTo(n,i).lineTo(n-r,s).lineTo(e-r,s).lineTo(e,i).lineTo(o,i),t},rd=Phaser.Utils.Objects.GetValue,od=Phaser.Utils.Objects.IsPlainObject,ad=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l,u){var c;return n(this,i),od(s)?(s=rd(u=s,"x",0),r=rd(u,"y",0),o=rd(u,"width",2),a=rd(u,"height",2),h=rd(u,"barColor",void 0),l=rd(u,"value",0)):od(o)?(o=rd(u=o,"width",2),a=rd(u,"height",2),h=rd(u,"barColor",void 0),l=rd(u,"value",0)):od(h)&&(h=rd(u=h,"barColor",void 0),l=rd(u,"value",0)),(c=e.call(this,t,s,r,o,a,u)).type="rexLineProgress",c.bootProgressBase(u),c.addShape((new Uu).setName("trackFill")).addShape((new Uu).setName("bar")).addShape((new Uu).setName("trackStroke")),c.setTrackColor(rd(u,"trackColor",void 0)),c.setBarColor(h),c.setTrackStroke(rd(u,"trackStrokeThickness",2),rd(u,"trackStrokeColor",void 0)),c.setSkewX(rd(u,"skewX",0)),c.setRTL(rd(u,"rtl",!1)),c.setValue(l),c}return r(i,[{key:"trackColor",get:function(){return this._trackColor},set:function(t){this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"trackStrokeColor",get:function(){return this._trackStrokeColor},set:function(t){this.dirty=this.dirty||this._trackStrokeColor!=t,this._trackStrokeColor=t;}},{key:"trackStrokeThickness",get:function(){return this._trackStrokeThickness},set:function(t){this.dirty=this.dirty||this._trackStrokeThickness!=t,this._trackStrokeThickness=t;}},{key:"setTrackStroke",value:function(t,e){return this.trackStrokeThickness=t,this.trackStrokeColor=e,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"setBarColor",value:function(t){return this.barColor=t,this}},{key:"skewX",get:function(){return this._skewX},set:function(t){this.dirty=this.dirty||this._skewX!=t,this._skewX=t;}},{key:"setSkewX",value:function(t){return this.skewX=t,this}},{key:"rtl",get:function(){return this._rtl},set:function(t){t=!!t,this.dirty=this.dirty||this._rtl!=t,this._rtl=t;}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}}]),i}(Yc(du)),hd={updateShapes:function(){var t=this.skewX,e=this.width-Math.abs(t),i=this.height,n=this.getShape("trackFill");n.fillStyle(this.trackColor),n.isFilled&&sd(n,0,0,e,i,t).close();var s,r,o=this.getShape("bar");(o.fillStyle(this.barColor),o.isFilled)&&(this.rtl?(s=e*(1-this.value),r=e):(s=0,r=e*this.value),sd(o,s,0,r,i,t).close());var a=this.getShape("trackStroke");a.lineStyle(this.trackStrokeThickness,this.trackStrokeColor),a.isStroked&&sd(a,0,0,e,i,t).end();}};Object.assign(ad.prototype,hd),T.register("lineProgress",(function(t,e,i,n,s,r,o){var a=new ad(this.scene,t,e,i,n,s,r,o);return this.scene.add.existing(a),a})),Z(window,"RexPlugins.UI.LineProgress",ad);var ld=function(t,e,i,n,s,r,o){void 0===o&&(o="round"),function(t,e){t.save(),t.beginPath();var i=e[0];t.moveTo(i.x,i.y);for(var n=1,s=e.length;n0&&(r.save(),ld(0,r,this.trackPoints,void 0,this.trackStrokeColor,this.trackStrokeThickness),r.restore());},cd=function(t,e,i,n,s,r){void 0===r&&(r=[]),r.length=4;for(var o=0;o<4;o++)r[o]||(r[o]={});var a;return s>=0?((a=r[0]).x=t+s,a.y=e,(a=r[1]).x=i+s,a.y=e,(a=r[2]).x=i,a.y=n,(a=r[3]).x=t,a.y=n):((a=r[0]).x=t,a.y=e,(a=r[1]).x=i,a.y=e,(a=r[2]).x=i-s,a.y=n,(a=r[3]).x=t-s,a.y=n),r},dd=Phaser.Utils.Objects.GetValue,fd=Phaser.Utils.Objects.IsPlainObject,pd=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l,u){var c;return n(this,i),fd(s)?(s=dd(u=s,"x",0),r=dd(u,"y",0),o=dd(u,"width",2),a=dd(u,"height",2),h=dd(u,"barColor",void 0),l=dd(u,"value",0)):fd(o)?(o=dd(u=o,"width",2),a=dd(u,"height",2),h=dd(u,"barColor",void 0),l=dd(u,"value",0)):fd(h)&&(h=dd(u=h,"barColor",void 0),l=dd(u,"value",0)),(c=e.call(this,t,s,r,o,a)).type="rexLineProgressCanvas",c.trackPoints=[],c.barPoints=[],c.bootProgressBase(u),c.setTrackColor(dd(u,"trackColor",void 0)),c.setBarColor(h,dd(u,"barColor2",void 0),dd(u,"isHorizontalGradient",void 0)),c.setTrackStroke(dd(u,"trackStrokeThickness",2),dd(u,"trackStrokeColor",void 0)),c.setSkewX(dd(u,"skewX",0)),c.setRTL(dd(u,"rtl",!1)),c.setValue(l),c}return r(i,[{key:"trackColor",get:function(){return this._trackColor},set:function(t){t=ye(t,this.canvas,this.context),this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"trackStrokeColor",get:function(){return this._trackStrokeColor},set:function(t){t=ye(t,this.canvas,this.context),this.dirty=this.dirty||this._trackStrokeColor!=t,this._trackStrokeColor=t;}},{key:"trackStrokeThickness",get:function(){return this._trackStrokeThickness},set:function(t){this.dirty=this.dirty||this._trackStrokeThickness!=t,this._trackStrokeThickness=t;}},{key:"setTrackStroke",value:function(t,e){return this.trackStrokeThickness=t,this.trackStrokeColor=e,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){t=ye(t,this.canvas,this.context),this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"barColor2",get:function(){return this._barColor2},set:function(t){t=ye(t,this.canvas,this.context),this.dirty=this.dirty||this._barColor2!=t,this._barColor2=t;}},{key:"isHorizontalGradient",get:function(){return this._isHorizontalGradient},set:function(t){this.dirty|=this._isHorizontalGradient!=t,this._isHorizontalGradient=t;}},{key:"setBarColor",value:function(t,e,i){return void 0===i&&(i=!0),this.barColor=t,this.barColor2=e,this.isHorizontalGradient=i,this}},{key:"skewX",get:function(){return this._skewX},set:function(t){this.dirty=this.dirty||this._skewX!=t,this._skewX=t;}},{key:"setSkewX",value:function(t){return this.skewX=t,this}},{key:"rtl",get:function(){return this._rtl},set:function(t){t=!!t,this.dirty=this.dirty||this._rtl!=t,this._rtl=t;}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},{key:"updateTexture",value:function(){return this.clear(),ud.call(this),p(h(i.prototype),"updateTexture",this).call(this),this}}]),i}(Yc(pe));T.register("circularProgressCanvas",(function(t,e,i,n,s,r,o){var a=new pd(this.scene,t,e,i,n,s,r,o);return this.scene.add.existing(a),a})),Z(window,"RexPlugins.UI.LineProgressCanvas",pd),Phaser.Math.Wrap;var vd=Phaser.Math.Linear,gd=function(){var t,e,i,n,s,r,o=this.getShape("triangle"),a=this.padding,h=this.width-a.right,l=0+a.left,u=this.height-a.bottom,c=0+a.top,d=(l+h)/2,f=(c+u)/2,p={0:{a:{x:l,y:c},b:{x:h,y:f},c:{x:l,y:u}},1:{a:{x:l,y:c},b:{x:d,y:u},c:{x:h,y:c}},2:{a:{x:h,y:c},b:{x:l,y:f},c:{x:h,y:u}},3:{a:{x:l,y:u},b:{x:d,y:c},c:{x:h,y:u}}};if(void 0===this.previousDirection){var v=p[this.direction],g=v.a,y=v.b,k=v.c;t=g.x,e=g.y,i=y.x,n=y.y,s=k.x,r=k.y;}else {var m=p[this.previousDirection],b=p[this.direction],x=this.easeDirectionProgress;t=vd(m.a.x,b.a.x,x),e=vd(m.a.y,b.a.y,x),i=vd(m.b.x,b.b.x,x),n=vd(m.b.y,b.b.y,x),s=vd(m.c.x,b.c.x,x),r=vd(m.c.y,b.c.y,x);}o.startAt(t,e).lineTo(i,n).lineTo(s,r),this.arrowOnly?o.end():o.close();},yd=(0, Phaser.Math.DegToRad)(120),kd=function(t){t=this.getShape("triangle");var e=this.width/2,i=this.height/2,n=Math.min(e,i)*this.radius,s=this.verticeRotation;t.startAt(e+n*Math.cos(s+yd),i+n*Math.sin(s+yd)).lineTo(e+n*Math.cos(s),i+n*Math.sin(s)).lineTo(e+n*Math.cos(s-yd),i+n*Math.sin(s-yd)),this.arrowOnly?t.end():t.close();},md={buildShapes:function(){this.addShape((new Uu).setName("triangle"));},updateShapes:function(){var t=this.getShape("triangle");this.arrowOnly?t.fillStyle().lineStyle(this.lineWidth,this.strokeColor,this.strokeAlpha):t.fillStyle(this.fillColor,this.fillAlpha).lineStyle(this.lineWidth,this.strokeColor,this.strokeAlpha),0===this.shapeMode?gd.call(this):kd.call(this);}},bd={setEaseDuration:function(t){return void 0===t&&(t=0),this.easeDuration=t,this},playEaseDirectionation:function(){return void 0===this.easeDirectionProgressTask&&(this.easeDirectionProgressTask=new ec(this,{eventEmitter:null})),this.easeDirectionProgressTask.restart({key:"easeDirectionProgress",from:0,to:1,duration:this.easeDuration}),this},stopEaseDirection:function(){return void 0===this.easeDirectionProgressTask||this.easeDirectionProgressTask.stop(),this}},xd=Phaser.Utils.Objects.GetValue,Cd=Phaser.Utils.Objects.IsPlainObject,wd=Phaser.Math.DegToRad,Sd=Phaser.Math.RadToDeg,Pd=function(t){a(s,t);var e=d(s);function s(t,i,r,o,a,h,l){var u,c,d,f,p,v,g,y,k;if(n(this,s),Cd(i)){var m=i;i=m.x,r=m.y,o=m.width,a=m.height,h=m.color,l=m.alpha,c=m.strokeColor,d=m.strokeAlpha,f=m.strokeWidth,p=m.arrowOnly,v=m.direction,g=m.easeDuration,y=m.padding,k=m.radius;}return void 0===i&&(i=0),void 0===r&&(r=0),void 0===o&&(o=1),void 0===a&&(a=o),void 0===p&&(p=!1),void 0===v&&(v=0),void 0===g&&(g=0),void 0===y&&(y=0),void 0===k&&(k=void 0),(u=e.call(this,t,i,r,o,a)).type="rexTriangle",u.setFillStyle(h,l),void 0!==c&&void 0===f&&(f=2),u.setStrokeStyle(f,c,d),u.setArrowOnly(p),u.setDirection(v,g),u.setPadding(y),u.setRadius(k),u.buildShapes(),u}return r(s,[{key:"arrowOnly",get:function(){return this._arrowOnly},set:function(t){this.dirty=this.dirty||this._arrowOnly!=t,this._arrowOnly=t;}},{key:"setArrowOnly",value:function(t){return void 0===t&&(t=!0),this.arrowOnly=t,this}},{key:"direction",get:function(){return this._direction},set:function(t){t=Od(t),this._direction!==t&&(this.easeDuration>0&&void 0!==this._direction?this.previousDirection=this._direction:this.previousDirection=void 0,this._direction=t,this.verticeAngle=90*t,this.dirty=!0,void 0!==this.previousDirection?this.playEaseDirectionation():this.stopEaseDirection());}},{key:"setDirection",value:function(t,e){return void 0!==e&&this.setEaseDuration(e),this.direction=t,this}},{key:"toggleDirection",value:function(t){return this.setDirection(this.direction+2,t),this}},{key:"easeDirectionProgress",get:function(){return this._easeDirectionProgress},set:function(t){this._easeDirectionProgress!==t&&(this._easeDirectionProgress=t,this.dirty=!0);}},{key:"setPadding",value:function(t,e,n,s){if("object"===i(t)){var r=t,o=xd(r,"x",null);null!==o?(t=o,n=o):(t=xd(r,"left",0),n=xd(r,"right",t));var a=xd(r,"y",null);null!==a?(e=a,s=a):(e=xd(r,"top",0),s=xd(r,"bottom",e));}else void 0===t&&(t=0),void 0===e&&(e=t),void 0===n&&(n=t),void 0===s&&(s=e);return void 0===this.padding&&(this.padding={}),this.dirty=this.dirty||this.padding.left!=t||this.padding.top!=e||this.padding.right!=n||this.padding.bottom!=s,this.padding.left=t,this.padding.top=e,this.padding.right=n,this.padding.bottom=s,this.setRadius(),this}},{key:"radius",get:function(){return this._radius},set:function(t){this.dirty=this.dirty||this._radius!=t,this._radius=t;}},{key:"setRadius",value:function(t){return this.radius=t,this.shapeMode=null==t?0:1,this}},{key:"verticeRotation",get:function(){return this._verticeRotation},set:function(t){this.dirty=this.dirty||this._verticeRotation!=t,this._verticeRotation=t;}},{key:"setVerticeRotation",value:function(t){return this.verticeRotation=t,this}},{key:"verticeAngle",get:function(){return Sd(this.verticeRotation)},set:function(t){this.verticeRotation=wd(t);}},{key:"setVerticeAngle",value:function(t){return this.verticeAngle=t,this}}]),s}(du),Td={right:0,down:1,left:2,up:3},Od=function(t){return "string"==typeof t&&(t=Td[t]),t%=4};Object.assign(Pd.prototype,md,bd),T.register("triangle",(function(t,e,i,n,s,r){var o=new Pd(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.Triangle",Pd),lt();var Md=Phaser.GameObjects.Zone,Ed=Phaser.Utils.Array.Add,_d=Phaser.Utils.Array.Remove,Rd=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a){var h;return n(this,i),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=1),void 0===a&&(a=1),(h=e.call(this,t,s,r,o,a)).children=[],h}return r(i,[{key:"destroy",value:function(t){if(this.scene&&!this.ignoreDestroy){if(t)for(var e,n=this.children.length-1;n>=0;n--)(e=this.children[n]).parentContainer||e.displayList||e.destroy(t);this.clear(!t),p(h(i.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 Ed(this.children,t,0,(function(t){t.once("destroy",e.onChildDestroy,e);}),this),this}},{key:"remove",value:function(t,e){var i=this;return _d(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;i0;){var n=i.shift();!e(n)&&n.isRexContainerLite&&i.push.apply(i,m(n.children));}},df=Phaser.Utils.Array,ff={getChildren:function(t){if(t)for(var e=0,i=this.children.length;e=0;e--)this.remove(this.backgroundChildren[e],t);return this}},Ep=function(t,e){if("string"==typeof t)this.childrenMap[t]=e;else {var i=t;for(t in i)this.childrenMap[t]=i[t];}return this},_p=/(\S+)\[(\d+)\]/i,Rp={getInnerPadding:function(t){return On(this.space,t)},setInnerPadding:function(t,e){return Mn(this.space,t,e),this},getOuterPadding:function(t){return On(this.getSizerConfig(this).padding,t)},setOuterPadding:function(t,e){return Mn(this.getSizerConfig(this).padding,t,e),this},getChildOuterPadding:function(t,e){return "string"==typeof t&&(t=this.getElement(t)),On(this.getSizerConfig(t).padding,e)},setChildOuterPadding:function(t,e,i){return "string"==typeof t&&(t=this.getElement(t)),Mn(this.getSizerConfig(t).padding,e,i),this}},Lp=function(t){var e=this.childrenWidth,i=void 0!==this.minWidth?this.minWidth:0;return void 0===t?(t=Math.max(i,e),this.layoutWarnEnable&&i>0&&e>i&&console.warn("Layout width warn: ".concat(this.constructor.name,"'s minWidth (").concat(i,") < childrenWidth (").concat(e,")"))):this.layoutWarnEnable&&(i>t||e>t)&&console.warn("Layout width warn: ".concat(this.constructor.name,"'s minWidth (").concat(i,") or childrenWidth (").concat(e," > targetWidth ").concat(t,")")),t},Bp=function(t){var e=this.childrenHeight,i=void 0!==this.minHeight?this.minHeight:0;return void 0===t?(t=Math.max(i,e),this.layoutWarnEnable&&i>0&&e>i&&console.warn("Layout height warn: ".concat(this.constructor.name,"'s minHeight (").concat(i,") < childrenHeight (").concat(e,")"))):this.layoutWarnEnable&&(i>t||e>t)&&console.warn("Layout height warn: ".concat(this.constructor.name,"'s minHeight (").concat(i,") or childrenHeight (").concat(e,") > targetHeight (").concat(t,")")),t},Dp={getShownChildren:function(t){void 0===t&&(t=[]);for(var e,i=this.children,n=0,s=i.length;n0;){var i=e.shift();i.rexSizer&&i.rexSizer.hidden||(i!==this&&t.push(i),i.isRexContainerLite&&e.push.apply(e,m(i.children)));}return t}},Ip=function(){this._childrenWidth=void 0,this._childrenHeight=void 0;for(var t,e=this.getChildrenSizers(),i=0,n=e.length;i0){var e=t.runTransitionInCallback();t.delayCall(e,this.next,this);}else this.next();}},{key:"exit_TRANS_OPNE",value:function(){this.parent.removeDelayCall();}},{key:"next_OPEN",value:function(){return "TRANS_CLOSE"}},{key:"enter_OPEN",value:function(){this.parent.onOpen();}},{key:"exit_OPEN",value:function(){this.parent.removeDelayCall();}},{key:"next_TRANS_CLOSE",value:function(){return "CLOSE"}},{key:"enter_TRANS_CLOSE",value:function(){var t=this.parent;if(t.transitOutTime>0){var e=t.runTransitionOutCallback();t.delayCall(e,this.next,this);}else this.next();}},{key:"exit_TRANS_CLOSE",value:function(){this.parent.removeDelayCall();}},{key:"next_CLOSE",value:function(){return "TRANS_OPNE"}},{key:"enter_CLOSE",value:function(){this.parent.onClose();}},{key:"exit_CLOSE",value:function(){}},{key:"canOpen",value:function(){return "IDLE"===this.state||"CLOSE"===this.state}},{key:"canClose",value:function(){return "IDLE"===this.state||"OPEN"===this.state}}]),i}(Wv),Vv={delayCall:function(t,e,i){return this.delayCallTimer=function(t,e,i,n,s){var r=so(t);return r.time.delayedCall(e,(function(){r.game.events.once("poststep",(function(){i.call(n,s);}));}))}(this,t,e,i),this},removeDelayCall:function(){return this.delayCallTimer&&(this.delayCallTimer.remove(!1),this.delayCallTimer=void 0),this}},Xv={setTransitInTime:function(t){return this.transitInTime=t,this},setTransitOutTime:function(t){return this.transitOutTime=t,this},setTransitInCallback:function(t){return t||(t=D),this.transitInCallback=t,this},setTransitOutCallback:function(t){return t||(t=D),this.transitOutCallback=t,this}},Gv={runTransitionInCallback:function(){return this.transitInCallback(this.parent,this.transitInTime),this.transitInTime},onOpen:function(){},requestOpen:function(t,e){if(!this._state.canOpen())return this;this.openEventData=arguments.length>0?t:this.parent;var i=this.transitInTime;return void 0!==e&&(this.transitInTime=e),this._state.goto("TRANS_OPNE"),this.transitInTime=i,this}},Uv={runTransitionOutCallback:function(){return this.transitOutCallback(this.parent,this.transitOutTime),this.transitOutTime},onClose:function(){this.oneShotMode&&this.parent.destroy();},requestClose:function(t,e){if(!this._state.canClose)return this;this.closeEventData=arguments.length>0?t:this.parent;var i=this.transitOutTime;return void 0!==e&&(this.transitOutTime=e),this._state.goto("TRANS_CLOSE"),this.transitOutTime=i,this}},Hv={};Object.assign(Hv,Vv,Xv,Gv,Uv);var Nv=Phaser.Utils.Objects.GetValue,Kv=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).setTransitInTime(Nv(s,"duration.in",200)),r.setTransitOutTime(Nv(s,"duration.out",200)),r.setTransitInCallback(Nv(s,"transitIn")),r.setTransitOutCallback(Nv(s,"transitOut")),r.oneShotMode=Nv(s,"destroy",!1),r.delayCallTimer=void 0,r._state=new Yv(u(r),{eventEmitter:!1,initState:Nv(s,"initState","IDLE")}),r.openEventData=void 0,r.closeEventData=void 0,r}return r(i,[{key:"state",get:function(){return this._state.state}},{key:"shutdown",value:function(t){this.isShutdown||(this.transitInCallback=void 0,this.transitOutCallback=void 0,this.openEventData=void 0,this.closeEventData=void 0,this.removeDelayCall(),p(h(i.prototype),"shutdown",this).call(this,t));}}]),i}(oo);Object.assign(Kv.prototype,Hv);var Jv=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;return n(this,i),(o=e.call(this,t,0,0,2,2,s,1)).setAlpha(r),o.setScrollFactor(0),o.boot(),o}return r(i,[{key:"boot",value:function(){this.scene.sys.events.on("prerender",this.resize,this);}},{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.scene.sys.events.off("prerender",this.resize,this),p(h(i.prototype),"destroy",this).call(this,t));}},{key:"tint",get:function(){return this.fillColor},set:function(t){this.setFillStyle(t,this.fillAlpha);}},{key:"resize",value:function(){var t=this.scene,e=t.sys.scale.gameSize,i=t.sys.cameras.main,n=e.width,s=e.height,r=1/i.zoom,o=n/2,a=s/2,h=n*r,l=s*r;this.x===o&&this.y===a||this.setPosition(o,a),this.width===h&&this.height===l||this.setSize(h,l).setOrigin(.5);}}]),i}(Phaser.GameObjects.Rectangle),Zv=Phaser.Utils.Objects.GetValue,qv=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,{eventEmitter:!1})).resetFromJSON(s),r.boot(),r}return r(i,[{key:"resetFromJSON",value:function(t){return this.setHitAreaMode(Zv(t,"hitAreaMode",0)),this.setEnable(Zv(t,"enable",!0)),this.setStopMode(Zv(t,"stopAllLevels",!0)),this}},{key:"boot",value:function(){this.parent.on("pointerdown",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerup",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointermove",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerover",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerout",(function(t,e){this.stopAllLevels&&e.stopPropagation();}),this);}},{key:"setHitAreaMode",value:function(t){"string"==typeof t&&(t=$v[t]);var e=this.parent;return e.input&&e.removeInteractive(),0===t?e.setInteractive():e.setInteractive({hitArea:{},hitAreaCallback:function(){return !0}}),this}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),t?this.parent.setInteractive():this.parent.disableInteractive(),this.enable=t,this}},{key:"setStopMode",value:function(t){return void 0===t&&(t=!0),this.stopAllLevels=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}}]),i}(oo),$v={default:0,fullWindow:1},Qv=Phaser.Utils.Objects.GetValue,tg=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=Qv(s,"color",0),a=Qv(s,"alpha",.8);return (r=e.call(this,t,o,a)).touchEventStop=new qv(u(r),{hitAreaMode:1}),r}return r(i)}(Jv),eg=function(t,e){void 0!==t._modalScaleSave?(t.scaleX=t._modalScaleSave,t.scaleY=t._modalScaleSave):t._modalScaleSave=t.scaleX,Xp(t,e);},ig=function(t,e){Gp(t,e,void 0,void 0,!1);},ng=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,tv(t,e);},sg=function(t,e){ev(t,e,!1);},rg=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,tv(t,e,t.alpha);},og=function(t,e){ev(t,e,!1);},ag=function(t,e,i,n,s){return !!t&&(!(n&&!n(t,e,i))&&(!!Ir(t,!0).contains(e,i)&&!(s&&!s(t,e,i))))},hg=Phaser.Utils.Objects.GetValue,lg=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),null==s.transitIn&&(s.transitIn=ug.popUp),null==s.transitOut&&(s.transitOut=ug.scaleDown),s.destroy=hg(s,"destroy",!0),r=e.call(this,t,s);var o=hg(s,"cover");r.cover=!1!==o?function(t,e){var i=t.scene,n=new tg(i,e);return i.add.existing(n),t.isRexContainerLite?(t.pin(n,{syncPosition:!1,syncRotation:!1,syncScale:!1,syncAlpha:!1,syncScrollFactor:!1}),t.moveDepthBelow(n)):i.children.moveBelow(n,t),n}(t,o):void 0,r.cover&&(r.setCoverTransitInCallback(hg(o,"transitIn",rg)),r.setCoverTransitOutCallback(hg(o,"transitOut",og)));var a=hg(s,"touchOutsideClose",!1),h=hg(s,"duration.hold",-1),l=hg(s,"timeOutClose",h>=0),c=hg(s,"anyTouchClose",!1);return hg(s,"manualClose",!1)&&(a=!1,c=!1,l=!1),c&&(a=!1),l?r.setDisplayTime(h):r.setDisplayTime(-1),c?r.once("open",r.anyTouchClose,u(r)):a&&r.once("open",r.touchOutsideClose,u(r)),hg(s,"openOnStart",!0)&&r.delayCall(0,r.requestOpen,u(r)),r}return r(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.cover||this.scene.input.off("pointerup",this.touchCloseCallback,this),this.cover&&!t&&(this.cover.destroy(),this.cover=void 0),p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"touchOutsideClose",value:function(){return this.cover?this.cover.on("pointerup",this.touchCloseCallback,this):this.scene.input.on("pointerup",this.touchCloseCallback,this),this.clickOutsideTest=!0,this}},{key:"anyTouchClose",value:function(){return this.cover?this.cover.once("pointerup",this.touchCloseCallback,this):this.scene.input.once("pointerup",this.touchCloseCallback,this),this}},{key:"touchCloseCallback",value:function(t){this.clickOutsideTest&&ag(this.parent,t.worldX,t.worldY)||this.requestClose();}},{key:"runTransitionInCallback",value:function(){var t=p(h(i.prototype),"runTransitionInCallback",this).call(this),e=this.cover;return e&&this.coverTransitInCallback&&this.coverTransitInCallback(e,t),t}},{key:"runTransitionOutCallback",value:function(){var t=p(h(i.prototype),"runTransitionOutCallback",this).call(this),e=this.cover;return e&&this.coverTransitOutCallback&&this.coverTransitOutCallback(e,t),t}},{key:"onOpen",value:function(){var t=this.displayTime;t>=0&&this.delayCall(t,this.requestClose,this),this.emit("open",this.parent,this),p(h(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.closeEventData),p(h(i.prototype),"onClose",this).call(this);}},{key:"setDisplayTime",value:function(t){return this.displayTime=t,this}},{key:"setTransitInCallback",value:function(t){switch("string"==typeof t&&(t=ug[t]),t){case ug.popUp:t=eg;break;case ug.fadeIn:t=ng;}return p(h(i.prototype),"setTransitInCallback",this).call(this,t),this}},{key:"setTransitOutCallback",value:function(t){switch("string"==typeof t&&(t=ug[t]),t){case ug.scaleDown:t=ig;break;case ug.fadeOut:t=sg;}return p(h(i.prototype),"setTransitOutCallback",this).call(this,t),this}},{key:"setCoverTransitInCallback",value:function(t){return this.coverTransitInCallback=t,this}},{key:"setCoverTransitOutCallback",value:function(t){return this.coverTransitOutCallback=t,this}}]),i}(Kv),ug={popUp:0,fadeIn:1,scaleDown:0,fadeOut:1},cg=function(t,e){var i=new lg(t,e);return i.on("open",(function(){t.emit("modal.open",i);})),i.on("close",(function(e){t.emit("modal.close",e,i);})),t.on("modal.requestClose",i.requestClose,i),i},dg=function(t,e){t.emit("modal.requestClose",e);},fg=function(t){return t&&"function"==typeof t},pg={modal:function(t,e){return fg(t)&&(e=t,t=void 0),void 0===this._modalBehavior&&(this.onCreateModalBehavior&&this.onCreateModalBehavior(this,t),this._modalBehavior=cg(this,t)),e&&this._modalBehavior.once("close",e),this._modalBehavior.requestOpen(),this},modalPromise:function(t){var e=this;return new Promise((function(i,n){e.modal(t,i);}))},modalClose:function(t){return dg(this,t),this}},vg=function(t,e,i,n){if(e)return ag(t,e.worldX,e.worldY,i,n);for(var s=t.scene.input.manager,r=s.pointersTotal,o=s.pointers,a=0;a=this.dragThreshold||this.isPointerInside(t))&&this.cancel();}},{key:"click",value:function(t,e){if(!this.enable)return this;if(void 0===t)return this.emit("clickoutside",this,this.parent,e),this;this.pointer=void 0;var i=this.lastClickTime;return void 0!==i&&t-i<=this.clickInterval||(this.lastClickTime=t,this.emit("clickoutside",this,this.parent,e)),this}},{key:"cancel",value:function(){return this.pointer=void 0,this}}]),i}(oo),Lg={press:0,pointerdown:0,release:1,pointerup:1},Bg={onClickOutside:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._clickOutside&&(t._clickOutside=new Rg(t,n)),t._clickOutside.on("clickoutside",e,i),this):this},offClickOutside:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._clickOutside||t._clickOutside.off("clickoutside",e,i),this},enableClickOutside:function(t,e){return t&&"object"!==i(t)&&(e=t,t=this),void 0===t._clickOutside||t._clickOutside.setEnable(e),this},disableClickOutside:function(t){return t&&"object"!==i(t)&&(t=this),void 0===t._clickOutside||t._clickOutside.setEnable(!1),this}},Dg=function(t){a(i,t);var e=d(i);function i(){var t;return n(this,i),(t=e.call(this,{eventEmitter:!1})).goto("IDLE"),t}return r(i,[{key:"setCooldownTime",value:function(t){return this.cooldownTime=t,this.cooldownMode=void 0!==t,this}},{key:"request",value:function(){return this.runMethod("request")}},{key:"update_IDLE",value:function(){this.compensationTime=0;}},{key:"request_IDLE",value:function(){return this.next(),!0}},{key:"next_IDLE",value:function(){if(this.cooldownMode)return "COOLDOWN"}},{key:"enter_COOLDOWN",value:function(){this.remainderTime=this.cooldownTime+this.compensationTime;}},{key:"update_COOLDOWN",value:function(t,e){this.remainderTime-=e,this.remainderTime<0&&(this.compensationTime=this.cooldownTime>e?-this.remainderTime:0,this.goto("IDLE"));}},{key:"request_COOLDOWN",value:function(){return !1}}]),i}(Wv),Ig=Phaser.Utils.Objects.GetValue,jg=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s))._enable=void 0,r.cooldown=new Dg,r.parent.setInteractive(Ig(s,"inputConfig",void 0)),r.resetFromJSON(s),r.boot(),r}return r(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.prevIsInTouch=!1,this.isInTouching=!1,this.setEnable(Ig(t,"enable",!0)),this.setCooldown(Ig(t,"cooldown",void 0)),this}},{key:"boot",value:function(){var t=this.parent;t.on("pointerdown",this.onPointIn,this),t.on("pointerover",this.onPointIn,this),t.on("pointerup",this.onPointOut,this),t.on("pointerout",this.onPointOut,this),this.scene.sys.events.on("preupdate",this.preupdate,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.scene.sys.events.off("preupdate",this.preupdate,this),this.pointer=void 0,p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t)return t||(this.prevIsInTouch=!1,this.isInTouching=!1,this.pointer=void 0),this._enable=t,this}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"cooldownTime",get:function(){return this.cooldown.cooldownTime},set:function(t){this.cooldown.setCooldownTime(t);}},{key:"setCooldown",value:function(t){return this.cooldownTime=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"onPointIn",value:function(t,e,i){this.enable&&t.isDown&&void 0===this.pointer&&(this.pointer=t,this.isInTouching=!0);}},{key:"onPointOut",value:function(t){this.enable&&this.pointer===t&&(this.pointer=void 0,this.isInTouching=!1);}},{key:"preupdate",value:function(t,e){this.cooldown.update(t,e),!this.prevIsInTouch&&this.isInTouching&&this.emit("touchstart",this,this.parent),this.isInTouching&&this.cooldown.request()&&this.emit("intouch",this,this.parent,this.pointer),this.prevIsInTouch&&!this.isInTouching&&this.emit("touchend",this,this.parent),this.prevIsInTouch=this.isInTouching;}}]),i}(oo),zg={isPointerInBounds:function(t){return void 0===t?t=this:"string"==typeof t&&(t=this.getElement(t)),!!t&&vg(t)},onTouching:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._inTouching&&(t._inTouching=new jg(t,n)),t._inTouching.on("intouch",e,i),this):this},offTouching:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._inTouching||t._inTouching.off("intouch",e,i),this},onTouchingEnd:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._inTouching&&(t._inTouching=new jg(t,n)),t._inTouching.on("touchend",e,i),this):this},offTouchingEnd:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._inTouching||t._inTouching.off("touchend",e,i),this},enableTouching:function(t,e){return t&&"object"!==i(t)&&(e=t,t=this),void 0===t._inTouching||t._inTouching.setEnable(e),this},disableTouching:function(t){return t&&"object"!==i(t)&&(t=this),void 0===t._inTouching||t._inTouching.setEnable(!1),this}},Ag=function(t,e,i){for(var n,s=0,r=t.length;s0),this.onDragStart()));}},{key:"onPointerUp",value:function(t){this.enable&&((!this.bounds||this.bounds.contains(t.x,t.y))&&this.pointer===t&&(this.pointer=void 0,this.movedState=!1,this.tracerState=ty,this.onDragEnd()));}},{key:"onPointerMove",value:function(t){if(this.enable&&t.isDown){var e=!this.bounds||this.bounds.contains(t.x,t.y),i=this.pointer===t;!i&&e||(i&&!e?this.onPointerUp(t):(this.movedState||(this.movedState=t.x!==t.downX||t.y!==t.downY),this.movedState&&this.onDrag()));}}},{key:"dragCancel",value:function(){return this.tracerState===ey&&this.onDragEnd(),this.pointer=void 0,this.tracerState=ty,this}},{key:"onDragStart",value:function(){this.emit("dragstart",this);}},{key:"onDragEnd",value:function(){this.emit("dragend",this);}},{key:"onDrag",value:function(){this.emit("drag",this);}},{key:"preUpdate",value:function(t,e){}},{key:"postUpdate",value:function(t,e){}},{key:"startTicking",value:function(){p(h(i.prototype),"startTicking",this).call(this),this.scene.sys.events.on("preupdate",this.preUpdate,this),this.scene.sys.events.on("postupdate",this.postUpdate,this);}},{key:"stopTicking",value:function(){p(h(i.prototype),"stopTicking",this).call(this),this.scene&&(this.scene.sys.events.off("preupdate",this.preUpdate,this),this.scene.sys.events.off("postupdate",this.postUpdate,this));}},{key:"setRecongizedStateObject",value:function(t){return this.recongizedState=t,this}},{key:"state",get:function(){return this.recongizedState.state},set:function(t){this.recongizedState.state=t;}},{key:"cancel",value:function(){return this.state=iy,this}}]),i}(ho),ty=0,ey=1,iy="IDLE",ny=Phaser.Utils.Objects.GetValue,sy=Phaser.Math.Distance.Between,ry=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=u(r=e.call(this,t,s)),a={states:{IDLE:{enter:function(){o.stop(),o.tapsCount=0,o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.start(),o.tapsCount=0,o.emit("tappingstart",o,o.gameObject,o.lastPointer);}},RECOGNIZED:{enter:function(){o.start(),o.emit("tap",o,o.gameObject,o.lastPointer),o.emit("".concat(o.tapsCount,"tap"),o,o.gameObject,o.lastPointer);}}},init:function(){this.state=oy;},eventEmitter:!1};return r.setRecongizedStateObject(new Wv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setHoldTime(ny(t,"time",250)),this.setTapInterval(ny(t,"tapInterval",200)),this.setDragThreshold(ny(t,"threshold",9)),this.setTapOffset(ny(t,"tapOffset",10));var e=ny(t,"taps",void 0);return void 0!==e?this.setTaps(e):(this.setMaxTaps(ny(t,"maxTaps",void 0)),this.setMinTaps(ny(t,"minTaps",void 0))),this}},{key:"onDragStart",value:function(){switch(this.state){case oy:this.state=ay;break;case ay:var t=this.lastPointer;sy(t.upX,t.upY,t.x,t.y)>this.tapOffset&&(this.state=hy,this.state=ay);break;case hy:this.state=ay;}}},{key:"onDragEnd",value:function(){this.state===ay&&(this.tapsCount++,this.emit("tapping",this,this.gameObject,this.lastPointer),void 0!==this.maxTaps&&this.tapsCount===this.maxTaps&&(this.state=hy));}},{key:"onDrag",value:function(){this.state!==oy&&this.pointer.getDistance()>this.dragThreshold&&(this.state=oy);}},{key:"preUpdate",value:function(t,e){if(this.isRunning&&this.enable&&this.state===ay){var i=this.lastPointer;if(i.isDown)t-i.downTime>this.holdTime&&(this.state=oy);else t-i.upTime>this.tapInterval&&(void 0===this.minTaps||this.tapsCount>=this.minTaps?this.state=hy:this.state=oy);}}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===hy&&(this.state=oy);}},{key:"isTapped",get:function(){return this.state===hy}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setTapInterval",value:function(t){return this.tapInterval=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"setTapOffset",value:function(t){return this.tapOffset=t,this}},{key:"setMaxTaps",value:function(t){return this.maxTaps=t,this}},{key:"setMinTaps",value:function(t){return this.minTaps=t,this}},{key:"setTaps",value:function(t,e){return void 0===e&&(e=t),this.setMinTaps(t).setMaxTaps(e),this}}]),i}(Qg),oy="IDLE",ay="BEGIN",hy="RECOGNIZED",ly=Phaser.Utils.Objects.GetValue,uy=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=u(r=e.call(this,t,s)),a={states:{IDLE:{enter:function(){o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.start();},exit:function(){o.stop();}},RECOGNIZED:{enter:function(){o.emit("pressstart",o,o.gameObject,o.lastPointer);},exit:function(){o.emit("pressend",o,o.gameObject,o.lastPointer);}}},init:function(){this.state=cy;},eventEmitter:!1};return r.setRecongizedStateObject(new Wv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(ly(t,"threshold",9)),this.setHoldTime(ly(t,"time",251)),this}},{key:"onDragStart",value:function(){this.state=dy,0===this.holdTime&&(this.state=fy);}},{key:"onDragEnd",value:function(){this.state=cy;}},{key:"onDrag",value:function(){this.state!==cy&&this.pointer.getDistance()>this.dragThreshold&&(this.state=cy);}},{key:"preUpdate",value:function(t,e){this.isRunning&&this.enable&&(this.state===dy&&t-this.pointer.downTime>=this.holdTime&&(this.state=fy));}},{key:"isPressed",get:function(){return this.state===fy}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Qg),cy="IDLE",dy="BEGIN",fy="RECOGNIZED",py=Phaser.Utils.Objects.GetValue,vy=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=u(r=e.call(this,t,s)),a={states:{IDLE:{},BEGIN:{enter:function(){var t=o.pointer;o.startX=t.x,o.startY=t.y,o.startWorldX=t.worldX,o.startWorldY=t.worldY;}},RECOGNIZED:{enter:function(){o.emit("panstart",o,o.gameObject,o.lastPointer);},exit:function(){var t=o.lastPointer;o.endX=t.x,o.endY=t.y,o.endWorldX=t.worldX,o.endWorldY=t.worldY,o.emit("panend",o,o.gameObject,o.lastPointer);}}},init:function(){this.state=gy;},eventEmitter:!1};return r.setRecongizedStateObject(new Wv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(py(t,"threshold",10)),this}},{key:"onDragStart",value:function(){this.state=yy,0===this.dragThreshold&&(this.state=ky);}},{key:"onDragEnd",value:function(){this.state=gy;}},{key:"onDrag",value:function(){switch(this.state){case yy:this.pointer.getDistance()>=this.dragThreshold&&(this.state=ky);break;case ky:var t=this.pointer.position,e=this.pointer.prevPosition;this.dx=t.x-e.x,this.dy=t.y-e.y;var i=this.pointer;this.x=i.x,this.y=i.y,this.worldX=i.worldX,this.worldY=i.worldY,this.emit("pan",this,this.gameObject,this.lastPointer);}}},{key:"isPanned",get:function(){return this.state===ky}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Qg),gy="IDLE",yy="BEGIN",ky="RECOGNIZED",my=Phaser.Math.Distance.Between,by=Phaser.Math.Angle.Between,xy={getDt:function(){return nu(this.scene)},getVelocity:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return my(e.x,e.y,t.x,t.y)/(.001*this.getDt())},getVelocityX:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Math.abs(t.x-e.x)/(.001*this.getDt())},getVelocityY:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Math.abs(t.y-e.y)/(.001*this.getDt())},getVelocityAngle:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return by(e.x,e.y,t.x,t.y)}},Cy={"up&down":0,"left&right":1,"4dir":2,"8dir":3},wy={},Sy=Phaser.Utils.Objects.GetValue,Py=Phaser.Math.RadToDeg,Ty=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=u(r=e.call(this,t,s)),a={states:{IDLE:{enter:function(){o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.validDrag=!1;}},RECOGNIZED:{enter:function(){o.start(),o.updateDirectionStates(),o.emit("swipe",o,o.gameObject,o.lastPointer);},exit:function(){o.stop(),o.clearDirectionStates();}}},init:function(){this.state=Oy;},eventEmitter:!1};return r.setRecongizedStateObject(new Wv(a)),r.clearDirectionStates(),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Sy(t,"threshold",10)),this.setVelocityThreshold(Sy(t,"velocityThreshold",1e3)),this.setDirectionMode(Sy(t,"dir","8dir")),this}},{key:"onDragStart",value:function(){this.state=My;}},{key:"onDragEnd",value:function(){this.state=Oy;}},{key:"onDrag",value:function(){this.state===My&&(this.validDrag||(this.validDrag=0===this.dragThreshold||this.pointer.getDistance()>=this.dragThreshold),this.validDrag&&this.dragVelocity>this.velocityThreshold&&(this.state=Ey));}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===Ey&&(this.state=Oy);}},{key:"isSwiped",get:function(){return this.state===Ey}},{key:"dragVelocity",get:function(){var t;switch(this.dirMode){case 0:t=this.getVelocityY();break;case 1:t=this.getVelocityX();break;default:t=this.getVelocity();}return t}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"setVelocityThreshold",value:function(t){return this.velocityThreshold=t,this}},{key:"setDirectionMode",value:function(t){return "string"==typeof t&&(t=Cy[t]),this.dirMode=t,this}},{key:"updateDirectionStates",value:function(){return function(t,e,i){switch(void 0===i?i={}:!0===i&&(i=wy),i.left=!1,i.right=!1,i.up=!1,i.down=!1,t=(t+360)%360,e){case 0:t<180?i.down=!0:i.up=!0;break;case 1:t>90&&t<=270?i.left=!0:i.right=!0;break;case 2:t>45&&t<=135?i.down=!0:t>135&&t<=225?i.left=!0:t>225&&t<=315?i.up=!0:i.right=!0;break;case 3:t>22.5&&t<=67.5?(i.down=!0,i.right=!0):t>67.5&&t<=112.5?i.down=!0:t>112.5&&t<=157.5?(i.down=!0,i.left=!0):t>157.5&&t<=202.5?i.left=!0:t>202.5&&t<=247.5?(i.left=!0,i.up=!0):t>247.5&&t<=292.5?i.up=!0:t>292.5&&t<=337.5?(i.up=!0,i.right=!0):i.right=!0;}}(Py(this.getVelocityAngle()),this.dirMode,this),this}},{key:"clearDirectionStates",value:function(){return this.left=!1,this.right=!1,this.up=!1,this.down=!1,this}}]),i}(Qg);Object.assign(Ty.prototype,xy);var Oy="IDLE",My="BEGIN",Ey="RECOGNIZED",_y=Phaser.Utils.Objects.GetValue,Ry=Phaser.Utils.Array.SpliceOne,Ly=Phaser.Math.Distance.Between,By=Phaser.Math.Angle.Between,Dy=function(){function t(e,i){n(this,t);var s=e.input.manager.pointersTotal-1;s<2&&e.input.addPointer(2-s),this.scene=e,this.setEventEmitter(_y(i,"eventEmitter",void 0)),this._enable=void 0,this.pointers=[],this.movedState={},this.resetFromJSON(i),this.boot();}return r(t,[{key:"resetFromJSON",value:function(t){return this.setEnable(_y(t,"enable",!0)),this.bounds=_y(t,"bounds",void 0),this.tracerState=jy,this.pointers.length=0,xt(this.movedState),this}},{key:"boot",value:function(){this.scene.input.on("pointerdown",this.onPointerDown,this),this.scene.input.on("pointerup",this.onPointerUp,this),this.scene.input.on("gameout",this.dragCancel,this),this.scene.input.on("pointermove",this.onPointerMove,this),this.scene.sys.events.once("shutdown",this.destroy,this);}},{key:"shutdown",value:function(){this.scene&&(this.destroyEventEmitter(),this.pointers.length=0,xt(this.movedState),this.scene.input.off("pointerdown",this.onPointerDown,this),this.scene.input.off("pointerup",this.onPointerUp,this),this.scene.input.off("gameout",this.dragCancel,this),this.scene.input.off("pointermove",this.onPointerMove,this),this.scene.sys.events.off("shutdown",this.destroy,this),this.scene=void 0);}},{key:"destroy",value:function(){this.shutdown();}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t)return t||this.dragCancel(),this._enable=t,this}},{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:"onPointerDown",value:function(t){if(this.enable&&(2!==this.pointers.length&&(!this.bounds||this.bounds.contains(t.x,t.y))&&-1===this.pointers.indexOf(t)))switch(this.movedState[t.id]=!1,this.pointers.push(t),this.tracerState){case jy:this.tracerState=zy,this.onDrag1Start();break;case zy:this.tracerState=Ay,this.onDrag2Start();}}},{key:"onPointerUp",value:function(t){if(this.enable&&(!this.bounds||this.bounds.contains(t.x,t.y))){var e=this.pointers.indexOf(t);if(-1!==e)switch(delete this.movedState[t.id],Ry(this.pointers,e),this.tracerState){case zy:this.tracerState=jy,this.onDrag1End();break;case Ay:this.tracerState=zy,this.onDrag2End(),this.onDrag1Start();}}}},{key:"onPointerMove",value:function(t){if(this.enable&&t.isDown){var e=!this.bounds||this.bounds.contains(t.x,t.y),i=-1!==this.pointers.indexOf(t);if(!i&&e);else if(i&&!e)this.onPointerUp(t);else if(this.movedState[t.id]||(this.movedState[t.id]=t.x!==t.downX||t.y!==t.downY),this.movedState[t.id])switch(this.tracerState){case zy:this.onDrag1();break;case Ay:this.onDrag2();}}}},{key:"dragCancel",value:function(){return this.tracerState===Ay&&this.onDrag2End(),this.pointers.length=0,xt(this.movedState),this.tracerState=jy,this}},{key:"onDrag1Start",value:function(){this.emit("drag1start",this);}},{key:"onDrag1End",value:function(){this.emit("drag1end",this);}},{key:"onDrag1",value:function(){this.emit("drag1",this);}},{key:"onDrag2Start",value:function(){this.emit("drag2start",this);}},{key:"onDrag2End",value:function(){this.emit("drag2end",this);}},{key:"onDrag2",value:function(){this.emit("drag2",this);}},{key:"distanceBetween",get:function(){if(this.tracerState!==Ay)return 0;var t=this.pointers[0],e=this.pointers[1];return Ly(t.x,t.y,e.x,e.y)}},{key:"angleBetween",get:function(){if(this.tracerState!==Ay)return 0;var t=this.pointers[0],e=this.pointers[1];return By(t.x,t.y,e.x,e.y)}},{key:"drag1Vector",get:function(){var t=this.pointers[0];if(t&&this.movedState[t.id]){var e=t.position,i=t.prevPosition;Iy.x=e.x-i.x,Iy.y=e.y-i.y;}else Iy.x=0,Iy.y=0;return Iy}},{key:"centerX",get:function(){if(this.tracerState!==Ay)return 0;var t=this.pointers[0].position,e=this.pointers[1].position;return (t.x+e.x)/2}},{key:"centerY",get:function(){if(this.tracerState!==Ay)return 0;var t=this.pointers[0].position,e=this.pointers[1].position;return (t.y+e.y)/2}},{key:"prevCenterX",get:function(){if(this.tracerState!==Ay)return 0;var t=this.movedState[this.pointers[0].id]?this.pointers[0].prevPosition:this.pointers[0].position,e=this.movedState[this.pointers[1].id]?this.pointers[1].prevPosition:this.pointers[1].position;return (t.x+e.x)/2}},{key:"prevCenterY",get:function(){if(this.tracerState!==Ay)return 0;var t=this.movedState[this.pointers[0].id]?this.pointers[0].prevPosition:this.pointers[0].position,e=this.movedState[this.pointers[1].id]?this.pointers[1].prevPosition:this.pointers[1].position;return (t.y+e.y)/2}},{key:"movementCenterX",get:function(){return this.centerX-this.prevCenterX}},{key:"movementCenterY",get:function(){return this.centerY-this.prevCenterY}},{key:"setRecongizedStateObject",value:function(t){return this.recongizedState=t,this}},{key:"state",get:function(){return this.recongizedState.state},set:function(t){this.recongizedState.state=t;}},{key:"cancel",value:function(){return this.state=Fy,this}}]),t}();Object.assign(Dy.prototype,sr);var Iy={},jy=0,zy=1,Ay=2,Fy="IDLE",Wy=Phaser.Utils.Objects.GetValue,Yy=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=u(r=e.call(this,t,s)),a={states:{IDLE:{enter:function(){o.prevDistance=void 0,o.scaleFactor=1;}},BEGIN:{},RECOGNIZED:{enter:function(){o.emit("pinchstart",o);},exit:function(){o.emit("pinchend",o);}}},init:function(){this.state=Vy;},eventEmitter:!1};return r.setRecongizedStateObject(new Wv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Wy(t,"threshold",0)),this}},{key:"onDrag2Start",value:function(){this.scaleFactor=1,this.prevDistance=this.distanceBetween,this.state=Xy,0===this.dragThreshold&&(this.state=Gy);}},{key:"onDrag2End",value:function(){this.state=Vy;}},{key:"onDrag2",value:function(){switch(this.state){case Xy:if(this.pointers[0].getDistance()>=this.dragThreshold&&this.pointers[1].getDistance()>=this.dragThreshold){var t=this.distanceBetween;this.scaleFactor=t/this.prevDistance,this.prevDistance=t,this.state=Gy;}break;case Gy:t=this.distanceBetween;this.scaleFactor=t/this.prevDistance,this.emit("pinch",this),this.prevDistance=t;}}},{key:"isPinched",get:function(){return this.state===Gy}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Dy),Vy="IDLE",Xy="BEGIN",Gy="RECOGNIZED",Uy=Phaser.Math.RotateAround,Hy=function(t,e,i,n){return Uy(t,e,i,n),t.rotation+=n,t},Ny={},Ky=Phaser.Utils.Objects.GetValue,Jy=Phaser.Math.Angle.WrapDegrees,Zy=Phaser.Math.Angle.ShortestBetween,qy=Phaser.Math.RadToDeg,$y=Phaser.Math.DegToRad,Qy=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=u(r=e.call(this,t,s)),a={states:{IDLE:{enter:function(){o.prevAngle=void 0,o.angle=0;}},BEGIN:{},RECOGNIZED:{enter:function(){o.emit("rotatestart",o);},exit:function(){o.emit("rotateend",o);}}},init:function(){this.state=ek;},eventEmitter:!1};return r.setRecongizedStateObject(new Wv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Ky(t,"threshold",0)),this}},{key:"onDrag2Start",value:function(){this.prevAngle=Jy(qy(this.angleBetween)),this.state=ik,0===this.dragThreshold&&(this.state=nk);}},{key:"onDrag2End",value:function(){this.state=ek;}},{key:"onDrag2",value:function(){switch(this.state){case ik:if(this.pointers[0].getDistance()>=this.dragThreshold&&this.pointers[1].getDistance()>=this.dragThreshold){var t=Jy(qy(this.angleBetween));this.angle=Zy(this.prevAngle,t),this.prevAngle=t,this.state=nk;}break;case nk:t=Jy(qy(this.angleBetween));this.angle=Zy(this.prevAngle,t),this.prevAngle=t,this.emit("rotate",this);}}},{key:"isRotated",get:function(){return this.state===nk}},{key:"rotation",get:function(){return $y(this.angle)}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Dy),tk={spinObject:function(t,e){if(!this.isRotation)return this;void 0===e&&(e=this.pointers[0].camera);var i=this.movementCenterX,n=this.movementCenterY,s=function(t,e,i,n){return void 0===n?n={}:!0===n&&(n=Ny),i.getWorldPoint(t,e,n),n}(this.centerX,this.centerY,e,!0),r=s.x,o=s.y,a=this.rotation;if(Array.isArray(t))for(var h=t,l=0,u=h.length;l0?f.pop().setTexture(v,B):s(p,v,B),c&&p.add.existing(L),d){var D=w+T*R-M*(R-1)+o*T,I=S+O*_-E*(_-1)+a*O;L.setOrigin(o,a).setPosition(D,I).setScale(m,b).setRotation(x),Mm(L,w,S,x);}P.push(L);}return P}(t,e,i,n),o=0,a=r.length;o=0;n--)(o=s[n])instanceof e&&(o.destroy(),Hm(s,n));else {n=0;for(var s,r=(s=t.postPipelines).length;nn&&(i.width=i.height*n),i}(t,{width:this.width,height:this.height},!0);return t.setDisplaySize(e.width,e.height),this.resetChildScaleState(t),this}},{key:"resize",value:function(t,e){return p(h(i.prototype),"resize",this).call(this,t,e),this.scaleImage(),this}},{key:"setTexture",value:function(t,e){var i=this.image;return i.setTexture(t,e),null!==t?(this.setChildVisible(i,!0),this.scaleImage()):this.setChildVisible(i,!1),this}}]),i}(zf);Object.assign(Qm.prototype,_m),T.register("imageBox",(function(t,e,i,n,s){var r=new Qm(this.scene,t,e,i,n,s);return this.scene.add.existing(r),r})),Z(window,"RexPlugins.UI.ImageBox",Qm),T.register("fullWindowRectangle",(function(t,e){var i=new Jv(this.scene,t,e);return this.scene.add.existing(i),i})),Z(window,"RexPlugins.UI.FullWindowRectangle",Jv),T.register("cover",(function(t){var e=new tg(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Cover",tg);var tb=function(t,e){if(this.scene.sys.scale.autoRound&&(t=Math.floor(t),e=Math.floor(e)),this.width===t&&this.height===e)return this;var i=this.node.style;return i.width="".concat(t,"px"),i.height="".concat(e,"px"),this.updateSize(),this},eb={id:["id",void 0],text:["value",void 0],maxLength:["maxLength",void 0],minLength:["minLength",void 0],placeholder:["placeholder",void 0],tooltip:["title",void 0],readOnly:["readOnly",!1],spellCheck:["spellcheck",!1],autoComplete:["autocomplete","off"]},ib={align:["textAlign",void 0],paddingLeft:["padding-left",void 0],paddingRight:["padding-right",void 0],paddingTop:["padding-top",void 0],paddingBottom:["padding-bottom",void 0],fontFamily:["fontFamily",void 0],fontSize:["font-size",void 0],color:["color","#ffffff"],backgroundColor:["backgroundColor","transparent"],border:["border",0],borderColor:["borderColor","transparent"],outline:["outline","none"],direction:["direction",void 0]},nb={input:"textchange",click:"click",dblclick:"dblclick",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",keydown:"keydown",keyup:"keyup",keypress:"keypress",compositionstart:"compositionStart",compositionend:"compositionEnd",compositionupdate:"compositionUpdate",focus:"focus",blur:"blur",select:"select"},sb=Phaser.Utils.Objects.GetValue,rb=function(t,e,i,n){var s=sb(n,"preventDefault",!1),r=sb(n,"preTest"),o=function(n){e.addEventListener(n,(function(e){r&&!r(t,n)||t.emit(i[n],t,e),s&&e.preventDefault();}));};for(var a in i)o(a);},ob=Phaser.GameObjects.DOMElement,ab=Phaser.Utils.Objects.IsPlainObject,hb=Phaser.Utils.Objects.GetValue,lb=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l,c;n(this,i),ab(s)?(s=hb(h=s,"x",0),r=hb(h,"y",0),o=hb(h,"width",0),a=hb(h,"height",0)):ab(o)&&(o=hb(h=o,"width",0),a=hb(h,"height",0)),void 0===h&&(h={});var d=hb(h,"inputType",void 0);void 0===d&&(d=hb(h,"type","text")),"textarea"===d?(c=document.createElement("textarea")).style.resize="none":(c=document.createElement("input")).type=d,bl(eb,h,c);var f=hb(h,"style",void 0);f=bl(ib,h,f);var p=c.style;for(var v in h)v in eb||v in ib||v in p&&(f[v]=h[v]);return f["box-sizing"]="border-box",(l=e.call(this,t,s,r,c,f)).type="rexInputText",l.resize(o,a),rb(u(l),c,nb),xl(c),hb(h,"selectAll",!1)&&l.selectAll(),l._isFocused=!1,l.on("focus",(function(){this._isFocused=!0;}),u(l)).on("blur",(function(){this._isFocused=!1;}),u(l)),l}return r(i,[{key:"inputType",get:function(){return "textarea"===this.node.tagName.toLowerCase()?"textarea":this.node.type}},{key:"text",get:function(){return this.node.value},set:function(t){this.node.value=t;}},{key:"setText",value:function(t){return this.text=t,this}},{key:"maxLength",get:function(){return this.node.maxLength},set:function(t){this.node.maxLength=t;}},{key:"setMaxLength",value:function(t){return this.maxLength=t,this}},{key:"minLength",get:function(){return this.node.minLength},set:function(t){this.node.minLength=t;}},{key:"setMinLength",value:function(t){return this.minLength=t,this}},{key:"placeholder",get:function(){return this.node.placeholder},set:function(t){this.node.placeholder=t;}},{key:"setPlaceholder",value:function(t){return this.placeholder=t,this}},{key:"selectText",value:function(t,e){return void 0===t?this.node.select():this.node.setSelectionRange(t,e),this}},{key:"selectAll",value:function(){return this.selectText(),this}},{key:"selectionStart",get:function(){return this.node.selectionStart}},{key:"selectionEnd",get:function(){return this.node.selectionEnd}},{key:"selectedText",get:function(){var t=this.node;return t.value.substring(t.selectionStart,t.selectionEnd)}},{key:"cursorPosition",get:function(){return this.node.selectionStart},set:function(t){this.node.setSelectionRange(t,t);}},{key:"setCursorPosition",value:function(t){return void 0===t?t=this.text.length:t<0&&(t=this.text.length+t),this.cursorPosition=t,this}},{key:"tooltip",get:function(){return this.node.title},set:function(t){this.node.title=t;}},{key:"setTooltip",value:function(t){return this.tooltip=t,this}},{key:"setTextChangedCallback",value:function(t){return this.onTextChanged=t,this}},{key:"readOnly",get:function(){return this.node.readOnly},set:function(t){this.node.readOnly=t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}},{key:"spellCheck",get:function(){return this.node.spellcheck},set:function(t){this.node.spellcheck=t;}},{key:"setSpellCheck",value:function(t){return this.spellCheck=t,this}},{key:"fontColor",get:function(){return this.node.style.color},set:function(t){this.node.style.color=t;}},{key:"setFontColor",value:function(t){return this.fontColor=t,this}},{key:"setStyle",value:function(t,e){return this.node.style[t]=e,this}},{key:"getStyle",value:function(t){return this.node.style[t]}},{key:"scrollToBottom",value:function(){return this.node.scrollTop=this.node.scrollHeight,this}},{key:"setEnabled",value:function(t){return void 0===t&&(t=!0),this.node.disabled=!t,this}},{key:"setBlur",value:function(){return this.node.blur(),this}},{key:"setFocus",value:function(){return this.node.focus(),this}},{key:"isFocused",get:function(){return this._isFocused}}]),i}(ob),ub={resize:tb};Object.assign(lb.prototype,ub),T.register("inputText",(function(t){var e=new lb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.InputText",lb);var cb=Phaser.Utils.Objects.GetValue,db=function(t,e){return void 0===t&&(t=0),new Promise((function(i,n){setTimeout((function(){i(e);}),t);}))},fb=function(t){var e=t.game,i=t.fileInput,n=t.closeDelay;return Sh(X(e).events,"focus").then((function(){return db(n)})).then((function(){var t={files:i.files};return Promise.resolve(t)}))},pb=Phaser.Utils.Objects.GetValue,vb=function(t){return this.setOrigin(t.originX,t.originY),this.setPosition(t.x,t.y),this.resize(t.displayWidth,t.displayHeight),this},gb=function(t,e,i,n,s,r){if(null===s||!1===s);else if(fg(s))s();else {var o=function(t,e,i){if(void 0===i)switch(e){case"image":case"svg":i="textures";break;case"animation":i="json";break;case"tilemapTiledJSON":case"tilemapCSV":i="tilemap";break;case"glsl":i="shader";break;default:i=e;}return t=X(t),"textures"===i?t.textures:t.cache[i]}(t,i,s);o.exists(n)&&o.remove(n);}var a=t.load;if(r&&a.once("filecomplete-".concat(i,"-").concat(n),(function(t,e,i){r(i);})),fg(e))e();else {var h=window.URL.createObjectURL(e);a[i](n,h);}a.start();},yb={loadFile:function(t,e,i,n,s){var r=this.scene;return gb(r,t,e,i,n,s),this},loadFilePromise:function(t,e,i,n){var s=this.scene;return new Promise((function(r,o){gb(s,t,e,i,n,(function(t){r(t);}));}))}},kb=Phaser.GameObjects.DOMElement,mb=Phaser.Utils.Objects.IsPlainObject,bb=Phaser.Utils.Objects.GetValue,xb=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),mb(s)?(s=bb(h=s,"x",0),r=bb(h,"y",0),o=bb(h,"width",0),a=bb(h,"height",0)):mb(o)&&(o=bb(h=o,"width",0),a=bb(h,"height",0));var c=document.createElement("input");c.type="file",c.style.display="none";var d=document.createElement("label");d.appendChild(c);var f=bb(h,"style",void 0);(l=e.call(this,t,s,r,d,f)).type="rexFileChooser",l.resetFromJSON(h),l.resize(o,a);var p=u(l);return c.onchange=function(){p.emit("change",p);},l.setCloseDelay(bb(h,"closeDelay",200)),c.onclick=function(){fb({game:t,fileInput:c,closeDelay:p.closeDelay}).then((function(){p.emit("select",p);}));},l}return r(i,[{key:"resetFromJSON",value:function(t){return this.setAccept(bb(t,"accept","")),this.setMultiple(bb(t,"multiple",!1)),this}},{key:"setAccept",value:function(t){return void 0===t&&(t=""),this.fileInput.setAttribute("accept",t),this}},{key:"setMultiple",value:function(t){return void 0===t&&(t=!0),t?this.fileInput.setAttribute("multiple",""):this.fileInput.removeAttribute("multiple"),this}},{key:"setCloseDelay",value:function(t){return void 0===t&&(t=200),this.closeDelay=t,this}},{key:"fileInput",get:function(){return this.node.children[0]}},{key:"open",value:function(){return this.fileInput.click(),this}},{key:"files",get:function(){return this.fileInput.files}}]),i}(kb),Cb={resize:tb,syncTo:vb};Object.assign(xb.prototype,Cb,yb),T.register("fileChooser",(function(t){var e=new xb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.FileChooser",xb);var wb={setDropEnable:function(t){return void 0===t&&(t=!0),this.dropEnable=t,this},toggleDropEnable:function(){return this.dropEnable=!this.dropEnable,this}},Sb={resize:tb,syncTo:vb};Object.assign(Sb,wb,{addFilter:function(t,e){return this.filters||(this.filters={}),this.filters[t]=e,this},addFilters:function(t){for(var e in this.filters||(this.filters={}),t)this.filters[e]=t[e];return this}},yb);var Pb={dragenter:"dragenter",dragleave:"dragleave",dragover:"dragover",drop:"drop"},Tb=Phaser.GameObjects.DOMElement,Ob=Phaser.Utils.Objects.IsPlainObject,Mb=Phaser.Utils.Objects.GetValue,Eb=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),Ob(s)?(s=Mb(h=s,"x",0),r=Mb(h,"y",0),o=Mb(h,"width",0),a=Mb(h,"height",0)):Ob(o)&&(o=Mb(h=o,"width",0),a=Mb(h,"height",0)),void 0===h&&(h={});var c=document.createElement("div"),d=Mb(h,"style",void 0);(l=e.call(this,t,s,r,c,d)).type="rexFileDropZone",l.resize(o,a),l._files=[],l.setDropEnable(Mb(h,"dropEnable",!0));var f=Mb(h,"filters");return f&&l.addFilters(f),rb(u(l),c,Pb,{preventDefault:!0,preTest:function(t){return t.dropEnable}}),l.on("drop",(function(t,e){this._files=e.dataTransfer.files;var i=this._files;if(i&&this.filters)for(var n in this.filters){for(var s=this.filters[n],r=[],o=0,a=i.length;o0&&this.emit("drop.".concat(n),r);}}),u(l)),l}return r(i,[{key:"files",get:function(){return this._files}}]),i}(Tb);Object.assign(Eb.prototype,Sb),T.register("fileDropZone",(function(t){var e=new Eb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.FileDropZone",Eb);var _b=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),c(r=e.call(this,t),new Proxy(u(r),u(r)))}return r(i,[{key:"get",value:function(t,e){if(lr(t,e))return t[e];var i=t.parent;return lr(i,e)?i[e]:void 0}},{key:"set",value:function(t,e,i){return lr(t,e)?t[e]=i:lr(t.parent,e)&&(t.parent[e]=i),!0}},{key:"key",get:function(){return this.parent.texture.key},set:function(t){this.parent.setTexture(t,this.frame);}},{key:"frame",get:function(){return this.parent.frame.name},set:function(t){this.parent.setFrame(t);}},{key:"scale",get:function(){return this.parent.scaleX},set:function(t){this.parent.setScale(t);}}]),i}(oo),Rb=Phaser.Utils.Objects.GetValue,Lb=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),(r=e.call(this,t,s)).style=Rb(s,"style",u(r));var o=Rb(s,"propertiesMap");return r.activeStyle=Bb(s,"active",o),r.hoverStyle=Bb(s,"hover",o),r.disableStyle=Bb(s,"disable",o),r.onModifyStyle=Rb(s,"onModifyStyle"),r}return r(i,[{key:"getStyle",value:function(t){return zl(this.style,t)}},{key:"modifyStyle",value:function(t){for(var e in t)this.style[e]=t[e];return this.onModifyStyle&&this.onModifyStyle(this.parent,t),this}},{key:"applyStyle",value:function(t){if(t){var e=this.getStyle(t);return Al(e,t)?void 0:(this.modifyStyle(t),e)}}},{key:"setActiveState",value:function(t){return Db.call(this,"active",t),this}},{key:"setHoverState",value:function(t){return Db.call(this,"hover",t),this}},{key:"setDisableState",value:function(t){return Db.call(this,"disable",t),this}}]),i}(oo),Bb=function(t,e,i){var n=jl(t,e);if(i)for(var s in n)i.hasOwnProperty(s)&&(n[i[s]]=n[s],delete n[s]);return n},Db=function(t,e){void 0===e&&(e=!0);var i="".concat(t,"State"),n="".concat(t,"Style"),s="".concat(t,"StyleSave");this[i]!==e&&(this[i]=e,e?this[s]=this.applyStyle(this[n]):(this.applyStyle(this[s]),this[s]=void 0));},Ib={addStyleManager:function(t){return this.styleManager=new Lb(this,t),this},setActiveState:function(t){return this.styleManager.setActiveState(t),this},setHoverState:function(t){return this.styleManager.setHoverState(t),this},setDisableState:function(t){return this.styleManager.setDisableState(t),this}},jb=Phaser.GameObjects.Image,zb=Phaser.Utils.Objects.GetValue,Ab=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=zb(s,"x",0),a=zb(s,"y",0),h=zb(s,"key",""),l=zb(s,"frame",void 0);(r=e.call(this,t,o,a,h,l)).type="rexStatesImage";var c=zb(s,"effects",!0);return c&&pr(u(r),c),r.style=new _b(u(r),s),s.style=r.style,r.addStyleManager(s),delete s.style,r}return r(i)}(jb);Object.assign(Ab.prototype,Ib),T.register("statesImage",(function(t){var e=new Ab(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.StatesImage",Ab);var Fb=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),void 0===s&&(s={}),(r=e.call(this,t,s)).type="rexStatesRoundRectangleShape",s.style=u(r),s.propertiesMap=Wb,r.addStyleManager(s),delete s.style,delete s.propertiesMap,r}return r(i)}(se),Wb={color:"fillColor",alpha:"fillAlpha",strokeWidth:"lineWidth"};Object.assign(Fb.prototype,Ib),T.register("statesRoundRectangle",(function(t){var e=new Fb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.StatesRoundRectangle",Fb);var Yb=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),c(r=e.call(this,t),new Proxy(u(r),u(r)))}return r(i,[{key:"get",value:function(t,e){if(lr(t,e))return t[e];var i=t.parent;return lr(i,e)?i[e]:void 0}},{key:"set",value:function(t,e,i){return lr(t,e)?t[e]=i:lr(t.parent,e)&&(t.parent[e]=i),!0}},{key:"key",get:function(){return this.parent.texture.key},set:function(t){this.parent.setTexture(t,this.frame);}},{key:"frame",get:function(){return this.parent.frame.name},set:function(t){this.parent.setFrame(t);}},{key:"leftWidth",get:function(){return this.parent.leftWidth},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,t,e.rightWidth,e.topHeight,e.bottomHeight);}},{key:"rightWidth",get:function(){return this.parent.rightWidth},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,t,e.topHeight,e.bottomHeight);}},{key:"topHeight",get:function(){return this.parent.topHeight},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,e.rightWidth,t,e.bottomHeight);}},{key:"bottomHeight",get:function(){return this.parent.bottomHeight},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,e.rightWidth,e.topHeight,t);}}]),i}(oo),Vb=Phaser.GameObjects.NineSlice,Xb=Phaser.Utils.Objects.GetValue,Gb=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=Xb(s,"x",0),a=Xb(s,"y",0),h=Xb(s,"key",null),l=Xb(s,"frame",null),c=Xb(s,"width",0),d=Xb(s,"height",0),f=Xb(s,"leftWidth",0),p=Xb(s,"rightWidth",0),v=Xb(s,"topHeight",0),g=Xb(s,"bottomHeight",0);(r=e.call(this,t,o,a,h,l,c,d,f,p,v,g)).type="rexStatesNineSlice";var y=Xb(s,"effects",!0);return y&&pr(u(r),y),r.style=new Yb(u(r),s),s.style=r.style,r.addStyleManager(s),delete s.style,r}return r(i)}(Vb);Object.assign(Gb.prototype,Ib),T.register("statesNineSlice",(function(t){var e=new Gb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.StatesNineSlice",Gb);var Ub=Phaser.GameObjects.Text,Hb=Phaser.Utils.Objects.GetValue,Nb=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=Hb(s,"x",0),a=Hb(s,"y",0),h=Hb(s,"text","");return (r=e.call(this,t,o,a,h,s)).type="rexStatesText",s.style=r.style,s.onModifyStyle=function(t,e){var i=e.hasOwnProperty("fontStyle")||e.hasOwnProperty("fontSize")||e.hasOwnProperty("fontFamily");t.style.update(i);},r.addStyleManager(s),delete s.style,r}return r(i)}(Ub);Object.assign(Nb.prototype,Ib),T.register("statesText",(function(t){var e=new Nb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.StatesText",Nb);var Kb=function(t,e){void 0===e&&(e={}),void 0===e.options&&(e.options={});var i=e.options;i.responsive=!1,i.maintainAspectRatio=!1,i.hasOwnProperty("devicePixelRatio")||(i.devicePixelRatio=1);var n=!1;void 0===i.animation?i.animation={}:!1===i.animation&&(n=!0,i.animation={});var s=i.animation;n&&(s.duration=0);var r=s.onProgress;s.onProgress=function(e){r&&r(e),t.needRedraw();};var o=s.onComplete;return s.onComplete=function(e){o&&o(e),t.needRedraw();},e},Jb=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;return n(this,i),(l=e.call(this,t,s,r,o,a)).type="rexChart",l.chart=void 0,void 0!==h&&l.setChart(h),l}return r(i,[{key:"destroy",value:function(t){this.scene&&(this.chart&&(this.chart.destroy(),this.chart=void 0),p(h(i.prototype),"destroy",this).call(this,t));}},{key:"resize",value:function(t,e){if(t===this.width&&e===this.height)return this;if(p(h(i.prototype),"resize",this).call(this,t,e),this.chart){var n=this.chart;n.height=this.canvas.height,n.width=this.canvas.width,n.aspectRatio=n.height?n.width/n.height:null,n.update();}return this}}]),i}(Mc),Zb={setChart:function(t){if(!window.Chart){return console.error("Can not find chartjs! Load chartjs in preload stage.\nscene.load.script('chartjs', 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.8.0/Chart.min.js');"),this}return this.chart&&this.chart.destroy(),this.chart=new Chart(this.context,Kb(this,t)),this},getChartDataset:function(t){if(void 0!==this.chart){if("string"!=typeof t)return this.chart.data.datasets[t];for(var e,i=this.chart.data.datasets,n=0,s=i.length;n(h=0===this.orientation?Math.abs(a.left-t):Math.abs(a.top-e))&&(s=h,n=r);}var h;a=i[i.length-1];return s>(h=0===this.orientation?Math.abs(a.right-t):Math.abs(a.bottom-e))&&(s=h,n=r+1),n},tx=Phaser.Utils.Objects.IsPlainObject,ex=Phaser.Utils.Objects.GetValue,ix=Phaser.Display.Align.CENTER,nx={min:0,full:-1},sx=function(t,e,n,s,r,o,a,h,l,u){kp.call(this,t);var c=t.isRexSpace,d=i(e);if(null===e)return this;if("number"===d);else if("string"===d)e=nx[e];else if(tx(e)){var f;e=ex(f=e,"proportion",void 0),n=ex(f,"align",ix),s=ex(f,"padding",0),r=ex(f,"expand",!1),o=ex(f,"key",void 0),a=ex(f,"index",void 0),t.isRexSizer||(h=ex(f,"minWidth",void 0),l=ex(f,"minHeight",void 0)),u=ex(f,"fitRatio",0);}return "string"==typeof n&&(n=Wf[n]),void 0===e&&(e=c?1:0),void 0===n&&(n=ix),void 0===s&&(s=0),void 0===r&&(r=!1),void 0===h&&(c?h=0:t.isRexSizer||(h=t._minWidth)),void 0===l&&(c?l=0:t.isRexSizer||(l=t._minHeight)),void 0===u&&(u=0),(f=this.getSizerConfig(t)).proportion=e,f.align=n,f.padding=gp(s),f.expand=r,f.fitRatio=0===e?u:0,void 0===a||a>=this.sizerChildren.length?this.sizerChildren.push(t):this.sizerChildren.splice(a,0,t),t.isRexSizer||(e>0&&(0===this.orientation?t.minWidth=void 0===h?_r(t):h:t.minHeight=void 0===l?Rr(t):l),r&&(0===this.orientation?t.minHeight=l:t.minWidth=h)),void 0!==o&&this.addChildrenMap(o,t),this},rx={add:sx,addSpace:function(t){return this.insertSpace(void 0,t),this},insertSpace:function(t,e){return void 0===e&&(e=1),sx.call(this,new $b(this.scene),{proportion:e,minWidth:0,minHeight:0,index:t}),this},insert:function(t,e,i,n,s,r,o,a){return tx(i)&&(i.index=t),sx.call(this,e,i,n,s,r,o,t,a),this},insertAtPosition:function(t,e,i,n,s,r,o,a,h){var l=Qb.call(this,t,e);return -1===l&&(l=void 0),this.insert(l,i,n,s,r,o,a,h),this}},ox=Phaser.Utils.Array.Remove,ax={remove:function(t,e){return this.getParentSizer(t)!==this||(ox(this.sizerChildren,t),Pp.call(this,t,e)),this},removeAll:function(t){for(var e=this.sizerChildren.length-1;e>=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,Ck.call(this,t),this}},hx={getChildAlign:function(t){return this.getSizerConfig(t).align},setChildAlign:function(t,e){return "string"==typeof e&&(e=Wf[e]),this.getSizerConfig(t).align=e,this}},lx={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);var e,i,n,s=0,r=this.sizerChildren;if(0===this.orientation)for(var o=this.space.item,a=!0,h=0,l=r.length;h0&&this.proportionLength>0&&(i=n.proportion*this.proportionLength):n.expand&&(i=e-this.space.left-this.space.right-s.left-s.right);return i},getExpandedChildHeight:function(t,e){var i;void 0===e&&(e=this.height);var n=t.rexSizer,s=n.padding;0===this.orientation?n.expand&&(i=e-this.space.top-this.space.bottom-s.top-s.bottom):n.proportion>0&&this.proportionLength>0&&(i=n.proportion*this.proportionLength);return i},getChildrenSizers:function(t){void 0===t&&(t=[]);for(var e,i=this.sizerChildren,n=0,s=i.length;n0?(e=t-this.getChildrenWidth(!1),this.proportionLength=e/this.childrenProportion):this.proportionLength=0;}return t},resolveHeight:function(t){t=Bp.call(this,t);if(void 0===this.proportionLength&&1===this.orientation){var e=t-this.childrenHeight;e>0?(e=t-this.getChildrenHeight(!1),this.proportionLength=e/this.childrenProportion):this.proportionLength=0;}return t}};Object.assign(lx,rx,ax,hx,{getChildProportion:function(t){return this.getSizerConfig(t).proportion},setChildProportion:function(t,e){return this.getSizerConfig(t).proportion=e,this}},{getChildExpand:function(t){return this.getSizerConfig(t).expand},setChildExpand:function(t,e){return this.getSizerConfig(t).expand=e,this}});var ux=function(){for(var t,e,i=0,n=this.sizerChildren,s=0,r=n.length;s0&&(i+=e);return i},cx={x:0,h:0,horizontal:0,"left-to-right":0,y:1,v:1,vertical:1,"top-to-bottom":1},dx=function(t){return "string"==typeof t&&(t=cx[t]),t},fx=Phaser.Utils.Objects.IsPlainObject,px=Phaser.Utils.Objects.GetValue,vx=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;return n(this,i),fx(s)?(s=px(l=s,"x",0),r=px(l,"y",0),o=px(l,"width",void 0),a=px(l,"height",void 0),h=px(l,"orientation",0)):fx(o)?(o=px(l=o,"width",void 0),a=px(l,"height",void 0),h=px(l,"orientation",0)):fx(h)&&(h=px(l=h,"orientation",0)),void 0===h&&(h=0),(u=e.call(this,t,s,r,o,a,l)).type="rexSizer",u.sizerChildren=[],u.setOrientation(h),u.setItemSpacing(px(l,"space.item",0)),u.setStartChildIndex(px(l,"startChildIndex",0)),u.setRTL(px(l,"rtl",!1)),u.addChildrenMap("items",u.sizerChildren),u}return r(i,[{key:"setOrientation",value:function(t){return this.orientation=dx(t),this}},{key:"setItemSpacing",value:function(t){return this.space.item=t,this}},{key:"setStartChildIndex",value:function(t){return this.startChildIndex=t,this}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},{key:"childrenProportion",get:function(){return void 0===this._childrenProportion&&(this._childrenProportion=ux.call(this)),this._childrenProportion}}]),i}(pk);Object.assign(vx.prototype,lx),T.register("sizer",(function(t,e,i,n,s,r){var o=new vx(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.Sizer",vx);var gx=function(){return Array.prototype.reduce.call(arguments,yx,0)},yx=function(t,e){return t+e},kx=Phaser.Utils.Objects.IsPlainObject,mx=Phaser.Utils.Objects.GetValue,bx=Phaser.Display.Align.CENTER,xx=function(t,e,i,n,s){if("number"==typeof t||"number"==typeof e)if(void 0===t){for(var r=0;r=0;e--){var i=this.sizerChildren[e];i&&this.remove(i,t);}return this},clear:function(t){return wx(this.sizerChildren,null),Ck.call(this,t),this}},Px={setColumnSpace:function(t){if(this.space.column||(this.space.column=[]),this.space.column.length=this.columnCount-1,"number"==typeof t)wx(this.space.column,t);else for(var e=0,i=this.columnCount-1;e=0;n--){var s=n*this.columnCount+t;this.sizerChildren.splice(s,0,null);}return this.columnProportions.push(e),this.columnWidth.length+=1,this.space.column.splice(t,0,i),this},Ex={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);for(var e,i,n,s,r=0,o=this.sizerChildren,a=0;a0){var i=t-this.getChildrenWidth(!1);i>=0&&(this.proportionWidthLength=i/e);}else this.proportionWidthLength=0;}return t},resolveHeight:function(t){t=Bp.call(this,t);if(void 0===this.proportionHeightLength){var e=this.totalRowProportions;if(e>0){var i=t-this.getChildrenHeight(!1);i>=0&&(this.proportionHeightLength=i/e);}else this.proportionHeightLength=0;}return t},resolveChildrenWidth:function(t){var e,i,n;for(var s in this.sizerChildren)(e=this.sizerChildren[s])&&e.isRexSizer&&!e.ignoreLayout&&(n=this.getColumnWidth(parseInt(s)%this.columnCount),i=this.getExpandedChildWidth(e,n),i=e.resolveWidth(i),e.resolveChildrenWidth(i));},runWidthWrap:function(t){var e,i,n;for(var s in this.sizerChildren)!(e=this.sizerChildren[s])||e.isRexSizer&&e.ignoreLayout||!e.runWidthWrap||(n=this.getColumnWidth(parseInt(s)%this.columnCount),i=this.getExpandedChildWidth(e,n),e.isRexSizer&&(i=e.resolveWidth(i)),e.runWidthWrap(i));return this},resetGrid:function(t,e,i,n,s){if(void 0===i&&(i=0),void 0===n&&(n=0),this.columnCount=t,this.rowCount=e,this.gridCount=t*e,this.removeAll(),this.sizerChildren.length=t*e,wx(this.sizerChildren,null),this.columnProportions=[],this.columnProportions.length=t,"number"==typeof i)wx(this.columnProportions,i);else for(var r=0;r0&&(e+=t);return e},Rx=function(){for(var t,e=0,i=0;i0&&(e+=t);return e},Lx=Phaser.Utils.Objects.IsPlainObject,Bx=Phaser.Utils.Objects.GetValue,Dx=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l,u,c,d){var f;return n(this,i),Lx(s)?(s=Bx(d=s,"x",0),r=Bx(d,"y",0),o=Bx(d,"width",void 0),a=Bx(d,"height",void 0),h=Bx(d,"column",d.col||0),l=Bx(d,"row",0),u=Bx(d,"columnProportions",0),c=Bx(d,"rowProportions",0)):Lx(o)?(o=Bx(d=o,"width",void 0),a=Bx(d,"height",void 0),h=Bx(d,"column",d.col||0),l=Bx(d,"row",0),u=Bx(d,"columnProportions",0),c=Bx(d,"rowProportions",0)):Lx(h)?(h=Bx(d=h,"column",d.col||0),l=Bx(d,"row",0),u=Bx(d,"columnProportions",0),c=Bx(d,"rowProportions",0)):Lx(u)&&(u=Bx(d=u,"columnProportions",0),c=Bx(d,"rowProportions",0)),(f=e.call(this,t,s,r,o,a,d)).type="rexGridSizer",f.sizerChildren=[],f.addChildrenMap("items",f.sizerChildren),f.setCreateCellContainerCallback(Bx(d,"createCellContainerCallback")),f.setIndentLeft(Bx(d,"space.indentLeftOdd",0),Bx(d,"space.indentLeftEven",0)),f.setIndentTop(Bx(d,"space.indentTopOdd",0),Bx(d,"space.indentTopEven",0)),f.resetGrid(h,l,u,c,Bx(d,"space",void 0)),f}return r(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(p(h(i.prototype),"destroy",this).call(this,t),this.columnProportions=void 0,this.rowProportions=void 0,this.columnWidth=void 0,this.rowHeight=void 0,this.createCellContainerCallback=void 0);}},{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(){return void 0===this._totalColumnProportions&&(this._totalColumnProportions=_x.call(this)),this._totalColumnProportions}},{key:"totalRowProportions",get:function(){return void 0===this._totalRowProportions&&(this._totalRowProportions=Rx.call(this)),this._totalRowProportions}},{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)}},{key:"getColumnWidth",value:function(t){var e=this.columnProportions[t];return 0===e?this.columnWidth[t]:e*this.proportionWidthLength}},{key:"getRowHeight",value:function(t){var e=this.rowProportions[t];return 0===e?this.rowHeight[t]:e*this.proportionHeightLength}},{key:"setCreateCellContainerCallback",value:function(t){return this.createCellContainerCallback=t,this}}]),i}(pk);Object.assign(Dx.prototype,Ex),T.register("gridSizer",(function(t,e,i,n,s,r,o,a,h){var l=new Dx(this.scene,t,e,i,n,s,r,o,a,h);return this.scene.add.existing(l),l})),Z(window,"RexPlugins.UI.GridSizer",Dx);var Ix=function(t,e,i,n){return e/t<=i?e/(n-1):0},jx=function(t,e){void 0===e?e={lines:[],width:0,height:0}:(e.lines.length=0,e.width=0,e.height=0);for(var i,n,s,r,o=this.sizerChildren,a=this.space.item,h=this.space.line,l=this.space.indentLeftOdd,u=this.space.indentLeftEven,c=this.space.indentTopOdd,d=this.space.indentTopEven,f=0,p=e.lines,v=void 0,g=0,y=o.length;ga.height/2)){s>(h=Fx(a.left,a.centerY,t,e))&&(s=h,n=r);var h,l=i[r+1];if(!l||l.y!==a.y)s>(h=Fx(a.right,a.centerY,t,e))&&(s=h,n=r+1);}}return n},Yx=Phaser.Utils.Objects.IsPlainObject,Vx=Phaser.Utils.Objects.GetValue,Xx=Phaser.Display.Align.CENTER,Gx=function(t,e,i,n){if("\n"===t)return this.addNewLine(),this;var s;(kp.call(this,t),Yx(e))&&(e=Vx(s=e,"padding",0),i=Vx(s,"key",void 0),n=Vx(s,"index",void 0));return void 0===e&&(e=0),(s=this.getSizerConfig(t)).align=Xx,s.padding=gp(e),void 0===n||n>=this.sizerChildren.length?this.sizerChildren.push(t):this.sizerChildren.splice(n,0,t),void 0!==i&&this.addChildrenMap(i,t),this},Ux={add:function(t,e,i){if(gg(t))for(var n=t,s=0,r=n.length;s=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,Ck.call(this,t),this}},Kx={getChildrenWidth:function(){return this.rexSizer.hidden?0:this.maxChildWidth+this.space.left+this.space.right},getChildrenHeight:function(){return this.rexSizer.hidden?0:this.widthWrapResult.height+this.space.top+this.space.bottom},getChildrenSizers:function(t){void 0===t&&(t=[]);for(var e,i=this.sizerChildren,n=0,s=i.length;n=0;i--)FC.call(this,e[i],t);return this}},YC=function(t,e,i){if(t){var n=this.setValueCallback,s=this.setValueCallbackScope;n&&(s?n.call(s,t,e,i):n(t,e,i)),this.fireEvent("button.statechange",t,e,i);}},VC=function(t){var e=this;t._selected=void 0,Object.defineProperty(t,"selected",{get:function(){return t._selected},set:function(i){if(t._selected!==i){var n=t._selected;t._selected=i,YC.call(e,t,i,n);}},enumerable:!0,configurable:!0}),t.selected=!1;},XC={add:function(t){return this.buttons.push(t),t._click||(t._click=new lc(t,this.clickConfig),t._click.on("click",(function(t,e,i,n){this.fireEvent("button.click",e,i,n);}),this).on("enable",(function(t,e){this.fireEvent("button.enable",e);}),this).on("disable",(function(t,e){this.fireEvent("button.disable",e);}),this),t.on("pointerover",(function(e,i,n,s){this.fireEvent("button.over",t,e,s);}),this).on("pointerout",(function(e,i){this.fireEvent("button.out",t,e,i);}),this).on("pointerdown",(function(e,i,n,s){this.fireEvent("button.down",t,e,s);}),this).on("pointerup",(function(e,i){this.fireEvent("button.up",t,e,i);}),this)),this.buttonsType&&(void 0===t.name&&console.error("".concat(this.parent.constructor.name,": Option button miss value")),VC.call(this,t)),this},addMultiple:function(t){for(var e=0,i=t.length;e2?o-2:0),h=2;h=0;i--)rw.call(this,e[i],t);return this}},aw=Phaser.Utils.Objects.GetValue,hw=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=aw(s,"row",0),a=aw(s,"column",s.col||0),h=aw(s,"createCellContainerCallback"),l=aw(s,"buttons",void 0),c=aw(s,"expand",!0),d=c?1:0;if(h&&(s.createCellContainerCallback=void 0),void 0!==l){o=Math.max(o,l.length);for(var f=0,p=l.length;fs&&lw.addNewLine(this);}else for(r=0,o=t.length;r=0;i--)pw.call(this,e[i],t);return this}},gw=Phaser.Utils.Objects.GetValue,yw=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=s.space;"number"==typeof o&&(s.space={item:o,line:o}),(r=e.call(this,t,s)).type="rexFixWidthButtons",r.buttonGroup=new ZC({parent:u(r),eventEmitter:gw(s,"eventEmitter",u(r)),groupName:gw(s,"groupName",void 0),clickConfig:gw(s,"click",void 0)}).setButtonsType(s);var a=gw(s,"background",void 0),h=gw(s,"buttons",void 0);return r.buttonsAlign=gw(s,"align",void 0),a&&r.addBackground(a),h&&r.addButtons(h),r.addChildrenMap("background",a),r.addChildrenMap("buttons",r.buttonGroup.buttons),r}return r(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(p(h(i.prototype),"destroy",this).call(this,t),this.buttonGroup.destroy(),this.buttonGroup=void 0);}},{key:"buttons",get:function(){return this.buttonGroup.buttons}},{key:"groupName",get:function(){return this.buttonGroup.groupName},set:function(t){this.buttonGroup.groupName=t;}},{key:"eventEmitter",get:function(){return this.buttonGroup.eventEmitter}}]),i}(Qx);Object.assign(yw.prototype,cw,vw,JC,$C),T.register("fixWidthButtons",(function(t){var e=new yw(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.FixWidthButtons",yw);var kw=Phaser.Utils.Objects.GetValue,mw=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),(r=e.call(this,t,s)).type="rexFileSelectorButton";var o=new xb(t);return t.add.existing(o),r.addBackground(o),r.addChildrenMap("fileChooser",o),r.setAccept(kw(s,"accept","")),r.setMultiple(kw(s,"multiple",!1)),o.on("change",(function(t){var e=t.files;0!==e.length&&(e=Array.from(e),this.emit("select",e,this));}),u(r)),r}return r(i,[{key:"files",get:function(){return this.childrenMap.fileChooser.files}}]),i}(oC);Object.assign(mw.prototype,{setAccept:function(t){return this.childrenMap.fileChooser.setAccept(t),this},setMultiple:function(t){return this.childrenMap.fileChooser.setMultiple(t),this},loadFile:function(t,e,i,n,s){return this.childrenMap.fileChooser.loadFile(t,e,i,n,s),this},loadFilePromise:function(t,e,i,n){return this.childrenMap.fileChooser.loadFilePromise(t,e,i,n)}}),T.register("fileSelectorButton",(function(t){var e=new mw(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.FileSelectorButton",mw);var bw={getChoice:function(t){var e=this.childrenMap.choicesSizer;return e?e.getButton(t):void 0},getAction:function(t){return this.childrenMap.actionsSizer.getButton(t)},getToolbar:function(t){return this.childrenMap.toolbarSizer.getButton(t)},getLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.getButton(t)},setChoiceEnable:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.setButtonEnable(t,e),this},setActionEnable:function(t,e){return this.childrenMap.actionsSizer.setButtonEnable(t,e),this},setToolbarEnable:function(t,e){return this.childrenMap.toolbarSizer.setButtonEnable(t,e),this},setLeftToolbarEnable:function(t,e){return this.childrenMap.leftToolbarSizer.setButtonEnable(t,e),this},toggleChoiceEnable:function(t){var e=this.childrenMap.choicesSizer;return e&&e.toggleButtonEnable(t),this},toggleActionEnable:function(t){return this.childrenMap.actionsSizer.toggleButtonEnable(t),this},toggleToolbarEnable:function(t){return this.childrenMap.toolbarSizer.toggleButtonEnable(t),this},toggleLeftToolbarEnable:function(t){return this.childrenMap.leftToolbarSizer.toggleButtonEnable(t),this},getChoiceEnable:function(t){var e=this.childrenMap.choicesSizer;return !!e&&e.getButtonEnable(t)},getActionEnable:function(t){return this.childrenMap.actionsSizer.getButtonEnable(t)},getToolbarEnable:function(t){return this.childrenMap.toolbarSizer.getButtonEnable(t)},getLeftToolbarEnable:function(t){return this.childrenMap.leftToolbarSizer.getButtonEnable(t)},emitChoiceClick:function(t){var e=this.childrenMap.choicesSizer;return e&&e.emitButtonClick(t),this},emitActionClick:function(t){return this.childrenMap.actionsSizer.emitButtonClick(t),this},emitToolbarClick:function(t){return this.childrenMap.toolbarSizer.emitButtonClick(t),this},emitLeftToolbarClick:function(t){return this.childrenMap.leftToolbarSizer.emitButtonClick(t),this},showChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.showButton(t),this},showAction:function(t){return this.childrenMap.actionsSizer.showButton(t),this},showToolbar:function(t){return this.childrenMap.toolbarSizer.showButton(t),this},showLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.showButton(t),this},hideChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.hideButton(t),this},hideAction:function(t){return this.childrenMap.actionsSizer.hideButton(t),this},hideToolbar:function(t){return this.childrenMap.toolbarSizer.hideButton(t),this},hideLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.hideButton(t),this},addChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.addButton(t),this},addAction:function(t){return this.childrenMap.actionsSizer.addButton(t),this},addToolbar:function(t){return this.childrenMap.toolbarSizer.addButton(t),this},addLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.addButton(t),this},removeChoice:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.removeButton(t,e),this},removeAction:function(t,e){return this.childrenMap.actionsSizer.removeButton(t,e),this},removeToolbar:function(t,e){return this.childrenMap.toolbarSizer.removeButton(t,e),this},removeLeftToolbar:function(t,e){return this.childrenMap.leftToolbarSizer.removeButton(t,e),this},clearChoices:function(t){var e=this.childrenMap.choicesSizer;return e&&e.clearButtons(t),this},clearActions:function(t){return this.childrenMap.actionsSizer.clearButtons(t),this},clearToolbar:function(t){return this.childrenMap.toolbarSizer.clearButtons(t),this},clearLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.clearButtons(t),this},forEachChoice:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.forEachButtton(t,e),this},forEachAction:function(t,e){return this.childrenMap.actionsSizer.forEachButtton(t,e),this},forEachToolbar:function(t,e){return this.childrenMap.toolbarSizer.forEachButtton(t,e),this},forEachLeftToolbar:function(t,e){return this.childrenMap.leftToolbarSizer.forEachButtton(t,e),this},setAllButtonsEnable:function(t){return void 0===t&&(t=!0),this.childrenMap.toolbarSizer&&this.setToolbarEnable(t),this.childrenMap.leftToolbarSizer&&this.setLeftToolbarEnable(t),this.childrenMap.actionsSizer&&this.setActionEnable(t),this.childrenMap.choicesSizer&&this.setChoiceEnable(t),this},getChoicesButtonStates:function(){var t=this.childrenMap.choicesSizer;return t?t.getAllButtonsState():{}},getChoicesButtonState:function(t){var e=this.childrenMap.choicesSizer;return void 0===t?e?e.getAllButtonsState():{}:!!e&&e.getButtonState(t)},setChoicesButtonState:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.setButtonState(t,e),this},clearChoicesButtonStates:function(){var t=this.childrenMap.choicesSizer;return t&&t.clearAllButtonsState(),this},getChoicesSelectedButtonName:function(){var t=this.childrenMap.choicesSizer;return t?t.getSelectedButtonName():""},setChoicesSelectedButtonName:function(t){var e=this.childrenMap.choicesSizer;return e&&e.setSelectedButtonName(t),this}},xw={onCreateModalBehavior:function(t){t.on("button.click",(function(e,i,n,s,r){if("actions"===i){var o={index:n,text:e.text,button:e,dialog:t};switch(t.buttonsType){case"radio":o.value=t.getChoicesSelectedButtonName();break;case"checkboxes":o.value=t.getChoicesButtonStates();break;default:o.value=void 0;}t.modalClose(o);}}));},modal:function(t,e){return t&&!1===t.defaultBehavior?this.onCreateModalBehavior=!1:delete this.onCreateModalBehavior,pg.modal.call(this,t,e),this}},Cw={};Object.assign(Cw,bw,xw);var ww=Phaser.Utils.Objects.GetValue,Sw=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),s.orientation=1,(r=e.call(this,t,s)).type="rexDialog",r.eventEmitter=ww(s,"eventEmitter",u(r));var o,a,h,l,c=ww(s,"background",void 0),d=ww(s,"title",void 0),f=ww(s,"toolbar",void 0),p=ww(s,"toolbarBackground",void 0),v=ww(s,"leftToolbar",void 0),g=ww(s,"leftToolbarBackground",void 0),y=ww(s,"content",void 0),k=ww(s,"description",void 0),m=ww(s,"choices",void 0),b=ww(s,"choicesBackground",void 0),x=ww(s,"actions",void 0),C=ww(s,"actionsBackground",void 0),w=ww(s,"click",void 0);if(c&&r.addBackground(c),f&&(h=new tw(t,{groupName:"toolbar",background:p,buttons:f,orientation:0,space:{item:ww(s,"space.toolbarItem",0)},click:w,eventEmitter:r.eventEmitter})),v&&(l=new tw(t,{groupName:"leftToolbar",background:g,buttons:v,orientation:0,space:{item:ww(s,"space.leftToolbarItem",0)},click:w,eventEmitter:r.eventEmitter})),d||f||v){var S,P=!!d&&ww(s,"expand.title",!0),T=ww(s,"align.title","center"),O=!(d&&!P&&"center"===T||!d&&(f||v));S=O?new vx(t,{orientation:0}):new Mk(t);var M=!!O||{height:!0};if(l&&S.add(l,{align:"left",expand:M}),d){O&&!P&&"right"===T&&S.addSpace();var E={left:ww(s,"space.titleLeft",0),right:ww(s,"space.titleRight",0)},_=P?1:0;S.add(d,{align:T,proportion:_,expand:M,padding:E}),O&&!P&&"left"===T&&S.addSpace();}h&&(O&&!d&&S.addSpace(),S.add(h,{align:"right",expand:M})),(y||k||m||x)&&(E={bottom:ww(s,"space.title",0),top:ww(s,"space.titleTop",0)});_=ww(s,"proportion.title",0);r.add(S,{padding:E,proportion:_,expand:!0});}if(y){var R=ww(s,"align.content","center"),L=ww(s,"space.content",0),B=(E={left:ww(s,"space.contentLeft",0),right:ww(s,"space.contentRight",0),bottom:k||m||x?L:0},_=ww(s,"proportion.content",0),ww(s,"expand.content",!0));r.add(y,{align:R,padding:E,proportion:_,expand:B});}if(k){R=ww(s,"align.description","center");var D=ww(s,"space.description",0);E={left:ww(s,"space.descriptionLeft",0),right:ww(s,"space.descriptionRight",0),bottom:m||x?D:0},_=ww(s,"proportion.description",0),B=ww(s,"expand.description",!0);r.add(k,{align:R,padding:E,proportion:_,expand:B});}if(m){var I=ww(s,"choicesType","").split("-"),j=Pw(I,"wrap")?yw:Pw(I,"grid")?hw:tw,z=Pw(I,"radio")?"radio":Pw(I,"checkboxes")?"checkboxes":void 0,A={left:ww(s,"space.choicesBackgroundLeft",0),right:ww(s,"space.choicesBackgroundRight",0),top:ww(s,"space.choicesBackgroundTop",0),bottom:ww(s,"space.choicesBackgroundBottom",0)},F=ww(s,"space.choice",0);j===tw?A.item=F:j===yw?(A.item=F,A.line=ww(s,"space.choiceLine",F)):(A.column=ww(s,"space.choiceColumn",F),A.row=ww(s,"space.choiceRow",F));var W={width:ww(s,"choicesWidth",void 0),height:ww(s,"choicesHeight",void 0),groupName:"choices",buttonsType:z,background:b,buttons:m,space:A,click:w,eventEmitter:r.eventEmitter,setValueCallback:ww(s,"choicesSetValueCallback",void 0),setValueCallbackScope:ww(s,"choicesSetValueCallbackScope",void 0)};j===tw&&(W.orientation=Pw(I,"x")?0:1),o=new j(t,W);var Y=ww(s,"space.choices",0);E={left:ww(s,"space.choicesLeft",0),right:ww(s,"space.choicesRight",0),bottom:x?Y:0},R=ww(s,"align.choices","center"),_=ww(s,"proportion.choices",0),B=ww(s,"expand.choices",!0);r.add(o,{align:R,padding:E,proportion:_,expand:B}),r.buttonsType=z;}if(x){a=new tw(t,{groupName:"actions",background:C,buttons:x,orientation:0,space:{item:ww(s,"space.action",0)},expand:ww(s,"expand.actions",!1),align:ww(s,"align.actions","center"),click:w,eventEmitter:r.eventEmitter});E={left:ww(s,"space.actionsLeft",0),right:ww(s,"space.actionsRight",0),bottom:ww(s,"space.actionsBottom",0)},_=ww(s,"proportion.action",0);r.add(a,{align:"center",padding:E,proportion:_,expand:!0});}return Ow(u(r),"click"),Ow(u(r),"over"),Ow(u(r),"out"),Ow(u(r),"enable"),Ow(u(r),"disable"),r.addChildrenMap("background",c),r.addChildrenMap("title",d),r.addChildrenMap("toolbar",f),r.addChildrenMap("leftToolbar",v),r.addChildrenMap("content",y),r.addChildrenMap("description",k),r.addChildrenMap("choices",o?o.buttons:void 0),r.addChildrenMap("actions",a?a.buttons:void 0),r.addChildrenMap("choicesSizer",o),r.addChildrenMap("actionsSizer",a),r.addChildrenMap("toolbarSizer",h),r.addChildrenMap("leftToolbarSizer",l),r}return r(i)}(vx),Pw=function(t,e){return -1!==t.indexOf(e)},Tw={actions:"action",choices:"choice",toolbar:"toolbar",leftToolbar:"leftToolbar"},Ow=function(t,e){t.on("button.".concat(e),(function(i,n,s,r,o){Tw.hasOwnProperty(n)&&t.emit("".concat(Tw[n],".").concat(e),i,s,r,o);}));};Object.assign(Sw.prototype,Cw),T.register("dialog",(function(t){var e=new Sw(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Dialog",Sw);var Mw=function(t,e,i){var n=new mC(t,e,i);return t.add.existing(n),n},Ew=function(t){this.childrenMap.title.resetDisplayContent(t.title);},_w=function(t){var e=this.childrenMap.content;if(e.resetDisplayContent)e.resetDisplayContent(t.content);else {var i=t.content||"";e.setText(i);}},Rw=function(t){var e=this.childrenMap.actions;if(e){var i=t.buttons;if(i){for(var n=this.scene,s=this.defaultActionConfig,r=this.defaultActionButtonCreator,o=0,a=i.length;o=t.dragThreshold?"DRAG":"DRAGBEGIN":"IDLE"}},{key:"update_DRAGBEGIN",value:function(t,e){this.next();}},{key:"next_DRAG",value:function(){var t,e=this.parent;return e.dragState.isUp&&(t=e.outOfBounds?"BACK":e.slidingEnable?"SLIDE":"IDLE"),t}},{key:"update_DRAG",value:function(t,e){var i=this.parent;i.dragState.justMoved&&i.dragging(),this.next();}},{key:"enter_DRAG",value:function(){this.parent.onDragStart();}},{key:"exit_DRAG",value:function(){this.parent.onDragEnd();}},{key:"next_SLIDE",value:function(){var t,e=this.parent;return e.dragState.isDown?t="DRAG":e.isSliding||(t="IDLE"),t}},{key:"enter_SLIDE",value:function(){this.parent.onSliding();}},{key:"exit_SLIDE",value:function(){this.parent.stop();}},{key:"update_SLIDE",value:function(t,e){this.parent.sliding(t,e),this.next();}},{key:"next_BACK",value:function(){var t,e=this.parent;return e.dragState.isDown?t="DRAG":e.isPullBack||(t="IDLE"),t}},{key:"enter_BACK",value:function(){this.parent.onPullBack();}},{key:"exit_BACK",value:function(){this.parent.stop();}},{key:"update_BACK",value:function(t,e){this.parent.pullBack(t,e),this.next();}}]),i}(Wv),bS=Phaser.Utils.Objects.GetValue,xS=Phaser.Math.Distance.Between,CS=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s))._enable=void 0,t.setInteractive(bS(s,"inputConfig",void 0)),r.resetFromJSON(s),r.boot(),r}return r(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.isInTouched=!1,this.holdStartTime=void 0,this.x=void 0,this.y=void 0,this.preX=void 0,this.preY=void 0,this.localX=void 0,this.localY=void 0,this.justMoved=!1,this.setEnable(bS(t,"enable",!0)),this.holdThreshold=bS(t,"holdThreshold",50),this.pointerOutReleaseEnable=bS(t,"pointerOutRelease",!0),this}},{key:"boot",value:function(){this.parent.on("pointerdown",this.onPointIn,this),this.parent.on("pointerup",this.onPointOut,this),this.pointerOutReleaseEnable&&this.parent.on("pointerout",this.onPointOut,this),this.parent.on("pointermove",this.onPointerMove,this),this.scene.sys.events.on("preupdate",this.preupdate,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.scene.sys.events.off("preupdate",this.preupdate,this),this.pointer=void 0,p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){this._enable!==t&&(t||(this.isInTouched=!1,this.pointer=void 0),this._enable=t);}},{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:"setPointerOutReleaseEnable",value:function(t){return void 0===t&&(t=!0),this.pointerOutReleaseEnable=t,this}},{key:"isDown",get:function(){return this.pointer&&this.pointer.isDown}},{key:"isUp",get:function(){return !this.isDown}},{key:"dx",get:function(){return this.x-this.preX}},{key:"dy",get:function(){return this.y-this.preY}},{key:"dt",get:function(){return nu(this.scene)}},{key:"speed",get:function(){return this.x===this.preX&&this.y===this.preY?0:xS(this.preX,this.preY,this.x,this.y)/(.001*this.dt)}},{key:"speedX",get:function(){return this.dx/(.001*this.dt)}},{key:"speedY",get:function(){return this.dy/(.001*this.dt)}},{key:"onPointIn",value:function(t,e,i){this.enable&&t.isDown&&void 0===this.pointer&&(this.pointer=t,this.localX=e,this.localY=i);}},{key:"onPointOut",value:function(t){this.enable&&this.pointer===t&&(this.pointer=void 0);}},{key:"onPointerMove",value:function(t,e,i){this.enable&&t.isDown&&this.pointer===t&&(this.localX=e,this.localY=i);}},{key:"preupdate",value:function(t,e){if(this.enable){var i=this.pointer;this.justMoved=!1,i&&!this.isInTouched?(this.x=i.worldX,this.y=i.worldY,this.preX=i.worldX,this.preY=i.worldY,this.isInTouched=!0,this.holdStartTime=void 0,this.emit("touchstart",i,this.localX,this.localY)):i&&this.isInTouched?this.x===i.x&&this.y===i.y?void 0===this.holdStartTime?this.holdStartTime=t:t-this.holdStartTime>this.holdThreshold&&(this.preX=this.x,this.preY=this.y):(this.preX=this.x,this.preY=this.y,this.x=i.worldX,this.y=i.worldY,this.holdStartTime=void 0,this.justMoved=!0,this.emit("touchmove",i,this.localX,this.localY)):!i&&this.isInTouched&&(this.isInTouched=!1,this.holdStartTime=void 0,this.emit("touchend",i));}}}]),i}(oo),wS=Phaser.Utils.Objects.GetValue,SS=function(){function t(e){n(this,t),this.resetFromJSON(e);}return r(t,[{key:"resetFromJSON",value:function(t){return this.setValue(wS(t,"value",0)),this.setSpeed(wS(t,"speed",0)),this.setAcceleration(wS(t,"acceleration",0)),this}},{key:"reset",value:function(){this.setValue(0),this.setSpeed(0),this.setAcceleration(0);}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"setSpeed",value:function(t){return this.speed=t,this}},{key:"setAcceleration",value:function(t){return this.acceleration=t,this}},{key:"updateSpeed",value:function(t){return 0!==this.acceleration&&(this.speed+=this.acceleration*t,this.speed<0&&(this.speed=0)),this}},{key:"getDeltaValue",value:function(t){return this.updateSpeed(t),this.speed<=0?0:this.speed*t}},{key:"update",value:function(t){return this.updateSpeed(t),this.speed>0&&(this.value+=this.getDeltaValue(t)),this}},{key:"isMoving",get:function(){return this.speed>0}}]),t}(),PS=function(){function t(){n(this,t),this.value,this.dir,this.movement=new SS;}return r(t,[{key:"init",value:function(t,e,i,n,s){return this.value=t,this.end=s,this.dir=void 0!==s?tthis.end&&(this.value=this.end):this.valuethis.maxValue}},{key:"overMin",value:function(t){return null!=this.minValue&&t0,Math.abs(e),i);}},{key:"sliding",value:function(t,e){e*=.001;var i=this._slowDown.update(e).value;this.overMax(i)?(this.value=this.maxValue,this._slowDown.stop()):this.overMin(i)?(this.value=this.minValue,this._slowDown.stop()):this.value=i;}},{key:"onPullBack",value:function(){var t=this.value,e=this.outOfMinBound?this.minValue:this.maxValue,i=Math.abs(e-t),n=this.backDeceleration,s=Math.sqrt(2*n*i);this._slowDown.init(t,void 0,s,n,e);}},{key:"pullBack",value:function(t,e){e*=.001,this.value=this._slowDown.update(e).value,this._slowDown.isMoving||this._state.next();}},{key:"stop",value:function(){this._slowDown.stop();}}]),i}(oo),ES={y:0,v:0,vertical:0,x:1,h:1,horizontal:1},_S=Phaser.Utils.Objects.GetValue,RS=function(t){a(i,t);var e=d(i);function i(t,s){var r;(n(this,i),(r=e.call(this,t,s)).parent!==r.scene?r.focusMode=_S(s,"focus",!0):r.focusMode=!1,r.setSpeed(_S(s,"speed",.1)),r.setEnable(_S(s,"enable",!0)),r.focusMode)?(t=r.parent).setInteractive(_S(s,"inputConfig",void 0)).on("wheel",(function(t,e,i,n,s){this.enable&&this.scroll(i);}),u(r)):r.scene.input.on("wheel",r.onSceneScroll,u(r));return r}return r(i,[{key:"destroy",value:function(){this.focusMode||this.scene.input.off("wheel",this.onSceneScroll,this);}},{key:"onSceneScroll",value:function(t,e,i,n,s,r){this.enable&&this.scroll(n);}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"setSpeed",value:function(t){return this.speed=t,this}},{key:"scroll",value:function(t){t*=this.speed,this.emit("scroll",t,this.parent,this);}}]),i}(oo),LS=Phaser.Utils.Objects.GetValue,BS=function(t,e,i,n){var s,r,o,a,h="Y"===(i=i.toUpperCase()),l=2===t.scrollMode,u=t.childrenMap.child,c="slider".concat(i);if(s=l||n.hasOwnProperty(c)?LS(n,c,void 0):LS(n,"slider",void 0)){var d,f,p;!0===s&&(s={}),s.orientation=h?1:0,r=function(t,e){void 0===e&&(e={});var i=qe(e);(e={slider:i}).orientation=i.orientation,delete i.orientation,e.background=i.background,delete i.background,e.buttons=i.buttons,delete i.buttons;var n=new kS(t,e);t.add.existing(n);var s=n.childrenMap.slider;return n.addChildrenMap("track",s.childrenMap.track),n.addChildrenMap("indicator",s.childrenMap.indicator),n.addChildrenMap("thumb",s.childrenMap.thumb),n}(t.scene,s);var v=LS(s,"position",0);"string"==typeof v&&(v=DS[v]);var g=LS(n,"space.slider".concat(i),void 0);void 0===g&&void 0===(g=LS(n,"space.slider",void 0))&&(g=l?0:LS(n,"space.child",0));var y="number"==typeof g;h?0===v?(d=2,f=1,p=y?{left:g}:g):(d=0,f=1,p=y?{right:g}:g):0===v?(d=1,f=2,p=y?{top:g}:g):(d=1,f=0,p=y?{bottom:g}:g),e.add(r,{column:d,row:f,align:"center",padding:p,expand:!0}),t["hideUnscrollableSlider".concat(i)]=LS(s,"hideUnscrollableSlider",!1),t["adaptThumb".concat(i,"SizeMode")]=LS(s,"adaptThumbSize",!1),t["minThumb".concat(i,"Size")]=LS(s,"minThumbSize",void 0);}else t["hideUnscrollableSlider".concat(i)]=!1,t["adaptThumb".concat(i,"SizeMode")]=!1,t["minThumb".concat(i,"Size")]=void 0;var k="scroller".concat(i);(o=l||n.hasOwnProperty(k)?LS(n,k,!0):LS(n,"scroller",!0))&&u&&(!0===o&&(o={}),o.orientation=h?0:1,a=new MS(u,o));var m,b,x,C,w=LS(n,l?"mouseWheelScroller".concat(i):"mouseWheelScroller",!1);(w&&u&&(m=new RS(u,w)),t.addChildrenMap("slider".concat(i),r),t.addChildrenMap("scroller".concat(i),a),t.addChildrenMap("mouseWheelScroller".concat(i),m),l&&!h||(t.hideUnscrollableSlider=t["hideUnscrollableSlider".concat(i)],t.adaptThumbSizeMode=t["adaptThumb".concat(i,"SizeMode")],t.minThumbSize=t["minThumb".concat(i,"Size")],t.addChildrenMap("slider",r),t.addChildrenMap("scroller",a),t.addChildrenMap("mouseWheelScroller",m)),r)&&(l?(b=h?"t":"s",C="scroll".concat(i)):(b="t",C="scroll"),r.on("valuechange",(function(e){t[b]=e,t.emit(C,t);})));a&&(l?(x="childO".concat(i),C="scroll".concat(i)):(x="childOY",C="scroll"),a.on("valuechange",(function(e){t[x]=e,t.emit(C,t);})));if(m){var S="addChildO".concat(i);m.on("scroll",(function(e){t[S](-e,!0);}));}},DS={right:0,left:1,bottom:0,top:1},IS=Phaser.Utils.Objects.GetValue,jS=function(t,e){var i=t.scene,n=[0,1,0],s=[0,1,0],r=IS(e,"width"),o=IS(e,"height");r||(IS(e,"child.expandWidth",!0)||(n[1]=0));o||(IS(e,"child.expandHeight",!0)||(s[1]=0));var a=new Dx(i,{column:3,row:3,columnProportions:n,rowProportions:s});switch(function(t,e,i){var n=Xw(i,"child"),s=Xw(n,"gameObject",void 0);if(s){var r=Xw(i,"space.child",0);t.childMargin={};var o=t.childMargin,a={};if("number"==typeof r)switch(t.scrollMode){case 0:case 1:o.top=0,o.bottom=0,o.left=0,o.right=0;break;default:o.top=r,o.bottom=r,o.left=r,o.right=r;}else switch(t.scrollMode){case 0:o.top=Xw(r,"top",0),o.bottom=Xw(r,"bottom",0),a.left=Xw(r,"left",0),a.right=Xw(r,"right",0);break;case 1:o.top=Xw(r,"left",0),o.bottom=Xw(r,"right",0),a.top=Xw(r,"top",0),a.bottom=Xw(r,"bottom",0);break;default:o.top=Xw(r,"top",0),o.bottom=Xw(r,"bottom",0),o.left=Xw(r,"left",0),o.right=Xw(r,"right",0);}e.add(s,{column:1,row:1,align:Xw(n,"align","center"),padding:a,expand:{width:Xw(n,"expandWidth",!0),height:Xw(n,"expandHeight",!0)}});}t.addChildrenMap("child",s);}(t,a,e),t.scrollMode){case 0:BS(t,a,"y",e);break;case 1:BS(t,a,"x",e);break;default:BS(t,a,"y",e),BS(t,a,"x",e);}return a},zS=function(t){var e,i,n,s;switch(this.scrollMode){case 0:case 1:e=this.topChildOY,i=this.bottomChildOY,n=this.childrenMap.scroller,s=this.childrenMap.slider;break;default:"Y"===(t=t.toUpperCase())?(e=this.topChildOY,i=this.bottomChildOY):(e=this.leftChildOX,i=this.rightChildOX),n=this.childrenMap["scroller".concat(t)],s=this.childrenMap["slider".concat(t)];}n&&n.setBounds(e,i),s&&s.setEnable(e!==i);},AS=function(t){switch(this.scrollMode){case 0:case 1:(e=this.childrenMap.slider)&&this.hideUnscrollableSlider&&this.setChildVisible(e,this.isOverflow);break;default:t=t.toUpperCase();var e=this.childrenMap["slider".concat(t)],i=this["hideUnscrollableSlider".concat(t)],n=this["isOverflow".concat(t)];e&&i&&this.setChildVisible(e,n);}},FS=function(t){switch(this.scrollMode){case 0:case 1:if(!this.adaptThumbSizeMode)return;if(!(a=this.childrenMap.slider))return;var e=Math.min(this.childVisibleHeight/this.childHeight,1),i=a.childrenMap.track,n=a.childrenMap.thumb,s=this.minThumbSize;if(0===this.scrollMode){var r=i.displayHeight*e;void 0!==s&&r0?t.setText(e).getTextBounds().wrappedText.split("\n"):e.split("\n");}return i},NS=function(t){return (t-this.textLineSpacing)/(this.textLineHeight+this.textLineSpacing)},KS=function(t){return t*(this.textLineHeight+this.textLineSpacing)-this.textLineSpacing},JS=function(t){var e,i=t+this.visibleLinesCount+1;switch(this.textObjectType){case 0:case 2:e=this.lines.slice(t,i).join("\n");break;case 1:var n=this.lines.getLineStartIndex(t),s=this.lines.getLineEndIndex(i-1);e=this.lines.getSliceTagText(n,s,!0);}return e},ZS=function(t,e){switch(US(t)){case 0:var i=(s=t.style).wordWrapWidth,n=s.wordWrapCallback;s.wordWrapWidth=0,s.wordWrapCallback=void 0,t.setText(e),s.wordWrapWidth=i,s.wordWrapCallback=n;break;case 1:var s,r=(s=t.style).wrapMode;s.wrapMode=0,t.setText(e),s.wrapMode=r;break;case 2:var o=t._maxWidth;t._maxWidth=0,t.setText(e),t._maxWidth=o;}},qS=function(){var t=this.textObject.rexSizer;this.textObject.y+=t.offsetY-t.preOffsetY,t.preOffsetY=t.offsetY,this.resetChildPositionState(this.textObject),this.textCropEnable&&$S.call(this);},$S=function(){if(this.textObject.setCrop){var t,e,i=this.textObject.rexSizer.offsetY;i<=0?(t=-i,e=this.height):(t=0,e=this.height-i),this.textObject.setCrop(0,t,this.width,e);}},QS=function(t,e,i){if(i+=this.textLineHeight+this.textLineSpacing,this.textObjectWidth!==e||this._textObjectRealHeight!==i){switch(this.textObjectWidth=e,this._textObjectRealHeight=i,this.textObjectType){case 0:case 1:t.setFixedSize(e,i);var n=t.style,s=Math.max(e,0);0===this.textObjectType?n.wordWrapWidth=s:(0===n.wrapMode&&(n.wrapMode=1),n.wrapWidth=s);break;case 2:t.setMaxWidth(e);}this.setText();}},tP={setText:function(t){return void 0!==t&&(this.text=t),this.lines=HS(this.textObject,this.text,this.lines),this.linesCount=this.lines.length,this._textHeight=void 0,this._textVisibleHeight=void 0,this.updateTextObject(),this},updateTextObject:function(){var t=Math.max(Math.floor(NS.call(this,-this.textOY)),0),e=KS.call(this,t)+this.textOY,i=JS.call(this,t);return ZS(this.textObject,i),this.textObject.rexSizer.offsetY=e,qS.call(this),this},preLayout:function(){return this._textLineHeight=void 0,this._textLineSpacing=void 0,this._visibleLinesCount=void 0,this._textHeight=void 0,this._textVisibleHeight=void 0,Ip.call(this),this},layoutChildren:function(){var t,e,i,n,s,r,o,a=this.left,h=this.top;(t=this.textObject).rexSizer.hidden||(n=a+(i=(e=t.rexSizer).padding).left,s=h+i.top,r=this.width-i.left-i.right,o=this.height-i.top-i.bottom,QS.call(this,t,r,o),up(t,n,s,r,o,e.align),e.preOffsetY=0,qS.call(this),this.textMask&&(this.textMask.setPosition().resize(),this.resetChildPositionState(this.textMask)));}},eP=Phaser.Utils.Objects.IsPlainObject,iP=Phaser.Utils.Objects.GetValue,nP=Phaser.Display.Align.TOP_LEFT,sP=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),eP(s)?(s=iP(h=s,"x",0),r=iP(h,"y",0),o=iP(h,"width",void 0),a=iP(h,"height",void 0)):eP(o)&&(o=iP(h=o,"width",void 0),a=iP(h,"height",void 0)),(l=e.call(this,t,s,r,o,a,h)).type="rexTextBlock",l.textObject=void 0,l.linesCount=0,l.textMask=void 0,l.textObjectType=void 0,l._textLineHeight=void 0,l._textLineSpacing=void 0,l._visibleLinesCount=void 0,l._textHeight=void 0,l._textVisibleHeight=void 0,l._textObjectRealHeight=0,l.lines=void 0,l.text=iP(h,"content",""),l._textOY=0,l.execeedTopState=!1,l.execeedBottomState=!1,l.setClampMode(iP(h,"clamplTextOY",!0)),l.alwaysScrollable=iP(h,"alwaysScrollable",!1);var c=iP(h,"background",void 0),d=iP(h,"text",void 0);void 0===d&&(d=rP(t)),l.textCropEnable=iP(h,"textCrop",!!d.setCrop);var f=iP(h,"textMask",!l.textCropEnable);c&&l.addBackground(c),l.add(d),l.sizerChildren=[d];var p=l.getSizerConfig(d);return p.align=nP,p.padding=gp(0),p.expand=!0,l.textObject=d,l.textObjectType=US(d),p.preOffsetY=0,p.offsetY=0,f&&(l.textMask=sC.call(u(l),l.textObject,u(l))),l.addChildrenMap("background",c),l.addChildrenMap("text",d),l}return r(i,[{key:"destroy",value:function(t){if(this.scene&&!this.ignoreDestroy){if(this.textObject=void 0,this.textMask=void 0,this.lines){switch(this.textObjectType){case 0:case 2:this.lines.length=0;break;case 1:this.lines.destroy();}this.lines=void 0;}p(h(i.prototype),"destroy",this).call(this,t);}}},{key:"setClampMode",value:function(t){return void 0===t&&(t=!0),this.clampTextOY=t,this}},{key:"textLineHeight",get:function(){if(void 0===this._textLineHeight){var t;switch(this.textObjectType){case 0:case 1:var e=this.textObject.style;t=e.metrics.fontSize+e.strokeThickness;break;case 2:var i=this.textObject.fontSize/this.textObject.fontData.size;t=this.textObject.fontData.lineHeight*i;}this._textLineHeight=t;}return this._textLineHeight}},{key:"textLineSpacing",get:function(){if(void 0===this._textLineSpacing){var t;switch(this.textObjectType){case 0:case 1:t=this.textObject.lineSpacing;break;case 2:t=0;}this._textLineSpacing=t;}return this._textLineSpacing}},{key:"visibleLinesCount",get:function(){return void 0===this._visibleLinesCount&&(this._visibleLinesCount=Math.floor(NS.call(this,this._textObjectRealHeight))),this._visibleLinesCount}},{key:"topTextOY",get:function(){return 0}},{key:"bottomTextOY",get:function(){return -this.textVisibleHeight}},{key:"textHeight",get:function(){return void 0===this._textHeight&&(this._textHeight=KS.call(this,this.linesCount)),this._textHeight}},{key:"textObjectHeight",get:function(){return this._textObjectRealHeight-(this.textLineHeight+this.textLineSpacing)}},{key:"textVisibleHeight",get:function(){if(void 0===this._textVisibleHeight){var t=this.textHeight-this.textObjectHeight;!this.alwaysScrollable&&t<0&&(t=0),this._textVisibleHeight=t;}return this._textVisibleHeight}},{key:"textOYExceedTop",value:function(t){return void 0===t&&(t=this.textOY),t>this.topTextOY}},{key:"textOYExeceedBottom",value:function(t){return void 0===t&&(t=this.textOY),tthis.linesCount?t=0:n?t=e:s&&(t=i)),this._textOY!==t&&(this._textOY=t,this.updateTextObject()),n&&(this.execeedTopState||this.emit("execeedtop",this,t,e)),this.execeedTopState=n,s&&(this.execeedBottomState||this.emit("execeedbottom",this,t,i)),this.execeedBottomState=s;}},{key:"setTextOY",value:function(t){return this.textOY=t,this}},{key:"t",get:function(){var t=this.textVisibleHeight;return 0===t?0:this.textOY/-t},set:function(t){this.textOY=-this.textVisibleHeight*t;}},{key:"setTextOYByPercentage",value:function(t){return this.t=t,this}}]),i}(pk),rP=function(t){return t.add.text(0,0,"")};Object.assign(sP.prototype,tP);var oP={scrollToLine:function(t){return this.setChildOY(-this.lineHeight*t),this},scrollToNextLine:function(t){void 0===t&&(t=1);var e=this.lineIndex+t;return this.scrollToLine(e),this}},aP=Phaser.Utils.Objects.GetValue,hP=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=aP(s,"text",void 0),a=aP(s,"textWidth",void 0),h=aP(s,"textHeight",void 0),l=aP(s,"textCrop",!!o.setCrop),u=aP(s,"textMask",!l),c=aP(s,"content",""),d=new sP(t,{width:a,height:h,text:o,textMask:u,textCrop:l&&!u,content:c,clamplTextOY:aP(s,"clamplChildOY",!1),alwaysScrollable:aP(s,"alwaysScrollable",!1)});t.add.existing(d),function(t){Object.defineProperty(t,"childOY",{configurable:!0,get:function(){return t.textOY},set:function(e){t.textOY=e;}}),Object.defineProperty(t,"topChildOY",{get:function(){return t.topTextOY}}),Object.defineProperty(t,"bottomChildOY",{get:function(){return t.bottomTextOY}}),Object.defineProperty(t,"childVisibleHeight",{get:function(){return t.textObjectHeight}}),Object.defineProperty(t,"childHeight",{get:function(){return t.textHeight}});}(d),s.scrollMode=0,s.type="rexTextArea",s.child={gameObject:d,expandWidth:void 0===a,expandHeight:void 0===h};var f=aP(s,"space",void 0);return f&&(f.child=aP(f,"text",0)),(r=e.call(this,t,s)).addChildrenMap("text",o),r}return r(i,[{key:"text",get:function(){return this.childrenMap.child.text}},{key:"lineHeight",get:function(){var t=this.childrenMap.child;return t.textLineHeight+t.textLineSpacing}},{key:"lineIndex",get:function(){return Math.floor(-this.childOY/this.lineHeight)}},{key:"linesCount",get:function(){return this.childrenMap.child.linesCount}},{key:"contentHeight",get:function(){return this.childrenMap.child.textHeight}}]),i}(XS);Object.assign(hP.prototype,{setText:function(t){return this.childrenMap.child.setText(t),this.resizeController(),this},appendText:function(t){return this.setText(this.text+t),this}},oP);var lP=Phaser.Utils.Objects.GetValue,uP=function(t,e,i){e=e?M(e):{};var n=lP(i,"background",aC),s=lP(i,"text",uC),r=lP(i,"track",aC),o=lP(i,"thumb",aC);n?e.background=n(t,e.background):delete e.background,s?e.text=s(t,e.text):delete e.text;var a=e.slider;!1!==a&&(void 0===a&&(a={}),r?a.track=r(t,a.track):delete a.track,o?a.thumb=o(t,a.thumb):delete a.thumb,e.slider=a);var h=new hP(t,e);return t.add.existing(h),h},cP=Phaser.Utils.Objects.GetValue,dP=Phaser.Utils.Objects.GetValue,fP=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;n(this,i),s=s?M(s):{},void 0===r&&(r={});var a=dP(r,"background",aC);a?s.background=a(t,s.background):delete s.background,s.title=Mw(t,s.title,r.title),s.content=function(t,e,i){var n,s=cP(e,"$type");void 0===s&&e&&(e.hasOwnProperty("slider")||e.hasOwnProperty("scroller"))&&(s="textarea"),n="textarea"===s?new uP(t,e,i):new Mw(t,e,i);return t.add.existing(n),n}(t,s.content,r.content),s.content instanceof hP&&Il(s,"height")&&!Il(s,"proportion.content")&&Z(s,"proportion.content",1);var h=s.button,l=s.buttonA||h,c=s.buttonB||h,d=s.buttonMode;void 0===d&&(d=l&&c?2:l?1:0);var f=r.button,p=r.buttonA||f,v=r.buttonB||f;switch(d){case 2:s.actions=[Mw(t,l,p),Mw(t,c,v)];break;case 1:s.actions=[Mw(t,l,p)];break;case 0:break;default:s.actions=[];}var g=s.choice;g&&(s.choices=[]),(o=e.call(this,t,s)).type="rexConfirmDialog",o.buttonMode=d,o.defaultActionConfig=h,o.defaultActionButtonCreator=f,o.defaultChoiceConfig=g,o.defaultChoiceCreator=r.choice;var y=o.childrenMap.actions;return o.addChildrenMap("buttonA",y?y[0]:null),o.addChildrenMap("buttonB",y?y[1]:null),Fw.call(u(o)),o}return r(i)}(Sw);Object.assign(fP.prototype,Bw),T.register("confirmDialog",(function(t,e){var i=new fP(this.scene,t,e);return this.scene.add.existing(i),i})),Z(window,"RexPlugins.UI.ConfirmDialog",fP);var pP=Phaser.Utils.Objects.GetValue,vP=function(t,e,i){var n=pP(t,"proportion.".concat(e),i.proportion),s=pP(t,"align.".concat(e),"center"),r=pP(t,"space.".concat(e),void 0);if("number"==typeof r&&i.paddingKey){var o=r;(r={})[i.paddingKey]=o;}return {proportion:n,align:s,padding:r,expand:pP(t,"expand.".concat(e),!0)}},gP=function(t){return vP(t,"header",{proportion:0,paddingKey:"bottom"})},yP=function(t){return vP(t,"leftSide",{proportion:0,paddingKey:"right"})},kP=function(t){return vP(t,"content",{proportion:1})},mP=function(t){return vP(t,"rightSide",{proportion:0,paddingKey:"left"})},bP=function(t){return vP(t,"footer",{proportion:0,paddingKey:"top"})},xP=function(t,e){var i=new vx(t,{orientation:e});return t.add.existing(i),i},CP=Phaser.Utils.Objects.GetValue,wP=[function(t){var e=this.scene,i=t.header;i&&this.add(i,gP(t));var n=xP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,yP(t));var r=t.content;r&&n.add(r,kP(t));var o=t.rightSide;o&&n.add(o,mP(t));var a=t.footer;a&&this.add(a,bP(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,gP(t));var n=xP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,yP(t));var r=xP(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=xP(e,0);r.add(o,{proportion:1,align:"center",padding:0,expand:!0});var a=t.content;a&&o.add(a,kP(t));var h=t.rightSide;h&&o.add(h,mP(t));var l=t.footer;l&&r.add(l,bP(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,gP(t));var n=xP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=xP(e,1);n.add(s,{proportion:1,align:"center",padding:0,expand:!0});var r=xP(e,0);s.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.leftSide;o&&r.add(o,yP(t));var a=t.content;a&&r.add(a,kP(t));var h=t.footer;h&&s.add(h,bP(t));var l=t.rightSide;l&&n.add(l,mP(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,gP(t));var n=xP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,yP(t));var r=xP(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.content;o&&r.add(o,kP(t));var a=t.footer;a&&r.add(a,bP(t));var h=t.rightSide;h&&n.add(h,mP(t));}],SP={FFF:0,LFF:1,FFR:2,LFR:3},PP=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),void 0===s&&(s={}),s.orientation=1,(r=e.call(this,t,s)).type="rexHolyGrail",r.build(s),r}return r(i)}(vx),TP={build:function(t){this.clear(!0);var e=CP(t,"background",void 0);e&&this.addBackground(e);var i=CP(t,"layoutMode",0);"string"==typeof i&&(i=SP[i.toUpperCase()]),(wP[i]||wP[0]).call(this,t),this.addChildrenMap("background",t.background),this.addChildrenMap("header",t.header),this.addChildrenMap("leftSide",t.leftSide),this.addChildrenMap("content",t.content),this.addChildrenMap("rightSide",t.rightSide),this.addChildrenMap("footer",t.footer);}};Object.assign(PP.prototype,TP),T.register("holyGrail",(function(t){var e=new PP(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.HolyGrail",PP);var OP={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):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 Ov(this.getButton(t,e)),this},showLeftButton:function(t){return Ov(this.getLeftButton(t)),this},showRightButton:function(t){return Ov(this.getRightButton(t)),this},showTopButton:function(t){return Ov(this.getTopButton(t)),this},showBottomButton:function(t){return Ov(this.getBottomButton(t)),this},hideButton:function(t,e){return Mv(this.getButton(t,e)),this},hideLeftButton:function(t){return Mv(this.getLeftButton(t)),this},hideRightButton:function(t){return Mv(this.getRightButton(t)),this},hideTopButton:function(t){return Mv(this.getTopButton(t)),this},hideBottomButton:function(t){return Mv(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},forEachButton:function(t,e,i){return this.getButtonsSizer(t).forEachButtton(e,i),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}},MP=Phaser.Utils.Objects.GetValue,EP=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),s.column=3,s.row=3,(r=e.call(this,t,s)).type="rexTabs",r.eventEmitter=MP(s,"eventEmitter",u(r));var o,a,h,l,c=MP(s,"background",void 0),d=MP(s,"panel",void 0),f=MP(s,"leftButtons",void 0),p=MP(s,"leftButtonsBackground",void 0),v=MP(s,"rightButtons",void 0),g=MP(s,"rightButtonsBackground",void 0),y=MP(s,"topButtons",void 0),k=MP(s,"topButtonsBackground",void 0),m=MP(s,"bottomButtons",void 0),b=MP(s,"bottomButtonsBackground",void 0),x=MP(s,"click",void 0);if(c&&r.addBackground(c),d&&r.add(d,1,1,"center",0,!0),f){var C=MP(s,"space.leftButtonsOffset",0),w=MP(s,"space.leftButton",0);o=new tw(t,{groupName:"left",background:p,buttons:f,orientation:1,space:{item:w},align:MP(s,"align.leftButtons",void 0),click:x,eventEmitter:r.eventEmitter});var S={top:C};r.add(o,0,1,"top",S,!1);}if(v){var P=MP(s,"space.rightButtonsOffset",0),T=MP(s,"space.rightButton",0);a=new tw(t,{groupName:"right",background:g,buttons:v,orientation:1,space:{item:T},align:MP(s,"align.rightButtons",void 0),click:x,eventEmitter:r.eventEmitter});S={top:P};r.add(a,2,1,"top",S,!1);}if(y){var O=MP(s,"space.topButtonsOffset",0),M=MP(s,"space.topButton",0);h=new tw(t,{groupName:"top",background:k,buttons:y,orientation:0,space:{item:M},align:MP(s,"align.topButtons",void 0),click:x,eventEmitter:r.eventEmitter});S={left:O};r.add(h,1,0,"left",S,!1);}if(m){var E=MP(s,"space.bottomButtonsOffset",0),_=MP(s,"space.bottomButton",0);l=new tw(t,{groupName:"bottom",background:b,buttons:m,orientation:0,space:{item:_},align:MP(s,"align.bottomButtons",void 0),click:x,eventEmitter:r.eventEmitter});S={left:E};r.add(l,1,2,"left",S,!1);}return r.addChildrenMap("background",c),r.addChildrenMap("panel",d),r.addChildrenMap("leftButtons",f),r.addChildrenMap("rightButtons",v),r.addChildrenMap("topButtons",y),r.addChildrenMap("bottomButtons",m),r.addChildrenMap("leftButtonsSizer",o),r.addChildrenMap("rightButtonsSizer",a),r.addChildrenMap("topButtonsSizer",h),r.addChildrenMap("bottomButtonsSizer",l),r}return r(i)}(Dx);Object.assign(EP.prototype,OP),T.register("tabs",(function(t){var e=new EP(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Tabs",EP),T.register("slider",(function(t){var e=new pS(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Slider",pS);var _P=function(){function t(e,i){n(this,t),this.container=null,this._deltaHeight=0,this.setParent(e);}return r(t,[{key:"setParent",value:function(t){this.parent=t,this.parentContainer=t.getParentContainer();}},{key:"destroy",value:function(t){void 0===t&&(t=!1),t||this.destroyContainer(),this.deltaHeight=0,this.data=void 0,this.container=null,this.parent=void 0,this.parentContainer=void 0;}},{key:"table",get:function(){return this.parent}},{key:"scrollMode",get:function(){return this.parentContainer.scrollMode}},{key:"colIndx",get:function(){return this.parent.cellIndxeToColIndex(this.index)}},{key:"rowIndx",get:function(){return this.parent.cellIndxeToRowIndex(this.index)}},{key:"getContainer",value:function(){return this.container}},{key:"setContainer",value:function(t){return t?(this.container&&this.container.destroy(),this.container=t,this.parentContainer.add(t),this):(this.destroyContainer(),this)}},{key:"destroyContainer",value:function(){return this.container&&(this.container.destroy(),this.container=null),this}},{key:"popContainer",value:function(){if(this.container){var t=this.container;return this.container=null,this.parentContainer.remove(t),t}return null}},{key:"setXY",value:function(t,e){return this.container&&this.parentContainer.setChildLocalPosition(this.container,t,e),this}},{key:"setCellContainerAlign",value:function(t){return "string"==typeof t&&(t=Wf[t]),this.cellContainerAlign=t,this}},{key:"deltaHeight",get:function(){return this._deltaHeight},set:function(t){null==t&&(t=0);var e=this.parent;0===this._deltaHeight&&0!==t?e.nonZeroDeltaHeightCount++:0!==this._deltaHeight&&0===t&&e.nonZeroDeltaHeightCount--;var i=this._deltaHeight!==t;if(this._deltaHeight=t,i){e.resetTotalRowsHeight();var n=0===this.scrollMode?"cellheightchange":"cellwidthchange";this.parentContainer.emit(n,this,this.container,this.parentContainer);}}},{key:"deltaWidth",get:function(){return this.deltaHeight},set:function(t){this.deltaHeight=t;}},{key:"setDeltaHeight",value:function(t){return this.deltaHeight=t,this}},{key:"setDeltaWidth",value:function(t){return this.deltaHeight=t,this}},{key:"height",get:function(){return 0===this.scrollMode?this.deltaHeight+this.parent.defaultCellHeight:this.parent.defaultCellWidth},set:function(t){1!==this.scrollMode&&this.setDeltaHeight(t-this.parent.defaultCellHeight);}},{key:"setHeight",value:function(t){return this.height=t,this}},{key:"width",get:function(){return 0===this.scrollMode?this.parent.defaultCellWidth:this.deltaHeight+this.parent.defaultCellHeight},set:function(t){0!==this.scrollMode&&this.setDeltaHeight(t-this.parent.defaultCellHeight);}},{key:"setWidth",value:function(t){return this.width=t,this}},{key:"scene",get:function(){return this.parentContainer.scene}}]),t}();Object.assign(_P.prototype,Ct);var RP=Phaser.Utils.Objects.GetValue,LP=Phaser.Utils.Array.SpliceOne,BP=function(){function t(e,i){n(this,t),this.parent=e,this.cells=[],this.cellPool=new st,this.resetFromJSON(i);}return r(t,[{key:"resetFromJSON",value:function(t){void 0===t&&(t={}),this.colCount=void 0,this.nonZeroDeltaHeightCount=0,this.resetTotalRowsHeight();var e=t.cellHeight;void 0===e&&(e=30);var i=t.cellWidth;return void 0===i&&(i=30),this.setDefaultCellHeight(e),this.setDefaultCellWidth(i),this.initCells(RP(t,"cellsCount",0)),this.setColumnCount(RP(t,"columns",1)),this}},{key:"destroy",value:function(t){this.cellPool.destroy(),this.cells=void 0,this.parent=void 0;}},{key:"defaultCellHeightMode",get:function(){return 0===this.nonZeroDeltaHeightCount}},{key:"setDefaultCellHeight",value:function(t){return this.defaultCellHeight=t,this}},{key:"setDefaultCellWidth",value:function(t){return this.defaultCellWidth=t,this}},{key:"initCells",value:function(t){var e=this.cells;e.length=t;for(var i=0;i=0&&t=0&&i0&&n)){if(0===r)return 2===e&&(i+=1),i;if(1===e){var o=i;(n=(i+=1)>=0&&i=this.colCount?null:e*this.colCount+t}},{key:"rowIndexToHeight",value:function(t,e){if(this.defaultCellHeightMode)return (e-t+1)*this.defaultCellHeight;for(var i=0,n=t;n<=e;n++)i+=this.getRowHeight(n);return i}},{key:"colIndexToWidth",value:function(t,e){return (e-t+1)*this.defaultCellWidth}},{key:"getRowHeight",value:function(t){var e=this.colCount;if(e<=1)return this.getCellHeight(this.colRowToCellIndex(0,t));for(var i,n=0,s=0;sthis.topTableOY,r=tthis.leftTableOX,r=tt?this.removeCells(t,e-t):this.insertNewCells(e,t-e)),this},insertNewCells:function(t,e){return "object"===i(t)&&(t=t.index),void 0===e&&(e=1),e<=0||(t=JP(t,0,this.cellsCount),this.table.insertNewCells(t,e)),this},removeCells:function(t,e){if("object"===i(t)&&(t=t.index),void 0===e&&(e=1),t<0&&(e+=t,t=0),e<=0)return this;if(t>this.cellsCount)return this;for(var n,s=t,r=t+e;sb.bottom&&(l=c.getTopLeft().y,t.setOrigin(0,1).setPosition(h+d,l+f));},WT={down:0,up:1},YT=Phaser.Utils.Objects.GetValue,VT=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),null==s.transitIn&&(s.transitIn=function(t,e){Xp(t,e,"y","Cubic");}),null==s.transitOut&&(s.transitOut=function(t,e){!function(t,e,i,n,s){void 0===n&&(n="Linear");var r={mode:0};switch(i){case 0:case"x":r.end={x:0};break;case 1:case"y":r.end={y:0};break;default:r.end=0;}r.duration=e,r.ease=n,void 0===s?s=new Yp(t,r):s.resetFromJSON(r),s.restart();}(t,e,"y","Linear");}),s.manualClose=!0,s.clickOutsideClose=!0,s.destroy=!0,r=e.call(this,t,s),FT(t,s),t.isRexSizer&&t.layout();var o=YT(s,"touchOutsideClose",!1),a=YT(s,"anyTouchClose",!1);return a&&(o=!1),a?r.once("open",r.anyTouchClose,u(r)):o&&r.once("open",r.touchOutsideClose,u(r)),r.requestOpen(),r}return r(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.scene.input.off("pointerup",this.touchCloseCallback,this),p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"touchOutsideClose",value:function(){return this.scene.input.on("pointerup",this.touchCloseCallback,this),this.clickOutsideTest=!0,this}},{key:"anyTouchClose",value:function(){return this.scene.input.once("pointerup",this.touchCloseCallback,this),this}},{key:"touchCloseCallback",value:function(t){this.clickOutsideTest&&ag(this.parent,t.worldX,t.worldY)||this.requestClose();}},{key:"onOpen",value:function(){this.emit("open",this.parent,this),p(h(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.parent,this),p(h(i.prototype),"onClose",this).call(this);}}]),i}(Kv),XT={openListPanel:function(){if(this.listPanel)return this;var t,e=zT.call(this);e.on("button.over",(function(t,i,n,s){this.listOnButtonOver&&this.listOnButtonOver.call(this,t,i,n,s),this.emit("button.over",this,e,t,i,n,s);}),this).on("button.out",(function(t,i,n,s){this.listOnButtonOut&&this.listOnButtonOut.call(this,t,i,n,s),this.emit("button.out",this,e,t,i,n,s);}),this),t=this.listAlignMode&&"label"!==this.listAlignMode?this.getElement(this.listAlignMode):this;var i=new VT(e,{duration:{in:this.listEaseInDuration,out:this.listEaseOutDuration},transitIn:this.listTransitInCallback,transitOut:this.listTransitOutCallback,expandDirection:this.listExpandDirection,alignTargetX:t,alignTargetY:this,alignSide:this.listAlignSide,bounds:this.listBounds,anyTouchClose:!0}).on("open",(function(){e.on("button.click",(function(t,i,n,s){this.listOnButtonClick&&this.listOnButtonClick.call(this,t,i,n,s),this.emit("button.click",this,e,t,i,n,s);}),this),this.emit("list.open",this,e);}),this).on("close",(function(){this.listPanel=void 0,this.dropDownBehavior=void 0;}),this);return this.listPanel=e,this.dropDownBehavior=i,this.pin(e),this},closeListPanel:function(){return this.dropDownBehavior?(this.dropDownBehavior.requestClose(),this):this},toggleListPanel:function(){return this.listPanel?this.closeListPanel():this.openListPanel(),this}};Object.assign(XT,IT);var GT=Phaser.Utils.Objects.GetValue,UT=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),(r=e.call(this,t,s)).type="rexDropDownList",r.timer=void 0,r.setOptions(GT(s,"options"));var o=GT(s,"list");return r.setWrapEnable(GT(o,"wrap",!1)),r.setCreateButtonCallback(GT(o,"createButtonCallback")),r.setCreateListBackgroundCallback(GT(o,"createBackgroundCallback")),r.setButtonClickCallback(GT(o,"onButtonClick")),r.setButtonOverCallback(GT(o,"onButtonOver")),r.setButtonOutCallback(GT(o,"onButtonOut")),r.setListExpandDirection(GT(o,"expandDirection")),r.setListEaseInDuration(GT(o,"easeIn",500)),r.setListEaseOutDuration(GT(o,"easeOut",100)),r.setListTransitInCallback(GT(o,"transitIn")),r.settListTransitOutCallback(GT(o,"transitOut")),r.setListSize(GT(o,"width"),GT(o,"height")),r.setListAlignmentMode(GT(o,"alignParent","text")),r.setListAlignmentSide(GT(o,"alignSide","")),r.setListBounds(GT(o,"bounds")),r.setListSpace(GT(o,"space")),r.setListDraggable(GT(o,"draggable",!1)),r.setValueChangeCallback(GT(s,"setValueCallback"),GT(s,"setValueCallbackScope")),r.setValue(GT(s,"value")),r.onClick(r.toggleListPanel,u(r)),r}return r(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.listPanel&&(this.listPanel.destroy(t),this.listPanel=void 0),p(h(i.prototype),"destroy",this).call(this,t));}},{key:"setOptions",value:function(t){return void 0===t&&(t=[]),this.options=t,this}},{key:"setValueChangeCallback",value:function(t,e){return this.valueChangeCallback=t,this.valueChangeCallbackScope=e,this}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"value",get:function(){return this._value},set:function(t){if(this._value!==t){var e=this._value;this._value=t;var i=this.valueChangeCallback,n=this.valueChangeCallbackScope;i&&(n?i.call(n,this,t,e):i(this,t,e)),this.emit("valuechange",this,t,e);}}},{key:"emitButtonClick",value:function(t){var e=this.options[t];return e?(this.emit("button.click",this,void 0,e,t),this):this}}]),i}(oC);Object.assign(UT.prototype,XT),T.register("dropDownList",(function(t){var e=new UT(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.DropDownList",UT);var HT=function(t,e,i){void 0===i&&(i={});var n=(e=e?M(e):{}).label||e.button,s=e.button||e.label;delete e.label,delete e.button;var r=i.label||i.button||i,o=i.button||i.label||i,a=kC(t,n,r);return a.list=e.list||{},a.list.createButtonCallback=function(t,e){var i=Mw(t,s,o).resetDisplayContent({text:e.text});return e.hasOwnProperty("value")&&(i.value=e.value),i},a.list.onButtonOver=function(t,e,i,n){t.setHoverState&&t.setHoverState(!0);},a.list.onButtonOut=function(t,e,i,n){t.setHoverState&&t.setHoverState(!1);},a},NT=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;return n(this,i),s=HT(t,s,r),(o=e.call(this,t,s)).type="rexSimpleDropDownList",o}return r(i,[{key:"setOptions",value:function(t){void 0===t&&(t=[]);for(var e=0,n=t.length;e=this.pageCount-1}},{key:"totalLinesCount",get:function(){return this.lines?this.lines.length:0}},{key:"startLineIndex",get:function(){return this._startLineIndex},set:function(t){t=eO(t,0,this.totalLinesCount-1),this._startLineIndex=t;}},{key:"setStartLineIndex",value:function(t){return this.startLineIndex=t,this}},{key:"pageLinesCount",get:function(){if(void 0!==this.maxLines)return this.maxLines;var t;switch(this.textObjectType){case 0:case 1:var e=this.parent.style.maxLines;t=e>0?e:Math.floor(function(t){var e,i,n;switch(US(t)){case 0:case 1:e=t.height-t.padding.top-t.padding.bottom,i=t.lineSpacing,n=t.style.metrics.fontSize+t.style.strokeThickness;break;case 2:e=t.height,i=0;var s=t.fontSize/t.fontData.size;n=t.fontData.lineHeight*s;}return (e-i)/(n+i)}(this.parent));break;case 2:t=this.totalLinesCount;}return t}},{key:"content",get:function(){return this.sections.join(this.pageBreak)}}]),i}(oo);Object.assign(iO.prototype,QT);var nO,sO=Phaser.Utils.Objects.GetFastValue,rO=Phaser.Utils.Objects.GetValue,oO=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).timer=null,r.resetFromJSON(s),r}return r(i,[{key:"resetFromJSON",value:function(t){this.setTextWrapEnable(rO(t,"wrap",!1)),this.setTypeMode(rO(t,"typeMode",0)),this.setTypingSpeed(rO(t,"speed",333)),this.setTextCallback=sO(t,"setTextCallback",null),this.setTextCallbackScope=sO(t,"setTextCallbackScope",null),this.setTypingContent(sO(t,"text","")),this.typingIdx=sO(t,"typingIdx",0),this.insertIdx=null,this.insertChar=null;var e=sO(t,"elapsed",null);return null!==e&&this.start(void 0,void 0,this.typingIdx,e),this}},{key:"shutdown",value:function(t){this.isShutdown||(this.freeTimer(),p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"setTypeMode",value:function(t){return "string"==typeof t&&(t=hO[t]),this.typeMode=t,this}},{key:"setTypeSpeed",value:function(t){return this.speed=t,this}},{key:"setTypingSpeed",value:function(t){return this.speed=t,this}},{key:"setTextWrapEnable",value:function(t){return void 0===t&&(t=!0),this.textWrapEnable=t,this}},{key:"text",get:function(){return this._text},set:function(t){var e=aO(t);this.textWrapEnable&&(e=function(t,e){switch(US(t)){case 0:t.style.syncFont(t.canvas,t.context),e=t.runWordWrap(e);break;case 1:e=t.getText(e,void 0,void 0,!0);break;case 2:e=t.setText(e).getTextBounds().wrappedText;}return e}(this.parent,e)),this._text=e;}},{key:"isTyping",get:function(){return null!==this.getTimer()}},{key:"isLastChar",get:function(){return this.typingIdx===this.textLen}},{key:"start",value:function(t,e,i,n){return void 0!==t&&this.setTypingContent(t),void 0!==e&&(this.speed=e),void 0===i&&(i=0),this.typingIdx=i+1,0===this.speed?this.stop(!0):(this.setText(""),this.startTimer(n)),this}},{key:"appendText",value:function(t){var e=this.text.concat(aO(t));return this.isTyping?this.setTypingContent(e):this.start(e,void 0,this.textLen),this}},{key:"stop",value:function(t){if(this.getTimer()&&this.freeTimer(),t){for(;!this.isLastChar;)this.getTypingString(this.text,this.typingIdx,this.textLen,this.typeMode),this.emit("typechar",this.insertChar),this.typingIdx++;this.setText(this.text),this.emit("type"),this.emit("complete",this,this.parent);}return this}},{key:"pause",value:function(){var t=this.getTimer();return t&&(t.paused=!0),this}},{key:"resume",value:function(){var t=this.getTimer();return t&&(t.paused=!1),this}},{key:"setTypingContent",value:function(t){return this.text=t,this.textLen=this.getTextLength(this.text),this}},{key:"onTyping",value:function(){var t=this.getTypingString(this.text,this.typingIdx,this.textLen,this.typeMode);this.setText(t),this.emit("typechar",this.insertChar),this.emit("type"),this.isLastChar?(this.freeTimer(),this.emit("complete",this,this.parent)):(this.timer.delay=this.speed,this.typingIdx++);}},{key:"getTypingString",value:function(t,e,i,n){var s;if(0===n){var r=0,o=e;this.insertIdx=o,s=this.getSubString(t,r,o);}else if(1===n){r=(o=i)-e;this.insertIdx=0,s=this.getSubString(t,r,o);}else if(2===n){var a=i/2;o=(r=Math.floor(a-e/2))+e;this.insertIdx=e%2?e:0,s=this.getSubString(t,r,o);}else if(3===n){var h,l=Math.floor(e/2);if(l>0){r=(o=i)-l;h=this.getSubString(t,r,o);}else h="";var u,c=e-l;if(c>0){o=(r=0)+c;this.insertIdx=o,u=this.getSubString(t,r,o);}else u="",this.insertIdx=0;s=u+h;}return this.insertChar=s.charAt(this.insertIdx-1),s}},{key:"startTimer",value:function(t){var e;return this.timer&&this.freeTimer(),void 0===t?e=0:(this.speed,e=t),this.timer=this.scene.time.addEvent({delay:1e-4,startAt:e,loop:!0,callback:this.onTyping,callbackScope:this}),this}},{key:"getTimer",value:function(){return this.timer}},{key:"freeTimer",value:function(){return this.timer&&(this.timer.remove(),this.timer=null),this}},{key:"setText",value:function(t){this.setTextCallback&&(t=this.setTextCallbackScope?this.setTextCallback.call(this.setTextCallbackScope,t,this.isLastChar,this.insertIdx):this.setTextCallback(t,this.isLastChar,this.insertIdx)),this.textWrapEnable?ZS(this.parent,t):this.parent.setText(t);}},{key:"getTextLength",value:function(t){var e=this.parent;return e.getPlainText?e.getPlainText(t).length:t.length}},{key:"getSubString",value:function(t,e,i){var n=this.parent;return n.getSubString?n.getSubString(t,e,i):t.slice(e,i)}}]),i}(oo),aO=function(t){return Array.isArray(t)?t=t.join("\n"):"number"==typeof t&&(t=t.toString()),t},hO={"left-to-right":0,"right-to-left":1,"middle-to-sides":2,"sides-to-middle":3},lO=Phaser.Utils.Objects.GetValue,uO=function(t){a(i,t);var e=d(i);function i(t,s){return n(this,i),void 0===s&&(s={}),s.hasOwnProperty("layoutMode")||(s.layoutMode=1),e.call(this,t,s)}return r(i)}((void 0===nO&&(nO="rexTextBox"),function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),(r=e.call(this,t,s)).type=nO;var o=r.childrenMap.text;return r.page=new iO(o,lO(s,"page",void 0)),r.typing=new oO(o,lO(s,"typing",s.type)),r.typing.on("complete",r.onPageEnd,u(r)).on("type",r.onType,u(r)).on("typechar",r.onTypeChar,u(r)),r.textWidth=o.width,r.textHeight=o.height,r}return r(i,[{key:"start",value:function(t,e){return this.page.setText(t),void 0!==e&&this.setTypingSpeed(e),this.emit("start"),this.typeNextPage(),this}},{key:"typeNextPage",value:function(){if(this.isLastPage)this.emit("complete");else {var t=this.page.getNextPage();this.typing.start(t);}return this}},{key:"pause",value:function(){return this.isTyping&&(this.typing.pause(),this.emit("pause")),this}},{key:"resume",value:function(){return this.isTyping||(this.emit("resume"),this.typing.resume()),this}},{key:"stop",value:function(t){return this.typing.stop(t),this}},{key:"showLastPage",value:function(){return this.typing.stop(),this.page.showLastPage(),this.emit("type"),this.onPageEnd(),this}},{key:"setTypeSpeed",value:function(t){return this.typing.setTypingSpeed(t),this}},{key:"setTypingSpeed",value:function(t){return this.typing.setTypingSpeed(t),this}},{key:"isTyping",get:function(){return this.typing.isTyping}},{key:"isLastPage",get:function(){return this.page.isLastPage}},{key:"isFirstPage",get:function(){return this.page.isFirstPage}},{key:"pageCount",get:function(){return this.page.pageCount}},{key:"pageIndex",get:function(){return this.page.pageIndex}},{key:"typingSpeed",get:function(){return this.typing.speed}},{key:"onType",value:function(){var t=this.childrenMap.text;this.textWidth===t.width&&this.textHeight===t.height||(this.textWidth=t.width,this.textHeight=t.height,this.getTopmostSizer().layout()),this.emit("type");}},{key:"onTypeChar",value:function(t){this.emit("typechar",t);}},{key:"onPageEnd",value:function(){var t=this.isLastPage;this.emit("pageend"),t&&this.emit("complete");}}]),i}(PC)));T.register("textBox",(function(t){var e=new uO(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.TextBox",uO);var cO=Phaser.Utils.Objects.GetValue,dO=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),(r=e.call(this,t,s)).type="rexNumberBar";var o,a=cO(s,"background",void 0),h=cO(s,"icon",void 0),l=cO(s,"iconMask",void 0),c=cO(s,"slider",void 0),d=cO(s,"text",void 0),f=cO(s,"space.icon",0),p=cO(s,"space.slider",0);(a&&r.addBackground(a),h)&&(0===r.orientation?(c||d)&&(v={right:f}):(c||d)&&(v={bottom:f}),r.add(h,{proportion:0,align:"center",padding:v}),l&&(l=sC.call(u(r),h,h,1)));if(c){var v,g;if(c.orientation=r.orientation,c.eventEmitter=u(r),c.value=null,c.hasOwnProperty("input")||(c.input=-1),o=new pS(t,c),t.add.existing(o),0===r.orientation?d&&(v={right:p}):d&&(v={bottom:p}),0===r.orientation)g=void 0===cO(c,"width",void 0)?1:0;else g=void 0===cO(c,"height",void 0)?1:0;r.add(o,{proportion:g,align:"center",padding:v});}d&&r.add(d),r.addChildrenMap("background",a),r.addChildrenMap("icon",h),r.addChildrenMap("iconMask",l),r.addChildrenMap("slider",o),r.addChildrenMap("text",d);var y=cO(s,"valuechangeCallback",null);if(null!==y){var k=cO(s,"valuechangeCallbackScope",void 0);r.on("valuechange",y,k);}return r.setEnable(cO(s,"enable",void 0)),r.setValue(cO(s,"value",0)),r}return r(i,[{key:"enable",get:function(){return !!this.childrenMap.slider&&this.childrenMap.slider.enable},set:function(t){this.childrenMap.slider&&this.childrenMap.slider.setEnable(t);}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"value",get:function(){return this.childrenMap.slider?this.childrenMap.slider.value:0},set:function(t){this.childrenMap.slider&&(this.childrenMap.slider.value=t);}},{key:"setValue",value:function(t,e,i){return this.childrenMap.slider&&this.childrenMap.slider.setValue(t,e,i),this}},{key:"addValue",value:function(t,e,i){return this.childrenMap.slider&&this.childrenMap.slider.addValue(t,e,i),this}},{key:"getValue",value:function(t,e){return this.childrenMap.slider?this.childrenMap.slider.getValue(t,e):0}},{key:"easeValueTo",value:function(t,e,i){return this.childrenMap.slider&&this.childrenMap.slider.easeValueTo(t,e,i),this}},{key:"stopEaseValue",value:function(){return this.childrenMap.slider&&this.childrenMap.slider.stopEaseValue(),this}},{key:"setEaseValueDuration",value:function(t){return this.childrenMap.slider&&this.childrenMap.slider.setEaseValueDuration(t),this}},{key:"setEaseValueFunction",value:function(t){return this.childrenMap.slider&&this.childrenMap.slider.setEaseValueFunction(t),this}},{key:"text",get:function(){var t=this.childrenMap.text;return void 0===t?"":t.text?t.text:t.getData("text")},set:function(t){var e=this.childrenMap.text;void 0!==e&&(e.setText?e.setText(t):e.setData("text",t));}},{key:"setText",value:function(t){return this.text=t,this}}]),i}(vx);T.register("numberBar",(function(t){var e=new dO(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.NumberBar",dO),T.register("scrollBar",(function(t){var e=new kS(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ScrollBar",kS);var fO=Phaser.Utils.Objects.GetValue,pO={leftTop:"left-top",centerTop:"center-top",rightTop:"right-top",leftCenter:"left-center",center:"center",rightCenter:"right-center",leftBottom:"left-bottom",centerBottom:"center-bottom",rightBottom:"right-bottom"},vO=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),(r=e.call(this,t,s)).type="rexBadge";var o=fO(s,"background",void 0);o&&r.addBackground(o),r.addChildrenMap("background",o);var a=fO(s,"main",void 0);for(var h in a&&r.add(a,{key:"main",align:"center",expand:!1}),r.addChildrenMap("main",a),pO){var l=fO(s,h,void 0);l&&(r.add(l,{key:h,align:pO[h],expand:!1}),r.addChildrenMap(h,l));}return r}return r(i)}(Mk);T.register("badgeLabel",(function(t){var e=new vO(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.BadgeLabel",vO);var gO=Mk.prototype.add,yO=function(t,e,i,n,s,r,o,a,h){return t.setVisible(!1),gO.call(this,t,e,i,n,s,r,o,a,h),this},kO={add:yO,addPage:yO},mO=zf.prototype.setChildVisible,bO={getPage:function(t){return void 0===t?null:this.sizerChildren.hasOwnProperty(t)?this.sizerChildren[t]:null},swapPage:function(t,e){this._previousKey=this._currentKey;var i=this.previousPage;i&&(0===this.swapMode?(mO.call(this,i,!1),this.emit("pageinvisible",i,this._previousKey,this)):i.destroy()),t&&!this.sizerChildren.hasOwnProperty(t)&&this.emit("createpage",t,this),this._currentKey=t;var n=this.currentPage;return n&&(mO.call(this,n,!0),this.emit("pagevisible",n,this._currentKey,this),void 0===e&&(e=this.fadeInDuration),e>0&&n.setAlpha(0).fadeIn(e,1)),this},hasPage:function(t){return this.sizerChildren.hasOwnProperty(t)}};Object.assign(bO,kO);var xO=Phaser.Utils.Objects.GetValue,CO=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).type="rexPages",r.childrenMap=r.sizerChildren,r._previousKey=void 0,r._currentKey=void 0,r.setSwapMode(xO(s,"swapMode",0)),r.setFadeInDuration(xO(s,"fadeIn",0)),r}return r(i,[{key:"setSwapMode",value:function(t){return "string"==typeof t&&(t=wO[t]),this.swapMode=t,this}},{key:"setFadeInDuration",value:function(t){return this.fadeInDuration=t,this}},{key:"previousKey",get:function(){return this._previousKey}},{key:"currentKey",get:function(){return this._currentKey},set:function(t){this.swapPage(t);}},{key:"currentPage",get:function(){return this.getPage(this.currentKey)}},{key:"previousPage",get:function(){return this.getPage(this.previousKey)}},{key:"keys",get:function(){return Object.keys(this.sizerChildren)}}]),i}(Mk);Object.assign(CO.prototype,bO);var wO={invisible:0,destroy:1};T.register("pages",(function(t){var e=new CO(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Pages",CO);var SO=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"tint",get:function(){return 0===this.vertices.length?16777215:this.vertices[0].color}},{key:"setInteractive",value:function(){var t=function(t,e,i){for(var n=this.faces,s=0;s=e.length))return e[t].name},getPageIndex:function(t){for(var e=this.getElement("tabs.buttons"),i=0,n=e.length;ithis.topChildOY}},{key:"childOYExeceedBottom",value:function(t){return void 0===t&&(t=this.childOY),tthis.leftChildOX}},{key:"childOXExeceedRight",value:function(t){return void 0===t&&(t=this.childOX),tthis.childHeight?t=0:n?t=e:s&&(t=i)),this._childOY!==t&&(this._childOY=t,this.resetChildPosition()),n&&(this.execeedTopState||this.emit("execeedtop",this,t,e)),this.execeedTopState=n,s&&(this.execeedBottomState||this.emit("execeedbottom",this,t,i)),this.execeedBottomState=s;}},{key:"childOX",get:function(){return this._childOX},set:function(t){var e=this.leftChildOX,i=this.rightChildOX,n=this.childOXExceedLeft(t),s=this.childOXExeceedRight(t);this.clampChildOX&&(this.childVisibleWidth>this.childWidth?t=0:n?t=e:s&&(t=i)),this._childOX!==t&&(this._childOX=t,this.resetChildPosition()),n&&(this.execeedLeftState||this.emit("execeedleft",this,t,e)),this.execeedLeftState=n,s&&(this.execeedRightState||this.emit("execeedright",this,t,i)),this.execeedRightState=s;}},{key:"setChildOY",value:function(t){return this.childOY=t,this}},{key:"setChildOX",value:function(t){return this.childOX=t,this}},{key:"t",get:function(){var t=this.visibleHeight;return 0===t?0:this.childOY/-t},set:function(t){this.childOY=-this.visibleHeight*t;}},{key:"s",get:function(){var t=this.visibleWidth;return 0===t?0:this.childOX/-t},set:function(t){this.childOX=-this.visibleWidth*t;}},{key:"setChildOYByPercentage",value:function(t){return this.t=t,this}},{key:"setChildOXByPercentage",value:function(t){return this.s=t,this}}]),i}(pk);Object.assign(WM.prototype,jM);var YM=["top","bottom","centerY","center"],VM=["left","right","centerX","center"],XM=function(t,e,i){var n,s="Y"===(e=e.toUpperCase()),r=this.childrenMap.child;if(s){if(i)for(var o=0,a=YM.length;o=0?0:Math.abs(l)<=Math.abs(u)?l:u;}}else {if(i)for(o=0,a=VM.length;o=0?0:Math.abs(c)<=Math.abs(d)?c:d;}}switch(this.scrollMode){case 0:case 1:this.childOY+=n;break;default:this["childO".concat(e)]+=n;}},GM=Phaser.Utils.Objects.GetValue,UM=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=Yw(s),a=GM(s,"panel",void 0);void 0===a&&(a={}),a.scrollMode=o,a.clamplChildOY=GM(s,"clamplChildOY",!1),a.clamplChildOX=GM(s,"clamplChildOX",!1);var h,l,u=new WM(t,a);switch(t.add.existing(u),o){case 0:h=GM(s,"expand.panel",!0),l=!0;break;case 1:h=!0,l=GM(s,"expand.panel",!0);break;default:h=!0,l=!0;}s.type="rexScrollablePanel",s.child={gameObject:u,expandWidth:h,expandHeight:l,align:GM(s,"align.panel","center")};var c=GM(s,"space",void 0);return c&&(c.child=GM(c,"panel",0)),(r=e.call(this,t,s)).addChildrenMap("panel",u.child),r.addChildrenMap("panelLayer",u.maskLayer),r.addChildrenMap("mask",u.maskGameObject),r.addChildrenMap("scrollableBlock",u),r}return r(i,[{key:"setChildrenInteractive",value:function(t){return void 0===t&&(t={}),t.hasOwnProperty("eventEmitter")||(t.eventEmitter=this),t.hasOwnProperty("targets")||(t.targets=[this.childrenMap.panel]),ck(this.childrenMap.child,t),this}}]),i}(XS),HM={scrollToChild:function(t,e){if(!this.hasChild(t))return this;switch(this.scrollMode){case 0:XM.call(this,t,"y",e);break;case 1:XM.call(this,t,"x",e);break;default:XM.call(this,t,"y",e),XM.call(this,t,"x",e);}return this}};Object.assign(UM.prototype,HM),T.register("scrollablePanel",(function(t){var e=new UM(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ScrollablePanel",UM);var NM=function(t,e){t.popUp(e);},KM=function(t,e){t.scaleDown(e);},JM=function(t,e){t.fadeIn(e);},ZM=function(t,e){t.fadeOut(e);},qM=function t(e,i,n){var s,r=bt(n,"reverse",!1);if(gg(e[0]))if(r)for(o=(a=e.length)-1;o>=0;o--)s=t(e[o],i,n);else for(var o=0,a=e.length;on?1:it)return this;for(var e=this.commands.length-1;;){var i=this.commands[this.index],n=i[1];if(gg(n)||(n=Bu(iE,i,1)),qM(n,this.scope),this.emit("runcommand",n,this.scope),this.index===e)return this.complete(),this;if(this.index++,this.nextTime=this.getNextDt(this.nextTime),this.nextTime>t)return this}}},{key:"complete",value:function(){this.clock.stop(),this.state=2,this.emit("complete",this.parent,this);}},{key:"getNextDt",value:function(t){var e=this.commands[this.index][0];return 1===this.timeUnit&&(e*=1e3),1===this.dtMode&&(e+=t),e}},{key:"setDtMode",value:function(t){return "string"==typeof t&&(t=sE[t]),this.dtMode=t,this}},{key:"setTimeUnit",value:function(t){return "string"==typeof t&&(t=nE[t]),this.timeUnit=t,this}}]),i}(oo),iE=[],nE={ms:0,s:1,sec:1},sE={abs:0,absolute:0,inc:1,increment:1},rE=Phaser.Utils.Objects.GetValue,oE=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),void 0===s&&(s={text:createDefaultTextObject(t)}),(r=e.call(this,t,s)).type="rexToast",r.setTransitInTime(rE(s,"duration.in",200)),r.setDisplayTime(rE(s,"duration.hold",1200)),r.setTransitOutTime(rE(s,"duration.out",200)),r.setTransitInCallback(rE(s,"transitIn",aE.popUp)),r.setTransitOutCallback(rE(s,"transitOut",aE.scaleDown)),r.player=new eE(u(r),{dtMode:1}),r.messages=[],r.scaleX0=void 0,r.scaleY0=void 0,r.setVisible(!1),r}return r(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.player.destroy(),this.player=void 0,this.messages=void 0,p(h(i.prototype),"destroy",this).call(this,t));}},{key:"setDisplayTime",value:function(t){return this.displayTime=t,this}},{key:"setTransitOutTime",value:function(t){return this.transitOutTime=t,this}},{key:"setTransitInTime",value:function(t){return this.transitInTime=t,this}},{key:"setTransitInCallback",value:function(t){switch("string"==typeof t&&(t=aE[t]),t){case aE.popUp:t=NM;break;case aE.fadeIn:t=JM;}return t||(t=D),this.transitInCallback=t,this}},{key:"setTransitOutCallback",value:function(t){switch("string"==typeof t&&(t=aE[t]),t){case aE.scaleDown:t=KM;break;case aE.fadeOut:t=ZM;}return t||(t=D),this.transitOutCallback=t,this}},{key:"setScale",value:function(t,e){return void 0===e&&(e=t),this.scaleX0=t,this.scaleY0=e,p(h(i.prototype),"setScale",this).call(this,t,e),this}},{key:"showMessage",value:function(t){if(void 0===this.scaleX0&&(this.scaleX0=this.scaleX),void 0===this.scaleY0&&(this.scaleY0=this.scaleY),void 0===t){if(0===this.messages.length)return this;t=this.messages.shift();}if(this.player.isPlaying)return this.messages.push(t),this;this.setScale(this.scaleX0,this.scaleY0).setVisible(!0),"string"==typeof t?this.setText(t):t(this),this.layout();var e=[[0,[this.transitInCallback,this,this.transitInTime]],[this.transitInTime,[D]],[this.displayTime,[this.transitOutCallback,this,this.transitOutTime]],[this.transitOutTime,[this.setVisible,!1]],[30,[D]]];return this.player.load(e,this).once("complete",(function(){this.showMessage();}),this).start(),this}}]),i}(oC),aE={popUp:0,fadeIn:1,scaleDown:0,fadeOut:1};T.register("toast",(function(t){var e=new oE(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Toast",oE);for(var hE,lE=function(t,e,i){void 0===i&&(i=!0),i?e=e?M(e):{}:e||(e={});var n=new eu(t,e);return t.add.existing(n),n},uE=["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenRod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","DarkOrange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","GoldenRod","Gray","Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory","Khaki","Lavender","LavenderBlush","LawnGreen","LemonChiffon","LightBlue","LightCoral","LightCyan","LightGoldenRodYellow","LightGray","LightGrey","LightGreen","LightPink","LightSalmon","LightSeaGreen","LightSkyBlue","LightSlateGray","LightSlateGrey","LightSteelBlue","LightYellow","Lime","LimeGreen","Linen","Magenta","Maroon","MediumAquaMarine","MediumBlue","MediumOrchid","MediumPurple","MediumSeaGreen","MediumSlateBlue","MediumSpringGreen","MediumTurquoise","MediumVioletRed","MidnightBlue","MintCream","MistyRose","Moccasin","NavajoWhite","Navy","OldLace","Olive","OliveDrab","Orange","OrangeRed","Orchid","PaleGoldenRod","PaleGreen","PaleTurquoise","PaleVioletRed","PapayaWhip","PeachPuff","Peru","Pink","Plum","PowderBlue","Purple","RebeccaPurple","Red","RosyBrown","RoyalBlue","SaddleBrown","Salmon","SandyBrown","SeaGreen","SeaShell","Sienna","Silver","SkyBlue","SlateBlue","SlateGray","SlateGrey","Snow","SpringGreen","SteelBlue","Tan","Teal","Thistle","Tomato","Turquoise","Violet","Wheat","White","WhiteSmoke","Yellow","YellowGreen"],cE=[15792383,16444375,65535,8388564,15794175,16119260,16770244,0,16772045,255,9055202,10824234,14596231,6266528,8388352,13789470,16744272,6591981,16775388,14423100,65535,139,35723,12092939,11119017,11119017,25600,12433259,9109643,5597999,16747520,10040012,9109504,15308410,9419919,4734347,3100495,3100495,52945,9699539,16716947,49151,6908265,6908265,2003199,11674146,16775920,2263842,16711935,14474460,16316671,16766720,14329120,8421504,8421504,32768,11403055,15794160,16738740,13458524,4915330,16777200,15787660,15132410,16773365,8190976,16775885,11393254,15761536,14745599,16448210,13882323,13882323,9498256,16758465,16752762,2142890,8900346,7833753,7833753,11584734,16777184,65280,3329330,16445670,16711935,8388608,6737322,205,12211667,9662683,3978097,8087790,64154,4772300,13047173,1644912,16121850,16770273,16770229,16768685,128,16643558,8421376,7048739,16753920,16729344,14315734,15657130,10025880,11529966,14381203,16773077,16767673,13468991,16761035,14524637,11591910,8388736,6697881,16711680,12357519,4286945,9127187,16416882,16032864,3050327,16774638,10506797,12632256,8900331,6970061,7372944,7372944,16775930,65407,4620980,13808780,32896,14204888,16737095,4251856,15631086,16113331,16777215,16119285,16776960,10145074],dE={},fE=0,pE=uE.length;fE0&&{height:this.colorComponentsHeight,formatLabel:this.colorComponentsFormatLabelConfig,inputText:this.colorComponentsInputTextConfig,space:this.colorComponentsSpace};var o=new QE(t,{width:n,height:r,background:e,space:this.colorPickerSpace,hPalette:{position:this.colorPickerHPalettePosition},colorComponents:s,value:this.value});return t.add.existing(o),o},e_={openColorPicker:function(){if(!this.colorPicker){var t=t_.call(this).layout(),e=new VT(t,{duration:{in:this.colorPickerEaseInDuration,out:this.colorPickerEaseOutDuration},transitIn:this.colorPickerTransitInCallback,transitOut:this.colorPickerTransitOutCallback,expandDirection:this.colorPickerExpandDirection,alignTargetX:this,alignTargetY:this,bounds:this.colorPickerBounds,touchOutsideClose:!0}).on("open",(function(){t.on("valuechange",(function(t){this.setValue(t);}),this);}),this).on("close",(function(){this.colorPicker=void 0,this.dropDownBehavior=void 0;}),this);return this.colorPicker=t,this.dropDownBehavior=e,this.pin(t),this}}};Object.assign(e_,wE);var i_=Phaser.Utils.Objects.GetValue,n_=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),(r=e.call(this,t,s)).type="rexColorInput",s.hasOwnProperty("colorPicker")||(s.colorPicker={background:{color:0}});var o=s.colorPicker,a=!1!==o&&null!==o;if(a){var h;r.setColorPickerSize(i_(o,"width",160),i_(o,"height",170));var l=i_(o,"background");h=l?function(t){return aC(t,l)}:i_(o,"createBackgroundCallback"),r.setCreateColorPickerBackgroundCallback(h),r.setColorPickerHPalettePosition(i_(o,"hPalettePosition",0)),r.setColorPickerExpandDirection(i_(o,"expandDirection")),r.setColorPickerEaseInDuration(i_(o,"easeIn",200)),r.setColorPickerEaseOutDuration(i_(o,"easeOut",200)),r.setColorPickerTransitInCallback(i_(o,"transitIn")),r.setColorPickerTransitOutCallback(i_(o,"transitOut")),r.setColorPickerBounds(i_(o,"bounds"));var c=i_(o,"space");void 0===c&&(c={left:10,right:10,top:10,bottom:10,item:8}),r.setColorPickerSpace(c);}var d=s.colorComponents;if(a&&(!1!==d&&null!==d)){r.setColorComponentsHeight(i_(d,"height",30)),r.setColorComponentsFormatLabelConfig(i_(d,"formatLabel"));var f=i_(d,"inputText");f||(f=i_(s,"inputText")),r.setColorComponentsInputTextConfig(f);var p=i_(d,"space");void 0===p&&(p={item:8}),r.setColorComponentsSpace(p);}var v=r.childrenMap.swatch;return v&&a&&r.onClick(v,r.openColorPicker,u(r)),r}return r(i)}(CE);Object.assign(n_.prototype,e_),T.register("colorInput",(function(t){var e=new n_(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ColorInput",n_),T.register("colorInputLite",(function(t){var e=new CE(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ColorInputBase",CE),T.register("colorPicker",(function(t){var e=new GE(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ColorPicker",GE),T.register("colorComponents",(function(t){var e=new qE(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ColorComponents",qE);var s_=function(t,e){return function(i,n,s,r){"panel"!==n&&s.moveChild(i,r?0:t,e);}},r_=function(t,e){return function(i,n,s,r){"panel"===n&&s.moveChild(i,r?0:t,e);}},o_={visible:{show:function(){return function(t,e,i,n){"panel"!==e&&i.setChildVisible(t,!0);}},hide:function(){return function(t,e,i,n){"panel"!==e&&i.setChildVisible(t,!1);}}},fade:{show:function(t,e){return void 0===e&&(e=1),function(i,n,s,r){"panel"!==n&&s.fadeChild(i,r?0:t,e);}},hide:function(t,e){return void 0===e&&(e=0),function(i,n,s,r){"panel"!==n&&s.fadeChild(i,r?0:t,e);}}},move:{show:s_,hide:s_},"move-panel":{show:r_,hide:r_}},a_=zf.prototype.setChildVisible,h_={setChildVisible:function(t,e){if("string"==typeof t){var i=t;t=this.sizerChildren[i];}else i=Pk(this.sizerChildren,t);return void 0===e&&(e=this.currentChildKey===i),a_.call(this,t,e),this}},l_={fadeChild:function(t,e,i){var n;return "string"==typeof t?(n=t,t=this.sizerChildren[n]):n=Pk(this.sizerChildren,t),void 0===e&&(e=500),void 0===i&&(i=this.currentChildKey===n?1:0),t.fadeIn(e,{start:t.alpha,end:i}),this},fadeChildPromise:function(t,e,i){return "string"==typeof t&&(t=this.sizerChildren[key]),this.fadeChild(t,e,i),t._fade?Ph(t._fade):Promise.resolve()}},u_={moveChild:function(t,e,i,n){var s;"string"==typeof t?(s=t,t=this.sizerChildren[s]):s=Pk(this.sizerChildren,t),void 0===e&&(e=500);var r,o,a,h,l=this.currentChildKey===s;if(void 0===n)switch(s){case"leftSide":case"rightSide":n=_r(t);break;case"topSide":case"bottomSide":n=Rr(t);break;default:if(l)switch(this.previousChildKey){case"leftSide":case"rightSide":n=_r(this.sizerChildren[this.previousChildKey]);break;case"topSide":case"bottomSide":n=Rr(this.sizerChildren[this.previousChildKey]);break;default:n=0;}else switch(this.currentChildKey){case"leftSide":case"rightSide":n=_r(this.sizerChildren[this.currentChildKey]);break;case"topSide":case"bottomSide":n=Rr(this.sizerChildren[this.currentChildKey]);break;default:n=0;}}if(l)switch(s){case"panel":switch(this.previousChildKey){case"leftSide":r=!0;break;case"rightSide":o=!0;break;case"topSide":a=!0;break;case"bottomSide":h=!0;}break;case"leftSide":o=!0;break;case"rightSide":r=!0;break;case"topSide":h=!0;break;case"bottomSide":a=!0;}else switch(s){case"panel":switch(this.currentChildKey){case"leftSide":o=!0;break;case"rightSide":r=!0;break;case"topSide":h=!0;break;case"bottomSide":a=!0;}break;case"leftSide":r=!0;break;case"rightSide":o=!0;break;case"topSide":a=!0;break;case"bottomSide":h=!0;}return r?t.moveTo(e,"-=".concat(n),void 0,i):o?t.moveTo(e,"+=".concat(n),void 0,i):a?t.moveTo(e,void 0,"-=".concat(n),i):h?t.moveTo(e,void 0,"+=".concat(n),i):t.moveTo(0),this},moveChildPromise:function(t,e,i,n){return "string"==typeof t&&(t=this.sizerChildren[key]),this.moveChild(t,e,i,n),t._easeMove?Ph(t._easeMove):Promise.resolve()}},c_={};Object.assign(c_,h_,l_,u_);var d_=Phaser.Utils.Objects.GetValue,f_=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),(r=e.call(this,t,s)).type="rexSides",r.childrenMap=r.sizerChildren,r.previousChildKey=void 0,r.currentChildKey=void 0;var o=d_(s,"showChildCallback",void 0);if(o)if(fg(o)){var a=d_(s,"showChildCallbackScope",void 0);r.on("showchild",o,a);var h=d_(s,"hideChildCallback",void 0),l=d_(s,"hideChildCallbackScope",void 0);r.on("hidechild",h,l);}else {var u=function(t){var e,i,n,s,r=k("string"==typeof t?[t]:t);return e=r[0],i=r.slice(1),o_.hasOwnProperty(e)?(n=o_[e].show.apply(null,i),s=o_[e].hide.apply(null,i)):(n=D,s=D),{show:n,hide:s}}(o);r.on("showchild",u.show),r.on("hidechild",u.hide);}var c=d_(s,"background",void 0),d=d_(s,"panel",void 0),f=d_(s,"leftSide",void 0),p=d_(s,"rightSide",void 0),v=d_(s,"topSide",void 0),g=d_(s,"bottomSide",void 0);if(c&&r.addBackground(c),d&&r.add(d,"panel","center",0,!0),f){var y=d_(s,"expand.left",!0);r.add(f,"leftSide","left-top",0,{height:y});}if(p){y=d_(s,"expand.right",!0);r.add(p,"rightSide","right-top",0,{height:y});}if(v){y=d_(s,"expand.top",!0);r.add(v,"topSide","left-top",0,{width:y});}if(g){y=d_(s,"expand.bottom",!0);r.add(g,"bottomSide","left-bottom",0,{width:y});}return r}return r(i,[{key:"reset",value:function(){return this.previousChildKey=void 0,this.currentChildKey="panel",this.showChild("panel",!0),this.hideChild("leftSide",!0),this.hideChild("rightSide",!0),this.hideChild("topSide",!0),this.hideChild("bottomSide",!0),this}}]),i}(Mk);Object.assign(f_.prototype,{showChild:function(t,e){var i=this.sizerChildren[t];return i&&(this.emit("showchild",i,t,this,e),this.resetChildState(i)),this},hideChild:function(t,e){var i=this.sizerChildren[t];return i&&(this.emit("hidechild",i,t,this,e),this.resetChildState(i)),this},swapChild:function(t,e){return this.currentChildKey===t||("panel"===this.currentChildKey||"panel"===t?(this.previousChildKey=this.currentChildKey,this.currentChildKey=t,this.hideChild(this.previousChildKey,e),this.showChild(this.currentChildKey,e)):(this.swapChild("panel",e),this.swapChild(t,e))),this},showPanel:function(t){return this.swapChild("panel",t),this},showLeftSide:function(){return this.swapChild("leftSide"),this},showRightSide:function(){return this.swapChild("rightSide"),this},showTopSide:function(){return this.swapChild("topSide"),this},showBottomSide:function(){return this.swapChild("bottomSide"),this},hideLeftSide:function(){return "leftSide"==this.currentChildKey&&this.showPanel(),this},hideRightSide:function(){return "rightSide"==this.currentChildKey&&this.showPanel(),this},hideTopSide:function(){return "topSide"==this.currentChildKey&&this.showPanel(),this},hideBottomSide:function(){return "bottomSide"==this.currentChildKey&&this.showPanel(),this},toggleLeftSide:function(){var t="panel"!==this.currentChildKey?"panel":"leftSide";return this.swapChild(t),this},toggleRightSide:function(){var t="panel"!==this.currentChildKey?"panel":"rightSide";return this.swapChild(t),this},toggleTopSide:function(){var t="panel"!==this.currentChildKey?"panel":"topSide";return this.swapChild(t),this},toggleBottomSide:function(){var t="panel"!==this.currentChildKey?"panel":"bottomSide";return this.swapChild(t),this}},c_),T.register("sides",(function(t){var e=new f_(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Sides",f_);var p_=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),s=kC(t,s),(r=e.call(this,t,s)).type="rexTweaker.Title",r}return r(i,[{key:"setTitle",value:function(t){return (t=t?M(t):{}).hasOwnProperty("text")||(t.hasOwnProperty("title")?t.text=t.title:t.text=""),this.resetDisplayContent(t),this}}]),i}(oC),v_=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),(r=e.call(this,t,s)).type="rexTweaker.FolderTitle";var o=new Pd(t,s.expandedIcon);return t.add.existing(o),r.addSpace().add(o,{proportion:0,expand:!1,padding:1,fitRatio:1}),r.addChildrenMap("expandedIcon",o),r}return r(i,[{key:"setExpandedState",value:function(t){void 0===t&&(t=!0);var e=t?"down":"right";return this.childrenMap.expandedIcon.setDirection(e),this}}]),i}(p_),g_=function(t,e){var i=new uR(t,e);return t.add.existing(i),i},y_=function(t,e,i){return aC(t,i)},k_=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).type="rexTweaker.Folder",r}return r(i,[{key:"setTitle",value:function(t){return this.childrenMap.title.setTitle(t),this}}]),i}(LM);Object.assign(k_.prototype,{setBindingTarget:function(t){return this.childrenMap.child.setBindingTarget(t),this}},{getMaxInputRowTitleWidth:function(){return this.childrenMap.child.getMaxInputRowTitleWidth()+this.getInnerPadding("left")},setInputRowTitleWidth:function(t){return t-=this.getInnerPadding("left"),this.childrenMap.child.setInputRowTitleWidth(t),this}});var m_=Phaser.Utils.Objects.GetValue,b_=Phaser.Utils.Objects.GetValue,x_={getMaxInputRowTitleWidth:function(){for(var t=0,e=this.childrenMap.pages.children,i=0,n=e.length;i1?e-1:0),n=1;n0?0:1,o.setMinWidth(this.itemWidth)),this.add(o,{proportion:r,expand:!0}),n.onValueChange&&a.on("valuechange",n.onValueChange),n.onValidate&&a.setValidateCallback(n.onValidate),o.setAutoUpdateEnable(n.autoUpdate),o.setBindingTarget(t,e),n.monitor&&o.startMonitorTarget(),n.key&&this.root.addChildrenMap(n.key,o),this},addButton:oR,addButtons:oR,addSeparator:function(t){var e=this.scene,i=aR(this.styles,"separator"),n=y_(e,0,i);return this.add(n,{expand:!0}),this},setBindingTarget:function(t){for(var e=this.sizerChildren,i=0,n=e.length;is?r:-r),u.localY=d+(c>n?o:-o);}},WR=Phaser.Utils.Objects.IsPlainObject,YR=Phaser.Utils.Objects.GetValue,VR=Phaser.Math.DegToRad,XR=Phaser.Math.RadToDeg,GR=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a){var h;if(n(this,i),WR(s)){var l=s;s=YR(l,"x",0),r=YR(l,"y",0),o=YR(l,"key",null),a=YR(l,"frame",null);}return (h=e.call(this,t,s,r,o,a)).type="rexSkewmage",h._skewX=0,h._skewY=0,h}return r(i,[{key:"skewX",get:function(){return this._skewX},set:function(t){this._skewX=t,FR(this,this._skewX,this._skewY);}},{key:"skewXDeg",get:function(){return XR(this._skewX)},set:function(t){this.skewX=VR(t);}},{key:"skewY",get:function(){return this._skewY},set:function(t){this._skewY=t,FR(this,this._skewX,this._skewY);}},{key:"skewYDeg",get:function(){return XR(this._skewY)},set:function(t){this.skewY=VR(t);}},{key:"setSkewX",value:function(t){return this.skewX=t,this}},{key:"setSkewY",value:function(t){return this.skewY=t,this}},{key:"setSkew",value:function(t,e){return void 0===e&&(e=t),this.skewX=t,this.skewY=e,this}},{key:"setSkewXDeg",value:function(t){return this.skewXDeg=t,this}},{key:"setSkewYDeg",value:function(t){return this.skewYDeg=t,this}},{key:"setSkewDeg",value:function(t,e){return void 0===e&&(e=t),this.skewXDeg=t,this.skewYDeg=e,this}}]),i}(AR),UR=Phaser.Utils.Objects.IsPlainObject,HR=Phaser.Utils.Objects.GetValue,NR=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"skewState",get:function(){return this.isRunning}}]),i}(lM(function(t){a(i,t);var e=d(i);function i(t,s,r,o,a){var h;if(n(this,i),UR(s)){var l=s;s=HR(l,"x",0),r=HR(l,"y",0),o=HR(l,"width",32),a=HR(l,"height",32);}var u=AO(t,o,a);return (h=e.call(this,t,s,r,u,null)).type="rexSkewRenderTexture",h.rt=h.texture,h}return r(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(p(h(i.prototype),"destroy",this).call(this,t),this.rt.destroy(),this.rt=null);}}]),i}(GR)));T.register("skew",(function(t,e){return new NR(t,e)})),Z(window,"RexPlugins.UI.Skew",NR),T.register("anchor",(function(t,e){return new zp(t,e)})),Z(window,"RexPlugins.UI.Anchor",zp),T.register("textTyping",(function(t,e){return new oO(t,e)})),Z(window,"RexPlugins.UI.TextTyping",oO),T.register("textPage",(function(t,e){return new iO(t,e)})),Z(window,"RexPlugins.UI.TextPage",iO);var KR=void 0,JR=Phaser.Utils.Objects.GetValue,ZR=Phaser.Utils.Objects.Clone,qR=function(t){return t.hasOwnProperty("align")?t.align:t.hasOwnProperty("halign")?t.halign:"left"},$R=Phaser.Utils.Objects.GetValue,QR=Phaser.Utils.Objects.Merge,tL={open:function(t,e){var i;void 0===t&&(t={}),t=QR(t,this.openConfig),(i=this)!==KR&&(void 0!==KR&&KR.close(),KR=i),fg(t)&&(e=t,t=void 0);var n=$R(t,"inputType",void 0);void 0===n&&(n=$R(t,"type","text")),void 0===e&&(e=$R(t,"onClose",void 0));var s=$R(t,"onOpen",void 0),r=$R(t,"onTextChanged",void 0);return this.inputText=function(t,e){void 0===e&&(e={}),e=ZR(e);var i=t.scene,n=t.style,s=JR(e,"backgroundColor",n.backgroundColor);null===s&&(s="transparent"),e.text=JR(e,"text",t.text),e.fontFamily=JR(e,"fontFamily",n.fontFamily),e.fontSize=JR(e,"fontSize",n.fontSize),e.color=JR(e,"color",n.color),e.backgroundColor=s,e.direction=JR(e,"rtl",n.rtl)?"rtl":"ltr",e.align=JR(e,"align",qR(n)),"rtl"===e.direction&&pC(t)&&(e.align="right");var r=new lb(i,t.x,t.y,JR(e,"width",t.width),JR(e,"height",t.height),e);r.setOrigin(t.originX,t.originY).setScrollFactor(t.scrollFactorX,t.scrollFactorY);var o=t.parentContainer;return o?o.add(r):i.add.existing(r),r}(this.parent,t).on("textchange",(function(t){var e=t.text;r?r(this.parent,e):this.parent.text=e;}),this).setFocus(),this.parent.setVisible(!1),this.onClose=e,$R(t,"enterClose","textarea"!==n)&&this.scene.input.keyboard.once("keydown-ENTER",this.close,this),this.delayCall=function(t,e,i){return t.time.delayedCall(0,e,[],i)}(this.scene,(function(){this.scene.input.once("pointerdown",this.close,this),s&&s(this.parent),this.emit("open",this.parent);}),this),this},close:function(){return this===KR&&(KR=void 0),this.parent.setVisible(!0),this.inputText&&(this.inputText.destroy(),this.inputText=void 0),this.delayCall&&(this.delayCall.remove(),this.delayCall=void 0),this.scene.input.keyboard.off("keydown-ENTER",this.close,this),this.scene.input.off("pointerdown",this.close,this),this.onClose&&this.onClose(this.parent),this.emit("close",this.parent),this}},eL=Phaser.Utils.Objects.GetValue,iL=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t)).inputText=void 0,r.onClose=void 0,r.delayCall=void 0,r.setOpenConfig(s),eL(s,"clickEnable",!0)&&t.on("pointerdown",(function(){this.open();}),u(r)).setInteractive(),r}return r(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.close(),p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"setOpenConfig",value:function(t){return void 0===t&&(t={}),this.openConfig=t,this}},{key:"isOpened",get:function(){return void 0!==this.inputText}},{key:"text",get:function(){return this.isOpened?this.inputText.text:this.parent.text}}]),i}(oo);Object.assign(iL.prototype,tL);T.register("textEdit",(function(t,e){return new iL(t,e)})),Z(window,"RexPlugins.UI.TextEdit",iL);var nL=65535,sL=function(t,e,i){if(null==e)return t;if(0===e)return aL(t,0,i),t;var n=t.text.length;if(0===n)return aL(t,e,i),t;var s=Math.floor(1.5*e/n);void 0!==i&&s>i&&(s=Math.floor(i));for(var r={},o=oL(t,s,e,i,r),a=0;a<=nL&&0!==o;a++){if((s+=o)<0){s=0;break}o=oL(t,s,e,i,r);}return a===nL&&console.warn("FontSizeFit: Test count exceeds ".concat(nL)),t.setFontSize(s),aL(t,e,i),t},rL=function(t,e,i){return void 0===i[e]&&(t.setFontSize(e),i[e]={width:t.width,height:t.height}),i[e]},oL=function(t,e,i,n,s){var r,o=rL(t,e,s),a=rL(t,e+1,s);if(void 0!==n)if(o.height<=n&&a.height>n)r=0;else {if(o.height>n)return -1;r=Math.floor(n-o.height);}if(o.width<=i&&a.width>i)return 0;if(o.width>i)return -1;var h=Math.floor(i-o.width);return void 0===r?h:Math.min(h,r)},aL=function(t,e,i){var n=t.style;n&&(n.fixedWidth=e,n.parent.width=e,void 0!==i&&(n.fixedHeight=i,n.parent.height=i),n.update(!1));},hL=Phaser.Utils.Objects.GetValue,lL=function(t){a(i,Phaser.Plugins.ScenePlugin);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).add=new T(t),r}return r(i,[{key:"start",value:function(){this.scene.events.on("destroy",this.destroy,this);}},{key:"isInTouching",value:function(t,e,i,n){return !!t.visible&&vg(t,e,i,n)}},{key:"viewport",get:function(){return Zr(this.scene,this.scene.cameras.main,!0)}}]),i}(),uL={getParentSizer:Dd,getTopmostSizer:Id,hide:Mv,show:Ov,isShown:Ev,edit:function(t,e,i){return t._edit||(t._edit=new iL(t,{clickEnable:!1})),t._edit.open(e,i),t._edit},wrapExpandText:vC,fontSizeExpandText:function(t,e){"number"==typeof e&&(e={minWidth:e});var i=hL(e,"minWidth",0),n=hL(e,"minHeight",0),s=hL(e,"fitHeight",!1);return t._minWidth=i,t._minHeight=n,s?(t.runWidthWrap=function(e){return t.setFixedSize&&t.setFixedSize(0,0),t.setFontSize(1),t},t.resize=function(e,i){return sL(t,e,i),t}):(t.runWidthWrap=function(e){return t.setFixedSize&&t.setFixedSize(0,0),sL(t,e,void 0),t},t.resize=function(e,i){return t.width===e&&t.height===i||t.setFixedSize(e,i),t}),t},fontSizeResize:sL,setFontSizeToFitWidth:sL,waitEvent:Sh,waitComplete:Ph,delayPromise:db,setChildrenInteractive:ck,fadeIn:tv,fadeOutDestroy:ev,easeMoveTo:cv,easeMoveFrom:dv,modal:cg,modalPromise:function(t,e){var i=cg(t,e);return new Promise((function(t,e){i.once("close",(function(e){t(e);}));}))},modalClose:dg,requestDrag:dR,openFileChooser:function(t,e){var i=pb(e,"closeDelay",200),n=function(t){var e=document.createElement("input");e.type="file";var i=cb(t,"accept",""),n=cb(t,"multiple",!1);return e.setAttribute("accept",i),n?e.setAttribute("multiple",""):e.removeAttribute("multiple"),e}(e);return n.click(),fb({game:t,fileInput:n,closeDelay:i}).then((function(t){return n.remove(),Promise.resolve(t)}))}};return Object.assign(lL.prototype,uL),lL})); + */Object.assign(xi.prototype,He,Ci);var wi=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"freeLine",value:function(t){if(t)return this.push(t),this}},{key:"freeLines",value:function(t){if(t)return this.pushMultiple(t),this}},{key:"getLine",value:function(t,e,i){var n=this.pop();return null===n&&(n={}),n.text=t,n.width=e,n.newLineMode=i,n}}]),i}(st),Si=Phaser.Utils.Objects.IsPlainObject,Pi=Phaser.Utils.Objects.GetValue,Ti=function(t,e){Si(t)?t=(e=t).key:void 0===e&&(e={key:t}),e.hasOwnProperty("key")||(e.key=t);var i=e.key,n=e.frame,s=e.width,r=e.height;if(void 0===s||void 0===r){var o=this.textureManager.getFrame(i,n),a=o?o.cutWidth:0,h=o?o.cutHeight:0;void 0===s&&void 0===r?(s=a,r=h):void 0===s?s=a*(r/h):void 0===r&&(r=h*(s/a));}this.images[t]={key:i,frame:n,width:s,height:r,y:Pi(e,"y",0),left:Pi(e,"left",0),right:Pi(e,"right",0),originX:Pi(e,"originX",0),originY:Pi(e,"originY",0)};},Oi=function(){function t(e){n(this,t),this.textureManager=e.sys.textures,this.images={};}return r(t,[{key:"destroy",value:function(){this.textureManager=void 0,this.images=void 0;}},{key:"add",value:function(t,e){if("string"==typeof t)Ti.call(this,t,e);else if(Array.isArray(t))for(var i=0,n=(s=t).length;i").concat(t,""):e.hasOwnProperty("_style")?"").concat(t,""):t}},{key:"destroy",value:function(){this.tags=void 0;}},{key:"isTextTag",value:function(t){var e=this.tags[t];return !!e&&null==e.img}}]),t}(),gn=function(t){for(var e,i,n,s={},r=0,o=(t=t.split(";")).length;r=1&&(n.color=a[0]),h>=2&&(n.thickness=parseInt(a[1].replace("px","")));break;case"shadow":a=n.split(" ");n={},(h=a.length)>=1&&(n.color=a[0]),h>=2&&(n.offsetX=parseInt(a[1].replace("px",""))),h>=3&&(n.offsetY=parseInt(a[2].replace("px",""))),h>=4&&(n.blur=parseInt(a[3].replace("px","")));break;case"u":case"underline":case"s":case"strikethrough":var h;a=n.split(" ");n={},(h=a.length)>=1&&(n.color=a[0]),h>=2&&(n.thickness=parseInt(a[1].replace("px",""))),h>=3&&(n.offset=parseInt(a[2].replace("px",""))),"underline"===i?i="u":"strikethrough"===i&&(i="s");break;case"y":n=parseFloat(n);}s[i]=n;}return s},yn=function(t){return 0===(t=t.replace(wn,"")).length},kn=/<\s*class=["|']([^"|']+)["|']\s*\>([\s\S]*?)<\s*\/class\s*\>|<\s*style=["|']([^"|']+)["|']\s*\>([\s\S]*?)<\s*\/style\s*\>/g,mn=/<\s*class=/i,bn=/<\s*class=["|']([^"|']+)["|']\s*\>([\s\S]*?)<\s*\/class\s*\>/,xn=/<\s*style=/i,Cn=/<\s*style=["|']([^"|']+)["|']\s*\>([\s\S]*?)<\s*\/style\s*\>/,wn=/^\s+|\s+$/,Sn=Phaser.Utils.Objects.GetValue,Pn=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a){n(this,i);var h=Sn(a,"tags",void 0),l=new vn(h);return e.call(this,t,s,r,o,a,"rexTagText",l)}return r(i,[{key:"addTag",value:function(t,e){return this.parser.addTag(t,e),this.updateText(!0)}},{key:"addTags",value:function(t){for(var e in t)this.parser.addTag(e,t[e]);return this.updateText(!0)}},{key:"getTag",value:function(t){return this.parser.getTag(t)}},{key:"preDestroy",value:function(){p(h(i.prototype),"preDestroy",this).call(this),this.parser.destroy(),this.parser=void 0;}}]),i}(Wi);T.register("tagText",(function(t,e,i,n){var s=new Pn(this.scene,t,e,i,n);return this.scene.add.existing(s),s})),Z(window,"RexPlugins.UI.TagText",Pn);var Tn=Phaser.Utils.Objects.GetValue,On=function(t,e){return void 0===e?t:t[e]},Mn=function(t,e,n){void 0===t&&(t={}),void 0===e&&(e=0);var s=i(e);return "string"===s?t[e]=n:"number"===s?(t.left=e,t.right=e,t.top=e,t.bottom=e):(t.left=Tn(e,"left",0),t.right=Tn(e,"right",0),t.top=Tn(e,"top",0),t.bottom=Tn(e,"bottom",0)),t},En=function(){function t(e,i){n(this,t),this.setParent(e),this.type=i,this.renderable=!1,this.reset().setActive();}return r(t,[{key:"destroy",value:function(){this.parent.removeChild(this);}},{key:"setParent",value:function(t){return this.parent=t,this}},{key:"scene",get:function(){return this.parent.scene}},{key:"canvas",get:function(){return this.parent?this.parent.canvas:null}},{key:"context",get:function(){return this.parent?this.parent.context:null}},{key:"setDirty",value:function(t){return t&&this.parent&&(this.parent.dirty=!0),this}},{key:"active",get:function(){return this._active},set:function(t){this.setDirty(this._active!=t),this._active=t;}},{key:"setActive",value:function(t){return void 0===t&&(t=!0),this.active=t,this}},{key:"modifyPorperties",value:function(t){return this}},{key:"onFree",value:function(){this.reset().setParent();}},{key:"reset",value:function(){return this}},{key:"render",value:function(){}},{key:"contains",value:function(t,e){return !1}}]),t}();Object.assign(En.prototype,Ct);var _n,Rn,Ln,Bn,Dn,In={renderContent:function(){},render:function(){if(!this.willRender)return this;var t=this.context;if(t.save(),t.globalAlpha=this.alpha,this.toLocalPosition){var e=this.drawX,i=this.drawY;this.autoRound&&(e=Math.round(e),i=Math.round(i)),t.translate(e,i),t.scale(this.scaleX,this.scaleY),t.rotate(this.rotation);}return this.drawBelowCallback&&this.drawBelowCallback(this),this.renderContent(),this.drawAboveCallback&&this.drawAboveCallback(this),t.restore(),this}},jn=Phaser.Math.RotateAround,zn=Phaser.Geom.Rectangle,An=function(t){void 0===Rn&&(Rn=new zn);var e=t.drawTLX,i=t.drawTLY;return Rn.setTo(e,i,t.drawTRX-e,t.drawBLY-i),Rn},Fn=Phaser.Math.RotateAround,Wn=function(t,e,i,n){return void 0===n?n={}:!0===n&&(void 0===Ln&&(Ln={}),n=Ln),n.x=e,n.y=i,0!==t.rotation&&Fn(n,0,0,t.rotation),n.x=n.x*t.scaleX+t.drawX,n.y=n.y*t.scaleY+t.drawY,n},Yn=Phaser.GameObjects.Components.TransformMatrix,Vn={},Xn=function(t,e,i,n,s){var r=Wn(e,i,n,!0),o=function(t,e,i,n){void 0===n?n={}:!0===n&&(n=Vn);var s=e-t.width*t.originX,r=i-t.height*t.originY;return void 0===Bn&&(Bn=new Yn,Dn=new Yn),t.parentContainer?t.getWorldTransformMatrix(Bn,Dn):Bn.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),Bn.transformPoint(s,r,n),n}(t,r.x,r.y,s);return o},Gn=function(t,e,i,n,s){"number"!=typeof i&&(s=i,i=0,n=0);var r=e.drawCenterX+i,o=e.drawCenterY+n;return Xn(t,e,r,o,s)},Un={contains:function(t,e){if(0===this.width||0===this.height)return !1;var i=function(t,e,i,n){return void 0===n?n={}:!0===n&&(void 0===_n&&(_n={}),n=_n),n.x=(t-i.drawX)/i.scaleX,n.y=(e-i.drawY)/i.scaleY,0!==i.rotation&&jn(n,0,0,-i.rotation),n}(t,e,this,!0);return An(this).contains(i.x,i.y)},getWorldPosition:function(t,e,i){return Gn(this.parent,this,t,e,i)}};Object.assign(Un,In);var Hn=Phaser.Math.DegToRad,Nn=Phaser.Math.RadToDeg,Kn=Phaser.Utils.Objects.GetValue,Jn=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).renderable=!0,r.scrollFactorX=1,r.scrollFactorY=1,r.toLocalPosition=!0,r.originX=0,r.offsetX=0,r.offsetY=0,r}return r(i,[{key:"visible",get:function(){return this._visible},set:function(t){this.setDirty(this._visible!=t),this._visible=t;}},{key:"setVisible",value:function(t){return void 0===t&&(t=!0),this.visible=t,this}},{key:"alpha",get:function(){return this._alpha},set:function(t){this.setDirty(this._alpha!=t),this._alpha=t;}},{key:"setAlpha",value:function(t){return this.alpha=t,this}},{key:"x",get:function(){return this._x},set:function(t){this.setDirty(this._x!=t),this._x=t;}},{key:"setX",value:function(t){return this.x=t,this}},{key:"y",get:function(){return this._y},set:function(t){this.setDirty(this._y!=t),this._y=t;}},{key:"setY",value:function(t){return this.y=t,this}},{key:"setPosition",value:function(t,e){return this.x=t,this.y=e,this}},{key:"setInitialPosition",value:function(t,e){return this.x0=t,this.y0=e,this}},{key:"setScrollFactorX",value:function(t){return this.scrollFactorX=t,this}},{key:"setScrollFactorY",value:function(t){return this.scrollFactorY=t,this}},{key:"setScrollFactor",value:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}},{key:"rotation",get:function(){return this._rotation},set:function(t){this.setDirty(this._rotation!=t),this._rotation=t;}},{key:"setRotation",value:function(t){return this.rotation=t,this}},{key:"angle",get:function(){return Nn(this._rotation)},set:function(t){this.rotation=Hn(t);}},{key:"setAngle",value:function(t){return this.angle=t,this}},{key:"scaleX",get:function(){return this._scaleX},set:function(t){this.setDirty(this._scaleX!==t),this._scaleX=t;}},{key:"setScaleX",value:function(t){return this.scaleX=t,this}},{key:"width",get:function(){return 0},set:function(t){}},{key:"setWidth",value:function(t,e){return void 0===e&&(e=!1),this.width=t,e&&(this.scaleY=this.scaleX),this}},{key:"leftSpace",get:function(){return this._leftSpace},set:function(t){this.setDirty(this._leftSpace!==t),this._leftSpace=t;}},{key:"setLeftSpace",value:function(t){return this.leftSpace=t,this}},{key:"rightSpace",get:function(){return this._rightSpace},set:function(t){this.setDirty(this._rightSpace!==t),this._rightSpace=t;}},{key:"setRightSpace",value:function(t){return this.rightSpace=t,this}},{key:"outerWidth",get:function(){return this.width+this.leftSpace+this.rightSpace}},{key:"scaleY",get:function(){return this._scaleY},set:function(t){this.setDirty(this._scaleY!==t),this._scaleY=t;}},{key:"setScaleY",value:function(t){return this.scaleY=t,this}},{key:"height",get:function(){return 0},set:function(t){}},{key:"setHeight",value:function(t,e){return void 0===e&&(e=!1),this.height=t,e&&(this.scaleX=this.scaleY),this}},{key:"setScale",value:function(t,e){return void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this}},{key:"setOrigin",value:function(t){return this.originX=t,this}},{key:"setAlign",value:function(t){return this.align=t,this}},{key:"modifyPorperties",value:function(t){if(!t)return this;t.hasOwnProperty("x")&&this.setX(t.x),t.hasOwnProperty("y")&&this.setY(t.y),t.hasOwnProperty("rotation")?this.setRotation(t.rotation):t.hasOwnProperty("angle")&&this.setAngle(t.angle),t.hasOwnProperty("alpha")&&this.setAlpha(t.alpha);var e=Kn(t,"width",void 0),i=Kn(t,"height",void 0),n=Kn(t,"scaleX",void 0),s=Kn(t,"scaleY",void 0);return void 0!==e?void 0===i&&void 0===s?this.setWidth(e,!0):this.setWidth(e):void 0!==n&&this.setScaleX(n),void 0!==i?void 0===e&&void 0===n?this.setHeight(i,!0):this.setHeight(i):void 0!==s&&this.setScaleY(s),t.hasOwnProperty("leftSpace")&&this.setLeftSpace(t.leftSpace),t.hasOwnProperty("rightSpace")&&this.setRightSpace(t.rightSpace),t.hasOwnProperty("align")&&this.setAlign(t.align),this}},{key:"setDrawBelowCallback",value:function(t){return this.drawBelowCallback=t,this}},{key:"setDrawAboveCallback",value:function(t){return this.drawAboveCallback=t,this}},{key:"reset",value:function(){return this.setVisible().setAlpha(1).setPosition(0,0).setRotation(0).setScale(1,1).setLeftSpace(0).setRightSpace(0).setOrigin(0).setAlign().setDrawBelowCallback().setDrawAboveCallback(),this}},{key:"willRender",get:function(){return this.visible&&this.alpha>0}},{key:"drawX",get:function(){var t=this.x+this.leftSpace+this.offsetX-this.originX*this.width;return this.parent._textOX*this.scrollFactorX+t}},{key:"drawY",get:function(){var t=this.y+this.offsetY;return this.parent._textOY*this.scrollFactorY+t}},{key:"drawTLX",get:function(){return 0}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return 0}},{key:"drawBLY",get:function(){return 0}},{key:"drawTRX",get:function(){return 0}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return 0}},{key:"drawBRY",get:function(){return 0}},{key:"drawCenterX",get:function(){return (this.drawTRX+this.drawTLX)/2}},{key:"drawCenterY",get:function(){return (this.drawBLY+this.drawTLY)/2}}]),i}(En);Object.assign(Jn.prototype,Un);var Zn=function(t,e,i){return e.hasOwnProperty(t)?e[t]:i[t]},qn=Phaser.Utils.Objects.GetValue,$n=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,"background")).setScrollFactor(0),r.setColor(qn(s,"color",null),qn(s,"color2",null),qn(s,"horizontalGradient",!0)),r.setStroke(qn(s,"stroke",null),qn(s,"strokeThickness",2)),r.setCornerRadius(qn(s,"cornerRadius",0),qn(s,"cornerIteration",null)),r}return r(i,[{key:"color",get:function(){return this._color},set:function(t){t=ye(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=ye(t,this.canvas,this.context),this.setDirty(this._color2!=t),this._color2=t;}},{key:"horizontalGradient",get:function(){return this._horizontalGradient},set:function(t){this.setDirty(this._horizontalGradient!=t),this._horizontalGradient=t;}},{key:"setColor",value:function(t,e,i){return void 0===i&&(i=!0),this.color=t,this.color2=e,this.horizontalGradient=i,this}},{key:"stroke",get:function(){return this._stroke},set:function(t){t=ye(t,this.canvas,this.context),this.setDirty(this._stroke!=t),this._stroke=t;}},{key:"strokeThickness",get:function(){return this._strokeThickness},set:function(t){this.setDirty(this._strokeThickness!=t),this._strokeThickness=t;}},{key:"setStroke",value:function(t,e){return null!=t&&void 0===e&&(e=2),this.stroke=t,this.strokeThickness=e,this}},{key:"cornerRadius",get:function(){return this._cornerRadius},set:function(t){this.setDirty(this._cornerRadius!=t),this._cornerRadius=t;}},{key:"cornerIteration",get:function(){return this._cornerIteration},set:function(t){this.setDirty(this._cornerIteration!=t),this._cornerIteration=t;}},{key:"modifyStyle",value:function(t){return t.hasOwnProperty("color")&&this.setColor(t.color,Zn("color2",t,this),Zn("horizontalGradient",t,this)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,Zn("strokeThickness",t,this)),t.hasOwnProperty("cornerRadius")&&this.setCornerRadius(t.cornerRadius,Zn("cornerIteration",t,this)),this}},{key:"modifyPorperties",value:function(t){return p(h(i.prototype),"modifyPorperties",this).call(this,t),this.modifyStyle(t),this}},{key:"setCornerRadius",value:function(t,e){return this.cornerRadius=t,this.cornerIteration=e,this}},{key:"renderContent",value:function(){we(this.parent,this.color,this.stroke,this.strokeThickness,this.cornerRadius,this.color2,this.horizontalGradient,this.cornerIteration);}}]),i}(Jn),Qn=Phaser.Utils.Objects.GetValue,ts=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,"innerbounds")).setScrollFactor(0),r.setColor(Qn(s,"color",null),Qn(s,"color2",null),Qn(s,"horizontalGradient",!0)),r.setStroke(Qn(s,"stroke",null),Qn(s,"strokeThickness",2)),r}return r(i,[{key:"color",get:function(){return this._color},set:function(t){t=ye(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=ye(t,this.canvas,this.context),this.setDirty(this._color2!=t),this._color2=t;}},{key:"horizontalGradient",get:function(){return this._horizontalGradient},set:function(t){this.setDirty(this._horizontalGradient!=t),this._horizontalGradient=t;}},{key:"setColor",value:function(t,e,i){return void 0===i&&(i=!0),this.color=t,this.color2=e,this.horizontalGradient=i,this}},{key:"stroke",get:function(){return this._stroke},set:function(t){t=ye(t,this.canvas,this.context),this.setDirty(this._stroke!=t),this._stroke=t;}},{key:"strokeThickness",get:function(){return this._strokeThickness},set:function(t){this.setDirty(this._strokeThickness!=t),this._strokeThickness=t;}},{key:"setStroke",value:function(t,e){return null!=t&&void 0===e&&(e=2),this.stroke=t,this.strokeThickness=e,this}},{key:"modifyPorperties",value:function(t){p(h(i.prototype),"modifyPorperties",this).call(this,t),t.hasOwnProperty("color")&&this.setColor(t.color,Qn(t,"color2",null),Qn(t,"horizontalGradient",!0)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,Qn(t,"strokeThickness",2));}},{key:"renderContent",value:function(){var t=this.parent.padding,e=t.left,i=t.top,n=this.parent.width-t.left-t.right,s=this.parent.height-t.top-t.bottom,r=this.context;if(null!=this.color){var o,a;if(null!=this.color2)(a=this.horizontalGradient?r.createLinearGradient(0,0,n,0):r.createLinearGradient(0,0,0,s)).addColorStop(0,this.color),a.addColorStop(1,this.color2),o=a;else o=this.color;r.fillStyle=o,r.fillRect(e,i,n,s);}null!=this.stroke&&this.strokeThickness>0&&(r.strokeStyle=this.stroke,r.lineWidth=this.strokeThickness,r.strokeRect(e,i,n,s));}}]),i}(Jn),es=Phaser.Utils.Objects.GetValue,is=function(){function t(e,i){n(this,t),this.parent=e,this.set(i);}return r(t,[{key:"toJSON",value:function(){return {bold:this.bold,italic:this.italic,fontSize:this.fontSize,fontFamily:this.fontFamily,color:this.color,stroke:this.stroke,strokeThickness:this.strokeThickness,shaodwColor:this.shadowColor,shadowBlur:this.shadowBlur,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,offsetX:this.offsetX,offsetY:this.offsetY,leftSpace:this.leftSpace,rightSpace:this.rightSpace,backgroundHeight:this.backgroundHeight,backgroundBottomY:this.backgroundBottomY,align:this.align}}},{key:"set",value:function(t){return this.setBold(es(t,"bold",!1)),this.setItalic(es(t,"italic",!1)),this.setFontSize(es(t,"fontSize","16px")),this.setFontFamily(es(t,"fontFamily","Courier")),this.setColor(es(t,"color","#fff")),this.setStrokeStyle(es(t,"stroke",null),es(t,"strokeThickness",0)),this.setShadow(es(t,"shadowColor",null),es(t,"shadowOffsetX",0),es(t,"shadowOffsetY",0),es(t,"shadowBlur",0)),this.setOffset(es(t,"offsetX",0),es(t,"offsetY",0)),this.setSpace(es(t,"leftSpace",0),es(t,"rightSpace",0)),this.setAlign(es(t,"align",void 0)),this.setBackgroundColor(es(t,"backgroundColor",null)),this.setBackgroundHeight(es(t,"backgroundHeight",void 0)),this.setBackgroundBottomY(es(t,"backgroundBottomY",void 0)),this}},{key:"modify",value:function(t){return t.hasOwnProperty("bold")&&this.setBold(t.bold),t.hasOwnProperty("italic")&&this.setItalic(t.italic),t.hasOwnProperty("fontSize")&&this.setFontSize(t.fontSize),t.hasOwnProperty("fontFamily")&&this.setFontFamily(t.fontFamily),t.hasOwnProperty("color")&&this.setColor(t.color),(t.hasOwnProperty("stroke")||t.hasOwnProperty("strokeThickness"))&&this.setStrokeStyle(Zn("stroke",t,this),Zn("strokeThickness",t,this)),t.hasOwnProperty("shadowColor")&&this.setShadowColor(t.shadowColor),(t.hasOwnProperty("shadowOffsetX")||t.hasOwnProperty("shadowOffsetY"))&&this.setShadowOffset(Zn("shadowOffsetX",t,this),Zn("shadowOffsetY",t,this)),t.hasOwnProperty("shadowBlur")&&this.setShadowBlur(t.shaodwBlur),t.hasOwnProperty("offsetX")&&this.setOffsetX(t.offsetX),t.hasOwnProperty("offsetY")&&this.setOffsetY(t.offsetY),t.hasOwnProperty("leftSpace")&&this.setLeftSpace(t.leftSpace),t.hasOwnProperty("rightSpace")&&this.setRightSpace(t.rightSpace),t.hasOwnProperty("align")&&this.setAlign(t.align),t.hasOwnProperty("backgroundColor")&&this.setBackgroundColor(t.backgroundColor),t.hasOwnProperty("backgroundHeight")&&this.setBackgroundHeight(t.backgroundHeight),t.hasOwnProperty("backgroundBottomY")&&this.setBackgroundBottomY(t.backgroundBottomY),this}},{key:"setUpdateTextFlag",value:function(){return this.parent&&(this.parent.updateTextFlag=!0),this}},{key:"clone",value:function(){return new t(null,this.toJSON())}},{key:"copyFrom",value:function(t){return this.set(t.toJSON()),this}},{key:"copyTo",value:function(t){return t.set(this.toJSON()),this}},{key:"setBold",value:function(t){return void 0===t&&(t=!0),this.bold=t,this.setUpdateTextFlag(),this}},{key:"setItalic",value:function(t){return void 0===t&&(t=!0),this.italic=t,this.setUpdateTextFlag(),this}},{key:"fontStyle",get:function(){return this.bold&&this.italic?"bold italic":this.bold?"bold":this.italic?"italic":""}},{key:"setFontSize",value:function(t){return "number"==typeof t&&(t="".concat(t,"px")),this.fontSize=t,this.setUpdateTextFlag(),this}},{key:"setFontFamily",value:function(t){return this.fontFamily=t,this.setUpdateTextFlag(),this}},{key:"font",get:function(){return "".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily)}},{key:"setColor",value:function(t){return this.color=ye(t),this}},{key:"hasFill",get:function(){return null!=this.color}},{key:"setStrokeStyle",value:function(t,e){return this.stroke=ye(t),void 0!==e&&(this.strokeThickness=e),this}},{key:"setStrokeThickness",value:function(t){return this.strokeThickness=t,this}},{key:"hasStroke",get:function(){return null!=this.stroke&&this.strokeThickness>0}},{key:"setShadowColor",value:function(t){return this.shadowColor=ye(t),this}},{key:"setShadowOffset",value:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.shadowOffsetX=t,this.shadowOffsetY=e,this}},{key:"setShadowBlur",value:function(t){return void 0===t&&(t=0),this.shaodwBlur=t,this}},{key:"setShadow",value:function(t,e,i,n){return this.setShadowColor(t).setShadowOffset(e,i).setShadowBlur(n),this}},{key:"setBackgroundColor",value:function(t){return this.backgroundColor=ye(t),this}},{key:"hasBackgroundColor",get:function(){return null!=this.backgroundColor}},{key:"setBackgroundHeight",value:function(t){return this.backgroundHeight=t,this}},{key:"setBackgroundBottomY",value:function(t){return this.backgroundBottomY=t,this}},{key:"setOffsetX",value:function(t){return void 0===t&&(t=0),this.offsetX=t,this}},{key:"setOffsetY",value:function(t){return void 0===t&&(t=0),this.offsetY=t,this}},{key:"setOffset",value:function(t,e){return this.setOffsetX(t).setOffsetY(e),this}},{key:"setLeftSpace",value:function(t){return void 0===t&&(t=0),this.leftSpace=t,this}},{key:"setRightSpace",value:function(t){return void 0===t&&(t=0),this.rightSpace=t,this}},{key:"setSpace",value:function(t,e){return this.setLeftSpace(t).setRightSpace(e),this}},{key:"setAlign",value:function(t){return this.align=t,this}},{key:"syncFont",value:function(t){return t.font=this.font,this}},{key:"syncStyle",value:function(t){t.textBaseline="alphabetic";var e=this.hasFill,i=this.hasStroke;return t.fillStyle=e?this.color:"#000",t.strokeStyle=i?this.stroke:"#000",t.lineWidth=i?this.strokeThickness:0,t.lineCap="round",t.lineJoin="round",this}},{key:"syncShadow",value:function(t){null!=t.shadowColor?(t.shadowColor=this.shadowColor,t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowBlur=this.shadowBlur):(t.shadowColor=0,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0);}},{key:"getTextMetrics",value:function(t,e){return this.syncFont(t).syncStyle(t),t.measureText(e)}}]),t}(),ns=Phaser.Utils.Array.Remove,ss=Phaser.Utils.Array.Remove,rs="text",os="image",as="drawer",hs="space",ls="command",us=function(t){return t.type===rs&&"\n"===t.text},cs=function(t){return t.type===rs&&"\f"===t.text},ds=function(t){return t.type===rs},fs=function(t){return t.type===ls},ps=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;return n(this,i),(o=e.call(this,t,rs)).updateTextFlag=!1,o.style=new is(u(o),r),o.setText(s),o}return r(i,[{key:"autoRound",get:function(){return this.parent.autoRound}},{key:"offsetX",get:function(){return this.style.offsetX},set:function(t){this.style&&(this.style.offsetX=t);}},{key:"offsetY",get:function(){return this.style.offsetY},set:function(t){this.style&&(this.style.offsetY=t);}},{key:"leftSpace",get:function(){return this.style.leftSpace*this.scaleX},set:function(t){this.style&&(this.style.leftSpace=t),g(h(i.prototype),"leftSpace",t,this,!0);}},{key:"rightSpace",get:function(){return this.style.rightSpace*this.scaleX},set:function(t){this.style&&(this.style.rightSpace=t),g(h(i.prototype),"rightSpace",t,this,!0);}},{key:"align",get:function(){return this.style.align},set:function(t){this.style&&(this.style.align=t);}},{key:"modifyStyle",value:function(t){return this.setDirty(!0),this.style.modify(t),this.updateTextFlag&&this.updateTextSize(),this}},{key:"modifyPorperties",value:function(t){return t?(this.modifyStyle(t),p(h(i.prototype),"modifyPorperties",this).call(this,t),this):this}},{key:"setText",value:function(t){return this.setDirty(this.text!=t),this.text=t,this.updateTextSize(),this}},{key:"updateTextSize",value:function(){var t=this.text;if("\n"===t||"\f"===t||""===t)this.clearTextSize();else {var e,i,n=this.style.getTextMetrics(this.context,this.text);this.textWidth=n.width,"actualBoundingBoxAscent"in n?(e=n.actualBoundingBoxAscent,i=n.actualBoundingBoxDescent):(e=0,i=0),this.textHeight=e+i,this.ascent=e,this.descent=i;}return this.updateTextFlag=!1,this}},{key:"clearTextSize",value:function(){return this.textWidth=0,this.textHeight=0,this.ascent=0,this.descent=0,this}},{key:"copyTextSize",value:function(t){return this.textWidth=t.textWidth,this.textHeight=t.textHeight,this.ascent=t.ascent,this.descent=t.descent,this}},{key:"width",get:function(){return this.textWidth*this.scaleX},set:function(t){this.textWidth>0?this.scaleX=t/this.textWidth:this.scaleX=1;}},{key:"height",get:function(){return this.textHeight*this.scaleY},set:function(t){this.textHeight>0?this.scaleY=t/this.textHeight:this.scaleY=1;}},{key:"willRender",get:function(){return 0!==this.textWidth&&p(h(i.prototype),"willRender",this)}},{key:"renderContent",value:function(){var t=this.context,e=this.style;if(e.hasBackgroundColor){t.fillStyle=e.backgroundColor;var i=this.drawTLX,n=this.drawTRX-i,s=e.backgroundBottomY;null==s&&(s=this.drawBLY);var r=e.backgroundHeight;null==r&&(r=s-this.drawTLY);var o=s-r;t.fillRect(i,o,n,r);}var a=e.hasFill,h=e.hasStroke;(a||h)&&(e.syncFont(t).syncStyle(t),h&&(e.syncShadow(t),t.strokeText(this.text,0,0)),a&&(e.syncShadow(t),t.fillText(this.text,0,0)));}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return -this.ascent}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.descent}},{key:"drawTRX",get:function(){return this.textWidth+this.rightSpace}},{key:"drawTRY",get:function(){return -this.ascent}},{key:"drawBRX",get:function(){return this.textWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.descent}}]),i}(Jn),vs=function(t,e){var i=this.createCharChildren(t,e);return this.addChild(i),this},gs=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;return n(this,i),(o=e.call(this,t,os)).setTexture(s,r),o}return r(i,[{key:"frameWidth",get:function(){return this.frameObj?this.frameObj.cutWidth:0}},{key:"frameHeight",get:function(){return this.frameObj?this.frameObj.cutHeight:0}},{key:"offsetY",get:function(){return -this.height},set:function(t){}},{key:"key",get:function(){return this._key},set:function(t){this.setDirty(this._key!=t),this._key=t;}},{key:"frame",get:function(){return this._frame},set:function(t){this.setDirty(this._frame!=t),this._frame=t;}},{key:"setTexture",value:function(t,e){return this.key=t,this.frame=e,this.frameObj=this.scene.sys.textures.getFrame(t,e),this}},{key:"width",get:function(){return this.frameWidth*this.scaleX},set:function(t){this.setDirty(this.width!==t),this.scaleX=t/this.frameWidth;}},{key:"height",get:function(){return this.frameHeight*this.scaleY},set:function(t){this.setDirty(this.height!==t),this.scaleY=t/this.frameHeight;}},{key:"setHeight",value:function(t,e){return void 0===e&&(e=!1),this.height=t,e&&(this.scaleX=this.scaleY),this}},{key:"renderContent",value:function(){var t=this.context,e=this.frameObj,i=this.frameWidth,n=this.frameHeight;t.drawImage(e.source.image,e.cutX,e.cutY,i,n,0,0,i,n);}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.frameHeight}},{key:"drawTRX",get:function(){return this.frameWidth+this.rightSpace}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return this.frameWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.frameHeight}}]),i}(Jn),ys=function(t,e,i){var n=this.createImageChild(t,e,i);return this.addChild(n),this},ks=function(t){a(i,t);var e=d(i);function i(t,s,r,o){var a;return n(this,i),(a=e.call(this,t,as)).setRenderCallback(s),a.setDrawerSize(r,o),a}return r(i,[{key:"setRenderCallback",value:function(t){return t?this.renderContent=t.bind(this):delete this.renderContent,this}},{key:"setDrawerSize",value:function(t,e){return !0===t?(this.toLocalPosition=!1,t=void 0,e=void 0):this.toLocalPosition=!0,void 0===t&&(t=0),void 0===e&&(e=t),this.drawerWidth=t,this.drawerHeight=e,this}},{key:"onFree",value:function(){p(h(i.prototype),"onFree",this).call(this),this.setRenderCallback();}},{key:"width",get:function(){return this.drawerWidth*this.scaleX},set:function(t){this.setDirty(this.width!==t),this.scaleX=this.drawerWidth>0?t/this.drawerWidth:1;}},{key:"height",get:function(){return this.drawerHeight*this.scaleY},set:function(t){this.setDirty(this.height!==t),this.scaleY=this.drawerHeight>0?t/this.drawerHeight:1;}},{key:"offsetY",get:function(){return -this.height},set:function(t){}},{key:"drawTLX",get:function(){return -this.leftSpace}},{key:"drawTLY",get:function(){return 0}},{key:"drawBLX",get:function(){return -this.leftSpace}},{key:"drawBLY",get:function(){return this.drawerHeight}},{key:"drawTRX",get:function(){return this.drawerWidth+this.rightSpace}},{key:"drawTRY",get:function(){return 0}},{key:"drawBRX",get:function(){return this.drawerWidth+this.rightSpace}},{key:"drawBRY",get:function(){return this.drawerHeight}}]),i}(Jn),ms=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,hs)).setSpaceWidth(s),r}return r(i,[{key:"width",get:function(){return this.spaceWidth*this.scaleX},set:function(t){this.spaceWidth>0?this.scaleX=t/this.spaceWidth:this.scaleX=1;}},{key:"setSpaceWidth",value:function(t){return this.spaceWidth=t,this}}]),i}(Jn),bs=function(t){var e=this.createSpaceChild(t);return this.addChild(e),this},xs=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a){var h;return n(this,i),(h=e.call(this,t,ls)).setName(s).setParameter(o).setCallback(r,a),h}return r(i,[{key:"setName",value:function(t){return this.name=t,this}},{key:"setParameter",value:function(t){return this.param=t,this}},{key:"setCallback",value:function(t,e){return this.callback=t,this.scope=e,this}},{key:"exec",value:function(){return this.scope?this.callback.call(this.scope,this.param,this.name):this.callback(this.param,this.name)}},{key:"onFree",value:function(){p(h(i.prototype),"onFree",this).call(this),this.setName().setCallback().setParameter();}}]),i}(En),Cs=function(t,e,i,n){var s=this.createCommandChild(t,e,i,n);return this.addChild(s),this},ws=function(t){var e={callback:void 0,start:0,isLastPage:!1,maxLines:void 0,padding:void 0,letterSpacing:void 0,hAlign:void 0,vAlign:void 0,children:[],lines:[],maxLineWidth:0,linesHeight:0,lineHeight:void 0,maxLineHeight:0,linesWidth:0,lineWidth:void 0};return Object.assign(e,t)},Ss=function(t,e,i,n){void 0===n&&(n={word:[],width:0}),n.word.length=0;for(var s=t.length,r=e,o=n.word,a=0;r0&&!a){var h=this.fixedHeight-n;if(i>0)r=h/i;else r=(l=Os.call(this)).height,o=l.ascent,i=Math.floor((h-o)/r);}else {var l;r=(l=Os.call(this)).height,o=l.ascent;}}else if(this.fixedHeight>0){if(void 0===(i=Es(t,"maxLines"))){h=this.fixedHeight-n;i=Math.floor(h/r);}}else i=Es(t,"maxLines",0);void 0===o&&(o=r);var u=0===i,c=Es(t,"wrapWidth",void 0);void 0===c&&(c=this.fixedWidth>0?this.fixedWidth-s:1/0);for(var d=Es(t,"letterSpacing",0),f=Es(t,"hAlign",0),p=Es(t,"vAlign",0),v=Es(t,"charWrap",!1),g=ws({callback:"runWordWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:f,vAlign:p,ascent:o,lineHeight:r,wrapWidth:c,charWrap:v}),y=this.children,k=0,m=y.length;k0&&(M.push({children:E,width:_}),R=Math.max(R,_)),g.start+=O.length,g.isLastPage=!L&&g.start===T,g.maxLineWidth=R,g.linesHeight=M.length*r;var F=this.fixedWidth>0?this.fixedWidth:g.maxLineWidth+s,W=this.fixedHeight>0?this.fixedHeight:g.linesHeight+n;!function(t,e,i){var n,s,r=t.hAlign,o=t.vAlign,a=t.linesHeight;switch(o){case 1:case"center":s=(i-a)/2;break;case 2:case"bottom":s=i-a;break;default:s=0;}for(var h=t.lines,l=0,u=h.length;l0?(o=this.fixedWidth-s)/i:0;else if(this.fixedWidth>0){if(void 0===(i=Ls(t,"maxLines",void 0))){var o=this.fixedWidth-s;i=Math.floor(o/r)+1;}}else i=Ls(t,"maxLines",0);var a=0===i,h=Ls(t,"fixedCharacterHeight",void 0);if(void 0===h){var l=Ls(t,"charPerLine",void 0);if(void 0!==l){var u=this.fixedHeight-n;h=Math.floor(u/l);}}var c=Ls(t,"wrapHeight",void 0);void 0===c&&(c=this.fixedHeight>0?this.fixedHeight-n:1/0);for(var d=Ls(t,"letterSpacing",0),f=Ls(t,"rtl",!0),p=Ls(t,"hAlign",f?2:0),v=Ls(t,"vAlign",0),g=ws({callback:"runVerticalWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:p,vAlign:v,lineWidth:r,fixedCharacterHeight:h,wrapHeight:c,rtl:f}),y=this.children,k=0,m=y.length;k0&&(M.push({children:E,height:_}),R=Math.max(R,_)),g.start+=O.length,g.isLastPage=g.start===T,g.maxLineHeight=R,g.linesWidth=M.length*r;var z=this.fixedWidth>0?this.fixedWidth:g.linesWidth+s,A=this.fixedHeight>0?this.fixedHeight:g.maxLineHeight+n;!function(t,e,i){var n,s,r=t.hAlign,o=t.vAlign,a=t.rtl,h=t.lines,l=t.lineWidth,u=t.linesWidth;switch(r){case 1:case"center":n=(e-u)/2;break;case 2:case"right":n=e-u;break;default:n=0;}a&&(n+=l);for(var c=0,d=h.length;c0?t:this.width,e>0?e:this.height)),this},setPadding:function(t,e){var i=this.padding,n=i.left,s=i.right,r=i.top,o=i.bottom;return Mn(i,t,e),this.dirty=this.dirty||n!=i.left||s!=i.right||r!=i.top||o!=i.bottom,this},getPadding:function(t){return On(this.padding,t)},modifyTextStyle:function(t){return this.textStyle.modify(t),this},modifyDefaultTextStyle:function(t){return this.defaultTextStyle.modify(t),this},resetTextStyle:function(){return this.textStyle.copyFrom(this.defaultTextStyle),this},setTestString:function(t){return this.testString=t,this},removeChild:function(t){return this.poolManager.free(t),ns(this.children,t),this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},removeChildren:function(){return this.poolManager.freeMultiple(this.children),this.children.length=0,this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},popChild:function(t){return ss(this.children,t),this.lastAppendedChildren.length=0,this.lastOverChild=null,this.dirty=!0,this},clearContent:function(){return this.setText(),this},addChild:function(t,e){var i,n,s,r=Array.isArray(t);void 0===e||e===this.children.length?r?(i=this.children).push.apply(i,m(t)):this.children.push(t):r?(n=this.children).splice.apply(n,[e,0].concat(m(t))):this.children.splice(e,0,t);(this.lastAppendedChildren.length=0,r)?(s=this.lastAppendedChildren).push.apply(s,m(t)):this.lastAppendedChildren.push(t);return this},createCharChild:function(t,e){e&&this.textStyle.modify(e);var i=this.poolManager.allocate(rs);return null===i?i=new ps(this,t,this.textStyle):i.setParent(this).setActive().modifyStyle(this.textStyle).setText(t),i},createCharChildren:function(t,e){e&&this.textStyle.modify(e);for(var i=[],n=0,s=t.length;ne&&(n=e,s=t);})),s},getCharWorldPosition:function(t,e,i,n){return "number"==typeof t&&(t=this.getCharChild(t,!0)),Gn(this,t,e,i,n)},setToMinSize:function(){for(var t=this.children,e=0,i=0,n=0,s=t.length;n=i.length&&(t=i.length);for(var n=0,s=0;s1?i-1:0),s=1;s0&&void 0!==t.setTint},useAlphaFadeEffect:function(t){return (void 0===this.fadeMode||1===this.fadeMode)&&this.fadeTime>0&&void 0!==t.setAlpha},useRevealEffect:function(t){return this.fadeMode>=2&&this.fadeMode<=5&&this.fadeTime>0&&(t.preFX||t.postFX)},fadeBob:function(t,e,i,n){var s=t.gameObject;if(this.useTintFadeEffect(s))void 0!==e&&t.setProperty("tintGray",255*e),t.easeProperty("tintGray",Math.floor(255*i),this.fadeTime,"Linear",0,!1,n);else if(this.useAlphaFadeEffect(s))void 0!==e&&t.setProperty("alpha",e),t.easeProperty("alpha",i,this.fadeTime,"Linear",0,!1,n);else if(this.useRevealEffect(s)){var r;switch(pr(s,"reveal"),this.fadeMode){case 2:r="revealUp";break;case 3:r="revealDown";break;case 4:r="revealLeft";break;case 5:r="revealRight";}void 0===e&&(e=0),s[r]=e,t.easeProperty(r,i,this.fadeTime,"Linear",0,!1,n),t.getTweenTask(r).once("complete",(function(){s[r]=null;}));}else n&&n(s);return this}},yr=function(t){return t>>16&255},kr=function(t){return t>>8&255},mr=function(t){return 255&t},br=Phaser.Events.EventEmitter,xr=function(t,e,i,n,s,r){return void 0===r?r={}:!0===r&&(r=Cr),"number"!=typeof i&&(i=0,n=0),r.x=s.x+s.width*t+i,r.y=s.y+s.height*e+n,r},Cr={},wr=function(t,e,i,n,s,r,o){if(t.hasOwnProperty("vp"))return t;"function"==typeof i&&(o=i,i=void 0),"function"==typeof s&&(o=s,s=void 0),void 0===i&&(i=.5),void 0===n&&(n=.5),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=xr),function(t){if(t.events)return t;var e=new br,i=t.x;Object.defineProperty(t,"x",{get:function(){return i},set:function(n){i!==n&&(i=n,e.emit("update",t));}});var n=t.y;Object.defineProperty(t,"y",{get:function(){return n},set:function(i){n!==i&&(n=i,e.emit("update",t));}});var s=t.width;Object.defineProperty(t,"width",{get:function(){return s},set:function(i){s!==i&&(s=i,e.emit("update",t));}});var r=t.height;Object.defineProperty(t,"height",{get:function(){return r},set:function(i){r!==i&&(r=i,e.emit("update",t));}}),t.events=e;}(e);var a=e.events;t.vp=e;var h=function(){o(i,n,s,r,e,t);};a.on("update",h),t.once("destroy",(function(){a.off("update",h),t.vp=void 0;})),Object.defineProperty(t,"vpx",{get:function(){return i},set:function(t){i!==t&&(i=t,h());}}),Object.defineProperty(t,"vpy",{get:function(){return n},set:function(t){n!==t&&(n=t,h());}}),Object.defineProperty(t,"vpxOffset",{get:function(){return s},set:function(t){s!==t&&(s=t,h());}}),Object.defineProperty(t,"vpyOffset",{get:function(){return r},set:function(t){r!==t&&(r=t,h());}}),h();},Sr=Phaser.Utils.Array.Remove,Pr={has:function(t){return this.bobs.hasOwnProperty(t)},exists:function(t){return this.bobs.hasOwnProperty(t)},get:function(t){return this.bobs[t]},getGO:function(t){var e=this.get(t);return e?e.gameObject:null},addGO:function(t,e){this.remove(t,!0),this.useTintFadeEffect(e)&&function(t,e){if(t.hasOwnProperty("tintR"))return t;void 0===e&&(e=16777215);var i=yr(e),n=kr(e),s=mr(e);Object.defineProperty(t,"tint",{get:function(){return e},set:function(r){r=16777215&Math.floor(r),t.setTint&&t.setTint(r),e!==r&&(i=yr(e=r),n=kr(e),s=mr(e));}}),Object.defineProperty(t,"tintR",{get:function(){return i},set:function(n){n=255&Math.floor(n),i!==n&&(i=n,t.tint=(255&n)<<16|65535&e);}}),Object.defineProperty(t,"tintG",{get:function(){return n},set:function(i){i=255&Math.floor(i),n!==i&&(n=i,t.tint=(255&i)<<8|16711935&e);}}),Object.defineProperty(t,"tintB",{get:function(){return s},set:function(i){i=255&Math.floor(i),s!==i&&(s=i,t.tint=255&i|16776960&e);}}),Object.defineProperty(t,"tintGray",{get:function(){return Math.floor((i+n+s)/3)},set:function(e){e=255&Math.floor(e),i===e&&n===e&&s===e||(i=e,n=e,s=e,t.tint=(255&e)<<16|(255&e)<<8|255&e);}}),t.tint=e;}(e),this.viewportCoordinateEnable&&wr(e,this.viewport),this.effectPropertiesConfig&&pr(e,this.effectPropertiesConfig),e.once("destroy",(function(){Sr(this.removedGOs,e),this.isEmpty&&this.emit("empty");}),this);var i=new this.BobClass(this,e,t);return this.bobs[t]=i,this},add:function(t){for(var e=this.createGameObjectCallback,i=this.createGameObjectScope,n=arguments.length,s=new Array(n>1?n-1:0),r=1;r2?n-2:0),r=2;r0?-this.delay:0,this.state=this.nowTime>=0?mo:ko,this.repeatCounter=0,this}},{key:"stop",value:function(){return this.state=yo,this}},{key:"update",value:function(t,e){this.state!==yo&&this.state!==xo&&0!==e&&0!==this.timeScale&&(this.nowTime+=e*this.timeScale,this.justRestart=!1,this.nowTime>=this.duration?-1===this.repeat||this.repeatCounter0&&(this.nowTime-=this.repeatDelay,this.state=bo)):(this.nowTime=this.duration,this.state=xo):this.nowTime>=0&&(this.state=mo));}},{key:"t",get:function(){var t;switch(this.state){case yo:case ko:case bo:t=0;break;case mo:t=this.nowTime/this.duration;break;case xo:t=1;}return vo(t,0,1)},set:function(t){(t=vo(t,-1,1))<0?(this.state=ko,this.nowTime=-this.delay*t):(this.state=mo,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===yo}},{key:"isDelay",get:function(){return this.state===ko}},{key:"isCountDown",get:function(){return this.state===mo}},{key:"isRunning",get:function(){return this.state===ko||this.state===mo}},{key:"isDone",get:function(){return this.state===xo}},{key:"isOddIteration",get:function(){return 1==(1&this.repeatCounter)}},{key:"isEvenIteration",get:function(){return 0==(1&this.repeatCounter)}}]),t}(),yo=0,ko=1,mo=2,bo=3,xo=-1,Co=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).timer=new go,r}return r(i,[{key:"shutdown",value:function(t){this.isShutdown||(p(h(i.prototype),"shutdown",this).call(this,t),this.timer.destroy(),this.timer=void 0);}},{key:"start",value:function(){return this.timer.start(),p(h(i.prototype),"start",this).call(this),this}},{key:"stop",value:function(){return this.timer.stop(),p(h(i.prototype),"stop",this).call(this),this}},{key:"complete",value:function(){return this.timer.stop(),p(h(i.prototype),"complete",this).call(this),this}}]),i}(co),wo=Phaser.Utils.Objects.GetValue,So=Phaser.Utils.Objects.GetAdvancedValue,Po=Phaser.Tweens.Builders.GetEaseFunction,To=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"resetFromJSON",value:function(t){return this.timer.resetFromJSON(wo(t,"timer")),this.setEnable(wo(t,"enable",!0)),this.setTarget(wo(t,"target",this.parent)),this.setDelay(So(t,"delay",0)),this.setDuration(So(t,"duration",1e3)),this.setEase(wo(t,"ease","Linear")),this.setRepeat(wo(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=Po(t),this}},{key:"start",value:function(){return this.timer.isRunning||p(h(i.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),p(h(i.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){}}]),i}(Co),Oo=Phaser.Sound.BaseSound,Mo=function(t){return t instanceof Oo},Eo=Phaser.Utils.Objects.GetValue,_o=Phaser.Utils.Objects.GetAdvancedValue,Ro=Phaser.Math.Linear,Lo=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;return n(this,i),Mo(t)&&(r=s,s=t,t=void 0),s.active=!0,s.scene=t,s.game=s.manager.game,(o=e.call(this,s,r)).volume={},o.resetFromJSON(r),o}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setMode(Eo(t,"mode",0)),this.setEnable(Eo(t,"enable",!0)),this.setVolumeRange(_o(t,"volume.start",this.parent.volume),_o(t,"volume.end",0)),this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=Bo[t]),this.mode=t,this}},{key:"setVolumeRange",value:function(t,e){return this.volume.start=t,this.volume.end=e,this}},{key:"start",value:function(){return this.timer.isRunning||(this.parent.setVolume(this.volume.start),this.timer.setDelay(this.delay).setDuration(this.duration),p(h(i.prototype),"start",this).call(this)),this}},{key:"updateGameObject",value:function(t,e){t.volume=Ro(this.volume.start,this.volume.end,e.t);}},{key:"complete",value:function(){switch(p(h(i.prototype),"complete",this).call(this),this.mode){case 1:this.parent.stop();break;case 2:this.parent.destroy();}return this}}]),i}(To),Bo={stop:1,destroy:2},Do=function(t,e,i,n,s){Mo(t)&&(s=n,n=i,i=e,e=t,t=void 0),void 0===n&&(n=1),void 0===s&&(s=0);var r,o={mode:0,volume:{start:s,end:n},duration:i};return "string"==typeof e&&(e=t.sys.sound.add(e)),e.hasOwnProperty("_fade")?(r=e._fade).stop().resetFromJSON(o):(r=new Lo(t,e,o),e._fade=r),r.start(),e.isPlaying||e.setVolume(s).play(),e},Io=function(t,e,i,n){Mo(t)&&(n=i,i=e,e=t,t=void 0),void 0===n&&(n=!0);var s,r={mode:n?2:1,volume:{start:e.volume,end:0},duration:i};return e.hasOwnProperty("_fade")?(s=e._fade).stop().resetFromJSON(r):(s=new Lo(t,e,r),e._fade=s),s.start(),e.isPlaying||e.play(),e},jo=Phaser.Utils.Objects.GetValue,zo={setBackgroundMusicLoop:function(t){return void 0===t&&(t=!0),this.backgroundMusicLoop=t,this},setBackgroundMusicFadeTime:function(t){return this.backgroundMusicFadeTime=t,this},getBackgroundMusic:function(){return this.backgroundMusic},setCurrentBackgroundMusic:function(t){return this.backgroundMusic=t,t&&(t.once("complete",(function(){this.backgroundMusic===t&&(this.backgroundMusic.destroy(),this.backgroundMusic=void 0);}),this).once("destroy",(function(){this.backgroundMusic===t&&(this.backgroundMusic=void 0);}),this),t.isPlaying||t.play()),this},playBackgroundMusic:function(t,e){if(this.backgroundMusic&&this.backgroundMusic.key===t)return this;this.stopBackgroundMusic();var i=this.sound.add(t,{loop:jo(e,"loop",this.backgroundMusicLoop),mute:jo(e,"mute",this.backgroundMusicMute),volume:jo(e,"volume",this.backgroundMusicVolume),detune:jo(e,"detune",0),rate:jo(e,"rate",1)});return this.setCurrentBackgroundMusic(i),this.backgroundMusicFadeTime>0&&this.fadeInBackgroundMusic(this.backgroundMusicFadeTime),this},pauseBackgroundMusic:function(){return this.backgroundMusic&&this.backgroundMusic.pause(),this},resumeBackgroundMusic:function(){return this.backgroundMusic&&this.backgroundMusic.resume(),this},stopBackgroundMusic:function(){return this.backgroundMusic&&(this.backgroundMusicFadeTime>0?this.fadeOutBackgroundMusic(this.backgroundMusicFadeTime,!0):(this.backgroundMusic.stop(),this.backgroundMusic.destroy(),this.backgroundMusic=void 0)),this},fadeInBackgroundMusic:function(t){return this.backgroundMusic&&Do(this.backgroundMusic,t,this.backgroundMusicVolume,0),this},fadeOutBackgroundMusic:function(t,e){return this.backgroundMusic&&Io(this.backgroundMusic,t,e),this},crossFadeBackgroundMusic:function(t,e){var i=this.backgroundMusicFadeTime;return this.backgroundMusicFadeTime=0,this.fadeOutBackgroundMusic(e,!0).playBackgroundMusic(t).fadeInBackgroundMusic(e),this.backgroundMusicFadeTime=i,this},setBackgroundMusicMute:function(t){return void 0===t&&(t=!0),this.backgroundMusicMute=t,this},setBackgroundMusicVolume:function(t){return this.backgroundMusicVolume=t,this},setBackgroundMusicRate:function(t){return this.backgroundMusic&&this.backgroundMusic.setRate(t),this},setBackgroundMusicDetune:function(t){return this.backgroundMusic&&this.backgroundMusic.setDetune(t),this}},Ao=Phaser.Utils.Objects.GetValue,Fo={setBackgroundMusic2Loop:function(t){return void 0===t&&(t=!0),this.backgroundMusic2Loop=t,this},setBackgroundMusic2FadeTime:function(t){return this.backgroundMusic2FadeTime=t,this},getBackgroundMusic2:function(){return this.backgroundMusic2},setCurrentBackgroundMusic2:function(t){return this.backgroundMusic2=t,t&&(t.once("complete",(function(){this.backgroundMusic2===t&&(this.backgroundMusic2.destroy(),this.backgroundMusic2=void 0);}),this).once("destroy",(function(){this.backgroundMusic2===t&&(this.backgroundMusic2=void 0);}),this),t.isPlaying||t.play()),this},playBackgroundMusic2:function(t,e){if(this.backgroundMusic2&&this.backgroundMusic2.key===t)return this;this.stopBackgroundMusic2();var i=this.sound.add(t,{loop:Ao(e,"loop",this.backgroundMusicLoop),mute:Ao(e,"mute",this.backgroundMusic2Mute),volume:Ao(e,"volume",this.backgroundMusic2Volume),detune:Ao(e,"detune",0),rate:Ao(e,"rate",1)});return this.setCurrentBackgroundMusic2(i),this.backgroundMusic2FadeTime>0&&this.fadeInBackgroundMusic2(this.backgroundMusic2FadeTime),this},pauseBackgroundMusic2:function(){return this.backgroundMusic2&&this.backgroundMusic2.pause(),this},resumeBackgroundMusic2:function(){return this.backgroundMusic2&&this.backgroundMusic2.resume(),this},stopBackgroundMusic2:function(){return this.backgroundMusic2&&(this.backgroundMusic2FadeTime>0?this.fadeOutBackgroundMusic2(this.backgroundMusic2FadeTime,!0):(this.backgroundMusic2.stop(),this.backgroundMusic2.destroy(),this.backgroundMusic2=void 0)),this},fadeInBackgroundMusic2:function(t){return this.backgroundMusic2&&Do(this.backgroundMusic2,t,this.backgroundMusic2Volume,0),this},fadeOutBackgroundMusic2:function(t,e){return this.backgroundMusic2&&Io(this.backgroundMusic2,t,e),this},crossFadeBackgroundMusic2:function(t,e){var i=this.backgroundMusic2FadeTime;return this.backgroundMusic2FadeTime=0,this.fadeOutBackgroundMusic2(e,!0).playBackgroundMusic2(t).fadeInBackgroundMusic2(e),this.backgroundMusic2FadeTime=i,this},setBackgroundMusic2Mute:function(t){return void 0===t&&(t=!0),this.backgroundMusic2Mute=t,this},setBackgroundMusic2Volume:function(t){return this.backgroundMusic2Volume=t,this},setBackgroundMusic2Rate:function(t){return this.backgroundMusic2&&this.backgroundMusic2.setRate(t),this},setBackgroundMusic2Detune:function(t){return this.backgroundMusic2&&this.backgroundMusic2.setDetune(t),this}},Wo=Phaser.Utils.Array.Remove,Yo=Phaser.Utils.Objects.GetValue,Vo={getSoundEffects:function(){return this.soundEffects},getLastSoundEffect:function(){return this.soundEffects[this.soundEffects.length-1]},playSoundEffect:function(t,e){var i=this.sound.add(t,{mute:Yo(e,"mute",this.soundEffectsMute),volume:Yo(e,"volume",this.soundEffectsVolume),detune:Yo(e,"detune",0),rate:Yo(e,"rate",1)});return this.soundEffects.push(i),i.once("complete",(function(){i.destroy(),this.sound&&Wo(this.soundEffects,i);}),this).once("destroy",(function(){this.sound&&Wo(this.soundEffects,i);}),this).play(),this},stopAllSoundEffects:function(){for(var t=this.soundEffects.length-1;t>=0;t--){var e=this.soundEffects[t];e.stop(),e.destroy();}return this},fadeInSoundEffect:function(t){var e=this.getLastSoundEffect();return e&&Do(e,t,this.soundEffectsVolume,0),this},fadeOutSoundEffect:function(t,e){var i=this.getLastSoundEffect();return i&&Io(i,t,e),this},fadeOutAllSoundEffects:function(t,e){for(var i=this.soundEffects.length-1;i>=0;i--)Io(this.soundEffects[i],t,e);return this},setSoundEffectMute:function(t,e){if(void 0===t&&(t=!0),void 0===e&&(e=!1),e){var i=this.getLastSoundEffect();i&&i.setMute(t);}else this.soundEffectsMute=t;return this},setSoundEffectVolume:function(t,e){if(void 0===e&&(e=!1),e){var i=this.getLastSoundEffect();i&&i.setVolume(t);}else this.soundEffectsVolume=t;return this},setSoundEffectDetune:function(t,e){var i;void 0===e&&(e=!1);for(var n=0,s=(i=e?[this.getLastSoundEffect()]:this.soundEffects).length;n=0;t--){var e=this.soundEffects[t];e.stop(),e.destroy();}return this},fadeInSoundEffect2:function(t){var e=this.getLastSoundEffect2();return e&&Do(e,t,this.soundEffects2Volume,0),this},fadeOutSoundEffect2:function(t,e){var i=this.getLastSoundEffect2();return i&&Io(i,t,e),this},fadeOutAllSoundEffects2:function(t,e){for(var i=this.soundEffects2.length-1;i>=0;i--)Io(this.soundEffects2[i],t,e);return this},setSoundEffect2Mute:function(t,e){if(void 0===t&&(t=!0),void 0===e&&(e=!1),e){var i=this.getLastSoundEffect2();i&&i.setMute(t);}else this.soundEffects2Mute=t;return this},setSoundEffect2Volume:function(t,e){if(void 0===e&&(e=!1),e){var i=this.getLastSoundEffect2();i&&i.setVolume(t);}else this.soundEffects2Volume=t;return this},setSoundEffect2Detune:function(t,e){var i;void 0===e&&(e=!1);for(var n=0,s=(i=e?[this.getLastSoundEffect2()]:this.soundEffects2).length;n=0;t--)this.soundEffects[t].destroy();if(this.soundEffects.length=0,this.soundEffects2.length)for(t=this.soundEffects2.length-1;t>=0;t--)this.soundEffects2[t].destroy();return this.soundEffects2.length=0,this.sound=void 0,this}},{key:"backgroundMusicMute",get:function(){return this._backgroundMusicMute},set:function(t){this._backgroundMusicMute=t,this.backgroundMusic&&this.backgroundMusic.setMute(mute);}},{key:"backgroundMusicVolume",get:function(){return this._backgroundMusicVolume},set:function(t){this._backgroundMusicVolume=t,this.backgroundMusic&&this.backgroundMusic.setVolume(t);}},{key:"backgroundMusic2Mute",get:function(){return this._backgroundMusic2Mute},set:function(t){this._backgroundMusic2Mute=t,this.backgroundMusic2&&this.backgroundMusic2.setMute(mute);}},{key:"backgroundMusic2Volume",get:function(){return this._backgroundMusic2Volume},set:function(t){this._backgroundMusic2Volume=t,this.backgroundMusic2&&this.backgroundMusic2.setVolume(t);}},{key:"soundEffectsMute",get:function(){return this._soundEffectsMute},set:function(t){this._soundEffectsMute=t;for(var e=this.soundEffects,i=0,n=e.length;i2?n-2:0),r=2;r3?s-3:0),o=3;o");this.setDelimiters(i[0],i[1]),this.setTranslateTagNameCallback(bt(e,"translateTagNameCallback")),this.isRunning=!1,this.isPaused=!1,this.skipEventFlag=!1,this.justCompleted=!1,this.lastTagStart=null,this.lastTagEnd=null,this.lastContent=null;}return r(t,[{key:"shutdown",value:function(){this.destroyEventEmitter();}},{key:"destroy",value:function(){this.shutdown();}},{key:"setMultipleLinesTagEnable",value:function(t){return void 0===t&&(t=!0),this.multipleLinesTagEnable=t,this}},{key:"setDelimiters",value:function(t,e){void 0===e&&(e=t[1],t=t[0]),this.delimiterLeft=t,this.delimiterRight=e,t=qi(this.delimiterLeft),e=qi(this.delimiterRight);var i=this.multipleLinesTagEnable?"gs":"gi";return this.reSplit=RegExp("".concat(t,"(.+?)").concat(e),i),this}},{key:"setTranslateTagNameCallback",value:function(t){return this.translateTagNameCallback=t,this}},{key:"setValueConverter",value:function(t){return !0===t?t=ya:t||(t=ma),this.valueConverter=t,this}},{key:"setLoopEnable",value:function(t){return void 0===t&&(t=!0),this.loopEnable=t,this}},{key:"setSource",value:function(t){return this.source=t,this}},{key:"resetIndex",value:function(t){return void 0===t&&(t=0),this.progressIndex=t,this.reSplit.lastIndex=t,this.lastTagStart=null,this.lastTagEnd=null,this.lastContent=null,this.justCompleted=!1,this.isRunning=!1,this}},{key:"start",value:function(t){return this.setSource(t).restart(),this}},{key:"restart",value:function(){this.resetIndex().next();}},{key:"next",value:function(){if(this.isPaused&&this.onResume(),this.isRunning)return this;if(this.isRunning=!0,this.justCompleted)return this.isRunning=!1,this;0===this.reSplit.lastIndex&&this.onStart();var t=this.source,e=t.length;for(this.reSplit.lastIndex=this.progressIndex;;){var i=this.reSplit.exec(t);if(!i){if(this.progressIndex");return s.setDelimiters(r[0],r[1]),s}return r(i,[{key:"setTagExpression",value:function(t){return t||(t=xa),this.tagExpression=t,this}},{key:"setValueExpression",value:function(t){return t||(t=xa),this.valueExpression=t,this}},{key:"setDelimiters",value:function(t,e){p(h(i.prototype),"setDelimiters",this).call(this,t,e);var n="(".concat(this.tagExpression,")(=(").concat(this.valueExpression,"))?");if(this.reTag=RegExp(n,"i"),this.tagExpression!==xa||this.valueExpression!==xa){var s="".concat(this.tagExpression,"(=").concat(this.valueExpression,")?"),r="/".concat(this.tagExpression);t=qi(this.delimiterLeft),e=qi(this.delimiterRight);var o=this.multipleLinesTagEnable?"gs":"gi";this.reSplit=RegExp("".concat(t,"((").concat(s,")|(").concat(r,"))").concat(e),o);}return this}},{key:"onTag",value:function(t){var e=t.match(this.reTag),i=e[1],n="/"===i.charAt(0);if(n&&(i=i.substring(1,i.length)),this.translateTagNameCallback&&(i=this.translateTagNameCallback(i)),this.skipEventFlag=!1,n)this.emit("-".concat(i)),this.skipEventFlag||this.emit("-",i),this.lastTagEnd=i;else {var s=function(t,e){if(null==t)return [];void 0===e&&(e=ya);for(var i=t.split(","),n=0,s=i.length;n1?s-1:0),o=1;o1&&-1!==e.indexOf("|")?e.split("|"):[e]).length;r0){var o=this.timeline.addTimer({name:Th,target:s,duration:r.duration,yoyo:r.yoyo,onStart:r.onStart,onProgress:r.onProgress,onComplete:r.onComplete});this.skipTypingAnimation&&o.seek(1);}else r.onStart&&r.onStart(s,0);this.minSizeEnable&&this.textPlayer.setToMinSize(),this.textPlayer.emit("typing",s);var a=this.nextChild;if(a)if(this.skipSpaceEnable&&((i=a).type===rs&&" "===i.text));else if(n+=this.speed+e,e=0,n>0){this.typingTimer=this.timeline.addTimer({name:"delay",target:this,duration:n,onComplete:function(e,i,n){e.typingTimer=void 0,t.call(e,n.remainder);}});break}}else fs(s)&&s.exec();}this.minSizeEnable&&this.textPlayer.setToMinSize(),this.inTypingProcessLoop=!1;},pause:function(){return this.timeline.pause(),this},resume:function(){return this.timeline.resume(),this},pauseTyping:function(){return this.isTypingPaused||(this.typingTimer?(this.typingTimer.pause(),this.isTypingPaused=!0):this.inTypingProcessLoop&&(this.inTypingProcessLoop=!1,this.isTypingPaused=!0)),this},resumeTyping:function(t){return this.isTypingPaused?(void 0===t&&(t=0),this.typingTimer?(this.isTypingPaused=!1,this.typingTimer.resume(),this.typingTimer.remainder+=t):this.isTypingPaused&&(this.isTypingPaused=!1,this.typing(t)),this):this},wait:function(t){return this.ignoreWait||(this.pauseTyping(),Rh(this.textPlayer,t,this.resumeTyping,this)),this},setIgnoreWait:function(t){return void 0===t&&(t=!0),this.ignoreWait=t,this},setSkipSpaceEnable:function(t){return void 0===t&&(t=!0),this.skipSpaceEnable=t,this},setSkipTypingAnimation:function(t){if(void 0===t&&(t=!0),this.skipTypingAnimation=t,t)for(var e=this.timeline.getTimers(Th),i=0,n=e.length;i0&&o.chainAnimation(i,n);},Gh=function(t){var e,i,n=k(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.stopAnimation.apply(s,m(i));},Uh=function(t){var e,i,n=k(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.pauseAnimation.apply(s,m(i));},Hh=function(t){var e,i,n=k(t);e=n[0],i=n.slice(1);var s=this.getGameObjectManager(e);s.chainAnimation.apply(s,m(i));},Nh=[function(t,e,i){var n=i.name;e.on("+",(function(i){if(!e.skipEventFlag){var s,r=i.split(".");if(Vh(r,n)){s=r[1];for(var o=arguments.length,a=new Array(o>1?o-1:0),h=1;h0)){var a=this.getGameObjectManager(e);a.hasMethod(i,n)?a.call.apply(a,[i,n].concat(m(s))):a.setProperty(i,n,s[0]);}},tl={to:!0,yoyo:!0,from:!0,toLeft:!0,toRight:!0,toUp:!0,toDown:!0,yoyoLeft:!0,yoyoRight:!0,yoyoUp:!0,yoyoDown:!0,fromLeft:!0,fromRight:!0,fromUp:!0,fromDown:!0},el=function(t){var e,i,n,s,r,o,a,h,l=y(t,8);e=l[0],i=l[1],n=l[2],s=l[3],r=l[4],o=l[5],a=l[6],h=l[7];var u=this.getGameObjectManager(e),c=u.getProperty(i,n);if("number"==typeof c){h.endsWith("Left")||h.endsWith("Up")?h.startsWith("to")||h.startsWith("yoyo")?s=c-s:h.startsWith("from")&&(u.setProperty(i,n,c-s),s=c):h.endsWith("Right")||h.endsWith("Down")?h.startsWith("to")||h.startsWith("yoyo")?s=c+s:h.startsWith("from")&&(u.setProperty(i,n,c+s),s=c):"from"===h&&(u.setProperty(i,n,s),s=c);var d=h.startsWith("yoyo");u.easeProperty(i,n,s,r,o,a,d);}},il=[function(t,e,i){var n=i.name;e.on("+",(function(i){if(!e.skipEventFlag){var s,r=i.split(".");if(Jh(r,n)){s=r[1];for(var o=arguments.length,a=new Array(o>1?o-1:0),h=1;h1?a-1:0),l=1;l0)return yl.length=0,!0;return yl.length=0,!1},yl=[],kl=void 0,ml=Phaser.Utils.Objects.GetValue,bl=function(t,e,i){var n,s;for(var r in void 0===i&&(i={}),t)n=t[r],void 0!==(s=ml(e,r,n[1]))&&(i[n[0]]=s);return i},xl=function(t){t.addEventListener("touchstart",Cl,!1),t.addEventListener("touchmove",Cl,!1),t.addEventListener("touchend",Cl,!1),t.addEventListener("mousedown",Cl,!1),t.addEventListener("mouseup",Cl,!1),t.addEventListener("mousemove",Cl,!1);},Cl=function(t){t.stopPropagation();},wl=Phaser.Utils.Objects.GetValue,Sl=function(){return this.close(),this.emit("keydown-ENTER",this.parent,this),this},Pl={open:function(){return this.isOpened||this.readOnly||((t=this)!==kl&&(void 0!==kl&&kl.close(),kl=t),this.isOpened=!0,this.node||(this.node=function(t,e){var i,n=wl(e,"inputType",void 0);void 0===n&&(n=wl(e,"type","text")),"textarea"===n?(i=document.createElement("textarea")).style.resize="none":(i=document.createElement("input")).type=n;var s=wl(e,"style",void 0),r=i.style;bl(fl,s,r),r.position="absolute",r.opacity=0,r.pointerEvents="none",r.zIndex=0,r.transform="scale(0)",bl(dl,e,i),xl(i);var o=t.scene.sys.scale;return (o.isFullscreen?o.fullscreenTarget:document.body).appendChild(i),i}(this,this.nodeConfig)),this.setFocus(),this.initText(),this.enterCloseEnable&&this.scene.input.keyboard.once("keydown-ENTER",Sl,this),this.scene.sys.events.on("postupdate",this.updateText,this),this.scene.input.on("pointerdown",this.onClickOutside,this),this.onOpenCallback&&this.onOpenCallback(this.parent,this),this.emit("open",this)),this;var t;},close:function(){return this.isOpened?(this===kl&&(kl=void 0),this.setBlur(),this.isOpened=!1,this.updateText(),this.scene.sys.events.off("postupdate",this.updateText,this),this.scene.input.off("pointerdown",this.onClickOutside,this),this.onCloseCallback&&this.onCloseCallback(this.parent,this),function(t){if(t){var e=t.parentElement;e&&e.removeChild(t);}}(this.node),this.node=void 0,this.emit("close",this),this):this}},Tl=Phaser.Utils.Objects.GetValue,Ol=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),r=e.call(this,t);var o=Tl(s,"inputType",void 0);void 0===o&&(o=Tl(s,"type","text")),r.setEnterCloseEnable(Tl(s,"enterClose","textarea"!==o));var a=Tl(s,"onOpen",void 0);a||(a=Tl(s,"onFocus",void 0)),r.onOpenCallback=a;var h=Tl(s,"onClose",void 0);return h||(h=Tl(s,"onBlur",void 0)),r.onCloseCallback=h,r.onUpdateCallback=Tl(s,"onUpdate",void 0),r.isOpened=!1,t.on("pointerdown",(function(){this.open();}),u(r)).setInteractive(),r.nodeConfig=function(t){void 0===t&&(t={});var e={};return pl(t,e,"inputType"),pl(t,e,"type"),pl(t,e,"style"),pl(t,e,fl),pl(t,e,dl),e}(s),r.node=void 0,r}return r(i,[{key:"destroy",value:function(){this.close(),p(h(i.prototype),"destroy",this).call(this);}},{key:"onClickOutside",value:function(t){vl(this.parent,t)||this.close();}},{key:"setEnterCloseEnable",value:function(t){return void 0===t&&(t=!0),this.enterCloseEnable=t,this}},{key:"initText",value:function(){}},{key:"updateText",value:function(){}},{key:"text",get:function(){return this.node?this.node.value:""},set:function(t){this.node&&(this.node.value=t);}},{key:"setText",value:function(t){return this.text=t,this}},{key:"maxLength",get:function(){return this.nodeConfig.maxLength},set:function(t){this.nodeConfig.maxLength=t,this.node&&(this.node.maxLength=t);}},{key:"setMaxLength",value:function(t){return this.maxLength=t,this}},{key:"minLength",get:function(){return this.nodeConfig.minLength},set:function(t){this.nodeConfig.minLength=t,this.node&&(this.node.minLength=t);}},{key:"setMinLength",value:function(t){return this.minLength=t,this}},{key:"placeholder",get:function(){return this.node.placeholder},set:function(t){this.node&&(this.node.placeholder=t);}},{key:"setPlaceholder",value:function(t){return this.placeholder=t,this}},{key:"selectText",value:function(t,e){return this.node?(void 0===t?this.node.select():this.node.setSelectionRange(t,e),this):this}},{key:"selectAll",value:function(){return this.selectText(),this}},{key:"selectionStart",get:function(){return this.node?this.node.selectionStart:0}},{key:"selectionEnd",get:function(){return this.node?this.node.selectionEnd:0}},{key:"selectedText",get:function(){if(!this.node)return "";var t=this.node;return t.value.substring(t.selectionStart,t.selectionEnd)}},{key:"cursorPosition",get:function(){return this.node?this.node.selectionStart:0},set:function(t){this.node&&this.node.setSelectionRange(t,t);}},{key:"setCursorPosition",value:function(t){return void 0===t?t=this.text.length:t<0&&(t=this.text.length+t),this.cursorPosition=t,this}},{key:"tooltip",get:function(){return this.node?this.node.title:""},set:function(t){if(!this.node)return this;this.node.title=t;}},{key:"setTooltip",value:function(t){return this.tooltip=t,this}},{key:"setTextChangedCallback",value:function(t){return this.onTextChanged=t,this}},{key:"readOnly",get:function(){return this.nodeConfig.readOnly},set:function(t){this.nodeConfig.readOnly=t,this.node&&(this.node.readOnly=t);}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}},{key:"spellCheck",get:function(){return this.node?this.node.spellcheck:""},set:function(t){this.node&&(this.node.spellcheck=t);}},{key:"setSpellCheck",value:function(t){return this.spellCheck=t,this}},{key:"fontColor",get:function(){if(this.node)return this.node.style.color},set:function(t){this.node&&(this.node.style.color=t);}},{key:"setFontColor",value:function(t){return this.fontColor=t,this}},{key:"setStyle",value:function(t,e){return this.node?(this.node.style[t]=e,this):this}},{key:"getStyle",value:function(t){if(this.node)return this.node.style[t]}},{key:"scrollToBottom",value:function(){return this.node?(this.node.scrollTop=this.node.scrollHeight,this):this}},{key:"setEnabled",value:function(t){return this.node?(void 0===t&&(t=!0),this.node.disabled=!t,this):this}},{key:"setBlur",value:function(){return this.node?(this.node.blur(),this):this}},{key:"setFocus",value:function(){return this.node?(this.node.focus(),this):this}},{key:"isFocused",get:function(){return this.isOpened}}]),i}(oo);Object.assign(Ol.prototype,Pl);var Ml=function(t,e,i){t=t.replace(" ","");var n=i.previousText;if(t===n)return t;if(isNaN(t)){i.emit("nan",t,i),t=n;var s=i.cursorPosition-1;i.setText(t),i.setCursorPosition(s);}else i.previousText=t;return t},El=function(t){var e=t.prevSelectionStart;if(null!==e){for(var i=t.prevSelectionEnd,n=t.parent,s=e;s=s&&h=i&&hi.length&&(t.prevCursorPosition=null),null!==t.prevCursorPosition&&(s=e.getCharChild(t.prevCursorPosition))&&("\n"===s.text&&s.clearTextSize(),e.emit("cursorout",s,t.prevCursorPosition,e)),null!=n&&(s=e.getCharChild(n))&&("\n"===s.text&&s.copyTextSize(e.lastInsertCursor),function(t){var e,i,n=t.parent,s=n.width,r=n.height,o=t.drawX,a=t.drawY,h=o+t.drawTLX,l=o+t.drawTRX,u=a+t.drawTLY,c=a+t.drawBLY;e=h<0?0-h:l>s?s-l:0,i=u<0?0-u:c>r?r-c:0,n._textOX+=e,n._textOY+=i;}(s),e.emit("cursorin",s,n,e)),e.emit("movecursor",n,t.prevCursorPosition,e),t.prevCursorPosition=n;}}(this)):(El(this),_l(this)),this}},{key:"setNumberInput",value:function(){return this.onUpdateCallback=Ml,this}},{key:"setSelectAllWhenFocusEnable",value:function(t){return void 0===t&&(t=!0),this.selectAllWhenFocus=t,this}}]),i}(Ol),Bl=Phaser.Utils.Objects.GetValue,Dl=["inputType","onOpen","onFocus","onClose","onBlur","onUpdate","enterClose","readOnly","maxLength","minLength","selectAll"],Il=function(t,e){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return !0;if(-1!==e.indexOf(".")){for(var i=e.split("."),n=t,s=0;st.length?i:t})),l.value=t.join(c);}else l.value=t.join(i.slice(a,a+l.count));a+=l.count,l.added||(h+=l.count);}}var d=e[o-1];return o>1&&"string"==typeof d.value&&(d.added||d.removed)&&t.equals("",d.value)&&(e[o-2].value+=d.value,e.pop()),e}Yl.prototype={diff:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.callback;"function"==typeof i&&(n=i,i={}),this.options=i;var s=this;function r(t){return n?(setTimeout((function(){n(void 0,t);}),0),!0):t}t=this.castInput(t),e=this.castInput(e),t=this.removeEmpty(this.tokenize(t));var o=(e=this.removeEmpty(this.tokenize(e))).length,a=t.length,h=1,l=o+a;i.maxEditLength&&(l=Math.min(l,i.maxEditLength));var u=[{newPos:-1,components:[]}],c=this.extractCommon(u[0],e,t,0);if(u[0].newPos+1>=o&&c+1>=a)return r([{value:this.join(e),count:e.length}]);function d(){for(var i=-1*h;i<=h;i+=2){var n=void 0,l=u[i-1],c=u[i+1],d=(c?c.newPos:0)-i;l&&(u[i-1]=void 0);var f=l&&l.newPos+1=o&&d+1>=a)return r(Vl(s,n.components,e,t,s.useLongestToken));u[i]=n;}else u[i]=void 0;}var v;h++;}if(n)!function t(){setTimeout((function(){if(h>l)return n();d()||t();}),0);}();else for(;h<=l;){var f=d();if(f)return f}},pushComponent:function(t,e,i){var n=t[t.length-1];n&&n.added===e&&n.removed===i?t[t.length-1]={count:n.count+1,added:e,removed:i}:t.push({count:1,added:e,removed:i});},extractCommon:function(t,e,i,n){for(var s=e.length,r=i.length,o=t.newPos,a=o-n,h=0;o+10,o=0,a=e.length;o0;this.dirty=this.dirty||this._radiusTL!==t||this._convexTL!==e,this._convexTL=e,this._radiusTL=Math.abs(t);}},{key:"radiusTR",get:function(){return this._radiusTR},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusTR!==t||this._convexTR!==e,this._convexTR=e,this._radiusTR=Math.abs(t);}},{key:"radiusBL",get:function(){return this._radiusBL},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusBL!==t||this._convexBL!==e,this._convexBL=e,this._radiusBL=Math.abs(t);}},{key:"radiusBR",get:function(){return this._radiusBR},set:function(t){var e=t>0;this.dirty=this.dirty||this._radiusBR!==t||this._convexBR!==e,this._convexBR=e,this._radiusBR=Math.abs(t);}},{key:"radius",get:function(){return Math.max(this.radiusTL,this.radiusTR,this.radiusBL,this.radiusBR)},set:function(t){"number"==typeof t?(this.radiusTL=t,this.radiusTR=t,this.radiusBL=t,this.radiusBR=t):(this.radiusTL=Ku(t,"tl",0),this.radiusTR=Ku(t,"tr",0),this.radiusBL=Ku(t,"bl",0),this.radiusBR=Ku(t,"br",0));}},{key:"setRadius",value:function(t){return void 0===t&&(t=0),this.radius=t,this}},{key:"iterations",get:function(){return this._iterations},set:function(t){this.dirty=this.dirty||this._iterations!==t,this._iterations=t;}},{key:"setIterations",value:function(t){return this.iterations=t,this}},{key:"updateData",value:function(){var t=this.pathData;t.length=0;var e,n=this.width,s=this.height,r=this.iterations+1;(e=this.radiusTL)>0?this._convexTL?Gt(e,e,e,e,180,270,!1,r,t):Gt(0,0,e,e,90,0,!0,r,t):Vt(0,0,t);(e=this.radiusTR)>0?this._convexTR?Gt(n-e,e,e,e,270,360,!1,r,t):Gt(n,0,e,e,180,90,!0,r,t):Vt(n,0,t);(e=this.radiusBR)>0?this._convexBR?Gt(n-e,s-e,e,e,0,90,!1,r,t):Gt(n,s,e,e,270,180,!0,r,t):Vt(n,s,t);(e=this.radiusBL)>0?this._convexBL?Gt(e,s-e,e,e,90,180,!1,r,t):Gt(0,s,e,e,360,270,!0,r,t):Vt(0,s,t);return t.push(t[0],t[1]),Eu(this.x,this.y,t),p(h(i.prototype),"updateData",this).call(this),this}}]),i}(yu),Zu=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,qu=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;return n(this,i),void 0===t&&(t=0),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===h&&(h=0),(l=e.call(this)).pathData=[],l.closePath=!0,l.setP0(t,s),l.setP1(r,o),l.setP2(a,h),l}return r(i,[{key:"x0",get:function(){return this._x0},set:function(t){this.dirty=this.dirty||this._x0!==t,this._x0=t;}},{key:"y0",get:function(){return this._y0},set:function(t){this.dirty=this.dirty||this._y0!==t,this._y0=t;}},{key:"setP0",value:function(t,e){return this.x0=t,this.y0=e,this}},{key:"x1",get:function(){return this._x1},set:function(t){this.dirty=this.dirty||this._x1!==t,this._x1=t;}},{key:"y1",get:function(){return this._y1},set:function(t){this.dirty=this.dirty||this._y1!==t,this._y1=t;}},{key:"setP1",value:function(t,e){return this.x1=t,this.y1=e,this}},{key:"x2",get:function(){return this._x2},set:function(t){this.dirty=this.dirty||this._x2!==t,this._x2=t;}},{key:"y2",get:function(){return this._y2},set:function(t){this.dirty=this.dirty||this._y2!==t,this._y2=t;}},{key:"setP2",value:function(t,e){return this.dirty=this.dirty||this.x2!==t||this.y2!==e,this.x2=t,this.y2=e,this}},{key:"updateData",value:function(){return this.pathData.length=0,this.pathData.push(this.x0,this.y0),this.pathData.push(this.x1,this.y1),this.pathData.push(this.x2,this.y2),this.pathData.push(this.x0,this.y0),p(h(i.prototype),"updateData",this).call(this),this}},{key:"webglRender",value:function(t,e,i,n,s){if(this.isFilled){var r=Zu(this.fillColor,this.fillAlpha*i),o=this.x0-n,a=this.y0-s,h=this.x1-n,l=this.y1-s,u=this.x2-n,c=this.y2-s,d=e.getX(o,a),f=e.getY(o,a),p=e.getX(h,l),v=e.getY(h,l),g=e.getX(u,c),y=e.getY(u,c);t.batchTri(d,f,p,v,g,y,r,r,r);}this.isStroked&&Kt(t,this,i,n,s);}},{key:"canvasRender",value:function(t,e,i){var n=this.x1-e,s=this.y1-i,r=this.x2-e,o=this.y2-i,a=this.x3-e,h=this.y3-i;t.beginPath(),t.moveTo(n,s),t.lineTo(r,o),t.lineTo(a,h),t.closePath(),this.isFilled&&(Zt(t,this),t.fill()),this.isStroked&&(qt(t,this),t.stroke());}}]),i}(vu),$u={buildShapes:function(){this.addShape((new Ju).setName("box")).addShape((new Uu).setName("checker"));},updateShapes:function(){var t=this.width/2,e=this.height/2,i=Math.min(t,e),n=2*i,s=t-i,r=e-i,o=this.boxLineWidth,a=Math.max(n/10,2),h=this.getShape("box"),l=this.getShape("checker");if(this.isSizeChanged){var u=n*(1-this.boxSize)/2,c=o/2,d=n*this.boxSize-o;h.setTopLeftPosition(s+c+u,r+c+u).setSize(d,d),this.isCircleShape?h.setRadius(d/2):h.setRadius(0);u=n*(1-this.checkerSize)/2;var f=n*this.checkerSize/4,p=1*f,v=2*f,g=3*f;l.startAt(p,v).lineTo(v,g).lineTo(g,p).offset(s+u,r+u).end();}this.checked?(h.fillStyle(this.boxFillColor,this.boxFillAlpha).lineStyle(o,this.boxStrokeColor,this.boxStrokeAlpha),l.lineStyle(a,this.checkerColor)):(h.fillStyle(this.uncheckedBoxFillColor,this.uncheckedBoxFillAlpha).lineStyle(o,this.uncheckedBoxStrokeColor,this.uncheckedBoxStrokeAlpha),l.lineStyle()),this.checked&&l.setDisplayPathSegment(this.checkerAnimProgress);}},Qu=Phaser.Utils.Objects.GetValue,tc=Phaser.Math.Linear,ec=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).resetFromJSON(),r.boot(),r}return r(i,[{key:"start",value:function(t){if(this.timer.isRunning)return this;var e=this.target;this.propertyKey=Qu(t,"key","value");var n=e[this.propertyKey];return this.fromValue=Qu(t,"from",n),this.toValue=Qu(t,"to",n),this.setEase(Qu(t,"ease",this.ease)),this.setDuration(Qu(t,"duration",this.duration)),this.setRepeat(Qu(t,"repeat",0)),this.setDelay(Qu(t,"delay",0)),this.setRepeatDelay(Qu(t,"repeatDelay",0)),this.timer.setDuration(this.duration).setRepeat(this.repeat).setDelay(this.delay).setRepeatDelay(this.repeatDelay),e[this.propertyKey]=this.fromValue,p(h(i.prototype),"start",this).call(this),this}},{key:"updateGameObject",value:function(t,e){var i=e.t;i=this.easeFn(i),t[this.propertyKey]=tc(this.fromValue,this.toValue,i);}}]),i}(To),ic={setCheckerAnimationDuration:function(t){return void 0===t&&(t=0),this.checkerAnimDuration=t,this},playCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask&&(this.checkerAnimProgressTask=new ec(this,{eventEmitter:null})),this.checkerAnimProgressTask.restart({key:"checkerAnimProgress",from:0,to:1,duration:this.checkerAnimDuration}),this},stopCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask||this.checkerAnimProgressTask.stop(),this}},nc={};Object.assign(nc,fu,{setBoxSize:function(t){return this.dirty=this.dirty||this.boxSize!==t,this.boxSize=t,this},setCheckerSize:function(t){return this.dirty=this.dirty||this.checkerSize!==t,this.checkerSize=t,this}},$u,ic);var sc=Phaser.Utils.Objects.GetValue,rc=Phaser.Utils.Objects.IsPlainObject,oc=23730,ac=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),rc(s)?(s=sc(l=s,"x",0),r=sc(l,"y",0),o=sc(l,"width",2),a=sc(l,"height",2),h=sc(l,"color",oc)):rc(h)&&(h=sc(l=h,"color",oc)),(u=e.call(this,t,s,r,o,a)).type="rexCheckbox",void 0===h&&(h=oc),u.setBoxShape(sc(l,"circleBox",!1)),u.setBoxFillStyle(h,sc(l,"boxFillAlpha",1)),u.setUncheckedBoxFillStyle(sc(l,"uncheckedColor",null),sc(l,"uncheckedBoxFillAlpha",1)),u.setBoxStrokeStyle(sc(l,"boxLineWidth",4),sc(l,"boxStrokeColor",h),sc(l,"boxStrokeAlpha",1)),u.setUncheckedBoxStrokeStyle(u.boxLineWidth,sc(l,"uncheckedBoxStrokeColor",u.boxStrokeColor),sc(l,"uncheckedBoxStrokeAlpha",u.boxStrokeAlpha)),u.setCheckerStyle(sc(l,"checkerColor",16777215),sc(l,"checkerAlpha",1)),u.setBoxSize(sc(l,"boxSize",1)),u.setCheckerSize(sc(l,"checkerSize",1)),u.setCheckerAnimationDuration(sc(l,"animationDuration",150)),u.buildShapes();var c=sc(l,"checked");return void 0===c&&(c=sc(l,"value",!1)),u.setValue(c),u}return r(i,[{key:"value",get:function(){return this._value},set:function(t){t=!!t,this._value!==t&&(this.dirty=!0,this._value=t,t?this.playCheckerAnimation():this.stopCheckerAnimation(),this.emit("valuechange",t));}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"toggleValue",value:function(){return this.setValue(!this.value),this}},{key:"checked",get:function(){return this.value},set:function(t){this.value=t;}},{key:"setChecked",value:function(t){return void 0===t&&(t=!0),this.setValue(t),this}},{key:"toggleChecked",value:function(){return this.toggleValue(),this}},{key:"checkerAnimProgress",get:function(){return this._checkerAnimProgress},set:function(t){this._checkerAnimProgress!==t&&(this._checkerAnimProgress=t,this.dirty=!0);}}]),i}(du);Object.assign(ac.prototype,nc);var hc=Phaser.Utils.Objects.GetValue,lc=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s))._enable=void 0,t.setInteractive(hc(s,"inputConfig",void 0)),r.resetFromJSON(s),r.boot(),r}return r(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.lastClickTime=void 0,this.setEnable(hc(t,"enable",!0)),this.setMode(hc(t,"mode",1)),this.setClickInterval(hc(t,"clickInterval",100)),this.setDragThreshold(hc(t,"threshold",void 0)),this}},{key:"boot",value:function(){var t=this.parent;t.on("pointerdown",this.onPress,this),t.on("pointerup",this.onRelease,this),t.on("pointerout",this.onPointOut,this),t.on("pointermove",this.onMove,this),t.on("pointerover",this.onOver,this),t.on("pointerout",this.onOut,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.pointer=null,p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t){t||this.cancel(),this._enable=t;var e=t?"enable":"disable";this.emit(e,this,this.parent);}}},{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=uc[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,this.emit("down",this,this.parent,t,n),0===this.mode&&this.click(t.downTime,t,n));}},{key:"onRelease",value:function(t,e,i,n){this.pointer===t&&(this.emit("up",this,this.parent,t,n),1===this.mode&&this.click(t.upTime,t,n),this.pointer=void 0);}},{key:"onPointOut",value:function(t,e){this.pointer===t&&this.cancel();}},{key:"onMove",value:function(t,e,i,n){this.pointer===t&&void 0!==this.dragThreshold&&1===this.mode&&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.parent,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.parent,e,i)),this}},{key:"cancel",value:function(){return this.pointer=void 0,this}},{key:"onOver",value:function(t,e,i,n){return this.enable?(this.emit("over",this,this.parent,t,n),this):this}},{key:"onOut",value:function(t,e){return this.enable?(this.emit("out",this,this.parent,t,e),this):this}}]),i}(oo),uc={press:0,pointerdown:0,release:1,pointerup:1},cc=Phaser.Utils.Objects.GetValue,dc=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var c;return n(this,i),(c=e.call(this,t,s,r,o,a,h,l))._click=new lc(u(c),cc(l,"click")),c._click.on("click",(function(){this.toggleValue();}),u(c)),c.setReadOnly(cc(l,"readOnly",!1)),c}return r(i,[{key:"readOnly",get:function(){return !this._click.enable},set:function(t){this._click.enable=!t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}}]),i}(ac);T.register("checkbox",(function(t,e,i,n,s,r){var o=new dc(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.Checkbox",dc);var fc={setTrackFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.trackFillColor!==t||this.trackFillAlpha!==e,this.trackFillColor=t,this.trackFillAlpha=e,this},setFalseValueTrackFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.falseValueTrackColor!==t||this.uncheckedTrackFillAlpha!==e,this.falseValueTrackColor=t,this.falseValueTrackFillAlpha=e,this},setThumbStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.thumbColor!==t||this.checkAlpha!==e,this.thumbColor=t,this.thumbAlpha=e,this}},pc={setTrackSize:function(t,e){return this.dirty=this.dirty||this.trackWidth!==t||this.trackHeight!==e,this.trackWidth=t,this.trackHeight=e,this},setTrackRadius:function(t){return this.dirty=this.dirty||this.trackRadius!==t,this.trackRadius=t,this},setThumbSize:function(t,e){return void 0===e&&(e=t),this.dirty=this.dirty||this.thumbWidth!==t||this.thumbHeight!==e,this.thumbWidth=t,this.thumbHeight=e,this},setThumbRadius:function(t){return this.dirty=this.dirty||this.thumbRadius!==t,this.thumbRadius=t,this}},vc={setThumbPosition:function(t,e){return void 0===e&&(e=1-t),this.thumbLeftX=t,this.thumbRightX=e,this},setRTL:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},gc=function(t,e,i){return (e-t)*i+t},yc=Phaser.Math.Linear,kc={buildShapes:function(){this.addShape((new Ju).setName("track")).addShape((new Ju).setName("thumb"));},updateShapes:function(){var t=this.width,e=this.height,i=this.value?this.toggleAnimProgress:1-this.toggleAnimProgress,n=this.getShape("track");if(this.isSizeChanged){var s=t*this.trackWidth,r=e*this.trackHeight,o=(t-s)/2,a=(e-r)/2,h=e*this.trackRadius;n.setTopLeftPosition(o,a).setSize(s,r).setRadius(h);}var l,u,c,d=(l=this.falseValueTrackColor,u=this.trackFillColor,c=i,(255&gc(yr(l),yr(u),c))<<16|(255&gc(kr(l),kr(u),c))<<8|255&gc(mr(l),mr(u),c)),f=yc(this.falseValueTrackFillAlpha,this.trackFillAlpha,i);n.fillStyle(d,f);var p=this.getShape("thumb");if(this.isSizeChanged){var v=t*this.thumbWidth,g=e*this.thumbHeight,y=e*this.thumbRadius;p.setSize(v,g).setRadius(y);}var k=yc(this.thumbLeftX,this.thumbRightX,i)*t;this.rtl&&(k=t-k);var m=e/2;p.setCenterPosition(k,m),p.fillStyle(this.thumbColor,this.thumbAlpha);}},mc={setToggleAnimationDuration:function(t){return void 0===t&&(t=0),this.toggleAnimDuration=t,this},playToggleAnimation:function(){return void 0===this.toggleAnimProgressTask&&(this.toggleAnimProgressTask=new ec(this,{eventEmitter:null})),this.toggleAnimProgressTask.restart({key:"toggleAnimProgress",from:0,to:1,duration:this.toggleAnimDuration}),this},stopToggleAnimation:function(){return void 0===this.toggleAnimProgressTask||this.toggleAnimProgressTask.stop(),this}},bc={};Object.assign(bc,fc,pc,vc,kc,mc);var xc=Phaser.Utils.Objects.GetValue,Cc=Phaser.Utils.Objects.IsPlainObject,wc=23730,Sc=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),Cc(s)?(s=xc(l=s,"x",0),r=xc(l,"y",0),o=xc(l,"width",2),a=xc(l,"height",2),h=xc(l,"color",wc)):Cc(h)&&(h=xc(l=h,"color",wc)),(u=e.call(this,t,s,r,o,a)).type="rexToggleSwitch",void 0===h&&(h=wc),u.setTrackFillStyle(h,xc(l,"trackFillAlpha",1)),u.setFalseValueTrackFillStyle(xc(l,"falseValueTrackColor",function(t){var e=.3*yr(t)+.59*kr(t)+.11*mr(t);return (255&e)<<16|(255&e)<<8|255&e}(h)),xc(l,"falseValueTrackFillAlpha",1)),u.setThumbStyle(xc(l,"thumbColor",16777215),xc(l,"thumbAlpha",1)),u.setTrackSize(xc(l,"trackWidth",.9),xc(l,"trackHeight",.5)),u.setTrackRadius(xc(l,"trackRadius",.5*u.trackHeight));var c=xc(l,"thumbHeight",void 0),d=xc(l,"thumbWidth",c);return void 0===d&&(d=.9*u.trackHeight),u.setThumbSize(d,c),u.setThumbRadius(xc(l,"thumbRadius",.5*u.thumbHeight)),u.setThumbPosition(xc(l,"thumbLeft",.3),xc(l,"thumbRight",void 0)),u.setRTL(xc(l,"rtl",!1)),u.setToggleAnimationDuration(xc(l,"animationDuration",150)),u.buildShapes(),u.setValue(xc(l,"value",!1),0),u}return r(i,[{key:"value",get:function(){return this._value},set:function(t){t=!!t,this._value!==t&&(this.dirty=!0,this._value=t,this.playToggleAnimation(),this.emit("valuechange",t));}},{key:"setValue",value:function(t,e){void 0===e&&(e=this.toggleAnimDuration);var i=this.toggleAnimDuration;return this.toggleAnimDuration=e,this.value=t,this.toggleAnimDuration=i,this}},{key:"toggleValue",value:function(t){return this.setValue(!this.value,t),this}},{key:"toggleAnimProgress",get:function(){return this._toggleAnimProgress},set:function(t){this._toggleAnimProgress!==t&&(this._toggleAnimProgress=t,this.dirty=!0);}}]),i}(du);Object.assign(Sc.prototype,bc);var Pc=Phaser.Utils.Objects.GetValue,Tc=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var c;return n(this,i),(c=e.call(this,t,s,r,o,a,h,l))._click=new lc(u(c),Pc(l,"click")),c._click.on("click",(function(){this.toggleValue();}),u(c)),c.setReadOnly(Pc(l,"readOnly",!1)),c}return r(i,[{key:"readOnly",get:function(){return !this._click.enable},set:function(t){this._click.enable=!t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}}]),i}(Sc);T.register("toggleSwitch",(function(t,e,i,n,s,r){var o=new Tc(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.ToggleSwitch",Tc);var Oc={loadFromURL:function(t,e){var i=this,n=new Image;return n.onload=function(){i.width!==n.width||i.height!==n.height?i.resize(n.width,n.height):i.clear(),i.context.drawImage(n,0,0),i.updateTexture(),e&&e(),n.onload=null,n.src="",n.remove();},n.src=t,this},loadFromURLPromise:function(t){var e=this;return new Promise((function(i,n){e.loadFromURL(t,i);}))},loadFromFile:function(t,e){var i=URL.createObjectURL(t);return this.loadFromURL(i,(function(){URL.revokeObjectURL(i),e&&e();})),this},loadFromFilePromise:function(t){var e=this;return new Promise((function(i,n){e.loadFromFile(t,i);}))}},Mc=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i)}(pe);Object.assign(Mc.prototype,Oc),T.register("canvas",(function(t,e,i,n){var s=new Mc(this.scene,t,e,i,n);return this.scene.add.existing(s),s})),Z(window,"RexPlugins.UI.Canvas",Mc);var Ec=Phaser.Utils.Objects.GetValue,_c=function(t){a(s,t);var e=d(s);function s(t,i,r,o,a,h){var l;return n(this,s),(l=e.call(this,t,i,r)).type="rexCircleMaskImage",l.setTexture(o,a,h),l}return r(s,[{key:"setTexture",value:function(t,e,n){"object"===i(e)&&(n=e,e=void 0),"string"==typeof n&&(n={maskType:n});var s=Ec(n,"maskType",0),r=Ec(n,"backgroundColor",void 0),o=Ec(n,"strokeColor",void 0),a=Ec(n,"strokeWidth",null!=o?10:0);if(void 0===s?s=0:"string"==typeof s&&(s=Rc[s]),this._textureKey=t,this._frameName=e,null===s)return this.loadTexture(t,e),this.dirty=!0,this;var h=this.scene.sys.textures.getFrame(t,e);if(!h)return this;h.cutWidth!==this.width||h.cutHeight!==this.height?this.setCanvasSize(h.cutWidth,h.cutHeight):this.clear();var l=this.canvas,u=this.context,c=l.width,d=l.height;null!=r&&(u.fillStyle=r,u.fillRect(0,0,c,d)),u.save(),u.beginPath();var f=a/2;switch(s){case 1:var p=(k=Math.floor(c/2))-f,v=(m=Math.floor(d/2))-f;u.ellipse(k,m,p,v,0,0,2*Math.PI);break;case 2:var g=Ec(n,"radius",0),y=Ec(n,"iteration",void 0);me(u,f,f,c-a,d-a,g,y);break;default:var k=Math.floor(c/2),m=Math.floor(d/2),b=Math.min(k,m)-f;u.arc(k,m,b,0,2*Math.PI);}return null!=o&&(u.strokeStyle=o,u.lineWidth=a,u.stroke()),u.clip(),this.loadTexture(t,e),u.restore(),this.dirty=!0,this}},{key:"resize",value:function(t,e){return this.setDisplaySize(t,e),this}}]),s}(pe),Rc={circle:0,ellipse:1,roundRectangle:2};T.register("circleMaskImage",(function(t,e,i,n,s){var r=new _c(this.scene,t,e,i,n,s);return this.scene.add.existing(r),r})),Z(window,"RexPlugins.UI.CircleMaskImage",_c);var Lc=Phaser.Utils.Objects.GetValue,Bc=function(t){a(s,t);var e=d(s);function s(t,i,r,o,a,h){var l;return n(this,s),(l=e.call(this,t,i,r)).type="rexAlphaMaskImage",l.maskFrame=null,l.setTexture(o,a,h),l}return r(s,[{key:"setTexture",value:function(t,e,n){"object"===i(e)&&(n=e,e=void 0),"string"==typeof n&&(n={mask:{key:n}});var s=Lc(n,"mask.key"),r=Lc(n,"mask.frame"),o=Lc(n,"mask.invertAlpha",!1),a=Lc(n,"mask.scale"),h=Lc(n,"backgroundColor");if(s){this._maskKey=s,this._maskFrame=r,this._maskScale=a;var l=s?this.scene.sys.textures.get(s):null;this.maskFrame=l?l.get(r):null;}this._textureKey=t,this._frameName=e;var u=this.maskFrame;if(null===u)return this.loadTexture(t,e),this.dirty=!0,this;var c=null!=h;this.loadTexture(t,e);var d,f,p=this.canvas,v=this.context,g=p.width,y=p.height;v.save(),v.globalCompositeOperation=o?"destination-out":"destination-in",null!=this._maskScale?(d=u.cutWidth*this._maskScale,f=u.cutHeight*this._maskScale):(d=g,f=y);var k=(g-d)/2,m=(y-f)/2;return this.drawFrame(this._maskKey,this._maskFrame,k,m,d,f),v.restore(),c&&(v.save(),v.globalCompositeOperation="destination-over",v.fillStyle=h,v.fillRect(0,0,g,y),v.restore()),this.dirty=!0,this}},{key:"resize",value:function(t,e){return this.setDisplaySize(t,e),this}}]),s}(pe);T.register("alphaMaskImage",(function(t,e,i,n,s){var r=new Bc(this.scene,t,e,i,n,s);return this.scene.add.existing(r),r})),Z(window,"RexPlugins.UI.AlphaMaskImage",Bc);var Dc=Phaser.Math.Linear,Ic=Phaser.Math.Percent,jc={setValue:function(t,e,i){return null==t||(void 0!==e&&(t=Ic(t,e,i)),this.value=t),this},addValue:function(t,e,i){return void 0!==e&&(t=Ic(t,e,i)),this.value+=t,this},getValue:function(t,e){var i=this.value;return void 0!==t&&(i=Dc(t,e,i)),i}},zc=Phaser.Math.Percent,Ac={setEaseValuePropName:function(t){return this.easeValuePropName=t,this},setEaseValueDuration:function(t){return this.easeValueDuration=t,this},setEaseValueFunction:function(t){return this.easeFunction=t,this},stopEaseValue:function(){return this.easeValueTask&&this.easeValueTask.stop(),this},easeValueTo:function(t,e,i){return null==t||(void 0!==e&&(t=zc(t,e,i)),void 0===this.easeValueTask&&(this.easeValueTask=new ec(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,to:t,duration:this.easeValueDuration,ease:this.easeFunction})),this},easeValueRepeat:function(t,e,i,n){return void 0===i&&(i=-1),void 0===n&&(n=0),void 0===this.easeValueTask&&(this.easeValueTask=new ec(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,from:t,to:e,duration:this.easeValueDuration,ease:this.easeFunction,repeat:i,repeatDelay:n}),this}},Fc=Phaser.Utils.Objects.GetValue,Wc=Phaser.Math.Clamp;function Yc(t){var e=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"bootProgressBase",value:function(t){this.eventEmitter=Fc(t,"eventEmitter",this);var e=Fc(t,"valuechangeCallback",null);if(null!==e){var i=Fc(t,"valuechangeCallbackScope",void 0);this.eventEmitter.on("valuechange",e,i);}return this.setEaseValuePropName("value").setEaseValueDuration(Fc(t,"easeValue.duration",0)).setEaseValueFunction(Fc(t,"easeValue.ease","Linear")),this}},{key:"value",get:function(){return this._value},set:function(t){t=Wc(t,0,1);var e=this._value,i=e!=t;this.dirty=this.dirty||i,this._value=t,i&&this.eventEmitter.emit("valuechange",this._value,e,this.eventEmitter);}}]),i}(t);return Object.assign(e.prototype,jc,Ac),e}var Vc=Phaser.Math.RadToDeg,Xc=Phaser.Math.DegToRad,Gc=function(t,e,i,n,s,r,o,a){var h=360===Math.abs(o-r),l=Xc(r),u=Xc(o),c=Math.cos(l),d=Math.sin(l),f=Math.cos(u),p=Math.sin(u);return t.startAt(e+c*n,i+d*n),t.arc(e,i,n,r,o,a),h&&0===s||(t.lineTo(e+f*s,i+p*s),s>0&&t.arc(e,i,s,o,r,!a)),t.close(),t},Uc={buildShapes:function(){this.addShape((new Uu).setName("track")).addShape((new Uu).setName("bar")).addShape((new bu).setName("center"));},updateShapes:function(){var t=this.radius,e=this.thickness*this.radius,i=this.radius,n=i-e,s=this.getShape("track");null!=this.trackColor&&this.thickness>0?(s.fillStyle(this.trackColor),Gc(s,t,t,i,n,0,360,!1)):s.reset();var r=this.getShape("bar");if(null!=this.barColor&&this.thickness>0){var o,a,h;if(1===this.value)o=!1,a=0,h=360;else o=this.anticlockwise,a=Vc(this.startAngle),h=360*(o?1-this.value:this.value)+a;r.fillStyle(this.barColor),Gc(r,t,t,i,n,a,h,!1);}else r.reset();var l=this.getShape("center");this.centerColor&&n>0?l.setCenterPosition(t,t).setRadius(n).fillStyle(this.centerColor):l.reset();}},Hc=Phaser.Utils.Objects.GetValue,Nc=Phaser.Utils.Objects.IsPlainObject,Kc=Phaser.Math.Clamp,Jc=Phaser.Math.DegToRad(270),Zc=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),Nc(s)&&(s=Hc(l=s,"x",0),r=Hc(l,"y",0),o=Hc(l,"radius",1),a=Hc(l,"barColor",void 0),h=Hc(l,"value",0)),void 0===o&&(o=1);var c=2*o;return (u=e.call(this,t,s,r,c,c)).type="rexCircularProgress",u.bootProgressBase(l),u.setRadius(o),u.setTrackColor(Hc(l,"trackColor",void 0)),u.setBarColor(a),u.setCenterColor(Hc(l,"centerColor",void 0)),u.setThickness(Hc(l,"thickness",.2)),u.setStartAngle(Hc(l,"startAngle",Jc)),u.setAnticlockwise(Hc(l,"anticlockwise",!1)),u.buildShapes(),u.setValue(h),u}return r(i,[{key:"resize",value:function(t,e){return (t=Math.floor(Math.min(t,e)))===this.width||(p(h(i.prototype),"resize",this).call(this,t,t),this.setRadius(t/2)),this}},{key:"radius",get:function(){return this._radius},set:function(t){this.dirty=this.dirty||this._radius!=t,this._radius=t;var e=2*t;this.resize(e,e);}},{key:"setRadius",value:function(t){return this.radius=t,this}},{key:"trackColor",get:function(){return this._trackColor},set:function(t){this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"setBarColor",value:function(t){return this.barColor=t,this}},{key:"startAngle",get:function(){return this._startAngle},set:function(t){this.dirty=this.dirty||this._startAngle!=t,this._startAngle=t;}},{key:"setStartAngle",value:function(t){return this.startAngle=t,this}},{key:"anticlockwise",get:function(){return this._anticlockwise},set:function(t){this.dirty=this.dirty||this._anticlockwise!=t,this._anticlockwise=t;}},{key:"setAnticlockwise",value:function(t){return void 0===t&&(t=!0),this.anticlockwise=t,this}},{key:"thickness",get:function(){return this._thickness},set:function(t){t=Kc(t,0,1),this.dirty=this.dirty||this._thickness!=t,this._thickness=t;}},{key:"setThickness",value:function(t){return this.thickness=t,this}},{key:"centerColor",get:function(){return this._centerColor},set:function(t){this.dirty=this.dirty||this._centerColor!=t,this._centerColor=t;}},{key:"setCenterColor",value:function(t){return this.centerColor=t,this}}]),i}(Yc(du));Object.assign(Zc.prototype,Uc),T.register("circularProgress",(function(t,e,i,n,s,r){var o=new Zc(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.CircularProgress",Zc);var qc=function(t,e,i,n,s,r,o,a,h,l,u,c){void 0===l&&(l=0),void 0===u&&(u=2*Math.PI),void 0===c&&(c=!1),e.beginPath(),e.ellipse(i,n,s,r,0,l,u,c),null!=o&&(e.fillStyle=o,e.fill()),null!=a&&(e.strokeStyle=a,e.lineWidth=h,e.stroke());},$c=function(){var t,e=this.radius,i=this.thickness*this.radius,n=this.radius-i/2,s=this.radius-i,r=(this.canvas,this.context);if(this.trackColor&&i>0&&(r.save(),qc(0,r,e,e,n,n,void 0,this.trackColor,i),r.restore()),this.barColor&&n>0){var o,a,h;if(1===this.value)o=!1,a=0,h=2*Math.PI;else o=this.anticlockwise,a=this.startAngle,h=2*Math.PI*(o?1-this.value:this.value)+a;r.save(),qc(0,r,e,e,n,n,void 0,this.barColor,i,a,h,o),r.restore();}this.centerColor&&s>0&&(this.centerColor2?((t=this.context.createRadialGradient(e,e,0,e,e,s)).addColorStop(0,this.centerColor),t.addColorStop(1,this.centerColor2)):t=this.centerColor,r.save(),qc(0,r,e,e,s,s,t),r.restore());this.textFormatCallback&&(this.textColor||this.textStrokeColor)&&(r.save(),function(t,e,i,n,s,r,o,a,h,l,u){void 0===h&&null!=a&&(h=2),void 0===l&&(l="start"),void 0===u&&(u="alphabetic"),e.font=r,e.textAlign=l,e.textBaseline=u,e.fillStyle=o,e.strokeStyle=a,e.lineWidth=h,e.lineCap="round",e.lineJoin="round",null!=a&&"none"!==a&&h>0&&e.strokeText(s,i,n),null!=o&&"none"!==o&&e.fillText(s,i,n);}(0,r,e,e,this.getFormatText(),this.textFont,this.textColor,this.textStrokeColor,this.textStrokeThickness,"center","middle"),r.restore());},Qc=Phaser.Utils.Objects.GetValue,td=Phaser.Utils.Objects.IsPlainObject,ed=Phaser.Math.Clamp,id=Phaser.Math.DegToRad(270),nd=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),td(s)&&(s=Qc(l=s,"x",0),r=Qc(l,"y",0),o=Qc(l,"radius",1),a=Qc(l,"barColor",void 0),h=Qc(l,"value",0));var c=2*o;(u=e.call(this,t,s,r,c,c)).type="rexCircularProgressCanvas",u.bootProgressBase(l),u.setRadius(o),u.setTrackColor(Qc(l,"trackColor",void 0)),u.setBarColor(a),u.setCenterColor(Qc(l,"centerColor",void 0)),u.setThickness(Qc(l,"thickness",.2)),u.setStartAngle(Qc(l,"startAngle",id)),u.setAnticlockwise(Qc(l,"anticlockwise",!1)),u.setTextColor(Qc(l,"textColor",void 0)),u.setTextStrokeColor(Qc(l,"textStrokeColor",void 0),Qc(l,"textStrokeThickness",void 0));var d=Qc(l,"textFont",void 0);return d?u.setTextFont(d):u.setTextFont(Qc(l,"textSize","16px"),Qc(l,"textFamily","Courier"),Qc(l,"textStyle","")),u.setTextFormatCallback(Qc(l,"textFormatCallback",void 0),Qc(l,"textFormatCallbackScope",void 0)),u.setValue(h),u}return r(i,[{key:"resize",value:function(t,e){return (t=Math.floor(Math.min(t,e)))===this.width||(p(h(i.prototype),"resize",this).call(this,t,t),this.setRadius(t/2)),this}},{key:"radius",get:function(){return this._radius},set:function(t){this.dirty=this.dirty||this._radius!=t,this._radius=t;var e=2*t;this.resize(e,e);}},{key:"setRadius",value:function(t){return this.radius=t,this}},{key:"trackColor",get:function(){return this._trackColor},set:function(t){t=ye(t,this.canvas,this.context),this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){t=ye(t,this.canvas,this.context),this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"setBarColor",value:function(t){return this.barColor=t,this}},{key:"startAngle",get:function(){return this._startAngle},set:function(t){this.dirty=this.dirty||this._startAngle!=t,this._startAngle=t;}},{key:"setStartAngle",value:function(t){return this.startAngle=t,this}},{key:"anticlockwise",get:function(){return this._anticlockwise},set:function(t){this.dirty=this.dirty||this._anticlockwise!=t,this._anticlockwise=t;}},{key:"setAnticlockwise",value:function(t){return void 0===t&&(t=!0),this.anticlockwise=t,this}},{key:"thickness",get:function(){return this._thickness},set:function(t){t=ed(t,0,1),this.dirty=this.dirty||this._thickness!=t,this._thickness=t;}},{key:"setThickness",value:function(t){return this.thickness=t,this}},{key:"centerColor",get:function(){return this._centerColor},set:function(t){t=ye(t,this.canvas,this.context),this.dirty=this.dirty||this._centerColor!=t,this._centerColor=t;}},{key:"centerColor2",get:function(){return this._centerColor2},set:function(t){t=ye(t,this.canvas,this.context),this.dirty=this.dirty||this._centerColor2!=t,this._centerColor2=t;}},{key:"setCenterColor",value:function(t,e){return this.centerColor=t,this.centerColor2=e,this}},{key:"textColor",get:function(){return this._textColor},set:function(t){t=ye(t,this.canvas,this.context),this.dirty=this.dirty||this._textColor!=t,this._textColor=t;}},{key:"setTextColor",value:function(t){return this.textColor=t,this}},{key:"textStrokeColor",get:function(){return this._textStrokeColor},set:function(t){t=ye(t,this.canvas,this.context),this.dirty=this.dirty||this._textStrokeColor!=t,this._textStrokeColor=t;}},{key:"textStrokeThickness",get:function(){return this._textStrokeThickness},set:function(t){this.dirty=this.dirty||this._textStrokeThickness!=t,this._textStrokeThickness=t;}},{key:"setTextStrokeColor",value:function(t,e){return void 0===e&&(e=2),this.textStrokeColor=t,this.textStrokeThickness=e,this}},{key:"textFont",get:function(){return this._textFont},set:function(t){this.dirty=this.dirty||this._textFont!=t,this._textFont=t;}},{key:"setTextFont",value:function(t,e,i){var n;return n=void 0===e?t:i+" "+t+" "+e,this.textFont=n,this}},{key:"setTextFormatCallback",value:function(t,e){return this.textFormatCallback=t,this.textFormatCallbackScope=e,this}},{key:"updateTexture",value:function(){return this.clear(),$c.call(this),p(h(i.prototype),"updateTexture",this).call(this),this}},{key:"getFormatText",value:function(t){return void 0===t&&(t=this.value),this.textFormatCallbackScope?this.textFormatCallback(t):this.textFormatCallback.call(this.textFormatCallbackScope,t)}}]),i}(Yc(pe));T.register("circularProgressCanvas",(function(t,e,i,n,s,r){var o=new nd(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.CircularProgressCanvas",nd);var sd=function(t,e,i,n,s,r){var o=(e+n)/2;return r>=0?t.startAt(o+r,i).lineTo(n+r,i).lineTo(n,s).lineTo(e,s).lineTo(e+r,i).lineTo(o+r,i):t.startAt(o,i).lineTo(n,i).lineTo(n-r,s).lineTo(e-r,s).lineTo(e,i).lineTo(o,i),t},rd=Phaser.Utils.Objects.GetValue,od=Phaser.Utils.Objects.IsPlainObject,ad=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l,u){var c;return n(this,i),od(s)?(s=rd(u=s,"x",0),r=rd(u,"y",0),o=rd(u,"width",2),a=rd(u,"height",2),h=rd(u,"barColor",void 0),l=rd(u,"value",0)):od(o)?(o=rd(u=o,"width",2),a=rd(u,"height",2),h=rd(u,"barColor",void 0),l=rd(u,"value",0)):od(h)&&(h=rd(u=h,"barColor",void 0),l=rd(u,"value",0)),(c=e.call(this,t,s,r,o,a,u)).type="rexLineProgress",c.bootProgressBase(u),c.addShape((new Uu).setName("trackFill")).addShape((new Uu).setName("bar")).addShape((new Uu).setName("trackStroke")),c.setTrackColor(rd(u,"trackColor",void 0)),c.setBarColor(h),c.setTrackStroke(rd(u,"trackStrokeThickness",2),rd(u,"trackStrokeColor",void 0)),c.setSkewX(rd(u,"skewX",0)),c.setRTL(rd(u,"rtl",!1)),c.setValue(l),c}return r(i,[{key:"trackColor",get:function(){return this._trackColor},set:function(t){this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"trackStrokeColor",get:function(){return this._trackStrokeColor},set:function(t){this.dirty=this.dirty||this._trackStrokeColor!=t,this._trackStrokeColor=t;}},{key:"trackStrokeThickness",get:function(){return this._trackStrokeThickness},set:function(t){this.dirty=this.dirty||this._trackStrokeThickness!=t,this._trackStrokeThickness=t;}},{key:"setTrackStroke",value:function(t,e){return this.trackStrokeThickness=t,this.trackStrokeColor=e,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"setBarColor",value:function(t){return this.barColor=t,this}},{key:"skewX",get:function(){return this._skewX},set:function(t){this.dirty=this.dirty||this._skewX!=t,this._skewX=t;}},{key:"setSkewX",value:function(t){return this.skewX=t,this}},{key:"rtl",get:function(){return this._rtl},set:function(t){t=!!t,this.dirty=this.dirty||this._rtl!=t,this._rtl=t;}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}}]),i}(Yc(du)),hd={updateShapes:function(){var t=this.skewX,e=this.width-Math.abs(t),i=this.height,n=this.getShape("trackFill");n.fillStyle(this.trackColor),n.isFilled&&sd(n,0,0,e,i,t).close();var s,r,o=this.getShape("bar");(o.fillStyle(this.barColor),o.isFilled)&&(this.rtl?(s=e*(1-this.value),r=e):(s=0,r=e*this.value),sd(o,s,0,r,i,t).close());var a=this.getShape("trackStroke");a.lineStyle(this.trackStrokeThickness,this.trackStrokeColor),a.isStroked&&sd(a,0,0,e,i,t).end();}};Object.assign(ad.prototype,hd),T.register("lineProgress",(function(t,e,i,n,s,r,o){var a=new ad(this.scene,t,e,i,n,s,r,o);return this.scene.add.existing(a),a})),Z(window,"RexPlugins.UI.LineProgress",ad);var ld=function(t,e,i,n,s,r,o){void 0===o&&(o="round"),function(t,e){t.save(),t.beginPath();var i=e[0];t.moveTo(i.x,i.y);for(var n=1,s=e.length;n0&&(r.save(),ld(0,r,this.trackPoints,void 0,this.trackStrokeColor,this.trackStrokeThickness),r.restore());},cd=function(t,e,i,n,s,r){void 0===r&&(r=[]),r.length=4;for(var o=0;o<4;o++)r[o]||(r[o]={});var a;return s>=0?((a=r[0]).x=t+s,a.y=e,(a=r[1]).x=i+s,a.y=e,(a=r[2]).x=i,a.y=n,(a=r[3]).x=t,a.y=n):((a=r[0]).x=t,a.y=e,(a=r[1]).x=i,a.y=e,(a=r[2]).x=i-s,a.y=n,(a=r[3]).x=t-s,a.y=n),r},dd=Phaser.Utils.Objects.GetValue,fd=Phaser.Utils.Objects.IsPlainObject,pd=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l,u){var c;return n(this,i),fd(s)?(s=dd(u=s,"x",0),r=dd(u,"y",0),o=dd(u,"width",2),a=dd(u,"height",2),h=dd(u,"barColor",void 0),l=dd(u,"value",0)):fd(o)?(o=dd(u=o,"width",2),a=dd(u,"height",2),h=dd(u,"barColor",void 0),l=dd(u,"value",0)):fd(h)&&(h=dd(u=h,"barColor",void 0),l=dd(u,"value",0)),(c=e.call(this,t,s,r,o,a)).type="rexLineProgressCanvas",c.trackPoints=[],c.barPoints=[],c.bootProgressBase(u),c.setTrackColor(dd(u,"trackColor",void 0)),c.setBarColor(h,dd(u,"barColor2",void 0),dd(u,"isHorizontalGradient",void 0)),c.setTrackStroke(dd(u,"trackStrokeThickness",2),dd(u,"trackStrokeColor",void 0)),c.setSkewX(dd(u,"skewX",0)),c.setRTL(dd(u,"rtl",!1)),c.setValue(l),c}return r(i,[{key:"trackColor",get:function(){return this._trackColor},set:function(t){t=ye(t,this.canvas,this.context),this.dirty=this.dirty||this._trackColor!=t,this._trackColor=t;}},{key:"setTrackColor",value:function(t){return this.trackColor=t,this}},{key:"trackStrokeColor",get:function(){return this._trackStrokeColor},set:function(t){t=ye(t,this.canvas,this.context),this.dirty=this.dirty||this._trackStrokeColor!=t,this._trackStrokeColor=t;}},{key:"trackStrokeThickness",get:function(){return this._trackStrokeThickness},set:function(t){this.dirty=this.dirty||this._trackStrokeThickness!=t,this._trackStrokeThickness=t;}},{key:"setTrackStroke",value:function(t,e){return this.trackStrokeThickness=t,this.trackStrokeColor=e,this}},{key:"barColor",get:function(){return this._barColor},set:function(t){t=ye(t,this.canvas,this.context),this.dirty=this.dirty||this._barColor!=t,this._barColor=t;}},{key:"barColor2",get:function(){return this._barColor2},set:function(t){t=ye(t,this.canvas,this.context),this.dirty=this.dirty||this._barColor2!=t,this._barColor2=t;}},{key:"isHorizontalGradient",get:function(){return this._isHorizontalGradient},set:function(t){this.dirty|=this._isHorizontalGradient!=t,this._isHorizontalGradient=t;}},{key:"setBarColor",value:function(t,e,i){return void 0===i&&(i=!0),this.barColor=t,this.barColor2=e,this.isHorizontalGradient=i,this}},{key:"skewX",get:function(){return this._skewX},set:function(t){this.dirty=this.dirty||this._skewX!=t,this._skewX=t;}},{key:"setSkewX",value:function(t){return this.skewX=t,this}},{key:"rtl",get:function(){return this._rtl},set:function(t){t=!!t,this.dirty=this.dirty||this._rtl!=t,this._rtl=t;}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},{key:"updateTexture",value:function(){return this.clear(),ud.call(this),p(h(i.prototype),"updateTexture",this).call(this),this}}]),i}(Yc(pe));T.register("circularProgressCanvas",(function(t,e,i,n,s,r,o){var a=new pd(this.scene,t,e,i,n,s,r,o);return this.scene.add.existing(a),a})),Z(window,"RexPlugins.UI.LineProgressCanvas",pd),Phaser.Math.Wrap;var vd=Phaser.Math.Linear,gd=function(){var t,e,i,n,s,r,o=this.getShape("triangle"),a=this.padding,h=this.width-a.right,l=0+a.left,u=this.height-a.bottom,c=0+a.top,d=(l+h)/2,f=(c+u)/2,p={0:{a:{x:l,y:c},b:{x:h,y:f},c:{x:l,y:u}},1:{a:{x:l,y:c},b:{x:d,y:u},c:{x:h,y:c}},2:{a:{x:h,y:c},b:{x:l,y:f},c:{x:h,y:u}},3:{a:{x:l,y:u},b:{x:d,y:c},c:{x:h,y:u}}};if(void 0===this.previousDirection){var v=p[this.direction],g=v.a,y=v.b,k=v.c;t=g.x,e=g.y,i=y.x,n=y.y,s=k.x,r=k.y;}else {var m=p[this.previousDirection],b=p[this.direction],x=this.easeDirectionProgress;t=vd(m.a.x,b.a.x,x),e=vd(m.a.y,b.a.y,x),i=vd(m.b.x,b.b.x,x),n=vd(m.b.y,b.b.y,x),s=vd(m.c.x,b.c.x,x),r=vd(m.c.y,b.c.y,x);}o.startAt(t,e).lineTo(i,n).lineTo(s,r),this.arrowOnly?o.end():o.close();},yd=(0, Phaser.Math.DegToRad)(120),kd=function(t){t=this.getShape("triangle");var e=this.width/2,i=this.height/2,n=Math.min(e,i)*this.radius,s=this.verticeRotation;t.startAt(e+n*Math.cos(s+yd),i+n*Math.sin(s+yd)).lineTo(e+n*Math.cos(s),i+n*Math.sin(s)).lineTo(e+n*Math.cos(s-yd),i+n*Math.sin(s-yd)),this.arrowOnly?t.end():t.close();},md={buildShapes:function(){this.addShape((new Uu).setName("triangle"));},updateShapes:function(){var t=this.getShape("triangle");this.arrowOnly?t.fillStyle().lineStyle(this.lineWidth,this.strokeColor,this.strokeAlpha):t.fillStyle(this.fillColor,this.fillAlpha).lineStyle(this.lineWidth,this.strokeColor,this.strokeAlpha),0===this.shapeMode?gd.call(this):kd.call(this);}},bd={setEaseDuration:function(t){return void 0===t&&(t=0),this.easeDuration=t,this},playEaseDirectionation:function(){return void 0===this.easeDirectionProgressTask&&(this.easeDirectionProgressTask=new ec(this,{eventEmitter:null})),this.easeDirectionProgressTask.restart({key:"easeDirectionProgress",from:0,to:1,duration:this.easeDuration}),this},stopEaseDirection:function(){return void 0===this.easeDirectionProgressTask||this.easeDirectionProgressTask.stop(),this}},xd=Phaser.Utils.Objects.GetValue,Cd=Phaser.Utils.Objects.IsPlainObject,wd=Phaser.Math.DegToRad,Sd=Phaser.Math.RadToDeg,Pd=function(t){a(s,t);var e=d(s);function s(t,i,r,o,a,h,l){var u,c,d,f,p,v,g,y,k;if(n(this,s),Cd(i)){var m=i;i=m.x,r=m.y,o=m.width,a=m.height,h=m.color,l=m.alpha,c=m.strokeColor,d=m.strokeAlpha,f=m.strokeWidth,p=m.arrowOnly,v=m.direction,g=m.easeDuration,y=m.padding,k=m.radius;}return void 0===i&&(i=0),void 0===r&&(r=0),void 0===o&&(o=1),void 0===a&&(a=o),void 0===p&&(p=!1),void 0===v&&(v=0),void 0===g&&(g=0),void 0===y&&(y=0),void 0===k&&(k=void 0),(u=e.call(this,t,i,r,o,a)).type="rexTriangle",u.setFillStyle(h,l),void 0!==c&&void 0===f&&(f=2),u.setStrokeStyle(f,c,d),u.setArrowOnly(p),u.setDirection(v,g),u.setPadding(y),u.setRadius(k),u.buildShapes(),u}return r(s,[{key:"arrowOnly",get:function(){return this._arrowOnly},set:function(t){this.dirty=this.dirty||this._arrowOnly!=t,this._arrowOnly=t;}},{key:"setArrowOnly",value:function(t){return void 0===t&&(t=!0),this.arrowOnly=t,this}},{key:"direction",get:function(){return this._direction},set:function(t){t=Od(t),this._direction!==t&&(this.easeDuration>0&&void 0!==this._direction?this.previousDirection=this._direction:this.previousDirection=void 0,this._direction=t,this.verticeAngle=90*t,this.dirty=!0,void 0!==this.previousDirection?this.playEaseDirectionation():this.stopEaseDirection());}},{key:"setDirection",value:function(t,e){return void 0!==e&&this.setEaseDuration(e),this.direction=t,this}},{key:"toggleDirection",value:function(t){return this.setDirection(this.direction+2,t),this}},{key:"easeDirectionProgress",get:function(){return this._easeDirectionProgress},set:function(t){this._easeDirectionProgress!==t&&(this._easeDirectionProgress=t,this.dirty=!0);}},{key:"setPadding",value:function(t,e,n,s){if("object"===i(t)){var r=t,o=xd(r,"x",null);null!==o?(t=o,n=o):(t=xd(r,"left",0),n=xd(r,"right",t));var a=xd(r,"y",null);null!==a?(e=a,s=a):(e=xd(r,"top",0),s=xd(r,"bottom",e));}else void 0===t&&(t=0),void 0===e&&(e=t),void 0===n&&(n=t),void 0===s&&(s=e);return void 0===this.padding&&(this.padding={}),this.dirty=this.dirty||this.padding.left!=t||this.padding.top!=e||this.padding.right!=n||this.padding.bottom!=s,this.padding.left=t,this.padding.top=e,this.padding.right=n,this.padding.bottom=s,this.setRadius(),this}},{key:"radius",get:function(){return this._radius},set:function(t){this.dirty=this.dirty||this._radius!=t,this._radius=t;}},{key:"setRadius",value:function(t){return this.radius=t,this.shapeMode=null==t?0:1,this}},{key:"verticeRotation",get:function(){return this._verticeRotation},set:function(t){this.dirty=this.dirty||this._verticeRotation!=t,this._verticeRotation=t;}},{key:"setVerticeRotation",value:function(t){return this.verticeRotation=t,this}},{key:"verticeAngle",get:function(){return Sd(this.verticeRotation)},set:function(t){this.verticeRotation=wd(t);}},{key:"setVerticeAngle",value:function(t){return this.verticeAngle=t,this}}]),s}(du),Td={right:0,down:1,left:2,up:3},Od=function(t){return "string"==typeof t&&(t=Td[t]),t%=4};Object.assign(Pd.prototype,md,bd),T.register("triangle",(function(t,e,i,n,s,r){var o=new Pd(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.Triangle",Pd),lt();var Md=Phaser.GameObjects.Zone,Ed=Phaser.Utils.Array.Add,_d=Phaser.Utils.Array.Remove,Rd=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a){var h;return n(this,i),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=1),void 0===a&&(a=1),(h=e.call(this,t,s,r,o,a)).children=[],h}return r(i,[{key:"destroy",value:function(t){if(this.scene&&!this.ignoreDestroy){if(t)for(var e,n=this.children.length-1;n>=0;n--)(e=this.children[n]).parentContainer||e.displayList||e.destroy(t);this.clear(!t),p(h(i.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 Ed(this.children,t,0,(function(t){t.once("destroy",e.onChildDestroy,e);}),this),this}},{key:"remove",value:function(t,e){var i=this;return _d(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;i0;){var n=i.shift();!e(n)&&n.isRexContainerLite&&i.push.apply(i,m(n.children));}},df=Phaser.Utils.Array,ff={getChildren:function(t){if(t)for(var e=0,i=this.children.length;e=0;e--)this.remove(this.backgroundChildren[e],t);return this}},Ep=function(t,e){if("string"==typeof t)this.childrenMap[t]=e;else {var i=t;for(t in i)this.childrenMap[t]=i[t];}return this},_p=/(\S+)\[(\d+)\]/i,Rp={getInnerPadding:function(t){return On(this.space,t)},setInnerPadding:function(t,e){return Mn(this.space,t,e),this},getOuterPadding:function(t){return On(this.getSizerConfig(this).padding,t)},setOuterPadding:function(t,e){return Mn(this.getSizerConfig(this).padding,t,e),this},getChildOuterPadding:function(t,e){return "string"==typeof t&&(t=this.getElement(t)),On(this.getSizerConfig(t).padding,e)},setChildOuterPadding:function(t,e,i){return "string"==typeof t&&(t=this.getElement(t)),Mn(this.getSizerConfig(t).padding,e,i),this}},Lp=function(t){var e=this.childrenWidth,i=void 0!==this.minWidth?this.minWidth:0;return void 0===t?(t=Math.max(i,e),this.layoutWarnEnable&&i>0&&e>i&&console.warn("Layout width warn: ".concat(this.constructor.name,"'s minWidth (").concat(i,") < childrenWidth (").concat(e,")"))):this.layoutWarnEnable&&(i>t||e>t)&&console.warn("Layout width warn: ".concat(this.constructor.name,"'s minWidth (").concat(i,") or childrenWidth (").concat(e," > targetWidth ").concat(t,")")),t},Bp=function(t){var e=this.childrenHeight,i=void 0!==this.minHeight?this.minHeight:0;return void 0===t?(t=Math.max(i,e),this.layoutWarnEnable&&i>0&&e>i&&console.warn("Layout height warn: ".concat(this.constructor.name,"'s minHeight (").concat(i,") < childrenHeight (").concat(e,")"))):this.layoutWarnEnable&&(i>t||e>t)&&console.warn("Layout height warn: ".concat(this.constructor.name,"'s minHeight (").concat(i,") or childrenHeight (").concat(e,") > targetHeight (").concat(t,")")),t},Dp={getShownChildren:function(t){void 0===t&&(t=[]);for(var e,i=this.children,n=0,s=i.length;n0;){var i=e.shift();i.rexSizer&&i.rexSizer.hidden||(i!==this&&t.push(i),i.isRexContainerLite&&e.push.apply(e,m(i.children)));}return t}},Ip=function(){this._childrenWidth=void 0,this._childrenHeight=void 0;for(var t,e=this.getChildrenSizers(),i=0,n=e.length;i0){var e=t.runTransitionInCallback();t.delayCall(e,this.next,this);}else this.next();}},{key:"exit_TRANS_OPNE",value:function(){this.parent.removeDelayCall();}},{key:"next_OPEN",value:function(){return "TRANS_CLOSE"}},{key:"enter_OPEN",value:function(){this.parent.onOpen();}},{key:"exit_OPEN",value:function(){this.parent.removeDelayCall();}},{key:"next_TRANS_CLOSE",value:function(){return "CLOSE"}},{key:"enter_TRANS_CLOSE",value:function(){var t=this.parent;if(t.transitOutTime>0){var e=t.runTransitionOutCallback();t.delayCall(e,this.next,this);}else this.next();}},{key:"exit_TRANS_CLOSE",value:function(){this.parent.removeDelayCall();}},{key:"next_CLOSE",value:function(){return "TRANS_OPNE"}},{key:"enter_CLOSE",value:function(){this.parent.onClose();}},{key:"exit_CLOSE",value:function(){}},{key:"canOpen",value:function(){return "IDLE"===this.state||"CLOSE"===this.state}},{key:"canClose",value:function(){return "IDLE"===this.state||"OPEN"===this.state}}]),i}(Wv),Vv={delayCall:function(t,e,i){return this.delayCallTimer=function(t,e,i,n,s){var r=so(t);return r.time.delayedCall(e,(function(){r.game.events.once("poststep",(function(){i.call(n,s);}));}))}(this,t,e,i),this},removeDelayCall:function(){return this.delayCallTimer&&(this.delayCallTimer.remove(!1),this.delayCallTimer=void 0),this}},Xv={setTransitInTime:function(t){return this.transitInTime=t,this},setTransitOutTime:function(t){return this.transitOutTime=t,this},setTransitInCallback:function(t){return t||(t=D),this.transitInCallback=t,this},setTransitOutCallback:function(t){return t||(t=D),this.transitOutCallback=t,this}},Gv={runTransitionInCallback:function(){return this.transitInCallback(this.parent,this.transitInTime),this.transitInTime},onOpen:function(){},requestOpen:function(t,e){if(!this._state.canOpen())return this;this.openEventData=arguments.length>0?t:this.parent;var i=this.transitInTime;return void 0!==e&&(this.transitInTime=e),this._state.goto("TRANS_OPNE"),this.transitInTime=i,this}},Uv={runTransitionOutCallback:function(){return this.transitOutCallback(this.parent,this.transitOutTime),this.transitOutTime},onClose:function(){this.oneShotMode&&this.parent.destroy();},requestClose:function(t,e){if(!this._state.canClose)return this;this.closeEventData=arguments.length>0?t:this.parent;var i=this.transitOutTime;return void 0!==e&&(this.transitOutTime=e),this._state.goto("TRANS_CLOSE"),this.transitOutTime=i,this}},Hv={};Object.assign(Hv,Vv,Xv,Gv,Uv);var Nv=Phaser.Utils.Objects.GetValue,Kv=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).setTransitInTime(Nv(s,"duration.in",200)),r.setTransitOutTime(Nv(s,"duration.out",200)),r.setTransitInCallback(Nv(s,"transitIn")),r.setTransitOutCallback(Nv(s,"transitOut")),r.oneShotMode=Nv(s,"destroy",!1),r.delayCallTimer=void 0,r._state=new Yv(u(r),{eventEmitter:!1,initState:Nv(s,"initState","IDLE")}),r.openEventData=void 0,r.closeEventData=void 0,r}return r(i,[{key:"state",get:function(){return this._state.state}},{key:"shutdown",value:function(t){this.isShutdown||(this.transitInCallback=void 0,this.transitOutCallback=void 0,this.openEventData=void 0,this.closeEventData=void 0,this.removeDelayCall(),p(h(i.prototype),"shutdown",this).call(this,t));}}]),i}(oo);Object.assign(Kv.prototype,Hv);var Jv=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;return n(this,i),(o=e.call(this,t,0,0,2,2,s,1)).setAlpha(r),o.setScrollFactor(0),o.boot(),o}return r(i,[{key:"boot",value:function(){this.scene.sys.events.on("prerender",this.resize,this);}},{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.scene.sys.events.off("prerender",this.resize,this),p(h(i.prototype),"destroy",this).call(this,t));}},{key:"tint",get:function(){return this.fillColor},set:function(t){this.setFillStyle(t,this.fillAlpha);}},{key:"resize",value:function(){var t=this.scene,e=t.sys.scale.gameSize,i=t.sys.cameras.main,n=e.width,s=e.height,r=1/i.zoom,o=n/2,a=s/2,h=n*r,l=s*r;this.x===o&&this.y===a||this.setPosition(o,a),this.width===h&&this.height===l||this.setSize(h,l).setOrigin(.5);}}]),i}(Phaser.GameObjects.Rectangle),Zv=Phaser.Utils.Objects.GetValue,qv=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,{eventEmitter:!1})).resetFromJSON(s),r.boot(),r}return r(i,[{key:"resetFromJSON",value:function(t){return this.setHitAreaMode(Zv(t,"hitAreaMode",0)),this.setEnable(Zv(t,"enable",!0)),this.setStopMode(Zv(t,"stopAllLevels",!0)),this}},{key:"boot",value:function(){this.parent.on("pointerdown",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerup",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointermove",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerover",(function(t,e,i,n){this.stopAllLevels&&n.stopPropagation();}),this).on("pointerout",(function(t,e){this.stopAllLevels&&e.stopPropagation();}),this);}},{key:"setHitAreaMode",value:function(t){"string"==typeof t&&(t=$v[t]);var e=this.parent;return e.input&&e.removeInteractive(),0===t?e.setInteractive():e.setInteractive({hitArea:{},hitAreaCallback:function(){return !0}}),this}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),t?this.parent.setInteractive():this.parent.disableInteractive(),this.enable=t,this}},{key:"setStopMode",value:function(t){return void 0===t&&(t=!0),this.stopAllLevels=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}}]),i}(oo),$v={default:0,fullWindow:1},Qv=Phaser.Utils.Objects.GetValue,tg=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=Qv(s,"color",0),a=Qv(s,"alpha",.8);return (r=e.call(this,t,o,a)).touchEventStop=new qv(u(r),{hitAreaMode:1}),r}return r(i)}(Jv),eg=function(t,e){void 0!==t._modalScaleSave?(t.scaleX=t._modalScaleSave,t.scaleY=t._modalScaleSave):t._modalScaleSave=t.scaleX,Xp(t,e);},ig=function(t,e){Gp(t,e,void 0,void 0,!1);},ng=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,tv(t,e);},sg=function(t,e){ev(t,e,!1);},rg=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,tv(t,e,t.alpha);},og=function(t,e){ev(t,e,!1);},ag=function(t,e,i,n,s){return !!t&&(!(n&&!n(t,e,i))&&(!!Ir(t,!0).contains(e,i)&&!(s&&!s(t,e,i))))},hg=Phaser.Utils.Objects.GetValue,lg=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),null==s.transitIn&&(s.transitIn=ug.popUp),null==s.transitOut&&(s.transitOut=ug.scaleDown),s.destroy=hg(s,"destroy",!0),r=e.call(this,t,s);var o=hg(s,"cover");r.cover=!1!==o?function(t,e){var i=t.scene,n=new tg(i,e);return i.add.existing(n),t.isRexContainerLite?(t.pin(n,{syncPosition:!1,syncRotation:!1,syncScale:!1,syncAlpha:!1,syncScrollFactor:!1}),t.moveDepthBelow(n)):i.children.moveBelow(n,t),n}(t,o):void 0,r.cover&&(r.setCoverTransitInCallback(hg(o,"transitIn",rg)),r.setCoverTransitOutCallback(hg(o,"transitOut",og)));var a=hg(s,"touchOutsideClose",!1),h=hg(s,"duration.hold",-1),l=hg(s,"timeOutClose",h>=0),c=hg(s,"anyTouchClose",!1);return hg(s,"manualClose",!1)&&(a=!1,c=!1,l=!1),c&&(a=!1),l?r.setDisplayTime(h):r.setDisplayTime(-1),c?r.once("open",r.anyTouchClose,u(r)):a&&r.once("open",r.touchOutsideClose,u(r)),hg(s,"openOnStart",!0)&&r.delayCall(0,r.requestOpen,u(r)),r}return r(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.cover||this.scene.input.off("pointerup",this.touchCloseCallback,this),this.cover&&!t&&(this.cover.destroy(),this.cover=void 0),p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"touchOutsideClose",value:function(){return this.cover?this.cover.on("pointerup",this.touchCloseCallback,this):this.scene.input.on("pointerup",this.touchCloseCallback,this),this.clickOutsideTest=!0,this}},{key:"anyTouchClose",value:function(){return this.cover?this.cover.once("pointerup",this.touchCloseCallback,this):this.scene.input.once("pointerup",this.touchCloseCallback,this),this}},{key:"touchCloseCallback",value:function(t){this.clickOutsideTest&&ag(this.parent,t.worldX,t.worldY)||this.requestClose();}},{key:"runTransitionInCallback",value:function(){var t=p(h(i.prototype),"runTransitionInCallback",this).call(this),e=this.cover;return e&&this.coverTransitInCallback&&this.coverTransitInCallback(e,t),t}},{key:"runTransitionOutCallback",value:function(){var t=p(h(i.prototype),"runTransitionOutCallback",this).call(this),e=this.cover;return e&&this.coverTransitOutCallback&&this.coverTransitOutCallback(e,t),t}},{key:"onOpen",value:function(){var t=this.displayTime;t>=0&&this.delayCall(t,this.requestClose,this),this.emit("open",this.parent,this),p(h(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.closeEventData),p(h(i.prototype),"onClose",this).call(this);}},{key:"setDisplayTime",value:function(t){return this.displayTime=t,this}},{key:"setTransitInCallback",value:function(t){switch("string"==typeof t&&(t=ug[t]),t){case ug.popUp:t=eg;break;case ug.fadeIn:t=ng;}return p(h(i.prototype),"setTransitInCallback",this).call(this,t),this}},{key:"setTransitOutCallback",value:function(t){switch("string"==typeof t&&(t=ug[t]),t){case ug.scaleDown:t=ig;break;case ug.fadeOut:t=sg;}return p(h(i.prototype),"setTransitOutCallback",this).call(this,t),this}},{key:"setCoverTransitInCallback",value:function(t){return this.coverTransitInCallback=t,this}},{key:"setCoverTransitOutCallback",value:function(t){return this.coverTransitOutCallback=t,this}}]),i}(Kv),ug={popUp:0,fadeIn:1,scaleDown:0,fadeOut:1},cg=function(t,e){var i=new lg(t,e);return i.on("open",(function(){t.emit("modal.open",i);})),i.on("close",(function(e){t.emit("modal.close",e,i);})),t.on("modal.requestClose",i.requestClose,i),i},dg=function(t,e){t.emit("modal.requestClose",e);},fg=function(t){return t&&"function"==typeof t},pg={modal:function(t,e){return fg(t)&&(e=t,t=void 0),void 0===this._modalBehavior&&(this.onCreateModalBehavior&&this.onCreateModalBehavior(this,t),this._modalBehavior=cg(this,t)),e&&this._modalBehavior.once("close",e),this._modalBehavior.requestOpen(),this},modalPromise:function(t){var e=this;return new Promise((function(i,n){e.modal(t,i);}))},modalClose:function(t){return dg(this,t),this}},vg=function(t,e,i,n){if(e)return ag(t,e.worldX,e.worldY,i,n);for(var s=t.scene.input.manager,r=s.pointersTotal,o=s.pointers,a=0;a=this.dragThreshold||this.isPointerInside(t))&&this.cancel();}},{key:"click",value:function(t,e){if(!this.enable)return this;if(void 0===t)return this.emit("clickoutside",this,this.parent,e),this;this.pointer=void 0;var i=this.lastClickTime;return void 0!==i&&t-i<=this.clickInterval||(this.lastClickTime=t,this.emit("clickoutside",this,this.parent,e)),this}},{key:"cancel",value:function(){return this.pointer=void 0,this}}]),i}(oo),Lg={press:0,pointerdown:0,release:1,pointerup:1},Bg={onClickOutside:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._clickOutside&&(t._clickOutside=new Rg(t,n)),t._clickOutside.on("clickoutside",e,i),this):this},offClickOutside:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._clickOutside||t._clickOutside.off("clickoutside",e,i),this},enableClickOutside:function(t,e){return t&&"object"!==i(t)&&(e=t,t=this),void 0===t._clickOutside||t._clickOutside.setEnable(e),this},disableClickOutside:function(t){return t&&"object"!==i(t)&&(t=this),void 0===t._clickOutside||t._clickOutside.setEnable(!1),this}},Dg=function(t){a(i,t);var e=d(i);function i(){var t;return n(this,i),(t=e.call(this,{eventEmitter:!1})).goto("IDLE"),t}return r(i,[{key:"setCooldownTime",value:function(t){return this.cooldownTime=t,this.cooldownMode=void 0!==t,this}},{key:"request",value:function(){return this.runMethod("request")}},{key:"update_IDLE",value:function(){this.compensationTime=0;}},{key:"request_IDLE",value:function(){return this.next(),!0}},{key:"next_IDLE",value:function(){if(this.cooldownMode)return "COOLDOWN"}},{key:"enter_COOLDOWN",value:function(){this.remainderTime=this.cooldownTime+this.compensationTime;}},{key:"update_COOLDOWN",value:function(t,e){this.remainderTime-=e,this.remainderTime<0&&(this.compensationTime=this.cooldownTime>e?-this.remainderTime:0,this.goto("IDLE"));}},{key:"request_COOLDOWN",value:function(){return !1}}]),i}(Wv),Ig=Phaser.Utils.Objects.GetValue,jg=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s))._enable=void 0,r.cooldown=new Dg,r.parent.setInteractive(Ig(s,"inputConfig",void 0)),r.resetFromJSON(s),r.boot(),r}return r(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.prevIsInTouch=!1,this.isInTouching=!1,this.setEnable(Ig(t,"enable",!0)),this.setCooldown(Ig(t,"cooldown",void 0)),this}},{key:"boot",value:function(){var t=this.parent;t.on("pointerdown",this.onPointIn,this),t.on("pointerover",this.onPointIn,this),t.on("pointerup",this.onPointOut,this),t.on("pointerout",this.onPointOut,this),this.scene.sys.events.on("preupdate",this.preupdate,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.scene.sys.events.off("preupdate",this.preupdate,this),this.pointer=void 0,p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t)return t||(this.prevIsInTouch=!1,this.isInTouching=!1,this.pointer=void 0),this._enable=t,this}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"cooldownTime",get:function(){return this.cooldown.cooldownTime},set:function(t){this.cooldown.setCooldownTime(t);}},{key:"setCooldown",value:function(t){return this.cooldownTime=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"onPointIn",value:function(t,e,i){this.enable&&t.isDown&&void 0===this.pointer&&(this.pointer=t,this.isInTouching=!0);}},{key:"onPointOut",value:function(t){this.enable&&this.pointer===t&&(this.pointer=void 0,this.isInTouching=!1);}},{key:"preupdate",value:function(t,e){this.cooldown.update(t,e),!this.prevIsInTouch&&this.isInTouching&&this.emit("touchstart",this,this.parent),this.isInTouching&&this.cooldown.request()&&this.emit("intouch",this,this.parent,this.pointer),this.prevIsInTouch&&!this.isInTouching&&this.emit("touchend",this,this.parent),this.prevIsInTouch=this.isInTouching;}}]),i}(oo),zg={isPointerInBounds:function(t){return void 0===t?t=this:"string"==typeof t&&(t=this.getElement(t)),!!t&&vg(t)},onTouching:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._inTouching&&(t._inTouching=new jg(t,n)),t._inTouching.on("intouch",e,i),this):this},offTouching:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._inTouching||t._inTouching.off("intouch",e,i),this},onTouchingEnd:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._inTouching&&(t._inTouching=new jg(t,n)),t._inTouching.on("touchend",e,i),this):this},offTouchingEnd:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._inTouching||t._inTouching.off("touchend",e,i),this},enableTouching:function(t,e){return t&&"object"!==i(t)&&(e=t,t=this),void 0===t._inTouching||t._inTouching.setEnable(e),this},disableTouching:function(t){return t&&"object"!==i(t)&&(t=this),void 0===t._inTouching||t._inTouching.setEnable(!1),this}},Ag=function(t,e,i){for(var n,s=0,r=t.length;s0),this.onDragStart()));}},{key:"onPointerUp",value:function(t){this.enable&&((!this.bounds||this.bounds.contains(t.x,t.y))&&this.pointer===t&&(this.pointer=void 0,this.movedState=!1,this.tracerState=ty,this.onDragEnd()));}},{key:"onPointerMove",value:function(t){if(this.enable&&t.isDown){var e=!this.bounds||this.bounds.contains(t.x,t.y),i=this.pointer===t;!i&&e||(i&&!e?this.onPointerUp(t):(this.movedState||(this.movedState=t.x!==t.downX||t.y!==t.downY),this.movedState&&this.onDrag()));}}},{key:"dragCancel",value:function(){return this.tracerState===ey&&this.onDragEnd(),this.pointer=void 0,this.tracerState=ty,this}},{key:"onDragStart",value:function(){this.emit("dragstart",this);}},{key:"onDragEnd",value:function(){this.emit("dragend",this);}},{key:"onDrag",value:function(){this.emit("drag",this);}},{key:"preUpdate",value:function(t,e){}},{key:"postUpdate",value:function(t,e){}},{key:"startTicking",value:function(){p(h(i.prototype),"startTicking",this).call(this),this.scene.sys.events.on("preupdate",this.preUpdate,this),this.scene.sys.events.on("postupdate",this.postUpdate,this);}},{key:"stopTicking",value:function(){p(h(i.prototype),"stopTicking",this).call(this),this.scene&&(this.scene.sys.events.off("preupdate",this.preUpdate,this),this.scene.sys.events.off("postupdate",this.postUpdate,this));}},{key:"setRecongizedStateObject",value:function(t){return this.recongizedState=t,this}},{key:"state",get:function(){return this.recongizedState.state},set:function(t){this.recongizedState.state=t;}},{key:"cancel",value:function(){return this.state=iy,this}}]),i}(ho),ty=0,ey=1,iy="IDLE",ny=Phaser.Utils.Objects.GetValue,sy=Phaser.Math.Distance.Between,ry=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=u(r=e.call(this,t,s)),a={states:{IDLE:{enter:function(){o.stop(),o.tapsCount=0,o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.start(),o.tapsCount=0,o.emit("tappingstart",o,o.gameObject,o.lastPointer);}},RECOGNIZED:{enter:function(){o.start(),o.emit("tap",o,o.gameObject,o.lastPointer),o.emit("".concat(o.tapsCount,"tap"),o,o.gameObject,o.lastPointer);}}},init:function(){this.state=oy;},eventEmitter:!1};return r.setRecongizedStateObject(new Wv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setHoldTime(ny(t,"time",250)),this.setTapInterval(ny(t,"tapInterval",200)),this.setDragThreshold(ny(t,"threshold",9)),this.setTapOffset(ny(t,"tapOffset",10));var e=ny(t,"taps",void 0);return void 0!==e?this.setTaps(e):(this.setMaxTaps(ny(t,"maxTaps",void 0)),this.setMinTaps(ny(t,"minTaps",void 0))),this}},{key:"onDragStart",value:function(){switch(this.state){case oy:this.state=ay;break;case ay:var t=this.lastPointer;sy(t.upX,t.upY,t.x,t.y)>this.tapOffset&&(this.state=hy,this.state=ay);break;case hy:this.state=ay;}}},{key:"onDragEnd",value:function(){this.state===ay&&(this.tapsCount++,this.emit("tapping",this,this.gameObject,this.lastPointer),void 0!==this.maxTaps&&this.tapsCount===this.maxTaps&&(this.state=hy));}},{key:"onDrag",value:function(){this.state!==oy&&this.pointer.getDistance()>this.dragThreshold&&(this.state=oy);}},{key:"preUpdate",value:function(t,e){if(this.isRunning&&this.enable&&this.state===ay){var i=this.lastPointer;if(i.isDown)t-i.downTime>this.holdTime&&(this.state=oy);else t-i.upTime>this.tapInterval&&(void 0===this.minTaps||this.tapsCount>=this.minTaps?this.state=hy:this.state=oy);}}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===hy&&(this.state=oy);}},{key:"isTapped",get:function(){return this.state===hy}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setTapInterval",value:function(t){return this.tapInterval=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"setTapOffset",value:function(t){return this.tapOffset=t,this}},{key:"setMaxTaps",value:function(t){return this.maxTaps=t,this}},{key:"setMinTaps",value:function(t){return this.minTaps=t,this}},{key:"setTaps",value:function(t,e){return void 0===e&&(e=t),this.setMinTaps(t).setMaxTaps(e),this}}]),i}(Qg),oy="IDLE",ay="BEGIN",hy="RECOGNIZED",ly=Phaser.Utils.Objects.GetValue,uy=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=u(r=e.call(this,t,s)),a={states:{IDLE:{enter:function(){o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.start();},exit:function(){o.stop();}},RECOGNIZED:{enter:function(){o.emit("pressstart",o,o.gameObject,o.lastPointer);},exit:function(){o.emit("pressend",o,o.gameObject,o.lastPointer);}}},init:function(){this.state=cy;},eventEmitter:!1};return r.setRecongizedStateObject(new Wv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(ly(t,"threshold",9)),this.setHoldTime(ly(t,"time",251)),this}},{key:"onDragStart",value:function(){this.state=dy,0===this.holdTime&&(this.state=fy);}},{key:"onDragEnd",value:function(){this.state=cy;}},{key:"onDrag",value:function(){this.state!==cy&&this.pointer.getDistance()>this.dragThreshold&&(this.state=cy);}},{key:"preUpdate",value:function(t,e){this.isRunning&&this.enable&&(this.state===dy&&t-this.pointer.downTime>=this.holdTime&&(this.state=fy));}},{key:"isPressed",get:function(){return this.state===fy}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Qg),cy="IDLE",dy="BEGIN",fy="RECOGNIZED",py=Phaser.Utils.Objects.GetValue,vy=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=u(r=e.call(this,t,s)),a={states:{IDLE:{},BEGIN:{enter:function(){var t=o.pointer;o.startX=t.x,o.startY=t.y,o.startWorldX=t.worldX,o.startWorldY=t.worldY;}},RECOGNIZED:{enter:function(){o.emit("panstart",o,o.gameObject,o.lastPointer);},exit:function(){var t=o.lastPointer;o.endX=t.x,o.endY=t.y,o.endWorldX=t.worldX,o.endWorldY=t.worldY,o.emit("panend",o,o.gameObject,o.lastPointer);}}},init:function(){this.state=gy;},eventEmitter:!1};return r.setRecongizedStateObject(new Wv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(py(t,"threshold",10)),this}},{key:"onDragStart",value:function(){this.state=yy,0===this.dragThreshold&&(this.state=ky);}},{key:"onDragEnd",value:function(){this.state=gy;}},{key:"onDrag",value:function(){switch(this.state){case yy:this.pointer.getDistance()>=this.dragThreshold&&(this.state=ky);break;case ky:var t=this.pointer.position,e=this.pointer.prevPosition;this.dx=t.x-e.x,this.dy=t.y-e.y;var i=this.pointer;this.x=i.x,this.y=i.y,this.worldX=i.worldX,this.worldY=i.worldY,this.emit("pan",this,this.gameObject,this.lastPointer);}}},{key:"isPanned",get:function(){return this.state===ky}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Qg),gy="IDLE",yy="BEGIN",ky="RECOGNIZED",my=Phaser.Math.Distance.Between,by=Phaser.Math.Angle.Between,xy={getDt:function(){return nu(this.scene)},getVelocity:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return my(e.x,e.y,t.x,t.y)/(.001*this.getDt())},getVelocityX:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Math.abs(t.x-e.x)/(.001*this.getDt())},getVelocityY:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Math.abs(t.y-e.y)/(.001*this.getDt())},getVelocityAngle:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return by(e.x,e.y,t.x,t.y)}},Cy={"up&down":0,"left&right":1,"4dir":2,"8dir":3},wy={},Sy=Phaser.Utils.Objects.GetValue,Py=Phaser.Math.RadToDeg,Ty=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=u(r=e.call(this,t,s)),a={states:{IDLE:{enter:function(){o.x=0,o.y=0,o.worldX=0,o.worldY=0;},exit:function(){var t=o.lastPointer;o.x=t.x,o.y=t.y,o.worldX=t.worldX,o.worldY=t.worldY;}},BEGIN:{enter:function(){o.validDrag=!1;}},RECOGNIZED:{enter:function(){o.start(),o.updateDirectionStates(),o.emit("swipe",o,o.gameObject,o.lastPointer);},exit:function(){o.stop(),o.clearDirectionStates();}}},init:function(){this.state=Oy;},eventEmitter:!1};return r.setRecongizedStateObject(new Wv(a)),r.clearDirectionStates(),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Sy(t,"threshold",10)),this.setVelocityThreshold(Sy(t,"velocityThreshold",1e3)),this.setDirectionMode(Sy(t,"dir","8dir")),this}},{key:"onDragStart",value:function(){this.state=My;}},{key:"onDragEnd",value:function(){this.state=Oy;}},{key:"onDrag",value:function(){this.state===My&&(this.validDrag||(this.validDrag=0===this.dragThreshold||this.pointer.getDistance()>=this.dragThreshold),this.validDrag&&this.dragVelocity>this.velocityThreshold&&(this.state=Ey));}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===Ey&&(this.state=Oy);}},{key:"isSwiped",get:function(){return this.state===Ey}},{key:"dragVelocity",get:function(){var t;switch(this.dirMode){case 0:t=this.getVelocityY();break;case 1:t=this.getVelocityX();break;default:t=this.getVelocity();}return t}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"setVelocityThreshold",value:function(t){return this.velocityThreshold=t,this}},{key:"setDirectionMode",value:function(t){return "string"==typeof t&&(t=Cy[t]),this.dirMode=t,this}},{key:"updateDirectionStates",value:function(){return function(t,e,i){switch(void 0===i?i={}:!0===i&&(i=wy),i.left=!1,i.right=!1,i.up=!1,i.down=!1,t=(t+360)%360,e){case 0:t<180?i.down=!0:i.up=!0;break;case 1:t>90&&t<=270?i.left=!0:i.right=!0;break;case 2:t>45&&t<=135?i.down=!0:t>135&&t<=225?i.left=!0:t>225&&t<=315?i.up=!0:i.right=!0;break;case 3:t>22.5&&t<=67.5?(i.down=!0,i.right=!0):t>67.5&&t<=112.5?i.down=!0:t>112.5&&t<=157.5?(i.down=!0,i.left=!0):t>157.5&&t<=202.5?i.left=!0:t>202.5&&t<=247.5?(i.left=!0,i.up=!0):t>247.5&&t<=292.5?i.up=!0:t>292.5&&t<=337.5?(i.up=!0,i.right=!0):i.right=!0;}}(Py(this.getVelocityAngle()),this.dirMode,this),this}},{key:"clearDirectionStates",value:function(){return this.left=!1,this.right=!1,this.up=!1,this.down=!1,this}}]),i}(Qg);Object.assign(Ty.prototype,xy);var Oy="IDLE",My="BEGIN",Ey="RECOGNIZED",_y=Phaser.Utils.Objects.GetValue,Ry=Phaser.Utils.Array.SpliceOne,Ly=Phaser.Math.Distance.Between,By=Phaser.Math.Angle.Between,Dy=function(){function t(e,i){n(this,t);var s=e.input.manager.pointersTotal-1;s<2&&e.input.addPointer(2-s),this.scene=e,this.setEventEmitter(_y(i,"eventEmitter",void 0)),this._enable=void 0,this.pointers=[],this.movedState={},this.resetFromJSON(i),this.boot();}return r(t,[{key:"resetFromJSON",value:function(t){return this.setEnable(_y(t,"enable",!0)),this.bounds=_y(t,"bounds",void 0),this.tracerState=jy,this.pointers.length=0,xt(this.movedState),this}},{key:"boot",value:function(){this.scene.input.on("pointerdown",this.onPointerDown,this),this.scene.input.on("pointerup",this.onPointerUp,this),this.scene.input.on("gameout",this.dragCancel,this),this.scene.input.on("pointermove",this.onPointerMove,this),this.scene.sys.events.once("shutdown",this.destroy,this);}},{key:"shutdown",value:function(){this.scene&&(this.destroyEventEmitter(),this.pointers.length=0,xt(this.movedState),this.scene.input.off("pointerdown",this.onPointerDown,this),this.scene.input.off("pointerup",this.onPointerUp,this),this.scene.input.off("gameout",this.dragCancel,this),this.scene.input.off("pointermove",this.onPointerMove,this),this.scene.sys.events.off("shutdown",this.destroy,this),this.scene=void 0);}},{key:"destroy",value:function(){this.shutdown();}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t)return t||this.dragCancel(),this._enable=t,this}},{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:"onPointerDown",value:function(t){if(this.enable&&(2!==this.pointers.length&&(!this.bounds||this.bounds.contains(t.x,t.y))&&-1===this.pointers.indexOf(t)))switch(this.movedState[t.id]=!1,this.pointers.push(t),this.tracerState){case jy:this.tracerState=zy,this.onDrag1Start();break;case zy:this.tracerState=Ay,this.onDrag2Start();}}},{key:"onPointerUp",value:function(t){if(this.enable&&(!this.bounds||this.bounds.contains(t.x,t.y))){var e=this.pointers.indexOf(t);if(-1!==e)switch(delete this.movedState[t.id],Ry(this.pointers,e),this.tracerState){case zy:this.tracerState=jy,this.onDrag1End();break;case Ay:this.tracerState=zy,this.onDrag2End(),this.onDrag1Start();}}}},{key:"onPointerMove",value:function(t){if(this.enable&&t.isDown){var e=!this.bounds||this.bounds.contains(t.x,t.y),i=-1!==this.pointers.indexOf(t);if(!i&&e);else if(i&&!e)this.onPointerUp(t);else if(this.movedState[t.id]||(this.movedState[t.id]=t.x!==t.downX||t.y!==t.downY),this.movedState[t.id])switch(this.tracerState){case zy:this.onDrag1();break;case Ay:this.onDrag2();}}}},{key:"dragCancel",value:function(){return this.tracerState===Ay&&this.onDrag2End(),this.pointers.length=0,xt(this.movedState),this.tracerState=jy,this}},{key:"onDrag1Start",value:function(){this.emit("drag1start",this);}},{key:"onDrag1End",value:function(){this.emit("drag1end",this);}},{key:"onDrag1",value:function(){this.emit("drag1",this);}},{key:"onDrag2Start",value:function(){this.emit("drag2start",this);}},{key:"onDrag2End",value:function(){this.emit("drag2end",this);}},{key:"onDrag2",value:function(){this.emit("drag2",this);}},{key:"distanceBetween",get:function(){if(this.tracerState!==Ay)return 0;var t=this.pointers[0],e=this.pointers[1];return Ly(t.x,t.y,e.x,e.y)}},{key:"angleBetween",get:function(){if(this.tracerState!==Ay)return 0;var t=this.pointers[0],e=this.pointers[1];return By(t.x,t.y,e.x,e.y)}},{key:"drag1Vector",get:function(){var t=this.pointers[0];if(t&&this.movedState[t.id]){var e=t.position,i=t.prevPosition;Iy.x=e.x-i.x,Iy.y=e.y-i.y;}else Iy.x=0,Iy.y=0;return Iy}},{key:"centerX",get:function(){if(this.tracerState!==Ay)return 0;var t=this.pointers[0].position,e=this.pointers[1].position;return (t.x+e.x)/2}},{key:"centerY",get:function(){if(this.tracerState!==Ay)return 0;var t=this.pointers[0].position,e=this.pointers[1].position;return (t.y+e.y)/2}},{key:"prevCenterX",get:function(){if(this.tracerState!==Ay)return 0;var t=this.movedState[this.pointers[0].id]?this.pointers[0].prevPosition:this.pointers[0].position,e=this.movedState[this.pointers[1].id]?this.pointers[1].prevPosition:this.pointers[1].position;return (t.x+e.x)/2}},{key:"prevCenterY",get:function(){if(this.tracerState!==Ay)return 0;var t=this.movedState[this.pointers[0].id]?this.pointers[0].prevPosition:this.pointers[0].position,e=this.movedState[this.pointers[1].id]?this.pointers[1].prevPosition:this.pointers[1].position;return (t.y+e.y)/2}},{key:"movementCenterX",get:function(){return this.centerX-this.prevCenterX}},{key:"movementCenterY",get:function(){return this.centerY-this.prevCenterY}},{key:"setRecongizedStateObject",value:function(t){return this.recongizedState=t,this}},{key:"state",get:function(){return this.recongizedState.state},set:function(t){this.recongizedState.state=t;}},{key:"cancel",value:function(){return this.state=Fy,this}}]),t}();Object.assign(Dy.prototype,sr);var Iy={},jy=0,zy=1,Ay=2,Fy="IDLE",Wy=Phaser.Utils.Objects.GetValue,Yy=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=u(r=e.call(this,t,s)),a={states:{IDLE:{enter:function(){o.prevDistance=void 0,o.scaleFactor=1;}},BEGIN:{},RECOGNIZED:{enter:function(){o.emit("pinchstart",o);},exit:function(){o.emit("pinchend",o);}}},init:function(){this.state=Vy;},eventEmitter:!1};return r.setRecongizedStateObject(new Wv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Wy(t,"threshold",0)),this}},{key:"onDrag2Start",value:function(){this.scaleFactor=1,this.prevDistance=this.distanceBetween,this.state=Xy,0===this.dragThreshold&&(this.state=Gy);}},{key:"onDrag2End",value:function(){this.state=Vy;}},{key:"onDrag2",value:function(){switch(this.state){case Xy:if(this.pointers[0].getDistance()>=this.dragThreshold&&this.pointers[1].getDistance()>=this.dragThreshold){var t=this.distanceBetween;this.scaleFactor=t/this.prevDistance,this.prevDistance=t,this.state=Gy;}break;case Gy:t=this.distanceBetween;this.scaleFactor=t/this.prevDistance,this.emit("pinch",this),this.prevDistance=t;}}},{key:"isPinched",get:function(){return this.state===Gy}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Dy),Vy="IDLE",Xy="BEGIN",Gy="RECOGNIZED",Uy=Phaser.Math.RotateAround,Hy=function(t,e,i,n){return Uy(t,e,i,n),t.rotation+=n,t},Ny={},Ky=Phaser.Utils.Objects.GetValue,Jy=Phaser.Math.Angle.WrapDegrees,Zy=Phaser.Math.Angle.ShortestBetween,qy=Phaser.Math.RadToDeg,$y=Phaser.Math.DegToRad,Qy=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=u(r=e.call(this,t,s)),a={states:{IDLE:{enter:function(){o.prevAngle=void 0,o.angle=0;}},BEGIN:{},RECOGNIZED:{enter:function(){o.emit("rotatestart",o);},exit:function(){o.emit("rotateend",o);}}},init:function(){this.state=ek;},eventEmitter:!1};return r.setRecongizedStateObject(new Wv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Ky(t,"threshold",0)),this}},{key:"onDrag2Start",value:function(){this.prevAngle=Jy(qy(this.angleBetween)),this.state=ik,0===this.dragThreshold&&(this.state=nk);}},{key:"onDrag2End",value:function(){this.state=ek;}},{key:"onDrag2",value:function(){switch(this.state){case ik:if(this.pointers[0].getDistance()>=this.dragThreshold&&this.pointers[1].getDistance()>=this.dragThreshold){var t=Jy(qy(this.angleBetween));this.angle=Zy(this.prevAngle,t),this.prevAngle=t,this.state=nk;}break;case nk:t=Jy(qy(this.angleBetween));this.angle=Zy(this.prevAngle,t),this.prevAngle=t,this.emit("rotate",this);}}},{key:"isRotated",get:function(){return this.state===nk}},{key:"rotation",get:function(){return $y(this.angle)}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Dy),tk={spinObject:function(t,e){if(!this.isRotation)return this;void 0===e&&(e=this.pointers[0].camera);var i=this.movementCenterX,n=this.movementCenterY,s=function(t,e,i,n){return void 0===n?n={}:!0===n&&(n=Ny),i.getWorldPoint(t,e,n),n}(this.centerX,this.centerY,e,!0),r=s.x,o=s.y,a=this.rotation;if(Array.isArray(t))for(var h=t,l=0,u=h.length;l0?u.pop().setTexture(d,M):s(c,d,M),h&&c.add.existing(O),l){var E=b+w*T+o*w,_=x+S*P+a*S;O.setOrigin(o,a).setPosition(E,_).setScale(g,y).setRotation(k),Mm(O,b,x,k);}C.push(O);}return C}(t,e,i,n),o=0,a=r.length;o=0;n--)(o=s[n])instanceof e&&(o.destroy(),Hm(s,n));else {n=0;for(var s,r=(s=t.postPipelines).length;nn&&(i.width=i.height*n),i}(t,{width:this.width,height:this.height},!0);return t.setDisplaySize(e.width,e.height),this.resetChildScaleState(t),this}},{key:"resize",value:function(t,e){return p(h(i.prototype),"resize",this).call(this,t,e),this.scaleImage(),this}},{key:"setTexture",value:function(t,e){var i=this.image;return i.setTexture(t,e),null!==t?(this.setChildVisible(i,!0),this.scaleImage()):this.setChildVisible(i,!1),this}}]),i}(zf);Object.assign(Qm.prototype,_m),T.register("imageBox",(function(t,e,i,n,s){var r=new Qm(this.scene,t,e,i,n,s);return this.scene.add.existing(r),r})),Z(window,"RexPlugins.UI.ImageBox",Qm),T.register("fullWindowRectangle",(function(t,e){var i=new Jv(this.scene,t,e);return this.scene.add.existing(i),i})),Z(window,"RexPlugins.UI.FullWindowRectangle",Jv),T.register("cover",(function(t){var e=new tg(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Cover",tg);var tb=function(t,e){if(this.scene.sys.scale.autoRound&&(t=Math.floor(t),e=Math.floor(e)),this.width===t&&this.height===e)return this;var i=this.node.style;return i.width="".concat(t,"px"),i.height="".concat(e,"px"),this.updateSize(),this},eb={id:["id",void 0],text:["value",void 0],maxLength:["maxLength",void 0],minLength:["minLength",void 0],placeholder:["placeholder",void 0],tooltip:["title",void 0],readOnly:["readOnly",!1],spellCheck:["spellcheck",!1],autoComplete:["autocomplete","off"]},ib={align:["textAlign",void 0],paddingLeft:["padding-left",void 0],paddingRight:["padding-right",void 0],paddingTop:["padding-top",void 0],paddingBottom:["padding-bottom",void 0],fontFamily:["fontFamily",void 0],fontSize:["font-size",void 0],color:["color","#ffffff"],backgroundColor:["backgroundColor","transparent"],border:["border",0],borderColor:["borderColor","transparent"],outline:["outline","none"],direction:["direction",void 0]},nb={input:"textchange",click:"click",dblclick:"dblclick",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",keydown:"keydown",keyup:"keyup",keypress:"keypress",compositionstart:"compositionStart",compositionend:"compositionEnd",compositionupdate:"compositionUpdate",focus:"focus",blur:"blur",select:"select"},sb=Phaser.Utils.Objects.GetValue,rb=function(t,e,i,n){var s=sb(n,"preventDefault",!1),r=sb(n,"preTest"),o=function(n){e.addEventListener(n,(function(e){r&&!r(t,n)||t.emit(i[n],t,e),s&&e.preventDefault();}));};for(var a in i)o(a);},ob=Phaser.GameObjects.DOMElement,ab=Phaser.Utils.Objects.IsPlainObject,hb=Phaser.Utils.Objects.GetValue,lb=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l,c;n(this,i),ab(s)?(s=hb(h=s,"x",0),r=hb(h,"y",0),o=hb(h,"width",0),a=hb(h,"height",0)):ab(o)&&(o=hb(h=o,"width",0),a=hb(h,"height",0)),void 0===h&&(h={});var d=hb(h,"inputType",void 0);void 0===d&&(d=hb(h,"type","text")),"textarea"===d?(c=document.createElement("textarea")).style.resize="none":(c=document.createElement("input")).type=d,bl(eb,h,c);var f=hb(h,"style",void 0);f=bl(ib,h,f);var p=c.style;for(var v in h)v in eb||v in ib||v in p&&(f[v]=h[v]);return f["box-sizing"]="border-box",(l=e.call(this,t,s,r,c,f)).type="rexInputText",l.resize(o,a),rb(u(l),c,nb),xl(c),hb(h,"selectAll",!1)&&l.selectAll(),l._isFocused=!1,l.on("focus",(function(){this._isFocused=!0;}),u(l)).on("blur",(function(){this._isFocused=!1;}),u(l)),l}return r(i,[{key:"inputType",get:function(){return "textarea"===this.node.tagName.toLowerCase()?"textarea":this.node.type}},{key:"text",get:function(){return this.node.value},set:function(t){this.node.value=t;}},{key:"setText",value:function(t){return this.text=t,this}},{key:"maxLength",get:function(){return this.node.maxLength},set:function(t){this.node.maxLength=t;}},{key:"setMaxLength",value:function(t){return this.maxLength=t,this}},{key:"minLength",get:function(){return this.node.minLength},set:function(t){this.node.minLength=t;}},{key:"setMinLength",value:function(t){return this.minLength=t,this}},{key:"placeholder",get:function(){return this.node.placeholder},set:function(t){this.node.placeholder=t;}},{key:"setPlaceholder",value:function(t){return this.placeholder=t,this}},{key:"selectText",value:function(t,e){return void 0===t?this.node.select():this.node.setSelectionRange(t,e),this}},{key:"selectAll",value:function(){return this.selectText(),this}},{key:"selectionStart",get:function(){return this.node.selectionStart}},{key:"selectionEnd",get:function(){return this.node.selectionEnd}},{key:"selectedText",get:function(){var t=this.node;return t.value.substring(t.selectionStart,t.selectionEnd)}},{key:"cursorPosition",get:function(){return this.node.selectionStart},set:function(t){this.node.setSelectionRange(t,t);}},{key:"setCursorPosition",value:function(t){return void 0===t?t=this.text.length:t<0&&(t=this.text.length+t),this.cursorPosition=t,this}},{key:"tooltip",get:function(){return this.node.title},set:function(t){this.node.title=t;}},{key:"setTooltip",value:function(t){return this.tooltip=t,this}},{key:"setTextChangedCallback",value:function(t){return this.onTextChanged=t,this}},{key:"readOnly",get:function(){return this.node.readOnly},set:function(t){this.node.readOnly=t;}},{key:"setReadOnly",value:function(t){return void 0===t&&(t=!0),this.readOnly=t,this}},{key:"spellCheck",get:function(){return this.node.spellcheck},set:function(t){this.node.spellcheck=t;}},{key:"setSpellCheck",value:function(t){return this.spellCheck=t,this}},{key:"fontColor",get:function(){return this.node.style.color},set:function(t){this.node.style.color=t;}},{key:"setFontColor",value:function(t){return this.fontColor=t,this}},{key:"setStyle",value:function(t,e){return this.node.style[t]=e,this}},{key:"getStyle",value:function(t){return this.node.style[t]}},{key:"scrollToBottom",value:function(){return this.node.scrollTop=this.node.scrollHeight,this}},{key:"setEnabled",value:function(t){return void 0===t&&(t=!0),this.node.disabled=!t,this}},{key:"setBlur",value:function(){return this.node.blur(),this}},{key:"setFocus",value:function(){return this.node.focus(),this}},{key:"isFocused",get:function(){return this._isFocused}}]),i}(ob),ub={resize:tb};Object.assign(lb.prototype,ub),T.register("inputText",(function(t){var e=new lb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.InputText",lb);var cb=Phaser.Utils.Objects.GetValue,db=function(t,e){return void 0===t&&(t=0),new Promise((function(i,n){setTimeout((function(){i(e);}),t);}))},fb=function(t){var e=t.game,i=t.fileInput,n=t.closeDelay;return Sh(X(e).events,"focus").then((function(){return db(n)})).then((function(){var t={files:i.files};return Promise.resolve(t)}))},pb=Phaser.Utils.Objects.GetValue,vb=function(t){return this.setOrigin(t.originX,t.originY),this.setPosition(t.x,t.y),this.resize(t.displayWidth,t.displayHeight),this},gb=function(t,e,i,n,s,r){if(null===s||!1===s);else if(fg(s))s();else {var o=function(t,e,i){if(void 0===i)switch(e){case"image":case"svg":i="textures";break;case"animation":i="json";break;case"tilemapTiledJSON":case"tilemapCSV":i="tilemap";break;case"glsl":i="shader";break;default:i=e;}return t=X(t),"textures"===i?t.textures:t.cache[i]}(t,i,s);o.exists(n)&&o.remove(n);}var a=t.load;if(r&&a.once("filecomplete-".concat(i,"-").concat(n),(function(t,e,i){r(i);})),fg(e))e();else {var h=window.URL.createObjectURL(e);a[i](n,h);}a.start();},yb={loadFile:function(t,e,i,n,s){var r=this.scene;return gb(r,t,e,i,n,s),this},loadFilePromise:function(t,e,i,n){var s=this.scene;return new Promise((function(r,o){gb(s,t,e,i,n,(function(t){r(t);}));}))}},kb=Phaser.GameObjects.DOMElement,mb=Phaser.Utils.Objects.IsPlainObject,bb=Phaser.Utils.Objects.GetValue,xb=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),mb(s)?(s=bb(h=s,"x",0),r=bb(h,"y",0),o=bb(h,"width",0),a=bb(h,"height",0)):mb(o)&&(o=bb(h=o,"width",0),a=bb(h,"height",0));var c=document.createElement("input");c.type="file",c.style.display="none";var d=document.createElement("label");d.appendChild(c);var f=bb(h,"style",void 0);(l=e.call(this,t,s,r,d,f)).type="rexFileChooser",l.resetFromJSON(h),l.resize(o,a);var p=u(l);return c.onchange=function(){p.emit("change",p);},l.setCloseDelay(bb(h,"closeDelay",200)),c.onclick=function(){fb({game:t,fileInput:c,closeDelay:p.closeDelay}).then((function(){p.emit("select",p);}));},l}return r(i,[{key:"resetFromJSON",value:function(t){return this.setAccept(bb(t,"accept","")),this.setMultiple(bb(t,"multiple",!1)),this}},{key:"setAccept",value:function(t){return void 0===t&&(t=""),this.fileInput.setAttribute("accept",t),this}},{key:"setMultiple",value:function(t){return void 0===t&&(t=!0),t?this.fileInput.setAttribute("multiple",""):this.fileInput.removeAttribute("multiple"),this}},{key:"setCloseDelay",value:function(t){return void 0===t&&(t=200),this.closeDelay=t,this}},{key:"fileInput",get:function(){return this.node.children[0]}},{key:"open",value:function(){return this.fileInput.click(),this}},{key:"files",get:function(){return this.fileInput.files}}]),i}(kb),Cb={resize:tb,syncTo:vb};Object.assign(xb.prototype,Cb,yb),T.register("fileChooser",(function(t){var e=new xb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.FileChooser",xb);var wb={setDropEnable:function(t){return void 0===t&&(t=!0),this.dropEnable=t,this},toggleDropEnable:function(){return this.dropEnable=!this.dropEnable,this}},Sb={resize:tb,syncTo:vb};Object.assign(Sb,wb,{addFilter:function(t,e){return this.filters||(this.filters={}),this.filters[t]=e,this},addFilters:function(t){for(var e in this.filters||(this.filters={}),t)this.filters[e]=t[e];return this}},yb);var Pb={dragenter:"dragenter",dragleave:"dragleave",dragover:"dragover",drop:"drop"},Tb=Phaser.GameObjects.DOMElement,Ob=Phaser.Utils.Objects.IsPlainObject,Mb=Phaser.Utils.Objects.GetValue,Eb=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),Ob(s)?(s=Mb(h=s,"x",0),r=Mb(h,"y",0),o=Mb(h,"width",0),a=Mb(h,"height",0)):Ob(o)&&(o=Mb(h=o,"width",0),a=Mb(h,"height",0)),void 0===h&&(h={});var c=document.createElement("div"),d=Mb(h,"style",void 0);(l=e.call(this,t,s,r,c,d)).type="rexFileDropZone",l.resize(o,a),l._files=[],l.setDropEnable(Mb(h,"dropEnable",!0));var f=Mb(h,"filters");return f&&l.addFilters(f),rb(u(l),c,Pb,{preventDefault:!0,preTest:function(t){return t.dropEnable}}),l.on("drop",(function(t,e){this._files=e.dataTransfer.files;var i=this._files;if(i&&this.filters)for(var n in this.filters){for(var s=this.filters[n],r=[],o=0,a=i.length;o0&&this.emit("drop.".concat(n),r);}}),u(l)),l}return r(i,[{key:"files",get:function(){return this._files}}]),i}(Tb);Object.assign(Eb.prototype,Sb),T.register("fileDropZone",(function(t){var e=new Eb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.FileDropZone",Eb);var _b=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),c(r=e.call(this,t),new Proxy(u(r),u(r)))}return r(i,[{key:"get",value:function(t,e){if(lr(t,e))return t[e];var i=t.parent;return lr(i,e)?i[e]:void 0}},{key:"set",value:function(t,e,i){return lr(t,e)?t[e]=i:lr(t.parent,e)&&(t.parent[e]=i),!0}},{key:"key",get:function(){return this.parent.texture.key},set:function(t){this.parent.setTexture(t,this.frame);}},{key:"frame",get:function(){return this.parent.frame.name},set:function(t){this.parent.setFrame(t);}},{key:"scale",get:function(){return this.parent.scaleX},set:function(t){this.parent.setScale(t);}}]),i}(oo),Rb=Phaser.Utils.Objects.GetValue,Lb=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),(r=e.call(this,t,s)).style=Rb(s,"style",u(r));var o=Rb(s,"propertiesMap");return r.activeStyle=Bb(s,"active",o),r.hoverStyle=Bb(s,"hover",o),r.disableStyle=Bb(s,"disable",o),r.onModifyStyle=Rb(s,"onModifyStyle"),r}return r(i,[{key:"getStyle",value:function(t){return zl(this.style,t)}},{key:"modifyStyle",value:function(t){for(var e in t)this.style[e]=t[e];return this.onModifyStyle&&this.onModifyStyle(this.parent,t),this}},{key:"applyStyle",value:function(t){if(t){var e=this.getStyle(t);return Al(e,t)?void 0:(this.modifyStyle(t),e)}}},{key:"setActiveState",value:function(t){return Db.call(this,"active",t),this}},{key:"setHoverState",value:function(t){return Db.call(this,"hover",t),this}},{key:"setDisableState",value:function(t){return Db.call(this,"disable",t),this}}]),i}(oo),Bb=function(t,e,i){var n=jl(t,e);if(i)for(var s in n)i.hasOwnProperty(s)&&(n[i[s]]=n[s],delete n[s]);return n},Db=function(t,e){void 0===e&&(e=!0);var i="".concat(t,"State"),n="".concat(t,"Style"),s="".concat(t,"StyleSave");this[i]!==e&&(this[i]=e,e?this[s]=this.applyStyle(this[n]):(this.applyStyle(this[s]),this[s]=void 0));},Ib={addStyleManager:function(t){return this.styleManager=new Lb(this,t),this},setActiveState:function(t){return this.styleManager.setActiveState(t),this},setHoverState:function(t){return this.styleManager.setHoverState(t),this},setDisableState:function(t){return this.styleManager.setDisableState(t),this}},jb=Phaser.GameObjects.Image,zb=Phaser.Utils.Objects.GetValue,Ab=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=zb(s,"x",0),a=zb(s,"y",0),h=zb(s,"key",""),l=zb(s,"frame",void 0);(r=e.call(this,t,o,a,h,l)).type="rexStatesImage";var c=zb(s,"effects",!0);return c&&pr(u(r),c),r.style=new _b(u(r),s),s.style=r.style,r.addStyleManager(s),delete s.style,r}return r(i)}(jb);Object.assign(Ab.prototype,Ib),T.register("statesImage",(function(t){var e=new Ab(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.StatesImage",Ab);var Fb=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),void 0===s&&(s={}),(r=e.call(this,t,s)).type="rexStatesRoundRectangleShape",s.style=u(r),s.propertiesMap=Wb,r.addStyleManager(s),delete s.style,delete s.propertiesMap,r}return r(i)}(se),Wb={color:"fillColor",alpha:"fillAlpha",strokeWidth:"lineWidth"};Object.assign(Fb.prototype,Ib),T.register("statesRoundRectangle",(function(t){var e=new Fb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.StatesRoundRectangle",Fb);var Yb=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),c(r=e.call(this,t),new Proxy(u(r),u(r)))}return r(i,[{key:"get",value:function(t,e){if(lr(t,e))return t[e];var i=t.parent;return lr(i,e)?i[e]:void 0}},{key:"set",value:function(t,e,i){return lr(t,e)?t[e]=i:lr(t.parent,e)&&(t.parent[e]=i),!0}},{key:"key",get:function(){return this.parent.texture.key},set:function(t){this.parent.setTexture(t,this.frame);}},{key:"frame",get:function(){return this.parent.frame.name},set:function(t){this.parent.setFrame(t);}},{key:"leftWidth",get:function(){return this.parent.leftWidth},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,t,e.rightWidth,e.topHeight,e.bottomHeight);}},{key:"rightWidth",get:function(){return this.parent.rightWidth},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,t,e.topHeight,e.bottomHeight);}},{key:"topHeight",get:function(){return this.parent.topHeight},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,e.rightWidth,t,e.bottomHeight);}},{key:"bottomHeight",get:function(){return this.parent.bottomHeight},set:function(t){var e=this.parent;parent.setSlices(e.width,e.height,e.leftWidth,e.rightWidth,e.topHeight,t);}}]),i}(oo),Vb=Phaser.GameObjects.NineSlice,Xb=Phaser.Utils.Objects.GetValue,Gb=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=Xb(s,"x",0),a=Xb(s,"y",0),h=Xb(s,"key",null),l=Xb(s,"frame",null),c=Xb(s,"width",0),d=Xb(s,"height",0),f=Xb(s,"leftWidth",0),p=Xb(s,"rightWidth",0),v=Xb(s,"topHeight",0),g=Xb(s,"bottomHeight",0);(r=e.call(this,t,o,a,h,l,c,d,f,p,v,g)).type="rexStatesNineSlice";var y=Xb(s,"effects",!0);return y&&pr(u(r),y),r.style=new Yb(u(r),s),s.style=r.style,r.addStyleManager(s),delete s.style,r}return r(i)}(Vb);Object.assign(Gb.prototype,Ib),T.register("statesNineSlice",(function(t){var e=new Gb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.StatesNineSlice",Gb);var Ub=Phaser.GameObjects.Text,Hb=Phaser.Utils.Objects.GetValue,Nb=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=Hb(s,"x",0),a=Hb(s,"y",0),h=Hb(s,"text","");return (r=e.call(this,t,o,a,h,s)).type="rexStatesText",s.style=r.style,s.onModifyStyle=function(t,e){var i=e.hasOwnProperty("fontStyle")||e.hasOwnProperty("fontSize")||e.hasOwnProperty("fontFamily");t.style.update(i);},r.addStyleManager(s),delete s.style,r}return r(i)}(Ub);Object.assign(Nb.prototype,Ib),T.register("statesText",(function(t){var e=new Nb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.StatesText",Nb);var Kb=function(t,e){void 0===e&&(e={}),void 0===e.options&&(e.options={});var i=e.options;i.responsive=!1,i.maintainAspectRatio=!1,i.hasOwnProperty("devicePixelRatio")||(i.devicePixelRatio=1);var n=!1;void 0===i.animation?i.animation={}:!1===i.animation&&(n=!0,i.animation={});var s=i.animation;n&&(s.duration=0);var r=s.onProgress;s.onProgress=function(e){r&&r(e),t.needRedraw();};var o=s.onComplete;return s.onComplete=function(e){o&&o(e),t.needRedraw();},e},Jb=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;return n(this,i),(l=e.call(this,t,s,r,o,a)).type="rexChart",l.chart=void 0,void 0!==h&&l.setChart(h),l}return r(i,[{key:"destroy",value:function(t){this.scene&&(this.chart&&(this.chart.destroy(),this.chart=void 0),p(h(i.prototype),"destroy",this).call(this,t));}},{key:"resize",value:function(t,e){if(t===this.width&&e===this.height)return this;if(p(h(i.prototype),"resize",this).call(this,t,e),this.chart){var n=this.chart;n.height=this.canvas.height,n.width=this.canvas.width,n.aspectRatio=n.height?n.width/n.height:null,n.update();}return this}}]),i}(Mc),Zb={setChart:function(t){if(!window.Chart){return console.error("Can not find chartjs! Load chartjs in preload stage.\nscene.load.script('chartjs', 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.8.0/Chart.min.js');"),this}return this.chart&&this.chart.destroy(),this.chart=new Chart(this.context,Kb(this,t)),this},getChartDataset:function(t){if(void 0!==this.chart){if("string"!=typeof t)return this.chart.data.datasets[t];for(var e,i=this.chart.data.datasets,n=0,s=i.length;n(h=0===this.orientation?Math.abs(a.left-t):Math.abs(a.top-e))&&(s=h,n=r);}var h;a=i[i.length-1];return s>(h=0===this.orientation?Math.abs(a.right-t):Math.abs(a.bottom-e))&&(s=h,n=r+1),n},tx=Phaser.Utils.Objects.IsPlainObject,ex=Phaser.Utils.Objects.GetValue,ix=Phaser.Display.Align.CENTER,nx={min:0,full:-1},sx=function(t,e,n,s,r,o,a,h,l,u){kp.call(this,t);var c=t.isRexSpace,d=i(e);if(null===e)return this;if("number"===d);else if("string"===d)e=nx[e];else if(tx(e)){var f;e=ex(f=e,"proportion",void 0),n=ex(f,"align",ix),s=ex(f,"padding",0),r=ex(f,"expand",!1),o=ex(f,"key",void 0),a=ex(f,"index",void 0),t.isRexSizer||(h=ex(f,"minWidth",void 0),l=ex(f,"minHeight",void 0)),u=ex(f,"fitRatio",0);}return "string"==typeof n&&(n=Wf[n]),void 0===e&&(e=c?1:0),void 0===n&&(n=ix),void 0===s&&(s=0),void 0===r&&(r=!1),void 0===h&&(c?h=0:t.isRexSizer||(h=t._minWidth)),void 0===l&&(c?l=0:t.isRexSizer||(l=t._minHeight)),void 0===u&&(u=0),(f=this.getSizerConfig(t)).proportion=e,f.align=n,f.padding=gp(s),f.expand=r,f.fitRatio=0===e?u:0,void 0===a||a>=this.sizerChildren.length?this.sizerChildren.push(t):this.sizerChildren.splice(a,0,t),t.isRexSizer||(e>0&&(0===this.orientation?t.minWidth=void 0===h?_r(t):h:t.minHeight=void 0===l?Rr(t):l),r&&(0===this.orientation?t.minHeight=l:t.minWidth=h)),void 0!==o&&this.addChildrenMap(o,t),this},rx={add:sx,addSpace:function(t){return this.insertSpace(void 0,t),this},insertSpace:function(t,e){return void 0===e&&(e=1),sx.call(this,new $b(this.scene),{proportion:e,minWidth:0,minHeight:0,index:t}),this},insert:function(t,e,i,n,s,r,o,a){return tx(i)&&(i.index=t),sx.call(this,e,i,n,s,r,o,t,a),this},insertAtPosition:function(t,e,i,n,s,r,o,a,h){var l=Qb.call(this,t,e);return -1===l&&(l=void 0),this.insert(l,i,n,s,r,o,a,h),this}},ox=Phaser.Utils.Array.Remove,ax={remove:function(t,e){return this.getParentSizer(t)!==this||(ox(this.sizerChildren,t),Pp.call(this,t,e)),this},removeAll:function(t){for(var e=this.sizerChildren.length-1;e>=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,Ck.call(this,t),this}},hx={getChildAlign:function(t){return this.getSizerConfig(t).align},setChildAlign:function(t,e){return "string"==typeof e&&(e=Wf[e]),this.getSizerConfig(t).align=e,this}},lx={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);var e,i,n,s=0,r=this.sizerChildren;if(0===this.orientation)for(var o=this.space.item,a=!0,h=0,l=r.length;h0&&this.proportionLength>0&&(i=n.proportion*this.proportionLength):n.expand&&(i=e-this.space.left-this.space.right-s.left-s.right);return i},getExpandedChildHeight:function(t,e){var i;void 0===e&&(e=this.height);var n=t.rexSizer,s=n.padding;0===this.orientation?n.expand&&(i=e-this.space.top-this.space.bottom-s.top-s.bottom):n.proportion>0&&this.proportionLength>0&&(i=n.proportion*this.proportionLength);return i},getChildrenSizers:function(t){void 0===t&&(t=[]);for(var e,i=this.sizerChildren,n=0,s=i.length;n0?(e=t-this.getChildrenWidth(!1),this.proportionLength=e/this.childrenProportion):this.proportionLength=0;}return t},resolveHeight:function(t){t=Bp.call(this,t);if(void 0===this.proportionLength&&1===this.orientation){var e=t-this.childrenHeight;e>0?(e=t-this.getChildrenHeight(!1),this.proportionLength=e/this.childrenProportion):this.proportionLength=0;}return t}};Object.assign(lx,rx,ax,hx,{getChildProportion:function(t){return this.getSizerConfig(t).proportion},setChildProportion:function(t,e){return this.getSizerConfig(t).proportion=e,this}},{getChildExpand:function(t){return this.getSizerConfig(t).expand},setChildExpand:function(t,e){return this.getSizerConfig(t).expand=e,this}});var ux=function(){for(var t,e,i=0,n=this.sizerChildren,s=0,r=n.length;s0&&(i+=e);return i},cx={x:0,h:0,horizontal:0,"left-to-right":0,y:1,v:1,vertical:1,"top-to-bottom":1},dx=function(t){return "string"==typeof t&&(t=cx[t]),t},fx=Phaser.Utils.Objects.IsPlainObject,px=Phaser.Utils.Objects.GetValue,vx=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;return n(this,i),fx(s)?(s=px(l=s,"x",0),r=px(l,"y",0),o=px(l,"width",void 0),a=px(l,"height",void 0),h=px(l,"orientation",0)):fx(o)?(o=px(l=o,"width",void 0),a=px(l,"height",void 0),h=px(l,"orientation",0)):fx(h)&&(h=px(l=h,"orientation",0)),void 0===h&&(h=0),(u=e.call(this,t,s,r,o,a,l)).type="rexSizer",u.sizerChildren=[],u.setOrientation(h),u.setItemSpacing(px(l,"space.item",0)),u.setStartChildIndex(px(l,"startChildIndex",0)),u.setRTL(px(l,"rtl",!1)),u.addChildrenMap("items",u.sizerChildren),u}return r(i,[{key:"setOrientation",value:function(t){return this.orientation=dx(t),this}},{key:"setItemSpacing",value:function(t){return this.space.item=t,this}},{key:"setStartChildIndex",value:function(t){return this.startChildIndex=t,this}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},{key:"childrenProportion",get:function(){return void 0===this._childrenProportion&&(this._childrenProportion=ux.call(this)),this._childrenProportion}}]),i}(pk);Object.assign(vx.prototype,lx),T.register("sizer",(function(t,e,i,n,s,r){var o=new vx(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.Sizer",vx);var gx=function(){return Array.prototype.reduce.call(arguments,yx,0)},yx=function(t,e){return t+e},kx=Phaser.Utils.Objects.IsPlainObject,mx=Phaser.Utils.Objects.GetValue,bx=Phaser.Display.Align.CENTER,xx=function(t,e,i,n,s){if("number"==typeof t||"number"==typeof e)if(void 0===t){for(var r=0;r=0;e--){var i=this.sizerChildren[e];i&&this.remove(i,t);}return this},clear:function(t){return wx(this.sizerChildren,null),Ck.call(this,t),this}},Px={setColumnSpace:function(t){if(this.space.column||(this.space.column=[]),this.space.column.length=this.columnCount-1,"number"==typeof t)wx(this.space.column,t);else for(var e=0,i=this.columnCount-1;e=0;n--){var s=n*this.columnCount+t;this.sizerChildren.splice(s,0,null);}return this.columnProportions.push(e),this.columnWidth.length+=1,this.space.column.splice(t,0,i),this},Ex={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);for(var e,i,n,s,r=0,o=this.sizerChildren,a=0;a0){var i=t-this.getChildrenWidth(!1);i>=0&&(this.proportionWidthLength=i/e);}else this.proportionWidthLength=0;}return t},resolveHeight:function(t){t=Bp.call(this,t);if(void 0===this.proportionHeightLength){var e=this.totalRowProportions;if(e>0){var i=t-this.getChildrenHeight(!1);i>=0&&(this.proportionHeightLength=i/e);}else this.proportionHeightLength=0;}return t},resolveChildrenWidth:function(t){var e,i,n;for(var s in this.sizerChildren)(e=this.sizerChildren[s])&&e.isRexSizer&&!e.ignoreLayout&&(n=this.getColumnWidth(parseInt(s)%this.columnCount),i=this.getExpandedChildWidth(e,n),i=e.resolveWidth(i),e.resolveChildrenWidth(i));},runWidthWrap:function(t){var e,i,n;for(var s in this.sizerChildren)!(e=this.sizerChildren[s])||e.isRexSizer&&e.ignoreLayout||!e.runWidthWrap||(n=this.getColumnWidth(parseInt(s)%this.columnCount),i=this.getExpandedChildWidth(e,n),e.isRexSizer&&(i=e.resolveWidth(i)),e.runWidthWrap(i));return this},resetGrid:function(t,e,i,n,s){if(void 0===i&&(i=0),void 0===n&&(n=0),this.columnCount=t,this.rowCount=e,this.gridCount=t*e,this.removeAll(),this.sizerChildren.length=t*e,wx(this.sizerChildren,null),this.columnProportions=[],this.columnProportions.length=t,"number"==typeof i)wx(this.columnProportions,i);else for(var r=0;r0&&(e+=t);return e},Rx=function(){for(var t,e=0,i=0;i0&&(e+=t);return e},Lx=Phaser.Utils.Objects.IsPlainObject,Bx=Phaser.Utils.Objects.GetValue,Dx=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l,u,c,d){var f;return n(this,i),Lx(s)?(s=Bx(d=s,"x",0),r=Bx(d,"y",0),o=Bx(d,"width",void 0),a=Bx(d,"height",void 0),h=Bx(d,"column",d.col||0),l=Bx(d,"row",0),u=Bx(d,"columnProportions",0),c=Bx(d,"rowProportions",0)):Lx(o)?(o=Bx(d=o,"width",void 0),a=Bx(d,"height",void 0),h=Bx(d,"column",d.col||0),l=Bx(d,"row",0),u=Bx(d,"columnProportions",0),c=Bx(d,"rowProportions",0)):Lx(h)?(h=Bx(d=h,"column",d.col||0),l=Bx(d,"row",0),u=Bx(d,"columnProportions",0),c=Bx(d,"rowProportions",0)):Lx(u)&&(u=Bx(d=u,"columnProportions",0),c=Bx(d,"rowProportions",0)),(f=e.call(this,t,s,r,o,a,d)).type="rexGridSizer",f.sizerChildren=[],f.addChildrenMap("items",f.sizerChildren),f.setCreateCellContainerCallback(Bx(d,"createCellContainerCallback")),f.setIndentLeft(Bx(d,"space.indentLeftOdd",0),Bx(d,"space.indentLeftEven",0)),f.setIndentTop(Bx(d,"space.indentTopOdd",0),Bx(d,"space.indentTopEven",0)),f.resetGrid(h,l,u,c,Bx(d,"space",void 0)),f}return r(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(p(h(i.prototype),"destroy",this).call(this,t),this.columnProportions=void 0,this.rowProportions=void 0,this.columnWidth=void 0,this.rowHeight=void 0,this.createCellContainerCallback=void 0);}},{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(){return void 0===this._totalColumnProportions&&(this._totalColumnProportions=_x.call(this)),this._totalColumnProportions}},{key:"totalRowProportions",get:function(){return void 0===this._totalRowProportions&&(this._totalRowProportions=Rx.call(this)),this._totalRowProportions}},{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)}},{key:"getColumnWidth",value:function(t){var e=this.columnProportions[t];return 0===e?this.columnWidth[t]:e*this.proportionWidthLength}},{key:"getRowHeight",value:function(t){var e=this.rowProportions[t];return 0===e?this.rowHeight[t]:e*this.proportionHeightLength}},{key:"setCreateCellContainerCallback",value:function(t){return this.createCellContainerCallback=t,this}}]),i}(pk);Object.assign(Dx.prototype,Ex),T.register("gridSizer",(function(t,e,i,n,s,r,o,a,h){var l=new Dx(this.scene,t,e,i,n,s,r,o,a,h);return this.scene.add.existing(l),l})),Z(window,"RexPlugins.UI.GridSizer",Dx);var Ix=function(t,e,i,n){return e/t<=i?e/(n-1):0},jx=function(t,e){void 0===e?e={lines:[],width:0,height:0}:(e.lines.length=0,e.width=0,e.height=0);for(var i,n,s,r,o=this.sizerChildren,a=this.space.item,h=this.space.line,l=this.space.indentLeftOdd,u=this.space.indentLeftEven,c=this.space.indentTopOdd,d=this.space.indentTopEven,f=0,p=e.lines,v=void 0,g=0,y=o.length;ga.height/2)){s>(h=Fx(a.left,a.centerY,t,e))&&(s=h,n=r);var h,l=i[r+1];if(!l||l.y!==a.y)s>(h=Fx(a.right,a.centerY,t,e))&&(s=h,n=r+1);}}return n},Yx=Phaser.Utils.Objects.IsPlainObject,Vx=Phaser.Utils.Objects.GetValue,Xx=Phaser.Display.Align.CENTER,Gx=function(t,e,i,n){if("\n"===t)return this.addNewLine(),this;var s;(kp.call(this,t),Yx(e))&&(e=Vx(s=e,"padding",0),i=Vx(s,"key",void 0),n=Vx(s,"index",void 0));return void 0===e&&(e=0),(s=this.getSizerConfig(t)).align=Xx,s.padding=gp(e),void 0===n||n>=this.sizerChildren.length?this.sizerChildren.push(t):this.sizerChildren.splice(n,0,t),void 0!==i&&this.addChildrenMap(i,t),this},Ux={add:function(t,e,i){if(gg(t))for(var n=t,s=0,r=n.length;s=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,Ck.call(this,t),this}},Kx={getChildrenWidth:function(){return this.rexSizer.hidden?0:this.maxChildWidth+this.space.left+this.space.right},getChildrenHeight:function(){return this.rexSizer.hidden?0:this.widthWrapResult.height+this.space.top+this.space.bottom},getChildrenSizers:function(t){void 0===t&&(t=[]);for(var e,i=this.sizerChildren,n=0,s=i.length;n=0;i--)FC.call(this,e[i],t);return this}},YC=function(t,e,i){if(t){var n=this.setValueCallback,s=this.setValueCallbackScope;n&&(s?n.call(s,t,e,i):n(t,e,i)),this.fireEvent("button.statechange",t,e,i);}},VC=function(t){var e=this;t._selected=void 0,Object.defineProperty(t,"selected",{get:function(){return t._selected},set:function(i){if(t._selected!==i){var n=t._selected;t._selected=i,YC.call(e,t,i,n);}},enumerable:!0,configurable:!0}),t.selected=!1;},XC={add:function(t){return this.buttons.push(t),t._click||(t._click=new lc(t,this.clickConfig),t._click.on("click",(function(t,e,i,n){this.fireEvent("button.click",e,i,n);}),this).on("enable",(function(t,e){this.fireEvent("button.enable",e);}),this).on("disable",(function(t,e){this.fireEvent("button.disable",e);}),this),t.on("pointerover",(function(e,i,n,s){this.fireEvent("button.over",t,e,s);}),this).on("pointerout",(function(e,i){this.fireEvent("button.out",t,e,i);}),this).on("pointerdown",(function(e,i,n,s){this.fireEvent("button.down",t,e,s);}),this).on("pointerup",(function(e,i){this.fireEvent("button.up",t,e,i);}),this)),this.buttonsType&&(void 0===t.name&&console.error("".concat(this.parent.constructor.name,": Option button miss value")),VC.call(this,t)),this},addMultiple:function(t){for(var e=0,i=t.length;e2?o-2:0),h=2;h=0;i--)rw.call(this,e[i],t);return this}},aw=Phaser.Utils.Objects.GetValue,hw=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=aw(s,"row",0),a=aw(s,"column",s.col||0),h=aw(s,"createCellContainerCallback"),l=aw(s,"buttons",void 0),c=aw(s,"expand",!0),d=c?1:0;if(h&&(s.createCellContainerCallback=void 0),void 0!==l){o=Math.max(o,l.length);for(var f=0,p=l.length;fs&&lw.addNewLine(this);}else for(r=0,o=t.length;r=0;i--)pw.call(this,e[i],t);return this}},gw=Phaser.Utils.Objects.GetValue,yw=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=s.space;"number"==typeof o&&(s.space={item:o,line:o}),(r=e.call(this,t,s)).type="rexFixWidthButtons",r.buttonGroup=new ZC({parent:u(r),eventEmitter:gw(s,"eventEmitter",u(r)),groupName:gw(s,"groupName",void 0),clickConfig:gw(s,"click",void 0)}).setButtonsType(s);var a=gw(s,"background",void 0),h=gw(s,"buttons",void 0);return r.buttonsAlign=gw(s,"align",void 0),a&&r.addBackground(a),h&&r.addButtons(h),r.addChildrenMap("background",a),r.addChildrenMap("buttons",r.buttonGroup.buttons),r}return r(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(p(h(i.prototype),"destroy",this).call(this,t),this.buttonGroup.destroy(),this.buttonGroup=void 0);}},{key:"buttons",get:function(){return this.buttonGroup.buttons}},{key:"groupName",get:function(){return this.buttonGroup.groupName},set:function(t){this.buttonGroup.groupName=t;}},{key:"eventEmitter",get:function(){return this.buttonGroup.eventEmitter}}]),i}(Qx);Object.assign(yw.prototype,cw,vw,JC,$C),T.register("fixWidthButtons",(function(t){var e=new yw(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.FixWidthButtons",yw);var kw=Phaser.Utils.Objects.GetValue,mw=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),(r=e.call(this,t,s)).type="rexFileSelectorButton";var o=new xb(t);return t.add.existing(o),r.addBackground(o),r.addChildrenMap("fileChooser",o),r.setAccept(kw(s,"accept","")),r.setMultiple(kw(s,"multiple",!1)),o.on("change",(function(t){var e=t.files;0!==e.length&&(e=Array.from(e),this.emit("select",e,this));}),u(r)),r}return r(i,[{key:"files",get:function(){return this.childrenMap.fileChooser.files}}]),i}(oC);Object.assign(mw.prototype,{setAccept:function(t){return this.childrenMap.fileChooser.setAccept(t),this},setMultiple:function(t){return this.childrenMap.fileChooser.setMultiple(t),this},loadFile:function(t,e,i,n,s){return this.childrenMap.fileChooser.loadFile(t,e,i,n,s),this},loadFilePromise:function(t,e,i,n){return this.childrenMap.fileChooser.loadFilePromise(t,e,i,n)}}),T.register("fileSelectorButton",(function(t){var e=new mw(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.FileSelectorButton",mw);var bw={getChoice:function(t){var e=this.childrenMap.choicesSizer;return e?e.getButton(t):void 0},getAction:function(t){return this.childrenMap.actionsSizer.getButton(t)},getToolbar:function(t){return this.childrenMap.toolbarSizer.getButton(t)},getLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.getButton(t)},setChoiceEnable:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.setButtonEnable(t,e),this},setActionEnable:function(t,e){return this.childrenMap.actionsSizer.setButtonEnable(t,e),this},setToolbarEnable:function(t,e){return this.childrenMap.toolbarSizer.setButtonEnable(t,e),this},setLeftToolbarEnable:function(t,e){return this.childrenMap.leftToolbarSizer.setButtonEnable(t,e),this},toggleChoiceEnable:function(t){var e=this.childrenMap.choicesSizer;return e&&e.toggleButtonEnable(t),this},toggleActionEnable:function(t){return this.childrenMap.actionsSizer.toggleButtonEnable(t),this},toggleToolbarEnable:function(t){return this.childrenMap.toolbarSizer.toggleButtonEnable(t),this},toggleLeftToolbarEnable:function(t){return this.childrenMap.leftToolbarSizer.toggleButtonEnable(t),this},getChoiceEnable:function(t){var e=this.childrenMap.choicesSizer;return !!e&&e.getButtonEnable(t)},getActionEnable:function(t){return this.childrenMap.actionsSizer.getButtonEnable(t)},getToolbarEnable:function(t){return this.childrenMap.toolbarSizer.getButtonEnable(t)},getLeftToolbarEnable:function(t){return this.childrenMap.leftToolbarSizer.getButtonEnable(t)},emitChoiceClick:function(t){var e=this.childrenMap.choicesSizer;return e&&e.emitButtonClick(t),this},emitActionClick:function(t){return this.childrenMap.actionsSizer.emitButtonClick(t),this},emitToolbarClick:function(t){return this.childrenMap.toolbarSizer.emitButtonClick(t),this},emitLeftToolbarClick:function(t){return this.childrenMap.leftToolbarSizer.emitButtonClick(t),this},showChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.showButton(t),this},showAction:function(t){return this.childrenMap.actionsSizer.showButton(t),this},showToolbar:function(t){return this.childrenMap.toolbarSizer.showButton(t),this},showLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.showButton(t),this},hideChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.hideButton(t),this},hideAction:function(t){return this.childrenMap.actionsSizer.hideButton(t),this},hideToolbar:function(t){return this.childrenMap.toolbarSizer.hideButton(t),this},hideLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.hideButton(t),this},addChoice:function(t){var e=this.childrenMap.choicesSizer;return e&&e.addButton(t),this},addAction:function(t){return this.childrenMap.actionsSizer.addButton(t),this},addToolbar:function(t){return this.childrenMap.toolbarSizer.addButton(t),this},addLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.addButton(t),this},removeChoice:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.removeButton(t,e),this},removeAction:function(t,e){return this.childrenMap.actionsSizer.removeButton(t,e),this},removeToolbar:function(t,e){return this.childrenMap.toolbarSizer.removeButton(t,e),this},removeLeftToolbar:function(t,e){return this.childrenMap.leftToolbarSizer.removeButton(t,e),this},clearChoices:function(t){var e=this.childrenMap.choicesSizer;return e&&e.clearButtons(t),this},clearActions:function(t){return this.childrenMap.actionsSizer.clearButtons(t),this},clearToolbar:function(t){return this.childrenMap.toolbarSizer.clearButtons(t),this},clearLeftToolbar:function(t){return this.childrenMap.leftToolbarSizer.clearButtons(t),this},forEachChoice:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.forEachButtton(t,e),this},forEachAction:function(t,e){return this.childrenMap.actionsSizer.forEachButtton(t,e),this},forEachToolbar:function(t,e){return this.childrenMap.toolbarSizer.forEachButtton(t,e),this},forEachLeftToolbar:function(t,e){return this.childrenMap.leftToolbarSizer.forEachButtton(t,e),this},setAllButtonsEnable:function(t){return void 0===t&&(t=!0),this.childrenMap.toolbarSizer&&this.setToolbarEnable(t),this.childrenMap.leftToolbarSizer&&this.setLeftToolbarEnable(t),this.childrenMap.actionsSizer&&this.setActionEnable(t),this.childrenMap.choicesSizer&&this.setChoiceEnable(t),this},getChoicesButtonStates:function(){var t=this.childrenMap.choicesSizer;return t?t.getAllButtonsState():{}},getChoicesButtonState:function(t){var e=this.childrenMap.choicesSizer;return void 0===t?e?e.getAllButtonsState():{}:!!e&&e.getButtonState(t)},setChoicesButtonState:function(t,e){var i=this.childrenMap.choicesSizer;return i&&i.setButtonState(t,e),this},clearChoicesButtonStates:function(){var t=this.childrenMap.choicesSizer;return t&&t.clearAllButtonsState(),this},getChoicesSelectedButtonName:function(){var t=this.childrenMap.choicesSizer;return t?t.getSelectedButtonName():""},setChoicesSelectedButtonName:function(t){var e=this.childrenMap.choicesSizer;return e&&e.setSelectedButtonName(t),this}},xw={onCreateModalBehavior:function(t){t.on("button.click",(function(e,i,n,s,r){if("actions"===i){var o={index:n,text:e.text,button:e,dialog:t};switch(t.buttonsType){case"radio":o.value=t.getChoicesSelectedButtonName();break;case"checkboxes":o.value=t.getChoicesButtonStates();break;default:o.value=void 0;}t.modalClose(o);}}));},modal:function(t,e){return t&&!1===t.defaultBehavior?this.onCreateModalBehavior=!1:delete this.onCreateModalBehavior,pg.modal.call(this,t,e),this}},Cw={};Object.assign(Cw,bw,xw);var ww=Phaser.Utils.Objects.GetValue,Sw=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),s.orientation=1,(r=e.call(this,t,s)).type="rexDialog",r.eventEmitter=ww(s,"eventEmitter",u(r));var o,a,h,l,c=ww(s,"background",void 0),d=ww(s,"title",void 0),f=ww(s,"toolbar",void 0),p=ww(s,"toolbarBackground",void 0),v=ww(s,"leftToolbar",void 0),g=ww(s,"leftToolbarBackground",void 0),y=ww(s,"content",void 0),k=ww(s,"description",void 0),m=ww(s,"choices",void 0),b=ww(s,"choicesBackground",void 0),x=ww(s,"actions",void 0),C=ww(s,"actionsBackground",void 0),w=ww(s,"click",void 0);if(c&&r.addBackground(c),f&&(h=new tw(t,{groupName:"toolbar",background:p,buttons:f,orientation:0,space:{item:ww(s,"space.toolbarItem",0)},click:w,eventEmitter:r.eventEmitter})),v&&(l=new tw(t,{groupName:"leftToolbar",background:g,buttons:v,orientation:0,space:{item:ww(s,"space.leftToolbarItem",0)},click:w,eventEmitter:r.eventEmitter})),d||f||v){var S,P=!!d&&ww(s,"expand.title",!0),T=ww(s,"align.title","center"),O=!(d&&!P&&"center"===T||!d&&(f||v));S=O?new vx(t,{orientation:0}):new Mk(t);var M=!!O||{height:!0};if(l&&S.add(l,{align:"left",expand:M}),d){O&&!P&&"right"===T&&S.addSpace();var E={left:ww(s,"space.titleLeft",0),right:ww(s,"space.titleRight",0)},_=P?1:0;S.add(d,{align:T,proportion:_,expand:M,padding:E}),O&&!P&&"left"===T&&S.addSpace();}h&&(O&&!d&&S.addSpace(),S.add(h,{align:"right",expand:M})),(y||k||m||x)&&(E={bottom:ww(s,"space.title",0),top:ww(s,"space.titleTop",0)});_=ww(s,"proportion.title",0);r.add(S,{padding:E,proportion:_,expand:!0});}if(y){var R=ww(s,"align.content","center"),L=ww(s,"space.content",0),B=(E={left:ww(s,"space.contentLeft",0),right:ww(s,"space.contentRight",0),bottom:k||m||x?L:0},_=ww(s,"proportion.content",0),ww(s,"expand.content",!0));r.add(y,{align:R,padding:E,proportion:_,expand:B});}if(k){R=ww(s,"align.description","center");var D=ww(s,"space.description",0);E={left:ww(s,"space.descriptionLeft",0),right:ww(s,"space.descriptionRight",0),bottom:m||x?D:0},_=ww(s,"proportion.description",0),B=ww(s,"expand.description",!0);r.add(k,{align:R,padding:E,proportion:_,expand:B});}if(m){var I=ww(s,"choicesType","").split("-"),j=Pw(I,"wrap")?yw:Pw(I,"grid")?hw:tw,z=Pw(I,"radio")?"radio":Pw(I,"checkboxes")?"checkboxes":void 0,A={left:ww(s,"space.choicesBackgroundLeft",0),right:ww(s,"space.choicesBackgroundRight",0),top:ww(s,"space.choicesBackgroundTop",0),bottom:ww(s,"space.choicesBackgroundBottom",0)},F=ww(s,"space.choice",0);j===tw?A.item=F:j===yw?(A.item=F,A.line=ww(s,"space.choiceLine",F)):(A.column=ww(s,"space.choiceColumn",F),A.row=ww(s,"space.choiceRow",F));var W={width:ww(s,"choicesWidth",void 0),height:ww(s,"choicesHeight",void 0),groupName:"choices",buttonsType:z,background:b,buttons:m,space:A,click:w,eventEmitter:r.eventEmitter,setValueCallback:ww(s,"choicesSetValueCallback",void 0),setValueCallbackScope:ww(s,"choicesSetValueCallbackScope",void 0)};j===tw&&(W.orientation=Pw(I,"x")?0:1),o=new j(t,W);var Y=ww(s,"space.choices",0);E={left:ww(s,"space.choicesLeft",0),right:ww(s,"space.choicesRight",0),bottom:x?Y:0},R=ww(s,"align.choices","center"),_=ww(s,"proportion.choices",0),B=ww(s,"expand.choices",!0);r.add(o,{align:R,padding:E,proportion:_,expand:B}),r.buttonsType=z;}if(x){a=new tw(t,{groupName:"actions",background:C,buttons:x,orientation:0,space:{item:ww(s,"space.action",0)},expand:ww(s,"expand.actions",!1),align:ww(s,"align.actions","center"),click:w,eventEmitter:r.eventEmitter});E={left:ww(s,"space.actionsLeft",0),right:ww(s,"space.actionsRight",0),bottom:ww(s,"space.actionsBottom",0)},_=ww(s,"proportion.action",0);r.add(a,{align:"center",padding:E,proportion:_,expand:!0});}return Ow(u(r),"click"),Ow(u(r),"over"),Ow(u(r),"out"),Ow(u(r),"enable"),Ow(u(r),"disable"),r.addChildrenMap("background",c),r.addChildrenMap("title",d),r.addChildrenMap("toolbar",f),r.addChildrenMap("leftToolbar",v),r.addChildrenMap("content",y),r.addChildrenMap("description",k),r.addChildrenMap("choices",o?o.buttons:void 0),r.addChildrenMap("actions",a?a.buttons:void 0),r.addChildrenMap("choicesSizer",o),r.addChildrenMap("actionsSizer",a),r.addChildrenMap("toolbarSizer",h),r.addChildrenMap("leftToolbarSizer",l),r}return r(i)}(vx),Pw=function(t,e){return -1!==t.indexOf(e)},Tw={actions:"action",choices:"choice",toolbar:"toolbar",leftToolbar:"leftToolbar"},Ow=function(t,e){t.on("button.".concat(e),(function(i,n,s,r,o){Tw.hasOwnProperty(n)&&t.emit("".concat(Tw[n],".").concat(e),i,s,r,o);}));};Object.assign(Sw.prototype,Cw),T.register("dialog",(function(t){var e=new Sw(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Dialog",Sw);var Mw=function(t,e,i){var n=new mC(t,e,i);return t.add.existing(n),n},Ew=function(t){this.childrenMap.title.resetDisplayContent(t.title);},_w=function(t){var e=this.childrenMap.content;if(e.resetDisplayContent)e.resetDisplayContent(t.content);else {var i=t.content||"";e.setText(i);}},Rw=function(t){var e=this.childrenMap.actions;if(e){var i=t.buttons;if(i){for(var n=this.scene,s=this.defaultActionConfig,r=this.defaultActionButtonCreator,o=0,a=i.length;o=t.dragThreshold?"DRAG":"DRAGBEGIN":"IDLE"}},{key:"update_DRAGBEGIN",value:function(t,e){this.next();}},{key:"next_DRAG",value:function(){var t,e=this.parent;return e.dragState.isUp&&(t=e.outOfBounds?"BACK":e.slidingEnable?"SLIDE":"IDLE"),t}},{key:"update_DRAG",value:function(t,e){var i=this.parent;i.dragState.justMoved&&i.dragging(),this.next();}},{key:"enter_DRAG",value:function(){this.parent.onDragStart();}},{key:"exit_DRAG",value:function(){this.parent.onDragEnd();}},{key:"next_SLIDE",value:function(){var t,e=this.parent;return e.dragState.isDown?t="DRAG":e.isSliding||(t="IDLE"),t}},{key:"enter_SLIDE",value:function(){this.parent.onSliding();}},{key:"exit_SLIDE",value:function(){this.parent.stop();}},{key:"update_SLIDE",value:function(t,e){this.parent.sliding(t,e),this.next();}},{key:"next_BACK",value:function(){var t,e=this.parent;return e.dragState.isDown?t="DRAG":e.isPullBack||(t="IDLE"),t}},{key:"enter_BACK",value:function(){this.parent.onPullBack();}},{key:"exit_BACK",value:function(){this.parent.stop();}},{key:"update_BACK",value:function(t,e){this.parent.pullBack(t,e),this.next();}}]),i}(Wv),bS=Phaser.Utils.Objects.GetValue,xS=Phaser.Math.Distance.Between,CS=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s))._enable=void 0,t.setInteractive(bS(s,"inputConfig",void 0)),r.resetFromJSON(s),r.boot(),r}return r(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.isInTouched=!1,this.holdStartTime=void 0,this.x=void 0,this.y=void 0,this.preX=void 0,this.preY=void 0,this.localX=void 0,this.localY=void 0,this.justMoved=!1,this.setEnable(bS(t,"enable",!0)),this.holdThreshold=bS(t,"holdThreshold",50),this.pointerOutReleaseEnable=bS(t,"pointerOutRelease",!0),this}},{key:"boot",value:function(){this.parent.on("pointerdown",this.onPointIn,this),this.parent.on("pointerup",this.onPointOut,this),this.pointerOutReleaseEnable&&this.parent.on("pointerout",this.onPointOut,this),this.parent.on("pointermove",this.onPointerMove,this),this.scene.sys.events.on("preupdate",this.preupdate,this);}},{key:"shutdown",value:function(t){this.isShutdown||(this.scene.sys.events.off("preupdate",this.preupdate,this),this.pointer=void 0,p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"enable",get:function(){return this._enable},set:function(t){this._enable!==t&&(t||(this.isInTouched=!1,this.pointer=void 0),this._enable=t);}},{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:"setPointerOutReleaseEnable",value:function(t){return void 0===t&&(t=!0),this.pointerOutReleaseEnable=t,this}},{key:"isDown",get:function(){return this.pointer&&this.pointer.isDown}},{key:"isUp",get:function(){return !this.isDown}},{key:"dx",get:function(){return this.x-this.preX}},{key:"dy",get:function(){return this.y-this.preY}},{key:"dt",get:function(){return nu(this.scene)}},{key:"speed",get:function(){return this.x===this.preX&&this.y===this.preY?0:xS(this.preX,this.preY,this.x,this.y)/(.001*this.dt)}},{key:"speedX",get:function(){return this.dx/(.001*this.dt)}},{key:"speedY",get:function(){return this.dy/(.001*this.dt)}},{key:"onPointIn",value:function(t,e,i){this.enable&&t.isDown&&void 0===this.pointer&&(this.pointer=t,this.localX=e,this.localY=i);}},{key:"onPointOut",value:function(t){this.enable&&this.pointer===t&&(this.pointer=void 0);}},{key:"onPointerMove",value:function(t,e,i){this.enable&&t.isDown&&this.pointer===t&&(this.localX=e,this.localY=i);}},{key:"preupdate",value:function(t,e){if(this.enable){var i=this.pointer;this.justMoved=!1,i&&!this.isInTouched?(this.x=i.worldX,this.y=i.worldY,this.preX=i.worldX,this.preY=i.worldY,this.isInTouched=!0,this.holdStartTime=void 0,this.emit("touchstart",i,this.localX,this.localY)):i&&this.isInTouched?this.x===i.x&&this.y===i.y?void 0===this.holdStartTime?this.holdStartTime=t:t-this.holdStartTime>this.holdThreshold&&(this.preX=this.x,this.preY=this.y):(this.preX=this.x,this.preY=this.y,this.x=i.worldX,this.y=i.worldY,this.holdStartTime=void 0,this.justMoved=!0,this.emit("touchmove",i,this.localX,this.localY)):!i&&this.isInTouched&&(this.isInTouched=!1,this.holdStartTime=void 0,this.emit("touchend",i));}}}]),i}(oo),wS=Phaser.Utils.Objects.GetValue,SS=function(){function t(e){n(this,t),this.resetFromJSON(e);}return r(t,[{key:"resetFromJSON",value:function(t){return this.setValue(wS(t,"value",0)),this.setSpeed(wS(t,"speed",0)),this.setAcceleration(wS(t,"acceleration",0)),this}},{key:"reset",value:function(){this.setValue(0),this.setSpeed(0),this.setAcceleration(0);}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"setSpeed",value:function(t){return this.speed=t,this}},{key:"setAcceleration",value:function(t){return this.acceleration=t,this}},{key:"updateSpeed",value:function(t){return 0!==this.acceleration&&(this.speed+=this.acceleration*t,this.speed<0&&(this.speed=0)),this}},{key:"getDeltaValue",value:function(t){return this.updateSpeed(t),this.speed<=0?0:this.speed*t}},{key:"update",value:function(t){return this.updateSpeed(t),this.speed>0&&(this.value+=this.getDeltaValue(t)),this}},{key:"isMoving",get:function(){return this.speed>0}}]),t}(),PS=function(){function t(){n(this,t),this.value,this.dir,this.movement=new SS;}return r(t,[{key:"init",value:function(t,e,i,n,s){return this.value=t,this.end=s,this.dir=void 0!==s?tthis.end&&(this.value=this.end):this.valuethis.maxValue}},{key:"overMin",value:function(t){return null!=this.minValue&&t0,Math.abs(e),i);}},{key:"sliding",value:function(t,e){e*=.001;var i=this._slowDown.update(e).value;this.overMax(i)?(this.value=this.maxValue,this._slowDown.stop()):this.overMin(i)?(this.value=this.minValue,this._slowDown.stop()):this.value=i;}},{key:"onPullBack",value:function(){var t=this.value,e=this.outOfMinBound?this.minValue:this.maxValue,i=Math.abs(e-t),n=this.backDeceleration,s=Math.sqrt(2*n*i);this._slowDown.init(t,void 0,s,n,e);}},{key:"pullBack",value:function(t,e){e*=.001,this.value=this._slowDown.update(e).value,this._slowDown.isMoving||this._state.next();}},{key:"stop",value:function(){this._slowDown.stop();}}]),i}(oo),ES={y:0,v:0,vertical:0,x:1,h:1,horizontal:1},_S=Phaser.Utils.Objects.GetValue,RS=function(t){a(i,t);var e=d(i);function i(t,s){var r;(n(this,i),(r=e.call(this,t,s)).parent!==r.scene?r.focusMode=_S(s,"focus",!0):r.focusMode=!1,r.setSpeed(_S(s,"speed",.1)),r.setEnable(_S(s,"enable",!0)),r.focusMode)?(t=r.parent).setInteractive(_S(s,"inputConfig",void 0)).on("wheel",(function(t,e,i,n,s){this.enable&&this.scroll(i);}),u(r)):r.scene.input.on("wheel",r.onSceneScroll,u(r));return r}return r(i,[{key:"destroy",value:function(){this.focusMode||this.scene.input.off("wheel",this.onSceneScroll,this);}},{key:"onSceneScroll",value:function(t,e,i,n,s,r){this.enable&&this.scroll(n);}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"setSpeed",value:function(t){return this.speed=t,this}},{key:"scroll",value:function(t){t*=this.speed,this.emit("scroll",t,this.parent,this);}}]),i}(oo),LS=Phaser.Utils.Objects.GetValue,BS=function(t,e,i,n){var s,r,o,a,h="Y"===(i=i.toUpperCase()),l=2===t.scrollMode,u=t.childrenMap.child,c="slider".concat(i);if(s=l||n.hasOwnProperty(c)?LS(n,c,void 0):LS(n,"slider",void 0)){var d,f,p;!0===s&&(s={}),s.orientation=h?1:0,r=function(t,e){void 0===e&&(e={});var i=qe(e);(e={slider:i}).orientation=i.orientation,delete i.orientation,e.background=i.background,delete i.background,e.buttons=i.buttons,delete i.buttons;var n=new kS(t,e);t.add.existing(n);var s=n.childrenMap.slider;return n.addChildrenMap("track",s.childrenMap.track),n.addChildrenMap("indicator",s.childrenMap.indicator),n.addChildrenMap("thumb",s.childrenMap.thumb),n}(t.scene,s);var v=LS(s,"position",0);"string"==typeof v&&(v=DS[v]);var g=LS(n,"space.slider".concat(i),void 0);void 0===g&&void 0===(g=LS(n,"space.slider",void 0))&&(g=l?0:LS(n,"space.child",0));var y="number"==typeof g;h?0===v?(d=2,f=1,p=y?{left:g}:g):(d=0,f=1,p=y?{right:g}:g):0===v?(d=1,f=2,p=y?{top:g}:g):(d=1,f=0,p=y?{bottom:g}:g),e.add(r,{column:d,row:f,align:"center",padding:p,expand:!0}),t["hideUnscrollableSlider".concat(i)]=LS(s,"hideUnscrollableSlider",!1),t["adaptThumb".concat(i,"SizeMode")]=LS(s,"adaptThumbSize",!1),t["minThumb".concat(i,"Size")]=LS(s,"minThumbSize",void 0);}else t["hideUnscrollableSlider".concat(i)]=!1,t["adaptThumb".concat(i,"SizeMode")]=!1,t["minThumb".concat(i,"Size")]=void 0;var k="scroller".concat(i);(o=l||n.hasOwnProperty(k)?LS(n,k,!0):LS(n,"scroller",!0))&&u&&(!0===o&&(o={}),o.orientation=h?0:1,a=new MS(u,o));var m,b,x,C,w=LS(n,l?"mouseWheelScroller".concat(i):"mouseWheelScroller",!1);(w&&u&&(m=new RS(u,w)),t.addChildrenMap("slider".concat(i),r),t.addChildrenMap("scroller".concat(i),a),t.addChildrenMap("mouseWheelScroller".concat(i),m),l&&!h||(t.hideUnscrollableSlider=t["hideUnscrollableSlider".concat(i)],t.adaptThumbSizeMode=t["adaptThumb".concat(i,"SizeMode")],t.minThumbSize=t["minThumb".concat(i,"Size")],t.addChildrenMap("slider",r),t.addChildrenMap("scroller",a),t.addChildrenMap("mouseWheelScroller",m)),r)&&(l?(b=h?"t":"s",C="scroll".concat(i)):(b="t",C="scroll"),r.on("valuechange",(function(e){t[b]=e,t.emit(C,t);})));a&&(l?(x="childO".concat(i),C="scroll".concat(i)):(x="childOY",C="scroll"),a.on("valuechange",(function(e){t[x]=e,t.emit(C,t);})));if(m){var S="addChildO".concat(i);m.on("scroll",(function(e){t[S](-e,!0);}));}},DS={right:0,left:1,bottom:0,top:1},IS=Phaser.Utils.Objects.GetValue,jS=function(t,e){var i=t.scene,n=[0,1,0],s=[0,1,0],r=IS(e,"width"),o=IS(e,"height");r||(IS(e,"child.expandWidth",!0)||(n[1]=0));o||(IS(e,"child.expandHeight",!0)||(s[1]=0));var a=new Dx(i,{column:3,row:3,columnProportions:n,rowProportions:s});switch(function(t,e,i){var n=Xw(i,"child"),s=Xw(n,"gameObject",void 0);if(s){var r=Xw(i,"space.child",0);t.childMargin={};var o=t.childMargin,a={};if("number"==typeof r)switch(t.scrollMode){case 0:case 1:o.top=0,o.bottom=0,o.left=0,o.right=0;break;default:o.top=r,o.bottom=r,o.left=r,o.right=r;}else switch(t.scrollMode){case 0:o.top=Xw(r,"top",0),o.bottom=Xw(r,"bottom",0),a.left=Xw(r,"left",0),a.right=Xw(r,"right",0);break;case 1:o.top=Xw(r,"left",0),o.bottom=Xw(r,"right",0),a.top=Xw(r,"top",0),a.bottom=Xw(r,"bottom",0);break;default:o.top=Xw(r,"top",0),o.bottom=Xw(r,"bottom",0),o.left=Xw(r,"left",0),o.right=Xw(r,"right",0);}e.add(s,{column:1,row:1,align:Xw(n,"align","center"),padding:a,expand:{width:Xw(n,"expandWidth",!0),height:Xw(n,"expandHeight",!0)}});}t.addChildrenMap("child",s);}(t,a,e),t.scrollMode){case 0:BS(t,a,"y",e);break;case 1:BS(t,a,"x",e);break;default:BS(t,a,"y",e),BS(t,a,"x",e);}return a},zS=function(t){var e,i,n,s;switch(this.scrollMode){case 0:case 1:e=this.topChildOY,i=this.bottomChildOY,n=this.childrenMap.scroller,s=this.childrenMap.slider;break;default:"Y"===(t=t.toUpperCase())?(e=this.topChildOY,i=this.bottomChildOY):(e=this.leftChildOX,i=this.rightChildOX),n=this.childrenMap["scroller".concat(t)],s=this.childrenMap["slider".concat(t)];}n&&n.setBounds(e,i),s&&s.setEnable(e!==i);},AS=function(t){switch(this.scrollMode){case 0:case 1:(e=this.childrenMap.slider)&&this.hideUnscrollableSlider&&this.setChildVisible(e,this.isOverflow);break;default:t=t.toUpperCase();var e=this.childrenMap["slider".concat(t)],i=this["hideUnscrollableSlider".concat(t)],n=this["isOverflow".concat(t)];e&&i&&this.setChildVisible(e,n);}},FS=function(t){switch(this.scrollMode){case 0:case 1:if(!this.adaptThumbSizeMode)return;if(!(a=this.childrenMap.slider))return;var e=Math.min(this.childVisibleHeight/this.childHeight,1),i=a.childrenMap.track,n=a.childrenMap.thumb,s=this.minThumbSize;if(0===this.scrollMode){var r=i.displayHeight*e;void 0!==s&&r0?t.setText(e).getTextBounds().wrappedText.split("\n"):e.split("\n");}return i},NS=function(t){return (t-this.textLineSpacing)/(this.textLineHeight+this.textLineSpacing)},KS=function(t){return t*(this.textLineHeight+this.textLineSpacing)-this.textLineSpacing},JS=function(t){var e,i=t+this.visibleLinesCount+1;switch(this.textObjectType){case 0:case 2:e=this.lines.slice(t,i).join("\n");break;case 1:var n=this.lines.getLineStartIndex(t),s=this.lines.getLineEndIndex(i-1);e=this.lines.getSliceTagText(n,s,!0);}return e},ZS=function(t,e){switch(US(t)){case 0:var i=(s=t.style).wordWrapWidth,n=s.wordWrapCallback;s.wordWrapWidth=0,s.wordWrapCallback=void 0,t.setText(e),s.wordWrapWidth=i,s.wordWrapCallback=n;break;case 1:var s,r=(s=t.style).wrapMode;s.wrapMode=0,t.setText(e),s.wrapMode=r;break;case 2:var o=t._maxWidth;t._maxWidth=0,t.setText(e),t._maxWidth=o;}},qS=function(){var t=this.textObject.rexSizer;this.textObject.y+=t.offsetY-t.preOffsetY,t.preOffsetY=t.offsetY,this.resetChildPositionState(this.textObject),this.textCropEnable&&$S.call(this);},$S=function(){if(this.textObject.setCrop){var t,e,i=this.textObject.rexSizer.offsetY;i<=0?(t=-i,e=this.height):(t=0,e=this.height-i),this.textObject.setCrop(0,t,this.width,e);}},QS=function(t,e,i){if(i+=this.textLineHeight+this.textLineSpacing,this.textObjectWidth!==e||this._textObjectRealHeight!==i){switch(this.textObjectWidth=e,this._textObjectRealHeight=i,this.textObjectType){case 0:case 1:t.setFixedSize(e,i);var n=t.style,s=Math.max(e,0);0===this.textObjectType?n.wordWrapWidth=s:(0===n.wrapMode&&(n.wrapMode=1),n.wrapWidth=s);break;case 2:t.setMaxWidth(e);}this.setText();}},tP={setText:function(t){return void 0!==t&&(this.text=t),this.lines=HS(this.textObject,this.text,this.lines),this.linesCount=this.lines.length,this._textHeight=void 0,this._textVisibleHeight=void 0,this.updateTextObject(),this},updateTextObject:function(){var t=Math.max(Math.floor(NS.call(this,-this.textOY)),0),e=KS.call(this,t)+this.textOY,i=JS.call(this,t);return ZS(this.textObject,i),this.textObject.rexSizer.offsetY=e,qS.call(this),this},preLayout:function(){return this._textLineHeight=void 0,this._textLineSpacing=void 0,this._visibleLinesCount=void 0,this._textHeight=void 0,this._textVisibleHeight=void 0,Ip.call(this),this},layoutChildren:function(){var t,e,i,n,s,r,o,a=this.left,h=this.top;(t=this.textObject).rexSizer.hidden||(n=a+(i=(e=t.rexSizer).padding).left,s=h+i.top,r=this.width-i.left-i.right,o=this.height-i.top-i.bottom,QS.call(this,t,r,o),up(t,n,s,r,o,e.align),e.preOffsetY=0,qS.call(this),this.textMask&&(this.textMask.setPosition().resize(),this.resetChildPositionState(this.textMask)));}},eP=Phaser.Utils.Objects.IsPlainObject,iP=Phaser.Utils.Objects.GetValue,nP=Phaser.Display.Align.TOP_LEFT,sP=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),eP(s)?(s=iP(h=s,"x",0),r=iP(h,"y",0),o=iP(h,"width",void 0),a=iP(h,"height",void 0)):eP(o)&&(o=iP(h=o,"width",void 0),a=iP(h,"height",void 0)),(l=e.call(this,t,s,r,o,a,h)).type="rexTextBlock",l.textObject=void 0,l.linesCount=0,l.textMask=void 0,l.textObjectType=void 0,l._textLineHeight=void 0,l._textLineSpacing=void 0,l._visibleLinesCount=void 0,l._textHeight=void 0,l._textVisibleHeight=void 0,l._textObjectRealHeight=0,l.lines=void 0,l.text=iP(h,"content",""),l._textOY=0,l.execeedTopState=!1,l.execeedBottomState=!1,l.setClampMode(iP(h,"clamplTextOY",!0)),l.alwaysScrollable=iP(h,"alwaysScrollable",!1);var c=iP(h,"background",void 0),d=iP(h,"text",void 0);void 0===d&&(d=rP(t)),l.textCropEnable=iP(h,"textCrop",!!d.setCrop);var f=iP(h,"textMask",!l.textCropEnable);c&&l.addBackground(c),l.add(d),l.sizerChildren=[d];var p=l.getSizerConfig(d);return p.align=nP,p.padding=gp(0),p.expand=!0,l.textObject=d,l.textObjectType=US(d),p.preOffsetY=0,p.offsetY=0,f&&(l.textMask=sC.call(u(l),l.textObject,u(l))),l.addChildrenMap("background",c),l.addChildrenMap("text",d),l}return r(i,[{key:"destroy",value:function(t){if(this.scene&&!this.ignoreDestroy){if(this.textObject=void 0,this.textMask=void 0,this.lines){switch(this.textObjectType){case 0:case 2:this.lines.length=0;break;case 1:this.lines.destroy();}this.lines=void 0;}p(h(i.prototype),"destroy",this).call(this,t);}}},{key:"setClampMode",value:function(t){return void 0===t&&(t=!0),this.clampTextOY=t,this}},{key:"textLineHeight",get:function(){if(void 0===this._textLineHeight){var t;switch(this.textObjectType){case 0:case 1:var e=this.textObject.style;t=e.metrics.fontSize+e.strokeThickness;break;case 2:var i=this.textObject.fontSize/this.textObject.fontData.size;t=this.textObject.fontData.lineHeight*i;}this._textLineHeight=t;}return this._textLineHeight}},{key:"textLineSpacing",get:function(){if(void 0===this._textLineSpacing){var t;switch(this.textObjectType){case 0:case 1:t=this.textObject.lineSpacing;break;case 2:t=0;}this._textLineSpacing=t;}return this._textLineSpacing}},{key:"visibleLinesCount",get:function(){return void 0===this._visibleLinesCount&&(this._visibleLinesCount=Math.floor(NS.call(this,this._textObjectRealHeight))),this._visibleLinesCount}},{key:"topTextOY",get:function(){return 0}},{key:"bottomTextOY",get:function(){return -this.textVisibleHeight}},{key:"textHeight",get:function(){return void 0===this._textHeight&&(this._textHeight=KS.call(this,this.linesCount)),this._textHeight}},{key:"textObjectHeight",get:function(){return this._textObjectRealHeight-(this.textLineHeight+this.textLineSpacing)}},{key:"textVisibleHeight",get:function(){if(void 0===this._textVisibleHeight){var t=this.textHeight-this.textObjectHeight;!this.alwaysScrollable&&t<0&&(t=0),this._textVisibleHeight=t;}return this._textVisibleHeight}},{key:"textOYExceedTop",value:function(t){return void 0===t&&(t=this.textOY),t>this.topTextOY}},{key:"textOYExeceedBottom",value:function(t){return void 0===t&&(t=this.textOY),tthis.linesCount?t=0:n?t=e:s&&(t=i)),this._textOY!==t&&(this._textOY=t,this.updateTextObject()),n&&(this.execeedTopState||this.emit("execeedtop",this,t,e)),this.execeedTopState=n,s&&(this.execeedBottomState||this.emit("execeedbottom",this,t,i)),this.execeedBottomState=s;}},{key:"setTextOY",value:function(t){return this.textOY=t,this}},{key:"t",get:function(){var t=this.textVisibleHeight;return 0===t?0:this.textOY/-t},set:function(t){this.textOY=-this.textVisibleHeight*t;}},{key:"setTextOYByPercentage",value:function(t){return this.t=t,this}}]),i}(pk),rP=function(t){return t.add.text(0,0,"")};Object.assign(sP.prototype,tP);var oP={scrollToLine:function(t){return this.setChildOY(-this.lineHeight*t),this},scrollToNextLine:function(t){void 0===t&&(t=1);var e=this.lineIndex+t;return this.scrollToLine(e),this}},aP=Phaser.Utils.Objects.GetValue,hP=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=aP(s,"text",void 0),a=aP(s,"textWidth",void 0),h=aP(s,"textHeight",void 0),l=aP(s,"textCrop",!!o.setCrop),u=aP(s,"textMask",!l),c=aP(s,"content",""),d=new sP(t,{width:a,height:h,text:o,textMask:u,textCrop:l&&!u,content:c,clamplTextOY:aP(s,"clamplChildOY",!1),alwaysScrollable:aP(s,"alwaysScrollable",!1)});t.add.existing(d),function(t){Object.defineProperty(t,"childOY",{configurable:!0,get:function(){return t.textOY},set:function(e){t.textOY=e;}}),Object.defineProperty(t,"topChildOY",{get:function(){return t.topTextOY}}),Object.defineProperty(t,"bottomChildOY",{get:function(){return t.bottomTextOY}}),Object.defineProperty(t,"childVisibleHeight",{get:function(){return t.textObjectHeight}}),Object.defineProperty(t,"childHeight",{get:function(){return t.textHeight}});}(d),s.scrollMode=0,s.type="rexTextArea",s.child={gameObject:d,expandWidth:void 0===a,expandHeight:void 0===h};var f=aP(s,"space",void 0);return f&&(f.child=aP(f,"text",0)),(r=e.call(this,t,s)).addChildrenMap("text",o),r}return r(i,[{key:"text",get:function(){return this.childrenMap.child.text}},{key:"lineHeight",get:function(){var t=this.childrenMap.child;return t.textLineHeight+t.textLineSpacing}},{key:"lineIndex",get:function(){return Math.floor(-this.childOY/this.lineHeight)}},{key:"linesCount",get:function(){return this.childrenMap.child.linesCount}},{key:"contentHeight",get:function(){return this.childrenMap.child.textHeight}}]),i}(XS);Object.assign(hP.prototype,{setText:function(t){return this.childrenMap.child.setText(t),this.resizeController(),this},appendText:function(t){return this.setText(this.text+t),this}},oP);var lP=Phaser.Utils.Objects.GetValue,uP=function(t,e,i){e=e?M(e):{};var n=lP(i,"background",aC),s=lP(i,"text",uC),r=lP(i,"track",aC),o=lP(i,"thumb",aC);n?e.background=n(t,e.background):delete e.background,s?e.text=s(t,e.text):delete e.text;var a=e.slider;!1!==a&&(void 0===a&&(a={}),r?a.track=r(t,a.track):delete a.track,o?a.thumb=o(t,a.thumb):delete a.thumb,e.slider=a);var h=new hP(t,e);return t.add.existing(h),h},cP=Phaser.Utils.Objects.GetValue,dP=Phaser.Utils.Objects.GetValue,fP=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;n(this,i),s=s?M(s):{},void 0===r&&(r={});var a=dP(r,"background",aC);a?s.background=a(t,s.background):delete s.background,s.title=Mw(t,s.title,r.title),s.content=function(t,e,i){var n,s=cP(e,"$type");void 0===s&&e&&(e.hasOwnProperty("slider")||e.hasOwnProperty("scroller"))&&(s="textarea"),n="textarea"===s?new uP(t,e,i):new Mw(t,e,i);return t.add.existing(n),n}(t,s.content,r.content),s.content instanceof hP&&Il(s,"height")&&!Il(s,"proportion.content")&&Z(s,"proportion.content",1);var h=s.button,l=s.buttonA||h,c=s.buttonB||h,d=s.buttonMode;void 0===d&&(d=l&&c?2:l?1:0);var f=r.button,p=r.buttonA||f,v=r.buttonB||f;switch(d){case 2:s.actions=[Mw(t,l,p),Mw(t,c,v)];break;case 1:s.actions=[Mw(t,l,p)];break;case 0:break;default:s.actions=[];}var g=s.choice;g&&(s.choices=[]),(o=e.call(this,t,s)).type="rexConfirmDialog",o.buttonMode=d,o.defaultActionConfig=h,o.defaultActionButtonCreator=f,o.defaultChoiceConfig=g,o.defaultChoiceCreator=r.choice;var y=o.childrenMap.actions;return o.addChildrenMap("buttonA",y?y[0]:null),o.addChildrenMap("buttonB",y?y[1]:null),Fw.call(u(o)),o}return r(i)}(Sw);Object.assign(fP.prototype,Bw),T.register("confirmDialog",(function(t,e){var i=new fP(this.scene,t,e);return this.scene.add.existing(i),i})),Z(window,"RexPlugins.UI.ConfirmDialog",fP);var pP=Phaser.Utils.Objects.GetValue,vP=function(t,e,i){var n=pP(t,"proportion.".concat(e),i.proportion),s=pP(t,"align.".concat(e),"center"),r=pP(t,"space.".concat(e),void 0);if("number"==typeof r&&i.paddingKey){var o=r;(r={})[i.paddingKey]=o;}return {proportion:n,align:s,padding:r,expand:pP(t,"expand.".concat(e),!0)}},gP=function(t){return vP(t,"header",{proportion:0,paddingKey:"bottom"})},yP=function(t){return vP(t,"leftSide",{proportion:0,paddingKey:"right"})},kP=function(t){return vP(t,"content",{proportion:1})},mP=function(t){return vP(t,"rightSide",{proportion:0,paddingKey:"left"})},bP=function(t){return vP(t,"footer",{proportion:0,paddingKey:"top"})},xP=function(t,e){var i=new vx(t,{orientation:e});return t.add.existing(i),i},CP=Phaser.Utils.Objects.GetValue,wP=[function(t){var e=this.scene,i=t.header;i&&this.add(i,gP(t));var n=xP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,yP(t));var r=t.content;r&&n.add(r,kP(t));var o=t.rightSide;o&&n.add(o,mP(t));var a=t.footer;a&&this.add(a,bP(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,gP(t));var n=xP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,yP(t));var r=xP(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=xP(e,0);r.add(o,{proportion:1,align:"center",padding:0,expand:!0});var a=t.content;a&&o.add(a,kP(t));var h=t.rightSide;h&&o.add(h,mP(t));var l=t.footer;l&&r.add(l,bP(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,gP(t));var n=xP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=xP(e,1);n.add(s,{proportion:1,align:"center",padding:0,expand:!0});var r=xP(e,0);s.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.leftSide;o&&r.add(o,yP(t));var a=t.content;a&&r.add(a,kP(t));var h=t.footer;h&&s.add(h,bP(t));var l=t.rightSide;l&&n.add(l,mP(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,gP(t));var n=xP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,yP(t));var r=xP(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.content;o&&r.add(o,kP(t));var a=t.footer;a&&r.add(a,bP(t));var h=t.rightSide;h&&n.add(h,mP(t));}],SP={FFF:0,LFF:1,FFR:2,LFR:3},PP=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),void 0===s&&(s={}),s.orientation=1,(r=e.call(this,t,s)).type="rexHolyGrail",r.build(s),r}return r(i)}(vx),TP={build:function(t){this.clear(!0);var e=CP(t,"background",void 0);e&&this.addBackground(e);var i=CP(t,"layoutMode",0);"string"==typeof i&&(i=SP[i.toUpperCase()]),(wP[i]||wP[0]).call(this,t),this.addChildrenMap("background",t.background),this.addChildrenMap("header",t.header),this.addChildrenMap("leftSide",t.leftSide),this.addChildrenMap("content",t.content),this.addChildrenMap("rightSide",t.rightSide),this.addChildrenMap("footer",t.footer);}};Object.assign(PP.prototype,TP),T.register("holyGrail",(function(t){var e=new PP(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.HolyGrail",PP);var OP={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):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 Ov(this.getButton(t,e)),this},showLeftButton:function(t){return Ov(this.getLeftButton(t)),this},showRightButton:function(t){return Ov(this.getRightButton(t)),this},showTopButton:function(t){return Ov(this.getTopButton(t)),this},showBottomButton:function(t){return Ov(this.getBottomButton(t)),this},hideButton:function(t,e){return Mv(this.getButton(t,e)),this},hideLeftButton:function(t){return Mv(this.getLeftButton(t)),this},hideRightButton:function(t){return Mv(this.getRightButton(t)),this},hideTopButton:function(t){return Mv(this.getTopButton(t)),this},hideBottomButton:function(t){return Mv(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},forEachButton:function(t,e,i){return this.getButtonsSizer(t).forEachButtton(e,i),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}},MP=Phaser.Utils.Objects.GetValue,EP=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),s.column=3,s.row=3,(r=e.call(this,t,s)).type="rexTabs",r.eventEmitter=MP(s,"eventEmitter",u(r));var o,a,h,l,c=MP(s,"background",void 0),d=MP(s,"panel",void 0),f=MP(s,"leftButtons",void 0),p=MP(s,"leftButtonsBackground",void 0),v=MP(s,"rightButtons",void 0),g=MP(s,"rightButtonsBackground",void 0),y=MP(s,"topButtons",void 0),k=MP(s,"topButtonsBackground",void 0),m=MP(s,"bottomButtons",void 0),b=MP(s,"bottomButtonsBackground",void 0),x=MP(s,"click",void 0);if(c&&r.addBackground(c),d&&r.add(d,1,1,"center",0,!0),f){var C=MP(s,"space.leftButtonsOffset",0),w=MP(s,"space.leftButton",0);o=new tw(t,{groupName:"left",background:p,buttons:f,orientation:1,space:{item:w},align:MP(s,"align.leftButtons",void 0),click:x,eventEmitter:r.eventEmitter});var S={top:C};r.add(o,0,1,"top",S,!1);}if(v){var P=MP(s,"space.rightButtonsOffset",0),T=MP(s,"space.rightButton",0);a=new tw(t,{groupName:"right",background:g,buttons:v,orientation:1,space:{item:T},align:MP(s,"align.rightButtons",void 0),click:x,eventEmitter:r.eventEmitter});S={top:P};r.add(a,2,1,"top",S,!1);}if(y){var O=MP(s,"space.topButtonsOffset",0),M=MP(s,"space.topButton",0);h=new tw(t,{groupName:"top",background:k,buttons:y,orientation:0,space:{item:M},align:MP(s,"align.topButtons",void 0),click:x,eventEmitter:r.eventEmitter});S={left:O};r.add(h,1,0,"left",S,!1);}if(m){var E=MP(s,"space.bottomButtonsOffset",0),_=MP(s,"space.bottomButton",0);l=new tw(t,{groupName:"bottom",background:b,buttons:m,orientation:0,space:{item:_},align:MP(s,"align.bottomButtons",void 0),click:x,eventEmitter:r.eventEmitter});S={left:E};r.add(l,1,2,"left",S,!1);}return r.addChildrenMap("background",c),r.addChildrenMap("panel",d),r.addChildrenMap("leftButtons",f),r.addChildrenMap("rightButtons",v),r.addChildrenMap("topButtons",y),r.addChildrenMap("bottomButtons",m),r.addChildrenMap("leftButtonsSizer",o),r.addChildrenMap("rightButtonsSizer",a),r.addChildrenMap("topButtonsSizer",h),r.addChildrenMap("bottomButtonsSizer",l),r}return r(i)}(Dx);Object.assign(EP.prototype,OP),T.register("tabs",(function(t){var e=new EP(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Tabs",EP),T.register("slider",(function(t){var e=new pS(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Slider",pS);var _P=function(){function t(e,i){n(this,t),this.container=null,this._deltaHeight=0,this.setParent(e);}return r(t,[{key:"setParent",value:function(t){this.parent=t,this.parentContainer=t.getParentContainer();}},{key:"destroy",value:function(t){void 0===t&&(t=!1),t||this.destroyContainer(),this.deltaHeight=0,this.data=void 0,this.container=null,this.parent=void 0,this.parentContainer=void 0;}},{key:"table",get:function(){return this.parent}},{key:"scrollMode",get:function(){return this.parentContainer.scrollMode}},{key:"colIndx",get:function(){return this.parent.cellIndxeToColIndex(this.index)}},{key:"rowIndx",get:function(){return this.parent.cellIndxeToRowIndex(this.index)}},{key:"getContainer",value:function(){return this.container}},{key:"setContainer",value:function(t){return t?(this.container&&this.container.destroy(),this.container=t,this.parentContainer.add(t),this):(this.destroyContainer(),this)}},{key:"destroyContainer",value:function(){return this.container&&(this.container.destroy(),this.container=null),this}},{key:"popContainer",value:function(){if(this.container){var t=this.container;return this.container=null,this.parentContainer.remove(t),t}return null}},{key:"setXY",value:function(t,e){return this.container&&this.parentContainer.setChildLocalPosition(this.container,t,e),this}},{key:"setCellContainerAlign",value:function(t){return "string"==typeof t&&(t=Wf[t]),this.cellContainerAlign=t,this}},{key:"deltaHeight",get:function(){return this._deltaHeight},set:function(t){null==t&&(t=0);var e=this.parent;0===this._deltaHeight&&0!==t?e.nonZeroDeltaHeightCount++:0!==this._deltaHeight&&0===t&&e.nonZeroDeltaHeightCount--;var i=this._deltaHeight!==t;if(this._deltaHeight=t,i){e.resetTotalRowsHeight();var n=0===this.scrollMode?"cellheightchange":"cellwidthchange";this.parentContainer.emit(n,this,this.container,this.parentContainer);}}},{key:"deltaWidth",get:function(){return this.deltaHeight},set:function(t){this.deltaHeight=t;}},{key:"setDeltaHeight",value:function(t){return this.deltaHeight=t,this}},{key:"setDeltaWidth",value:function(t){return this.deltaHeight=t,this}},{key:"height",get:function(){return 0===this.scrollMode?this.deltaHeight+this.parent.defaultCellHeight:this.parent.defaultCellWidth},set:function(t){1!==this.scrollMode&&this.setDeltaHeight(t-this.parent.defaultCellHeight);}},{key:"setHeight",value:function(t){return this.height=t,this}},{key:"width",get:function(){return 0===this.scrollMode?this.parent.defaultCellWidth:this.deltaHeight+this.parent.defaultCellHeight},set:function(t){0!==this.scrollMode&&this.setDeltaHeight(t-this.parent.defaultCellHeight);}},{key:"setWidth",value:function(t){return this.width=t,this}},{key:"scene",get:function(){return this.parentContainer.scene}}]),t}();Object.assign(_P.prototype,Ct);var RP=Phaser.Utils.Objects.GetValue,LP=Phaser.Utils.Array.SpliceOne,BP=function(){function t(e,i){n(this,t),this.parent=e,this.cells=[],this.cellPool=new st,this.resetFromJSON(i);}return r(t,[{key:"resetFromJSON",value:function(t){void 0===t&&(t={}),this.colCount=void 0,this.nonZeroDeltaHeightCount=0,this.resetTotalRowsHeight();var e=t.cellHeight;void 0===e&&(e=30);var i=t.cellWidth;return void 0===i&&(i=30),this.setDefaultCellHeight(e),this.setDefaultCellWidth(i),this.initCells(RP(t,"cellsCount",0)),this.setColumnCount(RP(t,"columns",1)),this}},{key:"destroy",value:function(t){this.cellPool.destroy(),this.cells=void 0,this.parent=void 0;}},{key:"defaultCellHeightMode",get:function(){return 0===this.nonZeroDeltaHeightCount}},{key:"setDefaultCellHeight",value:function(t){return this.defaultCellHeight=t,this}},{key:"setDefaultCellWidth",value:function(t){return this.defaultCellWidth=t,this}},{key:"initCells",value:function(t){var e=this.cells;e.length=t;for(var i=0;i=0&&t=0&&i0&&n)){if(0===r)return 2===e&&(i+=1),i;if(1===e){var o=i;(n=(i+=1)>=0&&i=this.colCount?null:e*this.colCount+t}},{key:"rowIndexToHeight",value:function(t,e){if(this.defaultCellHeightMode)return (e-t+1)*this.defaultCellHeight;for(var i=0,n=t;n<=e;n++)i+=this.getRowHeight(n);return i}},{key:"colIndexToWidth",value:function(t,e){return (e-t+1)*this.defaultCellWidth}},{key:"getRowHeight",value:function(t){var e=this.colCount;if(e<=1)return this.getCellHeight(this.colRowToCellIndex(0,t));for(var i,n=0,s=0;sthis.topTableOY,r=tthis.leftTableOX,r=tt?this.removeCells(t,e-t):this.insertNewCells(e,t-e)),this},insertNewCells:function(t,e){return "object"===i(t)&&(t=t.index),void 0===e&&(e=1),e<=0||(t=JP(t,0,this.cellsCount),this.table.insertNewCells(t,e)),this},removeCells:function(t,e){if("object"===i(t)&&(t=t.index),void 0===e&&(e=1),t<0&&(e+=t,t=0),e<=0)return this;if(t>this.cellsCount)return this;for(var n,s=t,r=t+e;sb.bottom&&(l=c.getTopLeft().y,t.setOrigin(0,1).setPosition(h+d,l+f));},WT={down:0,up:1},YT=Phaser.Utils.Objects.GetValue,VT=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),null==s.transitIn&&(s.transitIn=function(t,e){Xp(t,e,"y","Cubic");}),null==s.transitOut&&(s.transitOut=function(t,e){!function(t,e,i,n,s){void 0===n&&(n="Linear");var r={mode:0};switch(i){case 0:case"x":r.end={x:0};break;case 1:case"y":r.end={y:0};break;default:r.end=0;}r.duration=e,r.ease=n,void 0===s?s=new Yp(t,r):s.resetFromJSON(r),s.restart();}(t,e,"y","Linear");}),s.manualClose=!0,s.clickOutsideClose=!0,s.destroy=!0,r=e.call(this,t,s),FT(t,s),t.isRexSizer&&t.layout();var o=YT(s,"touchOutsideClose",!1),a=YT(s,"anyTouchClose",!1);return a&&(o=!1),a?r.once("open",r.anyTouchClose,u(r)):o&&r.once("open",r.touchOutsideClose,u(r)),r.requestOpen(),r}return r(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.scene.input.off("pointerup",this.touchCloseCallback,this),p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"touchOutsideClose",value:function(){return this.scene.input.on("pointerup",this.touchCloseCallback,this),this.clickOutsideTest=!0,this}},{key:"anyTouchClose",value:function(){return this.scene.input.once("pointerup",this.touchCloseCallback,this),this}},{key:"touchCloseCallback",value:function(t){this.clickOutsideTest&&ag(this.parent,t.worldX,t.worldY)||this.requestClose();}},{key:"onOpen",value:function(){this.emit("open",this.parent,this),p(h(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.parent,this),p(h(i.prototype),"onClose",this).call(this);}}]),i}(Kv),XT={openListPanel:function(){if(this.listPanel)return this;var t,e=zT.call(this);e.on("button.over",(function(t,i,n,s){this.listOnButtonOver&&this.listOnButtonOver.call(this,t,i,n,s),this.emit("button.over",this,e,t,i,n,s);}),this).on("button.out",(function(t,i,n,s){this.listOnButtonOut&&this.listOnButtonOut.call(this,t,i,n,s),this.emit("button.out",this,e,t,i,n,s);}),this),t=this.listAlignMode&&"label"!==this.listAlignMode?this.getElement(this.listAlignMode):this;var i=new VT(e,{duration:{in:this.listEaseInDuration,out:this.listEaseOutDuration},transitIn:this.listTransitInCallback,transitOut:this.listTransitOutCallback,expandDirection:this.listExpandDirection,alignTargetX:t,alignTargetY:this,alignSide:this.listAlignSide,bounds:this.listBounds,anyTouchClose:!0}).on("open",(function(){e.on("button.click",(function(t,i,n,s){this.listOnButtonClick&&this.listOnButtonClick.call(this,t,i,n,s),this.emit("button.click",this,e,t,i,n,s);}),this),this.emit("list.open",this,e);}),this).on("close",(function(){this.listPanel=void 0,this.dropDownBehavior=void 0;}),this);return this.listPanel=e,this.dropDownBehavior=i,this.pin(e),this},closeListPanel:function(){return this.dropDownBehavior?(this.dropDownBehavior.requestClose(),this):this},toggleListPanel:function(){return this.listPanel?this.closeListPanel():this.openListPanel(),this}};Object.assign(XT,IT);var GT=Phaser.Utils.Objects.GetValue,UT=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),(r=e.call(this,t,s)).type="rexDropDownList",r.timer=void 0,r.setOptions(GT(s,"options"));var o=GT(s,"list");return r.setWrapEnable(GT(o,"wrap",!1)),r.setCreateButtonCallback(GT(o,"createButtonCallback")),r.setCreateListBackgroundCallback(GT(o,"createBackgroundCallback")),r.setButtonClickCallback(GT(o,"onButtonClick")),r.setButtonOverCallback(GT(o,"onButtonOver")),r.setButtonOutCallback(GT(o,"onButtonOut")),r.setListExpandDirection(GT(o,"expandDirection")),r.setListEaseInDuration(GT(o,"easeIn",500)),r.setListEaseOutDuration(GT(o,"easeOut",100)),r.setListTransitInCallback(GT(o,"transitIn")),r.settListTransitOutCallback(GT(o,"transitOut")),r.setListSize(GT(o,"width"),GT(o,"height")),r.setListAlignmentMode(GT(o,"alignParent","text")),r.setListAlignmentSide(GT(o,"alignSide","")),r.setListBounds(GT(o,"bounds")),r.setListSpace(GT(o,"space")),r.setListDraggable(GT(o,"draggable",!1)),r.setValueChangeCallback(GT(s,"setValueCallback"),GT(s,"setValueCallbackScope")),r.setValue(GT(s,"value")),r.onClick(r.toggleListPanel,u(r)),r}return r(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.listPanel&&(this.listPanel.destroy(t),this.listPanel=void 0),p(h(i.prototype),"destroy",this).call(this,t));}},{key:"setOptions",value:function(t){return void 0===t&&(t=[]),this.options=t,this}},{key:"setValueChangeCallback",value:function(t,e){return this.valueChangeCallback=t,this.valueChangeCallbackScope=e,this}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"value",get:function(){return this._value},set:function(t){if(this._value!==t){var e=this._value;this._value=t;var i=this.valueChangeCallback,n=this.valueChangeCallbackScope;i&&(n?i.call(n,this,t,e):i(this,t,e)),this.emit("valuechange",this,t,e);}}},{key:"emitButtonClick",value:function(t){var e=this.options[t];return e?(this.emit("button.click",this,void 0,e,t),this):this}}]),i}(oC);Object.assign(UT.prototype,XT),T.register("dropDownList",(function(t){var e=new UT(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.DropDownList",UT);var HT=function(t,e,i){void 0===i&&(i={});var n=(e=e?M(e):{}).label||e.button,s=e.button||e.label;delete e.label,delete e.button;var r=i.label||i.button||i,o=i.button||i.label||i,a=kC(t,n,r);return a.list=e.list||{},a.list.createButtonCallback=function(t,e){var i=Mw(t,s,o).resetDisplayContent({text:e.text});return e.hasOwnProperty("value")&&(i.value=e.value),i},a.list.onButtonOver=function(t,e,i,n){t.setHoverState&&t.setHoverState(!0);},a.list.onButtonOut=function(t,e,i,n){t.setHoverState&&t.setHoverState(!1);},a},NT=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;return n(this,i),s=HT(t,s,r),(o=e.call(this,t,s)).type="rexSimpleDropDownList",o}return r(i,[{key:"setOptions",value:function(t){void 0===t&&(t=[]);for(var e=0,n=t.length;e=this.pageCount-1}},{key:"totalLinesCount",get:function(){return this.lines?this.lines.length:0}},{key:"startLineIndex",get:function(){return this._startLineIndex},set:function(t){t=eO(t,0,this.totalLinesCount-1),this._startLineIndex=t;}},{key:"setStartLineIndex",value:function(t){return this.startLineIndex=t,this}},{key:"pageLinesCount",get:function(){if(void 0!==this.maxLines)return this.maxLines;var t;switch(this.textObjectType){case 0:case 1:var e=this.parent.style.maxLines;t=e>0?e:Math.floor(function(t){var e,i,n;switch(US(t)){case 0:case 1:e=t.height-t.padding.top-t.padding.bottom,i=t.lineSpacing,n=t.style.metrics.fontSize+t.style.strokeThickness;break;case 2:e=t.height,i=0;var s=t.fontSize/t.fontData.size;n=t.fontData.lineHeight*s;}return (e-i)/(n+i)}(this.parent));break;case 2:t=this.totalLinesCount;}return t}},{key:"content",get:function(){return this.sections.join(this.pageBreak)}}]),i}(oo);Object.assign(iO.prototype,QT);var nO,sO=Phaser.Utils.Objects.GetFastValue,rO=Phaser.Utils.Objects.GetValue,oO=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).timer=null,r.resetFromJSON(s),r}return r(i,[{key:"resetFromJSON",value:function(t){this.setTextWrapEnable(rO(t,"wrap",!1)),this.setTypeMode(rO(t,"typeMode",0)),this.setTypingSpeed(rO(t,"speed",333)),this.setTextCallback=sO(t,"setTextCallback",null),this.setTextCallbackScope=sO(t,"setTextCallbackScope",null),this.setTypingContent(sO(t,"text","")),this.typingIdx=sO(t,"typingIdx",0),this.insertIdx=null,this.insertChar=null;var e=sO(t,"elapsed",null);return null!==e&&this.start(void 0,void 0,this.typingIdx,e),this}},{key:"shutdown",value:function(t){this.isShutdown||(this.freeTimer(),p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"setTypeMode",value:function(t){return "string"==typeof t&&(t=hO[t]),this.typeMode=t,this}},{key:"setTypeSpeed",value:function(t){return this.speed=t,this}},{key:"setTypingSpeed",value:function(t){return this.speed=t,this}},{key:"setTextWrapEnable",value:function(t){return void 0===t&&(t=!0),this.textWrapEnable=t,this}},{key:"text",get:function(){return this._text},set:function(t){var e=aO(t);this.textWrapEnable&&(e=function(t,e){switch(US(t)){case 0:t.style.syncFont(t.canvas,t.context),e=t.runWordWrap(e);break;case 1:e=t.getText(e,void 0,void 0,!0);break;case 2:e=t.setText(e).getTextBounds().wrappedText;}return e}(this.parent,e)),this._text=e;}},{key:"isTyping",get:function(){return null!==this.getTimer()}},{key:"isLastChar",get:function(){return this.typingIdx===this.textLen}},{key:"start",value:function(t,e,i,n){return void 0!==t&&this.setTypingContent(t),void 0!==e&&(this.speed=e),void 0===i&&(i=0),this.typingIdx=i+1,0===this.speed?this.stop(!0):(this.setText(""),this.startTimer(n)),this}},{key:"appendText",value:function(t){var e=this.text.concat(aO(t));return this.isTyping?this.setTypingContent(e):this.start(e,void 0,this.textLen),this}},{key:"stop",value:function(t){if(this.getTimer()&&this.freeTimer(),t){for(;!this.isLastChar;)this.getTypingString(this.text,this.typingIdx,this.textLen,this.typeMode),this.emit("typechar",this.insertChar),this.typingIdx++;this.setText(this.text),this.emit("type"),this.emit("complete",this,this.parent);}return this}},{key:"pause",value:function(){var t=this.getTimer();return t&&(t.paused=!0),this}},{key:"resume",value:function(){var t=this.getTimer();return t&&(t.paused=!1),this}},{key:"setTypingContent",value:function(t){return this.text=t,this.textLen=this.getTextLength(this.text),this}},{key:"onTyping",value:function(){var t=this.getTypingString(this.text,this.typingIdx,this.textLen,this.typeMode);this.setText(t),this.emit("typechar",this.insertChar),this.emit("type"),this.isLastChar?(this.freeTimer(),this.emit("complete",this,this.parent)):(this.timer.delay=this.speed,this.typingIdx++);}},{key:"getTypingString",value:function(t,e,i,n){var s;if(0===n){var r=0,o=e;this.insertIdx=o,s=this.getSubString(t,r,o);}else if(1===n){r=(o=i)-e;this.insertIdx=0,s=this.getSubString(t,r,o);}else if(2===n){var a=i/2;o=(r=Math.floor(a-e/2))+e;this.insertIdx=e%2?e:0,s=this.getSubString(t,r,o);}else if(3===n){var h,l=Math.floor(e/2);if(l>0){r=(o=i)-l;h=this.getSubString(t,r,o);}else h="";var u,c=e-l;if(c>0){o=(r=0)+c;this.insertIdx=o,u=this.getSubString(t,r,o);}else u="",this.insertIdx=0;s=u+h;}return this.insertChar=s.charAt(this.insertIdx-1),s}},{key:"startTimer",value:function(t){var e;return this.timer&&this.freeTimer(),void 0===t?e=0:(this.speed,e=t),this.timer=this.scene.time.addEvent({delay:1e-4,startAt:e,loop:!0,callback:this.onTyping,callbackScope:this}),this}},{key:"getTimer",value:function(){return this.timer}},{key:"freeTimer",value:function(){return this.timer&&(this.timer.remove(),this.timer=null),this}},{key:"setText",value:function(t){this.setTextCallback&&(t=this.setTextCallbackScope?this.setTextCallback.call(this.setTextCallbackScope,t,this.isLastChar,this.insertIdx):this.setTextCallback(t,this.isLastChar,this.insertIdx)),this.textWrapEnable?ZS(this.parent,t):this.parent.setText(t);}},{key:"getTextLength",value:function(t){var e=this.parent;return e.getPlainText?e.getPlainText(t).length:t.length}},{key:"getSubString",value:function(t,e,i){var n=this.parent;return n.getSubString?n.getSubString(t,e,i):t.slice(e,i)}}]),i}(oo),aO=function(t){return Array.isArray(t)?t=t.join("\n"):"number"==typeof t&&(t=t.toString()),t},hO={"left-to-right":0,"right-to-left":1,"middle-to-sides":2,"sides-to-middle":3},lO=Phaser.Utils.Objects.GetValue,uO=function(t){a(i,t);var e=d(i);function i(t,s){return n(this,i),void 0===s&&(s={}),s.hasOwnProperty("layoutMode")||(s.layoutMode=1),e.call(this,t,s)}return r(i)}((void 0===nO&&(nO="rexTextBox"),function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),(r=e.call(this,t,s)).type=nO;var o=r.childrenMap.text;return r.page=new iO(o,lO(s,"page",void 0)),r.typing=new oO(o,lO(s,"typing",s.type)),r.typing.on("complete",r.onPageEnd,u(r)).on("type",r.onType,u(r)).on("typechar",r.onTypeChar,u(r)),r.textWidth=o.width,r.textHeight=o.height,r}return r(i,[{key:"start",value:function(t,e){return this.page.setText(t),void 0!==e&&this.setTypingSpeed(e),this.emit("start"),this.typeNextPage(),this}},{key:"typeNextPage",value:function(){if(this.isLastPage)this.emit("complete");else {var t=this.page.getNextPage();this.typing.start(t);}return this}},{key:"pause",value:function(){return this.isTyping&&(this.typing.pause(),this.emit("pause")),this}},{key:"resume",value:function(){return this.isTyping||(this.emit("resume"),this.typing.resume()),this}},{key:"stop",value:function(t){return this.typing.stop(t),this}},{key:"showLastPage",value:function(){return this.typing.stop(),this.page.showLastPage(),this.emit("type"),this.onPageEnd(),this}},{key:"setTypeSpeed",value:function(t){return this.typing.setTypingSpeed(t),this}},{key:"setTypingSpeed",value:function(t){return this.typing.setTypingSpeed(t),this}},{key:"isTyping",get:function(){return this.typing.isTyping}},{key:"isLastPage",get:function(){return this.page.isLastPage}},{key:"isFirstPage",get:function(){return this.page.isFirstPage}},{key:"pageCount",get:function(){return this.page.pageCount}},{key:"pageIndex",get:function(){return this.page.pageIndex}},{key:"typingSpeed",get:function(){return this.typing.speed}},{key:"onType",value:function(){var t=this.childrenMap.text;this.textWidth===t.width&&this.textHeight===t.height||(this.textWidth=t.width,this.textHeight=t.height,this.getTopmostSizer().layout()),this.emit("type");}},{key:"onTypeChar",value:function(t){this.emit("typechar",t);}},{key:"onPageEnd",value:function(){var t=this.isLastPage;this.emit("pageend"),t&&this.emit("complete");}}]),i}(PC)));T.register("textBox",(function(t){var e=new uO(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.TextBox",uO);var cO=Phaser.Utils.Objects.GetValue,dO=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),(r=e.call(this,t,s)).type="rexNumberBar";var o,a=cO(s,"background",void 0),h=cO(s,"icon",void 0),l=cO(s,"iconMask",void 0),c=cO(s,"slider",void 0),d=cO(s,"text",void 0),f=cO(s,"space.icon",0),p=cO(s,"space.slider",0);(a&&r.addBackground(a),h)&&(0===r.orientation?(c||d)&&(v={right:f}):(c||d)&&(v={bottom:f}),r.add(h,{proportion:0,align:"center",padding:v}),l&&(l=sC.call(u(r),h,h,1)));if(c){var v,g;if(c.orientation=r.orientation,c.eventEmitter=u(r),c.value=null,c.hasOwnProperty("input")||(c.input=-1),o=new pS(t,c),t.add.existing(o),0===r.orientation?d&&(v={right:p}):d&&(v={bottom:p}),0===r.orientation)g=void 0===cO(c,"width",void 0)?1:0;else g=void 0===cO(c,"height",void 0)?1:0;r.add(o,{proportion:g,align:"center",padding:v});}d&&r.add(d),r.addChildrenMap("background",a),r.addChildrenMap("icon",h),r.addChildrenMap("iconMask",l),r.addChildrenMap("slider",o),r.addChildrenMap("text",d);var y=cO(s,"valuechangeCallback",null);if(null!==y){var k=cO(s,"valuechangeCallbackScope",void 0);r.on("valuechange",y,k);}return r.setEnable(cO(s,"enable",void 0)),r.setValue(cO(s,"value",0)),r}return r(i,[{key:"enable",get:function(){return !!this.childrenMap.slider&&this.childrenMap.slider.enable},set:function(t){this.childrenMap.slider&&this.childrenMap.slider.setEnable(t);}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"value",get:function(){return this.childrenMap.slider?this.childrenMap.slider.value:0},set:function(t){this.childrenMap.slider&&(this.childrenMap.slider.value=t);}},{key:"setValue",value:function(t,e,i){return this.childrenMap.slider&&this.childrenMap.slider.setValue(t,e,i),this}},{key:"addValue",value:function(t,e,i){return this.childrenMap.slider&&this.childrenMap.slider.addValue(t,e,i),this}},{key:"getValue",value:function(t,e){return this.childrenMap.slider?this.childrenMap.slider.getValue(t,e):0}},{key:"easeValueTo",value:function(t,e,i){return this.childrenMap.slider&&this.childrenMap.slider.easeValueTo(t,e,i),this}},{key:"stopEaseValue",value:function(){return this.childrenMap.slider&&this.childrenMap.slider.stopEaseValue(),this}},{key:"setEaseValueDuration",value:function(t){return this.childrenMap.slider&&this.childrenMap.slider.setEaseValueDuration(t),this}},{key:"setEaseValueFunction",value:function(t){return this.childrenMap.slider&&this.childrenMap.slider.setEaseValueFunction(t),this}},{key:"text",get:function(){var t=this.childrenMap.text;return void 0===t?"":t.text?t.text:t.getData("text")},set:function(t){var e=this.childrenMap.text;void 0!==e&&(e.setText?e.setText(t):e.setData("text",t));}},{key:"setText",value:function(t){return this.text=t,this}}]),i}(vx);T.register("numberBar",(function(t){var e=new dO(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.NumberBar",dO),T.register("scrollBar",(function(t){var e=new kS(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ScrollBar",kS);var fO=Phaser.Utils.Objects.GetValue,pO={leftTop:"left-top",centerTop:"center-top",rightTop:"right-top",leftCenter:"left-center",center:"center",rightCenter:"right-center",leftBottom:"left-bottom",centerBottom:"center-bottom",rightBottom:"right-bottom"},vO=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),(r=e.call(this,t,s)).type="rexBadge";var o=fO(s,"background",void 0);o&&r.addBackground(o),r.addChildrenMap("background",o);var a=fO(s,"main",void 0);for(var h in a&&r.add(a,{key:"main",align:"center",expand:!1}),r.addChildrenMap("main",a),pO){var l=fO(s,h,void 0);l&&(r.add(l,{key:h,align:pO[h],expand:!1}),r.addChildrenMap(h,l));}return r}return r(i)}(Mk);T.register("badgeLabel",(function(t){var e=new vO(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.BadgeLabel",vO);var gO=Mk.prototype.add,yO=function(t,e,i,n,s,r,o,a,h){return t.setVisible(!1),gO.call(this,t,e,i,n,s,r,o,a,h),this},kO={add:yO,addPage:yO},mO=zf.prototype.setChildVisible,bO={getPage:function(t){return void 0===t?null:this.sizerChildren.hasOwnProperty(t)?this.sizerChildren[t]:null},swapPage:function(t,e){this._previousKey=this._currentKey;var i=this.previousPage;i&&(0===this.swapMode?(mO.call(this,i,!1),this.emit("pageinvisible",i,this._previousKey,this)):i.destroy()),t&&!this.sizerChildren.hasOwnProperty(t)&&this.emit("createpage",t,this),this._currentKey=t;var n=this.currentPage;return n&&(mO.call(this,n,!0),this.emit("pagevisible",n,this._currentKey,this),void 0===e&&(e=this.fadeInDuration),e>0&&n.setAlpha(0).fadeIn(e,1)),this},hasPage:function(t){return this.sizerChildren.hasOwnProperty(t)}};Object.assign(bO,kO);var xO=Phaser.Utils.Objects.GetValue,CO=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).type="rexPages",r.childrenMap=r.sizerChildren,r._previousKey=void 0,r._currentKey=void 0,r.setSwapMode(xO(s,"swapMode",0)),r.setFadeInDuration(xO(s,"fadeIn",0)),r}return r(i,[{key:"setSwapMode",value:function(t){return "string"==typeof t&&(t=wO[t]),this.swapMode=t,this}},{key:"setFadeInDuration",value:function(t){return this.fadeInDuration=t,this}},{key:"previousKey",get:function(){return this._previousKey}},{key:"currentKey",get:function(){return this._currentKey},set:function(t){this.swapPage(t);}},{key:"currentPage",get:function(){return this.getPage(this.currentKey)}},{key:"previousPage",get:function(){return this.getPage(this.previousKey)}},{key:"keys",get:function(){return Object.keys(this.sizerChildren)}}]),i}(Mk);Object.assign(CO.prototype,bO);var wO={invisible:0,destroy:1};T.register("pages",(function(t){var e=new CO(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Pages",CO);var SO=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"tint",get:function(){return 0===this.vertices.length?16777215:this.vertices[0].color}},{key:"setInteractive",value:function(){var t=function(t,e,i){for(var n=this.faces,s=0;s=e.length))return e[t].name},getPageIndex:function(t){for(var e=this.getElement("tabs.buttons"),i=0,n=e.length;ithis.topChildOY}},{key:"childOYExeceedBottom",value:function(t){return void 0===t&&(t=this.childOY),tthis.leftChildOX}},{key:"childOXExeceedRight",value:function(t){return void 0===t&&(t=this.childOX),tthis.childHeight?t=0:n?t=e:s&&(t=i)),this._childOY!==t&&(this._childOY=t,this.resetChildPosition()),n&&(this.execeedTopState||this.emit("execeedtop",this,t,e)),this.execeedTopState=n,s&&(this.execeedBottomState||this.emit("execeedbottom",this,t,i)),this.execeedBottomState=s;}},{key:"childOX",get:function(){return this._childOX},set:function(t){var e=this.leftChildOX,i=this.rightChildOX,n=this.childOXExceedLeft(t),s=this.childOXExeceedRight(t);this.clampChildOX&&(this.childVisibleWidth>this.childWidth?t=0:n?t=e:s&&(t=i)),this._childOX!==t&&(this._childOX=t,this.resetChildPosition()),n&&(this.execeedLeftState||this.emit("execeedleft",this,t,e)),this.execeedLeftState=n,s&&(this.execeedRightState||this.emit("execeedright",this,t,i)),this.execeedRightState=s;}},{key:"setChildOY",value:function(t){return this.childOY=t,this}},{key:"setChildOX",value:function(t){return this.childOX=t,this}},{key:"t",get:function(){var t=this.visibleHeight;return 0===t?0:this.childOY/-t},set:function(t){this.childOY=-this.visibleHeight*t;}},{key:"s",get:function(){var t=this.visibleWidth;return 0===t?0:this.childOX/-t},set:function(t){this.childOX=-this.visibleWidth*t;}},{key:"setChildOYByPercentage",value:function(t){return this.t=t,this}},{key:"setChildOXByPercentage",value:function(t){return this.s=t,this}}]),i}(pk);Object.assign(WM.prototype,jM);var YM=["top","bottom","centerY","center"],VM=["left","right","centerX","center"],XM=function(t,e,i){var n,s="Y"===(e=e.toUpperCase()),r=this.childrenMap.child;if(s){if(i)for(var o=0,a=YM.length;o=0?0:Math.abs(l)<=Math.abs(u)?l:u;}}else {if(i)for(o=0,a=VM.length;o=0?0:Math.abs(c)<=Math.abs(d)?c:d;}}switch(this.scrollMode){case 0:case 1:this.childOY+=n;break;default:this["childO".concat(e)]+=n;}},GM=Phaser.Utils.Objects.GetValue,UM=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=Yw(s),a=GM(s,"panel",void 0);void 0===a&&(a={}),a.scrollMode=o,a.clamplChildOY=GM(s,"clamplChildOY",!1),a.clamplChildOX=GM(s,"clamplChildOX",!1);var h,l,u=new WM(t,a);switch(t.add.existing(u),o){case 0:h=GM(s,"expand.panel",!0),l=!0;break;case 1:h=!0,l=GM(s,"expand.panel",!0);break;default:h=!0,l=!0;}s.type="rexScrollablePanel",s.child={gameObject:u,expandWidth:h,expandHeight:l,align:GM(s,"align.panel","center")};var c=GM(s,"space",void 0);return c&&(c.child=GM(c,"panel",0)),(r=e.call(this,t,s)).addChildrenMap("panel",u.child),r.addChildrenMap("panelLayer",u.maskLayer),r.addChildrenMap("mask",u.maskGameObject),r.addChildrenMap("scrollableBlock",u),r}return r(i,[{key:"setChildrenInteractive",value:function(t){return void 0===t&&(t={}),t.hasOwnProperty("eventEmitter")||(t.eventEmitter=this),t.hasOwnProperty("targets")||(t.targets=[this.childrenMap.panel]),ck(this.childrenMap.child,t),this}}]),i}(XS),HM={scrollToChild:function(t,e){if(!this.hasChild(t))return this;switch(this.scrollMode){case 0:XM.call(this,t,"y",e);break;case 1:XM.call(this,t,"x",e);break;default:XM.call(this,t,"y",e),XM.call(this,t,"x",e);}return this}};Object.assign(UM.prototype,HM),T.register("scrollablePanel",(function(t){var e=new UM(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ScrollablePanel",UM);var NM=function(t,e){t.popUp(e);},KM=function(t,e){t.scaleDown(e);},JM=function(t,e){t.fadeIn(e);},ZM=function(t,e){t.fadeOut(e);},qM=function t(e,i,n){var s,r=bt(n,"reverse",!1);if(gg(e[0]))if(r)for(o=(a=e.length)-1;o>=0;o--)s=t(e[o],i,n);else for(var o=0,a=e.length;on?1:it)return this;for(var e=this.commands.length-1;;){var i=this.commands[this.index],n=i[1];if(gg(n)||(n=Bu(iE,i,1)),qM(n,this.scope),this.emit("runcommand",n,this.scope),this.index===e)return this.complete(),this;if(this.index++,this.nextTime=this.getNextDt(this.nextTime),this.nextTime>t)return this}}},{key:"complete",value:function(){this.clock.stop(),this.state=2,this.emit("complete",this.parent,this);}},{key:"getNextDt",value:function(t){var e=this.commands[this.index][0];return 1===this.timeUnit&&(e*=1e3),1===this.dtMode&&(e+=t),e}},{key:"setDtMode",value:function(t){return "string"==typeof t&&(t=sE[t]),this.dtMode=t,this}},{key:"setTimeUnit",value:function(t){return "string"==typeof t&&(t=nE[t]),this.timeUnit=t,this}}]),i}(oo),iE=[],nE={ms:0,s:1,sec:1},sE={abs:0,absolute:0,inc:1,increment:1},rE=Phaser.Utils.Objects.GetValue,oE=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),void 0===s&&(s={text:createDefaultTextObject(t)}),(r=e.call(this,t,s)).type="rexToast",r.setTransitInTime(rE(s,"duration.in",200)),r.setDisplayTime(rE(s,"duration.hold",1200)),r.setTransitOutTime(rE(s,"duration.out",200)),r.setTransitInCallback(rE(s,"transitIn",aE.popUp)),r.setTransitOutCallback(rE(s,"transitOut",aE.scaleDown)),r.player=new eE(u(r),{dtMode:1}),r.messages=[],r.scaleX0=void 0,r.scaleY0=void 0,r.setVisible(!1),r}return r(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.player.destroy(),this.player=void 0,this.messages=void 0,p(h(i.prototype),"destroy",this).call(this,t));}},{key:"setDisplayTime",value:function(t){return this.displayTime=t,this}},{key:"setTransitOutTime",value:function(t){return this.transitOutTime=t,this}},{key:"setTransitInTime",value:function(t){return this.transitInTime=t,this}},{key:"setTransitInCallback",value:function(t){switch("string"==typeof t&&(t=aE[t]),t){case aE.popUp:t=NM;break;case aE.fadeIn:t=JM;}return t||(t=D),this.transitInCallback=t,this}},{key:"setTransitOutCallback",value:function(t){switch("string"==typeof t&&(t=aE[t]),t){case aE.scaleDown:t=KM;break;case aE.fadeOut:t=ZM;}return t||(t=D),this.transitOutCallback=t,this}},{key:"setScale",value:function(t,e){return void 0===e&&(e=t),this.scaleX0=t,this.scaleY0=e,p(h(i.prototype),"setScale",this).call(this,t,e),this}},{key:"showMessage",value:function(t){if(void 0===this.scaleX0&&(this.scaleX0=this.scaleX),void 0===this.scaleY0&&(this.scaleY0=this.scaleY),void 0===t){if(0===this.messages.length)return this;t=this.messages.shift();}if(this.player.isPlaying)return this.messages.push(t),this;this.setScale(this.scaleX0,this.scaleY0).setVisible(!0),"string"==typeof t?this.setText(t):t(this),this.layout();var e=[[0,[this.transitInCallback,this,this.transitInTime]],[this.transitInTime,[D]],[this.displayTime,[this.transitOutCallback,this,this.transitOutTime]],[this.transitOutTime,[this.setVisible,!1]],[30,[D]]];return this.player.load(e,this).once("complete",(function(){this.showMessage();}),this).start(),this}}]),i}(oC),aE={popUp:0,fadeIn:1,scaleDown:0,fadeOut:1};T.register("toast",(function(t){var e=new oE(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Toast",oE);for(var hE,lE=function(t,e,i){void 0===i&&(i=!0),i?e=e?M(e):{}:e||(e={});var n=new eu(t,e);return t.add.existing(n),n},uE=["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenRod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","DarkOrange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","GoldenRod","Gray","Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory","Khaki","Lavender","LavenderBlush","LawnGreen","LemonChiffon","LightBlue","LightCoral","LightCyan","LightGoldenRodYellow","LightGray","LightGrey","LightGreen","LightPink","LightSalmon","LightSeaGreen","LightSkyBlue","LightSlateGray","LightSlateGrey","LightSteelBlue","LightYellow","Lime","LimeGreen","Linen","Magenta","Maroon","MediumAquaMarine","MediumBlue","MediumOrchid","MediumPurple","MediumSeaGreen","MediumSlateBlue","MediumSpringGreen","MediumTurquoise","MediumVioletRed","MidnightBlue","MintCream","MistyRose","Moccasin","NavajoWhite","Navy","OldLace","Olive","OliveDrab","Orange","OrangeRed","Orchid","PaleGoldenRod","PaleGreen","PaleTurquoise","PaleVioletRed","PapayaWhip","PeachPuff","Peru","Pink","Plum","PowderBlue","Purple","RebeccaPurple","Red","RosyBrown","RoyalBlue","SaddleBrown","Salmon","SandyBrown","SeaGreen","SeaShell","Sienna","Silver","SkyBlue","SlateBlue","SlateGray","SlateGrey","Snow","SpringGreen","SteelBlue","Tan","Teal","Thistle","Tomato","Turquoise","Violet","Wheat","White","WhiteSmoke","Yellow","YellowGreen"],cE=[15792383,16444375,65535,8388564,15794175,16119260,16770244,0,16772045,255,9055202,10824234,14596231,6266528,8388352,13789470,16744272,6591981,16775388,14423100,65535,139,35723,12092939,11119017,11119017,25600,12433259,9109643,5597999,16747520,10040012,9109504,15308410,9419919,4734347,3100495,3100495,52945,9699539,16716947,49151,6908265,6908265,2003199,11674146,16775920,2263842,16711935,14474460,16316671,16766720,14329120,8421504,8421504,32768,11403055,15794160,16738740,13458524,4915330,16777200,15787660,15132410,16773365,8190976,16775885,11393254,15761536,14745599,16448210,13882323,13882323,9498256,16758465,16752762,2142890,8900346,7833753,7833753,11584734,16777184,65280,3329330,16445670,16711935,8388608,6737322,205,12211667,9662683,3978097,8087790,64154,4772300,13047173,1644912,16121850,16770273,16770229,16768685,128,16643558,8421376,7048739,16753920,16729344,14315734,15657130,10025880,11529966,14381203,16773077,16767673,13468991,16761035,14524637,11591910,8388736,6697881,16711680,12357519,4286945,9127187,16416882,16032864,3050327,16774638,10506797,12632256,8900331,6970061,7372944,7372944,16775930,65407,4620980,13808780,32896,14204888,16737095,4251856,15631086,16113331,16777215,16119285,16776960,10145074],dE={},fE=0,pE=uE.length;fE0&&{height:this.colorComponentsHeight,formatLabel:this.colorComponentsFormatLabelConfig,inputText:this.colorComponentsInputTextConfig,space:this.colorComponentsSpace};var o=new QE(t,{width:n,height:r,background:e,space:this.colorPickerSpace,hPalette:{position:this.colorPickerHPalettePosition},colorComponents:s,value:this.value});return t.add.existing(o),o},e_={openColorPicker:function(){if(!this.colorPicker){var t=t_.call(this).layout(),e=new VT(t,{duration:{in:this.colorPickerEaseInDuration,out:this.colorPickerEaseOutDuration},transitIn:this.colorPickerTransitInCallback,transitOut:this.colorPickerTransitOutCallback,expandDirection:this.colorPickerExpandDirection,alignTargetX:this,alignTargetY:this,bounds:this.colorPickerBounds,touchOutsideClose:!0}).on("open",(function(){t.on("valuechange",(function(t){this.setValue(t);}),this);}),this).on("close",(function(){this.colorPicker=void 0,this.dropDownBehavior=void 0;}),this);return this.colorPicker=t,this.dropDownBehavior=e,this.pin(t),this}}};Object.assign(e_,wE);var i_=Phaser.Utils.Objects.GetValue,n_=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),(r=e.call(this,t,s)).type="rexColorInput",s.hasOwnProperty("colorPicker")||(s.colorPicker={background:{color:0}});var o=s.colorPicker,a=!1!==o&&null!==o;if(a){var h;r.setColorPickerSize(i_(o,"width",160),i_(o,"height",170));var l=i_(o,"background");h=l?function(t){return aC(t,l)}:i_(o,"createBackgroundCallback"),r.setCreateColorPickerBackgroundCallback(h),r.setColorPickerHPalettePosition(i_(o,"hPalettePosition",0)),r.setColorPickerExpandDirection(i_(o,"expandDirection")),r.setColorPickerEaseInDuration(i_(o,"easeIn",200)),r.setColorPickerEaseOutDuration(i_(o,"easeOut",200)),r.setColorPickerTransitInCallback(i_(o,"transitIn")),r.setColorPickerTransitOutCallback(i_(o,"transitOut")),r.setColorPickerBounds(i_(o,"bounds"));var c=i_(o,"space");void 0===c&&(c={left:10,right:10,top:10,bottom:10,item:8}),r.setColorPickerSpace(c);}var d=s.colorComponents;if(a&&(!1!==d&&null!==d)){r.setColorComponentsHeight(i_(d,"height",30)),r.setColorComponentsFormatLabelConfig(i_(d,"formatLabel"));var f=i_(d,"inputText");f||(f=i_(s,"inputText")),r.setColorComponentsInputTextConfig(f);var p=i_(d,"space");void 0===p&&(p={item:8}),r.setColorComponentsSpace(p);}var v=r.childrenMap.swatch;return v&&a&&r.onClick(v,r.openColorPicker,u(r)),r}return r(i)}(CE);Object.assign(n_.prototype,e_),T.register("colorInput",(function(t){var e=new n_(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ColorInput",n_),T.register("colorInputLite",(function(t){var e=new CE(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ColorInputBase",CE),T.register("colorPicker",(function(t){var e=new GE(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ColorPicker",GE),T.register("colorComponents",(function(t){var e=new qE(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ColorComponents",qE);var s_=function(t,e){return function(i,n,s,r){"panel"!==n&&s.moveChild(i,r?0:t,e);}},r_=function(t,e){return function(i,n,s,r){"panel"===n&&s.moveChild(i,r?0:t,e);}},o_={visible:{show:function(){return function(t,e,i,n){"panel"!==e&&i.setChildVisible(t,!0);}},hide:function(){return function(t,e,i,n){"panel"!==e&&i.setChildVisible(t,!1);}}},fade:{show:function(t,e){return void 0===e&&(e=1),function(i,n,s,r){"panel"!==n&&s.fadeChild(i,r?0:t,e);}},hide:function(t,e){return void 0===e&&(e=0),function(i,n,s,r){"panel"!==n&&s.fadeChild(i,r?0:t,e);}}},move:{show:s_,hide:s_},"move-panel":{show:r_,hide:r_}},a_=zf.prototype.setChildVisible,h_={setChildVisible:function(t,e){if("string"==typeof t){var i=t;t=this.sizerChildren[i];}else i=Pk(this.sizerChildren,t);return void 0===e&&(e=this.currentChildKey===i),a_.call(this,t,e),this}},l_={fadeChild:function(t,e,i){var n;return "string"==typeof t?(n=t,t=this.sizerChildren[n]):n=Pk(this.sizerChildren,t),void 0===e&&(e=500),void 0===i&&(i=this.currentChildKey===n?1:0),t.fadeIn(e,{start:t.alpha,end:i}),this},fadeChildPromise:function(t,e,i){return "string"==typeof t&&(t=this.sizerChildren[key]),this.fadeChild(t,e,i),t._fade?Ph(t._fade):Promise.resolve()}},u_={moveChild:function(t,e,i,n){var s;"string"==typeof t?(s=t,t=this.sizerChildren[s]):s=Pk(this.sizerChildren,t),void 0===e&&(e=500);var r,o,a,h,l=this.currentChildKey===s;if(void 0===n)switch(s){case"leftSide":case"rightSide":n=_r(t);break;case"topSide":case"bottomSide":n=Rr(t);break;default:if(l)switch(this.previousChildKey){case"leftSide":case"rightSide":n=_r(this.sizerChildren[this.previousChildKey]);break;case"topSide":case"bottomSide":n=Rr(this.sizerChildren[this.previousChildKey]);break;default:n=0;}else switch(this.currentChildKey){case"leftSide":case"rightSide":n=_r(this.sizerChildren[this.currentChildKey]);break;case"topSide":case"bottomSide":n=Rr(this.sizerChildren[this.currentChildKey]);break;default:n=0;}}if(l)switch(s){case"panel":switch(this.previousChildKey){case"leftSide":r=!0;break;case"rightSide":o=!0;break;case"topSide":a=!0;break;case"bottomSide":h=!0;}break;case"leftSide":o=!0;break;case"rightSide":r=!0;break;case"topSide":h=!0;break;case"bottomSide":a=!0;}else switch(s){case"panel":switch(this.currentChildKey){case"leftSide":o=!0;break;case"rightSide":r=!0;break;case"topSide":h=!0;break;case"bottomSide":a=!0;}break;case"leftSide":r=!0;break;case"rightSide":o=!0;break;case"topSide":a=!0;break;case"bottomSide":h=!0;}return r?t.moveTo(e,"-=".concat(n),void 0,i):o?t.moveTo(e,"+=".concat(n),void 0,i):a?t.moveTo(e,void 0,"-=".concat(n),i):h?t.moveTo(e,void 0,"+=".concat(n),i):t.moveTo(0),this},moveChildPromise:function(t,e,i,n){return "string"==typeof t&&(t=this.sizerChildren[key]),this.moveChild(t,e,i,n),t._easeMove?Ph(t._easeMove):Promise.resolve()}},c_={};Object.assign(c_,h_,l_,u_);var d_=Phaser.Utils.Objects.GetValue,f_=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),(r=e.call(this,t,s)).type="rexSides",r.childrenMap=r.sizerChildren,r.previousChildKey=void 0,r.currentChildKey=void 0;var o=d_(s,"showChildCallback",void 0);if(o)if(fg(o)){var a=d_(s,"showChildCallbackScope",void 0);r.on("showchild",o,a);var h=d_(s,"hideChildCallback",void 0),l=d_(s,"hideChildCallbackScope",void 0);r.on("hidechild",h,l);}else {var u=function(t){var e,i,n,s,r=k("string"==typeof t?[t]:t);return e=r[0],i=r.slice(1),o_.hasOwnProperty(e)?(n=o_[e].show.apply(null,i),s=o_[e].hide.apply(null,i)):(n=D,s=D),{show:n,hide:s}}(o);r.on("showchild",u.show),r.on("hidechild",u.hide);}var c=d_(s,"background",void 0),d=d_(s,"panel",void 0),f=d_(s,"leftSide",void 0),p=d_(s,"rightSide",void 0),v=d_(s,"topSide",void 0),g=d_(s,"bottomSide",void 0);if(c&&r.addBackground(c),d&&r.add(d,"panel","center",0,!0),f){var y=d_(s,"expand.left",!0);r.add(f,"leftSide","left-top",0,{height:y});}if(p){y=d_(s,"expand.right",!0);r.add(p,"rightSide","right-top",0,{height:y});}if(v){y=d_(s,"expand.top",!0);r.add(v,"topSide","left-top",0,{width:y});}if(g){y=d_(s,"expand.bottom",!0);r.add(g,"bottomSide","left-bottom",0,{width:y});}return r}return r(i,[{key:"reset",value:function(){return this.previousChildKey=void 0,this.currentChildKey="panel",this.showChild("panel",!0),this.hideChild("leftSide",!0),this.hideChild("rightSide",!0),this.hideChild("topSide",!0),this.hideChild("bottomSide",!0),this}}]),i}(Mk);Object.assign(f_.prototype,{showChild:function(t,e){var i=this.sizerChildren[t];return i&&(this.emit("showchild",i,t,this,e),this.resetChildState(i)),this},hideChild:function(t,e){var i=this.sizerChildren[t];return i&&(this.emit("hidechild",i,t,this,e),this.resetChildState(i)),this},swapChild:function(t,e){return this.currentChildKey===t||("panel"===this.currentChildKey||"panel"===t?(this.previousChildKey=this.currentChildKey,this.currentChildKey=t,this.hideChild(this.previousChildKey,e),this.showChild(this.currentChildKey,e)):(this.swapChild("panel",e),this.swapChild(t,e))),this},showPanel:function(t){return this.swapChild("panel",t),this},showLeftSide:function(){return this.swapChild("leftSide"),this},showRightSide:function(){return this.swapChild("rightSide"),this},showTopSide:function(){return this.swapChild("topSide"),this},showBottomSide:function(){return this.swapChild("bottomSide"),this},hideLeftSide:function(){return "leftSide"==this.currentChildKey&&this.showPanel(),this},hideRightSide:function(){return "rightSide"==this.currentChildKey&&this.showPanel(),this},hideTopSide:function(){return "topSide"==this.currentChildKey&&this.showPanel(),this},hideBottomSide:function(){return "bottomSide"==this.currentChildKey&&this.showPanel(),this},toggleLeftSide:function(){var t="panel"!==this.currentChildKey?"panel":"leftSide";return this.swapChild(t),this},toggleRightSide:function(){var t="panel"!==this.currentChildKey?"panel":"rightSide";return this.swapChild(t),this},toggleTopSide:function(){var t="panel"!==this.currentChildKey?"panel":"topSide";return this.swapChild(t),this},toggleBottomSide:function(){var t="panel"!==this.currentChildKey?"panel":"bottomSide";return this.swapChild(t),this}},c_),T.register("sides",(function(t){var e=new f_(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Sides",f_);var p_=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),s=kC(t,s),(r=e.call(this,t,s)).type="rexTweaker.Title",r}return r(i,[{key:"setTitle",value:function(t){return (t=t?M(t):{}).hasOwnProperty("text")||(t.hasOwnProperty("title")?t.text=t.title:t.text=""),this.resetDisplayContent(t),this}}]),i}(oC),v_=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={}),(r=e.call(this,t,s)).type="rexTweaker.FolderTitle";var o=new Pd(t,s.expandedIcon);return t.add.existing(o),r.addSpace().add(o,{proportion:0,expand:!1,padding:1,fitRatio:1}),r.addChildrenMap("expandedIcon",o),r}return r(i,[{key:"setExpandedState",value:function(t){void 0===t&&(t=!0);var e=t?"down":"right";return this.childrenMap.expandedIcon.setDirection(e),this}}]),i}(p_),g_=function(t,e){var i=new uR(t,e);return t.add.existing(i),i},y_=function(t,e,i){return aC(t,i)},k_=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).type="rexTweaker.Folder",r}return r(i,[{key:"setTitle",value:function(t){return this.childrenMap.title.setTitle(t),this}}]),i}(LM);Object.assign(k_.prototype,{setBindingTarget:function(t){return this.childrenMap.child.setBindingTarget(t),this}},{getMaxInputRowTitleWidth:function(){return this.childrenMap.child.getMaxInputRowTitleWidth()+this.getInnerPadding("left")},setInputRowTitleWidth:function(t){return t-=this.getInnerPadding("left"),this.childrenMap.child.setInputRowTitleWidth(t),this}});var m_=Phaser.Utils.Objects.GetValue,b_=Phaser.Utils.Objects.GetValue,x_={getMaxInputRowTitleWidth:function(){for(var t=0,e=this.childrenMap.pages.children,i=0,n=e.length;i1?e-1:0),n=1;n0?0:1,o.setMinWidth(this.itemWidth)),this.add(o,{proportion:r,expand:!0}),n.onValueChange&&a.on("valuechange",n.onValueChange),n.onValidate&&a.setValidateCallback(n.onValidate),o.setAutoUpdateEnable(n.autoUpdate),o.setBindingTarget(t,e),n.monitor&&o.startMonitorTarget(),n.key&&this.root.addChildrenMap(n.key,o),this},addButton:oR,addButtons:oR,addSeparator:function(t){var e=this.scene,i=aR(this.styles,"separator"),n=y_(e,0,i);return this.add(n,{expand:!0}),this},setBindingTarget:function(t){for(var e=this.sizerChildren,i=0,n=e.length;is?r:-r),u.localY=d+(c>n?o:-o);}},WR=Phaser.Utils.Objects.IsPlainObject,YR=Phaser.Utils.Objects.GetValue,VR=Phaser.Math.DegToRad,XR=Phaser.Math.RadToDeg,GR=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a){var h;if(n(this,i),WR(s)){var l=s;s=YR(l,"x",0),r=YR(l,"y",0),o=YR(l,"key",null),a=YR(l,"frame",null);}return (h=e.call(this,t,s,r,o,a)).type="rexSkewmage",h._skewX=0,h._skewY=0,h}return r(i,[{key:"skewX",get:function(){return this._skewX},set:function(t){this._skewX=t,FR(this,this._skewX,this._skewY);}},{key:"skewXDeg",get:function(){return XR(this._skewX)},set:function(t){this.skewX=VR(t);}},{key:"skewY",get:function(){return this._skewY},set:function(t){this._skewY=t,FR(this,this._skewX,this._skewY);}},{key:"skewYDeg",get:function(){return XR(this._skewY)},set:function(t){this.skewY=VR(t);}},{key:"setSkewX",value:function(t){return this.skewX=t,this}},{key:"setSkewY",value:function(t){return this.skewY=t,this}},{key:"setSkew",value:function(t,e){return void 0===e&&(e=t),this.skewX=t,this.skewY=e,this}},{key:"setSkewXDeg",value:function(t){return this.skewXDeg=t,this}},{key:"setSkewYDeg",value:function(t){return this.skewYDeg=t,this}},{key:"setSkewDeg",value:function(t,e){return void 0===e&&(e=t),this.skewXDeg=t,this.skewYDeg=e,this}}]),i}(AR),UR=Phaser.Utils.Objects.IsPlainObject,HR=Phaser.Utils.Objects.GetValue,NR=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"skewState",get:function(){return this.isRunning}}]),i}(lM(function(t){a(i,t);var e=d(i);function i(t,s,r,o,a){var h;if(n(this,i),UR(s)){var l=s;s=HR(l,"x",0),r=HR(l,"y",0),o=HR(l,"width",32),a=HR(l,"height",32);}var u=AO(t,o,a);return (h=e.call(this,t,s,r,u,null)).type="rexSkewRenderTexture",h.rt=h.texture,h}return r(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(p(h(i.prototype),"destroy",this).call(this,t),this.rt.destroy(),this.rt=null);}}]),i}(GR)));T.register("skew",(function(t,e){return new NR(t,e)})),Z(window,"RexPlugins.UI.Skew",NR),T.register("anchor",(function(t,e){return new zp(t,e)})),Z(window,"RexPlugins.UI.Anchor",zp),T.register("textTyping",(function(t,e){return new oO(t,e)})),Z(window,"RexPlugins.UI.TextTyping",oO),T.register("textPage",(function(t,e){return new iO(t,e)})),Z(window,"RexPlugins.UI.TextPage",iO);var KR=void 0,JR=Phaser.Utils.Objects.GetValue,ZR=Phaser.Utils.Objects.Clone,qR=function(t){return t.hasOwnProperty("align")?t.align:t.hasOwnProperty("halign")?t.halign:"left"},$R=Phaser.Utils.Objects.GetValue,QR=Phaser.Utils.Objects.Merge,tL={open:function(t,e){var i;void 0===t&&(t={}),t=QR(t,this.openConfig),(i=this)!==KR&&(void 0!==KR&&KR.close(),KR=i),fg(t)&&(e=t,t=void 0);var n=$R(t,"inputType",void 0);void 0===n&&(n=$R(t,"type","text")),void 0===e&&(e=$R(t,"onClose",void 0));var s=$R(t,"onOpen",void 0),r=$R(t,"onTextChanged",void 0);return this.inputText=function(t,e){void 0===e&&(e={}),e=ZR(e);var i=t.scene,n=t.style,s=JR(e,"backgroundColor",n.backgroundColor);null===s&&(s="transparent"),e.text=JR(e,"text",t.text),e.fontFamily=JR(e,"fontFamily",n.fontFamily),e.fontSize=JR(e,"fontSize",n.fontSize),e.color=JR(e,"color",n.color),e.backgroundColor=s,e.direction=JR(e,"rtl",n.rtl)?"rtl":"ltr",e.align=JR(e,"align",qR(n)),"rtl"===e.direction&&pC(t)&&(e.align="right");var r=new lb(i,t.x,t.y,JR(e,"width",t.width),JR(e,"height",t.height),e);r.setOrigin(t.originX,t.originY).setScrollFactor(t.scrollFactorX,t.scrollFactorY);var o=t.parentContainer;return o?o.add(r):i.add.existing(r),r}(this.parent,t).on("textchange",(function(t){var e=t.text;r?r(this.parent,e):this.parent.text=e;}),this).setFocus(),this.parent.setVisible(!1),this.onClose=e,$R(t,"enterClose","textarea"!==n)&&this.scene.input.keyboard.once("keydown-ENTER",this.close,this),this.delayCall=function(t,e,i){return t.time.delayedCall(0,e,[],i)}(this.scene,(function(){this.scene.input.once("pointerdown",this.close,this),s&&s(this.parent),this.emit("open",this.parent);}),this),this},close:function(){return this===KR&&(KR=void 0),this.parent.setVisible(!0),this.inputText&&(this.inputText.destroy(),this.inputText=void 0),this.delayCall&&(this.delayCall.remove(),this.delayCall=void 0),this.scene.input.keyboard.off("keydown-ENTER",this.close,this),this.scene.input.off("pointerdown",this.close,this),this.onClose&&this.onClose(this.parent),this.emit("close",this.parent),this}},eL=Phaser.Utils.Objects.GetValue,iL=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t)).inputText=void 0,r.onClose=void 0,r.delayCall=void 0,r.setOpenConfig(s),eL(s,"clickEnable",!0)&&t.on("pointerdown",(function(){this.open();}),u(r)).setInteractive(),r}return r(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.close(),p(h(i.prototype),"shutdown",this).call(this,t));}},{key:"setOpenConfig",value:function(t){return void 0===t&&(t={}),this.openConfig=t,this}},{key:"isOpened",get:function(){return void 0!==this.inputText}},{key:"text",get:function(){return this.isOpened?this.inputText.text:this.parent.text}}]),i}(oo);Object.assign(iL.prototype,tL);T.register("textEdit",(function(t,e){return new iL(t,e)})),Z(window,"RexPlugins.UI.TextEdit",iL);var nL=65535,sL=function(t,e,i){if(null==e)return t;if(0===e)return aL(t,0,i),t;var n=t.text.length;if(0===n)return aL(t,e,i),t;var s=Math.floor(1.5*e/n);void 0!==i&&s>i&&(s=Math.floor(i));for(var r={},o=oL(t,s,e,i,r),a=0;a<=nL&&0!==o;a++){if((s+=o)<0){s=0;break}o=oL(t,s,e,i,r);}return a===nL&&console.warn("FontSizeFit: Test count exceeds ".concat(nL)),t.setFontSize(s),aL(t,e,i),t},rL=function(t,e,i){return void 0===i[e]&&(t.setFontSize(e),i[e]={width:t.width,height:t.height}),i[e]},oL=function(t,e,i,n,s){var r,o=rL(t,e,s),a=rL(t,e+1,s);if(void 0!==n)if(o.height<=n&&a.height>n)r=0;else {if(o.height>n)return -1;r=Math.floor(n-o.height);}if(o.width<=i&&a.width>i)return 0;if(o.width>i)return -1;var h=Math.floor(i-o.width);return void 0===r?h:Math.min(h,r)},aL=function(t,e,i){var n=t.style;n&&(n.fixedWidth=e,n.parent.width=e,void 0!==i&&(n.fixedHeight=i,n.parent.height=i),n.update(!1));},hL=Phaser.Utils.Objects.GetValue,lL=function(t){a(i,Phaser.Plugins.ScenePlugin);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,s)).add=new T(t),r}return r(i,[{key:"start",value:function(){this.scene.events.on("destroy",this.destroy,this);}},{key:"isInTouching",value:function(t,e,i,n){return !!t.visible&&vg(t,e,i,n)}},{key:"viewport",get:function(){return Zr(this.scene,this.scene.cameras.main,!0)}}]),i}(),uL={getParentSizer:Dd,getTopmostSizer:Id,hide:Mv,show:Ov,isShown:Ev,edit:function(t,e,i){return t._edit||(t._edit=new iL(t,{clickEnable:!1})),t._edit.open(e,i),t._edit},wrapExpandText:vC,fontSizeExpandText:function(t,e){"number"==typeof e&&(e={minWidth:e});var i=hL(e,"minWidth",0),n=hL(e,"minHeight",0),s=hL(e,"fitHeight",!1);return t._minWidth=i,t._minHeight=n,s?(t.runWidthWrap=function(e){return t.setFixedSize&&t.setFixedSize(0,0),t.setFontSize(1),t},t.resize=function(e,i){return sL(t,e,i),t}):(t.runWidthWrap=function(e){return t.setFixedSize&&t.setFixedSize(0,0),sL(t,e,void 0),t},t.resize=function(e,i){return t.width===e&&t.height===i||t.setFixedSize(e,i),t}),t},fontSizeResize:sL,setFontSizeToFitWidth:sL,waitEvent:Sh,waitComplete:Ph,delayPromise:db,setChildrenInteractive:ck,fadeIn:tv,fadeOutDestroy:ev,easeMoveTo:cv,easeMoveFrom:dv,modal:cg,modalPromise:function(t,e){var i=cg(t,e);return new Promise((function(t,e){i.once("close",(function(e){t(e);}));}))},modalClose:dg,requestDrag:dR,openFileChooser:function(t,e){var i=pb(e,"closeDelay",200),n=function(t){var e=document.createElement("input");e.type="file";var i=cb(t,"accept",""),n=cb(t,"multiple",!1);return e.setAttribute("accept",i),n?e.setAttribute("multiple",""):e.removeAttribute("multiple"),e}(e);return n.click(),fb({game:t,fileInput:n,closeDelay:i}).then((function(t){return n.remove(),Promise.resolve(t)}))}};return Object.assign(lL.prototype,uL),lL}));