diff --git a/dist/rexgameobjectshellplugin.js b/dist/rexgameobjectshellplugin.js index 79930d032b..b546101a6f 100644 --- a/dist/rexgameobjectshellplugin.js +++ b/dist/rexgameobjectshellplugin.js @@ -538,7 +538,7 @@ } }; - var GetValue$34 = Phaser.Utils.Objects.GetValue; + var GetValue$32 = Phaser.Utils.Objects.GetValue; var BaseAdd = Base$3.prototype.add; var Add$8 = function Add(gameObject, config) { this.setParent(gameObject); @@ -593,11 +593,11 @@ state.syncAlpha = config; state.syncScrollFactor = config; } else { - state.syncPosition = GetValue$34(config, 'syncPosition', true); - state.syncRotation = GetValue$34(config, 'syncRotation', true); - state.syncScale = GetValue$34(config, 'syncScale', true); - state.syncAlpha = GetValue$34(config, 'syncAlpha', true); - state.syncScrollFactor = GetValue$34(config, 'syncScrollFactor', true); + state.syncPosition = GetValue$32(config, 'syncPosition', true); + state.syncRotation = GetValue$32(config, 'syncRotation', true); + state.syncScale = GetValue$32(config, 'syncScale', true); + state.syncAlpha = GetValue$32(config, 'syncAlpha', true); + state.syncScrollFactor = GetValue$32(config, 'syncScrollFactor', true); } }; var AddChild$4 = { @@ -1942,7 +1942,7 @@ return object instanceof GameObjectClass; }; - var GetValue$33 = Phaser.Utils.Objects.GetValue; + var GetValue$31 = Phaser.Utils.Objects.GetValue; var DynamicTexture$1 = Phaser.Textures.DynamicTexture; var UUID$2 = Phaser.Utils.String.UUID; var Snapshot = function Snapshot(config) { @@ -1951,13 +1951,13 @@ } var gameObjects = config.gameObjects; var renderTexture = config.renderTexture; // renderTexture, or dynamicTexture - var x = GetValue$33(config, 'x', undefined); - var y = GetValue$33(config, 'y', undefined); - var width = GetValue$33(config, 'width', undefined); - var height = GetValue$33(config, 'height', undefined); - var originX = GetValue$33(config, 'originX', 0); - var originY = GetValue$33(config, 'originY', 0); - var padding = GetValue$33(config, 'padding', 0); + var x = GetValue$31(config, 'x', undefined); + var y = GetValue$31(config, 'y', undefined); + var width = GetValue$31(config, 'width', undefined); + var height = GetValue$31(config, 'height', undefined); + var originX = GetValue$31(config, 'originX', 0); + var originY = GetValue$31(config, 'originY', 0); + var padding = GetValue$31(config, 'padding', 0); var scrollX, scrollY; if (width === undefined || height === undefined || x === undefined || y === undefined) { // Union bounds of gameObjects @@ -2068,17 +2068,17 @@ } }; - var GetValue$32 = Phaser.Utils.Objects.GetValue; + var GetValue$30 = Phaser.Utils.Objects.GetValue; var DrawBounds$2 = function DrawBounds(gameObjects, graphics, config) { var strokeColor, lineWidth, fillColor, fillAlpha, padding; if (typeof config === 'number') { strokeColor = config; } else { - strokeColor = GetValue$32(config, 'color'); - lineWidth = GetValue$32(config, 'lineWidth'); - fillColor = GetValue$32(config, 'fillColor'); - fillAlpha = GetValue$32(config, 'fillAlpha', 1); - padding = GetValue$32(config, 'padding', 0); + strokeColor = GetValue$30(config, 'color'); + lineWidth = GetValue$30(config, 'lineWidth'); + fillColor = GetValue$30(config, 'fillColor'); + fillAlpha = GetValue$30(config, 'fillAlpha', 1); + padding = GetValue$30(config, 'padding', 0); } if (Array.isArray(gameObjects)) { for (var i = 0, cnt = gameObjects.length; i < cnt; i++) { @@ -2141,10 +2141,10 @@ y: 0 }]; - var GetValue$31 = Phaser.Utils.Objects.GetValue; + var GetValue$2$ = Phaser.Utils.Objects.GetValue; var DrawBounds$1 = function DrawBounds(graphics, config) { - var drawContainer = GetValue$31(config, 'drawContainer', true); - var gameObjects = GetValue$31(config, 'children'); + var drawContainer = GetValue$2$(config, 'drawContainer', true); + var gameObjects = GetValue$2$(config, 'children'); if (gameObjects === undefined) { gameObjects = this.getAllVisibleChildren([this]); } @@ -2769,18 +2769,18 @@ return obj && typeof obj === 'function'; }; - var GetValue$30 = Phaser.Utils.Objects.GetValue; + var GetValue$2_ = Phaser.Utils.Objects.GetValue; var GetDefaultCallback = function GetDefaultCallback(config) { - var color = GetValue$30(config, 'color'); - var alpha = GetValue$30(config, 'alpha', 0.5); - var strokeColor = GetValue$30(config, 'strokeColor'); - var strokeWidth = GetValue$30(config, 'strokeWidth', 2); + var color = GetValue$2_(config, 'color'); + var alpha = GetValue$2_(config, 'alpha', 0.5); + var strokeColor = GetValue$2_(config, 'strokeColor'); + var strokeWidth = GetValue$2_(config, 'strokeWidth', 2); return function (scene) { return scene.add.rectangle(0, 0, 0, 0, color, alpha).setStrokeStyle(strokeColor, strokeWidth); }; }; var AddBoundsRectangle = function AddBoundsRectangle(parent, config) { - var callback = GetValue$30(config, 'boundsRectangle'); + var callback = GetValue$2_(config, 'boundsRectangle'); if (!IsFunction(callback)) { callback = GetDefaultCallback(callback); } @@ -2834,17 +2834,17 @@ }); }; - var GetValue$2$ = Phaser.Utils.Objects.GetValue; + var GetValue$2Z = Phaser.Utils.Objects.GetValue; var GetPointCallback = function GetPointCallback(config, key) { - var callback = GetValue$2$(config, key); + var callback = GetValue$2Z(config, key); if (!IsFunction(callback)) { config = callback; - var color = GetValue$2$(config, 'color'); - var alpha = GetValue$2$(config, 'alpha', 1); - var strokeColor = GetValue$2$(config, 'strokeColor'); - var strokeWidth = GetValue$2$(config, 'strokeWidth', 2); - var size = GetValue$2$(config, 'size', 20); - var shape = GetValue$2$(config, 'shape', 'rectangle'); + var color = GetValue$2Z(config, 'color'); + var alpha = GetValue$2Z(config, 'alpha', 1); + var strokeColor = GetValue$2Z(config, 'strokeColor'); + var strokeWidth = GetValue$2Z(config, 'strokeWidth', 2); + var size = GetValue$2Z(config, 'size', 20); + var shape = GetValue$2Z(config, 'shape', 'rectangle'); if (shape === 'rectangle') { // Rectangle callback = function callback(scene) { @@ -3247,11 +3247,11 @@ }; var IsPlainObject$P = Phaser.Utils.Objects.IsPlainObject; - var GetValue$2_ = Phaser.Utils.Objects.GetValue; + var GetValue$2Y = Phaser.Utils.Objects.GetValue; var SetStretchMode = function SetStretchMode(mode) { if (IsPlainObject$P(mode)) { - this.stretchMode.edge = parseMode(GetValue$2_(mode, 'edge', 0)); - this.stretchMode.internal = parseMode(GetValue$2_(mode, 'internal', 0)); + this.stretchMode.edge = parseMode(GetValue$2Y(mode, 'edge', 0)); + this.stretchMode.internal = parseMode(GetValue$2Y(mode, 'internal', 0)); } else { mode = parseMode(mode); this.stretchMode.edge = mode; @@ -3314,7 +3314,7 @@ }; var IsPlainObject$O = Phaser.Utils.Objects.IsPlainObject; - var GetValue$2Z = Phaser.Utils.Objects.GetValue; + var GetValue$2X = Phaser.Utils.Objects.GetValue; var NinePatchBase = function NinePatchBase(GOClass, type) { var NinePatch = /*#__PURE__*/function (_GOClass) { _inherits(NinePatch, _GOClass); @@ -3324,53 +3324,53 @@ _classCallCheck(this, NinePatch); if (IsPlainObject$O(x)) { config = x; - x = GetValue$2Z(config, 'x', 0); - y = GetValue$2Z(config, 'y', 0); - width = GetValue$2Z(config, 'width', 1); - height = GetValue$2Z(config, 'height', 1); - key = GetValue$2Z(config, 'key', undefined); - baseFrame = GetValue$2Z(config, 'baseFrame', undefined); - columns = GetValue$2Z(config, 'columns', undefined); - rows = GetValue$2Z(config, 'rows', undefined); + x = GetValue$2X(config, 'x', 0); + y = GetValue$2X(config, 'y', 0); + width = GetValue$2X(config, 'width', 1); + height = GetValue$2X(config, 'height', 1); + key = GetValue$2X(config, 'key', undefined); + baseFrame = GetValue$2X(config, 'baseFrame', undefined); + columns = GetValue$2X(config, 'columns', undefined); + rows = GetValue$2X(config, 'rows', undefined); } else if (IsPlainObject$O(width)) { config = width; - width = GetValue$2Z(config, 'width', 1); - height = GetValue$2Z(config, 'height', 1); - key = GetValue$2Z(config, 'key', undefined); - baseFrame = GetValue$2Z(config, 'baseFrame', undefined); - columns = GetValue$2Z(config, 'columns', undefined); - rows = GetValue$2Z(config, 'rows', undefined); + width = GetValue$2X(config, 'width', 1); + height = GetValue$2X(config, 'height', 1); + key = GetValue$2X(config, 'key', undefined); + baseFrame = GetValue$2X(config, 'baseFrame', undefined); + columns = GetValue$2X(config, 'columns', undefined); + rows = GetValue$2X(config, 'rows', undefined); } else if (IsPlainObject$O(key)) { config = key; - key = GetValue$2Z(config, 'key', undefined); - baseFrame = GetValue$2Z(config, 'baseFrame', undefined); - columns = GetValue$2Z(config, 'columns', undefined); - rows = GetValue$2Z(config, 'rows', undefined); + key = GetValue$2X(config, 'key', undefined); + baseFrame = GetValue$2X(config, 'baseFrame', undefined); + columns = GetValue$2X(config, 'columns', undefined); + rows = GetValue$2X(config, 'rows', undefined); } else if (IsPlainObject$O(baseFrame)) { config = baseFrame; - baseFrame = GetValue$2Z(config, 'baseFrame', undefined); - columns = GetValue$2Z(config, 'columns', undefined); - rows = GetValue$2Z(config, 'rows', undefined); + baseFrame = GetValue$2X(config, 'baseFrame', undefined); + columns = GetValue$2X(config, 'columns', undefined); + rows = GetValue$2X(config, 'rows', undefined); } else if (Array.isArray(baseFrame)) { config = rows; rows = columns; columns = baseFrame; - baseFrame = GetValue$2Z(config, 'baseFrame', undefined); + baseFrame = GetValue$2X(config, 'baseFrame', undefined); } else if (IsPlainObject$O(columns)) { config = columns; - columns = GetValue$2Z(config, 'columns', undefined); - rows = GetValue$2Z(config, 'rows', undefined); + columns = GetValue$2X(config, 'columns', undefined); + rows = GetValue$2X(config, 'rows', undefined); } if (columns === undefined) { - var leftWidth = GetValue$2Z(config, 'leftWidth', undefined); - var rightWidth = GetValue$2Z(config, 'rightWidth', undefined); + var leftWidth = GetValue$2X(config, 'leftWidth', undefined); + var rightWidth = GetValue$2X(config, 'rightWidth', undefined); if (leftWidth !== undefined && rightWidth !== undefined) { columns = [leftWidth, undefined, rightWidth]; } } if (rows === undefined) { - var topHeight = GetValue$2Z(config, 'topHeight', undefined); - var bottomHeight = GetValue$2Z(config, 'bottomHeight', undefined); + var topHeight = GetValue$2X(config, 'topHeight', undefined); + var bottomHeight = GetValue$2X(config, 'bottomHeight', undefined); if (topHeight !== undefined && bottomHeight !== undefined) { rows = [topHeight, undefined, bottomHeight]; } @@ -3384,12 +3384,12 @@ _this._tileSprite = undefined; // Reserved for drawing image _this._image = undefined; // Reserved for drawing image - _this.setGetFrameNameCallback(GetValue$2Z(config, 'getFrameNameCallback', undefined)); - _this.setStretchMode(GetValue$2Z(config, 'stretchMode', 0)); - _this.setPreserveRatio(GetValue$2Z(config, 'preserveRatio', true)); - var maxFixedPartScale = GetValue$2Z(config, 'maxFixedPartScale', 1); - var maxFixedPartScaleX = GetValue$2Z(config, 'maxFixedPartScaleX', maxFixedPartScale); - var maxFixedPartScaleY = GetValue$2Z(config, 'maxFixedPartScaleY', undefined); + _this.setGetFrameNameCallback(GetValue$2X(config, 'getFrameNameCallback', undefined)); + _this.setStretchMode(GetValue$2X(config, 'stretchMode', 0)); + _this.setPreserveRatio(GetValue$2X(config, 'preserveRatio', true)); + var maxFixedPartScale = GetValue$2X(config, 'maxFixedPartScale', 1); + var maxFixedPartScaleX = GetValue$2X(config, 'maxFixedPartScaleX', maxFixedPartScale); + var maxFixedPartScaleY = GetValue$2X(config, 'maxFixedPartScaleY', undefined); _this.setMaxFixedPartScale(maxFixedPartScaleX, maxFixedPartScaleY); _this.setBaseTexture(key, baseFrame, columns, rows); return _this; @@ -3697,12 +3697,12 @@ return Stack; }(); - var GetValue$2Y = Phaser.Utils.Objects.GetValue; + var GetValue$2W = Phaser.Utils.Objects.GetValue; var Pools$1 = {}; var PoolManager$1 = /*#__PURE__*/function () { function PoolManager(config) { _classCallCheck(this, PoolManager); - this.pools = GetValue$2Y(config, 'pools', Pools$1); + this.pools = GetValue$2W(config, 'pools', Pools$1); } _createClass(PoolManager, [{ key: "destroy", @@ -3749,7 +3749,7 @@ CheckP3Version(); var GameObject$4 = Phaser.GameObjects.GameObject; var IsPlainObject$N = Phaser.Utils.Objects.IsPlainObject; - var GetValue$2X = Phaser.Utils.Objects.GetValue; + var GetValue$2V = Phaser.Utils.Objects.GetValue; var List = Phaser.Structs.List; var StableSort = Phaser.Utils.Array.StableSort; var Blitter = /*#__PURE__*/function (_GameObject) { @@ -3760,10 +3760,10 @@ _classCallCheck(this, Blitter); if (IsPlainObject$N(x)) { config = x; - x = GetValue$2X(config, 'x', 0); - y = GetValue$2X(config, 'y', 0); - texture = GetValue$2X(config, 'texture'); - frame = GetValue$2X(config, 'frame'); + x = GetValue$2V(config, 'x', 0); + y = GetValue$2V(config, 'y', 0); + texture = GetValue$2V(config, 'texture'); + frame = GetValue$2V(config, 'frame'); } if (x === undefined) { x = 0; @@ -3776,7 +3776,7 @@ _this.renderList = []; _this.displayListDirty = false; _this.lastAppendedChildren = []; - var reuseBob = GetValue$2X(config, 'reuseBob', true); + var reuseBob = GetValue$2V(config, 'reuseBob', true); _this.poolManager = reuseBob ? new PoolManager$1(config) : undefined; _this.setTexture(texture, frame); _this.setPosition(x, y); @@ -3855,7 +3855,7 @@ * * @return {*} The value of the requested key. */ - var GetValue$2W = function GetValue(source, key, defaultValue) { + var GetValue$2U = function GetValue(source, key, defaultValue) { if (!source || typeof source === 'number') { return defaultValue; } else if (source.hasOwnProperty(key)) { @@ -3904,7 +3904,7 @@ }, getData: function getData(key, defaultValue) { this.enableData(); - return key === undefined ? this.data : GetValue$2W(this.data, key, defaultValue); + return key === undefined ? this.data : GetValue$2U(this.data, key, defaultValue); }, incData: function incData(key, inc, defaultValue) { if (defaultValue === undefined) { @@ -4012,7 +4012,7 @@ var DegToRad$d = Phaser.Math.DegToRad; var RadToDeg$7 = Phaser.Math.RadToDeg; - var GetValue$2V = Phaser.Utils.Objects.GetValue; + var GetValue$2T = Phaser.Utils.Objects.GetValue; var RenderBase$1 = /*#__PURE__*/function (_Base) { _inherits(RenderBase, _Base); var _super = _createSuper(RenderBase); @@ -4257,11 +4257,11 @@ } // ScaleX, ScaleY - var width = GetValue$2V(o, 'width', undefined); - var height = GetValue$2V(o, 'height', undefined); - var scale = GetValue$2V(o, 'scale', undefined); - var scaleX = GetValue$2V(o, 'scaleX', scale); - var scaleY = GetValue$2V(o, 'scaleY', scale); + var width = GetValue$2T(o, 'width', undefined); + var height = GetValue$2T(o, 'height', undefined); + var scale = GetValue$2T(o, 'scale', undefined); + var scaleX = GetValue$2T(o, 'scaleX', scale); + var scaleY = GetValue$2T(o, 'scaleY', scale); if (width !== undefined) { if (height === undefined && scaleY === undefined) { this.setWidth(width, true); @@ -4284,7 +4284,7 @@ } else if (o.hasOwnProperty('displayHeight')) { this.setDisplayHeight(o.displayHeight); } - var origin = GetValue$2V(o, 'origin', undefined); + var origin = GetValue$2T(o, 'origin', undefined); if (origin !== undefined) { this.setOrigin(origin); } else { @@ -4617,7 +4617,7 @@ }(NinePatchBase(Blitter, 'rexNinePatch2')); Object.assign(NinePatch.prototype, Methods$k); - var GetValue$2U = Phaser.Utils.Objects.GetValue; + var GetValue$2S = Phaser.Utils.Objects.GetValue; var RoundRectangle$2 = /*#__PURE__*/function () { function RoundRectangle(x, y, width, height, radiusConfig) { _classCallCheck(this, RoundRectangle); @@ -4718,14 +4718,14 @@ defaultRadiusX = value; defaultRadiusY = value; } else { - defaultRadiusX = GetValue$2U(value, 'x', 0); - defaultRadiusY = GetValue$2U(value, 'y', 0); + defaultRadiusX = GetValue$2S(value, 'x', 0); + defaultRadiusY = GetValue$2S(value, 'y', 0); } var radius = this.cornerRadius; - radius.tl = GetRadius(GetValue$2U(value, 'tl', undefined), defaultRadiusX, defaultRadiusY); - radius.tr = GetRadius(GetValue$2U(value, 'tr', undefined), defaultRadiusX, defaultRadiusY); - radius.bl = GetRadius(GetValue$2U(value, 'bl', undefined), defaultRadiusX, defaultRadiusY); - radius.br = GetRadius(GetValue$2U(value, 'br', undefined), defaultRadiusX, defaultRadiusY); + radius.tl = GetRadius(GetValue$2S(value, 'tl', undefined), defaultRadiusX, defaultRadiusY); + radius.tr = GetRadius(GetValue$2S(value, 'tr', undefined), defaultRadiusX, defaultRadiusY); + radius.bl = GetRadius(GetValue$2S(value, 'bl', undefined), defaultRadiusX, defaultRadiusY); + radius.br = GetRadius(GetValue$2S(value, 'br', undefined), defaultRadiusX, defaultRadiusY); } }, { key: "radiusTL", @@ -4786,8 +4786,8 @@ radius.x = value; radius.y = value; } else { - radius.x = GetValue$2U(value, 'x', 0); - radius.y = GetValue$2U(value, 'y', 0); + radius.x = GetValue$2S(value, 'x', 0); + radius.y = GetValue$2S(value, 'y', 0); } SetConvex(radius); }; @@ -4988,7 +4988,7 @@ var Shape$1 = Phaser.GameObjects.Shape; var IsPlainObject$L = Phaser.Utils.Objects.IsPlainObject; - var GetValue$2T = Phaser.Utils.Objects.GetValue; + var GetValue$2R = Phaser.Utils.Objects.GetValue; var Earcut$1 = Phaser.Geom.Polygon.Earcut; var RoundRectangle$1 = /*#__PURE__*/function (_Shape) { _inherits(RoundRectangle, _Shape); @@ -5033,7 +5033,7 @@ _this = _super.call(this, scene, 'rexRoundRectangleShape', geom); _this.setShapeType(shapeType); if (_this.shapeType === 0) { - var radius = GetValue$2T(radiusConfig, 'radius', radiusConfig); + var radius = GetValue$2R(radiusConfig, 'radius', radiusConfig); geom.setTo(0, 0, width, height, radius); } else { var radius = { @@ -5042,7 +5042,7 @@ }; geom.setTo(0, 0, width, height, radius); } - var iteration = GetValue$2T(radiusConfig, 'iteration', undefined); + var iteration = GetValue$2R(radiusConfig, 'iteration', undefined); _this.setIteration(iteration); _this.setPosition(x, y); _this.setFillStyle(fillColor, fillAlpha); @@ -6471,7 +6471,7 @@ }; var GetAdvancedValue$5 = Phaser.Utils.Objects.GetAdvancedValue; - var GetValue$2S = Phaser.Utils.Objects.GetValue; + var GetValue$2Q = Phaser.Utils.Objects.GetValue; var TextStyle$1 = /*#__PURE__*/function () { function TextStyle(text, style, propertyMap) { _classCallCheck(this, TextStyle); @@ -6574,7 +6574,7 @@ var postCallback = prop[2]; if (key === 'wrapCallback' || key === 'wrapCallbackScope') { // Callback & scope should be set without processing the values - this[key] = GetValue$2S(style, objKey, defaultValue); + this[key] = GetValue$2Q(style, objKey, defaultValue); } else { var value = GetAdvancedValue$5(style, objKey, defaultValue); if (postCallback) { @@ -6585,7 +6585,7 @@ } // Allow for 'font' override - var font = GetValue$2S(style, 'font', null); + var font = GetValue$2Q(style, 'font', null); if (font === null) { this._font = this.fontStyle + ' ' + this.fontSize + ' ' + this.fontFamily; } else { @@ -6593,19 +6593,19 @@ } // Allow for 'fill' to be used in place of 'color' - var fill = GetValue$2S(style, 'fill', null); + var fill = GetValue$2Q(style, 'fill', null); if (fill !== null) { this.color = GetStyle(fill); } - var metrics = GetValue$2S(style, 'metrics', false); + var metrics = GetValue$2Q(style, 'metrics', false); // Provide optional TextMetrics in the style object to avoid the canvas look-up / scanning // Doing this is reset if you then change the font of this TextStyle after creation if (metrics) { this.metrics = { - ascent: GetValue$2S(metrics, 'ascent', 0), - descent: GetValue$2S(metrics, 'descent', 0), - fontSize: GetValue$2S(metrics, 'fontSize', 0) + ascent: GetValue$2Q(metrics, 'ascent', 0), + descent: GetValue$2Q(metrics, 'descent', 0), + fontSize: GetValue$2Q(metrics, 'fontSize', 0) }; } else if (updateText || !this.metrics) { this.metrics = MeasureText(this); @@ -6674,9 +6674,9 @@ this.fontSize = ''; this.fontStyle = ''; } else { - this.fontFamily = GetValue$2S(font, 'fontFamily', 'Courier'); - this.fontSize = GetValue$2S(font, 'fontSize', '16px'); - this.fontStyle = GetValue$2S(font, 'fontStyle', ''); + this.fontFamily = GetValue$2Q(font, 'fontFamily', 'Courier'); + this.fontSize = GetValue$2Q(font, 'fontSize', '16px'); + this.fontStyle = GetValue$2Q(font, 'fontStyle', ''); } return this.update(true); } @@ -7027,9 +7027,9 @@ this.fontSize = ''; this.fontStyle = ''; } else { - this.fontFamily = GetValue$2S(font, 'fontFamily', this.fontFamily); - this.fontSize = GetValue$2S(font, 'fontSize', this.fontSize); - this.fontStyle = GetValue$2S(font, 'fontStyle', this.fontStyle); + this.fontFamily = GetValue$2Q(font, 'fontFamily', this.fontFamily); + this.fontSize = GetValue$2Q(font, 'fontSize', this.fontSize); + this.fontStyle = GetValue$2Q(font, 'fontStyle', this.fontStyle); } } return this.parent.updateText(true); @@ -7250,7 +7250,7 @@ } }; - var GetValue$2R = Phaser.Utils.Objects.GetValue; + var GetValue$2P = Phaser.Utils.Objects.GetValue; var NO_NEWLINE$3 = CONST.NO_NEWLINE; var RAW_NEWLINE$1 = CONST.RAW_NEWLINE; var Pen = /*#__PURE__*/function () { @@ -7263,17 +7263,17 @@ key: "resetFromJSON", value: function resetFromJSON(o) { // (txt, x, y, width, prop, newLineMode, startIndex) - this.text = GetValue$2R(o, 'text', ''); - this.x = GetValue$2R(o, 'x', 0); - this.y = GetValue$2R(o, 'y', 0); - this.width = GetValue$2R(o, 'width', 0); - var prop = GetValue$2R(o, 'prop', null); + this.text = GetValue$2P(o, 'text', ''); + this.x = GetValue$2P(o, 'x', 0); + this.y = GetValue$2P(o, 'y', 0); + this.width = GetValue$2P(o, 'width', 0); + var prop = GetValue$2P(o, 'prop', null); if (prop === null) { prop = {}; } this.prop = prop; - this.newLineMode = GetValue$2R(o, 'newLineMode', 0); - this.startIndex = GetValue$2R(o, 'startIndex', 0); + this.newLineMode = GetValue$2P(o, 'newLineMode', 0); + this.startIndex = GetValue$2P(o, 'startIndex', 0); } }, { key: "plainText", @@ -7866,7 +7866,7 @@ return retLines; }; - var GetValue$2Q = Phaser.Utils.Objects.GetValue; + var GetValue$2O = Phaser.Utils.Objects.GetValue; var NO_WRAP = CONST.NO_WRAP; var NO_NEWLINE = CONST.NO_NEWLINE; var CanvasText = /*#__PURE__*/function () { @@ -7874,10 +7874,10 @@ _classCallCheck(this, CanvasText); this.parent = config.parent; this.scene = this.parent.scene; - this.context = GetValue$2Q(config, 'context', null); + this.context = GetValue$2O(config, 'context', null); this.canvas = this.context.canvas; - this.parser = GetValue$2Q(config, 'parser', null); - this.defaultStyle = GetValue$2Q(config, 'style', null); + this.parser = GetValue$2O(config, 'parser', null); + this.defaultStyle = GetValue$2O(config, 'style', null); this.autoRound = true; this.pensPool = config.pensPool; // Required this.linesPool = config.linesPool; // Required @@ -8214,7 +8214,7 @@ }(Stack); var IsPlainObject$K = Phaser.Utils.Objects.IsPlainObject; - var GetValue$2P = Phaser.Utils.Objects.GetValue; + var GetValue$2N = Phaser.Utils.Objects.GetValue; var AddImage$1 = function AddImage(key, config) { if (IsPlainObject$K(key)) { config = key; @@ -8249,11 +8249,11 @@ frame: frameKey, width: width, height: height, - y: GetValue$2P(config, 'y', 0), - left: GetValue$2P(config, 'left', 0), - right: GetValue$2P(config, 'right', 0), - originX: GetValue$2P(config, 'originX', 0), - originY: GetValue$2P(config, 'originY', 0) + y: GetValue$2N(config, 'y', 0), + left: GetValue$2N(config, 'left', 0), + right: GetValue$2N(config, 'right', 0), + originX: GetValue$2N(config, 'originX', 0), + originY: GetValue$2N(config, 'originY', 0) }; }; @@ -8375,7 +8375,7 @@ var AddToDOM = Phaser.DOM.AddToDOM; var CanvasPool = Phaser.Display.Canvas.CanvasPool; var GameObject$1 = Phaser.GameObjects.GameObject; - var GetValue$2O = Phaser.Utils.Objects.GetValue; + var GetValue$2M = Phaser.Utils.Objects.GetValue; var RemoveFromDOM = Phaser.DOM.RemoveFromDOM; var SPLITREGEXP = CONST.SPLITREGEXP; @@ -8391,10 +8391,10 @@ _classCallCheck(this, Text); if (IsPlainObject$J(x)) { var config = x; - x = GetValue$2O(config, 'x', 0); - y = GetValue$2O(config, 'y', 0); - text = GetValue$2O(config, 'text', ''); - style = GetValue$2O(config, 'style'); + x = GetValue$2M(config, 'x', 0); + y = GetValue$2M(config, 'y', 0); + text = GetValue$2M(config, 'text', ''); + style = GetValue$2M(config, 'style'); } if (x === undefined) { x = 0; @@ -8426,7 +8426,7 @@ } } _this.style = new TextStyle$1(_assertThisInitialized(_this), style); - var imageData = GetValue$2O(style, 'images', undefined); + var imageData = GetValue$2M(style, 'images', undefined); if (imageData) { _this.addImage(imageData); } @@ -8461,7 +8461,7 @@ _this.renderer.deleteTexture(_this.frame.source.glTexture); _this.frame.source.glTexture = null; } - var sharedPoolMode = GetValue$2O(style, 'sharedPool', true); + var sharedPoolMode = GetValue$2M(style, 'sharedPool', true); var pensPool, linesPool, wrapTextLinesPool; if (sharedPoolMode) { // Use pools first time @@ -8503,8 +8503,8 @@ _this.setPadding(style.padding); } _this.setText(text); - _this.setUrlTagCursorStyle(GetValue$2O(style, 'urlTagCursorStyle', 'pointer')); - if (GetValue$2O(style, 'interactive', false)) { + _this.setUrlTagCursorStyle(GetValue$2M(style, 'urlTagCursorStyle', 'pointer')); + if (GetValue$2M(style, 'interactive', false)) { _this.setInteractive(); } return _this; @@ -8613,21 +8613,21 @@ var config = left; // If they specify x and/or y this applies to all - var x = GetValue$2O(config, 'x', null); + var x = GetValue$2M(config, 'x', null); if (x !== null) { left = x; right = x; } else { - left = GetValue$2O(config, 'left', 0); - right = GetValue$2O(config, 'right', left); + left = GetValue$2M(config, 'left', 0); + right = GetValue$2M(config, 'right', left); } - var y = GetValue$2O(config, 'y', null); + var y = GetValue$2M(config, 'y', null); if (y !== null) { top = y; bottom = y; } else { - top = GetValue$2O(config, 'top', 0); - bottom = GetValue$2O(config, 'bottom', top); + top = GetValue$2M(config, 'top', 0); + bottom = GetValue$2M(config, 'bottom', top); } } else { if (left === undefined) { @@ -9369,11 +9369,11 @@ return Object.assign({}, TagRegexSave); }; - var GetValue$2N = Phaser.Utils.Objects.GetValue; + var GetValue$2L = Phaser.Utils.Objects.GetValue; var Parser$1 = /*#__PURE__*/function () { function Parser(style) { _classCallCheck(this, Parser); - var delimiters = GetValue$2N(style, 'delimiters', '[]'); + var delimiters = GetValue$2L(style, 'delimiters', '[]'); this.tagRegex = GetTagRegex(delimiters); this.delimiters = delimiters; } @@ -9429,7 +9429,7 @@ Phaser.Utils.Objects.GetValue; - var GetValue$2M = Phaser.Utils.Objects.GetValue; + var GetValue$2K = Phaser.Utils.Objects.GetValue; var GetPadding$1 = function GetPadding(padding, key) { if (key === undefined) { return padding; @@ -9452,10 +9452,10 @@ padding.top = key; padding.bottom = key; } else { - padding.left = GetValue$2M(key, 'left', 0); - padding.right = GetValue$2M(key, 'right', 0); - padding.top = GetValue$2M(key, 'top', 0); - padding.bottom = GetValue$2M(key, 'bottom', 0); + padding.left = GetValue$2K(key, 'left', 0); + padding.right = GetValue$2K(key, 'right', 0); + padding.top = GetValue$2K(key, 'top', 0); + padding.bottom = GetValue$2K(key, 'bottom', 0); } return padding; }; @@ -9702,7 +9702,7 @@ var DegToRad$a = Phaser.Math.DegToRad; var RadToDeg$6 = Phaser.Math.RadToDeg; - var GetValue$2L = Phaser.Utils.Objects.GetValue; + var GetValue$2J = Phaser.Utils.Objects.GetValue; var RenderBase = /*#__PURE__*/function (_Base) { _inherits(RenderBase, _Base); var _super = _createSuper(RenderBase); @@ -10002,10 +10002,10 @@ } // ScaleX, ScaleY - var width = GetValue$2L(o, 'width', undefined); - var height = GetValue$2L(o, 'height', undefined); - var scaleX = GetValue$2L(o, 'scaleX', undefined); - var scaleY = GetValue$2L(o, 'scaleY', undefined); + var width = GetValue$2J(o, 'width', undefined); + var height = GetValue$2J(o, 'height', undefined); + var scaleX = GetValue$2J(o, 'scaleX', undefined); + var scaleY = GetValue$2J(o, 'scaleY', undefined); if (width !== undefined) { if (height === undefined && scaleY === undefined) { this.setWidth(width, true); @@ -10137,7 +10137,7 @@ } }; - var GetValue$2K = Phaser.Utils.Objects.GetValue; + var GetValue$2I = Phaser.Utils.Objects.GetValue; var Background = /*#__PURE__*/function (_RenderBase) { _inherits(Background, _RenderBase); var _super = _createSuper(Background); @@ -10146,9 +10146,9 @@ _classCallCheck(this, Background); _this = _super.call(this, parent, 'background'); _this.setScrollFactor(0); - _this.setColor(GetValue$2K(config, 'color', null), GetValue$2K(config, 'color2', null), GetValue$2K(config, 'horizontalGradient', true)); - _this.setStroke(GetValue$2K(config, 'stroke', null), GetValue$2K(config, 'strokeThickness', 2)); - _this.setCornerRadius(GetValue$2K(config, 'cornerRadius', 0), GetValue$2K(config, 'cornerIteration', null)); + _this.setColor(GetValue$2I(config, 'color', null), GetValue$2I(config, 'color2', null), GetValue$2I(config, 'horizontalGradient', true)); + _this.setStroke(GetValue$2I(config, 'stroke', null), GetValue$2I(config, 'strokeThickness', 2)); + _this.setCornerRadius(GetValue$2I(config, 'cornerRadius', 0), GetValue$2I(config, 'cornerIteration', null)); return _this; } _createClass(Background, [{ @@ -10277,7 +10277,7 @@ return Background; }(RenderBase); - var GetValue$2J = Phaser.Utils.Objects.GetValue; + var GetValue$2H = Phaser.Utils.Objects.GetValue; var InnerBounds = /*#__PURE__*/function (_RenderBase) { _inherits(InnerBounds, _RenderBase); var _super = _createSuper(InnerBounds); @@ -10286,8 +10286,8 @@ _classCallCheck(this, InnerBounds); _this = _super.call(this, parent, 'innerbounds'); _this.setScrollFactor(0); - _this.setColor(GetValue$2J(config, 'color', null), GetValue$2J(config, 'color2', null), GetValue$2J(config, 'horizontalGradient', true)); - _this.setStroke(GetValue$2J(config, 'stroke', null), GetValue$2J(config, 'strokeThickness', 2)); + _this.setColor(GetValue$2H(config, 'color', null), GetValue$2H(config, 'color2', null), GetValue$2H(config, 'horizontalGradient', true)); + _this.setStroke(GetValue$2H(config, 'stroke', null), GetValue$2H(config, 'strokeThickness', 2)); return _this; } _createClass(InnerBounds, [{ @@ -10366,10 +10366,10 @@ value: function modifyPorperties(o) { _get(_getPrototypeOf(InnerBounds.prototype), "modifyPorperties", this).call(this, o); if (o.hasOwnProperty('color')) { - this.setColor(o.color, GetValue$2J(o, 'color2', null), GetValue$2J(o, 'horizontalGradient', true)); + this.setColor(o.color, GetValue$2H(o, 'color2', null), GetValue$2H(o, 'horizontalGradient', true)); } if (o.hasOwnProperty('stroke')) { - this.setStroke(o.stroke, GetValue$2J(o, 'strokeThickness', 2)); + this.setStroke(o.stroke, GetValue$2H(o, 'strokeThickness', 2)); } } }, { @@ -10409,7 +10409,7 @@ return InnerBounds; }(RenderBase); - var GetValue$2I = Phaser.Utils.Objects.GetValue; + var GetValue$2G = Phaser.Utils.Objects.GetValue; var TextStyle = /*#__PURE__*/function () { function TextStyle(parent, config) { _classCallCheck(this, TextStyle); @@ -10443,19 +10443,19 @@ }, { key: "set", value: function set(o) { - this.setBold(GetValue$2I(o, 'bold', false)); - this.setItalic(GetValue$2I(o, 'italic', false)); - this.setFontSize(GetValue$2I(o, 'fontSize', '16px')); - this.setFontFamily(GetValue$2I(o, 'fontFamily', 'Courier')); - this.setColor(GetValue$2I(o, 'color', '#fff')); - this.setStrokeStyle(GetValue$2I(o, 'stroke', null), GetValue$2I(o, 'strokeThickness', 0)); - this.setShadow(GetValue$2I(o, 'shadowColor', null), GetValue$2I(o, 'shadowOffsetX', 0), GetValue$2I(o, 'shadowOffsetY', 0), GetValue$2I(o, 'shadowBlur', 0)); - this.setOffset(GetValue$2I(o, 'offsetX', 0), GetValue$2I(o, 'offsetY', 0)); - this.setSpace(GetValue$2I(o, 'leftSpace', 0), GetValue$2I(o, 'rightSpace', 0)); - this.setAlign(GetValue$2I(o, 'align', undefined)); - this.setBackgroundColor(GetValue$2I(o, 'backgroundColor', null)); - this.setBackgroundHeight(GetValue$2I(o, 'backgroundHeight', undefined)); - this.setBackgroundBottomY(GetValue$2I(o, 'backgroundBottomY', undefined)); + this.setBold(GetValue$2G(o, 'bold', false)); + this.setItalic(GetValue$2G(o, 'italic', false)); + this.setFontSize(GetValue$2G(o, 'fontSize', '16px')); + this.setFontFamily(GetValue$2G(o, 'fontFamily', 'Courier')); + this.setColor(GetValue$2G(o, 'color', '#fff')); + this.setStrokeStyle(GetValue$2G(o, 'stroke', null), GetValue$2G(o, 'strokeThickness', 0)); + this.setShadow(GetValue$2G(o, 'shadowColor', null), GetValue$2G(o, 'shadowOffsetX', 0), GetValue$2G(o, 'shadowOffsetY', 0), GetValue$2G(o, 'shadowBlur', 0)); + this.setOffset(GetValue$2G(o, 'offsetX', 0), GetValue$2G(o, 'offsetY', 0)); + this.setSpace(GetValue$2G(o, 'leftSpace', 0), GetValue$2G(o, 'rightSpace', 0)); + this.setAlign(GetValue$2G(o, 'align', undefined)); + this.setBackgroundColor(GetValue$2G(o, 'backgroundColor', null)); + this.setBackgroundHeight(GetValue$2G(o, 'backgroundHeight', undefined)); + this.setBackgroundBottomY(GetValue$2G(o, 'backgroundBottomY', undefined)); return this; } }, { @@ -11838,22 +11838,22 @@ }; var Result = {}; - var GetValue$2H = Phaser.Utils.Objects.GetValue; + var GetValue$2F = Phaser.Utils.Objects.GetValue; var RunWordWrap$1 = function RunWordWrap(config) { // Parse parameters - var startIndex = GetValue$2H(config, 'start', 0); - SetPadding$1(this.wrapPadding, GetValue$2H(config, 'padding', 0)); + var startIndex = GetValue$2F(config, 'start', 0); + SetPadding$1(this.wrapPadding, GetValue$2F(config, 'padding', 0)); var paddingVertical = this.padding.top + this.padding.bottom + this.wrapPadding.top + this.wrapPadding.bottom; var paddingHorizontal = this.padding.left + this.padding.right + this.wrapPadding.left + this.wrapPadding.right; // Get lineHeight, maxLines - var lineHeight = GetValue$2H(config, 'lineHeight'); - var ascent = GetValue$2H(config, 'ascent', lineHeight); + var lineHeight = GetValue$2F(config, 'lineHeight'); + var ascent = GetValue$2F(config, 'ascent', lineHeight); var maxLines; if (lineHeight === undefined) { // Calculate lineHeight - var useDefaultTextHeight = GetValue$2H(config, 'useDefaultTextHeight', false); - maxLines = GetValue$2H(config, 'maxLines', 0); + var useDefaultTextHeight = GetValue$2F(config, 'useDefaultTextHeight', false); + maxLines = GetValue$2F(config, 'maxLines', 0); if (this.fixedHeight > 0 && !useDefaultTextHeight) { var innerHeight = this.fixedHeight - paddingVertical; if (maxLines > 0) { @@ -11875,13 +11875,13 @@ // Calculate maxLines if (this.fixedHeight > 0) { // Calculate maxLines via lineHeight, in fixedHeight mode - maxLines = GetValue$2H(config, 'maxLines'); + maxLines = GetValue$2F(config, 'maxLines'); if (maxLines === undefined) { var innerHeight = this.fixedHeight - paddingVertical; maxLines = Math.floor(innerHeight / lineHeight); } } else { - maxLines = GetValue$2H(config, 'maxLines', 0); // Default is show all lines + maxLines = GetValue$2F(config, 'maxLines', 0); // Default is show all lines } } @@ -11892,7 +11892,7 @@ var showAllLines = maxLines === 0; // Get wrapWidth - var wrapWidth = GetValue$2H(config, 'wrapWidth', undefined); + var wrapWidth = GetValue$2F(config, 'wrapWidth', undefined); if (wrapWidth === undefined) { if (this.fixedWidth > 0) { wrapWidth = this.fixedWidth - paddingHorizontal; @@ -11901,10 +11901,10 @@ } } - var letterSpacing = GetValue$2H(config, 'letterSpacing', 0); - var hAlign = GetValue$2H(config, 'hAlign', 0); - var vAlign = GetValue$2H(config, 'vAlign', 0); - var charWrap = GetValue$2H(config, 'charWrap', false); + var letterSpacing = GetValue$2F(config, 'letterSpacing', 0); + var hAlign = GetValue$2F(config, 'hAlign', 0); + var vAlign = GetValue$2F(config, 'vAlign', 0); + var charWrap = GetValue$2F(config, 'charWrap', false); var result = CreateWrapResultData({ // Override properties callback: 'runWordWrap', @@ -12092,18 +12092,18 @@ } }; - var GetValue$2G = Phaser.Utils.Objects.GetValue; + var GetValue$2E = Phaser.Utils.Objects.GetValue; var RunVerticalWrap$1 = function RunVerticalWrap(config) { // Parse parameters - var startIndex = GetValue$2G(config, 'start', 0); - SetPadding$1(this.wrapPadding, GetValue$2G(config, 'padding', 0)); + var startIndex = GetValue$2E(config, 'start', 0); + SetPadding$1(this.wrapPadding, GetValue$2E(config, 'padding', 0)); var paddingVertical = this.padding.top + this.padding.bottom + this.wrapPadding.top + this.wrapPadding.bottom; var paddingHorizontal = this.padding.left + this.padding.right + this.wrapPadding.left + this.wrapPadding.right; - var lineWidth = GetValue$2G(config, 'lineWidth', undefined); + var lineWidth = GetValue$2E(config, 'lineWidth', undefined); var maxLines; if (lineWidth === undefined) { // Calculate lineWidth via maxLines, in fixedWidth mode - maxLines = GetValue$2G(config, 'maxLines', 0); + maxLines = GetValue$2E(config, 'maxLines', 0); if (this.fixedWidth > 0) { var innerWidth = this.fixedWidth - paddingHorizontal; lineWidth = innerWidth / maxLines; @@ -12113,22 +12113,22 @@ } else { if (this.fixedWidth > 0) { // Calculate maxLines via lineWidth, in fixedWidth mode - maxLines = GetValue$2G(config, 'maxLines', undefined); + maxLines = GetValue$2E(config, 'maxLines', undefined); if (maxLines === undefined) { var innerWidth = this.fixedWidth - paddingHorizontal; maxLines = Math.floor(innerWidth / lineWidth) + 1; } } else { - maxLines = GetValue$2G(config, 'maxLines', 0); // Default is show all lines + maxLines = GetValue$2E(config, 'maxLines', 0); // Default is show all lines } } var showAllLines = maxLines === 0; // Get fixedCharacterHeight - var fixedCharacterHeight = GetValue$2G(config, 'fixedCharacterHeight', undefined); + var fixedCharacterHeight = GetValue$2E(config, 'fixedCharacterHeight', undefined); if (fixedCharacterHeight === undefined) { - var charPerLine = GetValue$2G(config, 'charPerLine', undefined); + var charPerLine = GetValue$2E(config, 'charPerLine', undefined); if (charPerLine !== undefined) { var innerHeight = this.fixedHeight - paddingVertical; fixedCharacterHeight = Math.floor(innerHeight / charPerLine); @@ -12136,7 +12136,7 @@ } // Get wrapHeight - var wrapHeight = GetValue$2G(config, 'wrapHeight', undefined); + var wrapHeight = GetValue$2E(config, 'wrapHeight', undefined); if (wrapHeight === undefined) { if (this.fixedHeight > 0) { wrapHeight = this.fixedHeight - paddingVertical; @@ -12145,10 +12145,10 @@ } } - var letterSpacing = GetValue$2G(config, 'letterSpacing', 0); - var rtl = GetValue$2G(config, 'rtl', true); - var hAlign = GetValue$2G(config, 'hAlign', rtl ? 2 : 0); - var vAlign = GetValue$2G(config, 'vAlign', 0); + var letterSpacing = GetValue$2E(config, 'letterSpacing', 0); + var rtl = GetValue$2E(config, 'rtl', true); + var hAlign = GetValue$2E(config, 'hAlign', rtl ? 2 : 0); + var vAlign = GetValue$2E(config, 'vAlign', 0); var result = CreateWrapResultData({ // Override properties callback: 'runVerticalWrap', @@ -12280,11 +12280,11 @@ return RunVerticalWrap$1.call(this, Merge$1(config, this.wrapConfig)); }; - var GetValue$2F = Phaser.Utils.Objects.GetValue; + var GetValue$2D = Phaser.Utils.Objects.GetValue; var RunWrap = function RunWrap(config) { - var wrapCallback = GetValue$2F(this.wrapConfig, 'callback'); + var wrapCallback = GetValue$2D(this.wrapConfig, 'callback'); if (!wrapCallback) { - wrapCallback = GetValue$2F(config, 'callback', this.runWordWrap); + wrapCallback = GetValue$2D(config, 'callback', this.runWordWrap); } if (typeof wrapCallback === 'string') { wrapCallback = this[wrapCallback]; @@ -12831,7 +12831,7 @@ }(); var IsPlainObject$I = Phaser.Utils.Objects.IsPlainObject; - var GetValue$2E = Phaser.Utils.Objects.GetValue; + var GetValue$2C = Phaser.Utils.Objects.GetValue; var DynamicText = /*#__PURE__*/function (_Canvas) { _inherits(DynamicText, _Canvas); var _super = _createSuper(DynamicText); @@ -12840,14 +12840,14 @@ _classCallCheck(this, DynamicText); if (IsPlainObject$I(x)) { config = x; - x = GetValue$2E(config, 'x', 0); - y = GetValue$2E(config, 'y', 0); - fixedWidth = GetValue$2E(config, 'width', 0); - fixedHeight = GetValue$2E(config, 'height', 0); + x = GetValue$2C(config, 'x', 0); + y = GetValue$2C(config, 'y', 0); + fixedWidth = GetValue$2C(config, 'width', 0); + fixedHeight = GetValue$2C(config, 'height', 0); } else if (IsPlainObject$I(fixedWidth)) { config = fixedWidth; - fixedWidth = GetValue$2E(config, 'width', 0); - fixedHeight = GetValue$2E(config, 'height', 0); + fixedWidth = GetValue$2C(config, 'width', 0); + fixedHeight = GetValue$2C(config, 'height', 0); } var width = fixedWidth === 0 ? 1 : fixedWidth; var height = fixedHeight === 0 ? 1 : fixedHeight; @@ -12856,23 +12856,23 @@ _this.autoRound = true; _this.padding = SetPadding$1(); _this.wrapPadding = SetPadding$1(); - var textStyleConfig = GetValue$2E(config, 'style', undefined); + var textStyleConfig = GetValue$2C(config, 'style', undefined); _this.defaultTextStyle = new TextStyle(null, textStyleConfig); _this.textStyle = _this.defaultTextStyle.clone(); - _this.setTestString(GetValue$2E(config, 'testString', '|MÉqgy')); + _this.setTestString(GetValue$2C(config, 'testString', '|MÉqgy')); _this._textOX = 0; _this._textOY = 0; - _this.background = new Background(_assertThisInitialized(_this), GetValue$2E(config, 'background', undefined)); - _this.innerBounds = new InnerBounds(_assertThisInitialized(_this), GetValue$2E(config, 'innerBounds', undefined)); + _this.background = new Background(_assertThisInitialized(_this), GetValue$2C(config, 'background', undefined)); + _this.innerBounds = new InnerBounds(_assertThisInitialized(_this), GetValue$2C(config, 'innerBounds', undefined)); _this.children = []; _this.lastAppendedChildren = []; _this.lastOverChild = null; _this.poolManager = new PoolManager(config); _this.setFixedSize(fixedWidth, fixedHeight); - _this.setPadding(GetValue$2E(config, 'padding', 0)); - _this.setWrapConfig(GetValue$2E(config, 'wrap', undefined)); - _this.setChildrenInteractiveEnable(GetValue$2E(config, 'childrenInteractive', false)); - var text = GetValue$2E(config, 'text', undefined); + _this.setPadding(GetValue$2C(config, 'padding', 0)); + _this.setWrapConfig(GetValue$2C(config, 'wrap', undefined)); + _this.setChildrenInteractiveEnable(GetValue$2C(config, 'childrenInteractive', false)); + var text = GetValue$2C(config, 'text', undefined); if (text) { _this.setText(text); } @@ -15514,32 +15514,32 @@ }; var globRect = new Rectangle$2(); - var GetValue$2D = Phaser.Utils.Objects.GetValue; + var GetValue$2B = Phaser.Utils.Objects.GetValue; var GOManager = /*#__PURE__*/function () { function GOManager(scene, config) { _classCallCheck(this, GOManager); this.scene = scene; - this.BobClass = GetValue$2D(config, 'BobClass', BobBase); - this.setCreateGameObjectCallback(GetValue$2D(config, 'createGameObject'), GetValue$2D(config, 'createGameObjectScope')); - this.setEventEmitter(GetValue$2D(config, 'eventEmitter', undefined)); - var fadeConfig = GetValue$2D(config, 'fade', 500); + this.BobClass = GetValue$2B(config, 'BobClass', BobBase); + this.setCreateGameObjectCallback(GetValue$2B(config, 'createGameObject'), GetValue$2B(config, 'createGameObjectScope')); + this.setEventEmitter(GetValue$2B(config, 'eventEmitter', undefined)); + var fadeConfig = GetValue$2B(config, 'fade', 500); if (typeof fadeConfig === 'number') { this.setGOFadeMode(); this.setGOFadeTime(fadeConfig); } else { - this.setGOFadeMode(GetValue$2D(fadeConfig, 'mode')); - this.setGOFadeTime(GetValue$2D(fadeConfig, 'time', 500)); + this.setGOFadeMode(GetValue$2B(fadeConfig, 'mode')); + this.setGOFadeTime(GetValue$2B(fadeConfig, 'time', 500)); } - var viewportCoordinateConfig = GetValue$2D(config, 'viewportCoordinate', false); + var viewportCoordinateConfig = GetValue$2B(config, 'viewportCoordinate', false); if (viewportCoordinateConfig !== false) { - this.setViewportCoordinateEnable(GetValue$2D(config, 'enable', true)); - this.setViewport(GetValue$2D(viewportCoordinateConfig, 'viewport')); + this.setViewportCoordinateEnable(GetValue$2B(config, 'enable', true)); + this.setViewport(GetValue$2B(viewportCoordinateConfig, 'viewport')); } else { this.setViewportCoordinateEnable(false); } - var effectPropertiesConfig = GetValue$2D(config, 'effectProperties', false); + var effectPropertiesConfig = GetValue$2B(config, 'effectProperties', false); this.setEffectPropertiesConfig(effectPropertiesConfig); - this.setSymbols(GetValue$2D(config, 'symbols')); + this.setSymbols(GetValue$2B(config, 'symbols')); this.bobs = {}; this.removedGOs = []; this._timeScale = 1; @@ -15623,7 +15623,7 @@ }(); Object.assign(GOManager.prototype, EventEmitterMethods$1, Methods$h); - var GetValue$2C = Phaser.Utils.Objects.GetValue; + var GetValue$2A = Phaser.Utils.Objects.GetValue; var LayerManager = /*#__PURE__*/function (_GOManager) { _inherits(LayerManager, _GOManager); var _super = _createSuper(LayerManager); @@ -15642,7 +15642,7 @@ } config.viewportCoordinate = false; _this = _super.call(this, scene, config); - var initLayers = GetValue$2C(config, 'layers'); + var initLayers = GetValue$2A(config, 'layers'); if (initLayers) { for (var i = 0, cnt = initLayers.length; i < cnt; i++) { _this.add(initLayers[i]); @@ -15779,7 +15779,7 @@ } }; - var GetValue$2B = Phaser.Utils.Objects.GetValue; + var GetValue$2z = Phaser.Utils.Objects.GetValue; var ComponentBase = /*#__PURE__*/function () { function ComponentBase(parent, config) { _classCallCheck(this, ComponentBase); @@ -15788,7 +15788,7 @@ this.isShutdown = false; // Event emitter, default is private event emitter - this.setEventEmitter(GetValue$2B(config, 'eventEmitter', true)); + this.setEventEmitter(GetValue$2z(config, 'eventEmitter', true)); // Register callback of parent destroy event, also see `shutdown` method if (this.parent) { @@ -15865,7 +15865,7 @@ }(); Object.assign(ComponentBase.prototype, EventEmitterMethods$1); - var GetValue$2A = Phaser.Utils.Objects.GetValue; + var GetValue$2y = Phaser.Utils.Objects.GetValue; var TickTask = /*#__PURE__*/function (_ComponentBase) { _inherits(TickTask, _ComponentBase); var _super = _createSuper(TickTask); @@ -15876,7 +15876,7 @@ _this._isRunning = false; _this.isPaused = false; _this.tickingState = false; - _this.setTickingMode(GetValue$2A(config, 'tickingMode', 1)); + _this.setTickingMode(GetValue$2y(config, 'tickingMode', 1)); // boot() later return _this; } @@ -15993,7 +15993,7 @@ 'always': 2 }; - var GetValue$2z = Phaser.Utils.Objects.GetValue; + var GetValue$2x = Phaser.Utils.Objects.GetValue; var SceneUpdateTickTask = /*#__PURE__*/function (_TickTask) { _inherits(SceneUpdateTickTask, _TickTask); var _super = _createSuper(SceneUpdateTickTask); @@ -16007,7 +16007,7 @@ // If this.scene is not available, use game's 'step' event var defaultEventName = _this.scene ? 'update' : 'step'; - _this.tickEventName = GetValue$2z(config, 'tickEventName', defaultEventName); + _this.tickEventName = GetValue$2x(config, 'tickEventName', defaultEventName); _this.isSceneTicker = !IsGameUpdateEvent(_this.tickEventName); return _this; } @@ -16043,7 +16043,7 @@ return eventName === 'step' || eventName === 'poststep'; }; - var GetValue$2y = Phaser.Utils.Objects.GetValue; + var GetValue$2w = Phaser.Utils.Objects.GetValue; var Clamp$e = Phaser.Math.Clamp; var Timer$1 = /*#__PURE__*/function () { function Timer(config) { @@ -16053,15 +16053,15 @@ _createClass(Timer, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.state = GetValue$2y(o, 'state', IDLE$6); - this.timeScale = GetValue$2y(o, 'timeScale', 1); - this.delay = GetValue$2y(o, 'delay', 0); - this.repeat = GetValue$2y(o, 'repeat', 0); - this.repeatCounter = GetValue$2y(o, 'repeatCounter', 0); - this.repeatDelay = GetValue$2y(o, 'repeatDelay', 0); - this.duration = GetValue$2y(o, 'duration', 0); - this.nowTime = GetValue$2y(o, 'nowTime', 0); - this.justRestart = GetValue$2y(o, 'justRestart', false); + this.state = GetValue$2w(o, 'state', IDLE$6); + this.timeScale = GetValue$2w(o, 'timeScale', 1); + this.delay = GetValue$2w(o, 'delay', 0); + this.repeat = GetValue$2w(o, 'repeat', 0); + this.repeatCounter = GetValue$2w(o, 'repeatCounter', 0); + this.repeatDelay = GetValue$2w(o, 'repeatDelay', 0); + this.duration = GetValue$2w(o, 'duration', 0); + this.nowTime = GetValue$2w(o, 'nowTime', 0); + this.justRestart = GetValue$2w(o, 'justRestart', false); } }, { key: "toJSON", @@ -16290,7 +16290,7 @@ return TimerTickTask; }(SceneUpdateTickTask); - var GetValue$2x = Phaser.Utils.Objects.GetValue; + var GetValue$2v = Phaser.Utils.Objects.GetValue; var GetAdvancedValue$4 = Phaser.Utils.Objects.GetAdvancedValue; var GetEaseFunction = Phaser.Tweens.Builders.GetEaseFunction; var EaseValueTaskBase = /*#__PURE__*/function (_TimerTask) { @@ -16303,13 +16303,13 @@ _createClass(EaseValueTaskBase, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.timer.resetFromJSON(GetValue$2x(o, 'timer')); - this.setEnable(GetValue$2x(o, 'enable', true)); - this.setTarget(GetValue$2x(o, 'target', this.parent)); + this.timer.resetFromJSON(GetValue$2v(o, 'timer')); + this.setEnable(GetValue$2v(o, 'enable', true)); + this.setTarget(GetValue$2v(o, 'target', this.parent)); this.setDelay(GetAdvancedValue$4(o, 'delay', 0)); this.setDuration(GetAdvancedValue$4(o, 'duration', 1000)); - this.setEase(GetValue$2x(o, 'ease', 'Linear')); - this.setRepeat(GetValue$2x(o, 'repeat', 0)); + this.setEase(GetValue$2v(o, 'ease', 'Linear')); + this.setRepeat(GetValue$2v(o, 'repeat', 0)); return this; } }, { @@ -16434,7 +16434,7 @@ return object instanceof SoundObjectClass; }; - var GetValue$2w = Phaser.Utils.Objects.GetValue; + var GetValue$2u = Phaser.Utils.Objects.GetValue; var GetAdvancedValue$3 = Phaser.Utils.Objects.GetAdvancedValue; var Linear$c = Phaser.Math.Linear; var Fade$2 = /*#__PURE__*/function (_EaseValueTaskBase) { @@ -16463,8 +16463,8 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Fade.prototype), "resetFromJSON", this).call(this, o); - this.setMode(GetValue$2w(o, 'mode', 0)); - this.setEnable(GetValue$2w(o, 'enable', true)); + this.setMode(GetValue$2u(o, 'mode', 0)); + this.setEnable(GetValue$2u(o, 'enable', true)); this.setVolumeRange(GetAdvancedValue$3(o, 'volume.start', this.parent.volume), GetAdvancedValue$3(o, 'volume.end', 0)); return this; } @@ -16598,7 +16598,7 @@ return sound; }; - var GetValue$2v = Phaser.Utils.Objects.GetValue; + var GetValue$2t = Phaser.Utils.Objects.GetValue; var BackgroundMusicMethods = { setBackgroundMusicLoop: function setBackgroundMusicLoop(value) { if (value === undefined) { @@ -16642,11 +16642,11 @@ this.stopBackgroundMusic(); // Stop previous background music var music = this.sound.add(key, { - loop: GetValue$2v(config, 'loop', this.backgroundMusicLoop), - mute: GetValue$2v(config, 'mute', this.backgroundMusicMute), - volume: GetValue$2v(config, 'volume', this.backgroundMusicVolume), - detune: GetValue$2v(config, 'detune', 0), - rate: GetValue$2v(config, 'rate', 1) + loop: GetValue$2t(config, 'loop', this.backgroundMusicLoop), + mute: GetValue$2t(config, 'mute', this.backgroundMusicMute), + volume: GetValue$2t(config, 'volume', this.backgroundMusicVolume), + detune: GetValue$2t(config, 'detune', 0), + rate: GetValue$2t(config, 'rate', 1) }); this.setCurrentBackgroundMusic(music); @@ -16724,7 +16724,7 @@ } }; - var GetValue$2u = Phaser.Utils.Objects.GetValue; + var GetValue$2s = Phaser.Utils.Objects.GetValue; var BackgroundMusic2Methods = { setBackgroundMusic2Loop: function setBackgroundMusic2Loop(value) { if (value === undefined) { @@ -16768,11 +16768,11 @@ this.stopBackgroundMusic2(); // Stop previous background music var music = this.sound.add(key, { - loop: GetValue$2u(config, 'loop', this.backgroundMusicLoop), - mute: GetValue$2u(config, 'mute', this.backgroundMusic2Mute), - volume: GetValue$2u(config, 'volume', this.backgroundMusic2Volume), - detune: GetValue$2u(config, 'detune', 0), - rate: GetValue$2u(config, 'rate', 1) + loop: GetValue$2s(config, 'loop', this.backgroundMusicLoop), + mute: GetValue$2s(config, 'mute', this.backgroundMusic2Mute), + volume: GetValue$2s(config, 'volume', this.backgroundMusic2Volume), + detune: GetValue$2s(config, 'detune', 0), + rate: GetValue$2s(config, 'rate', 1) }); this.setCurrentBackgroundMusic2(music); @@ -16851,7 +16851,7 @@ }; var RemoveItem$8 = Phaser.Utils.Array.Remove; - var GetValue$2t = Phaser.Utils.Objects.GetValue; + var GetValue$2r = Phaser.Utils.Objects.GetValue; var SoundEffectsMethods = { getSoundEffects: function getSoundEffects() { return this.soundEffects; @@ -16861,10 +16861,10 @@ }, playSoundEffect: function playSoundEffect(key, config) { var music = this.sound.add(key, { - mute: GetValue$2t(config, 'mute', this.soundEffectsMute), - volume: GetValue$2t(config, 'volume', this.soundEffectsVolume), - detune: GetValue$2t(config, 'detune', 0), - rate: GetValue$2t(config, 'rate', 1) + mute: GetValue$2r(config, 'mute', this.soundEffectsMute), + volume: GetValue$2r(config, 'volume', this.soundEffectsVolume), + detune: GetValue$2r(config, 'detune', 0), + rate: GetValue$2r(config, 'rate', 1) }); this.soundEffects.push(music); music.once('complete', function () { @@ -16980,7 +16980,7 @@ }; var RemoveItem$7 = Phaser.Utils.Array.Remove; - var GetValue$2s = Phaser.Utils.Objects.GetValue; + var GetValue$2q = Phaser.Utils.Objects.GetValue; var SoundEffects2Methods = { getSoundEffects2: function getSoundEffects2() { return this.soundEffects2; @@ -16990,10 +16990,10 @@ }, playSoundEffect2: function playSoundEffect2(key, config) { var music = this.sound.add(key, { - mute: GetValue$2s(config, 'mute', this.soundEffects2Mute), - volume: GetValue$2s(config, 'volume', this.soundEffects2Volume), - detune: GetValue$2s(config, 'detune', 0), - rate: GetValue$2s(config, 'rate', 1) + mute: GetValue$2q(config, 'mute', this.soundEffects2Mute), + volume: GetValue$2q(config, 'volume', this.soundEffects2Volume), + detune: GetValue$2q(config, 'detune', 0), + rate: GetValue$2q(config, 'rate', 1) }); this.soundEffects2.push(music); music.once('complete', function () { @@ -17111,7 +17111,7 @@ var Methods$g = {}; Object.assign(Methods$g, BackgroundMusicMethods, BackgroundMusic2Methods, SoundEffectsMethods, SoundEffects2Methods); - var GetValue$2r = Phaser.Utils.Objects.GetValue; + var GetValue$2p = Phaser.Utils.Objects.GetValue; var SoundManager = /*#__PURE__*/function () { function SoundManager(game, config) { _classCallCheck(this, SoundManager); @@ -17119,26 +17119,26 @@ // Background music will be (fade out)destroyed when play next one. this.backgroundMusic = undefined; - this._backgroundMusicVolume = GetValue$2r(config, 'bgm.volume', 1); - this._backgroundMusicMute = GetValue$2r(config, 'bgm.mute', false); - this.setBackgroundMusicLoop(GetValue$2r(config, 'bgm.loop', true)); - this.setBackgroundMusicFadeTime(GetValue$2r(config, 'bgm.fade', 500)); + this._backgroundMusicVolume = GetValue$2p(config, 'bgm.volume', 1); + this._backgroundMusicMute = GetValue$2p(config, 'bgm.mute', false); + this.setBackgroundMusicLoop(GetValue$2p(config, 'bgm.loop', true)); + this.setBackgroundMusicFadeTime(GetValue$2p(config, 'bgm.fade', 500)); this.backgroundMusic2 = undefined; - this._backgroundMusic2Volume = GetValue$2r(config, 'bgm2.volume', 1); - this._backgroundMusic2Mute = GetValue$2r(config, 'bgm2.mute', false); - this.setBackgroundMusic2Loop(GetValue$2r(config, 'bgm2.loop', true)); - this.setBackgroundMusic2FadeTime(GetValue$2r(config, 'bgm2.fade', 500)); + this._backgroundMusic2Volume = GetValue$2p(config, 'bgm2.volume', 1); + this._backgroundMusic2Mute = GetValue$2p(config, 'bgm2.mute', false); + this.setBackgroundMusic2Loop(GetValue$2p(config, 'bgm2.loop', true)); + this.setBackgroundMusic2FadeTime(GetValue$2p(config, 'bgm2.fade', 500)); // Sound effect will be destroyed when completed this.soundEffects = []; - this._soundEffectsVolume = GetValue$2r(config, 'soundEffect.volume', 1); + this._soundEffectsVolume = GetValue$2p(config, 'soundEffect.volume', 1); this.soundEffects2 = []; - this._soundEffects2Volume = GetValue$2r(config, 'soundEffect2.volume', 1); - var initialBackgroundMusic = GetValue$2r(config, 'bgm.initial', undefined); + this._soundEffects2Volume = GetValue$2p(config, 'soundEffect2.volume', 1); + var initialBackgroundMusic = GetValue$2p(config, 'bgm.initial', undefined); if (initialBackgroundMusic) { this.setCurrentBackgroundMusic(initialBackgroundMusic); } - var initialBackgroundMusic2 = GetValue$2r(config, 'bgm2.initial', undefined); + var initialBackgroundMusic2 = GetValue$2p(config, 'bgm2.initial', undefined); if (initialBackgroundMusic2) { this.setCurrentBackgroundMusic2(initialBackgroundMusic2); } @@ -17286,7 +17286,7 @@ }(); Object.assign(SoundManager.prototype, Methods$g); - var GetValue$2q = Phaser.Utils.Objects.GetValue; + var GetValue$2o = Phaser.Utils.Objects.GetValue; var BaseClock = /*#__PURE__*/function (_TickTask) { _inherits(BaseClock, _TickTask); var _super = _createSuper(BaseClock); @@ -17301,9 +17301,9 @@ _createClass(BaseClock, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.isRunning = GetValue$2q(o, 'isRunning', false); - this.timeScale = GetValue$2q(o, 'timeScale', 1); - this.now = GetValue$2q(o, 'now', 0); + this.isRunning = GetValue$2o(o, 'isRunning', false); + this.timeScale = GetValue$2o(o, 'timeScale', 1); + this.now = GetValue$2o(o, 'now', 0); return this; } }, { @@ -17566,7 +17566,7 @@ return TimerPool; }(Stack); - var GetValue$2p = Phaser.Utils.Objects.GetValue; + var GetValue$2n = Phaser.Utils.Objects.GetValue; var TimerPool = new TimerPool$1(); var Timeline = /*#__PURE__*/function (_Clock) { _inherits(Timeline, _Clock); @@ -17577,7 +17577,7 @@ _this = _super.call(this, parent, config); _this.addedTimers = []; _this.timers = []; - _this.timerPool = GetValue$2p(config, 'pool', TimerPool); + _this.timerPool = GetValue$2n(config, 'pool', TimerPool); return _this; } _createClass(Timeline, [{ @@ -18075,9 +18075,9 @@ var _this; _classCallCheck(this, WaitEventManager); _this = _super.call(this, parent); - _this.waitCompleteEventName = GetValue$2W(config, 'completeEventName', _this.waitCompleteEventName); - _this.setClickTarget(GetValue$2W(config, 'clickTarget', _this.scene)); - _this.setCameraTarget(GetValue$2W(config, 'camera', _this.scene.cameras.main)); + _this.waitCompleteEventName = GetValue$2U(config, 'completeEventName', _this.waitCompleteEventName); + _this.setClickTarget(GetValue$2U(config, 'clickTarget', _this.scene)); + _this.setCameraTarget(GetValue$2U(config, 'camera', _this.scene.cameras.main)); return _this; } _createClass(WaitEventManager, [{ @@ -18116,17 +18116,17 @@ }; Object.assign(WaitEventManager.prototype, WaitTimeMethods, WaitInputMethods, WaitGameObjectMethods, WaitCameraMethods, WaitMusicMethods, Methods$f); - var GetValue$2o = Phaser.Utils.Objects.GetValue; + var GetValue$2m = Phaser.Utils.Objects.GetValue; var InitManagers = function InitManagers(scene, config) { this.clickTarget = undefined; this.cameraTarget = undefined; this.managersScene = scene; this.gameObjectManagers = {}; - var layerManagerConfig = GetValue$2o(config, 'layers', false); + var layerManagerConfig = GetValue$2m(config, 'layers', false); if (layerManagerConfig !== false) { this.gameObjectManagers.layer = new LayerManager(scene, layerManagerConfig); } - var soundManagerConfig = GetValue$2o(config, 'sounds'); + var soundManagerConfig = GetValue$2m(config, 'sounds'); if (soundManagerConfig !== false) { this.soundManager = new SoundManager(scene, soundManagerConfig); } @@ -18358,20 +18358,20 @@ function BracketParser(config) { _classCallCheck(this, BracketParser); // Event emitter - this.setEventEmitter(GetValue$2W(config, 'eventEmitter', undefined)); + this.setEventEmitter(GetValue$2U(config, 'eventEmitter', undefined)); // Value convert - this.setValueConverter(GetValue$2W(config, 'valueConvert', true)); + this.setValueConverter(GetValue$2U(config, 'valueConvert', true)); // Loop - this.setLoopEnable(GetValue$2W(config, 'loop', false)); + this.setLoopEnable(GetValue$2U(config, 'loop', false)); // Brackets and generate regex - this.setMultipleLinesTagEnable(GetValue$2W(config, 'multipleLinesTag', false)); - var delimiters = GetValue$2W(config, 'delimiters', '<>'); + this.setMultipleLinesTagEnable(GetValue$2U(config, 'multipleLinesTag', false)); + var delimiters = GetValue$2U(config, 'delimiters', '<>'); this.setDelimiters(delimiters[0], delimiters[1]); // Translate tagName callback - this.setTranslateTagNameCallback(GetValue$2W(config, 'translateTagNameCallback')); + this.setTranslateTagNameCallback(GetValue$2U(config, 'translateTagNameCallback')); this.isRunning = false; this.isPaused = false; this.skipEventFlag = false; @@ -18639,10 +18639,10 @@ _this = _super.call(this, config); // Parameters for regex - _this.setTagExpression(GetValue$2W(config, 'regex.tag', undefined)); - _this.setValueExpression(GetValue$2W(config, 'regex.value', undefined)); + _this.setTagExpression(GetValue$2U(config, 'regex.tag', undefined)); + _this.setValueExpression(GetValue$2U(config, 'regex.value', undefined)); // Brackets and generate regex - var delimiters = GetValue$2W(config, 'delimiters', '<>'); + var delimiters = GetValue$2U(config, 'delimiters', '<>'); _this.setDelimiters(delimiters[0], delimiters[1]); return _this; } @@ -19982,7 +19982,7 @@ return lines.join(''); }; - var GetValue$2n = Phaser.Utils.Objects.GetValue; + var GetValue$2l = Phaser.Utils.Objects.GetValue; var Parser = /*#__PURE__*/function (_BracketParser) { _inherits(Parser, _BracketParser); var _super = _createSuper(Parser); @@ -19997,7 +19997,7 @@ } _this = _super.call(this, config); AddParseCallbacks(textPlayer, _assertThisInitialized(_this), config); - _this.setCommentLineStartSymbol(GetValue$2n(config, 'comment', '//')); + _this.setCommentLineStartSymbol(GetValue$2l(config, 'comment', '//')); _this.setContentOutputEnable(); return _this; } @@ -20430,7 +20430,7 @@ }; Object.assign(Methods$e, TypingSpeedMethods$1); - var GetValue$2m = Phaser.Utils.Objects.GetValue; + var GetValue$2k = Phaser.Utils.Objects.GetValue; var TypeWriter = /*#__PURE__*/function () { function TypeWriter(textPlayer, config) { _classCallCheck(this, TypeWriter); @@ -20443,13 +20443,13 @@ this.isTypingPaused = false; // Used in this.wait(), this.pauseTyping(), this.resumeTyping() this.setIgnoreWait(false); this.setSkipTypingAnimation(false); - this.setTypingStartCallback(GetValue$2m(config, 'onTypingStart', SetChildrenInvisible)); - this.setDefaultTypingSpeed(GetValue$2m(config, 'speed', 250)); + this.setTypingStartCallback(GetValue$2k(config, 'onTypingStart', SetChildrenInvisible)); + this.setDefaultTypingSpeed(GetValue$2k(config, 'speed', 250)); this.setTypingSpeed(); - this.setSkipSpaceEnable(GetValue$2m(config, 'skipSpace', false)); - this.setAnimationConfig(GetValue$2m(config, 'animation', undefined)); - this.setMinSizeEnable(GetValue$2m(config, 'minSizeEnable', false)); - this.setFadeOutPageCallback(GetValue$2m(config, 'fadeOutPage')); + this.setSkipSpaceEnable(GetValue$2k(config, 'skipSpace', false)); + this.setAnimationConfig(GetValue$2k(config, 'animation', undefined)); + this.setMinSizeEnable(GetValue$2k(config, 'minSizeEnable', false)); + this.setFadeOutPageCallback(GetValue$2k(config, 'fadeOutPage')); } _createClass(TypeWriter, [{ key: "destroy", @@ -21356,7 +21356,7 @@ }; var IsPlainObject$H = Phaser.Utils.Objects.IsPlainObject; - var GetValue$2l = Phaser.Utils.Objects.GetValue; + var GetValue$2j = Phaser.Utils.Objects.GetValue; var TextPlayer = /*#__PURE__*/function (_Extend) { _inherits(TextPlayer, _Extend); var _super = _createSuper(TextPlayer); @@ -21378,19 +21378,19 @@ _this = _super.call(this, scene, x, y, fixedWidth, fixedHeight, config); _this.type = 'rexTextPlayer'; _this.initManagers(scene, config); - _this.parser = new Parser(_assertThisInitialized(_this), GetValue$2l(config, 'parser', undefined)); - _this.typeWriter = new TypeWriter(_assertThisInitialized(_this), GetValue$2l(config, 'typing', undefined)); + _this.parser = new Parser(_assertThisInitialized(_this), GetValue$2j(config, 'parser', undefined)); + _this.typeWriter = new TypeWriter(_assertThisInitialized(_this), GetValue$2j(config, 'typing', undefined)); _this._imageManager = undefined; - var imageData = GetValue$2l(config, 'images', undefined); + var imageData = GetValue$2j(config, 'images', undefined); if (imageData) { _this.addImage(imageData); } - var spriteManagerConfig = GetValue$2l(config, 'sprites'); + var spriteManagerConfig = GetValue$2j(config, 'sprites'); if (spriteManagerConfig !== false && spriteManagerConfig !== null) { AddSpriteManager.call(_assertThisInitialized(_this), spriteManagerConfig); } - _this.setIgnoreNextPageInput(GetValue$2l(config, 'ignoreNextPageInput', false)); - _this.setNextPageInput(GetValue$2l(config, 'nextPageInput', null)); + _this.setIgnoreNextPageInput(GetValue$2j(config, 'ignoreNextPageInput', false)); + _this.setNextPageInput(GetValue$2j(config, 'nextPageInput', null)); _this.isPlaying = false; if (content) { _this.play(content); @@ -21573,7 +21573,7 @@ LastOpenedEditor$1 = undefined; }; - var GetValue$2k = Phaser.Utils.Objects.GetValue; + var GetValue$2i = Phaser.Utils.Objects.GetValue; var SetProperties = function SetProperties(properties, config, out) { if (out === undefined) { out = {}; @@ -21581,7 +21581,7 @@ var property, value; for (var key in properties) { property = properties[key]; // [propName, defaultValue] - value = GetValue$2k(config, key, property[1]); + value = GetValue$2i(config, key, property[1]); if (value !== undefined) { out[property[0]] = value; } @@ -21650,12 +21650,12 @@ this.emit('close', this); }; - var GetValue$2j = Phaser.Utils.Objects.GetValue; + var GetValue$2h = Phaser.Utils.Objects.GetValue; var CreateElement = function CreateElement(parent, config) { var element; - var textType = GetValue$2j(config, 'inputType', undefined); + var textType = GetValue$2h(config, 'inputType', undefined); if (textType === undefined) { - textType = GetValue$2j(config, 'type', 'text'); + textType = GetValue$2h(config, 'type', 'text'); } if (textType === 'textarea') { element = document.createElement('textarea'); @@ -21664,7 +21664,7 @@ element = document.createElement('input'); element.type = textType; } - var style = GetValue$2j(config, 'style', undefined); + var style = GetValue$2h(config, 'style', undefined); // Apply other style properties var elementStyle = element.style; SetProperties(StyleProperties$1, style, elementStyle); @@ -21738,7 +21738,7 @@ close: Close$1 }; - var GetValue$2i = Phaser.Utils.Objects.GetValue; + var GetValue$2g = Phaser.Utils.Objects.GetValue; var HiddenTextEditBase = /*#__PURE__*/function (_ComponentBase) { _inherits(HiddenTextEditBase, _ComponentBase); var _super = _createSuper(HiddenTextEditBase); @@ -21748,22 +21748,22 @@ _this = _super.call(this, gameObject); // this.parent = gameObject; - var textType = GetValue$2i(config, 'inputType', undefined); + var textType = GetValue$2g(config, 'inputType', undefined); if (textType === undefined) { - textType = GetValue$2i(config, 'type', 'text'); + textType = GetValue$2g(config, 'type', 'text'); } - _this.setEnterCloseEnable(GetValue$2i(config, 'enterClose', textType !== 'textarea')); - var onOpen = GetValue$2i(config, 'onOpen', undefined); + _this.setEnterCloseEnable(GetValue$2g(config, 'enterClose', textType !== 'textarea')); + var onOpen = GetValue$2g(config, 'onOpen', undefined); if (!onOpen) { - onOpen = GetValue$2i(config, 'onFocus', undefined); + onOpen = GetValue$2g(config, 'onFocus', undefined); } _this.onOpenCallback = onOpen; - var onClose = GetValue$2i(config, 'onClose', undefined); + var onClose = GetValue$2g(config, 'onClose', undefined); if (!onClose) { - onClose = GetValue$2i(config, 'onBlur', undefined); + onClose = GetValue$2g(config, 'onBlur', undefined); } _this.onCloseCallback = onClose; - _this.onUpdateCallback = GetValue$2i(config, 'onUpdate', undefined); + _this.onUpdateCallback = GetValue$2g(config, 'onUpdate', undefined); _this.isOpened = false; gameObject.on('pointerdown', function () { this.open(); @@ -22268,7 +22268,7 @@ hiddenTextEdit.prevCursorPosition = null; }; - var GetValue$2h = Phaser.Utils.Objects.GetValue; + var GetValue$2f = Phaser.Utils.Objects.GetValue; var HiddenTextEdit = /*#__PURE__*/function (_HiddenTextEditBase) { _inherits(HiddenTextEdit, _HiddenTextEditBase); var _super = _createSuper(HiddenTextEdit); @@ -22278,7 +22278,7 @@ _this = _super.call(this, gameObject, config); // this.parent = gameObject; - _this.setSelectAllWhenFocusEnable(GetValue$2h(config, 'selectAll', false)); + _this.setSelectAllWhenFocusEnable(GetValue$2f(config, 'selectAll', false)); _this.cursorMoveStartIndex = null; _this.prevCursorPosition = null; _this.prevSelectionStart = null; @@ -22377,10 +22377,10 @@ return HiddenTextEdit; }(HiddenTextEditBase); - var GetValue$2g = Phaser.Utils.Objects.GetValue; + var GetValue$2e = Phaser.Utils.Objects.GetValue; var PropertiesList = ['inputType', 'onOpen', 'onFocus', 'onClose', 'onBlur', 'onUpdate', 'enterClose', 'readOnly', 'maxLength', 'minLength', 'selectAll']; var CreateHiddenTextEdit = function CreateHiddenTextEdit(parent, parentConfig) { - var config = GetValue$2g(parentConfig, 'edit'); + var config = GetValue$2e(parentConfig, 'edit'); if (config === undefined) { config = {}; } @@ -24972,7 +24972,7 @@ return Rectangle; }(BaseGeom); - var GetValue$2f = Phaser.Utils.Objects.GetValue; + var GetValue$2d = Phaser.Utils.Objects.GetValue; var RoundRectangle = /*#__PURE__*/function (_PathBase) { _inherits(RoundRectangle, _PathBase); var _super = _createSuper(RoundRectangle); @@ -25134,10 +25134,10 @@ this.radiusBL = value; this.radiusBR = value; } else { - this.radiusTL = GetValue$2f(value, 'tl', 0); - this.radiusTR = GetValue$2f(value, 'tr', 0); - this.radiusBL = GetValue$2f(value, 'bl', 0); - this.radiusBR = GetValue$2f(value, 'br', 0); + this.radiusTL = GetValue$2d(value, 'tl', 0); + this.radiusTR = GetValue$2d(value, 'tr', 0); + this.radiusBL = GetValue$2d(value, 'bl', 0); + this.radiusBR = GetValue$2d(value, 'br', 0); } } }, { @@ -25470,7 +25470,7 @@ } }; - var GetValue$2e = Phaser.Utils.Objects.GetValue; + var GetValue$2c = Phaser.Utils.Objects.GetValue; var Linear$a = Phaser.Math.Linear; var EaseValueTask = /*#__PURE__*/function (_EaseValueTaskBase) { _inherits(EaseValueTask, _EaseValueTaskBase); @@ -25493,15 +25493,15 @@ return this; } var target = this.target; - this.propertyKey = GetValue$2e(config, 'key', 'value'); + this.propertyKey = GetValue$2c(config, 'key', 'value'); var currentValue = target[this.propertyKey]; - this.fromValue = GetValue$2e(config, 'from', currentValue); - this.toValue = GetValue$2e(config, 'to', currentValue); - this.setEase(GetValue$2e(config, 'ease', this.ease)); - this.setDuration(GetValue$2e(config, 'duration', this.duration)); - this.setRepeat(GetValue$2e(config, 'repeat', 0)); - this.setDelay(GetValue$2e(config, 'delay', 0)); - this.setRepeatDelay(GetValue$2e(config, 'repeatDelay', 0)); + this.fromValue = GetValue$2c(config, 'from', currentValue); + this.toValue = GetValue$2c(config, 'to', currentValue); + this.setEase(GetValue$2c(config, 'ease', this.ease)); + this.setDuration(GetValue$2c(config, 'duration', this.duration)); + this.setRepeat(GetValue$2c(config, 'repeat', 0)); + this.setDelay(GetValue$2c(config, 'delay', 0)); + this.setRepeatDelay(GetValue$2c(config, 'repeatDelay', 0)); this.timer.setDuration(this.duration).setRepeat(this.repeat).setDelay(this.delay).setRepeatDelay(this.repeatDelay); target[this.propertyKey] = this.fromValue; _get(_getPrototypeOf(EaseValueTask.prototype), "start", this).call(this); @@ -25552,7 +25552,7 @@ var methods$r = {}; Object.assign(methods$r, StyleMethods$2, SizeMethods$1, ShapesUpdateMethods$4, CheckerAnimationMethods); - var GetValue$2d = Phaser.Utils.Objects.GetValue; + var GetValue$2b = Phaser.Utils.Objects.GetValue; var IsPlainObject$F = Phaser.Utils.Objects.IsPlainObject; var DefaultBoxFillColor = 0x005cb2; var DefaultCheckerColor = 0xffffff; @@ -25564,33 +25564,33 @@ _classCallCheck(this, CheckboxShape); if (IsPlainObject$F(x)) { config = x; - x = GetValue$2d(config, 'x', 0); - y = GetValue$2d(config, 'y', 0); - width = GetValue$2d(config, 'width', 2); - height = GetValue$2d(config, 'height', 2); - color = GetValue$2d(config, 'color', DefaultBoxFillColor); + x = GetValue$2b(config, 'x', 0); + y = GetValue$2b(config, 'y', 0); + width = GetValue$2b(config, 'width', 2); + height = GetValue$2b(config, 'height', 2); + color = GetValue$2b(config, 'color', DefaultBoxFillColor); } else if (IsPlainObject$F(color)) { config = color; - color = GetValue$2d(config, 'color', DefaultBoxFillColor); + color = GetValue$2b(config, 'color', DefaultBoxFillColor); } _this = _super.call(this, scene, x, y, width, height); _this.type = 'rexCheckbox'; if (color === undefined) { color = DefaultBoxFillColor; } - _this.setBoxShape(GetValue$2d(config, 'circleBox', false)); - _this.setBoxFillStyle(color, GetValue$2d(config, 'boxFillAlpha', 1)); - _this.setUncheckedBoxFillStyle(GetValue$2d(config, 'uncheckedColor', null), GetValue$2d(config, 'uncheckedBoxFillAlpha', 1)); - _this.setBoxStrokeStyle(GetValue$2d(config, 'boxLineWidth', 4), GetValue$2d(config, 'boxStrokeColor', color), GetValue$2d(config, 'boxStrokeAlpha', 1)); - _this.setUncheckedBoxStrokeStyle(_this.boxLineWidth, GetValue$2d(config, 'uncheckedBoxStrokeColor', _this.boxStrokeColor), GetValue$2d(config, 'uncheckedBoxStrokeAlpha', _this.boxStrokeAlpha)); - _this.setCheckerStyle(GetValue$2d(config, 'checkerColor', DefaultCheckerColor), GetValue$2d(config, 'checkerAlpha', 1)); - _this.setBoxSize(GetValue$2d(config, 'boxSize', 1)); - _this.setCheckerSize(GetValue$2d(config, 'checkerSize', 1)); - _this.setCheckerAnimationDuration(GetValue$2d(config, 'animationDuration', 150)); + _this.setBoxShape(GetValue$2b(config, 'circleBox', false)); + _this.setBoxFillStyle(color, GetValue$2b(config, 'boxFillAlpha', 1)); + _this.setUncheckedBoxFillStyle(GetValue$2b(config, 'uncheckedColor', null), GetValue$2b(config, 'uncheckedBoxFillAlpha', 1)); + _this.setBoxStrokeStyle(GetValue$2b(config, 'boxLineWidth', 4), GetValue$2b(config, 'boxStrokeColor', color), GetValue$2b(config, 'boxStrokeAlpha', 1)); + _this.setUncheckedBoxStrokeStyle(_this.boxLineWidth, GetValue$2b(config, 'uncheckedBoxStrokeColor', _this.boxStrokeColor), GetValue$2b(config, 'uncheckedBoxStrokeAlpha', _this.boxStrokeAlpha)); + _this.setCheckerStyle(GetValue$2b(config, 'checkerColor', DefaultCheckerColor), GetValue$2b(config, 'checkerAlpha', 1)); + _this.setBoxSize(GetValue$2b(config, 'boxSize', 1)); + _this.setCheckerSize(GetValue$2b(config, 'checkerSize', 1)); + _this.setCheckerAnimationDuration(GetValue$2b(config, 'animationDuration', 150)); _this.buildShapes(); - var value = GetValue$2d(config, 'checked'); + var value = GetValue$2b(config, 'checked'); if (value === undefined) { - value = GetValue$2d(config, 'value', false); + value = GetValue$2b(config, 'value', false); } _this.setValue(value); return _this; @@ -25666,7 +25666,7 @@ }(BaseShapes); Object.assign(CheckboxShape.prototype, methods$r); - var GetValue$2c = Phaser.Utils.Objects.GetValue; + var GetValue$2a = Phaser.Utils.Objects.GetValue; var Button = /*#__PURE__*/function (_ComponentBase) { _inherits(Button, _ComponentBase); var _super = _createSuper(Button); @@ -25677,7 +25677,7 @@ // this.parent = gameObject; _this._enable = undefined; - gameObject.setInteractive(GetValue$2c(config, "inputConfig", undefined)); + gameObject.setInteractive(GetValue$2a(config, "inputConfig", undefined)); _this.resetFromJSON(config); _this.boot(); return _this; @@ -25687,10 +25687,10 @@ value: function resetFromJSON(o) { this.pointer = undefined; this.lastClickTime = undefined; - this.setEnable(GetValue$2c(o, "enable", true)); - this.setMode(GetValue$2c(o, "mode", 1)); - this.setClickInterval(GetValue$2c(o, "clickInterval", 100)); - this.setDragThreshold(GetValue$2c(o, 'threshold', undefined)); + this.setEnable(GetValue$2a(o, "enable", true)); + this.setMode(GetValue$2a(o, "mode", 1)); + this.setClickInterval(GetValue$2a(o, "clickInterval", 100)); + this.setDragThreshold(GetValue$2a(o, 'threshold', undefined)); return this; } }, { @@ -25875,7 +25875,7 @@ pointerup: 1 }; - var GetValue$2b = Phaser.Utils.Objects.GetValue; + var GetValue$29 = Phaser.Utils.Objects.GetValue; var Checkbox = /*#__PURE__*/function (_CheckboxShape) { _inherits(Checkbox, _CheckboxShape); var _super = _createSuper(Checkbox); @@ -25883,11 +25883,11 @@ var _this; _classCallCheck(this, Checkbox); _this = _super.call(this, scene, x, y, width, height, color, config); - _this._click = new Button(_assertThisInitialized(_this), GetValue$2b(config, 'click')); + _this._click = new Button(_assertThisInitialized(_this), GetValue$29(config, 'click')); _this._click.on('click', function () { this.toggleValue(); }, _assertThisInitialized(_this)); - _this.setReadOnly(GetValue$2b(config, 'readOnly', false)); + _this.setReadOnly(GetValue$29(config, 'readOnly', false)); return _this; } _createClass(Checkbox, [{ @@ -26097,7 +26097,7 @@ return (shade & 0xff) << 16 | (shade & 0xff) << 8 | shade & 0xff; }; - var GetValue$2a = Phaser.Utils.Objects.GetValue; + var GetValue$28 = Phaser.Utils.Objects.GetValue; var IsPlainObject$E = Phaser.Utils.Objects.IsPlainObject; var DefaultTrackFillColor = 0x005cb2; var DefaultThumbFillColor = 0xffffff; @@ -26109,37 +26109,37 @@ _classCallCheck(this, ToggleSwitchShape); if (IsPlainObject$E(x)) { config = x; - x = GetValue$2a(config, 'x', 0); - y = GetValue$2a(config, 'y', 0); - width = GetValue$2a(config, 'width', 2); - height = GetValue$2a(config, 'height', 2); - color = GetValue$2a(config, 'color', DefaultTrackFillColor); + x = GetValue$28(config, 'x', 0); + y = GetValue$28(config, 'y', 0); + width = GetValue$28(config, 'width', 2); + height = GetValue$28(config, 'height', 2); + color = GetValue$28(config, 'color', DefaultTrackFillColor); } else if (IsPlainObject$E(color)) { config = color; - color = GetValue$2a(config, 'color', DefaultTrackFillColor); + color = GetValue$28(config, 'color', DefaultTrackFillColor); } _this = _super.call(this, scene, x, y, width, height); _this.type = 'rexToggleSwitch'; if (color === undefined) { color = DefaultTrackFillColor; } - _this.setTrackFillStyle(color, GetValue$2a(config, 'trackFillAlpha', 1)); - _this.setFalseValueTrackFillStyle(GetValue$2a(config, 'falseValueTrackColor', GrayScale(color)), GetValue$2a(config, 'falseValueTrackFillAlpha', 1)); - _this.setThumbStyle(GetValue$2a(config, 'thumbColor', DefaultThumbFillColor), GetValue$2a(config, 'thumbAlpha', 1)); - _this.setTrackSize(GetValue$2a(config, 'trackWidth', 0.9), GetValue$2a(config, 'trackHeight', 0.5)); - _this.setTrackRadius(GetValue$2a(config, 'trackRadius', _this.trackHeight * 0.5)); - var thumbHeight = GetValue$2a(config, 'thumbHeight', undefined); - var thumbWidth = GetValue$2a(config, 'thumbWidth', thumbHeight); + _this.setTrackFillStyle(color, GetValue$28(config, 'trackFillAlpha', 1)); + _this.setFalseValueTrackFillStyle(GetValue$28(config, 'falseValueTrackColor', GrayScale(color)), GetValue$28(config, 'falseValueTrackFillAlpha', 1)); + _this.setThumbStyle(GetValue$28(config, 'thumbColor', DefaultThumbFillColor), GetValue$28(config, 'thumbAlpha', 1)); + _this.setTrackSize(GetValue$28(config, 'trackWidth', 0.9), GetValue$28(config, 'trackHeight', 0.5)); + _this.setTrackRadius(GetValue$28(config, 'trackRadius', _this.trackHeight * 0.5)); + var thumbHeight = GetValue$28(config, 'thumbHeight', undefined); + var thumbWidth = GetValue$28(config, 'thumbWidth', thumbHeight); if (thumbWidth === undefined) { thumbWidth = _this.trackHeight * 0.9; } _this.setThumbSize(thumbWidth, thumbHeight); - _this.setThumbRadius(GetValue$2a(config, 'thumbRadius', _this.thumbHeight * 0.5)); - _this.setThumbPosition(GetValue$2a(config, 'thumbLeft', 0.3), GetValue$2a(config, 'thumbRight', undefined)); - _this.setRTL(GetValue$2a(config, 'rtl', false)); - _this.setToggleAnimationDuration(GetValue$2a(config, 'animationDuration', 150)); + _this.setThumbRadius(GetValue$28(config, 'thumbRadius', _this.thumbHeight * 0.5)); + _this.setThumbPosition(GetValue$28(config, 'thumbLeft', 0.3), GetValue$28(config, 'thumbRight', undefined)); + _this.setRTL(GetValue$28(config, 'rtl', false)); + _this.setToggleAnimationDuration(GetValue$28(config, 'animationDuration', 150)); _this.buildShapes(); - _this.setValue(GetValue$2a(config, 'value', false), 0); + _this.setValue(GetValue$28(config, 'value', false), 0); return _this; } _createClass(ToggleSwitchShape, [{ @@ -26192,7 +26192,7 @@ }(BaseShapes); Object.assign(ToggleSwitchShape.prototype, methods$q); - var GetValue$29 = Phaser.Utils.Objects.GetValue; + var GetValue$27 = Phaser.Utils.Objects.GetValue; var ToggleSwitch = /*#__PURE__*/function (_ToggleSwitchShape) { _inherits(ToggleSwitch, _ToggleSwitchShape); var _super = _createSuper(ToggleSwitch); @@ -26200,11 +26200,11 @@ var _this; _classCallCheck(this, ToggleSwitch); _this = _super.call(this, scene, x, y, width, height, color, config); - _this._click = new Button(_assertThisInitialized(_this), GetValue$29(config, 'click')); + _this._click = new Button(_assertThisInitialized(_this), GetValue$27(config, 'click')); _this._click.on('click', function () { this.toggleValue(); }, _assertThisInitialized(_this)); - _this.setReadOnly(GetValue$29(config, 'readOnly', false)); + _this.setReadOnly(GetValue$27(config, 'readOnly', false)); return _this; } _createClass(ToggleSwitch, [{ @@ -26389,7 +26389,7 @@ easeValueRepeat: EaseValueRepeat }; - var GetValue$28 = Phaser.Utils.Objects.GetValue; + var GetValue$26 = Phaser.Utils.Objects.GetValue; var Clamp$c = Phaser.Math.Clamp; function ProgressBase (BaseClass) { var ProgressBase = /*#__PURE__*/function (_BaseClass) { @@ -26402,13 +26402,13 @@ _createClass(ProgressBase, [{ key: "bootProgressBase", value: function bootProgressBase(config) { - this.eventEmitter = GetValue$28(config, 'eventEmitter', this); - var callback = GetValue$28(config, 'valuechangeCallback', null); + this.eventEmitter = GetValue$26(config, 'eventEmitter', this); + var callback = GetValue$26(config, 'valuechangeCallback', null); if (callback !== null) { - var scope = GetValue$28(config, 'valuechangeCallbackScope', undefined); + var scope = GetValue$26(config, 'valuechangeCallbackScope', undefined); this.eventEmitter.on('valuechange', callback, scope); } - this.setEaseValuePropName('value').setEaseValueDuration(GetValue$28(config, 'easeValue.duration', 0)).setEaseValueFunction(GetValue$28(config, 'easeValue.ease', 'Linear')); + this.setEaseValuePropName('value').setEaseValueDuration(GetValue$26(config, 'easeValue.duration', 0)).setEaseValueFunction(GetValue$26(config, 'easeValue.ease', 'Linear')); return this; } }, { @@ -26503,7 +26503,7 @@ } }; - var GetValue$27 = Phaser.Utils.Objects.GetValue; + var GetValue$25 = Phaser.Utils.Objects.GetValue; var IsPlainObject$D = Phaser.Utils.Objects.IsPlainObject; var Clamp$b = Phaser.Math.Clamp; var DefaultStartAngle$1 = Phaser.Math.DegToRad(270); @@ -26515,11 +26515,11 @@ _classCallCheck(this, CircularProgress); if (IsPlainObject$D(x)) { config = x; - x = GetValue$27(config, 'x', 0); - y = GetValue$27(config, 'y', 0); - radius = GetValue$27(config, 'radius', 1); - barColor = GetValue$27(config, 'barColor', undefined); - value = GetValue$27(config, 'value', 0); + x = GetValue$25(config, 'x', 0); + y = GetValue$25(config, 'y', 0); + radius = GetValue$25(config, 'radius', 1); + barColor = GetValue$25(config, 'barColor', undefined); + value = GetValue$25(config, 'value', 0); } if (radius === undefined) { radius = 1; @@ -26529,12 +26529,12 @@ _this.type = 'rexCircularProgress'; _this.bootProgressBase(config); _this.setRadius(radius); - _this.setTrackColor(GetValue$27(config, 'trackColor', undefined)); + _this.setTrackColor(GetValue$25(config, 'trackColor', undefined)); _this.setBarColor(barColor); - _this.setCenterColor(GetValue$27(config, 'centerColor', undefined)); - _this.setThickness(GetValue$27(config, 'thickness', 0.2)); - _this.setStartAngle(GetValue$27(config, 'startAngle', DefaultStartAngle$1)); - _this.setAnticlockwise(GetValue$27(config, 'anticlockwise', false)); + _this.setCenterColor(GetValue$25(config, 'centerColor', undefined)); + _this.setThickness(GetValue$25(config, 'thickness', 0.2)); + _this.setStartAngle(GetValue$25(config, 'startAngle', DefaultStartAngle$1)); + _this.setAnticlockwise(GetValue$25(config, 'anticlockwise', false)); _this.buildShapes(); _this.setValue(value); return _this; @@ -26775,7 +26775,7 @@ } }; - var GetValue$26 = Phaser.Utils.Objects.GetValue; + var GetValue$24 = Phaser.Utils.Objects.GetValue; var IsPlainObject$C = Phaser.Utils.Objects.IsPlainObject; var Clamp$a = Phaser.Math.Clamp; var DefaultStartAngle = Phaser.Math.DegToRad(270); @@ -26787,32 +26787,32 @@ _classCallCheck(this, CircularProgress); if (IsPlainObject$C(x)) { config = x; - x = GetValue$26(config, 'x', 0); - y = GetValue$26(config, 'y', 0); - radius = GetValue$26(config, 'radius', 1); - barColor = GetValue$26(config, 'barColor', undefined); - value = GetValue$26(config, 'value', 0); + x = GetValue$24(config, 'x', 0); + y = GetValue$24(config, 'y', 0); + radius = GetValue$24(config, 'radius', 1); + barColor = GetValue$24(config, 'barColor', undefined); + value = GetValue$24(config, 'value', 0); } var width = radius * 2; _this = _super.call(this, scene, x, y, width, width); _this.type = 'rexCircularProgressCanvas'; _this.bootProgressBase(config); _this.setRadius(radius); - _this.setTrackColor(GetValue$26(config, 'trackColor', undefined)); + _this.setTrackColor(GetValue$24(config, 'trackColor', undefined)); _this.setBarColor(barColor); - _this.setCenterColor(GetValue$26(config, 'centerColor', undefined)); - _this.setThickness(GetValue$26(config, 'thickness', 0.2)); - _this.setStartAngle(GetValue$26(config, 'startAngle', DefaultStartAngle)); - _this.setAnticlockwise(GetValue$26(config, 'anticlockwise', false)); - _this.setTextColor(GetValue$26(config, 'textColor', undefined)); - _this.setTextStrokeColor(GetValue$26(config, 'textStrokeColor', undefined), GetValue$26(config, 'textStrokeThickness', undefined)); - var textFont = GetValue$26(config, 'textFont', undefined); + _this.setCenterColor(GetValue$24(config, 'centerColor', undefined)); + _this.setThickness(GetValue$24(config, 'thickness', 0.2)); + _this.setStartAngle(GetValue$24(config, 'startAngle', DefaultStartAngle)); + _this.setAnticlockwise(GetValue$24(config, 'anticlockwise', false)); + _this.setTextColor(GetValue$24(config, 'textColor', undefined)); + _this.setTextStrokeColor(GetValue$24(config, 'textStrokeColor', undefined), GetValue$24(config, 'textStrokeThickness', undefined)); + var textFont = GetValue$24(config, 'textFont', undefined); if (textFont) { _this.setTextFont(textFont); } else { - _this.setTextFont(GetValue$26(config, 'textSize', '16px'), GetValue$26(config, 'textFamily', 'Courier'), GetValue$26(config, 'textStyle', '')); + _this.setTextFont(GetValue$24(config, 'textSize', '16px'), GetValue$24(config, 'textFamily', 'Courier'), GetValue$24(config, 'textStyle', '')); } - _this.setTextFormatCallback(GetValue$26(config, 'textFormatCallback', undefined), GetValue$26(config, 'textFormatCallbackScope', undefined)); + _this.setTextFormatCallback(GetValue$24(config, 'textFormatCallback', undefined), GetValue$24(config, 'textFormatCallbackScope', undefined)); _this.setValue(value); return _this; } @@ -27110,7 +27110,7 @@ return lines; }; - var GetValue$25 = Phaser.Utils.Objects.GetValue; + var GetValue$23 = Phaser.Utils.Objects.GetValue; var IsPlainObject$B = Phaser.Utils.Objects.IsPlainObject; var LineProgress$1 = /*#__PURE__*/function (_ProgressBase) { _inherits(LineProgress, _ProgressBase); @@ -27120,32 +27120,32 @@ _classCallCheck(this, LineProgress); if (IsPlainObject$B(x)) { config = x; - x = GetValue$25(config, 'x', 0); - y = GetValue$25(config, 'y', 0); - width = GetValue$25(config, 'width', 2); - height = GetValue$25(config, 'height', 2); - barColor = GetValue$25(config, 'barColor', undefined); - value = GetValue$25(config, 'value', 0); + x = GetValue$23(config, 'x', 0); + y = GetValue$23(config, 'y', 0); + width = GetValue$23(config, 'width', 2); + height = GetValue$23(config, 'height', 2); + barColor = GetValue$23(config, 'barColor', undefined); + value = GetValue$23(config, 'value', 0); } else if (IsPlainObject$B(width)) { config = width; - width = GetValue$25(config, 'width', 2); - height = GetValue$25(config, 'height', 2); - barColor = GetValue$25(config, 'barColor', undefined); - value = GetValue$25(config, 'value', 0); + width = GetValue$23(config, 'width', 2); + height = GetValue$23(config, 'height', 2); + barColor = GetValue$23(config, 'barColor', undefined); + value = GetValue$23(config, 'value', 0); } else if (IsPlainObject$B(barColor)) { config = barColor; - barColor = GetValue$25(config, 'barColor', undefined); - value = GetValue$25(config, 'value', 0); + barColor = GetValue$23(config, 'barColor', undefined); + value = GetValue$23(config, 'value', 0); } _this = _super.call(this, scene, x, y, width, height, config); _this.type = 'rexLineProgress'; _this.bootProgressBase(config); _this.addShape(new Lines().setName('trackFill')).addShape(new Lines().setName('bar')).addShape(new Lines().setName('trackStroke')); - _this.setTrackColor(GetValue$25(config, 'trackColor', undefined)); + _this.setTrackColor(GetValue$23(config, 'trackColor', undefined)); _this.setBarColor(barColor); - _this.setTrackStroke(GetValue$25(config, 'trackStrokeThickness', 2), GetValue$25(config, 'trackStrokeColor', undefined)); - _this.setSkewX(GetValue$25(config, 'skewX', 0)); - _this.setRTL(GetValue$25(config, 'rtl', false)); + _this.setTrackStroke(GetValue$23(config, 'trackStrokeThickness', 2), GetValue$23(config, 'trackStrokeColor', undefined)); + _this.setSkewX(GetValue$23(config, 'skewX', 0)); + _this.setRTL(GetValue$23(config, 'rtl', false)); _this.setValue(value); return _this; } @@ -27385,7 +27385,7 @@ return out; }; - var GetValue$24 = Phaser.Utils.Objects.GetValue; + var GetValue$22 = Phaser.Utils.Objects.GetValue; var IsPlainObject$A = Phaser.Utils.Objects.IsPlainObject; var LineProgress = /*#__PURE__*/function (_ProgressBase) { _inherits(LineProgress, _ProgressBase); @@ -27395,33 +27395,33 @@ _classCallCheck(this, LineProgress); if (IsPlainObject$A(x)) { config = x; - x = GetValue$24(config, 'x', 0); - y = GetValue$24(config, 'y', 0); - width = GetValue$24(config, 'width', 2); - height = GetValue$24(config, 'height', 2); - barColor = GetValue$24(config, 'barColor', undefined); - value = GetValue$24(config, 'value', 0); + x = GetValue$22(config, 'x', 0); + y = GetValue$22(config, 'y', 0); + width = GetValue$22(config, 'width', 2); + height = GetValue$22(config, 'height', 2); + barColor = GetValue$22(config, 'barColor', undefined); + value = GetValue$22(config, 'value', 0); } else if (IsPlainObject$A(width)) { config = width; - width = GetValue$24(config, 'width', 2); - height = GetValue$24(config, 'height', 2); - barColor = GetValue$24(config, 'barColor', undefined); - value = GetValue$24(config, 'value', 0); + width = GetValue$22(config, 'width', 2); + height = GetValue$22(config, 'height', 2); + barColor = GetValue$22(config, 'barColor', undefined); + value = GetValue$22(config, 'value', 0); } else if (IsPlainObject$A(barColor)) { config = barColor; - barColor = GetValue$24(config, 'barColor', undefined); - value = GetValue$24(config, 'value', 0); + barColor = GetValue$22(config, 'barColor', undefined); + value = GetValue$22(config, 'value', 0); } _this = _super.call(this, scene, x, y, width, height); _this.type = 'rexLineProgressCanvas'; _this.trackPoints = []; _this.barPoints = []; _this.bootProgressBase(config); - _this.setTrackColor(GetValue$24(config, 'trackColor', undefined)); - _this.setBarColor(barColor, GetValue$24(config, 'barColor2', undefined), GetValue$24(config, 'isHorizontalGradient', undefined)); - _this.setTrackStroke(GetValue$24(config, 'trackStrokeThickness', 2), GetValue$24(config, 'trackStrokeColor', undefined)); - _this.setSkewX(GetValue$24(config, 'skewX', 0)); - _this.setRTL(GetValue$24(config, 'rtl', false)); + _this.setTrackColor(GetValue$22(config, 'trackColor', undefined)); + _this.setBarColor(barColor, GetValue$22(config, 'barColor2', undefined), GetValue$22(config, 'isHorizontalGradient', undefined)); + _this.setTrackStroke(GetValue$22(config, 'trackStrokeThickness', 2), GetValue$22(config, 'trackStrokeColor', undefined)); + _this.setSkewX(GetValue$22(config, 'skewX', 0)); + _this.setRTL(GetValue$22(config, 'rtl', false)); _this.setValue(value); return _this; } @@ -27726,7 +27726,7 @@ } }; - var GetValue$23 = Phaser.Utils.Objects.GetValue; + var GetValue$21 = Phaser.Utils.Objects.GetValue; var IsPlainObject$z = Phaser.Utils.Objects.IsPlainObject; var DegToRad$4 = Phaser.Math.DegToRad; var RadToDeg$4 = Phaser.Math.RadToDeg; @@ -27873,21 +27873,21 @@ var config = left; // If they specify x and/or y this applies to all - var x = GetValue$23(config, 'x', null); + var x = GetValue$21(config, 'x', null); if (x !== null) { left = x; right = x; } else { - left = GetValue$23(config, 'left', 0); - right = GetValue$23(config, 'right', left); + left = GetValue$21(config, 'left', 0); + right = GetValue$21(config, 'right', left); } - var y = GetValue$23(config, 'y', null); + var y = GetValue$21(config, 'y', null); if (y !== null) { top = y; bottom = y; } else { - top = GetValue$23(config, 'top', 0); - bottom = GetValue$23(config, 'bottom', top); + top = GetValue$21(config, 'top', 0); + bottom = GetValue$21(config, 'bottom', top); } } else { if (left === undefined) { @@ -28357,7 +28357,7 @@ QuickSet(child, globZone, align); }; - var GetValue$22 = Phaser.Utils.Objects.GetValue; + var GetValue$20 = Phaser.Utils.Objects.GetValue; var Group$1 = Phaser.GameObjects.Group; var DrawBounds = function DrawBounds(graphics, config) { var scene = graphics.scene; @@ -28366,13 +28366,13 @@ if (typeof config === 'number') { color = config; } else { - color = GetValue$22(config, 'color'); - lineWidth = GetValue$22(config, 'lineWidth'); - var nameTextConfig = GetValue$22(config, 'name', false); + color = GetValue$20(config, 'color'); + lineWidth = GetValue$20(config, 'lineWidth'); + var nameTextConfig = GetValue$20(config, 'name', false); if (nameTextConfig) { - createTextCallback = GetValue$22(nameTextConfig, 'createTextCallback', DefaultCreateTextCallback); - createTextCallbackScope = GetValue$22(nameTextConfig, 'createTextCallbackScope', undefined); - textAlign = GetValue$22(nameTextConfig, 'align', 'left-top'); + createTextCallback = GetValue$20(nameTextConfig, 'createTextCallback', DefaultCreateTextCallback); + createTextCallbackScope = GetValue$20(nameTextConfig, 'createTextCallbackScope', undefined); + textAlign = GetValue$20(nameTextConfig, 'align', 'left-top'); if (typeof textAlign === 'string') { textAlign = AlignConst[textAlign]; } @@ -28429,7 +28429,7 @@ }; var GlobRect = undefined; - var GetValue$21 = Phaser.Utils.Objects.GetValue; + var GetValue$1$ = Phaser.Utils.Objects.GetValue; var GetBoundsConfig = function GetBoundsConfig(config, out) { if (config === undefined) { config = 0; @@ -28443,10 +28443,10 @@ out.top = config; out.bottom = config; } else { - out.left = GetValue$21(config, 'left', 0); - out.right = GetValue$21(config, 'right', 0); - out.top = GetValue$21(config, 'top', 0); - out.bottom = GetValue$21(config, 'bottom', 0); + out.left = GetValue$1$(config, 'left', 0); + out.right = GetValue$1$(config, 'right', 0); + out.top = GetValue$1$(config, 'top', 0); + out.bottom = GetValue$1$(config, 'bottom', 0); } return out; }; @@ -29260,7 +29260,7 @@ return this; }; - var GetValue$20 = Phaser.Utils.Objects.GetValue; + var GetValue$1_ = Phaser.Utils.Objects.GetValue; var GetAdvancedValue$2 = Phaser.Utils.Objects.GetAdvancedValue; var Linear$5 = Phaser.Math.Linear; var Scale = /*#__PURE__*/function (_EaseValueTaskBase) { @@ -29283,7 +29283,7 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Scale.prototype), "resetFromJSON", this).call(this, o); - this.setMode(GetValue$20(o, 'mode', 0)); + this.setMode(GetValue$1_(o, 'mode', 0)); this.setScaleRange(GetAdvancedValue$2(o, 'start', undefined), GetAdvancedValue$2(o, 'end', 0)); return this; } @@ -29611,7 +29611,7 @@ } }; - var GetValue$1$ = Phaser.Utils.Objects.GetValue; + var GetValue$1Z = Phaser.Utils.Objects.GetValue; var GetAdvancedValue$1 = Phaser.Utils.Objects.GetAdvancedValue; var Linear$4 = Phaser.Math.Linear; var Fade$1 = /*#__PURE__*/function (_EaseValueTaskBase) { @@ -29632,7 +29632,7 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Fade.prototype), "resetFromJSON", this).call(this, o); - this.setMode(GetValue$1$(o, 'mode', 0)); + this.setMode(GetValue$1Z(o, 'mode', 0)); this.setAlphaRange(GetAdvancedValue$1(o, 'start', this.parent.alpha), GetAdvancedValue$1(o, 'end', 0)); return this; } @@ -29812,7 +29812,7 @@ } }; - var GetValue$1_ = Phaser.Utils.Objects.GetValue; + var GetValue$1Y = Phaser.Utils.Objects.GetValue; var GetAdvancedValue = Phaser.Utils.Objects.GetAdvancedValue; var Linear$3 = Phaser.Math.Linear; var EaseMove = /*#__PURE__*/function (_EaseValueTaskBase) { @@ -29833,7 +29833,7 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(EaseMove.prototype), "resetFromJSON", this).call(this, o); - this.setMode(GetValue$1_(o, 'mode', 0)); + this.setMode(GetValue$1Y(o, 'mode', 0)); if (o && (o.hasOwnProperty('x') || o.hasOwnProperty('y'))) { var endX = GetAdvancedValue(o, 'x', undefined); var endY = GetAdvancedValue(o, 'y', undefined); @@ -30098,7 +30098,7 @@ } }; - var GetValue$1Z = Phaser.Utils.Objects.GetValue; + var GetValue$1X = Phaser.Utils.Objects.GetValue; var ShakePosition = /*#__PURE__*/function (_TickTask) { _inherits(ShakePosition, _TickTask); var _super = _createSuper(ShakePosition); @@ -30116,16 +30116,16 @@ _createClass(ShakePosition, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.timer.resetFromJSON(GetValue$1Z(o, 'timer')); - this.setEnable(GetValue$1Z(o, 'enable', true)); - this.setMode(GetValue$1Z(o, 'mode', 1)); - this.isRunning = GetValue$1Z(o, 'isRunning', false); - this.setMagnitudeMode(GetValue$1Z(o, 'magnitudeMode', 1)); - this.setAxisMode(GetValue$1Z(o, "axis", 0)); - this.setDuration(GetValue$1Z(o, 'duration', 500)); - this.setMagnitude(GetValue$1Z(o, 'magnitude', 10)); - this.ox = GetValue$1Z(o, 'ox', undefined); - this.oy = GetValue$1Z(o, 'oy', undefined); + this.timer.resetFromJSON(GetValue$1X(o, 'timer')); + this.setEnable(GetValue$1X(o, 'enable', true)); + this.setMode(GetValue$1X(o, 'mode', 1)); + this.isRunning = GetValue$1X(o, 'isRunning', false); + this.setMagnitudeMode(GetValue$1X(o, 'magnitudeMode', 1)); + this.setAxisMode(GetValue$1X(o, "axis", 0)); + this.setDuration(GetValue$1X(o, 'duration', 500)); + this.setMagnitude(GetValue$1X(o, 'magnitude', 10)); + this.ox = GetValue$1X(o, 'ox', undefined); + this.oy = GetValue$1X(o, 'oy', undefined); return this; } }, { @@ -30238,8 +30238,8 @@ value: function start(duration, magnitude) { if (typeof duration !== 'number') { var config = duration; - magnitude = GetValue$1Z(config, 'magnitude', undefined); - duration = GetValue$1Z(config, 'duration', undefined); + magnitude = GetValue$1X(config, 'magnitude', undefined); + duration = GetValue$1X(config, 'duration', undefined); } if (magnitude !== undefined) { this.setMagnitude(magnitude); @@ -31068,13 +31068,13 @@ function FSM(config) { _classCallCheck(this, FSM); // Attach get-next-state function - var states = GetValue$2W(config, 'states', undefined); + var states = GetValue$2U(config, 'states', undefined); if (states) { this.addStates(states); } // Attach extend members - var extend = GetValue$2W(config, 'extend', undefined); + var extend = GetValue$2U(config, 'extend', undefined); if (extend) { for (var name in extend) { if (!this.hasOwnProperty(name) || this[name] === undefined) { @@ -31084,8 +31084,8 @@ } // Event emitter - var eventEmitter = GetValue$2W(config, 'eventEmitter', undefined); - var EventEmitterClass = GetValue$2W(config, 'EventEmitterClass', undefined); + var eventEmitter = GetValue$2U(config, 'eventEmitter', undefined); + var EventEmitterClass = GetValue$2U(config, 'EventEmitterClass', undefined); this.setEventEmitter(eventEmitter, EventEmitterClass); this._stateLock = false; this.resetFromJSON(config); @@ -31103,9 +31103,9 @@ }, { key: "resetFromJSON", value: function resetFromJSON(o) { - this.setEnable(GetValue$2W(o, 'enable', true)); - this.start(GetValue$2W(o, 'start', undefined)); - var init = GetValue$2W(o, 'init', undefined); + this.setEnable(GetValue$2U(o, 'enable', true)); + this.start(GetValue$2U(o, 'start', undefined)); + var init = GetValue$2U(o, 'init', undefined); if (init) { init.call(this); } @@ -31342,7 +31342,7 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(FSM.prototype), "resetFromJSON", this).call(this, o); - this._scene = GetValue$2W(o, 'scene', undefined); + this._scene = GetValue$2U(o, 'scene', undefined); return this; } }, { @@ -31681,7 +31681,7 @@ var methods$p = {}; Object.assign(methods$p, DelayCallMethods$1, ConfigurationMethods$1, OpenMethods, CloseMethods); - var GetValue$1Y = Phaser.Utils.Objects.GetValue; + var GetValue$1W = Phaser.Utils.Objects.GetValue; var OpenCloseTransition = /*#__PURE__*/function (_ComponentBase) { _inherits(OpenCloseTransition, _ComponentBase); var _super = _createSuper(OpenCloseTransition); @@ -31692,15 +31692,15 @@ // this.parent = gameObject; // this.scene - _this.setTransitInTime(GetValue$1Y(config, 'duration.in', 200)); - _this.setTransitOutTime(GetValue$1Y(config, 'duration.out', 200)); - _this.setTransitInCallback(GetValue$1Y(config, 'transitIn')); - _this.setTransitOutCallback(GetValue$1Y(config, 'transitOut')); - _this.oneShotMode = GetValue$1Y(config, 'destroy', false); + _this.setTransitInTime(GetValue$1W(config, 'duration.in', 200)); + _this.setTransitOutTime(GetValue$1W(config, 'duration.out', 200)); + _this.setTransitInCallback(GetValue$1W(config, 'transitIn')); + _this.setTransitOutCallback(GetValue$1W(config, 'transitOut')); + _this.oneShotMode = GetValue$1W(config, 'destroy', false); _this.delayCallTimer = undefined; _this._state = new State$1(_assertThisInitialized(_this), { eventEmitter: false, - initState: GetValue$1Y(config, 'initState', 'IDLE') + initState: GetValue$1W(config, 'initState', 'IDLE') }); _this.openEventData = undefined; _this.closeEventData = undefined; @@ -31792,7 +31792,7 @@ return FullWindowRectangle; }(Rectangle); - var GetValue$1X = Phaser.Utils.Objects.GetValue; + var GetValue$1V = Phaser.Utils.Objects.GetValue; var TouchEventStop = /*#__PURE__*/function (_ComponentBase) { _inherits(TouchEventStop, _ComponentBase); var _super = _createSuper(TouchEventStop); @@ -31812,9 +31812,9 @@ _createClass(TouchEventStop, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.setHitAreaMode(GetValue$1X(o, 'hitAreaMode', 0)); - this.setEnable(GetValue$1X(o, 'enable', true)); - this.setStopMode(GetValue$1X(o, 'stopAllLevels', true)); + this.setHitAreaMode(GetValue$1V(o, 'hitAreaMode', 0)); + this.setEnable(GetValue$1V(o, 'enable', true)); + this.setStopMode(GetValue$1V(o, 'stopAllLevels', true)); return this; } }, { @@ -31901,15 +31901,15 @@ fullWindow: 1 }; - var GetValue$1W = Phaser.Utils.Objects.GetValue; + var GetValue$1U = Phaser.Utils.Objects.GetValue; var Cover = /*#__PURE__*/function (_FullWindowRectangle) { _inherits(Cover, _FullWindowRectangle); var _super = _createSuper(Cover); function Cover(scene, config) { var _this; _classCallCheck(this, Cover); - var fillColor = GetValue$1W(config, 'color', 0x0); - var fillAlpha = GetValue$1W(config, 'alpha', 0.8); + var fillColor = GetValue$1U(config, 'color', 0x0); + var fillAlpha = GetValue$1U(config, 'alpha', 0.8); _this = _super.call(this, scene, fillColor, fillAlpha); _this.touchEventStop = new TouchEventStop(_assertThisInitialized(_this), { hitAreaMode: 1 @@ -31998,7 +31998,7 @@ return true; }; - var GetValue$1V = Phaser.Utils.Objects.GetValue; + var GetValue$1T = Phaser.Utils.Objects.GetValue; var Modal$2 = /*#__PURE__*/function (_OpenCloseTransition) { _inherits(Modal, _OpenCloseTransition); var _super = _createSuper(Modal); @@ -32014,25 +32014,25 @@ if (config.transitOut == null) { config.transitOut = TransitionMode.scaleDown; } - config.destroy = GetValue$1V(config, 'destroy', true); + config.destroy = GetValue$1T(config, 'destroy', true); _this = _super.call(this, gameObject, config); // this.parent = gameObject; // this.scene // Cover : key of modal, to block touch input - var coverConfig = GetValue$1V(config, 'cover'); + var coverConfig = GetValue$1T(config, 'cover'); _this.cover = coverConfig !== false ? CreateCover(gameObject, coverConfig) : undefined; if (_this.cover) { - _this.setCoverTransitInCallback(GetValue$1V(coverConfig, 'transitIn', DefaultCoverTransitInCallback)); - _this.setCoverTransitOutCallback(GetValue$1V(coverConfig, 'transitOut', DefaultCoverTransitOutCallback)); + _this.setCoverTransitInCallback(GetValue$1T(coverConfig, 'transitIn', DefaultCoverTransitInCallback)); + _this.setCoverTransitOutCallback(GetValue$1T(coverConfig, 'transitOut', DefaultCoverTransitOutCallback)); } // Close conditions: - var touchOutsideClose = GetValue$1V(config, 'touchOutsideClose', false); - var timeOutDuration = GetValue$1V(config, 'duration.hold', -1); - var timeOutClose = GetValue$1V(config, 'timeOutClose', timeOutDuration >= 0); - var anyTouchClose = GetValue$1V(config, 'anyTouchClose', false); - var manualClose = GetValue$1V(config, 'manualClose', false); + var touchOutsideClose = GetValue$1T(config, 'touchOutsideClose', false); + var timeOutDuration = GetValue$1T(config, 'duration.hold', -1); + var timeOutClose = GetValue$1T(config, 'timeOutClose', timeOutDuration >= 0); + var anyTouchClose = GetValue$1T(config, 'anyTouchClose', false); + var manualClose = GetValue$1T(config, 'manualClose', false); if (manualClose) { touchOutsideClose = false; anyTouchClose = false; @@ -32053,7 +32053,7 @@ } else if (touchOutsideClose) { _this.once('open', _this.touchOutsideClose, _assertThisInitialized(_this)); } - if (GetValue$1V(config, 'openOnStart', true)) { + if (GetValue$1T(config, 'openOnStart', true)) { // Run this.requestOpen() next tick // User can register events before this.requestOpen() _this.delayCall(0, _this.requestOpen, _assertThisInitialized(_this)); @@ -32579,7 +32579,7 @@ } }; - var GetValue$1U = Phaser.Utils.Objects.GetValue; + var GetValue$1S = Phaser.Utils.Objects.GetValue; var ClickOutside = /*#__PURE__*/function (_ComponentBase) { _inherits(ClickOutside, _ComponentBase); var _super = _createSuper(ClickOutside); @@ -32590,7 +32590,7 @@ // this.parent = gameObject; _this._enable = undefined; - var inputConfig = GetValue$1U(config, "inputConfig", undefined); + var inputConfig = GetValue$1S(config, "inputConfig", undefined); if (inputConfig) { gameObject.setInteractive(inputConfig); } @@ -32603,10 +32603,10 @@ value: function resetFromJSON(o) { this.pointer = undefined; this.lastClickTime = undefined; - this.setEnable(GetValue$1U(o, "enable", true)); - this.setMode(GetValue$1U(o, "mode", 1)); - this.setClickInterval(GetValue$1U(o, "clickInterval", 100)); - this.setDragThreshold(GetValue$1U(o, 'threshold', undefined)); + this.setEnable(GetValue$1S(o, "enable", true)); + this.setMode(GetValue$1S(o, "mode", 1)); + this.setClickInterval(GetValue$1S(o, "clickInterval", 100)); + this.setDragThreshold(GetValue$1S(o, 'threshold', undefined)); return this; } }, { @@ -32898,7 +32898,7 @@ return Cooldown; }(FSM); - var GetValue$1T = Phaser.Utils.Objects.GetValue; + var GetValue$1R = Phaser.Utils.Objects.GetValue; var InTouching = /*#__PURE__*/function (_ComponentBase) { _inherits(InTouching, _ComponentBase); var _super = _createSuper(InTouching); @@ -32910,7 +32910,7 @@ _this._enable = undefined; _this.cooldown = new Cooldown(); - _this.parent.setInteractive(GetValue$1T(config, 'inputConfig', undefined)); + _this.parent.setInteractive(GetValue$1R(config, 'inputConfig', undefined)); _this.resetFromJSON(config); _this.boot(); return _this; @@ -32921,8 +32921,8 @@ this.pointer = undefined; this.prevIsInTouch = false; this.isInTouching = false; - this.setEnable(GetValue$1T(o, 'enable', true)); - this.setCooldown(GetValue$1T(o, 'cooldown', undefined)); + this.setEnable(GetValue$1R(o, 'enable', true)); + this.setCooldown(GetValue$1R(o, 'cooldown', undefined)); return this; } }, { @@ -33153,9 +33153,9 @@ eventEmitter.emit(eventName, child, pointer, event); }; - var GetValue$1S = Phaser.Utils.Objects.GetValue; + var GetValue$1Q = Phaser.Utils.Objects.GetValue; var DownChild = function DownChild(config) { - var downConfig = GetValue$1S(config, 'down', undefined); + var downConfig = GetValue$1Q(config, 'down', undefined); if (downConfig === false) { return; } else if (downConfig === true) { @@ -33168,9 +33168,9 @@ EmitChildEvent(childrenInteractive.eventEmitter, "".concat(childrenInteractive.eventNamePrefix, "down"), childrenInteractive.targetSizers, pointer.worldX, pointer.worldY, pointer, event); }; - var GetValue$1R = Phaser.Utils.Objects.GetValue; + var GetValue$1P = Phaser.Utils.Objects.GetValue; var UpChild = function UpChild(config) { - var upConfig = GetValue$1R(config, 'up', undefined); + var upConfig = GetValue$1P(config, 'up', undefined); if (upConfig === false) { return; } else if (upConfig === true) { @@ -33183,9 +33183,9 @@ EmitChildEvent(childrenInteractive.eventEmitter, "".concat(childrenInteractive.eventNamePrefix, "up"), childrenInteractive.targetSizers, pointer.worldX, pointer.worldY, pointer, event); }; - var GetValue$1Q = Phaser.Utils.Objects.GetValue; + var GetValue$1O = Phaser.Utils.Objects.GetValue; var OverChild = function OverChild(config) { - var overConfig = GetValue$1Q(config, 'over', undefined); + var overConfig = GetValue$1O(config, 'over', undefined); if (overConfig === false) { return; } else if (overConfig === true) { @@ -33212,9 +33212,9 @@ EmitChildEvent(childrenInteractive.eventEmitter, "".concat(childrenInteractive.eventNamePrefix, "out"), childrenInteractive.targetSizers, child, undefined, pointer, event); }; - var GetValue$1P = Phaser.Utils.Objects.GetValue; + var GetValue$1N = Phaser.Utils.Objects.GetValue; var ClickChild = function ClickChild(config) { - var clickConfig = GetValue$1P(config, 'click', undefined); + var clickConfig = GetValue$1N(config, 'click', undefined); if (clickConfig === false) { return; } else if (clickConfig === true) { @@ -33233,7 +33233,7 @@ }, this); }; - var GetValue$1O = Phaser.Utils.Objects.GetValue; + var GetValue$1M = Phaser.Utils.Objects.GetValue; var OnePointerTracer = /*#__PURE__*/function (_TickTask) { _inherits(OnePointerTracer, _TickTask); var _super = _createSuper(OnePointerTracer); @@ -33247,7 +33247,7 @@ _this = _super.call(this, scene, config); _this.gameObject = gameObject; if (gameObject) { - gameObject.setInteractive(GetValue$1O(config, "inputConfig", undefined)); + gameObject.setInteractive(GetValue$1M(config, "inputConfig", undefined)); } _this._enable = undefined; _this.resetFromJSON(config); @@ -33257,10 +33257,10 @@ _createClass(OnePointerTracer, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.setEnable(GetValue$1O(o, 'enable', true)); + this.setEnable(GetValue$1M(o, 'enable', true)); this.setDetectBounds(); if (this.gameObject === undefined) { - this.setDetectBounds(GetValue$1O(o, 'bounds', undefined)); + this.setDetectBounds(GetValue$1M(o, 'bounds', undefined)); } else { this.setDetectBounds(); } @@ -33485,7 +33485,7 @@ var TOUCH1$2 = 1; var IDLE$5 = 'IDLE'; - var GetValue$1N = Phaser.Utils.Objects.GetValue; + var GetValue$1L = Phaser.Utils.Objects.GetValue; var DistanceBetween$4 = Phaser.Math.Distance.Between; var Tap = /*#__PURE__*/function (_OnePointerTracer) { _inherits(Tap, _OnePointerTracer); @@ -33541,16 +33541,16 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Tap.prototype), "resetFromJSON", this).call(this, o); - this.setHoldTime(GetValue$1N(o, 'time', 250)); // min-hold-time of Press is 251 - this.setTapInterval(GetValue$1N(o, 'tapInterval', 200)); - this.setDragThreshold(GetValue$1N(o, 'threshold', 9)); - this.setTapOffset(GetValue$1N(o, 'tapOffset', 10)); - var taps = GetValue$1N(o, 'taps', undefined); + this.setHoldTime(GetValue$1L(o, 'time', 250)); // min-hold-time of Press is 251 + this.setTapInterval(GetValue$1L(o, 'tapInterval', 200)); + this.setDragThreshold(GetValue$1L(o, 'threshold', 9)); + this.setTapOffset(GetValue$1L(o, 'tapOffset', 10)); + var taps = GetValue$1L(o, 'taps', undefined); if (taps !== undefined) { this.setTaps(taps); } else { - this.setMaxTaps(GetValue$1N(o, 'maxTaps', undefined)); - this.setMinTaps(GetValue$1N(o, 'minTaps', undefined)); + this.setMaxTaps(GetValue$1L(o, 'maxTaps', undefined)); + this.setMinTaps(GetValue$1L(o, 'minTaps', undefined)); } return this; } @@ -33692,7 +33692,7 @@ var BEGIN$3 = 'BEGIN'; var RECOGNIZED$3 = 'RECOGNIZED'; - var GetValue$1M = Phaser.Utils.Objects.GetValue; + var GetValue$1K = Phaser.Utils.Objects.GetValue; var Press = /*#__PURE__*/function (_OnePointerTracer) { _inherits(Press, _OnePointerTracer); var _super = _createSuper(Press); @@ -33747,8 +33747,8 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Press.prototype), "resetFromJSON", this).call(this, o); - this.setDragThreshold(GetValue$1M(o, 'threshold', 9)); - this.setHoldTime(GetValue$1M(o, 'time', 251)); + this.setDragThreshold(GetValue$1K(o, 'threshold', 9)); + this.setHoldTime(GetValue$1K(o, 'time', 251)); return this; } }, { @@ -33925,7 +33925,7 @@ }; var globOut$1 = {}; - var GetValue$1L = Phaser.Utils.Objects.GetValue; + var GetValue$1J = Phaser.Utils.Objects.GetValue; var RadToDeg$3 = Phaser.Math.RadToDeg; var Swipe = /*#__PURE__*/function (_OnePointerTracer) { _inherits(Swipe, _OnePointerTracer); @@ -33982,9 +33982,9 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Swipe.prototype), "resetFromJSON", this).call(this, o); - this.setDragThreshold(GetValue$1L(o, 'threshold', 10)); - this.setVelocityThreshold(GetValue$1L(o, 'velocityThreshold', 1000)); - this.setDirectionMode(GetValue$1L(o, 'dir', '8dir')); + this.setDragThreshold(GetValue$1J(o, 'threshold', 10)); + this.setVelocityThreshold(GetValue$1J(o, 'velocityThreshold', 1000)); + this.setDirectionMode(GetValue$1J(o, 'dir', '8dir')); return this; } }, { @@ -34091,7 +34091,7 @@ var BEGIN$1 = 'BEGIN'; var RECOGNIZED$1 = 'RECOGNIZED'; - var GetValue$1K = Phaser.Utils.Objects.GetValue; + var GetValue$1I = Phaser.Utils.Objects.GetValue; var SpliceOne$1 = Phaser.Utils.Array.SpliceOne; var DistanceBetween$2 = Phaser.Math.Distance.Between; var AngleBetween = Phaser.Math.Angle.Between; @@ -34104,7 +34104,7 @@ } this.scene = scene; // Event emitter - this.setEventEmitter(GetValue$1K(config, 'eventEmitter', undefined)); + this.setEventEmitter(GetValue$1I(config, 'eventEmitter', undefined)); this._enable = undefined; this.pointers = []; this.movedState = {}; @@ -34114,8 +34114,8 @@ _createClass(TwoPointersTracer, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.setEnable(GetValue$1K(o, "enable", true)); - this.bounds = GetValue$1K(o, 'bounds', undefined); + this.setEnable(GetValue$1I(o, "enable", true)); + this.bounds = GetValue$1I(o, 'bounds', undefined); this.tracerState = TOUCH0$1; this.pointers.length = 0; Clear(this.movedState); @@ -34477,7 +34477,7 @@ return this; }; - var GetValue$1J = Phaser.Utils.Objects.GetValue; + var GetValue$1H = Phaser.Utils.Objects.GetValue; var WrapDegrees = Phaser.Math.Angle.WrapDegrees; // Wrap degrees: -180 to 180 var ShortestBetween = Phaser.Math.Angle.ShortestBetween; var RadToDeg$2 = Phaser.Math.RadToDeg; @@ -34520,7 +34520,7 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Rotate.prototype), "resetFromJSON", this).call(this, o); - this.setDragThreshold(GetValue$1J(o, 'threshold', 0)); + this.setDragThreshold(GetValue$1H(o, 'threshold', 0)); return this; } }, { @@ -34584,9 +34584,9 @@ var BEGIN = 'BEGIN'; var RECOGNIZED = 'RECOGNIZED'; - var GetValue$1I = Phaser.Utils.Objects.GetValue; + var GetValue$1G = Phaser.Utils.Objects.GetValue; var TapChild = function TapChild(config) { - var tapConfig = GetValue$1I(config, 'tap', undefined); + var tapConfig = GetValue$1G(config, 'tap', undefined); if (tapConfig === false) { return; } else if (tapConfig === true) { @@ -34599,9 +34599,9 @@ }, this); }; - var GetValue$1H = Phaser.Utils.Objects.GetValue; + var GetValue$1F = Phaser.Utils.Objects.GetValue; var PressChild = function PressChild(config) { - var pressConfig = GetValue$1H(config, 'press', undefined); + var pressConfig = GetValue$1F(config, 'press', undefined); if (pressConfig === false) { return; } else if (pressConfig === true) { @@ -34616,9 +34616,9 @@ }, this); }; - var GetValue$1G = Phaser.Utils.Objects.GetValue; + var GetValue$1E = Phaser.Utils.Objects.GetValue; var SwipeChild = function SwipeChild(config) { - var swipeConfig = GetValue$1G(config, 'swipe', undefined); + var swipeConfig = GetValue$1E(config, 'swipe', undefined); if (swipeConfig === false) { return; } else if (swipeConfig === true) { @@ -34638,16 +34638,16 @@ }, this); }; - var GetValue$1F = Phaser.Utils.Objects.GetValue; + var GetValue$1D = Phaser.Utils.Objects.GetValue; var SetChildrenInteractive = function SetChildrenInteractive(gameObject, config) { gameObject.setInteractive(); - if (GetValue$1F(config, 'dropZone', false)) { + if (GetValue$1D(config, 'dropZone', false)) { gameObject.input.dropZone = true; } gameObject._childrenInteractive = { - targetSizers: GetValue$1F(config, 'targets', [gameObject]), - eventEmitter: GetValue$1F(config, 'eventEmitter', gameObject), - eventNamePrefix: GetValue$1F(config, 'inputEventPrefix', 'child.') + targetSizers: GetValue$1D(config, 'targets', [gameObject]), + eventEmitter: GetValue$1D(config, 'eventEmitter', gameObject), + eventNamePrefix: GetValue$1D(config, 'inputEventPrefix', 'child.') }; DownChild.call(gameObject, config); UpChild.call(gameObject, config); @@ -34711,7 +34711,7 @@ }; Object.assign(methods$n, PaddingMethods, AddChildMethods$8, RemoveChildMethods$7, GetParentSizerMethods, ScaleMethods, FadeMethods, EaseMoveMethods, ShakeMethods, EaseDataMethods, ClickMethods, ClickOutsideMethods, TouchingMethods, HideMethods, ModalMethods$1, GetShownChildrenMethods); - var GetValue$1E = Phaser.Utils.Objects.GetValue; + var GetValue$1C = Phaser.Utils.Objects.GetValue; var Base = /*#__PURE__*/function (_Container) { _inherits(Base, _Container); var _super = _createSuper(Base); @@ -34721,7 +34721,7 @@ _this = _super.call(this, scene, x, y, 1, 1); _this.isRexSizer = true; _this.setMinSize(minWidth, minHeight); - _this.setName(GetValue$1E(config, 'name', '')); + _this.setName(GetValue$1C(config, 'name', '')); _this.rexSizer = {}; _this.space = {}; _this.backgroundChildren = undefined; @@ -34729,18 +34729,18 @@ _this.childrenMap = {}; _this.layoutedChildren = undefined; _this.enableLayoutWarn(); - var anchorConfig = GetValue$1E(config, 'anchor', undefined); + var anchorConfig = GetValue$1C(config, 'anchor', undefined); if (anchorConfig) { _this.setAnchor(anchorConfig); } - _this.setInnerPadding(GetValue$1E(config, 'space', 0)); - var draggable = GetValue$1E(config, 'draggable', false); + _this.setInnerPadding(GetValue$1C(config, 'space', 0)); + var draggable = GetValue$1C(config, 'draggable', false); if (draggable) { _this.setDraggable(draggable); } - _this.setSizerEventsEnable(GetValue$1E(config, 'sizerEvents', false)); + _this.setSizerEventsEnable(GetValue$1C(config, 'sizerEvents', false)); _this.setDirty(true); - if (GetValue$1E(config, 'enableLayer', false)) { + if (GetValue$1C(config, 'enableLayer', false)) { _this.enableLayer(); } return _this; @@ -35105,23 +35105,23 @@ }; var IsPlainObject$r = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1D = Phaser.Utils.Objects.GetValue; + var GetValue$1B = Phaser.Utils.Objects.GetValue; var ALIGN_CENTER$3 = Phaser.Display.Align.CENTER; var UUID$1 = Phaser.Utils.String.UUID; var Add$7 = function Add(gameObject, childKey, align, padding, expand, minWidth, minHeight, offsetX, offsetY) { AddChild$1.call(this, gameObject); if (IsPlainObject$r(childKey)) { var config = childKey; - childKey = GetValue$1D(config, 'key', undefined); - align = GetValue$1D(config, 'align', ALIGN_CENTER$3); - offsetX = GetValue$1D(config, 'offsetX', 0); - offsetY = GetValue$1D(config, 'offsetY', 0); - padding = GetValue$1D(config, 'padding', 0); - expand = GetValue$1D(config, 'expand', true); + childKey = GetValue$1B(config, 'key', undefined); + align = GetValue$1B(config, 'align', ALIGN_CENTER$3); + offsetX = GetValue$1B(config, 'offsetX', 0); + offsetY = GetValue$1B(config, 'offsetY', 0); + padding = GetValue$1B(config, 'padding', 0); + expand = GetValue$1B(config, 'expand', true); if (!gameObject.isRexSizer) { // Get minWidth,minHeight from config - minWidth = GetValue$1D(config, 'minWidth', gameObject._minWidth); - minHeight = GetValue$1D(config, 'minHeight', gameObject._minHeighted); + minWidth = GetValue$1B(config, 'minWidth', gameObject._minWidth); + minHeight = GetValue$1B(config, 'minHeight', gameObject._minHeighted); } } var hasValidKey = childKey !== undefined; @@ -35161,8 +35161,8 @@ config.alignOffsetY = offsetY; config.padding = GetBoundsConfig(padding); if (IsPlainObject$r(expand)) { - config.expandWidth = GetValue$1D(expand, 'width', false); - config.expandHeight = GetValue$1D(expand, 'height', false); + config.expandWidth = GetValue$1B(expand, 'width', false); + config.expandHeight = GetValue$1B(expand, 'height', false); } else { config.expandWidth = expand; config.expandHeight = expand; @@ -35278,7 +35278,7 @@ }; var IsPlainObject$q = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1C = Phaser.Utils.Objects.GetValue; + var GetValue$1A = Phaser.Utils.Objects.GetValue; var OverlapSizer = /*#__PURE__*/function (_BaseSizer) { _inherits(OverlapSizer, _BaseSizer); var _super = _createSuper(OverlapSizer); @@ -35287,14 +35287,14 @@ _classCallCheck(this, OverlapSizer); if (IsPlainObject$q(x)) { config = x; - x = GetValue$1C(config, 'x', 0); - y = GetValue$1C(config, 'y', 0); - minWidth = GetValue$1C(config, 'width', undefined); - minHeight = GetValue$1C(config, 'height', undefined); + x = GetValue$1A(config, 'x', 0); + y = GetValue$1A(config, 'y', 0); + minWidth = GetValue$1A(config, 'width', undefined); + minHeight = GetValue$1A(config, 'height', undefined); } else if (IsPlainObject$q(minWidth)) { config = minWidth; - minWidth = GetValue$1C(config, 'width', undefined); - minHeight = GetValue$1C(config, 'height', undefined); + minWidth = GetValue$1A(config, 'width', undefined); + minHeight = GetValue$1A(config, 'height', undefined); } _this = _super.call(this, scene, x, y, minWidth, minHeight, config); _this.type = 'rexOverlapSizer'; @@ -35458,7 +35458,7 @@ updateText: UpdateText }; - var GetValue$1B = Phaser.Utils.Objects.GetValue; + var GetValue$1z = Phaser.Utils.Objects.GetValue; var SnapTo$1 = Phaser.Math.Snap.To; var Knob = /*#__PURE__*/function (_ProgressBase) { _inherits(Knob, _ProgressBase); @@ -35476,8 +35476,8 @@ _this.bootProgressBase(config); // Add elements - var background = GetValue$1B(config, 'background', undefined); - var textObject = GetValue$1B(config, 'text', undefined); + var background = GetValue$1z(config, 'background', undefined); + var textObject = GetValue$1z(config, 'text', undefined); if (background) { _this.addBackground(background); } @@ -35486,11 +35486,11 @@ // Don't draw text on knob directly config.textColor = undefined; config.textStrokeColor = undefined; - _this.setTextFormatCallback(GetValue$1B(config, 'textFormatCallback', undefined), GetValue$1B(config, 'textFormatCallbackScope', undefined)); + _this.setTextFormatCallback(GetValue$1z(config, 'textFormatCallback', undefined), GetValue$1z(config, 'textFormatCallbackScope', undefined)); } // Create circular progress object var knob = new CircularProgress(scene, config); - knob.setDepth(GetValue$1B(config, 'knobDepth', 0)); + knob.setDepth(GetValue$1z(config, 'knobDepth', 0)); knob._value = -1; // To trigger text updating scene.add.existing(knob); _this.add(knob, 'knob'); @@ -35502,12 +35502,12 @@ _this.addChildrenMap('background', background); _this.addChildrenMap('knob', knob); _this.addChildrenMap('text', textObject); - _this.setEnable(GetValue$1B(config, 'enable', undefined)); - _this.setGap(GetValue$1B(config, 'gap', undefined)); - _this.setValue(GetValue$1B(config, 'value', 0), GetValue$1B(config, 'min', undefined), GetValue$1B(config, 'max', undefined)); + _this.setEnable(GetValue$1z(config, 'enable', undefined)); + _this.setGap(GetValue$1z(config, 'gap', undefined)); + _this.setValue(GetValue$1z(config, 'value', 0), GetValue$1z(config, 'min', undefined), GetValue$1z(config, 'max', undefined)); // Input - var inputMode = GetValue$1B(config, 'input', 0); + var inputMode = GetValue$1z(config, 'input', 0); if (typeof inputMode === 'string') { inputMode = INPUTMODE$1[inputMode]; } @@ -35582,7 +35582,7 @@ roundRectangle: RoundRectangle, triangle: Triangle$1 }; - var GetValue$1A = Phaser.Utils.Objects.GetValue; + var GetValue$1y = Phaser.Utils.Objects.GetValue; var IsPlainObject$p = Phaser.Utils.Objects.IsPlainObject; var ClearAll = function ClearAll() { var shapes = this.getShapes(); @@ -35600,7 +35600,7 @@ return shape; }, buildShapes: function buildShapes(config) { - var createCallback = GetValue$1A(config, 'create', undefined); + var createCallback = GetValue$1y(config, 'create', undefined); if (IsPlainObject$p(createCallback)) { var shapes = createCallback; for (var shapeType in shapes) { @@ -35632,7 +35632,7 @@ } else if (typeof createCallback === 'function') { createCallback.call(this); } - this.setUpdateShapesCallback(GetValue$1A(config, 'update')); + this.setUpdateShapesCallback(GetValue$1y(config, 'update')); }, setUpdateShapesCallback: function setUpdateShapesCallback(callback) { if (callback === undefined) { @@ -35679,7 +35679,7 @@ var tempMatrix$1, parentMatrix; var globOut = {}; - var GetValue$1z = Phaser.Utils.Objects.GetValue; + var GetValue$1x = Phaser.Utils.Objects.GetValue; var IsPlainObject$o = Phaser.Utils.Objects.IsPlainObject; var CustomShapes = /*#__PURE__*/function (_BaseShapes) { _inherits(CustomShapes, _BaseShapes); @@ -35689,13 +35689,13 @@ _classCallCheck(this, CustomShapes); if (IsPlainObject$o(x)) { config = x; - x = GetValue$1z(config, 'x', 0); - y = GetValue$1z(config, 'y', 0); - width = GetValue$1z(config, 'width', 2); - height = GetValue$1z(config, 'height', 2); + x = GetValue$1x(config, 'x', 0); + y = GetValue$1x(config, 'y', 0); + width = GetValue$1x(config, 'width', 2); + height = GetValue$1x(config, 'height', 2); } _this = _super.call(this, scene, x, y, width, height); - _this.type = GetValue$1z(config, 'type', 'rexCustomShapes'); + _this.type = GetValue$1x(config, 'type', 'rexCustomShapes'); _this.buildShapes(config); return _this; } @@ -35723,7 +35723,7 @@ }(BaseShapes); Object.assign(CustomShapes.prototype, ShapesUpdateMethods); - var GetValue$1y = Phaser.Utils.Objects.GetValue; + var GetValue$1w = Phaser.Utils.Objects.GetValue; var IsPlainObject$n = Phaser.Utils.Objects.IsPlainObject; /*#__PURE__*/(function (_ProgressBase) { _inherits(CustomProgress, _ProgressBase); @@ -35733,10 +35733,10 @@ _classCallCheck(this, CustomProgress); if (IsPlainObject$n(x)) { config = x; - x = GetValue$1y(config, 'x', 0); - y = GetValue$1y(config, 'y', 0); - width = GetValue$1y(config, 'width', 2); - height = GetValue$1y(config, 'height', 2); + x = GetValue$1w(config, 'x', 0); + y = GetValue$1w(config, 'y', 0); + width = GetValue$1w(config, 'width', 2); + height = GetValue$1w(config, 'height', 2); } if (config === undefined) { config = {}; @@ -35746,7 +35746,7 @@ } _this = _super.call(this, scene, x, y, width, height, config); _this.bootProgressBase(config); - _this.setValue(GetValue$1y(config, 'value', 0)); + _this.setValue(GetValue$1w(config, 'value', 0)); return _this; } _createClass(CustomProgress, [{ @@ -35787,7 +35787,7 @@ }; var IsPlainObject$m = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1x = Phaser.Utils.Objects.GetValue; + var GetValue$1v = Phaser.Utils.Objects.GetValue; var GetRandomItem = Phaser.Utils.Array.GetRandom; var DirMode = { out: 0, @@ -35838,9 +35838,9 @@ this.currentTransitionMode = undefined; if (IsPlainObject$m(texture)) { var config = texture; - texture = GetValue$1x(config, 'key', undefined); - frame = GetValue$1x(config, 'frame', undefined); - mode = GetValue$1x(config, 'mode'); + texture = GetValue$1v(config, 'key', undefined); + frame = GetValue$1v(config, 'frame', undefined); + mode = GetValue$1v(config, 'mode'); if (Array.isArray(mode)) { mode = GetRandomItem(mode); } @@ -36193,28 +36193,28 @@ }; }; - var GetValue$1w = Phaser.Utils.Objects.GetValue; + var GetValue$1u = Phaser.Utils.Objects.GetValue; var DefaultImageClass = Phaser.GameObjects.Image; var IsPlainObject$l = Phaser.Utils.Objects.IsPlainObject; var RotateAround$1 = Phaser.Math.RotateAround; var GridCutImage = function GridCutImage(gameObject, columns, rows, config) { if (IsPlainObject$l(columns)) { config = columns; - columns = GetValue$1w(config, 'columns', 1); - rows = GetValue$1w(config, 'rows', 1); + columns = GetValue$1u(config, 'columns', 1); + rows = GetValue$1u(config, 'rows', 1); } - var createImageCallback = GetValue$1w(config, 'createImageCallback'); + var createImageCallback = GetValue$1u(config, 'createImageCallback'); if (!createImageCallback) { - var ImageClass = GetValue$1w(config, 'ImageClass', DefaultImageClass); + var ImageClass = GetValue$1u(config, 'ImageClass', DefaultImageClass); createImageCallback = function createImageCallback(scene, key, frame) { return new ImageClass(scene, 0, 0, key, frame); }; } - var originX = GetValue$1w(config, 'originX', 0.5); - var originY = GetValue$1w(config, 'originY', 0.5); - var addToScene = GetValue$1w(config, 'add', true); - var align = GetValue$1w(config, 'align', addToScene); - var imageObjectPool = GetValue$1w(config, 'objectPool', undefined); + var originX = GetValue$1u(config, 'originX', 0.5); + var originY = GetValue$1u(config, 'originY', 0.5); + var addToScene = GetValue$1u(config, 'add', true); + var align = GetValue$1u(config, 'align', addToScene); + var imageObjectPool = GetValue$1u(config, 'objectPool', undefined); var scene = gameObject.scene; var texture = gameObject.texture; var frame = gameObject.frame; @@ -36349,7 +36349,7 @@ }; var IsPlainObject$k = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1v = Phaser.Utils.Objects.GetValue; + var GetValue$1t = Phaser.Utils.Objects.GetValue; var Clamp$9 = Phaser.Math.Clamp; var TransitionImage = /*#__PURE__*/function (_Container) { _inherits(TransitionImage, _Container); @@ -36359,24 +36359,24 @@ _classCallCheck(this, TransitionImage); if (IsPlainObject$k(x)) { config = x; - x = GetValue$1v(config, 'x', 0); - y = GetValue$1v(config, 'y', 0); - texture = GetValue$1v(config, 'key', undefined); - frame = GetValue$1v(config, 'frame', undefined); + x = GetValue$1t(config, 'x', 0); + y = GetValue$1t(config, 'y', 0); + texture = GetValue$1t(config, 'key', undefined); + frame = GetValue$1t(config, 'frame', undefined); } else if (IsPlainObject$k(frame)) { config = frame; frame = undefined; } - var backImage = GetValue$1v(config, 'back', undefined); - var frontImage = GetValue$1v(config, 'front', undefined); + var backImage = GetValue$1t(config, 'back', undefined); + var frontImage = GetValue$1t(config, 'front', undefined); if (!backImage) { backImage = scene.add.image(x, y, texture, frame); } if (!frontImage) { frontImage = scene.add.image(x, y, texture, frame); } - var width = GetValue$1v(config, 'width', frontImage.width); - var height = GetValue$1v(config, 'height', frontImage.height); + var width = GetValue$1t(config, 'width', frontImage.width); + var height = GetValue$1t(config, 'height', frontImage.height); _this = _super.call(this, scene, x, y, width, height); _this.type = 'rexTransitionImage'; backImage.setVisible(false); @@ -36390,18 +36390,18 @@ _this.currentTransitionMode = undefined; // Transition parameters - var onStart = GetValue$1v(config, 'onStart', undefined); - var onProgress = GetValue$1v(config, 'onProgress', undefined); - var onComplete = GetValue$1v(config, 'onComplete', undefined); - var dir = GetValue$1v(config, 'dir', 0); + var onStart = GetValue$1t(config, 'onStart', undefined); + var onProgress = GetValue$1t(config, 'onProgress', undefined); + var onComplete = GetValue$1t(config, 'onComplete', undefined); + var dir = GetValue$1t(config, 'dir', 0); if (onStart === undefined && onProgress === undefined && onComplete === undefined) { onStart = OnStart; onProgress = OnProgress; onComplete = OnComplete; dir = 0; } - _this.setTransitionStartCallback(onStart, GetValue$1v(config, 'onStartScope', undefined)).setTransitionProgressCallback(onProgress, GetValue$1v(config, 'onProgressScope', undefined)).setTransitionCompleteCallback(onComplete, GetValue$1v(config, 'onCompleteScope', undefined)).setTransitionDirection(dir).setDuration(GetValue$1v(config, 'duration', 1000)).setEaseFunction(GetValue$1v(config, 'ease', 'Linear')); - var maskGameObject = GetValue$1v(config, 'mask', undefined); + _this.setTransitionStartCallback(onStart, GetValue$1t(config, 'onStartScope', undefined)).setTransitionProgressCallback(onProgress, GetValue$1t(config, 'onProgressScope', undefined)).setTransitionCompleteCallback(onComplete, GetValue$1t(config, 'onCompleteScope', undefined)).setTransitionDirection(dir).setDuration(GetValue$1t(config, 'duration', 1000)).setEaseFunction(GetValue$1t(config, 'ease', 'Linear')); + var maskGameObject = GetValue$1t(config, 'mask', undefined); if (maskGameObject) { _this.setMaskGameObject(maskGameObject); } @@ -36595,7 +36595,7 @@ var globalSize = {}; var IsPlainObject$j = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1u = Phaser.Utils.Objects.GetValue; + var GetValue$1s = Phaser.Utils.Objects.GetValue; var ImageBox = /*#__PURE__*/function (_Container) { _inherits(ImageBox, _Container); var _super = _createSuper(ImageBox); @@ -36604,15 +36604,15 @@ _classCallCheck(this, ImageBox); if (IsPlainObject$j(x)) { config = x; - x = GetValue$1u(config, 'x', 0); - y = GetValue$1u(config, 'y', 0); - texture = GetValue$1u(config, 'key', undefined); - frame = GetValue$1u(config, 'frame', undefined); + x = GetValue$1s(config, 'x', 0); + y = GetValue$1s(config, 'y', 0); + texture = GetValue$1s(config, 'key', undefined); + frame = GetValue$1s(config, 'frame', undefined); } else if (IsPlainObject$j(frame)) { config = frame; frame = undefined; } - var image = GetValue$1u(config, 'image'); + var image = GetValue$1s(config, 'image'); if (!image) { image = scene.add.image(x, y, texture, frame); if (texture === undefined) { @@ -36625,8 +36625,8 @@ _this.type = 'rexImageBox'; _this.add(image); _this.image = image; - var width = GetValue$1u(config, 'width', image.width); - var height = GetValue$1u(config, 'height', image.height); + var width = GetValue$1s(config, 'width', image.width); + var height = GetValue$1s(config, 'height', image.height); _this.resize(width, height); return _this; } @@ -36763,10 +36763,10 @@ select: 'select' }; - var GetValue$1t = Phaser.Utils.Objects.GetValue; + var GetValue$1r = Phaser.Utils.Objects.GetValue; var RouteEvents = function RouteEvents(gameObject, element, elementEvents, config) { - var preventDefault = GetValue$1t(config, 'preventDefault', false); - var preTest = GetValue$1t(config, 'preTest'); + var preventDefault = GetValue$1r(config, 'preventDefault', false); + var preTest = GetValue$1r(config, 'preTest'); var _loop = function _loop(elementEventName) { // Note: Don't use `var` here element.addEventListener(elementEventName, function (e) { @@ -36785,7 +36785,7 @@ var DOMElement$2 = Phaser.GameObjects.DOMElement; var IsPlainObject$i = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1s = Phaser.Utils.Objects.GetValue; + var GetValue$1q = Phaser.Utils.Objects.GetValue; var InputText = /*#__PURE__*/function (_DOMElement) { _inherits(InputText, _DOMElement); var _super = _createSuper(InputText); @@ -36794,22 +36794,22 @@ _classCallCheck(this, InputText); if (IsPlainObject$i(x)) { config = x; - x = GetValue$1s(config, 'x', 0); - y = GetValue$1s(config, 'y', 0); - width = GetValue$1s(config, 'width', 0); - height = GetValue$1s(config, 'height', 0); + x = GetValue$1q(config, 'x', 0); + y = GetValue$1q(config, 'y', 0); + width = GetValue$1q(config, 'width', 0); + height = GetValue$1q(config, 'height', 0); } else if (IsPlainObject$i(width)) { config = width; - width = GetValue$1s(config, 'width', 0); - height = GetValue$1s(config, 'height', 0); + width = GetValue$1q(config, 'width', 0); + height = GetValue$1q(config, 'height', 0); } if (config === undefined) { config = {}; } var element; - var textType = GetValue$1s(config, 'inputType', undefined); + var textType = GetValue$1q(config, 'inputType', undefined); if (textType === undefined) { - textType = GetValue$1s(config, 'type', 'text'); + textType = GetValue$1q(config, 'type', 'text'); } if (textType === 'textarea') { element = document.createElement('textarea'); @@ -36819,7 +36819,7 @@ element.type = textType; } SetProperties(ElementProperties, config, element); - var style = GetValue$1s(config, 'style', undefined); + var style = GetValue$1q(config, 'style', undefined); style = SetProperties(StyleProperties, config, style); // Apply other style properties var elementStyle = element.style; @@ -36840,7 +36840,7 @@ // Don't propagate touch/mouse events to parent(game canvas) StopPropagationTouchEvents(element); - if (GetValue$1s(config, 'selectAll', false)) { + if (GetValue$1q(config, 'selectAll', false)) { _this.selectAll(); } _this._isFocused = false; @@ -37204,7 +37204,7 @@ var DOMElement$1 = Phaser.GameObjects.DOMElement; var IsPlainObject$h = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1r = Phaser.Utils.Objects.GetValue; + var GetValue$1p = Phaser.Utils.Objects.GetValue; var FileChooser = /*#__PURE__*/function (_DOMElement) { _inherits(FileChooser, _DOMElement); var _super = _createSuper(FileChooser); @@ -37213,14 +37213,14 @@ _classCallCheck(this, FileChooser); if (IsPlainObject$h(x)) { config = x; - x = GetValue$1r(config, 'x', 0); - y = GetValue$1r(config, 'y', 0); - width = GetValue$1r(config, 'width', 0); - height = GetValue$1r(config, 'height', 0); + x = GetValue$1p(config, 'x', 0); + y = GetValue$1p(config, 'y', 0); + width = GetValue$1p(config, 'width', 0); + height = GetValue$1p(config, 'height', 0); } else if (IsPlainObject$h(width)) { config = width; - width = GetValue$1r(config, 'width', 0); - height = GetValue$1r(config, 'height', 0); + width = GetValue$1p(config, 'width', 0); + height = GetValue$1p(config, 'height', 0); } // Create a hidden file input @@ -37232,7 +37232,7 @@ // Create a label parent var labelElement = document.createElement('label'); labelElement.appendChild(inputElement); - var style = GetValue$1r(config, 'style', undefined); + var style = GetValue$1p(config, 'style', undefined); _this = _super.call(this, scene, x, y, labelElement, style); _this.type = 'rexFileChooser'; _this.resetFromJSON(config); @@ -37243,7 +37243,7 @@ inputElement.onchange = function () { self.emit('change', self); }; - _this.setCloseDelay(GetValue$1r(config, 'closeDelay', 200)); + _this.setCloseDelay(GetValue$1p(config, 'closeDelay', 200)); inputElement.onclick = function () { ClickPromise({ game: scene, @@ -37258,8 +37258,8 @@ _createClass(FileChooser, [{ key: "resetFromJSON", value: function resetFromJSON(config) { - this.setAccept(GetValue$1r(config, 'accept', '')); - this.setMultiple(GetValue$1r(config, 'multiple', false)); + this.setAccept(GetValue$1p(config, 'accept', '')); + this.setMultiple(GetValue$1p(config, 'multiple', false)); return this; } }, { @@ -37367,7 +37367,7 @@ var DOMElement = Phaser.GameObjects.DOMElement; var IsPlainObject$g = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1q = Phaser.Utils.Objects.GetValue; + var GetValue$1o = Phaser.Utils.Objects.GetValue; var FileDropZone = /*#__PURE__*/function (_DOMElement) { _inherits(FileDropZone, _DOMElement); var _super = _createSuper(FileDropZone); @@ -37376,26 +37376,26 @@ _classCallCheck(this, FileDropZone); if (IsPlainObject$g(x)) { config = x; - x = GetValue$1q(config, 'x', 0); - y = GetValue$1q(config, 'y', 0); - width = GetValue$1q(config, 'width', 0); - height = GetValue$1q(config, 'height', 0); + x = GetValue$1o(config, 'x', 0); + y = GetValue$1o(config, 'y', 0); + width = GetValue$1o(config, 'width', 0); + height = GetValue$1o(config, 'height', 0); } else if (IsPlainObject$g(width)) { config = width; - width = GetValue$1q(config, 'width', 0); - height = GetValue$1q(config, 'height', 0); + width = GetValue$1o(config, 'width', 0); + height = GetValue$1o(config, 'height', 0); } if (config === undefined) { config = {}; } var element = document.createElement('div'); - var style = GetValue$1q(config, 'style', undefined); + var style = GetValue$1o(config, 'style', undefined); _this = _super.call(this, scene, x, y, element, style); _this.type = 'rexFileDropZone'; _this.resize(width, height); _this._files = []; - _this.setDropEnable(GetValue$1q(config, 'dropEnable', true)); - var filters = GetValue$1q(config, 'filters'); + _this.setDropEnable(GetValue$1o(config, 'dropEnable', true)); + var filters = GetValue$1o(config, 'filters'); if (filters) { _this.addFilters(filters); } @@ -37498,7 +37498,7 @@ return Style; }(ComponentBase); - var GetValue$1p = Phaser.Utils.Objects.GetValue; + var GetValue$1n = Phaser.Utils.Objects.GetValue; var StyleManager = /*#__PURE__*/function (_ComponentBase) { _inherits(StyleManager, _ComponentBase); var _super = _createSuper(StyleManager); @@ -37508,12 +37508,12 @@ _this = _super.call(this, gameObject, config); // this.parent = gameObject; - _this.style = GetValue$1p(config, 'style', _assertThisInitialized(_this)); - var propertiesMap = GetValue$1p(config, 'propertiesMap'); + _this.style = GetValue$1n(config, 'style', _assertThisInitialized(_this)); + var propertiesMap = GetValue$1n(config, 'propertiesMap'); _this.activeStyle = ExtractStyle(config, 'active', propertiesMap); _this.hoverStyle = ExtractStyle(config, 'hover', propertiesMap); _this.disableStyle = ExtractStyle(config, 'disable', propertiesMap); - _this.onModifyStyle = GetValue$1p(config, 'onModifyStyle'); + _this.onModifyStyle = GetValue$1n(config, 'onModifyStyle'); return _this; } _createClass(StyleManager, [{ @@ -37618,7 +37618,7 @@ }; var PhaserImage = Phaser.GameObjects.Image; - var GetValue$1o = Phaser.Utils.Objects.GetValue; + var GetValue$1m = Phaser.Utils.Objects.GetValue; var StatesImage = /*#__PURE__*/function (_PhaserImage) { _inherits(StatesImage, _PhaserImage); var _super = _createSuper(StatesImage); @@ -37628,13 +37628,13 @@ if (config === undefined) { config = {}; } - var x = GetValue$1o(config, 'x', 0); - var y = GetValue$1o(config, 'y', 0); - var key = GetValue$1o(config, 'key', ''); - var frame = GetValue$1o(config, 'frame', undefined); + var x = GetValue$1m(config, 'x', 0); + var y = GetValue$1m(config, 'y', 0); + var key = GetValue$1m(config, 'key', ''); + var frame = GetValue$1m(config, 'frame', undefined); _this = _super.call(this, scene, x, y, key, frame); _this.type = 'rexStatesImage'; - var effectConfig = GetValue$1o(config, 'effects', true); + var effectConfig = GetValue$1m(config, 'effects', true); if (effectConfig) { AddEffectProperties(_assertThisInitialized(_this), effectConfig); } @@ -37737,7 +37737,7 @@ }(ComponentBase); var PhaserNineSlice = Phaser.GameObjects.NineSlice; - var GetValue$1n = Phaser.Utils.Objects.GetValue; + var GetValue$1l = Phaser.Utils.Objects.GetValue; var StatesNineSlice = /*#__PURE__*/function (_PhaserNineSlice) { _inherits(StatesNineSlice, _PhaserNineSlice); var _super = _createSuper(StatesNineSlice); @@ -37747,19 +37747,19 @@ if (config === undefined) { config = {}; } - var x = GetValue$1n(config, 'x', 0); - var y = GetValue$1n(config, 'y', 0); - var key = GetValue$1n(config, 'key', null); - var frame = GetValue$1n(config, 'frame', null); - var width = GetValue$1n(config, 'width', 0); - var height = GetValue$1n(config, 'height', 0); - var leftWidth = GetValue$1n(config, 'leftWidth', 0); - var rightWidth = GetValue$1n(config, 'rightWidth', 0); - var topHeight = GetValue$1n(config, 'topHeight', 0); - var bottomHeight = GetValue$1n(config, 'bottomHeight', 0); + var x = GetValue$1l(config, 'x', 0); + var y = GetValue$1l(config, 'y', 0); + var key = GetValue$1l(config, 'key', null); + var frame = GetValue$1l(config, 'frame', null); + var width = GetValue$1l(config, 'width', 0); + var height = GetValue$1l(config, 'height', 0); + var leftWidth = GetValue$1l(config, 'leftWidth', 0); + var rightWidth = GetValue$1l(config, 'rightWidth', 0); + var topHeight = GetValue$1l(config, 'topHeight', 0); + var bottomHeight = GetValue$1l(config, 'bottomHeight', 0); _this = _super.call(this, scene, x, y, key, frame, width, height, leftWidth, rightWidth, topHeight, bottomHeight); _this.type = 'rexStatesNineSlice'; - var effectConfig = GetValue$1n(config, 'effects', true); + var effectConfig = GetValue$1l(config, 'effects', true); if (effectConfig) { AddEffectProperties(_assertThisInitialized(_this), effectConfig); } @@ -37803,7 +37803,7 @@ Object.assign(StatesRoundRectangle.prototype, HelperMethods); var PhaserText = Phaser.GameObjects.Text; - var GetValue$1m = Phaser.Utils.Objects.GetValue; + var GetValue$1k = Phaser.Utils.Objects.GetValue; var StatesText = /*#__PURE__*/function (_PhaserText) { _inherits(StatesText, _PhaserText); var _super = _createSuper(StatesText); @@ -37813,9 +37813,9 @@ if (config === undefined) { config = {}; } - var x = GetValue$1m(config, 'x', 0); - var y = GetValue$1m(config, 'y', 0); - var text = GetValue$1m(config, 'text', ''); + var x = GetValue$1k(config, 'x', 0); + var y = GetValue$1k(config, 'y', 0); + var text = GetValue$1k(config, 'text', ''); _this = _super.call(this, scene, x, y, text, config); _this.type = 'rexStatesText'; config.style = _this.style; @@ -38401,7 +38401,7 @@ }; var IsPlainObject$f = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1l = Phaser.Utils.Objects.GetValue; + var GetValue$1j = Phaser.Utils.Objects.GetValue; var ALIGN_CENTER$2 = Phaser.Display.Align.CENTER; var PROPORTIONMODE = { min: 0, @@ -38417,17 +38417,17 @@ proportion = PROPORTIONMODE[proportion]; } else if (IsPlainObject$f(proportion)) { var config = proportion; - proportion = GetValue$1l(config, 'proportion', undefined); - align = GetValue$1l(config, 'align', ALIGN_CENTER$2); - paddingConfig = GetValue$1l(config, 'padding', 0); - expand = GetValue$1l(config, 'expand', false); - childKey = GetValue$1l(config, 'key', undefined); - index = GetValue$1l(config, 'index', undefined); + proportion = GetValue$1j(config, 'proportion', undefined); + align = GetValue$1j(config, 'align', ALIGN_CENTER$2); + paddingConfig = GetValue$1j(config, 'padding', 0); + expand = GetValue$1j(config, 'expand', false); + childKey = GetValue$1j(config, 'key', undefined); + index = GetValue$1j(config, 'index', undefined); if (!gameObject.isRexSizer) { - minWidth = GetValue$1l(config, 'minWidth', undefined); - minHeight = GetValue$1l(config, 'minHeight', undefined); + minWidth = GetValue$1j(config, 'minWidth', undefined); + minHeight = GetValue$1j(config, 'minHeight', undefined); } - fitRatio = GetValue$1l(config, 'fitRatio', 0); // width/height + fitRatio = GetValue$1j(config, 'fitRatio', 0); // width/height } if (typeof align === 'string') { @@ -38644,7 +38644,7 @@ }; var IsPlainObject$e = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1k = Phaser.Utils.Objects.GetValue; + var GetValue$1i = Phaser.Utils.Objects.GetValue; var Sizer = /*#__PURE__*/function (_BaseSizer) { _inherits(Sizer, _BaseSizer); var _super = _createSuper(Sizer); @@ -38653,19 +38653,19 @@ _classCallCheck(this, Sizer); if (IsPlainObject$e(x)) { config = x; - x = GetValue$1k(config, 'x', 0); - y = GetValue$1k(config, 'y', 0); - minWidth = GetValue$1k(config, 'width', undefined); - minHeight = GetValue$1k(config, 'height', undefined); - orientation = GetValue$1k(config, 'orientation', 0); + x = GetValue$1i(config, 'x', 0); + y = GetValue$1i(config, 'y', 0); + minWidth = GetValue$1i(config, 'width', undefined); + minHeight = GetValue$1i(config, 'height', undefined); + orientation = GetValue$1i(config, 'orientation', 0); } else if (IsPlainObject$e(minWidth)) { config = minWidth; - minWidth = GetValue$1k(config, 'width', undefined); - minHeight = GetValue$1k(config, 'height', undefined); - orientation = GetValue$1k(config, 'orientation', 0); + minWidth = GetValue$1i(config, 'width', undefined); + minHeight = GetValue$1i(config, 'height', undefined); + orientation = GetValue$1i(config, 'orientation', 0); } else if (IsPlainObject$e(orientation)) { config = orientation; - orientation = GetValue$1k(config, 'orientation', 0); + orientation = GetValue$1i(config, 'orientation', 0); } if (orientation === undefined) { orientation = 0; @@ -38674,9 +38674,9 @@ _this.type = 'rexSizer'; _this.sizerChildren = []; _this.setOrientation(orientation); - _this.setItemSpacing(GetValue$1k(config, 'space.item', 0)); - _this.setStartChildIndex(GetValue$1k(config, 'startChildIndex', 0)); - _this.setRTL(GetValue$1k(config, 'rtl', false)); + _this.setItemSpacing(GetValue$1i(config, 'space.item', 0)); + _this.setStartChildIndex(GetValue$1i(config, 'startChildIndex', 0)); + _this.setRTL(GetValue$1i(config, 'rtl', false)); _this.addChildrenMap('items', _this.sizerChildren); return _this; } @@ -38968,7 +38968,7 @@ }; var IsPlainObject$d = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1j = Phaser.Utils.Objects.GetValue; + var GetValue$1h = Phaser.Utils.Objects.GetValue; var ALIGN_CENTER$1 = Phaser.Display.Align.CENTER; var GetEmptyCellIndex = function GetEmptyCellIndex(columnIndex, rowIndex, cells, columnCount, rowCount) { if (typeof columnIndex === 'number' || typeof rowIndex === 'number') { @@ -39017,12 +39017,12 @@ AddChild$1.call(this, gameObject); if (IsPlainObject$d(columnIndex)) { var config = columnIndex; - columnIndex = GetValue$1j(config, 'column', undefined); - rowIndex = GetValue$1j(config, 'row', undefined); - align = GetValue$1j(config, 'align', ALIGN_CENTER$1); - paddingConfig = GetValue$1j(config, 'padding', 0); - expand = GetValue$1j(config, 'expand', false); - childKey = GetValue$1j(config, 'key', undefined); + columnIndex = GetValue$1h(config, 'column', undefined); + rowIndex = GetValue$1h(config, 'row', undefined); + align = GetValue$1h(config, 'align', ALIGN_CENTER$1); + paddingConfig = GetValue$1h(config, 'padding', 0); + expand = GetValue$1h(config, 'expand', false); + childKey = GetValue$1h(config, 'key', undefined); } // Get insert index @@ -39057,8 +39057,8 @@ config.align = align; config.padding = GetBoundsConfig(paddingConfig); if (IsPlainObject$d(expand)) { - config.expandWidth = GetValue$1j(expand, 'width', false); - config.expandHeight = GetValue$1j(expand, 'height', false); + config.expandWidth = GetValue$1h(expand, 'width', false); + config.expandHeight = GetValue$1h(expand, 'height', false); } else { config.expandWidth = expand; config.expandHeight = expand; @@ -39163,7 +39163,7 @@ } }; - var GetValue$1i = Phaser.Utils.Objects.GetValue; + var GetValue$1g = Phaser.Utils.Objects.GetValue; var ResetGrid = function ResetGrid(columnCount, rowCount, columnProportions, rowProportions, space) { if (columnProportions === undefined) { columnProportions = 0; @@ -39207,8 +39207,8 @@ this.rowHeight.length = rowCount; // space - this.setColumnSpace(GetValue$1i(space, 'column', 0)); - this.setRowSpace(GetValue$1i(space, 'row', 0)); + this.setColumnSpace(GetValue$1g(space, 'column', 0)); + this.setRowSpace(GetValue$1g(space, 'row', 0)); var scene = this.scene; var createCellContainerCallback = this.createCellContainerCallback; if (createCellContainerCallback) { @@ -39322,7 +39322,7 @@ }; var IsPlainObject$c = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1h = Phaser.Utils.Objects.GetValue; + var GetValue$1f = Phaser.Utils.Objects.GetValue; var GridSizer = /*#__PURE__*/function (_BaseSizer) { _inherits(GridSizer, _BaseSizer); var _super = _createSuper(GridSizer); @@ -39331,41 +39331,41 @@ _classCallCheck(this, GridSizer); if (IsPlainObject$c(x)) { config = x; - x = GetValue$1h(config, 'x', 0); - y = GetValue$1h(config, 'y', 0); - minWidth = GetValue$1h(config, 'width', undefined); - minHeight = GetValue$1h(config, 'height', undefined); - columnCount = GetValue$1h(config, 'column', config.col || 0); - rowCount = GetValue$1h(config, 'row', 0); - columnProportions = GetValue$1h(config, 'columnProportions', 0); - rowProportions = GetValue$1h(config, 'rowProportions', 0); + x = GetValue$1f(config, 'x', 0); + y = GetValue$1f(config, 'y', 0); + minWidth = GetValue$1f(config, 'width', undefined); + minHeight = GetValue$1f(config, 'height', undefined); + columnCount = GetValue$1f(config, 'column', config.col || 0); + rowCount = GetValue$1f(config, 'row', 0); + columnProportions = GetValue$1f(config, 'columnProportions', 0); + rowProportions = GetValue$1f(config, 'rowProportions', 0); } else if (IsPlainObject$c(minWidth)) { config = minWidth; - minWidth = GetValue$1h(config, 'width', undefined); - minHeight = GetValue$1h(config, 'height', undefined); - columnCount = GetValue$1h(config, 'column', config.col || 0); - rowCount = GetValue$1h(config, 'row', 0); - columnProportions = GetValue$1h(config, 'columnProportions', 0); - rowProportions = GetValue$1h(config, 'rowProportions', 0); + minWidth = GetValue$1f(config, 'width', undefined); + minHeight = GetValue$1f(config, 'height', undefined); + columnCount = GetValue$1f(config, 'column', config.col || 0); + rowCount = GetValue$1f(config, 'row', 0); + columnProportions = GetValue$1f(config, 'columnProportions', 0); + rowProportions = GetValue$1f(config, 'rowProportions', 0); } else if (IsPlainObject$c(columnCount)) { config = columnCount; - columnCount = GetValue$1h(config, 'column', config.col || 0); - rowCount = GetValue$1h(config, 'row', 0); - columnProportions = GetValue$1h(config, 'columnProportions', 0); - rowProportions = GetValue$1h(config, 'rowProportions', 0); + columnCount = GetValue$1f(config, 'column', config.col || 0); + rowCount = GetValue$1f(config, 'row', 0); + columnProportions = GetValue$1f(config, 'columnProportions', 0); + rowProportions = GetValue$1f(config, 'rowProportions', 0); } else if (IsPlainObject$c(columnProportions)) { config = columnProportions; - columnProportions = GetValue$1h(config, 'columnProportions', 0); - rowProportions = GetValue$1h(config, 'rowProportions', 0); + columnProportions = GetValue$1f(config, 'columnProportions', 0); + rowProportions = GetValue$1f(config, 'rowProportions', 0); } _this = _super.call(this, scene, x, y, minWidth, minHeight, config); _this.type = 'rexGridSizer'; _this.sizerChildren = []; _this.addChildrenMap('items', _this.sizerChildren); - _this.setCreateCellContainerCallback(GetValue$1h(config, 'createCellContainerCallback')); - _this.setIndentLeft(GetValue$1h(config, 'space.indentLeftOdd', 0), GetValue$1h(config, 'space.indentLeftEven', 0)); - _this.setIndentTop(GetValue$1h(config, 'space.indentTopOdd', 0), GetValue$1h(config, 'space.indentTopEven', 0)); - _this.resetGrid(columnCount, rowCount, columnProportions, rowProportions, GetValue$1h(config, 'space', undefined)); + _this.setCreateCellContainerCallback(GetValue$1f(config, 'createCellContainerCallback')); + _this.setIndentLeft(GetValue$1f(config, 'space.indentLeftOdd', 0), GetValue$1f(config, 'space.indentLeftEven', 0)); + _this.setIndentTop(GetValue$1f(config, 'space.indentTopOdd', 0), GetValue$1f(config, 'space.indentTopEven', 0)); + _this.resetGrid(columnCount, rowCount, columnProportions, rowProportions, GetValue$1f(config, 'space', undefined)); return _this; } _createClass(GridSizer, [{ @@ -39729,7 +39729,7 @@ }; var IsPlainObject$b = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1g = Phaser.Utils.Objects.GetValue; + var GetValue$1e = Phaser.Utils.Objects.GetValue; var ALIGN_CENTER = Phaser.Display.Align.CENTER; var Add$3 = function Add(gameObject, paddingConfig, childKey, index) { if (gameObject === '\n') { @@ -39739,9 +39739,9 @@ AddChild$1.call(this, gameObject); if (IsPlainObject$b(paddingConfig)) { var config = paddingConfig; - paddingConfig = GetValue$1g(config, 'padding', 0); - childKey = GetValue$1g(config, 'key', undefined); - index = GetValue$1g(config, 'index', undefined); + paddingConfig = GetValue$1e(config, 'padding', 0); + childKey = GetValue$1e(config, 'key', undefined); + index = GetValue$1e(config, 'index', undefined); } if (paddingConfig === undefined) { paddingConfig = 0; @@ -39857,7 +39857,7 @@ }; var IsPlainObject$a = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1f = Phaser.Utils.Objects.GetValue; + var GetValue$1d = Phaser.Utils.Objects.GetValue; var FixWidthSizer = /*#__PURE__*/function (_BaseSizer) { _inherits(FixWidthSizer, _BaseSizer); var _super = _createSuper(FixWidthSizer); @@ -39866,26 +39866,26 @@ _classCallCheck(this, FixWidthSizer); if (IsPlainObject$a(x)) { config = x; - x = GetValue$1f(config, 'x', 0); - y = GetValue$1f(config, 'y', 0); - minWidth = GetValue$1f(config, 'width', undefined); - minHeight = GetValue$1f(config, 'height', undefined); + x = GetValue$1d(config, 'x', 0); + y = GetValue$1d(config, 'y', 0); + minWidth = GetValue$1d(config, 'width', undefined); + minHeight = GetValue$1d(config, 'height', undefined); } else if (IsPlainObject$a(minWidth)) { config = minWidth; - minWidth = GetValue$1f(config, 'width', undefined); - minHeight = GetValue$1f(config, 'height', undefined); + minWidth = GetValue$1d(config, 'width', undefined); + minHeight = GetValue$1d(config, 'height', undefined); } _this = _super.call(this, scene, x, y, minWidth, minHeight, config); _this.type = 'rexFixWidthSizer'; _this.sizerChildren = []; - _this.setOrientation(GetValue$1f(config, 'orientation', 0)); - _this.setItemSpacing(GetValue$1f(config, 'space.item', 0)); - _this.setLineSpacing(GetValue$1f(config, 'space.line', 0)); - _this.setIntentLeft(GetValue$1f(config, 'space.indentLeftOdd', 0), GetValue$1f(config, 'space.indentLeftEven', 0)); - _this.setIntentTop(GetValue$1f(config, 'space.indentTopOdd', 0), GetValue$1f(config, 'space.indentTopEven', 0)); - _this.setAlign(GetValue$1f(config, 'align', 0)); - _this.setJustifyPercentage(GetValue$1f(config, 'justifyPercentage', 0.25)); - _this.setRTL(GetValue$1f(config, 'rtl', false)); + _this.setOrientation(GetValue$1d(config, 'orientation', 0)); + _this.setItemSpacing(GetValue$1d(config, 'space.item', 0)); + _this.setLineSpacing(GetValue$1d(config, 'space.line', 0)); + _this.setIntentLeft(GetValue$1d(config, 'space.indentLeftOdd', 0), GetValue$1d(config, 'space.indentLeftEven', 0)); + _this.setIntentTop(GetValue$1d(config, 'space.indentTopOdd', 0), GetValue$1d(config, 'space.indentTopEven', 0)); + _this.setAlign(GetValue$1d(config, 'align', 0)); + _this.setJustifyPercentage(GetValue$1d(config, 'justifyPercentage', 0.25)); + _this.setRTL(GetValue$1d(config, 'rtl', false)); _this.addChildrenMap('items', _this.sizerChildren); return _this; } @@ -40259,7 +40259,7 @@ return maskGameObject; }; - var GetValue$1e = Phaser.Utils.Objects.GetValue; + var GetValue$1c = Phaser.Utils.Objects.GetValue; var Label = /*#__PURE__*/function (_LabelBase) { _inherits(Label, _LabelBase); var _super = _createSuper(Label); @@ -40271,14 +40271,14 @@ _this.type = 'rexLabel'; // Add elements - var background = GetValue$1e(config, 'background', undefined); - var icon = GetValue$1e(config, 'icon', undefined); - var iconMask = GetValue$1e(config, 'iconMask', undefined); - var text = GetValue$1e(config, 'text', undefined); - var action = GetValue$1e(config, 'action', undefined); - var actionMask = GetValue$1e(config, 'actionMask', undefined); + var background = GetValue$1c(config, 'background', undefined); + var icon = GetValue$1c(config, 'icon', undefined); + var iconMask = GetValue$1c(config, 'iconMask', undefined); + var text = GetValue$1c(config, 'text', undefined); + var action = GetValue$1c(config, 'action', undefined); + var actionMask = GetValue$1c(config, 'actionMask', undefined); // Align - var align = GetValue$1e(config, 'align', undefined); // undefined/left/top: no space + var align = GetValue$1c(config, 'align', undefined); // undefined/left/top: no space if (background) { _this.addBackground(background); @@ -40293,23 +40293,23 @@ if (_this.orientation === 0) { if (text || action) { padding = { - right: GetValue$1e(config, 'space.icon', 0), - top: GetValue$1e(config, 'space.iconTop', 0), - bottom: GetValue$1e(config, 'space.iconBottom', 0), - left: GetValue$1e(config, 'space.iconLeft', 0) + right: GetValue$1c(config, 'space.icon', 0), + top: GetValue$1c(config, 'space.iconTop', 0), + bottom: GetValue$1c(config, 'space.iconBottom', 0), + left: GetValue$1c(config, 'space.iconLeft', 0) }; } } else { if (text || action) { padding = { - bottom: GetValue$1e(config, 'space.icon', 0), - left: GetValue$1e(config, 'space.iconLeft', 0), - right: GetValue$1e(config, 'space.iconRight', 0), - top: GetValue$1e(config, 'space.iconTop', 0) + bottom: GetValue$1c(config, 'space.icon', 0), + left: GetValue$1c(config, 'space.iconLeft', 0), + right: GetValue$1c(config, 'space.iconRight', 0), + top: GetValue$1c(config, 'space.iconTop', 0) }; } } - var fitRatio = GetValue$1e(config, 'squareFitIcon', false) ? 1 : 0; + var fitRatio = GetValue$1c(config, 'squareFitIcon', false) ? 1 : 0; _this.add(icon, { proportion: 0, padding: padding, @@ -40320,14 +40320,14 @@ } if (!fitRatio) { - var iconSize = GetValue$1e(config, 'iconSize', undefined); - _this.setIconSize(GetValue$1e(config, 'iconWidth', iconSize), GetValue$1e(config, 'iconHeight', iconSize)); + var iconSize = GetValue$1c(config, 'iconSize', undefined); + _this.setIconSize(GetValue$1c(config, 'iconWidth', iconSize), GetValue$1c(config, 'iconHeight', iconSize)); } } if (text) { - var textSpace = GetValue$1e(config, 'space.text', 0); - var expandTextWidth = GetValue$1e(config, 'expandTextWidth', false); - var expandTextHeight = GetValue$1e(config, 'expandTextHeight', false); + var textSpace = GetValue$1c(config, 'space.text', 0); + var expandTextWidth = GetValue$1c(config, 'expandTextWidth', false); + var expandTextHeight = GetValue$1c(config, 'expandTextHeight', false); var proportion, padding, expand; if (_this.orientation === 0) { proportion = expandTextWidth ? 1 : 0; @@ -40356,18 +40356,18 @@ var padding; if (_this.orientation === 0) { padding = { - top: GetValue$1e(config, 'space.actionTop', 0), - bottom: GetValue$1e(config, 'space.actionBottom', 0), - right: GetValue$1e(config, 'space.actionRight', 0) + top: GetValue$1c(config, 'space.actionTop', 0), + bottom: GetValue$1c(config, 'space.actionBottom', 0), + right: GetValue$1c(config, 'space.actionRight', 0) }; } else { padding = { - left: GetValue$1e(config, 'space.actionLeft', 0), - right: GetValue$1e(config, 'space.actionRight', 0), - bottom: GetValue$1e(config, 'space.actionBottom', 0) + left: GetValue$1c(config, 'space.actionLeft', 0), + right: GetValue$1c(config, 'space.actionRight', 0), + bottom: GetValue$1c(config, 'space.actionBottom', 0) }; } - var fitRatio = GetValue$1e(config, 'squareFitAction', false) ? 1 : 0; + var fitRatio = GetValue$1c(config, 'squareFitAction', false) ? 1 : 0; _this.add(action, { proportion: 0, padding: padding, @@ -40378,8 +40378,8 @@ } if (!fitRatio) { - var actionSize = GetValue$1e(config, 'actionSize'); - _this.setActionSize(GetValue$1e(config, 'actionWidth', actionSize), GetValue$1e(config, 'actionHeight', actionSize)); + var actionSize = GetValue$1c(config, 'actionSize'); + _this.setActionSize(GetValue$1c(config, 'actionWidth', actionSize), GetValue$1c(config, 'actionHeight', actionSize)); } } @@ -40431,12 +40431,12 @@ return gameObject; }; - var GetValue$1d = Phaser.Utils.Objects.GetValue; + var GetValue$1b = Phaser.Utils.Objects.GetValue; var PhaserBitmapText = Phaser.GameObjects.BitmapText; var CreateText = function CreateText(scene, config) { - var type = GetValue$1d(config, '$type'); + var type = GetValue$1b(config, '$type'); if (type === undefined) { - if (!!GetValue$1d(config, 'key')) { + if (!!GetValue$1b(config, 'key')) { type = 'bitmaptext'; } } @@ -40444,13 +40444,13 @@ switch (type) { case 'bitmaptext': case 'bitmap': - var key = GetValue$1d(config, 'key'); - var size = GetValue$1d(config, 'size'); + var key = GetValue$1b(config, 'key'); + var size = GetValue$1b(config, 'size'); if (size === undefined) { - size = GetValue$1d(config, 'fontSize'); + size = GetValue$1b(config, 'fontSize'); } gameObject = new PhaserBitmapText(scene, 0, 0, key, '', size); - var color = GetValue$1d(config, 'color'); + var color = GetValue$1b(config, 'color'); if (color !== undefined) { gameObject.setTint(color); } @@ -40541,20 +40541,20 @@ return gameObject; }; - var GetValue$1c = Phaser.Utils.Objects.GetValue; + var GetValue$1a = Phaser.Utils.Objects.GetValue; var BuildLabelConfig = function BuildLabelConfig(scene, config, creators) { config = config ? DeepClone(config) : {}; - var createBackground = GetValue$1c(creators, 'background', CreateBackground$2); - var createText = GetValue$1c(creators, 'text', CreateText); - var createIcon = GetValue$1c(creators, 'icon', CreateImage); - var createAction = GetValue$1c(creators, 'action', CreateImage); + var createBackground = GetValue$1a(creators, 'background', CreateBackground$2); + var createText = GetValue$1a(creators, 'text', CreateText); + var createIcon = GetValue$1a(creators, 'icon', CreateImage); + var createAction = GetValue$1a(creators, 'action', CreateImage); if (createBackground) { config.background = createBackground(scene, config.background); } else { delete config.background; } if (createText) { - var wrapText = GetValue$1c(config, 'wrapText', false); + var wrapText = GetValue$1a(config, 'wrapText', false); if (wrapText) { if (wrapText === true) { wrapText = 'word'; @@ -40647,18 +40647,18 @@ Phaser.Utils.Objects.GetValue; - var GetValue$1b = Phaser.Utils.Objects.GetValue; + var GetValue$19 = Phaser.Utils.Objects.GetValue; var IsPlainObject$9 = Phaser.Utils.Objects.IsPlainObject; var Build$1 = function Build(scene, config) { // Add elements - var background = GetValue$1b(config, 'background', undefined); - var icon = GetValue$1b(config, 'icon', undefined); - var iconMask = GetValue$1b(config, 'iconMask', undefined); - var nameText = GetValue$1b(config, 'nameText', undefined); - var valueText = GetValue$1b(config, 'valueText', undefined); - var bar = GetValue$1b(config, 'bar', undefined); - var action = GetValue$1b(config, 'action', undefined); - var actionMask = GetValue$1b(config, 'actionMask', undefined); + var background = GetValue$19(config, 'background', undefined); + var icon = GetValue$19(config, 'icon', undefined); + var iconMask = GetValue$19(config, 'iconMask', undefined); + var nameText = GetValue$19(config, 'nameText', undefined); + var valueText = GetValue$19(config, 'valueText', undefined); + var bar = GetValue$19(config, 'bar', undefined); + var action = GetValue$19(config, 'action', undefined); + var actionMask = GetValue$19(config, 'actionMask', undefined); if (IsPlainObject$9(bar)) { bar = new LineProgress(scene, bar); scene.add.existing(bar); @@ -40679,17 +40679,17 @@ if (this.orientation === 0) { if (hasTextSizer || action) { padding = { - right: GetValue$1b(config, 'space.icon', 0), - top: GetValue$1b(config, 'space.iconTop', 0), - bottom: GetValue$1b(config, 'space.iconBottom', 0) + right: GetValue$19(config, 'space.icon', 0), + top: GetValue$19(config, 'space.iconTop', 0), + bottom: GetValue$19(config, 'space.iconBottom', 0) }; } } else { if (hasTextSizer || action) { padding = { - bottom: GetValue$1b(config, 'space.icon', 0), - left: GetValue$1b(config, 'space.iconLeft', 0), - right: GetValue$1b(config, 'space.iconRight', 0) + bottom: GetValue$19(config, 'space.icon', 0), + left: GetValue$19(config, 'space.iconLeft', 0), + right: GetValue$19(config, 'space.iconRight', 0) }; } } @@ -40718,7 +40718,7 @@ } nameText.setOrigin(0, nameText.originY); var padding = { - left: GetValue$1b(config, 'space.name', 0) + left: GetValue$19(config, 'space.name', 0) }; nameValueSizer.add(nameText, { padding: padding @@ -40732,12 +40732,12 @@ valueText.setOrigin(1, valueText.originY); nameValueSizer.addSpace(); var padding = { - right: GetValue$1b(config, 'space.value', 0) + right: GetValue$19(config, 'space.value', 0) }; nameValueSizer.add(valueText, { padding: padding }); - this.setValueTextFormatCallback(GetValue$1b(config, 'valueTextFormatCallback', DefaultValueTextFormatCallback), GetValue$1b(config, 'valueTextFormatCallbackScope', undefined)); + this.setValueTextFormatCallback(GetValue$19(config, 'valueTextFormatCallback', DefaultValueTextFormatCallback), GetValue$19(config, 'valueTextFormatCallbackScope', undefined)); } textSizer.add(nameValueSizer, { expand: true @@ -40745,10 +40745,10 @@ } if (bar) { var padding = { - top: nameValueSizer ? GetValue$1b(config, 'space.bar', 0) : 0, - bottom: GetValue$1b(config, 'space.barBottom', 0), - left: GetValue$1b(config, 'space.barLeft', 0), - right: GetValue$1b(config, 'space.barRight', 0) + top: nameValueSizer ? GetValue$19(config, 'space.bar', 0) : 0, + bottom: GetValue$19(config, 'space.barBottom', 0), + left: GetValue$19(config, 'space.barLeft', 0), + right: GetValue$19(config, 'space.barRight', 0) }; textSizer.add(bar, { expand: true, @@ -40758,10 +40758,10 @@ var padding = undefined; if (action) { padding = { - right: GetValue$1b(config, 'space.text', 0) + right: GetValue$19(config, 'space.text', 0) }; } - var textAlign = GetValue$1b(config, 'align.text', 'bottom'); + var textAlign = GetValue$19(config, 'align.text', 'bottom'); this.add(textSizer, { proportion: 1, align: textAlign, @@ -40772,13 +40772,13 @@ var padding; if (this.orientation === 0) { padding = { - top: GetValue$1b(config, 'space.actionTop', 0), - bottom: GetValue$1b(config, 'space.actionBottom', 0) + top: GetValue$19(config, 'space.actionTop', 0), + bottom: GetValue$19(config, 'space.actionBottom', 0) }; } else { padding = { - left: GetValue$1b(config, 'space.actionLeft', 0), - right: GetValue$1b(config, 'space.actionRight', 0) + left: GetValue$19(config, 'space.actionLeft', 0), + right: GetValue$19(config, 'space.actionRight', 0) }; } this.add(action, { @@ -41096,7 +41096,7 @@ var SizerRmove$2 = Sizer.prototype.remove; var SizerClear$2 = Sizer.prototype.clear; - var Remove$2 = function Remove(gameObject, destroyChild) { + var Remove$3 = function Remove(gameObject, destroyChild) { if (this.getParentSizer(gameObject) !== this) { return this; } @@ -41110,10 +41110,10 @@ if (IsArray(gameObject)) { var gameObjects = gameObject; for (var i = 0, cnt = gameObjects.length; i < cnt; i++) { - Remove$2.call(this, gameObjects[i], destroyChild); + Remove$3.call(this, gameObjects[i], destroyChild); } } else { - Remove$2.call(this, gameObject, destroyChild); + Remove$3.call(this, gameObject, destroyChild); } return this; }, @@ -41135,7 +41135,7 @@ clearButtons: function clearButtons(destroyChild) { var buttons = this.buttonGroup.buttons; for (var i = buttons.length - 1; i >= 0; i--) { - Remove$2.call(this, buttons[i], destroyChild); + Remove$3.call(this, buttons[i], destroyChild); } return this; } @@ -41275,13 +41275,13 @@ } }; - var GetValue$1a = Phaser.Utils.Objects.GetValue; + var GetValue$18 = Phaser.Utils.Objects.GetValue; var ButtonsTypeMethods = { setButtonsType: function setButtonsType(config) { if (config === undefined) { config = {}; } - var buttonsType = GetValue$1a(config, 'buttonsType', config.type); + var buttonsType = GetValue$18(config, 'buttonsType', config.type); this.buttonsType = buttonsType; if (!this.buttonsType) { return this; @@ -41289,11 +41289,11 @@ // Assign this.setValueCallback, this.setValueCallbackScope var setValueCallback, setValueCallbackScope; - setValueCallback = GetValue$1a(config, 'setValueCallback', undefined); - setValueCallbackScope = GetValue$1a(config, 'setValueCallbackScope', undefined); + setValueCallback = GetValue$18(config, 'setValueCallback', undefined); + setValueCallbackScope = GetValue$18(config, 'setValueCallbackScope', undefined); if (setValueCallback === undefined) { - setValueCallback = GetValue$1a(config, 'setButtonStateCallback', undefined); - setValueCallbackScope = GetValue$1a(config, 'setButtonStateCallbackScope', undefined); + setValueCallback = GetValue$18(config, 'setButtonStateCallback', undefined); + setValueCallbackScope = GetValue$18(config, 'setButtonStateCallbackScope', undefined); } this.setValueCallback = setValueCallback; this.setValueCallbackScope = setValueCallbackScope; @@ -41594,7 +41594,7 @@ } }; - var GetValue$19 = Phaser.Utils.Objects.GetValue; + var GetValue$17 = Phaser.Utils.Objects.GetValue; var Buttons$1 = /*#__PURE__*/function (_Sizer) { _inherits(Buttons, _Sizer); var _super = _createSuper(Buttons); @@ -41616,18 +41616,18 @@ _this.type = 'rexButtons'; _this.buttonGroup = new ButtonGroup({ parent: _assertThisInitialized(_this), - eventEmitter: GetValue$19(config, 'eventEmitter', _assertThisInitialized(_this)), - groupName: GetValue$19(config, 'groupName', undefined), - clickConfig: GetValue$19(config, 'click', undefined) + eventEmitter: GetValue$17(config, 'eventEmitter', _assertThisInitialized(_this)), + groupName: GetValue$17(config, 'groupName', undefined), + clickConfig: GetValue$17(config, 'click', undefined) }).setButtonsType(config); // Add elements - var background = GetValue$19(config, 'background', undefined); - var buttons = GetValue$19(config, 'buttons', undefined); + var background = GetValue$17(config, 'background', undefined); + var buttons = GetValue$17(config, 'buttons', undefined); // Buttons properties - _this.buttonsExpand = GetValue$19(config, 'expand', false); - _this.buttonsAlign = GetValue$19(config, 'align', undefined); // undefined/left/top: no space + _this.buttonsExpand = GetValue$17(config, 'expand', false); + _this.buttonsAlign = GetValue$17(config, 'align', undefined); // undefined/left/top: no space if (background) { _this.addBackground(background); @@ -41690,7 +41690,7 @@ var SizerRmove$1 = GridSizer.prototype.remove; var SizerClear$1 = GridSizer.prototype.clear; - var Remove$1 = function Remove(gameObject, destroyChild) { + var Remove$2 = function Remove(gameObject, destroyChild) { var gameObject = this.getButton(gameObject); if (!gameObject) { return this; @@ -41704,10 +41704,10 @@ if (IsArray(gameObject)) { var gameObjects = gameObject; for (var i = 0, cnt = gameObjects.length; i < cnt; i++) { - Remove$1.call(this, gameObjects[i], destroyChild); + Remove$2.call(this, gameObjects[i], destroyChild); } } else { - Remove$1.call(this, gameObject, destroyChild); + Remove$2.call(this, gameObject, destroyChild); } return this; }, @@ -41724,13 +41724,13 @@ clearButtons: function clearButtons(destroyChild) { var buttons = this.buttonGroup.buttons; for (var i = buttons.length - 1; i >= 0; i--) { - Remove$1.call(this, buttons[i], destroyChild); + Remove$2.call(this, buttons[i], destroyChild); } return this; } }; - var GetValue$18 = Phaser.Utils.Objects.GetValue; + var GetValue$16 = Phaser.Utils.Objects.GetValue; var GridButtons = /*#__PURE__*/function (_GridSizer) { _inherits(GridButtons, _GridSizer); var _super = _createSuper(GridButtons); @@ -41740,11 +41740,11 @@ if (config === undefined) { config = {}; } - var rowCount = GetValue$18(config, 'row', 0); - var columnCount = GetValue$18(config, 'column', config.col || 0); - var createCellContainerCallback = GetValue$18(config, 'createCellContainerCallback'); - var buttons = GetValue$18(config, 'buttons', undefined); - var buttonsExpand = GetValue$18(config, 'expand', true); + var rowCount = GetValue$16(config, 'row', 0); + var columnCount = GetValue$16(config, 'column', config.col || 0); + var createCellContainerCallback = GetValue$16(config, 'createCellContainerCallback'); + var buttons = GetValue$16(config, 'buttons', undefined); + var buttonsExpand = GetValue$16(config, 'expand', true); var buttonProportion = buttonsExpand ? 1 : 0; if (createCellContainerCallback) { config.createCellContainerCallback = undefined; @@ -41765,17 +41765,17 @@ _this.type = 'rexGridButtons'; _this.buttonGroup = new ButtonGroup({ parent: _assertThisInitialized(_this), - eventEmitter: GetValue$18(config, 'eventEmitter', _assertThisInitialized(_this)), - groupName: GetValue$18(config, 'groupName', undefined), - clickConfig: GetValue$18(config, 'click', undefined) + eventEmitter: GetValue$16(config, 'eventEmitter', _assertThisInitialized(_this)), + groupName: GetValue$16(config, 'groupName', undefined), + clickConfig: GetValue$16(config, 'click', undefined) }).setButtonsType(config); // Add elements - var background = GetValue$18(config, 'background', undefined); + var background = GetValue$16(config, 'background', undefined); // Buttons properties _this.buttonsExpand = buttonsExpand; - GetValue$18(config, 'space', undefined); + GetValue$16(config, 'space', undefined); if (background) { _this.addBackground(background); } @@ -41884,7 +41884,7 @@ var SizerRmove = FixWidthSizer.prototype.remove; var SizerClear = FixWidthSizer.prototype.clear; - var Remove = function Remove(gameObject, destroyChild) { + var Remove$1 = function Remove(gameObject, destroyChild) { var gameObject = this.getButton(gameObject); if (!gameObject) { return this; @@ -41898,10 +41898,10 @@ if (IsArray(gameObject)) { var gameObjects = gameObject; for (var i = 0, cnt = gameObjects.length; i < cnt; i++) { - Remove.call(this, gameObjects[i], destroyChild); + Remove$1.call(this, gameObjects[i], destroyChild); } } else { - Remove.call(this, gameObject, destroyChild); + Remove$1.call(this, gameObject, destroyChild); } return this; }, @@ -41918,13 +41918,13 @@ clearButtons: function clearButtons(destroyChild) { var buttons = this.buttonGroup.buttons; for (var i = buttons.length - 1; i >= 0; i--) { - Remove.call(this, buttons[i], destroyChild); + Remove$1.call(this, buttons[i], destroyChild); } return this; } }; - var GetValue$17 = Phaser.Utils.Objects.GetValue; + var GetValue$15 = Phaser.Utils.Objects.GetValue; var Buttons = /*#__PURE__*/function (_FixWidthSizer) { _inherits(Buttons, _FixWidthSizer); var _super = _createSuper(Buttons); @@ -41947,17 +41947,17 @@ _this.type = 'rexFixWidthButtons'; _this.buttonGroup = new ButtonGroup({ parent: _assertThisInitialized(_this), - eventEmitter: GetValue$17(config, 'eventEmitter', _assertThisInitialized(_this)), - groupName: GetValue$17(config, 'groupName', undefined), - clickConfig: GetValue$17(config, 'click', undefined) + eventEmitter: GetValue$15(config, 'eventEmitter', _assertThisInitialized(_this)), + groupName: GetValue$15(config, 'groupName', undefined), + clickConfig: GetValue$15(config, 'click', undefined) }).setButtonsType(config); // Add elements - var background = GetValue$17(config, 'background', undefined); - var buttons = GetValue$17(config, 'buttons', undefined); + var background = GetValue$15(config, 'background', undefined); + var buttons = GetValue$15(config, 'buttons', undefined); // Buttons properties - _this.buttonsAlign = GetValue$17(config, 'align', undefined); + _this.buttonsAlign = GetValue$15(config, 'align', undefined); if (background) { _this.addBackground(background); } @@ -42020,7 +42020,7 @@ } }; - var GetValue$16 = Phaser.Utils.Objects.GetValue; + var GetValue$14 = Phaser.Utils.Objects.GetValue; var FileSelectorButton = /*#__PURE__*/function (_Label) { _inherits(FileSelectorButton, _Label); var _super = _createSuper(FileSelectorButton); @@ -42033,8 +42033,8 @@ scene.add.existing(fileChooser); _this.addBackground(fileChooser); _this.addChildrenMap('fileChooser', fileChooser); - _this.setAccept(GetValue$16(config, 'accept', '')); - _this.setMultiple(GetValue$16(config, 'multiple', false)); + _this.setAccept(GetValue$14(config, 'accept', '')); + _this.setMultiple(GetValue$14(config, 'multiple', false)); fileChooser.on('change', function (gameObject) { var files = gameObject.files; if (files.length === 0) { @@ -42375,7 +42375,7 @@ var Methods$8 = {}; Object.assign(Methods$8, ButtonMethods$1, ModalMethods); - var GetValue$15 = Phaser.Utils.Objects.GetValue; + var GetValue$13 = Phaser.Utils.Objects.GetValue; var Dialog = /*#__PURE__*/function (_Sizer) { _inherits(Dialog, _Sizer); var _super = _createSuper(Dialog); @@ -42389,24 +42389,24 @@ config.orientation = 1; // Top to bottom _this = _super.call(this, scene, config); _this.type = 'rexDialog'; - _this.eventEmitter = GetValue$15(config, 'eventEmitter', _assertThisInitialized(_this)); + _this.eventEmitter = GetValue$13(config, 'eventEmitter', _assertThisInitialized(_this)); // Add elements - var background = GetValue$15(config, 'background', undefined); - var title = GetValue$15(config, 'title', undefined); - var toolbar = GetValue$15(config, 'toolbar', undefined); - var toolbarBackground = GetValue$15(config, 'toolbarBackground', undefined); - var leftToolbar = GetValue$15(config, 'leftToolbar', undefined); - var leftToolbarBackground = GetValue$15(config, 'leftToolbarBackground', undefined); - var content = GetValue$15(config, 'content', undefined); - var description = GetValue$15(config, 'description', undefined); + var background = GetValue$13(config, 'background', undefined); + var title = GetValue$13(config, 'title', undefined); + var toolbar = GetValue$13(config, 'toolbar', undefined); + var toolbarBackground = GetValue$13(config, 'toolbarBackground', undefined); + var leftToolbar = GetValue$13(config, 'leftToolbar', undefined); + var leftToolbarBackground = GetValue$13(config, 'leftToolbarBackground', undefined); + var content = GetValue$13(config, 'content', undefined); + var description = GetValue$13(config, 'description', undefined); var choicesSizer; - var choices = GetValue$15(config, 'choices', undefined); - var choicesBackground = GetValue$15(config, 'choicesBackground', undefined); + var choices = GetValue$13(config, 'choices', undefined); + var choicesBackground = GetValue$13(config, 'choicesBackground', undefined); var actionsSizer; - var actions = GetValue$15(config, 'actions', undefined); - var actionsBackground = GetValue$15(config, 'actionsBackground', undefined); - var clickConfig = GetValue$15(config, 'click', undefined); + var actions = GetValue$13(config, 'actions', undefined); + var actionsBackground = GetValue$13(config, 'actionsBackground', undefined); + var clickConfig = GetValue$13(config, 'click', undefined); if (background) { _this.addBackground(background); } @@ -42419,7 +42419,7 @@ orientation: 0, // Left-right space: { - item: GetValue$15(config, 'space.toolbarItem', 0) + item: GetValue$13(config, 'space.toolbarItem', 0) }, click: clickConfig, eventEmitter: _this.eventEmitter @@ -42434,7 +42434,7 @@ orientation: 0, // Left-right space: { - item: GetValue$15(config, 'space.leftToolbarItem', 0) + item: GetValue$13(config, 'space.leftToolbarItem', 0) }, click: clickConfig, eventEmitter: _this.eventEmitter @@ -42443,8 +42443,8 @@ // title or toolbar or leftToolbar if (title || toolbar || leftToolbar) { - var titleExpandWidth = !!title && GetValue$15(config, 'expand.title', true); - var titleAlign = GetValue$15(config, 'align.title', 'center'); + var titleExpandWidth = !!title && GetValue$13(config, 'expand.title', true); + var titleAlign = GetValue$13(config, 'align.title', 'center'); var useOverlapSizer = // Has title, title is not exapnd-width, title align to center title && !titleExpandWidth && titleAlign === 'center' || @@ -42478,8 +42478,8 @@ titleSizer.addSpace(); } var padding = { - left: GetValue$15(config, 'space.titleLeft', 0), - right: GetValue$15(config, 'space.titleRight', 0) + left: GetValue$13(config, 'space.titleLeft', 0), + right: GetValue$13(config, 'space.titleRight', 0) }; var proportion = titleExpandWidth ? 1 : 0; titleSizer.add(title, { @@ -42511,11 +42511,11 @@ var padding; if (content || description || choices || actions) { padding = { - bottom: GetValue$15(config, 'space.title', 0), - top: GetValue$15(config, 'space.titleTop', 0) + bottom: GetValue$13(config, 'space.title', 0), + top: GetValue$13(config, 'space.titleTop', 0) }; } - var proportion = GetValue$15(config, 'proportion.title', 0); + var proportion = GetValue$13(config, 'proportion.title', 0); _this.add(titleSizer, { padding: padding, proportion: proportion, @@ -42523,15 +42523,15 @@ }); } if (content) { - var align = GetValue$15(config, 'align.content', 'center'); - var contentSpace = GetValue$15(config, 'space.content', 0); + var align = GetValue$13(config, 'align.content', 'center'); + var contentSpace = GetValue$13(config, 'space.content', 0); var padding = { - left: GetValue$15(config, 'space.contentLeft', 0), - right: GetValue$15(config, 'space.contentRight', 0), + left: GetValue$13(config, 'space.contentLeft', 0), + right: GetValue$13(config, 'space.contentRight', 0), bottom: description || choices || actions ? contentSpace : 0 }; - var proportion = GetValue$15(config, 'proportion.content', 0); - var expand = GetValue$15(config, 'expand.content', true); + var proportion = GetValue$13(config, 'proportion.content', 0); + var expand = GetValue$13(config, 'expand.content', true); _this.add(content, { align: align, padding: padding, @@ -42540,15 +42540,15 @@ }); } if (description) { - var align = GetValue$15(config, 'align.description', 'center'); - var descriptionSpace = GetValue$15(config, 'space.description', 0); + var align = GetValue$13(config, 'align.description', 'center'); + var descriptionSpace = GetValue$13(config, 'space.description', 0); var padding = { - left: GetValue$15(config, 'space.descriptionLeft', 0), - right: GetValue$15(config, 'space.descriptionRight', 0), + left: GetValue$13(config, 'space.descriptionLeft', 0), + right: GetValue$13(config, 'space.descriptionRight', 0), bottom: choices || actions ? descriptionSpace : 0 }; - var proportion = GetValue$15(config, 'proportion.description', 0); - var expand = GetValue$15(config, 'expand.description', true); + var proportion = GetValue$13(config, 'proportion.description', 0); + var expand = GetValue$13(config, 'expand.description', true); _this.add(description, { align: align, padding: padding, @@ -42557,29 +42557,29 @@ }); } if (choices) { - var choicesType = GetValue$15(config, 'choicesType', '').split('-'); + var choicesType = GetValue$13(config, 'choicesType', '').split('-'); var ButtonsClass = Contains(choicesType, 'wrap') ? Buttons : Contains(choicesType, 'grid') ? GridButtons : Buttons$1; var buttonsType = Contains(choicesType, 'radio') ? 'radio' : Contains(choicesType, 'checkboxes') ? 'checkboxes' : undefined; var space = { - left: GetValue$15(config, 'space.choicesBackgroundLeft', 0), - right: GetValue$15(config, 'space.choicesBackgroundRight', 0), - top: GetValue$15(config, 'space.choicesBackgroundTop', 0), - bottom: GetValue$15(config, 'space.choicesBackgroundBottom', 0) + left: GetValue$13(config, 'space.choicesBackgroundLeft', 0), + right: GetValue$13(config, 'space.choicesBackgroundRight', 0), + top: GetValue$13(config, 'space.choicesBackgroundTop', 0), + bottom: GetValue$13(config, 'space.choicesBackgroundBottom', 0) }; - var itemSpace = GetValue$15(config, 'space.choice', 0); + var itemSpace = GetValue$13(config, 'space.choice', 0); if (ButtonsClass === Buttons$1) { space.item = itemSpace; } else if (ButtonsClass === Buttons) { space.item = itemSpace; - space.line = GetValue$15(config, 'space.choiceLine', itemSpace); + space.line = GetValue$13(config, 'space.choiceLine', itemSpace); } else { // GridButtons - space.column = GetValue$15(config, 'space.choiceColumn', itemSpace); - space.row = GetValue$15(config, 'space.choiceRow', itemSpace); + space.column = GetValue$13(config, 'space.choiceColumn', itemSpace); + space.row = GetValue$13(config, 'space.choiceRow', itemSpace); } var choicesConfig = { - width: GetValue$15(config, 'choicesWidth', undefined), - height: GetValue$15(config, 'choicesHeight', undefined), + width: GetValue$13(config, 'choicesWidth', undefined), + height: GetValue$13(config, 'choicesHeight', undefined), groupName: 'choices', buttonsType: buttonsType, background: choicesBackground, @@ -42587,22 +42587,22 @@ space: space, click: clickConfig, eventEmitter: _this.eventEmitter, - setValueCallback: GetValue$15(config, 'choicesSetValueCallback', undefined), - setValueCallbackScope: GetValue$15(config, 'choicesSetValueCallbackScope', undefined) + setValueCallback: GetValue$13(config, 'choicesSetValueCallback', undefined), + setValueCallbackScope: GetValue$13(config, 'choicesSetValueCallbackScope', undefined) }; if (ButtonsClass === Buttons$1) { choicesConfig.orientation = Contains(choicesType, 'x') ? 0 : 1; } choicesSizer = new ButtonsClass(scene, choicesConfig); - var choicesSpace = GetValue$15(config, 'space.choices', 0); + var choicesSpace = GetValue$13(config, 'space.choices', 0); var padding = { - left: GetValue$15(config, 'space.choicesLeft', 0), - right: GetValue$15(config, 'space.choicesRight', 0), + left: GetValue$13(config, 'space.choicesLeft', 0), + right: GetValue$13(config, 'space.choicesRight', 0), bottom: actions ? choicesSpace : 0 }; - var align = GetValue$15(config, 'align.choices', 'center'); - var proportion = GetValue$15(config, 'proportion.choices', 0); - var expand = GetValue$15(config, 'expand.choices', true); + var align = GetValue$13(config, 'align.choices', 'center'); + var proportion = GetValue$13(config, 'proportion.choices', 0); + var expand = GetValue$13(config, 'expand.choices', true); _this.add(choicesSizer, { align: align, padding: padding, @@ -42619,19 +42619,19 @@ orientation: 0, // Left-right space: { - item: GetValue$15(config, 'space.action', 0) + item: GetValue$13(config, 'space.action', 0) }, - expand: GetValue$15(config, 'expand.actions', false), - align: GetValue$15(config, 'align.actions', 'center'), + expand: GetValue$13(config, 'expand.actions', false), + align: GetValue$13(config, 'align.actions', 'center'), click: clickConfig, eventEmitter: _this.eventEmitter }); var padding = { - left: GetValue$15(config, 'space.actionsLeft', 0), - right: GetValue$15(config, 'space.actionsRight', 0), - bottom: GetValue$15(config, 'space.actionsBottom', 0) + left: GetValue$13(config, 'space.actionsLeft', 0), + right: GetValue$13(config, 'space.actionsRight', 0), + bottom: GetValue$13(config, 'space.actionsBottom', 0) }; - var proportion = GetValue$15(config, 'proportion.action', 0); + var proportion = GetValue$13(config, 'proportion.action', 0); _this.add(actionsSizer, { align: 'center', padding: padding, @@ -42875,12 +42875,12 @@ return scrollMode; }; - var GetValue$14 = Phaser.Utils.Objects.GetValue; + var GetValue$12 = Phaser.Utils.Objects.GetValue; var AddChild = function AddChild(topPatent, childParent, config) { - var childConfig = GetValue$14(config, 'child'); - var child = GetValue$14(childConfig, 'gameObject', undefined); + var childConfig = GetValue$12(config, 'child'); + var child = GetValue$12(childConfig, 'gameObject', undefined); if (child) { - var childSpace = GetValue$14(config, 'space.child', 0); + var childSpace = GetValue$12(config, 'space.child', 0); topPatent.childMargin = {}; var childMargin = topPatent.childMargin; var childPadding = {}; @@ -42904,35 +42904,35 @@ } else { switch (topPatent.scrollMode) { case 0: - childMargin.top = GetValue$14(childSpace, 'top', 0); - childMargin.bottom = GetValue$14(childSpace, 'bottom', 0); - childPadding.left = GetValue$14(childSpace, 'left', 0); - childPadding.right = GetValue$14(childSpace, 'right', 0); + childMargin.top = GetValue$12(childSpace, 'top', 0); + childMargin.bottom = GetValue$12(childSpace, 'bottom', 0); + childPadding.left = GetValue$12(childSpace, 'left', 0); + childPadding.right = GetValue$12(childSpace, 'right', 0); break; case 1: - childMargin.top = GetValue$14(childSpace, 'left', 0); - childMargin.bottom = GetValue$14(childSpace, 'right', 0); - childPadding.top = GetValue$14(childSpace, 'top', 0); - childPadding.bottom = GetValue$14(childSpace, 'bottom', 0); + childMargin.top = GetValue$12(childSpace, 'left', 0); + childMargin.bottom = GetValue$12(childSpace, 'right', 0); + childPadding.top = GetValue$12(childSpace, 'top', 0); + childPadding.bottom = GetValue$12(childSpace, 'bottom', 0); break; default: // 2 - childMargin.top = GetValue$14(childSpace, 'top', 0); - childMargin.bottom = GetValue$14(childSpace, 'bottom', 0); - childMargin.left = GetValue$14(childSpace, 'left', 0); - childMargin.right = GetValue$14(childSpace, 'right', 0); + childMargin.top = GetValue$12(childSpace, 'top', 0); + childMargin.bottom = GetValue$12(childSpace, 'bottom', 0); + childMargin.left = GetValue$12(childSpace, 'left', 0); + childMargin.right = GetValue$12(childSpace, 'right', 0); break; } } childParent.add(child, { column: 1, row: 1, - align: GetValue$14(childConfig, 'align', 'center'), + align: GetValue$12(childConfig, 'align', 'center'), padding: childPadding, expand: { - width: GetValue$14(childConfig, 'expandWidth', true), + width: GetValue$12(childConfig, 'expandWidth', true), // Private - height: GetValue$14(childConfig, 'expandHeight', true) // Private + height: GetValue$12(childConfig, 'expandHeight', true) // Private } }); } @@ -43149,7 +43149,7 @@ this.resetChildPositionState(indicator); }; - var GetValue$13 = Phaser.Utils.Objects.GetValue; + var GetValue$11 = Phaser.Utils.Objects.GetValue; var IsPlainObject$8 = Phaser.Utils.Objects.IsPlainObject; var Clamp$7 = Phaser.Math.Clamp; var SnapTo = Phaser.Math.Snap.To; @@ -43163,13 +43163,13 @@ _this = _super.call(this, scene, config); _this.type = 'rexSlider'; _this.bootProgressBase(config); - _this.reverseAxis = GetValue$13(config, 'reverseAxis', false); + _this.reverseAxis = GetValue$11(config, 'reverseAxis', false); // Add elements - var background = GetValue$13(config, 'background', undefined); - var track = GetValue$13(config, 'track', undefined); - var indicator = GetValue$13(config, 'indicator', undefined); - var thumb = GetValue$13(config, 'thumb', undefined); + var background = GetValue$11(config, 'background', undefined); + var track = GetValue$11(config, 'track', undefined); + var indicator = GetValue$11(config, 'indicator', undefined); + var thumb = GetValue$11(config, 'thumb', undefined); if (background) { if (IsPlainObject$8(background)) { background = CreateBackground$2(scene, background); @@ -43202,7 +43202,7 @@ } // Input - var inputMode = GetValue$13(config, 'input', 0); + var inputMode = GetValue$11(config, 'input', 0); if (typeof inputMode === 'string') { inputMode = INPUTMODE[inputMode]; } @@ -43240,9 +43240,9 @@ _this.addChildrenMap('track', track); _this.addChildrenMap('indicator', indicator); _this.addChildrenMap('thumb', thumb); - _this.setEnable(GetValue$13(config, 'enable', undefined)); - _this.setGap(GetValue$13(config, 'gap', undefined)); - _this.setValue(GetValue$13(config, 'value', 0), GetValue$13(config, 'min', undefined), GetValue$13(config, 'max', undefined)); + _this.setEnable(GetValue$11(config, 'enable', undefined)); + _this.setGap(GetValue$11(config, 'gap', undefined)); + _this.setValue(GetValue$11(config, 'value', 0), GetValue$11(config, 'min', undefined), GetValue$11(config, 'max', undefined)); return _this; } _createClass(Slider, [{ @@ -43314,7 +43314,7 @@ }; Object.assign(Slider.prototype, methods$c); - var GetValue$12 = Phaser.Utils.Objects.GetValue; + var GetValue$10 = Phaser.Utils.Objects.GetValue; var ScrollBar = /*#__PURE__*/function (_Sizer) { _inherits(ScrollBar, _Sizer); var _super = _createSuper(ScrollBar); @@ -43326,12 +43326,12 @@ _this.type = 'rexScrollBar'; // Add elements - var background = GetValue$12(config, 'background', undefined); - var buttonsConfig = GetValue$12(config, 'buttons', undefined); - var button0 = GetValue$12(buttonsConfig, 'top', GetValue$12(buttonsConfig, 'left', undefined)); - var button1 = GetValue$12(buttonsConfig, 'bottom', GetValue$12(buttonsConfig, 'right', undefined)); + var background = GetValue$10(config, 'background', undefined); + var buttonsConfig = GetValue$10(config, 'buttons', undefined); + var button0 = GetValue$10(buttonsConfig, 'top', GetValue$10(buttonsConfig, 'left', undefined)); + var button1 = GetValue$10(buttonsConfig, 'bottom', GetValue$10(buttonsConfig, 'right', undefined)); var slider, - sliderConfig = GetValue$12(config, 'slider', undefined); + sliderConfig = GetValue$10(config, 'slider', undefined); if (background) { _this.addBackground(background); } @@ -43352,10 +43352,10 @@ sliderConfig.value = null; var proportion; if (_this.orientation === 0) { - var sliderWidth = GetValue$12(sliderConfig, 'width', undefined); + var sliderWidth = GetValue$10(sliderConfig, 'width', undefined); proportion = sliderWidth === undefined ? 1 : 0; } else { - var sliderHeight = GetValue$12(sliderConfig, 'height', undefined); + var sliderHeight = GetValue$10(sliderConfig, 'height', undefined); proportion = sliderHeight === undefined ? 1 : 0; } slider = new Slider(scene, sliderConfig); @@ -43379,14 +43379,14 @@ _this.addChildrenMap('background', background); _this.addChildrenMap('slider', slider); _this.addChildrenMap('buttons', buttons); - var callback = GetValue$12(config, 'valuechangeCallback', null); + var callback = GetValue$10(config, 'valuechangeCallback', null); if (callback !== null) { - var scope = GetValue$12(config, 'valuechangeCallbackScope', undefined); + var scope = GetValue$10(config, 'valuechangeCallbackScope', undefined); _this.on('valuechange', callback, scope); } - _this.setEnable(GetValue$12(config, 'enable', undefined)); - _this.setValue(GetValue$12(config, 'value', 0)); - _this.setScrollStep(GetValue$12(buttonsConfig, 'step', 0.01)); + _this.setEnable(GetValue$10(config, 'enable', undefined)); + _this.setValue(GetValue$10(config, 'value', 0)); + _this.setScrollStep(GetValue$10(buttonsConfig, 'step', 0.01)); return _this; } _createClass(ScrollBar, [{ @@ -43688,7 +43688,7 @@ return State; }(FSM); - var GetValue$11 = Phaser.Utils.Objects.GetValue; + var GetValue$$ = Phaser.Utils.Objects.GetValue; var DistanceBetween = Phaser.Math.Distance.Between; var DragSpeed = /*#__PURE__*/function (_ComponentBase) { _inherits(DragSpeed, _ComponentBase); @@ -43700,7 +43700,7 @@ // this.parent = gameObject; _this._enable = undefined; - gameObject.setInteractive(GetValue$11(config, "inputConfig", undefined)); + gameObject.setInteractive(GetValue$$(config, "inputConfig", undefined)); _this.resetFromJSON(config); _this.boot(); return _this; @@ -43718,9 +43718,9 @@ this.localX = undefined; this.localY = undefined; this.justMoved = false; - this.setEnable(GetValue$11(o, 'enable', true)); - this.holdThreshold = GetValue$11(o, 'holdThreshold', 50); // ms - this.pointerOutReleaseEnable = GetValue$11(o, 'pointerOutRelease', true); + this.setEnable(GetValue$$(o, 'enable', true)); + this.holdThreshold = GetValue$$(o, 'holdThreshold', 50); // ms + this.pointerOutReleaseEnable = GetValue$$(o, 'pointerOutRelease', true); return this; } }, { @@ -43917,7 +43917,7 @@ return DragSpeed; }(ComponentBase); - var GetValue$10 = Phaser.Utils.Objects.GetValue; + var GetValue$_ = Phaser.Utils.Objects.GetValue; var Movement = /*#__PURE__*/function () { function Movement(config) { _classCallCheck(this, Movement); @@ -43926,9 +43926,9 @@ _createClass(Movement, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.setValue(GetValue$10(o, 'value', 0)); - this.setSpeed(GetValue$10(o, 'speed', 0)); - this.setAcceleration(GetValue$10(o, 'acceleration', 0)); + this.setValue(GetValue$_(o, 'value', 0)); + this.setSpeed(GetValue$_(o, 'speed', 0)); + this.setAcceleration(GetValue$_(o, 'acceleration', 0)); return this; } }, { @@ -44066,7 +44066,7 @@ return SlowDown; }(); - var GetValue$$ = Phaser.Utils.Objects.GetValue; + var GetValue$Z = Phaser.Utils.Objects.GetValue; var Clamp$6 = Phaser.Math.Clamp; var Scroller = /*#__PURE__*/function (_ComponentBase) { _inherits(Scroller, _ComponentBase); @@ -44077,34 +44077,34 @@ _this = _super.call(this, gameObject, config); // this.parent = gameObject; - var enable = GetValue$$(config, 'enable', true); + var enable = GetValue$Z(config, 'enable', true); _this._state = new State(_assertThisInitialized(_this), { enable: enable, eventEmitter: false }); var drapSpeedConfig = { - inputConfig: GetValue$$(config, 'inputConfig', undefined), + inputConfig: GetValue$Z(config, 'inputConfig', undefined), enable: enable, - pointerOutRelease: GetValue$$(config, 'pointerOutRelease', true), + pointerOutRelease: GetValue$Z(config, 'pointerOutRelease', true), eventEmitter: false }; _this.dragState = new DragSpeed(gameObject, drapSpeedConfig); _this._enable = undefined; _this._value = undefined; _this._slowDown = new SlowDown(); - var callback = GetValue$$(config, 'valuechangeCallback', null); + var callback = GetValue$Z(config, 'valuechangeCallback', null); if (callback !== null) { - var scope = GetValue$$(config, 'valuechangeCallbackScope', undefined); + var scope = GetValue$Z(config, 'valuechangeCallbackScope', undefined); _this.on('valuechange', callback, scope); } - callback = GetValue$$(config, 'overmaxCallback', null); + callback = GetValue$Z(config, 'overmaxCallback', null); if (callback !== null) { - var scope = GetValue$$(config, 'overmaxCallbackScope', undefined); + var scope = GetValue$Z(config, 'overmaxCallbackScope', undefined); _this.on('overmax', callback, scope); } - callback = GetValue$$(config, 'overminCallback', null); + callback = GetValue$Z(config, 'overminCallback', null); if (callback !== null) { - var scope = GetValue$$(config, 'overminCallbackScope', undefined); + var scope = GetValue$Z(config, 'overminCallbackScope', undefined); _this.on('overmin', callback, scope); } _this.resetFromJSON(config); @@ -44114,21 +44114,21 @@ _createClass(Scroller, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.setOrientationMode(GetValue$$(o, 'orientation', 0)); - this.setDragThreshold(GetValue$$(o, 'threshold', 10)); - this.setSlidingDeceleration(GetValue$$(o, 'slidingDeceleration', 5000)); - this.setBackDeceleration(GetValue$$(o, 'backDeceleration', 2000)); - var dragRate = GetValue$$(o, 'dragRate', 1); - dragRate = dragRate * (GetValue$$(o, 'dragReverse', false) ? -1 : 1); + this.setOrientationMode(GetValue$Z(o, 'orientation', 0)); + this.setDragThreshold(GetValue$Z(o, 'threshold', 10)); + this.setSlidingDeceleration(GetValue$Z(o, 'slidingDeceleration', 5000)); + this.setBackDeceleration(GetValue$Z(o, 'backDeceleration', 2000)); + var dragRate = GetValue$Z(o, 'dragRate', 1); + dragRate = dragRate * (GetValue$Z(o, 'dragReverse', false) ? -1 : 1); this.setDragRate(dragRate); - var bounds = GetValue$$(o, 'bounds', undefined); + var bounds = GetValue$Z(o, 'bounds', undefined); if (bounds) { this.setBounds(bounds); } else { - this.setBounds(GetValue$$(o, 'max', 0), GetValue$$(o, 'min', 0)); + this.setBounds(GetValue$Z(o, 'max', 0), GetValue$Z(o, 'min', 0)); } - this.setValue(GetValue$$(o, 'value', this.maxValue || 0)); - this.setEnable(GetValue$$(o, "enable", true)); + this.setValue(GetValue$Z(o, 'value', this.maxValue || 0)); + this.setEnable(GetValue$Z(o, "enable", true)); return this; } }, { @@ -44460,7 +44460,7 @@ horizontal: 1 }; - var GetValue$_ = Phaser.Utils.Objects.GetValue; + var GetValue$Y = Phaser.Utils.Objects.GetValue; var MouseWheelScroller = /*#__PURE__*/function (_ComponentBase) { _inherits(MouseWheelScroller, _ComponentBase); var _super = _createSuper(MouseWheelScroller); @@ -44471,18 +44471,18 @@ // this.parent = gameObject; if (_this.parent !== _this.scene) { - _this.focusMode = GetValue$_(config, 'focus', true); + _this.focusMode = GetValue$Y(config, 'focus', true); } else { _this.focusMode = false; } - _this.setSpeed(GetValue$_(config, 'speed', 0.1)); - _this.setEnable(GetValue$_(config, 'enable', true)); + _this.setSpeed(GetValue$Y(config, 'speed', 0.1)); + _this.setEnable(GetValue$Y(config, 'enable', true)); if (!_this.focusMode) { // Register on scene _this.scene.input.on('wheel', _this.onSceneScroll, _assertThisInitialized(_this)); } else { var gameObject = _this.parent; - gameObject.setInteractive(GetValue$_(config, "inputConfig", undefined)).on('wheel', function (pointer, dx, dy, dz, event) { + gameObject.setInteractive(GetValue$Y(config, "inputConfig", undefined)).on('wheel', function (pointer, dx, dy, dz, event) { if (!this.enable) { return; } @@ -44531,7 +44531,7 @@ return MouseWheelScroller; }(ComponentBase); - var GetValue$Z = Phaser.Utils.Objects.GetValue; + var GetValue$X = Phaser.Utils.Objects.GetValue; var AddSlider = function AddSlider(topPatent, sliderParent, axis, config) { axis = axis.toUpperCase(); var isAxisY = axis === 'Y'; @@ -44540,12 +44540,12 @@ var sliderConfig, slider; var sliderConfigKey = "slider".concat(axis); if (isScrollXYMode) { - sliderConfig = GetValue$Z(config, sliderConfigKey, undefined); + sliderConfig = GetValue$X(config, sliderConfigKey, undefined); } else { if (config.hasOwnProperty(sliderConfigKey)) { - sliderConfig = GetValue$Z(config, sliderConfigKey, undefined); + sliderConfig = GetValue$X(config, sliderConfigKey, undefined); } else { - sliderConfig = GetValue$Z(config, 'slider', undefined); + sliderConfig = GetValue$X(config, 'slider', undefined); } } if (sliderConfig) { @@ -44555,7 +44555,7 @@ sliderConfig.orientation = isAxisY ? 1 : 0; slider = CreateScrollbar(topPatent.scene, sliderConfig); var column, row, padding; - var sliderPosition = GetValue$Z(sliderConfig, 'position', 0); + var sliderPosition = GetValue$X(sliderConfig, 'position', 0); if (typeof sliderPosition === 'string') { sliderPosition = SLIDER_POSITION_MAP[sliderPosition]; } @@ -44565,15 +44565,15 @@ 2. space.slider 3. space.child */ - var sliderPadding = GetValue$Z(config, "space.slider".concat(axis), undefined); + var sliderPadding = GetValue$X(config, "space.slider".concat(axis), undefined); if (sliderPadding === undefined) { - sliderPadding = GetValue$Z(config, 'space.slider', undefined); + sliderPadding = GetValue$X(config, 'space.slider', undefined); if (sliderPadding === undefined) { if (isScrollXYMode) { sliderPadding = 0; } else { // Legacy - sliderPadding = GetValue$Z(config, 'space.child', 0); + sliderPadding = GetValue$X(config, 'space.child', 0); } } } @@ -44618,9 +44618,9 @@ padding: padding, expand: true }); - topPatent["hideUnscrollableSlider".concat(axis)] = GetValue$Z(sliderConfig, 'hideUnscrollableSlider', false); - topPatent["adaptThumb".concat(axis, "SizeMode")] = GetValue$Z(sliderConfig, 'adaptThumbSize', false); - topPatent["minThumb".concat(axis, "Size")] = GetValue$Z(sliderConfig, 'minThumbSize', undefined); + topPatent["hideUnscrollableSlider".concat(axis)] = GetValue$X(sliderConfig, 'hideUnscrollableSlider', false); + topPatent["adaptThumb".concat(axis, "SizeMode")] = GetValue$X(sliderConfig, 'adaptThumbSize', false); + topPatent["minThumb".concat(axis, "Size")] = GetValue$X(sliderConfig, 'minThumbSize', undefined); } else { topPatent["hideUnscrollableSlider".concat(axis)] = false; topPatent["adaptThumb".concat(axis, "SizeMode")] = false; @@ -44629,12 +44629,12 @@ var scrollerConfig, scroller; var scrollerConfigKey = "scroller".concat(axis); if (isScrollXYMode) { - scrollerConfig = GetValue$Z(config, scrollerConfigKey, true); + scrollerConfig = GetValue$X(config, scrollerConfigKey, true); } else { if (config.hasOwnProperty(scrollerConfigKey)) { - scrollerConfig = GetValue$Z(config, scrollerConfigKey, true); + scrollerConfig = GetValue$X(config, scrollerConfigKey, true); } else { - scrollerConfig = GetValue$Z(config, 'scroller', true); + scrollerConfig = GetValue$X(config, 'scroller', true); } } if (scrollerConfig && child) { @@ -44644,7 +44644,7 @@ scrollerConfig.orientation = isAxisY ? 0 : 1; scroller = new Scroller(child, scrollerConfig); } - var mouseWheelScrollerConfig = GetValue$Z(config, isScrollXYMode ? "mouseWheelScroller".concat(axis) : 'mouseWheelScroller', false), + var mouseWheelScrollerConfig = GetValue$X(config, isScrollXYMode ? "mouseWheelScroller".concat(axis) : 'mouseWheelScroller', false), mouseWheelScroller; if (mouseWheelScrollerConfig && child) { mouseWheelScroller = new MouseWheelScroller(child, mouseWheelScrollerConfig); @@ -44704,22 +44704,22 @@ top: 1 }; - var GetValue$Y = Phaser.Utils.Objects.GetValue; + var GetValue$W = Phaser.Utils.Objects.GetValue; var CreateScrollableSizer = function CreateScrollableSizer(parent, config) { var scene = parent.scene; var columnProportions = [0, 1, 0], rowProportions = [0, 1, 0]; - var parentMinWidth = GetValue$Y(config, 'width'); - var parentMinHeight = GetValue$Y(config, 'height'); + var parentMinWidth = GetValue$W(config, 'width'); + var parentMinHeight = GetValue$W(config, 'height'); if (!parentMinWidth) { - var expandChildWidth = GetValue$Y(config, 'child.expandWidth', true); + var expandChildWidth = GetValue$W(config, 'child.expandWidth', true); if (!expandChildWidth) { columnProportions[1] = 0; // Calculate parent's width by child's width } } if (!parentMinHeight) { - var expandChildHeight = GetValue$Y(config, 'child.expandHeight', true); + var expandChildHeight = GetValue$W(config, 'child.expandHeight', true); if (!expandChildHeight) { rowProportions[1] = 0; // Calculate parent's height by child's height } @@ -44938,7 +44938,7 @@ } }; - var GetValue$X = Phaser.Utils.Objects.GetValue; + var GetValue$V = Phaser.Utils.Objects.GetValue; var Clamp$5 = Phaser.Math.Clamp; var Scrollable = /*#__PURE__*/function (_Sizer) { _inherits(Scrollable, _Sizer); @@ -44954,19 +44954,19 @@ var isRevererXY = scrollMode === 1; config.orientation = !isRevererXY ? 1 : 0; _this = _super.call(this, scene, config); - _this.type = GetValue$X(config, 'type', 'rexScrollable'); + _this.type = GetValue$V(config, 'type', 'rexScrollable'); _this.scrollMode = scrollMode; // Add elements // Background - var background = GetValue$X(config, 'background', undefined); + var background = GetValue$V(config, 'background', undefined); if (background) { _this.addBackground(background); } - var header = GetValue$X(config, 'header', undefined); + var header = GetValue$V(config, 'header', undefined); if (header) { - var align = GetValue$X(config, 'align.header', 'center'); - var headerSpace = GetValue$X(config, 'space.header', 0); + var align = GetValue$V(config, 'align.header', 'center'); + var headerSpace = GetValue$V(config, 'space.header', 0); var padding; if (!isRevererXY) { padding = { @@ -44981,7 +44981,7 @@ proportion: 0, align: align, padding: padding, - expand: GetValue$X(config, 'expand.header', true) + expand: GetValue$V(config, 'expand.header', true) }); } var scrollableSizer = CreateScrollableSizer(_assertThisInitialized(_this), config); @@ -44993,10 +44993,10 @@ expand: true }); } - var footer = GetValue$X(config, 'footer', undefined); + var footer = GetValue$V(config, 'footer', undefined); if (footer) { - var align = GetValue$X(config, 'align.footer', 'center'); - var footerSpace = GetValue$X(config, 'space.footer', 0); + var align = GetValue$V(config, 'align.footer', 'center'); + var footerSpace = GetValue$V(config, 'space.footer', 0); var padding; if (!isRevererXY) { padding = { @@ -45011,7 +45011,7 @@ proportion: 0, align: align, padding: padding, - expand: GetValue$X(config, 'expand.footer', true) + expand: GetValue$V(config, 'expand.footer', true) }); } _this.addChildrenMap('background', background); @@ -45762,7 +45762,7 @@ }; var IsPlainObject$7 = Phaser.Utils.Objects.IsPlainObject; - var GetValue$W = Phaser.Utils.Objects.GetValue; + var GetValue$U = Phaser.Utils.Objects.GetValue; var ALIGN_LEFTTOP$1 = Phaser.Display.Align.TOP_LEFT; var TextBlock = /*#__PURE__*/function (_BaseSizer) { _inherits(TextBlock, _BaseSizer); @@ -45772,14 +45772,14 @@ _classCallCheck(this, TextBlock); if (IsPlainObject$7(x)) { config = x; - x = GetValue$W(config, 'x', 0); - y = GetValue$W(config, 'y', 0); - minWidth = GetValue$W(config, 'width', undefined); - minHeight = GetValue$W(config, 'height', undefined); + x = GetValue$U(config, 'x', 0); + y = GetValue$U(config, 'y', 0); + minWidth = GetValue$U(config, 'width', undefined); + minHeight = GetValue$U(config, 'height', undefined); } else if (IsPlainObject$7(minWidth)) { config = minWidth; - minWidth = GetValue$W(config, 'width', undefined); - minHeight = GetValue$W(config, 'height', undefined); + minWidth = GetValue$U(config, 'width', undefined); + minHeight = GetValue$U(config, 'height', undefined); } _this = _super.call(this, scene, x, y, minWidth, minHeight, config); _this.type = 'rexTextBlock'; @@ -45798,21 +45798,21 @@ // Tag text object : pens-manager // Bitmap text object : array of string - _this.text = GetValue$W(config, 'content', ''); + _this.text = GetValue$U(config, 'content', ''); _this._textOY = 0; _this.execeedTopState = false; _this.execeedBottomState = false; - _this.setClampMode(GetValue$W(config, 'clamplTextOY', true)); - _this.alwaysScrollable = GetValue$W(config, 'alwaysScrollable', false); + _this.setClampMode(GetValue$U(config, 'clamplTextOY', true)); + _this.alwaysScrollable = GetValue$U(config, 'alwaysScrollable', false); // Add elements - var background = GetValue$W(config, 'background', undefined); - var textObject = GetValue$W(config, 'text', undefined); + var background = GetValue$U(config, 'background', undefined); + var textObject = GetValue$U(config, 'text', undefined); if (textObject === undefined) { textObject = CreateDefaultTextObject(scene); } - _this.textCropEnable = GetValue$W(config, 'textCrop', !!textObject.setCrop); - var textMaskEnable = GetValue$W(config, 'textMask', !_this.textCropEnable); + _this.textCropEnable = GetValue$U(config, 'textCrop', !!textObject.setCrop); + var textMaskEnable = GetValue$U(config, 'textMask', !_this.textCropEnable); if (background) { _this.addBackground(background); } @@ -46096,7 +46096,7 @@ } }; - var GetValue$V = Phaser.Utils.Objects.GetValue; + var GetValue$T = Phaser.Utils.Objects.GetValue; var TextArea = /*#__PURE__*/function (_Scrollable) { _inherits(TextArea, _Scrollable); var _super = _createSuper(TextArea); @@ -46108,12 +46108,12 @@ } // Create text-block - var textObject = GetValue$V(config, 'text', undefined); - var textWidth = GetValue$V(config, 'textWidth', undefined); - var textHeight = GetValue$V(config, 'textHeight', undefined); - var textCrop = GetValue$V(config, 'textCrop', !!textObject.setCrop); - var textMask = GetValue$V(config, 'textMask', !textCrop); - var content = GetValue$V(config, 'content', ''); + var textObject = GetValue$T(config, 'text', undefined); + var textWidth = GetValue$T(config, 'textWidth', undefined); + var textHeight = GetValue$T(config, 'textHeight', undefined); + var textCrop = GetValue$T(config, 'textCrop', !!textObject.setCrop); + var textMask = GetValue$T(config, 'textMask', !textCrop); + var content = GetValue$T(config, 'content', ''); var textBlock = new TextBlock(scene, { width: textWidth, height: textHeight, @@ -46121,8 +46121,8 @@ textMask: textMask, textCrop: textCrop && !textMask, content: content, - clamplTextOY: GetValue$V(config, 'clamplChildOY', false), - alwaysScrollable: GetValue$V(config, 'alwaysScrollable', false) + clamplTextOY: GetValue$T(config, 'clamplChildOY', false), + alwaysScrollable: GetValue$T(config, 'alwaysScrollable', false) }); scene.add.existing(textBlock); // Important: Add to display list for touch detecting // Inject properties for scrollable interface @@ -46136,9 +46136,9 @@ expandWidth: textWidth === undefined, expandHeight: textHeight === undefined }; - var spaceConfig = GetValue$V(config, 'space', undefined); + var spaceConfig = GetValue$T(config, 'space', undefined); if (spaceConfig) { - spaceConfig.child = GetValue$V(spaceConfig, 'text', 0); + spaceConfig.child = GetValue$T(spaceConfig, 'text', 0); } _this = _super.call(this, scene, config); _this.addChildrenMap('text', textObject); @@ -46177,13 +46177,13 @@ }(Scrollable); Object.assign(TextArea.prototype, SetTextMethods$1, ScrollMethods$2); - var GetValue$U = Phaser.Utils.Objects.GetValue; + var GetValue$S = Phaser.Utils.Objects.GetValue; var CreateTextArea = function CreateTextArea(scene, config, creators) { config = config ? DeepClone(config) : {}; - var createBackground = GetValue$U(creators, 'background', CreateBackground$2); - var createText = GetValue$U(creators, 'text', CreateText); - var createTrack = GetValue$U(creators, 'track', CreateBackground$2); - var createThumb = GetValue$U(creators, 'thumb', CreateBackground$2); + var createBackground = GetValue$S(creators, 'background', CreateBackground$2); + var createText = GetValue$S(creators, 'text', CreateText); + var createTrack = GetValue$S(creators, 'track', CreateBackground$2); + var createThumb = GetValue$S(creators, 'thumb', CreateBackground$2); if (createBackground) { config.background = createBackground(scene, config.background); } else { @@ -46220,9 +46220,9 @@ return gameObject; }; - var GetValue$T = Phaser.Utils.Objects.GetValue; + var GetValue$R = Phaser.Utils.Objects.GetValue; var CreateContent = function CreateContent(scene, config, creators) { - var type = GetValue$T(config, '$type'); + var type = GetValue$R(config, '$type'); if (type === undefined) { if (config && (config.hasOwnProperty('slider') || config.hasOwnProperty('scroller'))) { type = 'textarea'; @@ -46241,7 +46241,7 @@ return gameObject; }; - var GetValue$S = Phaser.Utils.Objects.GetValue; + var GetValue$Q = Phaser.Utils.Objects.GetValue; var ConfirmDialog = /*#__PURE__*/function (_Dialog) { _inherits(ConfirmDialog, _Dialog); var _super = _createSuper(ConfirmDialog); @@ -46252,7 +46252,7 @@ if (creators === undefined) { creators = {}; } - var createBackground = GetValue$S(creators, 'background', CreateBackground$2); + var createBackground = GetValue$Q(creators, 'background', CreateBackground$2); if (createBackground) { config.background = createBackground(scene, config.background); } else { @@ -46311,17 +46311,17 @@ }(Dialog); Object.assign(ConfirmDialog.prototype, Methods$7); - var GetValue$R = Phaser.Utils.Objects.GetValue; + var GetValue$P = Phaser.Utils.Objects.GetValue; var GetAddChildConfig = function GetAddChildConfig(config, key, defaultValues) { - var proportion = GetValue$R(config, "proportion.".concat(key), defaultValues.proportion); - var align = GetValue$R(config, "align.".concat(key), 'center'); - var padding = GetValue$R(config, "space.".concat(key), undefined); + var proportion = GetValue$P(config, "proportion.".concat(key), defaultValues.proportion); + var align = GetValue$P(config, "align.".concat(key), 'center'); + var padding = GetValue$P(config, "space.".concat(key), undefined); if (typeof padding === 'number' && defaultValues.paddingKey) { var paddingNum = padding; padding = {}; padding[defaultValues.paddingKey] = paddingNum; } - var expand = GetValue$R(config, "expand.".concat(key), true); + var expand = GetValue$P(config, "expand.".concat(key), true); return { proportion: proportion, align: align, @@ -46607,17 +46607,17 @@ } }; - var GetValue$Q = Phaser.Utils.Objects.GetValue; + var GetValue$O = Phaser.Utils.Objects.GetValue; var LayoutCallbacks = [LayoutMode0$1, LayoutMode1, LayoutMode2, LayoutMode0]; var Build = function Build(config) { this.clear(true); // Add Background - var background = GetValue$Q(config, 'background', undefined); + var background = GetValue$O(config, 'background', undefined); if (background) { this.addBackground(background); } - var layoutMode = GetValue$Q(config, 'layoutMode', 0); + var layoutMode = GetValue$O(config, 'layoutMode', 0); if (typeof layoutMode === 'string') { layoutMode = LayoutModesMap[layoutMode.toUpperCase()]; } @@ -46877,7 +46877,7 @@ } }; - var GetValue$P = Phaser.Utils.Objects.GetValue; + var GetValue$N = Phaser.Utils.Objects.GetValue; var Tabs = /*#__PURE__*/function (_GridSizer) { _inherits(Tabs, _GridSizer); var _super = _createSuper(Tabs); @@ -46892,24 +46892,24 @@ config.row = 3; _this = _super.call(this, scene, config); _this.type = 'rexTabs'; - _this.eventEmitter = GetValue$P(config, 'eventEmitter', _assertThisInitialized(_this)); + _this.eventEmitter = GetValue$N(config, 'eventEmitter', _assertThisInitialized(_this)); // Add elements - var background = GetValue$P(config, 'background', undefined); - var panel = GetValue$P(config, 'panel', undefined); - var leftButtons = GetValue$P(config, 'leftButtons', undefined); - var leftButtonsBackground = GetValue$P(config, 'leftButtonsBackground', undefined); + var background = GetValue$N(config, 'background', undefined); + var panel = GetValue$N(config, 'panel', undefined); + var leftButtons = GetValue$N(config, 'leftButtons', undefined); + var leftButtonsBackground = GetValue$N(config, 'leftButtonsBackground', undefined); var leftButtonsSizer; - var rightButtons = GetValue$P(config, 'rightButtons', undefined); - var rightButtonsBackground = GetValue$P(config, 'rightButtonsBackground', undefined); + var rightButtons = GetValue$N(config, 'rightButtons', undefined); + var rightButtonsBackground = GetValue$N(config, 'rightButtonsBackground', undefined); var rightButtonsSizer; - var topButtons = GetValue$P(config, 'topButtons', undefined); - var topButtonsBackground = GetValue$P(config, 'topButtonsBackground', undefined); + var topButtons = GetValue$N(config, 'topButtons', undefined); + var topButtonsBackground = GetValue$N(config, 'topButtonsBackground', undefined); var topButtonsSizer; - var bottomButtons = GetValue$P(config, 'bottomButtons', undefined); - var bottomButtonsBackground = GetValue$P(config, 'bottomButtonsBackground', undefined); + var bottomButtons = GetValue$N(config, 'bottomButtons', undefined); + var bottomButtonsBackground = GetValue$N(config, 'bottomButtonsBackground', undefined); var bottomButtonsSizer; - var clickConfig = GetValue$P(config, 'click', undefined); + var clickConfig = GetValue$N(config, 'click', undefined); if (background) { _this.addBackground(background); } @@ -46917,8 +46917,8 @@ _this.add(panel, 1, 1, 'center', 0, true); } if (leftButtons) { - var leftButtonsOffset = GetValue$P(config, 'space.leftButtonsOffset', 0); - var leftButtonSpace = GetValue$P(config, 'space.leftButton', 0); + var leftButtonsOffset = GetValue$N(config, 'space.leftButtonsOffset', 0); + var leftButtonSpace = GetValue$N(config, 'space.leftButton', 0); leftButtonsSizer = new Buttons$1(scene, { groupName: 'left', background: leftButtonsBackground, @@ -46928,7 +46928,7 @@ space: { item: leftButtonSpace }, - align: GetValue$P(config, 'align.leftButtons', undefined), + align: GetValue$N(config, 'align.leftButtons', undefined), click: clickConfig, eventEmitter: _this.eventEmitter }); @@ -46938,8 +46938,8 @@ _this.add(leftButtonsSizer, 0, 1, 'top', padding, false); } if (rightButtons) { - var rightButtonsOffset = GetValue$P(config, 'space.rightButtonsOffset', 0); - var rightButtonSpace = GetValue$P(config, 'space.rightButton', 0); + var rightButtonsOffset = GetValue$N(config, 'space.rightButtonsOffset', 0); + var rightButtonSpace = GetValue$N(config, 'space.rightButton', 0); rightButtonsSizer = new Buttons$1(scene, { groupName: 'right', background: rightButtonsBackground, @@ -46949,7 +46949,7 @@ space: { item: rightButtonSpace }, - align: GetValue$P(config, 'align.rightButtons', undefined), + align: GetValue$N(config, 'align.rightButtons', undefined), click: clickConfig, eventEmitter: _this.eventEmitter }); @@ -46959,8 +46959,8 @@ _this.add(rightButtonsSizer, 2, 1, 'top', padding, false); } if (topButtons) { - var toptButtonsOffset = GetValue$P(config, 'space.topButtonsOffset', 0); - var topButtonSpace = GetValue$P(config, 'space.topButton', 0); + var toptButtonsOffset = GetValue$N(config, 'space.topButtonsOffset', 0); + var topButtonSpace = GetValue$N(config, 'space.topButton', 0); topButtonsSizer = new Buttons$1(scene, { groupName: 'top', background: topButtonsBackground, @@ -46970,7 +46970,7 @@ space: { item: topButtonSpace }, - align: GetValue$P(config, 'align.topButtons', undefined), + align: GetValue$N(config, 'align.topButtons', undefined), click: clickConfig, eventEmitter: _this.eventEmitter }); @@ -46980,8 +46980,8 @@ _this.add(topButtonsSizer, 1, 0, 'left', padding, false); } if (bottomButtons) { - var bottomButtonsOffset = GetValue$P(config, 'space.bottomButtonsOffset', 0); - var bottomButtonSpace = GetValue$P(config, 'space.bottomButton', 0); + var bottomButtonsOffset = GetValue$N(config, 'space.bottomButtonsOffset', 0); + var bottomButtonSpace = GetValue$N(config, 'space.bottomButton', 0); bottomButtonsSizer = new Buttons$1(scene, { groupName: 'bottom', background: bottomButtonsBackground, @@ -46991,7 +46991,7 @@ space: { item: bottomButtonSpace }, - align: GetValue$P(config, 'align.bottomButtons', undefined), + align: GetValue$N(config, 'align.bottomButtons', undefined), click: clickConfig, eventEmitter: _this.eventEmitter }); @@ -47224,7 +47224,7 @@ }(); Object.assign(Cell.prototype, DataMethods$2); - var GetValue$O = Phaser.Utils.Objects.GetValue; + var GetValue$M = Phaser.Utils.Objects.GetValue; var SpliceOne = Phaser.Utils.Array.SpliceOne; var Table = /*#__PURE__*/function () { function Table(parent, config) { @@ -47253,8 +47253,8 @@ } this.setDefaultCellHeight(cellHeight); this.setDefaultCellWidth(cellWidth); - this.initCells(GetValue$O(o, 'cellsCount', 0)); - this.setColumnCount(GetValue$O(o, 'columns', 1)); + this.initCells(GetValue$M(o, 'cellsCount', 0)); + this.setColumnCount(GetValue$M(o, 'columns', 1)); return this; } }, { @@ -47797,7 +47797,7 @@ } }; - var GetValue$N = Phaser.Utils.Objects.GetValue; + var GetValue$L = Phaser.Utils.Objects.GetValue; var MASKUPDATEMODE = { update: 0, everyTick: 1 @@ -47808,9 +47808,9 @@ // No children mask return this; } - this.setMaskUpdateMode(GetValue$N(config, 'updateMode', 0)); - this.enableChildrenMask(GetValue$N(config, 'padding', 0)); - this.setMaskLayer(GetValue$N(config, 'layer', undefined)); + this.setMaskUpdateMode(GetValue$L(config, 'updateMode', 0)); + this.enableChildrenMask(GetValue$L(config, 'padding', 0)); + this.setMaskLayer(GetValue$L(config, 'layer', undefined)); this.startMaskUpdate(); return this; }, @@ -48195,7 +48195,7 @@ var Group = Phaser.GameObjects.Group; var Set = Phaser.Structs.Set; - var GetValue$M = Phaser.Utils.Objects.GetValue; + var GetValue$K = Phaser.Utils.Objects.GetValue; var GridTable$1 = /*#__PURE__*/function (_ContainerLite) { _inherits(GridTable, _ContainerLite); var _super = _createSuper(GridTable); @@ -48215,27 +48215,27 @@ _this.execeedBottomState = false; _this.execeedLeftState = false; _this.execeedRightState = false; - var reuseCellContainer = GetValue$M(config, 'reuseCellContainer', false); + var reuseCellContainer = GetValue$K(config, 'reuseCellContainer', false); if (reuseCellContainer) { _this.cellContainersPool = new Group(scene); // Don't add Group into update list, I will destroy it manually } - var callback = GetValue$M(config, 'cellVisibleCallback', null); + var callback = GetValue$K(config, 'cellVisibleCallback', null); if (callback !== null) { - var scope = GetValue$M(config, 'cellVisibleCallbackScope', undefined); + var scope = GetValue$K(config, 'cellVisibleCallbackScope', undefined); _this.on('cellvisible', callback, scope); } - callback = GetValue$M(config, 'cellInvisibleCallback', null); + callback = GetValue$K(config, 'cellInvisibleCallback', null); if (callback !== null) { - var scope = GetValue$M(config, 'cellInvisibleCallbackScope', undefined); + var scope = GetValue$K(config, 'cellInvisibleCallbackScope', undefined); _this.on('cellinvisible', callback, scope); } - if (GetValue$M(config, 'enableLayer', false)) { + if (GetValue$K(config, 'enableLayer', false)) { _this.enableLayer(); } - _this.setupChildrenMask(GetValue$M(config, 'mask', undefined)); - _this.setScrollMode(GetValue$M(config, 'scrollMode', 0)); - _this.setClampMode(GetValue$M(config, 'clamplTableOXY', true)); + _this.setupChildrenMask(GetValue$K(config, 'mask', undefined)); + _this.setScrollMode(GetValue$K(config, 'scrollMode', 0)); + _this.setClampMode(GetValue$K(config, 'clamplTableOXY', true)); // Pre-process cell size var cellWidth, cellHeight, columns; @@ -48249,7 +48249,7 @@ // scroll x cellWidth = config.cellHeight; cellHeight = config.cellWidth; - columns = GetValue$M(config, 'rows', config.columns); + columns = GetValue$K(config, 'rows', config.columns); } if (!columns) { columns = 1; // Default columns @@ -48731,9 +48731,9 @@ EmitCellEvent(this.eventEmitter, 'cell.out', table, cellIndex, undefined, pointer, event); }; - var GetValue$L = Phaser.Utils.Objects.GetValue; + var GetValue$J = Phaser.Utils.Objects.GetValue; var ClickCell = function ClickCell(table, tableConfig) { - var buttonConfig = GetValue$L(tableConfig, 'click', undefined); + var buttonConfig = GetValue$J(tableConfig, 'click', undefined); if (buttonConfig === false) { return; } else if (buttonConfig === undefined) { @@ -48746,9 +48746,9 @@ }, this); }; - var GetValue$K = Phaser.Utils.Objects.GetValue; + var GetValue$I = Phaser.Utils.Objects.GetValue; var TapCell = function TapCell(table, tableConfig) { - var tapConfig = GetValue$K(tableConfig, 'tap', undefined); + var tapConfig = GetValue$I(tableConfig, 'tap', undefined); if (tapConfig === false) { return; } @@ -48759,9 +48759,9 @@ }, this); }; - var GetValue$J = Phaser.Utils.Objects.GetValue; + var GetValue$H = Phaser.Utils.Objects.GetValue; var PressCell = function PressCell(table, tableConfig) { - var pressConfig = GetValue$J(tableConfig, 'press', undefined); + var pressConfig = GetValue$H(tableConfig, 'press', undefined); if (pressConfig === false) { return; } @@ -48773,9 +48773,9 @@ }, this); }; - var GetValue$I = Phaser.Utils.Objects.GetValue; + var GetValue$G = Phaser.Utils.Objects.GetValue; var SwipeCell = function SwipeCell(table, tableConfig) { - var swipeConfig = GetValue$I(tableConfig, 'swipe', undefined); + var swipeConfig = GetValue$G(tableConfig, 'swipe', undefined); if (swipeConfig === false) { return; } else if (swipeConfig === undefined) { @@ -48825,7 +48825,7 @@ } }; - var GetValue$H = Phaser.Utils.Objects.GetValue; + var GetValue$F = Phaser.Utils.Objects.GetValue; var GridTable = /*#__PURE__*/function (_Scrollable) { _inherits(GridTable, _Scrollable); var _super = _createSuper(GridTable); @@ -48838,14 +48838,14 @@ // Create grid table core var scrollMode = GetScrollMode(config); - var tableConfig = GetValue$H(config, 'table', undefined); + var tableConfig = GetValue$F(config, 'table', undefined); if (tableConfig === undefined) { tableConfig = {}; } tableConfig.scrollMode = scrollMode === 2 ? 0 : scrollMode; - tableConfig.clamplTableOXY = GetValue$H(config, 'clamplChildOY', false); - var tableWidth = GetValue$H(tableConfig, 'width', undefined); - var tableHeight = GetValue$H(tableConfig, 'height', undefined); + tableConfig.clamplTableOXY = GetValue$F(config, 'clamplChildOY', false); + var tableWidth = GetValue$F(tableConfig, 'width', undefined); + var tableHeight = GetValue$F(tableConfig, 'height', undefined); var table = new GridTable$1(scene, 0, 0, tableWidth, tableHeight, tableConfig); scene.add.existing(table); // Important: Add to display list for touch detecting var expandWidth, expandHeight; @@ -48869,16 +48869,16 @@ expandWidth: expandWidth, expandHeight: expandHeight }; - var spaceConfig = GetValue$H(config, 'space', undefined); + var spaceConfig = GetValue$F(config, 'space', undefined); if (spaceConfig) { - spaceConfig.child = GetValue$H(spaceConfig, 'table', 0); + spaceConfig.child = GetValue$F(spaceConfig, 'table', 0); } _this = _super.call(this, scene, config); _this.addChildrenMap('table', table); _this.addChildrenMap('tableLayer', table.maskLayer); - _this.eventEmitter = GetValue$H(config, 'eventEmitter', _assertThisInitialized(_this)); - var callback = GetValue$H(config, 'createCellContainerCallback', NOOP); - var scope = GetValue$H(config, 'createCellContainerCallbackScope', undefined); + _this.eventEmitter = GetValue$F(config, 'eventEmitter', _assertThisInitialized(_this)); + var callback = GetValue$F(config, 'createCellContainerCallback', NOOP); + var scope = GetValue$F(config, 'createCellContainerCallbackScope', undefined); _this.setCreateCellContainerCallback(callback, scope); TableOnCellVisible.call(_assertThisInitialized(_this), table); _this.resizeControllerFlag = false; @@ -48886,10 +48886,10 @@ table.on(eventName, function () { this.resizeControllerFlag = true; }, _assertThisInitialized(_this)); - if (GetValue$H(tableConfig, 'interactive', true)) { + if (GetValue$F(tableConfig, 'interactive', true)) { TableSetInteractive.call(_assertThisInitialized(_this), table, tableConfig); } - _this.setItems(GetValue$H(config, 'items', [])); + _this.setItems(GetValue$F(config, 'items', [])); scene.game.events.on('poststep', _this.onPostStep, _assertThisInitialized(_this)); return _this; } @@ -49095,7 +49095,7 @@ return background; }; - var CreateButtons$2 = function CreateButtons(scene, items, callback, scope) { + var CreateButtons$3 = function CreateButtons(scene, items, callback, scope) { var item; var buttons = [], button; @@ -49185,7 +49185,7 @@ } }; - var GetValue$G = Phaser.Utils.Objects.GetValue; + var GetValue$E = Phaser.Utils.Objects.GetValue; var Menu = /*#__PURE__*/function (_Buttons) { _inherits(Menu, _Buttons); var _super = _createSuper(Menu); @@ -49206,17 +49206,17 @@ var parentMenu = config._parentMenu; var parentButton = config._parentButton; // Popup, root menu can be static, sub-menus are always popup. - var popUp = GetValue$G(config, 'popup', true); + var popUp = GetValue$E(config, 'popup', true); // Items - var items = GetValue$G(config, 'items', undefined); + var items = GetValue$E(config, 'items', undefined); // Background - var createBackgroundCallback = GetValue$G(config, 'createBackgroundCallback', undefined); - var createBackgroundCallbackScope = GetValue$G(config, 'createBackgroundCallbackScope', undefined); + var createBackgroundCallback = GetValue$E(config, 'createBackgroundCallback', undefined); + var createBackgroundCallbackScope = GetValue$E(config, 'createBackgroundCallbackScope', undefined); config.background = CreateBackground$1(scene, items, createBackgroundCallback, createBackgroundCallbackScope); // Buttons - var createButtonCallback = GetValue$G(config, 'createButtonCallback', undefined); - var createButtonCallbackScope = GetValue$G(config, 'createButtonCallbackScope', undefined); - config.buttons = CreateButtons$2(scene, items, createButtonCallback, createButtonCallbackScope); + var createButtonCallback = GetValue$E(config, 'createButtonCallback', undefined); + var createButtonCallbackScope = GetValue$E(config, 'createButtonCallbackScope', undefined); + config.buttons = CreateButtons$3(scene, items, createButtonCallback, createButtonCallbackScope); _this = _super.call(this, scene, config); _this.type = 'rexMenu'; _this.items = items; @@ -49239,7 +49239,7 @@ // Side of submenu _this.subMenuSide = [_this.y < bounds.centerY ? SUBMENU_DOWN : SUBMENU_UP, _this.x < bounds.centerX ? SUBMENU_RIGHT : SUBMENU_LEFT]; // Overwrite subMenuSide value if given - var subMenuSide = GetValue$G(config, 'subMenuSide', undefined); + var subMenuSide = GetValue$E(config, 'subMenuSide', undefined); if (subMenuSide !== undefined) { if (typeof subMenuSide === 'string') { subMenuSide = SubMenuSideMode[subMenuSide]; @@ -49247,26 +49247,26 @@ _this.subMenuSide[_this.orientation] = subMenuSide; } // ToggleOrientation mode - _this.toggleOrientation = GetValue$G(config, 'toggleOrientation', false); + _this.toggleOrientation = GetValue$E(config, 'toggleOrientation', false); // Expand mode - _this.expandEventName = GetValue$G(config, 'expandEvent', 'button.click'); + _this.expandEventName = GetValue$E(config, 'expandEvent', 'button.click'); // Transition - _this.easeIn = ParseEaseConfig(_assertThisInitialized(_this), GetValue$G(config, 'easeIn', 0)); - _this.easeOut = ParseEaseConfig(_assertThisInitialized(_this), GetValue$G(config, 'easeOut', 0)); - _this.setTransitInCallback(GetValue$G(config, 'transitIn')); - _this.setTransitOutCallback(GetValue$G(config, 'transitOut')); + _this.easeIn = ParseEaseConfig(_assertThisInitialized(_this), GetValue$E(config, 'easeIn', 0)); + _this.easeOut = ParseEaseConfig(_assertThisInitialized(_this), GetValue$E(config, 'easeOut', 0)); + _this.setTransitInCallback(GetValue$E(config, 'transitIn')); + _this.setTransitOutCallback(GetValue$E(config, 'transitOut')); // Callbacks _this.createBackgroundCallback = createBackgroundCallback; _this.createBackgroundCallbackScope = createBackgroundCallbackScope; _this.createButtonCallback = createButtonCallback; _this.createButtonCallbackScope = createButtonCallbackScope; // Children key - _this.childrenKey = GetValue$G(config, 'childrenKey', 'children'); + _this.childrenKey = GetValue$E(config, 'childrenKey', 'children'); // Event flag _this._isPassedEvent = false; // pointerdown-outside-collapse - _this.pointerDownOutsideCollapsing = GetValue$G(config, 'pointerDownOutsideCollapsing', true); + _this.pointerDownOutsideCollapsing = GetValue$E(config, 'pointerDownOutsideCollapsing', true); if (_this.pointerDownOutsideCollapsing) { scene.input.on('pointerdown', _this.onPointerDownOutside, _assertThisInitialized(_this)); } @@ -49567,29 +49567,29 @@ var GetValueFromAliasKeys = function GetValueFromAliasKeys(source, key0, key1, key2, defaultValue) { if (HasValue(source, key0)) { - return GetValue$2W(source, key0); + return GetValue$2U(source, key0); } else if (key1 && HasValue(source, key1)) { - return GetValue$2W(source, key1); + return GetValue$2U(source, key1); } else if (key2 && HasValue(source, key2)) { - return GetValue$2W(source, key2); + return GetValue$2U(source, key2); } else { return defaultValue; } }; - var GetValue$F = Phaser.Utils.Objects.GetValue; + var GetValue$D = Phaser.Utils.Objects.GetValue; var SetPosition = function SetPosition(gameObject, config) { - var expandDirection = GetValue$F(config, 'expandDirection', undefined); + var expandDirection = GetValue$D(config, 'expandDirection', undefined); if (typeof expandDirection === 'string') { expandDirection = ExpandDirections[expandDirection]; } var alignTargetX = GetValueFromAliasKeys(config, 'alignTarget', 'alignTargetX'); - var alignTargetY = GetValue$F(config, 'alignTargetY', alignTargetX); - var alignOffsetX = GetValue$F(config, 'alignOffsetX', 0); - var alignOffsetY = GetValue$F(config, 'alignOffsetY', 0); - var alignSide = GetValue$F(config, 'alignSide', ''); + var alignTargetY = GetValue$D(config, 'alignTargetY', alignTargetX); + var alignOffsetX = GetValue$D(config, 'alignOffsetX', 0); + var alignOffsetY = GetValue$D(config, 'alignOffsetY', 0); + var alignSide = GetValue$D(config, 'alignSide', ''); var alignRight = alignSide.includes('right'); - var positionBounds = GetValue$F(config, 'bounds'); + var positionBounds = GetValue$D(config, 'bounds'); // Expand direction var isExpandDown = expandDirection === 0; @@ -49621,7 +49621,7 @@ up: 1 }; - var GetValue$E = Phaser.Utils.Objects.GetValue; + var GetValue$C = Phaser.Utils.Objects.GetValue; var DropDown = /*#__PURE__*/function (_OpenCloseTransition) { _inherits(DropDown, _OpenCloseTransition); var _super = _createSuper(DropDown); @@ -49655,8 +49655,8 @@ } // Close conditions: - var touchOutsideClose = GetValue$E(config, 'touchOutsideClose', false); - var anyTouchClose = GetValue$E(config, 'anyTouchClose', false); + var touchOutsideClose = GetValue$C(config, 'touchOutsideClose', false); + var anyTouchClose = GetValue$C(config, 'anyTouchClose', false); if (anyTouchClose) { touchOutsideClose = false; } @@ -49803,7 +49803,7 @@ }; Object.assign(Methods$3, methods$8); - var GetValue$D = Phaser.Utils.Objects.GetValue; + var GetValue$B = Phaser.Utils.Objects.GetValue; var DropDownList = /*#__PURE__*/function (_Label) { _inherits(DropDownList, _Label); var _super = _createSuper(DropDownList); @@ -49813,27 +49813,27 @@ _this = _super.call(this, scene, config); _this.type = 'rexDropDownList'; _this.timer = undefined; - _this.setOptions(GetValue$D(config, 'options')); - var listConfig = GetValue$D(config, 'list'); - _this.setWrapEnable(GetValue$D(listConfig, 'wrap', false)); - _this.setCreateButtonCallback(GetValue$D(listConfig, 'createButtonCallback')); - _this.setCreateListBackgroundCallback(GetValue$D(listConfig, 'createBackgroundCallback')); - _this.setButtonClickCallback(GetValue$D(listConfig, 'onButtonClick')); - _this.setButtonOverCallback(GetValue$D(listConfig, 'onButtonOver')); - _this.setButtonOutCallback(GetValue$D(listConfig, 'onButtonOut')); - _this.setListExpandDirection(GetValue$D(listConfig, 'expandDirection')); - _this.setListEaseInDuration(GetValue$D(listConfig, 'easeIn', 500)); - _this.setListEaseOutDuration(GetValue$D(listConfig, 'easeOut', 100)); - _this.setListTransitInCallback(GetValue$D(listConfig, 'transitIn')); - _this.settListTransitOutCallback(GetValue$D(listConfig, 'transitOut')); - _this.setListSize(GetValue$D(listConfig, 'width'), GetValue$D(listConfig, 'height')); - _this.setListAlignmentMode(GetValue$D(listConfig, 'alignParent', 'text')); - _this.setListAlignmentSide(GetValue$D(listConfig, 'alignSide', '')); - _this.setListBounds(GetValue$D(listConfig, 'bounds')); - _this.setListSpace(GetValue$D(listConfig, 'space')); - _this.setListDraggable(GetValue$D(listConfig, 'draggable', false)); - _this.setValueChangeCallback(GetValue$D(config, 'setValueCallback'), GetValue$D(config, 'setValueCallbackScope')); - _this.setValue(GetValue$D(config, 'value')); + _this.setOptions(GetValue$B(config, 'options')); + var listConfig = GetValue$B(config, 'list'); + _this.setWrapEnable(GetValue$B(listConfig, 'wrap', false)); + _this.setCreateButtonCallback(GetValue$B(listConfig, 'createButtonCallback')); + _this.setCreateListBackgroundCallback(GetValue$B(listConfig, 'createBackgroundCallback')); + _this.setButtonClickCallback(GetValue$B(listConfig, 'onButtonClick')); + _this.setButtonOverCallback(GetValue$B(listConfig, 'onButtonOver')); + _this.setButtonOutCallback(GetValue$B(listConfig, 'onButtonOut')); + _this.setListExpandDirection(GetValue$B(listConfig, 'expandDirection')); + _this.setListEaseInDuration(GetValue$B(listConfig, 'easeIn', 500)); + _this.setListEaseOutDuration(GetValue$B(listConfig, 'easeOut', 100)); + _this.setListTransitInCallback(GetValue$B(listConfig, 'transitIn')); + _this.settListTransitOutCallback(GetValue$B(listConfig, 'transitOut')); + _this.setListSize(GetValue$B(listConfig, 'width'), GetValue$B(listConfig, 'height')); + _this.setListAlignmentMode(GetValue$B(listConfig, 'alignParent', 'text')); + _this.setListAlignmentSide(GetValue$B(listConfig, 'alignSide', '')); + _this.setListBounds(GetValue$B(listConfig, 'bounds')); + _this.setListSpace(GetValue$B(listConfig, 'space')); + _this.setListDraggable(GetValue$B(listConfig, 'draggable', false)); + _this.setValueChangeCallback(GetValue$B(config, 'setValueCallback'), GetValue$B(config, 'setValueCallbackScope')); + _this.setValue(GetValue$B(config, 'value')); _this.onClick(_this.toggleListPanel, _assertThisInitialized(_this)); return _this; } @@ -50116,7 +50116,7 @@ }; Object.assign(Methods$2, SetContentMethods, GetPageMethods, ShowMethods); - var GetValue$C = Phaser.Utils.Objects.GetValue; + var GetValue$A = Phaser.Utils.Objects.GetValue; var Clamp$2 = Phaser.Math.Clamp; var TextPage = /*#__PURE__*/function (_ComponentBase) { _inherits(TextPage, _ComponentBase); @@ -50144,11 +50144,11 @@ _createClass(TextPage, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.setMaxLines(GetValue$C(o, 'maxLines', undefined)); - this.setPageBreak(GetValue$C(o, 'pageBreak', '\f\n')); - this.setText(GetValue$C(o, 'text', '')); - this.setStartLineIndex(GetValue$C(o, 'start', 0)); - this.setPageIndex(GetValue$C(o, 'page', -1)); + this.setMaxLines(GetValue$A(o, 'maxLines', undefined)); + this.setPageBreak(GetValue$A(o, 'pageBreak', '\f\n')); + this.setText(GetValue$A(o, 'text', '')); + this.setStartLineIndex(GetValue$A(o, 'start', 0)); + this.setPageIndex(GetValue$A(o, 'page', -1)); return this; } }, { @@ -50346,7 +50346,7 @@ }; Object.assign(methods$7, AddChildMethods); - var GetValue$B = Phaser.Utils.Objects.GetValue; + var GetValue$z = Phaser.Utils.Objects.GetValue; var Pages = /*#__PURE__*/function (_OverlapSizer) { _inherits(Pages, _OverlapSizer); var _super = _createSuper(Pages); @@ -50358,8 +50358,8 @@ _this.childrenMap = _this.sizerChildren; _this._previousKey = undefined; _this._currentKey = undefined; - _this.setSwapMode(GetValue$B(config, 'swapMode', 0)); - _this.setFadeInDuration(GetValue$B(config, 'fadeIn', 0)); + _this.setSwapMode(GetValue$z(config, 'swapMode', 0)); + _this.setFadeInDuration(GetValue$z(config, 'fadeIn', 0)); return _this; } _createClass(Pages, [{ @@ -50492,7 +50492,7 @@ }; var IsPlainObject$6 = Phaser.Utils.Objects.IsPlainObject; - var GetValue$A = Phaser.Utils.Objects.GetValue; + var GetValue$y = Phaser.Utils.Objects.GetValue; var GenerateGridVerts = Phaser.Geom.Mesh.GenerateGridVerts; var RadToDeg$1 = Phaser.Math.RadToDeg; var DegToRad$2 = Phaser.Math.DegToRad; @@ -50506,19 +50506,19 @@ _classCallCheck(this, Image); if (IsPlainObject$6(x)) { config = x; - x = GetValue$A(config, 'x', 0); - y = GetValue$A(config, 'y', 0); - key = GetValue$A(config, 'key', null); - frame = GetValue$A(config, 'frame', null); + x = GetValue$y(config, 'x', 0); + y = GetValue$y(config, 'y', 0); + key = GetValue$y(config, 'key', null); + frame = GetValue$y(config, 'frame', null); } _this = _super.call(this, scene, x, y, key, frame); _this.type = 'rexPerspectiveImage'; _this.setSizeToFrame(); _this.resetPerspective(); _this.panZ(PanZ); - _this.hideCCW = GetValue$A(config, 'hideCCW', true); - var gridWidth = GetValue$A(config, 'gridWidth', 0); - var gridHeight = GetValue$A(config, 'gridHeight', gridWidth); + _this.hideCCW = GetValue$y(config, 'hideCCW', true); + var gridWidth = GetValue$y(config, 'gridWidth', 0); + var gridHeight = GetValue$y(config, 'gridHeight', gridWidth); _this.resetVerts(gridWidth, gridHeight); _this.prevFrame = _this.frame; return _this; @@ -50700,7 +50700,7 @@ }; var IsPlainObject$5 = Phaser.Utils.Objects.IsPlainObject; - var GetValue$z = Phaser.Utils.Objects.GetValue; + var GetValue$x = Phaser.Utils.Objects.GetValue; var RenderTexture = /*#__PURE__*/function (_Image) { _inherits(RenderTexture, _Image); var _super = _createSuper(RenderTexture); @@ -50709,10 +50709,10 @@ _classCallCheck(this, RenderTexture); if (IsPlainObject$5(x)) { config = x; - x = GetValue$z(config, 'x', 0); - y = GetValue$z(config, 'y', 0); - width = GetValue$z(config, 'width', 32); - height = GetValue$z(config, 'height', 32); + x = GetValue$x(config, 'x', 0); + y = GetValue$x(config, 'y', 0); + width = GetValue$x(config, 'width', 32); + height = GetValue$x(config, 'height', 32); } // dynamic-texture -> quad-image @@ -51021,7 +51021,7 @@ } }; - var GetValue$y = Phaser.Utils.Objects.GetValue; + var GetValue$w = Phaser.Utils.Objects.GetValue; var Linear$1 = Phaser.Math.Linear; var Flip = /*#__PURE__*/function (_EaseValueTaskBase) { _inherits(Flip, _EaseValueTaskBase); @@ -51041,9 +51041,9 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Flip.prototype), "resetFromJSON", this).call(this, o); - this.setEase(GetValue$y(o, 'ease', 'Cubic')); - this.setFrontToBackDirection(GetValue$y(o, 'frontToBack', 0)); - this.setBackToFrontDirection(GetValue$y(o, 'backToFront', 1)); + this.setEase(GetValue$w(o, 'ease', 'Cubic')); + this.setFrontToBackDirection(GetValue$w(o, 'frontToBack', 0)); + this.setBackToFrontDirection(GetValue$w(o, 'backToFront', 1)); return this; } }, { @@ -51151,7 +51151,7 @@ }; var IsPlainObject$3 = Phaser.Utils.Objects.IsPlainObject; - var GetValue$x = Phaser.Utils.Objects.GetValue; + var GetValue$v = Phaser.Utils.Objects.GetValue; var FaceNames = ['back', 'front']; var Card = /*#__PURE__*/function (_FaceContainer) { _inherits(Card, _FaceContainer); @@ -51161,14 +51161,14 @@ _classCallCheck(this, Card); if (IsPlainObject$3(x)) { config = x; - x = GetValue$x(config, 'x', 0); - y = GetValue$x(config, 'y', 0); + x = GetValue$v(config, 'x', 0); + y = GetValue$v(config, 'y', 0); } var faces = CreateFaces(scene, config, FaceNames); var backFace = faces.back; var frontFace = faces.front; - var width = GetValue$x(config, 'width'); - var height = GetValue$x(config, 'height'); + var width = GetValue$v(config, 'width'); + var height = GetValue$v(config, 'height'); if (width === undefined || height === undefined) { if (width === undefined) { var frontFaceWidth = frontFace ? frontFace.width : 0; @@ -51189,13 +51189,13 @@ ForEachFace(faces, function (face, name) { this["".concat(name, "Face")] = face; }, _assertThisInitialized(_this)); - var flipConfig = GetValue$x(config, 'flip', undefined); + var flipConfig = GetValue$v(config, 'flip', undefined); if (flipConfig !== false) { _this.flip = new Flip(_assertThisInitialized(_this), flipConfig); } - _this.setOrientation(GetValue$x(config, 'orientation', 0)); + _this.setOrientation(GetValue$v(config, 'orientation', 0)); LayoutFaces(_assertThisInitialized(_this), faces); - _this.setFace(GetValue$x(config, 'face', 0)); + _this.setFace(GetValue$v(config, 'face', 0)); return _this; } _createClass(Card, [{ @@ -51320,10 +51320,10 @@ Phaser.Utils.Objects.GetValue; - var GetValue$w = Phaser.Utils.Objects.GetValue; + var GetValue$u = Phaser.Utils.Objects.GetValue; var CreatePerspectiveCardMesh = function CreatePerspectiveCardMesh(config) { var scene = this.scene; - this.setSnapshotPadding(GetValue$w(config, 'snapshotPadding', 0)); + this.setSnapshotPadding(GetValue$u(config, 'snapshotPadding', 0)); config = Clone$1(config); // Remove size config delete config.width; @@ -51408,7 +51408,7 @@ } }; - var GetValue$v = Phaser.Utils.Objects.GetValue; + var GetValue$t = Phaser.Utils.Objects.GetValue; var PerspectiveCard = /*#__PURE__*/function (_OverlapSizer) { _inherits(PerspectiveCard, _OverlapSizer); var _super = _createSuper(PerspectiveCard); @@ -51420,13 +51420,13 @@ // Layout faces var backFace = config.back; - var backFaceExpand = GetValue$v(config, 'expand.back', true); + var backFaceExpand = GetValue$t(config, 'expand.back', true); _this.add(backFace, { key: 'back', expand: backFaceExpand }); var frontFace = config.front; - var frontFaceExpand = GetValue$v(config, 'expand.front', true); + var frontFaceExpand = GetValue$t(config, 'expand.front', true); _this.add(frontFace, { key: 'front', expand: frontFaceExpand @@ -51591,14 +51591,14 @@ }; var IsPlainObject$2 = Phaser.Utils.Objects.IsPlainObject; - var GetValue$u = Phaser.Utils.Objects.GetValue; + var GetValue$s = Phaser.Utils.Objects.GetValue; var UUID = Phaser.Utils.String.UUID; var AddPage = function AddPage(key, tabGameObject, pageGameObject) { if (IsPlainObject$2(key)) { var config = key; - key = GetValue$u(config, 'key'); - tabGameObject = GetValue$u(config, 'tab'); - pageGameObject = GetValue$u(config, 'page'); + key = GetValue$s(config, 'key'); + tabGameObject = GetValue$s(config, 'tab'); + pageGameObject = GetValue$s(config, 'page'); } if (!key) { key = UUID(); @@ -51696,7 +51696,7 @@ }; Object.assign(methods$6, SwapPageMethods, RemovePageMethods); - var GetValue$t = Phaser.Utils.Objects.GetValue; + var GetValue$r = Phaser.Utils.Objects.GetValue; var SizerAdd = Sizer.prototype.add; var TabPages$1 = /*#__PURE__*/function (_Sizer) { _inherits(TabPages, _Sizer); @@ -51707,23 +51707,23 @@ if (config === undefined) { config = {}; } - var tabsPosition = GetValue$t(config, 'tabPosition', 'top'); + var tabsPosition = GetValue$r(config, 'tabPosition', 'top'); var sizerOrientation = tabsPosition === 'left' || tabsPosition === 'right' ? 'x' : 'y'; config.orientation = sizerOrientation; _this = _super.call(this, scene, config); _this.type = 'rexTabPages'; // Add elements - var background = GetValue$t(config, 'background', undefined); + var background = GetValue$r(config, 'background', undefined); if (background) { _this.addBackground(background); } - var pagesConfig = GetValue$t(config, 'pages'); + var pagesConfig = GetValue$r(config, 'pages'); var pages = new Pages(scene, pagesConfig); scene.add.existing(pages); var isHorizontalTabs = sizerOrientation === 'y'; - var wrapTabs = isHorizontalTabs ? GetValue$t(config, 'wrapTabs', false) : false; - var tabsConfig = GetValue$t(config, 'tabs', undefined); + var wrapTabs = isHorizontalTabs ? GetValue$r(config, 'wrapTabs', false) : false; + var tabsConfig = GetValue$r(config, 'tabs', undefined); if (tabsConfig === undefined) { tabsConfig = {}; } @@ -51732,8 +51732,8 @@ tabsConfig.buttonsType = 'radio'; var tabs = new ButtonsClass(scene, tabsConfig); scene.add.existing(tabs); - var tabsExpand = wrapTabs ? true : GetValue$t(config, 'expand.tabs', false); - var tabAlign = GetValue$t(config, 'align.tabs', 'left'); + var tabsExpand = wrapTabs ? true : GetValue$r(config, 'expand.tabs', false); + var tabAlign = GetValue$r(config, 'align.tabs', 'left'); switch (tabsPosition) { case 'top': case 'left': @@ -51919,7 +51919,7 @@ } }; - var GetValue$s = Phaser.Utils.Objects.GetValue; + var GetValue$q = Phaser.Utils.Objects.GetValue; var Folder$1 = /*#__PURE__*/function (_Sizer) { _inherits(Folder, _Sizer); var _super = _createSuper(Folder); @@ -51947,15 +51947,15 @@ // title var defaultAlign = _this.orientation === 1 ? 'left' : 'top'; - var align = GetValue$s(config, 'align.title', defaultAlign); - var expand = GetValue$s(config, 'expand.title', true); + var align = GetValue$q(config, 'align.title', defaultAlign); + var expand = GetValue$q(config, 'expand.title', true); _this.add(title, { proportion: 0, align: align, expand: expand }); - var toggleByTarget = GetValue$s(config, 'toggleByTarget', undefined); - var toggleClickConfig = GetValue$s(config, 'toggleClickConfig'); + var toggleByTarget = GetValue$q(config, 'toggleByTarget', undefined); + var toggleClickConfig = GetValue$q(config, 'toggleClickConfig'); if (toggleByTarget === undefined) { toggleByTarget = title; } @@ -51967,13 +51967,13 @@ // child _this.childTransition = new Transition(child); - var customOrigin = GetValue$s(config, 'customChildOrigin', false); + var customOrigin = GetValue$q(config, 'customChildOrigin', false); if (!customOrigin) { var origin = !_this.rtl ? 0 : 1; child.setOrigin(origin); } - var align = GetValue$s(config, 'align.child', 'left'); - var expand = GetValue$s(config, 'expand.child', true); + var align = GetValue$q(config, 'align.child', 'left'); + var expand = GetValue$q(config, 'expand.child', true); var proportion = expand ? 1 : 0; _this.add(child, { proportion: proportion, @@ -51984,10 +51984,10 @@ _this.addChildrenMap('child', child); _this.addChildrenMap('background', background); var transitionConfig = config.transition; - _this.setTransitionDuration(GetValue$s(transitionConfig, 'duration', 200)); - _this.setExpandCallback(GetValue$s(transitionConfig, 'expandCallback', undefined)); - _this.setCollapseCallback(GetValue$s(transitionConfig, 'collapseCallback', undefined)); - _this.reLayoutTarget = GetValue$s(config, 'reLayoutTarget', undefined); + _this.setTransitionDuration(GetValue$q(transitionConfig, 'duration', 200)); + _this.setExpandCallback(GetValue$q(transitionConfig, 'expandCallback', undefined)); + _this.setCollapseCallback(GetValue$q(transitionConfig, 'collapseCallback', undefined)); + _this.reLayoutTarget = GetValue$q(config, 'reLayoutTarget', undefined); var onExpandStart = config.onExpandStart; if (onExpandStart) { _this.on('expand.start', onExpandStart); @@ -52069,8 +52069,8 @@ } }; - var GetValue$r = Phaser.Utils.Objects.GetValue; - var TextAreaInput$1 = /*#__PURE__*/function (_Scrollable) { + var GetValue$p = Phaser.Utils.Objects.GetValue; + var TextAreaInput = /*#__PURE__*/function (_Scrollable) { _inherits(TextAreaInput, _Scrollable); var _super = _createSuper(TextAreaInput); function TextAreaInput(scene, config) { @@ -52081,7 +52081,7 @@ } // Create inputText - var inputTextConfig = GetValue$r(config, 'text'); + var inputTextConfig = GetValue$p(config, 'text'); var inputText; if (IsGameObject(inputTextConfig)) { inputText = inputTextConfig; @@ -52113,9 +52113,9 @@ expandWidth: expandInputTextWidth, expandHeight: expandInputTextHeight }; - var spaceConfig = GetValue$r(config, 'space', undefined); + var spaceConfig = GetValue$p(config, 'space', undefined); if (spaceConfig) { - spaceConfig.child = GetValue$r(spaceConfig, 'text', 0); + spaceConfig.child = GetValue$p(spaceConfig, 'text', 0); } config.scroller = false; // No scroller supported _this = _super.call(this, scene, config); @@ -52146,7 +52146,7 @@ }, _assertThisInitialized(_this)); // Set initial text if given - var content = GetValue$r(config, 'content', undefined); + var content = GetValue$p(config, 'content', undefined); if (content) { _this.setText(content); } @@ -52200,7 +52200,7 @@ }]); return TextAreaInput; }(Scrollable); - Object.assign(TextAreaInput$1.prototype, SetTextMethods, ScrollMethods); + Object.assign(TextAreaInput.prototype, SetTextMethods, ScrollMethods); var GetChildrenWidth = function GetChildrenWidth() { if (this.rexSizer.hidden) { @@ -52332,7 +52332,7 @@ Object.assign(methods$5, ChildrenMaskMethods); var IsPlainObject$1 = Phaser.Utils.Objects.IsPlainObject; - var GetValue$q = Phaser.Utils.Objects.GetValue; + var GetValue$o = Phaser.Utils.Objects.GetValue; var ALIGN_LEFTTOP = Phaser.Display.Align.TOP_LEFT; var ScrollableBlock = /*#__PURE__*/function (_BaseSizer) { _inherits(ScrollableBlock, _BaseSizer); @@ -52342,14 +52342,14 @@ _classCallCheck(this, ScrollableBlock); if (IsPlainObject$1(x)) { config = x; - x = GetValue$q(config, 'x', 0); - y = GetValue$q(config, 'y', 0); - minWidth = GetValue$q(config, 'width', undefined); - minHeight = GetValue$q(config, 'height', undefined); + x = GetValue$o(config, 'x', 0); + y = GetValue$o(config, 'y', 0); + minWidth = GetValue$o(config, 'width', undefined); + minHeight = GetValue$o(config, 'height', undefined); } else if (IsPlainObject$1(minWidth)) { config = minWidth; - minWidth = GetValue$q(config, 'width', undefined); - minHeight = GetValue$q(config, 'height', undefined); + minWidth = GetValue$o(config, 'width', undefined); + minHeight = GetValue$o(config, 'height', undefined); } _this = _super.call(this, scene, x, y, minWidth, minHeight, config); _this.type = 'rexScrollableBlock'; @@ -52361,15 +52361,15 @@ _this.execeedBottomState = false; _this.execeedLeftState = false; _this.execeedRightState = false; - _this.setScrollMode(GetValue$q(config, 'scrollMode', 0)); - var clampChildOY = GetValue$q(config, 'clamplChildOY', true); - var clampChildOX = GetValue$q(config, 'clamplChildOX', clampChildOY); + _this.setScrollMode(GetValue$o(config, 'scrollMode', 0)); + var clampChildOY = GetValue$o(config, 'clamplChildOY', true); + var clampChildOX = GetValue$o(config, 'clamplChildOX', clampChildOY); _this.setClampMode(clampChildOY, clampChildOX); // Add elements // No background object, and child does not have padding - var child = GetValue$q(config, 'child', undefined); - var expand = GetValue$q(config, 'expand', true); + var child = GetValue$o(config, 'child', undefined); + var expand = GetValue$o(config, 'expand', true); if (child.setOrigin) { child.setOrigin(0); } @@ -52381,7 +52381,7 @@ _this.child = child; // Create mask of child object - _this.setupChildrenMask(GetValue$q(config, 'mask', undefined)); + _this.setupChildrenMask(GetValue$o(config, 'mask', undefined)); if (_this.childrenMask) { _this.maskGameObject = MaskToGameObject(_this.childrenMask); } @@ -52758,7 +52758,7 @@ } }; - var GetValue$p = Phaser.Utils.Objects.GetValue; + var GetValue$n = Phaser.Utils.Objects.GetValue; var ScrollablePanel = /*#__PURE__*/function (_Scrollable) { _inherits(ScrollablePanel, _Scrollable); var _super = _createSuper(ScrollablePanel); @@ -52771,25 +52771,25 @@ // Create scrollable-block var scrollMode = GetScrollMode(config); - var panelConfig = GetValue$p(config, 'panel', undefined); + var panelConfig = GetValue$n(config, 'panel', undefined); if (panelConfig === undefined) { panelConfig = {}; } panelConfig.scrollMode = scrollMode; - panelConfig.clamplChildOY = GetValue$p(config, 'clamplChildOY', false); - panelConfig.clamplChildOX = GetValue$p(config, 'clamplChildOX', false); + panelConfig.clamplChildOY = GetValue$n(config, 'clamplChildOY', false); + panelConfig.clamplChildOX = GetValue$n(config, 'clamplChildOX', false); var scrollableBlock = new ScrollableBlock(scene, panelConfig); scene.add.existing(scrollableBlock); // Important: Add to display list for touch detecting var expandPanelWidth, expandPanelHeight; switch (scrollMode) { case 0: - expandPanelWidth = GetValue$p(config, 'expand.panel', true); + expandPanelWidth = GetValue$n(config, 'expand.panel', true); expandPanelHeight = true; break; case 1: expandPanelWidth = true; - expandPanelHeight = GetValue$p(config, 'expand.panel', true); + expandPanelHeight = GetValue$n(config, 'expand.panel', true); break; default: // 2 @@ -52803,11 +52803,11 @@ gameObject: scrollableBlock, expandWidth: expandPanelWidth, expandHeight: expandPanelHeight, - align: GetValue$p(config, 'align.panel', 'center') + align: GetValue$n(config, 'align.panel', 'center') }; - var spaceConfig = GetValue$p(config, 'space', undefined); + var spaceConfig = GetValue$n(config, 'space', undefined); if (spaceConfig) { - spaceConfig.child = GetValue$p(spaceConfig, 'panel', 0); + spaceConfig.child = GetValue$n(spaceConfig, 'panel', 0); } _this = _super.call(this, scene, config); _this.addChildrenMap('panel', scrollableBlock.child); @@ -52857,7 +52857,7 @@ return inputText; }; - var GetValue$o = Phaser.Utils.Objects.GetValue; + var GetValue$m = Phaser.Utils.Objects.GetValue; var Color$3 = Phaser.Display.Color; var ColorToRGBA$2 = Phaser.Display.Color.ColorToRGBA; var HSVToRGB$2 = Phaser.Display.Color.HSVToRGB; @@ -52877,8 +52877,8 @@ _this.colorObject = new Color$3(); // Add elements - var background = GetValue$o(config, 'background', undefined); - var formatLabel = GetValue$o(config, 'formatLabel', undefined); + var background = GetValue$m(config, 'background', undefined); + var formatLabel = GetValue$m(config, 'formatLabel', undefined); if (!IsGameObject(formatLabel)) { formatLabel = CreateLabel(scene, formatLabel).resetDisplayContent(); } @@ -52888,7 +52888,7 @@ components.push(config.inputText1); components.push(config.inputText2); } else { - var inputTextConfig = GetValue$o(config, 'inputText'); + var inputTextConfig = GetValue$m(config, 'inputText'); for (var i = 0; i < 3; i++) { var inputText = CreateInputText$1(scene, inputTextConfig).setMaxLength(3).setNumberInput(); components.push(inputText); @@ -52897,15 +52897,15 @@ if (background) { _this.addBackground(background); } - var proportion = GetValue$o(config, 'proportion.formatLabel', 0); + var proportion = GetValue$m(config, 'proportion.formatLabel', 0); var defaultExpand = formatLabel.isRexContainerLite ? true : false; - var expand = GetValue$o(config, 'expand.formatLabel', defaultExpand); + var expand = GetValue$m(config, 'expand.formatLabel', defaultExpand); _this.add(formatLabel, { proportion: proportion, expand: expand }); - var proportion = GetValue$o(inputTextConfig, 'width') === undefined ? 1 : 0; - var expand = GetValue$o(inputTextConfig, 'height') === undefined ? true : false; + var proportion = GetValue$m(inputTextConfig, 'width') === undefined ? 1 : 0; + var expand = GetValue$m(inputTextConfig, 'height') === undefined ? true : false; for (var i = 0, cnt = components.length; i < cnt; i++) { _this.add(components[i], { proportion: proportion, @@ -52922,13 +52922,13 @@ this.setValue(this.colorObject.color); }, _assertThisInitialized(_this)); } - var callback = GetValue$o(config, 'valuechangeCallback', null); + var callback = GetValue$m(config, 'valuechangeCallback', null); if (callback !== null) { - var scope = GetValue$o(config, 'valuechangeCallbackScope', undefined); + var scope = GetValue$m(config, 'valuechangeCallbackScope', undefined); _this.on('valuechange', callback, scope); } formatLabel.setText('RGB'); - _this.setValue(GetValue$o(config, 'value', 0xffffff)); + _this.setValue(GetValue$m(config, 'value', 0xffffff)); return _this; } _createClass(ColorComponents, [{ @@ -53095,10 +53095,10 @@ } }; - var GetValue$n = Phaser.Utils.Objects.GetValue; + var GetValue$l = Phaser.Utils.Objects.GetValue; var IsPlainObject = Phaser.Utils.Objects.IsPlainObject; var Clamp = Phaser.Math.Clamp; - var ColorInput$2 = /*#__PURE__*/function (_Sizer) { + var ColorInput$1 = /*#__PURE__*/function (_Sizer) { _inherits(ColorInput, _Sizer); var _super = _createSuper(ColorInput); function ColorInput(scene, config) { @@ -53112,14 +53112,14 @@ _this.type = 'rexColorInputLite'; // Add elements - var background = GetValue$n(config, 'background', undefined); - var swatchConfig = GetValue$n(config, 'swatch'); + var background = GetValue$l(config, 'background', undefined); + var swatchConfig = GetValue$l(config, 'swatch'); var swatchSize; if (IsPlainObject(swatchConfig)) { - swatchSize = GetValue$n(swatchConfig, 'size'); + swatchSize = GetValue$l(swatchConfig, 'size'); } - var swatch = CreateSwatch(scene, GetValue$n(config, 'swatch')); - var inputTextConfig = GetValue$n(config, 'inputText', true); + var swatch = CreateSwatch(scene, GetValue$l(config, 'swatch')); + var inputTextConfig = GetValue$l(config, 'inputText', true); var inputText; if (inputTextConfig) { inputText = CreateInputText$1(scene, inputTextConfig); @@ -53128,13 +53128,13 @@ _this.addBackground(background); } if (swatch) { - swatchSize = GetValue$n(config, 'swatchSize', swatchSize); + swatchSize = GetValue$l(config, 'swatchSize', swatchSize); var squareExpandSwatch; if (swatchSize !== undefined) { ResizeGameObject(swatch, swatchSize, swatchSize); squareExpandSwatch = false; } else { - squareExpandSwatch = GetValue$n(config, 'squareExpandSwatch', true); + squareExpandSwatch = GetValue$l(config, 'squareExpandSwatch', true); } var fitRatio = squareExpandSwatch ? 1 : 0; _this.add(swatch, { @@ -53144,8 +53144,8 @@ }); } if (inputText) { - var proportion = GetValue$n(inputTextConfig, 'width') === undefined ? 1 : 0; - var expand = GetValue$n(inputTextConfig, 'height') === undefined ? true : false; + var proportion = GetValue$l(inputTextConfig, 'width') === undefined ? 1 : 0; + var expand = GetValue$l(inputTextConfig, 'height') === undefined ? true : false; _this.add(inputText, { proportion: proportion, expand: expand @@ -53159,12 +53159,12 @@ this.setValue(inputText.value); }, _assertThisInitialized(_this)); } - var callback = GetValue$n(config, 'valuechangeCallback', null); + var callback = GetValue$l(config, 'valuechangeCallback', null); if (callback !== null) { - var scope = GetValue$n(config, 'valuechangeCallbackScope', undefined); + var scope = GetValue$l(config, 'valuechangeCallbackScope', undefined); _this.on('valuechange', callback, scope); } - _this.setValue(GetValue$n(config, 'value', 0x0)); + _this.setValue(GetValue$l(config, 'value', 0x0)); return _this; } _createClass(ColorInput, [{ @@ -53761,7 +53761,7 @@ return SVPalette; }(OverlapSizer); - var GetValue$m = Phaser.Utils.Objects.GetValue; + var GetValue$k = Phaser.Utils.Objects.GetValue; var ColorPicker = /*#__PURE__*/function (_Sizer) { _inherits(ColorPicker, _Sizer); var _super = _createSuper(ColorPicker); @@ -53773,7 +53773,7 @@ _this.freezePalettes = false; // orientation - var hPalettePosition = GetValue$m(config, 'hPalette.position', 0); + var hPalettePosition = GetValue$k(config, 'hPalette.position', 0); if (typeof hPalettePosition === 'string') { hPalettePosition = HPalettePositionNamesMap[hPalettePosition]; } @@ -53786,17 +53786,17 @@ _this.setOrientation(orientation); // Add elements - var background = GetValue$m(config, 'background', undefined); + var background = GetValue$k(config, 'background', undefined); var hPaletteWidth, hPaletteHeight; if (_this.orientation === 0) { - var hPaletteWidth = GetValue$m(config, 'hPalette.width', undefined); + var hPaletteWidth = GetValue$k(config, 'hPalette.width', undefined); if (hPaletteWidth === undefined) { - hPaletteWidth = GetValue$m(config, 'hPalette.size', 10); + hPaletteWidth = GetValue$k(config, 'hPalette.size', 10); } } else { - hPaletteHeight = GetValue$m(config, 'hPalette.height', undefined); + hPaletteHeight = GetValue$k(config, 'hPalette.height', undefined); if (hPaletteHeight === undefined) { - hPaletteHeight = GetValue$m(config, 'hPalette.size', 10); + hPaletteHeight = GetValue$k(config, 'hPalette.size', 10); } } var hPalette = new HPalette(scene, { @@ -53804,8 +53804,8 @@ height: hPaletteHeight }); scene.add.existing(hPalette); - var svPaletteWidth = GetValue$m(config, 'svPalette.width', undefined); - var svPaletteHeight = GetValue$m(config, 'svPalette.height', undefined); + var svPaletteWidth = GetValue$k(config, 'svPalette.width', undefined); + var svPaletteHeight = GetValue$k(config, 'svPalette.height', undefined); var svPalette = new SVPalette(scene, { width: svPaletteWidth, height: svPaletteHeight @@ -53847,12 +53847,12 @@ _this.addChildrenMap('background', background); _this.addChildrenMap('hPalette', hPalette); _this.addChildrenMap('svPalette', svPalette); - var callback = GetValue$m(config, 'valuechangeCallback', null); + var callback = GetValue$k(config, 'valuechangeCallback', null); if (callback !== null) { - var scope = GetValue$m(config, 'valuechangeCallbackScope', undefined); + var scope = GetValue$k(config, 'valuechangeCallbackScope', undefined); _this.on('valuechange', callback, scope); } - _this.setValue(GetValue$m(config, 'value', 0xffffff)); + _this.setValue(GetValue$k(config, 'value', 0xffffff)); return _this; } _createClass(ColorPicker, [{ @@ -53921,7 +53921,7 @@ right: 3 }; - var GetValue$l = Phaser.Utils.Objects.GetValue; + var GetValue$j = Phaser.Utils.Objects.GetValue; var ColorPickerPanel = /*#__PURE__*/function (_Sizer) { _inherits(ColorPickerPanel, _Sizer); var _super = _createSuper(ColorPickerPanel); @@ -53936,12 +53936,12 @@ _this.type = 'rexColorInput.ColorPickerPanel'; // Add elements - var background = GetValue$l(config, 'background', undefined); + var background = GetValue$j(config, 'background', undefined); var colorPicker = new ColorPicker(scene, { hPalette: config.hPalette || {}, svPalette: config.svPalette || {}, space: { - item: GetValue$l(config, 'space.hPalette', 8) + item: GetValue$j(config, 'space.hPalette', 8) } }); scene.add.existing(colorPicker); @@ -53977,7 +53977,7 @@ this.setValue(value); }, _assertThisInitialized(_this)); } - _this.setValue(GetValue$l(config, 'value', 0xffffff)); + _this.setValue(GetValue$j(config, 'value', 0xffffff)); return _this; } _createClass(ColorPickerPanel, [{ @@ -54094,8 +54094,8 @@ }; Object.assign(methods$2, methods$3); - var GetValue$k = Phaser.Utils.Objects.GetValue; - var ColorInput$1 = /*#__PURE__*/function (_ColorInputBase) { + var GetValue$i = Phaser.Utils.Objects.GetValue; + var ColorInput = /*#__PURE__*/function (_ColorInputBase) { _inherits(ColorInput, _ColorInputBase); var _super = _createSuper(ColorInput); function ColorInput(scene, config) { @@ -54116,25 +54116,25 @@ var colorPickerConfig = config.colorPicker; var hasColorPicker = colorPickerConfig !== false && colorPickerConfig !== null; if (hasColorPicker) { - _this.setColorPickerSize(GetValue$k(colorPickerConfig, 'width', 160), GetValue$k(colorPickerConfig, 'height', 170)); + _this.setColorPickerSize(GetValue$i(colorPickerConfig, 'width', 160), GetValue$i(colorPickerConfig, 'height', 170)); var createBackgroundCallback; - var background = GetValue$k(colorPickerConfig, 'background'); + var background = GetValue$i(colorPickerConfig, 'background'); if (background) { createBackgroundCallback = function createBackgroundCallback(scene) { return CreateBackground$2(scene, background); }; } else { - createBackgroundCallback = GetValue$k(colorPickerConfig, 'createBackgroundCallback'); + createBackgroundCallback = GetValue$i(colorPickerConfig, 'createBackgroundCallback'); } _this.setCreateColorPickerBackgroundCallback(createBackgroundCallback); - _this.setColorPickerHPalettePosition(GetValue$k(colorPickerConfig, 'hPalettePosition', 0)); - _this.setColorPickerExpandDirection(GetValue$k(colorPickerConfig, 'expandDirection')); - _this.setColorPickerEaseInDuration(GetValue$k(colorPickerConfig, 'easeIn', 200)); - _this.setColorPickerEaseOutDuration(GetValue$k(colorPickerConfig, 'easeOut', 200)); - _this.setColorPickerTransitInCallback(GetValue$k(colorPickerConfig, 'transitIn')); - _this.setColorPickerTransitOutCallback(GetValue$k(colorPickerConfig, 'transitOut')); - _this.setColorPickerBounds(GetValue$k(colorPickerConfig, 'bounds')); - var colorPickerSpaceConfig = GetValue$k(colorPickerConfig, 'space'); + _this.setColorPickerHPalettePosition(GetValue$i(colorPickerConfig, 'hPalettePosition', 0)); + _this.setColorPickerExpandDirection(GetValue$i(colorPickerConfig, 'expandDirection')); + _this.setColorPickerEaseInDuration(GetValue$i(colorPickerConfig, 'easeIn', 200)); + _this.setColorPickerEaseOutDuration(GetValue$i(colorPickerConfig, 'easeOut', 200)); + _this.setColorPickerTransitInCallback(GetValue$i(colorPickerConfig, 'transitIn')); + _this.setColorPickerTransitOutCallback(GetValue$i(colorPickerConfig, 'transitOut')); + _this.setColorPickerBounds(GetValue$i(colorPickerConfig, 'bounds')); + var colorPickerSpaceConfig = GetValue$i(colorPickerConfig, 'space'); if (colorPickerSpaceConfig === undefined) { colorPickerSpaceConfig = { left: 10, @@ -54149,14 +54149,14 @@ var colorComponentsConfig = config.colorComponents; var hasColorComponents = colorComponentsConfig !== false && colorComponentsConfig !== null; if (hasColorPicker && hasColorComponents) { - _this.setColorComponentsHeight(GetValue$k(colorComponentsConfig, 'height', 30)); - _this.setColorComponentsFormatLabelConfig(GetValue$k(colorComponentsConfig, 'formatLabel')); - var colorComponentsInputTextConfig = GetValue$k(colorComponentsConfig, 'inputText'); + _this.setColorComponentsHeight(GetValue$i(colorComponentsConfig, 'height', 30)); + _this.setColorComponentsFormatLabelConfig(GetValue$i(colorComponentsConfig, 'formatLabel')); + var colorComponentsInputTextConfig = GetValue$i(colorComponentsConfig, 'inputText'); if (!colorComponentsInputTextConfig) { - colorComponentsInputTextConfig = GetValue$k(config, 'inputText'); + colorComponentsInputTextConfig = GetValue$i(config, 'inputText'); } _this.setColorComponentsInputTextConfig(colorComponentsInputTextConfig); - var colorComponentsSpace = GetValue$k(colorComponentsConfig, 'space'); + var colorComponentsSpace = GetValue$i(colorComponentsConfig, 'space'); if (colorComponentsSpace === undefined) { colorComponentsSpace = { item: 8 @@ -54171,8 +54171,34 @@ return _this; } return _createClass(ColorInput); - }(ColorInput$2); - Object.assign(ColorInput$1.prototype, methods$2); + }(ColorInput$1); + Object.assign(ColorInput.prototype, methods$2); + + var RegisterInputHandler = function RegisterInputHandler(config) { + var isValidInputHandler = true; + if (!config.hasOwnProperty('accept')) { + isValidInputHandler = false; + console.error("[Tweaker] Can't register inputHandler '".concat(config.name, "', missing 'accept' callback.")); + } + if (!config.hasOwnProperty('build')) { + isValidInputHandler = false; + console.error("[Tweaker] Can't register inputHandler '".concat(config.name, "', missing 'build' callback.")); + } + if (isValidInputHandler) { + this.inputHandlers.unshift(config); + } + return this; + }; + + var GetFirst = Phaser.Utils.Array.GetFirst; + var Remove = Phaser.Utils.Array.Remove; + var RemoveInputHandler = function RemoveInputHandler(name) { + var handler = GetFirst(this.inputHandlers, 'name', name); + if (handler) { + Remove(this.inputHandlers, handler); + } + return this; + }; var Title = /*#__PURE__*/function (_Label) { _inherits(Title, _Label); @@ -54293,10 +54319,10 @@ }(Folder$1); Object.assign(Folder.prototype, BindingTargetMethods$3, InputRowTitleWidthMethods$1); - var GetValue$j = Phaser.Utils.Objects.GetValue; + var GetValue$h = Phaser.Utils.Objects.GetValue; var CreateFolder = function CreateFolder(scene, config, style) { // Create Folder-title - var titleStyle = GetValue$j(style, 'title') || {}; + var titleStyle = GetValue$h(style, 'title') || {}; var title = new FolderTitle(scene, titleStyle); scene.add.existing(title); title.on('folder.expand', function () { @@ -54305,12 +54331,12 @@ title.setExpandedState(false); }); var tweakerConfig = { - root: GetValue$j(style, 'root'), - styles: GetValue$j(style, 'tweaker'), - space: GetValue$j(style, 'space') || {} + root: GetValue$h(style, 'root'), + styles: GetValue$h(style, 'tweaker'), + space: GetValue$h(style, 'space') || {} }; var child = CreateTweaker(scene, tweakerConfig); - var backgroundStyle = GetValue$j(style, 'background'); + var backgroundStyle = GetValue$h(style, 'background'); var background = CreateBackground(scene, config, backgroundStyle); var folder = new Folder(scene, { orientation: 1, @@ -54318,19 +54344,19 @@ child: child, background: background, transition: { - duration: GetValue$j(style, 'transition.duration', 200) + duration: GetValue$h(style, 'transition.duration', 200) } }); scene.add.existing(folder); return folder; }; - var GetValue$i = Phaser.Utils.Objects.GetValue; + var GetValue$g = Phaser.Utils.Objects.GetValue; var AddFolder = function AddFolder(config) { var scene = this.scene; // Create folder - var folderStyle = GetValue$i(this.styles, 'folder') || {}; + var folderStyle = GetValue$g(this.styles, 'folder') || {}; folderStyle.tweaker = this.styles; folderStyle.root = this.root; var folder = CreateFolder(scene, config, folderStyle); @@ -54344,7 +54370,7 @@ // Set content folder.setTitle(config); - var expanded = GetValue$i(config, 'expanded', true); + var expanded = GetValue$g(config, 'expanded', true); if (expanded) { folder.expand(0); } else { @@ -54400,16 +54426,16 @@ }(TabPages$1); Object.assign(TabPages.prototype, BindingTargetMethods$2, InputRowTitleWidthMethods); - var GetValue$h = Phaser.Utils.Objects.GetValue; + var GetValue$f = Phaser.Utils.Objects.GetValue; var CreateTab = function CreateTab(scene, config, style) { var tabPages = new TabPages(scene, style); scene.add.existing(tabPages); - var tabConfig = GetValue$h(style, 'tab'); + var tabConfig = GetValue$f(style, 'tab'); var tweakerConfig = { - root: GetValue$h(style, 'root'), - styles: GetValue$h(style, 'tweaker') + root: GetValue$f(style, 'root'), + styles: GetValue$f(style, 'tweaker') }; - var pages = GetValue$h(config, 'pages') || []; + var pages = GetValue$f(config, 'pages') || []; for (var i = 0, cnt = pages.length; i < cnt; i++) { var page = pages[i]; tabPages.addPage({ @@ -54428,12 +54454,12 @@ return tabPages; }; - var GetValue$g = Phaser.Utils.Objects.GetValue; + var GetValue$e = Phaser.Utils.Objects.GetValue; var AddTab = function AddTab(config) { var scene = this.scene; // Create tab - var tabStyle = GetValue$g(this.styles, 'tab') || {}; + var tabStyle = GetValue$e(this.styles, 'tab') || {}; tabStyle.tweaker = this.styles; tabStyle.root = this.root; var tab = CreateTab(scene, config, tabStyle); @@ -54444,7 +54470,7 @@ this.add(tab, { expand: true }); - var pagesConfig = GetValue$g(config, 'pages') || []; + var pagesConfig = GetValue$e(config, 'pages') || []; var pages = []; var shownPageIndex = 0; for (var i = 0, cnt = pagesConfig.length; i < cnt; i++) { @@ -54463,54 +54489,6 @@ return pages; }; - var StringType = 'string'; - var TextAreaType = 'textarea'; - var NumberType = 'number'; - var RangeType = 'range'; - var ListType = 'list'; - var ButtonsType = 'buttons'; - var BooleanType = 'boolean'; - var ToggleSwitchType = 'toggleSwitch'; - var ColorType = 'color'; - - var GetInputType = function GetInputType(object, key, config) { - // Force input type to view - if (config.view) { - return config.view; - } - if (config.options) { - return ListType; - } - if (!object) { - return StringType; - } - var value = object[key]; - switch (_typeof(value)) { - case 'number': - if (HasProperties(config, 'min', 'max')) { - return RangeType; - } - return NumberType; - case 'string': - return StringType; - case 'boolean': - return BooleanType; - default: - return StringType; - } - }; - var HasProperties = function HasProperties(object) { - for (var _len = arguments.length, keys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - keys[_key - 1] = arguments[_key]; - } - for (var i = 0, cnt = keys.length; i < cnt; i++) { - if (object[keys[i]] === undefined) { - return false; - } - } - return true; - }; - var BindingTargetMethods$1 = { setupBinding: function setupBinding() { var inputField = this.childrenMap.inputField; @@ -54608,7 +54586,7 @@ } }; - var GetValue$f = Phaser.Utils.Objects.GetValue; + var GetValue$d = Phaser.Utils.Objects.GetValue; var InputRow = /*#__PURE__*/function (_Sizer) { _inherits(InputRow, _Sizer); var _super = _createSuper(InputRow); @@ -54623,8 +54601,8 @@ var inputTitle = config.inputTitle; var inputField = config.inputField; var background = config.background; - var proportion = GetValue$f(config, 'proportion.title', 0); - var titleSpace = GetValue$f(config, 'space.title', 0); + var proportion = GetValue$d(config, 'proportion.title', 0); + var titleSpace = GetValue$d(config, 'space.title', 0); var padding; if (_this.orientation === 0) { padding = { @@ -54641,7 +54619,7 @@ padding: padding }); var defaultProportion = config.parentOrientation === 1 ? 1 : 0; - var proportion = GetValue$f(config, 'proportion.inputField', defaultProportion); + var proportion = GetValue$d(config, 'proportion.inputField', defaultProportion); _this.add(inputField, { proportion: proportion, expand: true @@ -54692,825 +54670,173 @@ return gameObject; }; - var InputFiledBase = /*#__PURE__*/function (_Sizer) { - _inherits(InputFiledBase, _Sizer); - var _super = _createSuper(InputFiledBase); - function InputFiledBase() { - _classCallCheck(this, InputFiledBase); - return _super.apply(this, arguments); + var GenerateInputFieldClass = function GenerateInputFieldClass(BaseClass) { + if (BaseClass === undefined) { + BaseClass = Sizer; } - _createClass(InputFiledBase, [{ - key: "bindingTarget", - get: function get() { - return this.getParentSizer().bindingTarget; - } - }, { - key: "bindingKey", - get: function get() { - return this.getParentSizer().bindTargetKey; - } - }, { - key: "value", - get: function get() { - return this._value; - }, - set: - // Override - function set(value) { - if (this._value === value) { - return; - } - var oldValue = this._value; - this._value = value; - if (!this.syncValueFlag) { - this.emit('valuechange', value, oldValue, this.bindingTarget, this.bindingKey); - } - } - }, { - key: "validate", - value: function validate(newValue) { - if (this.syncValueFlag || !this.validateCallback) { - return true; - } - return this.validateCallback(newValue, this._value, this.bindingTarget, this.bindingKey); - } - }, { - key: "getValue", - value: function getValue() { - return this.value; - } - }, { - key: "setValue", - value: function setValue(value) { - this.value = value; - return this; - } - - /* - Internal method invoked when - - inputRow.setBindingTarget(target), or - - inputRow.syncTargetValue() - */ - }, { - key: "syncValue", - value: function syncValue(value) { - this.syncValueFlag = true; - this.value = value; - this.syncValueFlag = false; - return this; - } - - // Override - }, { - key: "readOnly", - get: function get() { - return this._readOnly; - } - - // Override - , - set: function set(value) { - this._readOnly = value; - } - }, { - key: "setReadOnly", - value: function setReadOnly(enable) { - if (enable === undefined) { - enable = true; - } - this.readOnly = enable; - return true; - } - }, { - key: "setTextFormatCallback", - value: function setTextFormatCallback(callback) { - this.textFormatCallback = callback; - return this; - } - }, { - key: "setValidateCallback", - value: function setValidateCallback(callback) { - this.validateCallback = callback; - return this; - } - }]); - return InputFiledBase; - }(Sizer); - - var TextInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(TextInput, _InputFiledBase); - var _super = _createSuper(TextInput); - function TextInput(scene, config) { - var _this; - _classCallCheck(this, TextInput); - if (config === undefined) { - config = {}; + var InputFiled = /*#__PURE__*/function (_BaseClass) { + _inherits(InputFiled, _BaseClass); + var _super = _createSuper(InputFiled); + function InputFiled() { + _classCallCheck(this, InputFiled); + return _super.apply(this, arguments); } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.TextInput'; - var inputTextConfig = config.inputText; - var inputText = CreateInputText$1(scene, inputTextConfig); - _this.add(inputText, { - proportion: 1, - expand: true - }); - _this.addChildrenMap('inputText', inputText); - inputText.on('close', function () { - this.setValue(inputText.value); - }, _assertThisInitialized(_this)); - return _this; - } - _createClass(TextInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; - } - if (!this.validate(value)) { - value = this._value; // Back to previous value + _createClass(InputFiled, [{ + key: "bindingTarget", + get: function get() { + return this.getParentSizer().bindingTarget; } - - var text = this.textFormatCallback ? this.textFormatCallback(value) : value; - this.childrenMap.inputText.setText(text); - _set(_getPrototypeOf(TextInput.prototype), "value", value, this, true); // Fire 'valuechange' event - } - }, { - key: "setInputTextReadOnly", - value: function setInputTextReadOnly(enable) { - if (enable === undefined) { - enable = true; + }, { + key: "bindingKey", + get: function get() { + return this.getParentSizer().bindTargetKey; } - this.childrenMap.inputText.setReadOnly(enable); - return this; - } - }]); - return TextInput; - }(InputFiledBase); - - var CreateTextInput = function CreateTextInput(scene, config, style) { - var gameObject = new TextInput(scene, style); - scene.add.existing(gameObject); - gameObject.setInputTextReadOnly(!!config.inputTextReadOnly); - return gameObject; - }; - - var CreateInputTextArea = function CreateInputTextArea(scene, config, deepCloneConfig) { - if (deepCloneConfig === undefined) { - deepCloneConfig = true; - } - if (deepCloneConfig) { - config = config ? DeepClone(config) : {}; - } else if (!config) { - config = {}; - } - var inputText = new TextAreaInput$1(scene, config); - scene.add.existing(inputText); - return inputText; - }; + }, { + key: "value", + get: function get() { + return this._value; + }, + set: function set(value) { + if (this._value === value) { + return; + } + if (!this.validate(value)) { + value = this._value; // Back to previous value + } - var TextAreaInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(TextAreaInput, _InputFiledBase); - var _super = _createSuper(TextAreaInput); - function TextAreaInput(scene, config) { - var _this; - _classCallCheck(this, TextAreaInput); - if (config === undefined) { - config = {}; - } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.TextAreaInput'; - var inputTextAreaConfig = config.inputTextArea; - if (inputTextAreaConfig === undefined) { - inputTextAreaConfig = {}; - } - if (!inputTextAreaConfig.hasOwnProperty('text')) { - inputTextAreaConfig.text = config.inputText; - } - if (!inputTextAreaConfig.hasOwnProperty('slider')) { - inputTextAreaConfig.slider = config.slider; - } - var inputText = CreateInputTextArea(scene, inputTextAreaConfig); - _this.add(inputText, { - proportion: 1, - expand: true - }); - _this.addChildrenMap('inputText', inputText); - inputText.on('close', function () { - this.setValue(inputText.value); - }, _assertThisInitialized(_this)); - return _this; - } - _createClass(TextAreaInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; - } - if (!this.validate(value)) { - value = this._value; // Back to previous value + if (this.displayValueCallback) { + this.displayValueCallback(this, value); + } + if (this._value === value) { + return; + } + var oldValue = this._value; + this._value = value; + if (!this.syncValueFlag) { + this.emit('valuechange', value, oldValue, this.bindingTarget, this.bindingKey); + } } - - var text = this.textFormatCallback ? this.textFormatCallback(value) : value; - this.childrenMap.inputText.setText(text); - _set(_getPrototypeOf(TextAreaInput.prototype), "value", value, this, true); // Fire 'valuechange' event - } - }, { - key: "setInputTextReadOnly", - value: function setInputTextReadOnly(enable) { - if (enable === undefined) { - enable = true; + }, { + key: "validate", + value: function validate(newValue) { + if (this.syncValueFlag || !this.validateCallback) { + return true; + } + return this.validateCallback(newValue, this._value, this.bindingTarget, this.bindingKey); } - this.childrenMap.inputText.setReadOnly(enable); - return this; - } - }]); - return TextAreaInput; - }(InputFiledBase); - - var CreateTextAreaInput = function CreateTextAreaInput(scene, config, style) { - var gameObject = new TextAreaInput(scene, style); - scene.add.existing(gameObject); - gameObject.setInputTextReadOnly(!!config.inputTextReadOnly); - return gameObject; - }; - - var NumberInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(NumberInput, _InputFiledBase); - var _super = _createSuper(NumberInput); - function NumberInput(scene, config) { - var _this; - _classCallCheck(this, NumberInput); - if (config === undefined) { - config = {}; - } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.NumberInput'; - var inputTextConfig = config.inputNumber || config.inputText; - var inputText = CreateInputText$1(scene, inputTextConfig).setNumberInput(); - _this.add(inputText, { - proportion: 1, - expand: true - }); - _this.addChildrenMap('inputText', inputText); - inputText.on('close', function () { - this.setValue(inputText.value); - }, _assertThisInitialized(_this)); - return _this; - } - _createClass(NumberInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; + }, { + key: "getFotmatText", + value: function getFotmatText(value) { + if (this.textFormatCallback) { + value = this.textFormatCallback(value); + } else { + value = value.toString(); + } + return value; } - if (!this.validate(value)) { - value = this._value; // Back to previous value + }, { + key: "getValue", + value: function getValue() { + return this.value; } - - var text = this.textFormatCallback ? this.textFormatCallback(value) : value; - this.childrenMap.inputText.setText(text); - _set(_getPrototypeOf(NumberInput.prototype), "value", value, this, true); // Fire 'valuechange' event - } - }, { - key: "setInputTextReadOnly", - value: function setInputTextReadOnly(enable) { - if (enable === undefined) { - enable = true; + }, { + key: "setValue", + value: function setValue(value) { + this.value = value; + return this; } - this.childrenMap.inputText.setReadOnly(enable); - return this; - } - }]); - return NumberInput; - }(InputFiledBase); - - var CreateNumberInput = function CreateNumberInput(scene, config, style) { - var gameObject = new NumberInput(scene, style); - scene.add.existing(gameObject); - gameObject.setInputTextReadOnly(!!config.inputTextReadOnly); - return gameObject; - }; - var CreateSlider = function CreateSlider(scene, config) { - var gameObject = new Slider(scene, config); - scene.add.existing(gameObject); - return gameObject; - }; - - var GetValue$e = Phaser.Utils.Objects.GetValue; - var Linear = Phaser.Math.Linear; - var SnapFloor = Phaser.Math.Snap.Floor; - var RangeInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(RangeInput, _InputFiledBase); - var _super = _createSuper(RangeInput); - function RangeInput(scene, config) { - var _this; - _classCallCheck(this, RangeInput); - if (config === undefined) { - config = {}; - } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.RangeInput'; - var sliderConfig = config.slider; - var trackSizeKey = _this.orientation === 0 ? 'track.height' : 'track.width'; - var trackSize = GetValue$e(sliderConfig, trackSizeKey); - var slider = CreateSlider(scene, sliderConfig); - var defaultProportion = config.parentOrientation === 1 ? 2 : 0; - var proportion = GetValue$e(config, 'proportion.range.slider', defaultProportion); - var expand = trackSize === undefined; - _this.add(slider, { - proportion: proportion, - expand: expand - }); - var inputTextConfig = config.inputNumber || config.inputText; - var inputText = CreateInputText$1(scene, inputTextConfig).setNumberInput(); - var defaultProportion = config.parentOrientation === 1 ? 1 : 0; - var proportion = GetValue$e(config, 'proportion.range.inputText', defaultProportion); - _this.add(inputText, { - proportion: proportion, - expand: true - }); - _this.addChildrenMap('slider', slider); - _this.addChildrenMap('inputText', inputText); - inputText.on('close', function () { - this.setValue(inputText.value); - }, _assertThisInitialized(_this)); - slider.on('valuechange', function () { - var value = Linear(this.minValue, this.maxValue, slider.value); - if (this.step) { - value = SnapFloor(value, this.step, this.minValue); + /* + Internal method invoked when + - inputRow.setBindingTarget(target), or + - inputRow.syncTargetValue() + */ + }, { + key: "syncValue", + value: function syncValue(value) { + this.syncValueFlag = true; + this.value = value; + this.syncValueFlag = false; + return this; } - this.setValue(value); - }, _assertThisInitialized(_this)); - return _this; - } - _createClass(RangeInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; + }, { + key: "setup", + value: function setup(config, setDefaults) { + if (setDefaults === undefined) { + setDefaults = false; + } + if (setDefaults || config.hasOwnProperty('format')) { + this.setTextFormatCallback(config.format); + } + if (setDefaults || config.hasOwnProperty('onValidate')) { + this.setValidateCallback(config.onValidate); + } + if (this.setupCallback) { + this.setupCallback(this, config, setDefaults); + } + return this; } - if (!this.validate(value)) { - value = this._value; // Back to previous value + }, { + key: "setSetupCallback", + value: function setSetupCallback(callback) { + this.setupCallback = callback; + return this; } - - var text = this.textFormatCallback ? this.textFormatCallback(value) : value; - this.childrenMap.inputText.setText('').setText(text); - this.childrenMap.slider.setValue(value, this.minValue, this.maxValue); - _set(_getPrototypeOf(RangeInput.prototype), "value", value, this, true); // Fire 'valuechange' event - } - }, { - key: "setRange", - value: function setRange(min, max, step) { - this.minValue = min; - this.maxValue = max; - this.step = step; - this.childrenMap.slider.setGap(step, min, max); - return this; - } - }, { - key: "setInputTextReadOnly", - value: function setInputTextReadOnly(enable) { - if (enable === undefined) { - enable = true; + }, { + key: "setDisplayValueCallback", + value: function setDisplayValueCallback(callback) { + this.displayValueCallback = callback; + return this; } - this.childrenMap.inputText.setReadOnly(enable); - return this; - } - }]); - return RangeInput; - }(InputFiledBase); - - var CreateRangeInput = function CreateRangeInput(scene, config, style) { - var gameObject = new RangeInput(scene, style); - scene.add.existing(gameObject); - gameObject.setRange(config.min, config.max, config.step); - gameObject.setInputTextReadOnly(!!config.inputTextReadOnly); - return gameObject; - }; - - var CreateDropDownList = function CreateDropDownList(scene, config) { - config = BuildListConfig(scene, config); - var gameObject = new DropDownList(scene, config); - scene.add.existing(gameObject); - return gameObject; - }; - - var GetOptionIndex = function GetOptionIndex(options, value) { - for (var i = 0, cnt = options.length; i < cnt; i++) { - var option = options[i]; - if (option.value === value) { - return i; - } - } - return undefined; - }; - var GetOptionText = function GetOptionText(options, value) { - var index = GetOptionIndex(options, value); - if (index == null) { - return undefined; - } - return options[index].text; - }; - - var ListInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(ListInput, _InputFiledBase); - var _super = _createSuper(ListInput); - function ListInput(scene, config) { - var _this; - _classCallCheck(this, ListInput); - if (config === undefined) { - config = {}; - } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.ListInput'; - var list = CreateDropDownList(scene, config.list); - _this.add(list, { - proportion: 1, - expand: true - }); - _this.addChildrenMap('list', list); - list.on('button.click', function (dropDownList, listPanel, button, index, pointer, event) { - this.setValue(button.value); - }, _assertThisInitialized(_this)); - return _this; - } - _createClass(ListInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; + }, { + key: "setTextFormatCallback", + value: function setTextFormatCallback(callback) { + this.textFormatCallback = callback; + return this; } - if (!this.validate(value)) { - value = this._value; // Back to previous value + }, { + key: "setValidateCallback", + value: function setValidateCallback(callback) { + this.validateCallback = callback; + return this; } - - var list = this.childrenMap.list; - var text = GetOptionText(list.options, value); - list.resetDisplayContent({ - text: text - }); - _set(_getPrototypeOf(ListInput.prototype), "value", value, this, true); // Fire 'valuechange' event - } - }, { - key: "setOptions", - value: function setOptions(options) { - this.childrenMap.list.setOptions(options); - return this; - } - }]); - return ListInput; - }(InputFiledBase); - - var CreateListInput = function CreateListInput(scene, config, style) { - var gameObject = new ListInput(scene, style); - scene.add.existing(gameObject); - gameObject.setOptions(config.options); - return gameObject; - }; - - var CreateButtons$1 = function CreateButtons(scene, config) { - var gameObject = new Buttons$1(scene, config); - scene.add.existing(gameObject); - return gameObject; - }; - - var SetButtonsActiveStateByIndex = function SetButtonsActiveStateByIndex(buttons, index) { - for (var i = 0, cnt = buttons.length; i < cnt; i++) { - var button = buttons[i]; - if (!button) { - continue; - } - button.setActiveState(i === index); - } + }]); + return InputFiled; + }(BaseClass); + return InputFiled; }; - var GetValue$d = Phaser.Utils.Objects.GetValue; - var ButtonsInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(ButtonsInput, _InputFiledBase); - var _super = _createSuper(ButtonsInput); - function ButtonsInput(scene, config) { - var _this; - _classCallCheck(this, ButtonsInput); - if (config === undefined) { - config = {}; - } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.ButtonsInput'; - var buttonConfig = config.button ? DeepClone(config.button) : {}; - var buttonExpand = GetValue$d(buttonConfig, 'expand', true); - if (buttonExpand) { - buttonConfig.align = 'center'; + var CreateInputField = function CreateInputField(scene, config, style) { + var inputField; + var inputHandlers = this.inputHandlers; + for (var i = 0, cnt = inputHandlers.length; i < cnt; i++) { + var handler = inputHandlers[i]; + if (handler.accept(config)) { + var InputFieldClass = GenerateInputFieldClass(handler.baseClass); + inputField = new InputFieldClass(scene); + scene.add.existing(inputField); + inputField.setSetupCallback(handler.setup).setDisplayValueCallback(handler.displayValue); + handler.build(inputField, style); + break; } - delete buttonConfig.expand; - var list = CreateButtons$1(scene, { - expand: buttonExpand - }); - list.buttonConfig = buttonConfig; - _this.add(list, { - proportion: 1, - expand: true - }); - _this.addChildrenMap('list', list); - list.on('button.click', function (button, index, pointer, event) { - var option = list.options[index]; - if (!option) { - return; // ?? - } - - this._selectedIndex = index; - this.setValue(option.value); - this._selectedIndex = undefined; - }, _assertThisInitialized(_this)); - return _this; } - _createClass(ButtonsInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; - } - if (!this.validate(value)) { - value = this._value; // Back to previous value - } - var list = this.childrenMap.list; - var index = this._selectedIndex; // See list's 'button.click' event - if (index === undefined) { - index = GetOptionIndex(list.options, value); - } - SetButtonsActiveStateByIndex(list.childrenMap.buttons, index); - _set(_getPrototypeOf(ButtonsInput.prototype), "value", value, this, true); // Fire 'valuechange' event - } - }, { - key: "setOptions", - value: function setOptions(options) { - var list = this.childrenMap.list; - list.options = options; - var scene = this.scene; - var buttonConfig = list.buttonConfig; - list.clearButtons(true); - for (var i = 0, cnt = options.length; i < cnt; i++) { - var option = options[i]; - var button = CreateLabel(scene, buttonConfig).setActiveState(false).resetDisplayContent({ - text: option.text - }); - list.addButton(button); - } - return this; - } - }]); - return ButtonsInput; - }(InputFiledBase); - - var CreateButtonsInput = function CreateButtonsInput(scene, config, style) { - var gameObject = new ButtonsInput(scene, style); - scene.add.existing(gameObject); - gameObject.setOptions(config.options); - return gameObject; - }; - - var CreateCheckbox = function CreateCheckbox(scene, config) { - var gameObject = new Checkbox(scene, config); - scene.add.existing(gameObject); - return gameObject; + // Setup by config + inputField.setup(config, true); + return inputField; }; var GetValue$c = Phaser.Utils.Objects.GetValue; - var CheckboxInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(CheckboxInput, _InputFiledBase); - var _super = _createSuper(CheckboxInput); - function CheckboxInput(scene, config) { - var _this; - _classCallCheck(this, CheckboxInput); - if (config === undefined) { - config = {}; - } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.CheckboxInput'; - var checkboxConfig = config.checkbox; - var checkbox = CreateCheckbox(scene, checkboxConfig); - var size = GetValue$c(checkboxConfig, 'size'); - if (size !== undefined) { - checkbox.setSize(size, size); - } - var fitRatio = size !== undefined ? 0 : 1; - _this.add(checkbox, { - proportion: 0, - expand: false, - fitRatio: fitRatio - }); - _this.addChildrenMap('checkbox', checkbox); - checkbox.on('valuechange', function (value) { - this.setValue(value); - }, _assertThisInitialized(_this)); - return _this; - } - _createClass(CheckboxInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; - } - if (!this.validate(value)) { - value = this._value; // Back to previous value - } - - this.childrenMap.checkbox.setValue(value); - _set(_getPrototypeOf(CheckboxInput.prototype), "value", value, this, true); // Fire 'valuechange' event - } - }]); - return CheckboxInput; - }(InputFiledBase); - - var CreateCheckboxInput = function CreateCheckboxInput(scene, config, style) { - var gameObject = new CheckboxInput(scene, style); - scene.add.existing(gameObject); - return gameObject; - }; - - var CreateToggleSwitch = function CreateToggleSwitch(scene, config) { - var gameObject = new ToggleSwitch(scene, config); - scene.add.existing(gameObject); - return gameObject; - }; - - var GetValue$b = Phaser.Utils.Objects.GetValue; - var ToggleSwitchInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(ToggleSwitchInput, _InputFiledBase); - var _super = _createSuper(ToggleSwitchInput); - function ToggleSwitchInput(scene, config) { - var _this; - _classCallCheck(this, ToggleSwitchInput); - if (config === undefined) { - config = {}; - } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.ToggleSwitchInput'; - var toggleSwitchConfig = config.toggleSwitch; - var toggleSwitch = CreateToggleSwitch(scene, toggleSwitchConfig); - var size = GetValue$b(toggleSwitchConfig, 'size'); - if (size !== undefined) { - toggleSwitch.setSize(size, size); - } - var fitRatio = size !== undefined ? 0 : 1; - _this.addSpace().add(toggleSwitch, { - proportion: 0, - expand: false, - fitRatio: fitRatio - }); - _this.addChildrenMap('toggleSwitch', toggleSwitch); - toggleSwitch.on('valuechange', function (value) { - this.setValue(value); - }, _assertThisInitialized(_this)); - return _this; - } - _createClass(ToggleSwitchInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; - } - if (!this.validate(value)) { - value = this._value; // Back to previous value - } - - this.childrenMap.toggleSwitch.setValue(value); - _set(_getPrototypeOf(ToggleSwitchInput.prototype), "value", value, this, true); // Fire 'valuechange' event - } - }]); - return ToggleSwitchInput; - }(InputFiledBase); - - var CreateToggleSwitchInput = function CreateToggleSwitchInput(scene, config, style) { - var gameObject = new ToggleSwitchInput(scene, style); - scene.add.existing(gameObject); - return gameObject; - }; - - var CreateColorInput$1 = function CreateColorInput(scene, config, deepCloneConfig) { - if (deepCloneConfig === undefined) { - deepCloneConfig = true; - } - if (deepCloneConfig) { - config = config ? DeepClone(config) : {}; - } else if (!config) { - config = {}; - } - var inputText = new ColorInput$1(scene, config); - scene.add.existing(inputText); - return inputText; - }; - - var ColorInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(ColorInput, _InputFiledBase); - var _super = _createSuper(ColorInput); - function ColorInput(scene, config) { - var _this; - _classCallCheck(this, ColorInput); - if (config === undefined) { - config = {}; - } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.ColorInput'; - var colorInputConfig = config.colorInput; - var colorInput = CreateColorInput$1(scene, colorInputConfig); - _this.add(colorInput, { - proportion: 1, - expand: true - }); - _this.addChildrenMap('colorInput', colorInput); - colorInput.on('valuechange', function (value) { - this.setValue(value); - }, _assertThisInitialized(_this)); - return _this; - } - _createClass(ColorInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; - } - if (!this.validate(value)) { - value = this._value; // Back to previous value - } - - this.childrenMap.colorInput.setValue(value); - _set(_getPrototypeOf(ColorInput.prototype), "value", value, this, true); // Fire 'valuechange' event - } - }]); - return ColorInput; - }(InputFiledBase); - - var CreateColorInput = function CreateColorInput(scene, config, style) { - var gameObject = new ColorInput(scene, style); - scene.add.existing(gameObject); - return gameObject; - }; - - var CallbacksMap = {}; - CallbacksMap[StringType] = CreateTextInput; - CallbacksMap[TextAreaType] = CreateTextAreaInput; - CallbacksMap[NumberType] = CreateNumberInput; - CallbacksMap[RangeType] = CreateRangeInput; - CallbacksMap[ListType] = CreateListInput; - CallbacksMap[ButtonsType] = CreateButtonsInput; - CallbacksMap[BooleanType] = CreateCheckboxInput; - CallbacksMap[ToggleSwitchType] = CreateToggleSwitchInput; - CallbacksMap[ColorType] = CreateColorInput; - var CreateInputField = function CreateInputField(scene, config, style) { - var viewType = config.view; - var callback; - if (IsFunction(viewType)) { - callback = viewType; - } else { - callback = CallbacksMap.hasOwnProperty(viewType) ? CallbacksMap[viewType] : CreateTextInput; - } - var gameObject = callback(scene, config, style); - - // Extra settings - gameObject.setTextFormatCallback(config.format); - return gameObject; - }; - - var GetValue$a = Phaser.Utils.Objects.GetValue; var CreateInputRow = function CreateInputRow(scene, config, style) { // Title - var titleStyle = GetValue$a(style, 'title') || {}; + var titleStyle = GetValue$c(style, 'title') || {}; var inputTitle = CreateTitleLabel(scene, config, titleStyle); // InputField - var inputField = CreateInputField(scene, config, style); + var inputField = CreateInputField.call(this, scene, config, style); // Background - var backgroundStyle = GetValue$a(style, 'background') || {}; + var backgroundStyle = GetValue$c(style, 'background') || {}; var background = CreateBackground$2(scene, backgroundStyle); var inputRow = new InputRow(scene, _objectSpread2(_objectSpread2(_objectSpread2({}, config), style), {}, { inputTitle: inputTitle, @@ -55522,26 +54848,31 @@ return inputRow; }; - Phaser.Utils.Objects.GetValue; var AddInput = function AddInput(object, key, config) { if (arguments.length === 1) { config = object; object = config.bindingTarget; key = config.bindingKey; - } else if (config === undefined) { - config = {}; + } else { + if (config === undefined) { + config = {}; + } + config.bindingTarget = object; + config.bindingKey = key; } if (!config.title) { config.title = key; } - if (!config.view) { - config.view = GetInputType(object, key, config); + if (config.bindingTarget && config.bindingKey) { + config.value = config.bindingTarget[config.bindingKey]; + } else { + config.value = undefined; } // Create InputRow var inputRowStyle = this.styles.inputRow || {}; inputRowStyle.parentOrientation = this.styles.orientation; - var inputSizer = CreateInputRow(this.scene, config, inputRowStyle); + var inputSizer = CreateInputRow.call(this, this.scene, config, inputRowStyle); var inputField = inputSizer.childrenMap.inputField; var proportion; if (this.orientation === 1) { @@ -55561,9 +54892,6 @@ if (config.onValueChange) { inputField.on('valuechange', config.onValueChange); } - if (config.onValidate) { - inputField.setValidateCallback(config.onValidate); - } // Bind target inputSizer.setAutoUpdateEnable(config.autoUpdate); @@ -55583,15 +54911,21 @@ return gameObject; }; - var GetValue$9 = Phaser.Utils.Objects.GetValue; - var CreateButtons = function CreateButtons(scene, config, style) { + var CreateButtons$2 = function CreateButtons(scene, config) { + var gameObject = new Buttons$1(scene, config); + scene.add.existing(gameObject); + return gameObject; + }; + + var GetValue$b = Phaser.Utils.Objects.GetValue; + var CreateButtons$1 = function CreateButtons(scene, config, style) { // Title - var titleStyle = GetValue$9(style, 'title') || {}; + var titleStyle = GetValue$b(style, 'title') || {}; var title = CreateTitleLabel(scene, config, titleStyle); // Buttons var buttonsConfig = config.buttons; - var buttonStyle = GetValue$9(style, 'button') || {}; + var buttonStyle = GetValue$b(style, 'button') || {}; var buttons = []; for (var i = 0, cnt = buttonsConfig.length; i < cnt; i++) { var button = CreateLabel(scene, buttonStyle); @@ -55602,13 +54936,13 @@ }); button.callback = buttonConfig.callback; } - var buttonsSizer = CreateButtons$1(scene, { + var buttonsSizer = CreateButtons$2(scene, { buttons: buttons, expand: buttons.length === 1 }); // Background - var backgroundStyle = GetValue$9(style, 'background') || {}; + var backgroundStyle = GetValue$b(style, 'background') || {}; var background = CreateRoundRectangle(scene, backgroundStyle); // InputRow @@ -55625,7 +54959,7 @@ return inputRow; }; - var GetValue$8 = Phaser.Utils.Objects.GetValue; + var GetValue$a = Phaser.Utils.Objects.GetValue; var AddButtons = function AddButtons(config) { var scene = this.scene; if (config === undefined) { @@ -55643,8 +54977,8 @@ delete config.bindingTarget; // Create buttons - var buttonsStyle = GetValue$8(this.styles, 'inputRow') || {}; - var buttons = CreateButtons(scene, config, buttonsStyle); + var buttonsStyle = GetValue$a(this.styles, 'inputRow') || {}; + var buttons = CreateButtons$1(scene, config, buttonsStyle); // Add buttons this.add(buttons, { @@ -55661,12 +54995,12 @@ return this; }; - var GetValue$7 = Phaser.Utils.Objects.GetValue; + var GetValue$9 = Phaser.Utils.Objects.GetValue; var AddSeparator = function AddSeparator(config) { var scene = this.scene; // Create separator - var separatorStyle = GetValue$7(this.styles, 'separator'); + var separatorStyle = GetValue$9(this.styles, 'separator'); var separator = CreateBackground(scene, config, separatorStyle); // Add separator @@ -55727,6 +55061,8 @@ }; var methods$1 = { + registerInputHandler: RegisterInputHandler, + removeInputHandler: RemoveInputHandler, addFolder: AddFolder, addTab: AddTab, addInput: AddInput, @@ -55738,7 +55074,7 @@ setInputRowTitleWidth: SetInputRowTitleWidth }; - var GetValue$6 = Phaser.Utils.Objects.GetValue; + var GetValue$8 = Phaser.Utils.Objects.GetValue; var TweakerShell = /*#__PURE__*/function (_Sizer) { _inherits(TweakerShell, _Sizer); var _super = _createSuper(TweakerShell); @@ -55756,13 +55092,13 @@ _this = _super.call(this, scene, config); _this.type = 'rexTweakerShell'; _this.root = config.root || _assertThisInitialized(_this); - _this.styles = GetValue$6(config, 'styles') || {}; + _this.styles = GetValue$8(config, 'styles') || {}; _this.styles.orientation = _this.orientation; - _this.itemWidth = GetValue$6(_this.styles, 'itemWidth', 0); + _this.itemWidth = GetValue$8(_this.styles, 'itemWidth', 0); if (_this.root === _assertThisInitialized(_this) && _this.orientation === 1) { - var alignTitle = GetValue$6(config, 'inputRow.alignTitle'); + var alignTitle = GetValue$8(config, 'inputRow.alignTitle'); if (alignTitle === undefined) { - var titleProportion = GetValue$6(_this.styles, 'inputRow.proportion.title'); + var titleProportion = GetValue$8(_this.styles, 'inputRow.proportion.title'); alignTitle = !titleProportion; } else { if (alignTitle) { @@ -55773,6 +55109,7 @@ _this.alignInputRowTitle = alignTitle; } else { _this.alignInputRowTitle = false; + _this.inputHandlers = _this.root.inputHandlers; } var background = CreateBackground(scene, undefined, config.background); if (background) { @@ -55793,6 +55130,529 @@ }(Sizer); Object.assign(TweakerShell.prototype, methods$1); + var SetInputTextReadOnly$3 = function SetInputTextReadOnly(gameObject, enable) { + if (enable === undefined) { + enable = true; + } + var inputText = gameObject.getElement('inputText'); + inputText.setReadOnly(enable); + }; + var TextInputHandler = { + name: 'TextInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'string'; + } + return typeof config.value === 'string'; + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.TextInput'; + var inputTextConfig = style.inputText; + var inputText = CreateInputText$1(scene, inputTextConfig); + gameObject.add(inputText, { + proportion: 1, + expand: true, + key: 'inputText' + }); + inputText.on('close', function () { + gameObject.setValue(inputText.value); + }); + }, + // Callback inside `setup()` + setup: function setup(gameObject, config, setDefaults) { + if (setDefaults || config.hasOwnProperty('inputTextReadOnly')) { + SetInputTextReadOnly$3(gameObject, !!config.inputTextReadOnly); + } + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var inputText = gameObject.getElement('inputText'); + inputText.setText(gameObject.getFotmatText(value)); + } + }; + + var CreateInputTextArea = function CreateInputTextArea(scene, config, deepCloneConfig) { + if (deepCloneConfig === undefined) { + deepCloneConfig = true; + } + if (deepCloneConfig) { + config = config ? DeepClone(config) : {}; + } else if (!config) { + config = {}; + } + var inputText = new TextAreaInput(scene, config); + scene.add.existing(inputText); + return inputText; + }; + + var SetInputTextReadOnly$2 = function SetInputTextReadOnly(gameObject, enable) { + if (enable === undefined) { + enable = true; + } + var inputText = gameObject.getElement('inputText'); + inputText.setReadOnly(enable); + }; + var TextAreaInputHandler = { + name: 'TextAreaInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'textarea'; + } + return false; + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + this.type = 'rexTweaker.TextAreaInput'; + var inputTextAreaConfig = style.inputTextArea; + if (inputTextAreaConfig === undefined) { + inputTextAreaConfig = {}; + } + if (!inputTextAreaConfig.hasOwnProperty('text')) { + inputTextAreaConfig.text = style.inputText; + } + if (!inputTextAreaConfig.hasOwnProperty('slider')) { + inputTextAreaConfig.slider = style.slider; + } + var inputText = CreateInputTextArea(scene, inputTextAreaConfig); + gameObject.add(inputText, { + proportion: 1, + expand: true, + key: 'inputText' + }); + inputText.on('close', function () { + gameObject.setValue(inputText.value); + }); + }, + // Callback inside `setup()` + setup: function setup(gameObject, config, setDefaults) { + if (setDefaults || config.hasOwnProperty('inputTextReadOnly')) { + SetInputTextReadOnly$2(gameObject, !!config.inputTextReadOnly); + } + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var inputText = gameObject.getElement('inputText'); + inputText.setText(gameObject.getFotmatText(value)); + } + }; + + var SetInputTextReadOnly$1 = function SetInputTextReadOnly(gameObject, enable) { + if (enable === undefined) { + enable = true; + } + var inputText = gameObject.getElement('inputText'); + inputText.setReadOnly(enable); + }; + var NumberInputHandler = { + name: 'NumberInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'number'; + } + return typeof config.value === 'number'; + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.NumberInput'; + var inputTextConfig = style.inputNumber || style.inputText; + var inputText = CreateInputText$1(scene, inputTextConfig).setNumberInput(); + gameObject.add(inputText, { + proportion: 1, + expand: true, + key: 'inputText' + }); + inputText.on('close', function () { + gameObject.setValue(inputText.value); + }); + }, + // Callback inside `setup()` + setup: function setup(gameObject, config, setDefaults) { + if (setDefaults || config.hasOwnProperty('inputTextReadOnly')) { + SetInputTextReadOnly$1(gameObject, !!config.inputTextReadOnly); + } + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var inputText = gameObject.getElement('inputText'); + inputText.setText(gameObject.getFotmatText(value)); + } + }; + + var CreateSlider = function CreateSlider(scene, config) { + var gameObject = new Slider(scene, config); + scene.add.existing(gameObject); + return gameObject; + }; + + var GetValue$7 = Phaser.Utils.Objects.GetValue; + var Linear = Phaser.Math.Linear; + var SnapFloor = Phaser.Math.Snap.Floor; + var SetRange = function SetRange(gameObject, min, max, step) { + gameObject.minValue = min; + gameObject.maxValue = max; + gameObject.step = step; + var slider = gameObject.getElement('slider'); + slider.setGap(step, min, max); + }; + var SetInputTextReadOnly = function SetInputTextReadOnly(gameObject, enable) { + if (enable === undefined) { + enable = true; + } + var inputText = gameObject.getElement('inputText'); + inputText.setReadOnly(enable); + }; + var RangeInputHandler = { + name: 'RangeInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'range'; + } + return typeof config.value === 'number' && config.hasOwnProperty('min') && config.hasOwnProperty('max'); + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.RangeInput'; + var sliderConfig = style.slider; + var trackSizeKey = gameObject.orientation === 0 ? 'track.height' : 'track.width'; + var trackSize = GetValue$7(sliderConfig, trackSizeKey); + var slider = CreateSlider(scene, sliderConfig); + var defaultProportion = style.parentOrientation === 1 ? 2 : 0; + var proportion = GetValue$7(style, 'proportion.range.slider', defaultProportion); + var expand = trackSize === undefined; + gameObject.add(slider, { + proportion: proportion, + expand: expand, + key: 'slider' + }); + var inputTextConfig = style.inputNumber || style.inputText; + var inputText = CreateInputText$1(scene, inputTextConfig).setNumberInput(); + var defaultProportion = style.parentOrientation === 1 ? 1 : 0; + var proportion = GetValue$7(style, 'proportion.range.inputText', defaultProportion); + gameObject.add(inputText, { + proportion: proportion, + expand: true, + key: 'inputText' + }); + inputText.on('close', function () { + gameObject.setValue(inputText.value); + }); + slider.on('valuechange', function () { + var value = Linear(gameObject.minValue, gameObject.maxValue, slider.value); + if (gameObject.step) { + value = SnapFloor(value, gameObject.step, gameObject.minValue); + } + gameObject.setValue(value); + }); + }, + // Callback inside `setup()` + setup: function setup(gameObject, config, setDefaults) { + if (setDefaults || config.hasOwnProperty('max')) { + SetRange(gameObject, config.min, config.max, config.step); + } + if (setDefaults || config.hasOwnProperty('inputTextReadOnly')) { + SetInputTextReadOnly(gameObject, !!config.inputTextReadOnly); + } + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var slider = gameObject.getElement('slider'); + slider.setValue(value, gameObject.minValue, gameObject.maxValue); + var inputText = gameObject.getElement('inputText'); + inputText.setText('').setText(gameObject.getFotmatText(value)); + } + }; + + var CreateColorInput = function CreateColorInput(scene, config, deepCloneConfig) { + if (deepCloneConfig === undefined) { + deepCloneConfig = true; + } + if (deepCloneConfig) { + config = config ? DeepClone(config) : {}; + } else if (!config) { + config = {}; + } + var inputText = new ColorInput(scene, config); + scene.add.existing(inputText); + return inputText; + }; + + var ColorInputHandler = { + name: 'ColorInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'color'; + } + return false; + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.ColorInput'; + var colorInputConfig = style.colorInput; + var colorInput = CreateColorInput(scene, colorInputConfig); + gameObject.add(colorInput, { + proportion: 1, + expand: true, + key: 'colorInput' + }); + colorInput.on('valuechange', function (value) { + gameObject.setValue(value); + }); + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var colorInput = gameObject.getElement('colorInput'); + colorInput.setValue(value); + } + }; + + var CreateCheckbox = function CreateCheckbox(scene, config) { + var gameObject = new Checkbox(scene, config); + scene.add.existing(gameObject); + return gameObject; + }; + + var CheckboxInputHandler = { + name: 'CheckboxInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'boolean'; + } + return typeof config.value === 'boolean'; + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.CheckboxInput'; + var checkboxConfig = style.checkbox; + var checkbox = CreateCheckbox(scene, checkboxConfig); + var size = checkboxConfig.size; + if (size !== undefined) { + checkbox.setSize(size, size); + } + var fitRatio = size !== undefined ? 0 : 1; + gameObject.add(checkbox, { + proportion: 0, + expand: false, + fitRatio: fitRatio, + key: 'checkbox' + }); + checkbox.on('valuechange', function (value) { + gameObject.setValue(value); + }); + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var checkbox = gameObject.getElement('checkbox'); + checkbox.setValue(value); + } + }; + + var CreateToggleSwitch = function CreateToggleSwitch(scene, config) { + var gameObject = new ToggleSwitch(scene, config); + scene.add.existing(gameObject); + return gameObject; + }; + + var ToggleSwitchInputHandler = { + name: 'ToggleSwitchInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'toggleSwitch'; + } + return false; + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.ToggleSwitchInput'; + var toggleSwitchConfig = style.toggleSwitch; + var toggleSwitch = CreateToggleSwitch(scene, toggleSwitchConfig); + var size = toggleSwitchConfig.size; + if (size !== undefined) { + toggleSwitch.setSize(size, size); + } + var fitRatio = size !== undefined ? 0 : 1; + gameObject.addSpace().add(toggleSwitch, { + proportion: 0, + expand: false, + fitRatio: fitRatio, + key: 'toggleSwitch' + }); + toggleSwitch.on('valuechange', function (value) { + gameObject.setValue(value); + }); + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var toggleSwitch = gameObject.getElement('toggleSwitch'); + toggleSwitch.setValue(value); + } + }; + + var CreateDropDownList = function CreateDropDownList(scene, config) { + config = BuildListConfig(scene, config); + var gameObject = new DropDownList(scene, config); + scene.add.existing(gameObject); + return gameObject; + }; + + var GetOptionIndex = function GetOptionIndex(options, value) { + for (var i = 0, cnt = options.length; i < cnt; i++) { + var option = options[i]; + if (option.value === value) { + return i; + } + } + return undefined; + }; + var GetOptionText = function GetOptionText(options, value) { + var index = GetOptionIndex(options, value); + if (index == null) { + return undefined; + } + return options[index].text; + }; + + var SetOptions$1 = function SetOptions(gameObject, options) { + var list = gameObject.getElement('list'); + list.setOptions(options); + }; + var ListInputHandler = { + name: 'ListInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'list'; + } + return config.hasOwnProperty('options'); + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.ListInput'; + var list = CreateDropDownList(scene, style.list); + gameObject.add(list, { + proportion: 1, + expand: true, + key: 'list' + }); + list.on('button.click', function (dropDownList, listPanel, button, index, pointer, event) { + gameObject.setValue(button.value); + }); + }, + // Callback inside `setup()` + setup: function setup(gameObject, config, setDefaults) { + if (setDefaults || config.hasOwnProperty('options')) { + SetOptions$1(gameObject, config.options); + } + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var list = gameObject.getElement('list'); + var text = GetOptionText(list.options, value); + list.resetDisplayContent({ + text: text + }); + } + }; + + var CreateButtons = function CreateButtons(scene, config) { + var gameObject = new Buttons$1(scene, config); + scene.add.existing(gameObject); + return gameObject; + }; + + var SetButtonsActiveStateByIndex = function SetButtonsActiveStateByIndex(buttons, index) { + for (var i = 0, cnt = buttons.length; i < cnt; i++) { + var button = buttons[i]; + if (!button) { + continue; + } + button.setActiveState(i === index); + } + }; + + var GetValue$6 = Phaser.Utils.Objects.GetValue; + var SetOptions = function SetOptions(gameObject, options) { + var list = gameObject.getElement('list'); + list.options = options; + var scene = gameObject.scene; + var buttonConfig = list.buttonConfig; + list.clearButtons(true); + for (var i = 0, cnt = options.length; i < cnt; i++) { + var option = options[i]; + var button = CreateLabel(scene, buttonConfig).setActiveState(false).resetDisplayContent({ + text: option.text + }); + list.addButton(button); + } + }; + var ButtonsInputHandler = { + name: 'ButtonsInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'buttons'; + } + return false; + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.ButtonsInput'; + + // TODO : DeepClone? + var buttonConfig = style.button ? DeepClone(style.button) : {}; + var buttonExpand = GetValue$6(buttonConfig, 'expand', true); + if (buttonExpand) { + buttonConfig.align = 'center'; + } + delete buttonConfig.expand; + var list = CreateButtons(scene, { + expand: buttonExpand + }); + list.buttonConfig = buttonConfig; + gameObject.add(list, { + proportion: 1, + expand: true, + key: 'list' + }); + list.on('button.click', function (button, index, pointer, event) { + var option = list.options[index]; + if (!option) { + return; // ?? + } + + gameObject._selectedIndex = index; + gameObject.setValue(option.value); + gameObject._selectedIndex = undefined; + }); + }, + // Callback inside `setup()` + setup: function setup(gameObject, config, setDefaults) { + if (setDefaults || config.hasOwnProperty('options')) { + SetOptions(gameObject, config.options); + } + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var list = gameObject.getElement('list'); + var index = gameObject._selectedIndex; // See list's 'button.click' event + if (index === undefined) { + index = GetOptionIndex(list.options, value); + } + SetButtonsActiveStateByIndex(list.childrenMap.buttons, index); + } + }; + + var RegisterDefaultInputHandlers = function RegisterDefaultInputHandlers() { + this.registerInputHandler(TextInputHandler).registerInputHandler(TextAreaInputHandler).registerInputHandler(NumberInputHandler).registerInputHandler(RangeInputHandler).registerInputHandler(ColorInputHandler).registerInputHandler(CheckboxInputHandler).registerInputHandler(ToggleSwitchInputHandler).registerInputHandler(ListInputHandler).registerInputHandler(ButtonsInputHandler); + }; + var Tweaker = /*#__PURE__*/function (_TweakerShell) { _inherits(Tweaker, _TweakerShell); var _super = _createSuper(Tweaker); @@ -55812,9 +55672,22 @@ // Create sizer _this = _super.call(this, scene, config); _this.type = 'rexTweaker'; + _this.inputHandlers = []; + RegisterDefaultInputHandlers.call(_assertThisInitialized(_this)); return _this; } - return _createClass(Tweaker); + _createClass(Tweaker, [{ + key: "destroy", + value: function destroy(fromScene) { + // This Game Object has already been destroyed + if (!this.scene || this.ignoreDestroy) { + return; + } + _get(_getPrototypeOf(Tweaker.prototype), "destroy", this).call(this, fromScene); + this.inputHandlers = undefined; + } + }]); + return Tweaker; }(TweakerShell); var GetShowCallback$1 = function GetShowCallback() { diff --git a/dist/rexgameobjectshellplugin.min.js b/dist/rexgameobjectshellplugin.min.js index f52ab21135..1ab50b50bf 100644 --- a/dist/rexgameobjectshellplugin.min.js +++ b/dist/rexgameobjectshellplugin.min.js @@ -1,22 +1,22 @@ -!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).rexgameobjectshellplugin=e();}(undefined,(function(){function t(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n);}return i}function e(e){for(var i=1;it.length)&&(e=t.length);for(var i=0,n=new Array(e);i=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 _(this.children,t,0,(function(t){t.once("destroy",e.onChildDestroy,e);}),this),this}},{key:"remove",value:function(t,e){var i=this;return L(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));}},dt=Phaser.Utils.Array,ft={getChildren:function(t){if(t)for(var e=0,i=this.children.length;et.length)&&(e=t.length);for(var i=0,n=new Array(e);i=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 _(this.children,t,0,(function(t){t.once("destroy",e.onChildDestroy,e);}),this),this}},{key:"remove",value:function(t,e){var i=this;return L(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));}},dt=Phaser.Utils.Array,ft={getChildren:function(t){if(t)for(var e=0,i=this.children.length;e * @copyright 2018 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */Object.assign(Le.prototype,me);var Re=function(t){return null==t||""===t||0===t.length},Be=function(t,e,n,s){if(void 0===s&&(s="."),"object"===i(t)){if(Re(e)){if(null==n)return;"object"===i(n)&&(t=n);}else {"string"==typeof e&&(e=e.split(s));var r=e.pop(),o=function(t,e,n){var s=t;if(Re(e));else {var r;"string"==typeof e&&(e=e.split("."));for(var o=0,a=e.length;o=6?(n=[arguments[2],void 0,arguments[3]],s=[arguments[4],void 0,arguments[5]]):(n=xe(n),s=xe(s)),this.textureKey=t,this.baseFrameName=e,this.columns.data=n,this.columns.count=n?n.length:0,this.columns.stretch=0,this.columns.minWidth=0,this.columns.scale=1,this.rows.data=s,this.rows.count=s?s.length:0,this.rows.stretch=0,this.rows.minHeight=0,this.rows.scale=1;var r=this.scene.sys.textures.get(t);if(!r)return this.clear(),this;if(!n||!s)return this.clear(),this;for(var o=r.get(e),a=o.width,h=0,l=0,u=n.length;l0?0:g,b=0;l=0;for(var S=n.length;l0?0:y),y>=1&&g>=1){var O=i(k=this.getFrameNameCallback(l,x,e));"string"!==O&&"number"!==O||r.add(k,0,b+o.cutX,C+o.cutY,y,g);}b+=y;}C+=g;}return this.updateTexture(),this},updateTexture:function(){if(this.clear(),void 0===this.textureKey)return this;var t=this.scene.sys.textures.get(this.textureKey);if(!t)return this;var e,i,n,s,r,o,a,h=this.columns.minWidth*this.maxFixedPartScaleX,l=this.rows.minHeight*this.maxFixedPartScaleY,u=this.width-h,c=this.height-l,d=u>=0?this.maxFixedPartScaleX:this.width/h,f=c>=0?this.maxFixedPartScaleY:this.height/l;if(this.preserveRatio){var p=Math.min(d,f);if(d>p){var v=(d-p)*h;u>=0?u+=v:u=v,d=p;}if(f>p){var g=(f-p)*l;c>=0?c+=g:c=g,f=p;}}this.columns.scale=d,this.rows.scale=f,e=u>0&&this.columns.stretch>0?u/this.columns.stretch:0,i=c>0&&this.rows.stretch>0?c/this.rows.stretch:0;var y=0,k=0;this._beginDraw();for(var m=0,b=this.rows.count;m0&&a>0&&(0===(0===r.stretch&&0===s.stretch||0===this.getStretchMode(C,m)?0:1)?this._drawImage(this.textureKey,n,y,k,o,a):this._drawTileSprite(this.textureKey,n,y,k,o,a)),y+=o;k+=a;}this._endDraw();},setStretchMode:function(t){return De(t)?(this.stretchMode.edge=Ie(Ae(t,"edge",0)),this.stretchMode.internal=Ie(Ae(t,"internal",0))):(t=Ie(t),this.stretchMode.edge=t,this.stretchMode.internal=t),this},getStretchMode:function(t,e){return Fe.call(this,t,e)?this.stretchMode.edge:this.stretchMode.internal},setPreserveRatio:function(t){return null==t&&(t=!0),this.preserveRatio=t,this},setMaxFixedPartScale:function(t,e){return void 0===e&&(e=t),this.maxFixedPartScaleX=t,this.maxFixedPartScaleY=e,this}},Ve=Phaser.Utils.Objects.IsPlainObject,Xe=Phaser.Utils.Objects.GetValue,Ge=function(t,e){var i=function(t){a(s,t);var i=d(s);function s(t,r,o,a,h,l,u,c,d,f){var p;if(n(this,s),Ve(r)?(r=Xe(f=r,"x",0),o=Xe(f,"y",0),a=Xe(f,"width",1),h=Xe(f,"height",1),l=Xe(f,"key",void 0),u=Xe(f,"baseFrame",void 0),c=Xe(f,"columns",void 0),d=Xe(f,"rows",void 0)):Ve(a)?(a=Xe(f=a,"width",1),h=Xe(f,"height",1),l=Xe(f,"key",void 0),u=Xe(f,"baseFrame",void 0),c=Xe(f,"columns",void 0),d=Xe(f,"rows",void 0)):Ve(l)?(l=Xe(f=l,"key",void 0),u=Xe(f,"baseFrame",void 0),c=Xe(f,"columns",void 0),d=Xe(f,"rows",void 0)):Ve(u)?(u=Xe(f=u,"baseFrame",void 0),c=Xe(f,"columns",void 0),d=Xe(f,"rows",void 0)):Array.isArray(u)?(f=d,d=c,c=u,u=Xe(f,"baseFrame",void 0)):Ve(c)&&(c=Xe(f=c,"columns",void 0),d=Xe(f,"rows",void 0)),void 0===c){var v=Xe(f,"leftWidth",void 0),g=Xe(f,"rightWidth",void 0);void 0!==v&&void 0!==g&&(c=[v,void 0,g]);}if(void 0===d){var y=Xe(f,"topHeight",void 0),k=Xe(f,"bottomHeight",void 0);void 0!==y&&void 0!==k&&(d=[y,void 0,k]);}(p=i.call(this,t)).type=e,p.setPosition(r,o).setSize(a,h).setOrigin(.5,.5),p.columns={},p.rows={},p.stretchMode={},p._tileSprite=void 0,p._image=void 0,p.setGetFrameNameCallback(Xe(f,"getFrameNameCallback",void 0)),p.setStretchMode(Xe(f,"stretchMode",0)),p.setPreserveRatio(Xe(f,"preserveRatio",!0));var m=Xe(f,"maxFixedPartScale",1),b=Xe(f,"maxFixedPartScaleX",m),C=Xe(f,"maxFixedPartScaleY",void 0);return p.setMaxFixedPartScale(b,C),p.setBaseTexture(l,u,c,d),p}return r(s,[{key:"minWidth",get:function(){return this.columns.minWidth}},{key:"minHeight",get:function(){return this.rows.minHeight}},{key:"fixedPartScaleX",get:function(){return this.columns.scale}},{key:"fixedPartScaleY",get:function(){return this.rows.scale}},{key:"resize",value:function(t,e){return this.width===t&&this.height===e||(p(h(s.prototype),"resize",this)?p(h(s.prototype),"resize",this).call(this,t,e):p(h(s.prototype),"setSize",this).call(this,t,e),this.updateTexture()),this}}]),s}(t);return Object.assign(i.prototype,We),i},He=Phaser.Game,Ue=function(t){return t instanceof He},Ne=Phaser.Scene,Ke=function(t){return t instanceof Ne},Je=function(t){return null==t||"object"!==i(t)?null:Ue(t)?t:Ue(t.game)?t.game:Ke(t)?t.sys.game:Ke(t.scene)?t.scene.sys.game:void 0},Ze=Phaser.GameObjects,qe=void 0,$e=function(t,e){if(qe||(qe={},Je(t).events.once("destroy",(function(){for(var t in qe)qe[t].destroy();qe=void 0;}))),!qe.hasOwnProperty(e)){var i=Je(t).scene.systemScene;(t=new Ze[e](i)).setOrigin(0),qe[e]=t;}return qe[e]},Qe=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i)}(Ge(Phaser.GameObjects.RenderTexture,"rexNinePatch")),ti={_drawImage:function(t,e,i,n,s,r){var o=$e(this,"Image").setTexture(t,e).setDisplaySize(s,r);this.draw(o,i,n);},_drawTileSprite:function(t,e,i,n,s,r){var o=$e(this,"TileSprite").setTexture(t,e).setSize(s,r);this.draw(o,i,n);}};Object.assign(Qe.prototype,ti);var ei=Phaser.GameObjects.GetCalcMatrix,ii=Phaser.Renderer.Canvas.SetTransform,ni={renderWebGL:function(t,e,i,n){var s=e.getRenderList();if(0!==s.length){i.addToRenderList(e);var r=t.pipelines.set(e.pipeline),o=e.frame.glTexture,a=r.setGameObject(e),h=i.roundPixels,l=ei(e,i,n),u=r.calcMatrix.copyFrom(l.calc),c=e._displayOriginX,d=e._displayOriginY,f=i.alpha*e.alpha;t.pipelines.preBatch(e);for(var p=0,v=s.length;p0?this.items.pop():null}},{key:"push",value:function(t){return this.items.push(t),this}},{key:"pushMultiple",value:function(t){return this.items.push.apply(this.items,t),t.length=0,this}},{key:"clear",value:function(){return this.items.length=0,this}}]),t}(),li=Phaser.Utils.Objects.GetValue,ui={},ci=function(){function t(e){n(this,t),this.pools=li(e,"pools",ui);}return r(t,[{key:"destroy",value:function(){this.pools=void 0;}},{key:"free",value:function(t){if(!this.pools)return this;var e=t.type;return this.pools.hasOwnProperty(e)||(this.pools[e]=new hi),this.pools[e].push(t),t.onFree(),this}},{key:"freeMultiple",value:function(t){if(!this.pools)return this;for(var e=0,i=t.length;e0},mi=function(t,e){return t._depth-e._depth},bi=Phaser.GameObjects.Components;Phaser.Class.mixin(yi,[bi.Alpha,bi.BlendMode,bi.ComputedSize,bi.Depth,bi.GetBounds,bi.Mask,bi.Origin,bi.Pipeline,bi.PostPipeline,bi.ScrollFactor,bi.Transform,bi.Visible,ni,ai]);var Ci="image",xi=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),s=t,r=i,o=0;o=6?(n=[arguments[2],void 0,arguments[3]],s=[arguments[4],void 0,arguments[5]]):(n=xe(n),s=xe(s)),this.textureKey=t,this.baseFrameName=e,this.columns.data=n,this.columns.count=n?n.length:0,this.columns.stretch=0,this.columns.minWidth=0,this.columns.scale=1,this.rows.data=s,this.rows.count=s?s.length:0,this.rows.stretch=0,this.rows.minHeight=0,this.rows.scale=1;var r=this.scene.sys.textures.get(t);if(!r)return this.clear(),this;if(!n||!s)return this.clear(),this;for(var o=r.get(e),a=o.width,h=0,l=0,u=n.length;l0?0:g,b=0;l=0;for(var S=n.length;l0?0:y),y>=1&&g>=1){var O=i(k=this.getFrameNameCallback(l,x,e));"string"!==O&&"number"!==O||r.add(k,0,b+o.cutX,C+o.cutY,y,g);}b+=y;}C+=g;}return this.updateTexture(),this},updateTexture:function(){if(this.clear(),void 0===this.textureKey)return this;var t=this.scene.sys.textures.get(this.textureKey);if(!t)return this;var e,i,n,s,r,o,a,h=this.columns.minWidth*this.maxFixedPartScaleX,l=this.rows.minHeight*this.maxFixedPartScaleY,u=this.width-h,c=this.height-l,d=u>=0?this.maxFixedPartScaleX:this.width/h,f=c>=0?this.maxFixedPartScaleY:this.height/l;if(this.preserveRatio){var p=Math.min(d,f);if(d>p){var v=(d-p)*h;u>=0?u+=v:u=v,d=p;}if(f>p){var g=(f-p)*l;c>=0?c+=g:c=g,f=p;}}this.columns.scale=d,this.rows.scale=f,e=u>0&&this.columns.stretch>0?u/this.columns.stretch:0,i=c>0&&this.rows.stretch>0?c/this.rows.stretch:0;var y=0,k=0;this._beginDraw();for(var m=0,b=this.rows.count;m0&&a>0&&(0===(0===r.stretch&&0===s.stretch||0===this.getStretchMode(C,m)?0:1)?this._drawImage(this.textureKey,n,y,k,o,a):this._drawTileSprite(this.textureKey,n,y,k,o,a)),y+=o;k+=a;}this._endDraw();},setStretchMode:function(t){return De(t)?(this.stretchMode.edge=Ie(Ae(t,"edge",0)),this.stretchMode.internal=Ie(Ae(t,"internal",0))):(t=Ie(t),this.stretchMode.edge=t,this.stretchMode.internal=t),this},getStretchMode:function(t,e){return Fe.call(this,t,e)?this.stretchMode.edge:this.stretchMode.internal},setPreserveRatio:function(t){return null==t&&(t=!0),this.preserveRatio=t,this},setMaxFixedPartScale:function(t,e){return void 0===e&&(e=t),this.maxFixedPartScaleX=t,this.maxFixedPartScaleY=e,this}},We=Phaser.Utils.Objects.IsPlainObject,Xe=Phaser.Utils.Objects.GetValue,Ge=function(t,e){var i=function(t){a(s,t);var i=d(s);function s(t,r,o,a,h,l,u,c,d,f){var p;if(n(this,s),We(r)?(r=Xe(f=r,"x",0),o=Xe(f,"y",0),a=Xe(f,"width",1),h=Xe(f,"height",1),l=Xe(f,"key",void 0),u=Xe(f,"baseFrame",void 0),c=Xe(f,"columns",void 0),d=Xe(f,"rows",void 0)):We(a)?(a=Xe(f=a,"width",1),h=Xe(f,"height",1),l=Xe(f,"key",void 0),u=Xe(f,"baseFrame",void 0),c=Xe(f,"columns",void 0),d=Xe(f,"rows",void 0)):We(l)?(l=Xe(f=l,"key",void 0),u=Xe(f,"baseFrame",void 0),c=Xe(f,"columns",void 0),d=Xe(f,"rows",void 0)):We(u)?(u=Xe(f=u,"baseFrame",void 0),c=Xe(f,"columns",void 0),d=Xe(f,"rows",void 0)):Array.isArray(u)?(f=d,d=c,c=u,u=Xe(f,"baseFrame",void 0)):We(c)&&(c=Xe(f=c,"columns",void 0),d=Xe(f,"rows",void 0)),void 0===c){var v=Xe(f,"leftWidth",void 0),g=Xe(f,"rightWidth",void 0);void 0!==v&&void 0!==g&&(c=[v,void 0,g]);}if(void 0===d){var y=Xe(f,"topHeight",void 0),k=Xe(f,"bottomHeight",void 0);void 0!==y&&void 0!==k&&(d=[y,void 0,k]);}(p=i.call(this,t)).type=e,p.setPosition(r,o).setSize(a,h).setOrigin(.5,.5),p.columns={},p.rows={},p.stretchMode={},p._tileSprite=void 0,p._image=void 0,p.setGetFrameNameCallback(Xe(f,"getFrameNameCallback",void 0)),p.setStretchMode(Xe(f,"stretchMode",0)),p.setPreserveRatio(Xe(f,"preserveRatio",!0));var m=Xe(f,"maxFixedPartScale",1),b=Xe(f,"maxFixedPartScaleX",m),C=Xe(f,"maxFixedPartScaleY",void 0);return p.setMaxFixedPartScale(b,C),p.setBaseTexture(l,u,c,d),p}return r(s,[{key:"minWidth",get:function(){return this.columns.minWidth}},{key:"minHeight",get:function(){return this.rows.minHeight}},{key:"fixedPartScaleX",get:function(){return this.columns.scale}},{key:"fixedPartScaleY",get:function(){return this.rows.scale}},{key:"resize",value:function(t,e){return this.width===t&&this.height===e||(p(h(s.prototype),"resize",this)?p(h(s.prototype),"resize",this).call(this,t,e):p(h(s.prototype),"setSize",this).call(this,t,e),this.updateTexture()),this}}]),s}(t);return Object.assign(i.prototype,Ve),i},He=Phaser.Game,Ue=function(t){return t instanceof He},Ne=Phaser.Scene,Ke=function(t){return t instanceof Ne},Je=function(t){return null==t||"object"!==i(t)?null:Ue(t)?t:Ue(t.game)?t.game:Ke(t)?t.sys.game:Ke(t.scene)?t.scene.sys.game:void 0},Ze=Phaser.GameObjects,qe=void 0,$e=function(t,e){if(qe||(qe={},Je(t).events.once("destroy",(function(){for(var t in qe)qe[t].destroy();qe=void 0;}))),!qe.hasOwnProperty(e)){var i=Je(t).scene.systemScene;(t=new Ze[e](i)).setOrigin(0),qe[e]=t;}return qe[e]},Qe=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i)}(Ge(Phaser.GameObjects.RenderTexture,"rexNinePatch")),ti={_drawImage:function(t,e,i,n,s,r){var o=$e(this,"Image").setTexture(t,e).setDisplaySize(s,r);this.draw(o,i,n);},_drawTileSprite:function(t,e,i,n,s,r){var o=$e(this,"TileSprite").setTexture(t,e).setSize(s,r);this.draw(o,i,n);}};Object.assign(Qe.prototype,ti);var ei=Phaser.GameObjects.GetCalcMatrix,ii=Phaser.Renderer.Canvas.SetTransform,ni={renderWebGL:function(t,e,i,n){var s=e.getRenderList();if(0!==s.length){i.addToRenderList(e);var r=t.pipelines.set(e.pipeline),o=e.frame.glTexture,a=r.setGameObject(e),h=i.roundPixels,l=ei(e,i,n),u=r.calcMatrix.copyFrom(l.calc),c=e._displayOriginX,d=e._displayOriginY,f=i.alpha*e.alpha;t.pipelines.preBatch(e);for(var p=0,v=s.length;p0?this.items.pop():null}},{key:"push",value:function(t){return this.items.push(t),this}},{key:"pushMultiple",value:function(t){return this.items.push.apply(this.items,t),t.length=0,this}},{key:"clear",value:function(){return this.items.length=0,this}}]),t}(),li=Phaser.Utils.Objects.GetValue,ui={},ci=function(){function t(e){n(this,t),this.pools=li(e,"pools",ui);}return r(t,[{key:"destroy",value:function(){this.pools=void 0;}},{key:"free",value:function(t){if(!this.pools)return this;var e=t.type;return this.pools.hasOwnProperty(e)||(this.pools[e]=new hi),this.pools[e].push(t),t.onFree(),this}},{key:"freeMultiple",value:function(t){if(!this.pools)return this;for(var e=0,i=t.length;e0},mi=function(t,e){return t._depth-e._depth},bi=Phaser.GameObjects.Components;Phaser.Class.mixin(yi,[bi.Alpha,bi.BlendMode,bi.ComputedSize,bi.Depth,bi.GetBounds,bi.Mask,bi.Origin,bi.Pipeline,bi.PostPipeline,bi.ScrollFactor,bi.Transform,bi.Visible,ni,ai]);var Ci="image",xi=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),s=t,r=i,o=0;o * @copyright 2019 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */Object.assign(Si.prototype,wi);var Oi=Phaser.Math.DegToRad,Pi=Phaser.Math.RadToDeg,Ti=Phaser.Utils.Objects.GetValue,Mi=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"visible",get:function(){return this._visible},set:function(t){this.setDisplayListDirty(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.setDisplayListDirty(!!this._alpha!=!!t),this._alpha=t;}},{key:"setAlpha",value:function(t){return this.alpha=t,this}},{key:"setX",value:function(t){return this.x=t,this}},{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:"setRotation",value:function(t){return this.rotation=t,this}},{key:"angle",get:function(){return Pi(this.rotation)},set:function(t){this.rotation=Oi(t);}},{key:"setAngle",value:function(t){return this.angle=t,this}},{key:"setScaleX",value:function(t){return this.scaleX=t,this}},{key:"width",get:function(){return this._width},set:function(t){this._width=t;}},{key:"setWidth",value:function(t,e){return void 0===e&&(e=!1),this.width=t,e&&(this.scaleY=this.scaleX),this}},{key:"setScaleY",value:function(t){return this.scaleY=t,this}},{key:"setScale",value:function(t,e){return void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this}},{key:"height",get:function(){return this._height},set:function(t){this._height=t;}},{key:"setHeight",value:function(t,e){return void 0===e&&(e=!1),this.height=t,e&&(this.scaleX=this.scaleY),this}},{key:"displayWidth",get:function(){return this._width*this.scaleX},set:function(t){this.scaleX=t/this._width;}},{key:"setDisplayWidth",value:function(t,e){return void 0===e&&(e=!1),this.displayWidth=t,e&&(this.scaleY=this.scaleX),this}},{key:"displayHeight",get:function(){return this._height*this.scaleY},set:function(t){this.scaleY=t/this._height;}},{key:"setDisplayHeight",value:function(t,e){return void 0===e&&(e=!1),this.displayHeight=t,e&&(this.scaleX=this.scaleY),this}},{key:"setOriginX",value:function(t){return this.originX=t,this._displayOriginX=this.width*t,this}},{key:"setOriginY",value:function(t){return this.originY=t,this._displayOriginY=this.height*t,this}},{key:"setOrigin",value:function(t,e){return void 0===e&&(e=t),this.setOriginX(t).setOriginY(e),this}},{key:"depth",get:function(){return this._depth},set:function(t){this.setDisplayListDirty(this._depth!=t),this._depth=t;}},{key:"setDepth",value:function(t){return void 0===t&&(t=0),this.depth=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=Ti(t,"width",void 0),i=Ti(t,"height",void 0),n=Ti(t,"scale",void 0),s=Ti(t,"scaleX",n),r=Ti(t,"scaleY",n);void 0!==e?void 0===i&&void 0===r?this.setWidth(e,!0):this.setWidth(e):void 0!==s?this.setScaleX(s):t.hasOwnProperty("displayWidth")&&this.setDisplayWidth(t.displayWidth),void 0!==i?void 0===e&&void 0===s?this.setHeight(i,!0):this.setHeight(i):void 0!==r?this.setScaleY(r):t.hasOwnProperty("displayHeight")&&this.setDisplayHeight(t.displayHeight);var o=Ti(t,"origin",void 0);return void 0!==o?this.setOrigin(o):(t.hasOwnProperty("originX")&&this.setOriginX(t.originX),t.hasOwnProperty("originY")&&this.setOriginY(t.originY)),t.hasOwnProperty("depth")&&this.setDepth(t.depth),this}},{key:"reset",value:function(){return p(h(i.prototype),"reset",this).call(this),this.setVisible().setAlpha(1).setPosition(0,0).setRotation(0).setScale(1,1).setOrigin(0).setDepth(0),this}},{key:"webglRender",value:function(t,e,i,n,s,r,o,a){}},{key:"canvasRender",value:function(t,e,i,n){}}]),i}(Si),Ei=Phaser.GameObjects.Components.TransformMatrix,_i=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,Li=new Ei,Ri=Phaser.Utils.Objects.IsPlainObject,Bi=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,Ci)).setFrame(s),r}return r(i,[{key:"width",get:function(){return this._width},set:function(t){}},{key:"height",get:function(){return this._height},set:function(t){}},{key:"setFrame",value:function(t){return arguments.length>0&&!Ri(t)&&(t=this.parent.texture.get(t)),this.frame=t,this._width=t?t.width:0,this._height=t?t.height:0,this}},{key:"setFlipX",value:function(t){return void 0===t&&(t=!0),this.flipX=t,this}},{key:"setFlipY",value:function(t){return void 0===t&&(t=!0),this.flipY=t,this}},{key:"resetFlip",value:function(){return this.flipX=!1,this.flipY=!1,this}},{key:"tint",get:function(){return void 0===this._tint?this.parent.tint:this._tint},set:function(t){this._tint=t;}},{key:"setTint",value:function(t){return this.tint=t,this.tintFill=!1,this}},{key:"setTintFill",value:function(t){return this.tint=t,this.tintFill=!0,this}},{key:"clearTint",value:function(){return this.setTint(16777215),this}},{key:"resetTint",value:function(){return this.tint=void 0,this.tintFill=void 0,this}},{key:"tintFill",get:function(){return void 0===this._tintFill?this.parent.tintFill:this._tintFill},set:function(t){this._tintFill=t;}},{key:"reset",value:function(){return p(h(i.prototype),"reset",this).call(this),this.resetFlip().resetTint().setFrame(),this}},{key:"modifyPorperties",value:function(t){return t?(t.hasOwnProperty("width")&&(t.displayWidth=t.width,delete t.width),t.hasOwnProperty("height")&&(t.displayHeight=t.height,delete t.height),t.hasOwnProperty("frame")&&this.setFrame(t.frame),p(h(i.prototype),"modifyPorperties",this).call(this,t),t.hasOwnProperty("flipX")&&this.setFlipX(t.flipX),t.hasOwnProperty("flipY")&&this.setFlipY(t.flipY),t.hasOwnProperty("tint")&&this.setTint(t.tint),t.hasOwnProperty("tintFill")&&this.setTintFill(t.tintFill),this):this}}]),i}(Mi),ji={webglRender:function(t,e,i,n,s,r,o,a){var h=this._width,l=this._height,u=h*this.originX,c=l*this.originY,d=this.x-n,f=this.y-s,p=1,v=1;this.flipX&&(d+=h-2*u,p=-1),this.flipY&&(f+=l-2*c,v=-1),Li.applyITRS(d,f,this.rotation,this.scaleX*p,this.scaleY*v),e.multiply(Li,Li);var g=-u,y=-c,k=g+h,m=y+l,b=Li.setQuad(g,y,k,m,a),C=this.frame.u0,x=this.frame.v0,w=this.frame.u1,S=this.frame.v1,O=_i(this.tint,this.alpha*i);t.batchQuad(this.parent,b[0],b[1],b[2],b[3],b[4],b[5],b[6],b[7],C,x,w,S,O,O,O,O,this.tintFill,r,o);},canvasRender:function(t,e,i,n){t.save();var s=this._width,r=this._height,o=s*this.originX,a=r*this.originY,h=this.x-o,l=this.y-a,u=1,c=1;this.flipX&&(h+=s,u=-1),this.flipY&&(l+=r,c=-1),n&&(h=Math.round(h),l=Math.round(l)),t.translate(h,l),t.rotate(this.rotation),t.scale(this.scaleX*u,this.scaleY*c);var d=this.frame;t.drawImage(d.source.image,d.cutX,d.cutY,s,r,0,0,s,r),t.restore();}};Object.assign(Bi.prototype,ji);var Di=function(t,e){"string"==typeof e&&(e={frame:e});var i=t.poolManager?t.poolManager.allocate(Ci):null;return null===i?i=new Bi(t):i.setParent(t).setActive(),i.modifyPorperties(e),t.addChild(i),i},Ai={_drawImage:function(t,e,i,n,s,r){Di(this,{frame:e,x:i,y:n,width:s,height:r});},_drawTileSprite:function(t,e,i,n,s,r){var o=this.texture.get(e),a=o.width,h=o.height,l=Math.floor(s/a),u=Math.floor(r/h);i+=(s-l*a)/2,n+=(r-u*h)/2;for(var c=0;c=0||t.y>=0,t.x=Math.abs(t.x),t.y=Math.abs(t.y);},Xi=function(t,e,i){var n=i.length;if(n>=2){var s=i[n-2],r=i[n-1];if(t===s&&e===r)return i}return i.push(t,e),i},Gi=Phaser.Math.DegToRad,Hi=function(t,e,i,n,s,r,o,a,h){o&&r>s?r-=360:!o&&r>>16,a=(65280&s)>>>8,h=255&s;t.fillStyle="rgba("+o+","+a+","+h+","+r+")";},$i=function(t,e,i,n){var s=i||e.strokeColor,r=n||e.strokeAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.strokeStyle="rgba("+o+","+a+","+h+","+r+")",t.lineWidth=e.lineWidth;},Qi=Phaser.Renderer.Canvas.SetTransform,tn={renderWebGL:function(t,e,i,n){e.dirty&&(e.updateData(),e.dirty=!1),i.addToRenderList(e);var s=t.pipelines.set(e.pipeline),r=Zi(e,i,n),o=s.calcMatrix.copyFrom(r.calc),a=e._displayOriginX,h=e._displayOriginY,l=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&Ni(s,o,e,l,a,h),e.isStroked&&Ji(s,e,l,a,h),t.pipelines.postBatch(e);},renderCanvas:function(t,e,i,n){e.dirty&&(e.updateData(),e.dirty=!1),i.addToRenderList(e);var s=t.currentContext;if(Qi(t,s,e,i,n)){var r=e._displayOriginX,o=e._displayOriginY,a=e.pathData,h=a.length-1,l=a[0]-r,u=a[1]-o;s.beginPath(),s.moveTo(l,u),e.closePath||(h-=2);for(var c=2;c0;}},{key:"fillAlpha",get:function(){return this._fillAlpha},set:function(t){this._fillAlpha=t,this.isFilled=t>0&&null!=this._fillColor;}},{key:"setFillStyle",value:function(t,e){return void 0===e&&(e=1),this.fillColor=t,this.fillAlpha=e,this}},{key:"strokeColor",get:function(){return this._strokeColor},set:function(t){this._strokeColor=t,this.isStroked=null!=t&&this._strokeAlpha>0&&this._lineWidth>0;}},{key:"strokeAlpha",get:function(){return this._strokeAlpha},set:function(t){this._strokeAlpha=t,this.isStroked=t>0&&null!=this._strokeColor&&this._lineWidth>0;}},{key:"lineWidth",get:function(){return this._lineWidth},set:function(t){this._lineWidth=t,this.isStroked=t>0&&null!=this._strokeColor;}},{key:"setStrokeStyle",value:function(t,e,i){return void 0===i&&(i=1),this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this}},{key:"updateData",value:function(){var t=this.geom,e=this.pathData;e.length=0;var i,n=t.width,s=t.height,r=t.cornerRadius,o=this.iteration+1;if(i=r.tl,an(i))if(i.convex){var a=i.x,h=i.y;Hi(a,h,i.x,i.y,180,270,!1,o,e);}else {Hi(a=0,h=0,i.x,i.y,90,0,!0,o,e);}else Xi(0,0,e);if(i=r.tr,an(i))if(i.convex){a=n-i.x,h=i.y;Hi(a,h,i.x,i.y,270,360,!1,o,e);}else {Hi(a=n,h=0,i.x,i.y,180,90,!0,o,e);}else Xi(n,0,e);if(i=r.br,an(i))if(i.convex){a=n-i.x,h=s-i.y;Hi(a,h,i.x,i.y,0,90,!1,o,e);}else {Hi(a=n,h=s,i.x,i.y,270,180,!0,o,e);}else Xi(n,s,e);if(i=r.bl,an(i))if(i.convex){a=i.x,h=s-i.y;Hi(a,h,i.x,i.y,90,180,!1,o,e);}else {Hi(a=0,h=s,i.x,i.y,360,270,!0,o,e);}else Xi(0,s,e);return e.push(e[0],e[1]),this.pathIndexes=rn(e),this}},{key:"setShapeType",value:function(t){return "string"==typeof t&&(t=hn[t]),this.shapeType=t,this}},{key:"width",get:function(){return this.geom.width},set:function(t){this.resize(t,this.height);}},{key:"height",get:function(){return this.geom.height},set:function(t){this.resize(this.width,t);}},{key:"setSize",value:function(t,e){if(void 0===e&&(e=t),this.geom.width===t&&this.geom.height===e)return this;this.geom.setSize(t,e),1===this.shapeType&&this.setRadius({x:t/2,y:e/2}),this.updateDisplayOrigin(),this.dirty=!0;var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this}},{key:"resize",value:function(t,e){return this.setSize(t,e),this}},{key:"radius",get:function(){return this.geom.radius},set:function(t){this.geom.setRadius(t),this.updateDisplayOrigin(),this.dirty=!0;}},{key:"radiusTL",get:function(){return this.geom.radiusTL},set:function(t){this.geom.radiusTL=t,this.dirty=!0;}},{key:"radiusTR",get:function(){return this.geom.radiusTR},set:function(t){this.geom.radiusTR=t,this.dirty=!0;}},{key:"radiusBL",get:function(){return this.geom.radiusBL},set:function(t){this.geom.radiusBL=t,this.dirty=!0;}},{key:"radiusBR",get:function(){return this.geom.radiusBR},set:function(t){this.geom.radiusBR=t,this.dirty=!0;}},{key:"setRadius",value:function(t){return void 0===t&&(t=0),this.radius=t,this}},{key:"setRadiusTL",value:function(t){return void 0===t&&(t=0),this.radiusTL=t,this}},{key:"setRadiusTR",value:function(t){return void 0===t&&(t=0),this.radiusTR=t,this}},{key:"setRadiusBL",value:function(t){return void 0===t&&(t=0),this.radiusBL=t,this}},{key:"setRadiusBR",value:function(t){return void 0===t&&(t=0),this.radiusBR=t,this}},{key:"cornerRadius",get:function(){return this.geom.cornerRadius},set:function(t){this.radius=t;}},{key:"setCornerRadius",value:function(t){return this.setRadius(t)}},{key:"iteration",get:function(){return this._iteration},set:function(t){void 0!==this._iteration?this._iteration!==t&&(this._iteration=t,this.dirty=!0):this._iteration=t;}},{key:"setIteration",value:function(t){return void 0===t&&(t=6),this.iteration=t,this}}]),i}(en),an=function(t){return t.x>0&&t.y>0},hn={rectangle:0,circle:1};Object.assign(on.prototype,tn);var ln=Phaser.Renderer.WebGL.Utils,un={renderWebGL:function(t,e,i,n){if(e.dirty&&(e.updateTexture(),e.dirty=!1),0!==e.width&&0!==e.height){i.addToRenderList(e);var s=e.frame,r=s.width,o=s.height,a=ln.getTintAppendFloatAlpha,h=t.pipelines.set(e.pipeline,e),l=h.setTexture2D(s.glTexture,e);t.pipelines.preBatch(e),h.batchTexture(e,s.glTexture,r,o,e.x,e.y,r/e.resolution,o/e.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,r,o,a(e.tintTopLeft,i.alpha*e._alphaTL),a(e.tintTopRight,i.alpha*e._alphaTR),a(e.tintBottomLeft,i.alpha*e._alphaBL),a(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,0,0,i,n,!1,l),t.pipelines.postBatch(e);}},renderCanvas:function(t,e,i,n){e.dirty&&(e.updateTexture(),e.dirty=!1),0!==e.width&&0!==e.height&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,n));}},cn=Phaser.Display.Color,dn={clear:function(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.dirty=!0,this},fill:function(t){return this.context.fillStyle=t,this.context.fillRect(0,0,this.canvas.width,this.canvas.height),this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r,o,a,h,l){var u=this.scene.sys.textures.getFrame(t,e);if(!u)return this;var c=u.cutWidth,d=u.cutHeight;void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=c),void 0===r&&(r=d),void 0===o&&(o=0),void 0===a&&(a=0),void 0===h&&(h=c),void 0===l&&(l=d);var f=u.cutX+o,p=u.cutY+a;return this.context.drawImage(u.source.image,f,p,h,l,i,n,s,r),this.dirty=!0,this},getDataURL:function(t,e){return this.canvas.toDataURL(t,e)},getPixel:function(t,e,i){void 0===i&&(i=new cn);var n=this.context.getImageData(t,e,1,1);return i.setTo(n.data[0],n.data[1],n.data[2],n.data[3]),i},setPixel:function(t,e,i,n,s,r){if("number"!=typeof i){var o=i;i=o.red,n=o.green,s=o.blue,r=o.alpha;}void 0===r&&(r=0!==i||0!==n||0!==s?255:0);var a=this.context.createImageData(1,1);return a.data[0]=i,a.data[1]=n,a.data[2]=s,a.data[3]=r,this.context.putImageData(a,t,e),this.dirty=!0,this}},fn=function(t,e,i,n,s,r,o){var a,h=t.sys.textures,l=t.renderer;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=e.width),void 0===o&&(o=e.height);var u=(a=h.exists(i)?h.get(i):h.createCanvas(i,r,o)).getSourceImage();u.width!==r&&(u.width=r),u.height!==o&&(u.height=o);var c=u.getContext("2d",{willReadFrequently:!0});c.clearRect(0,0,r,o),c.drawImage(e,n,s,r,o),l.gl&&a&&l.canvasToTexture(u,a.source[0].glTexture,!0,0);},pn={updateTexture:function(t,e){t&&(e?t.call(e,this.canvas,this.context):t(this.canvas,this.context)),this.canvas.width===this.frame.width&&this.canvas.height===this.frame.height||this.frame.setSize(this.canvas.width,this.canvas.height),this.renderer&&this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(this.canvas,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!1;var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=this.width,i.hitArea.height=this.height),this},generateTexture:function(t,e,i,n,s){var r=this.canvas;return void 0===n?n=r.width:n*=this.resolution,void 0===s?s=r.height:s*=this.resolution,fn(this.scene,r,t,e,i,n,s),this},loadTexture:function(t,e){var i=this.scene.sys.textures.getFrame(t,e);return i?(this.width!==i.cutWidth||this.height!==i.cutHeight?this.setSize(i.cutWidth,i.cutHeight):this.clear(),this.drawFrame(t,e),this.dirty=!0,this):this}};M();var vn=Phaser.Display.Canvas.CanvasPool,gn=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,"rexCanvas")).renderer=t.sys.game.renderer,h.resolution=1,h._width=o,h._height=a,o=Math.max(Math.ceil(o*h.resolution),1),a=Math.max(Math.ceil(a*h.resolution),1),h.canvas=vn.create(u(h),o,a),h.context=h.canvas.getContext("2d",{willReadFrequently:!0}),h.dirty=!1,h.setPosition(s,r),h.setOrigin(.5,.5),h.initPipeline(),h.initPostPipeline(!0),h._crop=h.resetCropObject(),h.texture=t.sys.textures.addCanvas(null,h.canvas,!0),h.frame=h.texture.get(),h.frame.source.resolution=h.resolution,h.renderer&&h.renderer.gl&&(h.renderer.deleteTexture(h.frame.source.glTexture),h.frame.source.glTexture=null),h.dirty=!0,h}return r(i,[{key:"preDestroy",value:function(){vn.remove(this.canvas),this.texture.destroy(),this.canvas=null,this.context=null;}},{key:"width",get:function(){return this._width},set:function(t){this.setSize(t,this._height);}},{key:"height",get:function(){return this._height},set:function(t){this.setSize(this._width,t);}},{key:"setCanvasSize",value:function(t,e){return this._width===t&&this._height===e||(this._width=t,this._height=e,this.updateDisplayOrigin(),t=Math.max(Math.ceil(t*this.resolution),1),e=Math.max(Math.ceil(e*this.resolution),1),this.canvas.width=t,this.canvas.height=e,this.frame.setSize(t,e),this.dirty=!0),this}},{key:"setSize",value:function(t,e){return this.setCanvasSize(t,e),this}},{key:"displayWidth",get:function(){return this.scaleX*this._width},set:function(t){this.scaleX=t/this._width;}},{key:"displayHeight",get:function(){return this.scaleY*this._height},set:function(t){this.scaleY=t/this._height;}},{key:"setDisplaySize",value:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}},{key:"getCanvas",value:function(t){return t||(this.dirty=!0),this.canvas}},{key:"getContext",value:function(t){return t||(this.dirty=!0),this.context}},{key:"needRedraw",value:function(){return this.dirty=!0,this}},{key:"resize",value:function(t,e){return this.setSize(t,e),this}}]),i}(Phaser.GameObjects.GameObject),yn=Phaser.GameObjects.Components;Phaser.Class.mixin(gn,[yn.Alpha,yn.BlendMode,yn.Crop,yn.Depth,yn.Flip,yn.GetBounds,yn.Mask,yn.Origin,yn.Pipeline,yn.PostPipeline,yn.ScrollFactor,yn.Tint,yn.Transform,yn.Visible,un,dn,pn]);var kn=Phaser.Utils.String.Pad,mn=function(t,e,n){if(null==t)return t;switch(i(t)){case"string":default:return t;case"number":return "#".concat(kn(Math.floor(t).toString(16),6,"0",1));case"function":return t(e,n);case"object":return t.hasOwnProperty("r")?t.hasOwnProperty("a")?"rgba(".concat(t.r,",").concat(t.g,",").concat(t.b,",").concat(t.a,")"):"rgb(".concat(t.r,",").concat(t.g,",").concat(t.b,")"):t.hasOwnProperty("h")?t.hasOwnProperty("a")?"hsla(".concat(t.h,",").concat(t.s,",").concat(t.l,",").concat(t.a,")"):"hsl(".concat(t.h,",").concat(t.s,",").concat(t.l,")"):t}},bn=Phaser.Math.DegToRad,Cn=function(t){return !t.hasOwnProperty("convex")||t.convex},xn=function(t){return t.x>0&&t.y>0},wn=function(t,e,i,n,s,r,o,a,h){if(a&&o>r?o-=360:!a&&o=f?1:n/f,g=s>=p?1:s/p,y=d.cornerRadius;t.save(),t.beginPath(),t.translate(e,i),a=y.tl,xn(a)?(h=a.x*v,l=a.y*g,Cn(a)?wn(t,h,l,h,l,180,270,!1,o):wn(t,0,0,h,l,90,0,!0,o),u=0,c=l):(t.lineTo(0,0),u=0,c=0),a=y.tr,xn(a)?(h=a.x*v,l=a.y*g,Cn(a)?wn(t,n-h,l,h,l,270,360,!1,o):wn(t,n,0,h,l,180,90,!0,o)):t.lineTo(n,0),a=y.br,xn(a)?(h=a.x*v,l=a.y*g,Cn(a)?wn(t,n-h,s-l,h,l,0,90,!1,o):wn(t,n,s,h,l,270,180,!0,o)):t.lineTo(n,s),a=y.bl,xn(a)?(h=a.x*v,l=a.y*g,Cn(a)?wn(t,h,s-l,h,l,90,180,!1,o):wn(t,0,s,h,l,360,270,!0,o)):t.lineTo(0,s),t.lineTo(u,c),t.closePath(),t.restore();}(e,i,n,s,r,o,d),null!=a){var f;if(null!=u)(f=c?e.createLinearGradient(0,0,s,0):e.createLinearGradient(0,0,0,r)).addColorStop(0,a),f.addColorStop(1,u),a=f;e.fillStyle=a,e.fill();}null!=h&&l>0&&(e.strokeStyle=h,e.lineWidth=l,e.stroke());},On=function(t,e,i,n,s,r,o,a){if(null!=e||null!=i){var h=t.canvas.width,l=t.canvas.height;null==i&&(n=0);var u=n/2;h=Math.max(1,h-n),l=Math.max(1,l-n),Sn(t.canvas,t.context,u,u,h,l,s,e,i,n,r,o,a);}};Phaser.Utils.Objects.GetValue; + */Object.assign(Si.prototype,wi);var Oi=Phaser.Math.DegToRad,Pi=Phaser.Math.RadToDeg,Ti=Phaser.Utils.Objects.GetValue,Mi=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"visible",get:function(){return this._visible},set:function(t){this.setDisplayListDirty(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.setDisplayListDirty(!!this._alpha!=!!t),this._alpha=t;}},{key:"setAlpha",value:function(t){return this.alpha=t,this}},{key:"setX",value:function(t){return this.x=t,this}},{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:"setRotation",value:function(t){return this.rotation=t,this}},{key:"angle",get:function(){return Pi(this.rotation)},set:function(t){this.rotation=Oi(t);}},{key:"setAngle",value:function(t){return this.angle=t,this}},{key:"setScaleX",value:function(t){return this.scaleX=t,this}},{key:"width",get:function(){return this._width},set:function(t){this._width=t;}},{key:"setWidth",value:function(t,e){return void 0===e&&(e=!1),this.width=t,e&&(this.scaleY=this.scaleX),this}},{key:"setScaleY",value:function(t){return this.scaleY=t,this}},{key:"setScale",value:function(t,e){return void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this}},{key:"height",get:function(){return this._height},set:function(t){this._height=t;}},{key:"setHeight",value:function(t,e){return void 0===e&&(e=!1),this.height=t,e&&(this.scaleX=this.scaleY),this}},{key:"displayWidth",get:function(){return this._width*this.scaleX},set:function(t){this.scaleX=t/this._width;}},{key:"setDisplayWidth",value:function(t,e){return void 0===e&&(e=!1),this.displayWidth=t,e&&(this.scaleY=this.scaleX),this}},{key:"displayHeight",get:function(){return this._height*this.scaleY},set:function(t){this.scaleY=t/this._height;}},{key:"setDisplayHeight",value:function(t,e){return void 0===e&&(e=!1),this.displayHeight=t,e&&(this.scaleX=this.scaleY),this}},{key:"setOriginX",value:function(t){return this.originX=t,this._displayOriginX=this.width*t,this}},{key:"setOriginY",value:function(t){return this.originY=t,this._displayOriginY=this.height*t,this}},{key:"setOrigin",value:function(t,e){return void 0===e&&(e=t),this.setOriginX(t).setOriginY(e),this}},{key:"depth",get:function(){return this._depth},set:function(t){this.setDisplayListDirty(this._depth!=t),this._depth=t;}},{key:"setDepth",value:function(t){return void 0===t&&(t=0),this.depth=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=Ti(t,"width",void 0),i=Ti(t,"height",void 0),n=Ti(t,"scale",void 0),s=Ti(t,"scaleX",n),r=Ti(t,"scaleY",n);void 0!==e?void 0===i&&void 0===r?this.setWidth(e,!0):this.setWidth(e):void 0!==s?this.setScaleX(s):t.hasOwnProperty("displayWidth")&&this.setDisplayWidth(t.displayWidth),void 0!==i?void 0===e&&void 0===s?this.setHeight(i,!0):this.setHeight(i):void 0!==r?this.setScaleY(r):t.hasOwnProperty("displayHeight")&&this.setDisplayHeight(t.displayHeight);var o=Ti(t,"origin",void 0);return void 0!==o?this.setOrigin(o):(t.hasOwnProperty("originX")&&this.setOriginX(t.originX),t.hasOwnProperty("originY")&&this.setOriginY(t.originY)),t.hasOwnProperty("depth")&&this.setDepth(t.depth),this}},{key:"reset",value:function(){return p(h(i.prototype),"reset",this).call(this),this.setVisible().setAlpha(1).setPosition(0,0).setRotation(0).setScale(1,1).setOrigin(0).setDepth(0),this}},{key:"webglRender",value:function(t,e,i,n,s,r,o,a){}},{key:"canvasRender",value:function(t,e,i,n){}}]),i}(Si),Ei=Phaser.GameObjects.Components.TransformMatrix,_i=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,Li=new Ei,Ri=Phaser.Utils.Objects.IsPlainObject,Bi=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,Ci)).setFrame(s),r}return r(i,[{key:"width",get:function(){return this._width},set:function(t){}},{key:"height",get:function(){return this._height},set:function(t){}},{key:"setFrame",value:function(t){return arguments.length>0&&!Ri(t)&&(t=this.parent.texture.get(t)),this.frame=t,this._width=t?t.width:0,this._height=t?t.height:0,this}},{key:"setFlipX",value:function(t){return void 0===t&&(t=!0),this.flipX=t,this}},{key:"setFlipY",value:function(t){return void 0===t&&(t=!0),this.flipY=t,this}},{key:"resetFlip",value:function(){return this.flipX=!1,this.flipY=!1,this}},{key:"tint",get:function(){return void 0===this._tint?this.parent.tint:this._tint},set:function(t){this._tint=t;}},{key:"setTint",value:function(t){return this.tint=t,this.tintFill=!1,this}},{key:"setTintFill",value:function(t){return this.tint=t,this.tintFill=!0,this}},{key:"clearTint",value:function(){return this.setTint(16777215),this}},{key:"resetTint",value:function(){return this.tint=void 0,this.tintFill=void 0,this}},{key:"tintFill",get:function(){return void 0===this._tintFill?this.parent.tintFill:this._tintFill},set:function(t){this._tintFill=t;}},{key:"reset",value:function(){return p(h(i.prototype),"reset",this).call(this),this.resetFlip().resetTint().setFrame(),this}},{key:"modifyPorperties",value:function(t){return t?(t.hasOwnProperty("width")&&(t.displayWidth=t.width,delete t.width),t.hasOwnProperty("height")&&(t.displayHeight=t.height,delete t.height),t.hasOwnProperty("frame")&&this.setFrame(t.frame),p(h(i.prototype),"modifyPorperties",this).call(this,t),t.hasOwnProperty("flipX")&&this.setFlipX(t.flipX),t.hasOwnProperty("flipY")&&this.setFlipY(t.flipY),t.hasOwnProperty("tint")&&this.setTint(t.tint),t.hasOwnProperty("tintFill")&&this.setTintFill(t.tintFill),this):this}}]),i}(Mi),ji={webglRender:function(t,e,i,n,s,r,o,a){var h=this._width,l=this._height,u=h*this.originX,c=l*this.originY,d=this.x-n,f=this.y-s,p=1,v=1;this.flipX&&(d+=h-2*u,p=-1),this.flipY&&(f+=l-2*c,v=-1),Li.applyITRS(d,f,this.rotation,this.scaleX*p,this.scaleY*v),e.multiply(Li,Li);var g=-u,y=-c,k=g+h,m=y+l,b=Li.setQuad(g,y,k,m,a),C=this.frame.u0,x=this.frame.v0,w=this.frame.u1,S=this.frame.v1,O=_i(this.tint,this.alpha*i);t.batchQuad(this.parent,b[0],b[1],b[2],b[3],b[4],b[5],b[6],b[7],C,x,w,S,O,O,O,O,this.tintFill,r,o);},canvasRender:function(t,e,i,n){t.save();var s=this._width,r=this._height,o=s*this.originX,a=r*this.originY,h=this.x-o,l=this.y-a,u=1,c=1;this.flipX&&(h+=s,u=-1),this.flipY&&(l+=r,c=-1),n&&(h=Math.round(h),l=Math.round(l)),t.translate(h,l),t.rotate(this.rotation),t.scale(this.scaleX*u,this.scaleY*c);var d=this.frame;t.drawImage(d.source.image,d.cutX,d.cutY,s,r,0,0,s,r),t.restore();}};Object.assign(Bi.prototype,ji);var Di=function(t,e){"string"==typeof e&&(e={frame:e});var i=t.poolManager?t.poolManager.allocate(Ci):null;return null===i?i=new Bi(t):i.setParent(t).setActive(),i.modifyPorperties(e),t.addChild(i),i},Ai={_drawImage:function(t,e,i,n,s,r){Di(this,{frame:e,x:i,y:n,width:s,height:r});},_drawTileSprite:function(t,e,i,n,s,r){var o=this.texture.get(e),a=o.width,h=o.height,l=Math.floor(s/a),u=Math.floor(r/h);i+=(s-l*a)/2,n+=(r-u*h)/2;for(var c=0;c=0||t.y>=0,t.x=Math.abs(t.x),t.y=Math.abs(t.y);},Xi=function(t,e,i){var n=i.length;if(n>=2){var s=i[n-2],r=i[n-1];if(t===s&&e===r)return i}return i.push(t,e),i},Gi=Phaser.Math.DegToRad,Hi=function(t,e,i,n,s,r,o,a,h){o&&r>s?r-=360:!o&&r>>16,a=(65280&s)>>>8,h=255&s;t.fillStyle="rgba("+o+","+a+","+h+","+r+")";},$i=function(t,e,i,n){var s=i||e.strokeColor,r=n||e.strokeAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.strokeStyle="rgba("+o+","+a+","+h+","+r+")",t.lineWidth=e.lineWidth;},Qi=Phaser.Renderer.Canvas.SetTransform,tn={renderWebGL:function(t,e,i,n){e.dirty&&(e.updateData(),e.dirty=!1),i.addToRenderList(e);var s=t.pipelines.set(e.pipeline),r=Zi(e,i,n),o=s.calcMatrix.copyFrom(r.calc),a=e._displayOriginX,h=e._displayOriginY,l=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&Ni(s,o,e,l,a,h),e.isStroked&&Ji(s,e,l,a,h),t.pipelines.postBatch(e);},renderCanvas:function(t,e,i,n){e.dirty&&(e.updateData(),e.dirty=!1),i.addToRenderList(e);var s=t.currentContext;if(Qi(t,s,e,i,n)){var r=e._displayOriginX,o=e._displayOriginY,a=e.pathData,h=a.length-1,l=a[0]-r,u=a[1]-o;s.beginPath(),s.moveTo(l,u),e.closePath||(h-=2);for(var c=2;c0;}},{key:"fillAlpha",get:function(){return this._fillAlpha},set:function(t){this._fillAlpha=t,this.isFilled=t>0&&null!=this._fillColor;}},{key:"setFillStyle",value:function(t,e){return void 0===e&&(e=1),this.fillColor=t,this.fillAlpha=e,this}},{key:"strokeColor",get:function(){return this._strokeColor},set:function(t){this._strokeColor=t,this.isStroked=null!=t&&this._strokeAlpha>0&&this._lineWidth>0;}},{key:"strokeAlpha",get:function(){return this._strokeAlpha},set:function(t){this._strokeAlpha=t,this.isStroked=t>0&&null!=this._strokeColor&&this._lineWidth>0;}},{key:"lineWidth",get:function(){return this._lineWidth},set:function(t){this._lineWidth=t,this.isStroked=t>0&&null!=this._strokeColor;}},{key:"setStrokeStyle",value:function(t,e,i){return void 0===i&&(i=1),this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this}},{key:"updateData",value:function(){var t=this.geom,e=this.pathData;e.length=0;var i,n=t.width,s=t.height,r=t.cornerRadius,o=this.iteration+1;if(i=r.tl,an(i))if(i.convex){var a=i.x,h=i.y;Hi(a,h,i.x,i.y,180,270,!1,o,e);}else {Hi(a=0,h=0,i.x,i.y,90,0,!0,o,e);}else Xi(0,0,e);if(i=r.tr,an(i))if(i.convex){a=n-i.x,h=i.y;Hi(a,h,i.x,i.y,270,360,!1,o,e);}else {Hi(a=n,h=0,i.x,i.y,180,90,!0,o,e);}else Xi(n,0,e);if(i=r.br,an(i))if(i.convex){a=n-i.x,h=s-i.y;Hi(a,h,i.x,i.y,0,90,!1,o,e);}else {Hi(a=n,h=s,i.x,i.y,270,180,!0,o,e);}else Xi(n,s,e);if(i=r.bl,an(i))if(i.convex){a=i.x,h=s-i.y;Hi(a,h,i.x,i.y,90,180,!1,o,e);}else {Hi(a=0,h=s,i.x,i.y,360,270,!0,o,e);}else Xi(0,s,e);return e.push(e[0],e[1]),this.pathIndexes=rn(e),this}},{key:"setShapeType",value:function(t){return "string"==typeof t&&(t=hn[t]),this.shapeType=t,this}},{key:"width",get:function(){return this.geom.width},set:function(t){this.resize(t,this.height);}},{key:"height",get:function(){return this.geom.height},set:function(t){this.resize(this.width,t);}},{key:"setSize",value:function(t,e){if(void 0===e&&(e=t),this.geom.width===t&&this.geom.height===e)return this;this.geom.setSize(t,e),1===this.shapeType&&this.setRadius({x:t/2,y:e/2}),this.updateDisplayOrigin(),this.dirty=!0;var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this}},{key:"resize",value:function(t,e){return this.setSize(t,e),this}},{key:"radius",get:function(){return this.geom.radius},set:function(t){this.geom.setRadius(t),this.updateDisplayOrigin(),this.dirty=!0;}},{key:"radiusTL",get:function(){return this.geom.radiusTL},set:function(t){this.geom.radiusTL=t,this.dirty=!0;}},{key:"radiusTR",get:function(){return this.geom.radiusTR},set:function(t){this.geom.radiusTR=t,this.dirty=!0;}},{key:"radiusBL",get:function(){return this.geom.radiusBL},set:function(t){this.geom.radiusBL=t,this.dirty=!0;}},{key:"radiusBR",get:function(){return this.geom.radiusBR},set:function(t){this.geom.radiusBR=t,this.dirty=!0;}},{key:"setRadius",value:function(t){return void 0===t&&(t=0),this.radius=t,this}},{key:"setRadiusTL",value:function(t){return void 0===t&&(t=0),this.radiusTL=t,this}},{key:"setRadiusTR",value:function(t){return void 0===t&&(t=0),this.radiusTR=t,this}},{key:"setRadiusBL",value:function(t){return void 0===t&&(t=0),this.radiusBL=t,this}},{key:"setRadiusBR",value:function(t){return void 0===t&&(t=0),this.radiusBR=t,this}},{key:"cornerRadius",get:function(){return this.geom.cornerRadius},set:function(t){this.radius=t;}},{key:"setCornerRadius",value:function(t){return this.setRadius(t)}},{key:"iteration",get:function(){return this._iteration},set:function(t){void 0!==this._iteration?this._iteration!==t&&(this._iteration=t,this.dirty=!0):this._iteration=t;}},{key:"setIteration",value:function(t){return void 0===t&&(t=6),this.iteration=t,this}}]),i}(en),an=function(t){return t.x>0&&t.y>0},hn={rectangle:0,circle:1};Object.assign(on.prototype,tn);var ln=Phaser.Renderer.WebGL.Utils,un={renderWebGL:function(t,e,i,n){if(e.dirty&&(e.updateTexture(),e.dirty=!1),0!==e.width&&0!==e.height){i.addToRenderList(e);var s=e.frame,r=s.width,o=s.height,a=ln.getTintAppendFloatAlpha,h=t.pipelines.set(e.pipeline,e),l=h.setTexture2D(s.glTexture,e);t.pipelines.preBatch(e),h.batchTexture(e,s.glTexture,r,o,e.x,e.y,r/e.resolution,o/e.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,r,o,a(e.tintTopLeft,i.alpha*e._alphaTL),a(e.tintTopRight,i.alpha*e._alphaTR),a(e.tintBottomLeft,i.alpha*e._alphaBL),a(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,0,0,i,n,!1,l),t.pipelines.postBatch(e);}},renderCanvas:function(t,e,i,n){e.dirty&&(e.updateTexture(),e.dirty=!1),0!==e.width&&0!==e.height&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,n));}},cn=Phaser.Display.Color,dn={clear:function(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.dirty=!0,this},fill:function(t){return this.context.fillStyle=t,this.context.fillRect(0,0,this.canvas.width,this.canvas.height),this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r,o,a,h,l){var u=this.scene.sys.textures.getFrame(t,e);if(!u)return this;var c=u.cutWidth,d=u.cutHeight;void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=c),void 0===r&&(r=d),void 0===o&&(o=0),void 0===a&&(a=0),void 0===h&&(h=c),void 0===l&&(l=d);var f=u.cutX+o,p=u.cutY+a;return this.context.drawImage(u.source.image,f,p,h,l,i,n,s,r),this.dirty=!0,this},getDataURL:function(t,e){return this.canvas.toDataURL(t,e)},getPixel:function(t,e,i){void 0===i&&(i=new cn);var n=this.context.getImageData(t,e,1,1);return i.setTo(n.data[0],n.data[1],n.data[2],n.data[3]),i},setPixel:function(t,e,i,n,s,r){if("number"!=typeof i){var o=i;i=o.red,n=o.green,s=o.blue,r=o.alpha;}void 0===r&&(r=0!==i||0!==n||0!==s?255:0);var a=this.context.createImageData(1,1);return a.data[0]=i,a.data[1]=n,a.data[2]=s,a.data[3]=r,this.context.putImageData(a,t,e),this.dirty=!0,this}},fn=function(t,e,i,n,s,r,o){var a,h=t.sys.textures,l=t.renderer;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=e.width),void 0===o&&(o=e.height);var u=(a=h.exists(i)?h.get(i):h.createCanvas(i,r,o)).getSourceImage();u.width!==r&&(u.width=r),u.height!==o&&(u.height=o);var c=u.getContext("2d",{willReadFrequently:!0});c.clearRect(0,0,r,o),c.drawImage(e,n,s,r,o),l.gl&&a&&l.canvasToTexture(u,a.source[0].glTexture,!0,0);},pn={updateTexture:function(t,e){t&&(e?t.call(e,this.canvas,this.context):t(this.canvas,this.context)),this.canvas.width===this.frame.width&&this.canvas.height===this.frame.height||this.frame.setSize(this.canvas.width,this.canvas.height),this.renderer&&this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(this.canvas,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!1;var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=this.width,i.hitArea.height=this.height),this},generateTexture:function(t,e,i,n,s){var r=this.canvas;return void 0===n?n=r.width:n*=this.resolution,void 0===s?s=r.height:s*=this.resolution,fn(this.scene,r,t,e,i,n,s),this},loadTexture:function(t,e){var i=this.scene.sys.textures.getFrame(t,e);return i?(this.width!==i.cutWidth||this.height!==i.cutHeight?this.setSize(i.cutWidth,i.cutHeight):this.clear(),this.drawFrame(t,e),this.dirty=!0,this):this}};M();var vn=Phaser.Display.Canvas.CanvasPool,gn=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,"rexCanvas")).renderer=t.sys.game.renderer,h.resolution=1,h._width=o,h._height=a,o=Math.max(Math.ceil(o*h.resolution),1),a=Math.max(Math.ceil(a*h.resolution),1),h.canvas=vn.create(u(h),o,a),h.context=h.canvas.getContext("2d",{willReadFrequently:!0}),h.dirty=!1,h.setPosition(s,r),h.setOrigin(.5,.5),h.initPipeline(),h.initPostPipeline(!0),h._crop=h.resetCropObject(),h.texture=t.sys.textures.addCanvas(null,h.canvas,!0),h.frame=h.texture.get(),h.frame.source.resolution=h.resolution,h.renderer&&h.renderer.gl&&(h.renderer.deleteTexture(h.frame.source.glTexture),h.frame.source.glTexture=null),h.dirty=!0,h}return r(i,[{key:"preDestroy",value:function(){vn.remove(this.canvas),this.texture.destroy(),this.canvas=null,this.context=null;}},{key:"width",get:function(){return this._width},set:function(t){this.setSize(t,this._height);}},{key:"height",get:function(){return this._height},set:function(t){this.setSize(this._width,t);}},{key:"setCanvasSize",value:function(t,e){return this._width===t&&this._height===e||(this._width=t,this._height=e,this.updateDisplayOrigin(),t=Math.max(Math.ceil(t*this.resolution),1),e=Math.max(Math.ceil(e*this.resolution),1),this.canvas.width=t,this.canvas.height=e,this.frame.setSize(t,e),this.dirty=!0),this}},{key:"setSize",value:function(t,e){return this.setCanvasSize(t,e),this}},{key:"displayWidth",get:function(){return this.scaleX*this._width},set:function(t){this.scaleX=t/this._width;}},{key:"displayHeight",get:function(){return this.scaleY*this._height},set:function(t){this.scaleY=t/this._height;}},{key:"setDisplaySize",value:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}},{key:"getCanvas",value:function(t){return t||(this.dirty=!0),this.canvas}},{key:"getContext",value:function(t){return t||(this.dirty=!0),this.context}},{key:"needRedraw",value:function(){return this.dirty=!0,this}},{key:"resize",value:function(t,e){return this.setSize(t,e),this}}]),i}(Phaser.GameObjects.GameObject),yn=Phaser.GameObjects.Components;Phaser.Class.mixin(gn,[yn.Alpha,yn.BlendMode,yn.Crop,yn.Depth,yn.Flip,yn.GetBounds,yn.Mask,yn.Origin,yn.Pipeline,yn.PostPipeline,yn.ScrollFactor,yn.Tint,yn.Transform,yn.Visible,un,dn,pn]);var kn=Phaser.Utils.String.Pad,mn=function(t,e,n){if(null==t)return t;switch(i(t)){case"string":default:return t;case"number":return "#".concat(kn(Math.floor(t).toString(16),6,"0",1));case"function":return t(e,n);case"object":return t.hasOwnProperty("r")?t.hasOwnProperty("a")?"rgba(".concat(t.r,",").concat(t.g,",").concat(t.b,",").concat(t.a,")"):"rgb(".concat(t.r,",").concat(t.g,",").concat(t.b,")"):t.hasOwnProperty("h")?t.hasOwnProperty("a")?"hsla(".concat(t.h,",").concat(t.s,",").concat(t.l,",").concat(t.a,")"):"hsl(".concat(t.h,",").concat(t.s,",").concat(t.l,")"):t}},bn=Phaser.Math.DegToRad,Cn=function(t){return !t.hasOwnProperty("convex")||t.convex},xn=function(t){return t.x>0&&t.y>0},wn=function(t,e,i,n,s,r,o,a,h){if(a&&o>r?o-=360:!a&&o=f?1:n/f,g=s>=p?1:s/p,y=d.cornerRadius;t.save(),t.beginPath(),t.translate(e,i),a=y.tl,xn(a)?(h=a.x*v,l=a.y*g,Cn(a)?wn(t,h,l,h,l,180,270,!1,o):wn(t,0,0,h,l,90,0,!0,o),u=0,c=l):(t.lineTo(0,0),u=0,c=0),a=y.tr,xn(a)?(h=a.x*v,l=a.y*g,Cn(a)?wn(t,n-h,l,h,l,270,360,!1,o):wn(t,n,0,h,l,180,90,!0,o)):t.lineTo(n,0),a=y.br,xn(a)?(h=a.x*v,l=a.y*g,Cn(a)?wn(t,n-h,s-l,h,l,0,90,!1,o):wn(t,n,s,h,l,270,180,!0,o)):t.lineTo(n,s),a=y.bl,xn(a)?(h=a.x*v,l=a.y*g,Cn(a)?wn(t,h,s-l,h,l,90,180,!1,o):wn(t,0,s,h,l,360,270,!0,o)):t.lineTo(0,s),t.lineTo(u,c),t.closePath(),t.restore();}(e,i,n,s,r,o,d),null!=a){var f;if(null!=u)(f=c?e.createLinearGradient(0,0,s,0):e.createLinearGradient(0,0,0,r)).addColorStop(0,a),f.addColorStop(1,u),a=f;e.fillStyle=a,e.fill();}null!=h&&l>0&&(e.strokeStyle=h,e.lineWidth=l,e.stroke());},On=function(t,e,i,n,s,r,o,a){if(null!=e||null!=i){var h=t.canvas.width,l=t.canvas.height;null==i&&(n=0);var u=n/2;h=Math.max(1,h-n),l=Math.max(1,l-n),Sn(t.canvas,t.context,u,u,h,l,s,e,i,n,r,o,a);}};Phaser.Utils.Objects.GetValue; /** * @author Richard Davey * @copyright 2019 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Pn=Phaser.Renderer.WebGL.Utils,Tn={renderWebGL:function(t,e,i,n){if(0!==e.width&&0!==e.height){i.addToRenderList(e);var s=e.frame,r=s.width,o=s.height,a=Pn.getTintAppendFloatAlpha,h=t.pipelines.set(e.pipeline,e),l=h.setTexture2D(s.glTexture,e);t.pipelines.preBatch(e),h.batchTexture(e,s.glTexture,r,o,e.x,e.y,r/e.style.resolution,o/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,r,o,a(e.tintTopLeft,i.alpha*e._alphaTL),a(e.tintTopRight,i.alpha*e._alphaTR),a(e.tintBottomLeft,i.alpha*e._alphaBL),a(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,0,0,i,n,!1,l),t.pipelines.postBatch(e);}},renderCanvas:function(t,e,i,n){0!==e.width&&0!==e.height&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,n));}},Mn=Phaser.Display.Canvas.CanvasPool;M();var En=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"setStyle",value:function(t){return this.style.setStyle(t)}},{key:"setFont",value:function(t){return this.style.setFont(t)}},{key:"setFontFamily",value:function(t){return this.style.setFontFamily(t)}},{key:"setFontSize",value:function(t){return this.style.setFontSize(t)}},{key:"setFontStyle",value:function(t){return this.style.setFontStyle(t)}},{key:"setTestString",value:function(t){return this.style.setTestString(t)}},{key:"setFixedSize",value:function(t,e){return this.style.setFixedSize(t,e)}},{key:"setBackgroundColor",value:function(t,e,i){return this.style.setBackgroundColor(t,e,i)}},{key:"setBackgroundStrokeColor",value:function(t,e){return this.style.setBackgroundStrokeColor(t,e)}},{key:"setBackgroundCornerRadius",value:function(t,e){return this.style.setBackgroundCornerRadius(t,e)}},{key:"setFill",value:function(t){return this.style.setFill(t)}},{key:"setColor",value:function(t){return this.style.setColor(t)}},{key:"setStroke",value:function(t,e){return this.style.setStroke(t,e)}},{key:"setShadow",value:function(t,e,i,n,s,r){return this.style.setShadow(t,e,i,n,s,r)}},{key:"setShadowOffset",value:function(t,e){return this.style.setShadowOffset(t,e)}},{key:"setShadowColor",value:function(t){return this.style.setShadowColor(t)}},{key:"setShadowBlur",value:function(t){return this.style.setShadowBlur(t)}},{key:"setShadowStroke",value:function(t){return this.style.setShadowStroke(t)}},{key:"setShadowFill",value:function(t){return this.style.setShadowFill(t)}},{key:"setWrapMode",value:function(t){return this.style.setWrapMode(t)}},{key:"setWrapWidth",value:function(t){return this.style.setWrapWidth(t)}},{key:"setWordWrapWidth",value:function(t){return this.style.setWrapWidth(t)}},{key:"setAlign",value:function(t){return this.style.setHAlign(t)}},{key:"setHAlign",value:function(t){return this.style.setHAlign(t)}},{key:"setVAlign",value:function(t){return this.style.setVAlign(t)}},{key:"setLineSpacing",value:function(t){return this.style.setLineSpacing(t)}},{key:"lineSpacing",get:function(){return this.style.lineSpacing},set:function(t){this.setLineSpacing(t);}},{key:"setXOffset",value:function(t){return this.style.setXOffset(t)}},{key:"setMaxLines",value:function(t){return this.style.setMaxLines(t)}},{key:"setResolution",value:function(t){return this.style.setResolution(t)}},{key:"getTextMetrics",value:function(){return this.style.getTextMetrics()}},{key:"setTextMetrics",value:function(t,e){return this.style.setTextMetrics(t,e)}},{key:"measureTextMargins",value:function(t,e){return function(t,e,i){void 0===i&&(i={});var n=Mn.create(this),s=n.getContext("2d",{willReadFrequently:!0});t.syncFont(n,s);var r=s.measureText(e),o=Math.ceil(r.width*t.baselineX),a=o,h=2*a;if(a=a*t.baselineY|0,n.width=o,n.height=h,s.fillStyle="#f00",s.fillRect(0,0,o,h),s.font=t._font,s.textBaseline="alphabetic",s.fillStyle="#000",s.fillText(t.testString,0,a),i.left=0,0===o||0===h||!s.getImageData(0,0,o,h))return Mn.remove(n),i;for(var l=s.getImageData(0,0,o,h).data,u=!1,c=0;ch;u--){for(c=0;c0&&this.wrapMode!==In&&0===this.wrapWidth}},{key:"setStyle",value:function(t,e,i){if(void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("wrap")){var n=t.wrap;if(n.hasOwnProperty("mode")){var s=n.mode;"string"==typeof s&&(n.mode=Gn[s]);}else n.hasOwnProperty("width")&&(n.mode=1);}t&&t.rtl&&i&&!t.hasOwnProperty("halign")&&(t.halign="right"),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px");var r=this.propertyMap;for(var o in r){var a=r[o],h=a[0],l=i?a[1]:this[o],u=a[2];if("wrapCallback"===o||"wrapCallbackScope"===o)this[o]=Vn(t,h,l);else {var c=Wn(t,h,l);u&&(c=u(c)),this[o]=c;}}var d=Vn(t,"font",null);this._font=null===d?this.fontStyle+" "+this.fontSize+" "+this.fontFamily:d;var f=Vn(t,"fill",null);null!==f&&(this.color=mn(f));var p=Vn(t,"metrics",!1);return p?this.metrics={ascent:Vn(p,"ascent",0),descent:Vn(p,"descent",0),fontSize:Vn(p,"fontSize",0)}:!e&&this.metrics||(this.metrics=Bn(this)),e?this.parent.updateText():this.parent}},{key:"syncFont",value:function(t,e){e.font=this._font;}},{key:"syncStyle",value:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round";}},{key:"syncShadow",value:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0);}},{key:"update",value:function(t){return t&&(this._font="".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily).trim(),this.metrics=Bn(this)),this.parent.updateText(t)}},{key:"buildFont",value:function(){var t="".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily).trim();return t!==this._font&&(this._font=t),this}},{key:"setFont",value:function(t){return "string"==typeof t?(this.fontFamily=t,this.fontSize="",this.fontStyle=""):(this.fontFamily=Vn(t,"fontFamily","Courier"),this.fontSize=Vn(t,"fontSize","16px"),this.fontStyle=Vn(t,"fontStyle","")),this.update(!0)}},{key:"setFontFamily",value:function(t){return this.fontFamily=t,this.update(!0)}},{key:"setFontStyle",value:function(t){return this.fontStyle=t,this.update(!0)}},{key:"setFontSize",value:function(t){return "number"==typeof t&&(t=t.toString()+"px"),this.fontSize=t,this.update(!0)}},{key:"setTestString",value:function(t){return this.testString=t,this.update(!0)}},{key:"setFixedSize",value:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(this.isWrapFitMode)}},{key:"setResolution",value:function(t){return this.resolution=t,this.update(!1)}},{key:"setLineSpacing",value:function(t){return this.lineSpacing=t,this.update(!1)}},{key:"setXOffset",value:function(t){return this.xOffset=t,this.update(!1)}},{key:"setBackgroundColor",value:function(t,e,i){return void 0===i&&(i=!0),this.backgroundColor=mn(t,this.parent.canvas,this.parent.context),this.backgroundColor2=mn(e,this.parent.canvas,this.parent.context),this.backgroundHorizontalGradient=i,this.update(!1)}},{key:"setBackgroundStrokeColor",value:function(t,e){return this.backgroundStrokeColor=mn(t,this.parent.canvas,this.parent.context),this.backgroundStrokeLineWidth=e,this.update(!1)}},{key:"setBackgroundCornerRadius",value:function(t,e){return this.backgroundCornerRadius=t,this.backgroundCornerIteration=e,this.update(!1)}},{key:"setFill",value:function(t){return this.color=mn(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setColor",value:function(t){return this.color=mn(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setStroke",value:function(t,e){return void 0===t?this.strokeThickness=0:(void 0===e&&(e=this.strokeThickness),this.stroke=mn(t,this.parent.canvas,this.parent.context),this.strokeThickness=e),this.update(!0)}},{key:"setShadow",value:function(t,e,i,n,s,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===s&&(s=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=mn(i,this.parent.canvas,this.parent.context),this.shadowBlur=n,this.shadowStroke=s,this.shadowFill=r,this.update(!1)}},{key:"setShadowOffset",value:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)}},{key:"setShadowColor",value:function(t){return void 0===t&&(t="#000"),this.shadowColor=mn(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setShadowBlur",value:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)}},{key:"setShadowStroke",value:function(t){return this.shadowStroke=t,this.update(!1)}},{key:"setShadowFill",value:function(t){return this.shadowFill=t,this.update(!1)}},{key:"setUnderline",value:function(t,e,i){return void 0===t&&(t="#000"),void 0===e&&(e=0),void 0===i&&(i=0),this.underlineColor=mn(t,this.parent.canvas,this.parent.context),this.underlineThickness=e,this.underlineOffset=i,this.update(!1)}},{key:"setUnderlineColor",value:function(t){return void 0===t&&(t="#000"),this.underlineColor=mn(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setUnderlineThickness",value:function(t){return void 0===t&&(t=0),this.underlineThickness=t,this.update(!1)}},{key:"setUnderlineOffset",value:function(t){return void 0===t&&(t=0),this.underlineOffset=t,this.update(!1)}},{key:"setStrikethrough",value:function(t,e,i){return void 0===t&&(t="#000"),void 0===e&&(e=0),void 0===i&&(i=0),this.strikethroughColor=mn(t,this.parent.canvas,this.parent.context),this.strikethroughThickness=e,this.strikethroughOffset=i,this.update(!1)}},{key:"setStrikethroughColor",value:function(t){return void 0===t&&(t="#000"),this.strikethroughColor=mn(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setStrikethroughThickness",value:function(t){return void 0===t&&(t=0),this.strikethroughThickness=t,this.update(!1)}},{key:"setStrikethroughOffset",value:function(t){return void 0===t&&(t=0),this.strikethroughOffset=t,this.update(!1)}},{key:"setWrapMode",value:function(t){return "string"==typeof t&&(t=Gn[t.toLowerCase()]||0),this.wrapMode=t,this.update(!0)}},{key:"setWrapWidth",value:function(t){return this.wrapWidth=t,this.update(!1)}},{key:"setAlign",value:function(t,e){return void 0===t&&(t="left"),void 0===e&&(e="top"),this.halign=t,this.valign=e,this.update(!1)}},{key:"setHAlign",value:function(t){return void 0===t&&(t="left"),this.halign=t,this.update(!1)}},{key:"setVAlign",value:function(t){return void 0===t&&(t="top"),this.valign=t,this.update(!1)}},{key:"setMaxLines",value:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)}},{key:"getTextMetrics",value:function(){var t=this.metrics;return {ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}}},{key:"setTextMetrics",value:function(t,e){return this.metrics.ascent=t.ascent,this.metrics.descent=t.descent,this.metrics.fontSize=t.fontSize,e&&("string"==typeof e?(this.fontFamily=e,this.fontSize="",this.fontStyle=""):(this.fontFamily=Vn(e,"fontFamily",this.fontFamily),this.fontSize=Vn(e,"fontSize",this.fontSize),this.fontStyle=Vn(e,"fontStyle",this.fontStyle))),this.parent.updateText(!0)}},{key:"lineHeight",get:function(){return this.metrics.fontSize+this.strokeThickness+this.lineSpacing}},{key:"toJSON",value:function(){var t={},e=this.propertyMap;for(var i in e)t[i]=this[i];return t.metrics=this.getTextMetrics(),t}},{key:"destroy",value:function(){this.parent=void 0;}}]),t}(),Gn={none:In,word:zn,char:Fn,character:Fn},Hn={draw:function(t,e,i,n){var s=this.penManager;this.hitAreaManager.clear();var r=this.context;r.save();var o=this.defaultStyle;this.clear(),On(this,o.backgroundColor,o.backgroundStrokeColor,o.backgroundStrokeLineWidth,o.backgroundCornerRadius,o.backgroundColor2,o.backgroundHorizontalGradient,o.backgroundCornerIteration),t+=this.startXOffset,e+=this.startYOffset;var a,h,l,u,c,d,f=o.halign,p=o.valign,v=o.lineHeight,g=s.lines,y=g.length,k=o.maxLines;k>0&&y>k?(h=k,l="center"===p?Math.floor((y-h)/2):"bottom"===p?y-h:0):(h=y,l=0),u=l+h;var m=this.rtl,b=m?this.parent.width:void 0;d="center"===p?Math.max((n-h*v)/2,0):"bottom"===p?Math.max(n-h*v-2,0):0,d+=e;for(var C=l;C0&&t.width>0){var a=i+o.underlineOffset-o.underlineThickness/2;this.drawLine(e,a,t.width,o.underlineThickness,o.underlineColor,o);}if(t.isTextPen&&this.drawText(e,i,t.text,o),t.isImagePen&&this.drawImage(e,i,t.prop.img,o),o.strikethroughThickness>0&&t.width>0){a=i+o.strikethroughOffset-o.strikethroughThickness/2;this.drawLine(e,a,t.width,o.strikethroughThickness,o.strikethroughColor,o);}if(r.restore(),t.hasAreaMarker&&t.width>0){var h,l=t.prop.area;if(l)h={key:l};else {var u=t.prop.url;h={key:"url:".concat(u),url:u};}this.hitAreaManager.add(e,i-this.startYOffset,t.width,this.defaultStyle.lineHeight,h);}},clear:function(){var t=this.canvas;this.context.clearRect(0,0,t.width,t.height);},drawLine:function(t,e,i,n,s,r){this.autoRound&&(t=Math.round(t),e=Math.round(e));var o=this.context;r.syncShadow(o,r.shadowStroke);var a=o.lineCap;o.lineCap="butt",o.strokeStyle=s,o.lineWidth=n,o.beginPath(),o.moveTo(t,e),o.lineTo(t+i,e),o.stroke(),o.lineCap=a;},drawText:function(t,e,i,n){this.autoRound&&(t=Math.round(t),e=Math.round(e));var s=this.context;n.stroke&&"none"!==n.stroke&&n.strokeThickness>0&&(n.syncShadow(s,n.shadowStroke),s.strokeText(i,t,e)),n.color&&"none"!==n.color&&(n.syncShadow(s,n.shadowFill),s.fillText(i,t,e));},drawImage:function(t,e,i,n){e-=this.startYOffset,this.parent.imageManager.draw(i,this.context,t,e,this.autoRound);}},Un=Phaser.Utils.Objects.GetValue,Nn=jn,Kn=Dn,Jn=function(){function t(e){n(this,t),this.prop={},this.resetFromJSON(e);}return r(t,[{key:"resetFromJSON",value:function(t){this.text=Un(t,"text",""),this.x=Un(t,"x",0),this.y=Un(t,"y",0),this.width=Un(t,"width",0);var e=Un(t,"prop",null);null===e&&(e={}),this.prop=e,this.newLineMode=Un(t,"newLineMode",0),this.startIndex=Un(t,"startIndex",0);}},{key:"plainText",get:function(){var t=this.text;return this.newLineMode===Kn&&(t+="\n"),t}},{key:"wrapText",get:function(){var t=this.text;return this.newLineMode!==Nn&&(t+="\n"),t}},{key:"rawTextLength",get:function(){var t=this.text.length;return this.newLineMode===Kn&&(t+=1),t}},{key:"endIndex",get:function(){return this.startIndex+this.rawTextLength}},{key:"lastX",get:function(){return this.x+this.width}},{key:"isTextPen",get:function(){return ""!==this.text}},{key:"isImagePen",get:function(){return !!this.prop.img}},{key:"hasAreaMarker",get:function(){return !!this.prop.area||!!this.prop.url}}]),t}(),Zn=Phaser.Utils.Objects.GetFastValue,qn=jn,$n=An,Qn=function(){function t(e){n(this,t),this.pens=[],this.lines=[],this.maxLinesWidth=void 0,this.pensPool=e.pensPool,this.linesPool=e.linesPool,this.tagToText=Zn(e,"tagToText",Ye),this.tagToTextScope=Zn(e,"tagToTextScope",void 0);}return r(t,[{key:"destroy",value:function(){this.clear(),this.tagToText=void 0,this.tagToTextScope=void 0;}},{key:"clear",value:function(){for(var t=0,e=this.lines.length;t=this.lines.length)return this.getLineEndIndex(t);var e=this.lines[t];return e&&e[0]?e[0].startIndex:0}},{key:"getLineEndIndex",value:function(t){t>=this.lines.length&&(t=this.lines.length-1);var e,i,n=!1;for(e=t;e>=0&&!(n=null!=(i=this.lines[e])&&i.length>0);e--);return n?i[i.length-1].endIndex:0}},{key:"getLineWidth",value:function(t){var e=this.lines[t];if(!e)return 0;var i=e[e.length-1];return null==i?0:i.lastX}},{key:"getMaxLineWidth",value:function(){if(void 0!==this.maxLinesWidth)return this.maxLinesWidth;for(var t,e=0,i=0,n=this.lines.length;ie&&(e=t);return this.maxLinesWidth=e,e}},{key:"getLineWidths",value:function(){for(var t=[],e=0,i=this.lines.length;e=t&&h<=e||(o=o.substring(t-a,e-a)),this.tagToTextScope?c+=this.tagToText.call(this.tagToTextScope,o,l,u):c+=this.tagToText(o,l,u),u=l,!(h>=e)));d++);return c}},{key:"length",get:function(){return this.lines.length},set:function(t){this.clear();}}]),t}(),ts={},es=Phaser.Geom.Rectangle,is=new hi,ns=function(){function t(){n(this,t),this.hitAreas=[];}return r(t,[{key:"destroy",value:function(){this.clear();}},{key:"clear",value:function(){for(var t=0,e=this.hitAreas.length;ts){""!==S?a.push(o.getLine(S,O,us)):0===T&&r>0&&a.push(o.getLine("",0,us)),a.push.apply(a,m(t(b,i,fs,s,0,o)));var E=a.pop();S=E.text,O=E.width,o.freeLine(E)," "===S&&(S="",O=0);}else (w=O+C)>l?(a.push(o.getLine(S,O,us)),S=b,O=C,l=s):(S+=b,O=w),x&&a.push(o.getLine(S,O,u));}return a},gs=Phaser.Utils.Objects.GetValue,ys=In,ks=jn,ms=function(){function t(e){n(this,t),this.parent=e.parent,this.scene=this.parent.scene,this.context=gs(e,"context",null),this.canvas=this.context.canvas,this.parser=gs(e,"parser",null),this.defaultStyle=gs(e,"style",null),this.autoRound=!0,this.pensPool=e.pensPool,this.linesPool=e.linesPool,this.wrapTextLinesPool=e.wrapTextLinesPool,this.penManager=this.newPenManager(),this._tmpPenManager=null,this.hitAreaManager=new ns,this.lastHitAreaKey=null,this.urlTagCursorStyle=null;var i=this.context;this.getTextWidth=function(t){return i.measureText(t).width};}return r(t,[{key:"destroy",value:function(){this.parent=void 0,this.scene=void 0,this.context=void 0,this.canvas=void 0,this.parser=void 0,this.defaultStyle=void 0,this.penManager&&(this.penManager.destroy(),this.penManager=void 0),this._tmpPenManager&&(this._tmpPenManager.destroy(),this._tmpPenManager=void 0),this.hitAreaManager&&(this.hitAreaManager.destroy(),this.hitAreaManager=void 0),this.pensPool=void 0,this.linesPool=void 0,this.wrapTextLinesPool=void 0;}},{key:"updatePenManager",value:function(t,e,i,n,s){if(void 0===s&&(s=this.penManager),s.clear(),""===t)return s;var r=this.parent.style;if(r.isWrapFitMode){var o=this.parent.padding;i=r.fixedWidth-o.left-o.right;}for(var a,h,l,u,c,d=this.canvas,f=this.context,p=function(t){return f.measureText(t).width},v=0,g=0,y=r.wrapCallback,k=r.wrapCallbackScope,m=!0,b=this.parser.splitText(t),C=this.wrapTextLinesPool,x=0,w=b.length;x0&&e!==ys&&i0&&t>e&&(t=e),t}},{key:"linesWidth",get:function(){return Math.ceil(this.penManager.getMaxLineWidth())}},{key:"linesHeight",get:function(){var t=this.desplayLinesCount,e=this.defaultStyle.lineHeight*t;return t>0&&(e-=this.defaultStyle.lineSpacing),e}},{key:"imageManager",get:function(){return this.parent.imageManager}},{key:"rtl",get:function(){return this.parent.style.rtl}},{key:"newPenManager",value:function(){return new Qn({pensPool:this.pensPool,linesPool:this.linesPool,tagToText:this.parser.propToTagText,tagToTextScope:this.parser})}},{key:"tmpPenManager",get:function(){return null===this._tmpPenManager&&(this._tmpPenManager=this.newPenManager()),this._tmpPenManager}},{key:"getPlainText",value:function(t,e,i){var n;if(null==t)n=this.penManager.plainText;else {var s=this.parser.splitText(t,1);n="";for(var r=0,o=s.length;rh;u--){for(c=0;c0&&this.wrapMode!==In&&0===this.wrapWidth}},{key:"setStyle",value:function(t,e,i){if(void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("wrap")){var n=t.wrap;if(n.hasOwnProperty("mode")){var s=n.mode;"string"==typeof s&&(n.mode=Gn[s]);}else n.hasOwnProperty("width")&&(n.mode=1);}t&&t.rtl&&i&&!t.hasOwnProperty("halign")&&(t.halign="right"),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px");var r=this.propertyMap;for(var o in r){var a=r[o],h=a[0],l=i?a[1]:this[o],u=a[2];if("wrapCallback"===o||"wrapCallbackScope"===o)this[o]=Wn(t,h,l);else {var c=Vn(t,h,l);u&&(c=u(c)),this[o]=c;}}var d=Wn(t,"font",null);this._font=null===d?this.fontStyle+" "+this.fontSize+" "+this.fontFamily:d;var f=Wn(t,"fill",null);null!==f&&(this.color=mn(f));var p=Wn(t,"metrics",!1);return p?this.metrics={ascent:Wn(p,"ascent",0),descent:Wn(p,"descent",0),fontSize:Wn(p,"fontSize",0)}:!e&&this.metrics||(this.metrics=Bn(this)),e?this.parent.updateText():this.parent}},{key:"syncFont",value:function(t,e){e.font=this._font;}},{key:"syncStyle",value:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round";}},{key:"syncShadow",value:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0);}},{key:"update",value:function(t){return t&&(this._font="".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily).trim(),this.metrics=Bn(this)),this.parent.updateText(t)}},{key:"buildFont",value:function(){var t="".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily).trim();return t!==this._font&&(this._font=t),this}},{key:"setFont",value:function(t){return "string"==typeof t?(this.fontFamily=t,this.fontSize="",this.fontStyle=""):(this.fontFamily=Wn(t,"fontFamily","Courier"),this.fontSize=Wn(t,"fontSize","16px"),this.fontStyle=Wn(t,"fontStyle","")),this.update(!0)}},{key:"setFontFamily",value:function(t){return this.fontFamily=t,this.update(!0)}},{key:"setFontStyle",value:function(t){return this.fontStyle=t,this.update(!0)}},{key:"setFontSize",value:function(t){return "number"==typeof t&&(t=t.toString()+"px"),this.fontSize=t,this.update(!0)}},{key:"setTestString",value:function(t){return this.testString=t,this.update(!0)}},{key:"setFixedSize",value:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(this.isWrapFitMode)}},{key:"setResolution",value:function(t){return this.resolution=t,this.update(!1)}},{key:"setLineSpacing",value:function(t){return this.lineSpacing=t,this.update(!1)}},{key:"setXOffset",value:function(t){return this.xOffset=t,this.update(!1)}},{key:"setBackgroundColor",value:function(t,e,i){return void 0===i&&(i=!0),this.backgroundColor=mn(t,this.parent.canvas,this.parent.context),this.backgroundColor2=mn(e,this.parent.canvas,this.parent.context),this.backgroundHorizontalGradient=i,this.update(!1)}},{key:"setBackgroundStrokeColor",value:function(t,e){return this.backgroundStrokeColor=mn(t,this.parent.canvas,this.parent.context),this.backgroundStrokeLineWidth=e,this.update(!1)}},{key:"setBackgroundCornerRadius",value:function(t,e){return this.backgroundCornerRadius=t,this.backgroundCornerIteration=e,this.update(!1)}},{key:"setFill",value:function(t){return this.color=mn(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setColor",value:function(t){return this.color=mn(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setStroke",value:function(t,e){return void 0===t?this.strokeThickness=0:(void 0===e&&(e=this.strokeThickness),this.stroke=mn(t,this.parent.canvas,this.parent.context),this.strokeThickness=e),this.update(!0)}},{key:"setShadow",value:function(t,e,i,n,s,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===s&&(s=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=mn(i,this.parent.canvas,this.parent.context),this.shadowBlur=n,this.shadowStroke=s,this.shadowFill=r,this.update(!1)}},{key:"setShadowOffset",value:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)}},{key:"setShadowColor",value:function(t){return void 0===t&&(t="#000"),this.shadowColor=mn(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setShadowBlur",value:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)}},{key:"setShadowStroke",value:function(t){return this.shadowStroke=t,this.update(!1)}},{key:"setShadowFill",value:function(t){return this.shadowFill=t,this.update(!1)}},{key:"setUnderline",value:function(t,e,i){return void 0===t&&(t="#000"),void 0===e&&(e=0),void 0===i&&(i=0),this.underlineColor=mn(t,this.parent.canvas,this.parent.context),this.underlineThickness=e,this.underlineOffset=i,this.update(!1)}},{key:"setUnderlineColor",value:function(t){return void 0===t&&(t="#000"),this.underlineColor=mn(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setUnderlineThickness",value:function(t){return void 0===t&&(t=0),this.underlineThickness=t,this.update(!1)}},{key:"setUnderlineOffset",value:function(t){return void 0===t&&(t=0),this.underlineOffset=t,this.update(!1)}},{key:"setStrikethrough",value:function(t,e,i){return void 0===t&&(t="#000"),void 0===e&&(e=0),void 0===i&&(i=0),this.strikethroughColor=mn(t,this.parent.canvas,this.parent.context),this.strikethroughThickness=e,this.strikethroughOffset=i,this.update(!1)}},{key:"setStrikethroughColor",value:function(t){return void 0===t&&(t="#000"),this.strikethroughColor=mn(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setStrikethroughThickness",value:function(t){return void 0===t&&(t=0),this.strikethroughThickness=t,this.update(!1)}},{key:"setStrikethroughOffset",value:function(t){return void 0===t&&(t=0),this.strikethroughOffset=t,this.update(!1)}},{key:"setWrapMode",value:function(t){return "string"==typeof t&&(t=Gn[t.toLowerCase()]||0),this.wrapMode=t,this.update(!0)}},{key:"setWrapWidth",value:function(t){return this.wrapWidth=t,this.update(!1)}},{key:"setAlign",value:function(t,e){return void 0===t&&(t="left"),void 0===e&&(e="top"),this.halign=t,this.valign=e,this.update(!1)}},{key:"setHAlign",value:function(t){return void 0===t&&(t="left"),this.halign=t,this.update(!1)}},{key:"setVAlign",value:function(t){return void 0===t&&(t="top"),this.valign=t,this.update(!1)}},{key:"setMaxLines",value:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)}},{key:"getTextMetrics",value:function(){var t=this.metrics;return {ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}}},{key:"setTextMetrics",value:function(t,e){return this.metrics.ascent=t.ascent,this.metrics.descent=t.descent,this.metrics.fontSize=t.fontSize,e&&("string"==typeof e?(this.fontFamily=e,this.fontSize="",this.fontStyle=""):(this.fontFamily=Wn(e,"fontFamily",this.fontFamily),this.fontSize=Wn(e,"fontSize",this.fontSize),this.fontStyle=Wn(e,"fontStyle",this.fontStyle))),this.parent.updateText(!0)}},{key:"lineHeight",get:function(){return this.metrics.fontSize+this.strokeThickness+this.lineSpacing}},{key:"toJSON",value:function(){var t={},e=this.propertyMap;for(var i in e)t[i]=this[i];return t.metrics=this.getTextMetrics(),t}},{key:"destroy",value:function(){this.parent=void 0;}}]),t}(),Gn={none:In,word:zn,char:Fn,character:Fn},Hn={draw:function(t,e,i,n){var s=this.penManager;this.hitAreaManager.clear();var r=this.context;r.save();var o=this.defaultStyle;this.clear(),On(this,o.backgroundColor,o.backgroundStrokeColor,o.backgroundStrokeLineWidth,o.backgroundCornerRadius,o.backgroundColor2,o.backgroundHorizontalGradient,o.backgroundCornerIteration),t+=this.startXOffset,e+=this.startYOffset;var a,h,l,u,c,d,f=o.halign,p=o.valign,v=o.lineHeight,g=s.lines,y=g.length,k=o.maxLines;k>0&&y>k?(h=k,l="center"===p?Math.floor((y-h)/2):"bottom"===p?y-h:0):(h=y,l=0),u=l+h;var m=this.rtl,b=m?this.parent.width:void 0;d="center"===p?Math.max((n-h*v)/2,0):"bottom"===p?Math.max(n-h*v-2,0):0,d+=e;for(var C=l;C0&&t.width>0){var a=i+o.underlineOffset-o.underlineThickness/2;this.drawLine(e,a,t.width,o.underlineThickness,o.underlineColor,o);}if(t.isTextPen&&this.drawText(e,i,t.text,o),t.isImagePen&&this.drawImage(e,i,t.prop.img,o),o.strikethroughThickness>0&&t.width>0){a=i+o.strikethroughOffset-o.strikethroughThickness/2;this.drawLine(e,a,t.width,o.strikethroughThickness,o.strikethroughColor,o);}if(r.restore(),t.hasAreaMarker&&t.width>0){var h,l=t.prop.area;if(l)h={key:l};else {var u=t.prop.url;h={key:"url:".concat(u),url:u};}this.hitAreaManager.add(e,i-this.startYOffset,t.width,this.defaultStyle.lineHeight,h);}},clear:function(){var t=this.canvas;this.context.clearRect(0,0,t.width,t.height);},drawLine:function(t,e,i,n,s,r){this.autoRound&&(t=Math.round(t),e=Math.round(e));var o=this.context;r.syncShadow(o,r.shadowStroke);var a=o.lineCap;o.lineCap="butt",o.strokeStyle=s,o.lineWidth=n,o.beginPath(),o.moveTo(t,e),o.lineTo(t+i,e),o.stroke(),o.lineCap=a;},drawText:function(t,e,i,n){this.autoRound&&(t=Math.round(t),e=Math.round(e));var s=this.context;n.stroke&&"none"!==n.stroke&&n.strokeThickness>0&&(n.syncShadow(s,n.shadowStroke),s.strokeText(i,t,e)),n.color&&"none"!==n.color&&(n.syncShadow(s,n.shadowFill),s.fillText(i,t,e));},drawImage:function(t,e,i,n){e-=this.startYOffset,this.parent.imageManager.draw(i,this.context,t,e,this.autoRound);}},Un=Phaser.Utils.Objects.GetValue,Nn=jn,Kn=Dn,Jn=function(){function t(e){n(this,t),this.prop={},this.resetFromJSON(e);}return r(t,[{key:"resetFromJSON",value:function(t){this.text=Un(t,"text",""),this.x=Un(t,"x",0),this.y=Un(t,"y",0),this.width=Un(t,"width",0);var e=Un(t,"prop",null);null===e&&(e={}),this.prop=e,this.newLineMode=Un(t,"newLineMode",0),this.startIndex=Un(t,"startIndex",0);}},{key:"plainText",get:function(){var t=this.text;return this.newLineMode===Kn&&(t+="\n"),t}},{key:"wrapText",get:function(){var t=this.text;return this.newLineMode!==Nn&&(t+="\n"),t}},{key:"rawTextLength",get:function(){var t=this.text.length;return this.newLineMode===Kn&&(t+=1),t}},{key:"endIndex",get:function(){return this.startIndex+this.rawTextLength}},{key:"lastX",get:function(){return this.x+this.width}},{key:"isTextPen",get:function(){return ""!==this.text}},{key:"isImagePen",get:function(){return !!this.prop.img}},{key:"hasAreaMarker",get:function(){return !!this.prop.area||!!this.prop.url}}]),t}(),Zn=Phaser.Utils.Objects.GetFastValue,qn=jn,$n=An,Qn=function(){function t(e){n(this,t),this.pens=[],this.lines=[],this.maxLinesWidth=void 0,this.pensPool=e.pensPool,this.linesPool=e.linesPool,this.tagToText=Zn(e,"tagToText",Ye),this.tagToTextScope=Zn(e,"tagToTextScope",void 0);}return r(t,[{key:"destroy",value:function(){this.clear(),this.tagToText=void 0,this.tagToTextScope=void 0;}},{key:"clear",value:function(){for(var t=0,e=this.lines.length;t=this.lines.length)return this.getLineEndIndex(t);var e=this.lines[t];return e&&e[0]?e[0].startIndex:0}},{key:"getLineEndIndex",value:function(t){t>=this.lines.length&&(t=this.lines.length-1);var e,i,n=!1;for(e=t;e>=0&&!(n=null!=(i=this.lines[e])&&i.length>0);e--);return n?i[i.length-1].endIndex:0}},{key:"getLineWidth",value:function(t){var e=this.lines[t];if(!e)return 0;var i=e[e.length-1];return null==i?0:i.lastX}},{key:"getMaxLineWidth",value:function(){if(void 0!==this.maxLinesWidth)return this.maxLinesWidth;for(var t,e=0,i=0,n=this.lines.length;ie&&(e=t);return this.maxLinesWidth=e,e}},{key:"getLineWidths",value:function(){for(var t=[],e=0,i=this.lines.length;e=t&&h<=e||(o=o.substring(t-a,e-a)),this.tagToTextScope?c+=this.tagToText.call(this.tagToTextScope,o,l,u):c+=this.tagToText(o,l,u),u=l,!(h>=e)));d++);return c}},{key:"length",get:function(){return this.lines.length},set:function(t){this.clear();}}]),t}(),ts={},es=Phaser.Geom.Rectangle,is=new hi,ns=function(){function t(){n(this,t),this.hitAreas=[];}return r(t,[{key:"destroy",value:function(){this.clear();}},{key:"clear",value:function(){for(var t=0,e=this.hitAreas.length;ts){""!==S?a.push(o.getLine(S,O,us)):0===T&&r>0&&a.push(o.getLine("",0,us)),a.push.apply(a,m(t(b,i,fs,s,0,o)));var E=a.pop();S=E.text,O=E.width,o.freeLine(E)," "===S&&(S="",O=0);}else (w=O+C)>l?(a.push(o.getLine(S,O,us)),S=b,O=C,l=s):(S+=b,O=w),x&&a.push(o.getLine(S,O,u));}return a},gs=Phaser.Utils.Objects.GetValue,ys=In,ks=jn,ms=function(){function t(e){n(this,t),this.parent=e.parent,this.scene=this.parent.scene,this.context=gs(e,"context",null),this.canvas=this.context.canvas,this.parser=gs(e,"parser",null),this.defaultStyle=gs(e,"style",null),this.autoRound=!0,this.pensPool=e.pensPool,this.linesPool=e.linesPool,this.wrapTextLinesPool=e.wrapTextLinesPool,this.penManager=this.newPenManager(),this._tmpPenManager=null,this.hitAreaManager=new ns,this.lastHitAreaKey=null,this.urlTagCursorStyle=null;var i=this.context;this.getTextWidth=function(t){return i.measureText(t).width};}return r(t,[{key:"destroy",value:function(){this.parent=void 0,this.scene=void 0,this.context=void 0,this.canvas=void 0,this.parser=void 0,this.defaultStyle=void 0,this.penManager&&(this.penManager.destroy(),this.penManager=void 0),this._tmpPenManager&&(this._tmpPenManager.destroy(),this._tmpPenManager=void 0),this.hitAreaManager&&(this.hitAreaManager.destroy(),this.hitAreaManager=void 0),this.pensPool=void 0,this.linesPool=void 0,this.wrapTextLinesPool=void 0;}},{key:"updatePenManager",value:function(t,e,i,n,s){if(void 0===s&&(s=this.penManager),s.clear(),""===t)return s;var r=this.parent.style;if(r.isWrapFitMode){var o=this.parent.padding;i=r.fixedWidth-o.left-o.right;}for(var a,h,l,u,c,d=this.canvas,f=this.context,p=function(t){return f.measureText(t).width},v=0,g=0,y=r.wrapCallback,k=r.wrapCallbackScope,m=!0,b=this.parser.splitText(t),C=this.wrapTextLinesPool,x=0,w=b.length;x0&&e!==ys&&i0&&t>e&&(t=e),t}},{key:"linesWidth",get:function(){return Math.ceil(this.penManager.getMaxLineWidth())}},{key:"linesHeight",get:function(){var t=this.desplayLinesCount,e=this.defaultStyle.lineHeight*t;return t>0&&(e-=this.defaultStyle.lineSpacing),e}},{key:"imageManager",get:function(){return this.parent.imageManager}},{key:"rtl",get:function(){return this.parent.style.rtl}},{key:"newPenManager",value:function(){return new Qn({pensPool:this.pensPool,linesPool:this.linesPool,tagToText:this.parser.propToTagText,tagToTextScope:this.parser})}},{key:"tmpPenManager",get:function(){return null===this._tmpPenManager&&(this._tmpPenManager=this.newPenManager()),this._tmpPenManager}},{key:"getPlainText",value:function(t,e,i){var n;if(null==t)n=this.penManager.plainText;else {var s=this.parser.splitText(t,1);n="";for(var r=0,o=s.length;r * @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=function(){return this.close(),this.emit("keydown-ENTER",this.parent,this),this},Xu=function(){this.isOpened=!0,this.initText(),this.enterCloseEnable&&this.scene.input.keyboard.once("keydown-ENTER",Vu,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);},Gu=function(){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);},Hu=Phaser.Utils.Objects.GetValue,Uu=function(t,e){var i,n=Hu(e,"inputType",void 0);void 0===n&&(n=Hu(e,"type","text")),"textarea"===n?(i=document.createElement("textarea")).style.resize="none":(i=document.createElement("input")).type=n;var s=Hu(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.addEventListener("focus",(function(e){Xu.call(t);})),i.addEventListener("blur",(function(e){Gu.call(t);})),i},Nu={open:function(){return this.isOpened||this.readOnly||((t=this)!==Iu&&(void 0!==Iu&&Iu.close(),Iu=t),this.node||(this.node=Uu(this,this.nodeConfig)),this.setFocus()),this;var t;},close:function(){return this.isOpened?(this===Iu&&(Iu=void 0),this.setBlur(),this):this}},Ku=Phaser.Utils.Objects.GetValue,Ju=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=Ku(s,"inputType",void 0);void 0===o&&(o=Ku(s,"type","text")),r.setEnterCloseEnable(Ku(s,"enterClose","textarea"!==o));var a=Ku(s,"onOpen",void 0);a||(a=Ku(s,"onFocus",void 0)),r.onOpenCallback=a;var h=Ku(s,"onClose",void 0);return h||(h=Ku(s,"onBlur",void 0)),r.onCloseCallback=h,r.onUpdateCallback=Ku(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(Ju.prototype,Nu);var Zu=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},qu=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)):(qu(this),$u(this)),this}},{key:"setNumberInput",value:function(){return this.onUpdateCallback=Zu,this}},{key:"setSelectAllWhenFocusEnable",value:function(t){return void 0===t&&(t=!0),this.selectAllWhenFocus=t,this}}]),i}(Ju),ec=Phaser.Utils.Objects.GetValue,ic=["inputType","onOpen","onFocus","onClose","onBlur","onUpdate","enterClose","readOnly","maxLength","minLength","selectAll"],nc=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}lc.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(uc(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=dd(t,"tl",0),this.radiusTR=dd(t,"tr",0),this.radiusBL=dd(t,"bl",0),this.radiusBR=dd(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]),Kc(this.x,this.y,t),p(h(i.prototype),"updateData",this).call(this),this}}]),i}(Ac),pd=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,vd=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=pd(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}(jc),gd={buildShapes:function(){this.addShape((new fd).setName("box")).addShape((new ld).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);}},yd=Phaser.Utils.Objects.GetValue,kd=Phaser.Math.Linear,md=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=yd(t,"key","value");var n=e[this.propertyKey];return this.fromValue=yd(t,"from",n),this.toValue=yd(t,"to",n),this.setEase(yd(t,"ease",this.ease)),this.setDuration(yd(t,"duration",this.duration)),this.setRepeat(yd(t,"repeat",0)),this.setDelay(yd(t,"delay",0)),this.setRepeatDelay(yd(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]=kd(this.fromValue,this.toValue,i);}}]),i}(Ua),bd={setCheckerAnimationDuration:function(t){return void 0===t&&(t=0),this.checkerAnimDuration=t,this},playCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask&&(this.checkerAnimProgressTask=new md(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}},Cd={};Object.assign(Cd,Rc,{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}},gd,bd);var xd=Phaser.Utils.Objects.GetValue,wd=Phaser.Utils.Objects.IsPlainObject,Sd=23730,Od=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),wd(s)?(s=xd(l=s,"x",0),r=xd(l,"y",0),o=xd(l,"width",2),a=xd(l,"height",2),h=xd(l,"color",Sd)):wd(h)&&(h=xd(l=h,"color",Sd)),(u=e.call(this,t,s,r,o,a)).type="rexCheckbox",void 0===h&&(h=Sd),u.setBoxShape(xd(l,"circleBox",!1)),u.setBoxFillStyle(h,xd(l,"boxFillAlpha",1)),u.setUncheckedBoxFillStyle(xd(l,"uncheckedColor",null),xd(l,"uncheckedBoxFillAlpha",1)),u.setBoxStrokeStyle(xd(l,"boxLineWidth",4),xd(l,"boxStrokeColor",h),xd(l,"boxStrokeAlpha",1)),u.setUncheckedBoxStrokeStyle(u.boxLineWidth,xd(l,"uncheckedBoxStrokeColor",u.boxStrokeColor),xd(l,"uncheckedBoxStrokeAlpha",u.boxStrokeAlpha)),u.setCheckerStyle(xd(l,"checkerColor",16777215),xd(l,"checkerAlpha",1)),u.setBoxSize(xd(l,"boxSize",1)),u.setCheckerSize(xd(l,"checkerSize",1)),u.setCheckerAnimationDuration(xd(l,"animationDuration",150)),u.buildShapes();var c=xd(l,"checked");return void 0===c&&(c=xd(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}(Lc);Object.assign(Od.prototype,Cd);var Pd=Phaser.Utils.Objects.GetValue,Td=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(Pd(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(Pd(t,"enable",!0)),this.setMode(Pd(t,"mode",1)),this.setClickInterval(Pd(t,"clickInterval",100)),this.setDragThreshold(Pd(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=Md[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),Md={press:0,pointerdown:0,release:1,pointerup:1},Ed=Phaser.Utils.Objects.GetValue,_d=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 Td(u(c),Ed(l,"click")),c._click.on("click",(function(){this.toggleValue();}),u(c)),c.setReadOnly(Ed(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}(Od),Ld={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}},Rd={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}},Bd={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}},jd=function(t,e,i){return (e-t)*i+t},Dd=Phaser.Math.Linear,Ad={buildShapes:function(){this.addShape((new fd).setName("track")).addShape((new fd).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&jd(ia(l),ia(u),c))<<16|(255&jd(na(l),na(u),c))<<8|255&jd(sa(l),sa(u),c)),f=Dd(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=Dd(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);}},Id={setToggleAnimationDuration:function(t){return void 0===t&&(t=0),this.toggleAnimDuration=t,this},playToggleAnimation:function(){return void 0===this.toggleAnimProgressTask&&(this.toggleAnimProgressTask=new md(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}},zd={};Object.assign(zd,Ld,Rd,Bd,Ad,Id);var Fd=Phaser.Utils.Objects.GetValue,Yd=Phaser.Utils.Objects.IsPlainObject,Wd=23730,Vd=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),Yd(s)?(s=Fd(l=s,"x",0),r=Fd(l,"y",0),o=Fd(l,"width",2),a=Fd(l,"height",2),h=Fd(l,"color",Wd)):Yd(h)&&(h=Fd(l=h,"color",Wd)),(u=e.call(this,t,s,r,o,a)).type="rexToggleSwitch",void 0===h&&(h=Wd),u.setTrackFillStyle(h,Fd(l,"trackFillAlpha",1)),u.setFalseValueTrackFillStyle(Fd(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)),Fd(l,"falseValueTrackFillAlpha",1)),u.setThumbStyle(Fd(l,"thumbColor",16777215),Fd(l,"thumbAlpha",1)),u.setTrackSize(Fd(l,"trackWidth",.9),Fd(l,"trackHeight",.5)),u.setTrackRadius(Fd(l,"trackRadius",.5*u.trackHeight));var c=Fd(l,"thumbHeight",void 0),d=Fd(l,"thumbWidth",c);return void 0===d&&(d=.9*u.trackHeight),u.setThumbSize(d,c),u.setThumbRadius(Fd(l,"thumbRadius",.5*u.thumbHeight)),u.setThumbPosition(Fd(l,"thumbLeft",.3),Fd(l,"thumbRight",void 0)),u.setRTL(Fd(l,"rtl",!1)),u.setToggleAnimationDuration(Fd(l,"animationDuration",150)),u.buildShapes(),u.setValue(Fd(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}(Lc);Object.assign(Vd.prototype,zd);var Xd=Phaser.Utils.Objects.GetValue,Gd=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 Td(u(c),Xd(l,"click")),c._click.on("click",(function(){this.toggleValue();}),u(c)),c.setReadOnly(Xd(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}(Vd),Hd={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);}))}},Ud=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(Ud.prototype,Hd),Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue;var Nd=Phaser.Math.Linear,Kd=Phaser.Math.Percent,Jd={setValue:function(t,e,i){return null==t||(void 0!==e&&(t=Kd(t,e,i)),this.value=t),this},addValue:function(t,e,i){return void 0!==e&&(t=Kd(t,e,i)),this.value+=t,this},getValue:function(t,e){var i=this.value;return void 0!==t&&(i=Nd(t,e,i)),i}},Zd=Phaser.Math.Percent,qd={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=Zd(t,e,i)),void 0===this.easeValueTask&&(this.easeValueTask=new md(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 md(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,from:t,to:e,duration:this.easeValueDuration,ease:this.easeFunction,repeat:i,repeatDelay:n}),this}},$d=Phaser.Utils.Objects.GetValue,Qd=Phaser.Math.Clamp;function tf(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=$d(t,"eventEmitter",this);var e=$d(t,"valuechangeCallback",null);if(null!==e){var i=$d(t,"valuechangeCallbackScope",void 0);this.eventEmitter.on("valuechange",e,i);}return this.setEaseValuePropName("value").setEaseValueDuration($d(t,"easeValue.duration",0)).setEaseValueFunction($d(t,"easeValue.ease","Linear")),this}},{key:"value",get:function(){return this._value},set:function(t){t=Qd(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,Jd,qd),e}var ef=Phaser.Math.RadToDeg,nf=Phaser.Math.DegToRad,sf=function(t,e,i,n,s,r,o,a){var h=360===Math.abs(o-r),l=nf(r),u=nf(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},rf={buildShapes:function(){this.addShape((new ld).setName("track")).addShape((new ld).setName("bar")).addShape((new Fc).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),sf(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=ef(this.startAngle),h=360*(o?1-this.value:this.value)+a;r.fillStyle(this.barColor),sf(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();}},of=Phaser.Utils.Objects.GetValue,af=Phaser.Utils.Objects.IsPlainObject,hf=Phaser.Math.Clamp,lf=Phaser.Math.DegToRad(270),uf=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),af(s)&&(s=of(l=s,"x",0),r=of(l,"y",0),o=of(l,"radius",1),a=of(l,"barColor",void 0),h=of(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(of(l,"trackColor",void 0)),u.setBarColor(a),u.setCenterColor(of(l,"centerColor",void 0)),u.setThickness(of(l,"thickness",.2)),u.setStartAngle(of(l,"startAngle",lf)),u.setAnticlockwise(of(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=hf(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}(tf(Lc));Object.assign(uf.prototype,rf);Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.IsPlainObject,Phaser.Math.Clamp,Phaser.Math.DegToRad(270);tf(gn);var cf=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},df=Phaser.Utils.Objects.GetValue,ff=Phaser.Utils.Objects.IsPlainObject,pf=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),ff(s)?(s=df(u=s,"x",0),r=df(u,"y",0),o=df(u,"width",2),a=df(u,"height",2),h=df(u,"barColor",void 0),l=df(u,"value",0)):ff(o)?(o=df(u=o,"width",2),a=df(u,"height",2),h=df(u,"barColor",void 0),l=df(u,"value",0)):ff(h)&&(h=df(u=h,"barColor",void 0),l=df(u,"value",0)),(c=e.call(this,t,s,r,o,a,u)).type="rexLineProgress",c.bootProgressBase(u),c.addShape((new ld).setName("trackFill")).addShape((new ld).setName("bar")).addShape((new ld).setName("trackStroke")),c.setTrackColor(df(u,"trackColor",void 0)),c.setBarColor(h),c.setTrackStroke(df(u,"trackStrokeThickness",2),df(u,"trackStrokeColor",void 0)),c.setSkewX(df(u,"skewX",0)),c.setRTL(df(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}(tf(Lc)),vf={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&&cf(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),cf(o,s,0,r,i,t).close());var a=this.getShape("trackStroke");a.lineStyle(this.trackStrokeThickness,this.trackStrokeColor),a.isStroked&&cf(a,0,0,e,i,t).end();}};Object.assign(pf.prototype,vf);var gf=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(),gf(0,r,this.trackPoints,void 0,this.trackStrokeColor,this.trackStrokeThickness),r.restore());},kf=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},mf=Phaser.Utils.Objects.GetValue,bf=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),bf(s)?(s=mf(u=s,"x",0),r=mf(u,"y",0),o=mf(u,"width",2),a=mf(u,"height",2),h=mf(u,"barColor",void 0),l=mf(u,"value",0)):bf(o)?(o=mf(u=o,"width",2),a=mf(u,"height",2),h=mf(u,"barColor",void 0),l=mf(u,"value",0)):bf(h)&&(h=mf(u=h,"barColor",void 0),l=mf(u,"value",0)),(c=e.call(this,t,s,r,o,a)).type="rexLineProgressCanvas",c.trackPoints=[],c.barPoints=[],c.bootProgressBase(u),c.setTrackColor(mf(u,"trackColor",void 0)),c.setBarColor(h,mf(u,"barColor2",void 0),mf(u,"isHorizontalGradient",void 0)),c.setTrackStroke(mf(u,"trackStrokeThickness",2),mf(u,"trackStrokeColor",void 0)),c.setSkewX(mf(u,"skewX",0)),c.setRTL(mf(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(),yf.call(this),p(h(i.prototype),"updateTexture",this).call(this),this}}]),i}(tf(gn));Phaser.Math.Wrap;var xf=Phaser.Math.Linear,wf=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=xf(m.a.x,b.a.x,C),e=xf(m.a.y,b.a.y,C),i=xf(m.b.x,b.b.x,C),n=xf(m.b.y,b.b.y,C),s=xf(m.c.x,b.c.x,C),r=xf(m.c.y,b.c.y,C);}o.startAt(t,e).lineTo(i,n).lineTo(s,r),this.arrowOnly?o.end():o.close();},Sf=(0, Phaser.Math.DegToRad)(120),Of=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+Sf),i+n*Math.sin(s+Sf)).lineTo(e+n*Math.cos(s),i+n*Math.sin(s)).lineTo(e+n*Math.cos(s-Sf),i+n*Math.sin(s-Sf)),this.arrowOnly?t.end():t.close();},Pf={buildShapes:function(){this.addShape((new ld).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?wf.call(this):Of.call(this);}},Tf={setEaseDuration:function(t){return void 0===t&&(t=0),this.easeDuration=t,this},playEaseDirectionation:function(){return void 0===this.easeDirectionProgressTask&&(this.easeDirectionProgressTask=new md(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}},Mf=Phaser.Utils.Objects.GetValue,Ef=Phaser.Utils.Objects.IsPlainObject,_f=Phaser.Math.DegToRad,Lf=Phaser.Math.RadToDeg,Rf=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),Ef(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=jf(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=Mf(r,"x",null);null!==o?(t=o,n=o):(t=Mf(r,"left",0),n=Mf(r,"right",t));var a=Mf(r,"y",null);null!==a?(e=a,s=a):(e=Mf(r,"top",0),s=Mf(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 Lf(this.verticeRotation)},set:function(t){this.verticeRotation=_f(t);}},{key:"setVerticeAngle",value:function(t){return this.verticeAngle=t,this}}]),s}(Lc),Bf={right:0,down:1,left:2,up:3},jf=function(t){return "string"==typeof t&&(t=Bf[t]),t%=4};Object.assign(Rf.prototype,Pf,Tf);var Df=function(t){return t.hasOwnProperty("rexSizer")||(t.rexSizer={}),t.rexSizer};var Af=Phaser.Display.Align,If={center:Af.CENTER,left:Af.LEFT_CENTER,right:Af.RIGHT_CENTER,top:Af.TOP_CENTER,bottom:Af.BOTTOM_CENTER,"left-top":Af.TOP_LEFT,"top-left":Af.TOP_LEFT,"left-center":Af.LEFT_CENTER,"center-left":Af.LEFT_CENTER,"left-bottom":Af.BOTTOM_LEFT,"bottom-left":Af.BOTTOM_LEFT,"center-top":Af.TOP_CENTER,"top-center":Af.TOP_CENTER,"center-center":Af.CENTER,"center-bottom":Af.BOTTOM_CENTER,"bottom-center":Af.BOTTOM_CENTER,"right-top":Af.TOP_RIGHT,"top-right":Af.TOP_RIGHT,"right-center":Af.RIGHT_CENTER,"center-right":Af.RIGHT_CENTER,"right-bottom":Af.BOTTOM_RIGHT,"bottom-right":Af.BOTTOM_RIGHT},zf=new Phaser.GameObjects.Zone({sys:{queueDepthSort:Ye,events:{once:Ye}}},0,0,1,1);zf.setOrigin(0);var Ff=0,Yf=1,Wf=2,Vf=4,Xf=6,Gf=8,Hf=10,Uf=12,Nf=function(t){var e=Pt(t);return t.y+e-e*t.originY},Kf=function(t){var e=Ot(t);return t.x-e*t.originX+.5*e},Jf=function(t,e){var i=Pt(t);return t.y=e-i+i*t.originY,t},Zf=function(t,e){var i=Ot(t),n=i*t.originX;return t.x=e+n-.5*i,t},qf=function(t){var e=Ot(t);return t.x-e*t.originX},$f=function(t,e){var i=Ot(t);return t.x=e+i*t.originX,t},Qf=function(t){var e=Ot(t);return t.x+e-e*t.originX},tp=function(t,e){var i=Ot(t);return t.x=e-i+i*t.originX,t},ep=function(t,e){var i=Pt(t),n=i*t.originY;return t.y=e+n-.5*i,t},ip=function(t){var e=Pt(t);return t.y-e*t.originY+.5*e},np=function(t){var e=Pt(t);return t.y-e*t.originY},sp=function(t,e){var i=Pt(t);return t.y=e+i*t.originY,t},rp=[];rp[11]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Zf(t,Kf(e)+i),Jf(t,Nf(e)+n),t},rp[Hf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),$f(t,qf(e)-i),Jf(t,Nf(e)+n),t},rp[Uf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),tp(t,Qf(e)+i),Jf(t,Nf(e)+n),t},rp[Xf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),function(t,e,i){Zf(t,e),ep(t,i);}(t,Kf(e)+i,ip(e)+n),t},rp[Vf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),$f(t,qf(e)-i),ep(t,ip(e)+n),t},rp[Gf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),tp(t,Qf(e)+i),ep(t,ip(e)+n),t},rp[Yf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Zf(t,Kf(e)+i),sp(t,np(e)-n),t},rp[Ff]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),$f(t,qf(e)-i),sp(t,np(e)-n),t},rp[Wf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),tp(t,Qf(e)+i),sp(t,np(e)-n),t};var op=function(t,e,i,n,s){return rp[i](t,e,n,s)},ap=function(t,e,i,n,s,r){zf.setPosition(e,i).setSize(n,s),op(t,zf,r);},hp=Phaser.Utils.Objects.GetValue,lp=Phaser.GameObjects.Group,up=function(t,e,i){return t.add.text(0,0,"")},cp=void 0,dp=Phaser.Utils.Objects.GetValue,fp=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=dp(t,"left",0),e.right=dp(t,"right",0),e.top=dp(t,"top",0),e.bottom=dp(t,"bottom",0)),e},pp=ie.prototype.add,vp=function(t){return pp.call(this,t),this.sizerEventsEnable&&(t.emit("sizer.add",t,this),this.emit("add",t,this)),this},gp={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),vp.call(this,t),this.backgroundChildren.push(t),this.getSizerConfig(t).padding=fp(e),void 0!==i&&this.addChildrenMap(i,t),this},isBackground:function(t){return void 0!==this.backgroundChildren&&-1!==this.backgroundChildren.indexOf(t)}},yp=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},kp={getParentSizer:function(t,e){return "string"==typeof t&&(e=t,t=void 0),void 0===t&&(t=this),yp(t,e)},getTopmostSizer:function(t){return void 0===t&&(t=this),function(t){for(var e=yp(t);e;)t=e,e=yp(e);return t}(t)},hasParentSizer:function(t,e){void 0===e&&(e=this);for(var i=yp(e);i;){if(i===t)return !0;i=yp(i);}return !1},hasChild:function(t,e){return void 0===e&&(e=this),this.hasParentSizer(e,t)}},mp=Phaser.Utils.Array.Remove,bp=ie.prototype.remove,Cp=kp.getParentSizer,xp=function(t,e){for(var i=Cp(t);i;)i.removeChildCallback&&i.removeChildCallback(t,e),i=Cp(i);return this.isBackground(t)&&mp(this.backgroundChildren,t),bp.call(this,t,e),!e&&this.sizerEventsEnable&&(t.emit("sizer.remove",t,this),this.emit("remove",t,this)),this},wp=Phaser.Utils.Array.Remove,Sp=kp.getParentSizer,Op={removeFromParentSizer:function(){var t=Sp(gameObject);return t&&t.remove(this),this},removeBackground:function(t,e){return void 0===this.backgroundChildren||this.getParentSizer(t)!==this||(wp(this.backgroundChildren,t),xp.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}},Pp={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}},Tp=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},Mp=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},Ep={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}},_p=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}(Bv),Dv={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}},Av={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}},Iv={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}},zv={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}},Fv={};Object.assign(Fv,Dv,Av,Iv,zv);var 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,s)).setTransitInTime(Yv(s,"duration.in",200)),r.setTransitOutTime(Yv(s,"duration.out",200)),r.setTransitInCallback(Yv(s,"transitIn")),r.setTransitOutCallback(Yv(s,"transitOut")),r.oneShotMode=Yv(s,"destroy",!1),r.delayCallTimer=void 0,r._state=new jv(u(r),{eventEmitter:!1,initState:Yv(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(Wv.prototype,Fv);var Vv=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),Xv=Phaser.Utils.Objects.GetValue,Gv=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(Xv(t,"hitAreaMode",0)),this.setEnable(Xv(t,"enable",!0)),this.setStopMode(Xv(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=Hv[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),Hv={default:0,fullWindow:1},Uv=Phaser.Utils.Objects.GetValue,Nv=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=Uv(s,"color",0),a=Uv(s,"alpha",.8);return (r=e.call(this,t,o,a)).touchEventStop=new Gv(u(r),{hitAreaMode:1}),r}return r(i)}(Vv),Kv=function(t,e){void 0!==t._modalScaleSave?(t.scaleX=t._modalScaleSave,t.scaleY=t._modalScaleSave):t._modalScaleSave=t.scaleX,zp(t,e);},Jv=function(t,e){Fp(t,e,void 0,void 0,!1);},Zv=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,Jp(t,e);},qv=function(t,e){Zp(t,e,!1);},$v=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,Jp(t,e,t.alpha);},Qv=function(t,e){Zp(t,e,!1);},tg=function(t,e,i,n,s){return !!t&&(!(n&&!n(t,e,i))&&(!!_t(t,!0).contains(e,i)&&!(s&&!s(t,e,i))))},eg=Phaser.Utils.Objects.GetValue,ig=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=ng.popUp),null==s.transitOut&&(s.transitOut=ng.scaleDown),s.destroy=eg(s,"destroy",!0),r=e.call(this,t,s);var o=eg(s,"cover");r.cover=!1!==o?function(t,e){var i=t.scene,n=new Nv(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(eg(o,"transitIn",$v)),r.setCoverTransitOutCallback(eg(o,"transitOut",Qv)));var a=eg(s,"touchOutsideClose",!1),h=eg(s,"duration.hold",-1),l=eg(s,"timeOutClose",h>=0),c=eg(s,"anyTouchClose",!1);return eg(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)),eg(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&&tg(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=ng[t]),t){case ng.popUp:t=Kv;break;case ng.fadeIn:t=Zv;}return p(h(i.prototype),"setTransitInCallback",this).call(this,t),this}},{key:"setTransitOutCallback",value:function(t){switch("string"==typeof t&&(t=ng[t]),t){case ng.scaleDown:t=Jv;break;case ng.fadeOut:t=qv;}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}(Wv),ng={popUp:0,fadeIn:1,scaleDown:0,fadeOut:1},sg={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 ig(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}},rg=function(t,e,i,n){if(e)return tg(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),xg={press:0,pointerdown:0,release:1,pointerup:1},wg={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 Cg(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}},Sg=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}(Bv),Og=Phaser.Utils.Objects.GetValue,Pg=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 Sg,r.parent.setInteractive(Og(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(Og(t,"enable",!0)),this.setCooldown(Og(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),Tg={isPointerInBounds:function(t){return void 0===t?t=this:"string"==typeof t&&(t=this.getElement(t)),!!t&&rg(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 Pg(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 Pg(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}},Mg=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=Gg,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===Hg&&this.onDragEnd(),this.pointer=void 0,this.tracerState=Gg,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=Ug,this}}]),i}(Ea),Gg=0,Hg=1,Ug="IDLE",Ng=Phaser.Utils.Objects.GetValue,Kg=Phaser.Math.Distance.Between,Jg=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=Zg;},eventEmitter:!1};return r.setRecongizedStateObject(new Bv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setHoldTime(Ng(t,"time",250)),this.setTapInterval(Ng(t,"tapInterval",200)),this.setDragThreshold(Ng(t,"threshold",9)),this.setTapOffset(Ng(t,"tapOffset",10));var e=Ng(t,"taps",void 0);return void 0!==e?this.setTaps(e):(this.setMaxTaps(Ng(t,"maxTaps",void 0)),this.setMinTaps(Ng(t,"minTaps",void 0))),this}},{key:"onDragStart",value:function(){switch(this.state){case Zg:this.state=qg;break;case qg:var t=this.lastPointer;Kg(t.upX,t.upY,t.x,t.y)>this.tapOffset&&(this.state=$g,this.state=qg);break;case $g:this.state=qg;}}},{key:"onDragEnd",value:function(){this.state===qg&&(this.tapsCount++,this.emit("tapping",this,this.gameObject,this.lastPointer),void 0!==this.maxTaps&&this.tapsCount===this.maxTaps&&(this.state=$g));}},{key:"onDrag",value:function(){this.state!==Zg&&this.pointer.getDistance()>this.dragThreshold&&(this.state=Zg);}},{key:"preUpdate",value:function(t,e){if(this.isRunning&&this.enable&&this.state===qg){var i=this.lastPointer;if(i.isDown)t-i.downTime>this.holdTime&&(this.state=Zg);else t-i.upTime>this.tapInterval&&(void 0===this.minTaps||this.tapsCount>=this.minTaps?this.state=$g:this.state=Zg);}}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===$g&&(this.state=Zg);}},{key:"isTapped",get:function(){return this.state===$g}},{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}(Xg),Zg="IDLE",qg="BEGIN",$g="RECOGNIZED",Qg=Phaser.Utils.Objects.GetValue,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.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=ey;},eventEmitter:!1};return r.setRecongizedStateObject(new Bv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Qg(t,"threshold",9)),this.setHoldTime(Qg(t,"time",251)),this}},{key:"onDragStart",value:function(){this.state=iy,0===this.holdTime&&(this.state=ny);}},{key:"onDragEnd",value:function(){this.state=ey;}},{key:"onDrag",value:function(){this.state!==ey&&this.pointer.getDistance()>this.dragThreshold&&(this.state=ey);}},{key:"preUpdate",value:function(t,e){this.isRunning&&this.enable&&(this.state===iy&&t-this.pointer.downTime>=this.holdTime&&(this.state=ny));}},{key:"isPressed",get:function(){return this.state===ny}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Xg),ey="IDLE",iy="BEGIN",ny="RECOGNIZED";Phaser.Utils.Objects.GetValue;var sy=Phaser.Math.Distance.Between,ry=Phaser.Math.Angle.Between,oy={getDt:function(){return Oc(this.scene)},getVelocity:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return sy(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 ry(e.x,e.y,t.x,t.y)}},ay={"up&down":0,"left&right":1,"4dir":2,"8dir":3},hy={},ly=Phaser.Utils.Objects.GetValue,uy=Phaser.Math.RadToDeg,cy=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=dy;},eventEmitter:!1};return r.setRecongizedStateObject(new Bv(a)),r.clearDirectionStates(),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(ly(t,"threshold",10)),this.setVelocityThreshold(ly(t,"velocityThreshold",1e3)),this.setDirectionMode(ly(t,"dir","8dir")),this}},{key:"onDragStart",value:function(){this.state=fy;}},{key:"onDragEnd",value:function(){this.state=dy;}},{key:"onDrag",value:function(){this.state===fy&&(this.validDrag||(this.validDrag=0===this.dragThreshold||this.pointer.getDistance()>=this.dragThreshold),this.validDrag&&this.dragVelocity>this.velocityThreshold&&(this.state=py));}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===py&&(this.state=dy);}},{key:"isSwiped",get:function(){return this.state===py}},{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=ay[t]),this.dirMode=t,this}},{key:"updateDirectionStates",value:function(){return function(t,e,i){switch(void 0===i?i={}:!0===i&&(i=hy),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;}}(uy(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}(Xg);Object.assign(cy.prototype,oy);var dy="IDLE",fy="BEGIN",py="RECOGNIZED",vy=Phaser.Utils.Objects.GetValue,gy=Phaser.Utils.Array.SpliceOne,yy=Phaser.Math.Distance.Between,ky=Phaser.Math.Angle.Between,my=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(vy(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(vy(t,"enable",!0)),this.bounds=vy(t,"bounds",void 0),this.tracerState=Cy,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 Cy:this.tracerState=xy,this.onDrag1Start();break;case xy:this.tracerState=wy,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],gy(this.pointers,e),this.tracerState){case xy:this.tracerState=Cy,this.onDrag1End();break;case wy:this.tracerState=xy,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 xy:this.onDrag1();break;case wy:this.onDrag2();}}}},{key:"dragCancel",value:function(){return this.tracerState===wy&&this.onDrag2End(),this.pointers.length=0,Yt(this.movedState),this.tracerState=Cy,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!==wy)return 0;var t=this.pointers[0],e=this.pointers[1];return yy(t.x,t.y,e.x,e.y)}},{key:"angleBetween",get:function(){if(this.tracerState!==wy)return 0;var t=this.pointers[0],e=this.pointers[1];return ky(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;by.x=e.x-i.x,by.y=e.y-i.y;}else by.x=0,by.y=0;return by}},{key:"centerX",get:function(){if(this.tracerState!==wy)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!==wy)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!==wy)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!==wy)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=Sy,this}}]),t}();Object.assign(my.prototype,Xo);var by={},Cy=0,xy=1,wy=2,Sy="IDLE";Phaser.Utils.Objects.GetValue;var Oy=Phaser.Math.RotateAround,Py=function(t,e,i,n){return Oy(t,e,i,n),t.rotation+=n,t},Ty={},My=Phaser.Utils.Objects.GetValue,Ey=Phaser.Math.Angle.WrapDegrees,_y=Phaser.Math.Angle.ShortestBetween,Ly=Phaser.Math.RadToDeg,Ry=Phaser.Math.DegToRad,By=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=Dy;},eventEmitter:!1};return r.setRecongizedStateObject(new Bv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(My(t,"threshold",0)),this}},{key:"onDrag2Start",value:function(){this.prevAngle=Ey(Ly(this.angleBetween)),this.state=Ay,0===this.dragThreshold&&(this.state=Iy);}},{key:"onDrag2End",value:function(){this.state=Dy;}},{key:"onDrag2",value:function(){switch(this.state){case Ay:if(this.pointers[0].getDistance()>=this.dragThreshold&&this.pointers[1].getDistance()>=this.dragThreshold){var t=Ey(Ly(this.angleBetween));this.angle=_y(this.prevAngle,t),this.prevAngle=t,this.state=Iy;}break;case Iy:t=Ey(Ly(this.angleBetween));this.angle=_y(this.prevAngle,t),this.prevAngle=t,this.emit("rotate",this);}}},{key:"isRotated",get:function(){return this.state===Iy}},{key:"rotation",get:function(){return Ry(this.angle)}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(my),jy={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=Ty),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),rm(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(bm.prototype,am);var Cm=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},xm={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"]},wm={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]},Sm={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"},Om=Phaser.Utils.Objects.GetValue,Pm=function(t,e,i,n){var s=Om(n,"preventDefault",!1),r=Om(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);},Tm=Phaser.GameObjects.DOMElement,Mm=Phaser.Utils.Objects.IsPlainObject,Em=Phaser.Utils.Objects.GetValue,_m=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l,c;n(this,i),Mm(s)?(s=Em(h=s,"x",0),r=Em(h,"y",0),o=Em(h,"width",0),a=Em(h,"height",0)):Mm(o)&&(o=Em(h=o,"width",0),a=Em(h,"height",0)),void 0===h&&(h={});var d=Em(h,"inputType",void 0);void 0===d&&(d=Em(h,"type","text")),"textarea"===d?(c=document.createElement("textarea")).style.resize="none":(c=document.createElement("input")).type=d,Fu(xm,h,c);var f=Em(h,"style",void 0);f=Fu(wm,h,f);var p=c.style;for(var v in h)v in xm||v in wm||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),Pm(u(l),c,Sm),Yu(c),Em(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}(Tm),Lm={resize:Cm};Object.assign(_m.prototype,Lm),Phaser.Utils.Objects.GetValue;var Rm=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 Bm=function(t){return this.setOrigin(t.originX,t.originY),this.setPosition(t.x,t.y),this.resize(t.displayWidth,t.displayHeight),this},jm=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();},Dm={loadFile:function(t,e,i,n,s){var r=this.scene;return jm(r,t,e,i,n,s),this},loadFilePromise:function(t,e,i,n){var s=this.scene;return new Promise((function(r,o){jm(s,t,e,i,n,(function(t){r(t);}));}))}},Am=Phaser.GameObjects.DOMElement,Im=Phaser.Utils.Objects.IsPlainObject,zm=Phaser.Utils.Objects.GetValue,Fm=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),Im(s)?(s=zm(h=s,"x",0),r=zm(h,"y",0),o=zm(h,"width",0),a=zm(h,"height",0)):Im(o)&&(o=zm(h=o,"width",0),a=zm(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=zm(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(zm(h,"closeDelay",200)),c.onclick=function(){Rm({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(zm(t,"accept","")),this.setMultiple(zm(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}(Am),Ym={resize:Cm,syncTo:Bm};Object.assign(Fm.prototype,Ym,Dm);var Wm={setDropEnable:function(t){return void 0===t&&(t=!0),this.dropEnable=t,this},toggleDropEnable:function(){return this.dropEnable=!this.dropEnable,this}},Vm={resize:Cm,syncTo:Bm};Object.assign(Vm,Wm,{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}},Dm);var Xm={dragenter:"dragenter",dragleave:"dragleave",dragover:"dragover",drop:"drop"},Gm=Phaser.GameObjects.DOMElement,Hm=Phaser.Utils.Objects.IsPlainObject,Um=Phaser.Utils.Objects.GetValue,Nm=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),Hm(s)?(s=Um(h=s,"x",0),r=Um(h,"y",0),o=Um(h,"width",0),a=Um(h,"height",0)):Hm(o)&&(o=Um(h=o,"width",0),a=Um(h,"height",0)),void 0===h&&(h={});var c=document.createElement("div"),d=Um(h,"style",void 0);(l=e.call(this,t,s,r,c,d)).type="rexFileDropZone",l.resize(o,a),l._files=[],l.setDropEnable(Um(h,"dropEnable",!0));var f=Um(h,"filters");return f&&l.addFilters(f),Pm(u(l),c,Xm,{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}(Gm);Object.assign(Nm.prototype,Vm);var Km=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),Jm=Phaser.Utils.Objects.GetValue,Zm=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=Jm(s,"style",u(r));var o=Jm(s,"propertiesMap");return r.activeStyle=qm(s,"active",o),r.hoverStyle=qm(s,"hover",o),r.disableStyle=qm(s,"disable",o),r.onModifyStyle=Jm(s,"onModifyStyle"),r}return r(i,[{key:"getStyle",value:function(t){return rc(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 oc(e,t)?void 0:(this.modifyStyle(t),e)}}},{key:"setActiveState",value:function(t){return $m.call(this,"active",t),this}},{key:"setHoverState",value:function(t){return $m.call(this,"hover",t),this}},{key:"setDisableState",value:function(t){return $m.call(this,"disable",t),this}}]),i}(Ta),qm=function(t,e,i){var n=sc(t,e);if(i)for(var s in n)i.hasOwnProperty(s)&&(n[i[s]]=n[s],delete n[s]);return n},$m=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));},Qm={addStyleManager:function(t){return this.styleManager=new Zm(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}},tb=Phaser.GameObjects.Image,eb=Phaser.Utils.Objects.GetValue,ib=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=eb(s,"x",0),a=eb(s,"y",0),h=eb(s,"key",""),l=eb(s,"frame",void 0);(r=e.call(this,t,o,a,h,l)).type="rexStatesImage";var c=eb(s,"effects",!0);return c&&Qo(u(r),c),r.style=new Km(u(r),s),s.style=r.style,r.addStyleManager(s),delete s.style,r}return r(i)}(tb);Object.assign(ib.prototype,Qm);var nb=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),sb=Phaser.GameObjects.NineSlice,rb=Phaser.Utils.Objects.GetValue,ob=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=rb(s,"x",0),a=rb(s,"y",0),h=rb(s,"key",null),l=rb(s,"frame",null),c=rb(s,"width",0),d=rb(s,"height",0),f=rb(s,"leftWidth",0),p=rb(s,"rightWidth",0),v=rb(s,"topHeight",0),g=rb(s,"bottomHeight",0);(r=e.call(this,t,o,a,h,l,c,d,f,p,v,g)).type="rexStatesNineSlice";var y=rb(s,"effects",!0);return y&&Qo(u(r),y),r.style=new nb(u(r),s),s.style=r.style,r.addStyleManager(s),delete s.style,r}return r(i)}(sb);Object.assign(ob.prototype,Qm);var ab=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=hb,r.addStyleManager(s),delete s.style,delete s.propertiesMap,r}return r(i)}(on),hb={color:"fillColor",alpha:"fillAlpha",strokeWidth:"lineWidth"};Object.assign(ab.prototype,Qm);var lb=Phaser.GameObjects.Text,ub=Phaser.Utils.Objects.GetValue,cb=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=ub(s,"x",0),a=ub(s,"y",0),h=ub(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)}(lb);Object.assign(cb.prototype,Qm);var db=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},fb=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}(Ud),pb={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,db(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},kb=Phaser.Utils.Objects.IsPlainObject,mb=Phaser.Utils.Objects.GetValue,bb=Phaser.Display.Align.CENTER,Cb={min:0,full:-1},xb=function(t,e,n,s,r,o,a,h,l,u){vp.call(this,t);var c=t.isRexSpace,d=i(e);if(null===e)return this;if("number"===d);else if("string"===d)e=Cb[e];else if(kb(e)){var f;e=mb(f=e,"proportion",void 0),n=mb(f,"align",bb),s=mb(f,"padding",0),r=mb(f,"expand",!1),o=mb(f,"key",void 0),a=mb(f,"index",void 0),t.isRexSizer||(h=mb(f,"minWidth",void 0),l=mb(f,"minHeight",void 0)),u=mb(f,"fitRatio",0);}return "string"==typeof n&&(n=If[n]),void 0===e&&(e=c?1:0),void 0===n&&(n=bb),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=fp(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},wb={add:xb,addSpace:function(t){return this.insertSpace(void 0,t),this},insertSpace:function(t,e){return void 0===e&&(e=1),xb.call(this,new gb(this.scene),{proportion:e,minWidth:0,minHeight:0,index:t}),this},insert:function(t,e,i,n,s,r,o,a){return kb(i)&&(i.index=t),xb.call(this,e,i,n,s,r,o,t,a),this},insertAtPosition:function(t,e,i,n,s,r,o,a,h){var l=yb.call(this,t,e);return -1===l&&(l=void 0),this.insert(l,i,n,s,r,o,a,h),this}},Sb=Phaser.Utils.Array.Remove,Ob={remove:function(t,e){return this.getParentSizer(t)!==this||(Sb(this.sizerChildren,t),xp.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,ik.call(this,t),this}},Pb={getChildAlign:function(t){return this.getSizerConfig(t).align},setChildAlign:function(t,e){return "string"==typeof e&&(e=If[e]),this.getSizerConfig(t).align=e,this}},Tb={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=Mp.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(Tb,wb,Ob,Pb,{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 Mb=function(){for(var t,e,i=0,n=this.sizerChildren,s=0,r=n.length;s0&&(i+=e);return i},Eb={x:0,h:0,horizontal:0,"left-to-right":0,y:1,v:1,vertical:1,"top-to-bottom":1},_b=function(t){return "string"==typeof t&&(t=Eb[t]),t},Lb=Phaser.Utils.Objects.IsPlainObject,Rb=Phaser.Utils.Objects.GetValue,Bb=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;return n(this,i),Lb(s)?(s=Rb(l=s,"x",0),r=Rb(l,"y",0),o=Rb(l,"width",void 0),a=Rb(l,"height",void 0),h=Rb(l,"orientation",0)):Lb(o)?(o=Rb(l=o,"width",void 0),a=Rb(l,"height",void 0),h=Rb(l,"orientation",0)):Lb(h)&&(h=Rb(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(Rb(l,"space.item",0)),u.setStartChildIndex(Rb(l,"startChildIndex",0)),u.setRTL(Rb(l,"rtl",!1)),u.addChildrenMap("items",u.sizerChildren),u}return r(i,[{key:"setOrientation",value:function(t){return this.orientation=_b(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=Mb.call(this)),this._childrenProportion}}]),i}(Ky);Object.assign(Bb.prototype,Tb);var jb=function(){return Array.prototype.reduce.call(arguments,Db,0)},Db=function(t,e){return t+e},Ab=Phaser.Utils.Objects.IsPlainObject,Ib=Phaser.Utils.Objects.GetValue,zb=Phaser.Display.Align.CENTER,Fb=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 Wb(this.sizerChildren,null),ik.call(this,t),this}},Xb={setColumnSpace:function(t){if(this.space.column||(this.space.column=[]),this.space.column.length=this.columnCount-1,"number"==typeof t)Wb(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},Nb={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=Mp.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,Wb(this.sizerChildren,null),this.columnProportions=[],this.columnProportions.length=t,"number"==typeof i)Wb(this.columnProportions,i);else for(var r=0;r0&&(e+=t);return e},Jb=function(){for(var t,e=0,i=0;i0&&(e+=t);return e},Zb=Phaser.Utils.Objects.IsPlainObject,qb=Phaser.Utils.Objects.GetValue,$b=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),Zb(s)?(s=qb(d=s,"x",0),r=qb(d,"y",0),o=qb(d,"width",void 0),a=qb(d,"height",void 0),h=qb(d,"column",d.col||0),l=qb(d,"row",0),u=qb(d,"columnProportions",0),c=qb(d,"rowProportions",0)):Zb(o)?(o=qb(d=o,"width",void 0),a=qb(d,"height",void 0),h=qb(d,"column",d.col||0),l=qb(d,"row",0),u=qb(d,"columnProportions",0),c=qb(d,"rowProportions",0)):Zb(h)?(h=qb(d=h,"column",d.col||0),l=qb(d,"row",0),u=qb(d,"columnProportions",0),c=qb(d,"rowProportions",0)):Zb(u)&&(u=qb(d=u,"columnProportions",0),c=qb(d,"rowProportions",0)),(f=e.call(this,t,s,r,o,a,d)).type="rexGridSizer",f.sizerChildren=[],f.addChildrenMap("items",f.sizerChildren),f.setCreateCellContainerCallback(qb(d,"createCellContainerCallback")),f.setIndentLeft(qb(d,"space.indentLeftOdd",0),qb(d,"space.indentLeftEven",0)),f.setIndentTop(qb(d,"space.indentTopOdd",0),qb(d,"space.indentTopEven",0)),f.resetGrid(h,l,u,c,qb(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=Kb.call(this)),this._totalColumnProportions}},{key:"totalRowProportions",get:function(){return void 0===this._totalRowProportions&&(this._totalRowProportions=Jb.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}(Ky);Object.assign($b.prototype,Nb);var Qb=function(t,e,i,n){return e/t<=i?e/(n-1):0},tC=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=nC(a.left,a.centerY,t,e))&&(s=h,n=r);var h,l=i[r+1];if(!l||l.y!==a.y)s>(h=nC(a.right,a.centerY,t,e))&&(s=h,n=r+1);}}return n},rC=Phaser.Utils.Objects.IsPlainObject,oC=Phaser.Utils.Objects.GetValue,aC=Phaser.Display.Align.CENTER,hC=function(t,e,i,n){if("\n"===t)return this.addNewLine(),this;var s;(vp.call(this,t),rC(e))&&(e=oC(s=e,"padding",0),i=oC(s,"key",void 0),n=oC(s,"index",void 0));return void 0===e&&(e=0),(s=this.getSizerConfig(t)).align=aC,s.padding=fp(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},lC={add:function(t,e,i){if(og(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,ik.call(this,t),this}},dC={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--)$C.call(this,e[i],t);return this}},tx=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);}},ex=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,tx.call(e,t,i,n);}},enumerable:!0,configurable:!0}),t.selected=!1;},ix={add:function(t){return this.buttons.push(t),t._click||(t._click=new Td(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")),ex.call(this,t)),this},addMultiple:function(t){for(var e=0,i=t.length;e2?o-2:0),h=2;h=0;i--)kx.call(this,e[i],t);return this}},bx=Phaser.Utils.Objects.GetValue,Cx=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=bx(s,"row",0),a=bx(s,"column",s.col||0),h=bx(s,"createCellContainerCallback"),l=bx(s,"buttons",void 0),c=bx(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&&xx.addNewLine(this);}else for(r=0,o=t.length;r=0;i--)Tx.call(this,e[i],t);return this}},Ex=Phaser.Utils.Objects.GetValue,_x=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 lx({parent:u(r),eventEmitter:Ex(s,"eventEmitter",u(r)),groupName:Ex(s,"groupName",void 0),clickConfig:Ex(s,"click",void 0)}).setButtonsType(s);var a=Ex(s,"background",void 0),h=Ex(s,"buttons",void 0);return r.buttonsAlign=Ex(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}(yC);Object.assign(_x.prototype,Sx,Mx,hx,cx);var Lx=Phaser.Utils.Objects.GetValue,Rx=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 Fm(t);return t.add.existing(o),r.addBackground(o),r.addChildrenMap("fileChooser",o),r.setAccept(Lx(s,"accept","")),r.setMultiple(Lx(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}(SC);Object.assign(Rx.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 Bx={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}},jx={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,sg.modal.call(this,t,e),this}},Dx={};Object.assign(Dx,Bx,jx);var Ax=Phaser.Utils.Objects.GetValue,Ix=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=Ax(s,"eventEmitter",u(r));var o,a,h,l,c=Ax(s,"background",void 0),d=Ax(s,"title",void 0),f=Ax(s,"toolbar",void 0),p=Ax(s,"toolbarBackground",void 0),v=Ax(s,"leftToolbar",void 0),g=Ax(s,"leftToolbarBackground",void 0),y=Ax(s,"content",void 0),k=Ax(s,"description",void 0),m=Ax(s,"choices",void 0),b=Ax(s,"choicesBackground",void 0),C=Ax(s,"actions",void 0),x=Ax(s,"actionsBackground",void 0),w=Ax(s,"click",void 0);if(c&&r.addBackground(c),f&&(h=new fx(t,{groupName:"toolbar",background:p,buttons:f,orientation:0,space:{item:Ax(s,"space.toolbarItem",0)},click:w,eventEmitter:r.eventEmitter})),v&&(l=new fx(t,{groupName:"leftToolbar",background:g,buttons:v,orientation:0,space:{item:Ax(s,"space.leftToolbarItem",0)},click:w,eventEmitter:r.eventEmitter})),d||f||v){var S,O=!!d&&Ax(s,"expand.title",!0),P=Ax(s,"align.title","center"),T=!(d&&!O&&"center"===P||!d&&(f||v));S=T?new Bb(t,{orientation:0}):new hk(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:Ax(s,"space.titleLeft",0),right:Ax(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:Ax(s,"space.title",0),top:Ax(s,"space.titleTop",0)});_=Ax(s,"proportion.title",0);r.add(S,{padding:E,proportion:_,expand:!0});}if(y){var L=Ax(s,"align.content","center"),R=Ax(s,"space.content",0),B=(E={left:Ax(s,"space.contentLeft",0),right:Ax(s,"space.contentRight",0),bottom:k||m||C?R:0},_=Ax(s,"proportion.content",0),Ax(s,"expand.content",!0));r.add(y,{align:L,padding:E,proportion:_,expand:B});}if(k){L=Ax(s,"align.description","center");var j=Ax(s,"space.description",0);E={left:Ax(s,"space.descriptionLeft",0),right:Ax(s,"space.descriptionRight",0),bottom:m||C?j:0},_=Ax(s,"proportion.description",0),B=Ax(s,"expand.description",!0);r.add(k,{align:L,padding:E,proportion:_,expand:B});}if(m){var D=Ax(s,"choicesType","").split("-"),A=zx(D,"wrap")?_x:zx(D,"grid")?Cx:fx,I=zx(D,"radio")?"radio":zx(D,"checkboxes")?"checkboxes":void 0,z={left:Ax(s,"space.choicesBackgroundLeft",0),right:Ax(s,"space.choicesBackgroundRight",0),top:Ax(s,"space.choicesBackgroundTop",0),bottom:Ax(s,"space.choicesBackgroundBottom",0)},F=Ax(s,"space.choice",0);A===fx?z.item=F:A===_x?(z.item=F,z.line=Ax(s,"space.choiceLine",F)):(z.column=Ax(s,"space.choiceColumn",F),z.row=Ax(s,"space.choiceRow",F));var Y={width:Ax(s,"choicesWidth",void 0),height:Ax(s,"choicesHeight",void 0),groupName:"choices",buttonsType:I,background:b,buttons:m,space:z,click:w,eventEmitter:r.eventEmitter,setValueCallback:Ax(s,"choicesSetValueCallback",void 0),setValueCallbackScope:Ax(s,"choicesSetValueCallbackScope",void 0)};A===fx&&(Y.orientation=zx(D,"x")?0:1),o=new A(t,Y);var W=Ax(s,"space.choices",0);E={left:Ax(s,"space.choicesLeft",0),right:Ax(s,"space.choicesRight",0),bottom:C?W:0},L=Ax(s,"align.choices","center"),_=Ax(s,"proportion.choices",0),B=Ax(s,"expand.choices",!0);r.add(o,{align:L,padding:E,proportion:_,expand:B}),r.buttonsType=I;}if(C){a=new fx(t,{groupName:"actions",background:x,buttons:C,orientation:0,space:{item:Ax(s,"space.action",0)},expand:Ax(s,"expand.actions",!1),align:Ax(s,"align.actions","center"),click:w,eventEmitter:r.eventEmitter});E={left:Ax(s,"space.actionsLeft",0),right:Ax(s,"space.actionsRight",0),bottom:Ax(s,"space.actionsBottom",0)},_=Ax(s,"proportion.action",0);r.add(a,{align:"center",padding:E,proportion:_,expand:!0});}return Yx(u(r),"click"),Yx(u(r),"over"),Yx(u(r),"out"),Yx(u(r),"enable"),Yx(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)}(Bb),zx=function(t,e){return -1!==t.indexOf(e)},Fx={actions:"action",choices:"choice",toolbar:"toolbar",leftToolbar:"leftToolbar"},Yx=function(t,e){t.on("button.".concat(e),(function(i,n,s,r,o){Fx.hasOwnProperty(n)&&t.emit("".concat(Fx[n],".").concat(e),i,s,r,o);}));};Object.assign(Ix.prototype,Dx);var Wx=function(t,e,i){var n=new IC(t,e,i);return t.add.existing(n),n},Vx=function(t){this.childrenMap.title.resetDisplayContent(t.title);},Xx=function(t){var e=this.childrenMap.content;if(e.resetDisplayContent)e.resetDisplayContent(t.content);else {var i=t.content||"";e.setText(i);}},Gx=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}(Bv),Bw=Phaser.Utils.Objects.GetValue,jw=Phaser.Math.Distance.Between,Dw=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(Bw(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(Bw(t,"enable",!0)),this.holdThreshold=Bw(t,"holdThreshold",50),this.pointerOutReleaseEnable=Bw(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 Oc(this.scene)}},{key:"speed",get:function(){return this.x===this.preX&&this.y===this.preY?0:jw(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),Aw=Phaser.Utils.Objects.GetValue,Iw=function(){function t(e){n(this,t),this.resetFromJSON(e);}return r(t,[{key:"resetFromJSON",value:function(t){return this.setValue(Aw(t,"value",0)),this.setSpeed(Aw(t,"speed",0)),this.setAcceleration(Aw(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}(),zw=function(){function t(){n(this,t),this.value,this.dir,this.movement=new Iw;}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),Vw={y:0,v:0,vertical:0,x:1,h:1,horizontal:1},Xw=Phaser.Utils.Objects.GetValue,Gw=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=Xw(s,"focus",!0):r.focusMode=!1,r.setSpeed(Xw(s,"speed",.1)),r.setEnable(Xw(s,"enable",!0)),r.focusMode)?(t=r.parent).setInteractive(Xw(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),Hw=Phaser.Utils.Objects.GetValue,Uw=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)?Hw(n,c,void 0):Hw(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 Lw(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=Hw(s,"position",0);"string"==typeof v&&(v=Nw[v]);var g=Hw(n,"space.slider".concat(i),void 0);void 0===g&&void 0===(g=Hw(n,"space.slider",void 0))&&(g=l?0:Hw(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)]=Hw(s,"hideUnscrollableSlider",!1),t["adaptThumb".concat(i,"SizeMode")]=Hw(s,"adaptThumbSize",!1),t["minThumb".concat(i,"Size")]=Hw(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)?Hw(n,k,!0):Hw(n,"scroller",!0))&&u&&(!0===o&&(o={}),o.orientation=h?0:1,a=new Ww(u,o));var m,b,C,x,w=Hw(n,l?"mouseWheelScroller".concat(i):"mouseWheelScroller",!1);(w&&u&&(m=new Gw(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);}));}},Nw={right:0,left:1,bottom:0,top:1},Kw=Phaser.Utils.Objects.GetValue,Jw=function(t,e){var i=t.scene,n=[0,1,0],s=[0,1,0],r=Kw(e,"width"),o=Kw(e,"height");r||(Kw(e,"child.expandWidth",!0)||(n[1]=0));o||(Kw(e,"child.expandHeight",!0)||(s[1]=0));var a=new $b(i,{column:3,row:3,columnProportions:n,rowProportions:s});switch(function(t,e,i){var n=iw(i,"child"),s=iw(n,"gameObject",void 0);if(s){var r=iw(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=iw(r,"top",0),o.bottom=iw(r,"bottom",0),a.left=iw(r,"left",0),a.right=iw(r,"right",0);break;case 1:o.top=iw(r,"left",0),o.bottom=iw(r,"right",0),a.top=iw(r,"top",0),a.bottom=iw(r,"bottom",0);break;default:o.top=iw(r,"top",0),o.bottom=iw(r,"bottom",0),o.left=iw(r,"left",0),o.right=iw(r,"right",0);}e.add(s,{column:1,row:1,align:iw(n,"align","center"),padding:a,expand:{width:iw(n,"expandWidth",!0),height:iw(n,"expandHeight",!0)}});}t.addChildrenMap("child",s);}(t,a,e),t.scrollMode){case 0:Uw(t,a,"y",e);break;case 1:Uw(t,a,"x",e);break;default:Uw(t,a,"y",e),Uw(t,a,"x",e);}return a},Zw=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);},qw=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);}},$w=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},oS=function(t){return (t-this.textLineSpacing)/(this.textLineHeight+this.textLineSpacing)},aS=function(t){return t*(this.textLineHeight+this.textLineSpacing)-this.textLineSpacing},hS=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},lS=function(t,e){switch(sS(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;}},uS=function(){var t=this.textObject.rexSizer;this.textObject.y+=t.offsetY-t.preOffsetY,t.preOffsetY=t.offsetY,this.resetChildPositionState(this.textObject),this.textCropEnable&&cS.call(this);},cS=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);}},dS=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();}},fS={setText:function(t){return void 0!==t&&(this.text=t),this.lines=rS(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(oS.call(this,-this.textOY)),0),e=aS.call(this,t)+this.textOY,i=hS.call(this,t);return lS(this.textObject,i),this.textObject.rexSizer.offsetY=e,uS.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,_p.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,dS.call(this,t,r,o),ap(t,n,s,r,o,e.align),e.preOffsetY=0,uS.call(this),this.textMask&&(this.textMask.setPosition().resize(),this.resetChildPositionState(this.textMask)));}},pS=Phaser.Utils.Objects.IsPlainObject,vS=Phaser.Utils.Objects.GetValue,gS=Phaser.Display.Align.TOP_LEFT,yS=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),pS(s)?(s=vS(h=s,"x",0),r=vS(h,"y",0),o=vS(h,"width",void 0),a=vS(h,"height",void 0)):pS(o)&&(o=vS(h=o,"width",void 0),a=vS(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=vS(h,"content",""),l._textOY=0,l.execeedTopState=!1,l.execeedBottomState=!1,l.setClampMode(vS(h,"clamplTextOY",!0)),l.alwaysScrollable=vS(h,"alwaysScrollable",!1);var c=vS(h,"background",void 0),d=vS(h,"text",void 0);void 0===d&&(d=kS(t)),l.textCropEnable=vS(h,"textCrop",!!d.setCrop);var f=vS(h,"textMask",!l.textCropEnable);c&&l.addBackground(c),l.add(d),l.sizerChildren=[d];var p=l.getSizerConfig(d);return p.align=gS,p.padding=fp(0),p.expand=!0,l.textObject=d,l.textObjectType=sS(d),p.preOffsetY=0,p.offsetY=0,f&&(l.textMask=xC.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(oS.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=aS.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}(Ky),kS=function(t){return t.add.text(0,0,"")};Object.assign(yS.prototype,fS);var mS={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}},bS=Phaser.Utils.Objects.GetValue,CS=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=bS(s,"text",void 0),a=bS(s,"textWidth",void 0),h=bS(s,"textHeight",void 0),l=bS(s,"textCrop",!!o.setCrop),u=bS(s,"textMask",!l),c=bS(s,"content",""),d=new yS(t,{width:a,height:h,text:o,textMask:u,textCrop:l&&!u,content:c,clamplTextOY:bS(s,"clamplChildOY",!1),alwaysScrollable:bS(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=bS(s,"space",void 0);return f&&(f.child=bS(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}(iS);Object.assign(CS.prototype,{setText:function(t){return this.childrenMap.child.setText(t),this.resizeController(),this},appendText:function(t){return this.setText(this.text+t),this}},mS);var xS=Phaser.Utils.Objects.GetValue,wS=function(t,e,i){e=e?xe(e):{};var n=xS(i,"background",OC),s=xS(i,"text",MC),r=xS(i,"track",OC),o=xS(i,"thumb",OC);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 CS(t,e);return t.add.existing(h),h},SS=Phaser.Utils.Objects.GetValue,OS=Phaser.Utils.Objects.GetValue,PS=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=OS(r,"background",OC);a?s.background=a(t,s.background):delete s.background,s.title=Wx(t,s.title,r.title),s.content=function(t,e,i){var n,s=SS(e,"$type");void 0===s&&e&&(e.hasOwnProperty("slider")||e.hasOwnProperty("scroller"))&&(s="textarea"),n="textarea"===s?new wS(t,e,i):new Wx(t,e,i);return t.add.existing(n),n}(t,s.content,r.content),s.content instanceof CS&&nc(s,"height")&&!nc(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=[Wx(t,l,p),Wx(t,c,v)];break;case 1:s.actions=[Wx(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),$x.call(u(o)),o}return r(i)}(Ix);Object.assign(PS.prototype,Ux);var TS=Phaser.Utils.Objects.GetValue,MS=function(t,e,i){var n=TS(t,"proportion.".concat(e),i.proportion),s=TS(t,"align.".concat(e),"center"),r=TS(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:TS(t,"expand.".concat(e),!0)}},ES=function(t){return MS(t,"header",{proportion:0,paddingKey:"bottom"})},_S=function(t){return MS(t,"leftSide",{proportion:0,paddingKey:"right"})},LS=function(t){return MS(t,"content",{proportion:1})},RS=function(t){return MS(t,"rightSide",{proportion:0,paddingKey:"left"})},BS=function(t){return MS(t,"footer",{proportion:0,paddingKey:"top"})},jS=function(t,e){var i=new Bb(t,{orientation:e});return t.add.existing(i),i},DS=Phaser.Utils.Objects.GetValue,AS=[function(t){var e=this.scene,i=t.header;i&&this.add(i,ES(t));var n=jS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,_S(t));var r=t.content;r&&n.add(r,LS(t));var o=t.rightSide;o&&n.add(o,RS(t));var a=t.footer;a&&this.add(a,BS(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,ES(t));var n=jS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,_S(t));var r=jS(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=jS(e,0);r.add(o,{proportion:1,align:"center",padding:0,expand:!0});var a=t.content;a&&o.add(a,LS(t));var h=t.rightSide;h&&o.add(h,RS(t));var l=t.footer;l&&r.add(l,BS(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,ES(t));var n=jS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=jS(e,1);n.add(s,{proportion:1,align:"center",padding:0,expand:!0});var r=jS(e,0);s.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.leftSide;o&&r.add(o,_S(t));var a=t.content;a&&r.add(a,LS(t));var h=t.footer;h&&s.add(h,BS(t));var l=t.rightSide;l&&n.add(l,RS(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,ES(t));var n=jS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,_S(t));var r=jS(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.content;o&&r.add(o,LS(t));var a=t.footer;a&&r.add(a,BS(t));var h=t.rightSide;h&&n.add(h,RS(t));}],IS={FFF:0,LFF:1,FFR:2,LFR:3},zS=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)}(Bb),FS={build:function(t){this.clear(!0);var e=DS(t,"background",void 0);e&&this.addBackground(e);var i=DS(t,"layoutMode",0);"string"==typeof i&&(i=IS[i.toUpperCase()]),(AS[i]||AS[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(zS.prototype,FS);var YS={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 bv(this.getButton(t,e)),this},showLeftButton:function(t){return bv(this.getLeftButton(t)),this},showRightButton:function(t){return bv(this.getRightButton(t)),this},showTopButton:function(t){return bv(this.getTopButton(t)),this},showBottomButton:function(t){return bv(this.getBottomButton(t)),this},hideButton:function(t,e){return Cv(this.getButton(t,e)),this},hideLeftButton:function(t){return Cv(this.getLeftButton(t)),this},hideRightButton:function(t){return Cv(this.getRightButton(t)),this},hideTopButton:function(t){return Cv(this.getTopButton(t)),this},hideBottomButton:function(t){return Cv(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}},WS=Phaser.Utils.Objects.GetValue,VS=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=WS(s,"eventEmitter",u(r));var o,a,h,l,c=WS(s,"background",void 0),d=WS(s,"panel",void 0),f=WS(s,"leftButtons",void 0),p=WS(s,"leftButtonsBackground",void 0),v=WS(s,"rightButtons",void 0),g=WS(s,"rightButtonsBackground",void 0),y=WS(s,"topButtons",void 0),k=WS(s,"topButtonsBackground",void 0),m=WS(s,"bottomButtons",void 0),b=WS(s,"bottomButtonsBackground",void 0),C=WS(s,"click",void 0);if(c&&r.addBackground(c),d&&r.add(d,1,1,"center",0,!0),f){var x=WS(s,"space.leftButtonsOffset",0),w=WS(s,"space.leftButton",0);o=new fx(t,{groupName:"left",background:p,buttons:f,orientation:1,space:{item:w},align:WS(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=WS(s,"space.rightButtonsOffset",0),P=WS(s,"space.rightButton",0);a=new fx(t,{groupName:"right",background:g,buttons:v,orientation:1,space:{item:P},align:WS(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=WS(s,"space.topButtonsOffset",0),M=WS(s,"space.topButton",0);h=new fx(t,{groupName:"top",background:k,buttons:y,orientation:0,space:{item:M},align:WS(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=WS(s,"space.bottomButtonsOffset",0),_=WS(s,"space.bottomButton",0);l=new fx(t,{groupName:"bottom",background:b,buttons:m,orientation:0,space:{item:_},align:WS(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)}($b);Object.assign(VS.prototype,YS);var XS=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=If[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(XS.prototype,wi);var GS=Phaser.Utils.Objects.GetValue,HS=Phaser.Utils.Array.SpliceOne,US=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(GS(t,"cellsCount",0)),this.setColumnCount(GS(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=hO(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));},QO={down:0,up:1},tP=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={}),null==s.transitIn&&(s.transitIn=function(t,e){zp(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 Ap(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),$O(t,s),t.isRexSizer&&t.layout();var o=tP(s,"touchOutsideClose",!1),a=tP(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&&tg(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}(Wv),iP={openListPanel:function(){if(this.listPanel)return this;var t,e=ZO.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 eP(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(iP,KO);var nP=Phaser.Utils.Objects.GetValue,sP=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(nP(s,"options"));var o=nP(s,"list");return r.setWrapEnable(nP(o,"wrap",!1)),r.setCreateButtonCallback(nP(o,"createButtonCallback")),r.setCreateListBackgroundCallback(nP(o,"createBackgroundCallback")),r.setButtonClickCallback(nP(o,"onButtonClick")),r.setButtonOverCallback(nP(o,"onButtonOver")),r.setButtonOutCallback(nP(o,"onButtonOut")),r.setListExpandDirection(nP(o,"expandDirection")),r.setListEaseInDuration(nP(o,"easeIn",500)),r.setListEaseOutDuration(nP(o,"easeOut",100)),r.setListTransitInCallback(nP(o,"transitIn")),r.settListTransitOutCallback(nP(o,"transitOut")),r.setListSize(nP(o,"width"),nP(o,"height")),r.setListAlignmentMode(nP(o,"alignParent","text")),r.setListAlignmentSide(nP(o,"alignSide","")),r.setListBounds(nP(o,"bounds")),r.setListSpace(nP(o,"space")),r.setListDraggable(nP(o,"draggable",!1)),r.setValueChangeCallback(nP(s,"setValueCallback"),nP(s,"setValueCallbackScope")),r.setValue(nP(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}(SC);Object.assign(sP.prototype,iP);var rP=function(t){return Array.isArray(t)?t=t.join("\n"):"number"==typeof t&&(t=t.toString()),t},oP={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(rP(t));t=this.sections.join("\n");this.lines=rS(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=dP(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(sS(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(fP.prototype,uP),Phaser.Utils.Objects.GetFastValue,Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue;var pP=hk.prototype.add,vP=function(t,e,i,n,s,r,o,a,h){return t.setVisible(!1),pP.call(this,t,e,i,n,s,r,o,a,h),this},gP={add:vP,addPage:vP},yP=ie.prototype.setChildVisible,kP={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?(yP.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&&(yP.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(kP,gP);var mP=Phaser.Utils.Objects.GetValue,bP=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(mP(s,"swapMode",0)),r.setFadeInDuration(mP(s,"fadeIn",0)),r}return r(i,[{key:"setSwapMode",value:function(t){return "string"==typeof t&&(t=CP[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}(hk);Object.assign(bP.prototype,kP);var CP={invisible:0,destroy:1},xP=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}(Ky);Object.assign(BT.prototype,ET);var jT=["top","bottom","centerY","center"],DT=["left","right","centerX","center"],AT=function(t,e,i){var n,s="Y"===(e=e.toUpperCase()),r=this.childrenMap.child;if(s){if(i)for(var o=0,a=jT.length;o=0?0:Math.abs(l)<=Math.abs(u)?l:u;}}else {if(i)for(o=0,a=DT.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;}},IT=Phaser.Utils.Objects.GetValue,zT=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=tw(s),a=IT(s,"panel",void 0);void 0===a&&(a={}),a.scrollMode=o,a.clamplChildOY=IT(s,"clamplChildOY",!1),a.clamplChildOX=IT(s,"clamplChildOX",!1);var h,l,u=new BT(t,a);switch(t.add.existing(u),o){case 0:h=IT(s,"expand.panel",!0),l=!0;break;case 1:h=!0,l=IT(s,"expand.panel",!0);break;default:h=!0,l=!0;}s.type="rexScrollablePanel",s.child={gameObject:u,expandWidth:h,expandHeight:l,align:IT(s,"align.panel","center")};var c=IT(s,"space",void 0);return c&&(c.child=IT(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]),Hy(this.childrenMap.child,t),this}}]),i}(iS),FT={scrollToChild:function(t,e){if(!this.hasChild(t))return this;switch(this.scrollMode){case 0:AT.call(this,t,"y",e);break;case 1:AT.call(this,t,"x",e);break;default:AT.call(this,t,"y",e),AT.call(this,t,"x",e);}return this}};Object.assign(zT.prototype,FT),Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue;for(var YT,WT=function(t,e,i){void 0===i&&(i=!0),i?e=e?xe(e):{}:e||(e={});var n=new wc(t,e);return t.add.existing(n),n},VT=Phaser.Utils.Objects.GetValue,XT=Phaser.Display.Color,GT=Phaser.Display.Color.ColorToRGBA,HT=Phaser.Display.Color.HSVToRGB,UT=Phaser.Math.Clamp,NT=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 XT;var o=VT(s,"background",void 0),a=VT(s,"formatLabel",void 0);Xt(a)||(a=Wx(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=VT(s,"inputText"),c=0;c<3;c++){var d=WT(t,l).setMaxLength(3).setNumberInput();h.push(d);}o&&r.addBackground(o);var f=VT(s,"proportion.formatLabel",0),p=!!a.isRexContainerLite,v=VT(s,"expand.formatLabel",p);r.add(a,{proportion:f,expand:v});f=void 0===VT(l,"width")?1:0,v=void 0===VT(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 LM(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},BM={openColorPicker:function(){if(!this.colorPicker){var t=RM.call(this).layout(),e=new eP(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(BM,aM);var jM=Phaser.Utils.Objects.GetValue,DM=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(jM(o,"width",160),jM(o,"height",170));var l=jM(o,"background");h=l?function(t){return OC(t,l)}:jM(o,"createBackgroundCallback"),r.setCreateColorPickerBackgroundCallback(h),r.setColorPickerHPalettePosition(jM(o,"hPalettePosition",0)),r.setColorPickerExpandDirection(jM(o,"expandDirection")),r.setColorPickerEaseInDuration(jM(o,"easeIn",200)),r.setColorPickerEaseOutDuration(jM(o,"easeOut",200)),r.setColorPickerTransitInCallback(jM(o,"transitIn")),r.setColorPickerTransitOutCallback(jM(o,"transitOut")),r.setColorPickerBounds(jM(o,"bounds"));var c=jM(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(jM(d,"height",30)),r.setColorComponentsFormatLabelConfig(jM(d,"formatLabel"));var f=jM(d,"inputText");f||(f=jM(s,"inputText")),r.setColorComponentsInputTextConfig(f);var p=jM(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)}(oM);Object.assign(DM.prototype,BM);var AM=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),s=AC(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}(SC),IM=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 Rf(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}(AM),zM=function(t,e){var i=new BE(t,e);return t.add.existing(i),i},FM=function(t,e,i){return OC(t,i)},YM=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}(OT);Object.assign(YM.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 WM=Phaser.Utils.Objects.GetValue,VM=Phaser.Utils.Objects.GetValue,XM={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:EE,addButtons:EE,addSeparator:function(t){var e=this.scene,i=_E(this.styles,"separator"),n=FM(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}(),Vr=Phaser.Utils.Array.Remove,Wr=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),Vr(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 Wr(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!==Va&&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=Va):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 Va: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===Va}},{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,Va=-1,Wa=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}(Wa),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",Vu,!1),t.addEventListener("touchmove",Vu,!1),t.addEventListener("touchend",Vu,!1),t.addEventListener("mousedown",Vu,!1),t.addEventListener("mouseup",Vu,!1),t.addEventListener("mousemove",Vu,!1);},Vu=function(t){t.stopPropagation();},Wu=function(){return this.close(),this.emit("keydown-ENTER",this.parent,this),this},Xu=function(){this.isOpened=!0,this.initText(),this.enterCloseEnable&&this.scene.input.keyboard.once("keydown-ENTER",Wu,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);},Gu=function(){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);},Hu=Phaser.Utils.Objects.GetValue,Uu=function(t,e){var i,n=Hu(e,"inputType",void 0);void 0===n&&(n=Hu(e,"type","text")),"textarea"===n?(i=document.createElement("textarea")).style.resize="none":(i=document.createElement("input")).type=n;var s=Hu(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.addEventListener("focus",(function(e){Xu.call(t);})),i.addEventListener("blur",(function(e){Gu.call(t);})),i},Nu={open:function(){return this.isOpened||this.readOnly||((t=this)!==Iu&&(void 0!==Iu&&Iu.close(),Iu=t),this.node||(this.node=Uu(this,this.nodeConfig)),this.setFocus()),this;var t;},close:function(){return this.isOpened?(this===Iu&&(Iu=void 0),this.setBlur(),this):this}},Ku=Phaser.Utils.Objects.GetValue,Ju=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=Ku(s,"inputType",void 0);void 0===o&&(o=Ku(s,"type","text")),r.setEnterCloseEnable(Ku(s,"enterClose","textarea"!==o));var a=Ku(s,"onOpen",void 0);a||(a=Ku(s,"onFocus",void 0)),r.onOpenCallback=a;var h=Ku(s,"onClose",void 0);return h||(h=Ku(s,"onBlur",void 0)),r.onCloseCallback=h,r.onUpdateCallback=Ku(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(Ju.prototype,Nu);var Zu=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},qu=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)):(qu(this),$u(this)),this}},{key:"setNumberInput",value:function(){return this.onUpdateCallback=Zu,this}},{key:"setSelectAllWhenFocusEnable",value:function(t){return void 0===t&&(t=!0),this.selectAllWhenFocus=t,this}}]),i}(Ju),ec=Phaser.Utils.Objects.GetValue,ic=["inputType","onOpen","onFocus","onClose","onBlur","onUpdate","enterClose","readOnly","maxLength","minLength","selectAll"],nc=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}lc.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(uc(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=dd(t,"tl",0),this.radiusTR=dd(t,"tr",0),this.radiusBL=dd(t,"bl",0),this.radiusBR=dd(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]),Kc(this.x,this.y,t),p(h(i.prototype),"updateData",this).call(this),this}}]),i}(Ac),pd=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,vd=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=pd(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}(jc),gd={buildShapes:function(){this.addShape((new fd).setName("box")).addShape((new ld).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);}},yd=Phaser.Utils.Objects.GetValue,kd=Phaser.Math.Linear,md=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=yd(t,"key","value");var n=e[this.propertyKey];return this.fromValue=yd(t,"from",n),this.toValue=yd(t,"to",n),this.setEase(yd(t,"ease",this.ease)),this.setDuration(yd(t,"duration",this.duration)),this.setRepeat(yd(t,"repeat",0)),this.setDelay(yd(t,"delay",0)),this.setRepeatDelay(yd(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]=kd(this.fromValue,this.toValue,i);}}]),i}(Ua),bd={setCheckerAnimationDuration:function(t){return void 0===t&&(t=0),this.checkerAnimDuration=t,this},playCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask&&(this.checkerAnimProgressTask=new md(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}},Cd={};Object.assign(Cd,Rc,{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}},gd,bd);var xd=Phaser.Utils.Objects.GetValue,wd=Phaser.Utils.Objects.IsPlainObject,Sd=23730,Od=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),wd(s)?(s=xd(l=s,"x",0),r=xd(l,"y",0),o=xd(l,"width",2),a=xd(l,"height",2),h=xd(l,"color",Sd)):wd(h)&&(h=xd(l=h,"color",Sd)),(u=e.call(this,t,s,r,o,a)).type="rexCheckbox",void 0===h&&(h=Sd),u.setBoxShape(xd(l,"circleBox",!1)),u.setBoxFillStyle(h,xd(l,"boxFillAlpha",1)),u.setUncheckedBoxFillStyle(xd(l,"uncheckedColor",null),xd(l,"uncheckedBoxFillAlpha",1)),u.setBoxStrokeStyle(xd(l,"boxLineWidth",4),xd(l,"boxStrokeColor",h),xd(l,"boxStrokeAlpha",1)),u.setUncheckedBoxStrokeStyle(u.boxLineWidth,xd(l,"uncheckedBoxStrokeColor",u.boxStrokeColor),xd(l,"uncheckedBoxStrokeAlpha",u.boxStrokeAlpha)),u.setCheckerStyle(xd(l,"checkerColor",16777215),xd(l,"checkerAlpha",1)),u.setBoxSize(xd(l,"boxSize",1)),u.setCheckerSize(xd(l,"checkerSize",1)),u.setCheckerAnimationDuration(xd(l,"animationDuration",150)),u.buildShapes();var c=xd(l,"checked");return void 0===c&&(c=xd(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}(Lc);Object.assign(Od.prototype,Cd);var Pd=Phaser.Utils.Objects.GetValue,Td=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(Pd(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(Pd(t,"enable",!0)),this.setMode(Pd(t,"mode",1)),this.setClickInterval(Pd(t,"clickInterval",100)),this.setDragThreshold(Pd(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=Md[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),Md={press:0,pointerdown:0,release:1,pointerup:1},Ed=Phaser.Utils.Objects.GetValue,_d=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 Td(u(c),Ed(l,"click")),c._click.on("click",(function(){this.toggleValue();}),u(c)),c.setReadOnly(Ed(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}(Od),Ld={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}},Rd={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}},Bd={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}},jd=function(t,e,i){return (e-t)*i+t},Dd=Phaser.Math.Linear,Ad={buildShapes:function(){this.addShape((new fd).setName("track")).addShape((new fd).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&jd(ia(l),ia(u),c))<<16|(255&jd(na(l),na(u),c))<<8|255&jd(sa(l),sa(u),c)),f=Dd(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=Dd(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);}},Id={setToggleAnimationDuration:function(t){return void 0===t&&(t=0),this.toggleAnimDuration=t,this},playToggleAnimation:function(){return void 0===this.toggleAnimProgressTask&&(this.toggleAnimProgressTask=new md(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}},zd={};Object.assign(zd,Ld,Rd,Bd,Ad,Id);var Fd=Phaser.Utils.Objects.GetValue,Yd=Phaser.Utils.Objects.IsPlainObject,Vd=23730,Wd=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),Yd(s)?(s=Fd(l=s,"x",0),r=Fd(l,"y",0),o=Fd(l,"width",2),a=Fd(l,"height",2),h=Fd(l,"color",Vd)):Yd(h)&&(h=Fd(l=h,"color",Vd)),(u=e.call(this,t,s,r,o,a)).type="rexToggleSwitch",void 0===h&&(h=Vd),u.setTrackFillStyle(h,Fd(l,"trackFillAlpha",1)),u.setFalseValueTrackFillStyle(Fd(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)),Fd(l,"falseValueTrackFillAlpha",1)),u.setThumbStyle(Fd(l,"thumbColor",16777215),Fd(l,"thumbAlpha",1)),u.setTrackSize(Fd(l,"trackWidth",.9),Fd(l,"trackHeight",.5)),u.setTrackRadius(Fd(l,"trackRadius",.5*u.trackHeight));var c=Fd(l,"thumbHeight",void 0),d=Fd(l,"thumbWidth",c);return void 0===d&&(d=.9*u.trackHeight),u.setThumbSize(d,c),u.setThumbRadius(Fd(l,"thumbRadius",.5*u.thumbHeight)),u.setThumbPosition(Fd(l,"thumbLeft",.3),Fd(l,"thumbRight",void 0)),u.setRTL(Fd(l,"rtl",!1)),u.setToggleAnimationDuration(Fd(l,"animationDuration",150)),u.buildShapes(),u.setValue(Fd(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}(Lc);Object.assign(Wd.prototype,zd);var Xd=Phaser.Utils.Objects.GetValue,Gd=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 Td(u(c),Xd(l,"click")),c._click.on("click",(function(){this.toggleValue();}),u(c)),c.setReadOnly(Xd(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}(Wd),Hd={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);}))}},Ud=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(Ud.prototype,Hd),Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue;var Nd=Phaser.Math.Linear,Kd=Phaser.Math.Percent,Jd={setValue:function(t,e,i){return null==t||(void 0!==e&&(t=Kd(t,e,i)),this.value=t),this},addValue:function(t,e,i){return void 0!==e&&(t=Kd(t,e,i)),this.value+=t,this},getValue:function(t,e){var i=this.value;return void 0!==t&&(i=Nd(t,e,i)),i}},Zd=Phaser.Math.Percent,qd={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=Zd(t,e,i)),void 0===this.easeValueTask&&(this.easeValueTask=new md(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 md(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,from:t,to:e,duration:this.easeValueDuration,ease:this.easeFunction,repeat:i,repeatDelay:n}),this}},$d=Phaser.Utils.Objects.GetValue,Qd=Phaser.Math.Clamp;function tf(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=$d(t,"eventEmitter",this);var e=$d(t,"valuechangeCallback",null);if(null!==e){var i=$d(t,"valuechangeCallbackScope",void 0);this.eventEmitter.on("valuechange",e,i);}return this.setEaseValuePropName("value").setEaseValueDuration($d(t,"easeValue.duration",0)).setEaseValueFunction($d(t,"easeValue.ease","Linear")),this}},{key:"value",get:function(){return this._value},set:function(t){t=Qd(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,Jd,qd),e}var ef=Phaser.Math.RadToDeg,nf=Phaser.Math.DegToRad,sf=function(t,e,i,n,s,r,o,a){var h=360===Math.abs(o-r),l=nf(r),u=nf(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},rf={buildShapes:function(){this.addShape((new ld).setName("track")).addShape((new ld).setName("bar")).addShape((new Fc).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),sf(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=ef(this.startAngle),h=360*(o?1-this.value:this.value)+a;r.fillStyle(this.barColor),sf(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();}},of=Phaser.Utils.Objects.GetValue,af=Phaser.Utils.Objects.IsPlainObject,hf=Phaser.Math.Clamp,lf=Phaser.Math.DegToRad(270),uf=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),af(s)&&(s=of(l=s,"x",0),r=of(l,"y",0),o=of(l,"radius",1),a=of(l,"barColor",void 0),h=of(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(of(l,"trackColor",void 0)),u.setBarColor(a),u.setCenterColor(of(l,"centerColor",void 0)),u.setThickness(of(l,"thickness",.2)),u.setStartAngle(of(l,"startAngle",lf)),u.setAnticlockwise(of(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=hf(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}(tf(Lc));Object.assign(uf.prototype,rf);Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.IsPlainObject,Phaser.Math.Clamp,Phaser.Math.DegToRad(270);tf(gn);var cf=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},df=Phaser.Utils.Objects.GetValue,ff=Phaser.Utils.Objects.IsPlainObject,pf=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),ff(s)?(s=df(u=s,"x",0),r=df(u,"y",0),o=df(u,"width",2),a=df(u,"height",2),h=df(u,"barColor",void 0),l=df(u,"value",0)):ff(o)?(o=df(u=o,"width",2),a=df(u,"height",2),h=df(u,"barColor",void 0),l=df(u,"value",0)):ff(h)&&(h=df(u=h,"barColor",void 0),l=df(u,"value",0)),(c=e.call(this,t,s,r,o,a,u)).type="rexLineProgress",c.bootProgressBase(u),c.addShape((new ld).setName("trackFill")).addShape((new ld).setName("bar")).addShape((new ld).setName("trackStroke")),c.setTrackColor(df(u,"trackColor",void 0)),c.setBarColor(h),c.setTrackStroke(df(u,"trackStrokeThickness",2),df(u,"trackStrokeColor",void 0)),c.setSkewX(df(u,"skewX",0)),c.setRTL(df(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}(tf(Lc)),vf={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&&cf(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),cf(o,s,0,r,i,t).close());var a=this.getShape("trackStroke");a.lineStyle(this.trackStrokeThickness,this.trackStrokeColor),a.isStroked&&cf(a,0,0,e,i,t).end();}};Object.assign(pf.prototype,vf);var gf=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(),gf(0,r,this.trackPoints,void 0,this.trackStrokeColor,this.trackStrokeThickness),r.restore());},kf=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},mf=Phaser.Utils.Objects.GetValue,bf=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),bf(s)?(s=mf(u=s,"x",0),r=mf(u,"y",0),o=mf(u,"width",2),a=mf(u,"height",2),h=mf(u,"barColor",void 0),l=mf(u,"value",0)):bf(o)?(o=mf(u=o,"width",2),a=mf(u,"height",2),h=mf(u,"barColor",void 0),l=mf(u,"value",0)):bf(h)&&(h=mf(u=h,"barColor",void 0),l=mf(u,"value",0)),(c=e.call(this,t,s,r,o,a)).type="rexLineProgressCanvas",c.trackPoints=[],c.barPoints=[],c.bootProgressBase(u),c.setTrackColor(mf(u,"trackColor",void 0)),c.setBarColor(h,mf(u,"barColor2",void 0),mf(u,"isHorizontalGradient",void 0)),c.setTrackStroke(mf(u,"trackStrokeThickness",2),mf(u,"trackStrokeColor",void 0)),c.setSkewX(mf(u,"skewX",0)),c.setRTL(mf(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(),yf.call(this),p(h(i.prototype),"updateTexture",this).call(this),this}}]),i}(tf(gn));Phaser.Math.Wrap;var xf=Phaser.Math.Linear,wf=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=xf(m.a.x,b.a.x,C),e=xf(m.a.y,b.a.y,C),i=xf(m.b.x,b.b.x,C),n=xf(m.b.y,b.b.y,C),s=xf(m.c.x,b.c.x,C),r=xf(m.c.y,b.c.y,C);}o.startAt(t,e).lineTo(i,n).lineTo(s,r),this.arrowOnly?o.end():o.close();},Sf=(0, Phaser.Math.DegToRad)(120),Of=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+Sf),i+n*Math.sin(s+Sf)).lineTo(e+n*Math.cos(s),i+n*Math.sin(s)).lineTo(e+n*Math.cos(s-Sf),i+n*Math.sin(s-Sf)),this.arrowOnly?t.end():t.close();},Pf={buildShapes:function(){this.addShape((new ld).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?wf.call(this):Of.call(this);}},Tf={setEaseDuration:function(t){return void 0===t&&(t=0),this.easeDuration=t,this},playEaseDirectionation:function(){return void 0===this.easeDirectionProgressTask&&(this.easeDirectionProgressTask=new md(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}},Mf=Phaser.Utils.Objects.GetValue,Ef=Phaser.Utils.Objects.IsPlainObject,_f=Phaser.Math.DegToRad,Lf=Phaser.Math.RadToDeg,Rf=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),Ef(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=jf(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=Mf(r,"x",null);null!==o?(t=o,n=o):(t=Mf(r,"left",0),n=Mf(r,"right",t));var a=Mf(r,"y",null);null!==a?(e=a,s=a):(e=Mf(r,"top",0),s=Mf(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 Lf(this.verticeRotation)},set:function(t){this.verticeRotation=_f(t);}},{key:"setVerticeAngle",value:function(t){return this.verticeAngle=t,this}}]),s}(Lc),Bf={right:0,down:1,left:2,up:3},jf=function(t){return "string"==typeof t&&(t=Bf[t]),t%=4};Object.assign(Rf.prototype,Pf,Tf);var Df=function(t){return t.hasOwnProperty("rexSizer")||(t.rexSizer={}),t.rexSizer};var Af=Phaser.Display.Align,If={center:Af.CENTER,left:Af.LEFT_CENTER,right:Af.RIGHT_CENTER,top:Af.TOP_CENTER,bottom:Af.BOTTOM_CENTER,"left-top":Af.TOP_LEFT,"top-left":Af.TOP_LEFT,"left-center":Af.LEFT_CENTER,"center-left":Af.LEFT_CENTER,"left-bottom":Af.BOTTOM_LEFT,"bottom-left":Af.BOTTOM_LEFT,"center-top":Af.TOP_CENTER,"top-center":Af.TOP_CENTER,"center-center":Af.CENTER,"center-bottom":Af.BOTTOM_CENTER,"bottom-center":Af.BOTTOM_CENTER,"right-top":Af.TOP_RIGHT,"top-right":Af.TOP_RIGHT,"right-center":Af.RIGHT_CENTER,"center-right":Af.RIGHT_CENTER,"right-bottom":Af.BOTTOM_RIGHT,"bottom-right":Af.BOTTOM_RIGHT},zf=new Phaser.GameObjects.Zone({sys:{queueDepthSort:Ye,events:{once:Ye}}},0,0,1,1);zf.setOrigin(0);var Ff=0,Yf=1,Vf=2,Wf=4,Xf=6,Gf=8,Hf=10,Uf=12,Nf=function(t){var e=Pt(t);return t.y+e-e*t.originY},Kf=function(t){var e=Ot(t);return t.x-e*t.originX+.5*e},Jf=function(t,e){var i=Pt(t);return t.y=e-i+i*t.originY,t},Zf=function(t,e){var i=Ot(t),n=i*t.originX;return t.x=e+n-.5*i,t},qf=function(t){var e=Ot(t);return t.x-e*t.originX},$f=function(t,e){var i=Ot(t);return t.x=e+i*t.originX,t},Qf=function(t){var e=Ot(t);return t.x+e-e*t.originX},tp=function(t,e){var i=Ot(t);return t.x=e-i+i*t.originX,t},ep=function(t,e){var i=Pt(t),n=i*t.originY;return t.y=e+n-.5*i,t},ip=function(t){var e=Pt(t);return t.y-e*t.originY+.5*e},np=function(t){var e=Pt(t);return t.y-e*t.originY},sp=function(t,e){var i=Pt(t);return t.y=e+i*t.originY,t},rp=[];rp[11]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Zf(t,Kf(e)+i),Jf(t,Nf(e)+n),t},rp[Hf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),$f(t,qf(e)-i),Jf(t,Nf(e)+n),t},rp[Uf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),tp(t,Qf(e)+i),Jf(t,Nf(e)+n),t},rp[Xf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),function(t,e,i){Zf(t,e),ep(t,i);}(t,Kf(e)+i,ip(e)+n),t},rp[Wf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),$f(t,qf(e)-i),ep(t,ip(e)+n),t},rp[Gf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),tp(t,Qf(e)+i),ep(t,ip(e)+n),t},rp[Yf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Zf(t,Kf(e)+i),sp(t,np(e)-n),t},rp[Ff]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),$f(t,qf(e)-i),sp(t,np(e)-n),t},rp[Vf]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),tp(t,Qf(e)+i),sp(t,np(e)-n),t};var op=function(t,e,i,n,s){return rp[i](t,e,n,s)},ap=function(t,e,i,n,s,r){zf.setPosition(e,i).setSize(n,s),op(t,zf,r);},hp=Phaser.Utils.Objects.GetValue,lp=Phaser.GameObjects.Group,up=function(t,e,i){return t.add.text(0,0,"")},cp=void 0,dp=Phaser.Utils.Objects.GetValue,fp=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=dp(t,"left",0),e.right=dp(t,"right",0),e.top=dp(t,"top",0),e.bottom=dp(t,"bottom",0)),e},pp=ie.prototype.add,vp=function(t){return pp.call(this,t),this.sizerEventsEnable&&(t.emit("sizer.add",t,this),this.emit("add",t,this)),this},gp={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),vp.call(this,t),this.backgroundChildren.push(t),this.getSizerConfig(t).padding=fp(e),void 0!==i&&this.addChildrenMap(i,t),this},isBackground:function(t){return void 0!==this.backgroundChildren&&-1!==this.backgroundChildren.indexOf(t)}},yp=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},kp={getParentSizer:function(t,e){return "string"==typeof t&&(e=t,t=void 0),void 0===t&&(t=this),yp(t,e)},getTopmostSizer:function(t){return void 0===t&&(t=this),function(t){for(var e=yp(t);e;)t=e,e=yp(e);return t}(t)},hasParentSizer:function(t,e){void 0===e&&(e=this);for(var i=yp(e);i;){if(i===t)return !0;i=yp(i);}return !1},hasChild:function(t,e){return void 0===e&&(e=this),this.hasParentSizer(e,t)}},mp=Phaser.Utils.Array.Remove,bp=ie.prototype.remove,Cp=kp.getParentSizer,xp=function(t,e){for(var i=Cp(t);i;)i.removeChildCallback&&i.removeChildCallback(t,e),i=Cp(i);return this.isBackground(t)&&mp(this.backgroundChildren,t),bp.call(this,t,e),!e&&this.sizerEventsEnable&&(t.emit("sizer.remove",t,this),this.emit("remove",t,this)),this},wp=Phaser.Utils.Array.Remove,Sp=kp.getParentSizer,Op={removeFromParentSizer:function(){var t=Sp(gameObject);return t&&t.remove(this),this},removeBackground:function(t,e){return void 0===this.backgroundChildren||this.getParentSizer(t)!==this||(wp(this.backgroundChildren,t),xp.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}},Pp={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}},Tp=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},Mp=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},Ep={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}},_p=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}(Bv),Dv={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}},Av={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}},Iv={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}},zv={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}},Fv={};Object.assign(Fv,Dv,Av,Iv,zv);var Yv=Phaser.Utils.Objects.GetValue,Vv=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(Yv(s,"duration.in",200)),r.setTransitOutTime(Yv(s,"duration.out",200)),r.setTransitInCallback(Yv(s,"transitIn")),r.setTransitOutCallback(Yv(s,"transitOut")),r.oneShotMode=Yv(s,"destroy",!1),r.delayCallTimer=void 0,r._state=new jv(u(r),{eventEmitter:!1,initState:Yv(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(Vv.prototype,Fv);var Wv=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),Xv=Phaser.Utils.Objects.GetValue,Gv=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(Xv(t,"hitAreaMode",0)),this.setEnable(Xv(t,"enable",!0)),this.setStopMode(Xv(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=Hv[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),Hv={default:0,fullWindow:1},Uv=Phaser.Utils.Objects.GetValue,Nv=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=Uv(s,"color",0),a=Uv(s,"alpha",.8);return (r=e.call(this,t,o,a)).touchEventStop=new Gv(u(r),{hitAreaMode:1}),r}return r(i)}(Wv),Kv=function(t,e){void 0!==t._modalScaleSave?(t.scaleX=t._modalScaleSave,t.scaleY=t._modalScaleSave):t._modalScaleSave=t.scaleX,zp(t,e);},Jv=function(t,e){Fp(t,e,void 0,void 0,!1);},Zv=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,Jp(t,e);},qv=function(t,e){Zp(t,e,!1);},$v=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,Jp(t,e,t.alpha);},Qv=function(t,e){Zp(t,e,!1);},tg=function(t,e,i,n,s){return !!t&&(!(n&&!n(t,e,i))&&(!!_t(t,!0).contains(e,i)&&!(s&&!s(t,e,i))))},eg=Phaser.Utils.Objects.GetValue,ig=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=ng.popUp),null==s.transitOut&&(s.transitOut=ng.scaleDown),s.destroy=eg(s,"destroy",!0),r=e.call(this,t,s);var o=eg(s,"cover");r.cover=!1!==o?function(t,e){var i=t.scene,n=new Nv(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(eg(o,"transitIn",$v)),r.setCoverTransitOutCallback(eg(o,"transitOut",Qv)));var a=eg(s,"touchOutsideClose",!1),h=eg(s,"duration.hold",-1),l=eg(s,"timeOutClose",h>=0),c=eg(s,"anyTouchClose",!1);return eg(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)),eg(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&&tg(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=ng[t]),t){case ng.popUp:t=Kv;break;case ng.fadeIn:t=Zv;}return p(h(i.prototype),"setTransitInCallback",this).call(this,t),this}},{key:"setTransitOutCallback",value:function(t){switch("string"==typeof t&&(t=ng[t]),t){case ng.scaleDown:t=Jv;break;case ng.fadeOut:t=qv;}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}(Vv),ng={popUp:0,fadeIn:1,scaleDown:0,fadeOut:1},sg={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 ig(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}},rg=function(t,e,i,n){if(e)return tg(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),xg={press:0,pointerdown:0,release:1,pointerup:1},wg={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 Cg(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}},Sg=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}(Bv),Og=Phaser.Utils.Objects.GetValue,Pg=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 Sg,r.parent.setInteractive(Og(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(Og(t,"enable",!0)),this.setCooldown(Og(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),Tg={isPointerInBounds:function(t){return void 0===t?t=this:"string"==typeof t&&(t=this.getElement(t)),!!t&&rg(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 Pg(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 Pg(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}},Mg=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=Gg,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===Hg&&this.onDragEnd(),this.pointer=void 0,this.tracerState=Gg,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=Ug,this}}]),i}(Ea),Gg=0,Hg=1,Ug="IDLE",Ng=Phaser.Utils.Objects.GetValue,Kg=Phaser.Math.Distance.Between,Jg=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=Zg;},eventEmitter:!1};return r.setRecongizedStateObject(new Bv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setHoldTime(Ng(t,"time",250)),this.setTapInterval(Ng(t,"tapInterval",200)),this.setDragThreshold(Ng(t,"threshold",9)),this.setTapOffset(Ng(t,"tapOffset",10));var e=Ng(t,"taps",void 0);return void 0!==e?this.setTaps(e):(this.setMaxTaps(Ng(t,"maxTaps",void 0)),this.setMinTaps(Ng(t,"minTaps",void 0))),this}},{key:"onDragStart",value:function(){switch(this.state){case Zg:this.state=qg;break;case qg:var t=this.lastPointer;Kg(t.upX,t.upY,t.x,t.y)>this.tapOffset&&(this.state=$g,this.state=qg);break;case $g:this.state=qg;}}},{key:"onDragEnd",value:function(){this.state===qg&&(this.tapsCount++,this.emit("tapping",this,this.gameObject,this.lastPointer),void 0!==this.maxTaps&&this.tapsCount===this.maxTaps&&(this.state=$g));}},{key:"onDrag",value:function(){this.state!==Zg&&this.pointer.getDistance()>this.dragThreshold&&(this.state=Zg);}},{key:"preUpdate",value:function(t,e){if(this.isRunning&&this.enable&&this.state===qg){var i=this.lastPointer;if(i.isDown)t-i.downTime>this.holdTime&&(this.state=Zg);else t-i.upTime>this.tapInterval&&(void 0===this.minTaps||this.tapsCount>=this.minTaps?this.state=$g:this.state=Zg);}}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===$g&&(this.state=Zg);}},{key:"isTapped",get:function(){return this.state===$g}},{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}(Xg),Zg="IDLE",qg="BEGIN",$g="RECOGNIZED",Qg=Phaser.Utils.Objects.GetValue,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.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=ey;},eventEmitter:!1};return r.setRecongizedStateObject(new Bv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Qg(t,"threshold",9)),this.setHoldTime(Qg(t,"time",251)),this}},{key:"onDragStart",value:function(){this.state=iy,0===this.holdTime&&(this.state=ny);}},{key:"onDragEnd",value:function(){this.state=ey;}},{key:"onDrag",value:function(){this.state!==ey&&this.pointer.getDistance()>this.dragThreshold&&(this.state=ey);}},{key:"preUpdate",value:function(t,e){this.isRunning&&this.enable&&(this.state===iy&&t-this.pointer.downTime>=this.holdTime&&(this.state=ny));}},{key:"isPressed",get:function(){return this.state===ny}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Xg),ey="IDLE",iy="BEGIN",ny="RECOGNIZED";Phaser.Utils.Objects.GetValue;var sy=Phaser.Math.Distance.Between,ry=Phaser.Math.Angle.Between,oy={getDt:function(){return Oc(this.scene)},getVelocity:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return sy(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 ry(e.x,e.y,t.x,t.y)}},ay={"up&down":0,"left&right":1,"4dir":2,"8dir":3},hy={},ly=Phaser.Utils.Objects.GetValue,uy=Phaser.Math.RadToDeg,cy=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=dy;},eventEmitter:!1};return r.setRecongizedStateObject(new Bv(a)),r.clearDirectionStates(),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(ly(t,"threshold",10)),this.setVelocityThreshold(ly(t,"velocityThreshold",1e3)),this.setDirectionMode(ly(t,"dir","8dir")),this}},{key:"onDragStart",value:function(){this.state=fy;}},{key:"onDragEnd",value:function(){this.state=dy;}},{key:"onDrag",value:function(){this.state===fy&&(this.validDrag||(this.validDrag=0===this.dragThreshold||this.pointer.getDistance()>=this.dragThreshold),this.validDrag&&this.dragVelocity>this.velocityThreshold&&(this.state=py));}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===py&&(this.state=dy);}},{key:"isSwiped",get:function(){return this.state===py}},{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=ay[t]),this.dirMode=t,this}},{key:"updateDirectionStates",value:function(){return function(t,e,i){switch(void 0===i?i={}:!0===i&&(i=hy),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;}}(uy(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}(Xg);Object.assign(cy.prototype,oy);var dy="IDLE",fy="BEGIN",py="RECOGNIZED",vy=Phaser.Utils.Objects.GetValue,gy=Phaser.Utils.Array.SpliceOne,yy=Phaser.Math.Distance.Between,ky=Phaser.Math.Angle.Between,my=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(vy(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(vy(t,"enable",!0)),this.bounds=vy(t,"bounds",void 0),this.tracerState=Cy,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 Cy:this.tracerState=xy,this.onDrag1Start();break;case xy:this.tracerState=wy,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],gy(this.pointers,e),this.tracerState){case xy:this.tracerState=Cy,this.onDrag1End();break;case wy:this.tracerState=xy,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 xy:this.onDrag1();break;case wy:this.onDrag2();}}}},{key:"dragCancel",value:function(){return this.tracerState===wy&&this.onDrag2End(),this.pointers.length=0,Yt(this.movedState),this.tracerState=Cy,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!==wy)return 0;var t=this.pointers[0],e=this.pointers[1];return yy(t.x,t.y,e.x,e.y)}},{key:"angleBetween",get:function(){if(this.tracerState!==wy)return 0;var t=this.pointers[0],e=this.pointers[1];return ky(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;by.x=e.x-i.x,by.y=e.y-i.y;}else by.x=0,by.y=0;return by}},{key:"centerX",get:function(){if(this.tracerState!==wy)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!==wy)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!==wy)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!==wy)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=Sy,this}}]),t}();Object.assign(my.prototype,Xo);var by={},Cy=0,xy=1,wy=2,Sy="IDLE";Phaser.Utils.Objects.GetValue;var Oy=Phaser.Math.RotateAround,Py=function(t,e,i,n){return Oy(t,e,i,n),t.rotation+=n,t},Ty={},My=Phaser.Utils.Objects.GetValue,Ey=Phaser.Math.Angle.WrapDegrees,_y=Phaser.Math.Angle.ShortestBetween,Ly=Phaser.Math.RadToDeg,Ry=Phaser.Math.DegToRad,By=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=Dy;},eventEmitter:!1};return r.setRecongizedStateObject(new Bv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(My(t,"threshold",0)),this}},{key:"onDrag2Start",value:function(){this.prevAngle=Ey(Ly(this.angleBetween)),this.state=Ay,0===this.dragThreshold&&(this.state=Iy);}},{key:"onDrag2End",value:function(){this.state=Dy;}},{key:"onDrag2",value:function(){switch(this.state){case Ay:if(this.pointers[0].getDistance()>=this.dragThreshold&&this.pointers[1].getDistance()>=this.dragThreshold){var t=Ey(Ly(this.angleBetween));this.angle=_y(this.prevAngle,t),this.prevAngle=t,this.state=Iy;}break;case Iy:t=Ey(Ly(this.angleBetween));this.angle=_y(this.prevAngle,t),this.prevAngle=t,this.emit("rotate",this);}}},{key:"isRotated",get:function(){return this.state===Iy}},{key:"rotation",get:function(){return Ry(this.angle)}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(my),jy={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=Ty),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),rm(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(bm.prototype,am);var Cm=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},xm={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"]},wm={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]},Sm={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"},Om=Phaser.Utils.Objects.GetValue,Pm=function(t,e,i,n){var s=Om(n,"preventDefault",!1),r=Om(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);},Tm=Phaser.GameObjects.DOMElement,Mm=Phaser.Utils.Objects.IsPlainObject,Em=Phaser.Utils.Objects.GetValue,_m=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l,c;n(this,i),Mm(s)?(s=Em(h=s,"x",0),r=Em(h,"y",0),o=Em(h,"width",0),a=Em(h,"height",0)):Mm(o)&&(o=Em(h=o,"width",0),a=Em(h,"height",0)),void 0===h&&(h={});var d=Em(h,"inputType",void 0);void 0===d&&(d=Em(h,"type","text")),"textarea"===d?(c=document.createElement("textarea")).style.resize="none":(c=document.createElement("input")).type=d,Fu(xm,h,c);var f=Em(h,"style",void 0);f=Fu(wm,h,f);var p=c.style;for(var v in h)v in xm||v in wm||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),Pm(u(l),c,Sm),Yu(c),Em(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}(Tm),Lm={resize:Cm};Object.assign(_m.prototype,Lm),Phaser.Utils.Objects.GetValue;var Rm=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 Bm=function(t){return this.setOrigin(t.originX,t.originY),this.setPosition(t.x,t.y),this.resize(t.displayWidth,t.displayHeight),this},jm=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();},Dm={loadFile:function(t,e,i,n,s){var r=this.scene;return jm(r,t,e,i,n,s),this},loadFilePromise:function(t,e,i,n){var s=this.scene;return new Promise((function(r,o){jm(s,t,e,i,n,(function(t){r(t);}));}))}},Am=Phaser.GameObjects.DOMElement,Im=Phaser.Utils.Objects.IsPlainObject,zm=Phaser.Utils.Objects.GetValue,Fm=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),Im(s)?(s=zm(h=s,"x",0),r=zm(h,"y",0),o=zm(h,"width",0),a=zm(h,"height",0)):Im(o)&&(o=zm(h=o,"width",0),a=zm(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=zm(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(zm(h,"closeDelay",200)),c.onclick=function(){Rm({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(zm(t,"accept","")),this.setMultiple(zm(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}(Am),Ym={resize:Cm,syncTo:Bm};Object.assign(Fm.prototype,Ym,Dm);var Vm={setDropEnable:function(t){return void 0===t&&(t=!0),this.dropEnable=t,this},toggleDropEnable:function(){return this.dropEnable=!this.dropEnable,this}},Wm={resize:Cm,syncTo:Bm};Object.assign(Wm,Vm,{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}},Dm);var Xm={dragenter:"dragenter",dragleave:"dragleave",dragover:"dragover",drop:"drop"},Gm=Phaser.GameObjects.DOMElement,Hm=Phaser.Utils.Objects.IsPlainObject,Um=Phaser.Utils.Objects.GetValue,Nm=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),Hm(s)?(s=Um(h=s,"x",0),r=Um(h,"y",0),o=Um(h,"width",0),a=Um(h,"height",0)):Hm(o)&&(o=Um(h=o,"width",0),a=Um(h,"height",0)),void 0===h&&(h={});var c=document.createElement("div"),d=Um(h,"style",void 0);(l=e.call(this,t,s,r,c,d)).type="rexFileDropZone",l.resize(o,a),l._files=[],l.setDropEnable(Um(h,"dropEnable",!0));var f=Um(h,"filters");return f&&l.addFilters(f),Pm(u(l),c,Xm,{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}(Gm);Object.assign(Nm.prototype,Wm);var Km=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),Jm=Phaser.Utils.Objects.GetValue,Zm=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=Jm(s,"style",u(r));var o=Jm(s,"propertiesMap");return r.activeStyle=qm(s,"active",o),r.hoverStyle=qm(s,"hover",o),r.disableStyle=qm(s,"disable",o),r.onModifyStyle=Jm(s,"onModifyStyle"),r}return r(i,[{key:"getStyle",value:function(t){return rc(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 oc(e,t)?void 0:(this.modifyStyle(t),e)}}},{key:"setActiveState",value:function(t){return $m.call(this,"active",t),this}},{key:"setHoverState",value:function(t){return $m.call(this,"hover",t),this}},{key:"setDisableState",value:function(t){return $m.call(this,"disable",t),this}}]),i}(Ta),qm=function(t,e,i){var n=sc(t,e);if(i)for(var s in n)i.hasOwnProperty(s)&&(n[i[s]]=n[s],delete n[s]);return n},$m=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));},Qm={addStyleManager:function(t){return this.styleManager=new Zm(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}},tb=Phaser.GameObjects.Image,eb=Phaser.Utils.Objects.GetValue,ib=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=eb(s,"x",0),a=eb(s,"y",0),h=eb(s,"key",""),l=eb(s,"frame",void 0);(r=e.call(this,t,o,a,h,l)).type="rexStatesImage";var c=eb(s,"effects",!0);return c&&Qo(u(r),c),r.style=new Km(u(r),s),s.style=r.style,r.addStyleManager(s),delete s.style,r}return r(i)}(tb);Object.assign(ib.prototype,Qm);var nb=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),sb=Phaser.GameObjects.NineSlice,rb=Phaser.Utils.Objects.GetValue,ob=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=rb(s,"x",0),a=rb(s,"y",0),h=rb(s,"key",null),l=rb(s,"frame",null),c=rb(s,"width",0),d=rb(s,"height",0),f=rb(s,"leftWidth",0),p=rb(s,"rightWidth",0),v=rb(s,"topHeight",0),g=rb(s,"bottomHeight",0);(r=e.call(this,t,o,a,h,l,c,d,f,p,v,g)).type="rexStatesNineSlice";var y=rb(s,"effects",!0);return y&&Qo(u(r),y),r.style=new nb(u(r),s),s.style=r.style,r.addStyleManager(s),delete s.style,r}return r(i)}(sb);Object.assign(ob.prototype,Qm);var ab=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=hb,r.addStyleManager(s),delete s.style,delete s.propertiesMap,r}return r(i)}(on),hb={color:"fillColor",alpha:"fillAlpha",strokeWidth:"lineWidth"};Object.assign(ab.prototype,Qm);var lb=Phaser.GameObjects.Text,ub=Phaser.Utils.Objects.GetValue,cb=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=ub(s,"x",0),a=ub(s,"y",0),h=ub(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)}(lb);Object.assign(cb.prototype,Qm);var db=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},fb=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}(Ud),pb={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,db(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},kb=Phaser.Utils.Objects.IsPlainObject,mb=Phaser.Utils.Objects.GetValue,bb=Phaser.Display.Align.CENTER,Cb={min:0,full:-1},xb=function(t,e,n,s,r,o,a,h,l,u){vp.call(this,t);var c=t.isRexSpace,d=i(e);if(null===e)return this;if("number"===d);else if("string"===d)e=Cb[e];else if(kb(e)){var f;e=mb(f=e,"proportion",void 0),n=mb(f,"align",bb),s=mb(f,"padding",0),r=mb(f,"expand",!1),o=mb(f,"key",void 0),a=mb(f,"index",void 0),t.isRexSizer||(h=mb(f,"minWidth",void 0),l=mb(f,"minHeight",void 0)),u=mb(f,"fitRatio",0);}return "string"==typeof n&&(n=If[n]),void 0===e&&(e=c?1:0),void 0===n&&(n=bb),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=fp(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},wb={add:xb,addSpace:function(t){return this.insertSpace(void 0,t),this},insertSpace:function(t,e){return void 0===e&&(e=1),xb.call(this,new gb(this.scene),{proportion:e,minWidth:0,minHeight:0,index:t}),this},insert:function(t,e,i,n,s,r,o,a){return kb(i)&&(i.index=t),xb.call(this,e,i,n,s,r,o,t,a),this},insertAtPosition:function(t,e,i,n,s,r,o,a,h){var l=yb.call(this,t,e);return -1===l&&(l=void 0),this.insert(l,i,n,s,r,o,a,h),this}},Sb=Phaser.Utils.Array.Remove,Ob={remove:function(t,e){return this.getParentSizer(t)!==this||(Sb(this.sizerChildren,t),xp.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,ik.call(this,t),this}},Pb={getChildAlign:function(t){return this.getSizerConfig(t).align},setChildAlign:function(t,e){return "string"==typeof e&&(e=If[e]),this.getSizerConfig(t).align=e,this}},Tb={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=Mp.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(Tb,wb,Ob,Pb,{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 Mb=function(){for(var t,e,i=0,n=this.sizerChildren,s=0,r=n.length;s0&&(i+=e);return i},Eb={x:0,h:0,horizontal:0,"left-to-right":0,y:1,v:1,vertical:1,"top-to-bottom":1},_b=function(t){return "string"==typeof t&&(t=Eb[t]),t},Lb=Phaser.Utils.Objects.IsPlainObject,Rb=Phaser.Utils.Objects.GetValue,Bb=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;return n(this,i),Lb(s)?(s=Rb(l=s,"x",0),r=Rb(l,"y",0),o=Rb(l,"width",void 0),a=Rb(l,"height",void 0),h=Rb(l,"orientation",0)):Lb(o)?(o=Rb(l=o,"width",void 0),a=Rb(l,"height",void 0),h=Rb(l,"orientation",0)):Lb(h)&&(h=Rb(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(Rb(l,"space.item",0)),u.setStartChildIndex(Rb(l,"startChildIndex",0)),u.setRTL(Rb(l,"rtl",!1)),u.addChildrenMap("items",u.sizerChildren),u}return r(i,[{key:"setOrientation",value:function(t){return this.orientation=_b(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=Mb.call(this)),this._childrenProportion}}]),i}(Ky);Object.assign(Bb.prototype,Tb);var jb=function(){return Array.prototype.reduce.call(arguments,Db,0)},Db=function(t,e){return t+e},Ab=Phaser.Utils.Objects.IsPlainObject,Ib=Phaser.Utils.Objects.GetValue,zb=Phaser.Display.Align.CENTER,Fb=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 Vb(this.sizerChildren,null),ik.call(this,t),this}},Xb={setColumnSpace:function(t){if(this.space.column||(this.space.column=[]),this.space.column.length=this.columnCount-1,"number"==typeof t)Vb(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},Nb={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=Mp.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,Vb(this.sizerChildren,null),this.columnProportions=[],this.columnProportions.length=t,"number"==typeof i)Vb(this.columnProportions,i);else for(var r=0;r0&&(e+=t);return e},Jb=function(){for(var t,e=0,i=0;i0&&(e+=t);return e},Zb=Phaser.Utils.Objects.IsPlainObject,qb=Phaser.Utils.Objects.GetValue,$b=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),Zb(s)?(s=qb(d=s,"x",0),r=qb(d,"y",0),o=qb(d,"width",void 0),a=qb(d,"height",void 0),h=qb(d,"column",d.col||0),l=qb(d,"row",0),u=qb(d,"columnProportions",0),c=qb(d,"rowProportions",0)):Zb(o)?(o=qb(d=o,"width",void 0),a=qb(d,"height",void 0),h=qb(d,"column",d.col||0),l=qb(d,"row",0),u=qb(d,"columnProportions",0),c=qb(d,"rowProportions",0)):Zb(h)?(h=qb(d=h,"column",d.col||0),l=qb(d,"row",0),u=qb(d,"columnProportions",0),c=qb(d,"rowProportions",0)):Zb(u)&&(u=qb(d=u,"columnProportions",0),c=qb(d,"rowProportions",0)),(f=e.call(this,t,s,r,o,a,d)).type="rexGridSizer",f.sizerChildren=[],f.addChildrenMap("items",f.sizerChildren),f.setCreateCellContainerCallback(qb(d,"createCellContainerCallback")),f.setIndentLeft(qb(d,"space.indentLeftOdd",0),qb(d,"space.indentLeftEven",0)),f.setIndentTop(qb(d,"space.indentTopOdd",0),qb(d,"space.indentTopEven",0)),f.resetGrid(h,l,u,c,qb(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=Kb.call(this)),this._totalColumnProportions}},{key:"totalRowProportions",get:function(){return void 0===this._totalRowProportions&&(this._totalRowProportions=Jb.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}(Ky);Object.assign($b.prototype,Nb);var Qb=function(t,e,i,n){return e/t<=i?e/(n-1):0},tC=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=nC(a.left,a.centerY,t,e))&&(s=h,n=r);var h,l=i[r+1];if(!l||l.y!==a.y)s>(h=nC(a.right,a.centerY,t,e))&&(s=h,n=r+1);}}return n},rC=Phaser.Utils.Objects.IsPlainObject,oC=Phaser.Utils.Objects.GetValue,aC=Phaser.Display.Align.CENTER,hC=function(t,e,i,n){if("\n"===t)return this.addNewLine(),this;var s;(vp.call(this,t),rC(e))&&(e=oC(s=e,"padding",0),i=oC(s,"key",void 0),n=oC(s,"index",void 0));return void 0===e&&(e=0),(s=this.getSizerConfig(t)).align=aC,s.padding=fp(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},lC={add:function(t,e,i){if(og(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,ik.call(this,t),this}},dC={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--)$C.call(this,e[i],t);return this}},tx=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);}},ex=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,tx.call(e,t,i,n);}},enumerable:!0,configurable:!0}),t.selected=!1;},ix={add:function(t){return this.buttons.push(t),t._click||(t._click=new Td(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")),ex.call(this,t)),this},addMultiple:function(t){for(var e=0,i=t.length;e2?o-2:0),h=2;h=0;i--)kx.call(this,e[i],t);return this}},bx=Phaser.Utils.Objects.GetValue,Cx=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=bx(s,"row",0),a=bx(s,"column",s.col||0),h=bx(s,"createCellContainerCallback"),l=bx(s,"buttons",void 0),c=bx(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&&xx.addNewLine(this);}else for(r=0,o=t.length;r=0;i--)Tx.call(this,e[i],t);return this}},Ex=Phaser.Utils.Objects.GetValue,_x=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 lx({parent:u(r),eventEmitter:Ex(s,"eventEmitter",u(r)),groupName:Ex(s,"groupName",void 0),clickConfig:Ex(s,"click",void 0)}).setButtonsType(s);var a=Ex(s,"background",void 0),h=Ex(s,"buttons",void 0);return r.buttonsAlign=Ex(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}(yC);Object.assign(_x.prototype,Sx,Mx,hx,cx);var Lx=Phaser.Utils.Objects.GetValue,Rx=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 Fm(t);return t.add.existing(o),r.addBackground(o),r.addChildrenMap("fileChooser",o),r.setAccept(Lx(s,"accept","")),r.setMultiple(Lx(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}(SC);Object.assign(Rx.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 Bx={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}},jx={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,sg.modal.call(this,t,e),this}},Dx={};Object.assign(Dx,Bx,jx);var Ax=Phaser.Utils.Objects.GetValue,Ix=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=Ax(s,"eventEmitter",u(r));var o,a,h,l,c=Ax(s,"background",void 0),d=Ax(s,"title",void 0),f=Ax(s,"toolbar",void 0),p=Ax(s,"toolbarBackground",void 0),v=Ax(s,"leftToolbar",void 0),g=Ax(s,"leftToolbarBackground",void 0),y=Ax(s,"content",void 0),k=Ax(s,"description",void 0),m=Ax(s,"choices",void 0),b=Ax(s,"choicesBackground",void 0),C=Ax(s,"actions",void 0),x=Ax(s,"actionsBackground",void 0),w=Ax(s,"click",void 0);if(c&&r.addBackground(c),f&&(h=new fx(t,{groupName:"toolbar",background:p,buttons:f,orientation:0,space:{item:Ax(s,"space.toolbarItem",0)},click:w,eventEmitter:r.eventEmitter})),v&&(l=new fx(t,{groupName:"leftToolbar",background:g,buttons:v,orientation:0,space:{item:Ax(s,"space.leftToolbarItem",0)},click:w,eventEmitter:r.eventEmitter})),d||f||v){var S,O=!!d&&Ax(s,"expand.title",!0),P=Ax(s,"align.title","center"),T=!(d&&!O&&"center"===P||!d&&(f||v));S=T?new Bb(t,{orientation:0}):new hk(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:Ax(s,"space.titleLeft",0),right:Ax(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:Ax(s,"space.title",0),top:Ax(s,"space.titleTop",0)});_=Ax(s,"proportion.title",0);r.add(S,{padding:E,proportion:_,expand:!0});}if(y){var L=Ax(s,"align.content","center"),R=Ax(s,"space.content",0),B=(E={left:Ax(s,"space.contentLeft",0),right:Ax(s,"space.contentRight",0),bottom:k||m||C?R:0},_=Ax(s,"proportion.content",0),Ax(s,"expand.content",!0));r.add(y,{align:L,padding:E,proportion:_,expand:B});}if(k){L=Ax(s,"align.description","center");var j=Ax(s,"space.description",0);E={left:Ax(s,"space.descriptionLeft",0),right:Ax(s,"space.descriptionRight",0),bottom:m||C?j:0},_=Ax(s,"proportion.description",0),B=Ax(s,"expand.description",!0);r.add(k,{align:L,padding:E,proportion:_,expand:B});}if(m){var D=Ax(s,"choicesType","").split("-"),A=zx(D,"wrap")?_x:zx(D,"grid")?Cx:fx,I=zx(D,"radio")?"radio":zx(D,"checkboxes")?"checkboxes":void 0,z={left:Ax(s,"space.choicesBackgroundLeft",0),right:Ax(s,"space.choicesBackgroundRight",0),top:Ax(s,"space.choicesBackgroundTop",0),bottom:Ax(s,"space.choicesBackgroundBottom",0)},F=Ax(s,"space.choice",0);A===fx?z.item=F:A===_x?(z.item=F,z.line=Ax(s,"space.choiceLine",F)):(z.column=Ax(s,"space.choiceColumn",F),z.row=Ax(s,"space.choiceRow",F));var Y={width:Ax(s,"choicesWidth",void 0),height:Ax(s,"choicesHeight",void 0),groupName:"choices",buttonsType:I,background:b,buttons:m,space:z,click:w,eventEmitter:r.eventEmitter,setValueCallback:Ax(s,"choicesSetValueCallback",void 0),setValueCallbackScope:Ax(s,"choicesSetValueCallbackScope",void 0)};A===fx&&(Y.orientation=zx(D,"x")?0:1),o=new A(t,Y);var V=Ax(s,"space.choices",0);E={left:Ax(s,"space.choicesLeft",0),right:Ax(s,"space.choicesRight",0),bottom:C?V:0},L=Ax(s,"align.choices","center"),_=Ax(s,"proportion.choices",0),B=Ax(s,"expand.choices",!0);r.add(o,{align:L,padding:E,proportion:_,expand:B}),r.buttonsType=I;}if(C){a=new fx(t,{groupName:"actions",background:x,buttons:C,orientation:0,space:{item:Ax(s,"space.action",0)},expand:Ax(s,"expand.actions",!1),align:Ax(s,"align.actions","center"),click:w,eventEmitter:r.eventEmitter});E={left:Ax(s,"space.actionsLeft",0),right:Ax(s,"space.actionsRight",0),bottom:Ax(s,"space.actionsBottom",0)},_=Ax(s,"proportion.action",0);r.add(a,{align:"center",padding:E,proportion:_,expand:!0});}return Yx(u(r),"click"),Yx(u(r),"over"),Yx(u(r),"out"),Yx(u(r),"enable"),Yx(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)}(Bb),zx=function(t,e){return -1!==t.indexOf(e)},Fx={actions:"action",choices:"choice",toolbar:"toolbar",leftToolbar:"leftToolbar"},Yx=function(t,e){t.on("button.".concat(e),(function(i,n,s,r,o){Fx.hasOwnProperty(n)&&t.emit("".concat(Fx[n],".").concat(e),i,s,r,o);}));};Object.assign(Ix.prototype,Dx);var Vx=function(t,e,i){var n=new IC(t,e,i);return t.add.existing(n),n},Wx=function(t){this.childrenMap.title.resetDisplayContent(t.title);},Xx=function(t){var e=this.childrenMap.content;if(e.resetDisplayContent)e.resetDisplayContent(t.content);else {var i=t.content||"";e.setText(i);}},Gx=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}(Bv),Bw=Phaser.Utils.Objects.GetValue,jw=Phaser.Math.Distance.Between,Dw=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(Bw(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(Bw(t,"enable",!0)),this.holdThreshold=Bw(t,"holdThreshold",50),this.pointerOutReleaseEnable=Bw(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 Oc(this.scene)}},{key:"speed",get:function(){return this.x===this.preX&&this.y===this.preY?0:jw(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),Aw=Phaser.Utils.Objects.GetValue,Iw=function(){function t(e){n(this,t),this.resetFromJSON(e);}return r(t,[{key:"resetFromJSON",value:function(t){return this.setValue(Aw(t,"value",0)),this.setSpeed(Aw(t,"speed",0)),this.setAcceleration(Aw(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}(),zw=function(){function t(){n(this,t),this.value,this.dir,this.movement=new Iw;}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),Ww={y:0,v:0,vertical:0,x:1,h:1,horizontal:1},Xw=Phaser.Utils.Objects.GetValue,Gw=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=Xw(s,"focus",!0):r.focusMode=!1,r.setSpeed(Xw(s,"speed",.1)),r.setEnable(Xw(s,"enable",!0)),r.focusMode)?(t=r.parent).setInteractive(Xw(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),Hw=Phaser.Utils.Objects.GetValue,Uw=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)?Hw(n,c,void 0):Hw(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=Vt(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 Lw(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=Hw(s,"position",0);"string"==typeof v&&(v=Nw[v]);var g=Hw(n,"space.slider".concat(i),void 0);void 0===g&&void 0===(g=Hw(n,"space.slider",void 0))&&(g=l?0:Hw(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)]=Hw(s,"hideUnscrollableSlider",!1),t["adaptThumb".concat(i,"SizeMode")]=Hw(s,"adaptThumbSize",!1),t["minThumb".concat(i,"Size")]=Hw(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)?Hw(n,k,!0):Hw(n,"scroller",!0))&&u&&(!0===o&&(o={}),o.orientation=h?0:1,a=new Vw(u,o));var m,b,C,x,w=Hw(n,l?"mouseWheelScroller".concat(i):"mouseWheelScroller",!1);(w&&u&&(m=new Gw(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);}));}},Nw={right:0,left:1,bottom:0,top:1},Kw=Phaser.Utils.Objects.GetValue,Jw=function(t,e){var i=t.scene,n=[0,1,0],s=[0,1,0],r=Kw(e,"width"),o=Kw(e,"height");r||(Kw(e,"child.expandWidth",!0)||(n[1]=0));o||(Kw(e,"child.expandHeight",!0)||(s[1]=0));var a=new $b(i,{column:3,row:3,columnProportions:n,rowProportions:s});switch(function(t,e,i){var n=iw(i,"child"),s=iw(n,"gameObject",void 0);if(s){var r=iw(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=iw(r,"top",0),o.bottom=iw(r,"bottom",0),a.left=iw(r,"left",0),a.right=iw(r,"right",0);break;case 1:o.top=iw(r,"left",0),o.bottom=iw(r,"right",0),a.top=iw(r,"top",0),a.bottom=iw(r,"bottom",0);break;default:o.top=iw(r,"top",0),o.bottom=iw(r,"bottom",0),o.left=iw(r,"left",0),o.right=iw(r,"right",0);}e.add(s,{column:1,row:1,align:iw(n,"align","center"),padding:a,expand:{width:iw(n,"expandWidth",!0),height:iw(n,"expandHeight",!0)}});}t.addChildrenMap("child",s);}(t,a,e),t.scrollMode){case 0:Uw(t,a,"y",e);break;case 1:Uw(t,a,"x",e);break;default:Uw(t,a,"y",e),Uw(t,a,"x",e);}return a},Zw=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);},qw=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);}},$w=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},oS=function(t){return (t-this.textLineSpacing)/(this.textLineHeight+this.textLineSpacing)},aS=function(t){return t*(this.textLineHeight+this.textLineSpacing)-this.textLineSpacing},hS=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},lS=function(t,e){switch(sS(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;}},uS=function(){var t=this.textObject.rexSizer;this.textObject.y+=t.offsetY-t.preOffsetY,t.preOffsetY=t.offsetY,this.resetChildPositionState(this.textObject),this.textCropEnable&&cS.call(this);},cS=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);}},dS=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();}},fS={setText:function(t){return void 0!==t&&(this.text=t),this.lines=rS(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(oS.call(this,-this.textOY)),0),e=aS.call(this,t)+this.textOY,i=hS.call(this,t);return lS(this.textObject,i),this.textObject.rexSizer.offsetY=e,uS.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,_p.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,dS.call(this,t,r,o),ap(t,n,s,r,o,e.align),e.preOffsetY=0,uS.call(this),this.textMask&&(this.textMask.setPosition().resize(),this.resetChildPositionState(this.textMask)));}},pS=Phaser.Utils.Objects.IsPlainObject,vS=Phaser.Utils.Objects.GetValue,gS=Phaser.Display.Align.TOP_LEFT,yS=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),pS(s)?(s=vS(h=s,"x",0),r=vS(h,"y",0),o=vS(h,"width",void 0),a=vS(h,"height",void 0)):pS(o)&&(o=vS(h=o,"width",void 0),a=vS(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=vS(h,"content",""),l._textOY=0,l.execeedTopState=!1,l.execeedBottomState=!1,l.setClampMode(vS(h,"clamplTextOY",!0)),l.alwaysScrollable=vS(h,"alwaysScrollable",!1);var c=vS(h,"background",void 0),d=vS(h,"text",void 0);void 0===d&&(d=kS(t)),l.textCropEnable=vS(h,"textCrop",!!d.setCrop);var f=vS(h,"textMask",!l.textCropEnable);c&&l.addBackground(c),l.add(d),l.sizerChildren=[d];var p=l.getSizerConfig(d);return p.align=gS,p.padding=fp(0),p.expand=!0,l.textObject=d,l.textObjectType=sS(d),p.preOffsetY=0,p.offsetY=0,f&&(l.textMask=xC.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(oS.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=aS.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}(Ky),kS=function(t){return t.add.text(0,0,"")};Object.assign(yS.prototype,fS);var mS={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}},bS=Phaser.Utils.Objects.GetValue,CS=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=bS(s,"text",void 0),a=bS(s,"textWidth",void 0),h=bS(s,"textHeight",void 0),l=bS(s,"textCrop",!!o.setCrop),u=bS(s,"textMask",!l),c=bS(s,"content",""),d=new yS(t,{width:a,height:h,text:o,textMask:u,textCrop:l&&!u,content:c,clamplTextOY:bS(s,"clamplChildOY",!1),alwaysScrollable:bS(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=bS(s,"space",void 0);return f&&(f.child=bS(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}(iS);Object.assign(CS.prototype,{setText:function(t){return this.childrenMap.child.setText(t),this.resizeController(),this},appendText:function(t){return this.setText(this.text+t),this}},mS);var xS=Phaser.Utils.Objects.GetValue,wS=function(t,e,i){e=e?xe(e):{};var n=xS(i,"background",OC),s=xS(i,"text",MC),r=xS(i,"track",OC),o=xS(i,"thumb",OC);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 CS(t,e);return t.add.existing(h),h},SS=Phaser.Utils.Objects.GetValue,OS=Phaser.Utils.Objects.GetValue,PS=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=OS(r,"background",OC);a?s.background=a(t,s.background):delete s.background,s.title=Vx(t,s.title,r.title),s.content=function(t,e,i){var n,s=SS(e,"$type");void 0===s&&e&&(e.hasOwnProperty("slider")||e.hasOwnProperty("scroller"))&&(s="textarea"),n="textarea"===s?new wS(t,e,i):new Vx(t,e,i);return t.add.existing(n),n}(t,s.content,r.content),s.content instanceof CS&&nc(s,"height")&&!nc(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=[Vx(t,l,p),Vx(t,c,v)];break;case 1:s.actions=[Vx(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),$x.call(u(o)),o}return r(i)}(Ix);Object.assign(PS.prototype,Ux);var TS=Phaser.Utils.Objects.GetValue,MS=function(t,e,i){var n=TS(t,"proportion.".concat(e),i.proportion),s=TS(t,"align.".concat(e),"center"),r=TS(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:TS(t,"expand.".concat(e),!0)}},ES=function(t){return MS(t,"header",{proportion:0,paddingKey:"bottom"})},_S=function(t){return MS(t,"leftSide",{proportion:0,paddingKey:"right"})},LS=function(t){return MS(t,"content",{proportion:1})},RS=function(t){return MS(t,"rightSide",{proportion:0,paddingKey:"left"})},BS=function(t){return MS(t,"footer",{proportion:0,paddingKey:"top"})},jS=function(t,e){var i=new Bb(t,{orientation:e});return t.add.existing(i),i},DS=Phaser.Utils.Objects.GetValue,AS=[function(t){var e=this.scene,i=t.header;i&&this.add(i,ES(t));var n=jS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,_S(t));var r=t.content;r&&n.add(r,LS(t));var o=t.rightSide;o&&n.add(o,RS(t));var a=t.footer;a&&this.add(a,BS(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,ES(t));var n=jS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,_S(t));var r=jS(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=jS(e,0);r.add(o,{proportion:1,align:"center",padding:0,expand:!0});var a=t.content;a&&o.add(a,LS(t));var h=t.rightSide;h&&o.add(h,RS(t));var l=t.footer;l&&r.add(l,BS(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,ES(t));var n=jS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=jS(e,1);n.add(s,{proportion:1,align:"center",padding:0,expand:!0});var r=jS(e,0);s.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.leftSide;o&&r.add(o,_S(t));var a=t.content;a&&r.add(a,LS(t));var h=t.footer;h&&s.add(h,BS(t));var l=t.rightSide;l&&n.add(l,RS(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,ES(t));var n=jS(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,_S(t));var r=jS(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.content;o&&r.add(o,LS(t));var a=t.footer;a&&r.add(a,BS(t));var h=t.rightSide;h&&n.add(h,RS(t));}],IS={FFF:0,LFF:1,FFR:2,LFR:3},zS=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)}(Bb),FS={build:function(t){this.clear(!0);var e=DS(t,"background",void 0);e&&this.addBackground(e);var i=DS(t,"layoutMode",0);"string"==typeof i&&(i=IS[i.toUpperCase()]),(AS[i]||AS[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(zS.prototype,FS);var YS={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 bv(this.getButton(t,e)),this},showLeftButton:function(t){return bv(this.getLeftButton(t)),this},showRightButton:function(t){return bv(this.getRightButton(t)),this},showTopButton:function(t){return bv(this.getTopButton(t)),this},showBottomButton:function(t){return bv(this.getBottomButton(t)),this},hideButton:function(t,e){return Cv(this.getButton(t,e)),this},hideLeftButton:function(t){return Cv(this.getLeftButton(t)),this},hideRightButton:function(t){return Cv(this.getRightButton(t)),this},hideTopButton:function(t){return Cv(this.getTopButton(t)),this},hideBottomButton:function(t){return Cv(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}},VS=Phaser.Utils.Objects.GetValue,WS=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=VS(s,"eventEmitter",u(r));var o,a,h,l,c=VS(s,"background",void 0),d=VS(s,"panel",void 0),f=VS(s,"leftButtons",void 0),p=VS(s,"leftButtonsBackground",void 0),v=VS(s,"rightButtons",void 0),g=VS(s,"rightButtonsBackground",void 0),y=VS(s,"topButtons",void 0),k=VS(s,"topButtonsBackground",void 0),m=VS(s,"bottomButtons",void 0),b=VS(s,"bottomButtonsBackground",void 0),C=VS(s,"click",void 0);if(c&&r.addBackground(c),d&&r.add(d,1,1,"center",0,!0),f){var x=VS(s,"space.leftButtonsOffset",0),w=VS(s,"space.leftButton",0);o=new fx(t,{groupName:"left",background:p,buttons:f,orientation:1,space:{item:w},align:VS(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=VS(s,"space.rightButtonsOffset",0),P=VS(s,"space.rightButton",0);a=new fx(t,{groupName:"right",background:g,buttons:v,orientation:1,space:{item:P},align:VS(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=VS(s,"space.topButtonsOffset",0),M=VS(s,"space.topButton",0);h=new fx(t,{groupName:"top",background:k,buttons:y,orientation:0,space:{item:M},align:VS(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=VS(s,"space.bottomButtonsOffset",0),_=VS(s,"space.bottomButton",0);l=new fx(t,{groupName:"bottom",background:b,buttons:m,orientation:0,space:{item:_},align:VS(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)}($b);Object.assign(WS.prototype,YS);var XS=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=If[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(XS.prototype,wi);var GS=Phaser.Utils.Objects.GetValue,HS=Phaser.Utils.Array.SpliceOne,US=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(GS(t,"cellsCount",0)),this.setColumnCount(GS(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=hO(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));},QO={down:0,up:1},tP=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={}),null==s.transitIn&&(s.transitIn=function(t,e){zp(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 Ap(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),$O(t,s),t.isRexSizer&&t.layout();var o=tP(s,"touchOutsideClose",!1),a=tP(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&&tg(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}(Vv),iP={openListPanel:function(){if(this.listPanel)return this;var t,e=ZO.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 eP(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(iP,KO);var nP=Phaser.Utils.Objects.GetValue,sP=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(nP(s,"options"));var o=nP(s,"list");return r.setWrapEnable(nP(o,"wrap",!1)),r.setCreateButtonCallback(nP(o,"createButtonCallback")),r.setCreateListBackgroundCallback(nP(o,"createBackgroundCallback")),r.setButtonClickCallback(nP(o,"onButtonClick")),r.setButtonOverCallback(nP(o,"onButtonOver")),r.setButtonOutCallback(nP(o,"onButtonOut")),r.setListExpandDirection(nP(o,"expandDirection")),r.setListEaseInDuration(nP(o,"easeIn",500)),r.setListEaseOutDuration(nP(o,"easeOut",100)),r.setListTransitInCallback(nP(o,"transitIn")),r.settListTransitOutCallback(nP(o,"transitOut")),r.setListSize(nP(o,"width"),nP(o,"height")),r.setListAlignmentMode(nP(o,"alignParent","text")),r.setListAlignmentSide(nP(o,"alignSide","")),r.setListBounds(nP(o,"bounds")),r.setListSpace(nP(o,"space")),r.setListDraggable(nP(o,"draggable",!1)),r.setValueChangeCallback(nP(s,"setValueCallback"),nP(s,"setValueCallbackScope")),r.setValue(nP(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}(SC);Object.assign(sP.prototype,iP);var rP=function(t){return Array.isArray(t)?t=t.join("\n"):"number"==typeof t&&(t=t.toString()),t},oP={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(rP(t));t=this.sections.join("\n");this.lines=rS(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=dP(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(sS(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(fP.prototype,uP),Phaser.Utils.Objects.GetFastValue,Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue;var pP=hk.prototype.add,vP=function(t,e,i,n,s,r,o,a,h){return t.setVisible(!1),pP.call(this,t,e,i,n,s,r,o,a,h),this},gP={add:vP,addPage:vP},yP=ie.prototype.setChildVisible,kP={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?(yP.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&&(yP.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(kP,gP);var mP=Phaser.Utils.Objects.GetValue,bP=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(mP(s,"swapMode",0)),r.setFadeInDuration(mP(s,"fadeIn",0)),r}return r(i,[{key:"setSwapMode",value:function(t){return "string"==typeof t&&(t=CP[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}(hk);Object.assign(bP.prototype,kP);var CP={invisible:0,destroy:1},xP=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}(Ky);Object.assign(BT.prototype,ET);var jT=["top","bottom","centerY","center"],DT=["left","right","centerX","center"],AT=function(t,e,i){var n,s="Y"===(e=e.toUpperCase()),r=this.childrenMap.child;if(s){if(i)for(var o=0,a=jT.length;o=0?0:Math.abs(l)<=Math.abs(u)?l:u;}}else {if(i)for(o=0,a=DT.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;}},IT=Phaser.Utils.Objects.GetValue,zT=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=tw(s),a=IT(s,"panel",void 0);void 0===a&&(a={}),a.scrollMode=o,a.clamplChildOY=IT(s,"clamplChildOY",!1),a.clamplChildOX=IT(s,"clamplChildOX",!1);var h,l,u=new BT(t,a);switch(t.add.existing(u),o){case 0:h=IT(s,"expand.panel",!0),l=!0;break;case 1:h=!0,l=IT(s,"expand.panel",!0);break;default:h=!0,l=!0;}s.type="rexScrollablePanel",s.child={gameObject:u,expandWidth:h,expandHeight:l,align:IT(s,"align.panel","center")};var c=IT(s,"space",void 0);return c&&(c.child=IT(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]),Hy(this.childrenMap.child,t),this}}]),i}(iS),FT={scrollToChild:function(t,e){if(!this.hasChild(t))return this;switch(this.scrollMode){case 0:AT.call(this,t,"y",e);break;case 1:AT.call(this,t,"x",e);break;default:AT.call(this,t,"y",e),AT.call(this,t,"x",e);}return this}};Object.assign(zT.prototype,FT),Phaser.Utils.Objects.GetValue,Phaser.Utils.Objects.GetValue;for(var YT,VT=function(t,e,i){void 0===i&&(i=!0),i?e=e?xe(e):{}:e||(e={});var n=new wc(t,e);return t.add.existing(n),n},WT=Phaser.Utils.Objects.GetValue,XT=Phaser.Display.Color,GT=Phaser.Display.Color.ColorToRGBA,HT=Phaser.Display.Color.HSVToRGB,UT=Phaser.Math.Clamp,NT=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 XT;var o=WT(s,"background",void 0),a=WT(s,"formatLabel",void 0);Xt(a)||(a=Vx(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=WT(s,"inputText"),c=0;c<3;c++){var d=VT(t,l).setMaxLength(3).setNumberInput();h.push(d);}o&&r.addBackground(o);var f=WT(s,"proportion.formatLabel",0),p=!!a.isRexContainerLite,v=WT(s,"expand.formatLabel",p);r.add(a,{proportion:f,expand:v});f=void 0===WT(l,"width")?1:0,v=void 0===WT(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 LM(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},BM={openColorPicker:function(){if(!this.colorPicker){var t=RM.call(this).layout(),e=new eP(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(BM,aM);var jM=Phaser.Utils.Objects.GetValue,DM=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(jM(o,"width",160),jM(o,"height",170));var l=jM(o,"background");h=l?function(t){return OC(t,l)}:jM(o,"createBackgroundCallback"),r.setCreateColorPickerBackgroundCallback(h),r.setColorPickerHPalettePosition(jM(o,"hPalettePosition",0)),r.setColorPickerExpandDirection(jM(o,"expandDirection")),r.setColorPickerEaseInDuration(jM(o,"easeIn",200)),r.setColorPickerEaseOutDuration(jM(o,"easeOut",200)),r.setColorPickerTransitInCallback(jM(o,"transitIn")),r.setColorPickerTransitOutCallback(jM(o,"transitOut")),r.setColorPickerBounds(jM(o,"bounds"));var c=jM(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(jM(d,"height",30)),r.setColorComponentsFormatLabelConfig(jM(d,"formatLabel"));var f=jM(d,"inputText");f||(f=jM(s,"inputText")),r.setColorComponentsInputTextConfig(f);var p=jM(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)}(oM);Object.assign(DM.prototype,BM);var AM=Phaser.Utils.Array.GetFirst,IM=Phaser.Utils.Array.Remove,zM=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),s=AC(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}(SC),FM=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 Rf(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}(zM),YM=function(t,e){var i=new uE(t,e);return t.add.existing(i),i},VM=function(t,e,i){return OC(t,i)},WM=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}(OT);Object.assign(WM.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 XM=Phaser.Utils.Objects.GetValue,GM=Phaser.Utils.Objects.GetValue,HM={getMaxInputRowTitleWidth:function(){for(var t=0,e=this.childrenMap.pages.children,i=0,n=e.length;i0?0:1,r.setMinWidth(this.itemWidth)),this.add(r,{proportion:s,expand:!0}),i.onValueChange&&o.on("valuechange",i.onValueChange),r.setAutoUpdateEnable(i.autoUpdate),r.setBindingTarget(t,e),i.monitor&&r.startMonitorTarget(),i.key&&this.root.addChildrenMap(i.key,r),this},addButton:oE,addButtons:oE,addSeparator:function(t){var e=this.scene,i=aE(this.styles,"separator"),n=VM(e,0,i);return this.add(n,{expand:!0}),this},setBindingTarget:function(t){for(var e=this.sizerChildren,i=0,n=e.length;i= 0); - var anyTouchClose = GetValue$1E(config, 'anyTouchClose', false); - var manualClose = GetValue$1E(config, 'manualClose', false); + var touchOutsideClose = GetValue$1C(config, 'touchOutsideClose', false); + var timeOutDuration = GetValue$1C(config, 'duration.hold', -1); + var timeOutClose = GetValue$1C(config, 'timeOutClose', timeOutDuration >= 0); + var anyTouchClose = GetValue$1C(config, 'anyTouchClose', false); + var manualClose = GetValue$1C(config, 'manualClose', false); if (manualClose) { touchOutsideClose = false; anyTouchClose = false; @@ -7462,7 +7462,7 @@ } else if (touchOutsideClose) { _this.once('open', _this.touchOutsideClose, _assertThisInitialized(_this)); } - if (GetValue$1E(config, 'openOnStart', true)) { + if (GetValue$1C(config, 'openOnStart', true)) { // Run this.requestOpen() next tick // User can register events before this.requestOpen() _this.delayCall(0, _this.requestOpen, _assertThisInitialized(_this)); @@ -7940,7 +7940,7 @@ return this; }; - var GetValue$1D = Phaser.Utils.Objects.GetValue; + var GetValue$1B = Phaser.Utils.Objects.GetValue; var Button = /*#__PURE__*/function (_ComponentBase) { _inherits(Button, _ComponentBase); var _super = _createSuper(Button); @@ -7951,7 +7951,7 @@ // this.parent = gameObject; _this._enable = undefined; - gameObject.setInteractive(GetValue$1D(config, "inputConfig", undefined)); + gameObject.setInteractive(GetValue$1B(config, "inputConfig", undefined)); _this.resetFromJSON(config); _this.boot(); return _this; @@ -7961,10 +7961,10 @@ value: function resetFromJSON(o) { this.pointer = undefined; this.lastClickTime = undefined; - this.setEnable(GetValue$1D(o, "enable", true)); - this.setMode(GetValue$1D(o, "mode", 1)); - this.setClickInterval(GetValue$1D(o, "clickInterval", 100)); - this.setDragThreshold(GetValue$1D(o, 'threshold', undefined)); + this.setEnable(GetValue$1B(o, "enable", true)); + this.setMode(GetValue$1B(o, "mode", 1)); + this.setClickInterval(GetValue$1B(o, "clickInterval", 100)); + this.setDragThreshold(GetValue$1B(o, 'threshold', undefined)); return this; } }, { @@ -8251,7 +8251,7 @@ }; var HitTestResult = []; - var GetValue$1C = Phaser.Utils.Objects.GetValue; + var GetValue$1A = Phaser.Utils.Objects.GetValue; var ClickOutside = /*#__PURE__*/function (_ComponentBase) { _inherits(ClickOutside, _ComponentBase); var _super = _createSuper(ClickOutside); @@ -8262,7 +8262,7 @@ // this.parent = gameObject; _this._enable = undefined; - var inputConfig = GetValue$1C(config, "inputConfig", undefined); + var inputConfig = GetValue$1A(config, "inputConfig", undefined); if (inputConfig) { gameObject.setInteractive(inputConfig); } @@ -8275,10 +8275,10 @@ value: function resetFromJSON(o) { this.pointer = undefined; this.lastClickTime = undefined; - this.setEnable(GetValue$1C(o, "enable", true)); - this.setMode(GetValue$1C(o, "mode", 1)); - this.setClickInterval(GetValue$1C(o, "clickInterval", 100)); - this.setDragThreshold(GetValue$1C(o, 'threshold', undefined)); + this.setEnable(GetValue$1A(o, "enable", true)); + this.setMode(GetValue$1A(o, "mode", 1)); + this.setClickInterval(GetValue$1A(o, "clickInterval", 100)); + this.setDragThreshold(GetValue$1A(o, 'threshold', undefined)); return this; } }, { @@ -8570,7 +8570,7 @@ return Cooldown; }(FSM); - var GetValue$1B = Phaser.Utils.Objects.GetValue; + var GetValue$1z = Phaser.Utils.Objects.GetValue; var InTouching = /*#__PURE__*/function (_ComponentBase) { _inherits(InTouching, _ComponentBase); var _super = _createSuper(InTouching); @@ -8582,7 +8582,7 @@ _this._enable = undefined; _this.cooldown = new Cooldown(); - _this.parent.setInteractive(GetValue$1B(config, 'inputConfig', undefined)); + _this.parent.setInteractive(GetValue$1z(config, 'inputConfig', undefined)); _this.resetFromJSON(config); _this.boot(); return _this; @@ -8593,8 +8593,8 @@ this.pointer = undefined; this.prevIsInTouch = false; this.isInTouching = false; - this.setEnable(GetValue$1B(o, 'enable', true)); - this.setCooldown(GetValue$1B(o, 'cooldown', undefined)); + this.setEnable(GetValue$1z(o, 'enable', true)); + this.setCooldown(GetValue$1z(o, 'cooldown', undefined)); return this; } }, { @@ -8825,9 +8825,9 @@ eventEmitter.emit(eventName, child, pointer, event); }; - var GetValue$1A = Phaser.Utils.Objects.GetValue; + var GetValue$1y = Phaser.Utils.Objects.GetValue; var DownChild = function DownChild(config) { - var downConfig = GetValue$1A(config, 'down', undefined); + var downConfig = GetValue$1y(config, 'down', undefined); if (downConfig === false) { return; } else if (downConfig === true) { @@ -8840,9 +8840,9 @@ EmitChildEvent(childrenInteractive.eventEmitter, "".concat(childrenInteractive.eventNamePrefix, "down"), childrenInteractive.targetSizers, pointer.worldX, pointer.worldY, pointer, event); }; - var GetValue$1z = Phaser.Utils.Objects.GetValue; + var GetValue$1x = Phaser.Utils.Objects.GetValue; var UpChild = function UpChild(config) { - var upConfig = GetValue$1z(config, 'up', undefined); + var upConfig = GetValue$1x(config, 'up', undefined); if (upConfig === false) { return; } else if (upConfig === true) { @@ -8855,9 +8855,9 @@ EmitChildEvent(childrenInteractive.eventEmitter, "".concat(childrenInteractive.eventNamePrefix, "up"), childrenInteractive.targetSizers, pointer.worldX, pointer.worldY, pointer, event); }; - var GetValue$1y = Phaser.Utils.Objects.GetValue; + var GetValue$1w = Phaser.Utils.Objects.GetValue; var OverChild = function OverChild(config) { - var overConfig = GetValue$1y(config, 'over', undefined); + var overConfig = GetValue$1w(config, 'over', undefined); if (overConfig === false) { return; } else if (overConfig === true) { @@ -8884,9 +8884,9 @@ EmitChildEvent(childrenInteractive.eventEmitter, "".concat(childrenInteractive.eventNamePrefix, "out"), childrenInteractive.targetSizers, child, undefined, pointer, event); }; - var GetValue$1x = Phaser.Utils.Objects.GetValue; + var GetValue$1v = Phaser.Utils.Objects.GetValue; var ClickChild = function ClickChild(config) { - var clickConfig = GetValue$1x(config, 'click', undefined); + var clickConfig = GetValue$1v(config, 'click', undefined); if (clickConfig === false) { return; } else if (clickConfig === true) { @@ -8905,7 +8905,7 @@ }, this); }; - var GetValue$1w = Phaser.Utils.Objects.GetValue; + var GetValue$1u = Phaser.Utils.Objects.GetValue; var OnePointerTracer = /*#__PURE__*/function (_TickTask) { _inherits(OnePointerTracer, _TickTask); var _super = _createSuper(OnePointerTracer); @@ -8919,7 +8919,7 @@ _this = _super.call(this, scene, config); _this.gameObject = gameObject; if (gameObject) { - gameObject.setInteractive(GetValue$1w(config, "inputConfig", undefined)); + gameObject.setInteractive(GetValue$1u(config, "inputConfig", undefined)); } _this._enable = undefined; _this.resetFromJSON(config); @@ -8929,10 +8929,10 @@ _createClass(OnePointerTracer, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.setEnable(GetValue$1w(o, 'enable', true)); + this.setEnable(GetValue$1u(o, 'enable', true)); this.setDetectBounds(); if (this.gameObject === undefined) { - this.setDetectBounds(GetValue$1w(o, 'bounds', undefined)); + this.setDetectBounds(GetValue$1u(o, 'bounds', undefined)); } else { this.setDetectBounds(); } @@ -9157,7 +9157,7 @@ var TOUCH1$1 = 1; var IDLE$5 = 'IDLE'; - var GetValue$1v = Phaser.Utils.Objects.GetValue; + var GetValue$1t = Phaser.Utils.Objects.GetValue; var DistanceBetween$5 = Phaser.Math.Distance.Between; var Tap = /*#__PURE__*/function (_OnePointerTracer) { _inherits(Tap, _OnePointerTracer); @@ -9213,16 +9213,16 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Tap.prototype), "resetFromJSON", this).call(this, o); - this.setHoldTime(GetValue$1v(o, 'time', 250)); // min-hold-time of Press is 251 - this.setTapInterval(GetValue$1v(o, 'tapInterval', 200)); - this.setDragThreshold(GetValue$1v(o, 'threshold', 9)); - this.setTapOffset(GetValue$1v(o, 'tapOffset', 10)); - var taps = GetValue$1v(o, 'taps', undefined); + this.setHoldTime(GetValue$1t(o, 'time', 250)); // min-hold-time of Press is 251 + this.setTapInterval(GetValue$1t(o, 'tapInterval', 200)); + this.setDragThreshold(GetValue$1t(o, 'threshold', 9)); + this.setTapOffset(GetValue$1t(o, 'tapOffset', 10)); + var taps = GetValue$1t(o, 'taps', undefined); if (taps !== undefined) { this.setTaps(taps); } else { - this.setMaxTaps(GetValue$1v(o, 'maxTaps', undefined)); - this.setMinTaps(GetValue$1v(o, 'minTaps', undefined)); + this.setMaxTaps(GetValue$1t(o, 'maxTaps', undefined)); + this.setMinTaps(GetValue$1t(o, 'minTaps', undefined)); } return this; } @@ -9364,7 +9364,7 @@ var BEGIN$3 = 'BEGIN'; var RECOGNIZED$3 = 'RECOGNIZED'; - var GetValue$1u = Phaser.Utils.Objects.GetValue; + var GetValue$1s = Phaser.Utils.Objects.GetValue; var Press = /*#__PURE__*/function (_OnePointerTracer) { _inherits(Press, _OnePointerTracer); var _super = _createSuper(Press); @@ -9419,8 +9419,8 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Press.prototype), "resetFromJSON", this).call(this, o); - this.setDragThreshold(GetValue$1u(o, 'threshold', 9)); - this.setHoldTime(GetValue$1u(o, 'time', 251)); + this.setDragThreshold(GetValue$1s(o, 'threshold', 9)); + this.setHoldTime(GetValue$1s(o, 'time', 251)); return this; } }, { @@ -9601,7 +9601,7 @@ }; var globOut$1 = {}; - var GetValue$1t = Phaser.Utils.Objects.GetValue; + var GetValue$1r = Phaser.Utils.Objects.GetValue; var RadToDeg$3 = Phaser.Math.RadToDeg; var Swipe = /*#__PURE__*/function (_OnePointerTracer) { _inherits(Swipe, _OnePointerTracer); @@ -9658,9 +9658,9 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Swipe.prototype), "resetFromJSON", this).call(this, o); - this.setDragThreshold(GetValue$1t(o, 'threshold', 10)); - this.setVelocityThreshold(GetValue$1t(o, 'velocityThreshold', 1000)); - this.setDirectionMode(GetValue$1t(o, 'dir', '8dir')); + this.setDragThreshold(GetValue$1r(o, 'threshold', 10)); + this.setVelocityThreshold(GetValue$1r(o, 'velocityThreshold', 1000)); + this.setDirectionMode(GetValue$1r(o, 'dir', '8dir')); return this; } }, { @@ -9767,7 +9767,7 @@ var BEGIN$1 = 'BEGIN'; var RECOGNIZED$1 = 'RECOGNIZED'; - var GetValue$1s = Phaser.Utils.Objects.GetValue; + var GetValue$1q = Phaser.Utils.Objects.GetValue; var SpliceOne = Phaser.Utils.Array.SpliceOne; var DistanceBetween$3 = Phaser.Math.Distance.Between; var AngleBetween = Phaser.Math.Angle.Between; @@ -9780,7 +9780,7 @@ } this.scene = scene; // Event emitter - this.setEventEmitter(GetValue$1s(config, 'eventEmitter', undefined)); + this.setEventEmitter(GetValue$1q(config, 'eventEmitter', undefined)); this._enable = undefined; this.pointers = []; this.movedState = {}; @@ -9790,8 +9790,8 @@ _createClass(TwoPointersTracer, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.setEnable(GetValue$1s(o, "enable", true)); - this.bounds = GetValue$1s(o, 'bounds', undefined); + this.setEnable(GetValue$1q(o, "enable", true)); + this.bounds = GetValue$1q(o, 'bounds', undefined); this.tracerState = TOUCH0; this.pointers.length = 0; Clear(this.movedState); @@ -10153,7 +10153,7 @@ return this; }; - var GetValue$1r = Phaser.Utils.Objects.GetValue; + var GetValue$1p = Phaser.Utils.Objects.GetValue; var WrapDegrees = Phaser.Math.Angle.WrapDegrees; // Wrap degrees: -180 to 180 var ShortestBetween = Phaser.Math.Angle.ShortestBetween; var RadToDeg$2 = Phaser.Math.RadToDeg; @@ -10196,7 +10196,7 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Rotate.prototype), "resetFromJSON", this).call(this, o); - this.setDragThreshold(GetValue$1r(o, 'threshold', 0)); + this.setDragThreshold(GetValue$1p(o, 'threshold', 0)); return this; } }, { @@ -10260,9 +10260,9 @@ var BEGIN = 'BEGIN'; var RECOGNIZED = 'RECOGNIZED'; - var GetValue$1q = Phaser.Utils.Objects.GetValue; + var GetValue$1o = Phaser.Utils.Objects.GetValue; var TapChild = function TapChild(config) { - var tapConfig = GetValue$1q(config, 'tap', undefined); + var tapConfig = GetValue$1o(config, 'tap', undefined); if (tapConfig === false) { return; } else if (tapConfig === true) { @@ -10275,9 +10275,9 @@ }, this); }; - var GetValue$1p = Phaser.Utils.Objects.GetValue; + var GetValue$1n = Phaser.Utils.Objects.GetValue; var PressChild = function PressChild(config) { - var pressConfig = GetValue$1p(config, 'press', undefined); + var pressConfig = GetValue$1n(config, 'press', undefined); if (pressConfig === false) { return; } else if (pressConfig === true) { @@ -10292,9 +10292,9 @@ }, this); }; - var GetValue$1o = Phaser.Utils.Objects.GetValue; + var GetValue$1m = Phaser.Utils.Objects.GetValue; var SwipeChild = function SwipeChild(config) { - var swipeConfig = GetValue$1o(config, 'swipe', undefined); + var swipeConfig = GetValue$1m(config, 'swipe', undefined); if (swipeConfig === false) { return; } else if (swipeConfig === true) { @@ -10314,16 +10314,16 @@ }, this); }; - var GetValue$1n = Phaser.Utils.Objects.GetValue; + var GetValue$1l = Phaser.Utils.Objects.GetValue; var SetChildrenInteractive$1 = function SetChildrenInteractive(gameObject, config) { gameObject.setInteractive(); - if (GetValue$1n(config, 'dropZone', false)) { + if (GetValue$1l(config, 'dropZone', false)) { gameObject.input.dropZone = true; } gameObject._childrenInteractive = { - targetSizers: GetValue$1n(config, 'targets', [gameObject]), - eventEmitter: GetValue$1n(config, 'eventEmitter', gameObject), - eventNamePrefix: GetValue$1n(config, 'inputEventPrefix', 'child.') + targetSizers: GetValue$1l(config, 'targets', [gameObject]), + eventEmitter: GetValue$1l(config, 'eventEmitter', gameObject), + eventNamePrefix: GetValue$1l(config, 'inputEventPrefix', 'child.') }; DownChild.call(gameObject, config); UpChild.call(gameObject, config); @@ -10387,7 +10387,7 @@ }; Object.assign(methods$j, PaddingMethods, AddChildMethods$7, RemoveChildMethods$6, GetParentSizerMethods, ScaleMethods, FadeMethods, EaseMoveMethods, ShakeMethods, EaseDataMethods, ClickMethods, ClickOutsideMethods, TouchingMethods, HideMethods, ModalMethods, GetShownChildrenMethods); - var GetValue$1m = Phaser.Utils.Objects.GetValue; + var GetValue$1k = Phaser.Utils.Objects.GetValue; var Base$1 = /*#__PURE__*/function (_Container) { _inherits(Base, _Container); var _super = _createSuper(Base); @@ -10397,7 +10397,7 @@ _this = _super.call(this, scene, x, y, 1, 1); _this.isRexSizer = true; _this.setMinSize(minWidth, minHeight); - _this.setName(GetValue$1m(config, 'name', '')); + _this.setName(GetValue$1k(config, 'name', '')); _this.rexSizer = {}; _this.space = {}; _this.backgroundChildren = undefined; @@ -10405,18 +10405,18 @@ _this.childrenMap = {}; _this.layoutedChildren = undefined; _this.enableLayoutWarn(); - var anchorConfig = GetValue$1m(config, 'anchor', undefined); + var anchorConfig = GetValue$1k(config, 'anchor', undefined); if (anchorConfig) { _this.setAnchor(anchorConfig); } - _this.setInnerPadding(GetValue$1m(config, 'space', 0)); - var draggable = GetValue$1m(config, 'draggable', false); + _this.setInnerPadding(GetValue$1k(config, 'space', 0)); + var draggable = GetValue$1k(config, 'draggable', false); if (draggable) { _this.setDraggable(draggable); } - _this.setSizerEventsEnable(GetValue$1m(config, 'sizerEvents', false)); + _this.setSizerEventsEnable(GetValue$1k(config, 'sizerEvents', false)); _this.setDirty(true); - if (GetValue$1m(config, 'enableLayer', false)) { + if (GetValue$1k(config, 'enableLayer', false)) { _this.enableLayer(); } return _this; @@ -11052,7 +11052,7 @@ }; var IsPlainObject$l = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1l = Phaser.Utils.Objects.GetValue; + var GetValue$1j = Phaser.Utils.Objects.GetValue; var ALIGN_CENTER$3 = Phaser.Display.Align.CENTER; var PROPORTIONMODE = { min: 0, @@ -11068,17 +11068,17 @@ proportion = PROPORTIONMODE[proportion]; } else if (IsPlainObject$l(proportion)) { var config = proportion; - proportion = GetValue$1l(config, 'proportion', undefined); - align = GetValue$1l(config, 'align', ALIGN_CENTER$3); - paddingConfig = GetValue$1l(config, 'padding', 0); - expand = GetValue$1l(config, 'expand', false); - childKey = GetValue$1l(config, 'key', undefined); - index = GetValue$1l(config, 'index', undefined); + proportion = GetValue$1j(config, 'proportion', undefined); + align = GetValue$1j(config, 'align', ALIGN_CENTER$3); + paddingConfig = GetValue$1j(config, 'padding', 0); + expand = GetValue$1j(config, 'expand', false); + childKey = GetValue$1j(config, 'key', undefined); + index = GetValue$1j(config, 'index', undefined); if (!gameObject.isRexSizer) { - minWidth = GetValue$1l(config, 'minWidth', undefined); - minHeight = GetValue$1l(config, 'minHeight', undefined); + minWidth = GetValue$1j(config, 'minWidth', undefined); + minHeight = GetValue$1j(config, 'minHeight', undefined); } - fitRatio = GetValue$1l(config, 'fitRatio', 0); // width/height + fitRatio = GetValue$1j(config, 'fitRatio', 0); // width/height } if (typeof align === 'string') { @@ -11317,7 +11317,7 @@ }; var IsPlainObject$k = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1k = Phaser.Utils.Objects.GetValue; + var GetValue$1i = Phaser.Utils.Objects.GetValue; var Sizer = /*#__PURE__*/function (_BaseSizer) { _inherits(Sizer, _BaseSizer); var _super = _createSuper(Sizer); @@ -11326,19 +11326,19 @@ _classCallCheck(this, Sizer); if (IsPlainObject$k(x)) { config = x; - x = GetValue$1k(config, 'x', 0); - y = GetValue$1k(config, 'y', 0); - minWidth = GetValue$1k(config, 'width', undefined); - minHeight = GetValue$1k(config, 'height', undefined); - orientation = GetValue$1k(config, 'orientation', 0); + x = GetValue$1i(config, 'x', 0); + y = GetValue$1i(config, 'y', 0); + minWidth = GetValue$1i(config, 'width', undefined); + minHeight = GetValue$1i(config, 'height', undefined); + orientation = GetValue$1i(config, 'orientation', 0); } else if (IsPlainObject$k(minWidth)) { config = minWidth; - minWidth = GetValue$1k(config, 'width', undefined); - minHeight = GetValue$1k(config, 'height', undefined); - orientation = GetValue$1k(config, 'orientation', 0); + minWidth = GetValue$1i(config, 'width', undefined); + minHeight = GetValue$1i(config, 'height', undefined); + orientation = GetValue$1i(config, 'orientation', 0); } else if (IsPlainObject$k(orientation)) { config = orientation; - orientation = GetValue$1k(config, 'orientation', 0); + orientation = GetValue$1i(config, 'orientation', 0); } if (orientation === undefined) { orientation = 0; @@ -11347,9 +11347,9 @@ _this.type = 'rexSizer'; _this.sizerChildren = []; _this.setOrientation(orientation); - _this.setItemSpacing(GetValue$1k(config, 'space.item', 0)); - _this.setStartChildIndex(GetValue$1k(config, 'startChildIndex', 0)); - _this.setRTL(GetValue$1k(config, 'rtl', false)); + _this.setItemSpacing(GetValue$1i(config, 'space.item', 0)); + _this.setStartChildIndex(GetValue$1i(config, 'startChildIndex', 0)); + _this.setRTL(GetValue$1i(config, 'rtl', false)); _this.addChildrenMap('items', _this.sizerChildren); return _this; } @@ -11393,6 +11393,32 @@ }(Base$1); Object.assign(Sizer.prototype, methods$i); + var RegisterInputHandler = function RegisterInputHandler(config) { + var isValidInputHandler = true; + if (!config.hasOwnProperty('accept')) { + isValidInputHandler = false; + console.error("[Tweaker] Can't register inputHandler '".concat(config.name, "', missing 'accept' callback.")); + } + if (!config.hasOwnProperty('build')) { + isValidInputHandler = false; + console.error("[Tweaker] Can't register inputHandler '".concat(config.name, "', missing 'build' callback.")); + } + if (isValidInputHandler) { + this.inputHandlers.unshift(config); + } + return this; + }; + + var GetFirst = Phaser.Utils.Array.GetFirst; + var Remove$2 = Phaser.Utils.Array.Remove; + var RemoveInputHandler = function RemoveInputHandler(name) { + var handler = GetFirst(this.inputHandlers, 'name', name); + if (handler) { + Remove$2(this.inputHandlers, handler); + } + return this; + }; + var SetDisplaySize = function SetDisplaySize(gameObject, width, height) { if (!gameObject) { return; @@ -11845,7 +11871,7 @@ return maskGameObject; }; - var GetValue$1j = Phaser.Utils.Objects.GetValue; + var GetValue$1h = Phaser.Utils.Objects.GetValue; var Label = /*#__PURE__*/function (_LabelBase) { _inherits(Label, _LabelBase); var _super = _createSuper(Label); @@ -11857,14 +11883,14 @@ _this.type = 'rexLabel'; // Add elements - var background = GetValue$1j(config, 'background', undefined); - var icon = GetValue$1j(config, 'icon', undefined); - var iconMask = GetValue$1j(config, 'iconMask', undefined); - var text = GetValue$1j(config, 'text', undefined); - var action = GetValue$1j(config, 'action', undefined); - var actionMask = GetValue$1j(config, 'actionMask', undefined); + var background = GetValue$1h(config, 'background', undefined); + var icon = GetValue$1h(config, 'icon', undefined); + var iconMask = GetValue$1h(config, 'iconMask', undefined); + var text = GetValue$1h(config, 'text', undefined); + var action = GetValue$1h(config, 'action', undefined); + var actionMask = GetValue$1h(config, 'actionMask', undefined); // Align - var align = GetValue$1j(config, 'align', undefined); // undefined/left/top: no space + var align = GetValue$1h(config, 'align', undefined); // undefined/left/top: no space if (background) { _this.addBackground(background); @@ -11879,23 +11905,23 @@ if (_this.orientation === 0) { if (text || action) { padding = { - right: GetValue$1j(config, 'space.icon', 0), - top: GetValue$1j(config, 'space.iconTop', 0), - bottom: GetValue$1j(config, 'space.iconBottom', 0), - left: GetValue$1j(config, 'space.iconLeft', 0) + right: GetValue$1h(config, 'space.icon', 0), + top: GetValue$1h(config, 'space.iconTop', 0), + bottom: GetValue$1h(config, 'space.iconBottom', 0), + left: GetValue$1h(config, 'space.iconLeft', 0) }; } } else { if (text || action) { padding = { - bottom: GetValue$1j(config, 'space.icon', 0), - left: GetValue$1j(config, 'space.iconLeft', 0), - right: GetValue$1j(config, 'space.iconRight', 0), - top: GetValue$1j(config, 'space.iconTop', 0) + bottom: GetValue$1h(config, 'space.icon', 0), + left: GetValue$1h(config, 'space.iconLeft', 0), + right: GetValue$1h(config, 'space.iconRight', 0), + top: GetValue$1h(config, 'space.iconTop', 0) }; } } - var fitRatio = GetValue$1j(config, 'squareFitIcon', false) ? 1 : 0; + var fitRatio = GetValue$1h(config, 'squareFitIcon', false) ? 1 : 0; _this.add(icon, { proportion: 0, padding: padding, @@ -11906,14 +11932,14 @@ } if (!fitRatio) { - var iconSize = GetValue$1j(config, 'iconSize', undefined); - _this.setIconSize(GetValue$1j(config, 'iconWidth', iconSize), GetValue$1j(config, 'iconHeight', iconSize)); + var iconSize = GetValue$1h(config, 'iconSize', undefined); + _this.setIconSize(GetValue$1h(config, 'iconWidth', iconSize), GetValue$1h(config, 'iconHeight', iconSize)); } } if (text) { - var textSpace = GetValue$1j(config, 'space.text', 0); - var expandTextWidth = GetValue$1j(config, 'expandTextWidth', false); - var expandTextHeight = GetValue$1j(config, 'expandTextHeight', false); + var textSpace = GetValue$1h(config, 'space.text', 0); + var expandTextWidth = GetValue$1h(config, 'expandTextWidth', false); + var expandTextHeight = GetValue$1h(config, 'expandTextHeight', false); var proportion, padding, expand; if (_this.orientation === 0) { proportion = expandTextWidth ? 1 : 0; @@ -11942,18 +11968,18 @@ var padding; if (_this.orientation === 0) { padding = { - top: GetValue$1j(config, 'space.actionTop', 0), - bottom: GetValue$1j(config, 'space.actionBottom', 0), - right: GetValue$1j(config, 'space.actionRight', 0) + top: GetValue$1h(config, 'space.actionTop', 0), + bottom: GetValue$1h(config, 'space.actionBottom', 0), + right: GetValue$1h(config, 'space.actionRight', 0) }; } else { padding = { - left: GetValue$1j(config, 'space.actionLeft', 0), - right: GetValue$1j(config, 'space.actionRight', 0), - bottom: GetValue$1j(config, 'space.actionBottom', 0) + left: GetValue$1h(config, 'space.actionLeft', 0), + right: GetValue$1h(config, 'space.actionRight', 0), + bottom: GetValue$1h(config, 'space.actionBottom', 0) }; } - var fitRatio = GetValue$1j(config, 'squareFitAction', false) ? 1 : 0; + var fitRatio = GetValue$1h(config, 'squareFitAction', false) ? 1 : 0; _this.add(action, { proportion: 0, padding: padding, @@ -11964,8 +11990,8 @@ } if (!fitRatio) { - var actionSize = GetValue$1j(config, 'actionSize'); - _this.setActionSize(GetValue$1j(config, 'actionWidth', actionSize), GetValue$1j(config, 'actionHeight', actionSize)); + var actionSize = GetValue$1h(config, 'actionSize'); + _this.setActionSize(GetValue$1h(config, 'actionWidth', actionSize), GetValue$1h(config, 'actionHeight', actionSize)); } } @@ -12112,7 +12138,7 @@ return target; }; - var GetValue$1i = Phaser.Utils.Objects.GetValue; + var GetValue$1g = Phaser.Utils.Objects.GetValue; var RoundRectangle$2 = /*#__PURE__*/function () { function RoundRectangle(x, y, width, height, radiusConfig) { _classCallCheck(this, RoundRectangle); @@ -12213,14 +12239,14 @@ defaultRadiusX = value; defaultRadiusY = value; } else { - defaultRadiusX = GetValue$1i(value, 'x', 0); - defaultRadiusY = GetValue$1i(value, 'y', 0); + defaultRadiusX = GetValue$1g(value, 'x', 0); + defaultRadiusY = GetValue$1g(value, 'y', 0); } var radius = this.cornerRadius; - radius.tl = GetRadius(GetValue$1i(value, 'tl', undefined), defaultRadiusX, defaultRadiusY); - radius.tr = GetRadius(GetValue$1i(value, 'tr', undefined), defaultRadiusX, defaultRadiusY); - radius.bl = GetRadius(GetValue$1i(value, 'bl', undefined), defaultRadiusX, defaultRadiusY); - radius.br = GetRadius(GetValue$1i(value, 'br', undefined), defaultRadiusX, defaultRadiusY); + radius.tl = GetRadius(GetValue$1g(value, 'tl', undefined), defaultRadiusX, defaultRadiusY); + radius.tr = GetRadius(GetValue$1g(value, 'tr', undefined), defaultRadiusX, defaultRadiusY); + radius.bl = GetRadius(GetValue$1g(value, 'bl', undefined), defaultRadiusX, defaultRadiusY); + radius.br = GetRadius(GetValue$1g(value, 'br', undefined), defaultRadiusX, defaultRadiusY); } }, { key: "radiusTL", @@ -12281,8 +12307,8 @@ radius.x = value; radius.y = value; } else { - radius.x = GetValue$1i(value, 'x', 0); - radius.y = GetValue$1i(value, 'y', 0); + radius.x = GetValue$1g(value, 'x', 0); + radius.y = GetValue$1g(value, 'y', 0); } SetConvex(radius); }; @@ -12483,7 +12509,7 @@ var Shape$1 = Phaser.GameObjects.Shape; var IsPlainObject$i = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1h = Phaser.Utils.Objects.GetValue; + var GetValue$1f = Phaser.Utils.Objects.GetValue; var Earcut$1 = Phaser.Geom.Polygon.Earcut; var RoundRectangle$1 = /*#__PURE__*/function (_Shape) { _inherits(RoundRectangle, _Shape); @@ -12528,7 +12554,7 @@ _this = _super.call(this, scene, 'rexRoundRectangleShape', geom); _this.setShapeType(shapeType); if (_this.shapeType === 0) { - var radius = GetValue$1h(radiusConfig, 'radius', radiusConfig); + var radius = GetValue$1f(radiusConfig, 'radius', radiusConfig); geom.setTo(0, 0, width, height, radius); } else { var radius = { @@ -12537,7 +12563,7 @@ }; geom.setTo(0, 0, width, height, radius); } - var iteration = GetValue$1h(radiusConfig, 'iteration', undefined); + var iteration = GetValue$1f(radiusConfig, 'iteration', undefined); _this.setIteration(iteration); _this.setPosition(x, y); _this.setFillStyle(fillColor, fillAlpha); @@ -12940,7 +12966,7 @@ return out; }; - var GetValue$1g = Phaser.Utils.Objects.GetValue; + var GetValue$1e = Phaser.Utils.Objects.GetValue; var StyleManager = /*#__PURE__*/function (_ComponentBase) { _inherits(StyleManager, _ComponentBase); var _super = _createSuper(StyleManager); @@ -12950,12 +12976,12 @@ _this = _super.call(this, gameObject, config); // this.parent = gameObject; - _this.style = GetValue$1g(config, 'style', _assertThisInitialized(_this)); - var propertiesMap = GetValue$1g(config, 'propertiesMap'); + _this.style = GetValue$1e(config, 'style', _assertThisInitialized(_this)); + var propertiesMap = GetValue$1e(config, 'propertiesMap'); _this.activeStyle = ExtractStyle(config, 'active', propertiesMap); _this.hoverStyle = ExtractStyle(config, 'hover', propertiesMap); _this.disableStyle = ExtractStyle(config, 'disable', propertiesMap); - _this.onModifyStyle = GetValue$1g(config, 'onModifyStyle'); + _this.onModifyStyle = GetValue$1e(config, 'onModifyStyle'); return _this; } _createClass(StyleManager, [{ @@ -14867,7 +14893,7 @@ }(ComponentBase); var PhaserNineSlice = Phaser.GameObjects.NineSlice; - var GetValue$1f = Phaser.Utils.Objects.GetValue; + var GetValue$1d = Phaser.Utils.Objects.GetValue; var StatesNineSlice = /*#__PURE__*/function (_PhaserNineSlice) { _inherits(StatesNineSlice, _PhaserNineSlice); var _super = _createSuper(StatesNineSlice); @@ -14877,19 +14903,19 @@ if (config === undefined) { config = {}; } - var x = GetValue$1f(config, 'x', 0); - var y = GetValue$1f(config, 'y', 0); - var key = GetValue$1f(config, 'key', null); - var frame = GetValue$1f(config, 'frame', null); - var width = GetValue$1f(config, 'width', 0); - var height = GetValue$1f(config, 'height', 0); - var leftWidth = GetValue$1f(config, 'leftWidth', 0); - var rightWidth = GetValue$1f(config, 'rightWidth', 0); - var topHeight = GetValue$1f(config, 'topHeight', 0); - var bottomHeight = GetValue$1f(config, 'bottomHeight', 0); + var x = GetValue$1d(config, 'x', 0); + var y = GetValue$1d(config, 'y', 0); + var key = GetValue$1d(config, 'key', null); + var frame = GetValue$1d(config, 'frame', null); + var width = GetValue$1d(config, 'width', 0); + var height = GetValue$1d(config, 'height', 0); + var leftWidth = GetValue$1d(config, 'leftWidth', 0); + var rightWidth = GetValue$1d(config, 'rightWidth', 0); + var topHeight = GetValue$1d(config, 'topHeight', 0); + var bottomHeight = GetValue$1d(config, 'bottomHeight', 0); _this = _super.call(this, scene, x, y, key, frame, width, height, leftWidth, rightWidth, topHeight, bottomHeight); _this.type = 'rexStatesNineSlice'; - var effectConfig = GetValue$1f(config, 'effects', true); + var effectConfig = GetValue$1d(config, 'effects', true); if (effectConfig) { AddEffectProperties(_assertThisInitialized(_this), effectConfig); } @@ -14964,7 +14990,7 @@ }(ComponentBase); var PhaserImage = Phaser.GameObjects.Image; - var GetValue$1e = Phaser.Utils.Objects.GetValue; + var GetValue$1c = Phaser.Utils.Objects.GetValue; var StatesImage = /*#__PURE__*/function (_PhaserImage) { _inherits(StatesImage, _PhaserImage); var _super = _createSuper(StatesImage); @@ -14974,13 +15000,13 @@ if (config === undefined) { config = {}; } - var x = GetValue$1e(config, 'x', 0); - var y = GetValue$1e(config, 'y', 0); - var key = GetValue$1e(config, 'key', ''); - var frame = GetValue$1e(config, 'frame', undefined); + var x = GetValue$1c(config, 'x', 0); + var y = GetValue$1c(config, 'y', 0); + var key = GetValue$1c(config, 'key', ''); + var frame = GetValue$1c(config, 'frame', undefined); _this = _super.call(this, scene, x, y, key, frame); _this.type = 'rexStatesImage'; - var effectConfig = GetValue$1e(config, 'effects', true); + var effectConfig = GetValue$1c(config, 'effects', true); if (effectConfig) { AddEffectProperties(_assertThisInitialized(_this), effectConfig); } @@ -15217,11 +15243,11 @@ }; var IsPlainObject$h = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1d = Phaser.Utils.Objects.GetValue; + var GetValue$1b = Phaser.Utils.Objects.GetValue; var SetStretchMode = function SetStretchMode(mode) { if (IsPlainObject$h(mode)) { - this.stretchMode.edge = parseMode(GetValue$1d(mode, 'edge', 0)); - this.stretchMode.internal = parseMode(GetValue$1d(mode, 'internal', 0)); + this.stretchMode.edge = parseMode(GetValue$1b(mode, 'edge', 0)); + this.stretchMode.internal = parseMode(GetValue$1b(mode, 'internal', 0)); } else { mode = parseMode(mode); this.stretchMode.edge = mode; @@ -15280,7 +15306,7 @@ }; var IsPlainObject$g = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1c = Phaser.Utils.Objects.GetValue; + var GetValue$1a = Phaser.Utils.Objects.GetValue; var NinePatchBase = function NinePatchBase(GOClass, type) { var NinePatch = /*#__PURE__*/function (_GOClass) { _inherits(NinePatch, _GOClass); @@ -15290,53 +15316,53 @@ _classCallCheck(this, NinePatch); if (IsPlainObject$g(x)) { config = x; - x = GetValue$1c(config, 'x', 0); - y = GetValue$1c(config, 'y', 0); - width = GetValue$1c(config, 'width', 1); - height = GetValue$1c(config, 'height', 1); - key = GetValue$1c(config, 'key', undefined); - baseFrame = GetValue$1c(config, 'baseFrame', undefined); - columns = GetValue$1c(config, 'columns', undefined); - rows = GetValue$1c(config, 'rows', undefined); + x = GetValue$1a(config, 'x', 0); + y = GetValue$1a(config, 'y', 0); + width = GetValue$1a(config, 'width', 1); + height = GetValue$1a(config, 'height', 1); + key = GetValue$1a(config, 'key', undefined); + baseFrame = GetValue$1a(config, 'baseFrame', undefined); + columns = GetValue$1a(config, 'columns', undefined); + rows = GetValue$1a(config, 'rows', undefined); } else if (IsPlainObject$g(width)) { config = width; - width = GetValue$1c(config, 'width', 1); - height = GetValue$1c(config, 'height', 1); - key = GetValue$1c(config, 'key', undefined); - baseFrame = GetValue$1c(config, 'baseFrame', undefined); - columns = GetValue$1c(config, 'columns', undefined); - rows = GetValue$1c(config, 'rows', undefined); + width = GetValue$1a(config, 'width', 1); + height = GetValue$1a(config, 'height', 1); + key = GetValue$1a(config, 'key', undefined); + baseFrame = GetValue$1a(config, 'baseFrame', undefined); + columns = GetValue$1a(config, 'columns', undefined); + rows = GetValue$1a(config, 'rows', undefined); } else if (IsPlainObject$g(key)) { config = key; - key = GetValue$1c(config, 'key', undefined); - baseFrame = GetValue$1c(config, 'baseFrame', undefined); - columns = GetValue$1c(config, 'columns', undefined); - rows = GetValue$1c(config, 'rows', undefined); + key = GetValue$1a(config, 'key', undefined); + baseFrame = GetValue$1a(config, 'baseFrame', undefined); + columns = GetValue$1a(config, 'columns', undefined); + rows = GetValue$1a(config, 'rows', undefined); } else if (IsPlainObject$g(baseFrame)) { config = baseFrame; - baseFrame = GetValue$1c(config, 'baseFrame', undefined); - columns = GetValue$1c(config, 'columns', undefined); - rows = GetValue$1c(config, 'rows', undefined); + baseFrame = GetValue$1a(config, 'baseFrame', undefined); + columns = GetValue$1a(config, 'columns', undefined); + rows = GetValue$1a(config, 'rows', undefined); } else if (Array.isArray(baseFrame)) { config = rows; rows = columns; columns = baseFrame; - baseFrame = GetValue$1c(config, 'baseFrame', undefined); + baseFrame = GetValue$1a(config, 'baseFrame', undefined); } else if (IsPlainObject$g(columns)) { config = columns; - columns = GetValue$1c(config, 'columns', undefined); - rows = GetValue$1c(config, 'rows', undefined); + columns = GetValue$1a(config, 'columns', undefined); + rows = GetValue$1a(config, 'rows', undefined); } if (columns === undefined) { - var leftWidth = GetValue$1c(config, 'leftWidth', undefined); - var rightWidth = GetValue$1c(config, 'rightWidth', undefined); + var leftWidth = GetValue$1a(config, 'leftWidth', undefined); + var rightWidth = GetValue$1a(config, 'rightWidth', undefined); if (leftWidth !== undefined && rightWidth !== undefined) { columns = [leftWidth, undefined, rightWidth]; } } if (rows === undefined) { - var topHeight = GetValue$1c(config, 'topHeight', undefined); - var bottomHeight = GetValue$1c(config, 'bottomHeight', undefined); + var topHeight = GetValue$1a(config, 'topHeight', undefined); + var bottomHeight = GetValue$1a(config, 'bottomHeight', undefined); if (topHeight !== undefined && bottomHeight !== undefined) { rows = [topHeight, undefined, bottomHeight]; } @@ -15350,12 +15376,12 @@ _this._tileSprite = undefined; // Reserved for drawing image _this._image = undefined; // Reserved for drawing image - _this.setGetFrameNameCallback(GetValue$1c(config, 'getFrameNameCallback', undefined)); - _this.setStretchMode(GetValue$1c(config, 'stretchMode', 0)); - _this.setPreserveRatio(GetValue$1c(config, 'preserveRatio', true)); - var maxFixedPartScale = GetValue$1c(config, 'maxFixedPartScale', 1); - var maxFixedPartScaleX = GetValue$1c(config, 'maxFixedPartScaleX', maxFixedPartScale); - var maxFixedPartScaleY = GetValue$1c(config, 'maxFixedPartScaleY', undefined); + _this.setGetFrameNameCallback(GetValue$1a(config, 'getFrameNameCallback', undefined)); + _this.setStretchMode(GetValue$1a(config, 'stretchMode', 0)); + _this.setPreserveRatio(GetValue$1a(config, 'preserveRatio', true)); + var maxFixedPartScale = GetValue$1a(config, 'maxFixedPartScale', 1); + var maxFixedPartScaleX = GetValue$1a(config, 'maxFixedPartScaleX', maxFixedPartScale); + var maxFixedPartScaleY = GetValue$1a(config, 'maxFixedPartScaleY', undefined); _this.setMaxFixedPartScale(maxFixedPartScaleX, maxFixedPartScaleY); _this.setBaseTexture(key, baseFrame, columns, rows); return _this; @@ -15483,7 +15509,7 @@ }; var PhaserText = Phaser.GameObjects.Text; - var GetValue$1b = Phaser.Utils.Objects.GetValue; + var GetValue$19 = Phaser.Utils.Objects.GetValue; var StatesText = /*#__PURE__*/function (_PhaserText) { _inherits(StatesText, _PhaserText); var _super = _createSuper(StatesText); @@ -15493,9 +15519,9 @@ if (config === undefined) { config = {}; } - var x = GetValue$1b(config, 'x', 0); - var y = GetValue$1b(config, 'y', 0); - var text = GetValue$1b(config, 'text', ''); + var x = GetValue$19(config, 'x', 0); + var y = GetValue$19(config, 'y', 0); + var text = GetValue$19(config, 'text', ''); _this = _super.call(this, scene, x, y, text, config); _this.type = 'rexStatesText'; config.style = _this.style; @@ -16030,7 +16056,7 @@ }; var GetAdvancedValue = Phaser.Utils.Objects.GetAdvancedValue; - var GetValue$1a = Phaser.Utils.Objects.GetValue; + var GetValue$18 = Phaser.Utils.Objects.GetValue; var TextStyle$1 = /*#__PURE__*/function () { function TextStyle(text, style, propertyMap) { _classCallCheck(this, TextStyle); @@ -16133,7 +16159,7 @@ var postCallback = prop[2]; if (key === 'wrapCallback' || key === 'wrapCallbackScope') { // Callback & scope should be set without processing the values - this[key] = GetValue$1a(style, objKey, defaultValue); + this[key] = GetValue$18(style, objKey, defaultValue); } else { var value = GetAdvancedValue(style, objKey, defaultValue); if (postCallback) { @@ -16144,7 +16170,7 @@ } // Allow for 'font' override - var font = GetValue$1a(style, 'font', null); + var font = GetValue$18(style, 'font', null); if (font === null) { this._font = this.fontStyle + ' ' + this.fontSize + ' ' + this.fontFamily; } else { @@ -16152,19 +16178,19 @@ } // Allow for 'fill' to be used in place of 'color' - var fill = GetValue$1a(style, 'fill', null); + var fill = GetValue$18(style, 'fill', null); if (fill !== null) { this.color = GetStyle(fill); } - var metrics = GetValue$1a(style, 'metrics', false); + var metrics = GetValue$18(style, 'metrics', false); // Provide optional TextMetrics in the style object to avoid the canvas look-up / scanning // Doing this is reset if you then change the font of this TextStyle after creation if (metrics) { this.metrics = { - ascent: GetValue$1a(metrics, 'ascent', 0), - descent: GetValue$1a(metrics, 'descent', 0), - fontSize: GetValue$1a(metrics, 'fontSize', 0) + ascent: GetValue$18(metrics, 'ascent', 0), + descent: GetValue$18(metrics, 'descent', 0), + fontSize: GetValue$18(metrics, 'fontSize', 0) }; } else if (updateText || !this.metrics) { this.metrics = MeasureText(this); @@ -16233,9 +16259,9 @@ this.fontSize = ''; this.fontStyle = ''; } else { - this.fontFamily = GetValue$1a(font, 'fontFamily', 'Courier'); - this.fontSize = GetValue$1a(font, 'fontSize', '16px'); - this.fontStyle = GetValue$1a(font, 'fontStyle', ''); + this.fontFamily = GetValue$18(font, 'fontFamily', 'Courier'); + this.fontSize = GetValue$18(font, 'fontSize', '16px'); + this.fontStyle = GetValue$18(font, 'fontStyle', ''); } return this.update(true); } @@ -16586,9 +16612,9 @@ this.fontSize = ''; this.fontStyle = ''; } else { - this.fontFamily = GetValue$1a(font, 'fontFamily', this.fontFamily); - this.fontSize = GetValue$1a(font, 'fontSize', this.fontSize); - this.fontStyle = GetValue$1a(font, 'fontStyle', this.fontStyle); + this.fontFamily = GetValue$18(font, 'fontFamily', this.fontFamily); + this.fontSize = GetValue$18(font, 'fontSize', this.fontSize); + this.fontStyle = GetValue$18(font, 'fontStyle', this.fontStyle); } } return this.parent.updateText(true); @@ -16974,7 +17000,7 @@ } }; - var GetValue$19 = Phaser.Utils.Objects.GetValue; + var GetValue$17 = Phaser.Utils.Objects.GetValue; var NO_NEWLINE$3 = CONST.NO_NEWLINE; var RAW_NEWLINE$1 = CONST.RAW_NEWLINE; var Pen = /*#__PURE__*/function () { @@ -16987,17 +17013,17 @@ key: "resetFromJSON", value: function resetFromJSON(o) { // (txt, x, y, width, prop, newLineMode, startIndex) - this.text = GetValue$19(o, 'text', ''); - this.x = GetValue$19(o, 'x', 0); - this.y = GetValue$19(o, 'y', 0); - this.width = GetValue$19(o, 'width', 0); - var prop = GetValue$19(o, 'prop', null); + this.text = GetValue$17(o, 'text', ''); + this.x = GetValue$17(o, 'x', 0); + this.y = GetValue$17(o, 'y', 0); + this.width = GetValue$17(o, 'width', 0); + var prop = GetValue$17(o, 'prop', null); if (prop === null) { prop = {}; } this.prop = prop; - this.newLineMode = GetValue$19(o, 'newLineMode', 0); - this.startIndex = GetValue$19(o, 'startIndex', 0); + this.newLineMode = GetValue$17(o, 'newLineMode', 0); + this.startIndex = GetValue$17(o, 'startIndex', 0); } }, { key: "plainText", @@ -17629,7 +17655,7 @@ return retLines; }; - var GetValue$18 = Phaser.Utils.Objects.GetValue; + var GetValue$16 = Phaser.Utils.Objects.GetValue; var NO_WRAP = CONST.NO_WRAP; var NO_NEWLINE = CONST.NO_NEWLINE; var CanvasText = /*#__PURE__*/function () { @@ -17637,10 +17663,10 @@ _classCallCheck(this, CanvasText); this.parent = config.parent; this.scene = this.parent.scene; - this.context = GetValue$18(config, 'context', null); + this.context = GetValue$16(config, 'context', null); this.canvas = this.context.canvas; - this.parser = GetValue$18(config, 'parser', null); - this.defaultStyle = GetValue$18(config, 'style', null); + this.parser = GetValue$16(config, 'parser', null); + this.defaultStyle = GetValue$16(config, 'style', null); this.autoRound = true; this.pensPool = config.pensPool; // Required this.linesPool = config.linesPool; // Required @@ -17977,7 +18003,7 @@ }(Stack); var IsPlainObject$f = Phaser.Utils.Objects.IsPlainObject; - var GetValue$17 = Phaser.Utils.Objects.GetValue; + var GetValue$15 = Phaser.Utils.Objects.GetValue; var AddImage = function AddImage(key, config) { if (IsPlainObject$f(key)) { config = key; @@ -18012,11 +18038,11 @@ frame: frameKey, width: width, height: height, - y: GetValue$17(config, 'y', 0), - left: GetValue$17(config, 'left', 0), - right: GetValue$17(config, 'right', 0), - originX: GetValue$17(config, 'originX', 0), - originY: GetValue$17(config, 'originY', 0) + y: GetValue$15(config, 'y', 0), + left: GetValue$15(config, 'left', 0), + right: GetValue$15(config, 'right', 0), + originX: GetValue$15(config, 'originX', 0), + originY: GetValue$15(config, 'originY', 0) }; }; @@ -18154,7 +18180,7 @@ var AddToDOM = Phaser.DOM.AddToDOM; var CanvasPool$1 = Phaser.Display.Canvas.CanvasPool; var GameObject$2 = Phaser.GameObjects.GameObject; - var GetValue$16 = Phaser.Utils.Objects.GetValue; + var GetValue$14 = Phaser.Utils.Objects.GetValue; var RemoveFromDOM = Phaser.DOM.RemoveFromDOM; var SPLITREGEXP = CONST.SPLITREGEXP; @@ -18170,10 +18196,10 @@ _classCallCheck(this, Text); if (IsPlainObject$e(x)) { var config = x; - x = GetValue$16(config, 'x', 0); - y = GetValue$16(config, 'y', 0); - text = GetValue$16(config, 'text', ''); - style = GetValue$16(config, 'style'); + x = GetValue$14(config, 'x', 0); + y = GetValue$14(config, 'y', 0); + text = GetValue$14(config, 'text', ''); + style = GetValue$14(config, 'style'); } if (x === undefined) { x = 0; @@ -18205,7 +18231,7 @@ } } _this.style = new TextStyle$1(_assertThisInitialized(_this), style); - var imageData = GetValue$16(style, 'images', undefined); + var imageData = GetValue$14(style, 'images', undefined); if (imageData) { _this.addImage(imageData); } @@ -18240,7 +18266,7 @@ _this.renderer.deleteTexture(_this.frame.source.glTexture); _this.frame.source.glTexture = null; } - var sharedPoolMode = GetValue$16(style, 'sharedPool', true); + var sharedPoolMode = GetValue$14(style, 'sharedPool', true); var pensPool, linesPool, wrapTextLinesPool; if (sharedPoolMode) { // Use pools first time @@ -18282,8 +18308,8 @@ _this.setPadding(style.padding); } _this.setText(text); - _this.setUrlTagCursorStyle(GetValue$16(style, 'urlTagCursorStyle', 'pointer')); - if (GetValue$16(style, 'interactive', false)) { + _this.setUrlTagCursorStyle(GetValue$14(style, 'urlTagCursorStyle', 'pointer')); + if (GetValue$14(style, 'interactive', false)) { _this.setInteractive(); } return _this; @@ -18392,21 +18418,21 @@ var config = left; // If they specify x and/or y this applies to all - var x = GetValue$16(config, 'x', null); + var x = GetValue$14(config, 'x', null); if (x !== null) { left = x; right = x; } else { - left = GetValue$16(config, 'left', 0); - right = GetValue$16(config, 'right', left); + left = GetValue$14(config, 'left', 0); + right = GetValue$14(config, 'right', left); } - var y = GetValue$16(config, 'y', null); + var y = GetValue$14(config, 'y', null); if (y !== null) { top = y; bottom = y; } else { - top = GetValue$16(config, 'top', 0); - bottom = GetValue$16(config, 'bottom', top); + top = GetValue$14(config, 'top', 0); + bottom = GetValue$14(config, 'bottom', top); } } else { if (left === undefined) { @@ -19148,11 +19174,11 @@ return Object.assign({}, TagRegexSave); }; - var GetValue$15 = Phaser.Utils.Objects.GetValue; + var GetValue$13 = Phaser.Utils.Objects.GetValue; var Parser = /*#__PURE__*/function () { function Parser(style) { _classCallCheck(this, Parser); - var delimiters = GetValue$15(style, 'delimiters', '[]'); + var delimiters = GetValue$13(style, 'delimiters', '[]'); this.tagRegex = GetTagRegex(delimiters); this.delimiters = delimiters; } @@ -19204,12 +19230,12 @@ return BBCodeText; }(Text); - var GetValue$14 = Phaser.Utils.Objects.GetValue; + var GetValue$12 = Phaser.Utils.Objects.GetValue; var PhaserBitmapText = Phaser.GameObjects.BitmapText; var CreateText = function CreateText(scene, config) { - var type = GetValue$14(config, '$type'); + var type = GetValue$12(config, '$type'); if (type === undefined) { - if (!!GetValue$14(config, 'key')) { + if (!!GetValue$12(config, 'key')) { type = 'bitmaptext'; } } @@ -19217,13 +19243,13 @@ switch (type) { case 'bitmaptext': case 'bitmap': - var key = GetValue$14(config, 'key'); - var size = GetValue$14(config, 'size'); + var key = GetValue$12(config, 'key'); + var size = GetValue$12(config, 'size'); if (size === undefined) { - size = GetValue$14(config, 'fontSize'); + size = GetValue$12(config, 'fontSize'); } gameObject = new PhaserBitmapText(scene, 0, 0, key, '', size); - var color = GetValue$14(config, 'color'); + var color = GetValue$12(config, 'color'); if (color !== undefined) { gameObject.setTint(color); } @@ -19605,7 +19631,7 @@ }, getData: function getData(key, defaultValue) { this.enableData(); - return key === undefined ? this.data : GetValue$1I(this.data, key, defaultValue); + return key === undefined ? this.data : GetValue$1G(this.data, key, defaultValue); }, incData: function incData(key, inc, defaultValue) { if (defaultValue === undefined) { @@ -19873,7 +19899,7 @@ var DegToRad$3 = Phaser.Math.DegToRad; var RadToDeg$1 = Phaser.Math.RadToDeg; - var GetValue$13 = Phaser.Utils.Objects.GetValue; + var GetValue$11 = Phaser.Utils.Objects.GetValue; var RenderBase = /*#__PURE__*/function (_Base) { _inherits(RenderBase, _Base); var _super = _createSuper(RenderBase); @@ -20173,10 +20199,10 @@ } // ScaleX, ScaleY - var width = GetValue$13(o, 'width', undefined); - var height = GetValue$13(o, 'height', undefined); - var scaleX = GetValue$13(o, 'scaleX', undefined); - var scaleY = GetValue$13(o, 'scaleY', undefined); + var width = GetValue$11(o, 'width', undefined); + var height = GetValue$11(o, 'height', undefined); + var scaleX = GetValue$11(o, 'scaleX', undefined); + var scaleY = GetValue$11(o, 'scaleY', undefined); if (width !== undefined) { if (height === undefined && scaleY === undefined) { this.setWidth(width, true); @@ -20308,7 +20334,7 @@ } }; - var GetValue$12 = Phaser.Utils.Objects.GetValue; + var GetValue$10 = Phaser.Utils.Objects.GetValue; var Background = /*#__PURE__*/function (_RenderBase) { _inherits(Background, _RenderBase); var _super = _createSuper(Background); @@ -20317,9 +20343,9 @@ _classCallCheck(this, Background); _this = _super.call(this, parent, 'background'); _this.setScrollFactor(0); - _this.setColor(GetValue$12(config, 'color', null), GetValue$12(config, 'color2', null), GetValue$12(config, 'horizontalGradient', true)); - _this.setStroke(GetValue$12(config, 'stroke', null), GetValue$12(config, 'strokeThickness', 2)); - _this.setCornerRadius(GetValue$12(config, 'cornerRadius', 0), GetValue$12(config, 'cornerIteration', null)); + _this.setColor(GetValue$10(config, 'color', null), GetValue$10(config, 'color2', null), GetValue$10(config, 'horizontalGradient', true)); + _this.setStroke(GetValue$10(config, 'stroke', null), GetValue$10(config, 'strokeThickness', 2)); + _this.setCornerRadius(GetValue$10(config, 'cornerRadius', 0), GetValue$10(config, 'cornerIteration', null)); return _this; } _createClass(Background, [{ @@ -20448,7 +20474,7 @@ return Background; }(RenderBase); - var GetValue$11 = Phaser.Utils.Objects.GetValue; + var GetValue$$ = Phaser.Utils.Objects.GetValue; var InnerBounds = /*#__PURE__*/function (_RenderBase) { _inherits(InnerBounds, _RenderBase); var _super = _createSuper(InnerBounds); @@ -20457,8 +20483,8 @@ _classCallCheck(this, InnerBounds); _this = _super.call(this, parent, 'innerbounds'); _this.setScrollFactor(0); - _this.setColor(GetValue$11(config, 'color', null), GetValue$11(config, 'color2', null), GetValue$11(config, 'horizontalGradient', true)); - _this.setStroke(GetValue$11(config, 'stroke', null), GetValue$11(config, 'strokeThickness', 2)); + _this.setColor(GetValue$$(config, 'color', null), GetValue$$(config, 'color2', null), GetValue$$(config, 'horizontalGradient', true)); + _this.setStroke(GetValue$$(config, 'stroke', null), GetValue$$(config, 'strokeThickness', 2)); return _this; } _createClass(InnerBounds, [{ @@ -20537,10 +20563,10 @@ value: function modifyPorperties(o) { _get(_getPrototypeOf(InnerBounds.prototype), "modifyPorperties", this).call(this, o); if (o.hasOwnProperty('color')) { - this.setColor(o.color, GetValue$11(o, 'color2', null), GetValue$11(o, 'horizontalGradient', true)); + this.setColor(o.color, GetValue$$(o, 'color2', null), GetValue$$(o, 'horizontalGradient', true)); } if (o.hasOwnProperty('stroke')) { - this.setStroke(o.stroke, GetValue$11(o, 'strokeThickness', 2)); + this.setStroke(o.stroke, GetValue$$(o, 'strokeThickness', 2)); } } }, { @@ -20580,7 +20606,7 @@ return InnerBounds; }(RenderBase); - var GetValue$10 = Phaser.Utils.Objects.GetValue; + var GetValue$_ = Phaser.Utils.Objects.GetValue; var TextStyle = /*#__PURE__*/function () { function TextStyle(parent, config) { _classCallCheck(this, TextStyle); @@ -20614,19 +20640,19 @@ }, { key: "set", value: function set(o) { - this.setBold(GetValue$10(o, 'bold', false)); - this.setItalic(GetValue$10(o, 'italic', false)); - this.setFontSize(GetValue$10(o, 'fontSize', '16px')); - this.setFontFamily(GetValue$10(o, 'fontFamily', 'Courier')); - this.setColor(GetValue$10(o, 'color', '#fff')); - this.setStrokeStyle(GetValue$10(o, 'stroke', null), GetValue$10(o, 'strokeThickness', 0)); - this.setShadow(GetValue$10(o, 'shadowColor', null), GetValue$10(o, 'shadowOffsetX', 0), GetValue$10(o, 'shadowOffsetY', 0), GetValue$10(o, 'shadowBlur', 0)); - this.setOffset(GetValue$10(o, 'offsetX', 0), GetValue$10(o, 'offsetY', 0)); - this.setSpace(GetValue$10(o, 'leftSpace', 0), GetValue$10(o, 'rightSpace', 0)); - this.setAlign(GetValue$10(o, 'align', undefined)); - this.setBackgroundColor(GetValue$10(o, 'backgroundColor', null)); - this.setBackgroundHeight(GetValue$10(o, 'backgroundHeight', undefined)); - this.setBackgroundBottomY(GetValue$10(o, 'backgroundBottomY', undefined)); + this.setBold(GetValue$_(o, 'bold', false)); + this.setItalic(GetValue$_(o, 'italic', false)); + this.setFontSize(GetValue$_(o, 'fontSize', '16px')); + this.setFontFamily(GetValue$_(o, 'fontFamily', 'Courier')); + this.setColor(GetValue$_(o, 'color', '#fff')); + this.setStrokeStyle(GetValue$_(o, 'stroke', null), GetValue$_(o, 'strokeThickness', 0)); + this.setShadow(GetValue$_(o, 'shadowColor', null), GetValue$_(o, 'shadowOffsetX', 0), GetValue$_(o, 'shadowOffsetY', 0), GetValue$_(o, 'shadowBlur', 0)); + this.setOffset(GetValue$_(o, 'offsetX', 0), GetValue$_(o, 'offsetY', 0)); + this.setSpace(GetValue$_(o, 'leftSpace', 0), GetValue$_(o, 'rightSpace', 0)); + this.setAlign(GetValue$_(o, 'align', undefined)); + this.setBackgroundColor(GetValue$_(o, 'backgroundColor', null)); + this.setBackgroundHeight(GetValue$_(o, 'backgroundHeight', undefined)); + this.setBackgroundBottomY(GetValue$_(o, 'backgroundBottomY', undefined)); return this; } }, { @@ -22003,22 +22029,22 @@ }; var Result = {}; - var GetValue$$ = Phaser.Utils.Objects.GetValue; + var GetValue$Z = Phaser.Utils.Objects.GetValue; var RunWordWrap$1 = function RunWordWrap(config) { // Parse parameters - var startIndex = GetValue$$(config, 'start', 0); - SetPadding$1(this.wrapPadding, GetValue$$(config, 'padding', 0)); + var startIndex = GetValue$Z(config, 'start', 0); + SetPadding$1(this.wrapPadding, GetValue$Z(config, 'padding', 0)); var paddingVertical = this.padding.top + this.padding.bottom + this.wrapPadding.top + this.wrapPadding.bottom; var paddingHorizontal = this.padding.left + this.padding.right + this.wrapPadding.left + this.wrapPadding.right; // Get lineHeight, maxLines - var lineHeight = GetValue$$(config, 'lineHeight'); - var ascent = GetValue$$(config, 'ascent', lineHeight); + var lineHeight = GetValue$Z(config, 'lineHeight'); + var ascent = GetValue$Z(config, 'ascent', lineHeight); var maxLines; if (lineHeight === undefined) { // Calculate lineHeight - var useDefaultTextHeight = GetValue$$(config, 'useDefaultTextHeight', false); - maxLines = GetValue$$(config, 'maxLines', 0); + var useDefaultTextHeight = GetValue$Z(config, 'useDefaultTextHeight', false); + maxLines = GetValue$Z(config, 'maxLines', 0); if (this.fixedHeight > 0 && !useDefaultTextHeight) { var innerHeight = this.fixedHeight - paddingVertical; if (maxLines > 0) { @@ -22040,13 +22066,13 @@ // Calculate maxLines if (this.fixedHeight > 0) { // Calculate maxLines via lineHeight, in fixedHeight mode - maxLines = GetValue$$(config, 'maxLines'); + maxLines = GetValue$Z(config, 'maxLines'); if (maxLines === undefined) { var innerHeight = this.fixedHeight - paddingVertical; maxLines = Math.floor(innerHeight / lineHeight); } } else { - maxLines = GetValue$$(config, 'maxLines', 0); // Default is show all lines + maxLines = GetValue$Z(config, 'maxLines', 0); // Default is show all lines } } @@ -22057,7 +22083,7 @@ var showAllLines = maxLines === 0; // Get wrapWidth - var wrapWidth = GetValue$$(config, 'wrapWidth', undefined); + var wrapWidth = GetValue$Z(config, 'wrapWidth', undefined); if (wrapWidth === undefined) { if (this.fixedWidth > 0) { wrapWidth = this.fixedWidth - paddingHorizontal; @@ -22066,10 +22092,10 @@ } } - var letterSpacing = GetValue$$(config, 'letterSpacing', 0); - var hAlign = GetValue$$(config, 'hAlign', 0); - var vAlign = GetValue$$(config, 'vAlign', 0); - var charWrap = GetValue$$(config, 'charWrap', false); + var letterSpacing = GetValue$Z(config, 'letterSpacing', 0); + var hAlign = GetValue$Z(config, 'hAlign', 0); + var vAlign = GetValue$Z(config, 'vAlign', 0); + var charWrap = GetValue$Z(config, 'charWrap', false); var result = CreateWrapResultData({ // Override properties callback: 'runWordWrap', @@ -22257,18 +22283,18 @@ } }; - var GetValue$_ = Phaser.Utils.Objects.GetValue; + var GetValue$Y = Phaser.Utils.Objects.GetValue; var RunVerticalWrap$1 = function RunVerticalWrap(config) { // Parse parameters - var startIndex = GetValue$_(config, 'start', 0); - SetPadding$1(this.wrapPadding, GetValue$_(config, 'padding', 0)); + var startIndex = GetValue$Y(config, 'start', 0); + SetPadding$1(this.wrapPadding, GetValue$Y(config, 'padding', 0)); var paddingVertical = this.padding.top + this.padding.bottom + this.wrapPadding.top + this.wrapPadding.bottom; var paddingHorizontal = this.padding.left + this.padding.right + this.wrapPadding.left + this.wrapPadding.right; - var lineWidth = GetValue$_(config, 'lineWidth', undefined); + var lineWidth = GetValue$Y(config, 'lineWidth', undefined); var maxLines; if (lineWidth === undefined) { // Calculate lineWidth via maxLines, in fixedWidth mode - maxLines = GetValue$_(config, 'maxLines', 0); + maxLines = GetValue$Y(config, 'maxLines', 0); if (this.fixedWidth > 0) { var innerWidth = this.fixedWidth - paddingHorizontal; lineWidth = innerWidth / maxLines; @@ -22278,22 +22304,22 @@ } else { if (this.fixedWidth > 0) { // Calculate maxLines via lineWidth, in fixedWidth mode - maxLines = GetValue$_(config, 'maxLines', undefined); + maxLines = GetValue$Y(config, 'maxLines', undefined); if (maxLines === undefined) { var innerWidth = this.fixedWidth - paddingHorizontal; maxLines = Math.floor(innerWidth / lineWidth) + 1; } } else { - maxLines = GetValue$_(config, 'maxLines', 0); // Default is show all lines + maxLines = GetValue$Y(config, 'maxLines', 0); // Default is show all lines } } var showAllLines = maxLines === 0; // Get fixedCharacterHeight - var fixedCharacterHeight = GetValue$_(config, 'fixedCharacterHeight', undefined); + var fixedCharacterHeight = GetValue$Y(config, 'fixedCharacterHeight', undefined); if (fixedCharacterHeight === undefined) { - var charPerLine = GetValue$_(config, 'charPerLine', undefined); + var charPerLine = GetValue$Y(config, 'charPerLine', undefined); if (charPerLine !== undefined) { var innerHeight = this.fixedHeight - paddingVertical; fixedCharacterHeight = Math.floor(innerHeight / charPerLine); @@ -22301,7 +22327,7 @@ } // Get wrapHeight - var wrapHeight = GetValue$_(config, 'wrapHeight', undefined); + var wrapHeight = GetValue$Y(config, 'wrapHeight', undefined); if (wrapHeight === undefined) { if (this.fixedHeight > 0) { wrapHeight = this.fixedHeight - paddingVertical; @@ -22310,10 +22336,10 @@ } } - var letterSpacing = GetValue$_(config, 'letterSpacing', 0); - var rtl = GetValue$_(config, 'rtl', true); - var hAlign = GetValue$_(config, 'hAlign', rtl ? 2 : 0); - var vAlign = GetValue$_(config, 'vAlign', 0); + var letterSpacing = GetValue$Y(config, 'letterSpacing', 0); + var rtl = GetValue$Y(config, 'rtl', true); + var hAlign = GetValue$Y(config, 'hAlign', rtl ? 2 : 0); + var vAlign = GetValue$Y(config, 'vAlign', 0); var result = CreateWrapResultData({ // Override properties callback: 'runVerticalWrap', @@ -22445,11 +22471,11 @@ return RunVerticalWrap$1.call(this, Merge(config, this.wrapConfig)); }; - var GetValue$Z = Phaser.Utils.Objects.GetValue; + var GetValue$X = Phaser.Utils.Objects.GetValue; var RunWrap = function RunWrap(config) { - var wrapCallback = GetValue$Z(this.wrapConfig, 'callback'); + var wrapCallback = GetValue$X(this.wrapConfig, 'callback'); if (!wrapCallback) { - wrapCallback = GetValue$Z(config, 'callback', this.runWordWrap); + wrapCallback = GetValue$X(config, 'callback', this.runWordWrap); } if (typeof wrapCallback === 'string') { wrapCallback = this[wrapCallback]; @@ -22996,7 +23022,7 @@ }(); var IsPlainObject$d = Phaser.Utils.Objects.IsPlainObject; - var GetValue$Y = Phaser.Utils.Objects.GetValue; + var GetValue$W = Phaser.Utils.Objects.GetValue; var DynamicText = /*#__PURE__*/function (_Canvas) { _inherits(DynamicText, _Canvas); var _super = _createSuper(DynamicText); @@ -23005,14 +23031,14 @@ _classCallCheck(this, DynamicText); if (IsPlainObject$d(x)) { config = x; - x = GetValue$Y(config, 'x', 0); - y = GetValue$Y(config, 'y', 0); - fixedWidth = GetValue$Y(config, 'width', 0); - fixedHeight = GetValue$Y(config, 'height', 0); + x = GetValue$W(config, 'x', 0); + y = GetValue$W(config, 'y', 0); + fixedWidth = GetValue$W(config, 'width', 0); + fixedHeight = GetValue$W(config, 'height', 0); } else if (IsPlainObject$d(fixedWidth)) { config = fixedWidth; - fixedWidth = GetValue$Y(config, 'width', 0); - fixedHeight = GetValue$Y(config, 'height', 0); + fixedWidth = GetValue$W(config, 'width', 0); + fixedHeight = GetValue$W(config, 'height', 0); } var width = fixedWidth === 0 ? 1 : fixedWidth; var height = fixedHeight === 0 ? 1 : fixedHeight; @@ -23021,23 +23047,23 @@ _this.autoRound = true; _this.padding = SetPadding$1(); _this.wrapPadding = SetPadding$1(); - var textStyleConfig = GetValue$Y(config, 'style', undefined); + var textStyleConfig = GetValue$W(config, 'style', undefined); _this.defaultTextStyle = new TextStyle(null, textStyleConfig); _this.textStyle = _this.defaultTextStyle.clone(); - _this.setTestString(GetValue$Y(config, 'testString', '|MÉqgy')); + _this.setTestString(GetValue$W(config, 'testString', '|MÉqgy')); _this._textOX = 0; _this._textOY = 0; - _this.background = new Background(_assertThisInitialized(_this), GetValue$Y(config, 'background', undefined)); - _this.innerBounds = new InnerBounds(_assertThisInitialized(_this), GetValue$Y(config, 'innerBounds', undefined)); + _this.background = new Background(_assertThisInitialized(_this), GetValue$W(config, 'background', undefined)); + _this.innerBounds = new InnerBounds(_assertThisInitialized(_this), GetValue$W(config, 'innerBounds', undefined)); _this.children = []; _this.lastAppendedChildren = []; _this.lastOverChild = null; _this.poolManager = new PoolManager(config); _this.setFixedSize(fixedWidth, fixedHeight); - _this.setPadding(GetValue$Y(config, 'padding', 0)); - _this.setWrapConfig(GetValue$Y(config, 'wrap', undefined)); - _this.setChildrenInteractiveEnable(GetValue$Y(config, 'childrenInteractive', false)); - var text = GetValue$Y(config, 'text', undefined); + _this.setPadding(GetValue$W(config, 'padding', 0)); + _this.setWrapConfig(GetValue$W(config, 'wrap', undefined)); + _this.setChildrenInteractiveEnable(GetValue$W(config, 'childrenInteractive', false)); + var text = GetValue$W(config, 'text', undefined); if (text) { _this.setText(text); } @@ -23158,20 +23184,20 @@ return gameObject; }; - var GetValue$X = Phaser.Utils.Objects.GetValue; + var GetValue$V = Phaser.Utils.Objects.GetValue; var BuildLabelConfig = function BuildLabelConfig(scene, config, creators) { config = config ? DeepClone(config) : {}; - var createBackground = GetValue$X(creators, 'background', CreateBackground$1); - var createText = GetValue$X(creators, 'text', CreateText); - var createIcon = GetValue$X(creators, 'icon', CreateImage); - var createAction = GetValue$X(creators, 'action', CreateImage); + var createBackground = GetValue$V(creators, 'background', CreateBackground$1); + var createText = GetValue$V(creators, 'text', CreateText); + var createIcon = GetValue$V(creators, 'icon', CreateImage); + var createAction = GetValue$V(creators, 'action', CreateImage); if (createBackground) { config.background = createBackground(scene, config.background); } else { delete config.background; } if (createText) { - var wrapText = GetValue$X(config, 'wrapText', false); + var wrapText = GetValue$V(config, 'wrapText', false); if (wrapText) { if (wrapText === true) { wrapText = 'word'; @@ -24245,7 +24271,7 @@ Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha; - var GetValue$W = Phaser.Utils.Objects.GetValue; + var GetValue$U = Phaser.Utils.Objects.GetValue; var RoundRectangle = /*#__PURE__*/function (_PathBase) { _inherits(RoundRectangle, _PathBase); var _super = _createSuper(RoundRectangle); @@ -24407,10 +24433,10 @@ this.radiusBL = value; this.radiusBR = value; } else { - this.radiusTL = GetValue$W(value, 'tl', 0); - this.radiusTR = GetValue$W(value, 'tr', 0); - this.radiusBL = GetValue$W(value, 'bl', 0); - this.radiusBR = GetValue$W(value, 'br', 0); + this.radiusTL = GetValue$U(value, 'tl', 0); + this.radiusTR = GetValue$U(value, 'tr', 0); + this.radiusBL = GetValue$U(value, 'bl', 0); + this.radiusBR = GetValue$U(value, 'br', 0); } } }, { @@ -24694,7 +24720,7 @@ } }; - var GetValue$V = Phaser.Utils.Objects.GetValue; + var GetValue$T = Phaser.Utils.Objects.GetValue; var IsPlainObject$c = Phaser.Utils.Objects.IsPlainObject; var DegToRad = Phaser.Math.DegToRad; var RadToDeg = Phaser.Math.RadToDeg; @@ -24841,21 +24867,21 @@ var config = left; // If they specify x and/or y this applies to all - var x = GetValue$V(config, 'x', null); + var x = GetValue$T(config, 'x', null); if (x !== null) { left = x; right = x; } else { - left = GetValue$V(config, 'left', 0); - right = GetValue$V(config, 'right', left); + left = GetValue$T(config, 'left', 0); + right = GetValue$T(config, 'right', left); } - var y = GetValue$V(config, 'y', null); + var y = GetValue$T(config, 'y', null); if (y !== null) { top = y; bottom = y; } else { - top = GetValue$V(config, 'top', 0); - bottom = GetValue$V(config, 'bottom', top); + top = GetValue$T(config, 'top', 0); + bottom = GetValue$T(config, 'bottom', top); } } else { if (left === undefined) { @@ -25106,7 +25132,7 @@ } }; - var GetValue$U = Phaser.Utils.Objects.GetValue; + var GetValue$S = Phaser.Utils.Objects.GetValue; var Folder$1 = /*#__PURE__*/function (_Sizer) { _inherits(Folder, _Sizer); var _super = _createSuper(Folder); @@ -25134,15 +25160,15 @@ // title var defaultAlign = _this.orientation === 1 ? 'left' : 'top'; - var align = GetValue$U(config, 'align.title', defaultAlign); - var expand = GetValue$U(config, 'expand.title', true); + var align = GetValue$S(config, 'align.title', defaultAlign); + var expand = GetValue$S(config, 'expand.title', true); _this.add(title, { proportion: 0, align: align, expand: expand }); - var toggleByTarget = GetValue$U(config, 'toggleByTarget', undefined); - var toggleClickConfig = GetValue$U(config, 'toggleClickConfig'); + var toggleByTarget = GetValue$S(config, 'toggleByTarget', undefined); + var toggleClickConfig = GetValue$S(config, 'toggleClickConfig'); if (toggleByTarget === undefined) { toggleByTarget = title; } @@ -25154,13 +25180,13 @@ // child _this.childTransition = new Transition(child); - var customOrigin = GetValue$U(config, 'customChildOrigin', false); + var customOrigin = GetValue$S(config, 'customChildOrigin', false); if (!customOrigin) { var origin = !_this.rtl ? 0 : 1; child.setOrigin(origin); } - var align = GetValue$U(config, 'align.child', 'left'); - var expand = GetValue$U(config, 'expand.child', true); + var align = GetValue$S(config, 'align.child', 'left'); + var expand = GetValue$S(config, 'expand.child', true); var proportion = expand ? 1 : 0; _this.add(child, { proportion: proportion, @@ -25171,10 +25197,10 @@ _this.addChildrenMap('child', child); _this.addChildrenMap('background', background); var transitionConfig = config.transition; - _this.setTransitionDuration(GetValue$U(transitionConfig, 'duration', 200)); - _this.setExpandCallback(GetValue$U(transitionConfig, 'expandCallback', undefined)); - _this.setCollapseCallback(GetValue$U(transitionConfig, 'collapseCallback', undefined)); - _this.reLayoutTarget = GetValue$U(config, 'reLayoutTarget', undefined); + _this.setTransitionDuration(GetValue$S(transitionConfig, 'duration', 200)); + _this.setExpandCallback(GetValue$S(transitionConfig, 'expandCallback', undefined)); + _this.setCollapseCallback(GetValue$S(transitionConfig, 'collapseCallback', undefined)); + _this.reLayoutTarget = GetValue$S(config, 'reLayoutTarget', undefined); var onExpandStart = config.onExpandStart; if (onExpandStart) { _this.on('expand.start', onExpandStart); @@ -25241,10 +25267,10 @@ }(Folder$1); Object.assign(Folder.prototype, BindingTargetMethods$2, InputRowTitleWidthMethods$1); - var GetValue$T = Phaser.Utils.Objects.GetValue; + var GetValue$R = Phaser.Utils.Objects.GetValue; var CreateFolder = function CreateFolder(scene, config, style) { // Create Folder-title - var titleStyle = GetValue$T(style, 'title') || {}; + var titleStyle = GetValue$R(style, 'title') || {}; var title = new FolderTitle(scene, titleStyle); scene.add.existing(title); title.on('folder.expand', function () { @@ -25253,12 +25279,12 @@ title.setExpandedState(false); }); var tweakerConfig = { - root: GetValue$T(style, 'root'), - styles: GetValue$T(style, 'tweaker'), - space: GetValue$T(style, 'space') || {} + root: GetValue$R(style, 'root'), + styles: GetValue$R(style, 'tweaker'), + space: GetValue$R(style, 'space') || {} }; var child = CreateTweaker(scene, tweakerConfig); - var backgroundStyle = GetValue$T(style, 'background'); + var backgroundStyle = GetValue$R(style, 'background'); var background = CreateBackground(scene, config, backgroundStyle); var folder = new Folder(scene, { orientation: 1, @@ -25266,19 +25292,19 @@ child: child, background: background, transition: { - duration: GetValue$T(style, 'transition.duration', 200) + duration: GetValue$R(style, 'transition.duration', 200) } }); scene.add.existing(folder); return folder; }; - var GetValue$S = Phaser.Utils.Objects.GetValue; + var GetValue$Q = Phaser.Utils.Objects.GetValue; var AddFolder = function AddFolder(config) { var scene = this.scene; // Create folder - var folderStyle = GetValue$S(this.styles, 'folder') || {}; + var folderStyle = GetValue$Q(this.styles, 'folder') || {}; folderStyle.tweaker = this.styles; folderStyle.root = this.root; var folder = CreateFolder(scene, config, folderStyle); @@ -25292,7 +25318,7 @@ // Set content folder.setTitle(config); - var expanded = GetValue$S(config, 'expanded', true); + var expanded = GetValue$Q(config, 'expanded', true); if (expanded) { folder.expand(0); } else { @@ -25561,13 +25587,13 @@ } }; - var GetValue$R = Phaser.Utils.Objects.GetValue; + var GetValue$P = Phaser.Utils.Objects.GetValue; var ButtonsTypeMethods = { setButtonsType: function setButtonsType(config) { if (config === undefined) { config = {}; } - var buttonsType = GetValue$R(config, 'buttonsType', config.type); + var buttonsType = GetValue$P(config, 'buttonsType', config.type); this.buttonsType = buttonsType; if (!this.buttonsType) { return this; @@ -25575,11 +25601,11 @@ // Assign this.setValueCallback, this.setValueCallbackScope var setValueCallback, setValueCallbackScope; - setValueCallback = GetValue$R(config, 'setValueCallback', undefined); - setValueCallbackScope = GetValue$R(config, 'setValueCallbackScope', undefined); + setValueCallback = GetValue$P(config, 'setValueCallback', undefined); + setValueCallbackScope = GetValue$P(config, 'setValueCallbackScope', undefined); if (setValueCallback === undefined) { - setValueCallback = GetValue$R(config, 'setButtonStateCallback', undefined); - setValueCallbackScope = GetValue$R(config, 'setButtonStateCallbackScope', undefined); + setValueCallback = GetValue$P(config, 'setButtonStateCallback', undefined); + setValueCallbackScope = GetValue$P(config, 'setButtonStateCallbackScope', undefined); } this.setValueCallback = setValueCallback; this.setValueCallbackScope = setValueCallbackScope; @@ -25880,7 +25906,7 @@ } }; - var GetValue$Q = Phaser.Utils.Objects.GetValue; + var GetValue$O = Phaser.Utils.Objects.GetValue; var Buttons$1 = /*#__PURE__*/function (_Sizer) { _inherits(Buttons, _Sizer); var _super = _createSuper(Buttons); @@ -25902,18 +25928,18 @@ _this.type = 'rexButtons'; _this.buttonGroup = new ButtonGroup({ parent: _assertThisInitialized(_this), - eventEmitter: GetValue$Q(config, 'eventEmitter', _assertThisInitialized(_this)), - groupName: GetValue$Q(config, 'groupName', undefined), - clickConfig: GetValue$Q(config, 'click', undefined) + eventEmitter: GetValue$O(config, 'eventEmitter', _assertThisInitialized(_this)), + groupName: GetValue$O(config, 'groupName', undefined), + clickConfig: GetValue$O(config, 'click', undefined) }).setButtonsType(config); // Add elements - var background = GetValue$Q(config, 'background', undefined); - var buttons = GetValue$Q(config, 'buttons', undefined); + var background = GetValue$O(config, 'background', undefined); + var buttons = GetValue$O(config, 'buttons', undefined); // Buttons properties - _this.buttonsExpand = GetValue$Q(config, 'expand', false); - _this.buttonsAlign = GetValue$Q(config, 'align', undefined); // undefined/left/top: no space + _this.buttonsExpand = GetValue$O(config, 'expand', false); + _this.buttonsAlign = GetValue$O(config, 'align', undefined); // undefined/left/top: no space if (background) { _this.addBackground(background); @@ -26223,7 +26249,7 @@ }; var IsPlainObject$b = Phaser.Utils.Objects.IsPlainObject; - var GetValue$P = Phaser.Utils.Objects.GetValue; + var GetValue$N = Phaser.Utils.Objects.GetValue; var ALIGN_CENTER$2 = Phaser.Display.Align.CENTER; var Add$5 = function Add(gameObject, paddingConfig, childKey, index) { if (gameObject === '\n') { @@ -26233,9 +26259,9 @@ AddChild$2.call(this, gameObject); if (IsPlainObject$b(paddingConfig)) { var config = paddingConfig; - paddingConfig = GetValue$P(config, 'padding', 0); - childKey = GetValue$P(config, 'key', undefined); - index = GetValue$P(config, 'index', undefined); + paddingConfig = GetValue$N(config, 'padding', 0); + childKey = GetValue$N(config, 'key', undefined); + index = GetValue$N(config, 'index', undefined); } if (paddingConfig === undefined) { paddingConfig = 0; @@ -26351,7 +26377,7 @@ }; var IsPlainObject$a = Phaser.Utils.Objects.IsPlainObject; - var GetValue$O = Phaser.Utils.Objects.GetValue; + var GetValue$M = Phaser.Utils.Objects.GetValue; var FixWidthSizer = /*#__PURE__*/function (_BaseSizer) { _inherits(FixWidthSizer, _BaseSizer); var _super = _createSuper(FixWidthSizer); @@ -26360,26 +26386,26 @@ _classCallCheck(this, FixWidthSizer); if (IsPlainObject$a(x)) { config = x; - x = GetValue$O(config, 'x', 0); - y = GetValue$O(config, 'y', 0); - minWidth = GetValue$O(config, 'width', undefined); - minHeight = GetValue$O(config, 'height', undefined); + x = GetValue$M(config, 'x', 0); + y = GetValue$M(config, 'y', 0); + minWidth = GetValue$M(config, 'width', undefined); + minHeight = GetValue$M(config, 'height', undefined); } else if (IsPlainObject$a(minWidth)) { config = minWidth; - minWidth = GetValue$O(config, 'width', undefined); - minHeight = GetValue$O(config, 'height', undefined); + minWidth = GetValue$M(config, 'width', undefined); + minHeight = GetValue$M(config, 'height', undefined); } _this = _super.call(this, scene, x, y, minWidth, minHeight, config); _this.type = 'rexFixWidthSizer'; _this.sizerChildren = []; - _this.setOrientation(GetValue$O(config, 'orientation', 0)); - _this.setItemSpacing(GetValue$O(config, 'space.item', 0)); - _this.setLineSpacing(GetValue$O(config, 'space.line', 0)); - _this.setIntentLeft(GetValue$O(config, 'space.indentLeftOdd', 0), GetValue$O(config, 'space.indentLeftEven', 0)); - _this.setIntentTop(GetValue$O(config, 'space.indentTopOdd', 0), GetValue$O(config, 'space.indentTopEven', 0)); - _this.setAlign(GetValue$O(config, 'align', 0)); - _this.setJustifyPercentage(GetValue$O(config, 'justifyPercentage', 0.25)); - _this.setRTL(GetValue$O(config, 'rtl', false)); + _this.setOrientation(GetValue$M(config, 'orientation', 0)); + _this.setItemSpacing(GetValue$M(config, 'space.item', 0)); + _this.setLineSpacing(GetValue$M(config, 'space.line', 0)); + _this.setIntentLeft(GetValue$M(config, 'space.indentLeftOdd', 0), GetValue$M(config, 'space.indentLeftEven', 0)); + _this.setIntentTop(GetValue$M(config, 'space.indentTopOdd', 0), GetValue$M(config, 'space.indentTopEven', 0)); + _this.setAlign(GetValue$M(config, 'align', 0)); + _this.setJustifyPercentage(GetValue$M(config, 'justifyPercentage', 0.25)); + _this.setRTL(GetValue$M(config, 'rtl', false)); _this.addChildrenMap('items', _this.sizerChildren); return _this; } @@ -26557,7 +26583,7 @@ } }; - var GetValue$N = Phaser.Utils.Objects.GetValue; + var GetValue$L = Phaser.Utils.Objects.GetValue; var Buttons = /*#__PURE__*/function (_FixWidthSizer) { _inherits(Buttons, _FixWidthSizer); var _super = _createSuper(Buttons); @@ -26580,17 +26606,17 @@ _this.type = 'rexFixWidthButtons'; _this.buttonGroup = new ButtonGroup({ parent: _assertThisInitialized(_this), - eventEmitter: GetValue$N(config, 'eventEmitter', _assertThisInitialized(_this)), - groupName: GetValue$N(config, 'groupName', undefined), - clickConfig: GetValue$N(config, 'click', undefined) + eventEmitter: GetValue$L(config, 'eventEmitter', _assertThisInitialized(_this)), + groupName: GetValue$L(config, 'groupName', undefined), + clickConfig: GetValue$L(config, 'click', undefined) }).setButtonsType(config); // Add elements - var background = GetValue$N(config, 'background', undefined); - var buttons = GetValue$N(config, 'buttons', undefined); + var background = GetValue$L(config, 'background', undefined); + var buttons = GetValue$L(config, 'buttons', undefined); // Buttons properties - _this.buttonsAlign = GetValue$N(config, 'align', undefined); + _this.buttonsAlign = GetValue$L(config, 'align', undefined); if (background) { _this.addBackground(background); } @@ -26758,23 +26784,23 @@ }; var IsPlainObject$9 = Phaser.Utils.Objects.IsPlainObject; - var GetValue$M = Phaser.Utils.Objects.GetValue; + var GetValue$K = Phaser.Utils.Objects.GetValue; var ALIGN_CENTER$1 = Phaser.Display.Align.CENTER; var UUID$1 = Phaser.Utils.String.UUID; var Add$3 = function Add(gameObject, childKey, align, padding, expand, minWidth, minHeight, offsetX, offsetY) { AddChild$2.call(this, gameObject); if (IsPlainObject$9(childKey)) { var config = childKey; - childKey = GetValue$M(config, 'key', undefined); - align = GetValue$M(config, 'align', ALIGN_CENTER$1); - offsetX = GetValue$M(config, 'offsetX', 0); - offsetY = GetValue$M(config, 'offsetY', 0); - padding = GetValue$M(config, 'padding', 0); - expand = GetValue$M(config, 'expand', true); + childKey = GetValue$K(config, 'key', undefined); + align = GetValue$K(config, 'align', ALIGN_CENTER$1); + offsetX = GetValue$K(config, 'offsetX', 0); + offsetY = GetValue$K(config, 'offsetY', 0); + padding = GetValue$K(config, 'padding', 0); + expand = GetValue$K(config, 'expand', true); if (!gameObject.isRexSizer) { // Get minWidth,minHeight from config - minWidth = GetValue$M(config, 'minWidth', gameObject._minWidth); - minHeight = GetValue$M(config, 'minHeight', gameObject._minHeighted); + minWidth = GetValue$K(config, 'minWidth', gameObject._minWidth); + minHeight = GetValue$K(config, 'minHeight', gameObject._minHeighted); } } var hasValidKey = childKey !== undefined; @@ -26814,8 +26840,8 @@ config.alignOffsetY = offsetY; config.padding = GetBoundsConfig(padding); if (IsPlainObject$9(expand)) { - config.expandWidth = GetValue$M(expand, 'width', false); - config.expandHeight = GetValue$M(expand, 'height', false); + config.expandWidth = GetValue$K(expand, 'width', false); + config.expandHeight = GetValue$K(expand, 'height', false); } else { config.expandWidth = expand; config.expandHeight = expand; @@ -26909,7 +26935,7 @@ }; var IsPlainObject$8 = Phaser.Utils.Objects.IsPlainObject; - var GetValue$L = Phaser.Utils.Objects.GetValue; + var GetValue$J = Phaser.Utils.Objects.GetValue; var OverlapSizer = /*#__PURE__*/function (_BaseSizer) { _inherits(OverlapSizer, _BaseSizer); var _super = _createSuper(OverlapSizer); @@ -26918,14 +26944,14 @@ _classCallCheck(this, OverlapSizer); if (IsPlainObject$8(x)) { config = x; - x = GetValue$L(config, 'x', 0); - y = GetValue$L(config, 'y', 0); - minWidth = GetValue$L(config, 'width', undefined); - minHeight = GetValue$L(config, 'height', undefined); + x = GetValue$J(config, 'x', 0); + y = GetValue$J(config, 'y', 0); + minWidth = GetValue$J(config, 'width', undefined); + minHeight = GetValue$J(config, 'height', undefined); } else if (IsPlainObject$8(minWidth)) { config = minWidth; - minWidth = GetValue$L(config, 'width', undefined); - minHeight = GetValue$L(config, 'height', undefined); + minWidth = GetValue$J(config, 'width', undefined); + minHeight = GetValue$J(config, 'height', undefined); } _this = _super.call(this, scene, x, y, minWidth, minHeight, config); _this.type = 'rexOverlapSizer'; @@ -27015,7 +27041,7 @@ }; Object.assign(methods$9, AddChildMethods$1); - var GetValue$K = Phaser.Utils.Objects.GetValue; + var GetValue$I = Phaser.Utils.Objects.GetValue; var Pages = /*#__PURE__*/function (_OverlapSizer) { _inherits(Pages, _OverlapSizer); var _super = _createSuper(Pages); @@ -27027,8 +27053,8 @@ _this.childrenMap = _this.sizerChildren; _this._previousKey = undefined; _this._currentKey = undefined; - _this.setSwapMode(GetValue$K(config, 'swapMode', 0)); - _this.setFadeInDuration(GetValue$K(config, 'fadeIn', 0)); + _this.setSwapMode(GetValue$I(config, 'swapMode', 0)); + _this.setFadeInDuration(GetValue$I(config, 'fadeIn', 0)); return _this; } _createClass(Pages, [{ @@ -27102,14 +27128,14 @@ }; var IsPlainObject$7 = Phaser.Utils.Objects.IsPlainObject; - var GetValue$J = Phaser.Utils.Objects.GetValue; + var GetValue$H = Phaser.Utils.Objects.GetValue; var UUID = Phaser.Utils.String.UUID; var AddPage = function AddPage(key, tabGameObject, pageGameObject) { if (IsPlainObject$7(key)) { var config = key; - key = GetValue$J(config, 'key'); - tabGameObject = GetValue$J(config, 'tab'); - pageGameObject = GetValue$J(config, 'page'); + key = GetValue$H(config, 'key'); + tabGameObject = GetValue$H(config, 'tab'); + pageGameObject = GetValue$H(config, 'page'); } if (!key) { key = UUID(); @@ -27207,7 +27233,7 @@ }; Object.assign(methods$8, SwapPageMethods, RemovePageMethods); - var GetValue$I = Phaser.Utils.Objects.GetValue; + var GetValue$G = Phaser.Utils.Objects.GetValue; var SizerAdd = Sizer.prototype.add; var TabPages$1 = /*#__PURE__*/function (_Sizer) { _inherits(TabPages, _Sizer); @@ -27218,23 +27244,23 @@ if (config === undefined) { config = {}; } - var tabsPosition = GetValue$I(config, 'tabPosition', 'top'); + var tabsPosition = GetValue$G(config, 'tabPosition', 'top'); var sizerOrientation = tabsPosition === 'left' || tabsPosition === 'right' ? 'x' : 'y'; config.orientation = sizerOrientation; _this = _super.call(this, scene, config); _this.type = 'rexTabPages'; // Add elements - var background = GetValue$I(config, 'background', undefined); + var background = GetValue$G(config, 'background', undefined); if (background) { _this.addBackground(background); } - var pagesConfig = GetValue$I(config, 'pages'); + var pagesConfig = GetValue$G(config, 'pages'); var pages = new Pages(scene, pagesConfig); scene.add.existing(pages); var isHorizontalTabs = sizerOrientation === 'y'; - var wrapTabs = isHorizontalTabs ? GetValue$I(config, 'wrapTabs', false) : false; - var tabsConfig = GetValue$I(config, 'tabs', undefined); + var wrapTabs = isHorizontalTabs ? GetValue$G(config, 'wrapTabs', false) : false; + var tabsConfig = GetValue$G(config, 'tabs', undefined); if (tabsConfig === undefined) { tabsConfig = {}; } @@ -27243,8 +27269,8 @@ tabsConfig.buttonsType = 'radio'; var tabs = new ButtonsClass(scene, tabsConfig); scene.add.existing(tabs); - var tabsExpand = wrapTabs ? true : GetValue$I(config, 'expand.tabs', false); - var tabAlign = GetValue$I(config, 'align.tabs', 'left'); + var tabsExpand = wrapTabs ? true : GetValue$G(config, 'expand.tabs', false); + var tabAlign = GetValue$G(config, 'align.tabs', 'left'); switch (tabsPosition) { case 'top': case 'left': @@ -27412,16 +27438,16 @@ return gameObject; }; - var GetValue$H = Phaser.Utils.Objects.GetValue; + var GetValue$F = Phaser.Utils.Objects.GetValue; var CreateTab = function CreateTab(scene, config, style) { var tabPages = new TabPages(scene, style); scene.add.existing(tabPages); - var tabConfig = GetValue$H(style, 'tab'); + var tabConfig = GetValue$F(style, 'tab'); var tweakerConfig = { - root: GetValue$H(style, 'root'), - styles: GetValue$H(style, 'tweaker') + root: GetValue$F(style, 'root'), + styles: GetValue$F(style, 'tweaker') }; - var pages = GetValue$H(config, 'pages') || []; + var pages = GetValue$F(config, 'pages') || []; for (var i = 0, cnt = pages.length; i < cnt; i++) { var page = pages[i]; tabPages.addPage({ @@ -27440,12 +27466,12 @@ return tabPages; }; - var GetValue$G = Phaser.Utils.Objects.GetValue; + var GetValue$E = Phaser.Utils.Objects.GetValue; var AddTab = function AddTab(config) { var scene = this.scene; // Create tab - var tabStyle = GetValue$G(this.styles, 'tab') || {}; + var tabStyle = GetValue$E(this.styles, 'tab') || {}; tabStyle.tweaker = this.styles; tabStyle.root = this.root; var tab = CreateTab(scene, config, tabStyle); @@ -27456,7 +27482,7 @@ this.add(tab, { expand: true }); - var pagesConfig = GetValue$G(config, 'pages') || []; + var pagesConfig = GetValue$E(config, 'pages') || []; var pages = []; var shownPageIndex = 0; for (var i = 0, cnt = pagesConfig.length; i < cnt; i++) { @@ -27475,54 +27501,6 @@ return pages; }; - var StringType = 'string'; - var TextAreaType = 'textarea'; - var NumberType = 'number'; - var RangeType = 'range'; - var ListType = 'list'; - var ButtonsType = 'buttons'; - var BooleanType = 'boolean'; - var ToggleSwitchType = 'toggleSwitch'; - var ColorType = 'color'; - - var GetInputType = function GetInputType(object, key, config) { - // Force input type to view - if (config.view) { - return config.view; - } - if (config.options) { - return ListType; - } - if (!object) { - return StringType; - } - var value = object[key]; - switch (_typeof(value)) { - case 'number': - if (HasProperties(config, 'min', 'max')) { - return RangeType; - } - return NumberType; - case 'string': - return StringType; - case 'boolean': - return BooleanType; - default: - return StringType; - } - }; - var HasProperties = function HasProperties(object) { - for (var _len = arguments.length, keys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - keys[_key - 1] = arguments[_key]; - } - for (var i = 0, cnt = keys.length; i < cnt; i++) { - if (object[keys[i]] === undefined) { - return false; - } - } - return true; - }; - var BindingTargetMethods = { setupBinding: function setupBinding() { var inputField = this.childrenMap.inputField; @@ -27620,7 +27598,7 @@ } }; - var GetValue$F = Phaser.Utils.Objects.GetValue; + var GetValue$D = Phaser.Utils.Objects.GetValue; var InputRow = /*#__PURE__*/function (_Sizer) { _inherits(InputRow, _Sizer); var _super = _createSuper(InputRow); @@ -27635,8 +27613,8 @@ var inputTitle = config.inputTitle; var inputField = config.inputField; var background = config.background; - var proportion = GetValue$F(config, 'proportion.title', 0); - var titleSpace = GetValue$F(config, 'space.title', 0); + var proportion = GetValue$D(config, 'proportion.title', 0); + var titleSpace = GetValue$D(config, 'space.title', 0); var padding; if (_this.orientation === 0) { padding = { @@ -27653,7 +27631,7 @@ padding: padding }); var defaultProportion = config.parentOrientation === 1 ? 1 : 0; - var proportion = GetValue$F(config, 'proportion.inputField', defaultProportion); + var proportion = GetValue$D(config, 'proportion.inputField', defaultProportion); _this.add(inputField, { proportion: proportion, expand: true @@ -27704,241 +27682,596 @@ return gameObject; }; - var InputFiledBase = /*#__PURE__*/function (_Sizer) { - _inherits(InputFiledBase, _Sizer); - var _super = _createSuper(InputFiledBase); - function InputFiledBase() { - _classCallCheck(this, InputFiledBase); - return _super.apply(this, arguments); + var GenerateInputFieldClass = function GenerateInputFieldClass(BaseClass) { + if (BaseClass === undefined) { + BaseClass = Sizer; } - _createClass(InputFiledBase, [{ - key: "bindingTarget", - get: function get() { - return this.getParentSizer().bindingTarget; - } - }, { - key: "bindingKey", - get: function get() { - return this.getParentSizer().bindTargetKey; + var InputFiled = /*#__PURE__*/function (_BaseClass) { + _inherits(InputFiled, _BaseClass); + var _super = _createSuper(InputFiled); + function InputFiled() { + _classCallCheck(this, InputFiled); + return _super.apply(this, arguments); } - }, { - key: "value", - get: function get() { - return this._value; - }, - set: - // Override - function set(value) { - if (this._value === value) { - return; - } - var oldValue = this._value; - this._value = value; - if (!this.syncValueFlag) { - this.emit('valuechange', value, oldValue, this.bindingTarget, this.bindingKey); + _createClass(InputFiled, [{ + key: "bindingTarget", + get: function get() { + return this.getParentSizer().bindingTarget; } - } - }, { - key: "validate", - value: function validate(newValue) { - if (this.syncValueFlag || !this.validateCallback) { - return true; + }, { + key: "bindingKey", + get: function get() { + return this.getParentSizer().bindTargetKey; } - return this.validateCallback(newValue, this._value, this.bindingTarget, this.bindingKey); - } - }, { - key: "getValue", - value: function getValue() { - return this.value; - } - }, { - key: "setValue", - value: function setValue(value) { - this.value = value; - return this; - } - - /* - Internal method invoked when - - inputRow.setBindingTarget(target), or - - inputRow.syncTargetValue() - */ - }, { - key: "syncValue", - value: function syncValue(value) { - this.syncValueFlag = true; - this.value = value; - this.syncValueFlag = false; - return this; - } - - // Override - }, { - key: "readOnly", - get: function get() { - return this._readOnly; - } + }, { + key: "value", + get: function get() { + return this._value; + }, + set: function set(value) { + if (this._value === value) { + return; + } + if (!this.validate(value)) { + value = this._value; // Back to previous value + } - // Override - , - set: function set(value) { - this._readOnly = value; - } - }, { - key: "setReadOnly", - value: function setReadOnly(enable) { - if (enable === undefined) { - enable = true; + if (this.displayValueCallback) { + this.displayValueCallback(this, value); + } + if (this._value === value) { + return; + } + var oldValue = this._value; + this._value = value; + if (!this.syncValueFlag) { + this.emit('valuechange', value, oldValue, this.bindingTarget, this.bindingKey); + } + } + }, { + key: "validate", + value: function validate(newValue) { + if (this.syncValueFlag || !this.validateCallback) { + return true; + } + return this.validateCallback(newValue, this._value, this.bindingTarget, this.bindingKey); + } + }, { + key: "getFotmatText", + value: function getFotmatText(value) { + if (this.textFormatCallback) { + value = this.textFormatCallback(value); + } else { + value = value.toString(); + } + return value; + } + }, { + key: "getValue", + value: function getValue() { + return this.value; + } + }, { + key: "setValue", + value: function setValue(value) { + this.value = value; + return this; } - this.readOnly = enable; - return true; - } - }, { - key: "setTextFormatCallback", - value: function setTextFormatCallback(callback) { - this.textFormatCallback = callback; - return this; - } - }, { - key: "setValidateCallback", - value: function setValidateCallback(callback) { - this.validateCallback = callback; - return this; - } - }]); - return InputFiledBase; - }(Sizer); - - var ElementProperties = { - maxLength: ['maxLength', undefined], - minLength: ['minLength', undefined], - readOnly: ['readOnly', false] - }; - var StyleProperties = { - direction: ['direction', undefined] - }; - var CopyProperty = function CopyProperty(from, to, key) { - if (typeof key === 'string') { - if (from.hasOwnProperty(key)) { - to[key] = from[key]; - } - } else { - var keys = key; - if (Array.isArray(keys)) { - for (var i = 0, cnt = keys.length; i < cnt; i++) { - CopyProperty(from, to, keys[i]); + /* + Internal method invoked when + - inputRow.setBindingTarget(target), or + - inputRow.syncTargetValue() + */ + }, { + key: "syncValue", + value: function syncValue(value) { + this.syncValueFlag = true; + this.value = value; + this.syncValueFlag = false; + return this; } - } else { - for (var key in keys) { - CopyProperty(from, to, key); + }, { + key: "setup", + value: function setup(config, setDefaults) { + if (setDefaults === undefined) { + setDefaults = false; + } + if (setDefaults || config.hasOwnProperty('format')) { + this.setTextFormatCallback(config.format); + } + if (setDefaults || config.hasOwnProperty('onValidate')) { + this.setValidateCallback(config.onValidate); + } + if (this.setupCallback) { + this.setupCallback(this, config, setDefaults); + } + return this; + } + }, { + key: "setSetupCallback", + value: function setSetupCallback(callback) { + this.setupCallback = callback; + return this; + } + }, { + key: "setDisplayValueCallback", + value: function setDisplayValueCallback(callback) { + this.displayValueCallback = callback; + return this; + } + }, { + key: "setTextFormatCallback", + value: function setTextFormatCallback(callback) { + this.textFormatCallback = callback; + return this; + } + }, { + key: "setValidateCallback", + value: function setValidateCallback(callback) { + this.validateCallback = callback; + return this; } + }]); + return InputFiled; + }(BaseClass); + return InputFiled; + }; + + var CreateInputField = function CreateInputField(scene, config, style) { + var inputField; + var inputHandlers = this.inputHandlers; + for (var i = 0, cnt = inputHandlers.length; i < cnt; i++) { + var handler = inputHandlers[i]; + if (handler.accept(config)) { + var InputFieldClass = GenerateInputFieldClass(handler.baseClass); + inputField = new InputFieldClass(scene); + scene.add.existing(inputField); + inputField.setSetupCallback(handler.setup).setDisplayValueCallback(handler.displayValue); + handler.build(inputField, style); + break; } } + + // Setup by config + inputField.setup(config, true); + return inputField; }; - var CopyElementConfig = function CopyElementConfig(from) { - if (from === undefined) { - from = {}; - } - var to = {}; - CopyProperty(from, to, 'inputType'); - CopyProperty(from, to, 'type'); - CopyProperty(from, to, 'style'); - CopyProperty(from, to, StyleProperties); - CopyProperty(from, to, ElementProperties); - return to; + var GetValue$C = Phaser.Utils.Objects.GetValue; + var CreateInputRow = function CreateInputRow(scene, config, style) { + // Title + var titleStyle = GetValue$C(style, 'title') || {}; + var inputTitle = CreateTitleLabel(scene, config, titleStyle); + + // InputField + var inputField = CreateInputField.call(this, scene, config, style); + + // Background + var backgroundStyle = GetValue$C(style, 'background') || {}; + var background = CreateBackground$1(scene, backgroundStyle); + var inputRow = new InputRow(scene, _objectSpread2(_objectSpread2(_objectSpread2({}, config), style), {}, { + inputTitle: inputTitle, + inputField: inputField, + background: background + })); + scene.add.existing(inputRow); + inputRow.setTitle(config); + return inputRow; }; - var LastOpenedEditor = undefined; - var SetLastOpenedEditor = function SetLastOpenedEditor(editor) { - if (editor === LastOpenedEditor) { - return; + var AddInput = function AddInput(object, key, config) { + if (arguments.length === 1) { + config = object; + object = config.bindingTarget; + key = config.bindingKey; + } else { + if (config === undefined) { + config = {}; + } + config.bindingTarget = object; + config.bindingKey = key; } - if (LastOpenedEditor !== undefined) { - LastOpenedEditor.close(); + if (!config.title) { + config.title = key; } - LastOpenedEditor = editor; - }; - var CloseLastOpenEditor = function CloseLastOpenEditor(editor) { - if (editor !== LastOpenedEditor) { - return; + if (config.bindingTarget && config.bindingKey) { + config.value = config.bindingTarget[config.bindingKey]; + } else { + config.value = undefined; } - // Don't call `LastOpenedEditor.close()` - LastOpenedEditor = undefined; - }; + // Create InputRow + var inputRowStyle = this.styles.inputRow || {}; + inputRowStyle.parentOrientation = this.styles.orientation; + var inputSizer = CreateInputRow.call(this, this.scene, config, inputRowStyle); + var inputField = inputSizer.childrenMap.inputField; + var proportion; + if (this.orientation === 1) { + // y + proportion = 0; + } else { + // x + proportion = this.itemWidth > 0 ? 0 : 1; + inputSizer.setMinWidth(this.itemWidth); + } - var GetValue$E = Phaser.Utils.Objects.GetValue; - var SetProperties = function SetProperties(properties, config, out) { - if (out === undefined) { - out = {}; + // Add InputRow to Tweaker + this.add(inputSizer, { + proportion: proportion, + expand: true + }); + if (config.onValueChange) { + inputField.on('valuechange', config.onValueChange); } - var property, value; - for (var key in properties) { - property = properties[key]; // [propName, defaultValue] - value = GetValue$E(config, key, property[1]); - if (value !== undefined) { - out[property[0]] = value; - } + + // Bind target + inputSizer.setAutoUpdateEnable(config.autoUpdate); + inputSizer.setBindingTarget(object, key); + if (config.monitor) { + inputSizer.startMonitorTarget(); } - return out; + if (config.key) { + this.root.addChildrenMap(config.key, inputSizer); + } + return this; }; - var StopPropagationTouchEvents = function StopPropagationTouchEvents(element) { - // Don't propagate touch/mouse events to parent(game canvas) - element.addEventListener('touchstart', callback, false); - element.addEventListener('touchmove', callback, false); - element.addEventListener('touchend', callback, false); - element.addEventListener('mousedown', callback, false); - element.addEventListener('mouseup', callback, false); - element.addEventListener('mousemove', callback, false); - }; - var callback = function callback(e) { - e.stopPropagation(); + var CreateRoundRectangle = function CreateRoundRectangle(scene, config) { + var gameObject = new RoundRectangle$1(scene, config); + scene.add.existing(gameObject); + return gameObject; }; - var EnterClose = function EnterClose() { - this.close(); - this.emit('keydown-ENTER', this.parent, this); - return this; + var CreateButtons$2 = function CreateButtons(scene, config) { + var gameObject = new Buttons$1(scene, config); + scene.add.existing(gameObject); + return gameObject; }; - var OnOpen = function OnOpen() { - this.isOpened = true; - this.initText(); - if (this.enterCloseEnable) { - this.scene.input.keyboard.once('keydown-ENTER', EnterClose, this); - } + var GetValue$B = Phaser.Utils.Objects.GetValue; + var CreateButtons$1 = function CreateButtons(scene, config, style) { + // Title + var titleStyle = GetValue$B(style, 'title') || {}; + var title = CreateTitleLabel(scene, config, titleStyle); - // There is no cursor-position-change event, - // so updating cursor position every tick - this.scene.sys.events.on('postupdate', this.updateText, this); - this.scene.input.on('pointerdown', this.onClickOutside, this); - if (this.onOpenCallback) { - this.onOpenCallback(this.parent, this); + // Buttons + var buttonsConfig = config.buttons; + var buttonStyle = GetValue$B(style, 'button') || {}; + var buttons = []; + for (var i = 0, cnt = buttonsConfig.length; i < cnt; i++) { + var button = CreateLabel(scene, buttonStyle); + buttons.push(button); + var buttonConfig = buttonsConfig[i]; + button.resetDisplayContent({ + text: buttonConfig.label + }); + button.callback = buttonConfig.callback; } - this.emit('open', this); - }; + var buttonsSizer = CreateButtons$2(scene, { + buttons: buttons, + expand: buttons.length === 1 + }); - var RemoveElement = function RemoveElement(element) { - if (!element) { - return; - } - var parentElement = element.parentElement; - if (parentElement) { - parentElement.removeChild(element); - } - }; + // Background + var backgroundStyle = GetValue$B(style, 'background') || {}; + var background = CreateRoundRectangle(scene, backgroundStyle); - var OnClose = function OnClose() { - this.isOpened = false; - this.updateText(); - this.scene.sys.events.off('postupdate', this.updateText, this); - this.scene.input.off('pointerdown', this.onClickOutside, this); - if (this.onCloseCallback) { - this.onCloseCallback(this.parent, this); - } + // InputRow + var inputRow = new InputRow(scene, _objectSpread2(_objectSpread2({}, style), {}, { + inputTitle: title, + inputField: buttonsSizer, + background: background + })); + scene.add.existing(inputRow); + inputRow.setTitle(config); + buttonsSizer.on('button.click', function (button) { + button.callback(inputRow.bindingTarget); + }); + return inputRow; + }; + + var GetValue$A = Phaser.Utils.Objects.GetValue; + var AddButtons = function AddButtons(config) { + var scene = this.scene; + if (config === undefined) { + config = {}; + } + if (config.hasOwnProperty('label')) { + config.buttons = [{ + label: config.label, + callback: config.callback + }]; + delete config.label; + delete config.callback; + } + var target = config.bindingTarget; + delete config.bindingTarget; + + // Create buttons + var buttonsStyle = GetValue$A(this.styles, 'inputRow') || {}; + var buttons = CreateButtons$1(scene, config, buttonsStyle); + + // Add buttons + this.add(buttons, { + expand: true + }); + + // Set binding target + if (target) { + buttons.setBindingTarget(target); + } + if (config.key) { + this.root.addChildrenMap(config.key, buttons); + } + return this; + }; + + var GetValue$z = Phaser.Utils.Objects.GetValue; + var AddSeparator = function AddSeparator(config) { + var scene = this.scene; + + // Create separator + var separatorStyle = GetValue$z(this.styles, 'separator'); + var separator = CreateBackground(scene, config, separatorStyle); + + // Add separator + this.add(separator, { + expand: true + }); + return this; + }; + + var SetBindingTarget = function SetBindingTarget(target) { + var children = this.sizerChildren; + for (var i = 0, cnt = children.length; i < cnt; i++) { + var child = children[i]; + if (!child.setBindingTarget) { + continue; + } + child.setBindingTarget(target); + } + return this; + }; + + var GetMaxInputRowTitleWidth = function GetMaxInputRowTitleWidth() { + var maxTitleWidth = 0; + var children = this.sizerChildren; + for (var i = 0, cnt = children.length; i < cnt; i++) { + var child = children[i]; + if (child.rexSizer.hidden) { + continue; + } + if (child.getMinTitleWidth) { + // InputRow + maxTitleWidth = Math.max(maxTitleWidth, child.getMinTitleWidth()); + } else if (child.getMaxInputRowTitleWidth) { + // Folder, TabPages + maxTitleWidth = Math.max(maxTitleWidth, child.getMaxInputRowTitleWidth()); + } + } + return maxTitleWidth + this.getInnerPadding('left'); + }; + + var SetInputRowTitleWidth = function SetInputRowTitleWidth(width) { + width -= this.getInnerPadding('left'); + var children = this.sizerChildren; + for (var i = 0, cnt = children.length; i < cnt; i++) { + var child = children[i]; + if (child.rexSizer.hidden) { + continue; + } + if (child.setMinTitleWidth) { + // InputRow + child.setMinTitleWidth(width); + } else if (child.setInputRowTitleWidth) { + // Folder, TabPages + child.setInputRowTitleWidth(width); + } + } + return this; + }; + + var methods$7 = { + registerInputHandler: RegisterInputHandler, + removeInputHandler: RemoveInputHandler, + addFolder: AddFolder, + addTab: AddTab, + addInput: AddInput, + addButton: AddButtons, + addButtons: AddButtons, + addSeparator: AddSeparator, + setBindingTarget: SetBindingTarget, + getMaxInputRowTitleWidth: GetMaxInputRowTitleWidth, + setInputRowTitleWidth: SetInputRowTitleWidth + }; + + var GetValue$y = Phaser.Utils.Objects.GetValue; + var TweakerShell = /*#__PURE__*/function (_Sizer) { + _inherits(TweakerShell, _Sizer); + var _super = _createSuper(TweakerShell); + function TweakerShell(scene, config) { + var _this; + _classCallCheck(this, TweakerShell); + if (config === undefined) { + config = {}; + } + if (config.orientation === undefined) { + config.orientation = 1; + } + + // Create sizer + _this = _super.call(this, scene, config); + _this.type = 'rexTweakerShell'; + _this.root = config.root || _assertThisInitialized(_this); + _this.styles = GetValue$y(config, 'styles') || {}; + _this.styles.orientation = _this.orientation; + _this.itemWidth = GetValue$y(_this.styles, 'itemWidth', 0); + if (_this.root === _assertThisInitialized(_this) && _this.orientation === 1) { + var alignTitle = GetValue$y(config, 'inputRow.alignTitle'); + if (alignTitle === undefined) { + var titleProportion = GetValue$y(_this.styles, 'inputRow.proportion.title'); + alignTitle = !titleProportion; + } else { + if (alignTitle) { + // Override title proportion to 0 + SetValue(_this.styles, 'inputRow.proportion.title', 0); + } + } + _this.alignInputRowTitle = alignTitle; + } else { + _this.alignInputRowTitle = false; + _this.inputHandlers = _this.root.inputHandlers; + } + var background = CreateBackground(scene, undefined, config.background); + if (background) { + _this.addBackground(background); + } + return _this; + } + _createClass(TweakerShell, [{ + key: "preLayout", + value: function preLayout() { + _get(_getPrototypeOf(TweakerShell.prototype), "preLayout", this).call(this); + if (this.alignInputRowTitle) { + this.setInputRowTitleWidth(this.getMaxInputRowTitleWidth()); + } + } + }]); + return TweakerShell; + }(Sizer); + Object.assign(TweakerShell.prototype, methods$7); + + var ElementProperties = { + maxLength: ['maxLength', undefined], + minLength: ['minLength', undefined], + readOnly: ['readOnly', false] + }; + var StyleProperties = { + direction: ['direction', undefined] + }; + + var CopyProperty = function CopyProperty(from, to, key) { + if (typeof key === 'string') { + if (from.hasOwnProperty(key)) { + to[key] = from[key]; + } + } else { + var keys = key; + if (Array.isArray(keys)) { + for (var i = 0, cnt = keys.length; i < cnt; i++) { + CopyProperty(from, to, keys[i]); + } + } else { + for (var key in keys) { + CopyProperty(from, to, key); + } + } + } + }; + + var CopyElementConfig = function CopyElementConfig(from) { + if (from === undefined) { + from = {}; + } + var to = {}; + CopyProperty(from, to, 'inputType'); + CopyProperty(from, to, 'type'); + CopyProperty(from, to, 'style'); + CopyProperty(from, to, StyleProperties); + CopyProperty(from, to, ElementProperties); + return to; + }; + + var LastOpenedEditor = undefined; + var SetLastOpenedEditor = function SetLastOpenedEditor(editor) { + if (editor === LastOpenedEditor) { + return; + } + if (LastOpenedEditor !== undefined) { + LastOpenedEditor.close(); + } + LastOpenedEditor = editor; + }; + var CloseLastOpenEditor = function CloseLastOpenEditor(editor) { + if (editor !== LastOpenedEditor) { + return; + } + + // Don't call `LastOpenedEditor.close()` + LastOpenedEditor = undefined; + }; + + var GetValue$x = Phaser.Utils.Objects.GetValue; + var SetProperties = function SetProperties(properties, config, out) { + if (out === undefined) { + out = {}; + } + var property, value; + for (var key in properties) { + property = properties[key]; // [propName, defaultValue] + value = GetValue$x(config, key, property[1]); + if (value !== undefined) { + out[property[0]] = value; + } + } + return out; + }; + + var StopPropagationTouchEvents = function StopPropagationTouchEvents(element) { + // Don't propagate touch/mouse events to parent(game canvas) + element.addEventListener('touchstart', callback, false); + element.addEventListener('touchmove', callback, false); + element.addEventListener('touchend', callback, false); + element.addEventListener('mousedown', callback, false); + element.addEventListener('mouseup', callback, false); + element.addEventListener('mousemove', callback, false); + }; + var callback = function callback(e) { + e.stopPropagation(); + }; + + var EnterClose = function EnterClose() { + this.close(); + this.emit('keydown-ENTER', this.parent, this); + return this; + }; + + var OnOpen = function OnOpen() { + this.isOpened = true; + this.initText(); + if (this.enterCloseEnable) { + this.scene.input.keyboard.once('keydown-ENTER', EnterClose, this); + } + + // There is no cursor-position-change event, + // so updating cursor position every tick + this.scene.sys.events.on('postupdate', this.updateText, this); + this.scene.input.on('pointerdown', this.onClickOutside, this); + if (this.onOpenCallback) { + this.onOpenCallback(this.parent, this); + } + this.emit('open', this); + }; + + var RemoveElement = function RemoveElement(element) { + if (!element) { + return; + } + var parentElement = element.parentElement; + if (parentElement) { + parentElement.removeChild(element); + } + }; + + var OnClose = function OnClose() { + this.isOpened = false; + this.updateText(); + this.scene.sys.events.off('postupdate', this.updateText, this); + this.scene.input.off('pointerdown', this.onClickOutside, this); + if (this.onCloseCallback) { + this.onCloseCallback(this.parent, this); + } // Remove input text element when closing editor RemoveElement(this.node); @@ -27946,12 +28279,12 @@ this.emit('close', this); }; - var GetValue$D = Phaser.Utils.Objects.GetValue; + var GetValue$w = Phaser.Utils.Objects.GetValue; var CreateElement = function CreateElement(parent, config) { var element; - var textType = GetValue$D(config, 'inputType', undefined); + var textType = GetValue$w(config, 'inputType', undefined); if (textType === undefined) { - textType = GetValue$D(config, 'type', 'text'); + textType = GetValue$w(config, 'type', 'text'); } if (textType === 'textarea') { element = document.createElement('textarea'); @@ -27960,7 +28293,7 @@ element = document.createElement('input'); element.type = textType; } - var style = GetValue$D(config, 'style', undefined); + var style = GetValue$w(config, 'style', undefined); // Apply other style properties var elementStyle = element.style; SetProperties(StyleProperties, style, elementStyle); @@ -28034,7 +28367,7 @@ close: Close }; - var GetValue$C = Phaser.Utils.Objects.GetValue; + var GetValue$v = Phaser.Utils.Objects.GetValue; var HiddenTextEditBase = /*#__PURE__*/function (_ComponentBase) { _inherits(HiddenTextEditBase, _ComponentBase); var _super = _createSuper(HiddenTextEditBase); @@ -28044,22 +28377,22 @@ _this = _super.call(this, gameObject); // this.parent = gameObject; - var textType = GetValue$C(config, 'inputType', undefined); + var textType = GetValue$v(config, 'inputType', undefined); if (textType === undefined) { - textType = GetValue$C(config, 'type', 'text'); + textType = GetValue$v(config, 'type', 'text'); } - _this.setEnterCloseEnable(GetValue$C(config, 'enterClose', textType !== 'textarea')); - var onOpen = GetValue$C(config, 'onOpen', undefined); + _this.setEnterCloseEnable(GetValue$v(config, 'enterClose', textType !== 'textarea')); + var onOpen = GetValue$v(config, 'onOpen', undefined); if (!onOpen) { - onOpen = GetValue$C(config, 'onFocus', undefined); + onOpen = GetValue$v(config, 'onFocus', undefined); } _this.onOpenCallback = onOpen; - var onClose = GetValue$C(config, 'onClose', undefined); + var onClose = GetValue$v(config, 'onClose', undefined); if (!onClose) { - onClose = GetValue$C(config, 'onBlur', undefined); + onClose = GetValue$v(config, 'onBlur', undefined); } _this.onCloseCallback = onClose; - _this.onUpdateCallback = GetValue$C(config, 'onUpdate', undefined); + _this.onUpdateCallback = GetValue$v(config, 'onUpdate', undefined); _this.isOpened = false; gameObject.on('pointerdown', function () { this.open(); @@ -28564,7 +28897,7 @@ hiddenTextEdit.prevCursorPosition = null; }; - var GetValue$B = Phaser.Utils.Objects.GetValue; + var GetValue$u = Phaser.Utils.Objects.GetValue; var HiddenTextEdit = /*#__PURE__*/function (_HiddenTextEditBase) { _inherits(HiddenTextEdit, _HiddenTextEditBase); var _super = _createSuper(HiddenTextEdit); @@ -28574,7 +28907,7 @@ _this = _super.call(this, gameObject, config); // this.parent = gameObject; - _this.setSelectAllWhenFocusEnable(GetValue$B(config, 'selectAll', false)); + _this.setSelectAllWhenFocusEnable(GetValue$u(config, 'selectAll', false)); _this.cursorMoveStartIndex = null; _this.prevCursorPosition = null; _this.prevSelectionStart = null; @@ -28673,10 +29006,10 @@ return HiddenTextEdit; }(HiddenTextEditBase); - var GetValue$A = Phaser.Utils.Objects.GetValue; + var GetValue$t = Phaser.Utils.Objects.GetValue; var PropertiesList = ['inputType', 'onOpen', 'onFocus', 'onClose', 'onBlur', 'onUpdate', 'enterClose', 'readOnly', 'maxLength', 'minLength', 'selectAll']; var CreateHiddenTextEdit = function CreateHiddenTextEdit(parent, parentConfig) { - var config = GetValue$A(parentConfig, 'edit'); + var config = GetValue$t(parentConfig, 'edit'); if (config === undefined) { config = {}; } @@ -29609,64 +29942,47 @@ return inputText; }; - var TextInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(TextInput, _InputFiledBase); - var _super = _createSuper(TextInput); - function TextInput(scene, config) { - var _this; - _classCallCheck(this, TextInput); - if (config === undefined) { - config = {}; + var SetInputTextReadOnly$3 = function SetInputTextReadOnly(gameObject, enable) { + if (enable === undefined) { + enable = true; + } + var inputText = gameObject.getElement('inputText'); + inputText.setReadOnly(enable); + }; + var TextInputHandler = { + name: 'TextInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'string'; } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.TextInput'; - var inputTextConfig = config.inputText; + return typeof config.value === 'string'; + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.TextInput'; + var inputTextConfig = style.inputText; var inputText = CreateInputText(scene, inputTextConfig); - _this.add(inputText, { + gameObject.add(inputText, { proportion: 1, - expand: true + expand: true, + key: 'inputText' }); - _this.addChildrenMap('inputText', inputText); inputText.on('close', function () { - this.setValue(inputText.value); - }, _assertThisInitialized(_this)); - return _this; - } - _createClass(TextInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; - } - if (!this.validate(value)) { - value = this._value; // Back to previous value - } - - var text = this.textFormatCallback ? this.textFormatCallback(value) : value; - this.childrenMap.inputText.setText(text); - _set(_getPrototypeOf(TextInput.prototype), "value", value, this, true); // Fire 'valuechange' event - } - }, { - key: "setInputTextReadOnly", - value: function setInputTextReadOnly(enable) { - if (enable === undefined) { - enable = true; - } - this.childrenMap.inputText.setReadOnly(enable); - return this; + gameObject.setValue(inputText.value); + }); + }, + // Callback inside `setup()` + setup: function setup(gameObject, config, setDefaults) { + if (setDefaults || config.hasOwnProperty('inputTextReadOnly')) { + SetInputTextReadOnly$3(gameObject, !!config.inputTextReadOnly); } - }]); - return TextInput; - }(InputFiledBase); - - var CreateTextInput = function CreateTextInput(scene, config, style) { - var gameObject = new TextInput(scene, style); - scene.add.existing(gameObject); - gameObject.setInputTextReadOnly(!!config.inputTextReadOnly); - return gameObject; + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var inputText = gameObject.getElement('inputText'); + inputText.setText(gameObject.getFotmatText(value)); + } }; var SCROLLMODE = { @@ -29957,7 +30273,7 @@ }; var IsPlainObject$5 = Phaser.Utils.Objects.IsPlainObject; - var GetValue$z = Phaser.Utils.Objects.GetValue; + var GetValue$s = Phaser.Utils.Objects.GetValue; var ALIGN_CENTER = Phaser.Display.Align.CENTER; var GetEmptyCellIndex = function GetEmptyCellIndex(columnIndex, rowIndex, cells, columnCount, rowCount) { if (typeof columnIndex === 'number' || typeof rowIndex === 'number') { @@ -30006,12 +30322,12 @@ AddChild$2.call(this, gameObject); if (IsPlainObject$5(columnIndex)) { var config = columnIndex; - columnIndex = GetValue$z(config, 'column', undefined); - rowIndex = GetValue$z(config, 'row', undefined); - align = GetValue$z(config, 'align', ALIGN_CENTER); - paddingConfig = GetValue$z(config, 'padding', 0); - expand = GetValue$z(config, 'expand', false); - childKey = GetValue$z(config, 'key', undefined); + columnIndex = GetValue$s(config, 'column', undefined); + rowIndex = GetValue$s(config, 'row', undefined); + align = GetValue$s(config, 'align', ALIGN_CENTER); + paddingConfig = GetValue$s(config, 'padding', 0); + expand = GetValue$s(config, 'expand', false); + childKey = GetValue$s(config, 'key', undefined); } // Get insert index @@ -30046,8 +30362,8 @@ config.align = align; config.padding = GetBoundsConfig(paddingConfig); if (IsPlainObject$5(expand)) { - config.expandWidth = GetValue$z(expand, 'width', false); - config.expandHeight = GetValue$z(expand, 'height', false); + config.expandWidth = GetValue$s(expand, 'width', false); + config.expandHeight = GetValue$s(expand, 'height', false); } else { config.expandWidth = expand; config.expandHeight = expand; @@ -30152,7 +30468,7 @@ } }; - var GetValue$y = Phaser.Utils.Objects.GetValue; + var GetValue$r = Phaser.Utils.Objects.GetValue; var ResetGrid = function ResetGrid(columnCount, rowCount, columnProportions, rowProportions, space) { if (columnProportions === undefined) { columnProportions = 0; @@ -30196,8 +30512,8 @@ this.rowHeight.length = rowCount; // space - this.setColumnSpace(GetValue$y(space, 'column', 0)); - this.setRowSpace(GetValue$y(space, 'row', 0)); + this.setColumnSpace(GetValue$r(space, 'column', 0)); + this.setRowSpace(GetValue$r(space, 'row', 0)); var scene = this.scene; var createCellContainerCallback = this.createCellContainerCallback; if (createCellContainerCallback) { @@ -30266,7 +30582,7 @@ return this; }; - var methods$7 = { + var methods$6 = { getChildrenWidth: GetChildrenWidth, getChildrenHeight: GetChildrenHeight, getExpandedChildWidth: GetExpandedChildWidth, @@ -30284,7 +30600,7 @@ insertEmptyColumn: InsertEmptyColumn, addEmptyColumn: AddEmptyColumn }; - Object.assign(methods$7, AddChildMethods, RemoveChildMethods, SetSpaceMethods); + Object.assign(methods$6, AddChildMethods, RemoveChildMethods, SetSpaceMethods); var GetTotalColumnProportions = function GetTotalColumnProportions() { var result = 0, @@ -30311,7 +30627,7 @@ }; var IsPlainObject$4 = Phaser.Utils.Objects.IsPlainObject; - var GetValue$x = Phaser.Utils.Objects.GetValue; + var GetValue$q = Phaser.Utils.Objects.GetValue; var GridSizer = /*#__PURE__*/function (_BaseSizer) { _inherits(GridSizer, _BaseSizer); var _super = _createSuper(GridSizer); @@ -30320,41 +30636,41 @@ _classCallCheck(this, GridSizer); if (IsPlainObject$4(x)) { config = x; - x = GetValue$x(config, 'x', 0); - y = GetValue$x(config, 'y', 0); - minWidth = GetValue$x(config, 'width', undefined); - minHeight = GetValue$x(config, 'height', undefined); - columnCount = GetValue$x(config, 'column', config.col || 0); - rowCount = GetValue$x(config, 'row', 0); - columnProportions = GetValue$x(config, 'columnProportions', 0); - rowProportions = GetValue$x(config, 'rowProportions', 0); + x = GetValue$q(config, 'x', 0); + y = GetValue$q(config, 'y', 0); + minWidth = GetValue$q(config, 'width', undefined); + minHeight = GetValue$q(config, 'height', undefined); + columnCount = GetValue$q(config, 'column', config.col || 0); + rowCount = GetValue$q(config, 'row', 0); + columnProportions = GetValue$q(config, 'columnProportions', 0); + rowProportions = GetValue$q(config, 'rowProportions', 0); } else if (IsPlainObject$4(minWidth)) { config = minWidth; - minWidth = GetValue$x(config, 'width', undefined); - minHeight = GetValue$x(config, 'height', undefined); - columnCount = GetValue$x(config, 'column', config.col || 0); - rowCount = GetValue$x(config, 'row', 0); - columnProportions = GetValue$x(config, 'columnProportions', 0); - rowProportions = GetValue$x(config, 'rowProportions', 0); + minWidth = GetValue$q(config, 'width', undefined); + minHeight = GetValue$q(config, 'height', undefined); + columnCount = GetValue$q(config, 'column', config.col || 0); + rowCount = GetValue$q(config, 'row', 0); + columnProportions = GetValue$q(config, 'columnProportions', 0); + rowProportions = GetValue$q(config, 'rowProportions', 0); } else if (IsPlainObject$4(columnCount)) { config = columnCount; - columnCount = GetValue$x(config, 'column', config.col || 0); - rowCount = GetValue$x(config, 'row', 0); - columnProportions = GetValue$x(config, 'columnProportions', 0); - rowProportions = GetValue$x(config, 'rowProportions', 0); + columnCount = GetValue$q(config, 'column', config.col || 0); + rowCount = GetValue$q(config, 'row', 0); + columnProportions = GetValue$q(config, 'columnProportions', 0); + rowProportions = GetValue$q(config, 'rowProportions', 0); } else if (IsPlainObject$4(columnProportions)) { config = columnProportions; - columnProportions = GetValue$x(config, 'columnProportions', 0); - rowProportions = GetValue$x(config, 'rowProportions', 0); + columnProportions = GetValue$q(config, 'columnProportions', 0); + rowProportions = GetValue$q(config, 'rowProportions', 0); } _this = _super.call(this, scene, x, y, minWidth, minHeight, config); _this.type = 'rexGridSizer'; _this.sizerChildren = []; _this.addChildrenMap('items', _this.sizerChildren); - _this.setCreateCellContainerCallback(GetValue$x(config, 'createCellContainerCallback')); - _this.setIndentLeft(GetValue$x(config, 'space.indentLeftOdd', 0), GetValue$x(config, 'space.indentLeftEven', 0)); - _this.setIndentTop(GetValue$x(config, 'space.indentTopOdd', 0), GetValue$x(config, 'space.indentTopEven', 0)); - _this.resetGrid(columnCount, rowCount, columnProportions, rowProportions, GetValue$x(config, 'space', undefined)); + _this.setCreateCellContainerCallback(GetValue$q(config, 'createCellContainerCallback')); + _this.setIndentLeft(GetValue$q(config, 'space.indentLeftOdd', 0), GetValue$q(config, 'space.indentLeftEven', 0)); + _this.setIndentTop(GetValue$q(config, 'space.indentTopOdd', 0), GetValue$q(config, 'space.indentTopEven', 0)); + _this.resetGrid(columnCount, rowCount, columnProportions, rowProportions, GetValue$q(config, 'space', undefined)); return _this; } _createClass(GridSizer, [{ @@ -30452,14 +30768,14 @@ }]); return GridSizer; }(Base$1); - Object.assign(GridSizer.prototype, methods$7); + Object.assign(GridSizer.prototype, methods$6); - var GetValue$w = Phaser.Utils.Objects.GetValue; + var GetValue$p = Phaser.Utils.Objects.GetValue; var AddChild = function AddChild(topPatent, childParent, config) { - var childConfig = GetValue$w(config, 'child'); - var child = GetValue$w(childConfig, 'gameObject', undefined); + var childConfig = GetValue$p(config, 'child'); + var child = GetValue$p(childConfig, 'gameObject', undefined); if (child) { - var childSpace = GetValue$w(config, 'space.child', 0); + var childSpace = GetValue$p(config, 'space.child', 0); topPatent.childMargin = {}; var childMargin = topPatent.childMargin; var childPadding = {}; @@ -30483,35 +30799,35 @@ } else { switch (topPatent.scrollMode) { case 0: - childMargin.top = GetValue$w(childSpace, 'top', 0); - childMargin.bottom = GetValue$w(childSpace, 'bottom', 0); - childPadding.left = GetValue$w(childSpace, 'left', 0); - childPadding.right = GetValue$w(childSpace, 'right', 0); + childMargin.top = GetValue$p(childSpace, 'top', 0); + childMargin.bottom = GetValue$p(childSpace, 'bottom', 0); + childPadding.left = GetValue$p(childSpace, 'left', 0); + childPadding.right = GetValue$p(childSpace, 'right', 0); break; case 1: - childMargin.top = GetValue$w(childSpace, 'left', 0); - childMargin.bottom = GetValue$w(childSpace, 'right', 0); - childPadding.top = GetValue$w(childSpace, 'top', 0); - childPadding.bottom = GetValue$w(childSpace, 'bottom', 0); + childMargin.top = GetValue$p(childSpace, 'left', 0); + childMargin.bottom = GetValue$p(childSpace, 'right', 0); + childPadding.top = GetValue$p(childSpace, 'top', 0); + childPadding.bottom = GetValue$p(childSpace, 'bottom', 0); break; default: // 2 - childMargin.top = GetValue$w(childSpace, 'top', 0); - childMargin.bottom = GetValue$w(childSpace, 'bottom', 0); - childMargin.left = GetValue$w(childSpace, 'left', 0); - childMargin.right = GetValue$w(childSpace, 'right', 0); + childMargin.top = GetValue$p(childSpace, 'top', 0); + childMargin.bottom = GetValue$p(childSpace, 'bottom', 0); + childMargin.left = GetValue$p(childSpace, 'left', 0); + childMargin.right = GetValue$p(childSpace, 'right', 0); break; } } childParent.add(child, { column: 1, row: 1, - align: GetValue$w(childConfig, 'align', 'center'), + align: GetValue$p(childConfig, 'align', 'center'), padding: childPadding, expand: { - width: GetValue$w(childConfig, 'expandWidth', true), + width: GetValue$p(childConfig, 'expandWidth', true), // Private - height: GetValue$w(childConfig, 'expandHeight', true) // Private + height: GetValue$p(childConfig, 'expandHeight', true) // Private } }); } @@ -30619,7 +30935,7 @@ easeValueRepeat: EaseValueRepeat }; - var GetValue$v = Phaser.Utils.Objects.GetValue; + var GetValue$o = Phaser.Utils.Objects.GetValue; var Clamp$5 = Phaser.Math.Clamp; function ProgressBase (BaseClass) { var ProgressBase = /*#__PURE__*/function (_BaseClass) { @@ -30632,13 +30948,13 @@ _createClass(ProgressBase, [{ key: "bootProgressBase", value: function bootProgressBase(config) { - this.eventEmitter = GetValue$v(config, 'eventEmitter', this); - var callback = GetValue$v(config, 'valuechangeCallback', null); + this.eventEmitter = GetValue$o(config, 'eventEmitter', this); + var callback = GetValue$o(config, 'valuechangeCallback', null); if (callback !== null) { - var scope = GetValue$v(config, 'valuechangeCallbackScope', undefined); + var scope = GetValue$o(config, 'valuechangeCallbackScope', undefined); this.eventEmitter.on('valuechange', callback, scope); } - this.setEaseValuePropName('value').setEaseValueDuration(GetValue$v(config, 'easeValue.duration', 0)).setEaseValueFunction(GetValue$v(config, 'easeValue.ease', 'Linear')); + this.setEaseValuePropName('value').setEaseValueDuration(GetValue$o(config, 'easeValue.duration', 0)).setEaseValueFunction(GetValue$o(config, 'easeValue.ease', 'Linear')); return this; } }, { @@ -30872,7 +31188,7 @@ this.resetChildPositionState(indicator); }; - var GetValue$u = Phaser.Utils.Objects.GetValue; + var GetValue$n = Phaser.Utils.Objects.GetValue; var IsPlainObject$3 = Phaser.Utils.Objects.IsPlainObject; var Clamp$4 = Phaser.Math.Clamp; var SnapTo = Phaser.Math.Snap.To; @@ -30886,13 +31202,13 @@ _this = _super.call(this, scene, config); _this.type = 'rexSlider'; _this.bootProgressBase(config); - _this.reverseAxis = GetValue$u(config, 'reverseAxis', false); + _this.reverseAxis = GetValue$n(config, 'reverseAxis', false); // Add elements - var background = GetValue$u(config, 'background', undefined); - var track = GetValue$u(config, 'track', undefined); - var indicator = GetValue$u(config, 'indicator', undefined); - var thumb = GetValue$u(config, 'thumb', undefined); + var background = GetValue$n(config, 'background', undefined); + var track = GetValue$n(config, 'track', undefined); + var indicator = GetValue$n(config, 'indicator', undefined); + var thumb = GetValue$n(config, 'thumb', undefined); if (background) { if (IsPlainObject$3(background)) { background = CreateBackground$1(scene, background); @@ -30925,7 +31241,7 @@ } // Input - var inputMode = GetValue$u(config, 'input', 0); + var inputMode = GetValue$n(config, 'input', 0); if (typeof inputMode === 'string') { inputMode = INPUTMODE[inputMode]; } @@ -30963,9 +31279,9 @@ _this.addChildrenMap('track', track); _this.addChildrenMap('indicator', indicator); _this.addChildrenMap('thumb', thumb); - _this.setEnable(GetValue$u(config, 'enable', undefined)); - _this.setGap(GetValue$u(config, 'gap', undefined)); - _this.setValue(GetValue$u(config, 'value', 0), GetValue$u(config, 'min', undefined), GetValue$u(config, 'max', undefined)); + _this.setEnable(GetValue$n(config, 'enable', undefined)); + _this.setGap(GetValue$n(config, 'gap', undefined)); + _this.setValue(GetValue$n(config, 'value', 0), GetValue$n(config, 'min', undefined), GetValue$n(config, 'max', undefined)); return _this; } _createClass(Slider, [{ @@ -31029,15 +31345,15 @@ click: 1, none: -1 }; - var methods$6 = { + var methods$5 = { getStartPoint: GetStartPoint, getEndPoint: GetEndoint, updateThumb: UpdateThumb, updateIndicator: UpdateIndicator }; - Object.assign(Slider.prototype, methods$6); + Object.assign(Slider.prototype, methods$5); - var GetValue$t = Phaser.Utils.Objects.GetValue; + var GetValue$m = Phaser.Utils.Objects.GetValue; var ScrollBar = /*#__PURE__*/function (_Sizer) { _inherits(ScrollBar, _Sizer); var _super = _createSuper(ScrollBar); @@ -31049,12 +31365,12 @@ _this.type = 'rexScrollBar'; // Add elements - var background = GetValue$t(config, 'background', undefined); - var buttonsConfig = GetValue$t(config, 'buttons', undefined); - var button0 = GetValue$t(buttonsConfig, 'top', GetValue$t(buttonsConfig, 'left', undefined)); - var button1 = GetValue$t(buttonsConfig, 'bottom', GetValue$t(buttonsConfig, 'right', undefined)); + var background = GetValue$m(config, 'background', undefined); + var buttonsConfig = GetValue$m(config, 'buttons', undefined); + var button0 = GetValue$m(buttonsConfig, 'top', GetValue$m(buttonsConfig, 'left', undefined)); + var button1 = GetValue$m(buttonsConfig, 'bottom', GetValue$m(buttonsConfig, 'right', undefined)); var slider, - sliderConfig = GetValue$t(config, 'slider', undefined); + sliderConfig = GetValue$m(config, 'slider', undefined); if (background) { _this.addBackground(background); } @@ -31075,10 +31391,10 @@ sliderConfig.value = null; var proportion; if (_this.orientation === 0) { - var sliderWidth = GetValue$t(sliderConfig, 'width', undefined); + var sliderWidth = GetValue$m(sliderConfig, 'width', undefined); proportion = sliderWidth === undefined ? 1 : 0; } else { - var sliderHeight = GetValue$t(sliderConfig, 'height', undefined); + var sliderHeight = GetValue$m(sliderConfig, 'height', undefined); proportion = sliderHeight === undefined ? 1 : 0; } slider = new Slider(scene, sliderConfig); @@ -31102,14 +31418,14 @@ _this.addChildrenMap('background', background); _this.addChildrenMap('slider', slider); _this.addChildrenMap('buttons', buttons); - var callback = GetValue$t(config, 'valuechangeCallback', null); + var callback = GetValue$m(config, 'valuechangeCallback', null); if (callback !== null) { - var scope = GetValue$t(config, 'valuechangeCallbackScope', undefined); + var scope = GetValue$m(config, 'valuechangeCallbackScope', undefined); _this.on('valuechange', callback, scope); } - _this.setEnable(GetValue$t(config, 'enable', undefined)); - _this.setValue(GetValue$t(config, 'value', 0)); - _this.setScrollStep(GetValue$t(buttonsConfig, 'step', 0.01)); + _this.setEnable(GetValue$m(config, 'enable', undefined)); + _this.setValue(GetValue$m(config, 'value', 0)); + _this.setScrollStep(GetValue$m(buttonsConfig, 'step', 0.01)); return _this; } _createClass(ScrollBar, [{ @@ -31411,7 +31727,7 @@ return State; }(FSM); - var GetValue$s = Phaser.Utils.Objects.GetValue; + var GetValue$l = Phaser.Utils.Objects.GetValue; var DistanceBetween = Phaser.Math.Distance.Between; var DragSpeed = /*#__PURE__*/function (_ComponentBase) { _inherits(DragSpeed, _ComponentBase); @@ -31423,7 +31739,7 @@ // this.parent = gameObject; _this._enable = undefined; - gameObject.setInteractive(GetValue$s(config, "inputConfig", undefined)); + gameObject.setInteractive(GetValue$l(config, "inputConfig", undefined)); _this.resetFromJSON(config); _this.boot(); return _this; @@ -31441,9 +31757,9 @@ this.localX = undefined; this.localY = undefined; this.justMoved = false; - this.setEnable(GetValue$s(o, 'enable', true)); - this.holdThreshold = GetValue$s(o, 'holdThreshold', 50); // ms - this.pointerOutReleaseEnable = GetValue$s(o, 'pointerOutRelease', true); + this.setEnable(GetValue$l(o, 'enable', true)); + this.holdThreshold = GetValue$l(o, 'holdThreshold', 50); // ms + this.pointerOutReleaseEnable = GetValue$l(o, 'pointerOutRelease', true); return this; } }, { @@ -31640,7 +31956,7 @@ return DragSpeed; }(ComponentBase); - var GetValue$r = Phaser.Utils.Objects.GetValue; + var GetValue$k = Phaser.Utils.Objects.GetValue; var Movement = /*#__PURE__*/function () { function Movement(config) { _classCallCheck(this, Movement); @@ -31649,9 +31965,9 @@ _createClass(Movement, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.setValue(GetValue$r(o, 'value', 0)); - this.setSpeed(GetValue$r(o, 'speed', 0)); - this.setAcceleration(GetValue$r(o, 'acceleration', 0)); + this.setValue(GetValue$k(o, 'value', 0)); + this.setSpeed(GetValue$k(o, 'speed', 0)); + this.setAcceleration(GetValue$k(o, 'acceleration', 0)); return this; } }, { @@ -31789,7 +32105,7 @@ return SlowDown; }(); - var GetValue$q = Phaser.Utils.Objects.GetValue; + var GetValue$j = Phaser.Utils.Objects.GetValue; var Clamp$3 = Phaser.Math.Clamp; var Scroller = /*#__PURE__*/function (_ComponentBase) { _inherits(Scroller, _ComponentBase); @@ -31800,34 +32116,34 @@ _this = _super.call(this, gameObject, config); // this.parent = gameObject; - var enable = GetValue$q(config, 'enable', true); + var enable = GetValue$j(config, 'enable', true); _this._state = new State(_assertThisInitialized(_this), { enable: enable, eventEmitter: false }); var drapSpeedConfig = { - inputConfig: GetValue$q(config, 'inputConfig', undefined), + inputConfig: GetValue$j(config, 'inputConfig', undefined), enable: enable, - pointerOutRelease: GetValue$q(config, 'pointerOutRelease', true), + pointerOutRelease: GetValue$j(config, 'pointerOutRelease', true), eventEmitter: false }; _this.dragState = new DragSpeed(gameObject, drapSpeedConfig); _this._enable = undefined; _this._value = undefined; _this._slowDown = new SlowDown(); - var callback = GetValue$q(config, 'valuechangeCallback', null); + var callback = GetValue$j(config, 'valuechangeCallback', null); if (callback !== null) { - var scope = GetValue$q(config, 'valuechangeCallbackScope', undefined); + var scope = GetValue$j(config, 'valuechangeCallbackScope', undefined); _this.on('valuechange', callback, scope); } - callback = GetValue$q(config, 'overmaxCallback', null); + callback = GetValue$j(config, 'overmaxCallback', null); if (callback !== null) { - var scope = GetValue$q(config, 'overmaxCallbackScope', undefined); + var scope = GetValue$j(config, 'overmaxCallbackScope', undefined); _this.on('overmax', callback, scope); } - callback = GetValue$q(config, 'overminCallback', null); + callback = GetValue$j(config, 'overminCallback', null); if (callback !== null) { - var scope = GetValue$q(config, 'overminCallbackScope', undefined); + var scope = GetValue$j(config, 'overminCallbackScope', undefined); _this.on('overmin', callback, scope); } _this.resetFromJSON(config); @@ -31837,21 +32153,21 @@ _createClass(Scroller, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.setOrientationMode(GetValue$q(o, 'orientation', 0)); - this.setDragThreshold(GetValue$q(o, 'threshold', 10)); - this.setSlidingDeceleration(GetValue$q(o, 'slidingDeceleration', 5000)); - this.setBackDeceleration(GetValue$q(o, 'backDeceleration', 2000)); - var dragRate = GetValue$q(o, 'dragRate', 1); - dragRate = dragRate * (GetValue$q(o, 'dragReverse', false) ? -1 : 1); + this.setOrientationMode(GetValue$j(o, 'orientation', 0)); + this.setDragThreshold(GetValue$j(o, 'threshold', 10)); + this.setSlidingDeceleration(GetValue$j(o, 'slidingDeceleration', 5000)); + this.setBackDeceleration(GetValue$j(o, 'backDeceleration', 2000)); + var dragRate = GetValue$j(o, 'dragRate', 1); + dragRate = dragRate * (GetValue$j(o, 'dragReverse', false) ? -1 : 1); this.setDragRate(dragRate); - var bounds = GetValue$q(o, 'bounds', undefined); + var bounds = GetValue$j(o, 'bounds', undefined); if (bounds) { this.setBounds(bounds); } else { - this.setBounds(GetValue$q(o, 'max', 0), GetValue$q(o, 'min', 0)); + this.setBounds(GetValue$j(o, 'max', 0), GetValue$j(o, 'min', 0)); } - this.setValue(GetValue$q(o, 'value', this.maxValue || 0)); - this.setEnable(GetValue$q(o, "enable", true)); + this.setValue(GetValue$j(o, 'value', this.maxValue || 0)); + this.setEnable(GetValue$j(o, "enable", true)); return this; } }, { @@ -32183,7 +32499,7 @@ horizontal: 1 }; - var GetValue$p = Phaser.Utils.Objects.GetValue; + var GetValue$i = Phaser.Utils.Objects.GetValue; var MouseWheelScroller = /*#__PURE__*/function (_ComponentBase) { _inherits(MouseWheelScroller, _ComponentBase); var _super = _createSuper(MouseWheelScroller); @@ -32194,18 +32510,18 @@ // this.parent = gameObject; if (_this.parent !== _this.scene) { - _this.focusMode = GetValue$p(config, 'focus', true); + _this.focusMode = GetValue$i(config, 'focus', true); } else { _this.focusMode = false; } - _this.setSpeed(GetValue$p(config, 'speed', 0.1)); - _this.setEnable(GetValue$p(config, 'enable', true)); + _this.setSpeed(GetValue$i(config, 'speed', 0.1)); + _this.setEnable(GetValue$i(config, 'enable', true)); if (!_this.focusMode) { // Register on scene _this.scene.input.on('wheel', _this.onSceneScroll, _assertThisInitialized(_this)); } else { var gameObject = _this.parent; - gameObject.setInteractive(GetValue$p(config, "inputConfig", undefined)).on('wheel', function (pointer, dx, dy, dz, event) { + gameObject.setInteractive(GetValue$i(config, "inputConfig", undefined)).on('wheel', function (pointer, dx, dy, dz, event) { if (!this.enable) { return; } @@ -32254,7 +32570,7 @@ return MouseWheelScroller; }(ComponentBase); - var GetValue$o = Phaser.Utils.Objects.GetValue; + var GetValue$h = Phaser.Utils.Objects.GetValue; var AddSlider = function AddSlider(topPatent, sliderParent, axis, config) { axis = axis.toUpperCase(); var isAxisY = axis === 'Y'; @@ -32263,12 +32579,12 @@ var sliderConfig, slider; var sliderConfigKey = "slider".concat(axis); if (isScrollXYMode) { - sliderConfig = GetValue$o(config, sliderConfigKey, undefined); + sliderConfig = GetValue$h(config, sliderConfigKey, undefined); } else { if (config.hasOwnProperty(sliderConfigKey)) { - sliderConfig = GetValue$o(config, sliderConfigKey, undefined); + sliderConfig = GetValue$h(config, sliderConfigKey, undefined); } else { - sliderConfig = GetValue$o(config, 'slider', undefined); + sliderConfig = GetValue$h(config, 'slider', undefined); } } if (sliderConfig) { @@ -32278,7 +32594,7 @@ sliderConfig.orientation = isAxisY ? 1 : 0; slider = CreateScrollbar(topPatent.scene, sliderConfig); var column, row, padding; - var sliderPosition = GetValue$o(sliderConfig, 'position', 0); + var sliderPosition = GetValue$h(sliderConfig, 'position', 0); if (typeof sliderPosition === 'string') { sliderPosition = SLIDER_POSITION_MAP[sliderPosition]; } @@ -32288,15 +32604,15 @@ 2. space.slider 3. space.child */ - var sliderPadding = GetValue$o(config, "space.slider".concat(axis), undefined); + var sliderPadding = GetValue$h(config, "space.slider".concat(axis), undefined); if (sliderPadding === undefined) { - sliderPadding = GetValue$o(config, 'space.slider', undefined); + sliderPadding = GetValue$h(config, 'space.slider', undefined); if (sliderPadding === undefined) { if (isScrollXYMode) { sliderPadding = 0; } else { // Legacy - sliderPadding = GetValue$o(config, 'space.child', 0); + sliderPadding = GetValue$h(config, 'space.child', 0); } } } @@ -32341,9 +32657,9 @@ padding: padding, expand: true }); - topPatent["hideUnscrollableSlider".concat(axis)] = GetValue$o(sliderConfig, 'hideUnscrollableSlider', false); - topPatent["adaptThumb".concat(axis, "SizeMode")] = GetValue$o(sliderConfig, 'adaptThumbSize', false); - topPatent["minThumb".concat(axis, "Size")] = GetValue$o(sliderConfig, 'minThumbSize', undefined); + topPatent["hideUnscrollableSlider".concat(axis)] = GetValue$h(sliderConfig, 'hideUnscrollableSlider', false); + topPatent["adaptThumb".concat(axis, "SizeMode")] = GetValue$h(sliderConfig, 'adaptThumbSize', false); + topPatent["minThumb".concat(axis, "Size")] = GetValue$h(sliderConfig, 'minThumbSize', undefined); } else { topPatent["hideUnscrollableSlider".concat(axis)] = false; topPatent["adaptThumb".concat(axis, "SizeMode")] = false; @@ -32352,12 +32668,12 @@ var scrollerConfig, scroller; var scrollerConfigKey = "scroller".concat(axis); if (isScrollXYMode) { - scrollerConfig = GetValue$o(config, scrollerConfigKey, true); + scrollerConfig = GetValue$h(config, scrollerConfigKey, true); } else { if (config.hasOwnProperty(scrollerConfigKey)) { - scrollerConfig = GetValue$o(config, scrollerConfigKey, true); + scrollerConfig = GetValue$h(config, scrollerConfigKey, true); } else { - scrollerConfig = GetValue$o(config, 'scroller', true); + scrollerConfig = GetValue$h(config, 'scroller', true); } } if (scrollerConfig && child) { @@ -32367,7 +32683,7 @@ scrollerConfig.orientation = isAxisY ? 0 : 1; scroller = new Scroller(child, scrollerConfig); } - var mouseWheelScrollerConfig = GetValue$o(config, isScrollXYMode ? "mouseWheelScroller".concat(axis) : 'mouseWheelScroller', false), + var mouseWheelScrollerConfig = GetValue$h(config, isScrollXYMode ? "mouseWheelScroller".concat(axis) : 'mouseWheelScroller', false), mouseWheelScroller; if (mouseWheelScrollerConfig && child) { mouseWheelScroller = new MouseWheelScroller(child, mouseWheelScrollerConfig); @@ -32427,22 +32743,22 @@ top: 1 }; - var GetValue$n = Phaser.Utils.Objects.GetValue; + var GetValue$g = Phaser.Utils.Objects.GetValue; var CreateScrollableSizer = function CreateScrollableSizer(parent, config) { var scene = parent.scene; var columnProportions = [0, 1, 0], rowProportions = [0, 1, 0]; - var parentMinWidth = GetValue$n(config, 'width'); - var parentMinHeight = GetValue$n(config, 'height'); + var parentMinWidth = GetValue$g(config, 'width'); + var parentMinHeight = GetValue$g(config, 'height'); if (!parentMinWidth) { - var expandChildWidth = GetValue$n(config, 'child.expandWidth', true); + var expandChildWidth = GetValue$g(config, 'child.expandWidth', true); if (!expandChildWidth) { columnProportions[1] = 0; // Calculate parent's width by child's width } } if (!parentMinHeight) { - var expandChildHeight = GetValue$n(config, 'child.expandHeight', true); + var expandChildHeight = GetValue$g(config, 'child.expandHeight', true); if (!expandChildHeight) { rowProportions[1] = 0; // Calculate parent's height by child's height } @@ -32661,7 +32977,7 @@ } }; - var GetValue$m = Phaser.Utils.Objects.GetValue; + var GetValue$f = Phaser.Utils.Objects.GetValue; var Clamp$2 = Phaser.Math.Clamp; var Scrollable = /*#__PURE__*/function (_Sizer) { _inherits(Scrollable, _Sizer); @@ -32677,19 +32993,19 @@ var isRevererXY = scrollMode === 1; config.orientation = !isRevererXY ? 1 : 0; _this = _super.call(this, scene, config); - _this.type = GetValue$m(config, 'type', 'rexScrollable'); + _this.type = GetValue$f(config, 'type', 'rexScrollable'); _this.scrollMode = scrollMode; // Add elements // Background - var background = GetValue$m(config, 'background', undefined); + var background = GetValue$f(config, 'background', undefined); if (background) { _this.addBackground(background); } - var header = GetValue$m(config, 'header', undefined); + var header = GetValue$f(config, 'header', undefined); if (header) { - var align = GetValue$m(config, 'align.header', 'center'); - var headerSpace = GetValue$m(config, 'space.header', 0); + var align = GetValue$f(config, 'align.header', 'center'); + var headerSpace = GetValue$f(config, 'space.header', 0); var padding; if (!isRevererXY) { padding = { @@ -32704,7 +33020,7 @@ proportion: 0, align: align, padding: padding, - expand: GetValue$m(config, 'expand.header', true) + expand: GetValue$f(config, 'expand.header', true) }); } var scrollableSizer = CreateScrollableSizer(_assertThisInitialized(_this), config); @@ -32716,10 +33032,10 @@ expand: true }); } - var footer = GetValue$m(config, 'footer', undefined); + var footer = GetValue$f(config, 'footer', undefined); if (footer) { - var align = GetValue$m(config, 'align.footer', 'center'); - var footerSpace = GetValue$m(config, 'space.footer', 0); + var align = GetValue$f(config, 'align.footer', 'center'); + var footerSpace = GetValue$f(config, 'space.footer', 0); var padding; if (!isRevererXY) { padding = { @@ -32734,7 +33050,7 @@ proportion: 0, align: align, padding: padding, - expand: GetValue$m(config, 'expand.footer', true) + expand: GetValue$f(config, 'expand.footer', true) }); } _this.addChildrenMap('background', background); @@ -33299,8 +33615,8 @@ } }; - var GetValue$l = Phaser.Utils.Objects.GetValue; - var TextAreaInput$1 = /*#__PURE__*/function (_Scrollable) { + var GetValue$e = Phaser.Utils.Objects.GetValue; + var TextAreaInput = /*#__PURE__*/function (_Scrollable) { _inherits(TextAreaInput, _Scrollable); var _super = _createSuper(TextAreaInput); function TextAreaInput(scene, config) { @@ -33311,7 +33627,7 @@ } // Create inputText - var inputTextConfig = GetValue$l(config, 'text'); + var inputTextConfig = GetValue$e(config, 'text'); var inputText; if (IsGameObject(inputTextConfig)) { inputText = inputTextConfig; @@ -33343,9 +33659,9 @@ expandWidth: expandInputTextWidth, expandHeight: expandInputTextHeight }; - var spaceConfig = GetValue$l(config, 'space', undefined); + var spaceConfig = GetValue$e(config, 'space', undefined); if (spaceConfig) { - spaceConfig.child = GetValue$l(spaceConfig, 'text', 0); + spaceConfig.child = GetValue$e(spaceConfig, 'text', 0); } config.scroller = false; // No scroller supported _this = _super.call(this, scene, config); @@ -33376,7 +33692,7 @@ }, _assertThisInitialized(_this)); // Set initial text if given - var content = GetValue$l(config, 'content', undefined); + var content = GetValue$e(config, 'content', undefined); if (content) { _this.setText(content); } @@ -33430,7 +33746,7 @@ }]); return TextAreaInput; }(Scrollable); - Object.assign(TextAreaInput$1.prototype, SetTextMethods, ScrollMethods); + Object.assign(TextAreaInput.prototype, SetTextMethods, ScrollMethods); var CreateInputTextArea = function CreateInputTextArea(scene, config, deepCloneConfig) { if (deepCloneConfig === undefined) { @@ -33441,138 +33757,104 @@ } else if (!config) { config = {}; } - var inputText = new TextAreaInput$1(scene, config); + var inputText = new TextAreaInput(scene, config); scene.add.existing(inputText); return inputText; }; - var TextAreaInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(TextAreaInput, _InputFiledBase); - var _super = _createSuper(TextAreaInput); - function TextAreaInput(scene, config) { - var _this; - _classCallCheck(this, TextAreaInput); - if (config === undefined) { - config = {}; + var SetInputTextReadOnly$2 = function SetInputTextReadOnly(gameObject, enable) { + if (enable === undefined) { + enable = true; + } + var inputText = gameObject.getElement('inputText'); + inputText.setReadOnly(enable); + }; + var TextAreaInputHandler = { + name: 'TextAreaInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'textarea'; } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.TextAreaInput'; - var inputTextAreaConfig = config.inputTextArea; + return false; + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + this.type = 'rexTweaker.TextAreaInput'; + var inputTextAreaConfig = style.inputTextArea; if (inputTextAreaConfig === undefined) { inputTextAreaConfig = {}; } if (!inputTextAreaConfig.hasOwnProperty('text')) { - inputTextAreaConfig.text = config.inputText; + inputTextAreaConfig.text = style.inputText; } if (!inputTextAreaConfig.hasOwnProperty('slider')) { - inputTextAreaConfig.slider = config.slider; + inputTextAreaConfig.slider = style.slider; } var inputText = CreateInputTextArea(scene, inputTextAreaConfig); - _this.add(inputText, { + gameObject.add(inputText, { proportion: 1, - expand: true + expand: true, + key: 'inputText' }); - _this.addChildrenMap('inputText', inputText); inputText.on('close', function () { - this.setValue(inputText.value); - }, _assertThisInitialized(_this)); - return _this; - } - _createClass(TextAreaInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; - } - if (!this.validate(value)) { - value = this._value; // Back to previous value - } - - var text = this.textFormatCallback ? this.textFormatCallback(value) : value; - this.childrenMap.inputText.setText(text); - _set(_getPrototypeOf(TextAreaInput.prototype), "value", value, this, true); // Fire 'valuechange' event - } - }, { - key: "setInputTextReadOnly", - value: function setInputTextReadOnly(enable) { - if (enable === undefined) { - enable = true; - } - this.childrenMap.inputText.setReadOnly(enable); - return this; + gameObject.setValue(inputText.value); + }); + }, + // Callback inside `setup()` + setup: function setup(gameObject, config, setDefaults) { + if (setDefaults || config.hasOwnProperty('inputTextReadOnly')) { + SetInputTextReadOnly$2(gameObject, !!config.inputTextReadOnly); } - }]); - return TextAreaInput; - }(InputFiledBase); - - var CreateTextAreaInput = function CreateTextAreaInput(scene, config, style) { - var gameObject = new TextAreaInput(scene, style); - scene.add.existing(gameObject); - gameObject.setInputTextReadOnly(!!config.inputTextReadOnly); - return gameObject; + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var inputText = gameObject.getElement('inputText'); + inputText.setText(gameObject.getFotmatText(value)); + } }; - var NumberInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(NumberInput, _InputFiledBase); - var _super = _createSuper(NumberInput); - function NumberInput(scene, config) { - var _this; - _classCallCheck(this, NumberInput); - if (config === undefined) { - config = {}; + var SetInputTextReadOnly$1 = function SetInputTextReadOnly(gameObject, enable) { + if (enable === undefined) { + enable = true; + } + var inputText = gameObject.getElement('inputText'); + inputText.setReadOnly(enable); + }; + var NumberInputHandler = { + name: 'NumberInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'number'; } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.NumberInput'; - var inputTextConfig = config.inputNumber || config.inputText; + return typeof config.value === 'number'; + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.NumberInput'; + var inputTextConfig = style.inputNumber || style.inputText; var inputText = CreateInputText(scene, inputTextConfig).setNumberInput(); - _this.add(inputText, { + gameObject.add(inputText, { proportion: 1, - expand: true + expand: true, + key: 'inputText' }); - _this.addChildrenMap('inputText', inputText); inputText.on('close', function () { - this.setValue(inputText.value); - }, _assertThisInitialized(_this)); - return _this; - } - _createClass(NumberInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; - } - if (!this.validate(value)) { - value = this._value; // Back to previous value - } - - var text = this.textFormatCallback ? this.textFormatCallback(value) : value; - this.childrenMap.inputText.setText(text); - _set(_getPrototypeOf(NumberInput.prototype), "value", value, this, true); // Fire 'valuechange' event - } - }, { - key: "setInputTextReadOnly", - value: function setInputTextReadOnly(enable) { - if (enable === undefined) { - enable = true; - } - this.childrenMap.inputText.setReadOnly(enable); - return this; + gameObject.setValue(inputText.value); + }); + }, + // Callback inside `setup()` + setup: function setup(gameObject, config, setDefaults) { + if (setDefaults || config.hasOwnProperty('inputTextReadOnly')) { + SetInputTextReadOnly$1(gameObject, !!config.inputTextReadOnly); } - }]); - return NumberInput; - }(InputFiledBase); - - var CreateNumberInput = function CreateNumberInput(scene, config, style) { - var gameObject = new NumberInput(scene, style); - scene.add.existing(gameObject); - gameObject.setInputTextReadOnly(!!config.inputTextReadOnly); - return gameObject; + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var inputText = gameObject.getElement('inputText'); + inputText.setText(gameObject.getFotmatText(value)); + } }; var CreateSlider = function CreateSlider(scene, config) { @@ -33581,811 +33863,967 @@ return gameObject; }; - var GetValue$k = Phaser.Utils.Objects.GetValue; + var GetValue$d = Phaser.Utils.Objects.GetValue; var Linear$2 = Phaser.Math.Linear; var SnapFloor = Phaser.Math.Snap.Floor; - var RangeInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(RangeInput, _InputFiledBase); - var _super = _createSuper(RangeInput); - function RangeInput(scene, config) { - var _this; - _classCallCheck(this, RangeInput); - if (config === undefined) { - config = {}; + var SetRange = function SetRange(gameObject, min, max, step) { + gameObject.minValue = min; + gameObject.maxValue = max; + gameObject.step = step; + var slider = gameObject.getElement('slider'); + slider.setGap(step, min, max); + }; + var SetInputTextReadOnly = function SetInputTextReadOnly(gameObject, enable) { + if (enable === undefined) { + enable = true; + } + var inputText = gameObject.getElement('inputText'); + inputText.setReadOnly(enable); + }; + var RangeInputHandler = { + name: 'RangeInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'range'; } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.RangeInput'; - var sliderConfig = config.slider; - var trackSizeKey = _this.orientation === 0 ? 'track.height' : 'track.width'; - var trackSize = GetValue$k(sliderConfig, trackSizeKey); + return typeof config.value === 'number' && config.hasOwnProperty('min') && config.hasOwnProperty('max'); + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.RangeInput'; + var sliderConfig = style.slider; + var trackSizeKey = gameObject.orientation === 0 ? 'track.height' : 'track.width'; + var trackSize = GetValue$d(sliderConfig, trackSizeKey); var slider = CreateSlider(scene, sliderConfig); - var defaultProportion = config.parentOrientation === 1 ? 2 : 0; - var proportion = GetValue$k(config, 'proportion.range.slider', defaultProportion); + var defaultProportion = style.parentOrientation === 1 ? 2 : 0; + var proportion = GetValue$d(style, 'proportion.range.slider', defaultProportion); var expand = trackSize === undefined; - _this.add(slider, { + gameObject.add(slider, { proportion: proportion, - expand: expand + expand: expand, + key: 'slider' }); - var inputTextConfig = config.inputNumber || config.inputText; + var inputTextConfig = style.inputNumber || style.inputText; var inputText = CreateInputText(scene, inputTextConfig).setNumberInput(); - var defaultProportion = config.parentOrientation === 1 ? 1 : 0; - var proportion = GetValue$k(config, 'proportion.range.inputText', defaultProportion); - _this.add(inputText, { + var defaultProportion = style.parentOrientation === 1 ? 1 : 0; + var proportion = GetValue$d(style, 'proportion.range.inputText', defaultProportion); + gameObject.add(inputText, { proportion: proportion, - expand: true + expand: true, + key: 'inputText' }); - _this.addChildrenMap('slider', slider); - _this.addChildrenMap('inputText', inputText); inputText.on('close', function () { - this.setValue(inputText.value); - }, _assertThisInitialized(_this)); + gameObject.setValue(inputText.value); + }); slider.on('valuechange', function () { - var value = Linear$2(this.minValue, this.maxValue, slider.value); - if (this.step) { - value = SnapFloor(value, this.step, this.minValue); + var value = Linear$2(gameObject.minValue, gameObject.maxValue, slider.value); + if (gameObject.step) { + value = SnapFloor(value, gameObject.step, gameObject.minValue); } - this.setValue(value); - }, _assertThisInitialized(_this)); + gameObject.setValue(value); + }); + }, + // Callback inside `setup()` + setup: function setup(gameObject, config, setDefaults) { + if (setDefaults || config.hasOwnProperty('max')) { + SetRange(gameObject, config.min, config.max, config.step); + } + if (setDefaults || config.hasOwnProperty('inputTextReadOnly')) { + SetInputTextReadOnly(gameObject, !!config.inputTextReadOnly); + } + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var slider = gameObject.getElement('slider'); + slider.setValue(value, gameObject.minValue, gameObject.maxValue); + var inputText = gameObject.getElement('inputText'); + inputText.setText('').setText(gameObject.getFotmatText(value)); + } + }; + + var CreateSwatch = function CreateSwatch(scene, config) { + if (config === false) { + return null; + } else if (IsGameObject(config)) { + return config; + } + var swatch = new RoundRectangle$1(scene, config); + scene.add.existing(swatch); + return swatch; + }; + + var ColorNames = ['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']; + var ColorValues = [0xf0f8ff, 0xfaebd7, 0x00ffff, 0x7fffd4, 0xf0ffff, 0xf5f5dc, 0xffe4c4, 0x000000, 0xffebcd, 0x0000ff, 0x8a2be2, 0xa52a2a, 0xdeb887, 0x5f9ea0, 0x7fff00, 0xd2691e, 0xff7f50, 0x6495ed, 0xfff8dc, 0xdc143c, 0x00ffff, 0x00008b, 0x008b8b, 0xb8860b, 0xa9a9a9, 0xa9a9a9, 0x006400, 0xbdb76b, 0x8b008b, 0x556b2f, 0xff8c00, 0x9932cc, 0x8b0000, 0xe9967a, 0x8fbc8f, 0x483d8b, 0x2f4f4f, 0x2f4f4f, 0x00ced1, 0x9400d3, 0xff1493, 0x00bfff, 0x696969, 0x696969, 0x1e90ff, 0xb22222, 0xfffaf0, 0x228b22, 0xff00ff, 0xdcdcdc, 0xf8f8ff, 0xffd700, 0xdaa520, 0x808080, 0x808080, 0x008000, 0xadff2f, 0xf0fff0, 0xff69b4, 0xcd5c5c, 0x4b0082, 0xfffff0, 0xf0e68c, 0xe6e6fa, 0xfff0f5, 0x7cfc00, 0xfffacd, 0xadd8e6, 0xf08080, 0xe0ffff, 0xfafad2, 0xd3d3d3, 0xd3d3d3, 0x90ee90, 0xffb6c1, 0xffa07a, 0x20b2aa, 0x87cefa, 0x778899, 0x778899, 0xb0c4de, 0xffffe0, 0x00ff00, 0x32cd32, 0xfaf0e6, 0xff00ff, 0x800000, 0x66cdaa, 0x0000cd, 0xba55d3, 0x9370db, 0x3cb371, 0x7b68ee, 0x00fa9a, 0x48d1cc, 0xc71585, 0x191970, 0xf5fffa, 0xffe4e1, 0xffe4b5, 0xffdead, 0x000080, 0xfdf5e6, 0x808000, 0x6b8e23, 0xffa500, 0xff4500, 0xda70d6, 0xeee8aa, 0x98fb98, 0xafeeee, 0xdb7093, 0xffefd5, 0xffdab9, 0xcd853f, 0xffc0cb, 0xdda0dd, 0xb0e0e6, 0x800080, 0x663399, 0xff0000, 0xbc8f8f, 0x4169e1, 0x8b4513, 0xfa8072, 0xf4a460, 0x2e8b57, 0xfff5ee, 0xa0522d, 0xc0c0c0, 0x87ceeb, 0x6a5acd, 0x708090, 0x708090, 0xfffafa, 0x00ff7f, 0x4682b4, 0xd2b48c, 0x008080, 0xd8bfd8, 0xff6347, 0x40e0d0, 0xee82ee, 0xf5deb3, 0xffffff, 0xf5f5f5, 0xffff00, 0x9acd32]; + var ColorNameToIntegerDict = {}, + name; + for (var i = 0, cnt = ColorNames.length; i < cnt; i++) { + name = ColorNames[i].toLowerCase(); + ColorNameToIntegerDict[name] = ColorValues[i]; + } + var ColorNameToInteger = function ColorNameToInteger(colorName) { + colorName = colorName.toLowerCase(); + if (ColorNameToIntegerDict.hasOwnProperty(colorName)) { + return ColorNameToIntegerDict[colorName]; + } else { + return null; + } + }; + + var ColorStringToInteger = function ColorStringToInteger(value) { + if (typeof value !== 'string') { + return value; + } + if (value.startsWith('#')) { + value = parseInt(value.substring(1), 16); + } else if (value.startsWith('0x')) { + value = parseInt(value.substring(2), 16); + } else { + value = ColorNameToInteger(value); + } + return value; + }; + + var Pad = Phaser.Utils.String.Pad; + var GetHexColorString = function GetHexColorString(value, prefix) { + if (prefix === undefined) { + prefix = '0x'; + } + var colorString = value.toString(16).toUpperCase(); + colorString = Pad(colorString, 6, 0, 1); + colorString = prefix + colorString; + return colorString; + }; + + var SetSwatchColor = function SetSwatchColor(swatch, color) { + if (!swatch) { + return; + } + if (swatch.setTint) { + swatch.setTint(color); + } else if (swatch.setFillStyle) { + swatch.setFillStyle(color); + } + }; + + var GetValue$c = Phaser.Utils.Objects.GetValue; + var IsPlainObject$2 = Phaser.Utils.Objects.IsPlainObject; + var Clamp$1 = Phaser.Math.Clamp; + var ColorInput$1 = /*#__PURE__*/function (_Sizer) { + _inherits(ColorInput, _Sizer); + var _super = _createSuper(ColorInput); + function ColorInput(scene, config) { + var _this; + _classCallCheck(this, ColorInput); + if (config === undefined) { + config = {}; + } + config.orientation = 0; + _this = _super.call(this, scene, config); + _this.type = 'rexColorInputLite'; + + // Add elements + var background = GetValue$c(config, 'background', undefined); + var swatchConfig = GetValue$c(config, 'swatch'); + var swatchSize; + if (IsPlainObject$2(swatchConfig)) { + swatchSize = GetValue$c(swatchConfig, 'size'); + } + var swatch = CreateSwatch(scene, GetValue$c(config, 'swatch')); + var inputTextConfig = GetValue$c(config, 'inputText', true); + var inputText; + if (inputTextConfig) { + inputText = CreateInputText(scene, inputTextConfig); + } + if (background) { + _this.addBackground(background); + } + if (swatch) { + swatchSize = GetValue$c(config, 'swatchSize', swatchSize); + var squareExpandSwatch; + if (swatchSize !== undefined) { + ResizeGameObject(swatch, swatchSize, swatchSize); + squareExpandSwatch = false; + } else { + squareExpandSwatch = GetValue$c(config, 'squareExpandSwatch', true); + } + var fitRatio = squareExpandSwatch ? 1 : 0; + _this.add(swatch, { + proportion: 0, + expand: false, + fitRatio: fitRatio + }); + } + if (inputText) { + var proportion = GetValue$c(inputTextConfig, 'width') === undefined ? 1 : 0; + var expand = GetValue$c(inputTextConfig, 'height') === undefined ? true : false; + _this.add(inputText, { + proportion: proportion, + expand: expand + }); + } + _this.addChildrenMap('background', background); + _this.addChildrenMap('swatch', swatch); + _this.addChildrenMap('inputText', inputText); + if (inputText) { + inputText.on('close', function () { + this.setValue(inputText.value); + }, _assertThisInitialized(_this)); + } + var callback = GetValue$c(config, 'valuechangeCallback', null); + if (callback !== null) { + var scope = GetValue$c(config, 'valuechangeCallbackScope', undefined); + _this.on('valuechange', callback, scope); + } + _this.setValue(GetValue$c(config, 'value', 0x0)); return _this; } - _createClass(RangeInput, [{ + _createClass(ColorInput, [{ key: "value", get: function get() { return this._value; }, set: function set(value) { + if (typeof value === 'string') { + value = ColorStringToInteger(value); + if (value == null) { + var inputText = this.childrenMap.inputText; + if (inputText) { + inputText.setText(GetHexColorString(this._value)); + } + return; + } + } else { + value = Clamp$1(Math.floor(value), 0, 0xffffff); + } if (this._value === value) { return; } - if (!this.validate(value)) { - value = this._value; // Back to previous value + this._value = value; + var swatch = this.childrenMap.swatch; + if (swatch) { + SetSwatchColor(swatch, value); + } + var inputText = this.childrenMap.inputText; + if (inputText) { + inputText.setText(GetHexColorString(value)); } - - var text = this.textFormatCallback ? this.textFormatCallback(value) : value; - this.childrenMap.inputText.setText('').setText(text); - this.childrenMap.slider.setValue(value, this.minValue, this.maxValue); - _set(_getPrototypeOf(RangeInput.prototype), "value", value, this, true); // Fire 'valuechange' event + this.emit('valuechange', this._value); } }, { - key: "setRange", - value: function setRange(min, max, step) { - this.minValue = min; - this.maxValue = max; - this.step = step; - this.childrenMap.slider.setGap(step, min, max); + key: "setValue", + value: function setValue(value) { + this.value = value; return this; } }, { - key: "setInputTextReadOnly", - value: function setInputTextReadOnly(enable) { - if (enable === undefined) { - enable = true; - } - this.childrenMap.inputText.setReadOnly(enable); + key: "color", + get: function get() { + return this._value; + }, + set: function set(color) { + this.value = color; + } + }, { + key: "setColor", + value: function setColor(color) { + this.color = color; return this; } }]); - return RangeInput; - }(InputFiledBase); - - var CreateRangeInput = function CreateRangeInput(scene, config, style) { - var gameObject = new RangeInput(scene, style); - scene.add.existing(gameObject); - gameObject.setRange(config.min, config.max, config.step); - gameObject.setInputTextReadOnly(!!config.inputTextReadOnly); - return gameObject; - }; - - var BuildListConfig = function BuildListConfig(scene, config, creators) { - config = config ? DeepClone(config) : {}; - if (creators === undefined) { - creators = {}; - } - var labelConfig = config.label || config.button; - var listButtonConfig = config.button || config.label; - delete config.label; - delete config.button; - var labelCreator = creators.label || creators.button || creators; - var listButtonCreator = creators.button || creators.label || creators; - var listConfig = BuildLabelConfig(scene, labelConfig, labelCreator); - listConfig.list = config.list || {}; - listConfig.list.createButtonCallback = function (scene, option) { - var gameObject = CreateLabel(scene, listButtonConfig, listButtonCreator).resetDisplayContent({ - text: option.text - }); - if (option.hasOwnProperty('value')) { - gameObject.value = option.value; - } - return gameObject; - }; - listConfig.list.onButtonOver = function (button, index, pointer, event) { - if (button.setHoverState) { - button.setHoverState(true); - } - }; - listConfig.list.onButtonOut = function (button, index, pointer, event) { - if (button.setHoverState) { - button.setHoverState(false); - } - }; - return listConfig; - }; + return ColorInput; + }(Sizer); - var methods$5 = { - setWrapEnable: function setWrapEnable(enable) { - if (enable === undefined) { - enable = true; - } - this.listWrapEnable = enable; - return this; - }, - setCreateButtonCallback: function setCreateButtonCallback(callback) { - this.listCreateButtonCallback = callback; - return this; - }, - setCreateListBackgroundCallback: function setCreateListBackgroundCallback(callback) { - this.listCreateBackgroundCallback = callback; - return this; - }, - setButtonClickCallback: function setButtonClickCallback(callback) { - this.listOnButtonClick = callback; - return this; - }, - setButtonOverCallback: function setButtonOverCallback(callback) { - this.listOnButtonOver = callback; + var methods$4 = { + // Color picker + setCreateColorPickerBackgroundCallback: function setCreateColorPickerBackgroundCallback(callback) { + this.colorPickerCreateBackgroundCallback = callback; return this; }, - setButtonOutCallback: function setButtonOutCallback(callback) { - this.listOnButtonOut = callback; + setColorPickerHPalettePosition: function setColorPickerHPalettePosition(position) { + this.colorPickerHPalettePosition = position; return this; }, - setListExpandDirection: function setListExpandDirection(direction) { + setColorPickerExpandDirection: function setColorPickerExpandDirection(direction) { if (typeof direction === 'string') { - direction = ListExpandDirections[direction]; + direction = ColorPickerExpandDirections[direction]; } - this.listExpandDirection = direction; + this.colorPickerExpandDirection = direction; return this; }, - setListEaseInDuration: function setListEaseInDuration(duration) { + setColorPickerEaseInDuration: function setColorPickerEaseInDuration(duration) { if (duration === undefined) { duration = 0; } - this.listEaseInDuration = duration; + this.colorPickerEaseInDuration = duration; return this; }, - setListEaseOutDuration: function setListEaseOutDuration(duration) { + setColorPickerEaseOutDuration: function setColorPickerEaseOutDuration(duration) { if (duration === undefined) { duration = 0; } - this.listEaseOutDuration = duration; + this.colorPickerEaseOutDuration = duration; return this; }, - setListTransitInCallback: function setListTransitInCallback(callback) { - this.listTransitInCallback = callback; + setColorPickerTransitInCallback: function setColorPickerTransitInCallback(callback) { + this.colorPickerTransitInCallback = callback; // callback = function(gameObject, duration) {} return this; }, - settListTransitOutCallback: function settListTransitOutCallback(callback) { - this.listTransitOutCallback = callback; + setColorPickerTransitOutCallback: function setColorPickerTransitOutCallback(callback) { + this.colorPickerTransitOutCallback = callback; // callback = function(gameObject, duration) {} return this; }, - setListBounds: function setListBounds(bounds) { - this.listBounds = bounds; + setColorPickerBounds: function setColorPickerBounds(bounds) { + this.colorPickerBounds = bounds; return this; }, - setListWidth: function setListWidth(width) { - this.listWidth = width; + setColorPickerWidth: function setColorPickerWidth(width) { + this.colorPickerWidth = width; return this; }, - setListHeight: function setListHeight(height) { - this.listHeight = height; + setColorPickerHeight: function setColorPickerHeight(height) { + this.colorPickerHeight = height; return this; }, - setListSize: function setListSize(width, height) { - this.setListWidth(width).setListHeight(height); + setColorPickerSize: function setColorPickerSize(width, height) { + this.setColorPickerWidth(width).setColorPickerHeight(height); return this; }, - setListAlignmentMode: function setListAlignmentMode(mode) { - this.listAlignMode = mode; + setColorPickerSpace: function setColorPickerSpace(space) { + if (space === undefined) { + space = {}; + } + this.colorPickerSpace = space; return this; }, - setListAlignmentSide: function setListAlignmentSide(side) { - if (side === undefined) { - side = ''; - } - this.listAlignSide = side; + // Color components + setColorComponentsHeight: function setColorComponentsHeight(height) { + this.colorComponentsHeight = height; return this; }, - setListSpace: function setListSpace(space) { - if (space === undefined) { - space = {}; - } - this.listSpace = space; + setColorComponentsFormatLabelConfig: function setColorComponentsFormatLabelConfig(config) { + this.colorComponentsFormatLabelConfig = config; return this; }, - setListDraggable: function setListDraggable(enable) { - if (enable === undefined) { - enable = true; + setColorComponentsInputTextConfig: function setColorComponentsInputTextConfig(config) { + this.colorComponentsInputTextConfig = config; + return this; + }, + setColorComponentsSpace: function setColorComponentsSpace(space) { + if (space === undefined) { + space = {}; } - this.listDraggable = enable; + this.colorComponentsSpace = space; return this; } }; - var ListExpandDirections = { + var ColorPickerExpandDirections = { down: 0, up: 1 }; - var CreateListPanel = function CreateListPanel() { - var scene = this.scene; - var background; - var createBackgroundCallback = this.listCreateBackgroundCallback; - if (createBackgroundCallback) { - background = createBackgroundCallback.call(this, scene); - scene.add.existing(background); - } - var buttons = []; - var createButtonCallback = this.listCreateButtonCallback; - if (createButtonCallback) { - var options = this.options; - for (var i = 0, cnt = options.length; i < cnt; i++) { - var button = createButtonCallback.call(this, scene, options[i], i, options); - scene.add.existing(button); - buttons.push(button); - } - } - var width = this.listWidth; - if (width === undefined) { - if (this.listAlignMode === 'text') { - width = this.getElement('text').width; - } else { - width = this.width; - } - } - var height = this.listHeight; - var listPanel; - if (!this.listWrapEnable) { - listPanel = new Buttons$1(scene, { - width: width, - height: height, - orientation: 'y', - background: background, - buttons: buttons, - space: this.listSpace, - draggable: this.listDraggable + var LoadImageMethods = { + loadFromURL: function loadFromURL(url, callback) { + var self = this; + var img = new Image(); + img.onload = function () { + if (self.width !== img.width || self.height !== img.height) { + self.resize(img.width, img.height); + } else { + self.clear(); + } + self.context.drawImage(img, 0, 0); + self.updateTexture(); + if (callback) { + callback(); + } + img.onload = null; + img.src = ''; + img.remove(); + }; + img.src = url; + return this; + }, + loadFromURLPromise: function loadFromURLPromise(url) { + var self = this; + return new Promise(function (resolve, reject) { + self.loadFromURL(url, resolve); }); - } else { - listPanel = new Buttons(scene, { - width: width, - height: height, - background: background, - buttons: buttons, - space: this.listSpace, - draggable: this.listDraggable + }, + loadFromFile: function loadFromFile(file, callback) { + var url = URL.createObjectURL(file); + this.loadFromURL(url, function () { + URL.revokeObjectURL(url); + if (callback) { + callback(); + } + }); + return this; + }, + loadFromFilePromise: function loadFromFilePromise(file) { + var self = this; + return new Promise(function (resolve, reject) { + self.loadFromFile(file, resolve); }); } - scene.add.existing(listPanel); - return listPanel; - }; - - var ScaleDown = function ScaleDown(gameObject, duration, orientation, ease, scale) { - if (ease === undefined) { - ease = 'Linear'; - } - var config = {}; - config.mode = 0; - switch (orientation) { - case 0: - case 'x': - config.end = { - x: 0 - }; - break; - case 1: - case 'y': - config.end = { - y: 0 - }; - break; - default: - config.end = 0; - break; - } - config.duration = duration; - config.ease = ease; - if (scale === undefined) { - scale = new Scale$1(gameObject, config); - } else { - scale.resetFromJSON(config); - } - scale.restart(); - return scale; }; - var GetValueFromAliasKeys = function GetValueFromAliasKeys(source, key0, key1, key2, defaultValue) { - if (HasValue(source, key0)) { - return GetValue$1I(source, key0); - } else if (key1 && HasValue(source, key1)) { - return GetValue$1I(source, key1); - } else if (key2 && HasValue(source, key2)) { - return GetValue$1I(source, key2); - } else { - return defaultValue; + var Canvas = /*#__PURE__*/function (_CanvasBase) { + _inherits(Canvas, _CanvasBase); + var _super = _createSuper(Canvas); + function Canvas() { + _classCallCheck(this, Canvas); + return _super.apply(this, arguments); } - }; + return _createClass(Canvas); + }(Canvas$1); + Object.assign(Canvas.prototype, LoadImageMethods); - var GetValue$j = Phaser.Utils.Objects.GetValue; - var SetPosition = function SetPosition(gameObject, config) { - var expandDirection = GetValue$j(config, 'expandDirection', undefined); - if (typeof expandDirection === 'string') { - expandDirection = ExpandDirections[expandDirection]; + var Color$3 = Phaser.Display.Color; + var Percent$2 = Phaser.Math.Percent; + var DrawHPalette = function DrawHPalette(canvas, context, verticalMode) { + if (verticalMode === undefined) { + verticalMode = false; } - var alignTargetX = GetValueFromAliasKeys(config, 'alignTarget', 'alignTargetX'); - var alignTargetY = GetValue$j(config, 'alignTargetY', alignTargetX); - var alignOffsetX = GetValue$j(config, 'alignOffsetX', 0); - var alignOffsetY = GetValue$j(config, 'alignOffsetY', 0); - var alignSide = GetValue$j(config, 'alignSide', ''); - var alignRight = alignSide.includes('right'); - var positionBounds = GetValue$j(config, 'bounds'); - - // Expand direction - var isExpandDown = expandDirection === 0; - var isExpandUp = expandDirection === 1; - var flexExpand = !isExpandDown && !isExpandUp; - var originX = alignRight ? 1 : 0; - var originY = isExpandDown || flexExpand ? 0 : 1; - gameObject.setOrigin(originX, originY); - var x, y; - if (alignRight) { - x = alignTargetX.getTopRight().x; + var width = canvas.width; + var height = canvas.height; + var color = new Color$3(); + if (verticalMode) { + for (var iy = 0; iy < height; iy++) { + var h = Percent$2(iy, 0, height); + color.setFromHSV(h, 1, 1); + context.fillStyle = color.rgba; + context.fillRect(0, iy, width, 1); + } } else { - x = alignTargetX.getTopLeft().x; - } - y = alignTargetY.getBottomLeft().y; - gameObject.setPosition(x + alignOffsetX, y + alignOffsetY); - var bounds = positionBounds; - if (!bounds) { - bounds = GetViewport(gameObject.scene); - } - if (flexExpand && gameObject.getBottomLeft().y > bounds.bottom) { - // Out of bounds, can't put list-panel below parent - y = alignTargetY.getTopLeft().y; - gameObject.setOrigin(0, 1).setPosition(x + alignOffsetX, y + alignOffsetY); + for (var ix = 0; ix < width; ix++) { + var h = Percent$2(ix, 0, width); + color.setFromHSV(h, 1, 1); + context.fillStyle = color.rgba; + context.fillRect(ix, 0, 1, height); + } } }; - var ExpandDirections = { - down: 0, - up: 1 + var DrawSVPalette = function DrawSVPalette(canvas, context, h) { + var width = canvas.width; + var height = canvas.height; + var imgData = context.getImageData(0, 0, width, height); + var data = imgData.data; + var color = new Color$3(); + for (var iy = 0; iy < height; iy++) { + for (var ix = 0; ix < width; ix++) { + var s = Percent$2(ix, 0, width); + var v = 1 - Percent$2(iy, 0, height); + color.setFromHSV(h, s, v); + var i = (iy * width + ix) * 4; + data[i] = color.red; + data[i + 1] = color.green; + data[i + 2] = color.blue; + data[i + 3] = 255; + } + } + context.putImageData(imgData, 0, 0); }; - var GetValue$i = Phaser.Utils.Objects.GetValue; - var DropDown = /*#__PURE__*/function (_OpenCloseTransition) { - _inherits(DropDown, _OpenCloseTransition); - var _super = _createSuper(DropDown); - function DropDown(gameObject, config) { + var Color$2 = Phaser.Display.Color; + var Percent$1 = Phaser.Math.Percent; + var ColorToRGBA$2 = Phaser.Display.Color.ColorToRGBA; + var HSVToRGB$2 = Phaser.Display.Color.HSVToRGB; + var HPaletteCanvas = /*#__PURE__*/function (_Canvas) { + _inherits(HPaletteCanvas, _Canvas); + var _super = _createSuper(HPaletteCanvas); + function HPaletteCanvas(scene, x, y, width, height, orientation) { var _this; - _classCallCheck(this, DropDown); - if (config === undefined) { - config = {}; - } - if (config.transitIn == null) { - config.transitIn = function (gameObject, duration) { - PopUp(gameObject, duration, 'y', 'Cubic'); - }; - } - if (config.transitOut == null) { - config.transitOut = function (gameObject, duration) { - // Don't destroy here - ScaleDown(gameObject, duration, 'y', 'Linear'); - }; + _classCallCheck(this, HPaletteCanvas); + if (x === undefined) { + x = 0; } - config.manualClose = true; - config.clickOutsideClose = true; - config.destroy = true; - _this = _super.call(this, gameObject, config); - // this.parent = gameObject; - // this.scene - - SetPosition(gameObject, config); - if (gameObject.isRexSizer) { - gameObject.layout(); + if (y === undefined) { + y = 0; } - - // Close conditions: - var touchOutsideClose = GetValue$i(config, 'touchOutsideClose', false); - var anyTouchClose = GetValue$i(config, 'anyTouchClose', false); - if (anyTouchClose) { - touchOutsideClose = false; + if (width === undefined) { + width = 2; } - - // Registet touch-close event after opened - if (anyTouchClose) { - _this.once('open', _this.anyTouchClose, _assertThisInitialized(_this)); - } else if (touchOutsideClose) { - _this.once('open', _this.touchOutsideClose, _assertThisInitialized(_this)); + if (height === undefined) { + height = 2; } - _this.requestOpen(); + _this = _super.call(this, scene, x, y, width, height); + _this.type = 'rexColorPicker.HPaletteCanvas'; + _this.colorObject = new Color$2(); + _this.setOrientation(orientation); + _this.setSize(width, height); return _this; } - _createClass(DropDown, [{ - key: "shutdown", - value: function shutdown(fromScene) { - // Already shutdown - if (this.isShutdown) { - return; - } - - // Registered in touchOutsideClose() - this.scene.input.off('pointerup', this.touchCloseCallback, this); - _get(_getPrototypeOf(DropDown.prototype), "shutdown", this).call(this, fromScene); + _createClass(HPaletteCanvas, [{ + key: "setOrientation", + value: function setOrientation(orientation) { + this.orientation = GetOrientationMode(orientation); + return this; } }, { - key: "touchOutsideClose", - value: function touchOutsideClose() { - this.scene.input.on('pointerup', this.touchCloseCallback, this); - this.clickOutsideTest = true; + key: "updateTexture", + value: function updateTexture() { + DrawHPalette(this.canvas, this.context, this.orientation); + _get(_getPrototypeOf(HPaletteCanvas.prototype), "updateTexture", this).call(this); return this; } }, { - key: "anyTouchClose", - value: function anyTouchClose() { - this.scene.input.once('pointerup', this.touchCloseCallback, this); - return this; + key: "color", + get: function get() { + return this.colorObject.color; } }, { - key: "touchCloseCallback", - value: function touchCloseCallback(pointer) { - if (this.clickOutsideTest && IsPointInBounds(this.parent, pointer.worldX, pointer.worldY)) { - return; + key: "hue", + get: function get() { + return this._hue; + }, + set: function set(value) { + this._hue = value; + } + }, { + key: "getHue", + value: function getHue(localX, localY) { + if (localX === undefined) { + return this.hue; } - this.requestClose(); + if (this.orientation === 0) { + this.hue = Percent$1(localX, 0, this.width); + } else { + this.hue = Percent$1(localY, 0, this.height); + } + return this.hue; } }, { - key: "onOpen", - value: function onOpen() { - this.emit('open', this.parent, this); - _get(_getPrototypeOf(DropDown.prototype), "onOpen", this).call(this); + key: "getColor", + value: function getColor(localX, localY) { + if (localX === undefined) { + return this.color; + } + var h = this.getHue(localX, localY); + this.colorObject.setFromRGB(HSVToRGB$2(h, 1, 1)); + return this.colorObject.color; } }, { - key: "onClose", - value: function onClose() { - this.emit('close', this.parent, this); - _get(_getPrototypeOf(DropDown.prototype), "onClose", this).call(this); + key: "setColor", + value: function setColor(color) { + if (this.color === color) { + return this; + } + return this; + } + }, { + key: "colorToLocalPosition", + value: function colorToLocalPosition(color, out) { + if (out === undefined) { + out = {}; + } else if (out === true) { + if (LocalXY$1 === undefined) { + LocalXY$1 = {}; + } + out = LocalXY$1; + } + this.colorObject.setFromRGB(ColorToRGBA$2(color)); + if (this.orientation === 0) { + out.x = this.width * this.colorObject.h; + out.y = this.height / 2; + } else { + out.x = this.width / 2; + out.y = this.height * this.colorObject.h; + } + return out; } }]); - return DropDown; - }(OpenCloseTransition); - - var OpenListPanel = function OpenListPanel() { - if (this.listPanel) { - return this; - } - var listPanel = CreateListPanel.call(this); + return HPaletteCanvas; + }(Canvas); + var LocalXY$1 = undefined; - // Button over/out - listPanel.on('button.over', function (button, index, pointer, event) { - if (this.listOnButtonOver) { - this.listOnButtonOver.call(this, button, index, pointer, event); - } - this.emit('button.over', this, listPanel, button, index, pointer, event); - }, this).on('button.out', function (button, index, pointer, event) { - if (this.listOnButtonOut) { - this.listOnButtonOut.call(this, button, index, pointer, event); + var RotateAround = Phaser.Math.RotateAround; + var LocalToWorld = function LocalToWorld(gameObject, localX, localY, out) { + if (out === undefined) { + out = {}; + } else if (out === true) { + if (GlobOut === undefined) { + GlobOut = {}; } - this.emit('button.out', this, listPanel, button, index, pointer, event); - }, this); - var alignTargetX; - if (!this.listAlignMode || this.listAlignMode === 'label') { - alignTargetX = this; - } else { - alignTargetX = this.getElement(this.listAlignMode); - } - var dropDownBehavior = new DropDown(listPanel, { - // Transition - duration: { - "in": this.listEaseInDuration, - out: this.listEaseOutDuration - }, - transitIn: this.listTransitInCallback, - transitOut: this.listTransitOutCallback, - // Position - expandDirection: this.listExpandDirection, - alignTargetX: alignTargetX, - alignTargetY: this, - alignSide: this.listAlignSide, - bounds: this.listBounds, - // Close condition - anyTouchClose: true - }).on('open', function () { - // After popping up - // Can click - listPanel.on('button.click', function (button, index, pointer, event) { - if (this.listOnButtonClick) { - this.listOnButtonClick.call(this, button, index, pointer, event); - } - this.emit('button.click', this, listPanel, button, index, pointer, event); - }, this); - this.emit('list.open', this, listPanel); - }, this).on('close', function () { - this.listPanel = undefined; - this.dropDownBehavior = undefined; - }, this); - this.listPanel = listPanel; - this.dropDownBehavior = dropDownBehavior; - this.pin(listPanel); - return this; - }; - - var CloseListPanel = function CloseListPanel() { - if (!this.dropDownBehavior) { - return this; - } - this.dropDownBehavior.requestClose(); - return this; - }; - - var ToggleListPanel = function ToggleListPanel() { - if (!this.listPanel) { - this.openListPanel(); - } else { - this.closeListPanel(); + out = GlobOut; } - return this; - }; - - var Methods = { - openListPanel: OpenListPanel, - closeListPanel: CloseListPanel, - toggleListPanel: ToggleListPanel + localX -= gameObject.width * gameObject.originX; + localY -= gameObject.height * gameObject.originY; + var point = { + x: localX * gameObject.scaleX, + y: localY * gameObject.scaleY + }; + RotateAround(point, 0, 0, -gameObject.rotation); + out.x = gameObject.x + localX; + out.y = gameObject.y + localY; + return out; }; - Object.assign(Methods, methods$5); + var GlobOut; - var GetValue$h = Phaser.Utils.Objects.GetValue; - var DropDownList = /*#__PURE__*/function (_Label) { - _inherits(DropDownList, _Label); - var _super = _createSuper(DropDownList); - function DropDownList(scene, config) { + var HPalette = /*#__PURE__*/function (_OverlapSizer) { + _inherits(HPalette, _OverlapSizer); + var _super = _createSuper(HPalette); + function HPalette(scene, config) { var _this; - _classCallCheck(this, DropDownList); + _classCallCheck(this, HPalette); + if (config === undefined) { + config = {}; + } _this = _super.call(this, scene, config); - _this.type = 'rexDropDownList'; - _this.timer = undefined; - _this.setOptions(GetValue$h(config, 'options')); - var listConfig = GetValue$h(config, 'list'); - _this.setWrapEnable(GetValue$h(listConfig, 'wrap', false)); - _this.setCreateButtonCallback(GetValue$h(listConfig, 'createButtonCallback')); - _this.setCreateListBackgroundCallback(GetValue$h(listConfig, 'createBackgroundCallback')); - _this.setButtonClickCallback(GetValue$h(listConfig, 'onButtonClick')); - _this.setButtonOverCallback(GetValue$h(listConfig, 'onButtonOver')); - _this.setButtonOutCallback(GetValue$h(listConfig, 'onButtonOut')); - _this.setListExpandDirection(GetValue$h(listConfig, 'expandDirection')); - _this.setListEaseInDuration(GetValue$h(listConfig, 'easeIn', 500)); - _this.setListEaseOutDuration(GetValue$h(listConfig, 'easeOut', 100)); - _this.setListTransitInCallback(GetValue$h(listConfig, 'transitIn')); - _this.settListTransitOutCallback(GetValue$h(listConfig, 'transitOut')); - _this.setListSize(GetValue$h(listConfig, 'width'), GetValue$h(listConfig, 'height')); - _this.setListAlignmentMode(GetValue$h(listConfig, 'alignParent', 'text')); - _this.setListAlignmentSide(GetValue$h(listConfig, 'alignSide', '')); - _this.setListBounds(GetValue$h(listConfig, 'bounds')); - _this.setListSpace(GetValue$h(listConfig, 'space')); - _this.setListDraggable(GetValue$h(listConfig, 'draggable', false)); - _this.setValueChangeCallback(GetValue$h(config, 'setValueCallback'), GetValue$h(config, 'setValueCallbackScope')); - _this.setValue(GetValue$h(config, 'value')); - _this.onClick(_this.toggleListPanel, _assertThisInitialized(_this)); + var orientation = config.width != null ? 1 : 0; + var paletteCanvas = new HPaletteCanvas(scene).setOrientation(orientation); + scene.add.existing(paletteCanvas); + _this.type = 'rexColorPicker.HPalette'; + paletteCanvas.setInteractive().on('pointerdown', _this.onPaletteCanvasPointerDown, _assertThisInitialized(_this)).on('pointermove', _this.onPaletteCanvasPointerDown, _assertThisInitialized(_this)); + var marker = new RoundRectangle$1(scene, { + strokeColor: 0xffffff, + strokeWidth: 2 + }); + scene.add.existing(marker); + _this.add(paletteCanvas, { + key: 'paletteCanvas', + expand: true + }).add(marker, { + key: 'marker', + expand: false + }); return _this; } - _createClass(DropDownList, [{ - key: "destroy", - value: function destroy(fromScene) { - // This Game Object has already been destroyed - if (!this.scene || this.ignoreDestroy) { - return; - } - if (this.listPanel) { - this.listPanel.destroy(fromScene); - this.listPanel = undefined; - } - _get(_getPrototypeOf(DropDownList.prototype), "destroy", this).call(this, fromScene); - } - }, { - key: "setOptions", - value: function setOptions(options) { - if (options === undefined) { - options = []; + _createClass(HPalette, [{ + key: "resize", + value: function resize(width, height) { + if (this.width === width && this.height === height) { + return this; } - this.options = options; + _get(_getPrototypeOf(HPalette.prototype), "resize", this).call(this, width, height); + var size = Math.min(width, height); + this.childrenMap.marker.setSize(size, size); return this; } }, { - key: "setValueChangeCallback", - value: function setValueChangeCallback(callback, scope) { - this.valueChangeCallback = callback; - this.valueChangeCallbackScope = scope; + key: "onPaletteCanvasPointerDown", + value: function onPaletteCanvasPointerDown(pointer, localX, localY, event) { + if (!pointer.isDown) { + return; + } + var paletteCanvas = this.childrenMap.paletteCanvas; + var color = paletteCanvas.getColor(localX, localY); + this.setMarkerPosition(color); + this.emit('input', color); + } + }, { + key: "color", + get: function get() { + return this.childrenMap.paletteCanvas.color; + } + }, { + key: "setColor", + value: function setColor(color) { + if (this.color === color) { + return this; + } + var paletteCanvas = this.childrenMap.paletteCanvas; + paletteCanvas.setColor(color); + this.setMarkerPosition(color); return this; } }, { - key: "setValue", - value: function setValue(value) { - this.value = value; + key: "setMarkerPosition", + value: function setMarkerPosition(color) { + var paletteCanvas = this.childrenMap.paletteCanvas; + var marker = this.childrenMap.marker; + var localXY = paletteCanvas.colorToLocalPosition(color, true); + LocalToWorld(paletteCanvas, localXY.x, localXY.y, marker); + this.resetChildPositionState(marker); return this; } }, { - key: "value", + key: "getHue", + value: function getHue(localX, localY) { + var paletteCanvas = this.childrenMap.paletteCanvas; + return paletteCanvas.getHue(localX, localY); + } + }]); + return HPalette; + }(OverlapSizer); + + var Color$1 = Phaser.Display.Color; + var Percent = Phaser.Math.Percent; + var ColorToRGBA$1 = Phaser.Display.Color.ColorToRGBA; + var HSVToRGB$1 = Phaser.Display.Color.HSVToRGB; + var SVPaletteCanvas = /*#__PURE__*/function (_Canvas) { + _inherits(SVPaletteCanvas, _Canvas); + var _super = _createSuper(SVPaletteCanvas); + function SVPaletteCanvas(scene, x, y, width, height, hue) { + var _this; + _classCallCheck(this, SVPaletteCanvas); + if (x === undefined) { + x = 0; + } + if (y === undefined) { + y = 0; + } + if (width === undefined) { + width = 2; + } + if (height === undefined) { + height = 2; + } + _this = _super.call(this, scene, x, y, width, height); + _this.type = 'rexColorPicker.SVPaletteCanvas'; + if (hue === undefined) { + hue = 1; + } + _this.colorObject = new Color$1(); + _this.setHue(hue); + _this.setSize(width, height); + return _this; + } + _createClass(SVPaletteCanvas, [{ + key: "color", get: function get() { - return this._value; + return this.colorObject.color; + } + }, { + key: "hue", + get: function get() { + return this._hue; }, - set: function set(value) { - if (this._value === value) { + set: function set(hue) { + if (this._hue === hue) { return; } - var previousValue = this._value; - this._value = value; - var callback = this.valueChangeCallback, - scope = this.valueChangeCallbackScope; - if (callback) { - if (scope) { - callback.call(scope, this, value, previousValue); - } else { - callback(this, value, previousValue); - } + this._hue = hue; + this.colorObject.h = hue; + this.dirty = true; + } + }, { + key: "setHue", + value: function setHue(hue) { + this.hue = hue; + return this; + } + }, { + key: "updateTexture", + value: function updateTexture() { + DrawSVPalette(this.canvas, this.context, this.hue); + _get(_getPrototypeOf(SVPaletteCanvas.prototype), "updateTexture", this).call(this); + return this; + } + }, { + key: "getColor", + value: function getColor(localX, localY) { + if (localX === undefined) { + return this.colorObject.color; } - this.emit('valuechange', this, value, previousValue); + var s = Percent(localX, 0, this.width); + var v = 1 - Percent(localY, 0, this.height); + this.colorObject.setFromRGB(HSVToRGB$1(this.hue, s, v)); + return this.colorObject.color; } }, { - key: "emitButtonClick", - value: function emitButtonClick(index) { - var option = this.options[index]; - if (!option) { + key: "setColor", + value: function setColor(color) { + if (this.color === color) { return this; } - this.emit('button.click', this, undefined, option, index); + this.colorObject.setFromRGB(ColorToRGBA$1(color)); + this.setHue(this.colorObject.h); return this; } - }]); - return DropDownList; - }(Label); - Object.assign(DropDownList.prototype, Methods); - - var CreateDropDownList = function CreateDropDownList(scene, config) { - config = BuildListConfig(scene, config); - var gameObject = new DropDownList(scene, config); - scene.add.existing(gameObject); - return gameObject; - }; - - var GetOptionIndex = function GetOptionIndex(options, value) { - for (var i = 0, cnt = options.length; i < cnt; i++) { - var option = options[i]; - if (option.value === value) { - return i; + }, { + key: "colorToLocalPosition", + value: function colorToLocalPosition(color, out) { + if (out === undefined) { + out = {}; + } else if (out === true) { + if (LocalXY === undefined) { + LocalXY = {}; + } + out = LocalXY; + } + this.colorObject.setFromRGB(ColorToRGBA$1(color)); + out.x = this.width * this.colorObject.s; + out.y = this.height * (1 - this.colorObject.v); + return out; } - } - return undefined; - }; - var GetOptionText = function GetOptionText(options, value) { - var index = GetOptionIndex(options, value); - if (index == null) { - return undefined; - } - return options[index].text; - }; + }]); + return SVPaletteCanvas; + }(Canvas); + var LocalXY = undefined; - var ListInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(ListInput, _InputFiledBase); - var _super = _createSuper(ListInput); - function ListInput(scene, config) { + var SVPalette = /*#__PURE__*/function (_OverlapSizer) { + _inherits(SVPalette, _OverlapSizer); + var _super = _createSuper(SVPalette); + function SVPalette(scene, config) { var _this; - _classCallCheck(this, ListInput); - if (config === undefined) { - config = {}; - } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.ListInput'; - var list = CreateDropDownList(scene, config.list); - _this.add(list, { - proportion: 1, + _classCallCheck(this, SVPalette); + _this = _super.call(this, scene, config); + var paletteCanvas = new SVPaletteCanvas(scene); + scene.add.existing(paletteCanvas); + _this.type = 'rexColorPicker.SVPalette'; + paletteCanvas.setInteractive().on('pointerdown', _this.onPaletteCanvasPointerDown, _assertThisInitialized(_this)).on('pointermove', _this.onPaletteCanvasPointerDown, _assertThisInitialized(_this)); + var marker = new RoundRectangle$1(scene, { + radius: 5, + strokeColor: 0xffffff, + strokeWidth: 2 + }); + scene.add.existing(marker); + _this.add(paletteCanvas, { + key: 'paletteCanvas', expand: true + }).add(marker, { + key: 'marker', + expand: false }); - _this.addChildrenMap('list', list); - list.on('button.click', function (dropDownList, listPanel, button, index, pointer, event) { - this.setValue(button.value); - }, _assertThisInitialized(_this)); return _this; } - _createClass(ListInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { + _createClass(SVPalette, [{ + key: "onPaletteCanvasPointerDown", + value: function onPaletteCanvasPointerDown(pointer, localX, localY, event) { + if (!pointer.isDown) { return; } - if (!this.validate(value)) { - value = this._value; // Back to previous value + var paletteCanvas = this.childrenMap.paletteCanvas; + var color = paletteCanvas.getColor(localX, localY); + this.setMarkerPosition(color); + this.emit('input', color); + } + }, { + key: "color", + get: function get() { + return this.childrenMap.paletteCanvas.color; + } + }, { + key: "setHue", + value: function setHue(hue) { + var paletteCanvas = this.childrenMap.paletteCanvas; + paletteCanvas.setHue(hue); // Redraw paletteCanvas + // Position of marker does not change + return this; + } + }, { + key: "setColor", + value: function setColor(color) { + if (this.color === color) { + return this; } - - var list = this.childrenMap.list; - var text = GetOptionText(list.options, value); - list.resetDisplayContent({ - text: text - }); - _set(_getPrototypeOf(ListInput.prototype), "value", value, this, true); // Fire 'valuechange' event + var paletteCanvas = this.childrenMap.paletteCanvas; + paletteCanvas.setColor(color); // Redraw paletteCanvas + this.setMarkerPosition(color); + return this; } }, { - key: "setOptions", - value: function setOptions(options) { - this.childrenMap.list.setOptions(options); + key: "setMarkerPosition", + value: function setMarkerPosition(color) { + var paletteCanvas = this.childrenMap.paletteCanvas; + var marker = this.childrenMap.marker; + var localXY = paletteCanvas.colorToLocalPosition(color, true); + LocalToWorld(paletteCanvas, localXY.x, localXY.y, marker); + this.resetChildPositionState(marker); return this; } }]); - return ListInput; - }(InputFiledBase); - - var CreateListInput = function CreateListInput(scene, config, style) { - var gameObject = new ListInput(scene, style); - scene.add.existing(gameObject); - gameObject.setOptions(config.options); - return gameObject; - }; + return SVPalette; + }(OverlapSizer); - var CreateButtons$1 = function CreateButtons(scene, config) { - var gameObject = new Buttons$1(scene, config); - scene.add.existing(gameObject); - return gameObject; - }; + var GetValue$b = Phaser.Utils.Objects.GetValue; + var ColorPicker = /*#__PURE__*/function (_Sizer) { + _inherits(ColorPicker, _Sizer); + var _super = _createSuper(ColorPicker); + function ColorPicker(scene, config) { + var _this; + _classCallCheck(this, ColorPicker); + _this = _super.call(this, scene, config); + _this.type = 'rexColorPicker'; + _this.freezePalettes = false; - var SetButtonsActiveStateByIndex = function SetButtonsActiveStateByIndex(buttons, index) { - for (var i = 0, cnt = buttons.length; i < cnt; i++) { - var button = buttons[i]; - if (!button) { - continue; + // orientation + var hPalettePosition = GetValue$b(config, 'hPalette.position', 0); + if (typeof hPalettePosition === 'string') { + hPalettePosition = HPalettePositionNamesMap[hPalettePosition]; } - button.setActiveState(i === index); - } - }; + var orientation = hPalettePosition === 0 || + // bottom + hPalettePosition === 2 // top + ? 1 : + // y + 0; // x + _this.setOrientation(orientation); - var GetValue$g = Phaser.Utils.Objects.GetValue; - var ButtonsInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(ButtonsInput, _InputFiledBase); - var _super = _createSuper(ButtonsInput); - function ButtonsInput(scene, config) { - var _this; - _classCallCheck(this, ButtonsInput); - if (config === undefined) { - config = {}; - } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.ButtonsInput'; - var buttonConfig = config.button ? DeepClone(config.button) : {}; - var buttonExpand = GetValue$g(buttonConfig, 'expand', true); - if (buttonExpand) { - buttonConfig.align = 'center'; + // Add elements + var background = GetValue$b(config, 'background', undefined); + var hPaletteWidth, hPaletteHeight; + if (_this.orientation === 0) { + var hPaletteWidth = GetValue$b(config, 'hPalette.width', undefined); + if (hPaletteWidth === undefined) { + hPaletteWidth = GetValue$b(config, 'hPalette.size', 10); + } + } else { + hPaletteHeight = GetValue$b(config, 'hPalette.height', undefined); + if (hPaletteHeight === undefined) { + hPaletteHeight = GetValue$b(config, 'hPalette.size', 10); + } } - delete buttonConfig.expand; - var list = CreateButtons$1(scene, { - expand: buttonExpand + var hPalette = new HPalette(scene, { + width: hPaletteWidth, + height: hPaletteHeight }); - list.buttonConfig = buttonConfig; - _this.add(list, { - proportion: 1, - expand: true + scene.add.existing(hPalette); + var svPaletteWidth = GetValue$b(config, 'svPalette.width', undefined); + var svPaletteHeight = GetValue$b(config, 'svPalette.height', undefined); + var svPalette = new SVPalette(scene, { + width: svPaletteWidth, + height: svPaletteHeight }); - _this.addChildrenMap('list', list); - list.on('button.click', function (button, index, pointer, event) { - var option = list.options[index]; - if (!option) { - return; // ?? - } - - this._selectedIndex = index; - this.setValue(option.value); - this._selectedIndex = undefined; + scene.add.existing(svPalette); + if (background) { + _this.addBackground(background); + } + var hPaletteAddConfig = { + proportion: 0, + expand: true + }; + var svPaletteProportion, svPaletteExpand; + if (_this.orientation === 0) { + svPaletteProportion = svPaletteWidth === undefined ? 1 : 0; + svPaletteExpand = svPaletteHeight === undefined ? true : false; + } else { + svPaletteProportion = svPaletteHeight === undefined ? 1 : 0; + svPaletteExpand = svPaletteWidth === undefined ? true : false; + } + var svPaletteAddConfig = { + proportion: svPaletteProportion, + expand: svPaletteExpand + }; + if (hPalettePosition === 0 || hPalettePosition === 3) { + // bottom, right + _this.add(svPalette, svPaletteAddConfig).add(hPalette, hPaletteAddConfig); + } else { + // left, top + _this.add(hPalette, hPaletteAddConfig).add(svPalette, svPaletteAddConfig); + } + hPalette.on('input', function () { + svPalette.setHue(hPalette.getHue()); + this.setValue(svPalette.color, true); + }, _assertThisInitialized(_this)); + svPalette.on('input', function () { + this.setValue(svPalette.color, true); }, _assertThisInitialized(_this)); + _this.addChildrenMap('background', background); + _this.addChildrenMap('hPalette', hPalette); + _this.addChildrenMap('svPalette', svPalette); + var callback = GetValue$b(config, 'valuechangeCallback', null); + if (callback !== null) { + var scope = GetValue$b(config, 'valuechangeCallbackScope', undefined); + _this.on('valuechange', callback, scope); + } + _this.setValue(GetValue$b(config, 'value', 0xffffff)); return _this; } - _createClass(ButtonsInput, [{ + _createClass(ColorPicker, [{ key: "value", get: function get() { return this._value; @@ -34394,270 +34832,151 @@ if (this._value === value) { return; } - if (!this.validate(value)) { - value = this._value; // Back to previous value - } - - var list = this.childrenMap.list; - var index = this._selectedIndex; // See list's 'button.click' event - if (index === undefined) { - index = GetOptionIndex(list.options, value); + var oldValue = this._value; + this._value = value; + if (!this.freezePalettes) { + this.updatePalettes(); } - SetButtonsActiveStateByIndex(list.childrenMap.buttons, index); - _set(_getPrototypeOf(ButtonsInput.prototype), "value", value, this, true); // Fire 'valuechange' event + this.emit('valuechange', value, oldValue, this); } }, { - key: "setOptions", - value: function setOptions(options) { - var list = this.childrenMap.list; - list.options = options; - var scene = this.scene; - var buttonConfig = list.buttonConfig; - list.clearButtons(true); - for (var i = 0, cnt = options.length; i < cnt; i++) { - var option = options[i]; - var button = CreateLabel(scene, buttonConfig).setActiveState(false).resetDisplayContent({ - text: option.text - }); - list.addButton(button); + key: "setValue", + value: function setValue(value, freezePalettes) { + this.freezePalettes = !!freezePalettes; + this.value = value; + this.freezePalettes = false; + return this; + } + }, { + key: "color", + get: function get() { + return this._value; + }, + set: function set(color) { + this.value = color; + } + }, { + key: "setColor", + value: function setColor(color) { + this.color = color; + return this; + } + }, { + key: "updatePalettes", + value: function updatePalettes() { + this.childrenMap.hPalette.setColor(this.color); + this.childrenMap.svPalette.setColor(this.color); + return this; + } + }, { + key: "runLayout", + value: function runLayout(parent, newWidth, newHeight) { + if (this.ignoreLayout) { + return this; } + _get(_getPrototypeOf(ColorPicker.prototype), "runLayout", this).call(this, parent, newWidth, newHeight); + this.childrenMap.hPalette.setMarkerPosition(this.value); + this.childrenMap.svPalette.setMarkerPosition(this.value); return this; } }]); - return ButtonsInput; - }(InputFiledBase); - - var CreateButtonsInput = function CreateButtonsInput(scene, config, style) { - var gameObject = new ButtonsInput(scene, style); - scene.add.existing(gameObject); - gameObject.setOptions(config.options); - return gameObject; + return ColorPicker; + }(Sizer); + var HPalettePositionNamesMap = { + bottom: 0, + left: 1, + top: 2, + right: 3 }; - var StyleMethods$1 = { - setBoxFillStyle: function setBoxFillStyle(color, alpha) { - if (alpha === undefined) { - alpha = 1; + var GetValue$a = Phaser.Utils.Objects.GetValue; + var Color = Phaser.Display.Color; + var ColorToRGBA = Phaser.Display.Color.ColorToRGBA; + var HSVToRGB = Phaser.Display.Color.HSVToRGB; + var Clamp = Phaser.Math.Clamp; + var ColorComponents = /*#__PURE__*/function (_Sizer) { + _inherits(ColorComponents, _Sizer); + var _super = _createSuper(ColorComponents); + function ColorComponents(scene, config) { + var _this; + _classCallCheck(this, ColorComponents); + if (config === undefined) { + config = {}; } - this.dirty = this.dirty || this.boxFillColor !== color || this.boxFillAlpha !== alpha; - this.boxFillColor = color; - this.boxFillAlpha = alpha; - return this; - }, - setUncheckedBoxFillStyle: function setUncheckedBoxFillStyle(color, alpha) { - if (alpha === undefined) { - alpha = 1; + config.orientation = 0; + _this = _super.call(this, scene, config); + _this.type = 'rexColorComponents'; + _this.colorObject = new Color(); + + // Add elements + var background = GetValue$a(config, 'background', undefined); + var formatLabel = GetValue$a(config, 'formatLabel', undefined); + if (!IsGameObject(formatLabel)) { + formatLabel = CreateLabel(scene, formatLabel).resetDisplayContent(); } - this.dirty = this.dirty || this.uncheckedBoxFillColor !== color || this.uncheckedBoxFillAlpha !== alpha; - this.uncheckedBoxFillColor = color; - this.uncheckedBoxFillAlpha = alpha; - return this; - }, - setBoxStrokeStyle: function setBoxStrokeStyle(lineWidth, color, alpha) { - if (alpha === undefined) { - alpha = 1; + var components = []; + if (config.inputText0 && config.inputText1 && config.inputText2) { + components.push(config.inputText0); + components.push(config.inputText1); + components.push(config.inputText2); + } else { + var inputTextConfig = GetValue$a(config, 'inputText'); + for (var i = 0; i < 3; i++) { + var inputText = CreateInputText(scene, inputTextConfig).setMaxLength(3).setNumberInput(); + components.push(inputText); + } } - this.dirty = this.dirty || this.boxLineWidth !== lineWidth || this.boxStrokeColor !== color || this.boxStrokeAlpha !== alpha; - this.boxLineWidth = lineWidth; - this.boxStrokeColor = color; - this.boxStrokeAlpha = alpha; - return this; - }, - setUncheckedBoxStrokeStyle: function setUncheckedBoxStrokeStyle(lineWidth, color, alpha) { - if (alpha === undefined) { - alpha = 1; + if (background) { + _this.addBackground(background); } - this.dirty = this.dirty || this.uncheckedBoxLineWidth !== lineWidth || this.uncheckedBoxStrokeColor !== color || this.uncheckedBoxStrokeAlpha !== alpha; - this.uncheckedBoxLineWidth = lineWidth; - this.uncheckedBoxStrokeColor = color; - this.uncheckedBoxStrokeAlpha = alpha; - return this; - }, - setCheckerStyle: function setCheckerStyle(color, alpha) { - if (alpha === undefined) { - alpha = 1; + var proportion = GetValue$a(config, 'proportion.formatLabel', 0); + var defaultExpand = formatLabel.isRexContainerLite ? true : false; + var expand = GetValue$a(config, 'expand.formatLabel', defaultExpand); + _this.add(formatLabel, { + proportion: proportion, + expand: expand + }); + var proportion = GetValue$a(inputTextConfig, 'width') === undefined ? 1 : 0; + var expand = GetValue$a(inputTextConfig, 'height') === undefined ? true : false; + for (var i = 0, cnt = components.length; i < cnt; i++) { + _this.add(components[i], { + proportion: proportion, + expand: expand + }); } - this.dirty = this.dirty || this.checkerColor !== color || this.checkAlpha !== alpha; - this.checkerColor = color; - this.checkAlpha = alpha; - return this; - }, - setBoxShape: function setBoxShape(isCircleShape) { - if (isCircleShape === undefined) { - isCircleShape = false; - } - if (this.isCircleShape === isCircleShape) { - return this; - } - this.isCircleShape = isCircleShape; - this.isSizeChanged = true; - this.dirty = true; - return this; - } - }; - - var SizeMethods$1 = { - setBoxSize: function setBoxSize(size) { - this.dirty = this.dirty || this.boxSize !== size; - this.boxSize = size; - return this; - }, - setCheckerSize: function setCheckerSize(size) { - this.dirty = this.dirty || this.checkerSize !== size; - this.checkerSize = size; - return this; - } - }; - - var ShapesUpdateMethods$1 = { - buildShapes: function buildShapes() { - this.addShape(new RoundRectangle().setName('box')).addShape(new Lines().setName('checker')); - }, - updateShapes: function updateShapes() { - var centerX = this.width / 2, - centerY = this.height / 2, - radius = Math.min(centerX, centerY); - var width = radius * 2; - var x = centerX - radius, - y = centerY - radius; - var boxLineWidth = this.boxLineWidth; - var checkLineWidth = Math.max(width / 10, 2); - var boxShape = this.getShape('box'); - var checkerShape = this.getShape('checker'); - - // Setup shapes - if (this.isSizeChanged) { - // Box - var posOffset = width * (1 - this.boxSize) / 2; - var halfBoxLineWidth = boxLineWidth / 2; - var boxInnerWidth = width * this.boxSize - boxLineWidth; - boxShape.setTopLeftPosition(x + halfBoxLineWidth + posOffset, y + halfBoxLineWidth + posOffset).setSize(boxInnerWidth, boxInnerWidth); - if (this.isCircleShape) { - boxShape.setRadius(boxInnerWidth / 2); - } else { - boxShape.setRadius(0); - } - - // Checker - var posOffset = width * (1 - this.checkerSize) / 2; - var unit = width * this.checkerSize / 4; - var u1 = unit * 1, - u2 = unit * 2, - u3 = unit * 3; - checkerShape.startAt(u1, u2).lineTo(u2, u3).lineTo(u3, u1).offset(x + posOffset, y + posOffset).end(); - } - - // Set styles - if (this.checked) { - boxShape.fillStyle(this.boxFillColor, this.boxFillAlpha).lineStyle(boxLineWidth, this.boxStrokeColor, this.boxStrokeAlpha); - checkerShape.lineStyle(checkLineWidth, this.checkerColor); - } else { - boxShape.fillStyle(this.uncheckedBoxFillColor, this.uncheckedBoxFillAlpha).lineStyle(boxLineWidth, this.uncheckedBoxStrokeColor, this.uncheckedBoxStrokeAlpha); - checkerShape.lineStyle(); - } - - // Play checker animation - if (this.checked) { - checkerShape.setDisplayPathSegment(this.checkerAnimProgress); - } - } - }; - - var CheckerAnimationMethods = { - setCheckerAnimationDuration: function setCheckerAnimationDuration(duration) { - if (duration === undefined) { - duration = 0; - } - this.checkerAnimDuration = duration; - return this; - }, - playCheckerAnimation: function playCheckerAnimation() { - if (this.checkerAnimProgressTask === undefined) { - this.checkerAnimProgressTask = new EaseValueTask(this, { - eventEmitter: null - }); - } - this.checkerAnimProgressTask.restart({ - key: 'checkerAnimProgress', - from: 0, - to: 1, - duration: this.checkerAnimDuration - }); - return this; - }, - stopCheckerAnimation: function stopCheckerAnimation() { - if (this.checkerAnimProgressTask === undefined) { - return this; - } - this.checkerAnimProgressTask.stop(); - return this; - } - }; - - var methods$4 = {}; - Object.assign(methods$4, StyleMethods$1, SizeMethods$1, ShapesUpdateMethods$1, CheckerAnimationMethods); - - var GetValue$f = Phaser.Utils.Objects.GetValue; - var IsPlainObject$2 = Phaser.Utils.Objects.IsPlainObject; - var DefaultBoxFillColor = 0x005cb2; - var DefaultCheckerColor = 0xffffff; - var CheckboxShape = /*#__PURE__*/function (_BaseShapes) { - _inherits(CheckboxShape, _BaseShapes); - var _super = _createSuper(CheckboxShape); - function CheckboxShape(scene, x, y, width, height, color, config) { - var _this; - _classCallCheck(this, CheckboxShape); - if (IsPlainObject$2(x)) { - config = x; - x = GetValue$f(config, 'x', 0); - y = GetValue$f(config, 'y', 0); - width = GetValue$f(config, 'width', 2); - height = GetValue$f(config, 'height', 2); - color = GetValue$f(config, 'color', DefaultBoxFillColor); - } else if (IsPlainObject$2(color)) { - config = color; - color = GetValue$f(config, 'color', DefaultBoxFillColor); - } - _this = _super.call(this, scene, x, y, width, height); - _this.type = 'rexCheckbox'; - if (color === undefined) { - color = DefaultBoxFillColor; + _this.addChildrenMap('background', background); + _this.addChildrenMap('formatLabel', formatLabel); + _this.addChildrenMap('components', components); + _this.onClick(formatLabel, _this.toggleColorFormat, _assertThisInitialized(_this)); + for (var i = 0, cnt = components.length; i < cnt; i++) { + components[i].on('close', function () { + this.updateColorObject(); + this.setValue(this.colorObject.color); + }, _assertThisInitialized(_this)); } - _this.setBoxShape(GetValue$f(config, 'circleBox', false)); - _this.setBoxFillStyle(color, GetValue$f(config, 'boxFillAlpha', 1)); - _this.setUncheckedBoxFillStyle(GetValue$f(config, 'uncheckedColor', null), GetValue$f(config, 'uncheckedBoxFillAlpha', 1)); - _this.setBoxStrokeStyle(GetValue$f(config, 'boxLineWidth', 4), GetValue$f(config, 'boxStrokeColor', color), GetValue$f(config, 'boxStrokeAlpha', 1)); - _this.setUncheckedBoxStrokeStyle(_this.boxLineWidth, GetValue$f(config, 'uncheckedBoxStrokeColor', _this.boxStrokeColor), GetValue$f(config, 'uncheckedBoxStrokeAlpha', _this.boxStrokeAlpha)); - _this.setCheckerStyle(GetValue$f(config, 'checkerColor', DefaultCheckerColor), GetValue$f(config, 'checkerAlpha', 1)); - _this.setBoxSize(GetValue$f(config, 'boxSize', 1)); - _this.setCheckerSize(GetValue$f(config, 'checkerSize', 1)); - _this.setCheckerAnimationDuration(GetValue$f(config, 'animationDuration', 150)); - _this.buildShapes(); - var value = GetValue$f(config, 'checked'); - if (value === undefined) { - value = GetValue$f(config, 'value', false); + var callback = GetValue$a(config, 'valuechangeCallback', null); + if (callback !== null) { + var scope = GetValue$a(config, 'valuechangeCallbackScope', undefined); + _this.on('valuechange', callback, scope); } - _this.setValue(value); + formatLabel.setText('RGB'); + _this.setValue(GetValue$a(config, 'value', 0xffffff)); return _this; } - _createClass(CheckboxShape, [{ + _createClass(ColorComponents, [{ key: "value", get: function get() { return this._value; }, set: function set(value) { - value = !!value; + value = Clamp(Math.floor(value), 0, 0xffffff); if (this._value === value) { return; } - this.dirty = true; this._value = value; - if (value) { - this.playCheckerAnimation(); - } else { - this.stopCheckerAnimation(); - } - this.emit('valuechange', value); + this.colorObject.setFromRGB(ColorToRGBA(value)); + this.updateComponents(); + this.emit('valuechange', this._value); } }, { key: "setValue", @@ -34666,124 +34985,144 @@ return this; } }, { - key: "toggleValue", - value: function toggleValue() { - this.setValue(!this.value); + key: "color", + get: function get() { + return this._value; + }, + set: function set(color) { + this.value = color; + } + }, { + key: "setColor", + value: function setColor(color) { + this.color = color; return this; } }, { - key: "checked", + key: "colorFormat", get: function get() { - return this.value; + return this.childrenMap.formatLabel.text; }, set: function set(value) { - this.value = value; + if (this.colorFormat === value) { + return; + } + this.childrenMap.formatLabel.setText(value); + this.updateComponents(); } }, { - key: "setChecked", - value: function setChecked(checked) { - if (checked === undefined) { - checked = true; - } - this.setValue(checked); + key: "setColorFormat", + value: function setColorFormat(colrType) { + this.colorFormat = colrType; return this; } }, { - key: "toggleChecked", - value: function toggleChecked() { - this.toggleValue(); + key: "toggleColorFormat", + value: function toggleColorFormat() { + this.colorFormat = this.colorFormat === 'RGB' ? 'HSV' : 'RGB'; return this; } }, { - key: "checkerAnimProgress", - get: function get() { - return this._checkerAnimProgress; - }, - set: function set(value) { - if (this._checkerAnimProgress === value) { - return; + key: "updateComponents", + value: function updateComponents() { + var components = this.childrenMap.components; + var value0, value1, value2; + if (this.colorFormat === 'RGB') { + value0 = this.colorObject.red; + value1 = this.colorObject.green; + value2 = this.colorObject.blue; + } else { + // colorFormat === 'HSV' + value0 = Math.floor(this.colorObject.h * 360); + value1 = Math.floor(this.colorObject.s * 100); + value2 = Math.floor(this.colorObject.v * 100); } - this._checkerAnimProgress = value; - this.dirty = true; - } - }]); - return CheckboxShape; - }(BaseShapes); - Object.assign(CheckboxShape.prototype, methods$4); - - var GetValue$e = Phaser.Utils.Objects.GetValue; - var Checkbox = /*#__PURE__*/function (_CheckboxShape) { - _inherits(Checkbox, _CheckboxShape); - var _super = _createSuper(Checkbox); - function Checkbox(scene, x, y, width, height, color, config) { - var _this; - _classCallCheck(this, Checkbox); - _this = _super.call(this, scene, x, y, width, height, color, config); - _this._click = new Button(_assertThisInitialized(_this), GetValue$e(config, 'click')); - _this._click.on('click', function () { - this.toggleValue(); - }, _assertThisInitialized(_this)); - _this.setReadOnly(GetValue$e(config, 'readOnly', false)); - return _this; - } - _createClass(Checkbox, [{ - key: "readOnly", - get: function get() { - return !this._click.enable; - }, - set: function set(value) { - this._click.enable = !value; + components[0].setValue(value0); + components[1].setValue(value1); + components[2].setValue(value2); + return this; } }, { - key: "setReadOnly", - value: function setReadOnly(enable) { - if (enable === undefined) { - enable = true; + key: "updateColorObject", + value: function updateColorObject() { + var components = this.childrenMap.components; + if (this.colorFormat === 'RGB') { + var red = Clamp(components[0].value, 0, 255); + var green = Clamp(components[1].value, 0, 255); + var blue = Clamp(components[2].value, 0, 255); + this.colorObject.setTo(red, green, blue); + } else { + var h = Clamp(components[0].value, 0, 359) / 360; + var s = Clamp(components[1].value, 0, 100) / 100; + var v = Clamp(components[2].value, 0, 100) / 100; + this.colorObject.setFromRGB(HSVToRGB(h, s, v)); } - this.readOnly = enable; return this; } }]); - return Checkbox; - }(CheckboxShape); - - var CreateCheckbox = function CreateCheckbox(scene, config) { - var gameObject = new Checkbox(scene, config); - scene.add.existing(gameObject); - return gameObject; - }; + return ColorComponents; + }(Sizer); - var GetValue$d = Phaser.Utils.Objects.GetValue; - var CheckboxInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(CheckboxInput, _InputFiledBase); - var _super = _createSuper(CheckboxInput); - function CheckboxInput(scene, config) { + var GetValue$9 = Phaser.Utils.Objects.GetValue; + var ColorPickerPanel = /*#__PURE__*/function (_Sizer) { + _inherits(ColorPickerPanel, _Sizer); + var _super = _createSuper(ColorPickerPanel); + function ColorPickerPanel(scene, config) { var _this; - _classCallCheck(this, CheckboxInput); + _classCallCheck(this, ColorPickerPanel); if (config === undefined) { config = {}; } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.CheckboxInput'; - var checkboxConfig = config.checkbox; - var checkbox = CreateCheckbox(scene, checkboxConfig); - var size = GetValue$d(checkboxConfig, 'size'); - if (size !== undefined) { - checkbox.setSize(size, size); + config.orientation = 1; + _this = _super.call(this, scene, config); + _this.type = 'rexColorInput.ColorPickerPanel'; + + // Add elements + var background = GetValue$9(config, 'background', undefined); + var colorPicker = new ColorPicker(scene, { + hPalette: config.hPalette || {}, + svPalette: config.svPalette || {}, + space: { + item: GetValue$9(config, 'space.hPalette', 8) + } + }); + scene.add.existing(colorPicker); + var colorComponents; + if (config.colorComponents) { + colorComponents = new ColorComponents(scene, config.colorComponents); + scene.add.existing(colorComponents); } - var fitRatio = size !== undefined ? 0 : 1; - _this.add(checkbox, { - proportion: 0, - expand: false, - fitRatio: fitRatio + if (background) { + _this.addBackground(background); + new TouchEventStop(background, { + stopAllLevels: false + }); + } + _this.add(colorPicker, { + proportion: 1, + expand: true }); - _this.addChildrenMap('checkbox', checkbox); - checkbox.on('valuechange', function (value) { + if (colorComponents) { + _this.add(colorComponents, { + proportion: 0, + expand: true + }); + } + _this.addChildrenMap('background', background); + _this.addChildrenMap('colorPicker', colorPicker); + _this.addChildrenMap('colorComponents', colorComponents); + colorPicker.on('valuechange', function (value) { this.setValue(value); }, _assertThisInitialized(_this)); + if (colorComponents) { + colorComponents.on('valuechange', function (value) { + this.setValue(value); + }, _assertThisInitialized(_this)); + } + _this.setValue(GetValue$9(config, 'value', 0xffffff)); return _this; } - _createClass(CheckboxInput, [{ + _createClass(ColorPickerPanel, [{ key: "value", get: function get() { return this._value; @@ -34792,481 +35131,302 @@ if (this._value === value) { return; } - if (!this.validate(value)) { - value = this._value; // Back to previous value + this._value = value; + var colorPicker = this.childrenMap.colorPicker; + colorPicker.setValue(value); + var colorComponents = this.childrenMap.colorComponents; + if (colorComponents) { + colorComponents.setValue(value); } - - this.childrenMap.checkbox.setValue(value); - _set(_getPrototypeOf(CheckboxInput.prototype), "value", value, this, true); // Fire 'valuechange' event + this.emit('valuechange', value); + } + }, { + key: "setValue", + value: function setValue(value) { + this.value = value; + return this; } }]); - return CheckboxInput; - }(InputFiledBase); - - var CreateCheckboxInput = function CreateCheckboxInput(scene, config, style) { - var gameObject = new CheckboxInput(scene, style); - scene.add.existing(gameObject); - return gameObject; - }; + return ColorPickerPanel; + }(Sizer); - var StyleMethods = { - setTrackFillStyle: function setTrackFillStyle(color, alpha) { - if (alpha === undefined) { - alpha = 1; - } - this.dirty = this.dirty || this.trackFillColor !== color || this.trackFillAlpha !== alpha; - this.trackFillColor = color; - this.trackFillAlpha = alpha; - return this; - }, - setFalseValueTrackFillStyle: function setFalseValueTrackFillStyle(color, alpha) { - if (alpha === undefined) { - alpha = 1; - } - this.dirty = this.dirty || this.falseValueTrackColor !== color || this.uncheckedTrackFillAlpha !== alpha; - this.falseValueTrackColor = color; - this.falseValueTrackFillAlpha = alpha; - return this; - }, - setThumbStyle: function setThumbStyle(color, alpha) { - if (alpha === undefined) { - alpha = 1; - } - this.dirty = this.dirty || this.thumbColor !== color || this.checkAlpha !== alpha; - this.thumbColor = color; - this.thumbAlpha = alpha; - return this; + Phaser.Utils.Objects.GetValue; + var CreateColorPicker = function CreateColorPicker(scene) { + var scene = this.scene; + var background; + var createBackgroundCallback = this.colorPickerCreateBackgroundCallback; + if (createBackgroundCallback) { + background = createBackgroundCallback.call(this, scene); + scene.add.existing(background); + } + var width = this.colorPickerWidth; + if (width === undefined) { + width = this.width; + } + var height = this.colorPickerHeight; + if (height === undefined) { + height = width; + } + var colorComponentsConfig; + if (this.colorComponentsHeight > 0) { + colorComponentsConfig = { + height: this.colorComponentsHeight, + formatLabel: this.colorComponentsFormatLabelConfig, + inputText: this.colorComponentsInputTextConfig, + space: this.colorComponentsSpace + }; + } else { + colorComponentsConfig = false; } + var colorPicker = new ColorPickerPanel(scene, { + width: width, + height: height, + background: background, + space: this.colorPickerSpace, + hPalette: { + position: this.colorPickerHPalettePosition + }, + colorComponents: colorComponentsConfig, + value: this.value + }); + scene.add.existing(colorPicker); + return colorPicker; }; - var SizeMethods = { - setTrackSize: function setTrackSize(width, height) { - this.dirty = this.dirty || this.trackWidth !== width || this.trackHeight !== height; - this.trackWidth = width; - this.trackHeight = height; - return this; - }, - setTrackRadius: function setTrackRadius(radius) { - this.dirty = this.dirty || this.trackRadius !== radius; - this.trackRadius = radius; - return this; - }, - setThumbSize: function setThumbSize(width, height) { - if (height === undefined) { - height = width; - } - this.dirty = this.dirty || this.thumbWidth !== width || this.thumbHeight !== height; - this.thumbWidth = width; - this.thumbHeight = height; - return this; - }, - setThumbRadius: function setThumbRadius(radius) { - this.dirty = this.dirty || this.thumbRadius !== radius; - this.thumbRadius = radius; - return this; + var ScaleDown = function ScaleDown(gameObject, duration, orientation, ease, scale) { + if (ease === undefined) { + ease = 'Linear'; + } + var config = {}; + config.mode = 0; + switch (orientation) { + case 0: + case 'x': + config.end = { + x: 0 + }; + break; + case 1: + case 'y': + config.end = { + y: 0 + }; + break; + default: + config.end = 0; + break; + } + config.duration = duration; + config.ease = ease; + if (scale === undefined) { + scale = new Scale$1(gameObject, config); + } else { + scale.resetFromJSON(config); } + scale.restart(); + return scale; }; - var PositionMethods = { - setThumbPosition: function setThumbPosition(left, right) { - if (right === undefined) { - right = 1 - left; - } - this.thumbLeftX = left; - this.thumbRightX = right; - return this; - }, - setRTL: function setRTL(rtl) { - if (rtl === undefined) { - rtl = true; - } - this.rtl = rtl; - return this; + var GetValueFromAliasKeys = function GetValueFromAliasKeys(source, key0, key1, key2, defaultValue) { + if (HasValue(source, key0)) { + return GetValue$1G(source, key0); + } else if (key1 && HasValue(source, key1)) { + return GetValue$1G(source, key1); + } else if (key2 && HasValue(source, key2)) { + return GetValue$1G(source, key2); + } else { + return defaultValue; } }; - /** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ + var GetValue$8 = Phaser.Utils.Objects.GetValue; + var SetPosition = function SetPosition(gameObject, config) { + var expandDirection = GetValue$8(config, 'expandDirection', undefined); + if (typeof expandDirection === 'string') { + expandDirection = ExpandDirections[expandDirection]; + } + var alignTargetX = GetValueFromAliasKeys(config, 'alignTarget', 'alignTargetX'); + var alignTargetY = GetValue$8(config, 'alignTargetY', alignTargetX); + var alignOffsetX = GetValue$8(config, 'alignOffsetX', 0); + var alignOffsetY = GetValue$8(config, 'alignOffsetY', 0); + var alignSide = GetValue$8(config, 'alignSide', ''); + var alignRight = alignSide.includes('right'); + var positionBounds = GetValue$8(config, 'bounds'); - /** - * Calculates a linear (interpolation) value over t. - * - * @function Phaser.Math.Linear - * @since 3.0.0 - * - * @param {number} p0 - The first point. - * @param {number} p1 - The second point. - * @param {number} t - The percentage between p0 and p1 to return, represented as a number between 0 and 1. - * - * @return {number} The step t% of the way between p0 and p1. - */ - var Linear$1 = function Linear(p0, p1, t) { - return (p1 - p0) * t + p0; - }; - - var GetR = function GetR(colorInt) { - return colorInt >> 16 & 0xff; - }; - var GetG = function GetG(colorInt) { - return colorInt >> 8 & 0xff; - }; - var GetB = function GetB(colorInt) { - return colorInt & 0xff; + // Expand direction + var isExpandDown = expandDirection === 0; + var isExpandUp = expandDirection === 1; + var flexExpand = !isExpandDown && !isExpandUp; + var originX = alignRight ? 1 : 0; + var originY = isExpandDown || flexExpand ? 0 : 1; + gameObject.setOrigin(originX, originY); + var x, y; + if (alignRight) { + x = alignTargetX.getTopRight().x; + } else { + x = alignTargetX.getTopLeft().x; + } + y = alignTargetY.getBottomLeft().y; + gameObject.setPosition(x + alignOffsetX, y + alignOffsetY); + var bounds = positionBounds; + if (!bounds) { + bounds = GetViewport(gameObject.scene); + } + if (flexExpand && gameObject.getBottomLeft().y > bounds.bottom) { + // Out of bounds, can't put list-panel below parent + y = alignTargetY.getTopLeft().y; + gameObject.setOrigin(0, 1).setPosition(x + alignOffsetX, y + alignOffsetY); + } }; - - var MixColor = function MixColor(color0, color1, t) { - var r = Linear$1(GetR(color0), GetR(color1), t); - var g = Linear$1(GetG(color0), GetG(color1), t); - var b = Linear$1(GetB(color0), GetB(color1), t); - return (r & 0xff) << 16 | (g & 0xff) << 8 | b & 0xff; + var ExpandDirections = { + down: 0, + up: 1 }; - var Linear = Phaser.Math.Linear; - var ShapesUpdateMethods = { - buildShapes: function buildShapes() { - this.addShape(new RoundRectangle().setName('track')).addShape(new RoundRectangle().setName('thumb')); - }, - updateShapes: function updateShapes() { - var width = this.width, - height = this.height; - var toggleAnimProgress = this.value ? this.toggleAnimProgress : 1 - this.toggleAnimProgress; - - // Track - var trackShape = this.getShape('track'); - if (this.isSizeChanged) { - var trackWidth = width * this.trackWidth, - trackHeight = height * this.trackHeight, - trackX = (width - trackWidth) / 2, - trackY = (height - trackHeight) / 2, - trackRadius = height * this.trackRadius; - trackShape.setTopLeftPosition(trackX, trackY).setSize(trackWidth, trackHeight).setRadius(trackRadius); + var GetValue$7 = Phaser.Utils.Objects.GetValue; + var DropDown = /*#__PURE__*/function (_OpenCloseTransition) { + _inherits(DropDown, _OpenCloseTransition); + var _super = _createSuper(DropDown); + function DropDown(gameObject, config) { + var _this; + _classCallCheck(this, DropDown); + if (config === undefined) { + config = {}; } - var trackFillColor = MixColor(this.falseValueTrackColor, this.trackFillColor, toggleAnimProgress); - var trackFillAlpha = Linear(this.falseValueTrackFillAlpha, this.trackFillAlpha, toggleAnimProgress); - trackShape.fillStyle(trackFillColor, trackFillAlpha); - - // Thumb - var thumbShape = this.getShape('thumb'); - if (this.isSizeChanged) { - var thumbWidth = width * this.thumbWidth, - thumbHeight = height * this.thumbHeight, - thumbRadius = height * this.thumbRadius; - thumbShape.setSize(thumbWidth, thumbHeight).setRadius(thumbRadius); + if (config.transitIn == null) { + config.transitIn = function (gameObject, duration) { + PopUp(gameObject, duration, 'y', 'Cubic'); + }; } - var thumbX = Linear(this.thumbLeftX, this.thumbRightX, toggleAnimProgress) * width; - if (this.rtl) { - thumbX = width - thumbX; + if (config.transitOut == null) { + config.transitOut = function (gameObject, duration) { + // Don't destroy here + ScaleDown(gameObject, duration, 'y', 'Linear'); + }; } - var thumbY = height / 2; - thumbShape.setCenterPosition(thumbX, thumbY); - thumbShape.fillStyle(this.thumbColor, this.thumbAlpha); - } - }; + config.manualClose = true; + config.clickOutsideClose = true; + config.destroy = true; + _this = _super.call(this, gameObject, config); + // this.parent = gameObject; + // this.scene - var ToggleAnimationMethods = { - setToggleAnimationDuration: function setToggleAnimationDuration(duration) { - if (duration === undefined) { - duration = 0; - } - this.toggleAnimDuration = duration; - return this; - }, - playToggleAnimation: function playToggleAnimation() { - if (this.toggleAnimProgressTask === undefined) { - this.toggleAnimProgressTask = new EaseValueTask(this, { - eventEmitter: null - }); - } - this.toggleAnimProgressTask.restart({ - key: 'toggleAnimProgress', - from: 0, - to: 1, - duration: this.toggleAnimDuration - }); - return this; - }, - stopToggleAnimation: function stopToggleAnimation() { - if (this.toggleAnimProgressTask === undefined) { - return this; + SetPosition(gameObject, config); + if (gameObject.isRexSizer) { + gameObject.layout(); } - this.toggleAnimProgressTask.stop(); - return this; - } - }; - - var methods$3 = {}; - Object.assign(methods$3, StyleMethods, SizeMethods, PositionMethods, ShapesUpdateMethods, ToggleAnimationMethods); - - var GrayScale = function GrayScale(color) { - var shade = 0.3 * GetR(color) + 0.59 * GetG(color) + 0.11 * GetB(color); - return (shade & 0xff) << 16 | (shade & 0xff) << 8 | shade & 0xff; - }; - var GetValue$c = Phaser.Utils.Objects.GetValue; - var IsPlainObject$1 = Phaser.Utils.Objects.IsPlainObject; - var DefaultTrackFillColor = 0x005cb2; - var DefaultThumbFillColor = 0xffffff; - var ToggleSwitchShape = /*#__PURE__*/function (_BaseShapes) { - _inherits(ToggleSwitchShape, _BaseShapes); - var _super = _createSuper(ToggleSwitchShape); - function ToggleSwitchShape(scene, x, y, width, height, color, config) { - var _this; - _classCallCheck(this, ToggleSwitchShape); - if (IsPlainObject$1(x)) { - config = x; - x = GetValue$c(config, 'x', 0); - y = GetValue$c(config, 'y', 0); - width = GetValue$c(config, 'width', 2); - height = GetValue$c(config, 'height', 2); - color = GetValue$c(config, 'color', DefaultTrackFillColor); - } else if (IsPlainObject$1(color)) { - config = color; - color = GetValue$c(config, 'color', DefaultTrackFillColor); - } - _this = _super.call(this, scene, x, y, width, height); - _this.type = 'rexToggleSwitch'; - if (color === undefined) { - color = DefaultTrackFillColor; + // Close conditions: + var touchOutsideClose = GetValue$7(config, 'touchOutsideClose', false); + var anyTouchClose = GetValue$7(config, 'anyTouchClose', false); + if (anyTouchClose) { + touchOutsideClose = false; } - _this.setTrackFillStyle(color, GetValue$c(config, 'trackFillAlpha', 1)); - _this.setFalseValueTrackFillStyle(GetValue$c(config, 'falseValueTrackColor', GrayScale(color)), GetValue$c(config, 'falseValueTrackFillAlpha', 1)); - _this.setThumbStyle(GetValue$c(config, 'thumbColor', DefaultThumbFillColor), GetValue$c(config, 'thumbAlpha', 1)); - _this.setTrackSize(GetValue$c(config, 'trackWidth', 0.9), GetValue$c(config, 'trackHeight', 0.5)); - _this.setTrackRadius(GetValue$c(config, 'trackRadius', _this.trackHeight * 0.5)); - var thumbHeight = GetValue$c(config, 'thumbHeight', undefined); - var thumbWidth = GetValue$c(config, 'thumbWidth', thumbHeight); - if (thumbWidth === undefined) { - thumbWidth = _this.trackHeight * 0.9; + + // Registet touch-close event after opened + if (anyTouchClose) { + _this.once('open', _this.anyTouchClose, _assertThisInitialized(_this)); + } else if (touchOutsideClose) { + _this.once('open', _this.touchOutsideClose, _assertThisInitialized(_this)); } - _this.setThumbSize(thumbWidth, thumbHeight); - _this.setThumbRadius(GetValue$c(config, 'thumbRadius', _this.thumbHeight * 0.5)); - _this.setThumbPosition(GetValue$c(config, 'thumbLeft', 0.3), GetValue$c(config, 'thumbRight', undefined)); - _this.setRTL(GetValue$c(config, 'rtl', false)); - _this.setToggleAnimationDuration(GetValue$c(config, 'animationDuration', 150)); - _this.buildShapes(); - _this.setValue(GetValue$c(config, 'value', false), 0); + _this.requestOpen(); return _this; } - _createClass(ToggleSwitchShape, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - value = !!value; - if (this._value === value) { + _createClass(DropDown, [{ + key: "shutdown", + value: function shutdown(fromScene) { + // Already shutdown + if (this.isShutdown) { return; } - this.dirty = true; - this._value = value; - this.playToggleAnimation(); - this.emit('valuechange', value); + + // Registered in touchOutsideClose() + this.scene.input.off('pointerup', this.touchCloseCallback, this); + _get(_getPrototypeOf(DropDown.prototype), "shutdown", this).call(this, fromScene); } }, { - key: "setValue", - value: function setValue(value, duration) { - if (duration === undefined) { - duration = this.toggleAnimDuration; - } - var durationSave = this.toggleAnimDuration; - this.toggleAnimDuration = duration; - this.value = value; - this.toggleAnimDuration = durationSave; + key: "touchOutsideClose", + value: function touchOutsideClose() { + this.scene.input.on('pointerup', this.touchCloseCallback, this); + this.clickOutsideTest = true; return this; } }, { - key: "toggleValue", - value: function toggleValue(duration) { - this.setValue(!this.value, duration); + key: "anyTouchClose", + value: function anyTouchClose() { + this.scene.input.once('pointerup', this.touchCloseCallback, this); return this; } }, { - key: "toggleAnimProgress", - get: function get() { - return this._toggleAnimProgress; - }, - set: function set(value) { - if (this._toggleAnimProgress === value) { + key: "touchCloseCallback", + value: function touchCloseCallback(pointer) { + if (this.clickOutsideTest && IsPointInBounds(this.parent, pointer.worldX, pointer.worldY)) { return; } - this._toggleAnimProgress = value; - this.dirty = true; - } - }]); - return ToggleSwitchShape; - }(BaseShapes); - Object.assign(ToggleSwitchShape.prototype, methods$3); - - var GetValue$b = Phaser.Utils.Objects.GetValue; - var ToggleSwitch = /*#__PURE__*/function (_ToggleSwitchShape) { - _inherits(ToggleSwitch, _ToggleSwitchShape); - var _super = _createSuper(ToggleSwitch); - function ToggleSwitch(scene, x, y, width, height, color, config) { - var _this; - _classCallCheck(this, ToggleSwitch); - _this = _super.call(this, scene, x, y, width, height, color, config); - _this._click = new Button(_assertThisInitialized(_this), GetValue$b(config, 'click')); - _this._click.on('click', function () { - this.toggleValue(); - }, _assertThisInitialized(_this)); - _this.setReadOnly(GetValue$b(config, 'readOnly', false)); - return _this; - } - _createClass(ToggleSwitch, [{ - key: "readOnly", - get: function get() { - return !this._click.enable; - }, - set: function set(value) { - this._click.enable = !value; + this.requestClose(); } }, { - key: "setReadOnly", - value: function setReadOnly(enable) { - if (enable === undefined) { - enable = true; - } - this.readOnly = enable; - return this; - } - }]); - return ToggleSwitch; - }(ToggleSwitchShape); - - var CreateToggleSwitch = function CreateToggleSwitch(scene, config) { - var gameObject = new ToggleSwitch(scene, config); - scene.add.existing(gameObject); - return gameObject; - }; - - var GetValue$a = Phaser.Utils.Objects.GetValue; - var ToggleSwitchInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(ToggleSwitchInput, _InputFiledBase); - var _super = _createSuper(ToggleSwitchInput); - function ToggleSwitchInput(scene, config) { - var _this; - _classCallCheck(this, ToggleSwitchInput); - if (config === undefined) { - config = {}; - } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.ToggleSwitchInput'; - var toggleSwitchConfig = config.toggleSwitch; - var toggleSwitch = CreateToggleSwitch(scene, toggleSwitchConfig); - var size = GetValue$a(toggleSwitchConfig, 'size'); - if (size !== undefined) { - toggleSwitch.setSize(size, size); + key: "onOpen", + value: function onOpen() { + this.emit('open', this.parent, this); + _get(_getPrototypeOf(DropDown.prototype), "onOpen", this).call(this); } - var fitRatio = size !== undefined ? 0 : 1; - _this.addSpace().add(toggleSwitch, { - proportion: 0, - expand: false, - fitRatio: fitRatio - }); - _this.addChildrenMap('toggleSwitch', toggleSwitch); - toggleSwitch.on('valuechange', function (value) { - this.setValue(value); - }, _assertThisInitialized(_this)); - return _this; - } - _createClass(ToggleSwitchInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; - } - if (!this.validate(value)) { - value = this._value; // Back to previous value - } - - this.childrenMap.toggleSwitch.setValue(value); - _set(_getPrototypeOf(ToggleSwitchInput.prototype), "value", value, this, true); // Fire 'valuechange' event + }, { + key: "onClose", + value: function onClose() { + this.emit('close', this.parent, this); + _get(_getPrototypeOf(DropDown.prototype), "onClose", this).call(this); } }]); - return ToggleSwitchInput; - }(InputFiledBase); - - var CreateToggleSwitchInput = function CreateToggleSwitchInput(scene, config, style) { - var gameObject = new ToggleSwitchInput(scene, style); - scene.add.existing(gameObject); - return gameObject; - }; - - var CreateSwatch = function CreateSwatch(scene, config) { - if (config === false) { - return null; - } else if (IsGameObject(config)) { - return config; - } - var swatch = new RoundRectangle$1(scene, config); - scene.add.existing(swatch); - return swatch; - }; - - var ColorNames = ['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']; - var ColorValues = [0xf0f8ff, 0xfaebd7, 0x00ffff, 0x7fffd4, 0xf0ffff, 0xf5f5dc, 0xffe4c4, 0x000000, 0xffebcd, 0x0000ff, 0x8a2be2, 0xa52a2a, 0xdeb887, 0x5f9ea0, 0x7fff00, 0xd2691e, 0xff7f50, 0x6495ed, 0xfff8dc, 0xdc143c, 0x00ffff, 0x00008b, 0x008b8b, 0xb8860b, 0xa9a9a9, 0xa9a9a9, 0x006400, 0xbdb76b, 0x8b008b, 0x556b2f, 0xff8c00, 0x9932cc, 0x8b0000, 0xe9967a, 0x8fbc8f, 0x483d8b, 0x2f4f4f, 0x2f4f4f, 0x00ced1, 0x9400d3, 0xff1493, 0x00bfff, 0x696969, 0x696969, 0x1e90ff, 0xb22222, 0xfffaf0, 0x228b22, 0xff00ff, 0xdcdcdc, 0xf8f8ff, 0xffd700, 0xdaa520, 0x808080, 0x808080, 0x008000, 0xadff2f, 0xf0fff0, 0xff69b4, 0xcd5c5c, 0x4b0082, 0xfffff0, 0xf0e68c, 0xe6e6fa, 0xfff0f5, 0x7cfc00, 0xfffacd, 0xadd8e6, 0xf08080, 0xe0ffff, 0xfafad2, 0xd3d3d3, 0xd3d3d3, 0x90ee90, 0xffb6c1, 0xffa07a, 0x20b2aa, 0x87cefa, 0x778899, 0x778899, 0xb0c4de, 0xffffe0, 0x00ff00, 0x32cd32, 0xfaf0e6, 0xff00ff, 0x800000, 0x66cdaa, 0x0000cd, 0xba55d3, 0x9370db, 0x3cb371, 0x7b68ee, 0x00fa9a, 0x48d1cc, 0xc71585, 0x191970, 0xf5fffa, 0xffe4e1, 0xffe4b5, 0xffdead, 0x000080, 0xfdf5e6, 0x808000, 0x6b8e23, 0xffa500, 0xff4500, 0xda70d6, 0xeee8aa, 0x98fb98, 0xafeeee, 0xdb7093, 0xffefd5, 0xffdab9, 0xcd853f, 0xffc0cb, 0xdda0dd, 0xb0e0e6, 0x800080, 0x663399, 0xff0000, 0xbc8f8f, 0x4169e1, 0x8b4513, 0xfa8072, 0xf4a460, 0x2e8b57, 0xfff5ee, 0xa0522d, 0xc0c0c0, 0x87ceeb, 0x6a5acd, 0x708090, 0x708090, 0xfffafa, 0x00ff7f, 0x4682b4, 0xd2b48c, 0x008080, 0xd8bfd8, 0xff6347, 0x40e0d0, 0xee82ee, 0xf5deb3, 0xffffff, 0xf5f5f5, 0xffff00, 0x9acd32]; - var ColorNameToIntegerDict = {}, - name; - for (var i = 0, cnt = ColorNames.length; i < cnt; i++) { - name = ColorNames[i].toLowerCase(); - ColorNameToIntegerDict[name] = ColorValues[i]; - } - var ColorNameToInteger = function ColorNameToInteger(colorName) { - colorName = colorName.toLowerCase(); - if (ColorNameToIntegerDict.hasOwnProperty(colorName)) { - return ColorNameToIntegerDict[colorName]; - } else { - return null; - } - }; + return DropDown; + }(OpenCloseTransition); - var ColorStringToInteger = function ColorStringToInteger(value) { - if (typeof value !== 'string') { - return value; - } - if (value.startsWith('#')) { - value = parseInt(value.substring(1), 16); - } else if (value.startsWith('0x')) { - value = parseInt(value.substring(2), 16); - } else { - value = ColorNameToInteger(value); + var OpenColorPicker = function OpenColorPicker() { + if (this.colorPicker) { + return; } - return value; - }; - var Pad = Phaser.Utils.String.Pad; - var GetHexColorString = function GetHexColorString(value, prefix) { - if (prefix === undefined) { - prefix = '0x'; - } - var colorString = value.toString(16).toUpperCase(); - colorString = Pad(colorString, 6, 0, 1); - colorString = prefix + colorString; - return colorString; + // Layout it to get full height + var colorPicker = CreateColorPicker.call(this).layout(); + var dropDownBehavior = new DropDown(colorPicker, { + // Transition + duration: { + "in": this.colorPickerEaseInDuration, + out: this.colorPickerEaseOutDuration + }, + transitIn: this.colorPickerTransitInCallback, + transitOut: this.colorPickerTransitOutCallback, + // Position + expandDirection: this.colorPickerExpandDirection, + alignTargetX: this, + alignTargetY: this, + bounds: this.colorPickerBounds, + // Close condition + touchOutsideClose: true + }).on('open', function () { + // After popping up + // Can click + colorPicker.on('valuechange', function (value) { + this.setValue(value); + }, this); + }, this).on('close', function () { + this.colorPicker = undefined; + this.dropDownBehavior = undefined; + }, this); + this.colorPicker = colorPicker; + this.dropDownBehavior = dropDownBehavior; + this.pin(colorPicker); + return this; }; - var SetSwatchColor = function SetSwatchColor(swatch, color) { - if (!swatch) { - return; - } - if (swatch.setTint) { - swatch.setTint(color); - } else if (swatch.setFillStyle) { - swatch.setFillStyle(color); - } + var methods$3 = { + openColorPicker: OpenColorPicker }; + Object.assign(methods$3, methods$4); - var GetValue$9 = Phaser.Utils.Objects.GetValue; - var IsPlainObject = Phaser.Utils.Objects.IsPlainObject; - var Clamp$1 = Phaser.Math.Clamp; - var ColorInput$2 = /*#__PURE__*/function (_Sizer) { - _inherits(ColorInput, _Sizer); + var GetValue$6 = Phaser.Utils.Objects.GetValue; + var ColorInput = /*#__PURE__*/function (_ColorInputBase) { + _inherits(ColorInput, _ColorInputBase); var _super = _createSuper(ColorInput); function ColorInput(scene, config) { var _this; @@ -35274,1342 +35434,1191 @@ if (config === undefined) { config = {}; } - config.orientation = 0; _this = _super.call(this, scene, config); - _this.type = 'rexColorInputLite'; - - // Add elements - var background = GetValue$9(config, 'background', undefined); - var swatchConfig = GetValue$9(config, 'swatch'); - var swatchSize; - if (IsPlainObject(swatchConfig)) { - swatchSize = GetValue$9(swatchConfig, 'size'); - } - var swatch = CreateSwatch(scene, GetValue$9(config, 'swatch')); - var inputTextConfig = GetValue$9(config, 'inputText', true); - var inputText; - if (inputTextConfig) { - inputText = CreateInputText(scene, inputTextConfig); - } - if (background) { - _this.addBackground(background); + _this.type = 'rexColorInput'; + if (!config.hasOwnProperty('colorPicker')) { + config.colorPicker = { + background: { + color: 0x0 + } + }; } - if (swatch) { - swatchSize = GetValue$9(config, 'swatchSize', swatchSize); - var squareExpandSwatch; - if (swatchSize !== undefined) { - ResizeGameObject(swatch, swatchSize, swatchSize); - squareExpandSwatch = false; + var colorPickerConfig = config.colorPicker; + var hasColorPicker = colorPickerConfig !== false && colorPickerConfig !== null; + if (hasColorPicker) { + _this.setColorPickerSize(GetValue$6(colorPickerConfig, 'width', 160), GetValue$6(colorPickerConfig, 'height', 170)); + var createBackgroundCallback; + var background = GetValue$6(colorPickerConfig, 'background'); + if (background) { + createBackgroundCallback = function createBackgroundCallback(scene) { + return CreateBackground$1(scene, background); + }; } else { - squareExpandSwatch = GetValue$9(config, 'squareExpandSwatch', true); + createBackgroundCallback = GetValue$6(colorPickerConfig, 'createBackgroundCallback'); } - var fitRatio = squareExpandSwatch ? 1 : 0; - _this.add(swatch, { - proportion: 0, - expand: false, - fitRatio: fitRatio - }); - } - if (inputText) { - var proportion = GetValue$9(inputTextConfig, 'width') === undefined ? 1 : 0; - var expand = GetValue$9(inputTextConfig, 'height') === undefined ? true : false; - _this.add(inputText, { - proportion: proportion, - expand: expand - }); + _this.setCreateColorPickerBackgroundCallback(createBackgroundCallback); + _this.setColorPickerHPalettePosition(GetValue$6(colorPickerConfig, 'hPalettePosition', 0)); + _this.setColorPickerExpandDirection(GetValue$6(colorPickerConfig, 'expandDirection')); + _this.setColorPickerEaseInDuration(GetValue$6(colorPickerConfig, 'easeIn', 200)); + _this.setColorPickerEaseOutDuration(GetValue$6(colorPickerConfig, 'easeOut', 200)); + _this.setColorPickerTransitInCallback(GetValue$6(colorPickerConfig, 'transitIn')); + _this.setColorPickerTransitOutCallback(GetValue$6(colorPickerConfig, 'transitOut')); + _this.setColorPickerBounds(GetValue$6(colorPickerConfig, 'bounds')); + var colorPickerSpaceConfig = GetValue$6(colorPickerConfig, 'space'); + if (colorPickerSpaceConfig === undefined) { + colorPickerSpaceConfig = { + left: 10, + right: 10, + top: 10, + bottom: 10, + item: 8 + }; + } + _this.setColorPickerSpace(colorPickerSpaceConfig); } - _this.addChildrenMap('background', background); - _this.addChildrenMap('swatch', swatch); - _this.addChildrenMap('inputText', inputText); - if (inputText) { - inputText.on('close', function () { - this.setValue(inputText.value); - }, _assertThisInitialized(_this)); + var colorComponentsConfig = config.colorComponents; + var hasColorComponents = colorComponentsConfig !== false && colorComponentsConfig !== null; + if (hasColorPicker && hasColorComponents) { + _this.setColorComponentsHeight(GetValue$6(colorComponentsConfig, 'height', 30)); + _this.setColorComponentsFormatLabelConfig(GetValue$6(colorComponentsConfig, 'formatLabel')); + var colorComponentsInputTextConfig = GetValue$6(colorComponentsConfig, 'inputText'); + if (!colorComponentsInputTextConfig) { + colorComponentsInputTextConfig = GetValue$6(config, 'inputText'); + } + _this.setColorComponentsInputTextConfig(colorComponentsInputTextConfig); + var colorComponentsSpace = GetValue$6(colorComponentsConfig, 'space'); + if (colorComponentsSpace === undefined) { + colorComponentsSpace = { + item: 8 + }; + } + _this.setColorComponentsSpace(colorComponentsSpace); } - var callback = GetValue$9(config, 'valuechangeCallback', null); - if (callback !== null) { - var scope = GetValue$9(config, 'valuechangeCallbackScope', undefined); - _this.on('valuechange', callback, scope); + var swatch = _this.childrenMap.swatch; + if (swatch && hasColorPicker) { + _this.onClick(swatch, _this.openColorPicker, _assertThisInitialized(_this)); } - _this.setValue(GetValue$9(config, 'value', 0x0)); return _this; } - _createClass(ColorInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (typeof value === 'string') { - value = ColorStringToInteger(value); - if (value == null) { - var inputText = this.childrenMap.inputText; - if (inputText) { - inputText.setText(GetHexColorString(this._value)); - } - return; - } - } else { - value = Clamp$1(Math.floor(value), 0, 0xffffff); - } - if (this._value === value) { - return; - } - this._value = value; - var swatch = this.childrenMap.swatch; - if (swatch) { - SetSwatchColor(swatch, value); - } - var inputText = this.childrenMap.inputText; - if (inputText) { - inputText.setText(GetHexColorString(value)); - } - this.emit('valuechange', this._value); - } - }, { - key: "setValue", - value: function setValue(value) { - this.value = value; - return this; - } - }, { - key: "color", - get: function get() { - return this._value; - }, - set: function set(color) { - this.value = color; - } - }, { - key: "setColor", - value: function setColor(color) { - this.color = color; - return this; - } - }]); - return ColorInput; - }(Sizer); + return _createClass(ColorInput); + }(ColorInput$1); + Object.assign(ColorInput.prototype, methods$3); - var methods$2 = { - // Color picker - setCreateColorPickerBackgroundCallback: function setCreateColorPickerBackgroundCallback(callback) { - this.colorPickerCreateBackgroundCallback = callback; - return this; + var CreateColorInput = function CreateColorInput(scene, config, deepCloneConfig) { + if (deepCloneConfig === undefined) { + deepCloneConfig = true; + } + if (deepCloneConfig) { + config = config ? DeepClone(config) : {}; + } else if (!config) { + config = {}; + } + var inputText = new ColorInput(scene, config); + scene.add.existing(inputText); + return inputText; + }; + + var ColorInputHandler = { + name: 'ColorInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'color'; + } + return false; }, - setColorPickerHPalettePosition: function setColorPickerHPalettePosition(position) { - this.colorPickerHPalettePosition = position; - return this; + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.ColorInput'; + var colorInputConfig = style.colorInput; + var colorInput = CreateColorInput(scene, colorInputConfig); + gameObject.add(colorInput, { + proportion: 1, + expand: true, + key: 'colorInput' + }); + colorInput.on('valuechange', function (value) { + gameObject.setValue(value); + }); }, - setColorPickerExpandDirection: function setColorPickerExpandDirection(direction) { - if (typeof direction === 'string') { - direction = ColorPickerExpandDirections[direction]; + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var colorInput = gameObject.getElement('colorInput'); + colorInput.setValue(value); + } + }; + + var StyleMethods$1 = { + setBoxFillStyle: function setBoxFillStyle(color, alpha) { + if (alpha === undefined) { + alpha = 1; } - this.colorPickerExpandDirection = direction; + this.dirty = this.dirty || this.boxFillColor !== color || this.boxFillAlpha !== alpha; + this.boxFillColor = color; + this.boxFillAlpha = alpha; return this; }, - setColorPickerEaseInDuration: function setColorPickerEaseInDuration(duration) { - if (duration === undefined) { - duration = 0; + setUncheckedBoxFillStyle: function setUncheckedBoxFillStyle(color, alpha) { + if (alpha === undefined) { + alpha = 1; } - this.colorPickerEaseInDuration = duration; + this.dirty = this.dirty || this.uncheckedBoxFillColor !== color || this.uncheckedBoxFillAlpha !== alpha; + this.uncheckedBoxFillColor = color; + this.uncheckedBoxFillAlpha = alpha; return this; }, - setColorPickerEaseOutDuration: function setColorPickerEaseOutDuration(duration) { - if (duration === undefined) { - duration = 0; + setBoxStrokeStyle: function setBoxStrokeStyle(lineWidth, color, alpha) { + if (alpha === undefined) { + alpha = 1; } - this.colorPickerEaseOutDuration = duration; - return this; - }, - setColorPickerTransitInCallback: function setColorPickerTransitInCallback(callback) { - this.colorPickerTransitInCallback = callback; - // callback = function(gameObject, duration) {} - return this; - }, - setColorPickerTransitOutCallback: function setColorPickerTransitOutCallback(callback) { - this.colorPickerTransitOutCallback = callback; - // callback = function(gameObject, duration) {} - return this; - }, - setColorPickerBounds: function setColorPickerBounds(bounds) { - this.colorPickerBounds = bounds; - return this; - }, - setColorPickerWidth: function setColorPickerWidth(width) { - this.colorPickerWidth = width; - return this; - }, - setColorPickerHeight: function setColorPickerHeight(height) { - this.colorPickerHeight = height; - return this; - }, - setColorPickerSize: function setColorPickerSize(width, height) { - this.setColorPickerWidth(width).setColorPickerHeight(height); + this.dirty = this.dirty || this.boxLineWidth !== lineWidth || this.boxStrokeColor !== color || this.boxStrokeAlpha !== alpha; + this.boxLineWidth = lineWidth; + this.boxStrokeColor = color; + this.boxStrokeAlpha = alpha; return this; }, - setColorPickerSpace: function setColorPickerSpace(space) { - if (space === undefined) { - space = {}; + setUncheckedBoxStrokeStyle: function setUncheckedBoxStrokeStyle(lineWidth, color, alpha) { + if (alpha === undefined) { + alpha = 1; } - this.colorPickerSpace = space; - return this; - }, - // Color components - setColorComponentsHeight: function setColorComponentsHeight(height) { - this.colorComponentsHeight = height; - return this; - }, - setColorComponentsFormatLabelConfig: function setColorComponentsFormatLabelConfig(config) { - this.colorComponentsFormatLabelConfig = config; + this.dirty = this.dirty || this.uncheckedBoxLineWidth !== lineWidth || this.uncheckedBoxStrokeColor !== color || this.uncheckedBoxStrokeAlpha !== alpha; + this.uncheckedBoxLineWidth = lineWidth; + this.uncheckedBoxStrokeColor = color; + this.uncheckedBoxStrokeAlpha = alpha; return this; }, - setColorComponentsInputTextConfig: function setColorComponentsInputTextConfig(config) { - this.colorComponentsInputTextConfig = config; + setCheckerStyle: function setCheckerStyle(color, alpha) { + if (alpha === undefined) { + alpha = 1; + } + this.dirty = this.dirty || this.checkerColor !== color || this.checkAlpha !== alpha; + this.checkerColor = color; + this.checkAlpha = alpha; return this; }, - setColorComponentsSpace: function setColorComponentsSpace(space) { - if (space === undefined) { - space = {}; + setBoxShape: function setBoxShape(isCircleShape) { + if (isCircleShape === undefined) { + isCircleShape = false; } - this.colorComponentsSpace = space; + if (this.isCircleShape === isCircleShape) { + return this; + } + this.isCircleShape = isCircleShape; + this.isSizeChanged = true; + this.dirty = true; return this; } }; - var ColorPickerExpandDirections = { - down: 0, - up: 1 - }; - var LoadImageMethods = { - loadFromURL: function loadFromURL(url, callback) { - var self = this; - var img = new Image(); - img.onload = function () { - if (self.width !== img.width || self.height !== img.height) { - self.resize(img.width, img.height); - } else { - self.clear(); - } - self.context.drawImage(img, 0, 0); - self.updateTexture(); - if (callback) { - callback(); - } - img.onload = null; - img.src = ''; - img.remove(); - }; - img.src = url; + var SizeMethods$1 = { + setBoxSize: function setBoxSize(size) { + this.dirty = this.dirty || this.boxSize !== size; + this.boxSize = size; return this; }, - loadFromURLPromise: function loadFromURLPromise(url) { - var self = this; - return new Promise(function (resolve, reject) { - self.loadFromURL(url, resolve); - }); - }, - loadFromFile: function loadFromFile(file, callback) { - var url = URL.createObjectURL(file); - this.loadFromURL(url, function () { - URL.revokeObjectURL(url); - if (callback) { - callback(); - } - }); + setCheckerSize: function setCheckerSize(size) { + this.dirty = this.dirty || this.checkerSize !== size; + this.checkerSize = size; return this; - }, - loadFromFilePromise: function loadFromFilePromise(file) { - var self = this; - return new Promise(function (resolve, reject) { - self.loadFromFile(file, resolve); - }); - } - }; - - var Canvas = /*#__PURE__*/function (_CanvasBase) { - _inherits(Canvas, _CanvasBase); - var _super = _createSuper(Canvas); - function Canvas() { - _classCallCheck(this, Canvas); - return _super.apply(this, arguments); - } - return _createClass(Canvas); - }(Canvas$1); - Object.assign(Canvas.prototype, LoadImageMethods); - - var Color$3 = Phaser.Display.Color; - var Percent$2 = Phaser.Math.Percent; - var DrawHPalette = function DrawHPalette(canvas, context, verticalMode) { - if (verticalMode === undefined) { - verticalMode = false; - } - var width = canvas.width; - var height = canvas.height; - var color = new Color$3(); - if (verticalMode) { - for (var iy = 0; iy < height; iy++) { - var h = Percent$2(iy, 0, height); - color.setFromHSV(h, 1, 1); - context.fillStyle = color.rgba; - context.fillRect(0, iy, width, 1); - } - } else { - for (var ix = 0; ix < width; ix++) { - var h = Percent$2(ix, 0, width); - color.setFromHSV(h, 1, 1); - context.fillStyle = color.rgba; - context.fillRect(ix, 0, 1, height); - } - } - }; - var DrawSVPalette = function DrawSVPalette(canvas, context, h) { - var width = canvas.width; - var height = canvas.height; - var imgData = context.getImageData(0, 0, width, height); - var data = imgData.data; - var color = new Color$3(); - for (var iy = 0; iy < height; iy++) { - for (var ix = 0; ix < width; ix++) { - var s = Percent$2(ix, 0, width); - var v = 1 - Percent$2(iy, 0, height); - color.setFromHSV(h, s, v); - var i = (iy * width + ix) * 4; - data[i] = color.red; - data[i + 1] = color.green; - data[i + 2] = color.blue; - data[i + 3] = 255; - } - } - context.putImageData(imgData, 0, 0); - }; - - var Color$2 = Phaser.Display.Color; - var Percent$1 = Phaser.Math.Percent; - var ColorToRGBA$2 = Phaser.Display.Color.ColorToRGBA; - var HSVToRGB$2 = Phaser.Display.Color.HSVToRGB; - var HPaletteCanvas = /*#__PURE__*/function (_Canvas) { - _inherits(HPaletteCanvas, _Canvas); - var _super = _createSuper(HPaletteCanvas); - function HPaletteCanvas(scene, x, y, width, height, orientation) { - var _this; - _classCallCheck(this, HPaletteCanvas); - if (x === undefined) { - x = 0; - } - if (y === undefined) { - y = 0; - } - if (width === undefined) { - width = 2; - } - if (height === undefined) { - height = 2; - } - _this = _super.call(this, scene, x, y, width, height); - _this.type = 'rexColorPicker.HPaletteCanvas'; - _this.colorObject = new Color$2(); - _this.setOrientation(orientation); - _this.setSize(width, height); - return _this; - } - _createClass(HPaletteCanvas, [{ - key: "setOrientation", - value: function setOrientation(orientation) { - this.orientation = GetOrientationMode(orientation); - return this; - } - }, { - key: "updateTexture", - value: function updateTexture() { - DrawHPalette(this.canvas, this.context, this.orientation); - _get(_getPrototypeOf(HPaletteCanvas.prototype), "updateTexture", this).call(this); - return this; - } - }, { - key: "color", - get: function get() { - return this.colorObject.color; - } - }, { - key: "hue", - get: function get() { - return this._hue; - }, - set: function set(value) { - this._hue = value; - } - }, { - key: "getHue", - value: function getHue(localX, localY) { - if (localX === undefined) { - return this.hue; - } - if (this.orientation === 0) { - this.hue = Percent$1(localX, 0, this.width); - } else { - this.hue = Percent$1(localY, 0, this.height); - } - return this.hue; - } - }, { - key: "getColor", - value: function getColor(localX, localY) { - if (localX === undefined) { - return this.color; - } - var h = this.getHue(localX, localY); - this.colorObject.setFromRGB(HSVToRGB$2(h, 1, 1)); - return this.colorObject.color; - } - }, { - key: "setColor", - value: function setColor(color) { - if (this.color === color) { - return this; - } - return this; - } - }, { - key: "colorToLocalPosition", - value: function colorToLocalPosition(color, out) { - if (out === undefined) { - out = {}; - } else if (out === true) { - if (LocalXY$1 === undefined) { - LocalXY$1 = {}; - } - out = LocalXY$1; - } - this.colorObject.setFromRGB(ColorToRGBA$2(color)); - if (this.orientation === 0) { - out.x = this.width * this.colorObject.h; - out.y = this.height / 2; - } else { - out.x = this.width / 2; - out.y = this.height * this.colorObject.h; - } - return out; - } - }]); - return HPaletteCanvas; - }(Canvas); - var LocalXY$1 = undefined; - - var RotateAround = Phaser.Math.RotateAround; - var LocalToWorld = function LocalToWorld(gameObject, localX, localY, out) { - if (out === undefined) { - out = {}; - } else if (out === true) { - if (GlobOut === undefined) { - GlobOut = {}; - } - out = GlobOut; } - localX -= gameObject.width * gameObject.originX; - localY -= gameObject.height * gameObject.originY; - var point = { - x: localX * gameObject.scaleX, - y: localY * gameObject.scaleY - }; - RotateAround(point, 0, 0, -gameObject.rotation); - out.x = gameObject.x + localX; - out.y = gameObject.y + localY; - return out; }; - var GlobOut; - - var HPalette = /*#__PURE__*/function (_OverlapSizer) { - _inherits(HPalette, _OverlapSizer); - var _super = _createSuper(HPalette); - function HPalette(scene, config) { - var _this; - _classCallCheck(this, HPalette); - if (config === undefined) { - config = {}; - } - _this = _super.call(this, scene, config); - var orientation = config.width != null ? 1 : 0; - var paletteCanvas = new HPaletteCanvas(scene).setOrientation(orientation); - scene.add.existing(paletteCanvas); - _this.type = 'rexColorPicker.HPalette'; - paletteCanvas.setInteractive().on('pointerdown', _this.onPaletteCanvasPointerDown, _assertThisInitialized(_this)).on('pointermove', _this.onPaletteCanvasPointerDown, _assertThisInitialized(_this)); - var marker = new RoundRectangle$1(scene, { - strokeColor: 0xffffff, - strokeWidth: 2 - }); - scene.add.existing(marker); - _this.add(paletteCanvas, { - key: 'paletteCanvas', - expand: true - }).add(marker, { - key: 'marker', - expand: false - }); - return _this; - } - _createClass(HPalette, [{ - key: "resize", - value: function resize(width, height) { - if (this.width === width && this.height === height) { - return this; - } - _get(_getPrototypeOf(HPalette.prototype), "resize", this).call(this, width, height); - var size = Math.min(width, height); - this.childrenMap.marker.setSize(size, size); - return this; - } - }, { - key: "onPaletteCanvasPointerDown", - value: function onPaletteCanvasPointerDown(pointer, localX, localY, event) { - if (!pointer.isDown) { - return; - } - var paletteCanvas = this.childrenMap.paletteCanvas; - var color = paletteCanvas.getColor(localX, localY); - this.setMarkerPosition(color); - this.emit('input', color); - } - }, { - key: "color", - get: function get() { - return this.childrenMap.paletteCanvas.color; - } - }, { - key: "setColor", - value: function setColor(color) { - if (this.color === color) { - return this; - } - var paletteCanvas = this.childrenMap.paletteCanvas; - paletteCanvas.setColor(color); - this.setMarkerPosition(color); - return this; - } - }, { - key: "setMarkerPosition", - value: function setMarkerPosition(color) { - var paletteCanvas = this.childrenMap.paletteCanvas; - var marker = this.childrenMap.marker; - var localXY = paletteCanvas.colorToLocalPosition(color, true); - LocalToWorld(paletteCanvas, localXY.x, localXY.y, marker); - this.resetChildPositionState(marker); - return this; - } - }, { - key: "getHue", - value: function getHue(localX, localY) { - var paletteCanvas = this.childrenMap.paletteCanvas; - return paletteCanvas.getHue(localX, localY); - } - }]); - return HPalette; - }(OverlapSizer); - var Color$1 = Phaser.Display.Color; - var Percent = Phaser.Math.Percent; - var ColorToRGBA$1 = Phaser.Display.Color.ColorToRGBA; - var HSVToRGB$1 = Phaser.Display.Color.HSVToRGB; - var SVPaletteCanvas = /*#__PURE__*/function (_Canvas) { - _inherits(SVPaletteCanvas, _Canvas); - var _super = _createSuper(SVPaletteCanvas); - function SVPaletteCanvas(scene, x, y, width, height, hue) { - var _this; - _classCallCheck(this, SVPaletteCanvas); - if (x === undefined) { - x = 0; - } - if (y === undefined) { - y = 0; - } - if (width === undefined) { - width = 2; - } - if (height === undefined) { - height = 2; - } - _this = _super.call(this, scene, x, y, width, height); - _this.type = 'rexColorPicker.SVPaletteCanvas'; - if (hue === undefined) { - hue = 1; - } - _this.colorObject = new Color$1(); - _this.setHue(hue); - _this.setSize(width, height); - return _this; - } - _createClass(SVPaletteCanvas, [{ - key: "color", - get: function get() { - return this.colorObject.color; - } - }, { - key: "hue", - get: function get() { - return this._hue; - }, - set: function set(hue) { - if (this._hue === hue) { - return; - } - this._hue = hue; - this.colorObject.h = hue; - this.dirty = true; - } - }, { - key: "setHue", - value: function setHue(hue) { - this.hue = hue; - return this; - } - }, { - key: "updateTexture", - value: function updateTexture() { - DrawSVPalette(this.canvas, this.context, this.hue); - _get(_getPrototypeOf(SVPaletteCanvas.prototype), "updateTexture", this).call(this); - return this; - } - }, { - key: "getColor", - value: function getColor(localX, localY) { - if (localX === undefined) { - return this.colorObject.color; - } - var s = Percent(localX, 0, this.width); - var v = 1 - Percent(localY, 0, this.height); - this.colorObject.setFromRGB(HSVToRGB$1(this.hue, s, v)); - return this.colorObject.color; - } - }, { - key: "setColor", - value: function setColor(color) { - if (this.color === color) { - return this; - } - this.colorObject.setFromRGB(ColorToRGBA$1(color)); - this.setHue(this.colorObject.h); - return this; - } - }, { - key: "colorToLocalPosition", - value: function colorToLocalPosition(color, out) { - if (out === undefined) { - out = {}; - } else if (out === true) { - if (LocalXY === undefined) { - LocalXY = {}; - } - out = LocalXY; - } - this.colorObject.setFromRGB(ColorToRGBA$1(color)); - out.x = this.width * this.colorObject.s; - out.y = this.height * (1 - this.colorObject.v); - return out; - } - }]); - return SVPaletteCanvas; - }(Canvas); - var LocalXY = undefined; - - var SVPalette = /*#__PURE__*/function (_OverlapSizer) { - _inherits(SVPalette, _OverlapSizer); - var _super = _createSuper(SVPalette); - function SVPalette(scene, config) { - var _this; - _classCallCheck(this, SVPalette); - _this = _super.call(this, scene, config); - var paletteCanvas = new SVPaletteCanvas(scene); - scene.add.existing(paletteCanvas); - _this.type = 'rexColorPicker.SVPalette'; - paletteCanvas.setInteractive().on('pointerdown', _this.onPaletteCanvasPointerDown, _assertThisInitialized(_this)).on('pointermove', _this.onPaletteCanvasPointerDown, _assertThisInitialized(_this)); - var marker = new RoundRectangle$1(scene, { - radius: 5, - strokeColor: 0xffffff, - strokeWidth: 2 - }); - scene.add.existing(marker); - _this.add(paletteCanvas, { - key: 'paletteCanvas', - expand: true - }).add(marker, { - key: 'marker', - expand: false - }); - return _this; - } - _createClass(SVPalette, [{ - key: "onPaletteCanvasPointerDown", - value: function onPaletteCanvasPointerDown(pointer, localX, localY, event) { - if (!pointer.isDown) { - return; - } - var paletteCanvas = this.childrenMap.paletteCanvas; - var color = paletteCanvas.getColor(localX, localY); - this.setMarkerPosition(color); - this.emit('input', color); - } - }, { - key: "color", - get: function get() { - return this.childrenMap.paletteCanvas.color; - } - }, { - key: "setHue", - value: function setHue(hue) { - var paletteCanvas = this.childrenMap.paletteCanvas; - paletteCanvas.setHue(hue); // Redraw paletteCanvas - // Position of marker does not change - return this; - } - }, { - key: "setColor", - value: function setColor(color) { - if (this.color === color) { - return this; + var ShapesUpdateMethods$1 = { + buildShapes: function buildShapes() { + this.addShape(new RoundRectangle().setName('box')).addShape(new Lines().setName('checker')); + }, + updateShapes: function updateShapes() { + var centerX = this.width / 2, + centerY = this.height / 2, + radius = Math.min(centerX, centerY); + var width = radius * 2; + var x = centerX - radius, + y = centerY - radius; + var boxLineWidth = this.boxLineWidth; + var checkLineWidth = Math.max(width / 10, 2); + var boxShape = this.getShape('box'); + var checkerShape = this.getShape('checker'); + + // Setup shapes + if (this.isSizeChanged) { + // Box + var posOffset = width * (1 - this.boxSize) / 2; + var halfBoxLineWidth = boxLineWidth / 2; + var boxInnerWidth = width * this.boxSize - boxLineWidth; + boxShape.setTopLeftPosition(x + halfBoxLineWidth + posOffset, y + halfBoxLineWidth + posOffset).setSize(boxInnerWidth, boxInnerWidth); + if (this.isCircleShape) { + boxShape.setRadius(boxInnerWidth / 2); + } else { + boxShape.setRadius(0); } - var paletteCanvas = this.childrenMap.paletteCanvas; - paletteCanvas.setColor(color); // Redraw paletteCanvas - this.setMarkerPosition(color); - return this; - } - }, { - key: "setMarkerPosition", - value: function setMarkerPosition(color) { - var paletteCanvas = this.childrenMap.paletteCanvas; - var marker = this.childrenMap.marker; - var localXY = paletteCanvas.colorToLocalPosition(color, true); - LocalToWorld(paletteCanvas, localXY.x, localXY.y, marker); - this.resetChildPositionState(marker); - return this; + + // Checker + var posOffset = width * (1 - this.checkerSize) / 2; + var unit = width * this.checkerSize / 4; + var u1 = unit * 1, + u2 = unit * 2, + u3 = unit * 3; + checkerShape.startAt(u1, u2).lineTo(u2, u3).lineTo(u3, u1).offset(x + posOffset, y + posOffset).end(); } - }]); - return SVPalette; - }(OverlapSizer); - var GetValue$8 = Phaser.Utils.Objects.GetValue; - var ColorPicker = /*#__PURE__*/function (_Sizer) { - _inherits(ColorPicker, _Sizer); - var _super = _createSuper(ColorPicker); - function ColorPicker(scene, config) { - var _this; - _classCallCheck(this, ColorPicker); - _this = _super.call(this, scene, config); - _this.type = 'rexColorPicker'; - _this.freezePalettes = false; + // Set styles + if (this.checked) { + boxShape.fillStyle(this.boxFillColor, this.boxFillAlpha).lineStyle(boxLineWidth, this.boxStrokeColor, this.boxStrokeAlpha); + checkerShape.lineStyle(checkLineWidth, this.checkerColor); + } else { + boxShape.fillStyle(this.uncheckedBoxFillColor, this.uncheckedBoxFillAlpha).lineStyle(boxLineWidth, this.uncheckedBoxStrokeColor, this.uncheckedBoxStrokeAlpha); + checkerShape.lineStyle(); + } - // orientation - var hPalettePosition = GetValue$8(config, 'hPalette.position', 0); - if (typeof hPalettePosition === 'string') { - hPalettePosition = HPalettePositionNamesMap[hPalettePosition]; + // Play checker animation + if (this.checked) { + checkerShape.setDisplayPathSegment(this.checkerAnimProgress); } - var orientation = hPalettePosition === 0 || - // bottom - hPalettePosition === 2 // top - ? 1 : - // y - 0; // x - _this.setOrientation(orientation); + } + }; - // Add elements - var background = GetValue$8(config, 'background', undefined); - var hPaletteWidth, hPaletteHeight; - if (_this.orientation === 0) { - var hPaletteWidth = GetValue$8(config, 'hPalette.width', undefined); - if (hPaletteWidth === undefined) { - hPaletteWidth = GetValue$8(config, 'hPalette.size', 10); - } - } else { - hPaletteHeight = GetValue$8(config, 'hPalette.height', undefined); - if (hPaletteHeight === undefined) { - hPaletteHeight = GetValue$8(config, 'hPalette.size', 10); - } + var CheckerAnimationMethods = { + setCheckerAnimationDuration: function setCheckerAnimationDuration(duration) { + if (duration === undefined) { + duration = 0; } - var hPalette = new HPalette(scene, { - width: hPaletteWidth, - height: hPaletteHeight - }); - scene.add.existing(hPalette); - var svPaletteWidth = GetValue$8(config, 'svPalette.width', undefined); - var svPaletteHeight = GetValue$8(config, 'svPalette.height', undefined); - var svPalette = new SVPalette(scene, { - width: svPaletteWidth, - height: svPaletteHeight + this.checkerAnimDuration = duration; + return this; + }, + playCheckerAnimation: function playCheckerAnimation() { + if (this.checkerAnimProgressTask === undefined) { + this.checkerAnimProgressTask = new EaseValueTask(this, { + eventEmitter: null + }); + } + this.checkerAnimProgressTask.restart({ + key: 'checkerAnimProgress', + from: 0, + to: 1, + duration: this.checkerAnimDuration }); - scene.add.existing(svPalette); - if (background) { - _this.addBackground(background); + return this; + }, + stopCheckerAnimation: function stopCheckerAnimation() { + if (this.checkerAnimProgressTask === undefined) { + return this; } - var hPaletteAddConfig = { - proportion: 0, - expand: true - }; - var svPaletteProportion, svPaletteExpand; - if (_this.orientation === 0) { - svPaletteProportion = svPaletteWidth === undefined ? 1 : 0; - svPaletteExpand = svPaletteHeight === undefined ? true : false; - } else { - svPaletteProportion = svPaletteHeight === undefined ? 1 : 0; - svPaletteExpand = svPaletteWidth === undefined ? true : false; + this.checkerAnimProgressTask.stop(); + return this; + } + }; + + var methods$2 = {}; + Object.assign(methods$2, StyleMethods$1, SizeMethods$1, ShapesUpdateMethods$1, CheckerAnimationMethods); + + var GetValue$5 = Phaser.Utils.Objects.GetValue; + var IsPlainObject$1 = Phaser.Utils.Objects.IsPlainObject; + var DefaultBoxFillColor = 0x005cb2; + var DefaultCheckerColor = 0xffffff; + var CheckboxShape = /*#__PURE__*/function (_BaseShapes) { + _inherits(CheckboxShape, _BaseShapes); + var _super = _createSuper(CheckboxShape); + function CheckboxShape(scene, x, y, width, height, color, config) { + var _this; + _classCallCheck(this, CheckboxShape); + if (IsPlainObject$1(x)) { + config = x; + x = GetValue$5(config, 'x', 0); + y = GetValue$5(config, 'y', 0); + width = GetValue$5(config, 'width', 2); + height = GetValue$5(config, 'height', 2); + color = GetValue$5(config, 'color', DefaultBoxFillColor); + } else if (IsPlainObject$1(color)) { + config = color; + color = GetValue$5(config, 'color', DefaultBoxFillColor); } - var svPaletteAddConfig = { - proportion: svPaletteProportion, - expand: svPaletteExpand - }; - if (hPalettePosition === 0 || hPalettePosition === 3) { - // bottom, right - _this.add(svPalette, svPaletteAddConfig).add(hPalette, hPaletteAddConfig); - } else { - // left, top - _this.add(hPalette, hPaletteAddConfig).add(svPalette, svPaletteAddConfig); + _this = _super.call(this, scene, x, y, width, height); + _this.type = 'rexCheckbox'; + if (color === undefined) { + color = DefaultBoxFillColor; } - hPalette.on('input', function () { - svPalette.setHue(hPalette.getHue()); - this.setValue(svPalette.color, true); - }, _assertThisInitialized(_this)); - svPalette.on('input', function () { - this.setValue(svPalette.color, true); - }, _assertThisInitialized(_this)); - _this.addChildrenMap('background', background); - _this.addChildrenMap('hPalette', hPalette); - _this.addChildrenMap('svPalette', svPalette); - var callback = GetValue$8(config, 'valuechangeCallback', null); - if (callback !== null) { - var scope = GetValue$8(config, 'valuechangeCallbackScope', undefined); - _this.on('valuechange', callback, scope); + _this.setBoxShape(GetValue$5(config, 'circleBox', false)); + _this.setBoxFillStyle(color, GetValue$5(config, 'boxFillAlpha', 1)); + _this.setUncheckedBoxFillStyle(GetValue$5(config, 'uncheckedColor', null), GetValue$5(config, 'uncheckedBoxFillAlpha', 1)); + _this.setBoxStrokeStyle(GetValue$5(config, 'boxLineWidth', 4), GetValue$5(config, 'boxStrokeColor', color), GetValue$5(config, 'boxStrokeAlpha', 1)); + _this.setUncheckedBoxStrokeStyle(_this.boxLineWidth, GetValue$5(config, 'uncheckedBoxStrokeColor', _this.boxStrokeColor), GetValue$5(config, 'uncheckedBoxStrokeAlpha', _this.boxStrokeAlpha)); + _this.setCheckerStyle(GetValue$5(config, 'checkerColor', DefaultCheckerColor), GetValue$5(config, 'checkerAlpha', 1)); + _this.setBoxSize(GetValue$5(config, 'boxSize', 1)); + _this.setCheckerSize(GetValue$5(config, 'checkerSize', 1)); + _this.setCheckerAnimationDuration(GetValue$5(config, 'animationDuration', 150)); + _this.buildShapes(); + var value = GetValue$5(config, 'checked'); + if (value === undefined) { + value = GetValue$5(config, 'value', false); } - _this.setValue(GetValue$8(config, 'value', 0xffffff)); + _this.setValue(value); return _this; } - _createClass(ColorPicker, [{ + _createClass(CheckboxShape, [{ key: "value", get: function get() { return this._value; }, set: function set(value) { + value = !!value; if (this._value === value) { return; } - var oldValue = this._value; + this.dirty = true; this._value = value; - if (!this.freezePalettes) { - this.updatePalettes(); + if (value) { + this.playCheckerAnimation(); + } else { + this.stopCheckerAnimation(); } - this.emit('valuechange', value, oldValue, this); + this.emit('valuechange', value); } }, { key: "setValue", - value: function setValue(value, freezePalettes) { - this.freezePalettes = !!freezePalettes; + value: function setValue(value) { this.value = value; - this.freezePalettes = false; return this; } }, { - key: "color", + key: "toggleValue", + value: function toggleValue() { + this.setValue(!this.value); + return this; + } + }, { + key: "checked", get: function get() { - return this._value; + return this.value; }, - set: function set(color) { - this.value = color; + set: function set(value) { + this.value = value; } }, { - key: "setColor", - value: function setColor(color) { - this.color = color; + key: "setChecked", + value: function setChecked(checked) { + if (checked === undefined) { + checked = true; + } + this.setValue(checked); return this; } }, { - key: "updatePalettes", - value: function updatePalettes() { - this.childrenMap.hPalette.setColor(this.color); - this.childrenMap.svPalette.setColor(this.color); + key: "toggleChecked", + value: function toggleChecked() { + this.toggleValue(); return this; } }, { - key: "runLayout", - value: function runLayout(parent, newWidth, newHeight) { - if (this.ignoreLayout) { - return this; + key: "checkerAnimProgress", + get: function get() { + return this._checkerAnimProgress; + }, + set: function set(value) { + if (this._checkerAnimProgress === value) { + return; } - _get(_getPrototypeOf(ColorPicker.prototype), "runLayout", this).call(this, parent, newWidth, newHeight); - this.childrenMap.hPalette.setMarkerPosition(this.value); - this.childrenMap.svPalette.setMarkerPosition(this.value); + this._checkerAnimProgress = value; + this.dirty = true; + } + }]); + return CheckboxShape; + }(BaseShapes); + Object.assign(CheckboxShape.prototype, methods$2); + + var GetValue$4 = Phaser.Utils.Objects.GetValue; + var Checkbox = /*#__PURE__*/function (_CheckboxShape) { + _inherits(Checkbox, _CheckboxShape); + var _super = _createSuper(Checkbox); + function Checkbox(scene, x, y, width, height, color, config) { + var _this; + _classCallCheck(this, Checkbox); + _this = _super.call(this, scene, x, y, width, height, color, config); + _this._click = new Button(_assertThisInitialized(_this), GetValue$4(config, 'click')); + _this._click.on('click', function () { + this.toggleValue(); + }, _assertThisInitialized(_this)); + _this.setReadOnly(GetValue$4(config, 'readOnly', false)); + return _this; + } + _createClass(Checkbox, [{ + key: "readOnly", + get: function get() { + return !this._click.enable; + }, + set: function set(value) { + this._click.enable = !value; + } + }, { + key: "setReadOnly", + value: function setReadOnly(enable) { + if (enable === undefined) { + enable = true; + } + this.readOnly = enable; return this; } }]); - return ColorPicker; - }(Sizer); - var HPalettePositionNamesMap = { - bottom: 0, - left: 1, - top: 2, - right: 3 + return Checkbox; + }(CheckboxShape); + + var CreateCheckbox = function CreateCheckbox(scene, config) { + var gameObject = new Checkbox(scene, config); + scene.add.existing(gameObject); + return gameObject; }; - var GetValue$7 = Phaser.Utils.Objects.GetValue; - var Color = Phaser.Display.Color; - var ColorToRGBA = Phaser.Display.Color.ColorToRGBA; - var HSVToRGB = Phaser.Display.Color.HSVToRGB; - var Clamp = Phaser.Math.Clamp; - var ColorComponents = /*#__PURE__*/function (_Sizer) { - _inherits(ColorComponents, _Sizer); - var _super = _createSuper(ColorComponents); - function ColorComponents(scene, config) { - var _this; - _classCallCheck(this, ColorComponents); - if (config === undefined) { - config = {}; + var CheckboxInputHandler = { + name: 'CheckboxInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'boolean'; } - config.orientation = 0; - _this = _super.call(this, scene, config); - _this.type = 'rexColorComponents'; - _this.colorObject = new Color(); + return typeof config.value === 'boolean'; + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.CheckboxInput'; + var checkboxConfig = style.checkbox; + var checkbox = CreateCheckbox(scene, checkboxConfig); + var size = checkboxConfig.size; + if (size !== undefined) { + checkbox.setSize(size, size); + } + var fitRatio = size !== undefined ? 0 : 1; + gameObject.add(checkbox, { + proportion: 0, + expand: false, + fitRatio: fitRatio, + key: 'checkbox' + }); + checkbox.on('valuechange', function (value) { + gameObject.setValue(value); + }); + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var checkbox = gameObject.getElement('checkbox'); + checkbox.setValue(value); + } + }; - // Add elements - var background = GetValue$7(config, 'background', undefined); - var formatLabel = GetValue$7(config, 'formatLabel', undefined); - if (!IsGameObject(formatLabel)) { - formatLabel = CreateLabel(scene, formatLabel).resetDisplayContent(); + var StyleMethods = { + setTrackFillStyle: function setTrackFillStyle(color, alpha) { + if (alpha === undefined) { + alpha = 1; } - var components = []; - if (config.inputText0 && config.inputText1 && config.inputText2) { - components.push(config.inputText0); - components.push(config.inputText1); - components.push(config.inputText2); - } else { - var inputTextConfig = GetValue$7(config, 'inputText'); - for (var i = 0; i < 3; i++) { - var inputText = CreateInputText(scene, inputTextConfig).setMaxLength(3).setNumberInput(); - components.push(inputText); - } + this.dirty = this.dirty || this.trackFillColor !== color || this.trackFillAlpha !== alpha; + this.trackFillColor = color; + this.trackFillAlpha = alpha; + return this; + }, + setFalseValueTrackFillStyle: function setFalseValueTrackFillStyle(color, alpha) { + if (alpha === undefined) { + alpha = 1; } - if (background) { - _this.addBackground(background); + this.dirty = this.dirty || this.falseValueTrackColor !== color || this.uncheckedTrackFillAlpha !== alpha; + this.falseValueTrackColor = color; + this.falseValueTrackFillAlpha = alpha; + return this; + }, + setThumbStyle: function setThumbStyle(color, alpha) { + if (alpha === undefined) { + alpha = 1; } - var proportion = GetValue$7(config, 'proportion.formatLabel', 0); - var defaultExpand = formatLabel.isRexContainerLite ? true : false; - var expand = GetValue$7(config, 'expand.formatLabel', defaultExpand); - _this.add(formatLabel, { - proportion: proportion, - expand: expand + this.dirty = this.dirty || this.thumbColor !== color || this.checkAlpha !== alpha; + this.thumbColor = color; + this.thumbAlpha = alpha; + return this; + } + }; + + var SizeMethods = { + setTrackSize: function setTrackSize(width, height) { + this.dirty = this.dirty || this.trackWidth !== width || this.trackHeight !== height; + this.trackWidth = width; + this.trackHeight = height; + return this; + }, + setTrackRadius: function setTrackRadius(radius) { + this.dirty = this.dirty || this.trackRadius !== radius; + this.trackRadius = radius; + return this; + }, + setThumbSize: function setThumbSize(width, height) { + if (height === undefined) { + height = width; + } + this.dirty = this.dirty || this.thumbWidth !== width || this.thumbHeight !== height; + this.thumbWidth = width; + this.thumbHeight = height; + return this; + }, + setThumbRadius: function setThumbRadius(radius) { + this.dirty = this.dirty || this.thumbRadius !== radius; + this.thumbRadius = radius; + return this; + } + }; + + var PositionMethods = { + setThumbPosition: function setThumbPosition(left, right) { + if (right === undefined) { + right = 1 - left; + } + this.thumbLeftX = left; + this.thumbRightX = right; + return this; + }, + setRTL: function setRTL(rtl) { + if (rtl === undefined) { + rtl = true; + } + this.rtl = rtl; + return this; + } + }; + + /** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + + /** + * Calculates a linear (interpolation) value over t. + * + * @function Phaser.Math.Linear + * @since 3.0.0 + * + * @param {number} p0 - The first point. + * @param {number} p1 - The second point. + * @param {number} t - The percentage between p0 and p1 to return, represented as a number between 0 and 1. + * + * @return {number} The step t% of the way between p0 and p1. + */ + var Linear$1 = function Linear(p0, p1, t) { + return (p1 - p0) * t + p0; + }; + + var GetR = function GetR(colorInt) { + return colorInt >> 16 & 0xff; + }; + var GetG = function GetG(colorInt) { + return colorInt >> 8 & 0xff; + }; + var GetB = function GetB(colorInt) { + return colorInt & 0xff; + }; + + var MixColor = function MixColor(color0, color1, t) { + var r = Linear$1(GetR(color0), GetR(color1), t); + var g = Linear$1(GetG(color0), GetG(color1), t); + var b = Linear$1(GetB(color0), GetB(color1), t); + return (r & 0xff) << 16 | (g & 0xff) << 8 | b & 0xff; + }; + + var Linear = Phaser.Math.Linear; + var ShapesUpdateMethods = { + buildShapes: function buildShapes() { + this.addShape(new RoundRectangle().setName('track')).addShape(new RoundRectangle().setName('thumb')); + }, + updateShapes: function updateShapes() { + var width = this.width, + height = this.height; + var toggleAnimProgress = this.value ? this.toggleAnimProgress : 1 - this.toggleAnimProgress; + + // Track + var trackShape = this.getShape('track'); + if (this.isSizeChanged) { + var trackWidth = width * this.trackWidth, + trackHeight = height * this.trackHeight, + trackX = (width - trackWidth) / 2, + trackY = (height - trackHeight) / 2, + trackRadius = height * this.trackRadius; + trackShape.setTopLeftPosition(trackX, trackY).setSize(trackWidth, trackHeight).setRadius(trackRadius); + } + var trackFillColor = MixColor(this.falseValueTrackColor, this.trackFillColor, toggleAnimProgress); + var trackFillAlpha = Linear(this.falseValueTrackFillAlpha, this.trackFillAlpha, toggleAnimProgress); + trackShape.fillStyle(trackFillColor, trackFillAlpha); + + // Thumb + var thumbShape = this.getShape('thumb'); + if (this.isSizeChanged) { + var thumbWidth = width * this.thumbWidth, + thumbHeight = height * this.thumbHeight, + thumbRadius = height * this.thumbRadius; + thumbShape.setSize(thumbWidth, thumbHeight).setRadius(thumbRadius); + } + var thumbX = Linear(this.thumbLeftX, this.thumbRightX, toggleAnimProgress) * width; + if (this.rtl) { + thumbX = width - thumbX; + } + var thumbY = height / 2; + thumbShape.setCenterPosition(thumbX, thumbY); + thumbShape.fillStyle(this.thumbColor, this.thumbAlpha); + } + }; + + var ToggleAnimationMethods = { + setToggleAnimationDuration: function setToggleAnimationDuration(duration) { + if (duration === undefined) { + duration = 0; + } + this.toggleAnimDuration = duration; + return this; + }, + playToggleAnimation: function playToggleAnimation() { + if (this.toggleAnimProgressTask === undefined) { + this.toggleAnimProgressTask = new EaseValueTask(this, { + eventEmitter: null + }); + } + this.toggleAnimProgressTask.restart({ + key: 'toggleAnimProgress', + from: 0, + to: 1, + duration: this.toggleAnimDuration }); - var proportion = GetValue$7(inputTextConfig, 'width') === undefined ? 1 : 0; - var expand = GetValue$7(inputTextConfig, 'height') === undefined ? true : false; - for (var i = 0, cnt = components.length; i < cnt; i++) { - _this.add(components[i], { - proportion: proportion, - expand: expand - }); + return this; + }, + stopToggleAnimation: function stopToggleAnimation() { + if (this.toggleAnimProgressTask === undefined) { + return this; } - _this.addChildrenMap('background', background); - _this.addChildrenMap('formatLabel', formatLabel); - _this.addChildrenMap('components', components); - _this.onClick(formatLabel, _this.toggleColorFormat, _assertThisInitialized(_this)); - for (var i = 0, cnt = components.length; i < cnt; i++) { - components[i].on('close', function () { - this.updateColorObject(); - this.setValue(this.colorObject.color); - }, _assertThisInitialized(_this)); + this.toggleAnimProgressTask.stop(); + return this; + } + }; + + var methods$1 = {}; + Object.assign(methods$1, StyleMethods, SizeMethods, PositionMethods, ShapesUpdateMethods, ToggleAnimationMethods); + + var GrayScale = function GrayScale(color) { + var shade = 0.3 * GetR(color) + 0.59 * GetG(color) + 0.11 * GetB(color); + return (shade & 0xff) << 16 | (shade & 0xff) << 8 | shade & 0xff; + }; + + var GetValue$3 = Phaser.Utils.Objects.GetValue; + var IsPlainObject = Phaser.Utils.Objects.IsPlainObject; + var DefaultTrackFillColor = 0x005cb2; + var DefaultThumbFillColor = 0xffffff; + var ToggleSwitchShape = /*#__PURE__*/function (_BaseShapes) { + _inherits(ToggleSwitchShape, _BaseShapes); + var _super = _createSuper(ToggleSwitchShape); + function ToggleSwitchShape(scene, x, y, width, height, color, config) { + var _this; + _classCallCheck(this, ToggleSwitchShape); + if (IsPlainObject(x)) { + config = x; + x = GetValue$3(config, 'x', 0); + y = GetValue$3(config, 'y', 0); + width = GetValue$3(config, 'width', 2); + height = GetValue$3(config, 'height', 2); + color = GetValue$3(config, 'color', DefaultTrackFillColor); + } else if (IsPlainObject(color)) { + config = color; + color = GetValue$3(config, 'color', DefaultTrackFillColor); } - var callback = GetValue$7(config, 'valuechangeCallback', null); - if (callback !== null) { - var scope = GetValue$7(config, 'valuechangeCallbackScope', undefined); - _this.on('valuechange', callback, scope); + _this = _super.call(this, scene, x, y, width, height); + _this.type = 'rexToggleSwitch'; + if (color === undefined) { + color = DefaultTrackFillColor; } - formatLabel.setText('RGB'); - _this.setValue(GetValue$7(config, 'value', 0xffffff)); + _this.setTrackFillStyle(color, GetValue$3(config, 'trackFillAlpha', 1)); + _this.setFalseValueTrackFillStyle(GetValue$3(config, 'falseValueTrackColor', GrayScale(color)), GetValue$3(config, 'falseValueTrackFillAlpha', 1)); + _this.setThumbStyle(GetValue$3(config, 'thumbColor', DefaultThumbFillColor), GetValue$3(config, 'thumbAlpha', 1)); + _this.setTrackSize(GetValue$3(config, 'trackWidth', 0.9), GetValue$3(config, 'trackHeight', 0.5)); + _this.setTrackRadius(GetValue$3(config, 'trackRadius', _this.trackHeight * 0.5)); + var thumbHeight = GetValue$3(config, 'thumbHeight', undefined); + var thumbWidth = GetValue$3(config, 'thumbWidth', thumbHeight); + if (thumbWidth === undefined) { + thumbWidth = _this.trackHeight * 0.9; + } + _this.setThumbSize(thumbWidth, thumbHeight); + _this.setThumbRadius(GetValue$3(config, 'thumbRadius', _this.thumbHeight * 0.5)); + _this.setThumbPosition(GetValue$3(config, 'thumbLeft', 0.3), GetValue$3(config, 'thumbRight', undefined)); + _this.setRTL(GetValue$3(config, 'rtl', false)); + _this.setToggleAnimationDuration(GetValue$3(config, 'animationDuration', 150)); + _this.buildShapes(); + _this.setValue(GetValue$3(config, 'value', false), 0); return _this; } - _createClass(ColorComponents, [{ + _createClass(ToggleSwitchShape, [{ key: "value", get: function get() { return this._value; }, set: function set(value) { - value = Clamp(Math.floor(value), 0, 0xffffff); + value = !!value; if (this._value === value) { return; } + this.dirty = true; this._value = value; - this.colorObject.setFromRGB(ColorToRGBA(value)); - this.updateComponents(); - this.emit('valuechange', this._value); + this.playToggleAnimation(); + this.emit('valuechange', value); } }, { key: "setValue", - value: function setValue(value) { + value: function setValue(value, duration) { + if (duration === undefined) { + duration = this.toggleAnimDuration; + } + var durationSave = this.toggleAnimDuration; + this.toggleAnimDuration = duration; this.value = value; + this.toggleAnimDuration = durationSave; return this; } }, { - key: "color", - get: function get() { - return this._value; - }, - set: function set(color) { - this.value = color; - } - }, { - key: "setColor", - value: function setColor(color) { - this.color = color; + key: "toggleValue", + value: function toggleValue(duration) { + this.setValue(!this.value, duration); return this; } }, { - key: "colorFormat", + key: "toggleAnimProgress", get: function get() { - return this.childrenMap.formatLabel.text; + return this._toggleAnimProgress; }, set: function set(value) { - if (this.colorFormat === value) { + if (this._toggleAnimProgress === value) { return; } - this.childrenMap.formatLabel.setText(value); - this.updateComponents(); - } - }, { - key: "setColorFormat", - value: function setColorFormat(colrType) { - this.colorFormat = colrType; - return this; - } - }, { - key: "toggleColorFormat", - value: function toggleColorFormat() { - this.colorFormat = this.colorFormat === 'RGB' ? 'HSV' : 'RGB'; - return this; + this._toggleAnimProgress = value; + this.dirty = true; } - }, { - key: "updateComponents", - value: function updateComponents() { - var components = this.childrenMap.components; - var value0, value1, value2; - if (this.colorFormat === 'RGB') { - value0 = this.colorObject.red; - value1 = this.colorObject.green; - value2 = this.colorObject.blue; - } else { - // colorFormat === 'HSV' - value0 = Math.floor(this.colorObject.h * 360); - value1 = Math.floor(this.colorObject.s * 100); - value2 = Math.floor(this.colorObject.v * 100); - } - components[0].setValue(value0); - components[1].setValue(value1); - components[2].setValue(value2); - return this; + }]); + return ToggleSwitchShape; + }(BaseShapes); + Object.assign(ToggleSwitchShape.prototype, methods$1); + + var GetValue$2 = Phaser.Utils.Objects.GetValue; + var ToggleSwitch = /*#__PURE__*/function (_ToggleSwitchShape) { + _inherits(ToggleSwitch, _ToggleSwitchShape); + var _super = _createSuper(ToggleSwitch); + function ToggleSwitch(scene, x, y, width, height, color, config) { + var _this; + _classCallCheck(this, ToggleSwitch); + _this = _super.call(this, scene, x, y, width, height, color, config); + _this._click = new Button(_assertThisInitialized(_this), GetValue$2(config, 'click')); + _this._click.on('click', function () { + this.toggleValue(); + }, _assertThisInitialized(_this)); + _this.setReadOnly(GetValue$2(config, 'readOnly', false)); + return _this; + } + _createClass(ToggleSwitch, [{ + key: "readOnly", + get: function get() { + return !this._click.enable; + }, + set: function set(value) { + this._click.enable = !value; } }, { - key: "updateColorObject", - value: function updateColorObject() { - var components = this.childrenMap.components; - if (this.colorFormat === 'RGB') { - var red = Clamp(components[0].value, 0, 255); - var green = Clamp(components[1].value, 0, 255); - var blue = Clamp(components[2].value, 0, 255); - this.colorObject.setTo(red, green, blue); - } else { - var h = Clamp(components[0].value, 0, 359) / 360; - var s = Clamp(components[1].value, 0, 100) / 100; - var v = Clamp(components[2].value, 0, 100) / 100; - this.colorObject.setFromRGB(HSVToRGB(h, s, v)); + key: "setReadOnly", + value: function setReadOnly(enable) { + if (enable === undefined) { + enable = true; } + this.readOnly = enable; return this; } }]); - return ColorComponents; - }(Sizer); + return ToggleSwitch; + }(ToggleSwitchShape); - var GetValue$6 = Phaser.Utils.Objects.GetValue; - var ColorPickerPanel = /*#__PURE__*/function (_Sizer) { - _inherits(ColorPickerPanel, _Sizer); - var _super = _createSuper(ColorPickerPanel); - function ColorPickerPanel(scene, config) { - var _this; - _classCallCheck(this, ColorPickerPanel); - if (config === undefined) { - config = {}; + var CreateToggleSwitch = function CreateToggleSwitch(scene, config) { + var gameObject = new ToggleSwitch(scene, config); + scene.add.existing(gameObject); + return gameObject; + }; + + var ToggleSwitchInputHandler = { + name: 'ToggleSwitchInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'toggleSwitch'; } - config.orientation = 1; - _this = _super.call(this, scene, config); - _this.type = 'rexColorInput.ColorPickerPanel'; + return false; + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.ToggleSwitchInput'; + var toggleSwitchConfig = style.toggleSwitch; + var toggleSwitch = CreateToggleSwitch(scene, toggleSwitchConfig); + var size = toggleSwitchConfig.size; + if (size !== undefined) { + toggleSwitch.setSize(size, size); + } + var fitRatio = size !== undefined ? 0 : 1; + gameObject.addSpace().add(toggleSwitch, { + proportion: 0, + expand: false, + fitRatio: fitRatio, + key: 'toggleSwitch' + }); + toggleSwitch.on('valuechange', function (value) { + gameObject.setValue(value); + }); + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var toggleSwitch = gameObject.getElement('toggleSwitch'); + toggleSwitch.setValue(value); + } + }; - // Add elements - var background = GetValue$6(config, 'background', undefined); - var colorPicker = new ColorPicker(scene, { - hPalette: config.hPalette || {}, - svPalette: config.svPalette || {}, - space: { - item: GetValue$6(config, 'space.hPalette', 8) - } + var BuildListConfig = function BuildListConfig(scene, config, creators) { + config = config ? DeepClone(config) : {}; + if (creators === undefined) { + creators = {}; + } + var labelConfig = config.label || config.button; + var listButtonConfig = config.button || config.label; + delete config.label; + delete config.button; + var labelCreator = creators.label || creators.button || creators; + var listButtonCreator = creators.button || creators.label || creators; + var listConfig = BuildLabelConfig(scene, labelConfig, labelCreator); + listConfig.list = config.list || {}; + listConfig.list.createButtonCallback = function (scene, option) { + var gameObject = CreateLabel(scene, listButtonConfig, listButtonCreator).resetDisplayContent({ + text: option.text }); - scene.add.existing(colorPicker); - var colorComponents; - if (config.colorComponents) { - colorComponents = new ColorComponents(scene, config.colorComponents); - scene.add.existing(colorComponents); + if (option.hasOwnProperty('value')) { + gameObject.value = option.value; } - if (background) { - _this.addBackground(background); - new TouchEventStop(background, { - stopAllLevels: false - }); + return gameObject; + }; + listConfig.list.onButtonOver = function (button, index, pointer, event) { + if (button.setHoverState) { + button.setHoverState(true); } - _this.add(colorPicker, { - proportion: 1, - expand: true - }); - if (colorComponents) { - _this.add(colorComponents, { - proportion: 0, - expand: true - }); + }; + listConfig.list.onButtonOut = function (button, index, pointer, event) { + if (button.setHoverState) { + button.setHoverState(false); } - _this.addChildrenMap('background', background); - _this.addChildrenMap('colorPicker', colorPicker); - _this.addChildrenMap('colorComponents', colorComponents); - colorPicker.on('valuechange', function (value) { - this.setValue(value); - }, _assertThisInitialized(_this)); - if (colorComponents) { - colorComponents.on('valuechange', function (value) { - this.setValue(value); - }, _assertThisInitialized(_this)); + }; + return listConfig; + }; + + var methods = { + setWrapEnable: function setWrapEnable(enable) { + if (enable === undefined) { + enable = true; } - _this.setValue(GetValue$6(config, 'value', 0xffffff)); - return _this; - } - _createClass(ColorPickerPanel, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; - } - this._value = value; - var colorPicker = this.childrenMap.colorPicker; - colorPicker.setValue(value); - var colorComponents = this.childrenMap.colorComponents; - if (colorComponents) { - colorComponents.setValue(value); - } - this.emit('valuechange', value); + this.listWrapEnable = enable; + return this; + }, + setCreateButtonCallback: function setCreateButtonCallback(callback) { + this.listCreateButtonCallback = callback; + return this; + }, + setCreateListBackgroundCallback: function setCreateListBackgroundCallback(callback) { + this.listCreateBackgroundCallback = callback; + return this; + }, + setButtonClickCallback: function setButtonClickCallback(callback) { + this.listOnButtonClick = callback; + return this; + }, + setButtonOverCallback: function setButtonOverCallback(callback) { + this.listOnButtonOver = callback; + return this; + }, + setButtonOutCallback: function setButtonOutCallback(callback) { + this.listOnButtonOut = callback; + return this; + }, + setListExpandDirection: function setListExpandDirection(direction) { + if (typeof direction === 'string') { + direction = ListExpandDirections[direction]; } - }, { - key: "setValue", - value: function setValue(value) { - this.value = value; - return this; + this.listExpandDirection = direction; + return this; + }, + setListEaseInDuration: function setListEaseInDuration(duration) { + if (duration === undefined) { + duration = 0; } - }]); - return ColorPickerPanel; - }(Sizer); + this.listEaseInDuration = duration; + return this; + }, + setListEaseOutDuration: function setListEaseOutDuration(duration) { + if (duration === undefined) { + duration = 0; + } + this.listEaseOutDuration = duration; + return this; + }, + setListTransitInCallback: function setListTransitInCallback(callback) { + this.listTransitInCallback = callback; + // callback = function(gameObject, duration) {} + return this; + }, + settListTransitOutCallback: function settListTransitOutCallback(callback) { + this.listTransitOutCallback = callback; + // callback = function(gameObject, duration) {} + return this; + }, + setListBounds: function setListBounds(bounds) { + this.listBounds = bounds; + return this; + }, + setListWidth: function setListWidth(width) { + this.listWidth = width; + return this; + }, + setListHeight: function setListHeight(height) { + this.listHeight = height; + return this; + }, + setListSize: function setListSize(width, height) { + this.setListWidth(width).setListHeight(height); + return this; + }, + setListAlignmentMode: function setListAlignmentMode(mode) { + this.listAlignMode = mode; + return this; + }, + setListAlignmentSide: function setListAlignmentSide(side) { + if (side === undefined) { + side = ''; + } + this.listAlignSide = side; + return this; + }, + setListSpace: function setListSpace(space) { + if (space === undefined) { + space = {}; + } + this.listSpace = space; + return this; + }, + setListDraggable: function setListDraggable(enable) { + if (enable === undefined) { + enable = true; + } + this.listDraggable = enable; + return this; + } + }; + var ListExpandDirections = { + down: 0, + up: 1 + }; - Phaser.Utils.Objects.GetValue; - var CreateColorPicker = function CreateColorPicker(scene) { + var CreateListPanel = function CreateListPanel() { var scene = this.scene; var background; - var createBackgroundCallback = this.colorPickerCreateBackgroundCallback; + var createBackgroundCallback = this.listCreateBackgroundCallback; if (createBackgroundCallback) { background = createBackgroundCallback.call(this, scene); scene.add.existing(background); } - var width = this.colorPickerWidth; - if (width === undefined) { - width = this.width; + var buttons = []; + var createButtonCallback = this.listCreateButtonCallback; + if (createButtonCallback) { + var options = this.options; + for (var i = 0, cnt = options.length; i < cnt; i++) { + var button = createButtonCallback.call(this, scene, options[i], i, options); + scene.add.existing(button); + buttons.push(button); + } } - var height = this.colorPickerHeight; - if (height === undefined) { - height = width; + var width = this.listWidth; + if (width === undefined) { + if (this.listAlignMode === 'text') { + width = this.getElement('text').width; + } else { + width = this.width; + } } - var colorComponentsConfig; - if (this.colorComponentsHeight > 0) { - colorComponentsConfig = { - height: this.colorComponentsHeight, - formatLabel: this.colorComponentsFormatLabelConfig, - inputText: this.colorComponentsInputTextConfig, - space: this.colorComponentsSpace - }; + var height = this.listHeight; + var listPanel; + if (!this.listWrapEnable) { + listPanel = new Buttons$1(scene, { + width: width, + height: height, + orientation: 'y', + background: background, + buttons: buttons, + space: this.listSpace, + draggable: this.listDraggable + }); } else { - colorComponentsConfig = false; + listPanel = new Buttons(scene, { + width: width, + height: height, + background: background, + buttons: buttons, + space: this.listSpace, + draggable: this.listDraggable + }); } - var colorPicker = new ColorPickerPanel(scene, { - width: width, - height: height, - background: background, - space: this.colorPickerSpace, - hPalette: { - position: this.colorPickerHPalettePosition - }, - colorComponents: colorComponentsConfig, - value: this.value - }); - scene.add.existing(colorPicker); - return colorPicker; + scene.add.existing(listPanel); + return listPanel; }; - var OpenColorPicker = function OpenColorPicker() { - if (this.colorPicker) { - return; + var OpenListPanel = function OpenListPanel() { + if (this.listPanel) { + return this; } + var listPanel = CreateListPanel.call(this); - // Layout it to get full height - var colorPicker = CreateColorPicker.call(this).layout(); - var dropDownBehavior = new DropDown(colorPicker, { + // Button over/out + listPanel.on('button.over', function (button, index, pointer, event) { + if (this.listOnButtonOver) { + this.listOnButtonOver.call(this, button, index, pointer, event); + } + this.emit('button.over', this, listPanel, button, index, pointer, event); + }, this).on('button.out', function (button, index, pointer, event) { + if (this.listOnButtonOut) { + this.listOnButtonOut.call(this, button, index, pointer, event); + } + this.emit('button.out', this, listPanel, button, index, pointer, event); + }, this); + var alignTargetX; + if (!this.listAlignMode || this.listAlignMode === 'label') { + alignTargetX = this; + } else { + alignTargetX = this.getElement(this.listAlignMode); + } + var dropDownBehavior = new DropDown(listPanel, { // Transition duration: { - "in": this.colorPickerEaseInDuration, - out: this.colorPickerEaseOutDuration + "in": this.listEaseInDuration, + out: this.listEaseOutDuration }, - transitIn: this.colorPickerTransitInCallback, - transitOut: this.colorPickerTransitOutCallback, - // Position - expandDirection: this.colorPickerExpandDirection, - alignTargetX: this, + transitIn: this.listTransitInCallback, + transitOut: this.listTransitOutCallback, + // Position + expandDirection: this.listExpandDirection, + alignTargetX: alignTargetX, alignTargetY: this, - bounds: this.colorPickerBounds, + alignSide: this.listAlignSide, + bounds: this.listBounds, // Close condition - touchOutsideClose: true + anyTouchClose: true }).on('open', function () { // After popping up // Can click - colorPicker.on('valuechange', function (value) { - this.setValue(value); + listPanel.on('button.click', function (button, index, pointer, event) { + if (this.listOnButtonClick) { + this.listOnButtonClick.call(this, button, index, pointer, event); + } + this.emit('button.click', this, listPanel, button, index, pointer, event); }, this); + this.emit('list.open', this, listPanel); }, this).on('close', function () { - this.colorPicker = undefined; + this.listPanel = undefined; this.dropDownBehavior = undefined; }, this); - this.colorPicker = colorPicker; + this.listPanel = listPanel; this.dropDownBehavior = dropDownBehavior; - this.pin(colorPicker); + this.pin(listPanel); return this; }; - var methods$1 = { - openColorPicker: OpenColorPicker + var CloseListPanel = function CloseListPanel() { + if (!this.dropDownBehavior) { + return this; + } + this.dropDownBehavior.requestClose(); + return this; }; - Object.assign(methods$1, methods$2); - var GetValue$5 = Phaser.Utils.Objects.GetValue; - var ColorInput$1 = /*#__PURE__*/function (_ColorInputBase) { - _inherits(ColorInput, _ColorInputBase); - var _super = _createSuper(ColorInput); - function ColorInput(scene, config) { + var ToggleListPanel = function ToggleListPanel() { + if (!this.listPanel) { + this.openListPanel(); + } else { + this.closeListPanel(); + } + return this; + }; + + var Methods = { + openListPanel: OpenListPanel, + closeListPanel: CloseListPanel, + toggleListPanel: ToggleListPanel + }; + Object.assign(Methods, methods); + + var GetValue$1 = Phaser.Utils.Objects.GetValue; + var DropDownList = /*#__PURE__*/function (_Label) { + _inherits(DropDownList, _Label); + var _super = _createSuper(DropDownList); + function DropDownList(scene, config) { var _this; - _classCallCheck(this, ColorInput); - if (config === undefined) { - config = {}; - } + _classCallCheck(this, DropDownList); _this = _super.call(this, scene, config); - _this.type = 'rexColorInput'; - if (!config.hasOwnProperty('colorPicker')) { - config.colorPicker = { - background: { - color: 0x0 - } - }; - } - var colorPickerConfig = config.colorPicker; - var hasColorPicker = colorPickerConfig !== false && colorPickerConfig !== null; - if (hasColorPicker) { - _this.setColorPickerSize(GetValue$5(colorPickerConfig, 'width', 160), GetValue$5(colorPickerConfig, 'height', 170)); - var createBackgroundCallback; - var background = GetValue$5(colorPickerConfig, 'background'); - if (background) { - createBackgroundCallback = function createBackgroundCallback(scene) { - return CreateBackground$1(scene, background); - }; - } else { - createBackgroundCallback = GetValue$5(colorPickerConfig, 'createBackgroundCallback'); + _this.type = 'rexDropDownList'; + _this.timer = undefined; + _this.setOptions(GetValue$1(config, 'options')); + var listConfig = GetValue$1(config, 'list'); + _this.setWrapEnable(GetValue$1(listConfig, 'wrap', false)); + _this.setCreateButtonCallback(GetValue$1(listConfig, 'createButtonCallback')); + _this.setCreateListBackgroundCallback(GetValue$1(listConfig, 'createBackgroundCallback')); + _this.setButtonClickCallback(GetValue$1(listConfig, 'onButtonClick')); + _this.setButtonOverCallback(GetValue$1(listConfig, 'onButtonOver')); + _this.setButtonOutCallback(GetValue$1(listConfig, 'onButtonOut')); + _this.setListExpandDirection(GetValue$1(listConfig, 'expandDirection')); + _this.setListEaseInDuration(GetValue$1(listConfig, 'easeIn', 500)); + _this.setListEaseOutDuration(GetValue$1(listConfig, 'easeOut', 100)); + _this.setListTransitInCallback(GetValue$1(listConfig, 'transitIn')); + _this.settListTransitOutCallback(GetValue$1(listConfig, 'transitOut')); + _this.setListSize(GetValue$1(listConfig, 'width'), GetValue$1(listConfig, 'height')); + _this.setListAlignmentMode(GetValue$1(listConfig, 'alignParent', 'text')); + _this.setListAlignmentSide(GetValue$1(listConfig, 'alignSide', '')); + _this.setListBounds(GetValue$1(listConfig, 'bounds')); + _this.setListSpace(GetValue$1(listConfig, 'space')); + _this.setListDraggable(GetValue$1(listConfig, 'draggable', false)); + _this.setValueChangeCallback(GetValue$1(config, 'setValueCallback'), GetValue$1(config, 'setValueCallbackScope')); + _this.setValue(GetValue$1(config, 'value')); + _this.onClick(_this.toggleListPanel, _assertThisInitialized(_this)); + return _this; + } + _createClass(DropDownList, [{ + key: "destroy", + value: function destroy(fromScene) { + // This Game Object has already been destroyed + if (!this.scene || this.ignoreDestroy) { + return; } - _this.setCreateColorPickerBackgroundCallback(createBackgroundCallback); - _this.setColorPickerHPalettePosition(GetValue$5(colorPickerConfig, 'hPalettePosition', 0)); - _this.setColorPickerExpandDirection(GetValue$5(colorPickerConfig, 'expandDirection')); - _this.setColorPickerEaseInDuration(GetValue$5(colorPickerConfig, 'easeIn', 200)); - _this.setColorPickerEaseOutDuration(GetValue$5(colorPickerConfig, 'easeOut', 200)); - _this.setColorPickerTransitInCallback(GetValue$5(colorPickerConfig, 'transitIn')); - _this.setColorPickerTransitOutCallback(GetValue$5(colorPickerConfig, 'transitOut')); - _this.setColorPickerBounds(GetValue$5(colorPickerConfig, 'bounds')); - var colorPickerSpaceConfig = GetValue$5(colorPickerConfig, 'space'); - if (colorPickerSpaceConfig === undefined) { - colorPickerSpaceConfig = { - left: 10, - right: 10, - top: 10, - bottom: 10, - item: 8 - }; + if (this.listPanel) { + this.listPanel.destroy(fromScene); + this.listPanel = undefined; } - _this.setColorPickerSpace(colorPickerSpaceConfig); + _get(_getPrototypeOf(DropDownList.prototype), "destroy", this).call(this, fromScene); } - var colorComponentsConfig = config.colorComponents; - var hasColorComponents = colorComponentsConfig !== false && colorComponentsConfig !== null; - if (hasColorPicker && hasColorComponents) { - _this.setColorComponentsHeight(GetValue$5(colorComponentsConfig, 'height', 30)); - _this.setColorComponentsFormatLabelConfig(GetValue$5(colorComponentsConfig, 'formatLabel')); - var colorComponentsInputTextConfig = GetValue$5(colorComponentsConfig, 'inputText'); - if (!colorComponentsInputTextConfig) { - colorComponentsInputTextConfig = GetValue$5(config, 'inputText'); - } - _this.setColorComponentsInputTextConfig(colorComponentsInputTextConfig); - var colorComponentsSpace = GetValue$5(colorComponentsConfig, 'space'); - if (colorComponentsSpace === undefined) { - colorComponentsSpace = { - item: 8 - }; + }, { + key: "setOptions", + value: function setOptions(options) { + if (options === undefined) { + options = []; } - _this.setColorComponentsSpace(colorComponentsSpace); + this.options = options; + return this; } - var swatch = _this.childrenMap.swatch; - if (swatch && hasColorPicker) { - _this.onClick(swatch, _this.openColorPicker, _assertThisInitialized(_this)); + }, { + key: "setValueChangeCallback", + value: function setValueChangeCallback(callback, scope) { + this.valueChangeCallback = callback; + this.valueChangeCallbackScope = scope; + return this; } - return _this; - } - return _createClass(ColorInput); - }(ColorInput$2); - Object.assign(ColorInput$1.prototype, methods$1); - - var CreateColorInput$1 = function CreateColorInput(scene, config, deepCloneConfig) { - if (deepCloneConfig === undefined) { - deepCloneConfig = true; - } - if (deepCloneConfig) { - config = config ? DeepClone(config) : {}; - } else if (!config) { - config = {}; - } - var inputText = new ColorInput$1(scene, config); - scene.add.existing(inputText); - return inputText; - }; - - var ColorInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(ColorInput, _InputFiledBase); - var _super = _createSuper(ColorInput); - function ColorInput(scene, config) { - var _this; - _classCallCheck(this, ColorInput); - if (config === undefined) { - config = {}; + }, { + key: "setValue", + value: function setValue(value) { + this.value = value; + return this; } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.ColorInput'; - var colorInputConfig = config.colorInput; - var colorInput = CreateColorInput$1(scene, colorInputConfig); - _this.add(colorInput, { - proportion: 1, - expand: true - }); - _this.addChildrenMap('colorInput', colorInput); - colorInput.on('valuechange', function (value) { - this.setValue(value); - }, _assertThisInitialized(_this)); - return _this; - } - _createClass(ColorInput, [{ + }, { key: "value", get: function get() { return this._value; @@ -36618,340 +36627,191 @@ if (this._value === value) { return; } - if (!this.validate(value)) { - value = this._value; // Back to previous value + var previousValue = this._value; + this._value = value; + var callback = this.valueChangeCallback, + scope = this.valueChangeCallbackScope; + if (callback) { + if (scope) { + callback.call(scope, this, value, previousValue); + } else { + callback(this, value, previousValue); + } } - - this.childrenMap.colorInput.setValue(value); - _set(_getPrototypeOf(ColorInput.prototype), "value", value, this, true); // Fire 'valuechange' event + this.emit('valuechange', this, value, previousValue); + } + }, { + key: "emitButtonClick", + value: function emitButtonClick(index) { + var option = this.options[index]; + if (!option) { + return this; + } + this.emit('button.click', this, undefined, option, index); + return this; } }]); - return ColorInput; - }(InputFiledBase); + return DropDownList; + }(Label); + Object.assign(DropDownList.prototype, Methods); - var CreateColorInput = function CreateColorInput(scene, config, style) { - var gameObject = new ColorInput(scene, style); + var CreateDropDownList = function CreateDropDownList(scene, config) { + config = BuildListConfig(scene, config); + var gameObject = new DropDownList(scene, config); scene.add.existing(gameObject); return gameObject; }; - var CallbacksMap = {}; - CallbacksMap[StringType] = CreateTextInput; - CallbacksMap[TextAreaType] = CreateTextAreaInput; - CallbacksMap[NumberType] = CreateNumberInput; - CallbacksMap[RangeType] = CreateRangeInput; - CallbacksMap[ListType] = CreateListInput; - CallbacksMap[ButtonsType] = CreateButtonsInput; - CallbacksMap[BooleanType] = CreateCheckboxInput; - CallbacksMap[ToggleSwitchType] = CreateToggleSwitchInput; - CallbacksMap[ColorType] = CreateColorInput; - var CreateInputField = function CreateInputField(scene, config, style) { - var viewType = config.view; - var callback; - if (IsFunction(viewType)) { - callback = viewType; - } else { - callback = CallbacksMap.hasOwnProperty(viewType) ? CallbacksMap[viewType] : CreateTextInput; + var GetOptionIndex = function GetOptionIndex(options, value) { + for (var i = 0, cnt = options.length; i < cnt; i++) { + var option = options[i]; + if (option.value === value) { + return i; + } } - var gameObject = callback(scene, config, style); - - // Extra settings - gameObject.setTextFormatCallback(config.format); - return gameObject; - }; - - var GetValue$4 = Phaser.Utils.Objects.GetValue; - var CreateInputRow = function CreateInputRow(scene, config, style) { - // Title - var titleStyle = GetValue$4(style, 'title') || {}; - var inputTitle = CreateTitleLabel(scene, config, titleStyle); - - // InputField - var inputField = CreateInputField(scene, config, style); - - // Background - var backgroundStyle = GetValue$4(style, 'background') || {}; - var background = CreateBackground$1(scene, backgroundStyle); - var inputRow = new InputRow(scene, _objectSpread2(_objectSpread2(_objectSpread2({}, config), style), {}, { - inputTitle: inputTitle, - inputField: inputField, - background: background - })); - scene.add.existing(inputRow); - inputRow.setTitle(config); - return inputRow; + return undefined; }; - - Phaser.Utils.Objects.GetValue; - var AddInput = function AddInput(object, key, config) { - if (arguments.length === 1) { - config = object; - object = config.bindingTarget; - key = config.bindingKey; - } else if (config === undefined) { - config = {}; - } - if (!config.title) { - config.title = key; - } - if (!config.view) { - config.view = GetInputType(object, key, config); - } - - // Create InputRow - var inputRowStyle = this.styles.inputRow || {}; - inputRowStyle.parentOrientation = this.styles.orientation; - var inputSizer = CreateInputRow(this.scene, config, inputRowStyle); - var inputField = inputSizer.childrenMap.inputField; - var proportion; - if (this.orientation === 1) { - // y - proportion = 0; - } else { - // x - proportion = this.itemWidth > 0 ? 0 : 1; - inputSizer.setMinWidth(this.itemWidth); - } - - // Add InputRow to Tweaker - this.add(inputSizer, { - proportion: proportion, - expand: true - }); - if (config.onValueChange) { - inputField.on('valuechange', config.onValueChange); - } - if (config.onValidate) { - inputField.setValidateCallback(config.onValidate); - } - - // Bind target - inputSizer.setAutoUpdateEnable(config.autoUpdate); - inputSizer.setBindingTarget(object, key); - if (config.monitor) { - inputSizer.startMonitorTarget(); - } - if (config.key) { - this.root.addChildrenMap(config.key, inputSizer); + var GetOptionText = function GetOptionText(options, value) { + var index = GetOptionIndex(options, value); + if (index == null) { + return undefined; } - return this; + return options[index].text; }; - var CreateRoundRectangle = function CreateRoundRectangle(scene, config) { - var gameObject = new RoundRectangle$1(scene, config); - scene.add.existing(gameObject); - return gameObject; + var SetOptions$1 = function SetOptions(gameObject, options) { + var list = gameObject.getElement('list'); + list.setOptions(options); }; - - var GetValue$3 = Phaser.Utils.Objects.GetValue; - var CreateButtons = function CreateButtons(scene, config, style) { - // Title - var titleStyle = GetValue$3(style, 'title') || {}; - var title = CreateTitleLabel(scene, config, titleStyle); - - // Buttons - var buttonsConfig = config.buttons; - var buttonStyle = GetValue$3(style, 'button') || {}; - var buttons = []; - for (var i = 0, cnt = buttonsConfig.length; i < cnt; i++) { - var button = CreateLabel(scene, buttonStyle); - buttons.push(button); - var buttonConfig = buttonsConfig[i]; - button.resetDisplayContent({ - text: buttonConfig.label + var ListInputHandler = { + name: 'ListInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'list'; + } + return config.hasOwnProperty('options'); + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.ListInput'; + var list = CreateDropDownList(scene, style.list); + gameObject.add(list, { + proportion: 1, + expand: true, + key: 'list' + }); + list.on('button.click', function (dropDownList, listPanel, button, index, pointer, event) { + gameObject.setValue(button.value); + }); + }, + // Callback inside `setup()` + setup: function setup(gameObject, config, setDefaults) { + if (setDefaults || config.hasOwnProperty('options')) { + SetOptions$1(gameObject, config.options); + } + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var list = gameObject.getElement('list'); + var text = GetOptionText(list.options, value); + list.resetDisplayContent({ + text: text }); - button.callback = buttonConfig.callback; - } - var buttonsSizer = CreateButtons$1(scene, { - buttons: buttons, - expand: buttons.length === 1 - }); - - // Background - var backgroundStyle = GetValue$3(style, 'background') || {}; - var background = CreateRoundRectangle(scene, backgroundStyle); - - // InputRow - var inputRow = new InputRow(scene, _objectSpread2(_objectSpread2({}, style), {}, { - inputTitle: title, - inputField: buttonsSizer, - background: background - })); - scene.add.existing(inputRow); - inputRow.setTitle(config); - buttonsSizer.on('button.click', function (button) { - button.callback(inputRow.bindingTarget); - }); - return inputRow; - }; - - var GetValue$2 = Phaser.Utils.Objects.GetValue; - var AddButtons = function AddButtons(config) { - var scene = this.scene; - if (config === undefined) { - config = {}; - } - if (config.hasOwnProperty('label')) { - config.buttons = [{ - label: config.label, - callback: config.callback - }]; - delete config.label; - delete config.callback; - } - var target = config.bindingTarget; - delete config.bindingTarget; - - // Create buttons - var buttonsStyle = GetValue$2(this.styles, 'inputRow') || {}; - var buttons = CreateButtons(scene, config, buttonsStyle); - - // Add buttons - this.add(buttons, { - expand: true - }); - - // Set binding target - if (target) { - buttons.setBindingTarget(target); - } - if (config.key) { - this.root.addChildrenMap(config.key, buttons); } - return this; }; - var GetValue$1 = Phaser.Utils.Objects.GetValue; - var AddSeparator = function AddSeparator(config) { - var scene = this.scene; - - // Create separator - var separatorStyle = GetValue$1(this.styles, 'separator'); - var separator = CreateBackground(scene, config, separatorStyle); - - // Add separator - this.add(separator, { - expand: true - }); - return this; + var CreateButtons = function CreateButtons(scene, config) { + var gameObject = new Buttons$1(scene, config); + scene.add.existing(gameObject); + return gameObject; }; - var SetBindingTarget = function SetBindingTarget(target) { - var children = this.sizerChildren; - for (var i = 0, cnt = children.length; i < cnt; i++) { - var child = children[i]; - if (!child.setBindingTarget) { + var SetButtonsActiveStateByIndex = function SetButtonsActiveStateByIndex(buttons, index) { + for (var i = 0, cnt = buttons.length; i < cnt; i++) { + var button = buttons[i]; + if (!button) { continue; } - child.setBindingTarget(target); + button.setActiveState(i === index); } - return this; }; - var GetMaxInputRowTitleWidth = function GetMaxInputRowTitleWidth() { - var maxTitleWidth = 0; - var children = this.sizerChildren; - for (var i = 0, cnt = children.length; i < cnt; i++) { - var child = children[i]; - if (child.rexSizer.hidden) { - continue; - } - if (child.getMinTitleWidth) { - // InputRow - maxTitleWidth = Math.max(maxTitleWidth, child.getMinTitleWidth()); - } else if (child.getMaxInputRowTitleWidth) { - // Folder, TabPages - maxTitleWidth = Math.max(maxTitleWidth, child.getMaxInputRowTitleWidth()); - } + var GetValue = Phaser.Utils.Objects.GetValue; + var SetOptions = function SetOptions(gameObject, options) { + var list = gameObject.getElement('list'); + list.options = options; + var scene = gameObject.scene; + var buttonConfig = list.buttonConfig; + list.clearButtons(true); + for (var i = 0, cnt = options.length; i < cnt; i++) { + var option = options[i]; + var button = CreateLabel(scene, buttonConfig).setActiveState(false).resetDisplayContent({ + text: option.text + }); + list.addButton(button); } - return maxTitleWidth + this.getInnerPadding('left'); }; - - var SetInputRowTitleWidth = function SetInputRowTitleWidth(width) { - width -= this.getInnerPadding('left'); - var children = this.sizerChildren; - for (var i = 0, cnt = children.length; i < cnt; i++) { - var child = children[i]; - if (child.rexSizer.hidden) { - continue; - } - if (child.setMinTitleWidth) { - // InputRow - child.setMinTitleWidth(width); - } else if (child.setInputRowTitleWidth) { - // Folder, TabPages - child.setInputRowTitleWidth(width); + var ButtonsInputHandler = { + name: 'ButtonsInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'buttons'; } - } - return this; - }; - - var methods = { - addFolder: AddFolder, - addTab: AddTab, - addInput: AddInput, - addButton: AddButtons, - addButtons: AddButtons, - addSeparator: AddSeparator, - setBindingTarget: SetBindingTarget, - getMaxInputRowTitleWidth: GetMaxInputRowTitleWidth, - setInputRowTitleWidth: SetInputRowTitleWidth - }; + return false; + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.ButtonsInput'; - var GetValue = Phaser.Utils.Objects.GetValue; - var TweakerShell = /*#__PURE__*/function (_Sizer) { - _inherits(TweakerShell, _Sizer); - var _super = _createSuper(TweakerShell); - function TweakerShell(scene, config) { - var _this; - _classCallCheck(this, TweakerShell); - if (config === undefined) { - config = {}; - } - if (config.orientation === undefined) { - config.orientation = 1; + // TODO : DeepClone? + var buttonConfig = style.button ? DeepClone(style.button) : {}; + var buttonExpand = GetValue(buttonConfig, 'expand', true); + if (buttonExpand) { + buttonConfig.align = 'center'; } - - // Create sizer - _this = _super.call(this, scene, config); - _this.type = 'rexTweakerShell'; - _this.root = config.root || _assertThisInitialized(_this); - _this.styles = GetValue(config, 'styles') || {}; - _this.styles.orientation = _this.orientation; - _this.itemWidth = GetValue(_this.styles, 'itemWidth', 0); - if (_this.root === _assertThisInitialized(_this) && _this.orientation === 1) { - var alignTitle = GetValue(config, 'inputRow.alignTitle'); - if (alignTitle === undefined) { - var titleProportion = GetValue(_this.styles, 'inputRow.proportion.title'); - alignTitle = !titleProportion; - } else { - if (alignTitle) { - // Override title proportion to 0 - SetValue(_this.styles, 'inputRow.proportion.title', 0); - } + delete buttonConfig.expand; + var list = CreateButtons(scene, { + expand: buttonExpand + }); + list.buttonConfig = buttonConfig; + gameObject.add(list, { + proportion: 1, + expand: true, + key: 'list' + }); + list.on('button.click', function (button, index, pointer, event) { + var option = list.options[index]; + if (!option) { + return; // ?? } - _this.alignInputRowTitle = alignTitle; - } else { - _this.alignInputRowTitle = false; + + gameObject._selectedIndex = index; + gameObject.setValue(option.value); + gameObject._selectedIndex = undefined; + }); + }, + // Callback inside `setup()` + setup: function setup(gameObject, config, setDefaults) { + if (setDefaults || config.hasOwnProperty('options')) { + SetOptions(gameObject, config.options); } - var background = CreateBackground(scene, undefined, config.background); - if (background) { - _this.addBackground(background); + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var list = gameObject.getElement('list'); + var index = gameObject._selectedIndex; // See list's 'button.click' event + if (index === undefined) { + index = GetOptionIndex(list.options, value); } - return _this; + SetButtonsActiveStateByIndex(list.childrenMap.buttons, index); } - _createClass(TweakerShell, [{ - key: "preLayout", - value: function preLayout() { - _get(_getPrototypeOf(TweakerShell.prototype), "preLayout", this).call(this); - if (this.alignInputRowTitle) { - this.setInputRowTitleWidth(this.getMaxInputRowTitleWidth()); - } - } - }]); - return TweakerShell; - }(Sizer); - Object.assign(TweakerShell.prototype, methods); + }; + + var RegisterDefaultInputHandlers = function RegisterDefaultInputHandlers() { + this.registerInputHandler(TextInputHandler).registerInputHandler(TextAreaInputHandler).registerInputHandler(NumberInputHandler).registerInputHandler(RangeInputHandler).registerInputHandler(ColorInputHandler).registerInputHandler(CheckboxInputHandler).registerInputHandler(ToggleSwitchInputHandler).registerInputHandler(ListInputHandler).registerInputHandler(ButtonsInputHandler); + }; var Tweaker = /*#__PURE__*/function (_TweakerShell) { _inherits(Tweaker, _TweakerShell); @@ -36972,9 +36832,22 @@ // Create sizer _this = _super.call(this, scene, config); _this.type = 'rexTweaker'; + _this.inputHandlers = []; + RegisterDefaultInputHandlers.call(_assertThisInitialized(_this)); return _this; } - return _createClass(Tweaker); + _createClass(Tweaker, [{ + key: "destroy", + value: function destroy(fromScene) { + // This Game Object has already been destroyed + if (!this.scene || this.ignoreDestroy) { + return; + } + _get(_getPrototypeOf(Tweaker.prototype), "destroy", this).call(this, fromScene); + this.inputHandlers = undefined; + } + }]); + return Tweaker; }(TweakerShell); return Tweaker; diff --git a/dist/rextweaker.min.js b/dist/rextweaker.min.js index 6466c1319b..37e4813d52 100644 --- a/dist/rextweaker.min.js +++ b/dist/rextweaker.min.js @@ -1,7 +1,7 @@ -!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).rextweaker=e();}(undefined,(function(){function t(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n);}return i}function e(e){for(var i=1;it.length)&&(e=t.length);for(var i=0,n=new Array(e);i=0;n--)(e=this.children[n]).parentContainer||e.displayList||e.destroy(t);this.clear(!t),v(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 w(this.children,t,0,(function(t){t.once("destroy",e.onChildDestroy,e);}),this),this}},{key:"remove",value:function(t,e){var i=this;return S(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,y(n.children));}},st=Phaser.Utils.Array,ot={getChildren:function(t){if(t)for(var e=0,i=this.children.length;e=0;e--)this.remove(this.backgroundChildren[e],t);return this}},He=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},Ne=/(\S+)\[(\d+)\]/i,Ue=Phaser.Utils.Objects.GetValue,Je=function(t,e){return void 0===e?t:t[e]},Ke=function(t,e,n){void 0===t&&(t={}),void 0===e&&(e=0);var r=i(e);return "string"===r?t[e]=n:"number"===r?(t.left=e,t.right=e,t.top=e,t.bottom=e):(t.left=Ue(e,"left",0),t.right=Ue(e,"right",0),t.top=Ue(e,"top",0),t.bottom=Ue(e,"bottom",0)),t},qe={getInnerPadding:function(t){return Je(this.space,t)},setInnerPadding:function(t,e){return Ke(this.space,t,e),this},getOuterPadding:function(t){return Je(this.getSizerConfig(this).padding,t)},setOuterPadding:function(t,e){return Ke(this.getSizerConfig(this).padding,t,e),this},getChildOuterPadding:function(t,e){return "string"==typeof t&&(t=this.getElement(t)),Je(this.getSizerConfig(t).padding,e)},setChildOuterPadding:function(t,e,i){return "string"==typeof t&&(t=this.getElement(t)),Ke(this.getSizerConfig(t).padding,e,i),this}},Ze=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},$e=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},Qe={getShownChildren:function(t){void 0===t&&(t=[]);for(var e,i=this.children,n=0,r=i.length;n0;){var i=e.shift();i.rexSizer&&i.rexSizer.hidden||(i!==this&&t.push(i),i.isRexContainerLite&&e.push.apply(e,y(i.children)));}return t}},ti=function(){this._childrenWidth=void 0,this._childrenHeight=void 0;for(var t,e=this.getChildrenSizers(),i=0,n=e.length;i0?-this.delay:0,this.state=this.nowTime>=0?wi:Ci,this.repeatCounter=0,this}},{key:"stop",value:function(){return this.state=xi,this}},{key:"update",value:function(t,e){this.state!==xi&&this.state!==Pi&&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=Si)):(this.nowTime=this.duration,this.state=Pi):this.nowTime>=0&&(this.state=wi));}},{key:"t",get:function(){var t;switch(this.state){case xi:case Ci:case Si:t=0;break;case wi:t=this.nowTime/this.duration;break;case Pi:t=1;}return mi(t,0,1)},set:function(t){(t=mi(t,-1,1))<0?(this.state=Ci,this.nowTime=-this.delay*t):(this.state=wi,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===xi}},{key:"isDelay",get:function(){return this.state===Ci}},{key:"isCountDown",get:function(){return this.state===wi}},{key:"isRunning",get:function(){return this.state===Ci||this.state===wi}},{key:"isDone",get:function(){return this.state===Pi}},{key:"isOddIteration",get:function(){return 1==(1&this.repeatCounter)}},{key:"isEvenIteration",get:function(){return 0==(1&this.repeatCounter)}}]),t}(),xi=0,Ci=1,wi=2,Si=3,Pi=-1,Oi=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).timer=new bi,s}return s(i,[{key:"shutdown",value:function(t){this.isShutdown||(v(h(i.prototype),"shutdown",this).call(this,t),this.timer.destroy(),this.timer=void 0);}},{key:"start",value:function(){return this.timer.start(),v(h(i.prototype),"start",this).call(this),this}},{key:"stop",value:function(){return this.timer.stop(),v(h(i.prototype),"stop",this).call(this),this}},{key:"complete",value:function(){return this.timer.stop(),v(h(i.prototype),"complete",this).call(this),this}}]),i}(gi),Ti=Phaser.Utils.Objects.GetValue,_i=Phaser.Utils.Objects.GetAdvancedValue,Ei=Phaser.Tweens.Builders.GetEaseFunction,Mi=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return s(i,[{key:"resetFromJSON",value:function(t){return this.timer.resetFromJSON(Ti(t,"timer")),this.setEnable(Ti(t,"enable",!0)),this.setTarget(Ti(t,"target",this.parent)),this.setDelay(_i(t,"delay",0)),this.setDuration(_i(t,"duration",1e3)),this.setEase(Ti(t,"ease","Linear")),this.setRepeat(Ti(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=Ei(t),this}},{key:"start",value:function(){return this.timer.isRunning||v(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),v(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}(Oi),Ri=Phaser.Utils.Objects.GetValue,Li=Phaser.Utils.Objects.GetAdvancedValue,Di=Phaser.Math.Linear,Ai=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).scaleStart={},s.scaleEnd={},s.resetFromJSON(r),s.boot(),s}return s(i,[{key:"resetFromJSON",value:function(t){return v(h(i.prototype),"resetFromJSON",this).call(this,t),this.setMode(Ri(t,"mode",0)),this.setScaleRange(Li(t,"start",void 0),Li(t,"end",0)),this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=zi[t]),this.mode=t,this}},{key:"setScaleRange",value:function(t,e){return "number"==typeof t?(this.startX=t,this.startY=t):(this.startX=Li(t,"x",this.parent.scaleX),this.startY=Li(t,"y",this.parent.scaleY)),"number"==typeof e?(this.endX=e,this.endY=e):(this.endX=Li(e,"x",void 0),this.endY=Li(e,"y",void 0)),this.hasScaleX=void 0!==this.startX&&void 0!==this.endX,this.hasScaleY=void 0!==this.startY&&void 0!==this.endY,this}},{key:"start",value:function(){if(this.timer.isRunning)return this;var t=this.parent;this.hasScaleX&&(t.scaleX=this.startX),this.hasScaleY&&(t.scaleY=this.startY);var e=this.repeat;return 2===this.mode&&-1!==e&&(e=2*(e+1)-1),this.timer.setDelay(this.delay).setDuration(this.duration).setRepeat(e),v(h(i.prototype),"start",this).call(this),this}},{key:"updateGameObject",value:function(t,e){var i=e.t;e.isOddIteration&&(i=1-i),i=this.easeFn(i),this.hasScaleX&&(t.scaleX=Di(this.startX,this.endX,i)),this.hasScaleY&&(t.scaleY=Di(this.startY,this.endY,i));}},{key:"complete",value:function(){return v(h(i.prototype),"complete",this).call(this),1===this.mode&&this.parent.destroy(),this}}]),i}(Mi),zi={stop:0,destroy:1,yoyo:2},Bi=function(t,e,i,n,r){var s,o;switch(void 0===n&&(n="Cubic"),i){case 0:case"x":s={x:0},o={x:t.scaleX};break;case 1:case"y":s={y:0},o={y:t.scaleY};break;default:s=0,o=t.scale;}var a={mode:0,start:s,end:o,duration:e,ease:n};return void 0===r?r=new Ai(t,a):r.resetFromJSON(a),r.restart(),r},ji=function(t,e,i,n,r,s){void 0===n&&(n="Linear"),r instanceof Ai&&(s=r,r=void 0),void 0===r&&(r=!0);var o={};switch(o.mode=r?1:0,i){case 0:case"x":o.end={x:0};break;case 1:case"y":o.end={y:0};break;default:o.end=0;}return o.duration=e,o.ease=n,void 0===s?s=new Ai(t,o):s.resetFromJSON(o),s.restart(),s},Wi=function(t,e){return new Promise((function(i,n){t.once(e,(function(){i();}));}))},Ii=function(t){return Wi(t,"complete")},Fi=Phaser.Utils.Objects.IsPlainObject,Yi=function(t,e){e.completeEventName=void 0,e.on("complete",(function(){e.completeEventName&&(t.emit(e.completeEventName,t),e.completeEventName=void 0);})),e.on("update",(function(){var e=je.getParentSizer(t);e&&e.resetChildPositionState(t);}));},Xi={popUp:function(t,e,i){if(Fi(t)){var n=t;t=n.duration,e=n.orientation,i=n.ease;}var r=void 0===this._scaleBehavior;return this._scaleBehavior=Bi(this,t,e,i,this._scaleBehavior),r&&Yi(this,this._scaleBehavior),this._scaleBehavior.completeEventName="popup.complete",this},popUpPromise:function(t,e,i){return this.popUp(t,e,i),Ii(this._scaleBehavior)},scaleDownDestroy:function(t,e,i,n){if(Fi(t)){var r=t;t=r.duration,e=r.orientation,i=r.ease,n=r.destroy;}var s=void 0===this._scaleBehavior;return this._scaleBehavior=ji(this,t,e,i,n,this._scaleBehavior),s&&Yi(this,this._scaleBehavior),this._scaleBehavior.completeEventName="scaledown.complete",this},scaleDownDestroyPromise:function(t,e,i,n){return this.scaleDownDestroy(t,e,i,n),Ii(this._scaleBehavior)},scaleDown:function(t,e,i){return this.scaleDownDestroy(t,e,i,!1),this},scaleDownPromise:function(t,e,i){return this.scaleDown(t,e,i),Ii(this._scaleBehavior)},scaleYoyo:function(t,e,i,n,r){if(Fi(t)){var s=t;t=s.duration,e=s.peakValue,i=s.repeat,n=s.orientation,r=s.ease;}var o=void 0===this._scaleBehavior;return this._scaleBehavior=function(t,e,i,n,r,s,o){var a,h;switch(void 0===i&&(i=1.2),void 0===n&&(n=0),void 0===s&&(s="Cubic"),r){case 0:case"x":a={x:t.scaleX},h={x:i};break;case 1:case"y":a={y:t.scaleX},h={y:i};break;default:a=t.scaleX,h=i;}var l={mode:2,start:a,end:h,duration:e/2,ease:s,repeat:n};return void 0===o?o=new Ai(t,l):o.resetFromJSON(l),o.restart(),o}(this,t,e,i,n,r,this._scaleBehavior),o&&Yi(this,this._scaleBehavior),this._scaleBehavior.completeEventName="scaleyoyo.complete",this},scaleYoyoPromise:function(t,e,i,n,r){return this.scaleYoyo(t,e,i,n,r),Ii(this._scaleBehavior)}},Vi=Phaser.Utils.Objects.GetValue,Gi=Phaser.Utils.Objects.GetAdvancedValue,Hi=Phaser.Math.Linear,Ni=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).resetFromJSON(r),s.boot(),s}return s(i,[{key:"resetFromJSON",value:function(t){return v(h(i.prototype),"resetFromJSON",this).call(this,t),this.setMode(Vi(t,"mode",0)),this.setAlphaRange(Gi(t,"start",this.parent.alpha),Gi(t,"end",0)),this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=Ui[t]),this.mode=t,this}},{key:"setAlphaRange",value:function(t,e){return this.alphaStart=t,this.alphaEnd=e,this}},{key:"start",value:function(){return this.timer.isRunning||(this.parent.setAlpha(this.alphaStart),this.timer.setDelay(this.delay).setDuration(this.duration).setRepeat(2===this.mode?-1:0),v(h(i.prototype),"start",this).call(this)),this}},{key:"updateGameObject",value:function(t,e){var i=e.t;e.isOddIteration&&(i=1-i),t.alpha=Hi(this.alphaStart,this.alphaEnd,i);}},{key:"complete",value:function(){return v(h(i.prototype),"complete",this).call(this),1===this.mode&&this.parent.destroy(),this}}]),i}(Mi),Ui={stop:0,destroy:1,yoyo:2},Ji=Phaser.Utils.Objects.IsPlainObject,Ki=function(t,e,i,n){var r,s;Ji(i)?(r=i.start,s=i.end):s=i,void 0===r&&(r=0),void 0===s&&(s=1);var o={mode:0,start:r,end:s,duration:e};return void 0===n?n=new Ni(t,o):n.resetFromJSON(o),n.restart(),n},qi=function(t,e,i,n){i instanceof Ni&&(n=i,i=void 0),void 0===i&&(i=!0);var r={mode:i?1:0,end:0,duration:e};return void 0===n?n=new Ni(t,r):n.resetFromJSON(r),n.restart(),n},Zi=Phaser.Utils.Objects.IsPlainObject,$i=function(t,e){e.completeEventName=void 0,e.on("complete",(function(){e.completeEventName&&(t.emit(e.completeEventName,t),e.completeEventName=void 0);})),e.on("update",(function(){var e=je.getParentSizer(t);e&&e.resetChildAlphaState(t);}));},Qi={fadeIn:function(t,e){if(Zi(t)){var i=t;t=i.duration,e=i.alpha;}var n=void 0===this._fade;return this._fade=Ki(this,t,e,this._fade),n&&$i(this,this._fade),this._fade.completeEventName="fadein.complete",this},fadeInPromise:function(t,e){return this.fadeIn(t,e),Ii(this._fade)},fadeOutDestroy:function(t,e){if(Zi(t)){var i=t;t=i.duration,e=i.destroy;}var n=void 0===this._fade;return this._fade=qi(this,t,e,this._fade),n&&$i(this,this._fade),this._fade.completeEventName="fadeout.complete",this},fadeOutDestroyPromise:function(t,e){return this.fadeOutDestroy(t,e),Ii(this._fade)},fadeOut:function(t){return this.fadeOutDestroy(t,!1),this},fadeOutPromise:function(t){return this.fadeOut(t),Ii(this._fade)}},tn=Phaser.Utils.Objects.GetValue,en=Phaser.Utils.Objects.GetAdvancedValue,nn=Phaser.Math.Linear,rn=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).resetFromJSON(r),s.boot(),s}return s(i,[{key:"resetFromJSON",value:function(t){if(v(h(i.prototype),"resetFromJSON",this).call(this,t),this.setMode(tn(t,"mode",0)),t&&(t.hasOwnProperty("x")||t.hasOwnProperty("y"))){var e=en(t,"x",void 0),n=en(t,"y",void 0);this.setTargetPosition(e,n);}else this.setTargetPosition(t);return this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=sn[t]),this.mode=t,this}},{key:"setTargetPosition",value:function(t,e){if("number"==typeof t||"number"==typeof e)this.startX=this.parent.x,this.startY=this.parent.y,this.endX=t,this.endY=e;else {var i=t;this.startX=en(i,"startX",void 0),this.startY=en(i,"startY",void 0),this.endX=en(i,"endX",void 0),this.endY=en(i,"endY",void 0);}return this.hasMoveX=void 0!==this.startX&&void 0!==this.endX,this.hasMoveY=void 0!==this.startY&&void 0!==this.endY,this}},{key:"start",value:function(){if(this.timer.isRunning)return this;var t=this.parent;return this.hasMoveX&&(t.x=this.startX),this.hasMoveY&&(t.y=this.startY),this.timer.setDelay(this.delay).setDuration(this.duration).setRepeat(2===this.mode?-1:0),v(h(i.prototype),"start",this).call(this),this}},{key:"updateGameObject",value:function(t,e){var i=e.t;e.isOddIteration&&(i=1-i),i=this.easeFn(i),this.hasMoveX&&(t.x=nn(this.startX,this.endX,i)),this.hasMoveY&&(t.y=nn(this.startY,this.endY,i));}},{key:"complete",value:function(){return v(h(i.prototype),"complete",this).call(this),1===this.mode&&this.parent.destroy(),this}}]),i}(Mi),sn={stop:0,destroy:1,yoyo:2},on=function(t,e){if("number"==typeof t)return t;var i=t[0],n=parseFloat(t.substr(2));switch(i){case"+":return e+n;case"-":return e-n;case"*":return e*n;case"/":return e/n}},an=Phaser.Utils.Objects.IsPlainObject,hn=Phaser.Math.Distance.Between,ln=function(t,e){e.completeEventName=void 0,e.on("complete",(function(){e.completeEventName&&(t.emit(e.completeEventName,t),e.completeEventName=void 0);})),e.on("update",(function(){var e=je.getParentSizer(t);e&&e.resetChildPositionState(t);}));},un={moveFrom:function(t,e,i,n,r){if(an(t)){var s=t;e=s.x,i=s.y,t=s.hasOwnProperty("speed")?1e3*hn(e,i,this.x,this.y)/s.speed:s.duration,n=s.ease;}var o=void 0===this._easeMove;return this._easeMove=function(t,e,i,n,r,s,o){s instanceof rn&&(o=s,s=void 0),void 0===s&&(s=!1);var a={};return a.mode=s?1:0,void 0!==i&&(a.startX=on(i,t.x),a.endX=t.x),void 0!==n&&(a.startY=on(n,t.y),a.endY=t.y),a.duration=e,a.ease=void 0===r?"Linear":r,void 0===o?o=new rn(t,a):o.resetFromJSON(a),o.restart(),o}(this,t,e,i,n,r,this._easeMove),o&&ln(this,this._easeMove),this._easeMove.completeEventName="movefrom.complete",this},moveFromPromise:function(t,e,i,n,r){return this.moveFrom(t,e,i,n,r),Ii(this._easeMove)},moveFromDestroy:function(t,e,i,n){return this.moveFrom(t,e,i,n,!0),this},moveFromDestroyPromise:function(t,e,i,n){return this.moveFromDestroy(t,e,i,n),Ii(this._easeMove)},moveTo:function(t,e,i,n,r){if(an(t)){var s=t;e=s.x,i=s.y,t=s.hasOwnProperty("speed")?1e3*hn(e,i,this.x,this.y)/s.speed:s.duration,n=s.ease;}var o=void 0===this._easeMove;return this._easeMove=function(t,e,i,n,r,s,o){s instanceof rn&&(o=s,s=void 0),void 0===s&&(s=!1);var a={};return a.mode=s?1:0,void 0!==i&&(a.startX=t.x,a.endX=on(i,t.x)),void 0!==n&&(a.startY=t.y,a.endY=on(n,t.y)),a.duration=e,a.ease=void 0===r?"Linear":r,void 0===o?o=new rn(t,a):o.resetFromJSON(a),o.restart(),o}(this,t,e,i,n,r,this._easeMove),o&&ln(this,this._easeMove),this._easeMove.completeEventName="moveto.complete",this},moveToPromise:function(t,e,i,n,r){return this.moveTo(t,e,i,n,r),Ii(this._easeMove)},moveToDestroy:function(t,e,i,n){return this.moveTo(t,e,i,n,!0),this},moveToDestroyPromise:function(t,e,i,n){return this.moveToDestroy(t,e,i,n,!0),Ii(this._easeMove)},moveStop:function(t){return this._easeMove?(this._easeMove.stop(t),this):this}},cn=Phaser.Utils.Objects.GetValue,dn=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).timer=new bi,s.resetFromJSON(r),s.boot(),s}return s(i,[{key:"resetFromJSON",value:function(t){return this.timer.resetFromJSON(cn(t,"timer")),this.setEnable(cn(t,"enable",!0)),this.setMode(cn(t,"mode",1)),this.isRunning=cn(t,"isRunning",!1),this.setMagnitudeMode(cn(t,"magnitudeMode",1)),this.setAxisMode(cn(t,"axis",0)),this.setDuration(cn(t,"duration",500)),this.setMagnitude(cn(t,"magnitude",10)),this.ox=cn(t,"ox",void 0),this.oy=cn(t,"oy",void 0),this}},{key:"toJSON",value:function(){return {timer:this.timer.toJSON(),enable:this.enable,mode:this.mode,isRunning:this.isRunning,magnitudeMode:magnitudeMode,duration:this.duration,magnitude:this.magnitude,ox:this.ox,oy:this.oy}}},{key:"shutdown",value:function(t){this.isShutdown||(v(h(i.prototype),"shutdown",this).call(this,t),this.timer.destroy(),this.timer=void 0);}},{key:"startTicking",value:function(){v(h(i.prototype),"startTicking",this).call(this),0===this.mode?(this.scene.game.events.on("poststep",this.update,this),this.scene.game.events.on("prestep",this.backToOrigin,this)):this.scene.sys.events.on("preupdate",this.update,this);}},{key:"stopTicking",value:function(){v(h(i.prototype),"stopTicking",this).call(this),this.scene&&(0===this.mode?(this.scene.game.events.off("poststep",this.update,this),this.scene.game.events.off("prestep",this.backToOrigin,this)):this.scene.sys.events.off("preupdate",this.update,this));}},{key:"setEnable",value:function(t){return null==t&&(t=!0),this.enable=t,this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=fn[t]),this.mode=t,this}},{key:"setMagnitudeMode",value:function(t){return "string"==typeof t&&(t=pn[t]),this.magnitudeMode=t,this}},{key:"setAxisMode",value:function(t){return "string"==typeof t&&(t=vn[t]),this.axisMode=t,this}},{key:"setDuration",value:function(t){return this.duration=t,this}},{key:"setMagnitude",value:function(t){return this.magnitude=t,this}},{key:"start",value:function(t,e){if("number"!=typeof t){var n=t;e=cn(n,"magnitude",void 0),t=cn(n,"duration",void 0);}return void 0!==e&&this.setMagnitude(e),void 0!==t&&this.setDuration(t),this.timer.setDuration(this.duration).start(),v(h(i.prototype),"start",this).call(this),this}},{key:"shake",value:function(t,e){return this.start(t,e),this}},{key:"update",value:function(t,e){if(!this.isRunning||!this.enable)return this;var i=this.parent;if(!i.active)return this;if(this.timer.update(t,e),this.timer.isDone)this.backToOrigin(),this.complete();else {void 0===this.ox&&(this.ox=i.x,this.oy=i.y);var n=this.magnitude;1===this.magnitudeMode&&(n*=1-this.timer.t);var r=Math.random()*Math.PI*2,s=this.ox+Math.cos(r)*n,o=this.oy+Math.sin(r)*n;switch(this.axisMode){case 1:i.x=s;break;case 2:i.y=o;break;default:i.x=s,i.y=o;}}return this}},{key:"backToOrigin",value:function(){if(!this.isRunning||!this.enable)return this;if(void 0===this.ox)return this;var t=this.parent;switch(this.axisMode){case 1:t.x=this.ox;break;case 2:t.y=this.oy;break;default:t.x=this.ox,t.y=this.oy;}return this.ox=void 0,this.oy=void 0,this}}]),i}(fi),fn={effect:0,behavior:1},vn={both:0,"h&v":0,"x&y":0,horizontal:1,h:1,x:1,vertical:2,v:2,y:2},pn={constant:0,decay:1},gn=Phaser.Utils.Objects.IsPlainObject,yn={shake:function(t,e,i){if(gn(t)){var n=t;t=n.duration,e=n.magnitude,i=n.magnitudeMode;}return void 0===this._shake&&(this._shake=new dn(this,{mode:0,magnitudeMode:1}),function(t,e){e.on("complete",(function(){t.emit("shake.complete",t);}));}(this,this._shake)),void 0!==t&&this._shake.setDuration(t),void 0!==e&&this._shake.setMagnitude(e),void 0!==i&&this._shake.setMagnitudeMode(i),this._shake.shake(),this},shakePromise:function(t,e){return this.shake(t,e),Ii(this._shake)}},kn=Phaser.Utils.Objects.GetValue,mn=Phaser.Math.Linear,bn=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).resetFromJSON(),s.boot(),s}return s(i,[{key:"start",value:function(t){if(this.timer.isRunning)return this;var e=this.target;this.propertyKey=kn(t,"key","value");var n=e[this.propertyKey];return this.fromValue=kn(t,"from",n),this.toValue=kn(t,"to",n),this.setEase(kn(t,"ease",this.ease)),this.setDuration(kn(t,"duration",this.duration)),this.setRepeat(kn(t,"repeat",0)),this.setDelay(kn(t,"delay",0)),this.setRepeatDelay(kn(t,"repeatDelay",0)),this.timer.setDuration(this.duration).setRepeat(this.repeat).setDelay(this.delay).setRepeatDelay(this.repeatDelay),e[this.propertyKey]=this.fromValue,v(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]=mn(this.fromValue,this.toValue,i);}}]),i}(Mi),xn=Phaser.Utils.Objects.IsPlainObject,Cn=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).parent.setDataEnabled(),s.easeTasks={},s}return s(i,[{key:"complete",value:function(t){this.emit("complete-".concat(t),this.parent,this),this.emit("complete",t,this.parent,this);}},{key:"getEaseTask",value:function(t){var e=this.easeTasks[t];return void 0===e&&(e=new bn(this.parent),this.easeTasks[t]=e,e.setTarget(this.parent.data.values).on("complete",(function(){this.complete(t);}),this)),e}},{key:"easeTo",value:function(t,e,i,n){if(xn(t)){var r=t;t=r.key,e=r.value,i=r.duration,n=r.ease;var s=r.speed;void 0===i&&void 0!==s&&(i=Math.abs(e-this.parent.data.values[t])/s*1e3);}return void 0===i&&(i=1e3),void 0===n&&(n="Linear"),this.getEaseTask(t).restart({key:t,to:e,duration:i,ease:n}),this}},{key:"easeFrom",value:function(t,e,i,n){if(xn(t)){var r=t;t=r.key,e=r.value,i=r.duration,n=r.ease;var s=r.speed;void 0===i&&void 0!==s&&(i=Math.abs(e-this.parent.data.values[t])/s*1e3);}return void 0===i&&(i=1e3),void 0===n&&(n="Linear"),this.getEaseTask(t).restart({key:t,from:e,duration:i,ease:n}),this}},{key:"stopEase",value:function(t,e){void 0===e&&(e=!0);var i=this.easeTasks[t];return i&&i.stop(e),this}},{key:"stopAll",value:function(t){for(var e in void 0===t&&(t=!0),this.easeTasks)this.stopEase(e,t);return this}}]),i}(ui),wn={easeDataTo:function(t,e,i,n){return this._easeData||(this._easeData=new Cn(this),function(t,e){e.on("complete",(function(e){t.emit("easedata.".concat(e,".complete"),t),t.emit("easedata.complete",e,t);}));}(this,this._easeData)),this._easeData.easeTo(t,e,i,n),this},easeDataToPromise:function(t,e,i,n){return this.easeDataTo(t,e,i,n),Wi(this._easeData,"complete-".concat(t))},stopEaseData:function(t,e){return this._easeData?(this._easeData.stopEase(t,e),this):this},stopAllEaseData:function(t){return this._easeData?(this._easeData.stopAll(t),this):this}},Sn=function(t){Tn(t,!1);},Pn=function(t){Tn(t,!0);},On=function(t){return !!t&&!Kt(t).hidden},Tn=function(t,e){if(t){Kt(t).hidden=e;var i=_(t);i?i.setChildVisible(t,!e):t.setVisible(!e);}},_n={show:function(t){return void 0===t&&(t=this),Sn(t),this},hide:function(t){return void 0===t&&(t=this),Pn(t),this},isShow:function(t){return void 0===t&&(t=this),On(t)}};function En(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Mn={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1;}function s(t,e,n,s,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new r(n,s||t,o),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e];}function a(){this._events=new n,this._eventsCount=0;}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},a.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return [];if(n.fn)return [n.fn];for(var r=0,s=n.length,o=new Array(s);r0){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}(Wn),Fn={delayCall:function(t,e,i){return this.delayCallTimer=function(t,e,i,n,r){var s=si(t);return s.time.delayedCall(e,(function(){s.game.events.once("poststep",(function(){i.call(n,r);}));}))}(this,t,e,i),this},removeDelayCall:function(){return this.delayCallTimer&&(this.delayCallTimer.remove(!1),this.delayCallTimer=void 0),this}},Yn={setTransitInTime:function(t){return this.transitInTime=t,this},setTransitOutTime:function(t){return this.transitOutTime=t,this},setTransitInCallback:function(t){return t||(t=ie),this.transitInCallback=t,this},setTransitOutCallback:function(t){return t||(t=ie),this.transitOutCallback=t,this}},Xn={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}},Vn={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}},Gn={};Object.assign(Gn,Fn,Yn,Xn,Vn);var Hn=Phaser.Utils.Objects.GetValue,Nn=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).setTransitInTime(Hn(r,"duration.in",200)),s.setTransitOutTime(Hn(r,"duration.out",200)),s.setTransitInCallback(Hn(r,"transitIn")),s.setTransitOutCallback(Hn(r,"transitOut")),s.oneShotMode=Hn(r,"destroy",!1),s.delayCallTimer=void 0,s._state=new In(u(s),{eventEmitter:!1,initState:Hn(r,"initState","IDLE")}),s.openEventData=void 0,s.closeEventData=void 0,s}return s(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(),v(h(i.prototype),"shutdown",this).call(this,t));}}]),i}(ui);Object.assign(Nn.prototype,Gn);var Un=function(t){a(i,t);var e=d(i);function i(t,r,s){var o;return n(this,i),(o=e.call(this,t,0,0,2,2,r,1)).setAlpha(s),o.setScrollFactor(0),o.boot(),o}return s(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),v(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,r=e.height,s=1/i.zoom,o=n/2,a=r/2,h=n*s,l=r*s;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),Jn=Phaser.Utils.Objects.GetValue,Kn=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,{eventEmitter:!1})).resetFromJSON(r),s.boot(),s}return s(i,[{key:"resetFromJSON",value:function(t){return this.setHitAreaMode(Jn(t,"hitAreaMode",0)),this.setEnable(Jn(t,"enable",!0)),this.setStopMode(Jn(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=qn[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}(ui),qn={default:0,fullWindow:1},Zn=Phaser.Utils.Objects.GetValue,$n=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i);var o=Zn(r,"color",0),a=Zn(r,"alpha",.8);return (s=e.call(this,t,o,a)).touchEventStop=new Kn(u(s),{hitAreaMode:1}),s}return s(i)}(Un),Qn=function(t,e){void 0!==t._modalScaleSave?(t.scaleX=t._modalScaleSave,t.scaleY=t._modalScaleSave):t._modalScaleSave=t.scaleX,Bi(t,e);},tr=function(t,e){ji(t,e,void 0,void 0,!1);},er=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,Ki(t,e);},ir=function(t,e){qi(t,e,!1);},nr=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,Ki(t,e,t.alpha);},rr=function(t,e){qi(t,e,!1);},sr=function(t,e,i,n,r){return !!t&&(!(n&&!n(t,e,i))&&(!!wt(t,!0).contains(e,i)&&!(r&&!r(t,e,i))))},or=Phaser.Utils.Objects.GetValue,ar=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={}),null==r.transitIn&&(r.transitIn=hr.popUp),null==r.transitOut&&(r.transitOut=hr.scaleDown),r.destroy=or(r,"destroy",!0),s=e.call(this,t,r);var o=or(r,"cover");s.cover=!1!==o?function(t,e){var i=t.scene,n=new $n(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,s.cover&&(s.setCoverTransitInCallback(or(o,"transitIn",nr)),s.setCoverTransitOutCallback(or(o,"transitOut",rr)));var a=or(r,"touchOutsideClose",!1),h=or(r,"duration.hold",-1),l=or(r,"timeOutClose",h>=0),c=or(r,"anyTouchClose",!1);return or(r,"manualClose",!1)&&(a=!1,c=!1,l=!1),c&&(a=!1),l?s.setDisplayTime(h):s.setDisplayTime(-1),c?s.once("open",s.anyTouchClose,u(s)):a&&s.once("open",s.touchOutsideClose,u(s)),or(r,"openOnStart",!0)&&s.delayCall(0,s.requestOpen,u(s)),s}return s(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),v(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&&sr(this.parent,t.worldX,t.worldY)||this.requestClose();}},{key:"runTransitionInCallback",value:function(){var t=v(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=v(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),v(h(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.closeEventData),v(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=hr[t]),t){case hr.popUp:t=Qn;break;case hr.fadeIn:t=er;}return v(h(i.prototype),"setTransitInCallback",this).call(this,t),this}},{key:"setTransitOutCallback",value:function(t){switch("string"==typeof t&&(t=hr[t]),t){case hr.scaleDown:t=tr;break;case hr.fadeOut:t=ir;}return v(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}(Nn),hr={popUp:0,fadeIn:1,scaleDown:0,fadeOut:1},lr=function(t){return t&&"function"==typeof t},ur={modal:function(t,e){return lr(t)&&(e=t,t=void 0),void 0===this._modalBehavior&&(this.onCreateModalBehavior&&this.onCreateModalBehavior(this,t),this._modalBehavior=function(t,e){var i=new ar(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}},cr=function(t,e,i,n){if(e)return sr(t,e.worldX,e.worldY,i,n);for(var r=t.scene.input.manager,s=r.pointersTotal,o=r.pointers,a=0;a=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}(ui),Tr={press:0,pointerdown:0,release:1,pointerup:1},_r={onClick:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._click&&(t._click=new Or(t,n)),t._click.on("click",e,i),this):this},offClick:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._click||t._click.off("click",e,i),this},enableClick:function(t,e){return t&&"object"!==i(t)&&(e=t,t=this),void 0===t._click||t._click.setEnable(e),this},disableClick:function(t){return t&&"object"!==i(t)&&(t=this),void 0===t._click||t._click.setEnable(!1),this}},Er=function(t,e,i,n){if(e)return !(i&&!i(t,e))&&(!!Mr(t,e)&&!(n&&!n(t,e)));for(var r=t.scene.input.manager,s=r.pointersTotal,o=r.pointers,a=0;a0)return Rr.length=0,!0;return Rr.length=0,!1},Rr=[],Lr=Phaser.Utils.Objects.GetValue,Dr=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),(s=e.call(this,t,r))._enable=void 0;var o=Lr(r,"inputConfig",void 0);return o&&t.setInteractive(o),s.resetFromJSON(r),s.boot(),s}return s(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.lastClickTime=void 0,this.setEnable(Lr(t,"enable",!0)),this.setMode(Lr(t,"mode",1)),this.setClickInterval(Lr(t,"clickInterval",100)),this.setDragThreshold(Lr(t,"threshold",void 0)),this}},{key:"boot",value:function(){var t=this.parent.scene;t.input.on("pointerdown",this.onPress,this),t.input.on("pointerup",this.onRelease,this),t.input.on("pointermove",this.onMove,this);}},{key:"shutdown",value:function(t){if(!this.isShutdown){var e=this.parent.scene;e.input.off("pointerdown",this.onPress,this),e.input.off("pointerup",this.onRelease,this),e.input.off("pointermove",this.onMove,this),this.pointer=null,v(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=Ar[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:"isPointerInside",value:function(t){var e=this.parent;return (e.input?Er:cr)(e,t)}},{key:"onPress",value:function(t){this.parent.willRender(t.camera)&&void 0===this.pointer&&(this.pointer=t,0===this.mode&&(this.isPointerInside(t)||this.click(t.downTime,t)));}},{key:"onRelease",value:function(t){this.parent.willRender(t.camera)&&this.pointer===t&&(1===this.mode&&(this.isPointerInside(t)||this.click(t.upTime,t)),this.pointer=void 0);}},{key:"onMove",value:function(t,e,i,n){this.pointer===t&&void 0!==this.dragThreshold&&1===this.mode&&(t.getDistance()>=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}(ui),Ar={press:0,pointerdown:0,release:1,pointerup:1},zr={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 Dr(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}},Br=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 s(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}(Wn),jr=Phaser.Utils.Objects.GetValue,Wr=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r))._enable=void 0,s.cooldown=new Br,s.parent.setInteractive(jr(r,"inputConfig",void 0)),s.resetFromJSON(r),s.boot(),s}return s(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.prevIsInTouch=!1,this.isInTouching=!1,this.setEnable(jr(t,"enable",!0)),this.setCooldown(jr(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,v(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}(ui),Ir={isPointerInBounds:function(t){return void 0===t?t=this:"string"==typeof t&&(t=this.getElement(t)),!!t&&cr(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 Wr(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 Wr(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}},Fr=function(t,e,i){for(var n,r=0,s=t.length;r0),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=is,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===ns&&this.onDragEnd(),this.pointer=void 0,this.tracerState=is,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(){v(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(){v(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=rs,this}}]),i}(fi),is=0,ns=1,rs="IDLE",ss=Phaser.Utils.Objects.GetValue,os=Phaser.Math.Distance.Between,as=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i);var o=u(s=e.call(this,t,r)),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=hs;},eventEmitter:!1};return s.setRecongizedStateObject(new Wn(a)),s}return s(i,[{key:"resetFromJSON",value:function(t){v(h(i.prototype),"resetFromJSON",this).call(this,t),this.setHoldTime(ss(t,"time",250)),this.setTapInterval(ss(t,"tapInterval",200)),this.setDragThreshold(ss(t,"threshold",9)),this.setTapOffset(ss(t,"tapOffset",10));var e=ss(t,"taps",void 0);return void 0!==e?this.setTaps(e):(this.setMaxTaps(ss(t,"maxTaps",void 0)),this.setMinTaps(ss(t,"minTaps",void 0))),this}},{key:"onDragStart",value:function(){switch(this.state){case hs:this.state=ls;break;case ls:var t=this.lastPointer;os(t.upX,t.upY,t.x,t.y)>this.tapOffset&&(this.state=us,this.state=ls);break;case us:this.state=ls;}}},{key:"onDragEnd",value:function(){this.state===ls&&(this.tapsCount++,this.emit("tapping",this,this.gameObject,this.lastPointer),void 0!==this.maxTaps&&this.tapsCount===this.maxTaps&&(this.state=us));}},{key:"onDrag",value:function(){this.state!==hs&&this.pointer.getDistance()>this.dragThreshold&&(this.state=hs);}},{key:"preUpdate",value:function(t,e){if(this.isRunning&&this.enable&&this.state===ls){var i=this.lastPointer;if(i.isDown)t-i.downTime>this.holdTime&&(this.state=hs);else t-i.upTime>this.tapInterval&&(void 0===this.minTaps||this.tapsCount>=this.minTaps?this.state=us:this.state=hs);}}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===us&&(this.state=hs);}},{key:"isTapped",get:function(){return this.state===us}},{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}(es),hs="IDLE",ls="BEGIN",us="RECOGNIZED",cs=Phaser.Utils.Objects.GetValue,ds=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i);var o=u(s=e.call(this,t,r)),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=fs;},eventEmitter:!1};return s.setRecongizedStateObject(new Wn(a)),s}return s(i,[{key:"resetFromJSON",value:function(t){return v(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(cs(t,"threshold",9)),this.setHoldTime(cs(t,"time",251)),this}},{key:"onDragStart",value:function(){this.state=vs,0===this.holdTime&&(this.state=ps);}},{key:"onDragEnd",value:function(){this.state=fs;}},{key:"onDrag",value:function(){this.state!==fs&&this.pointer.getDistance()>this.dragThreshold&&(this.state=fs);}},{key:"preUpdate",value:function(t,e){this.isRunning&&this.enable&&(this.state===vs&&t-this.pointer.downTime>=this.holdTime&&(this.state=ps));}},{key:"isPressed",get:function(){return this.state===ps}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(es),fs="IDLE",vs="BEGIN",ps="RECOGNIZED";Phaser.Utils.Objects.GetValue;var gs=function(t){return hi(t).loop.delta},ys=Phaser.Math.Distance.Between,ks=Phaser.Math.Angle.Between,ms={getDt:function(){return gs(this.scene)},getVelocity:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return ys(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 ks(e.x,e.y,t.x,t.y)}},bs={"up&down":0,"left&right":1,"4dir":2,"8dir":3},xs={},Cs=Phaser.Utils.Objects.GetValue,ws=Phaser.Math.RadToDeg,Ss=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i);var o=u(s=e.call(this,t,r)),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=Ps;},eventEmitter:!1};return s.setRecongizedStateObject(new Wn(a)),s.clearDirectionStates(),s}return s(i,[{key:"resetFromJSON",value:function(t){return v(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Cs(t,"threshold",10)),this.setVelocityThreshold(Cs(t,"velocityThreshold",1e3)),this.setDirectionMode(Cs(t,"dir","8dir")),this}},{key:"onDragStart",value:function(){this.state=Os;}},{key:"onDragEnd",value:function(){this.state=Ps;}},{key:"onDrag",value:function(){this.state===Os&&(this.validDrag||(this.validDrag=0===this.dragThreshold||this.pointer.getDistance()>=this.dragThreshold),this.validDrag&&this.dragVelocity>this.velocityThreshold&&(this.state=Ts));}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===Ts&&(this.state=Ps);}},{key:"isSwiped",get:function(){return this.state===Ts}},{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=bs[t]),this.dirMode=t,this}},{key:"updateDirectionStates",value:function(){return function(t,e,i){switch(void 0===i?i={}:!0===i&&(i=xs),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;}}(ws(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}(es);Object.assign(Ss.prototype,ms);var Ps="IDLE",Os="BEGIN",Ts="RECOGNIZED",_s=Phaser.Utils.Objects.GetValue,Es=Phaser.Utils.Array.SpliceOne,Ms=Phaser.Math.Distance.Between,Rs=Phaser.Math.Angle.Between,Ls=function(){function t(e,i){n(this,t);var r=e.input.manager.pointersTotal-1;r<2&&e.input.addPointer(2-r),this.scene=e,this.setEventEmitter(_s(i,"eventEmitter",void 0)),this._enable=void 0,this.pointers=[],this.movedState={},this.resetFromJSON(i),this.boot();}return s(t,[{key:"resetFromJSON",value:function(t){return this.setEnable(_s(t,"enable",!0)),this.bounds=_s(t,"bounds",void 0),this.tracerState=As,this.pointers.length=0,Dt(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,Dt(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 As:this.tracerState=zs,this.onDrag1Start();break;case zs:this.tracerState=Bs,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],Es(this.pointers,e),this.tracerState){case zs:this.tracerState=As,this.onDrag1End();break;case Bs:this.tracerState=zs,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 zs:this.onDrag1();break;case Bs:this.onDrag2();}}}},{key:"dragCancel",value:function(){return this.tracerState===Bs&&this.onDrag2End(),this.pointers.length=0,Dt(this.movedState),this.tracerState=As,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!==Bs)return 0;var t=this.pointers[0],e=this.pointers[1];return Ms(t.x,t.y,e.x,e.y)}},{key:"angleBetween",get:function(){if(this.tracerState!==Bs)return 0;var t=this.pointers[0],e=this.pointers[1];return Rs(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;Ds.x=e.x-i.x,Ds.y=e.y-i.y;}else Ds.x=0,Ds.y=0;return Ds}},{key:"centerX",get:function(){if(this.tracerState!==Bs)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!==Bs)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!==Bs)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!==Bs)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=js,this}}]),t}();Object.assign(Ls.prototype,ii);var Ds={},As=0,zs=1,Bs=2,js="IDLE";Phaser.Utils.Objects.GetValue;var Ws=Phaser.Math.RotateAround,Is=function(t,e,i,n){return Ws(t,e,i,n),t.rotation+=n,t},Fs={},Ys=Phaser.Utils.Objects.GetValue,Xs=Phaser.Math.Angle.WrapDegrees,Vs=Phaser.Math.Angle.ShortestBetween,Gs=Phaser.Math.RadToDeg,Hs=Phaser.Math.DegToRad,Ns=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i);var o=u(s=e.call(this,t,r)),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=Js;},eventEmitter:!1};return s.setRecongizedStateObject(new Wn(a)),s}return s(i,[{key:"resetFromJSON",value:function(t){return v(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Ys(t,"threshold",0)),this}},{key:"onDrag2Start",value:function(){this.prevAngle=Xs(Gs(this.angleBetween)),this.state=Ks,0===this.dragThreshold&&(this.state=qs);}},{key:"onDrag2End",value:function(){this.state=Js;}},{key:"onDrag2",value:function(){switch(this.state){case Ks:if(this.pointers[0].getDistance()>=this.dragThreshold&&this.pointers[1].getDistance()>=this.dragThreshold){var t=Xs(Gs(this.angleBetween));this.angle=Vs(this.prevAngle,t),this.prevAngle=t,this.state=qs;}break;case qs:t=Xs(Gs(this.angleBetween));this.angle=Vs(this.prevAngle,t),this.prevAngle=t,this.emit("rotate",this);}}},{key:"isRotated",get:function(){return this.state===qs}},{key:"rotation",get:function(){return Hs(this.angle)}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Ls),Us={spinObject:function(t,e){if(!this.isRotation)return this;void 0===e&&(e=this.pointers[0].camera);var i=this.movementCenterX,n=this.movementCenterY,r=function(t,e,i,n){return void 0===n?n={}:!0===n&&(n=Fs),i.getWorldPoint(t,e,n),n}(this.centerX,this.centerY,e,!0),s=r.x,o=r.y,a=this.rotation;if(Array.isArray(t))for(var h=t,l=0,u=h.length;l=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?kt(t):h:t.minHeight=void 0===l?mt(t):l),s&&(0===this.orientation?t.minHeight=l:t.minWidth=h)),void 0!==o&&this.addChildrenMap(o,t),this},ko={add:yo,addSpace:function(t){return this.insertSpace(void 0,t),this},insertSpace:function(t,e){return void 0===e&&(e=1),yo.call(this,new uo(this.scene),{proportion:e,minWidth:0,minHeight:0,index:t}),this},insert:function(t,e,i,n,r,s,o,a){return fo(i)&&(i.index=t),yo.call(this,e,i,n,r,s,o,t,a),this},insertAtPosition:function(t,e,i,n,r,s,o,a,h){var l=co.call(this,t,e);return -1===l&&(l=void 0),this.insert(l,i,n,r,s,o,a,h),this}},mo=Jt.prototype.clear,bo=function(t){this.backgroundChildren&&(this.backgroundChildren.length=0);var e,i=!t&&this.sizerEventsEnable;if(i&&(e=this.getChildren([])),mo.call(this,t),i)for(var n,r=0,s=e.length;r=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,bo.call(this,t),this}},wo={getChildAlign:function(t){return this.getSizerConfig(t).align},setChildAlign:function(t,e){return "string"==typeof e&&(e=ee[e]),this.getSizerConfig(t).align=e,this}},So={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);var e,i,n,r=0,s=this.sizerChildren;if(0===this.orientation)for(var o=this.space.item,a=!0,h=0,l=s.length;h0&&this.proportionLength>0&&(i=n.proportion*this.proportionLength):n.expand&&(i=e-this.space.left-this.space.right-r.left-r.right);return i},getExpandedChildHeight:function(t,e){var i;void 0===e&&(e=this.height);var n=t.rexSizer,r=n.padding;0===this.orientation?n.expand&&(i=e-this.space.top-this.space.bottom-r.top-r.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,r=i.length;n0?(e=t-this.getChildrenWidth(!1),this.proportionLength=e/this.childrenProportion):this.proportionLength=0;}return t},resolveHeight:function(t){t=$e.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(So,ko,Co,wo,{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 Po=function(){for(var t,e,i=0,n=this.sizerChildren,r=0,s=n.length;r0&&(i+=e);return i},Oo={x:0,h:0,horizontal:0,"left-to-right":0,y:1,v:1,vertical:1,"top-to-bottom":1},To=function(t){return "string"==typeof t&&(t=Oo[t]),t},_o=Phaser.Utils.Objects.IsPlainObject,Eo=Phaser.Utils.Objects.GetValue,Mo=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h,l){var u;return n(this,i),_o(r)?(r=Eo(l=r,"x",0),s=Eo(l,"y",0),o=Eo(l,"width",void 0),a=Eo(l,"height",void 0),h=Eo(l,"orientation",0)):_o(o)?(o=Eo(l=o,"width",void 0),a=Eo(l,"height",void 0),h=Eo(l,"orientation",0)):_o(h)&&(h=Eo(l=h,"orientation",0)),void 0===h&&(h=0),(u=e.call(this,t,r,s,o,a,l)).type="rexSizer",u.sizerChildren=[],u.setOrientation(h),u.setItemSpacing(Eo(l,"space.item",0)),u.setStartChildIndex(Eo(l,"startChildIndex",0)),u.setRTL(Eo(l,"rtl",!1)),u.addChildrenMap("items",u.sizerChildren),u}return s(i,[{key:"setOrientation",value:function(t){return this.orientation=To(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=Po.call(this)),this._childrenProportion}}]),i}(ao);Object.assign(Mo.prototype,So);var Ro=function(t,e,i){if(t){var n=null==e,r=null==i;return n&&r||(n||(t.displayWidth=e),r||(t.displayHeight=i),n&&(t.scaleX=t.scaleY),r&&(t.scaleY=t.scaleX)),t}},Lo=function(t,e){var i;return t||0===t||(t=""),void 0===e&&(e=!0),Array.isArray(t)&&(t=t.join("\n")),(i=e?"".concat(this.text,"\n").concat(t):"".concat(this.text).concat(t))!=this.text&&this.setText(i),this},Do={appendText:Lo,resetDisplayContent:function(t){void 0===t?t={}:"string"==typeof t&&(t={text:t});var e=t.text||"";this.setText(e);var i=this.childrenMap.icon;if(i){t.icon?this.show(i):this.hide(i);var n=t.iconSize;n&&(this.setChildDisplaySize(i,n,n),void 0!==this.iconWidth&&this.setIconSize(n)),!0!==t.icon&&this.setIconTexture(t.icon,t.iconFrame);}var r=this.childrenMap.action;if(r){t.action?this.show(r):this.hide(r);var s=t.actionSize;s&&(this.setChildDisplaySize(r,s,s),void 0!==this.actionWidth&&this.setActionSize(s)),!0!==t.action&&this.setActionTexture(t.action,t.actionFrame);}return this}},Ao=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return s(i,[{key:"text",get:function(){var t=this.childrenMap.text;return t?t.text:""},set:function(t){var e=this.childrenMap.text;e&&e.setText(t);}},{key:"setText",value:function(t){return this.text=t,this}},{key:"setIconTexture",value:function(t,e){var i=this.childrenMap.icon;return i?(i.setTexture(t,e),void 0!==this.iconWidth&&(Ro(i,this.iconWidth,this.iconHeight),this.resetChildScaleState(i)),this):this}},{key:"setTexture",value:function(t,e){return this.setIconTexture(t,e),this}},{key:"setIconSize",value:function(t,e){return void 0===e&&(e=t),this.iconWidth=t,this.iconHeight=e,this}},{key:"texture",get:function(){var t=this.childrenMap.icon;if(t)return t.texture}},{key:"frame",get:function(){var t=this.childrenMap.icon;if(t)return t.frame}},{key:"setActionTexture",value:function(t,e){var i=this.childrenMap.action;return void 0===i||(i.setTexture(t,e),void 0!==this.actionWidth&&(Ro(i,this.actionWidth,this.actionHeight),this.resetChildScaleState(i))),this}},{key:"actionTexture",get:function(){var t=this.childrenMap.action;if(t)return t.texture}},{key:"actionFrame",get:function(){var t=this.childrenMap.action;if(t)return t.frame}},{key:"setActionSize",value:function(t,e){return void 0===e&&(e=t),this.actionWidth=t,this.actionHeight=e,this}},{key:"preLayout",value:function(){var t=this.childrenMap.icon;t&&void 0!==this.iconWidth&&Ro(t,this.iconWidth,this.iconHeight);var e=this.childrenMap.action;e&&void 0!==this.actionWidth&&Ro(e,this.actionWidth,this.actionHeight),v(h(i.prototype),"preLayout",this).call(this);}},{key:"runLayout",value:function(t,e,n){if(this.ignoreLayout)return this;v(h(i.prototype),"runLayout",this).call(this,t,e,n);var r=this.childrenMap.iconMask;r&&(r.setPosition(),this.resetChildPositionState(r));var s=this.childrenMap.actionMask;return s&&(s.setPosition(),this.resetChildPositionState(s)),this}},{key:"resize",value:function(t,e){v(h(i.prototype),"resize",this).call(this,t,e);var n=this.childrenMap.iconMask;n&&n.resize();var r=this.childrenMap.actionMask;return r&&r.resize(),this}}]),i}(Mo);Object.assign(Ao.prototype,Do);var zo=function(t,e,i,n,r){if(this.clear().fillStyle(16777215),1===this.shapeType){i=i.left;var s=Math.min(t,e)/2;this.fillCircle(-t*(n-.5),-e*(r-.5),s+i);}else this.fillRect(-t*n-i.left,-e*r-i.top,t+i.left+i.right,e+i.top+i.bottom);},Bo=function(t,e){for(var i in t){if(!(i in e))return !1;if(t[i]!==e[i])return !1}for(var i in e)if(!(i in t))return !1;return !0},jo=function(t){a(i,t);var e=d(i);function i(t,r,s){var o;return n(this,i),void 0===r&&(r=0),"string"==typeof r&&(r=Wo[r]),(o=e.call(this,t.scene)).parent=t,o.shapeType=r,o.padding=Le(s),o.setPosition().resize().setVisible(!1),o}return s(i,[{key:"destroy",value:function(){return this.parent=void 0,v(h(i.prototype),"destroy",this).call(this),this}},{key:"setPosition",value:function(t,e){var n=this.parent;return void 0===t&&(t=n.x),void 0===e&&(e=n.y),v(h(i.prototype),"setPosition",this).call(this,t,e),this}},{key:"resize",value:function(t,e,i){var n=this.parent;void 0===t&&(t=n.width),void 0===e&&(e=n.height),void 0===i?i=this.padding:"number"==typeof i&&(i=Le(i));var r=this.width!==t||this.height!==e,s=this.padding!==i&&!Bo(this.padding,i);return r||s?(this.width=t,this.height=e,s&&At(i,this.padding),this.originX=n.originX,this.originY=n.originY,zo.call(this,t,e,i,n.originX,n.originY),this):this}},{key:"setOrigin",value:function(t,e){void 0===e&&(e=t);var i=this.parent;return void 0===t&&(t=i.originX),void 0===e&&(e=i.originY),this.originX===t&&this.originY===e||(this.originX=t,this.originY=e,zo.call(this,this.width,this.height,this.padding,t,e)),this}}]),i}(Phaser.GameObjects.Graphics),Wo={rectangle:0,circle:1},Io=function(t,e,i,n){var r=new jo(e,i,n);if(t&&!t.isRexSizer){var s=r.createGeometryMask();t.setMask(s),this.once("destroy",(function(){t.setMask(),s.destroy();}));}return this.pin(r),r},Fo=Phaser.Utils.Objects.GetValue,Yo=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),(s=e.call(this,t,r)).type="rexLabel";var o=Fo(r,"background",void 0),a=Fo(r,"icon",void 0),h=Fo(r,"iconMask",void 0),l=Fo(r,"text",void 0),c=Fo(r,"action",void 0),d=Fo(r,"actionMask",void 0),f=Fo(r,"align",void 0);if(o&&s.addBackground(o),"right"!==f&&"bottom"!==f&&"center"!==f||s.addSpace(),a){0===s.orientation?(l||c)&&(x={right:Fo(r,"space.icon",0),top:Fo(r,"space.iconTop",0),bottom:Fo(r,"space.iconBottom",0),left:Fo(r,"space.iconLeft",0)}):(l||c)&&(x={bottom:Fo(r,"space.icon",0),left:Fo(r,"space.iconLeft",0),right:Fo(r,"space.iconRight",0),top:Fo(r,"space.iconTop",0)});var v=Fo(r,"squareFitIcon",!1)?1:0;if(s.add(a,{proportion:0,padding:x,fitRatio:v}),h&&(h=Io.call(u(s),a,a,1)),!v){var p=Fo(r,"iconSize",void 0);s.setIconSize(Fo(r,"iconWidth",p),Fo(r,"iconHeight",p));}}if(l){var g,y,k=Fo(r,"space.text",0),m=Fo(r,"expandTextWidth",!1),b=Fo(r,"expandTextHeight",!1);0===s.orientation?(g=m?1:0,c&&(x={right:k}),y=b):(g=b?1:0,c&&(x={bottom:k}),y=m),s.add(l,{proportion:g,expand:y,padding:x});}if(c){var x;x=0===s.orientation?{top:Fo(r,"space.actionTop",0),bottom:Fo(r,"space.actionBottom",0),right:Fo(r,"space.actionRight",0)}:{left:Fo(r,"space.actionLeft",0),right:Fo(r,"space.actionRight",0),bottom:Fo(r,"space.actionBottom",0)};v=Fo(r,"squareFitAction",!1)?1:0;if(s.add(c,{proportion:0,padding:x,fitRatio:v}),d&&(d=Io.call(u(s),c,c,1)),!v){var C=Fo(r,"actionSize");s.setActionSize(Fo(r,"actionWidth",C),Fo(r,"actionHeight",C));}}return "center"===f&&s.addSpace(),s.addChildrenMap("background",o),s.addChildrenMap("icon",a),s.addChildrenMap("iconMask",h),s.addChildrenMap("text",l),s.addChildrenMap("action",c),s.addChildrenMap("actionMask",d),s}return s(i)}(Ao),Xo=function t(e){var n,r,s;if(null==e||"object"!==i(e))return e;if(n=Array.isArray(e)?[]:{},function(t){if("object"!==i(t)||t.nodeType||t===t.window)return !1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return !1}catch(t){return !1}return !0}(e))for(s in e)r=e[s],n[s]=t(r);else n=e;return n},Vo=function(t){return null==t||""===t||0===t.length},Go=function(t,e,n,r){if(void 0===r&&(r="."),"object"===i(t)){if(Vo(e)){if(null==n)return;"object"===i(n)&&(t=n);}else {"string"==typeof e&&(e=e.split(r));var s=e.pop(),o=function(t,e,n){var r=t;if(Vo(e));else {var s;"string"==typeof e&&(e=e.split("."));for(var o=0,a=e.length;o=0||t.y>=0,t.x=Math.abs(t.x),t.y=Math.abs(t.y);},qo=function(t,e,i){var n=i.length;if(n>=2){var r=i[n-2],s=i[n-1];if(t===r&&e===s)return i}return i.push(t,e),i},Zo=Phaser.Math.DegToRad,$o=function(t,e,i,n,r,s,o,a,h){o&&s>r?s-=360:!o&&s>>16,a=(65280&r)>>>8,h=255&r;t.fillStyle="rgba("+o+","+a+","+h+","+s+")";},sa=function(t,e,i,n){var r=i||e.strokeColor,s=n||e.strokeAlpha,o=(16711680&r)>>>16,a=(65280&r)>>>8,h=255&r;t.strokeStyle="rgba("+o+","+a+","+h+","+s+")",t.lineWidth=e.lineWidth;},oa=Phaser.Renderer.Canvas.SetTransform,aa={renderWebGL:function(t,e,i,n){e.dirty&&(e.updateData(),e.dirty=!1),i.addToRenderList(e);var r=t.pipelines.set(e.pipeline),s=na(e,i,n),o=r.calcMatrix.copyFrom(s.calc),a=e._displayOriginX,h=e._displayOriginY,l=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&ta(r,o,e,l,a,h),e.isStroked&&ia(r,e,l,a,h),t.pipelines.postBatch(e);},renderCanvas:function(t,e,i,n){e.dirty&&(e.updateData(),e.dirty=!1),i.addToRenderList(e);var r=t.currentContext;if(oa(t,r,e,i,n)){var s=e._displayOriginX,o=e._displayOriginY,a=e.pathData,h=a.length-1,l=a[0]-s,u=a[1]-o;r.beginPath(),r.moveTo(l,u),e.closePath||(h-=2);for(var c=2;c0;}},{key:"fillAlpha",get:function(){return this._fillAlpha},set:function(t){this._fillAlpha=t,this.isFilled=t>0&&null!=this._fillColor;}},{key:"setFillStyle",value:function(t,e){return void 0===e&&(e=1),this.fillColor=t,this.fillAlpha=e,this}},{key:"strokeColor",get:function(){return this._strokeColor},set:function(t){this._strokeColor=t,this.isStroked=null!=t&&this._strokeAlpha>0&&this._lineWidth>0;}},{key:"strokeAlpha",get:function(){return this._strokeAlpha},set:function(t){this._strokeAlpha=t,this.isStroked=t>0&&null!=this._strokeColor&&this._lineWidth>0;}},{key:"lineWidth",get:function(){return this._lineWidth},set:function(t){this._lineWidth=t,this.isStroked=t>0&&null!=this._strokeColor;}},{key:"setStrokeStyle",value:function(t,e,i){return void 0===i&&(i=1),this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this}},{key:"updateData",value:function(){var t=this.geom,e=this.pathData;e.length=0;var i,n=t.width,r=t.height,s=t.cornerRadius,o=this.iteration+1;if(i=s.tl,fa(i))if(i.convex){var a=i.x,h=i.y;$o(a,h,i.x,i.y,180,270,!1,o,e);}else {$o(a=0,h=0,i.x,i.y,90,0,!0,o,e);}else qo(0,0,e);if(i=s.tr,fa(i))if(i.convex){a=n-i.x,h=i.y;$o(a,h,i.x,i.y,270,360,!1,o,e);}else {$o(a=n,h=0,i.x,i.y,180,90,!0,o,e);}else qo(n,0,e);if(i=s.br,fa(i))if(i.convex){a=n-i.x,h=r-i.y;$o(a,h,i.x,i.y,0,90,!1,o,e);}else {$o(a=n,h=r,i.x,i.y,270,180,!0,o,e);}else qo(n,r,e);if(i=s.bl,fa(i))if(i.convex){a=i.x,h=r-i.y;$o(a,h,i.x,i.y,90,180,!1,o,e);}else {$o(a=0,h=r,i.x,i.y,360,270,!0,o,e);}else qo(0,r,e);return e.push(e[0],e[1]),this.pathIndexes=ca(e),this}},{key:"setShapeType",value:function(t){return "string"==typeof t&&(t=va[t]),this.shapeType=t,this}},{key:"width",get:function(){return this.geom.width},set:function(t){this.resize(t,this.height);}},{key:"height",get:function(){return this.geom.height},set:function(t){this.resize(this.width,t);}},{key:"setSize",value:function(t,e){if(void 0===e&&(e=t),this.geom.width===t&&this.geom.height===e)return this;this.geom.setSize(t,e),1===this.shapeType&&this.setRadius({x:t/2,y:e/2}),this.updateDisplayOrigin(),this.dirty=!0;var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this}},{key:"resize",value:function(t,e){return this.setSize(t,e),this}},{key:"radius",get:function(){return this.geom.radius},set:function(t){this.geom.setRadius(t),this.updateDisplayOrigin(),this.dirty=!0;}},{key:"radiusTL",get:function(){return this.geom.radiusTL},set:function(t){this.geom.radiusTL=t,this.dirty=!0;}},{key:"radiusTR",get:function(){return this.geom.radiusTR},set:function(t){this.geom.radiusTR=t,this.dirty=!0;}},{key:"radiusBL",get:function(){return this.geom.radiusBL},set:function(t){this.geom.radiusBL=t,this.dirty=!0;}},{key:"radiusBR",get:function(){return this.geom.radiusBR},set:function(t){this.geom.radiusBR=t,this.dirty=!0;}},{key:"setRadius",value:function(t){return void 0===t&&(t=0),this.radius=t,this}},{key:"setRadiusTL",value:function(t){return void 0===t&&(t=0),this.radiusTL=t,this}},{key:"setRadiusTR",value:function(t){return void 0===t&&(t=0),this.radiusTR=t,this}},{key:"setRadiusBL",value:function(t){return void 0===t&&(t=0),this.radiusBL=t,this}},{key:"setRadiusBR",value:function(t){return void 0===t&&(t=0),this.radiusBR=t,this}},{key:"cornerRadius",get:function(){return this.geom.cornerRadius},set:function(t){this.radius=t;}},{key:"setCornerRadius",value:function(t){return this.setRadius(t)}},{key:"iteration",get:function(){return this._iteration},set:function(t){void 0!==this._iteration?this._iteration!==t&&(this._iteration=t,this.dirty=!0):this._iteration=t;}},{key:"setIteration",value:function(t){return void 0===t&&(t=6),this.iteration=t,this}}]),i}(ha),fa=function(t){return t.x>0&&t.y>0},va={rectangle:0,circle:1};Object.assign(da.prototype,aa);var pa=function(t,e,i,n){if(void 0===i&&(i="."),void 0===n&&(n={}),!t)return n;if(e in t)return Object.assign(n,t[e]);for(var r in e+=i,t)r.startsWith(e)&&(n[r.replace(e,"")]=t[r]);return n},ga=function(t,e,i){if(void 0===i&&(i={}),Array.isArray(e))for(var n=0,r=e.length;n=6?(n=[arguments[2],void 0,arguments[3]],r=[arguments[4],void 0,arguments[5]]):(n=Xo(n),r=Xo(r)),this.textureKey=t,this.baseFrameName=e,this.columns.data=n,this.columns.count=n?n.length:0,this.columns.stretch=0,this.columns.minWidth=0,this.columns.scale=1,this.rows.data=r,this.rows.count=r?r.length:0,this.rows.stretch=0,this.rows.minHeight=0,this.rows.scale=1;var s=this.scene.sys.textures.get(t);if(!s)return this.clear(),this;if(!n||!r)return this.clear(),this;for(var o=s.get(e),a=o.width,h=0,l=0,u=n.length;l0?0:g,b=0;l=0;for(var S=n.length;l0?0:y),y>=1&&g>=1){var P=i(k=this.getFrameNameCallback(l,C,e));"string"!==P&&"number"!==P||s.add(k,0,b+o.cutX,x+o.cutY,y,g);}b+=y;}x+=g;}return this.updateTexture(),this},updateTexture:function(){if(this.clear(),void 0===this.textureKey)return this;var t=this.scene.sys.textures.get(this.textureKey);if(!t)return this;var e,i,n,r,s,o,a,h=this.columns.minWidth*this.maxFixedPartScaleX,l=this.rows.minHeight*this.maxFixedPartScaleY,u=this.width-h,c=this.height-l,d=u>=0?this.maxFixedPartScaleX:this.width/h,f=c>=0?this.maxFixedPartScaleY:this.height/l;if(this.preserveRatio){var v=Math.min(d,f);if(d>v){var p=(d-v)*h;u>=0?u+=p:u=p,d=v;}if(f>v){var g=(f-v)*l;c>=0?c+=g:c=g,f=v;}}this.columns.scale=d,this.rows.scale=f,e=u>0&&this.columns.stretch>0?u/this.columns.stretch:0,i=c>0&&this.rows.stretch>0?c/this.rows.stretch:0;var y=0,k=0;this._beginDraw();for(var m=0,b=this.rows.count;m0&&a>0&&(0===(0===s.stretch&&0===r.stretch||0===this.getStretchMode(x,m)?0:1)?this._drawImage(this.textureKey,n,y,k,o,a):this._drawTileSprite(this.textureKey,n,y,k,o,a)),y+=o;k+=a;}this._endDraw();},setStretchMode:function(t){return Ia(t)?(this.stretchMode.edge=Ya(Fa(t,"edge",0)),this.stretchMode.internal=Ya(Fa(t,"internal",0))):(t=Ya(t),this.stretchMode.edge=t,this.stretchMode.internal=t),this},getStretchMode:function(t,e){return Va.call(this,t,e)?this.stretchMode.edge:this.stretchMode.internal},setPreserveRatio:function(t){return null==t&&(t=!0),this.preserveRatio=t,this},setMaxFixedPartScale:function(t,e){return void 0===e&&(e=t),this.maxFixedPartScaleX=t,this.maxFixedPartScaleY=e,this}},Ha=Phaser.Utils.Objects.IsPlainObject,Na=Phaser.Utils.Objects.GetValue,Ua=Phaser.GameObjects,Ja=void 0,Ka=function(t,e){if(Ja||(Ja={},hi(t).events.once("destroy",(function(){for(var t in Ja)Ja[t].destroy();Ja=void 0;}))),!Ja.hasOwnProperty(e)){var i=hi(t).scene.systemScene;(t=new Ua[e](i)).setOrigin(0),Ja[e]=t;}return Ja[e]},qa=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return s(i)}(function(t,e){var i=function(t){a(r,t);var i=d(r);function r(t,s,o,a,h,l,u,c,d,f){var v;if(n(this,r),Ha(s)?(s=Na(f=s,"x",0),o=Na(f,"y",0),a=Na(f,"width",1),h=Na(f,"height",1),l=Na(f,"key",void 0),u=Na(f,"baseFrame",void 0),c=Na(f,"columns",void 0),d=Na(f,"rows",void 0)):Ha(a)?(a=Na(f=a,"width",1),h=Na(f,"height",1),l=Na(f,"key",void 0),u=Na(f,"baseFrame",void 0),c=Na(f,"columns",void 0),d=Na(f,"rows",void 0)):Ha(l)?(l=Na(f=l,"key",void 0),u=Na(f,"baseFrame",void 0),c=Na(f,"columns",void 0),d=Na(f,"rows",void 0)):Ha(u)?(u=Na(f=u,"baseFrame",void 0),c=Na(f,"columns",void 0),d=Na(f,"rows",void 0)):Array.isArray(u)?(f=d,d=c,c=u,u=Na(f,"baseFrame",void 0)):Ha(c)&&(c=Na(f=c,"columns",void 0),d=Na(f,"rows",void 0)),void 0===c){var p=Na(f,"leftWidth",void 0),g=Na(f,"rightWidth",void 0);void 0!==p&&void 0!==g&&(c=[p,void 0,g]);}if(void 0===d){var y=Na(f,"topHeight",void 0),k=Na(f,"bottomHeight",void 0);void 0!==y&&void 0!==k&&(d=[y,void 0,k]);}(v=i.call(this,t)).type=e,v.setPosition(s,o).setSize(a,h).setOrigin(.5,.5),v.columns={},v.rows={},v.stretchMode={},v._tileSprite=void 0,v._image=void 0,v.setGetFrameNameCallback(Na(f,"getFrameNameCallback",void 0)),v.setStretchMode(Na(f,"stretchMode",0)),v.setPreserveRatio(Na(f,"preserveRatio",!0));var m=Na(f,"maxFixedPartScale",1),b=Na(f,"maxFixedPartScaleX",m),x=Na(f,"maxFixedPartScaleY",void 0);return v.setMaxFixedPartScale(b,x),v.setBaseTexture(l,u,c,d),v}return s(r,[{key:"minWidth",get:function(){return this.columns.minWidth}},{key:"minHeight",get:function(){return this.rows.minHeight}},{key:"fixedPartScaleX",get:function(){return this.columns.scale}},{key:"fixedPartScaleY",get:function(){return this.rows.scale}},{key:"resize",value:function(t,e){return this.width===t&&this.height===e||(v(h(r.prototype),"resize",this)?v(h(r.prototype),"resize",this).call(this,t,e):v(h(r.prototype),"setSize",this).call(this,t,e),this.updateTexture()),this}}]),r}(t);return Object.assign(i.prototype,Ga),i}(Phaser.GameObjects.RenderTexture,"rexNinePatch")),Za={_drawImage:function(t,e,i,n,r,s){var o=Ka(this,"Image").setTexture(t,e).setDisplaySize(r,s);this.draw(o,i,n);},_drawTileSprite:function(t,e,i,n,r,s){var o=Ka(this,"TileSprite").setTexture(t,e).setSize(r,s);this.draw(o,i,n);}};Object.assign(qa.prototype,Za);var $a=function(t,e){var i,n;switch(e&&(e.hasOwnProperty("type")?i=e.type:e.hasOwnProperty("leftWidth")?i="nineSlice":e.hasOwnProperty("key")&&(i="image")),i){case"image":n=new ja(t,e);break;case"nineSlice":n=e.hasOwnProperty("stretchMode")?new qa(t,e):new Da(t,e);break;default:n=new Ca(t,e);}return t.add.existing(n),n},Qa=Phaser.GameObjects.Text,th=Phaser.Utils.Objects.GetValue,eh=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={});var o=th(r,"x",0),a=th(r,"y",0),h=th(r,"text","");return (s=e.call(this,t,o,a,h,r)).type="rexStatesText",r.style=s.style,r.onModifyStyle=function(t,e){var i=e.hasOwnProperty("fontStyle")||e.hasOwnProperty("fontSize")||e.hasOwnProperty("fontFamily");t.style.update(i);},s.addStyleManager(r),delete r.style,s}return s(i)}(Qa);Object.assign(eh.prototype,xa); +!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).rextweaker=e();}(undefined,(function(){function t(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n);}return i}function e(e){for(var i=1;it.length)&&(e=t.length);for(var i=0,n=new Array(e);i=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 w(this.children,t,0,(function(t){t.once("destroy",e.onChildDestroy,e);}),this),this}},{key:"remove",value:function(t,e){var i=this;return S(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,y(n.children));}},st=Phaser.Utils.Array,ot={getChildren:function(t){if(t)for(var e=0,i=this.children.length;e=0;e--)this.remove(this.backgroundChildren[e],t);return this}},Ge=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},Ne=/(\S+)\[(\d+)\]/i,Ue=Phaser.Utils.Objects.GetValue,Ke=function(t,e){return void 0===e?t:t[e]},Je=function(t,e,n){void 0===t&&(t={}),void 0===e&&(e=0);var r=i(e);return "string"===r?t[e]=n:"number"===r?(t.left=e,t.right=e,t.top=e,t.bottom=e):(t.left=Ue(e,"left",0),t.right=Ue(e,"right",0),t.top=Ue(e,"top",0),t.bottom=Ue(e,"bottom",0)),t},qe={getInnerPadding:function(t){return Ke(this.space,t)},setInnerPadding:function(t,e){return Je(this.space,t,e),this},getOuterPadding:function(t){return Ke(this.getSizerConfig(this).padding,t)},setOuterPadding:function(t,e){return Je(this.getSizerConfig(this).padding,t,e),this},getChildOuterPadding:function(t,e){return "string"==typeof t&&(t=this.getElement(t)),Ke(this.getSizerConfig(t).padding,e)},setChildOuterPadding:function(t,e,i){return "string"==typeof t&&(t=this.getElement(t)),Je(this.getSizerConfig(t).padding,e,i),this}},Ze=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},$e=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},Qe={getShownChildren:function(t){void 0===t&&(t=[]);for(var e,i=this.children,n=0,r=i.length;n0;){var i=e.shift();i.rexSizer&&i.rexSizer.hidden||(i!==this&&t.push(i),i.isRexContainerLite&&e.push.apply(e,y(i.children)));}return t}},ti=function(){this._childrenWidth=void 0,this._childrenHeight=void 0;for(var t,e=this.getChildrenSizers(),i=0,n=e.length;i0?-this.delay:0,this.state=this.nowTime>=0?wi:Ci,this.repeatCounter=0,this}},{key:"stop",value:function(){return this.state=xi,this}},{key:"update",value:function(t,e){this.state!==xi&&this.state!==Pi&&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=Si)):(this.nowTime=this.duration,this.state=Pi):this.nowTime>=0&&(this.state=wi));}},{key:"t",get:function(){var t;switch(this.state){case xi:case Ci:case Si:t=0;break;case wi:t=this.nowTime/this.duration;break;case Pi:t=1;}return mi(t,0,1)},set:function(t){(t=mi(t,-1,1))<0?(this.state=Ci,this.nowTime=-this.delay*t):(this.state=wi,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===xi}},{key:"isDelay",get:function(){return this.state===Ci}},{key:"isCountDown",get:function(){return this.state===wi}},{key:"isRunning",get:function(){return this.state===Ci||this.state===wi}},{key:"isDone",get:function(){return this.state===Pi}},{key:"isOddIteration",get:function(){return 1==(1&this.repeatCounter)}},{key:"isEvenIteration",get:function(){return 0==(1&this.repeatCounter)}}]),t}(),xi=0,Ci=1,wi=2,Si=3,Pi=-1,Oi=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).timer=new bi,s}return s(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}(gi),Ti=Phaser.Utils.Objects.GetValue,_i=Phaser.Utils.Objects.GetAdvancedValue,Ei=Phaser.Tweens.Builders.GetEaseFunction,Mi=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return s(i,[{key:"resetFromJSON",value:function(t){return this.timer.resetFromJSON(Ti(t,"timer")),this.setEnable(Ti(t,"enable",!0)),this.setTarget(Ti(t,"target",this.parent)),this.setDelay(_i(t,"delay",0)),this.setDuration(_i(t,"duration",1e3)),this.setEase(Ti(t,"ease","Linear")),this.setRepeat(Ti(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=Ei(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}(Oi),Ri=Phaser.Utils.Objects.GetValue,Li=Phaser.Utils.Objects.GetAdvancedValue,Di=Phaser.Math.Linear,Ai=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).scaleStart={},s.scaleEnd={},s.resetFromJSON(r),s.boot(),s}return s(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setMode(Ri(t,"mode",0)),this.setScaleRange(Li(t,"start",void 0),Li(t,"end",0)),this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=zi[t]),this.mode=t,this}},{key:"setScaleRange",value:function(t,e){return "number"==typeof t?(this.startX=t,this.startY=t):(this.startX=Li(t,"x",this.parent.scaleX),this.startY=Li(t,"y",this.parent.scaleY)),"number"==typeof e?(this.endX=e,this.endY=e):(this.endX=Li(e,"x",void 0),this.endY=Li(e,"y",void 0)),this.hasScaleX=void 0!==this.startX&&void 0!==this.endX,this.hasScaleY=void 0!==this.startY&&void 0!==this.endY,this}},{key:"start",value:function(){if(this.timer.isRunning)return this;var t=this.parent;this.hasScaleX&&(t.scaleX=this.startX),this.hasScaleY&&(t.scaleY=this.startY);var e=this.repeat;return 2===this.mode&&-1!==e&&(e=2*(e+1)-1),this.timer.setDelay(this.delay).setDuration(this.duration).setRepeat(e),p(h(i.prototype),"start",this).call(this),this}},{key:"updateGameObject",value:function(t,e){var i=e.t;e.isOddIteration&&(i=1-i),i=this.easeFn(i),this.hasScaleX&&(t.scaleX=Di(this.startX,this.endX,i)),this.hasScaleY&&(t.scaleY=Di(this.startY,this.endY,i));}},{key:"complete",value:function(){return p(h(i.prototype),"complete",this).call(this),1===this.mode&&this.parent.destroy(),this}}]),i}(Mi),zi={stop:0,destroy:1,yoyo:2},Bi=function(t,e,i,n,r){var s,o;switch(void 0===n&&(n="Cubic"),i){case 0:case"x":s={x:0},o={x:t.scaleX};break;case 1:case"y":s={y:0},o={y:t.scaleY};break;default:s=0,o=t.scale;}var a={mode:0,start:s,end:o,duration:e,ease:n};return void 0===r?r=new Ai(t,a):r.resetFromJSON(a),r.restart(),r},Ii=function(t,e,i,n,r,s){void 0===n&&(n="Linear"),r instanceof Ai&&(s=r,r=void 0),void 0===r&&(r=!0);var o={};switch(o.mode=r?1:0,i){case 0:case"x":o.end={x:0};break;case 1:case"y":o.end={y:0};break;default:o.end=0;}return o.duration=e,o.ease=n,void 0===s?s=new Ai(t,o):s.resetFromJSON(o),s.restart(),s},ji=function(t,e){return new Promise((function(i,n){t.once(e,(function(){i();}));}))},Wi=function(t){return ji(t,"complete")},Fi=Phaser.Utils.Objects.IsPlainObject,Yi=function(t,e){e.completeEventName=void 0,e.on("complete",(function(){e.completeEventName&&(t.emit(e.completeEventName,t),e.completeEventName=void 0);})),e.on("update",(function(){var e=Ie.getParentSizer(t);e&&e.resetChildPositionState(t);}));},Xi={popUp:function(t,e,i){if(Fi(t)){var n=t;t=n.duration,e=n.orientation,i=n.ease;}var r=void 0===this._scaleBehavior;return this._scaleBehavior=Bi(this,t,e,i,this._scaleBehavior),r&&Yi(this,this._scaleBehavior),this._scaleBehavior.completeEventName="popup.complete",this},popUpPromise:function(t,e,i){return this.popUp(t,e,i),Wi(this._scaleBehavior)},scaleDownDestroy:function(t,e,i,n){if(Fi(t)){var r=t;t=r.duration,e=r.orientation,i=r.ease,n=r.destroy;}var s=void 0===this._scaleBehavior;return this._scaleBehavior=Ii(this,t,e,i,n,this._scaleBehavior),s&&Yi(this,this._scaleBehavior),this._scaleBehavior.completeEventName="scaledown.complete",this},scaleDownDestroyPromise:function(t,e,i,n){return this.scaleDownDestroy(t,e,i,n),Wi(this._scaleBehavior)},scaleDown:function(t,e,i){return this.scaleDownDestroy(t,e,i,!1),this},scaleDownPromise:function(t,e,i){return this.scaleDown(t,e,i),Wi(this._scaleBehavior)},scaleYoyo:function(t,e,i,n,r){if(Fi(t)){var s=t;t=s.duration,e=s.peakValue,i=s.repeat,n=s.orientation,r=s.ease;}var o=void 0===this._scaleBehavior;return this._scaleBehavior=function(t,e,i,n,r,s,o){var a,h;switch(void 0===i&&(i=1.2),void 0===n&&(n=0),void 0===s&&(s="Cubic"),r){case 0:case"x":a={x:t.scaleX},h={x:i};break;case 1:case"y":a={y:t.scaleX},h={y:i};break;default:a=t.scaleX,h=i;}var l={mode:2,start:a,end:h,duration:e/2,ease:s,repeat:n};return void 0===o?o=new Ai(t,l):o.resetFromJSON(l),o.restart(),o}(this,t,e,i,n,r,this._scaleBehavior),o&&Yi(this,this._scaleBehavior),this._scaleBehavior.completeEventName="scaleyoyo.complete",this},scaleYoyoPromise:function(t,e,i,n,r){return this.scaleYoyo(t,e,i,n,r),Wi(this._scaleBehavior)}},Vi=Phaser.Utils.Objects.GetValue,Hi=Phaser.Utils.Objects.GetAdvancedValue,Gi=Phaser.Math.Linear,Ni=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).resetFromJSON(r),s.boot(),s}return s(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setMode(Vi(t,"mode",0)),this.setAlphaRange(Hi(t,"start",this.parent.alpha),Hi(t,"end",0)),this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=Ui[t]),this.mode=t,this}},{key:"setAlphaRange",value:function(t,e){return this.alphaStart=t,this.alphaEnd=e,this}},{key:"start",value:function(){return this.timer.isRunning||(this.parent.setAlpha(this.alphaStart),this.timer.setDelay(this.delay).setDuration(this.duration).setRepeat(2===this.mode?-1:0),p(h(i.prototype),"start",this).call(this)),this}},{key:"updateGameObject",value:function(t,e){var i=e.t;e.isOddIteration&&(i=1-i),t.alpha=Gi(this.alphaStart,this.alphaEnd,i);}},{key:"complete",value:function(){return p(h(i.prototype),"complete",this).call(this),1===this.mode&&this.parent.destroy(),this}}]),i}(Mi),Ui={stop:0,destroy:1,yoyo:2},Ki=Phaser.Utils.Objects.IsPlainObject,Ji=function(t,e,i,n){var r,s;Ki(i)?(r=i.start,s=i.end):s=i,void 0===r&&(r=0),void 0===s&&(s=1);var o={mode:0,start:r,end:s,duration:e};return void 0===n?n=new Ni(t,o):n.resetFromJSON(o),n.restart(),n},qi=function(t,e,i,n){i instanceof Ni&&(n=i,i=void 0),void 0===i&&(i=!0);var r={mode:i?1:0,end:0,duration:e};return void 0===n?n=new Ni(t,r):n.resetFromJSON(r),n.restart(),n},Zi=Phaser.Utils.Objects.IsPlainObject,$i=function(t,e){e.completeEventName=void 0,e.on("complete",(function(){e.completeEventName&&(t.emit(e.completeEventName,t),e.completeEventName=void 0);})),e.on("update",(function(){var e=Ie.getParentSizer(t);e&&e.resetChildAlphaState(t);}));},Qi={fadeIn:function(t,e){if(Zi(t)){var i=t;t=i.duration,e=i.alpha;}var n=void 0===this._fade;return this._fade=Ji(this,t,e,this._fade),n&&$i(this,this._fade),this._fade.completeEventName="fadein.complete",this},fadeInPromise:function(t,e){return this.fadeIn(t,e),Wi(this._fade)},fadeOutDestroy:function(t,e){if(Zi(t)){var i=t;t=i.duration,e=i.destroy;}var n=void 0===this._fade;return this._fade=qi(this,t,e,this._fade),n&&$i(this,this._fade),this._fade.completeEventName="fadeout.complete",this},fadeOutDestroyPromise:function(t,e){return this.fadeOutDestroy(t,e),Wi(this._fade)},fadeOut:function(t){return this.fadeOutDestroy(t,!1),this},fadeOutPromise:function(t){return this.fadeOut(t),Wi(this._fade)}},tn=Phaser.Utils.Objects.GetValue,en=Phaser.Utils.Objects.GetAdvancedValue,nn=Phaser.Math.Linear,rn=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).resetFromJSON(r),s.boot(),s}return s(i,[{key:"resetFromJSON",value:function(t){if(p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setMode(tn(t,"mode",0)),t&&(t.hasOwnProperty("x")||t.hasOwnProperty("y"))){var e=en(t,"x",void 0),n=en(t,"y",void 0);this.setTargetPosition(e,n);}else this.setTargetPosition(t);return this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=sn[t]),this.mode=t,this}},{key:"setTargetPosition",value:function(t,e){if("number"==typeof t||"number"==typeof e)this.startX=this.parent.x,this.startY=this.parent.y,this.endX=t,this.endY=e;else {var i=t;this.startX=en(i,"startX",void 0),this.startY=en(i,"startY",void 0),this.endX=en(i,"endX",void 0),this.endY=en(i,"endY",void 0);}return this.hasMoveX=void 0!==this.startX&&void 0!==this.endX,this.hasMoveY=void 0!==this.startY&&void 0!==this.endY,this}},{key:"start",value:function(){if(this.timer.isRunning)return this;var t=this.parent;return this.hasMoveX&&(t.x=this.startX),this.hasMoveY&&(t.y=this.startY),this.timer.setDelay(this.delay).setDuration(this.duration).setRepeat(2===this.mode?-1:0),p(h(i.prototype),"start",this).call(this),this}},{key:"updateGameObject",value:function(t,e){var i=e.t;e.isOddIteration&&(i=1-i),i=this.easeFn(i),this.hasMoveX&&(t.x=nn(this.startX,this.endX,i)),this.hasMoveY&&(t.y=nn(this.startY,this.endY,i));}},{key:"complete",value:function(){return p(h(i.prototype),"complete",this).call(this),1===this.mode&&this.parent.destroy(),this}}]),i}(Mi),sn={stop:0,destroy:1,yoyo:2},on=function(t,e){if("number"==typeof t)return t;var i=t[0],n=parseFloat(t.substr(2));switch(i){case"+":return e+n;case"-":return e-n;case"*":return e*n;case"/":return e/n}},an=Phaser.Utils.Objects.IsPlainObject,hn=Phaser.Math.Distance.Between,ln=function(t,e){e.completeEventName=void 0,e.on("complete",(function(){e.completeEventName&&(t.emit(e.completeEventName,t),e.completeEventName=void 0);})),e.on("update",(function(){var e=Ie.getParentSizer(t);e&&e.resetChildPositionState(t);}));},un={moveFrom:function(t,e,i,n,r){if(an(t)){var s=t;e=s.x,i=s.y,t=s.hasOwnProperty("speed")?1e3*hn(e,i,this.x,this.y)/s.speed:s.duration,n=s.ease;}var o=void 0===this._easeMove;return this._easeMove=function(t,e,i,n,r,s,o){s instanceof rn&&(o=s,s=void 0),void 0===s&&(s=!1);var a={};return a.mode=s?1:0,void 0!==i&&(a.startX=on(i,t.x),a.endX=t.x),void 0!==n&&(a.startY=on(n,t.y),a.endY=t.y),a.duration=e,a.ease=void 0===r?"Linear":r,void 0===o?o=new rn(t,a):o.resetFromJSON(a),o.restart(),o}(this,t,e,i,n,r,this._easeMove),o&&ln(this,this._easeMove),this._easeMove.completeEventName="movefrom.complete",this},moveFromPromise:function(t,e,i,n,r){return this.moveFrom(t,e,i,n,r),Wi(this._easeMove)},moveFromDestroy:function(t,e,i,n){return this.moveFrom(t,e,i,n,!0),this},moveFromDestroyPromise:function(t,e,i,n){return this.moveFromDestroy(t,e,i,n),Wi(this._easeMove)},moveTo:function(t,e,i,n,r){if(an(t)){var s=t;e=s.x,i=s.y,t=s.hasOwnProperty("speed")?1e3*hn(e,i,this.x,this.y)/s.speed:s.duration,n=s.ease;}var o=void 0===this._easeMove;return this._easeMove=function(t,e,i,n,r,s,o){s instanceof rn&&(o=s,s=void 0),void 0===s&&(s=!1);var a={};return a.mode=s?1:0,void 0!==i&&(a.startX=t.x,a.endX=on(i,t.x)),void 0!==n&&(a.startY=t.y,a.endY=on(n,t.y)),a.duration=e,a.ease=void 0===r?"Linear":r,void 0===o?o=new rn(t,a):o.resetFromJSON(a),o.restart(),o}(this,t,e,i,n,r,this._easeMove),o&&ln(this,this._easeMove),this._easeMove.completeEventName="moveto.complete",this},moveToPromise:function(t,e,i,n,r){return this.moveTo(t,e,i,n,r),Wi(this._easeMove)},moveToDestroy:function(t,e,i,n){return this.moveTo(t,e,i,n,!0),this},moveToDestroyPromise:function(t,e,i,n){return this.moveToDestroy(t,e,i,n,!0),Wi(this._easeMove)},moveStop:function(t){return this._easeMove?(this._easeMove.stop(t),this):this}},cn=Phaser.Utils.Objects.GetValue,dn=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).timer=new bi,s.resetFromJSON(r),s.boot(),s}return s(i,[{key:"resetFromJSON",value:function(t){return this.timer.resetFromJSON(cn(t,"timer")),this.setEnable(cn(t,"enable",!0)),this.setMode(cn(t,"mode",1)),this.isRunning=cn(t,"isRunning",!1),this.setMagnitudeMode(cn(t,"magnitudeMode",1)),this.setAxisMode(cn(t,"axis",0)),this.setDuration(cn(t,"duration",500)),this.setMagnitude(cn(t,"magnitude",10)),this.ox=cn(t,"ox",void 0),this.oy=cn(t,"oy",void 0),this}},{key:"toJSON",value:function(){return {timer:this.timer.toJSON(),enable:this.enable,mode:this.mode,isRunning:this.isRunning,magnitudeMode:magnitudeMode,duration:this.duration,magnitude:this.magnitude,ox:this.ox,oy:this.oy}}},{key:"shutdown",value:function(t){this.isShutdown||(p(h(i.prototype),"shutdown",this).call(this,t),this.timer.destroy(),this.timer=void 0);}},{key:"startTicking",value:function(){p(h(i.prototype),"startTicking",this).call(this),0===this.mode?(this.scene.game.events.on("poststep",this.update,this),this.scene.game.events.on("prestep",this.backToOrigin,this)):this.scene.sys.events.on("preupdate",this.update,this);}},{key:"stopTicking",value:function(){p(h(i.prototype),"stopTicking",this).call(this),this.scene&&(0===this.mode?(this.scene.game.events.off("poststep",this.update,this),this.scene.game.events.off("prestep",this.backToOrigin,this)):this.scene.sys.events.off("preupdate",this.update,this));}},{key:"setEnable",value:function(t){return null==t&&(t=!0),this.enable=t,this}},{key:"setMode",value:function(t){return "string"==typeof t&&(t=fn[t]),this.mode=t,this}},{key:"setMagnitudeMode",value:function(t){return "string"==typeof t&&(t=vn[t]),this.magnitudeMode=t,this}},{key:"setAxisMode",value:function(t){return "string"==typeof t&&(t=pn[t]),this.axisMode=t,this}},{key:"setDuration",value:function(t){return this.duration=t,this}},{key:"setMagnitude",value:function(t){return this.magnitude=t,this}},{key:"start",value:function(t,e){if("number"!=typeof t){var n=t;e=cn(n,"magnitude",void 0),t=cn(n,"duration",void 0);}return void 0!==e&&this.setMagnitude(e),void 0!==t&&this.setDuration(t),this.timer.setDuration(this.duration).start(),p(h(i.prototype),"start",this).call(this),this}},{key:"shake",value:function(t,e){return this.start(t,e),this}},{key:"update",value:function(t,e){if(!this.isRunning||!this.enable)return this;var i=this.parent;if(!i.active)return this;if(this.timer.update(t,e),this.timer.isDone)this.backToOrigin(),this.complete();else {void 0===this.ox&&(this.ox=i.x,this.oy=i.y);var n=this.magnitude;1===this.magnitudeMode&&(n*=1-this.timer.t);var r=Math.random()*Math.PI*2,s=this.ox+Math.cos(r)*n,o=this.oy+Math.sin(r)*n;switch(this.axisMode){case 1:i.x=s;break;case 2:i.y=o;break;default:i.x=s,i.y=o;}}return this}},{key:"backToOrigin",value:function(){if(!this.isRunning||!this.enable)return this;if(void 0===this.ox)return this;var t=this.parent;switch(this.axisMode){case 1:t.x=this.ox;break;case 2:t.y=this.oy;break;default:t.x=this.ox,t.y=this.oy;}return this.ox=void 0,this.oy=void 0,this}}]),i}(fi),fn={effect:0,behavior:1},pn={both:0,"h&v":0,"x&y":0,horizontal:1,h:1,x:1,vertical:2,v:2,y:2},vn={constant:0,decay:1},gn=Phaser.Utils.Objects.IsPlainObject,yn={shake:function(t,e,i){if(gn(t)){var n=t;t=n.duration,e=n.magnitude,i=n.magnitudeMode;}return void 0===this._shake&&(this._shake=new dn(this,{mode:0,magnitudeMode:1}),function(t,e){e.on("complete",(function(){t.emit("shake.complete",t);}));}(this,this._shake)),void 0!==t&&this._shake.setDuration(t),void 0!==e&&this._shake.setMagnitude(e),void 0!==i&&this._shake.setMagnitudeMode(i),this._shake.shake(),this},shakePromise:function(t,e){return this.shake(t,e),Wi(this._shake)}},kn=Phaser.Utils.Objects.GetValue,mn=Phaser.Math.Linear,bn=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).resetFromJSON(),s.boot(),s}return s(i,[{key:"start",value:function(t){if(this.timer.isRunning)return this;var e=this.target;this.propertyKey=kn(t,"key","value");var n=e[this.propertyKey];return this.fromValue=kn(t,"from",n),this.toValue=kn(t,"to",n),this.setEase(kn(t,"ease",this.ease)),this.setDuration(kn(t,"duration",this.duration)),this.setRepeat(kn(t,"repeat",0)),this.setDelay(kn(t,"delay",0)),this.setRepeatDelay(kn(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]=mn(this.fromValue,this.toValue,i);}}]),i}(Mi),xn=Phaser.Utils.Objects.IsPlainObject,Cn=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).parent.setDataEnabled(),s.easeTasks={},s}return s(i,[{key:"complete",value:function(t){this.emit("complete-".concat(t),this.parent,this),this.emit("complete",t,this.parent,this);}},{key:"getEaseTask",value:function(t){var e=this.easeTasks[t];return void 0===e&&(e=new bn(this.parent),this.easeTasks[t]=e,e.setTarget(this.parent.data.values).on("complete",(function(){this.complete(t);}),this)),e}},{key:"easeTo",value:function(t,e,i,n){if(xn(t)){var r=t;t=r.key,e=r.value,i=r.duration,n=r.ease;var s=r.speed;void 0===i&&void 0!==s&&(i=Math.abs(e-this.parent.data.values[t])/s*1e3);}return void 0===i&&(i=1e3),void 0===n&&(n="Linear"),this.getEaseTask(t).restart({key:t,to:e,duration:i,ease:n}),this}},{key:"easeFrom",value:function(t,e,i,n){if(xn(t)){var r=t;t=r.key,e=r.value,i=r.duration,n=r.ease;var s=r.speed;void 0===i&&void 0!==s&&(i=Math.abs(e-this.parent.data.values[t])/s*1e3);}return void 0===i&&(i=1e3),void 0===n&&(n="Linear"),this.getEaseTask(t).restart({key:t,from:e,duration:i,ease:n}),this}},{key:"stopEase",value:function(t,e){void 0===e&&(e=!0);var i=this.easeTasks[t];return i&&i.stop(e),this}},{key:"stopAll",value:function(t){for(var e in void 0===t&&(t=!0),this.easeTasks)this.stopEase(e,t);return this}}]),i}(ui),wn={easeDataTo:function(t,e,i,n){return this._easeData||(this._easeData=new Cn(this),function(t,e){e.on("complete",(function(e){t.emit("easedata.".concat(e,".complete"),t),t.emit("easedata.complete",e,t);}));}(this,this._easeData)),this._easeData.easeTo(t,e,i,n),this},easeDataToPromise:function(t,e,i,n){return this.easeDataTo(t,e,i,n),ji(this._easeData,"complete-".concat(t))},stopEaseData:function(t,e){return this._easeData?(this._easeData.stopEase(t,e),this):this},stopAllEaseData:function(t){return this._easeData?(this._easeData.stopAll(t),this):this}},Sn=function(t){Tn(t,!1);},Pn=function(t){Tn(t,!0);},On=function(t){return !!t&&!Jt(t).hidden},Tn=function(t,e){if(t){Jt(t).hidden=e;var i=_(t);i?i.setChildVisible(t,!e):t.setVisible(!e);}},_n={show:function(t){return void 0===t&&(t=this),Sn(t),this},hide:function(t){return void 0===t&&(t=this),Pn(t),this},isShow:function(t){return void 0===t&&(t=this),On(t)}};function En(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Mn={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1;}function s(t,e,n,s,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new r(n,s||t,o),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e];}function a(){this._events=new n,this._eventsCount=0;}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},a.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return [];if(n.fn)return [n.fn];for(var r=0,s=n.length,o=new Array(s);r0){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}(jn),Fn={delayCall:function(t,e,i){return this.delayCallTimer=function(t,e,i,n,r){var s=si(t);return s.time.delayedCall(e,(function(){s.game.events.once("poststep",(function(){i.call(n,r);}));}))}(this,t,e,i),this},removeDelayCall:function(){return this.delayCallTimer&&(this.delayCallTimer.remove(!1),this.delayCallTimer=void 0),this}},Yn={setTransitInTime:function(t){return this.transitInTime=t,this},setTransitOutTime:function(t){return this.transitOutTime=t,this},setTransitInCallback:function(t){return t||(t=ie),this.transitInCallback=t,this},setTransitOutCallback:function(t){return t||(t=ie),this.transitOutCallback=t,this}},Xn={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}},Vn={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}},Hn={};Object.assign(Hn,Fn,Yn,Xn,Vn);var Gn=Phaser.Utils.Objects.GetValue,Nn=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).setTransitInTime(Gn(r,"duration.in",200)),s.setTransitOutTime(Gn(r,"duration.out",200)),s.setTransitInCallback(Gn(r,"transitIn")),s.setTransitOutCallback(Gn(r,"transitOut")),s.oneShotMode=Gn(r,"destroy",!1),s.delayCallTimer=void 0,s._state=new Wn(u(s),{eventEmitter:!1,initState:Gn(r,"initState","IDLE")}),s.openEventData=void 0,s.closeEventData=void 0,s}return s(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}(ui);Object.assign(Nn.prototype,Hn);var Un=function(t){a(i,t);var e=d(i);function i(t,r,s){var o;return n(this,i),(o=e.call(this,t,0,0,2,2,r,1)).setAlpha(s),o.setScrollFactor(0),o.boot(),o}return s(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,r=e.height,s=1/i.zoom,o=n/2,a=r/2,h=n*s,l=r*s;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),Kn=Phaser.Utils.Objects.GetValue,Jn=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,{eventEmitter:!1})).resetFromJSON(r),s.boot(),s}return s(i,[{key:"resetFromJSON",value:function(t){return this.setHitAreaMode(Kn(t,"hitAreaMode",0)),this.setEnable(Kn(t,"enable",!0)),this.setStopMode(Kn(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=qn[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}(ui),qn={default:0,fullWindow:1},Zn=Phaser.Utils.Objects.GetValue,$n=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i);var o=Zn(r,"color",0),a=Zn(r,"alpha",.8);return (s=e.call(this,t,o,a)).touchEventStop=new Jn(u(s),{hitAreaMode:1}),s}return s(i)}(Un),Qn=function(t,e){void 0!==t._modalScaleSave?(t.scaleX=t._modalScaleSave,t.scaleY=t._modalScaleSave):t._modalScaleSave=t.scaleX,Bi(t,e);},tr=function(t,e){Ii(t,e,void 0,void 0,!1);},er=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,Ji(t,e);},ir=function(t,e){qi(t,e,!1);},nr=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,Ji(t,e,t.alpha);},rr=function(t,e){qi(t,e,!1);},sr=function(t,e,i,n,r){return !!t&&(!(n&&!n(t,e,i))&&(!!wt(t,!0).contains(e,i)&&!(r&&!r(t,e,i))))},or=Phaser.Utils.Objects.GetValue,ar=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={}),null==r.transitIn&&(r.transitIn=hr.popUp),null==r.transitOut&&(r.transitOut=hr.scaleDown),r.destroy=or(r,"destroy",!0),s=e.call(this,t,r);var o=or(r,"cover");s.cover=!1!==o?function(t,e){var i=t.scene,n=new $n(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,s.cover&&(s.setCoverTransitInCallback(or(o,"transitIn",nr)),s.setCoverTransitOutCallback(or(o,"transitOut",rr)));var a=or(r,"touchOutsideClose",!1),h=or(r,"duration.hold",-1),l=or(r,"timeOutClose",h>=0),c=or(r,"anyTouchClose",!1);return or(r,"manualClose",!1)&&(a=!1,c=!1,l=!1),c&&(a=!1),l?s.setDisplayTime(h):s.setDisplayTime(-1),c?s.once("open",s.anyTouchClose,u(s)):a&&s.once("open",s.touchOutsideClose,u(s)),or(r,"openOnStart",!0)&&s.delayCall(0,s.requestOpen,u(s)),s}return s(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&&sr(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=hr[t]),t){case hr.popUp:t=Qn;break;case hr.fadeIn:t=er;}return p(h(i.prototype),"setTransitInCallback",this).call(this,t),this}},{key:"setTransitOutCallback",value:function(t){switch("string"==typeof t&&(t=hr[t]),t){case hr.scaleDown:t=tr;break;case hr.fadeOut:t=ir;}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}(Nn),hr={popUp:0,fadeIn:1,scaleDown:0,fadeOut:1},lr=function(t){return t&&"function"==typeof t},ur={modal:function(t,e){return lr(t)&&(e=t,t=void 0),void 0===this._modalBehavior&&(this.onCreateModalBehavior&&this.onCreateModalBehavior(this,t),this._modalBehavior=function(t,e){var i=new ar(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}},cr=function(t,e,i,n){if(e)return sr(t,e.worldX,e.worldY,i,n);for(var r=t.scene.input.manager,s=r.pointersTotal,o=r.pointers,a=0;a=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}(ui),Tr={press:0,pointerdown:0,release:1,pointerup:1},_r={onClick:function(t,e,i,n){return t?("function"==typeof t&&(n=i,i=e,e=t,t=this),void 0===t._click&&(t._click=new Or(t,n)),t._click.on("click",e,i),this):this},offClick:function(t,e,i){return "function"==typeof t&&(i=e,e=t,t=this),void 0===t._click||t._click.off("click",e,i),this},enableClick:function(t,e){return t&&"object"!==i(t)&&(e=t,t=this),void 0===t._click||t._click.setEnable(e),this},disableClick:function(t){return t&&"object"!==i(t)&&(t=this),void 0===t._click||t._click.setEnable(!1),this}},Er=function(t,e,i,n){if(e)return !(i&&!i(t,e))&&(!!Mr(t,e)&&!(n&&!n(t,e)));for(var r=t.scene.input.manager,s=r.pointersTotal,o=r.pointers,a=0;a0)return Rr.length=0,!0;return Rr.length=0,!1},Rr=[],Lr=Phaser.Utils.Objects.GetValue,Dr=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),(s=e.call(this,t,r))._enable=void 0;var o=Lr(r,"inputConfig",void 0);return o&&t.setInteractive(o),s.resetFromJSON(r),s.boot(),s}return s(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.lastClickTime=void 0,this.setEnable(Lr(t,"enable",!0)),this.setMode(Lr(t,"mode",1)),this.setClickInterval(Lr(t,"clickInterval",100)),this.setDragThreshold(Lr(t,"threshold",void 0)),this}},{key:"boot",value:function(){var t=this.parent.scene;t.input.on("pointerdown",this.onPress,this),t.input.on("pointerup",this.onRelease,this),t.input.on("pointermove",this.onMove,this);}},{key:"shutdown",value:function(t){if(!this.isShutdown){var e=this.parent.scene;e.input.off("pointerdown",this.onPress,this),e.input.off("pointerup",this.onRelease,this),e.input.off("pointermove",this.onMove,this),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=Ar[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:"isPointerInside",value:function(t){var e=this.parent;return (e.input?Er:cr)(e,t)}},{key:"onPress",value:function(t){this.parent.willRender(t.camera)&&void 0===this.pointer&&(this.pointer=t,0===this.mode&&(this.isPointerInside(t)||this.click(t.downTime,t)));}},{key:"onRelease",value:function(t){this.parent.willRender(t.camera)&&this.pointer===t&&(1===this.mode&&(this.isPointerInside(t)||this.click(t.upTime,t)),this.pointer=void 0);}},{key:"onMove",value:function(t,e,i,n){this.pointer===t&&void 0!==this.dragThreshold&&1===this.mode&&(t.getDistance()>=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}(ui),Ar={press:0,pointerdown:0,release:1,pointerup:1},zr={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 Dr(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}},Br=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 s(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}(jn),Ir=Phaser.Utils.Objects.GetValue,jr=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r))._enable=void 0,s.cooldown=new Br,s.parent.setInteractive(Ir(r,"inputConfig",void 0)),s.resetFromJSON(r),s.boot(),s}return s(i,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.prevIsInTouch=!1,this.isInTouching=!1,this.setEnable(Ir(t,"enable",!0)),this.setCooldown(Ir(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}(ui),Wr={isPointerInBounds:function(t){return void 0===t?t=this:"string"==typeof t&&(t=this.getElement(t)),!!t&&cr(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 jr(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 jr(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}},Fr=function(t,e,i){for(var n,r=0,s=t.length;r0),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=is,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===ns&&this.onDragEnd(),this.pointer=void 0,this.tracerState=is,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=rs,this}}]),i}(fi),is=0,ns=1,rs="IDLE",ss=Phaser.Utils.Objects.GetValue,os=Phaser.Math.Distance.Between,as=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i);var o=u(s=e.call(this,t,r)),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=hs;},eventEmitter:!1};return s.setRecongizedStateObject(new jn(a)),s}return s(i,[{key:"resetFromJSON",value:function(t){p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setHoldTime(ss(t,"time",250)),this.setTapInterval(ss(t,"tapInterval",200)),this.setDragThreshold(ss(t,"threshold",9)),this.setTapOffset(ss(t,"tapOffset",10));var e=ss(t,"taps",void 0);return void 0!==e?this.setTaps(e):(this.setMaxTaps(ss(t,"maxTaps",void 0)),this.setMinTaps(ss(t,"minTaps",void 0))),this}},{key:"onDragStart",value:function(){switch(this.state){case hs:this.state=ls;break;case ls:var t=this.lastPointer;os(t.upX,t.upY,t.x,t.y)>this.tapOffset&&(this.state=us,this.state=ls);break;case us:this.state=ls;}}},{key:"onDragEnd",value:function(){this.state===ls&&(this.tapsCount++,this.emit("tapping",this,this.gameObject,this.lastPointer),void 0!==this.maxTaps&&this.tapsCount===this.maxTaps&&(this.state=us));}},{key:"onDrag",value:function(){this.state!==hs&&this.pointer.getDistance()>this.dragThreshold&&(this.state=hs);}},{key:"preUpdate",value:function(t,e){if(this.isRunning&&this.enable&&this.state===ls){var i=this.lastPointer;if(i.isDown)t-i.downTime>this.holdTime&&(this.state=hs);else t-i.upTime>this.tapInterval&&(void 0===this.minTaps||this.tapsCount>=this.minTaps?this.state=us:this.state=hs);}}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===us&&(this.state=hs);}},{key:"isTapped",get:function(){return this.state===us}},{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}(es),hs="IDLE",ls="BEGIN",us="RECOGNIZED",cs=Phaser.Utils.Objects.GetValue,ds=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i);var o=u(s=e.call(this,t,r)),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=fs;},eventEmitter:!1};return s.setRecongizedStateObject(new jn(a)),s}return s(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(cs(t,"threshold",9)),this.setHoldTime(cs(t,"time",251)),this}},{key:"onDragStart",value:function(){this.state=ps,0===this.holdTime&&(this.state=vs);}},{key:"onDragEnd",value:function(){this.state=fs;}},{key:"onDrag",value:function(){this.state!==fs&&this.pointer.getDistance()>this.dragThreshold&&(this.state=fs);}},{key:"preUpdate",value:function(t,e){this.isRunning&&this.enable&&(this.state===ps&&t-this.pointer.downTime>=this.holdTime&&(this.state=vs));}},{key:"isPressed",get:function(){return this.state===vs}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(es),fs="IDLE",ps="BEGIN",vs="RECOGNIZED";Phaser.Utils.Objects.GetValue;var gs=function(t){return hi(t).loop.delta},ys=Phaser.Math.Distance.Between,ks=Phaser.Math.Angle.Between,ms={getDt:function(){return gs(this.scene)},getVelocity:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return ys(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 ks(e.x,e.y,t.x,t.y)}},bs={"up&down":0,"left&right":1,"4dir":2,"8dir":3},xs={},Cs=Phaser.Utils.Objects.GetValue,ws=Phaser.Math.RadToDeg,Ss=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i);var o=u(s=e.call(this,t,r)),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=Ps;},eventEmitter:!1};return s.setRecongizedStateObject(new jn(a)),s.clearDirectionStates(),s}return s(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Cs(t,"threshold",10)),this.setVelocityThreshold(Cs(t,"velocityThreshold",1e3)),this.setDirectionMode(Cs(t,"dir","8dir")),this}},{key:"onDragStart",value:function(){this.state=Os;}},{key:"onDragEnd",value:function(){this.state=Ps;}},{key:"onDrag",value:function(){this.state===Os&&(this.validDrag||(this.validDrag=0===this.dragThreshold||this.pointer.getDistance()>=this.dragThreshold),this.validDrag&&this.dragVelocity>this.velocityThreshold&&(this.state=Ts));}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===Ts&&(this.state=Ps);}},{key:"isSwiped",get:function(){return this.state===Ts}},{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=bs[t]),this.dirMode=t,this}},{key:"updateDirectionStates",value:function(){return function(t,e,i){switch(void 0===i?i={}:!0===i&&(i=xs),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;}}(ws(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}(es);Object.assign(Ss.prototype,ms);var Ps="IDLE",Os="BEGIN",Ts="RECOGNIZED",_s=Phaser.Utils.Objects.GetValue,Es=Phaser.Utils.Array.SpliceOne,Ms=Phaser.Math.Distance.Between,Rs=Phaser.Math.Angle.Between,Ls=function(){function t(e,i){n(this,t);var r=e.input.manager.pointersTotal-1;r<2&&e.input.addPointer(2-r),this.scene=e,this.setEventEmitter(_s(i,"eventEmitter",void 0)),this._enable=void 0,this.pointers=[],this.movedState={},this.resetFromJSON(i),this.boot();}return s(t,[{key:"resetFromJSON",value:function(t){return this.setEnable(_s(t,"enable",!0)),this.bounds=_s(t,"bounds",void 0),this.tracerState=As,this.pointers.length=0,Dt(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,Dt(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 As:this.tracerState=zs,this.onDrag1Start();break;case zs:this.tracerState=Bs,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],Es(this.pointers,e),this.tracerState){case zs:this.tracerState=As,this.onDrag1End();break;case Bs:this.tracerState=zs,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 zs:this.onDrag1();break;case Bs:this.onDrag2();}}}},{key:"dragCancel",value:function(){return this.tracerState===Bs&&this.onDrag2End(),this.pointers.length=0,Dt(this.movedState),this.tracerState=As,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!==Bs)return 0;var t=this.pointers[0],e=this.pointers[1];return Ms(t.x,t.y,e.x,e.y)}},{key:"angleBetween",get:function(){if(this.tracerState!==Bs)return 0;var t=this.pointers[0],e=this.pointers[1];return Rs(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;Ds.x=e.x-i.x,Ds.y=e.y-i.y;}else Ds.x=0,Ds.y=0;return Ds}},{key:"centerX",get:function(){if(this.tracerState!==Bs)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!==Bs)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!==Bs)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!==Bs)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=Is,this}}]),t}();Object.assign(Ls.prototype,ii);var Ds={},As=0,zs=1,Bs=2,Is="IDLE";Phaser.Utils.Objects.GetValue;var js=Phaser.Math.RotateAround,Ws=function(t,e,i,n){return js(t,e,i,n),t.rotation+=n,t},Fs={},Ys=Phaser.Utils.Objects.GetValue,Xs=Phaser.Math.Angle.WrapDegrees,Vs=Phaser.Math.Angle.ShortestBetween,Hs=Phaser.Math.RadToDeg,Gs=Phaser.Math.DegToRad,Ns=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i);var o=u(s=e.call(this,t,r)),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=Ks;},eventEmitter:!1};return s.setRecongizedStateObject(new jn(a)),s}return s(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Ys(t,"threshold",0)),this}},{key:"onDrag2Start",value:function(){this.prevAngle=Xs(Hs(this.angleBetween)),this.state=Js,0===this.dragThreshold&&(this.state=qs);}},{key:"onDrag2End",value:function(){this.state=Ks;}},{key:"onDrag2",value:function(){switch(this.state){case Js:if(this.pointers[0].getDistance()>=this.dragThreshold&&this.pointers[1].getDistance()>=this.dragThreshold){var t=Xs(Hs(this.angleBetween));this.angle=Vs(this.prevAngle,t),this.prevAngle=t,this.state=qs;}break;case qs:t=Xs(Hs(this.angleBetween));this.angle=Vs(this.prevAngle,t),this.prevAngle=t,this.emit("rotate",this);}}},{key:"isRotated",get:function(){return this.state===qs}},{key:"rotation",get:function(){return Gs(this.angle)}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(Ls),Us={spinObject:function(t,e){if(!this.isRotation)return this;void 0===e&&(e=this.pointers[0].camera);var i=this.movementCenterX,n=this.movementCenterY,r=function(t,e,i,n){return void 0===n?n={}:!0===n&&(n=Fs),i.getWorldPoint(t,e,n),n}(this.centerX,this.centerY,e,!0),s=r.x,o=r.y,a=this.rotation;if(Array.isArray(t))for(var h=t,l=0,u=h.length;l=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?kt(t):h:t.minHeight=void 0===l?mt(t):l),s&&(0===this.orientation?t.minHeight=l:t.minWidth=h)),void 0!==o&&this.addChildrenMap(o,t),this},ko={add:yo,addSpace:function(t){return this.insertSpace(void 0,t),this},insertSpace:function(t,e){return void 0===e&&(e=1),yo.call(this,new uo(this.scene),{proportion:e,minWidth:0,minHeight:0,index:t}),this},insert:function(t,e,i,n,r,s,o,a){return fo(i)&&(i.index=t),yo.call(this,e,i,n,r,s,o,t,a),this},insertAtPosition:function(t,e,i,n,r,s,o,a,h){var l=co.call(this,t,e);return -1===l&&(l=void 0),this.insert(l,i,n,r,s,o,a,h),this}},mo=Kt.prototype.clear,bo=function(t){this.backgroundChildren&&(this.backgroundChildren.length=0);var e,i=!t&&this.sizerEventsEnable;if(i&&(e=this.getChildren([])),mo.call(this,t),i)for(var n,r=0,s=e.length;r=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,bo.call(this,t),this}},wo={getChildAlign:function(t){return this.getSizerConfig(t).align},setChildAlign:function(t,e){return "string"==typeof e&&(e=ee[e]),this.getSizerConfig(t).align=e,this}},So={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);var e,i,n,r=0,s=this.sizerChildren;if(0===this.orientation)for(var o=this.space.item,a=!0,h=0,l=s.length;h0&&this.proportionLength>0&&(i=n.proportion*this.proportionLength):n.expand&&(i=e-this.space.left-this.space.right-r.left-r.right);return i},getExpandedChildHeight:function(t,e){var i;void 0===e&&(e=this.height);var n=t.rexSizer,r=n.padding;0===this.orientation?n.expand&&(i=e-this.space.top-this.space.bottom-r.top-r.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,r=i.length;n0?(e=t-this.getChildrenWidth(!1),this.proportionLength=e/this.childrenProportion):this.proportionLength=0;}return t},resolveHeight:function(t){t=$e.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(So,ko,Co,wo,{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 Po=function(){for(var t,e,i=0,n=this.sizerChildren,r=0,s=n.length;r0&&(i+=e);return i},Oo={x:0,h:0,horizontal:0,"left-to-right":0,y:1,v:1,vertical:1,"top-to-bottom":1},To=function(t){return "string"==typeof t&&(t=Oo[t]),t},_o=Phaser.Utils.Objects.IsPlainObject,Eo=Phaser.Utils.Objects.GetValue,Mo=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h,l){var u;return n(this,i),_o(r)?(r=Eo(l=r,"x",0),s=Eo(l,"y",0),o=Eo(l,"width",void 0),a=Eo(l,"height",void 0),h=Eo(l,"orientation",0)):_o(o)?(o=Eo(l=o,"width",void 0),a=Eo(l,"height",void 0),h=Eo(l,"orientation",0)):_o(h)&&(h=Eo(l=h,"orientation",0)),void 0===h&&(h=0),(u=e.call(this,t,r,s,o,a,l)).type="rexSizer",u.sizerChildren=[],u.setOrientation(h),u.setItemSpacing(Eo(l,"space.item",0)),u.setStartChildIndex(Eo(l,"startChildIndex",0)),u.setRTL(Eo(l,"rtl",!1)),u.addChildrenMap("items",u.sizerChildren),u}return s(i,[{key:"setOrientation",value:function(t){return this.orientation=To(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=Po.call(this)),this._childrenProportion}}]),i}(ao);Object.assign(Mo.prototype,So);var Ro=Phaser.Utils.Array.GetFirst,Lo=Phaser.Utils.Array.Remove,Do=function(t,e,i){if(t){var n=null==e,r=null==i;return n&&r||(n||(t.displayWidth=e),r||(t.displayHeight=i),n&&(t.scaleX=t.scaleY),r&&(t.scaleY=t.scaleX)),t}},Ao=function(t,e){var i;return t||0===t||(t=""),void 0===e&&(e=!0),Array.isArray(t)&&(t=t.join("\n")),(i=e?"".concat(this.text,"\n").concat(t):"".concat(this.text).concat(t))!=this.text&&this.setText(i),this},zo={appendText:Ao,resetDisplayContent:function(t){void 0===t?t={}:"string"==typeof t&&(t={text:t});var e=t.text||"";this.setText(e);var i=this.childrenMap.icon;if(i){t.icon?this.show(i):this.hide(i);var n=t.iconSize;n&&(this.setChildDisplaySize(i,n,n),void 0!==this.iconWidth&&this.setIconSize(n)),!0!==t.icon&&this.setIconTexture(t.icon,t.iconFrame);}var r=this.childrenMap.action;if(r){t.action?this.show(r):this.hide(r);var s=t.actionSize;s&&(this.setChildDisplaySize(r,s,s),void 0!==this.actionWidth&&this.setActionSize(s)),!0!==t.action&&this.setActionTexture(t.action,t.actionFrame);}return this}},Bo=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return s(i,[{key:"text",get:function(){var t=this.childrenMap.text;return t?t.text:""},set:function(t){var e=this.childrenMap.text;e&&e.setText(t);}},{key:"setText",value:function(t){return this.text=t,this}},{key:"setIconTexture",value:function(t,e){var i=this.childrenMap.icon;return i?(i.setTexture(t,e),void 0!==this.iconWidth&&(Do(i,this.iconWidth,this.iconHeight),this.resetChildScaleState(i)),this):this}},{key:"setTexture",value:function(t,e){return this.setIconTexture(t,e),this}},{key:"setIconSize",value:function(t,e){return void 0===e&&(e=t),this.iconWidth=t,this.iconHeight=e,this}},{key:"texture",get:function(){var t=this.childrenMap.icon;if(t)return t.texture}},{key:"frame",get:function(){var t=this.childrenMap.icon;if(t)return t.frame}},{key:"setActionTexture",value:function(t,e){var i=this.childrenMap.action;return void 0===i||(i.setTexture(t,e),void 0!==this.actionWidth&&(Do(i,this.actionWidth,this.actionHeight),this.resetChildScaleState(i))),this}},{key:"actionTexture",get:function(){var t=this.childrenMap.action;if(t)return t.texture}},{key:"actionFrame",get:function(){var t=this.childrenMap.action;if(t)return t.frame}},{key:"setActionSize",value:function(t,e){return void 0===e&&(e=t),this.actionWidth=t,this.actionHeight=e,this}},{key:"preLayout",value:function(){var t=this.childrenMap.icon;t&&void 0!==this.iconWidth&&Do(t,this.iconWidth,this.iconHeight);var e=this.childrenMap.action;e&&void 0!==this.actionWidth&&Do(e,this.actionWidth,this.actionHeight),p(h(i.prototype),"preLayout",this).call(this);}},{key:"runLayout",value:function(t,e,n){if(this.ignoreLayout)return this;p(h(i.prototype),"runLayout",this).call(this,t,e,n);var r=this.childrenMap.iconMask;r&&(r.setPosition(),this.resetChildPositionState(r));var s=this.childrenMap.actionMask;return s&&(s.setPosition(),this.resetChildPositionState(s)),this}},{key:"resize",value:function(t,e){p(h(i.prototype),"resize",this).call(this,t,e);var n=this.childrenMap.iconMask;n&&n.resize();var r=this.childrenMap.actionMask;return r&&r.resize(),this}}]),i}(Mo);Object.assign(Bo.prototype,zo);var Io=function(t,e,i,n,r){if(this.clear().fillStyle(16777215),1===this.shapeType){i=i.left;var s=Math.min(t,e)/2;this.fillCircle(-t*(n-.5),-e*(r-.5),s+i);}else this.fillRect(-t*n-i.left,-e*r-i.top,t+i.left+i.right,e+i.top+i.bottom);},jo=function(t,e){for(var i in t){if(!(i in e))return !1;if(t[i]!==e[i])return !1}for(var i in e)if(!(i in t))return !1;return !0},Wo=function(t){a(i,t);var e=d(i);function i(t,r,s){var o;return n(this,i),void 0===r&&(r=0),"string"==typeof r&&(r=Fo[r]),(o=e.call(this,t.scene)).parent=t,o.shapeType=r,o.padding=Le(s),o.setPosition().resize().setVisible(!1),o}return s(i,[{key:"destroy",value:function(){return this.parent=void 0,p(h(i.prototype),"destroy",this).call(this),this}},{key:"setPosition",value:function(t,e){var n=this.parent;return void 0===t&&(t=n.x),void 0===e&&(e=n.y),p(h(i.prototype),"setPosition",this).call(this,t,e),this}},{key:"resize",value:function(t,e,i){var n=this.parent;void 0===t&&(t=n.width),void 0===e&&(e=n.height),void 0===i?i=this.padding:"number"==typeof i&&(i=Le(i));var r=this.width!==t||this.height!==e,s=this.padding!==i&&!jo(this.padding,i);return r||s?(this.width=t,this.height=e,s&&At(i,this.padding),this.originX=n.originX,this.originY=n.originY,Io.call(this,t,e,i,n.originX,n.originY),this):this}},{key:"setOrigin",value:function(t,e){void 0===e&&(e=t);var i=this.parent;return void 0===t&&(t=i.originX),void 0===e&&(e=i.originY),this.originX===t&&this.originY===e||(this.originX=t,this.originY=e,Io.call(this,this.width,this.height,this.padding,t,e)),this}}]),i}(Phaser.GameObjects.Graphics),Fo={rectangle:0,circle:1},Yo=function(t,e,i,n){var r=new Wo(e,i,n);if(t&&!t.isRexSizer){var s=r.createGeometryMask();t.setMask(s),this.once("destroy",(function(){t.setMask(),s.destroy();}));}return this.pin(r),r},Xo=Phaser.Utils.Objects.GetValue,Vo=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),(s=e.call(this,t,r)).type="rexLabel";var o=Xo(r,"background",void 0),a=Xo(r,"icon",void 0),h=Xo(r,"iconMask",void 0),l=Xo(r,"text",void 0),c=Xo(r,"action",void 0),d=Xo(r,"actionMask",void 0),f=Xo(r,"align",void 0);if(o&&s.addBackground(o),"right"!==f&&"bottom"!==f&&"center"!==f||s.addSpace(),a){0===s.orientation?(l||c)&&(x={right:Xo(r,"space.icon",0),top:Xo(r,"space.iconTop",0),bottom:Xo(r,"space.iconBottom",0),left:Xo(r,"space.iconLeft",0)}):(l||c)&&(x={bottom:Xo(r,"space.icon",0),left:Xo(r,"space.iconLeft",0),right:Xo(r,"space.iconRight",0),top:Xo(r,"space.iconTop",0)});var p=Xo(r,"squareFitIcon",!1)?1:0;if(s.add(a,{proportion:0,padding:x,fitRatio:p}),h&&(h=Yo.call(u(s),a,a,1)),!p){var v=Xo(r,"iconSize",void 0);s.setIconSize(Xo(r,"iconWidth",v),Xo(r,"iconHeight",v));}}if(l){var g,y,k=Xo(r,"space.text",0),m=Xo(r,"expandTextWidth",!1),b=Xo(r,"expandTextHeight",!1);0===s.orientation?(g=m?1:0,c&&(x={right:k}),y=b):(g=b?1:0,c&&(x={bottom:k}),y=m),s.add(l,{proportion:g,expand:y,padding:x});}if(c){var x;x=0===s.orientation?{top:Xo(r,"space.actionTop",0),bottom:Xo(r,"space.actionBottom",0),right:Xo(r,"space.actionRight",0)}:{left:Xo(r,"space.actionLeft",0),right:Xo(r,"space.actionRight",0),bottom:Xo(r,"space.actionBottom",0)};p=Xo(r,"squareFitAction",!1)?1:0;if(s.add(c,{proportion:0,padding:x,fitRatio:p}),d&&(d=Yo.call(u(s),c,c,1)),!p){var C=Xo(r,"actionSize");s.setActionSize(Xo(r,"actionWidth",C),Xo(r,"actionHeight",C));}}return "center"===f&&s.addSpace(),s.addChildrenMap("background",o),s.addChildrenMap("icon",a),s.addChildrenMap("iconMask",h),s.addChildrenMap("text",l),s.addChildrenMap("action",c),s.addChildrenMap("actionMask",d),s}return s(i)}(Bo),Ho=function t(e){var n,r,s;if(null==e||"object"!==i(e))return e;if(n=Array.isArray(e)?[]:{},function(t){if("object"!==i(t)||t.nodeType||t===t.window)return !1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return !1}catch(t){return !1}return !0}(e))for(s in e)r=e[s],n[s]=t(r);else n=e;return n},Go=function(t){return null==t||""===t||0===t.length},No=function(t,e,n,r){if(void 0===r&&(r="."),"object"===i(t)){if(Go(e)){if(null==n)return;"object"===i(n)&&(t=n);}else {"string"==typeof e&&(e=e.split(r));var s=e.pop(),o=function(t,e,n){var r=t;if(Go(e));else {var s;"string"==typeof e&&(e=e.split("."));for(var o=0,a=e.length;o=0||t.y>=0,t.x=Math.abs(t.x),t.y=Math.abs(t.y);},$o=function(t,e,i){var n=i.length;if(n>=2){var r=i[n-2],s=i[n-1];if(t===r&&e===s)return i}return i.push(t,e),i},Qo=Phaser.Math.DegToRad,ta=function(t,e,i,n,r,s,o,a,h){o&&s>r?s-=360:!o&&s>>16,a=(65280&r)>>>8,h=255&r;t.fillStyle="rgba("+o+","+a+","+h+","+s+")";},aa=function(t,e,i,n){var r=i||e.strokeColor,s=n||e.strokeAlpha,o=(16711680&r)>>>16,a=(65280&r)>>>8,h=255&r;t.strokeStyle="rgba("+o+","+a+","+h+","+s+")",t.lineWidth=e.lineWidth;},ha=Phaser.Renderer.Canvas.SetTransform,la={renderWebGL:function(t,e,i,n){e.dirty&&(e.updateData(),e.dirty=!1),i.addToRenderList(e);var r=t.pipelines.set(e.pipeline),s=sa(e,i,n),o=r.calcMatrix.copyFrom(s.calc),a=e._displayOriginX,h=e._displayOriginY,l=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&ia(r,o,e,l,a,h),e.isStroked&&ra(r,e,l,a,h),t.pipelines.postBatch(e);},renderCanvas:function(t,e,i,n){e.dirty&&(e.updateData(),e.dirty=!1),i.addToRenderList(e);var r=t.currentContext;if(ha(t,r,e,i,n)){var s=e._displayOriginX,o=e._displayOriginY,a=e.pathData,h=a.length-1,l=a[0]-s,u=a[1]-o;r.beginPath(),r.moveTo(l,u),e.closePath||(h-=2);for(var c=2;c0;}},{key:"fillAlpha",get:function(){return this._fillAlpha},set:function(t){this._fillAlpha=t,this.isFilled=t>0&&null!=this._fillColor;}},{key:"setFillStyle",value:function(t,e){return void 0===e&&(e=1),this.fillColor=t,this.fillAlpha=e,this}},{key:"strokeColor",get:function(){return this._strokeColor},set:function(t){this._strokeColor=t,this.isStroked=null!=t&&this._strokeAlpha>0&&this._lineWidth>0;}},{key:"strokeAlpha",get:function(){return this._strokeAlpha},set:function(t){this._strokeAlpha=t,this.isStroked=t>0&&null!=this._strokeColor&&this._lineWidth>0;}},{key:"lineWidth",get:function(){return this._lineWidth},set:function(t){this._lineWidth=t,this.isStroked=t>0&&null!=this._strokeColor;}},{key:"setStrokeStyle",value:function(t,e,i){return void 0===i&&(i=1),this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this}},{key:"updateData",value:function(){var t=this.geom,e=this.pathData;e.length=0;var i,n=t.width,r=t.height,s=t.cornerRadius,o=this.iteration+1;if(i=s.tl,va(i))if(i.convex){var a=i.x,h=i.y;ta(a,h,i.x,i.y,180,270,!1,o,e);}else {ta(a=0,h=0,i.x,i.y,90,0,!0,o,e);}else $o(0,0,e);if(i=s.tr,va(i))if(i.convex){a=n-i.x,h=i.y;ta(a,h,i.x,i.y,270,360,!1,o,e);}else {ta(a=n,h=0,i.x,i.y,180,90,!0,o,e);}else $o(n,0,e);if(i=s.br,va(i))if(i.convex){a=n-i.x,h=r-i.y;ta(a,h,i.x,i.y,0,90,!1,o,e);}else {ta(a=n,h=r,i.x,i.y,270,180,!0,o,e);}else $o(n,r,e);if(i=s.bl,va(i))if(i.convex){a=i.x,h=r-i.y;ta(a,h,i.x,i.y,90,180,!1,o,e);}else {ta(a=0,h=r,i.x,i.y,360,270,!0,o,e);}else $o(0,r,e);return e.push(e[0],e[1]),this.pathIndexes=fa(e),this}},{key:"setShapeType",value:function(t){return "string"==typeof t&&(t=ga[t]),this.shapeType=t,this}},{key:"width",get:function(){return this.geom.width},set:function(t){this.resize(t,this.height);}},{key:"height",get:function(){return this.geom.height},set:function(t){this.resize(this.width,t);}},{key:"setSize",value:function(t,e){if(void 0===e&&(e=t),this.geom.width===t&&this.geom.height===e)return this;this.geom.setSize(t,e),1===this.shapeType&&this.setRadius({x:t/2,y:e/2}),this.updateDisplayOrigin(),this.dirty=!0;var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this}},{key:"resize",value:function(t,e){return this.setSize(t,e),this}},{key:"radius",get:function(){return this.geom.radius},set:function(t){this.geom.setRadius(t),this.updateDisplayOrigin(),this.dirty=!0;}},{key:"radiusTL",get:function(){return this.geom.radiusTL},set:function(t){this.geom.radiusTL=t,this.dirty=!0;}},{key:"radiusTR",get:function(){return this.geom.radiusTR},set:function(t){this.geom.radiusTR=t,this.dirty=!0;}},{key:"radiusBL",get:function(){return this.geom.radiusBL},set:function(t){this.geom.radiusBL=t,this.dirty=!0;}},{key:"radiusBR",get:function(){return this.geom.radiusBR},set:function(t){this.geom.radiusBR=t,this.dirty=!0;}},{key:"setRadius",value:function(t){return void 0===t&&(t=0),this.radius=t,this}},{key:"setRadiusTL",value:function(t){return void 0===t&&(t=0),this.radiusTL=t,this}},{key:"setRadiusTR",value:function(t){return void 0===t&&(t=0),this.radiusTR=t,this}},{key:"setRadiusBL",value:function(t){return void 0===t&&(t=0),this.radiusBL=t,this}},{key:"setRadiusBR",value:function(t){return void 0===t&&(t=0),this.radiusBR=t,this}},{key:"cornerRadius",get:function(){return this.geom.cornerRadius},set:function(t){this.radius=t;}},{key:"setCornerRadius",value:function(t){return this.setRadius(t)}},{key:"iteration",get:function(){return this._iteration},set:function(t){void 0!==this._iteration?this._iteration!==t&&(this._iteration=t,this.dirty=!0):this._iteration=t;}},{key:"setIteration",value:function(t){return void 0===t&&(t=6),this.iteration=t,this}}]),i}(ua),va=function(t){return t.x>0&&t.y>0},ga={rectangle:0,circle:1};Object.assign(pa.prototype,la);var ya=function(t,e,i,n){if(void 0===i&&(i="."),void 0===n&&(n={}),!t)return n;if(e in t)return Object.assign(n,t[e]);for(var r in e+=i,t)r.startsWith(e)&&(n[r.replace(e,"")]=t[r]);return n},ka=function(t,e,i){if(void 0===i&&(i={}),Array.isArray(e))for(var n=0,r=e.length;n=6?(n=[arguments[2],void 0,arguments[3]],r=[arguments[4],void 0,arguments[5]]):(n=Ho(n),r=Ho(r)),this.textureKey=t,this.baseFrameName=e,this.columns.data=n,this.columns.count=n?n.length:0,this.columns.stretch=0,this.columns.minWidth=0,this.columns.scale=1,this.rows.data=r,this.rows.count=r?r.length:0,this.rows.stretch=0,this.rows.minHeight=0,this.rows.scale=1;var s=this.scene.sys.textures.get(t);if(!s)return this.clear(),this;if(!n||!r)return this.clear(),this;for(var o=s.get(e),a=o.width,h=0,l=0,u=n.length;l0?0:g,b=0;l=0;for(var S=n.length;l0?0:y),y>=1&&g>=1){var P=i(k=this.getFrameNameCallback(l,C,e));"string"!==P&&"number"!==P||s.add(k,0,b+o.cutX,x+o.cutY,y,g);}b+=y;}x+=g;}return this.updateTexture(),this},updateTexture:function(){if(this.clear(),void 0===this.textureKey)return this;var t=this.scene.sys.textures.get(this.textureKey);if(!t)return this;var e,i,n,r,s,o,a,h=this.columns.minWidth*this.maxFixedPartScaleX,l=this.rows.minHeight*this.maxFixedPartScaleY,u=this.width-h,c=this.height-l,d=u>=0?this.maxFixedPartScaleX:this.width/h,f=c>=0?this.maxFixedPartScaleY:this.height/l;if(this.preserveRatio){var p=Math.min(d,f);if(d>p){var v=(d-p)*h;u>=0?u+=v:u=v,d=p;}if(f>p){var g=(f-p)*l;c>=0?c+=g:c=g,f=p;}}this.columns.scale=d,this.rows.scale=f,e=u>0&&this.columns.stretch>0?u/this.columns.stretch:0,i=c>0&&this.rows.stretch>0?c/this.rows.stretch:0;var y=0,k=0;this._beginDraw();for(var m=0,b=this.rows.count;m0&&a>0&&(0===(0===s.stretch&&0===r.stretch||0===this.getStretchMode(x,m)?0:1)?this._drawImage(this.textureKey,n,y,k,o,a):this._drawTileSprite(this.textureKey,n,y,k,o,a)),y+=o;k+=a;}this._endDraw();},setStretchMode:function(t){return Ya(t)?(this.stretchMode.edge=Va(Xa(t,"edge",0)),this.stretchMode.internal=Va(Xa(t,"internal",0))):(t=Va(t),this.stretchMode.edge=t,this.stretchMode.internal=t),this},getStretchMode:function(t,e){return Ga.call(this,t,e)?this.stretchMode.edge:this.stretchMode.internal},setPreserveRatio:function(t){return null==t&&(t=!0),this.preserveRatio=t,this},setMaxFixedPartScale:function(t,e){return void 0===e&&(e=t),this.maxFixedPartScaleX=t,this.maxFixedPartScaleY=e,this}},Ua=Phaser.Utils.Objects.IsPlainObject,Ka=Phaser.Utils.Objects.GetValue,Ja=Phaser.GameObjects,qa=void 0,Za=function(t,e){if(qa||(qa={},hi(t).events.once("destroy",(function(){for(var t in qa)qa[t].destroy();qa=void 0;}))),!qa.hasOwnProperty(e)){var i=hi(t).scene.systemScene;(t=new Ja[e](i)).setOrigin(0),qa[e]=t;}return qa[e]},$a=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return s(i)}(function(t,e){var i=function(t){a(r,t);var i=d(r);function r(t,s,o,a,h,l,u,c,d,f){var p;if(n(this,r),Ua(s)?(s=Ka(f=s,"x",0),o=Ka(f,"y",0),a=Ka(f,"width",1),h=Ka(f,"height",1),l=Ka(f,"key",void 0),u=Ka(f,"baseFrame",void 0),c=Ka(f,"columns",void 0),d=Ka(f,"rows",void 0)):Ua(a)?(a=Ka(f=a,"width",1),h=Ka(f,"height",1),l=Ka(f,"key",void 0),u=Ka(f,"baseFrame",void 0),c=Ka(f,"columns",void 0),d=Ka(f,"rows",void 0)):Ua(l)?(l=Ka(f=l,"key",void 0),u=Ka(f,"baseFrame",void 0),c=Ka(f,"columns",void 0),d=Ka(f,"rows",void 0)):Ua(u)?(u=Ka(f=u,"baseFrame",void 0),c=Ka(f,"columns",void 0),d=Ka(f,"rows",void 0)):Array.isArray(u)?(f=d,d=c,c=u,u=Ka(f,"baseFrame",void 0)):Ua(c)&&(c=Ka(f=c,"columns",void 0),d=Ka(f,"rows",void 0)),void 0===c){var v=Ka(f,"leftWidth",void 0),g=Ka(f,"rightWidth",void 0);void 0!==v&&void 0!==g&&(c=[v,void 0,g]);}if(void 0===d){var y=Ka(f,"topHeight",void 0),k=Ka(f,"bottomHeight",void 0);void 0!==y&&void 0!==k&&(d=[y,void 0,k]);}(p=i.call(this,t)).type=e,p.setPosition(s,o).setSize(a,h).setOrigin(.5,.5),p.columns={},p.rows={},p.stretchMode={},p._tileSprite=void 0,p._image=void 0,p.setGetFrameNameCallback(Ka(f,"getFrameNameCallback",void 0)),p.setStretchMode(Ka(f,"stretchMode",0)),p.setPreserveRatio(Ka(f,"preserveRatio",!0));var m=Ka(f,"maxFixedPartScale",1),b=Ka(f,"maxFixedPartScaleX",m),x=Ka(f,"maxFixedPartScaleY",void 0);return p.setMaxFixedPartScale(b,x),p.setBaseTexture(l,u,c,d),p}return s(r,[{key:"minWidth",get:function(){return this.columns.minWidth}},{key:"minHeight",get:function(){return this.rows.minHeight}},{key:"fixedPartScaleX",get:function(){return this.columns.scale}},{key:"fixedPartScaleY",get:function(){return this.rows.scale}},{key:"resize",value:function(t,e){return this.width===t&&this.height===e||(p(h(r.prototype),"resize",this)?p(h(r.prototype),"resize",this).call(this,t,e):p(h(r.prototype),"setSize",this).call(this,t,e),this.updateTexture()),this}}]),r}(t);return Object.assign(i.prototype,Na),i}(Phaser.GameObjects.RenderTexture,"rexNinePatch")),Qa={_drawImage:function(t,e,i,n,r,s){var o=Za(this,"Image").setTexture(t,e).setDisplaySize(r,s);this.draw(o,i,n);},_drawTileSprite:function(t,e,i,n,r,s){var o=Za(this,"TileSprite").setTexture(t,e).setSize(r,s);this.draw(o,i,n);}};Object.assign($a.prototype,Qa);var th=function(t,e){var i,n;switch(e&&(e.hasOwnProperty("type")?i=e.type:e.hasOwnProperty("leftWidth")?i="nineSlice":e.hasOwnProperty("key")&&(i="image")),i){case"image":n=new Wa(t,e);break;case"nineSlice":n=e.hasOwnProperty("stretchMode")?new $a(t,e):new za(t,e);break;default:n=new Sa(t,e);}return t.add.existing(n),n},eh=Phaser.GameObjects.Text,ih=Phaser.Utils.Objects.GetValue,nh=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={});var o=ih(r,"x",0),a=ih(r,"y",0),h=ih(r,"text","");return (s=e.call(this,t,o,a,h,r)).type="rexStatesText",r.style=s.style,r.onModifyStyle=function(t,e){var i=e.hasOwnProperty("fontStyle")||e.hasOwnProperty("fontSize")||e.hasOwnProperty("fontFamily");t.style.update(i);},s.addStyleManager(r),delete r.style,s}return s(i)}(eh);Object.assign(nh.prototype,wa); /** * @author Richard Davey * @copyright 2019 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var ih=Phaser.Renderer.WebGL.Utils,nh={renderWebGL:function(t,e,i,n){if(0!==e.width&&0!==e.height){i.addToRenderList(e);var r=e.frame,s=r.width,o=r.height,a=ih.getTintAppendFloatAlpha,h=t.pipelines.set(e.pipeline,e),l=h.setTexture2D(r.glTexture,e);t.pipelines.preBatch(e),h.batchTexture(e,r.glTexture,s,o,e.x,e.y,s/e.style.resolution,o/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,s,o,a(e.tintTopLeft,i.alpha*e._alphaTL),a(e.tintTopRight,i.alpha*e._alphaTR),a(e.tintBottomLeft,i.alpha*e._alphaBL),a(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,0,0,i,n,!1,l),t.pipelines.postBatch(e);}},renderCanvas:function(t,e,i,n){0!==e.width&&0!==e.height&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,n));}},rh=Phaser.Display.Canvas.CanvasPool;x();var sh=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return s(i,[{key:"setStyle",value:function(t){return this.style.setStyle(t)}},{key:"setFont",value:function(t){return this.style.setFont(t)}},{key:"setFontFamily",value:function(t){return this.style.setFontFamily(t)}},{key:"setFontSize",value:function(t){return this.style.setFontSize(t)}},{key:"setFontStyle",value:function(t){return this.style.setFontStyle(t)}},{key:"setTestString",value:function(t){return this.style.setTestString(t)}},{key:"setFixedSize",value:function(t,e){return this.style.setFixedSize(t,e)}},{key:"setBackgroundColor",value:function(t,e,i){return this.style.setBackgroundColor(t,e,i)}},{key:"setBackgroundStrokeColor",value:function(t,e){return this.style.setBackgroundStrokeColor(t,e)}},{key:"setBackgroundCornerRadius",value:function(t,e){return this.style.setBackgroundCornerRadius(t,e)}},{key:"setFill",value:function(t){return this.style.setFill(t)}},{key:"setColor",value:function(t){return this.style.setColor(t)}},{key:"setStroke",value:function(t,e){return this.style.setStroke(t,e)}},{key:"setShadow",value:function(t,e,i,n,r,s){return this.style.setShadow(t,e,i,n,r,s)}},{key:"setShadowOffset",value:function(t,e){return this.style.setShadowOffset(t,e)}},{key:"setShadowColor",value:function(t){return this.style.setShadowColor(t)}},{key:"setShadowBlur",value:function(t){return this.style.setShadowBlur(t)}},{key:"setShadowStroke",value:function(t){return this.style.setShadowStroke(t)}},{key:"setShadowFill",value:function(t){return this.style.setShadowFill(t)}},{key:"setWrapMode",value:function(t){return this.style.setWrapMode(t)}},{key:"setWrapWidth",value:function(t){return this.style.setWrapWidth(t)}},{key:"setWordWrapWidth",value:function(t){return this.style.setWrapWidth(t)}},{key:"setAlign",value:function(t){return this.style.setHAlign(t)}},{key:"setHAlign",value:function(t){return this.style.setHAlign(t)}},{key:"setVAlign",value:function(t){return this.style.setVAlign(t)}},{key:"setLineSpacing",value:function(t){return this.style.setLineSpacing(t)}},{key:"lineSpacing",get:function(){return this.style.lineSpacing},set:function(t){this.setLineSpacing(t);}},{key:"setXOffset",value:function(t){return this.style.setXOffset(t)}},{key:"setMaxLines",value:function(t){return this.style.setMaxLines(t)}},{key:"setResolution",value:function(t){return this.style.setResolution(t)}},{key:"getTextMetrics",value:function(){return this.style.getTextMetrics()}},{key:"setTextMetrics",value:function(t,e){return this.style.setTextMetrics(t,e)}},{key:"measureTextMargins",value:function(t,e){return function(t,e,i){void 0===i&&(i={});var n=rh.create(this),r=n.getContext("2d",{willReadFrequently:!0});t.syncFont(n,r);var s=r.measureText(e),o=Math.ceil(s.width*t.baselineX),a=o,h=2*a;if(a=a*t.baselineY|0,n.width=o,n.height=h,r.fillStyle="#f00",r.fillRect(0,0,o,h),r.font=t._font,r.textBaseline="alphabetic",r.fillStyle="#000",r.fillText(t.testString,0,a),i.left=0,0===o||0===h||!r.getImageData(0,0,o,h))return rh.remove(n),i;for(var l=r.getImageData(0,0,o,h).data,u=!1,c=0;ch;u--){for(c=0;c0&&this.wrapMode!==ph&&0===this.wrapWidth}},{key:"setStyle",value:function(t,e,i){if(void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("wrap")){var n=t.wrap;if(n.hasOwnProperty("mode")){var r=n.mode;"string"==typeof r&&(n.mode=Ch[r]);}else n.hasOwnProperty("width")&&(n.mode=1);}t&&t.rtl&&i&&!t.hasOwnProperty("halign")&&(t.halign="right"),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px");var s=this.propertyMap;for(var o in s){var a=s[o],h=a[0],l=i?a[1]:this[o],u=a[2];if("wrapCallback"===o||"wrapCallbackScope"===o)this[o]=bh(t,h,l);else {var c=mh(t,h,l);u&&(c=u(c)),this[o]=c;}}var d=bh(t,"font",null);this._font=null===d?this.fontStyle+" "+this.fontSize+" "+this.fontFamily:d;var f=bh(t,"fill",null);null!==f&&(this.color=hh(f));var v=bh(t,"metrics",!1);return v?this.metrics={ascent:bh(v,"ascent",0),descent:bh(v,"descent",0),fontSize:bh(v,"fontSize",0)}:!e&&this.metrics||(this.metrics=ch(this)),e?this.parent.updateText():this.parent}},{key:"syncFont",value:function(t,e){e.font=this._font;}},{key:"syncStyle",value:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round";}},{key:"syncShadow",value:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0);}},{key:"update",value:function(t){return t&&(this._font="".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily).trim(),this.metrics=ch(this)),this.parent.updateText(t)}},{key:"buildFont",value:function(){var t="".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily).trim();return t!==this._font&&(this._font=t),this}},{key:"setFont",value:function(t){return "string"==typeof t?(this.fontFamily=t,this.fontSize="",this.fontStyle=""):(this.fontFamily=bh(t,"fontFamily","Courier"),this.fontSize=bh(t,"fontSize","16px"),this.fontStyle=bh(t,"fontStyle","")),this.update(!0)}},{key:"setFontFamily",value:function(t){return this.fontFamily=t,this.update(!0)}},{key:"setFontStyle",value:function(t){return this.fontStyle=t,this.update(!0)}},{key:"setFontSize",value:function(t){return "number"==typeof t&&(t=t.toString()+"px"),this.fontSize=t,this.update(!0)}},{key:"setTestString",value:function(t){return this.testString=t,this.update(!0)}},{key:"setFixedSize",value:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(this.isWrapFitMode)}},{key:"setResolution",value:function(t){return this.resolution=t,this.update(!1)}},{key:"setLineSpacing",value:function(t){return this.lineSpacing=t,this.update(!1)}},{key:"setXOffset",value:function(t){return this.xOffset=t,this.update(!1)}},{key:"setBackgroundColor",value:function(t,e,i){return void 0===i&&(i=!0),this.backgroundColor=hh(t,this.parent.canvas,this.parent.context),this.backgroundColor2=hh(e,this.parent.canvas,this.parent.context),this.backgroundHorizontalGradient=i,this.update(!1)}},{key:"setBackgroundStrokeColor",value:function(t,e){return this.backgroundStrokeColor=hh(t,this.parent.canvas,this.parent.context),this.backgroundStrokeLineWidth=e,this.update(!1)}},{key:"setBackgroundCornerRadius",value:function(t,e){return this.backgroundCornerRadius=t,this.backgroundCornerIteration=e,this.update(!1)}},{key:"setFill",value:function(t){return this.color=hh(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setColor",value:function(t){return this.color=hh(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setStroke",value:function(t,e){return void 0===t?this.strokeThickness=0:(void 0===e&&(e=this.strokeThickness),this.stroke=hh(t,this.parent.canvas,this.parent.context),this.strokeThickness=e),this.update(!0)}},{key:"setShadow",value:function(t,e,i,n,r,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===r&&(r=!1),void 0===s&&(s=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=hh(i,this.parent.canvas,this.parent.context),this.shadowBlur=n,this.shadowStroke=r,this.shadowFill=s,this.update(!1)}},{key:"setShadowOffset",value:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)}},{key:"setShadowColor",value:function(t){return void 0===t&&(t="#000"),this.shadowColor=hh(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setShadowBlur",value:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)}},{key:"setShadowStroke",value:function(t){return this.shadowStroke=t,this.update(!1)}},{key:"setShadowFill",value:function(t){return this.shadowFill=t,this.update(!1)}},{key:"setUnderline",value:function(t,e,i){return void 0===t&&(t="#000"),void 0===e&&(e=0),void 0===i&&(i=0),this.underlineColor=hh(t,this.parent.canvas,this.parent.context),this.underlineThickness=e,this.underlineOffset=i,this.update(!1)}},{key:"setUnderlineColor",value:function(t){return void 0===t&&(t="#000"),this.underlineColor=hh(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setUnderlineThickness",value:function(t){return void 0===t&&(t=0),this.underlineThickness=t,this.update(!1)}},{key:"setUnderlineOffset",value:function(t){return void 0===t&&(t=0),this.underlineOffset=t,this.update(!1)}},{key:"setStrikethrough",value:function(t,e,i){return void 0===t&&(t="#000"),void 0===e&&(e=0),void 0===i&&(i=0),this.strikethroughColor=hh(t,this.parent.canvas,this.parent.context),this.strikethroughThickness=e,this.strikethroughOffset=i,this.update(!1)}},{key:"setStrikethroughColor",value:function(t){return void 0===t&&(t="#000"),this.strikethroughColor=hh(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setStrikethroughThickness",value:function(t){return void 0===t&&(t=0),this.strikethroughThickness=t,this.update(!1)}},{key:"setStrikethroughOffset",value:function(t){return void 0===t&&(t=0),this.strikethroughOffset=t,this.update(!1)}},{key:"setWrapMode",value:function(t){return "string"==typeof t&&(t=Ch[t.toLowerCase()]||0),this.wrapMode=t,this.update(!0)}},{key:"setWrapWidth",value:function(t){return this.wrapWidth=t,this.update(!1)}},{key:"setAlign",value:function(t,e){return void 0===t&&(t="left"),void 0===e&&(e="top"),this.halign=t,this.valign=e,this.update(!1)}},{key:"setHAlign",value:function(t){return void 0===t&&(t="left"),this.halign=t,this.update(!1)}},{key:"setVAlign",value:function(t){return void 0===t&&(t="top"),this.valign=t,this.update(!1)}},{key:"setMaxLines",value:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)}},{key:"getTextMetrics",value:function(){var t=this.metrics;return {ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}}},{key:"setTextMetrics",value:function(t,e){return this.metrics.ascent=t.ascent,this.metrics.descent=t.descent,this.metrics.fontSize=t.fontSize,e&&("string"==typeof e?(this.fontFamily=e,this.fontSize="",this.fontStyle=""):(this.fontFamily=bh(e,"fontFamily",this.fontFamily),this.fontSize=bh(e,"fontSize",this.fontSize),this.fontStyle=bh(e,"fontStyle",this.fontStyle))),this.parent.updateText(!0)}},{key:"lineHeight",get:function(){return this.metrics.fontSize+this.strokeThickness+this.lineSpacing}},{key:"toJSON",value:function(){var t={},e=this.propertyMap;for(var i in e)t[i]=this[i];return t.metrics=this.getTextMetrics(),t}},{key:"destroy",value:function(){this.parent=void 0;}}]),t}(),Ch={none:ph,word:gh,char:yh,character:yh},wh=Phaser.Math.DegToRad,Sh=function(t){return !t.hasOwnProperty("convex")||t.convex},Ph=function(t){return t.x>0&&t.y>0},Oh=function(t,e,i,n,r,s,o,a,h){if(a&&o>s?o-=360:!a&&o=f?1:n/f,g=r>=v?1:r/v,y=d.cornerRadius;t.save(),t.beginPath(),t.translate(e,i),a=y.tl,Ph(a)?(h=a.x*p,l=a.y*g,Sh(a)?Oh(t,h,l,h,l,180,270,!1,o):Oh(t,0,0,h,l,90,0,!0,o),u=0,c=l):(t.lineTo(0,0),u=0,c=0),a=y.tr,Ph(a)?(h=a.x*p,l=a.y*g,Sh(a)?Oh(t,n-h,l,h,l,270,360,!1,o):Oh(t,n,0,h,l,180,90,!0,o)):t.lineTo(n,0),a=y.br,Ph(a)?(h=a.x*p,l=a.y*g,Sh(a)?Oh(t,n-h,r-l,h,l,0,90,!1,o):Oh(t,n,r,h,l,270,180,!0,o)):t.lineTo(n,r),a=y.bl,Ph(a)?(h=a.x*p,l=a.y*g,Sh(a)?Oh(t,h,r-l,h,l,90,180,!1,o):Oh(t,0,r,h,l,360,270,!0,o)):t.lineTo(0,r),t.lineTo(u,c),t.closePath(),t.restore();}(e,i,n,r,s,o,d),null!=a){var f;if(null!=u)(f=c?e.createLinearGradient(0,0,r,0):e.createLinearGradient(0,0,0,s)).addColorStop(0,a),f.addColorStop(1,u),a=f;e.fillStyle=a,e.fill();}null!=h&&l>0&&(e.strokeStyle=h,e.lineWidth=l,e.stroke());},_h=function(t,e,i,n,r,s,o,a){if(null!=e||null!=i){var h=t.canvas.width,l=t.canvas.height;null==i&&(n=0);var u=n/2;h=Math.max(1,h-n),l=Math.max(1,l-n),Th(t.canvas,t.context,u,u,h,l,r,e,i,n,s,o,a);}},Eh={draw:function(t,e,i,n){var r=this.penManager;this.hitAreaManager.clear();var s=this.context;s.save();var o=this.defaultStyle;this.clear(),_h(this,o.backgroundColor,o.backgroundStrokeColor,o.backgroundStrokeLineWidth,o.backgroundCornerRadius,o.backgroundColor2,o.backgroundHorizontalGradient,o.backgroundCornerIteration),t+=this.startXOffset,e+=this.startYOffset;var a,h,l,u,c,d,f=o.halign,v=o.valign,p=o.lineHeight,g=r.lines,y=g.length,k=o.maxLines;k>0&&y>k?(h=k,l="center"===v?Math.floor((y-h)/2):"bottom"===v?y-h:0):(h=y,l=0),u=l+h;var m=this.rtl,b=m?this.parent.width:void 0;d="center"===v?Math.max((n-h*p)/2,0):"bottom"===v?Math.max(n-h*p-2,0):0,d+=e;for(var x=l;x0&&t.width>0){var a=i+o.underlineOffset-o.underlineThickness/2;this.drawLine(e,a,t.width,o.underlineThickness,o.underlineColor,o);}if(t.isTextPen&&this.drawText(e,i,t.text,o),t.isImagePen&&this.drawImage(e,i,t.prop.img,o),o.strikethroughThickness>0&&t.width>0){a=i+o.strikethroughOffset-o.strikethroughThickness/2;this.drawLine(e,a,t.width,o.strikethroughThickness,o.strikethroughColor,o);}if(s.restore(),t.hasAreaMarker&&t.width>0){var h,l=t.prop.area;if(l)h={key:l};else {var u=t.prop.url;h={key:"url:".concat(u),url:u};}this.hitAreaManager.add(e,i-this.startYOffset,t.width,this.defaultStyle.lineHeight,h);}},clear:function(){var t=this.canvas;this.context.clearRect(0,0,t.width,t.height);},drawLine:function(t,e,i,n,r,s){this.autoRound&&(t=Math.round(t),e=Math.round(e));var o=this.context;s.syncShadow(o,s.shadowStroke);var a=o.lineCap;o.lineCap="butt",o.strokeStyle=r,o.lineWidth=n,o.beginPath(),o.moveTo(t,e),o.lineTo(t+i,e),o.stroke(),o.lineCap=a;},drawText:function(t,e,i,n){this.autoRound&&(t=Math.round(t),e=Math.round(e));var r=this.context;n.stroke&&"none"!==n.stroke&&n.strokeThickness>0&&(n.syncShadow(r,n.shadowStroke),r.strokeText(i,t,e)),n.color&&"none"!==n.color&&(n.syncShadow(r,n.shadowFill),r.fillText(i,t,e));},drawImage:function(t,e,i,n){e-=this.startYOffset,this.parent.imageManager.draw(i,this.context,t,e,this.autoRound);}},Mh=Phaser.Utils.Objects.GetValue,Rh=dh,Lh=fh,Dh=function(){function t(e){n(this,t),this.prop={},this.resetFromJSON(e);}return s(t,[{key:"resetFromJSON",value:function(t){this.text=Mh(t,"text",""),this.x=Mh(t,"x",0),this.y=Mh(t,"y",0),this.width=Mh(t,"width",0);var e=Mh(t,"prop",null);null===e&&(e={}),this.prop=e,this.newLineMode=Mh(t,"newLineMode",0),this.startIndex=Mh(t,"startIndex",0);}},{key:"plainText",get:function(){var t=this.text;return this.newLineMode===Lh&&(t+="\n"),t}},{key:"wrapText",get:function(){var t=this.text;return this.newLineMode!==Rh&&(t+="\n"),t}},{key:"rawTextLength",get:function(){var t=this.text.length;return this.newLineMode===Lh&&(t+=1),t}},{key:"endIndex",get:function(){return this.startIndex+this.rawTextLength}},{key:"lastX",get:function(){return this.x+this.width}},{key:"isTextPen",get:function(){return ""!==this.text}},{key:"isImagePen",get:function(){return !!this.prop.img}},{key:"hasAreaMarker",get:function(){return !!this.prop.area||!!this.prop.url}}]),t}(),Ah=Phaser.Utils.Objects.GetFastValue,zh=dh,Bh=vh,jh=function(){function t(e){n(this,t),this.pens=[],this.lines=[],this.maxLinesWidth=void 0,this.pensPool=e.pensPool,this.linesPool=e.linesPool,this.tagToText=Ah(e,"tagToText",ie),this.tagToTextScope=Ah(e,"tagToTextScope",void 0);}return s(t,[{key:"destroy",value:function(){this.clear(),this.tagToText=void 0,this.tagToTextScope=void 0;}},{key:"clear",value:function(){for(var t=0,e=this.lines.length;t=this.lines.length)return this.getLineEndIndex(t);var e=this.lines[t];return e&&e[0]?e[0].startIndex:0}},{key:"getLineEndIndex",value:function(t){t>=this.lines.length&&(t=this.lines.length-1);var e,i,n=!1;for(e=t;e>=0&&!(n=null!=(i=this.lines[e])&&i.length>0);e--);return n?i[i.length-1].endIndex:0}},{key:"getLineWidth",value:function(t){var e=this.lines[t];if(!e)return 0;var i=e[e.length-1];return null==i?0:i.lastX}},{key:"getMaxLineWidth",value:function(){if(void 0!==this.maxLinesWidth)return this.maxLinesWidth;for(var t,e=0,i=0,n=this.lines.length;ie&&(e=t);return this.maxLinesWidth=e,e}},{key:"getLineWidths",value:function(){for(var t=[],e=0,i=this.lines.length;e=t&&h<=e||(o=o.substring(t-a,e-a)),this.tagToTextScope?c+=this.tagToText.call(this.tagToTextScope,o,l,u):c+=this.tagToText(o,l,u),u=l,!(h>=e)));d++);return c}},{key:"length",get:function(){return this.lines.length},set:function(t){this.clear();}}]),t}(),Wh={},Ih=function(){function t(){n(this,t),this.items=[];}return s(t,[{key:"destroy",value:function(){this.clear(),this.items=void 0;}},{key:"pop",value:function(){return this.items.length>0?this.items.pop():null}},{key:"push",value:function(t){return this.items.push(t),this}},{key:"pushMultiple",value:function(t){return this.items.push.apply(this.items,t),t.length=0,this}},{key:"clear",value:function(){return this.items.length=0,this}}]),t}(),Fh=Phaser.Geom.Rectangle,Yh=new Ih,Xh=function(){function t(){n(this,t),this.hitAreas=[];}return s(t,[{key:"destroy",value:function(){this.clear();}},{key:"clear",value:function(){for(var t=0,e=this.hitAreas.length;tr){""!==S?a.push(o.getLine(S,P,Kh)):0===T&&s>0&&a.push(o.getLine("",0,Kh)),a.push.apply(a,y(t(b,i,$h,r,0,o)));var E=a.pop();S=E.text,P=E.width,o.freeLine(E)," "===S&&(S="",P=0);}else (w=P+x)>l?(a.push(o.getLine(S,P,Kh)),S=b,P=x,l=r):(S+=b,P=w),C&&a.push(o.getLine(S,P,u));}return a},el=Phaser.Utils.Objects.GetValue,il=ph,nl=dh,rl=function(){function t(e){n(this,t),this.parent=e.parent,this.scene=this.parent.scene,this.context=el(e,"context",null),this.canvas=this.context.canvas,this.parser=el(e,"parser",null),this.defaultStyle=el(e,"style",null),this.autoRound=!0,this.pensPool=e.pensPool,this.linesPool=e.linesPool,this.wrapTextLinesPool=e.wrapTextLinesPool,this.penManager=this.newPenManager(),this._tmpPenManager=null,this.hitAreaManager=new Xh,this.lastHitAreaKey=null,this.urlTagCursorStyle=null;var i=this.context;this.getTextWidth=function(t){return i.measureText(t).width};}return s(t,[{key:"destroy",value:function(){this.parent=void 0,this.scene=void 0,this.context=void 0,this.canvas=void 0,this.parser=void 0,this.defaultStyle=void 0,this.penManager&&(this.penManager.destroy(),this.penManager=void 0),this._tmpPenManager&&(this._tmpPenManager.destroy(),this._tmpPenManager=void 0),this.hitAreaManager&&(this.hitAreaManager.destroy(),this.hitAreaManager=void 0),this.pensPool=void 0,this.linesPool=void 0,this.wrapTextLinesPool=void 0;}},{key:"updatePenManager",value:function(t,e,i,n,r){if(void 0===r&&(r=this.penManager),r.clear(),""===t)return r;var s=this.parent.style;if(s.isWrapFitMode){var o=this.parent.padding;i=s.fixedWidth-o.left-o.right;}for(var a,h,l,u,c,d=this.canvas,f=this.context,v=function(t){return f.measureText(t).width},p=0,g=0,y=s.wrapCallback,k=s.wrapCallbackScope,m=!0,b=this.parser.splitText(t),x=this.wrapTextLinesPool,C=0,w=b.length;C0&&e!==il&&i0&&t>e&&(t=e),t}},{key:"linesWidth",get:function(){return Math.ceil(this.penManager.getMaxLineWidth())}},{key:"linesHeight",get:function(){var t=this.desplayLinesCount,e=this.defaultStyle.lineHeight*t;return t>0&&(e-=this.defaultStyle.lineSpacing),e}},{key:"imageManager",get:function(){return this.parent.imageManager}},{key:"rtl",get:function(){return this.parent.style.rtl}},{key:"newPenManager",value:function(){return new jh({pensPool:this.pensPool,linesPool:this.linesPool,tagToText:this.parser.propToTagText,tagToTextScope:this.parser})}},{key:"tmpPenManager",get:function(){return null===this._tmpPenManager&&(this._tmpPenManager=this.newPenManager()),this._tmpPenManager}},{key:"getPlainText",value:function(t,e,i){var n;if(null==t)n=this.penManager.plainText;else {var r=this.parser.splitText(t,1);n="";for(var s=0,o=r.length;s0}},{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}(au);Object.assign(Tu.prototype,wu);var _u=function(t,e,i){return e.hasOwnProperty(t)?e[t]:i[t]},Eu=Phaser.Utils.Objects.GetValue,Mu=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,"background")).setScrollFactor(0),s.setColor(Eu(r,"color",null),Eu(r,"color2",null),Eu(r,"horizontalGradient",!0)),s.setStroke(Eu(r,"stroke",null),Eu(r,"strokeThickness",2)),s.setCornerRadius(Eu(r,"cornerRadius",0),Eu(r,"cornerIteration",null)),s}return s(i,[{key:"color",get:function(){return this._color},set:function(t){t=hh(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=hh(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=hh(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,_u("color2",t,this),_u("horizontalGradient",t,this)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,_u("strokeThickness",t,this)),t.hasOwnProperty("cornerRadius")&&this.setCornerRadius(t.cornerRadius,_u("cornerIteration",t,this)),this}},{key:"modifyPorperties",value:function(t){return v(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(){_h(this.parent,this.color,this.stroke,this.strokeThickness,this.cornerRadius,this.color2,this.horizontalGradient,this.cornerIteration);}}]),i}(Tu),Ru=Phaser.Utils.Objects.GetValue,Lu=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,"innerbounds")).setScrollFactor(0),s.setColor(Ru(r,"color",null),Ru(r,"color2",null),Ru(r,"horizontalGradient",!0)),s.setStroke(Ru(r,"stroke",null),Ru(r,"strokeThickness",2)),s}return s(i,[{key:"color",get:function(){return this._color},set:function(t){t=hh(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=hh(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=hh(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){v(h(i.prototype),"modifyPorperties",this).call(this,t),t.hasOwnProperty("color")&&this.setColor(t.color,Ru(t,"color2",null),Ru(t,"horizontalGradient",!0)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,Ru(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,r=this.parent.height-t.top-t.bottom,s=this.context;if(null!=this.color){var o,a;if(null!=this.color2)(a=this.horizontalGradient?s.createLinearGradient(0,0,n,0):s.createLinearGradient(0,0,0,r)).addColorStop(0,this.color),a.addColorStop(1,this.color2),o=a;else o=this.color;s.fillStyle=o,s.fillRect(e,i,n,r);}null!=this.stroke&&this.strokeThickness>0&&(s.strokeStyle=this.stroke,s.lineWidth=this.strokeThickness,s.strokeRect(e,i,n,r));}}]),i}(Tu),Du=Phaser.Utils.Objects.GetValue,Au=function(){function t(e,i){n(this,t),this.parent=e,this.set(i);}return s(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(Du(t,"bold",!1)),this.setItalic(Du(t,"italic",!1)),this.setFontSize(Du(t,"fontSize","16px")),this.setFontFamily(Du(t,"fontFamily","Courier")),this.setColor(Du(t,"color","#fff")),this.setStrokeStyle(Du(t,"stroke",null),Du(t,"strokeThickness",0)),this.setShadow(Du(t,"shadowColor",null),Du(t,"shadowOffsetX",0),Du(t,"shadowOffsetY",0),Du(t,"shadowBlur",0)),this.setOffset(Du(t,"offsetX",0),Du(t,"offsetY",0)),this.setSpace(Du(t,"leftSpace",0),Du(t,"rightSpace",0)),this.setAlign(Du(t,"align",void 0)),this.setBackgroundColor(Du(t,"backgroundColor",null)),this.setBackgroundHeight(Du(t,"backgroundHeight",void 0)),this.setBackgroundBottomY(Du(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(_u("stroke",t,this),_u("strokeThickness",t,this)),t.hasOwnProperty("shadowColor")&&this.setShadowColor(t.shadowColor),(t.hasOwnProperty("shadowOffsetX")||t.hasOwnProperty("shadowOffsetY"))&&this.setShadowOffset(_u("shadowOffsetX",t,this),_u("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=hh(t),this}},{key:"hasFill",get:function(){return null!=this.color}},{key:"setStrokeStyle",value:function(t,e){return this.stroke=hh(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=hh(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=hh(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}(),zu=Phaser.Utils.Array.Remove,Bu=Phaser.Utils.Array.Remove,ju="text",Wu="image",Iu="drawer",Fu="space",Yu="command",Xu=function(t){return t.type===ju&&"\n"===t.text},Vu=function(t){return t.type===ju&&"\f"===t.text},Gu=function(t){return t.type===ju},Hu=function(t){a(i,t);var e=d(i);function i(t,r,s){var o;return n(this,i),(o=e.call(this,t,ju)).updateTextFlag=!1,o.style=new Au(u(o),s),o.setText(r),o}return s(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),v(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&&v(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,r=e.backgroundBottomY;null==r&&(r=this.drawBLY);var s=e.backgroundHeight;null==s&&(s=r-this.drawTLY);var o=r-s;t.fillRect(i,o,n,s);}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}(Tu),Nu=function(t,e){var i=this.createCharChildren(t,e);return this.addChild(i),this},Uu=function(t){a(i,t);var e=d(i);function i(t,r,s){var o;return n(this,i),(o=e.call(this,t,Wu)).setTexture(r,s),o}return s(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}(Tu),Ju=function(t){a(i,t);var e=d(i);function i(t,r,s,o){var a;return n(this,i),(a=e.call(this,t,Iu)).setRenderCallback(r),a.setDrawerSize(s,o),a}return s(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(){v(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}(Tu),Ku=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,Fu)).setSpaceWidth(r),s}return s(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}(Tu),qu=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a){var h;return n(this,i),(h=e.call(this,t,Yu)).setName(r).setParameter(o).setCallback(s,a),h}return s(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(){v(h(i.prototype),"onFree",this).call(this),this.setName().setCallback().setParameter();}}]),i}(au),Zu=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)},$u=function(t,e,i,n){void 0===n&&(n={word:[],width:0}),n.word.length=0;for(var r=t.length,s=e,o=n.word,a=0;s0&&!a){var h=this.fixedHeight-n;if(i>0)s=h/i;else s=(l=ec.call(this)).height,o=l.ascent,i=Math.floor((h-o)/s);}else {var l;s=(l=ec.call(this)).height,o=l.ascent;}}else if(this.fixedHeight>0){if(void 0===(i=nc(t,"maxLines"))){h=this.fixedHeight-n;i=Math.floor(h/s);}}else i=nc(t,"maxLines",0);void 0===o&&(o=s);var u=0===i,c=nc(t,"wrapWidth",void 0);void 0===c&&(c=this.fixedWidth>0?this.fixedWidth-r:1/0);for(var d=nc(t,"letterSpacing",0),f=nc(t,"hAlign",0),v=nc(t,"vAlign",0),p=nc(t,"charWrap",!1),g=Zu({callback:"runWordWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:f,vAlign:v,ascent:o,lineHeight:s,wrapWidth:c,charWrap:p}),y=this.children,k=0,m=y.length;k0&&(_.push({children:E,width:M}),R=Math.max(R,M)),g.start+=T.length,g.isLastPage=!L&&g.start===O,g.maxLineWidth=R,g.linesHeight=_.length*s;var I=this.fixedWidth>0?this.fixedWidth:g.maxLineWidth+r,F=this.fixedHeight>0?this.fixedHeight:g.linesHeight+n;!function(t,e,i){var n,r,s=t.hAlign,o=t.vAlign,a=t.linesHeight;switch(o){case 1:case"center":r=(i-a)/2;break;case 2:case"bottom":r=i-a;break;default:r=0;}for(var h=t.lines,l=0,u=h.length;l0?(o=this.fixedWidth-r)/i:0;else if(this.fixedWidth>0){if(void 0===(i=oc(t,"maxLines",void 0))){var o=this.fixedWidth-r;i=Math.floor(o/s)+1;}}else i=oc(t,"maxLines",0);var a=0===i,h=oc(t,"fixedCharacterHeight",void 0);if(void 0===h){var l=oc(t,"charPerLine",void 0);if(void 0!==l){var u=this.fixedHeight-n;h=Math.floor(u/l);}}var c=oc(t,"wrapHeight",void 0);void 0===c&&(c=this.fixedHeight>0?this.fixedHeight-n:1/0);for(var d=oc(t,"letterSpacing",0),f=oc(t,"rtl",!0),v=oc(t,"hAlign",f?2:0),p=oc(t,"vAlign",0),g=Zu({callback:"runVerticalWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:v,vAlign:p,lineWidth:s,fixedCharacterHeight:h,wrapHeight:c,rtl:f}),y=this.children,k=0,m=y.length;k0&&(_.push({children:E,height:M}),R=Math.max(R,M)),g.start+=T.length,g.isLastPage=g.start===O,g.maxLineHeight=R,g.linesWidth=_.length*s;var j=this.fixedWidth>0?this.fixedWidth:g.linesWidth+r,W=this.fixedHeight>0?this.fixedHeight:g.maxLineHeight+n;!function(t,e,i){var n,r,s=t.hAlign,o=t.vAlign,a=t.rtl,h=t.lines,l=t.lineWidth,u=t.linesWidth;switch(s){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,r=i.right,s=i.top,o=i.bottom;return Ke(i,t,e),this.dirty=this.dirty||n!=i.left||r!=i.right||s!=i.top||o!=i.bottom,this},getPadding:function(t){return Je(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),zu(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 Bu(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,r,s=Array.isArray(t);void 0===e||e===this.children.length?s?(i=this.children).push.apply(i,y(t)):this.children.push(t):s?(n=this.children).splice.apply(n,[e,0].concat(y(t))):this.children.splice(e,0,t);(this.lastAppendedChildren.length=0,s)?(r=this.lastAppendedChildren).push.apply(r,y(t)):this.lastAppendedChildren.push(t);return this},createCharChild:function(t,e){e&&this.textStyle.modify(e);var i=this.poolManager.allocate(ju);return null===i?i=new Hu(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,r=t.length;ne&&(n=e,r=t);})),r},getCharWorldPosition:function(t,e,i,n){return "number"==typeof t&&(t=this.getCharChild(t,!0)),Cu(this,t,e,i,n)},setToMinSize:function(){for(var t=this.children,e=0,i=0,n=0,r=t.length;n=i.length&&(t=i.length);for(var n=0,r=0;r0,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=yd(t,"tl",0),this.radiusTR=yd(t,"tr",0),this.radiusBL=yd(t,"bl",0),this.radiusBR=yd(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,r=this.height,s=this.iterations+1;(e=this.radiusTL)>0?this._convexTL?$o(e,e,e,e,180,270,!1,s,t):$o(0,0,e,e,90,0,!0,s,t):qo(0,0,t);(e=this.radiusTR)>0?this._convexTR?$o(n-e,e,e,e,270,360,!1,s,t):$o(n,0,e,e,180,90,!0,s,t):qo(n,0,t);(e=this.radiusBR)>0?this._convexBR?$o(n-e,r-e,e,e,0,90,!1,s,t):$o(n,r,e,e,270,180,!0,s,t):qo(n,r,t);(e=this.radiusBL)>0?this._convexBL?$o(e,r-e,e,e,90,180,!1,s,t):$o(0,r,e,e,360,270,!0,s,t):qo(0,r,t);return t.push(t[0],t[1]),ed(this.x,this.y,t),v(h(i.prototype),"updateData",this).call(this),this}}]),i}(Kc);Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,Phaser.Math.Wrap;var md=Phaser.Math.Linear,bd=function(){var t,e,i,n,r,s,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,v={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 p=v[this.direction],g=p.a,y=p.b,k=p.c;t=g.x,e=g.y,i=y.x,n=y.y,r=k.x,s=k.y;}else {var m=v[this.previousDirection],b=v[this.direction],x=this.easeDirectionProgress;t=md(m.a.x,b.a.x,x),e=md(m.a.y,b.a.y,x),i=md(m.b.x,b.b.x,x),n=md(m.b.y,b.b.y,x),r=md(m.c.x,b.c.x,x),s=md(m.c.y,b.c.y,x);}o.startAt(t,e).lineTo(i,n).lineTo(r,s),this.arrowOnly?o.end():o.close();},xd=(0, Phaser.Math.DegToRad)(120),Cd=function(t){t=this.getShape("triangle");var e=this.width/2,i=this.height/2,n=Math.min(e,i)*this.radius,r=this.verticeRotation;t.startAt(e+n*Math.cos(r+xd),i+n*Math.sin(r+xd)).lineTo(e+n*Math.cos(r),i+n*Math.sin(r)).lineTo(e+n*Math.cos(r-xd),i+n*Math.sin(r-xd)),this.arrowOnly?t.end():t.close();},wd={buildShapes:function(){this.addShape((new gd).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?bd.call(this):Cd.call(this);}},Sd={setEaseDuration:function(t){return void 0===t&&(t=0),this.easeDuration=t,this},playEaseDirectionation:function(){return void 0===this.easeDirectionProgressTask&&(this.easeDirectionProgressTask=new bn(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}},Pd=Phaser.Utils.Objects.GetValue,Od=Phaser.Utils.Objects.IsPlainObject,Td=Phaser.Math.DegToRad,_d=Phaser.Math.RadToDeg,Ed=function(t){a(r,t);var e=d(r);function r(t,i,s,o,a,h,l){var u,c,d,f,v,p,g,y,k;if(n(this,r),Od(i)){var m=i;i=m.x,s=m.y,o=m.width,a=m.height,h=m.color,l=m.alpha,c=m.strokeColor,d=m.strokeAlpha,f=m.strokeWidth,v=m.arrowOnly,p=m.direction,g=m.easeDuration,y=m.padding,k=m.radius;}return void 0===i&&(i=0),void 0===s&&(s=0),void 0===o&&(o=1),void 0===a&&(a=o),void 0===v&&(v=!1),void 0===p&&(p=0),void 0===g&&(g=0),void 0===y&&(y=0),void 0===k&&(k=void 0),(u=e.call(this,t,i,s,o,a)).type="rexTriangle",u.setFillStyle(h,l),void 0!==c&&void 0===f&&(f=2),u.setStrokeStyle(f,c,d),u.setArrowOnly(v),u.setDirection(p,g),u.setPadding(y),u.setRadius(k),u.buildShapes(),u}return s(r,[{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=Rd(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,r){if("object"===i(t)){var s=t,o=Pd(s,"x",null);null!==o?(t=o,n=o):(t=Pd(s,"left",0),n=Pd(s,"right",t));var a=Pd(s,"y",null);null!==a?(e=a,r=a):(e=Pd(s,"top",0),r=Pd(s,"bottom",e));}else void 0===t&&(t=0),void 0===e&&(e=t),void 0===n&&(n=t),void 0===r&&(r=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!=r,this.padding.left=t,this.padding.top=e,this.padding.right=n,this.padding.bottom=r,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 _d(this.verticeRotation)},set:function(t){this.verticeRotation=Td(t);}},{key:"setVerticeAngle",value:function(t){return this.verticeAngle=t,this}}]),r}(Hc),Md={right:0,down:1,left:2,up:3},Rd=function(t){return "string"==typeof t&&(t=Md[t]),t%=4};Object.assign(Ed.prototype,wd,Sd);var Ld=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={}),(s=e.call(this,t,r)).type="rexTweaker.FolderTitle";var o=new Ed(t,r.expandedIcon);return t.add.existing(o),s.addSpace().add(o,{proportion:0,expand:!1,padding:1,fitRatio:1}),s.addChildrenMap("expandedIcon",o),s}return s(i,[{key:"setExpandedState",value:function(t){void 0===t&&(t=!0);var e=t?"down":"right";return this.childrenMap.expandedIcon.setDirection(e),this}}]),i}(Ic),Dd=function(t,e){var i=new dm(t,e);return t.add.existing(i),i},Ad=function(t,e,i){return $a(t,i)},zd=function(t){a(i,t);var e=d(i);function i(t,r){return n(this,i),void 0===r&&(r={}),r.destroy=!1,e.call(this,t,r)}return s(i,[{key:"onOpen",value:function(){this.emit("open",this.parent,this),v(h(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.parent,this),v(h(i.prototype),"onClose",this).call(this);}}]),i}(Nn),Bd={expand:function(t){if(!0===this.expanded)return this;void 0===t&&(t=this.transitionDuration),this.expanded=!0;var e=this.childrenMap.title,i=this.childrenMap.child;return this.show(i),(this.reLayoutTarget?this.reLayoutTarget:this.getTopmostSizer()).layout(),e.emit("folder.expand",t,this),i.emit("folder.expand",t,this),this.emit("expand.start",this),this.childTransition.once("open",(function(){this.emit("expand.complete",this);}),this).requestOpen(null,t),this},collapse:function(t){if(!1===this.expanded)return this;void 0===t&&(t=this.transitionDuration),this.expanded=!1;var e=this.childrenMap.title,i=this.childrenMap.child;return e.emit("folder.collapse",t,this),i.emit("folder.collapse",t,this),this.emit("collapse.start",this),this.childTransition.once("close",(function(){this.setChildScale(i,1,1).hide(i),(this.reLayoutTarget?this.reLayoutTarget:this.getTopmostSizer()).layout(),this.emit("collapse.complete",this);}),this).requestClose(null,t),this},toggle:function(t){return this.expanded?this.collapse(t):this.expand(t),this}},jd=function(t,e){Xi.popUp.call(t,e,this.expandDirection);},Wd=function(t,e){Xi.scaleDown.call(t,e,this.expandDirection);},Id={setTransitionDuration:function(t){return this.transitionDuration=t,this.childTransition.setTransitInTime(t).setTransitOutTime(t),this},setExpandCallback:function(t){return void 0===t&&(t=jd.bind(this)),this.childTransition.setTransitInCallback(t),this},setCollapseCallback:function(t){return void 0===t&&(t=Wd.bind(this)),this.childTransition.setTransitOutCallback(t),this}},Fd=Phaser.Utils.Objects.GetValue,Yd=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={}),r.hasOwnProperty("orientation")||(r.orientation=1),(s=e.call(this,t,r)).type="rexFolder",s.expanded=void 0,s.expandDirection=1===s.orientation?"y":"x";var o=r.background,a=r.title,h=r.child;o&&s.addBackground(o);var l=1===s.orientation?"left":"top",c=Fd(r,"align.title",l),d=Fd(r,"expand.title",!0);s.add(a,{proportion:0,align:c,expand:d});var f=Fd(r,"toggleByTarget",void 0),v=Fd(r,"toggleClickConfig");if(void 0===f&&(f=a),f&&_r.onClick.call(f,(function(){this.toggle();}),u(s),v),s.childTransition=new zd(h),!Fd(r,"customChildOrigin",!1)){var p=s.rtl?1:0;h.setOrigin(p);}c=Fd(r,"align.child","left");var g=(d=Fd(r,"expand.child",!0))?1:0;s.add(h,{proportion:g,align:c,expand:d}),s.addChildrenMap("title",a),s.addChildrenMap("child",h),s.addChildrenMap("background",o);var y=r.transition;s.setTransitionDuration(Fd(y,"duration",200)),s.setExpandCallback(Fd(y,"expandCallback",void 0)),s.setCollapseCallback(Fd(y,"collapseCallback",void 0)),s.reLayoutTarget=Fd(r,"reLayoutTarget",void 0);var k=r.onExpandStart;k&&s.on("expand.start",k);var m=r.onExpandComplete;m&&s.on("expand.complete",m);var b=r.onCollapseStart;b&&s.on("collapse.start",b);var x=r.onCollapseComplete;return x&&s.on("collapse.complete",x),s}return s(i)}(Mo);Object.assign(Yd.prototype,Bd,Id);var Xd=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).type="rexTweaker.Folder",s}return s(i,[{key:"setTitle",value:function(t){return this.childrenMap.title.setTitle(t),this}}]),i}(Yd);Object.assign(Xd.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 Vd=Phaser.Utils.Objects.GetValue,Gd=Phaser.Utils.Objects.GetValue,Hd=Mo.prototype.add,Nd=Mo.prototype.addSpace,Ud=function(t){var e=!t.isRexSpace,i=!e||this.buttonsExpand?1:0;if(0===this.sizerChildren.length)if(e){!this.buttonsExpand&&("right"===this.buttonsAlign||"center"===this.buttonsAlign||"bottom"===this.buttonsAlign)&&Nd.call(this),Hd.call(this,t,{proportion:i,expand:!0});var n=!this.buttonsExpand&&"center"===this.buttonsAlign;n&&Nd.call(this),this.hasTailSpace=n;}else Hd.call(this,t,{proportion:i,expand:!0}),this.hasTailSpace=!1;else if(this.hasTailSpace){var r=this.sizerChildren.length-1;Hd.call(this,t,{index:r,proportion:i,expand:!0});}else Hd.call(this,t,{proportion:i,expand:!0});return e&&this.buttonGroup.add(t),this},Jd={addButton:function(t){if(dr(t))for(var e=t,i=0,n=e.length;i=0;i--)Zd.call(this,e[i],t);return this}},Qd=function(t,e,i){if(t){var n=this.setValueCallback,r=this.setValueCallbackScope;n&&(r?n.call(r,t,e,i):n(t,e,i)),this.fireEvent("button.statechange",t,e,i);}},tf=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,Qd.call(e,t,i,n);}},enumerable:!0,configurable:!0}),t.selected=!1;},ef={add:function(t){return this.buttons.push(t),t._click||(t._click=new Or(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,r){this.fireEvent("button.over",t,e,r);}),this).on("pointerout",(function(e,i){this.fireEvent("button.out",t,e,i);}),this).on("pointerdown",(function(e,i,n,r){this.fireEvent("button.down",t,e,r);}),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")),tf.call(this,t)),this},addMultiple:function(t){for(var e=0,i=t.length;e2?o-2:0),h=2;ha.height/2)){r>(h=kf(a.left,a.centerY,t,e))&&(r=h,n=s);var h,l=i[s+1];if(!l||l.y!==a.y)r>(h=kf(a.right,a.centerY,t,e))&&(r=h,n=s+1);}}return n},bf=Phaser.Utils.Objects.IsPlainObject,xf=Phaser.Utils.Objects.GetValue,Cf=Phaser.Display.Align.CENTER,wf=function(t,e,i,n){if("\n"===t)return this.addNewLine(),this;var r;(Ae.call(this,t),bf(e))&&(e=xf(r=e,"padding",0),i=xf(r,"key",void 0),n=xf(r,"index",void 0));return void 0===e&&(e=0),(r=this.getSizerConfig(t)).align=Cf,r.padding=Le(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},Sf={add:function(t,e,i){if(dr(t))for(var n=t,r=0,s=n.length;r=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,bo.call(this,t),this}},Tf={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,r=i.length;nr&&Af.addNewLine(this);}else for(s=0,o=t.length;s=0;i--)If.call(this,e[i],t);return this}},Yf=Phaser.Utils.Objects.GetValue,Xf=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={});var o=r.space;"number"==typeof o&&(r.space={item:o,line:o}),(s=e.call(this,t,r)).type="rexFixWidthButtons",s.buttonGroup=new lf({parent:u(s),eventEmitter:Yf(r,"eventEmitter",u(s)),groupName:Yf(r,"groupName",void 0),clickConfig:Yf(r,"click",void 0)}).setButtonsType(r);var a=Yf(r,"background",void 0),h=Yf(r,"buttons",void 0);return s.buttonsAlign=Yf(r,"align",void 0),a&&s.addBackground(a),h&&s.addButtons(h),s.addChildrenMap("background",a),s.addChildrenMap("buttons",s.buttonGroup.buttons),s}return s(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(v(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}(Lf);Object.assign(Xf.prototype,Bf,Ff,hf,cf);var Vf=Phaser.Utils.Objects.IsPlainObject,Gf=Phaser.Utils.Objects.GetValue,Hf=Phaser.Display.Align.CENTER,Nf=Phaser.Utils.String.UUID,Uf={add:function(t,e,i,n,r,s,o,a,h){(Ae.call(this,t),Vf(e))&&(e=Gf(l=e,"key",void 0),i=Gf(l,"align",Hf),a=Gf(l,"offsetX",0),h=Gf(l,"offsetY",0),n=Gf(l,"padding",0),r=Gf(l,"expand",!0),t.isRexSizer||(s=Gf(l,"minWidth",t._minWidth),o=Gf(l,"minHeight",t._minHeighted)));var l,u=void 0!==e;return u||(e=Nf()),"string"==typeof i&&(i=ee[i]),void 0===i&&(i=Hf),void 0===a&&(a=0),void 0===h&&(h=0),void 0===n&&(n=0),void 0===r&&(r=!0),t.isRexSizer||(void 0===s&&(s=t._minWidth),void 0===o&&(o=t._minHeight)),(l=this.getSizerConfig(t)).align=i,l.alignOffsetX=a,l.alignOffsetY=h,l.padding=Le(n),Vf(r)?(l.expandWidth=Gf(r,"width",!1),l.expandHeight=Gf(r,"height",!1)):(l.expandWidth=r,l.expandHeight=r),t.isRexSizer||(l.expandWidth&&(t.minWidth=void 0===s?kt(t):s),l.expandHeight&&(t.minHeight=void 0===o?mt(t):o)),this.sizerChildren.hasOwnProperty(e)&&this.sizerChildren[e].destroy(),this.sizerChildren[e]=t,u&&this.addChildrenMap(e,t),this}},Jf={remove:function(t,e){var i;if("string"==typeof t){if(i=t,!(t=this.sizerChildren[i]))return this}else {if(this.getParentSizer(t)!==this)return this;i=this.childToKey(t);}return i&&(delete this.sizerChildren[i],this.childrenMap.hasOwnProperty(i)&&delete this.childrenMap[i]),Ye.call(this,t,e),this},removeAll:function(t){for(var e in this.sizerChildren)this.remove(e,t);return this},clear:function(t){for(var e in this.sizerChildren)delete this.sizerChildren[e],this.childrenMap.hasOwnProperty(e)&&delete this.childrenMap[e];return bo.call(this,t),this}},Kf={getChildrenWidth:function(){if(this.rexSizer.hidden)return 0;var t,e,i,n=0,r=this.sizerChildren;for(var s in r)e=(t=r[s]).rexSizer.padding,i=this.getChildWidth(t)+e.left+e.right,n=Math.max(i,n);return n+this.space.left+this.space.right},getChildrenHeight:function(){if(this.rexSizer.hidden)return 0;var t,e,i,n=0,r=this.sizerChildren;for(var s in r)i=(t=r[s]).isRexSizer?Math.max(t.minHeight,t.childrenHeight):void 0!==t.minHeight?t.minHeight:mt(t),i+=(e=t.rexSizer.padding).top+e.bottom,n=Math.max(i,n);return n+this.space.top+this.space.bottom},getExpandedChildWidth:function(t,e){var i;void 0===e&&(e=this.width);var n=t.rexSizer;if(n.expandWidth){var r=e-this.space.left-this.space.right,s=n.padding;i=r-s.left-s.right;}return i},getExpandedChildHeight:function(t,e){var i;void 0===e&&(e=this.height);var n=t.rexSizer;if(n.expandHeight){var r=e-this.space.top-this.space.bottom,s=n.padding;i=r-s.top-s.bottom;}return i},getChildrenSizers:function(t){void 0===t&&(t=[]);var e,i=this.sizerChildren;for(var n in i)(e=i[n]).isRexSizer&&t.push(e);return t},layoutChildren:function(){var t,e,i,n,r,s,o,a,h,l=this.innerLeft,u=this.innerTop,c=this.innerWidth,d=this.innerHeight,f=this.sizerChildren;for(var v in f)(t=f[v]).rexSizer.hidden||(i=(e=t.rexSizer).padding,xr.call(this,t),t.isRexSizer?(t.runLayout(this,this.getExpandedChildWidth(t),this.getExpandedChildHeight(t)),ho(t,this)):(a=void 0,h=void 0,e.expandWidth&&(a=c-i.left-i.right),e.expandHeight&&(h=d-i.top-i.bottom),yr(t,a,h)),n=l+i.left,s=c-i.left-i.right,r=u+i.top,o=d-i.top-i.bottom,Cr.call(this,t,n,r,s,o,e.align,e.alignOffsetX,e.alignOffsetY));}};Object.assign(Kf,Uf,Jf);var qf=Phaser.Utils.Objects.IsPlainObject,Zf=Phaser.Utils.Objects.GetValue,$f=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h){var l;return n(this,i),qf(r)?(r=Zf(h=r,"x",0),s=Zf(h,"y",0),o=Zf(h,"width",void 0),a=Zf(h,"height",void 0)):qf(o)&&(o=Zf(h=o,"width",void 0),a=Zf(h,"height",void 0)),(l=e.call(this,t,r,s,o,a,h)).type="rexOverlapSizer",l.sizerChildren={},l.addChildrenMap("items",l.sizerChildren),l}return s(i,[{key:"childToKey",value:function(t){if("string"!=typeof t)return function(t,e){if(Array.isArray(t))return t.indexOf(e);for(var i in t)if(t[i]===e)return i;return null}(this.sizerChildren,t);var e=t;return this.sizerChildren.hasOwnPropery(e)?e:null}}]),i}(ao);Object.assign($f.prototype,Kf);var Qf=$f.prototype.add,tv=function(t,e,i,n,r,s,o,a,h){return t.setVisible(!1),Qf.call(this,t,e,i,n,r,s,o,a,h),this},ev={add:tv,addPage:tv},iv=Jt.prototype.setChildVisible,nv={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?(iv.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&&(iv.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(nv,ev);var rv=Phaser.Utils.Objects.GetValue,sv=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).type="rexPages",s.childrenMap=s.sizerChildren,s._previousKey=void 0,s._currentKey=void 0,s.setSwapMode(rv(r,"swapMode",0)),s.setFadeInDuration(rv(r,"fadeIn",0)),s}return s(i,[{key:"setSwapMode",value:function(t){return "string"==typeof t&&(t=ov[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}($f);Object.assign(sv.prototype,nv);var ov={invisible:0,destroy:1},av=Phaser.Utils.Objects.IsPlainObject,hv=Phaser.Utils.Objects.GetValue,lv=Phaser.Utils.String.UUID,uv={swapPage:function(t,e){var i,n;null!=(i="number"==typeof t?t:this.getPageIndex(t))&&(void 0!==e&&(n=this.childrenMap.pages.fadeInDuration,this.childrenMap.pages.fadeInDuration=e),this.childrenMap.tabs.emitButtonClick(i),void 0!==n&&(this.childrenMap.pages.fadeInDuration=n));return this},swapFirstPage:function(t){return this.swapPage(0,t),this},swapLastPage:function(t){var e=this.getElement("tabs.buttons").length-1;return this.swapPage(e,t),this}},cv={removePage:function(t,e){"number"==typeof t&&(t=this.getPageKey(t));var i=this.childrenMap.tabs,n=i.getByName(t),r=this.childrenMap.pages,s=r.getElement(t);return n&&s?(r.removeChildrenMap(t),i.removeButton(n,e),r.remove(s,e),this):this}},dv={getPageKey:function(t){var e=this.getElement("tabs.buttons");if(!(t>=e.length))return e[t].name},getPageIndex:function(t){for(var e=this.getElement("tabs.buttons"),i=0,n=e.length;i1?e-1:0),n=1;n=r&&h=i&&hi.length&&(t.prevCursorPosition=null),null!==t.prevCursorPosition&&(r=e.getCharChild(t.prevCursorPosition))&&("\n"===r.text&&r.clearTextSize(),e.emit("cursorout",r,t.prevCursorPosition,e)),null!=n&&(r=e.getCharChild(n))&&("\n"===r.text&&r.copyTextSize(e.lastInsertCursor),function(t){var e,i,n=t.parent,r=n.width,s=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>r?r-l:0,i=u<0?0-u:c>s?s-c:0,n._textOX+=e,n._textOY+=i;}(r),e.emit("cursorin",r,n,e)),e.emit("movecursor",n,t.prevCursorPosition,e),t.prevCursorPosition=n;}}(this)):(qv(this),Zv(this)),this}},{key:"setNumberInput",value:function(){return this.onUpdateCallback=Kv,this}},{key:"setSelectAllWhenFocusEnable",value:function(t){return void 0===t&&(t=!0),this.selectAllWhenFocus=t,this}}]),i}(Jv),tp=Phaser.Utils.Objects.GetValue,ep=["inputType","onOpen","onFocus","onClose","onBlur","onUpdate","enterClose","readOnly","maxLength","minLength","selectAll"],ip=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,r=0;rt.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}op.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 r=this;function s(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 s([{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 s(ap(r,n.components,e,t,r.useLongestToken));u[i]=n;}else u[i]=void 0;}var p;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 r=e.length,s=i.length,o=t.newPos,a=o-n,h=0;o+1=0;e--){var i=this.sizerChildren[e];i&&this.remove(i,t);}return this},clear:function(t){return Ap(this.sizerChildren,null),bo.call(this,t),this}},Bp={setColumnSpace:function(t){if(this.space.column||(this.space.column=[]),this.space.column.length=this.columnCount-1,"number"==typeof t)Ap(this.space.column,t);else for(var e=0,i=this.columnCount-1;e=0;n--){var r=n*this.columnCount+t;this.sizerChildren.splice(r,0,null);}return this.columnProportions.push(e),this.columnWidth.length+=1,this.space.column.splice(t,0,i),this},Fp={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);for(var e,i,n,r,s=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=$e.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 r in this.sizerChildren)(e=this.sizerChildren[r])&&e.isRexSizer&&!e.ignoreLayout&&(n=this.getColumnWidth(parseInt(r)%this.columnCount),i=this.getExpandedChildWidth(e,n),i=e.resolveWidth(i),e.resolveChildrenWidth(i));},runWidthWrap:function(t){var e,i,n;for(var r in this.sizerChildren)!(e=this.sizerChildren[r])||e.isRexSizer&&e.ignoreLayout||!e.runWidthWrap||(n=this.getColumnWidth(parseInt(r)%this.columnCount),i=this.getExpandedChildWidth(e,n),e.isRexSizer&&(i=e.resolveWidth(i)),e.runWidthWrap(i));return this},resetGrid:function(t,e,i,n,r){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,Ap(this.sizerChildren,null),this.columnProportions=[],this.columnProportions.length=t,"number"==typeof i)Ap(this.columnProportions,i);else for(var s=0;s0&&(e+=t);return e},Xp=function(){for(var t,e=0,i=0;i0&&(e+=t);return e},Vp=Phaser.Utils.Objects.IsPlainObject,Gp=Phaser.Utils.Objects.GetValue,Hp=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h,l,u,c,d){var f;return n(this,i),Vp(r)?(r=Gp(d=r,"x",0),s=Gp(d,"y",0),o=Gp(d,"width",void 0),a=Gp(d,"height",void 0),h=Gp(d,"column",d.col||0),l=Gp(d,"row",0),u=Gp(d,"columnProportions",0),c=Gp(d,"rowProportions",0)):Vp(o)?(o=Gp(d=o,"width",void 0),a=Gp(d,"height",void 0),h=Gp(d,"column",d.col||0),l=Gp(d,"row",0),u=Gp(d,"columnProportions",0),c=Gp(d,"rowProportions",0)):Vp(h)?(h=Gp(d=h,"column",d.col||0),l=Gp(d,"row",0),u=Gp(d,"columnProportions",0),c=Gp(d,"rowProportions",0)):Vp(u)&&(u=Gp(d=u,"columnProportions",0),c=Gp(d,"rowProportions",0)),(f=e.call(this,t,r,s,o,a,d)).type="rexGridSizer",f.sizerChildren=[],f.addChildrenMap("items",f.sizerChildren),f.setCreateCellContainerCallback(Gp(d,"createCellContainerCallback")),f.setIndentLeft(Gp(d,"space.indentLeftOdd",0),Gp(d,"space.indentLeftEven",0)),f.setIndentTop(Gp(d,"space.indentTopOdd",0),Gp(d,"space.indentTopEven",0)),f.resetGrid(h,l,u,c,Gp(d,"space",void 0)),f}return s(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(v(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=Yp.call(this)),this._totalColumnProportions}},{key:"totalRowProportions",get:function(){return void 0===this._totalRowProportions&&(this._totalRowProportions=Xp.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}(ao);Object.assign(Hp.prototype,Fp);var Np=Phaser.Utils.Objects.GetValue,Up=Phaser.Math.Linear,Jp=Phaser.Math.Percent,Kp={setValue:function(t,e,i){return null==t||(void 0!==e&&(t=Jp(t,e,i)),this.value=t),this},addValue:function(t,e,i){return void 0!==e&&(t=Jp(t,e,i)),this.value+=t,this},getValue:function(t,e){var i=this.value;return void 0!==t&&(i=Up(t,e,i)),i}},qp=Phaser.Math.Percent,Zp={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=qp(t,e,i)),void 0===this.easeValueTask&&(this.easeValueTask=new bn(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 bn(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,from:t,to:e,duration:this.easeValueDuration,ease:this.easeFunction,repeat:i,repeatDelay:n}),this}},$p=Phaser.Utils.Objects.GetValue,Qp=Phaser.Math.Clamp;var tg=Phaser.Math.Percent,eg=function(t,e,i){var n;return t.y===e.y?n=tg(i.x,t.x,e.x):t.x===e.x&&(n=tg(i.y,t.y,e.y)),n},ig=function(t,e,i){var n,r;this.enable&&(ng.x=e,ng.y=i,this.reverseAxis?(n=this.getEndPoint(),r=this.getStartPoint()):(n=this.getStartPoint(),r=this.getEndPoint()),this.value=eg(n,r,ng));},ng={},rg=function(t,e,i){if(this.enable&&t.isDown){var n,r;sg.x=t.worldX,sg.y=t.worldY,this.reverseAxis?(n=this.getEndPoint(),r=this.getStartPoint()):(n=this.getStartPoint(),r=this.getEndPoint());var s=eg(n,r,sg);this.stopEaseValue(),0===this.easeValueDuration||Math.abs(this.value-s)<.1?this.value=s:this.easeValueTo(s);}},sg={},og=function(t,e){void 0===e&&(e=ag);var i=this.childrenMap.thumb,n=i.x,r=i.y;return Oe(i,this.innerLeft,this.innerTop,this.innerWidth,this.innerHeight,t),e.x=i.x,e.y=i.y,i.x=n,i.y=r,e},ag={},hg=Phaser.Display.Align.LEFT_CENTER,lg=Phaser.Display.Align.TOP_CENTER,ug={},cg=Phaser.Display.Align.RIGHT_CENTER,dg=Phaser.Display.Align.BOTTOM_CENTER,fg={},vg=Phaser.Math.Linear,pg={},gg=Phaser.Display.Align.LEFT_CENTER,yg=Phaser.Display.Align.TOP_CENTER,kg=Phaser.Display.Align.RIGHT_CENTER,mg=Phaser.Display.Align.BOTTOM_CENTER,bg=Phaser.Utils.Objects.GetValue,xg=Phaser.Utils.Objects.IsPlainObject,Cg=Phaser.Math.Clamp,wg=Phaser.Math.Snap.To,Sg=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),(s=e.call(this,t,r)).type="rexSlider",s.bootProgressBase(r),s.reverseAxis=bg(r,"reverseAxis",!1);var o=bg(r,"background",void 0),a=bg(r,"track",void 0),h=bg(r,"indicator",void 0),l=bg(r,"thumb",void 0);o&&(xg(o)&&(o=$a(t,o)),s.addBackground(o)),a&&(xg(a)&&(a=$a(t,a)),s.add(a,{proportion:1,expand:!0,minWidth:0===s.orientation?0:void 0,minHeight:1===s.orientation?0:void 0})),h&&(xg(h)&&(h=$a(t,h)),s.pin(h)),l&&(xg(l)&&(l=$a(t,l)),s.pin(l));var c=bg(r,"input",0);switch("string"==typeof c&&(c=Pg[c]),c){case 0:l&&(l.setInteractive(),s.scene.input.setDraggable(l),l.on("drag",ig,u(s)).on("dragstart",(function(t){this.eventEmitter.emit("inputstart",t);}),u(s)).on("dragend",(function(t){this.eventEmitter.emit("inputend",t);}),u(s)));break;case 1:s.on("pointerdown",rg,u(s)).on("pointermove",rg,u(s)).on("pointerdown",(function(t){this.eventEmitter.emit("inputstart",t);}),u(s)).on("pointerup",(function(t){this.eventEmitter.emit("inputend",t);}),u(s)).on("pointerover",(function(t){t.isDown&&this.eventEmitter.emit("inputstart",t);}),u(s)).on("pointerout",(function(t){t.isDown&&this.eventEmitter.emit("inputend",t);}),u(s)).setInteractive();}return s.addChildrenMap("background",o),s.addChildrenMap("track",a),s.addChildrenMap("indicator",h),s.addChildrenMap("thumb",l),s.setEnable(bg(r,"enable",void 0)),s.setGap(bg(r,"gap",void 0)),s.setValue(bg(r,"value",0),bg(r,"min",void 0),bg(r,"max",void 0)),s}return s(i,[{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"setGap",value:function(t,e,i){return t&&void 0!==e&&(t/=i-e),this.gap=t,this}},{key:"value",get:function(){return this._value},set:function(t){void 0!==this.gap&&(t=wg(t,this.gap));var e=this._value;this._value=Cg(t,0,1),e!==this._value&&(this.updateThumb(this._value),this.updateIndicator(this._value),this.eventEmitter.emit("valuechange",this._value,e,this.eventEmitter));}},{key:"runLayout",value:function(t,e,n){return this.ignoreLayout||(v(h(i.prototype),"runLayout",this).call(this,t,e,n),this.updateThumb(),this.updateIndicator()),this}}]),i}(function(t){var e=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return s(i,[{key:"bootProgressBase",value:function(t){this.eventEmitter=$p(t,"eventEmitter",this);var e=$p(t,"valuechangeCallback",null);if(null!==e){var i=$p(t,"valuechangeCallbackScope",void 0);this.eventEmitter.on("valuechange",e,i);}return this.setEaseValuePropName("value").setEaseValueDuration($p(t,"easeValue.duration",0)).setEaseValueFunction($p(t,"easeValue.ease","Linear")),this}},{key:"value",get:function(){return this._value},set:function(t){t=Qp(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,Kp,Zp),e}(Mo)),Pg={pan:0,drag:0,click:1,none:-1},Og={getStartPoint:function(t){if(void 0===t&&(t=ug),this.childrenMap.thumb){var e=0===this.orientation?hg:lg;og.call(this,e,t);}else 0===this.orientation?(t.x=this.innerLeft+1,t.y=this.centerY):(t.x=this.centerX,t.y=this.innerTop+1);return t},getEndPoint:function(t){if(void 0===t&&(t=fg),this.childrenMap.thumb){var e=0===this.orientation?cg:dg;og.call(this,e,t);}else 0===this.orientation?(t.x=this.innerRight-1,t.y=this.centerY):(t.x=this.centerX,t.y=this.innerBottom-1);return t},updateThumb:function(t){var e,i,n=this.childrenMap.thumb;return void 0===n||(void 0===t&&(t=this.value),this.reverseAxis?(e=this.getEndPoint(),i=this.getStartPoint()):(e=this.getStartPoint(),i=this.getEndPoint()),function(t,e,i,n){void 0===n&&(n=pg),n.x=vg(e.x,i.x,t),n.y=vg(e.y,i.y,t);}(t,e,i,n),this.resetChildPositionState(n)),this},updateIndicator:function(t){var e=this.childrenMap.indicator;if(void 0===e)return this;void 0===t&&(t=this.value);var i,n,r,s=this.reverseAxis,o=this.childrenMap.thumb;if(o)if(0===this.orientation){var a=kt(o);if(s){h=o.x-a*o.originX;i=this.right-h;}else {var h;i=(h=o.x-a*o.originX)+a-this.left;}}else {var l=mt(o);if(s){u=o.y-l*o.originY;n=this.bottom-u;}else {var u;n=(u=o.y-l*o.originY)+l-this.top;}}else 0===this.orientation?i=this.width*t:n=this.height*t;yr(e,i,n),r=s?0===this.orientation?kg:mg:0===this.orientation?gg:yg,Pe(e,this,r),this.resetChildPositionState(e);}};Object.assign(Sg.prototype,Og);var Tg=Phaser.Utils.Objects.GetValue,_g=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),(s=e.call(this,t,r)).type="rexScrollBar";var o,a=Tg(r,"background",void 0),h=Tg(r,"buttons",void 0),l=Tg(h,"top",Tg(h,"left",void 0)),c=Tg(h,"bottom",Tg(h,"right",void 0)),d=Tg(r,"slider",void 0);(a&&s.addBackground(a),l)&&(s.add(l),new Wr(l).on("intouch",(function(){if(this.enable){var t=o.reverseAxis?this.scrollStep:-this.scrollStep;this.value+=t;}}),u(s)));if(d){var f;if(d.orientation=s.orientation,d.eventEmitter=u(s),d.value=null,0===s.orientation)f=void 0===Tg(d,"width",void 0)?1:0;else f=void 0===Tg(d,"height",void 0)?1:0;o=new Sg(t,d),t.add.existing(o),s.add(o,{proportion:f});}c&&(s.add(c),new Wr(c).on("intouch",(function(){if(this.enable){var t=o.reverseAxis?-this.scrollStep:this.scrollStep;this.value+=t;}}),u(s)));var v=[l,c];s.addChildrenMap("background",a),s.addChildrenMap("slider",o),s.addChildrenMap("buttons",v);var p=Tg(r,"valuechangeCallback",null);if(null!==p){var g=Tg(r,"valuechangeCallbackScope",void 0);s.on("valuechange",p,g);}return s.setEnable(Tg(r,"enable",void 0)),s.setValue(Tg(r,"value",0)),s.setScrollStep(Tg(h,"step",.01)),s}return s(i,[{key:"setScrollStep",value:function(t){return this.scrollStep=t,this}},{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}}]),i}(Mo),Eg=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,r)).parent=t,s.init(),s}return s(i,[{key:"init",value:function(){this.start("IDLE");}},{key:"next_IDLE",value:function(){var t,e=this.parent;return e.dragState.isDown&&(t=0===e.dragThreshold?"DRAG":"DRAGBEGIN"),t}},{key:"update_IDLE",value:function(t,e){this.next();}},{key:"next_DRAGBEGIN",value:function(){var t=this.parent,e=t.dragState;return e.isDown?e.pointer.getDistance()>=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}(Wn),Mg=Phaser.Utils.Objects.GetValue,Rg=Phaser.Math.Distance.Between,Lg=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r))._enable=void 0,t.setInteractive(Mg(r,"inputConfig",void 0)),s.resetFromJSON(r),s.boot(),s}return s(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(Mg(t,"enable",!0)),this.holdThreshold=Mg(t,"holdThreshold",50),this.pointerOutReleaseEnable=Mg(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,v(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 gs(this.scene)}},{key:"speed",get:function(){return this.x===this.preX&&this.y===this.preY?0:Rg(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}(ui),Dg=Phaser.Utils.Objects.GetValue,Ag=function(){function t(e){n(this,t),this.resetFromJSON(e);}return s(t,[{key:"resetFromJSON",value:function(t){return this.setValue(Dg(t,"value",0)),this.setSpeed(Dg(t,"speed",0)),this.setAcceleration(Dg(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}(),zg=function(){function t(){n(this,t),this.value,this.dir,this.movement=new Ag;}return s(t,[{key:"init",value:function(t,e,i,n,r){return this.value=t,this.end=r,this.dir=void 0!==r?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,r=Math.sqrt(2*n*i);this._slowDown.init(t,void 0,r,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}(ui),Ig={y:0,v:0,vertical:0,x:1,h:1,horizontal:1},Fg=Phaser.Utils.Objects.GetValue,Yg=function(t){a(i,t);var e=d(i);function i(t,r){var s;(n(this,i),(s=e.call(this,t,r)).parent!==s.scene?s.focusMode=Fg(r,"focus",!0):s.focusMode=!1,s.setSpeed(Fg(r,"speed",.1)),s.setEnable(Fg(r,"enable",!0)),s.focusMode)?(t=s.parent).setInteractive(Fg(r,"inputConfig",void 0)).on("wheel",(function(t,e,i,n,r){this.enable&&this.scroll(i);}),u(s)):s.scene.input.on("wheel",s.onSceneScroll,u(s));return s}return s(i,[{key:"destroy",value:function(){this.focusMode||this.scene.input.off("wheel",this.onSceneScroll,this);}},{key:"onSceneScroll",value:function(t,e,i,n,r,s){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}(ui),Xg=Phaser.Utils.Objects.GetValue,Vg=function(t,e,i,n){var r,s,o,a,h="Y"===(i=i.toUpperCase()),l=2===t.scrollMode,u=t.childrenMap.child,c="slider".concat(i);if(r=l||n.hasOwnProperty(c)?Xg(n,c,void 0):Xg(n,"slider",void 0)){var d,f,v;!0===r&&(r={}),r.orientation=h?1:0,s=function(t,e){void 0===e&&(e={});var i=At(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 _g(t,e);t.add.existing(n);var r=n.childrenMap.slider;return n.addChildrenMap("track",r.childrenMap.track),n.addChildrenMap("indicator",r.childrenMap.indicator),n.addChildrenMap("thumb",r.childrenMap.thumb),n}(t.scene,r);var p=Xg(r,"position",0);"string"==typeof p&&(p=Gg[p]);var g=Xg(n,"space.slider".concat(i),void 0);void 0===g&&void 0===(g=Xg(n,"space.slider",void 0))&&(g=l?0:Xg(n,"space.child",0));var y="number"==typeof g;h?0===p?(d=2,f=1,v=y?{left:g}:g):(d=0,f=1,v=y?{right:g}:g):0===p?(d=1,f=2,v=y?{top:g}:g):(d=1,f=0,v=y?{bottom:g}:g),e.add(s,{column:d,row:f,align:"center",padding:v,expand:!0}),t["hideUnscrollableSlider".concat(i)]=Xg(r,"hideUnscrollableSlider",!1),t["adaptThumb".concat(i,"SizeMode")]=Xg(r,"adaptThumbSize",!1),t["minThumb".concat(i,"Size")]=Xg(r,"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)?Xg(n,k,!0):Xg(n,"scroller",!0))&&u&&(!0===o&&(o={}),o.orientation=h?0:1,a=new Wg(u,o));var m,b,x,C,w=Xg(n,l?"mouseWheelScroller".concat(i):"mouseWheelScroller",!1);(w&&u&&(m=new Yg(u,w)),t.addChildrenMap("slider".concat(i),s),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",s),t.addChildrenMap("scroller",a),t.addChildrenMap("mouseWheelScroller",m)),s)&&(l?(b=h?"t":"s",C="scroll".concat(i)):(b="t",C="scroll"),s.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);}));}},Gg={right:0,left:1,bottom:0,top:1},Hg=Phaser.Utils.Objects.GetValue,Ng=function(t,e){var i=t.scene,n=[0,1,0],r=[0,1,0],s=Hg(e,"width"),o=Hg(e,"height");s||(Hg(e,"child.expandWidth",!0)||(n[1]=0));o||(Hg(e,"child.expandHeight",!0)||(r[1]=0));var a=new Hp(i,{column:3,row:3,columnProportions:n,rowProportions:r});switch(function(t,e,i){var n=Np(i,"child"),r=Np(n,"gameObject",void 0);if(r){var s=Np(i,"space.child",0);t.childMargin={};var o=t.childMargin,a={};if("number"==typeof s)switch(t.scrollMode){case 0:case 1:o.top=0,o.bottom=0,o.left=0,o.right=0;break;default:o.top=s,o.bottom=s,o.left=s,o.right=s;}else switch(t.scrollMode){case 0:o.top=Np(s,"top",0),o.bottom=Np(s,"bottom",0),a.left=Np(s,"left",0),a.right=Np(s,"right",0);break;case 1:o.top=Np(s,"left",0),o.bottom=Np(s,"right",0),a.top=Np(s,"top",0),a.bottom=Np(s,"bottom",0);break;default:o.top=Np(s,"top",0),o.bottom=Np(s,"bottom",0),o.left=Np(s,"left",0),o.right=Np(s,"right",0);}e.add(r,{column:1,row:1,align:Np(n,"align","center"),padding:a,expand:{width:Np(n,"expandWidth",!0),height:Np(n,"expandHeight",!0)}});}t.addChildrenMap("child",r);}(t,a,e),t.scrollMode){case 0:Vg(t,a,"y",e);break;case 1:Vg(t,a,"x",e);break;default:Vg(t,a,"y",e),Vg(t,a,"x",e);}return a},Ug=function(t){var e,i,n,r;switch(this.scrollMode){case 0:case 1:e=this.topChildOY,i=this.bottomChildOY,n=this.childrenMap.scroller,r=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)],r=this.childrenMap["slider".concat(t)];}n&&n.setBounds(e,i),r&&r.setEnable(e!==i);},Jg=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);}},Kg=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,r=this.minThumbSize;if(0===this.scrollMode){var s=i.displayHeight*e;void 0!==r&&sb.bottom&&(l=c.getTopLeft().y,t.setOrigin(0,1).setPosition(h+d,l+f));},py={down:0,up:1},gy=Phaser.Utils.Objects.GetValue,yy=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={}),null==r.transitIn&&(r.transitIn=function(t,e){Bi(t,e,"y","Cubic");}),null==r.transitOut&&(r.transitOut=function(t,e){!function(t,e,i,n,r){void 0===n&&(n="Linear");var s={mode:0};switch(i){case 0:case"x":s.end={x:0};break;case 1:case"y":s.end={y:0};break;default:s.end=0;}s.duration=e,s.ease=n,void 0===r?r=new Ai(t,s):r.resetFromJSON(s),r.restart();}(t,e,"y","Linear");}),r.manualClose=!0,r.clickOutsideClose=!0,r.destroy=!0,s=e.call(this,t,r),vy(t,r),t.isRexSizer&&t.layout();var o=gy(r,"touchOutsideClose",!1),a=gy(r,"anyTouchClose",!1);return a&&(o=!1),a?s.once("open",s.anyTouchClose,u(s)):o&&s.once("open",s.touchOutsideClose,u(s)),s.requestOpen(),s}return s(i,[{key:"shutdown",value:function(t){this.isShutdown||(this.scene.input.off("pointerup",this.touchCloseCallback,this),v(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&&sr(this.parent,t.worldX,t.worldY)||this.requestClose();}},{key:"onOpen",value:function(){this.emit("open",this.parent,this),v(h(i.prototype),"onOpen",this).call(this);}},{key:"onClose",value:function(){this.emit("close",this.parent,this),v(h(i.prototype),"onClose",this).call(this);}}]),i}(Nn),ky={openListPanel:function(){if(this.listPanel)return this;var t,e=dy.call(this);e.on("button.over",(function(t,i,n,r){this.listOnButtonOver&&this.listOnButtonOver.call(this,t,i,n,r),this.emit("button.over",this,e,t,i,n,r);}),this).on("button.out",(function(t,i,n,r){this.listOnButtonOut&&this.listOnButtonOut.call(this,t,i,n,r),this.emit("button.out",this,e,t,i,n,r);}),this),t=this.listAlignMode&&"label"!==this.listAlignMode?this.getElement(this.listAlignMode):this;var i=new yy(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,r){this.listOnButtonClick&&this.listOnButtonClick.call(this,t,i,n,r),this.emit("button.click",this,e,t,i,n,r);}),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(ky,uy);var my=Phaser.Utils.Objects.GetValue,by=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),(s=e.call(this,t,r)).type="rexDropDownList",s.timer=void 0,s.setOptions(my(r,"options"));var o=my(r,"list");return s.setWrapEnable(my(o,"wrap",!1)),s.setCreateButtonCallback(my(o,"createButtonCallback")),s.setCreateListBackgroundCallback(my(o,"createBackgroundCallback")),s.setButtonClickCallback(my(o,"onButtonClick")),s.setButtonOverCallback(my(o,"onButtonOver")),s.setButtonOutCallback(my(o,"onButtonOut")),s.setListExpandDirection(my(o,"expandDirection")),s.setListEaseInDuration(my(o,"easeIn",500)),s.setListEaseOutDuration(my(o,"easeOut",100)),s.setListTransitInCallback(my(o,"transitIn")),s.settListTransitOutCallback(my(o,"transitOut")),s.setListSize(my(o,"width"),my(o,"height")),s.setListAlignmentMode(my(o,"alignParent","text")),s.setListAlignmentSide(my(o,"alignSide","")),s.setListBounds(my(o,"bounds")),s.setListSpace(my(o,"space")),s.setListDraggable(my(o,"draggable",!1)),s.setValueChangeCallback(my(r,"setValueCallback"),my(r,"setValueCallbackScope")),s.setValue(my(r,"value")),s.onClick(s.toggleListPanel,u(s)),s}return s(i,[{key:"destroy",value:function(t){this.scene&&!this.ignoreDestroy&&(this.listPanel&&(this.listPanel.destroy(t),this.listPanel=void 0),v(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}(Yo);Object.assign(by.prototype,ky);var xy=function(t,e){e=function(t,e,i){void 0===i&&(i={});var n=(e=e?Xo(e):{}).label||e.button,r=e.button||e.label;delete e.label,delete e.button;var s=i.label||i.button||i,o=i.button||i.label||i,a=Wc(t,n,s);return a.list=e.list||{},a.list.createButtonCallback=function(t,e){var i=bv(t,r,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}(t,e);var i=new by(t,e);return t.add.existing(i),i},Cy=function(t,e){for(var i=0,n=t.length;i>16&255},Gy=function(t){return t>>8&255},Hy=function(t){return 255&t},Ny=Phaser.Math.Linear,Uy={buildShapes:function(){this.addShape((new kd).setName("track")).addShape((new kd).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 r=t*this.trackWidth,s=e*this.trackHeight,o=(t-r)/2,a=(e-s)/2,h=e*this.trackRadius;n.setTopLeftPosition(o,a).setSize(r,s).setRadius(h);}var l,u,c,d=(l=this.falseValueTrackColor,u=this.trackFillColor,c=i,(255&Xy(Vy(l),Vy(u),c))<<16|(255&Xy(Gy(l),Gy(u),c))<<8|255&Xy(Hy(l),Hy(u),c)),f=Ny(this.falseValueTrackFillAlpha,this.trackFillAlpha,i);n.fillStyle(d,f);var v=this.getShape("thumb");if(this.isSizeChanged){var p=t*this.thumbWidth,g=e*this.thumbHeight,y=e*this.thumbRadius;v.setSize(p,g).setRadius(y);}var k=Ny(this.thumbLeftX,this.thumbRightX,i)*t;this.rtl&&(k=t-k);var m=e/2;v.setCenterPosition(k,m),v.fillStyle(this.thumbColor,this.thumbAlpha);}},Jy={setToggleAnimationDuration:function(t){return void 0===t&&(t=0),this.toggleAnimDuration=t,this},playToggleAnimation:function(){return void 0===this.toggleAnimProgressTask&&(this.toggleAnimProgressTask=new bn(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}},Ky={};Object.assign(Ky,Iy,Fy,Yy,Uy,Jy);var qy=Phaser.Utils.Objects.GetValue,Zy=Phaser.Utils.Objects.IsPlainObject,$y=23730,Qy=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h,l){var u;n(this,i),Zy(r)?(r=qy(l=r,"x",0),s=qy(l,"y",0),o=qy(l,"width",2),a=qy(l,"height",2),h=qy(l,"color",$y)):Zy(h)&&(h=qy(l=h,"color",$y)),(u=e.call(this,t,r,s,o,a)).type="rexToggleSwitch",void 0===h&&(h=$y),u.setTrackFillStyle(h,qy(l,"trackFillAlpha",1)),u.setFalseValueTrackFillStyle(qy(l,"falseValueTrackColor",function(t){var e=.3*Vy(t)+.59*Gy(t)+.11*Hy(t);return (255&e)<<16|(255&e)<<8|255&e}(h)),qy(l,"falseValueTrackFillAlpha",1)),u.setThumbStyle(qy(l,"thumbColor",16777215),qy(l,"thumbAlpha",1)),u.setTrackSize(qy(l,"trackWidth",.9),qy(l,"trackHeight",.5)),u.setTrackRadius(qy(l,"trackRadius",.5*u.trackHeight));var c=qy(l,"thumbHeight",void 0),d=qy(l,"thumbWidth",c);return void 0===d&&(d=.9*u.trackHeight),u.setThumbSize(d,c),u.setThumbRadius(qy(l,"thumbRadius",.5*u.thumbHeight)),u.setThumbPosition(qy(l,"thumbLeft",.3),qy(l,"thumbRight",void 0)),u.setRTL(qy(l,"rtl",!1)),u.setToggleAnimationDuration(qy(l,"animationDuration",150)),u.buildShapes(),u.setValue(qy(l,"value",!1),0),u}return s(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}(Hc);Object.assign(Qy.prototype,Ky);for(var tk,ek=Phaser.Utils.Objects.GetValue,ik=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h,l){var c;return n(this,i),(c=e.call(this,t,r,s,o,a,h,l))._click=new Or(u(c),ek(l,"click")),c._click.on("click",(function(){this.toggleValue();}),u(c)),c.setReadOnly(ek(l,"readOnly",!1)),c}return s(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}(Qy),nk=Phaser.Utils.Objects.GetValue,rk=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={}),(s=e.call(this,t)).type="rexTweaker.ToggleSwitchInput";var o=r.toggleSwitch,a=function(t,e){var i=new ik(t,e);return t.add.existing(i),i}(t,o),h=nk(o,"size");void 0!==h&&a.setSize(h,h);var l=void 0!==h?0:1;return s.addSpace().add(a,{proportion:0,expand:!1,fitRatio:l}),s.addChildrenMap("toggleSwitch",a),a.on("valuechange",(function(t){this.setValue(t);}),u(s)),s}return s(i,[{key:"value",get:function(){return this._value},set:function(t){this._value!==t&&(this.validate(t)||(t=this._value),this.childrenMap.toggleSwitch.setValue(t),g(h(i.prototype),"value",t,this,!0));}}]),i}(Dv),sk=["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"],ok=[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],ak={},hk=0,lk=sk.length;hk0&&{height:this.colorComponentsHeight,formatLabel:this.colorComponentsFormatLabelConfig,inputText:this.colorComponentsInputTextConfig,space:this.colorComponentsSpace};var o=new qk(t,{width:n,height:s,background:e,space:this.colorPickerSpace,hPalette:{position:this.colorPickerHPalettePosition},colorComponents:r,value:this.value});return t.add.existing(o),o},$k={openColorPicker:function(){if(!this.colorPicker){var t=Zk.call(this).layout(),e=new yy(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($k,yk);var Qk=Phaser.Utils.Objects.GetValue,tm=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={}),(s=e.call(this,t,r)).type="rexColorInput",r.hasOwnProperty("colorPicker")||(r.colorPicker={background:{color:0}});var o=r.colorPicker,a=!1!==o&&null!==o;if(a){var h;s.setColorPickerSize(Qk(o,"width",160),Qk(o,"height",170));var l=Qk(o,"background");h=l?function(t){return $a(t,l)}:Qk(o,"createBackgroundCallback"),s.setCreateColorPickerBackgroundCallback(h),s.setColorPickerHPalettePosition(Qk(o,"hPalettePosition",0)),s.setColorPickerExpandDirection(Qk(o,"expandDirection")),s.setColorPickerEaseInDuration(Qk(o,"easeIn",200)),s.setColorPickerEaseOutDuration(Qk(o,"easeOut",200)),s.setColorPickerTransitInCallback(Qk(o,"transitIn")),s.setColorPickerTransitOutCallback(Qk(o,"transitOut")),s.setColorPickerBounds(Qk(o,"bounds"));var c=Qk(o,"space");void 0===c&&(c={left:10,right:10,top:10,bottom:10,item:8}),s.setColorPickerSpace(c);}var d=r.colorComponents;if(a&&(!1!==d&&null!==d)){s.setColorComponentsHeight(Qk(d,"height",30)),s.setColorComponentsFormatLabelConfig(Qk(d,"formatLabel"));var f=Qk(d,"inputText");f||(f=Qk(r,"inputText")),s.setColorComponentsInputTextConfig(f);var v=Qk(d,"space");void 0===v&&(v={item:8}),s.setColorComponentsSpace(v);}var p=s.childrenMap.swatch;return p&&a&&s.onClick(p,s.openColorPicker,u(s)),s}return s(i)}(gk);Object.assign(tm.prototype,$k);var em=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={}),(s=e.call(this,t)).type="rexTweaker.ColorInput";var o=function(t,e,i){void 0===i&&(i=!0),i?e=e?Xo(e):{}:e||(e={});var n=new tm(t,e);return t.add.existing(n),n}(t,r.colorInput);return s.add(o,{proportion:1,expand:!0}),s.addChildrenMap("colorInput",o),o.on("valuechange",(function(t){this.setValue(t);}),u(s)),s}return s(i,[{key:"value",get:function(){return this._value},set:function(t){this._value!==t&&(this.validate(t)||(t=this._value),this.childrenMap.colorInput.setValue(t),g(h(i.prototype),"value",t,this,!0));}}]),i}(Dv),im={};im[wv]=Sp,im.textarea=function(t,e,i){var n=new ry(t,i);return t.add.existing(n),n.setInputTextReadOnly(!!e.inputTextReadOnly),n},im[Sv]=function(t,e,i){var n=new sy(t,i);return t.add.existing(n),n.setInputTextReadOnly(!!e.inputTextReadOnly),n},im[Pv]=function(t,e,i){var n=new ly(t,i);return t.add.existing(n),n.setRange(e.min,e.max,e.step),n.setInputTextReadOnly(!!e.inputTextReadOnly),n},im[Ov]=function(t,e,i){var n=new wy(t,i);return t.add.existing(n),n.setOptions(e.options),n},im.buttons=function(t,e,i){var n=new Oy(t,i);return t.add.existing(n),n.setOptions(e.options),n},im[Tv]=function(t,e,i){var n=new Wy(t,i);return t.add.existing(n),n},im.toggleSwitch=function(t,e,i){var n=new rk(t,i);return t.add.existing(n),n},im.color=function(t,e,i){var n=new em(t,i);return t.add.existing(n),n};var nm=Phaser.Utils.Objects.GetValue,rm=function(t,i,n){var r=nm(n,"title")||{},s=Lv(t,0,r),o=function(t,e,i){var n=e.view,r=(lr(n)?n:im.hasOwnProperty(n)?im[n]:Sp)(t,e,i);return r.setTextFormatCallback(e.format),r}(t,i,n),a=nm(n,"background")||{},h=$a(t,a),l=new Rv(t,e(e(e({},i),n),{},{inputTitle:s,inputField:o,background:h}));return t.add.existing(l),l.setTitle(i),l};Phaser.Utils.Objects.GetValue;var sm=Phaser.Utils.Objects.GetValue,om=function(t,i,n){for(var r=sm(n,"title")||{},s=Lv(t,0,r),o=i.buttons,a=sm(n,"button")||{},h=[],l=0,u=o.length;l0?0:1,o.setMinWidth(this.itemWidth)),this.add(o,{proportion:s,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:hm,addButtons:hm,addSeparator:function(t){var e=this.scene,i=lm(this.styles,"separator"),n=Ad(e,0,i);return this.add(n,{expand:!0}),this},setBindingTarget:function(t){for(var e=this.sizerChildren,i=0,n=e.length;ih;u--){for(c=0;c0&&this.wrapMode!==yh&&0===this.wrapWidth}},{key:"setStyle",value:function(t,e,i){if(void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("wrap")){var n=t.wrap;if(n.hasOwnProperty("mode")){var r=n.mode;"string"==typeof r&&(n.mode=Sh[r]);}else n.hasOwnProperty("width")&&(n.mode=1);}t&&t.rtl&&i&&!t.hasOwnProperty("halign")&&(t.halign="right"),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px");var s=this.propertyMap;for(var o in s){var a=s[o],h=a[0],l=i?a[1]:this[o],u=a[2];if("wrapCallback"===o||"wrapCallbackScope"===o)this[o]=Ch(t,h,l);else {var c=xh(t,h,l);u&&(c=u(c)),this[o]=c;}}var d=Ch(t,"font",null);this._font=null===d?this.fontStyle+" "+this.fontSize+" "+this.fontFamily:d;var f=Ch(t,"fill",null);null!==f&&(this.color=uh(f));var p=Ch(t,"metrics",!1);return p?this.metrics={ascent:Ch(p,"ascent",0),descent:Ch(p,"descent",0),fontSize:Ch(p,"fontSize",0)}:!e&&this.metrics||(this.metrics=fh(this)),e?this.parent.updateText():this.parent}},{key:"syncFont",value:function(t,e){e.font=this._font;}},{key:"syncStyle",value:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round";}},{key:"syncShadow",value:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0);}},{key:"update",value:function(t){return t&&(this._font="".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily).trim(),this.metrics=fh(this)),this.parent.updateText(t)}},{key:"buildFont",value:function(){var t="".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily).trim();return t!==this._font&&(this._font=t),this}},{key:"setFont",value:function(t){return "string"==typeof t?(this.fontFamily=t,this.fontSize="",this.fontStyle=""):(this.fontFamily=Ch(t,"fontFamily","Courier"),this.fontSize=Ch(t,"fontSize","16px"),this.fontStyle=Ch(t,"fontStyle","")),this.update(!0)}},{key:"setFontFamily",value:function(t){return this.fontFamily=t,this.update(!0)}},{key:"setFontStyle",value:function(t){return this.fontStyle=t,this.update(!0)}},{key:"setFontSize",value:function(t){return "number"==typeof t&&(t=t.toString()+"px"),this.fontSize=t,this.update(!0)}},{key:"setTestString",value:function(t){return this.testString=t,this.update(!0)}},{key:"setFixedSize",value:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(this.isWrapFitMode)}},{key:"setResolution",value:function(t){return this.resolution=t,this.update(!1)}},{key:"setLineSpacing",value:function(t){return this.lineSpacing=t,this.update(!1)}},{key:"setXOffset",value:function(t){return this.xOffset=t,this.update(!1)}},{key:"setBackgroundColor",value:function(t,e,i){return void 0===i&&(i=!0),this.backgroundColor=uh(t,this.parent.canvas,this.parent.context),this.backgroundColor2=uh(e,this.parent.canvas,this.parent.context),this.backgroundHorizontalGradient=i,this.update(!1)}},{key:"setBackgroundStrokeColor",value:function(t,e){return this.backgroundStrokeColor=uh(t,this.parent.canvas,this.parent.context),this.backgroundStrokeLineWidth=e,this.update(!1)}},{key:"setBackgroundCornerRadius",value:function(t,e){return this.backgroundCornerRadius=t,this.backgroundCornerIteration=e,this.update(!1)}},{key:"setFill",value:function(t){return this.color=uh(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setColor",value:function(t){return this.color=uh(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setStroke",value:function(t,e){return void 0===t?this.strokeThickness=0:(void 0===e&&(e=this.strokeThickness),this.stroke=uh(t,this.parent.canvas,this.parent.context),this.strokeThickness=e),this.update(!0)}},{key:"setShadow",value:function(t,e,i,n,r,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===r&&(r=!1),void 0===s&&(s=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=uh(i,this.parent.canvas,this.parent.context),this.shadowBlur=n,this.shadowStroke=r,this.shadowFill=s,this.update(!1)}},{key:"setShadowOffset",value:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)}},{key:"setShadowColor",value:function(t){return void 0===t&&(t="#000"),this.shadowColor=uh(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setShadowBlur",value:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)}},{key:"setShadowStroke",value:function(t){return this.shadowStroke=t,this.update(!1)}},{key:"setShadowFill",value:function(t){return this.shadowFill=t,this.update(!1)}},{key:"setUnderline",value:function(t,e,i){return void 0===t&&(t="#000"),void 0===e&&(e=0),void 0===i&&(i=0),this.underlineColor=uh(t,this.parent.canvas,this.parent.context),this.underlineThickness=e,this.underlineOffset=i,this.update(!1)}},{key:"setUnderlineColor",value:function(t){return void 0===t&&(t="#000"),this.underlineColor=uh(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setUnderlineThickness",value:function(t){return void 0===t&&(t=0),this.underlineThickness=t,this.update(!1)}},{key:"setUnderlineOffset",value:function(t){return void 0===t&&(t=0),this.underlineOffset=t,this.update(!1)}},{key:"setStrikethrough",value:function(t,e,i){return void 0===t&&(t="#000"),void 0===e&&(e=0),void 0===i&&(i=0),this.strikethroughColor=uh(t,this.parent.canvas,this.parent.context),this.strikethroughThickness=e,this.strikethroughOffset=i,this.update(!1)}},{key:"setStrikethroughColor",value:function(t){return void 0===t&&(t="#000"),this.strikethroughColor=uh(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setStrikethroughThickness",value:function(t){return void 0===t&&(t=0),this.strikethroughThickness=t,this.update(!1)}},{key:"setStrikethroughOffset",value:function(t){return void 0===t&&(t=0),this.strikethroughOffset=t,this.update(!1)}},{key:"setWrapMode",value:function(t){return "string"==typeof t&&(t=Sh[t.toLowerCase()]||0),this.wrapMode=t,this.update(!0)}},{key:"setWrapWidth",value:function(t){return this.wrapWidth=t,this.update(!1)}},{key:"setAlign",value:function(t,e){return void 0===t&&(t="left"),void 0===e&&(e="top"),this.halign=t,this.valign=e,this.update(!1)}},{key:"setHAlign",value:function(t){return void 0===t&&(t="left"),this.halign=t,this.update(!1)}},{key:"setVAlign",value:function(t){return void 0===t&&(t="top"),this.valign=t,this.update(!1)}},{key:"setMaxLines",value:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)}},{key:"getTextMetrics",value:function(){var t=this.metrics;return {ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}}},{key:"setTextMetrics",value:function(t,e){return this.metrics.ascent=t.ascent,this.metrics.descent=t.descent,this.metrics.fontSize=t.fontSize,e&&("string"==typeof e?(this.fontFamily=e,this.fontSize="",this.fontStyle=""):(this.fontFamily=Ch(e,"fontFamily",this.fontFamily),this.fontSize=Ch(e,"fontSize",this.fontSize),this.fontStyle=Ch(e,"fontStyle",this.fontStyle))),this.parent.updateText(!0)}},{key:"lineHeight",get:function(){return this.metrics.fontSize+this.strokeThickness+this.lineSpacing}},{key:"toJSON",value:function(){var t={},e=this.propertyMap;for(var i in e)t[i]=this[i];return t.metrics=this.getTextMetrics(),t}},{key:"destroy",value:function(){this.parent=void 0;}}]),t}(),Sh={none:yh,word:kh,char:mh,character:mh},Ph=Phaser.Math.DegToRad,Oh=function(t){return !t.hasOwnProperty("convex")||t.convex},Th=function(t){return t.x>0&&t.y>0},_h=function(t,e,i,n,r,s,o,a,h){if(a&&o>s?o-=360:!a&&o=f?1:n/f,g=r>=p?1:r/p,y=d.cornerRadius;t.save(),t.beginPath(),t.translate(e,i),a=y.tl,Th(a)?(h=a.x*v,l=a.y*g,Oh(a)?_h(t,h,l,h,l,180,270,!1,o):_h(t,0,0,h,l,90,0,!0,o),u=0,c=l):(t.lineTo(0,0),u=0,c=0),a=y.tr,Th(a)?(h=a.x*v,l=a.y*g,Oh(a)?_h(t,n-h,l,h,l,270,360,!1,o):_h(t,n,0,h,l,180,90,!0,o)):t.lineTo(n,0),a=y.br,Th(a)?(h=a.x*v,l=a.y*g,Oh(a)?_h(t,n-h,r-l,h,l,0,90,!1,o):_h(t,n,r,h,l,270,180,!0,o)):t.lineTo(n,r),a=y.bl,Th(a)?(h=a.x*v,l=a.y*g,Oh(a)?_h(t,h,r-l,h,l,90,180,!1,o):_h(t,0,r,h,l,360,270,!0,o)):t.lineTo(0,r),t.lineTo(u,c),t.closePath(),t.restore();}(e,i,n,r,s,o,d),null!=a){var f;if(null!=u)(f=c?e.createLinearGradient(0,0,r,0):e.createLinearGradient(0,0,0,s)).addColorStop(0,a),f.addColorStop(1,u),a=f;e.fillStyle=a,e.fill();}null!=h&&l>0&&(e.strokeStyle=h,e.lineWidth=l,e.stroke());},Mh=function(t,e,i,n,r,s,o,a){if(null!=e||null!=i){var h=t.canvas.width,l=t.canvas.height;null==i&&(n=0);var u=n/2;h=Math.max(1,h-n),l=Math.max(1,l-n),Eh(t.canvas,t.context,u,u,h,l,r,e,i,n,s,o,a);}},Rh={draw:function(t,e,i,n){var r=this.penManager;this.hitAreaManager.clear();var s=this.context;s.save();var o=this.defaultStyle;this.clear(),Mh(this,o.backgroundColor,o.backgroundStrokeColor,o.backgroundStrokeLineWidth,o.backgroundCornerRadius,o.backgroundColor2,o.backgroundHorizontalGradient,o.backgroundCornerIteration),t+=this.startXOffset,e+=this.startYOffset;var a,h,l,u,c,d,f=o.halign,p=o.valign,v=o.lineHeight,g=r.lines,y=g.length,k=o.maxLines;k>0&&y>k?(h=k,l="center"===p?Math.floor((y-h)/2):"bottom"===p?y-h:0):(h=y,l=0),u=l+h;var m=this.rtl,b=m?this.parent.width:void 0;d="center"===p?Math.max((n-h*v)/2,0):"bottom"===p?Math.max(n-h*v-2,0):0,d+=e;for(var x=l;x0&&t.width>0){var a=i+o.underlineOffset-o.underlineThickness/2;this.drawLine(e,a,t.width,o.underlineThickness,o.underlineColor,o);}if(t.isTextPen&&this.drawText(e,i,t.text,o),t.isImagePen&&this.drawImage(e,i,t.prop.img,o),o.strikethroughThickness>0&&t.width>0){a=i+o.strikethroughOffset-o.strikethroughThickness/2;this.drawLine(e,a,t.width,o.strikethroughThickness,o.strikethroughColor,o);}if(s.restore(),t.hasAreaMarker&&t.width>0){var h,l=t.prop.area;if(l)h={key:l};else {var u=t.prop.url;h={key:"url:".concat(u),url:u};}this.hitAreaManager.add(e,i-this.startYOffset,t.width,this.defaultStyle.lineHeight,h);}},clear:function(){var t=this.canvas;this.context.clearRect(0,0,t.width,t.height);},drawLine:function(t,e,i,n,r,s){this.autoRound&&(t=Math.round(t),e=Math.round(e));var o=this.context;s.syncShadow(o,s.shadowStroke);var a=o.lineCap;o.lineCap="butt",o.strokeStyle=r,o.lineWidth=n,o.beginPath(),o.moveTo(t,e),o.lineTo(t+i,e),o.stroke(),o.lineCap=a;},drawText:function(t,e,i,n){this.autoRound&&(t=Math.round(t),e=Math.round(e));var r=this.context;n.stroke&&"none"!==n.stroke&&n.strokeThickness>0&&(n.syncShadow(r,n.shadowStroke),r.strokeText(i,t,e)),n.color&&"none"!==n.color&&(n.syncShadow(r,n.shadowFill),r.fillText(i,t,e));},drawImage:function(t,e,i,n){e-=this.startYOffset,this.parent.imageManager.draw(i,this.context,t,e,this.autoRound);}},Lh=Phaser.Utils.Objects.GetValue,Dh=ph,Ah=vh,zh=function(){function t(e){n(this,t),this.prop={},this.resetFromJSON(e);}return s(t,[{key:"resetFromJSON",value:function(t){this.text=Lh(t,"text",""),this.x=Lh(t,"x",0),this.y=Lh(t,"y",0),this.width=Lh(t,"width",0);var e=Lh(t,"prop",null);null===e&&(e={}),this.prop=e,this.newLineMode=Lh(t,"newLineMode",0),this.startIndex=Lh(t,"startIndex",0);}},{key:"plainText",get:function(){var t=this.text;return this.newLineMode===Ah&&(t+="\n"),t}},{key:"wrapText",get:function(){var t=this.text;return this.newLineMode!==Dh&&(t+="\n"),t}},{key:"rawTextLength",get:function(){var t=this.text.length;return this.newLineMode===Ah&&(t+=1),t}},{key:"endIndex",get:function(){return this.startIndex+this.rawTextLength}},{key:"lastX",get:function(){return this.x+this.width}},{key:"isTextPen",get:function(){return ""!==this.text}},{key:"isImagePen",get:function(){return !!this.prop.img}},{key:"hasAreaMarker",get:function(){return !!this.prop.area||!!this.prop.url}}]),t}(),Bh=Phaser.Utils.Objects.GetFastValue,Ih=ph,jh=gh,Wh=function(){function t(e){n(this,t),this.pens=[],this.lines=[],this.maxLinesWidth=void 0,this.pensPool=e.pensPool,this.linesPool=e.linesPool,this.tagToText=Bh(e,"tagToText",ie),this.tagToTextScope=Bh(e,"tagToTextScope",void 0);}return s(t,[{key:"destroy",value:function(){this.clear(),this.tagToText=void 0,this.tagToTextScope=void 0;}},{key:"clear",value:function(){for(var t=0,e=this.lines.length;t=this.lines.length)return this.getLineEndIndex(t);var e=this.lines[t];return e&&e[0]?e[0].startIndex:0}},{key:"getLineEndIndex",value:function(t){t>=this.lines.length&&(t=this.lines.length-1);var e,i,n=!1;for(e=t;e>=0&&!(n=null!=(i=this.lines[e])&&i.length>0);e--);return n?i[i.length-1].endIndex:0}},{key:"getLineWidth",value:function(t){var e=this.lines[t];if(!e)return 0;var i=e[e.length-1];return null==i?0:i.lastX}},{key:"getMaxLineWidth",value:function(){if(void 0!==this.maxLinesWidth)return this.maxLinesWidth;for(var t,e=0,i=0,n=this.lines.length;ie&&(e=t);return this.maxLinesWidth=e,e}},{key:"getLineWidths",value:function(){for(var t=[],e=0,i=this.lines.length;e=t&&h<=e||(o=o.substring(t-a,e-a)),this.tagToTextScope?c+=this.tagToText.call(this.tagToTextScope,o,l,u):c+=this.tagToText(o,l,u),u=l,!(h>=e)));d++);return c}},{key:"length",get:function(){return this.lines.length},set:function(t){this.clear();}}]),t}(),Fh={},Yh=function(){function t(){n(this,t),this.items=[];}return s(t,[{key:"destroy",value:function(){this.clear(),this.items=void 0;}},{key:"pop",value:function(){return this.items.length>0?this.items.pop():null}},{key:"push",value:function(t){return this.items.push(t),this}},{key:"pushMultiple",value:function(t){return this.items.push.apply(this.items,t),t.length=0,this}},{key:"clear",value:function(){return this.items.length=0,this}}]),t}(),Xh=Phaser.Geom.Rectangle,Vh=new Yh,Hh=function(){function t(){n(this,t),this.hitAreas=[];}return s(t,[{key:"destroy",value:function(){this.clear();}},{key:"clear",value:function(){for(var t=0,e=this.hitAreas.length;tr){""!==S?a.push(o.getLine(S,P,Zh)):0===T&&s>0&&a.push(o.getLine("",0,Zh)),a.push.apply(a,y(t(b,i,tl,r,0,o)));var E=a.pop();S=E.text,P=E.width,o.freeLine(E)," "===S&&(S="",P=0);}else (w=P+x)>l?(a.push(o.getLine(S,P,Zh)),S=b,P=x,l=r):(S+=b,P=w),C&&a.push(o.getLine(S,P,u));}return a},nl=Phaser.Utils.Objects.GetValue,rl=yh,sl=ph,ol=function(){function t(e){n(this,t),this.parent=e.parent,this.scene=this.parent.scene,this.context=nl(e,"context",null),this.canvas=this.context.canvas,this.parser=nl(e,"parser",null),this.defaultStyle=nl(e,"style",null),this.autoRound=!0,this.pensPool=e.pensPool,this.linesPool=e.linesPool,this.wrapTextLinesPool=e.wrapTextLinesPool,this.penManager=this.newPenManager(),this._tmpPenManager=null,this.hitAreaManager=new Hh,this.lastHitAreaKey=null,this.urlTagCursorStyle=null;var i=this.context;this.getTextWidth=function(t){return i.measureText(t).width};}return s(t,[{key:"destroy",value:function(){this.parent=void 0,this.scene=void 0,this.context=void 0,this.canvas=void 0,this.parser=void 0,this.defaultStyle=void 0,this.penManager&&(this.penManager.destroy(),this.penManager=void 0),this._tmpPenManager&&(this._tmpPenManager.destroy(),this._tmpPenManager=void 0),this.hitAreaManager&&(this.hitAreaManager.destroy(),this.hitAreaManager=void 0),this.pensPool=void 0,this.linesPool=void 0,this.wrapTextLinesPool=void 0;}},{key:"updatePenManager",value:function(t,e,i,n,r){if(void 0===r&&(r=this.penManager),r.clear(),""===t)return r;var s=this.parent.style;if(s.isWrapFitMode){var o=this.parent.padding;i=s.fixedWidth-o.left-o.right;}for(var a,h,l,u,c,d=this.canvas,f=this.context,p=function(t){return f.measureText(t).width},v=0,g=0,y=s.wrapCallback,k=s.wrapCallbackScope,m=!0,b=this.parser.splitText(t),x=this.wrapTextLinesPool,C=0,w=b.length;C0&&e!==rl&&i0&&t>e&&(t=e),t}},{key:"linesWidth",get:function(){return Math.ceil(this.penManager.getMaxLineWidth())}},{key:"linesHeight",get:function(){var t=this.desplayLinesCount,e=this.defaultStyle.lineHeight*t;return t>0&&(e-=this.defaultStyle.lineSpacing),e}},{key:"imageManager",get:function(){return this.parent.imageManager}},{key:"rtl",get:function(){return this.parent.style.rtl}},{key:"newPenManager",value:function(){return new Wh({pensPool:this.pensPool,linesPool:this.linesPool,tagToText:this.parser.propToTagText,tagToTextScope:this.parser})}},{key:"tmpPenManager",get:function(){return null===this._tmpPenManager&&(this._tmpPenManager=this.newPenManager()),this._tmpPenManager}},{key:"getPlainText",value:function(t,e,i){var n;if(null==t)n=this.penManager.plainText;else {var r=this.parser.splitText(t,1);n="";for(var s=0,o=r.length;s0}},{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}(lu);Object.assign(Eu.prototype,Pu);var Mu=function(t,e,i){return e.hasOwnProperty(t)?e[t]:i[t]},Ru=Phaser.Utils.Objects.GetValue,Lu=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,"background")).setScrollFactor(0),s.setColor(Ru(r,"color",null),Ru(r,"color2",null),Ru(r,"horizontalGradient",!0)),s.setStroke(Ru(r,"stroke",null),Ru(r,"strokeThickness",2)),s.setCornerRadius(Ru(r,"cornerRadius",0),Ru(r,"cornerIteration",null)),s}return s(i,[{key:"color",get:function(){return this._color},set:function(t){t=uh(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=uh(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=uh(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,Mu("color2",t,this),Mu("horizontalGradient",t,this)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,Mu("strokeThickness",t,this)),t.hasOwnProperty("cornerRadius")&&this.setCornerRadius(t.cornerRadius,Mu("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(){Mh(this.parent,this.color,this.stroke,this.strokeThickness,this.cornerRadius,this.color2,this.horizontalGradient,this.cornerIteration);}}]),i}(Eu),Du=Phaser.Utils.Objects.GetValue,Au=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,"innerbounds")).setScrollFactor(0),s.setColor(Du(r,"color",null),Du(r,"color2",null),Du(r,"horizontalGradient",!0)),s.setStroke(Du(r,"stroke",null),Du(r,"strokeThickness",2)),s}return s(i,[{key:"color",get:function(){return this._color},set:function(t){t=uh(t,this.canvas,this.context),this.setDirty(this._color!=t),this._color=t;}},{key:"color2",get:function(){return this._color2},set:function(t){t=uh(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=uh(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,Du(t,"color2",null),Du(t,"horizontalGradient",!0)),t.hasOwnProperty("stroke")&&this.setStroke(t.stroke,Du(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,r=this.parent.height-t.top-t.bottom,s=this.context;if(null!=this.color){var o,a;if(null!=this.color2)(a=this.horizontalGradient?s.createLinearGradient(0,0,n,0):s.createLinearGradient(0,0,0,r)).addColorStop(0,this.color),a.addColorStop(1,this.color2),o=a;else o=this.color;s.fillStyle=o,s.fillRect(e,i,n,r);}null!=this.stroke&&this.strokeThickness>0&&(s.strokeStyle=this.stroke,s.lineWidth=this.strokeThickness,s.strokeRect(e,i,n,r));}}]),i}(Eu),zu=Phaser.Utils.Objects.GetValue,Bu=function(){function t(e,i){n(this,t),this.parent=e,this.set(i);}return s(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(zu(t,"bold",!1)),this.setItalic(zu(t,"italic",!1)),this.setFontSize(zu(t,"fontSize","16px")),this.setFontFamily(zu(t,"fontFamily","Courier")),this.setColor(zu(t,"color","#fff")),this.setStrokeStyle(zu(t,"stroke",null),zu(t,"strokeThickness",0)),this.setShadow(zu(t,"shadowColor",null),zu(t,"shadowOffsetX",0),zu(t,"shadowOffsetY",0),zu(t,"shadowBlur",0)),this.setOffset(zu(t,"offsetX",0),zu(t,"offsetY",0)),this.setSpace(zu(t,"leftSpace",0),zu(t,"rightSpace",0)),this.setAlign(zu(t,"align",void 0)),this.setBackgroundColor(zu(t,"backgroundColor",null)),this.setBackgroundHeight(zu(t,"backgroundHeight",void 0)),this.setBackgroundBottomY(zu(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(Mu("stroke",t,this),Mu("strokeThickness",t,this)),t.hasOwnProperty("shadowColor")&&this.setShadowColor(t.shadowColor),(t.hasOwnProperty("shadowOffsetX")||t.hasOwnProperty("shadowOffsetY"))&&this.setShadowOffset(Mu("shadowOffsetX",t,this),Mu("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=uh(t),this}},{key:"hasFill",get:function(){return null!=this.color}},{key:"setStrokeStyle",value:function(t,e){return this.stroke=uh(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=uh(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=uh(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}(),Iu=Phaser.Utils.Array.Remove,ju=Phaser.Utils.Array.Remove,Wu="text",Fu="image",Yu="drawer",Xu="space",Vu="command",Hu=function(t){return t.type===Wu&&"\n"===t.text},Gu=function(t){return t.type===Wu&&"\f"===t.text},Nu=function(t){return t.type===Wu},Uu=function(t){a(i,t);var e=d(i);function i(t,r,s){var o;return n(this,i),(o=e.call(this,t,Wu)).updateTextFlag=!1,o.style=new Bu(u(o),s),o.setText(r),o}return s(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,r=e.backgroundBottomY;null==r&&(r=this.drawBLY);var s=e.backgroundHeight;null==s&&(s=r-this.drawTLY);var o=r-s;t.fillRect(i,o,n,s);}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}(Eu),Ku=function(t,e){var i=this.createCharChildren(t,e);return this.addChild(i),this},Ju=function(t){a(i,t);var e=d(i);function i(t,r,s){var o;return n(this,i),(o=e.call(this,t,Fu)).setTexture(r,s),o}return s(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}(Eu),qu=function(t){a(i,t);var e=d(i);function i(t,r,s,o){var a;return n(this,i),(a=e.call(this,t,Yu)).setRenderCallback(r),a.setDrawerSize(s,o),a}return s(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}(Eu),Zu=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,Xu)).setSpaceWidth(r),s}return s(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}(Eu),$u=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a){var h;return n(this,i),(h=e.call(this,t,Vu)).setName(r).setParameter(o).setCallback(s,a),h}return s(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}(lu),Qu=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)},tc=function(t,e,i,n){void 0===n&&(n={word:[],width:0}),n.word.length=0;for(var r=t.length,s=e,o=n.word,a=0;s0&&!a){var h=this.fixedHeight-n;if(i>0)s=h/i;else s=(l=nc.call(this)).height,o=l.ascent,i=Math.floor((h-o)/s);}else {var l;s=(l=nc.call(this)).height,o=l.ascent;}}else if(this.fixedHeight>0){if(void 0===(i=sc(t,"maxLines"))){h=this.fixedHeight-n;i=Math.floor(h/s);}}else i=sc(t,"maxLines",0);void 0===o&&(o=s);var u=0===i,c=sc(t,"wrapWidth",void 0);void 0===c&&(c=this.fixedWidth>0?this.fixedWidth-r:1/0);for(var d=sc(t,"letterSpacing",0),f=sc(t,"hAlign",0),p=sc(t,"vAlign",0),v=sc(t,"charWrap",!1),g=Qu({callback:"runWordWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:f,vAlign:p,ascent:o,lineHeight:s,wrapWidth:c,charWrap:v}),y=this.children,k=0,m=y.length;k0&&(_.push({children:E,width:M}),R=Math.max(R,M)),g.start+=T.length,g.isLastPage=!L&&g.start===O,g.maxLineWidth=R,g.linesHeight=_.length*s;var W=this.fixedWidth>0?this.fixedWidth:g.maxLineWidth+r,F=this.fixedHeight>0?this.fixedHeight:g.linesHeight+n;!function(t,e,i){var n,r,s=t.hAlign,o=t.vAlign,a=t.linesHeight;switch(o){case 1:case"center":r=(i-a)/2;break;case 2:case"bottom":r=i-a;break;default:r=0;}for(var h=t.lines,l=0,u=h.length;l0?(o=this.fixedWidth-r)/i:0;else if(this.fixedWidth>0){if(void 0===(i=hc(t,"maxLines",void 0))){var o=this.fixedWidth-r;i=Math.floor(o/s)+1;}}else i=hc(t,"maxLines",0);var a=0===i,h=hc(t,"fixedCharacterHeight",void 0);if(void 0===h){var l=hc(t,"charPerLine",void 0);if(void 0!==l){var u=this.fixedHeight-n;h=Math.floor(u/l);}}var c=hc(t,"wrapHeight",void 0);void 0===c&&(c=this.fixedHeight>0?this.fixedHeight-n:1/0);for(var d=hc(t,"letterSpacing",0),f=hc(t,"rtl",!0),p=hc(t,"hAlign",f?2:0),v=hc(t,"vAlign",0),g=Qu({callback:"runVerticalWrap",start:e,padding:this.wrapPadding,letterSpacing:d,maxLines:i,hAlign:p,vAlign:v,lineWidth:s,fixedCharacterHeight:h,wrapHeight:c,rtl:f}),y=this.children,k=0,m=y.length;k0&&(_.push({children:E,height:M}),R=Math.max(R,M)),g.start+=T.length,g.isLastPage=g.start===O,g.maxLineHeight=R,g.linesWidth=_.length*s;var I=this.fixedWidth>0?this.fixedWidth:g.linesWidth+r,j=this.fixedHeight>0?this.fixedHeight:g.maxLineHeight+n;!function(t,e,i){var n,r,s=t.hAlign,o=t.vAlign,a=t.rtl,h=t.lines,l=t.lineWidth,u=t.linesWidth;switch(s){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,r=i.right,s=i.top,o=i.bottom;return Je(i,t,e),this.dirty=this.dirty||n!=i.left||r!=i.right||s!=i.top||o!=i.bottom,this},getPadding:function(t){return Ke(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),Iu(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 ju(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,r,s=Array.isArray(t);void 0===e||e===this.children.length?s?(i=this.children).push.apply(i,y(t)):this.children.push(t):s?(n=this.children).splice.apply(n,[e,0].concat(y(t))):this.children.splice(e,0,t);(this.lastAppendedChildren.length=0,s)?(r=this.lastAppendedChildren).push.apply(r,y(t)):this.lastAppendedChildren.push(t);return this},createCharChild:function(t,e){e&&this.textStyle.modify(e);var i=this.poolManager.allocate(Wu);return null===i?i=new Uu(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,r=t.length;ne&&(n=e,r=t);})),r},getCharWorldPosition:function(t,e,i,n){return "number"==typeof t&&(t=this.getCharChild(t,!0)),Su(this,t,e,i,n)},setToMinSize:function(){for(var t=this.children,e=0,i=0,n=0,r=t.length;n=i.length&&(t=i.length);for(var n=0,r=0;r0,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=md(t,"tl",0),this.radiusTR=md(t,"tr",0),this.radiusBL=md(t,"bl",0),this.radiusBR=md(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,r=this.height,s=this.iterations+1;(e=this.radiusTL)>0?this._convexTL?ta(e,e,e,e,180,270,!1,s,t):ta(0,0,e,e,90,0,!0,s,t):$o(0,0,t);(e=this.radiusTR)>0?this._convexTR?ta(n-e,e,e,e,270,360,!1,s,t):ta(n,0,e,e,180,90,!0,s,t):$o(n,0,t);(e=this.radiusBR)>0?this._convexBR?ta(n-e,r-e,e,e,0,90,!1,s,t):ta(n,r,e,e,270,180,!0,s,t):$o(n,r,t);(e=this.radiusBL)>0?this._convexBL?ta(e,r-e,e,e,90,180,!1,s,t):ta(0,r,e,e,360,270,!0,s,t):$o(0,r,t);return t.push(t[0],t[1]),nd(this.x,this.y,t),p(h(i.prototype),"updateData",this).call(this),this}}]),i}(Zc);Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,Phaser.Math.Wrap;var xd=Phaser.Math.Linear,Cd=function(){var t,e,i,n,r,s,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,r=k.x,s=k.y;}else {var m=p[this.previousDirection],b=p[this.direction],x=this.easeDirectionProgress;t=xd(m.a.x,b.a.x,x),e=xd(m.a.y,b.a.y,x),i=xd(m.b.x,b.b.x,x),n=xd(m.b.y,b.b.y,x),r=xd(m.c.x,b.c.x,x),s=xd(m.c.y,b.c.y,x);}o.startAt(t,e).lineTo(i,n).lineTo(r,s),this.arrowOnly?o.end():o.close();},wd=(0, Phaser.Math.DegToRad)(120),Sd=function(t){t=this.getShape("triangle");var e=this.width/2,i=this.height/2,n=Math.min(e,i)*this.radius,r=this.verticeRotation;t.startAt(e+n*Math.cos(r+wd),i+n*Math.sin(r+wd)).lineTo(e+n*Math.cos(r),i+n*Math.sin(r)).lineTo(e+n*Math.cos(r-wd),i+n*Math.sin(r-wd)),this.arrowOnly?t.end():t.close();},Pd={buildShapes:function(){this.addShape((new kd).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?Cd.call(this):Sd.call(this);}},Od={setEaseDuration:function(t){return void 0===t&&(t=0),this.easeDuration=t,this},playEaseDirectionation:function(){return void 0===this.easeDirectionProgressTask&&(this.easeDirectionProgressTask=new bn(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}},Td=Phaser.Utils.Objects.GetValue,_d=Phaser.Utils.Objects.IsPlainObject,Ed=Phaser.Math.DegToRad,Md=Phaser.Math.RadToDeg,Rd=function(t){a(r,t);var e=d(r);function r(t,i,s,o,a,h,l){var u,c,d,f,p,v,g,y,k;if(n(this,r),_d(i)){var m=i;i=m.x,s=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===s&&(s=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,s,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 s(r,[{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=Dd(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,r){if("object"===i(t)){var s=t,o=Td(s,"x",null);null!==o?(t=o,n=o):(t=Td(s,"left",0),n=Td(s,"right",t));var a=Td(s,"y",null);null!==a?(e=a,r=a):(e=Td(s,"top",0),r=Td(s,"bottom",e));}else void 0===t&&(t=0),void 0===e&&(e=t),void 0===n&&(n=t),void 0===r&&(r=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!=r,this.padding.left=t,this.padding.top=e,this.padding.right=n,this.padding.bottom=r,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 Md(this.verticeRotation)},set:function(t){this.verticeRotation=Ed(t);}},{key:"setVerticeAngle",value:function(t){return this.verticeAngle=t,this}}]),r}(Uc),Ld={right:0,down:1,left:2,up:3},Dd=function(t){return "string"==typeof t&&(t=Ld[t]),t%=4};Object.assign(Rd.prototype,Pd,Od);var Ad=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={}),(s=e.call(this,t,r)).type="rexTweaker.FolderTitle";var o=new Rd(t,r.expandedIcon);return t.add.existing(o),s.addSpace().add(o,{proportion:0,expand:!1,padding:1,fitRatio:1}),s.addChildrenMap("expandedIcon",o),s}return s(i,[{key:"setExpandedState",value:function(t){void 0===t&&(t=!0);var e=t?"down":"right";return this.childrenMap.expandedIcon.setDirection(e),this}}]),i}(Yc),zd=function(t,e){var i=new Fp(t,e);return t.add.existing(i),i},Bd=function(t,e,i){return th(t,i)},Id=function(t){a(i,t);var e=d(i);function i(t,r){return n(this,i),void 0===r&&(r={}),r.destroy=!1,e.call(this,t,r)}return s(i,[{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}(Nn),jd={expand:function(t){if(!0===this.expanded)return this;void 0===t&&(t=this.transitionDuration),this.expanded=!0;var e=this.childrenMap.title,i=this.childrenMap.child;return this.show(i),(this.reLayoutTarget?this.reLayoutTarget:this.getTopmostSizer()).layout(),e.emit("folder.expand",t,this),i.emit("folder.expand",t,this),this.emit("expand.start",this),this.childTransition.once("open",(function(){this.emit("expand.complete",this);}),this).requestOpen(null,t),this},collapse:function(t){if(!1===this.expanded)return this;void 0===t&&(t=this.transitionDuration),this.expanded=!1;var e=this.childrenMap.title,i=this.childrenMap.child;return e.emit("folder.collapse",t,this),i.emit("folder.collapse",t,this),this.emit("collapse.start",this),this.childTransition.once("close",(function(){this.setChildScale(i,1,1).hide(i),(this.reLayoutTarget?this.reLayoutTarget:this.getTopmostSizer()).layout(),this.emit("collapse.complete",this);}),this).requestClose(null,t),this},toggle:function(t){return this.expanded?this.collapse(t):this.expand(t),this}},Wd=function(t,e){Xi.popUp.call(t,e,this.expandDirection);},Fd=function(t,e){Xi.scaleDown.call(t,e,this.expandDirection);},Yd={setTransitionDuration:function(t){return this.transitionDuration=t,this.childTransition.setTransitInTime(t).setTransitOutTime(t),this},setExpandCallback:function(t){return void 0===t&&(t=Wd.bind(this)),this.childTransition.setTransitInCallback(t),this},setCollapseCallback:function(t){return void 0===t&&(t=Fd.bind(this)),this.childTransition.setTransitOutCallback(t),this}},Xd=Phaser.Utils.Objects.GetValue,Vd=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={}),r.hasOwnProperty("orientation")||(r.orientation=1),(s=e.call(this,t,r)).type="rexFolder",s.expanded=void 0,s.expandDirection=1===s.orientation?"y":"x";var o=r.background,a=r.title,h=r.child;o&&s.addBackground(o);var l=1===s.orientation?"left":"top",c=Xd(r,"align.title",l),d=Xd(r,"expand.title",!0);s.add(a,{proportion:0,align:c,expand:d});var f=Xd(r,"toggleByTarget",void 0),p=Xd(r,"toggleClickConfig");if(void 0===f&&(f=a),f&&_r.onClick.call(f,(function(){this.toggle();}),u(s),p),s.childTransition=new Id(h),!Xd(r,"customChildOrigin",!1)){var v=s.rtl?1:0;h.setOrigin(v);}c=Xd(r,"align.child","left");var g=(d=Xd(r,"expand.child",!0))?1:0;s.add(h,{proportion:g,align:c,expand:d}),s.addChildrenMap("title",a),s.addChildrenMap("child",h),s.addChildrenMap("background",o);var y=r.transition;s.setTransitionDuration(Xd(y,"duration",200)),s.setExpandCallback(Xd(y,"expandCallback",void 0)),s.setCollapseCallback(Xd(y,"collapseCallback",void 0)),s.reLayoutTarget=Xd(r,"reLayoutTarget",void 0);var k=r.onExpandStart;k&&s.on("expand.start",k);var m=r.onExpandComplete;m&&s.on("expand.complete",m);var b=r.onCollapseStart;b&&s.on("collapse.start",b);var x=r.onCollapseComplete;return x&&s.on("collapse.complete",x),s}return s(i)}(Mo);Object.assign(Vd.prototype,jd,Yd);var Hd=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).type="rexTweaker.Folder",s}return s(i,[{key:"setTitle",value:function(t){return this.childrenMap.title.setTitle(t),this}}]),i}(Vd);Object.assign(Hd.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 Gd=Phaser.Utils.Objects.GetValue,Nd=Phaser.Utils.Objects.GetValue,Ud=Mo.prototype.add,Kd=Mo.prototype.addSpace,Jd=function(t){var e=!t.isRexSpace,i=!e||this.buttonsExpand?1:0;if(0===this.sizerChildren.length)if(e){!this.buttonsExpand&&("right"===this.buttonsAlign||"center"===this.buttonsAlign||"bottom"===this.buttonsAlign)&&Kd.call(this),Ud.call(this,t,{proportion:i,expand:!0});var n=!this.buttonsExpand&&"center"===this.buttonsAlign;n&&Kd.call(this),this.hasTailSpace=n;}else Ud.call(this,t,{proportion:i,expand:!0}),this.hasTailSpace=!1;else if(this.hasTailSpace){var r=this.sizerChildren.length-1;Ud.call(this,t,{index:r,proportion:i,expand:!0});}else Ud.call(this,t,{proportion:i,expand:!0});return e&&this.buttonGroup.add(t),this},qd={addButton:function(t){if(dr(t))for(var e=t,i=0,n=e.length;i=0;i--)Qd.call(this,e[i],t);return this}},ef=function(t,e,i){if(t){var n=this.setValueCallback,r=this.setValueCallbackScope;n&&(r?n.call(r,t,e,i):n(t,e,i)),this.fireEvent("button.statechange",t,e,i);}},nf=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,ef.call(e,t,i,n);}},enumerable:!0,configurable:!0}),t.selected=!1;},rf={add:function(t){return this.buttons.push(t),t._click||(t._click=new Or(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,r){this.fireEvent("button.over",t,e,r);}),this).on("pointerout",(function(e,i){this.fireEvent("button.out",t,e,i);}),this).on("pointerdown",(function(e,i,n,r){this.fireEvent("button.down",t,e,r);}),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")),nf.call(this,t)),this},addMultiple:function(t){for(var e=0,i=t.length;e2?o-2:0),h=2;ha.height/2)){r>(h=bf(a.left,a.centerY,t,e))&&(r=h,n=s);var h,l=i[s+1];if(!l||l.y!==a.y)r>(h=bf(a.right,a.centerY,t,e))&&(r=h,n=s+1);}}return n},Cf=Phaser.Utils.Objects.IsPlainObject,wf=Phaser.Utils.Objects.GetValue,Sf=Phaser.Display.Align.CENTER,Pf=function(t,e,i,n){if("\n"===t)return this.addNewLine(),this;var r;(Ae.call(this,t),Cf(e))&&(e=wf(r=e,"padding",0),i=wf(r,"key",void 0),n=wf(r,"index",void 0));return void 0===e&&(e=0),(r=this.getSizerConfig(t)).align=Sf,r.padding=Le(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},Of={add:function(t,e,i){if(dr(t))for(var n=t,r=0,s=n.length;r=0;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,bo.call(this,t),this}},Ef={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,r=i.length;nr&&Bf.addNewLine(this);}else for(s=0,o=t.length;s=0;i--)Yf.call(this,e[i],t);return this}},Vf=Phaser.Utils.Objects.GetValue,Hf=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={});var o=r.space;"number"==typeof o&&(r.space={item:o,line:o}),(s=e.call(this,t,r)).type="rexFixWidthButtons",s.buttonGroup=new cf({parent:u(s),eventEmitter:Vf(r,"eventEmitter",u(s)),groupName:Vf(r,"groupName",void 0),clickConfig:Vf(r,"click",void 0)}).setButtonsType(r);var a=Vf(r,"background",void 0),h=Vf(r,"buttons",void 0);return s.buttonsAlign=Vf(r,"align",void 0),a&&s.addBackground(a),h&&s.addButtons(h),s.addChildrenMap("background",a),s.addChildrenMap("buttons",s.buttonGroup.buttons),s}return s(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}(Af);Object.assign(Hf.prototype,jf,Xf,uf,ff);var Gf=Phaser.Utils.Objects.IsPlainObject,Nf=Phaser.Utils.Objects.GetValue,Uf=Phaser.Display.Align.CENTER,Kf=Phaser.Utils.String.UUID,Jf={add:function(t,e,i,n,r,s,o,a,h){(Ae.call(this,t),Gf(e))&&(e=Nf(l=e,"key",void 0),i=Nf(l,"align",Uf),a=Nf(l,"offsetX",0),h=Nf(l,"offsetY",0),n=Nf(l,"padding",0),r=Nf(l,"expand",!0),t.isRexSizer||(s=Nf(l,"minWidth",t._minWidth),o=Nf(l,"minHeight",t._minHeighted)));var l,u=void 0!==e;return u||(e=Kf()),"string"==typeof i&&(i=ee[i]),void 0===i&&(i=Uf),void 0===a&&(a=0),void 0===h&&(h=0),void 0===n&&(n=0),void 0===r&&(r=!0),t.isRexSizer||(void 0===s&&(s=t._minWidth),void 0===o&&(o=t._minHeight)),(l=this.getSizerConfig(t)).align=i,l.alignOffsetX=a,l.alignOffsetY=h,l.padding=Le(n),Gf(r)?(l.expandWidth=Nf(r,"width",!1),l.expandHeight=Nf(r,"height",!1)):(l.expandWidth=r,l.expandHeight=r),t.isRexSizer||(l.expandWidth&&(t.minWidth=void 0===s?kt(t):s),l.expandHeight&&(t.minHeight=void 0===o?mt(t):o)),this.sizerChildren.hasOwnProperty(e)&&this.sizerChildren[e].destroy(),this.sizerChildren[e]=t,u&&this.addChildrenMap(e,t),this}},qf={remove:function(t,e){var i;if("string"==typeof t){if(i=t,!(t=this.sizerChildren[i]))return this}else {if(this.getParentSizer(t)!==this)return this;i=this.childToKey(t);}return i&&(delete this.sizerChildren[i],this.childrenMap.hasOwnProperty(i)&&delete this.childrenMap[i]),Ye.call(this,t,e),this},removeAll:function(t){for(var e in this.sizerChildren)this.remove(e,t);return this},clear:function(t){for(var e in this.sizerChildren)delete this.sizerChildren[e],this.childrenMap.hasOwnProperty(e)&&delete this.childrenMap[e];return bo.call(this,t),this}},Zf={getChildrenWidth:function(){if(this.rexSizer.hidden)return 0;var t,e,i,n=0,r=this.sizerChildren;for(var s in r)e=(t=r[s]).rexSizer.padding,i=this.getChildWidth(t)+e.left+e.right,n=Math.max(i,n);return n+this.space.left+this.space.right},getChildrenHeight:function(){if(this.rexSizer.hidden)return 0;var t,e,i,n=0,r=this.sizerChildren;for(var s in r)i=(t=r[s]).isRexSizer?Math.max(t.minHeight,t.childrenHeight):void 0!==t.minHeight?t.minHeight:mt(t),i+=(e=t.rexSizer.padding).top+e.bottom,n=Math.max(i,n);return n+this.space.top+this.space.bottom},getExpandedChildWidth:function(t,e){var i;void 0===e&&(e=this.width);var n=t.rexSizer;if(n.expandWidth){var r=e-this.space.left-this.space.right,s=n.padding;i=r-s.left-s.right;}return i},getExpandedChildHeight:function(t,e){var i;void 0===e&&(e=this.height);var n=t.rexSizer;if(n.expandHeight){var r=e-this.space.top-this.space.bottom,s=n.padding;i=r-s.top-s.bottom;}return i},getChildrenSizers:function(t){void 0===t&&(t=[]);var e,i=this.sizerChildren;for(var n in i)(e=i[n]).isRexSizer&&t.push(e);return t},layoutChildren:function(){var t,e,i,n,r,s,o,a,h,l=this.innerLeft,u=this.innerTop,c=this.innerWidth,d=this.innerHeight,f=this.sizerChildren;for(var p in f)(t=f[p]).rexSizer.hidden||(i=(e=t.rexSizer).padding,xr.call(this,t),t.isRexSizer?(t.runLayout(this,this.getExpandedChildWidth(t),this.getExpandedChildHeight(t)),ho(t,this)):(a=void 0,h=void 0,e.expandWidth&&(a=c-i.left-i.right),e.expandHeight&&(h=d-i.top-i.bottom),yr(t,a,h)),n=l+i.left,s=c-i.left-i.right,r=u+i.top,o=d-i.top-i.bottom,Cr.call(this,t,n,r,s,o,e.align,e.alignOffsetX,e.alignOffsetY));}};Object.assign(Zf,Jf,qf);var $f=Phaser.Utils.Objects.IsPlainObject,Qf=Phaser.Utils.Objects.GetValue,tp=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h){var l;return n(this,i),$f(r)?(r=Qf(h=r,"x",0),s=Qf(h,"y",0),o=Qf(h,"width",void 0),a=Qf(h,"height",void 0)):$f(o)&&(o=Qf(h=o,"width",void 0),a=Qf(h,"height",void 0)),(l=e.call(this,t,r,s,o,a,h)).type="rexOverlapSizer",l.sizerChildren={},l.addChildrenMap("items",l.sizerChildren),l}return s(i,[{key:"childToKey",value:function(t){if("string"!=typeof t)return function(t,e){if(Array.isArray(t))return t.indexOf(e);for(var i in t)if(t[i]===e)return i;return null}(this.sizerChildren,t);var e=t;return this.sizerChildren.hasOwnPropery(e)?e:null}}]),i}(ao);Object.assign(tp.prototype,Zf);var ep=tp.prototype.add,ip=function(t,e,i,n,r,s,o,a,h){return t.setVisible(!1),ep.call(this,t,e,i,n,r,s,o,a,h),this},np={add:ip,addPage:ip},rp=Kt.prototype.setChildVisible,sp={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?(rp.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&&(rp.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(sp,np);var op=Phaser.Utils.Objects.GetValue,ap=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r)).type="rexPages",s.childrenMap=s.sizerChildren,s._previousKey=void 0,s._currentKey=void 0,s.setSwapMode(op(r,"swapMode",0)),s.setFadeInDuration(op(r,"fadeIn",0)),s}return s(i,[{key:"setSwapMode",value:function(t){return "string"==typeof t&&(t=hp[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}(tp);Object.assign(ap.prototype,sp);var hp={invisible:0,destroy:1},lp=Phaser.Utils.Objects.IsPlainObject,up=Phaser.Utils.Objects.GetValue,cp=Phaser.Utils.String.UUID,dp={swapPage:function(t,e){var i,n;null!=(i="number"==typeof t?t:this.getPageIndex(t))&&(void 0!==e&&(n=this.childrenMap.pages.fadeInDuration,this.childrenMap.pages.fadeInDuration=e),this.childrenMap.tabs.emitButtonClick(i),void 0!==n&&(this.childrenMap.pages.fadeInDuration=n));return this},swapFirstPage:function(t){return this.swapPage(0,t),this},swapLastPage:function(t){var e=this.getElement("tabs.buttons").length-1;return this.swapPage(e,t),this}},fp={removePage:function(t,e){"number"==typeof t&&(t=this.getPageKey(t));var i=this.childrenMap.tabs,n=i.getByName(t),r=this.childrenMap.pages,s=r.getElement(t);return n&&s?(r.removeChildrenMap(t),i.removeButton(n,e),r.remove(s,e),this):this}},pp={getPageKey:function(t){var e=this.getElement("tabs.buttons");if(!(t>=e.length))return e[t].name},getPageIndex:function(t){for(var e=this.getElement("tabs.buttons"),i=0,n=e.length;i0?0:1,s.setMinWidth(this.itemWidth)),this.add(s,{proportion:r,expand:!0}),i.onValueChange&&o.on("valuechange",i.onValueChange),s.setAutoUpdateEnable(i.autoUpdate),s.setBindingTarget(t,e),i.monitor&&s.startMonitorTarget(),i.key&&this.root.addChildrenMap(i.key,s),this},addButton:Bp,addButtons:Bp,addSeparator:function(t){var e=this.scene,i=Ip(this.styles,"separator"),n=Bd(e,0,i);return this.add(n,{expand:!0}),this},setBindingTarget:function(t){for(var e=this.sizerChildren,i=0,n=e.length;i=r&&h=i&&hi.length&&(t.prevCursorPosition=null),null!==t.prevCursorPosition&&(r=e.getCharChild(t.prevCursorPosition))&&("\n"===r.text&&r.clearTextSize(),e.emit("cursorout",r,t.prevCursorPosition,e)),null!=n&&(r=e.getCharChild(n))&&("\n"===r.text&&r.copyTextSize(e.lastInsertCursor),function(t){var e,i,n=t.parent,r=n.width,s=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>r?r-l:0,i=u<0?0-u:c>s?s-c:0,n._textOX+=e,n._textOY+=i;}(r),e.emit("cursorin",r,n,e)),e.emit("movecursor",n,t.prevCursorPosition,e),t.prevCursorPosition=n;}}(this)):(nv(this),rv(this)),this}},{key:"setNumberInput",value:function(){return this.onUpdateCallback=iv,this}},{key:"setSelectAllWhenFocusEnable",value:function(t){return void 0===t&&(t=!0),this.selectAllWhenFocus=t,this}}]),i}(ev),av=Phaser.Utils.Objects.GetValue,hv=["inputType","onOpen","onFocus","onClose","onBlur","onUpdate","enterClose","readOnly","maxLength","minLength","selectAll"],lv=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,r=0;rt.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}fv.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 r=this;function s(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 s([{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 s(pv(r,n.components,e,t,r.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 r=e.length,s=i.length,o=t.newPos,a=o-n,h=0;o+1=0;e--){var i=this.sizerChildren[e];i&&this.remove(i,t);}return this},clear:function(t){return Fv(this.sizerChildren,null),bo.call(this,t),this}},Xv={setColumnSpace:function(t){if(this.space.column||(this.space.column=[]),this.space.column.length=this.columnCount-1,"number"==typeof t)Fv(this.space.column,t);else for(var e=0,i=this.columnCount-1;e=0;n--){var r=n*this.columnCount+t;this.sizerChildren.splice(r,0,null);}return this.columnProportions.push(e),this.columnWidth.length+=1,this.space.column.splice(t,0,i),this},Nv={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);for(var e,i,n,r,s=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=$e.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 r in this.sizerChildren)(e=this.sizerChildren[r])&&e.isRexSizer&&!e.ignoreLayout&&(n=this.getColumnWidth(parseInt(r)%this.columnCount),i=this.getExpandedChildWidth(e,n),i=e.resolveWidth(i),e.resolveChildrenWidth(i));},runWidthWrap:function(t){var e,i,n;for(var r in this.sizerChildren)!(e=this.sizerChildren[r])||e.isRexSizer&&e.ignoreLayout||!e.runWidthWrap||(n=this.getColumnWidth(parseInt(r)%this.columnCount),i=this.getExpandedChildWidth(e,n),e.isRexSizer&&(i=e.resolveWidth(i)),e.runWidthWrap(i));return this},resetGrid:function(t,e,i,n,r){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,Fv(this.sizerChildren,null),this.columnProportions=[],this.columnProportions.length=t,"number"==typeof i)Fv(this.columnProportions,i);else for(var s=0;s0&&(e+=t);return e},Kv=function(){for(var t,e=0,i=0;i0&&(e+=t);return e},Jv=Phaser.Utils.Objects.IsPlainObject,qv=Phaser.Utils.Objects.GetValue,Zv=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h,l,u,c,d){var f;return n(this,i),Jv(r)?(r=qv(d=r,"x",0),s=qv(d,"y",0),o=qv(d,"width",void 0),a=qv(d,"height",void 0),h=qv(d,"column",d.col||0),l=qv(d,"row",0),u=qv(d,"columnProportions",0),c=qv(d,"rowProportions",0)):Jv(o)?(o=qv(d=o,"width",void 0),a=qv(d,"height",void 0),h=qv(d,"column",d.col||0),l=qv(d,"row",0),u=qv(d,"columnProportions",0),c=qv(d,"rowProportions",0)):Jv(h)?(h=qv(d=h,"column",d.col||0),l=qv(d,"row",0),u=qv(d,"columnProportions",0),c=qv(d,"rowProportions",0)):Jv(u)&&(u=qv(d=u,"columnProportions",0),c=qv(d,"rowProportions",0)),(f=e.call(this,t,r,s,o,a,d)).type="rexGridSizer",f.sizerChildren=[],f.addChildrenMap("items",f.sizerChildren),f.setCreateCellContainerCallback(qv(d,"createCellContainerCallback")),f.setIndentLeft(qv(d,"space.indentLeftOdd",0),qv(d,"space.indentLeftEven",0)),f.setIndentTop(qv(d,"space.indentTopOdd",0),qv(d,"space.indentTopEven",0)),f.resetGrid(h,l,u,c,qv(d,"space",void 0)),f}return s(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=Uv.call(this)),this._totalColumnProportions}},{key:"totalRowProportions",get:function(){return void 0===this._totalRowProportions&&(this._totalRowProportions=Kv.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}(ao);Object.assign(Zv.prototype,Nv);var $v=Phaser.Utils.Objects.GetValue,Qv=Phaser.Math.Linear,tg=Phaser.Math.Percent,eg={setValue:function(t,e,i){return null==t||(void 0!==e&&(t=tg(t,e,i)),this.value=t),this},addValue:function(t,e,i){return void 0!==e&&(t=tg(t,e,i)),this.value+=t,this},getValue:function(t,e){var i=this.value;return void 0!==t&&(i=Qv(t,e,i)),i}},ig=Phaser.Math.Percent,ng={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=ig(t,e,i)),void 0===this.easeValueTask&&(this.easeValueTask=new bn(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 bn(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,from:t,to:e,duration:this.easeValueDuration,ease:this.easeFunction,repeat:i,repeatDelay:n}),this}},rg=Phaser.Utils.Objects.GetValue,sg=Phaser.Math.Clamp;var og=Phaser.Math.Percent,ag=function(t,e,i){var n;return t.y===e.y?n=og(i.x,t.x,e.x):t.x===e.x&&(n=og(i.y,t.y,e.y)),n},hg=function(t,e,i){var n,r;this.enable&&(lg.x=e,lg.y=i,this.reverseAxis?(n=this.getEndPoint(),r=this.getStartPoint()):(n=this.getStartPoint(),r=this.getEndPoint()),this.value=ag(n,r,lg));},lg={},ug=function(t,e,i){if(this.enable&&t.isDown){var n,r;cg.x=t.worldX,cg.y=t.worldY,this.reverseAxis?(n=this.getEndPoint(),r=this.getStartPoint()):(n=this.getStartPoint(),r=this.getEndPoint());var s=ag(n,r,cg);this.stopEaseValue(),0===this.easeValueDuration||Math.abs(this.value-s)<.1?this.value=s:this.easeValueTo(s);}},cg={},dg=function(t,e){void 0===e&&(e=fg);var i=this.childrenMap.thumb,n=i.x,r=i.y;return Oe(i,this.innerLeft,this.innerTop,this.innerWidth,this.innerHeight,t),e.x=i.x,e.y=i.y,i.x=n,i.y=r,e},fg={},pg=Phaser.Display.Align.LEFT_CENTER,vg=Phaser.Display.Align.TOP_CENTER,gg={},yg=Phaser.Display.Align.RIGHT_CENTER,kg=Phaser.Display.Align.BOTTOM_CENTER,mg={},bg=Phaser.Math.Linear,xg={},Cg=Phaser.Display.Align.LEFT_CENTER,wg=Phaser.Display.Align.TOP_CENTER,Sg=Phaser.Display.Align.RIGHT_CENTER,Pg=Phaser.Display.Align.BOTTOM_CENTER,Og=Phaser.Utils.Objects.GetValue,Tg=Phaser.Utils.Objects.IsPlainObject,_g=Phaser.Math.Clamp,Eg=Phaser.Math.Snap.To,Mg=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),(s=e.call(this,t,r)).type="rexSlider",s.bootProgressBase(r),s.reverseAxis=Og(r,"reverseAxis",!1);var o=Og(r,"background",void 0),a=Og(r,"track",void 0),h=Og(r,"indicator",void 0),l=Og(r,"thumb",void 0);o&&(Tg(o)&&(o=th(t,o)),s.addBackground(o)),a&&(Tg(a)&&(a=th(t,a)),s.add(a,{proportion:1,expand:!0,minWidth:0===s.orientation?0:void 0,minHeight:1===s.orientation?0:void 0})),h&&(Tg(h)&&(h=th(t,h)),s.pin(h)),l&&(Tg(l)&&(l=th(t,l)),s.pin(l));var c=Og(r,"input",0);switch("string"==typeof c&&(c=Rg[c]),c){case 0:l&&(l.setInteractive(),s.scene.input.setDraggable(l),l.on("drag",hg,u(s)).on("dragstart",(function(t){this.eventEmitter.emit("inputstart",t);}),u(s)).on("dragend",(function(t){this.eventEmitter.emit("inputend",t);}),u(s)));break;case 1:s.on("pointerdown",ug,u(s)).on("pointermove",ug,u(s)).on("pointerdown",(function(t){this.eventEmitter.emit("inputstart",t);}),u(s)).on("pointerup",(function(t){this.eventEmitter.emit("inputend",t);}),u(s)).on("pointerover",(function(t){t.isDown&&this.eventEmitter.emit("inputstart",t);}),u(s)).on("pointerout",(function(t){t.isDown&&this.eventEmitter.emit("inputend",t);}),u(s)).setInteractive();}return s.addChildrenMap("background",o),s.addChildrenMap("track",a),s.addChildrenMap("indicator",h),s.addChildrenMap("thumb",l),s.setEnable(Og(r,"enable",void 0)),s.setGap(Og(r,"gap",void 0)),s.setValue(Og(r,"value",0),Og(r,"min",void 0),Og(r,"max",void 0)),s}return s(i,[{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"setGap",value:function(t,e,i){return t&&void 0!==e&&(t/=i-e),this.gap=t,this}},{key:"value",get:function(){return this._value},set:function(t){void 0!==this.gap&&(t=Eg(t,this.gap));var e=this._value;this._value=_g(t,0,1),e!==this._value&&(this.updateThumb(this._value),this.updateIndicator(this._value),this.eventEmitter.emit("valuechange",this._value,e,this.eventEmitter));}},{key:"runLayout",value:function(t,e,n){return this.ignoreLayout||(p(h(i.prototype),"runLayout",this).call(this,t,e,n),this.updateThumb(),this.updateIndicator()),this}}]),i}(function(t){var e=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return s(i,[{key:"bootProgressBase",value:function(t){this.eventEmitter=rg(t,"eventEmitter",this);var e=rg(t,"valuechangeCallback",null);if(null!==e){var i=rg(t,"valuechangeCallbackScope",void 0);this.eventEmitter.on("valuechange",e,i);}return this.setEaseValuePropName("value").setEaseValueDuration(rg(t,"easeValue.duration",0)).setEaseValueFunction(rg(t,"easeValue.ease","Linear")),this}},{key:"value",get:function(){return this._value},set:function(t){t=sg(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,eg,ng),e}(Mo)),Rg={pan:0,drag:0,click:1,none:-1},Lg={getStartPoint:function(t){if(void 0===t&&(t=gg),this.childrenMap.thumb){var e=0===this.orientation?pg:vg;dg.call(this,e,t);}else 0===this.orientation?(t.x=this.innerLeft+1,t.y=this.centerY):(t.x=this.centerX,t.y=this.innerTop+1);return t},getEndPoint:function(t){if(void 0===t&&(t=mg),this.childrenMap.thumb){var e=0===this.orientation?yg:kg;dg.call(this,e,t);}else 0===this.orientation?(t.x=this.innerRight-1,t.y=this.centerY):(t.x=this.centerX,t.y=this.innerBottom-1);return t},updateThumb:function(t){var e,i,n=this.childrenMap.thumb;return void 0===n||(void 0===t&&(t=this.value),this.reverseAxis?(e=this.getEndPoint(),i=this.getStartPoint()):(e=this.getStartPoint(),i=this.getEndPoint()),function(t,e,i,n){void 0===n&&(n=xg),n.x=bg(e.x,i.x,t),n.y=bg(e.y,i.y,t);}(t,e,i,n),this.resetChildPositionState(n)),this},updateIndicator:function(t){var e=this.childrenMap.indicator;if(void 0===e)return this;void 0===t&&(t=this.value);var i,n,r,s=this.reverseAxis,o=this.childrenMap.thumb;if(o)if(0===this.orientation){var a=kt(o);if(s){h=o.x-a*o.originX;i=this.right-h;}else {var h;i=(h=o.x-a*o.originX)+a-this.left;}}else {var l=mt(o);if(s){u=o.y-l*o.originY;n=this.bottom-u;}else {var u;n=(u=o.y-l*o.originY)+l-this.top;}}else 0===this.orientation?i=this.width*t:n=this.height*t;yr(e,i,n),r=s?0===this.orientation?Sg:Pg:0===this.orientation?Cg:wg,Pe(e,this,r),this.resetChildPositionState(e);}};Object.assign(Mg.prototype,Lg);var Dg=Phaser.Utils.Objects.GetValue,Ag=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),(s=e.call(this,t,r)).type="rexScrollBar";var o,a=Dg(r,"background",void 0),h=Dg(r,"buttons",void 0),l=Dg(h,"top",Dg(h,"left",void 0)),c=Dg(h,"bottom",Dg(h,"right",void 0)),d=Dg(r,"slider",void 0);(a&&s.addBackground(a),l)&&(s.add(l),new jr(l).on("intouch",(function(){if(this.enable){var t=o.reverseAxis?this.scrollStep:-this.scrollStep;this.value+=t;}}),u(s)));if(d){var f;if(d.orientation=s.orientation,d.eventEmitter=u(s),d.value=null,0===s.orientation)f=void 0===Dg(d,"width",void 0)?1:0;else f=void 0===Dg(d,"height",void 0)?1:0;o=new Mg(t,d),t.add.existing(o),s.add(o,{proportion:f});}c&&(s.add(c),new jr(c).on("intouch",(function(){if(this.enable){var t=o.reverseAxis?-this.scrollStep:this.scrollStep;this.value+=t;}}),u(s)));var p=[l,c];s.addChildrenMap("background",a),s.addChildrenMap("slider",o),s.addChildrenMap("buttons",p);var v=Dg(r,"valuechangeCallback",null);if(null!==v){var g=Dg(r,"valuechangeCallbackScope",void 0);s.on("valuechange",v,g);}return s.setEnable(Dg(r,"enable",void 0)),s.setValue(Dg(r,"value",0)),s.setScrollStep(Dg(h,"step",.01)),s}return s(i,[{key:"setScrollStep",value:function(t){return this.scrollStep=t,this}},{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}}]),i}(Mo),zg=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,r)).parent=t,s.init(),s}return s(i,[{key:"init",value:function(){this.start("IDLE");}},{key:"next_IDLE",value:function(){var t,e=this.parent;return e.dragState.isDown&&(t=0===e.dragThreshold?"DRAG":"DRAGBEGIN"),t}},{key:"update_IDLE",value:function(t,e){this.next();}},{key:"next_DRAGBEGIN",value:function(){var t=this.parent,e=t.dragState;return e.isDown?e.pointer.getDistance()>=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}(jn),Bg=Phaser.Utils.Objects.GetValue,Ig=Phaser.Math.Distance.Between,jg=function(t){a(i,t);var e=d(i);function i(t,r){var s;return n(this,i),(s=e.call(this,t,r))._enable=void 0,t.setInteractive(Bg(r,"inputConfig",void 0)),s.resetFromJSON(r),s.boot(),s}return s(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(Bg(t,"enable",!0)),this.holdThreshold=Bg(t,"holdThreshold",50),this.pointerOutReleaseEnable=Bg(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 gs(this.scene)}},{key:"speed",get:function(){return this.x===this.preX&&this.y===this.preY?0:Ig(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}(ui),Wg=Phaser.Utils.Objects.GetValue,Fg=function(){function t(e){n(this,t),this.resetFromJSON(e);}return s(t,[{key:"resetFromJSON",value:function(t){return this.setValue(Wg(t,"value",0)),this.setSpeed(Wg(t,"speed",0)),this.setAcceleration(Wg(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}(),Yg=function(){function t(){n(this,t),this.value,this.dir,this.movement=new Fg;}return s(t,[{key:"init",value:function(t,e,i,n,r){return this.value=t,this.end=r,this.dir=void 0!==r?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,r=Math.sqrt(2*n*i);this._slowDown.init(t,void 0,r,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}(ui),Gg={y:0,v:0,vertical:0,x:1,h:1,horizontal:1},Ng=Phaser.Utils.Objects.GetValue,Ug=function(t){a(i,t);var e=d(i);function i(t,r){var s;(n(this,i),(s=e.call(this,t,r)).parent!==s.scene?s.focusMode=Ng(r,"focus",!0):s.focusMode=!1,s.setSpeed(Ng(r,"speed",.1)),s.setEnable(Ng(r,"enable",!0)),s.focusMode)?(t=s.parent).setInteractive(Ng(r,"inputConfig",void 0)).on("wheel",(function(t,e,i,n,r){this.enable&&this.scroll(i);}),u(s)):s.scene.input.on("wheel",s.onSceneScroll,u(s));return s}return s(i,[{key:"destroy",value:function(){this.focusMode||this.scene.input.off("wheel",this.onSceneScroll,this);}},{key:"onSceneScroll",value:function(t,e,i,n,r,s){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}(ui),Kg=Phaser.Utils.Objects.GetValue,Jg=function(t,e,i,n){var r,s,o,a,h="Y"===(i=i.toUpperCase()),l=2===t.scrollMode,u=t.childrenMap.child,c="slider".concat(i);if(r=l||n.hasOwnProperty(c)?Kg(n,c,void 0):Kg(n,"slider",void 0)){var d,f,p;!0===r&&(r={}),r.orientation=h?1:0,s=function(t,e){void 0===e&&(e={});var i=At(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 Ag(t,e);t.add.existing(n);var r=n.childrenMap.slider;return n.addChildrenMap("track",r.childrenMap.track),n.addChildrenMap("indicator",r.childrenMap.indicator),n.addChildrenMap("thumb",r.childrenMap.thumb),n}(t.scene,r);var v=Kg(r,"position",0);"string"==typeof v&&(v=qg[v]);var g=Kg(n,"space.slider".concat(i),void 0);void 0===g&&void 0===(g=Kg(n,"space.slider",void 0))&&(g=l?0:Kg(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(s,{column:d,row:f,align:"center",padding:p,expand:!0}),t["hideUnscrollableSlider".concat(i)]=Kg(r,"hideUnscrollableSlider",!1),t["adaptThumb".concat(i,"SizeMode")]=Kg(r,"adaptThumbSize",!1),t["minThumb".concat(i,"Size")]=Kg(r,"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)?Kg(n,k,!0):Kg(n,"scroller",!0))&&u&&(!0===o&&(o={}),o.orientation=h?0:1,a=new Hg(u,o));var m,b,x,C,w=Kg(n,l?"mouseWheelScroller".concat(i):"mouseWheelScroller",!1);(w&&u&&(m=new Ug(u,w)),t.addChildrenMap("slider".concat(i),s),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",s),t.addChildrenMap("scroller",a),t.addChildrenMap("mouseWheelScroller",m)),s)&&(l?(b=h?"t":"s",C="scroll".concat(i)):(b="t",C="scroll"),s.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);}));}},qg={right:0,left:1,bottom:0,top:1},Zg=Phaser.Utils.Objects.GetValue,$g=function(t,e){var i=t.scene,n=[0,1,0],r=[0,1,0],s=Zg(e,"width"),o=Zg(e,"height");s||(Zg(e,"child.expandWidth",!0)||(n[1]=0));o||(Zg(e,"child.expandHeight",!0)||(r[1]=0));var a=new Zv(i,{column:3,row:3,columnProportions:n,rowProportions:r});switch(function(t,e,i){var n=$v(i,"child"),r=$v(n,"gameObject",void 0);if(r){var s=$v(i,"space.child",0);t.childMargin={};var o=t.childMargin,a={};if("number"==typeof s)switch(t.scrollMode){case 0:case 1:o.top=0,o.bottom=0,o.left=0,o.right=0;break;default:o.top=s,o.bottom=s,o.left=s,o.right=s;}else switch(t.scrollMode){case 0:o.top=$v(s,"top",0),o.bottom=$v(s,"bottom",0),a.left=$v(s,"left",0),a.right=$v(s,"right",0);break;case 1:o.top=$v(s,"left",0),o.bottom=$v(s,"right",0),a.top=$v(s,"top",0),a.bottom=$v(s,"bottom",0);break;default:o.top=$v(s,"top",0),o.bottom=$v(s,"bottom",0),o.left=$v(s,"left",0),o.right=$v(s,"right",0);}e.add(r,{column:1,row:1,align:$v(n,"align","center"),padding:a,expand:{width:$v(n,"expandWidth",!0),height:$v(n,"expandHeight",!0)}});}t.addChildrenMap("child",r);}(t,a,e),t.scrollMode){case 0:Jg(t,a,"y",e);break;case 1:Jg(t,a,"x",e);break;default:Jg(t,a,"y",e),Jg(t,a,"x",e);}return a},Qg=function(t){var e,i,n,r;switch(this.scrollMode){case 0:case 1:e=this.topChildOY,i=this.bottomChildOY,n=this.childrenMap.scroller,r=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)],r=this.childrenMap["slider".concat(t)];}n&&n.setBounds(e,i),r&&r.setEnable(e!==i);},ty=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);}},ey=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,r=this.minThumbSize;if(0===this.scrollMode){var s=i.displayHeight*e;void 0!==r&&s0&&{height:this.colorComponentsHeight,formatLabel:this.colorComponentsFormatLabelConfig,inputText:this.colorComponentsInputTextConfig,space:this.colorComponentsSpace};var o=new hk(t,{width:n,height:s,background:e,space:this.colorPickerSpace,hPalette:{position:this.colorPickerHPalettePosition},colorComponents:r,value:this.value});return t.add.existing(o),o},uk=Phaser.Utils.Objects.GetValue,ck=function(t,e){var i=uk(e,"expandDirection",void 0);"string"==typeof i&&(i=dk[i]);var n,r,s,a,h,l,u=(s="alignTargetX",lv(n=e,r="alignTarget")?Dn(n,r):s&&lv(n,s)?Dn(n,s):a),c=uk(e,"alignTargetY",u),d=uk(e,"alignOffsetX",0),f=uk(e,"alignOffsetY",0),p=uk(e,"alignSide","").includes("right"),v=uk(e,"bounds"),g=0===i,y=!g&&!(1===i),k=p?1:0,m=g||y?0:1;t.setOrigin(k,m),h=p?u.getTopRight().x:u.getTopLeft().x,l=c.getBottomLeft().y,t.setPosition(h+d,l+f);var b=v;b||(b=$t(t.scene)),y&&t.getBottomLeft().y>b.bottom&&(l=c.getTopLeft().y,t.setOrigin(0,1).setPosition(h+d,l+f));},dk={down:0,up:1},fk=Phaser.Utils.Objects.GetValue,pk=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={}),null==r.transitIn&&(r.transitIn=function(t,e){Bi(t,e,"y","Cubic");}),null==r.transitOut&&(r.transitOut=function(t,e){!function(t,e,i,n,r){void 0===n&&(n="Linear");var s={mode:0};switch(i){case 0:case"x":s.end={x:0};break;case 1:case"y":s.end={y:0};break;default:s.end=0;}s.duration=e,s.ease=n,void 0===r?r=new Ai(t,s):r.resetFromJSON(s),r.restart();}(t,e,"y","Linear");}),r.manualClose=!0,r.clickOutsideClose=!0,r.destroy=!0,s=e.call(this,t,r),ck(t,r),t.isRexSizer&&t.layout();var o=fk(r,"touchOutsideClose",!1),a=fk(r,"anyTouchClose",!1);return a&&(o=!1),a?s.once("open",s.anyTouchClose,u(s)):o&&s.once("open",s.touchOutsideClose,u(s)),s.requestOpen(),s}return s(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&&sr(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}(Nn),vk={openColorPicker:function(){if(!this.colorPicker){var t=lk.call(this).layout(),e=new pk(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(vk,Ey);var gk=Phaser.Utils.Objects.GetValue,yk=function(t){a(i,t);var e=d(i);function i(t,r){var s;n(this,i),void 0===r&&(r={}),(s=e.call(this,t,r)).type="rexColorInput",r.hasOwnProperty("colorPicker")||(r.colorPicker={background:{color:0}});var o=r.colorPicker,a=!1!==o&&null!==o;if(a){var h;s.setColorPickerSize(gk(o,"width",160),gk(o,"height",170));var l=gk(o,"background");h=l?function(t){return th(t,l)}:gk(o,"createBackgroundCallback"),s.setCreateColorPickerBackgroundCallback(h),s.setColorPickerHPalettePosition(gk(o,"hPalettePosition",0)),s.setColorPickerExpandDirection(gk(o,"expandDirection")),s.setColorPickerEaseInDuration(gk(o,"easeIn",200)),s.setColorPickerEaseOutDuration(gk(o,"easeOut",200)),s.setColorPickerTransitInCallback(gk(o,"transitIn")),s.setColorPickerTransitOutCallback(gk(o,"transitOut")),s.setColorPickerBounds(gk(o,"bounds"));var c=gk(o,"space");void 0===c&&(c={left:10,right:10,top:10,bottom:10,item:8}),s.setColorPickerSpace(c);}var d=r.colorComponents;if(a&&(!1!==d&&null!==d)){s.setColorComponentsHeight(gk(d,"height",30)),s.setColorComponentsFormatLabelConfig(gk(d,"formatLabel"));var f=gk(d,"inputText");f||(f=gk(r,"inputText")),s.setColorComponentsInputTextConfig(f);var p=gk(d,"space");void 0===p&&(p={item:8}),s.setColorComponentsSpace(p);}var v=s.childrenMap.swatch;return v&&a&&s.onClick(v,s.openColorPicker,u(s)),s}return s(i)}(_y);Object.assign(yk.prototype,vk);var kk={name:"ColorInput",accept:function(t){return !!t.hasOwnProperty("view")&&"color"===t.view},build:function(t,e){var i=t.scene;t.type="rexTweaker.ColorInput";var n=function(t,e,i){void 0===i&&(i=!0),i?e=e?Ho(e):{}:e||(e={});var n=new yk(t,e);return t.add.existing(n),n}(i,e.colorInput);t.add(n,{proportion:1,expand:!0,key:"colorInput"}),n.on("valuechange",(function(e){t.setValue(e);}));},displayValue:function(t,e){t.getElement("colorInput").setValue(e);}},mk={setBoxFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.boxFillColor!==t||this.boxFillAlpha!==e,this.boxFillColor=t,this.boxFillAlpha=e,this},setUncheckedBoxFillStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.uncheckedBoxFillColor!==t||this.uncheckedBoxFillAlpha!==e,this.uncheckedBoxFillColor=t,this.uncheckedBoxFillAlpha=e,this},setBoxStrokeStyle:function(t,e,i){return void 0===i&&(i=1),this.dirty=this.dirty||this.boxLineWidth!==t||this.boxStrokeColor!==e||this.boxStrokeAlpha!==i,this.boxLineWidth=t,this.boxStrokeColor=e,this.boxStrokeAlpha=i,this},setUncheckedBoxStrokeStyle:function(t,e,i){return void 0===i&&(i=1),this.dirty=this.dirty||this.uncheckedBoxLineWidth!==t||this.uncheckedBoxStrokeColor!==e||this.uncheckedBoxStrokeAlpha!==i,this.uncheckedBoxLineWidth=t,this.uncheckedBoxStrokeColor=e,this.uncheckedBoxStrokeAlpha=i,this},setCheckerStyle:function(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.checkerColor!==t||this.checkAlpha!==e,this.checkerColor=t,this.checkAlpha=e,this},setBoxShape:function(t){return void 0===t&&(t=!1),this.isCircleShape===t||(this.isCircleShape=t,this.isSizeChanged=!0,this.dirty=!0),this}},bk={buildShapes:function(){this.addShape((new bd).setName("box")).addShape((new kd).setName("checker"));},updateShapes:function(){var t=this.width/2,e=this.height/2,i=Math.min(t,e),n=2*i,r=t-i,s=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(r+c+u,s+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(r+u,s+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);}},xk={setCheckerAnimationDuration:function(t){return void 0===t&&(t=0),this.checkerAnimDuration=t,this},playCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask&&(this.checkerAnimProgressTask=new bn(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}},Ck={};Object.assign(Ck,mk,{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}},bk,xk);var wk=Phaser.Utils.Objects.GetValue,Sk=Phaser.Utils.Objects.IsPlainObject,Pk=23730,Ok=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h,l){var u;n(this,i),Sk(r)?(r=wk(l=r,"x",0),s=wk(l,"y",0),o=wk(l,"width",2),a=wk(l,"height",2),h=wk(l,"color",Pk)):Sk(h)&&(h=wk(l=h,"color",Pk)),(u=e.call(this,t,r,s,o,a)).type="rexCheckbox",void 0===h&&(h=Pk),u.setBoxShape(wk(l,"circleBox",!1)),u.setBoxFillStyle(h,wk(l,"boxFillAlpha",1)),u.setUncheckedBoxFillStyle(wk(l,"uncheckedColor",null),wk(l,"uncheckedBoxFillAlpha",1)),u.setBoxStrokeStyle(wk(l,"boxLineWidth",4),wk(l,"boxStrokeColor",h),wk(l,"boxStrokeAlpha",1)),u.setUncheckedBoxStrokeStyle(u.boxLineWidth,wk(l,"uncheckedBoxStrokeColor",u.boxStrokeColor),wk(l,"uncheckedBoxStrokeAlpha",u.boxStrokeAlpha)),u.setCheckerStyle(wk(l,"checkerColor",16777215),wk(l,"checkerAlpha",1)),u.setBoxSize(wk(l,"boxSize",1)),u.setCheckerSize(wk(l,"checkerSize",1)),u.setCheckerAnimationDuration(wk(l,"animationDuration",150)),u.buildShapes();var c=wk(l,"checked");return void 0===c&&(c=wk(l,"value",!1)),u.setValue(c),u}return s(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}(Uc);Object.assign(Ok.prototype,Ck);var Tk=Phaser.Utils.Objects.GetValue,_k=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h,l){var c;return n(this,i),(c=e.call(this,t,r,s,o,a,h,l))._click=new Or(u(c),Tk(l,"click")),c._click.on("click",(function(){this.toggleValue();}),u(c)),c.setReadOnly(Tk(l,"readOnly",!1)),c}return s(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}(Ok),Ek={name:"CheckboxInput",accept:function(t){return t.hasOwnProperty("view")?"boolean"===t.view:"boolean"==typeof t.value},build:function(t,e){var i=t.scene;t.type="rexTweaker.CheckboxInput";var n=e.checkbox,r=function(t,e){var i=new _k(t,e);return t.add.existing(i),i}(i,n),s=n.size;void 0!==s&&r.setSize(s,s);var o=void 0!==s?0:1;t.add(r,{proportion:0,expand:!1,fitRatio:o,key:"checkbox"}),r.on("valuechange",(function(e){t.setValue(e);}));},displayValue:function(t,e){t.getElement("checkbox").setValue(e);}},Mk={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}},Rk={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}},Lk={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}},Dk=function(t,e,i){return (e-t)*i+t},Ak=function(t){return t>>16&255},zk=function(t){return t>>8&255},Bk=function(t){return 255&t},Ik=Phaser.Math.Linear,jk={buildShapes:function(){this.addShape((new bd).setName("track")).addShape((new bd).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 r=t*this.trackWidth,s=e*this.trackHeight,o=(t-r)/2,a=(e-s)/2,h=e*this.trackRadius;n.setTopLeftPosition(o,a).setSize(r,s).setRadius(h);}var l,u,c,d=(l=this.falseValueTrackColor,u=this.trackFillColor,c=i,(255&Dk(Ak(l),Ak(u),c))<<16|(255&Dk(zk(l),zk(u),c))<<8|255&Dk(Bk(l),Bk(u),c)),f=Ik(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=Ik(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);}},Wk={setToggleAnimationDuration:function(t){return void 0===t&&(t=0),this.toggleAnimDuration=t,this},playToggleAnimation:function(){return void 0===this.toggleAnimProgressTask&&(this.toggleAnimProgressTask=new bn(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}},Fk={};Object.assign(Fk,Mk,Rk,Lk,jk,Wk);var Yk=Phaser.Utils.Objects.GetValue,Xk=Phaser.Utils.Objects.IsPlainObject,Vk=23730,Hk=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h,l){var u;n(this,i),Xk(r)?(r=Yk(l=r,"x",0),s=Yk(l,"y",0),o=Yk(l,"width",2),a=Yk(l,"height",2),h=Yk(l,"color",Vk)):Xk(h)&&(h=Yk(l=h,"color",Vk)),(u=e.call(this,t,r,s,o,a)).type="rexToggleSwitch",void 0===h&&(h=Vk),u.setTrackFillStyle(h,Yk(l,"trackFillAlpha",1)),u.setFalseValueTrackFillStyle(Yk(l,"falseValueTrackColor",function(t){var e=.3*Ak(t)+.59*zk(t)+.11*Bk(t);return (255&e)<<16|(255&e)<<8|255&e}(h)),Yk(l,"falseValueTrackFillAlpha",1)),u.setThumbStyle(Yk(l,"thumbColor",16777215),Yk(l,"thumbAlpha",1)),u.setTrackSize(Yk(l,"trackWidth",.9),Yk(l,"trackHeight",.5)),u.setTrackRadius(Yk(l,"trackRadius",.5*u.trackHeight));var c=Yk(l,"thumbHeight",void 0),d=Yk(l,"thumbWidth",c);return void 0===d&&(d=.9*u.trackHeight),u.setThumbSize(d,c),u.setThumbRadius(Yk(l,"thumbRadius",.5*u.thumbHeight)),u.setThumbPosition(Yk(l,"thumbLeft",.3),Yk(l,"thumbRight",void 0)),u.setRTL(Yk(l,"rtl",!1)),u.setToggleAnimationDuration(Yk(l,"animationDuration",150)),u.buildShapes(),u.setValue(Yk(l,"value",!1),0),u}return s(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}(Uc);Object.assign(Hk.prototype,Fk);var Gk=Phaser.Utils.Objects.GetValue,Nk=function(t){a(i,t);var e=d(i);function i(t,r,s,o,a,h,l){var c;return n(this,i),(c=e.call(this,t,r,s,o,a,h,l))._click=new Or(u(c),Gk(l,"click")),c._click.on("click",(function(){this.toggleValue();}),u(c)),c.setReadOnly(Gk(l,"readOnly",!1)),c}return s(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}(Hk),Uk={name:"ToggleSwitchInput",accept:function(t){return !!t.hasOwnProperty("view")&&"toggleSwitch"===t.view},build:function(t,e){var i=t.scene;t.type="rexTweaker.ToggleSwitchInput";var n=e.toggleSwitch,r=function(t,e){var i=new Nk(t,e);return t.add.existing(i),i}(i,n),s=n.size;void 0!==s&&r.setSize(s,s);var o=void 0!==s?0:1;t.addSpace().add(r,{proportion:0,expand:!1,fitRatio:o,key:"toggleSwitch"}),r.on("valuechange",(function(e){t.setValue(e);}));},displayValue:function(t,e){t.getElement("toggleSwitch").setValue(e);}},Kk={setWrapEnable:function(t){return void 0===t&&(t=!0),this.listWrapEnable=t,this},setCreateButtonCallback:function(t){return this.listCreateButtonCallback=t,this},setCreateListBackgroundCallback:function(t){return this.listCreateBackgroundCallback=t,this},setButtonClickCallback:function(t){return this.listOnButtonClick=t,this},setButtonOverCallback:function(t){return this.listOnButtonOver=t,this},setButtonOutCallback:function(t){return this.listOnButtonOut=t,this},setListExpandDirection:function(t){return "string"==typeof t&&(t=Jk[t]),this.listExpandDirection=t,this},setListEaseInDuration:function(t){return void 0===t&&(t=0),this.listEaseInDuration=t,this},setListEaseOutDuration:function(t){return void 0===t&&(t=0),this.listEaseOutDuration=t,this},setListTransitInCallback:function(t){return this.listTransitInCallback=t,this},settListTransitOutCallback:function(t){return this.listTransitOutCallback=t,this},setListBounds:function(t){return this.listBounds=t,this},setListWidth:function(t){return this.listWidth=t,this},setListHeight:function(t){return this.listHeight=t,this},setListSize:function(t,e){return this.setListWidth(t).setListHeight(e),this},setListAlignmentMode:function(t){return this.listAlignMode=t,this},setListAlignmentSide:function(t){return void 0===t&&(t=""),this.listAlignSide=t,this},setListSpace:function(t){return void 0===t&&(t={}),this.listSpace=t,this},setListDraggable:function(t){return void 0===t&&(t=!0),this.listDraggable=t,this}},Jk={down:0,up:1},qk=function(){var t,e=this.scene,i=this.listCreateBackgroundCallback;i&&(t=i.call(this,e),e.add.existing(t));var n=[],r=this.listCreateButtonCallback;if(r)for(var s=this.options,o=0,a=s.length;o([\s\S]*?)<\s*\/style\s*\>/; var RE_SPACE = /^\s+|\s+$/; - var GetValue$3c = Phaser.Utils.Objects.GetValue; + var GetValue$3a = Phaser.Utils.Objects.GetValue; var TagText = /*#__PURE__*/function (_Text) { _inherits(TagText, _Text); var _super = _createSuper(TagText); function TagText(scene, x, y, text, style) { _classCallCheck(this, TagText); - var tags = GetValue$3c(style, 'tags', undefined); + var tags = GetValue$3a(style, 'tags', undefined); var parser = new Parser$1(tags); return _super.call(this, scene, x, y, text, style, 'rexTagText', parser); } @@ -7422,7 +7422,7 @@ }); SetValue(window, 'RexPlugins.UI.TagText', TagText); - var GetValue$3b = Phaser.Utils.Objects.GetValue; + var GetValue$39 = Phaser.Utils.Objects.GetValue; var GetPadding$1 = function GetPadding(padding, key) { if (key === undefined) { return padding; @@ -7445,10 +7445,10 @@ padding.top = key; padding.bottom = key; } else { - padding.left = GetValue$3b(key, 'left', 0); - padding.right = GetValue$3b(key, 'right', 0); - padding.top = GetValue$3b(key, 'top', 0); - padding.bottom = GetValue$3b(key, 'bottom', 0); + padding.left = GetValue$39(key, 'left', 0); + padding.right = GetValue$39(key, 'right', 0); + padding.top = GetValue$39(key, 'top', 0); + padding.bottom = GetValue$39(key, 'bottom', 0); } return padding; }; @@ -7695,7 +7695,7 @@ var DegToRad$d = Phaser.Math.DegToRad; var RadToDeg$8 = Phaser.Math.RadToDeg; - var GetValue$3a = Phaser.Utils.Objects.GetValue; + var GetValue$38 = Phaser.Utils.Objects.GetValue; var RenderBase = /*#__PURE__*/function (_Base) { _inherits(RenderBase, _Base); var _super = _createSuper(RenderBase); @@ -7995,10 +7995,10 @@ } // ScaleX, ScaleY - var width = GetValue$3a(o, 'width', undefined); - var height = GetValue$3a(o, 'height', undefined); - var scaleX = GetValue$3a(o, 'scaleX', undefined); - var scaleY = GetValue$3a(o, 'scaleY', undefined); + var width = GetValue$38(o, 'width', undefined); + var height = GetValue$38(o, 'height', undefined); + var scaleX = GetValue$38(o, 'scaleX', undefined); + var scaleY = GetValue$38(o, 'scaleY', undefined); if (width !== undefined) { if (height === undefined && scaleY === undefined) { this.setWidth(width, true); @@ -8130,7 +8130,7 @@ } }; - var GetValue$39 = Phaser.Utils.Objects.GetValue; + var GetValue$37 = Phaser.Utils.Objects.GetValue; var Background = /*#__PURE__*/function (_RenderBase) { _inherits(Background, _RenderBase); var _super = _createSuper(Background); @@ -8139,9 +8139,9 @@ _classCallCheck(this, Background); _this = _super.call(this, parent, 'background'); _this.setScrollFactor(0); - _this.setColor(GetValue$39(config, 'color', null), GetValue$39(config, 'color2', null), GetValue$39(config, 'horizontalGradient', true)); - _this.setStroke(GetValue$39(config, 'stroke', null), GetValue$39(config, 'strokeThickness', 2)); - _this.setCornerRadius(GetValue$39(config, 'cornerRadius', 0), GetValue$39(config, 'cornerIteration', null)); + _this.setColor(GetValue$37(config, 'color', null), GetValue$37(config, 'color2', null), GetValue$37(config, 'horizontalGradient', true)); + _this.setStroke(GetValue$37(config, 'stroke', null), GetValue$37(config, 'strokeThickness', 2)); + _this.setCornerRadius(GetValue$37(config, 'cornerRadius', 0), GetValue$37(config, 'cornerIteration', null)); return _this; } _createClass(Background, [{ @@ -8270,7 +8270,7 @@ return Background; }(RenderBase); - var GetValue$38 = Phaser.Utils.Objects.GetValue; + var GetValue$36 = Phaser.Utils.Objects.GetValue; var InnerBounds = /*#__PURE__*/function (_RenderBase) { _inherits(InnerBounds, _RenderBase); var _super = _createSuper(InnerBounds); @@ -8279,8 +8279,8 @@ _classCallCheck(this, InnerBounds); _this = _super.call(this, parent, 'innerbounds'); _this.setScrollFactor(0); - _this.setColor(GetValue$38(config, 'color', null), GetValue$38(config, 'color2', null), GetValue$38(config, 'horizontalGradient', true)); - _this.setStroke(GetValue$38(config, 'stroke', null), GetValue$38(config, 'strokeThickness', 2)); + _this.setColor(GetValue$36(config, 'color', null), GetValue$36(config, 'color2', null), GetValue$36(config, 'horizontalGradient', true)); + _this.setStroke(GetValue$36(config, 'stroke', null), GetValue$36(config, 'strokeThickness', 2)); return _this; } _createClass(InnerBounds, [{ @@ -8359,10 +8359,10 @@ value: function modifyPorperties(o) { _get(_getPrototypeOf(InnerBounds.prototype), "modifyPorperties", this).call(this, o); if (o.hasOwnProperty('color')) { - this.setColor(o.color, GetValue$38(o, 'color2', null), GetValue$38(o, 'horizontalGradient', true)); + this.setColor(o.color, GetValue$36(o, 'color2', null), GetValue$36(o, 'horizontalGradient', true)); } if (o.hasOwnProperty('stroke')) { - this.setStroke(o.stroke, GetValue$38(o, 'strokeThickness', 2)); + this.setStroke(o.stroke, GetValue$36(o, 'strokeThickness', 2)); } } }, { @@ -8402,7 +8402,7 @@ return InnerBounds; }(RenderBase); - var GetValue$37 = Phaser.Utils.Objects.GetValue; + var GetValue$35 = Phaser.Utils.Objects.GetValue; var TextStyle = /*#__PURE__*/function () { function TextStyle(parent, config) { _classCallCheck(this, TextStyle); @@ -8436,19 +8436,19 @@ }, { key: "set", value: function set(o) { - this.setBold(GetValue$37(o, 'bold', false)); - this.setItalic(GetValue$37(o, 'italic', false)); - this.setFontSize(GetValue$37(o, 'fontSize', '16px')); - this.setFontFamily(GetValue$37(o, 'fontFamily', 'Courier')); - this.setColor(GetValue$37(o, 'color', '#fff')); - this.setStrokeStyle(GetValue$37(o, 'stroke', null), GetValue$37(o, 'strokeThickness', 0)); - this.setShadow(GetValue$37(o, 'shadowColor', null), GetValue$37(o, 'shadowOffsetX', 0), GetValue$37(o, 'shadowOffsetY', 0), GetValue$37(o, 'shadowBlur', 0)); - this.setOffset(GetValue$37(o, 'offsetX', 0), GetValue$37(o, 'offsetY', 0)); - this.setSpace(GetValue$37(o, 'leftSpace', 0), GetValue$37(o, 'rightSpace', 0)); - this.setAlign(GetValue$37(o, 'align', undefined)); - this.setBackgroundColor(GetValue$37(o, 'backgroundColor', null)); - this.setBackgroundHeight(GetValue$37(o, 'backgroundHeight', undefined)); - this.setBackgroundBottomY(GetValue$37(o, 'backgroundBottomY', undefined)); + this.setBold(GetValue$35(o, 'bold', false)); + this.setItalic(GetValue$35(o, 'italic', false)); + this.setFontSize(GetValue$35(o, 'fontSize', '16px')); + this.setFontFamily(GetValue$35(o, 'fontFamily', 'Courier')); + this.setColor(GetValue$35(o, 'color', '#fff')); + this.setStrokeStyle(GetValue$35(o, 'stroke', null), GetValue$35(o, 'strokeThickness', 0)); + this.setShadow(GetValue$35(o, 'shadowColor', null), GetValue$35(o, 'shadowOffsetX', 0), GetValue$35(o, 'shadowOffsetY', 0), GetValue$35(o, 'shadowBlur', 0)); + this.setOffset(GetValue$35(o, 'offsetX', 0), GetValue$35(o, 'offsetY', 0)); + this.setSpace(GetValue$35(o, 'leftSpace', 0), GetValue$35(o, 'rightSpace', 0)); + this.setAlign(GetValue$35(o, 'align', undefined)); + this.setBackgroundColor(GetValue$35(o, 'backgroundColor', null)); + this.setBackgroundHeight(GetValue$35(o, 'backgroundHeight', undefined)); + this.setBackgroundBottomY(GetValue$35(o, 'backgroundBottomY', undefined)); return this; } }, { @@ -9831,22 +9831,22 @@ }; var Result = {}; - var GetValue$36 = Phaser.Utils.Objects.GetValue; + var GetValue$34 = Phaser.Utils.Objects.GetValue; var RunWordWrap$1 = function RunWordWrap(config) { // Parse parameters - var startIndex = GetValue$36(config, 'start', 0); - SetPadding$1(this.wrapPadding, GetValue$36(config, 'padding', 0)); + var startIndex = GetValue$34(config, 'start', 0); + SetPadding$1(this.wrapPadding, GetValue$34(config, 'padding', 0)); var paddingVertical = this.padding.top + this.padding.bottom + this.wrapPadding.top + this.wrapPadding.bottom; var paddingHorizontal = this.padding.left + this.padding.right + this.wrapPadding.left + this.wrapPadding.right; // Get lineHeight, maxLines - var lineHeight = GetValue$36(config, 'lineHeight'); - var ascent = GetValue$36(config, 'ascent', lineHeight); + var lineHeight = GetValue$34(config, 'lineHeight'); + var ascent = GetValue$34(config, 'ascent', lineHeight); var maxLines; if (lineHeight === undefined) { // Calculate lineHeight - var useDefaultTextHeight = GetValue$36(config, 'useDefaultTextHeight', false); - maxLines = GetValue$36(config, 'maxLines', 0); + var useDefaultTextHeight = GetValue$34(config, 'useDefaultTextHeight', false); + maxLines = GetValue$34(config, 'maxLines', 0); if (this.fixedHeight > 0 && !useDefaultTextHeight) { var innerHeight = this.fixedHeight - paddingVertical; if (maxLines > 0) { @@ -9868,13 +9868,13 @@ // Calculate maxLines if (this.fixedHeight > 0) { // Calculate maxLines via lineHeight, in fixedHeight mode - maxLines = GetValue$36(config, 'maxLines'); + maxLines = GetValue$34(config, 'maxLines'); if (maxLines === undefined) { var innerHeight = this.fixedHeight - paddingVertical; maxLines = Math.floor(innerHeight / lineHeight); } } else { - maxLines = GetValue$36(config, 'maxLines', 0); // Default is show all lines + maxLines = GetValue$34(config, 'maxLines', 0); // Default is show all lines } } @@ -9885,7 +9885,7 @@ var showAllLines = maxLines === 0; // Get wrapWidth - var wrapWidth = GetValue$36(config, 'wrapWidth', undefined); + var wrapWidth = GetValue$34(config, 'wrapWidth', undefined); if (wrapWidth === undefined) { if (this.fixedWidth > 0) { wrapWidth = this.fixedWidth - paddingHorizontal; @@ -9894,10 +9894,10 @@ } } - var letterSpacing = GetValue$36(config, 'letterSpacing', 0); - var hAlign = GetValue$36(config, 'hAlign', 0); - var vAlign = GetValue$36(config, 'vAlign', 0); - var charWrap = GetValue$36(config, 'charWrap', false); + var letterSpacing = GetValue$34(config, 'letterSpacing', 0); + var hAlign = GetValue$34(config, 'hAlign', 0); + var vAlign = GetValue$34(config, 'vAlign', 0); + var charWrap = GetValue$34(config, 'charWrap', false); var result = CreateWrapResultData({ // Override properties callback: 'runWordWrap', @@ -10085,18 +10085,18 @@ } }; - var GetValue$35 = Phaser.Utils.Objects.GetValue; + var GetValue$33 = Phaser.Utils.Objects.GetValue; var RunVerticalWrap$1 = function RunVerticalWrap(config) { // Parse parameters - var startIndex = GetValue$35(config, 'start', 0); - SetPadding$1(this.wrapPadding, GetValue$35(config, 'padding', 0)); + var startIndex = GetValue$33(config, 'start', 0); + SetPadding$1(this.wrapPadding, GetValue$33(config, 'padding', 0)); var paddingVertical = this.padding.top + this.padding.bottom + this.wrapPadding.top + this.wrapPadding.bottom; var paddingHorizontal = this.padding.left + this.padding.right + this.wrapPadding.left + this.wrapPadding.right; - var lineWidth = GetValue$35(config, 'lineWidth', undefined); + var lineWidth = GetValue$33(config, 'lineWidth', undefined); var maxLines; if (lineWidth === undefined) { // Calculate lineWidth via maxLines, in fixedWidth mode - maxLines = GetValue$35(config, 'maxLines', 0); + maxLines = GetValue$33(config, 'maxLines', 0); if (this.fixedWidth > 0) { var innerWidth = this.fixedWidth - paddingHorizontal; lineWidth = innerWidth / maxLines; @@ -10106,22 +10106,22 @@ } else { if (this.fixedWidth > 0) { // Calculate maxLines via lineWidth, in fixedWidth mode - maxLines = GetValue$35(config, 'maxLines', undefined); + maxLines = GetValue$33(config, 'maxLines', undefined); if (maxLines === undefined) { var innerWidth = this.fixedWidth - paddingHorizontal; maxLines = Math.floor(innerWidth / lineWidth) + 1; } } else { - maxLines = GetValue$35(config, 'maxLines', 0); // Default is show all lines + maxLines = GetValue$33(config, 'maxLines', 0); // Default is show all lines } } var showAllLines = maxLines === 0; // Get fixedCharacterHeight - var fixedCharacterHeight = GetValue$35(config, 'fixedCharacterHeight', undefined); + var fixedCharacterHeight = GetValue$33(config, 'fixedCharacterHeight', undefined); if (fixedCharacterHeight === undefined) { - var charPerLine = GetValue$35(config, 'charPerLine', undefined); + var charPerLine = GetValue$33(config, 'charPerLine', undefined); if (charPerLine !== undefined) { var innerHeight = this.fixedHeight - paddingVertical; fixedCharacterHeight = Math.floor(innerHeight / charPerLine); @@ -10129,7 +10129,7 @@ } // Get wrapHeight - var wrapHeight = GetValue$35(config, 'wrapHeight', undefined); + var wrapHeight = GetValue$33(config, 'wrapHeight', undefined); if (wrapHeight === undefined) { if (this.fixedHeight > 0) { wrapHeight = this.fixedHeight - paddingVertical; @@ -10138,10 +10138,10 @@ } } - var letterSpacing = GetValue$35(config, 'letterSpacing', 0); - var rtl = GetValue$35(config, 'rtl', true); - var hAlign = GetValue$35(config, 'hAlign', rtl ? 2 : 0); - var vAlign = GetValue$35(config, 'vAlign', 0); + var letterSpacing = GetValue$33(config, 'letterSpacing', 0); + var rtl = GetValue$33(config, 'rtl', true); + var hAlign = GetValue$33(config, 'hAlign', rtl ? 2 : 0); + var vAlign = GetValue$33(config, 'vAlign', 0); var result = CreateWrapResultData({ // Override properties callback: 'runVerticalWrap', @@ -10273,11 +10273,11 @@ return RunVerticalWrap$1.call(this, Merge$1(config, this.wrapConfig)); }; - var GetValue$34 = Phaser.Utils.Objects.GetValue; + var GetValue$32 = Phaser.Utils.Objects.GetValue; var RunWrap = function RunWrap(config) { - var wrapCallback = GetValue$34(this.wrapConfig, 'callback'); + var wrapCallback = GetValue$32(this.wrapConfig, 'callback'); if (!wrapCallback) { - wrapCallback = GetValue$34(config, 'callback', this.runWordWrap); + wrapCallback = GetValue$32(config, 'callback', this.runWordWrap); } if (typeof wrapCallback === 'string') { wrapCallback = this[wrapCallback]; @@ -10824,7 +10824,7 @@ }(); var IsPlainObject$M = Phaser.Utils.Objects.IsPlainObject; - var GetValue$33 = Phaser.Utils.Objects.GetValue; + var GetValue$31 = Phaser.Utils.Objects.GetValue; var DynamicText = /*#__PURE__*/function (_Canvas) { _inherits(DynamicText, _Canvas); var _super = _createSuper(DynamicText); @@ -10833,14 +10833,14 @@ _classCallCheck(this, DynamicText); if (IsPlainObject$M(x)) { config = x; - x = GetValue$33(config, 'x', 0); - y = GetValue$33(config, 'y', 0); - fixedWidth = GetValue$33(config, 'width', 0); - fixedHeight = GetValue$33(config, 'height', 0); + x = GetValue$31(config, 'x', 0); + y = GetValue$31(config, 'y', 0); + fixedWidth = GetValue$31(config, 'width', 0); + fixedHeight = GetValue$31(config, 'height', 0); } else if (IsPlainObject$M(fixedWidth)) { config = fixedWidth; - fixedWidth = GetValue$33(config, 'width', 0); - fixedHeight = GetValue$33(config, 'height', 0); + fixedWidth = GetValue$31(config, 'width', 0); + fixedHeight = GetValue$31(config, 'height', 0); } var width = fixedWidth === 0 ? 1 : fixedWidth; var height = fixedHeight === 0 ? 1 : fixedHeight; @@ -10849,23 +10849,23 @@ _this.autoRound = true; _this.padding = SetPadding$1(); _this.wrapPadding = SetPadding$1(); - var textStyleConfig = GetValue$33(config, 'style', undefined); + var textStyleConfig = GetValue$31(config, 'style', undefined); _this.defaultTextStyle = new TextStyle(null, textStyleConfig); _this.textStyle = _this.defaultTextStyle.clone(); - _this.setTestString(GetValue$33(config, 'testString', '|MÉqgy')); + _this.setTestString(GetValue$31(config, 'testString', '|MÉqgy')); _this._textOX = 0; _this._textOY = 0; - _this.background = new Background(_assertThisInitialized(_this), GetValue$33(config, 'background', undefined)); - _this.innerBounds = new InnerBounds(_assertThisInitialized(_this), GetValue$33(config, 'innerBounds', undefined)); + _this.background = new Background(_assertThisInitialized(_this), GetValue$31(config, 'background', undefined)); + _this.innerBounds = new InnerBounds(_assertThisInitialized(_this), GetValue$31(config, 'innerBounds', undefined)); _this.children = []; _this.lastAppendedChildren = []; _this.lastOverChild = null; _this.poolManager = new PoolManager(config); _this.setFixedSize(fixedWidth, fixedHeight); - _this.setPadding(GetValue$33(config, 'padding', 0)); - _this.setWrapConfig(GetValue$33(config, 'wrap', undefined)); - _this.setChildrenInteractiveEnable(GetValue$33(config, 'childrenInteractive', false)); - var text = GetValue$33(config, 'text', undefined); + _this.setPadding(GetValue$31(config, 'padding', 0)); + _this.setWrapConfig(GetValue$31(config, 'wrap', undefined)); + _this.setChildrenInteractiveEnable(GetValue$31(config, 'childrenInteractive', false)); + var text = GetValue$31(config, 'text', undefined); if (text) { _this.setText(text); } @@ -13629,17 +13629,17 @@ return output; }; - var GetValue$32 = Phaser.Utils.Objects.GetValue; + var GetValue$30 = Phaser.Utils.Objects.GetValue; var DrawBounds$2 = function DrawBounds(gameObjects, graphics, config) { var strokeColor, lineWidth, fillColor, fillAlpha, padding; if (typeof config === 'number') { strokeColor = config; } else { - strokeColor = GetValue$32(config, 'color'); - lineWidth = GetValue$32(config, 'lineWidth'); - fillColor = GetValue$32(config, 'fillColor'); - fillAlpha = GetValue$32(config, 'fillAlpha', 1); - padding = GetValue$32(config, 'padding', 0); + strokeColor = GetValue$30(config, 'color'); + lineWidth = GetValue$30(config, 'lineWidth'); + fillColor = GetValue$30(config, 'fillColor'); + fillAlpha = GetValue$30(config, 'fillAlpha', 1); + padding = GetValue$30(config, 'padding', 0); } if (Array.isArray(gameObjects)) { for (var i = 0, cnt = gameObjects.length; i < cnt; i++) { @@ -13742,32 +13742,32 @@ }; var globRect = new Rectangle$3(); - var GetValue$31 = Phaser.Utils.Objects.GetValue; + var GetValue$2$ = Phaser.Utils.Objects.GetValue; var GOManager = /*#__PURE__*/function () { function GOManager(scene, config) { _classCallCheck(this, GOManager); this.scene = scene; - this.BobClass = GetValue$31(config, 'BobClass', BobBase); - this.setCreateGameObjectCallback(GetValue$31(config, 'createGameObject'), GetValue$31(config, 'createGameObjectScope')); - this.setEventEmitter(GetValue$31(config, 'eventEmitter', undefined)); - var fadeConfig = GetValue$31(config, 'fade', 500); + this.BobClass = GetValue$2$(config, 'BobClass', BobBase); + this.setCreateGameObjectCallback(GetValue$2$(config, 'createGameObject'), GetValue$2$(config, 'createGameObjectScope')); + this.setEventEmitter(GetValue$2$(config, 'eventEmitter', undefined)); + var fadeConfig = GetValue$2$(config, 'fade', 500); if (typeof fadeConfig === 'number') { this.setGOFadeMode(); this.setGOFadeTime(fadeConfig); } else { - this.setGOFadeMode(GetValue$31(fadeConfig, 'mode')); - this.setGOFadeTime(GetValue$31(fadeConfig, 'time', 500)); + this.setGOFadeMode(GetValue$2$(fadeConfig, 'mode')); + this.setGOFadeTime(GetValue$2$(fadeConfig, 'time', 500)); } - var viewportCoordinateConfig = GetValue$31(config, 'viewportCoordinate', false); + var viewportCoordinateConfig = GetValue$2$(config, 'viewportCoordinate', false); if (viewportCoordinateConfig !== false) { - this.setViewportCoordinateEnable(GetValue$31(config, 'enable', true)); - this.setViewport(GetValue$31(viewportCoordinateConfig, 'viewport')); + this.setViewportCoordinateEnable(GetValue$2$(config, 'enable', true)); + this.setViewport(GetValue$2$(viewportCoordinateConfig, 'viewport')); } else { this.setViewportCoordinateEnable(false); } - var effectPropertiesConfig = GetValue$31(config, 'effectProperties', false); + var effectPropertiesConfig = GetValue$2$(config, 'effectProperties', false); this.setEffectPropertiesConfig(effectPropertiesConfig); - this.setSymbols(GetValue$31(config, 'symbols')); + this.setSymbols(GetValue$2$(config, 'symbols')); this.bobs = {}; this.removedGOs = []; this._timeScale = 1; @@ -13891,7 +13891,7 @@ return gameObjects; }; - var GetValue$30 = Phaser.Utils.Objects.GetValue; + var GetValue$2_ = Phaser.Utils.Objects.GetValue; var LayerManager = /*#__PURE__*/function (_GOManager) { _inherits(LayerManager, _GOManager); var _super = _createSuper(LayerManager); @@ -13910,7 +13910,7 @@ } config.viewportCoordinate = false; _this = _super.call(this, scene, config); - var initLayers = GetValue$30(config, 'layers'); + var initLayers = GetValue$2_(config, 'layers'); if (initLayers) { for (var i = 0, cnt = initLayers.length; i < cnt; i++) { _this.add(initLayers[i]); @@ -14047,7 +14047,7 @@ } }; - var GetValue$2$ = Phaser.Utils.Objects.GetValue; + var GetValue$2Z = Phaser.Utils.Objects.GetValue; var ComponentBase = /*#__PURE__*/function () { function ComponentBase(parent, config) { _classCallCheck(this, ComponentBase); @@ -14056,7 +14056,7 @@ this.isShutdown = false; // Event emitter, default is private event emitter - this.setEventEmitter(GetValue$2$(config, 'eventEmitter', true)); + this.setEventEmitter(GetValue$2Z(config, 'eventEmitter', true)); // Register callback of parent destroy event, also see `shutdown` method if (this.parent) { @@ -14133,7 +14133,7 @@ }(); Object.assign(ComponentBase.prototype, EventEmitterMethods$1); - var GetValue$2_ = Phaser.Utils.Objects.GetValue; + var GetValue$2Y = Phaser.Utils.Objects.GetValue; var TickTask = /*#__PURE__*/function (_ComponentBase) { _inherits(TickTask, _ComponentBase); var _super = _createSuper(TickTask); @@ -14144,7 +14144,7 @@ _this._isRunning = false; _this.isPaused = false; _this.tickingState = false; - _this.setTickingMode(GetValue$2_(config, 'tickingMode', 1)); + _this.setTickingMode(GetValue$2Y(config, 'tickingMode', 1)); // boot() later return _this; } @@ -14261,7 +14261,7 @@ 'always': 2 }; - var GetValue$2Z = Phaser.Utils.Objects.GetValue; + var GetValue$2X = Phaser.Utils.Objects.GetValue; var SceneUpdateTickTask = /*#__PURE__*/function (_TickTask) { _inherits(SceneUpdateTickTask, _TickTask); var _super = _createSuper(SceneUpdateTickTask); @@ -14275,7 +14275,7 @@ // If this.scene is not available, use game's 'step' event var defaultEventName = _this.scene ? 'update' : 'step'; - _this.tickEventName = GetValue$2Z(config, 'tickEventName', defaultEventName); + _this.tickEventName = GetValue$2X(config, 'tickEventName', defaultEventName); _this.isSceneTicker = !IsGameUpdateEvent(_this.tickEventName); return _this; } @@ -14311,7 +14311,7 @@ return eventName === 'step' || eventName === 'poststep'; }; - var GetValue$2Y = Phaser.Utils.Objects.GetValue; + var GetValue$2W = Phaser.Utils.Objects.GetValue; var Clamp$f = Phaser.Math.Clamp; var Timer$1 = /*#__PURE__*/function () { function Timer(config) { @@ -14321,15 +14321,15 @@ _createClass(Timer, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.state = GetValue$2Y(o, 'state', IDLE$8); - this.timeScale = GetValue$2Y(o, 'timeScale', 1); - this.delay = GetValue$2Y(o, 'delay', 0); - this.repeat = GetValue$2Y(o, 'repeat', 0); - this.repeatCounter = GetValue$2Y(o, 'repeatCounter', 0); - this.repeatDelay = GetValue$2Y(o, 'repeatDelay', 0); - this.duration = GetValue$2Y(o, 'duration', 0); - this.nowTime = GetValue$2Y(o, 'nowTime', 0); - this.justRestart = GetValue$2Y(o, 'justRestart', false); + this.state = GetValue$2W(o, 'state', IDLE$8); + this.timeScale = GetValue$2W(o, 'timeScale', 1); + this.delay = GetValue$2W(o, 'delay', 0); + this.repeat = GetValue$2W(o, 'repeat', 0); + this.repeatCounter = GetValue$2W(o, 'repeatCounter', 0); + this.repeatDelay = GetValue$2W(o, 'repeatDelay', 0); + this.duration = GetValue$2W(o, 'duration', 0); + this.nowTime = GetValue$2W(o, 'nowTime', 0); + this.justRestart = GetValue$2W(o, 'justRestart', false); } }, { key: "toJSON", @@ -14558,7 +14558,7 @@ return TimerTickTask; }(SceneUpdateTickTask); - var GetValue$2X = Phaser.Utils.Objects.GetValue; + var GetValue$2V = Phaser.Utils.Objects.GetValue; var GetAdvancedValue$5 = Phaser.Utils.Objects.GetAdvancedValue; var GetEaseFunction = Phaser.Tweens.Builders.GetEaseFunction; var EaseValueTaskBase = /*#__PURE__*/function (_TimerTask) { @@ -14571,13 +14571,13 @@ _createClass(EaseValueTaskBase, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.timer.resetFromJSON(GetValue$2X(o, 'timer')); - this.setEnable(GetValue$2X(o, 'enable', true)); - this.setTarget(GetValue$2X(o, 'target', this.parent)); + this.timer.resetFromJSON(GetValue$2V(o, 'timer')); + this.setEnable(GetValue$2V(o, 'enable', true)); + this.setTarget(GetValue$2V(o, 'target', this.parent)); this.setDelay(GetAdvancedValue$5(o, 'delay', 0)); this.setDuration(GetAdvancedValue$5(o, 'duration', 1000)); - this.setEase(GetValue$2X(o, 'ease', 'Linear')); - this.setRepeat(GetValue$2X(o, 'repeat', 0)); + this.setEase(GetValue$2V(o, 'ease', 'Linear')); + this.setRepeat(GetValue$2V(o, 'repeat', 0)); return this; } }, { @@ -14702,7 +14702,7 @@ return object instanceof SoundObjectClass; }; - var GetValue$2W = Phaser.Utils.Objects.GetValue; + var GetValue$2U = Phaser.Utils.Objects.GetValue; var GetAdvancedValue$4 = Phaser.Utils.Objects.GetAdvancedValue; var Linear$d = Phaser.Math.Linear; var Fade$3 = /*#__PURE__*/function (_EaseValueTaskBase) { @@ -14731,8 +14731,8 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Fade.prototype), "resetFromJSON", this).call(this, o); - this.setMode(GetValue$2W(o, 'mode', 0)); - this.setEnable(GetValue$2W(o, 'enable', true)); + this.setMode(GetValue$2U(o, 'mode', 0)); + this.setEnable(GetValue$2U(o, 'enable', true)); this.setVolumeRange(GetAdvancedValue$4(o, 'volume.start', this.parent.volume), GetAdvancedValue$4(o, 'volume.end', 0)); return this; } @@ -14866,7 +14866,7 @@ return sound; }; - var GetValue$2V = Phaser.Utils.Objects.GetValue; + var GetValue$2T = Phaser.Utils.Objects.GetValue; var BackgroundMusicMethods = { setBackgroundMusicLoop: function setBackgroundMusicLoop(value) { if (value === undefined) { @@ -14910,11 +14910,11 @@ this.stopBackgroundMusic(); // Stop previous background music var music = this.sound.add(key, { - loop: GetValue$2V(config, 'loop', this.backgroundMusicLoop), - mute: GetValue$2V(config, 'mute', this.backgroundMusicMute), - volume: GetValue$2V(config, 'volume', this.backgroundMusicVolume), - detune: GetValue$2V(config, 'detune', 0), - rate: GetValue$2V(config, 'rate', 1) + loop: GetValue$2T(config, 'loop', this.backgroundMusicLoop), + mute: GetValue$2T(config, 'mute', this.backgroundMusicMute), + volume: GetValue$2T(config, 'volume', this.backgroundMusicVolume), + detune: GetValue$2T(config, 'detune', 0), + rate: GetValue$2T(config, 'rate', 1) }); this.setCurrentBackgroundMusic(music); @@ -14992,7 +14992,7 @@ } }; - var GetValue$2U = Phaser.Utils.Objects.GetValue; + var GetValue$2S = Phaser.Utils.Objects.GetValue; var BackgroundMusic2Methods = { setBackgroundMusic2Loop: function setBackgroundMusic2Loop(value) { if (value === undefined) { @@ -15036,11 +15036,11 @@ this.stopBackgroundMusic2(); // Stop previous background music var music = this.sound.add(key, { - loop: GetValue$2U(config, 'loop', this.backgroundMusicLoop), - mute: GetValue$2U(config, 'mute', this.backgroundMusic2Mute), - volume: GetValue$2U(config, 'volume', this.backgroundMusic2Volume), - detune: GetValue$2U(config, 'detune', 0), - rate: GetValue$2U(config, 'rate', 1) + loop: GetValue$2S(config, 'loop', this.backgroundMusicLoop), + mute: GetValue$2S(config, 'mute', this.backgroundMusic2Mute), + volume: GetValue$2S(config, 'volume', this.backgroundMusic2Volume), + detune: GetValue$2S(config, 'detune', 0), + rate: GetValue$2S(config, 'rate', 1) }); this.setCurrentBackgroundMusic2(music); @@ -15119,7 +15119,7 @@ }; var RemoveItem$9 = Phaser.Utils.Array.Remove; - var GetValue$2T = Phaser.Utils.Objects.GetValue; + var GetValue$2R = Phaser.Utils.Objects.GetValue; var SoundEffectsMethods = { getSoundEffects: function getSoundEffects() { return this.soundEffects; @@ -15129,10 +15129,10 @@ }, playSoundEffect: function playSoundEffect(key, config) { var music = this.sound.add(key, { - mute: GetValue$2T(config, 'mute', this.soundEffectsMute), - volume: GetValue$2T(config, 'volume', this.soundEffectsVolume), - detune: GetValue$2T(config, 'detune', 0), - rate: GetValue$2T(config, 'rate', 1) + mute: GetValue$2R(config, 'mute', this.soundEffectsMute), + volume: GetValue$2R(config, 'volume', this.soundEffectsVolume), + detune: GetValue$2R(config, 'detune', 0), + rate: GetValue$2R(config, 'rate', 1) }); this.soundEffects.push(music); music.once('complete', function () { @@ -15248,7 +15248,7 @@ }; var RemoveItem$8 = Phaser.Utils.Array.Remove; - var GetValue$2S = Phaser.Utils.Objects.GetValue; + var GetValue$2Q = Phaser.Utils.Objects.GetValue; var SoundEffects2Methods = { getSoundEffects2: function getSoundEffects2() { return this.soundEffects2; @@ -15258,10 +15258,10 @@ }, playSoundEffect2: function playSoundEffect2(key, config) { var music = this.sound.add(key, { - mute: GetValue$2S(config, 'mute', this.soundEffects2Mute), - volume: GetValue$2S(config, 'volume', this.soundEffects2Volume), - detune: GetValue$2S(config, 'detune', 0), - rate: GetValue$2S(config, 'rate', 1) + mute: GetValue$2Q(config, 'mute', this.soundEffects2Mute), + volume: GetValue$2Q(config, 'volume', this.soundEffects2Volume), + detune: GetValue$2Q(config, 'detune', 0), + rate: GetValue$2Q(config, 'rate', 1) }); this.soundEffects2.push(music); music.once('complete', function () { @@ -15379,7 +15379,7 @@ var Methods$f = {}; Object.assign(Methods$f, BackgroundMusicMethods, BackgroundMusic2Methods, SoundEffectsMethods, SoundEffects2Methods); - var GetValue$2R = Phaser.Utils.Objects.GetValue; + var GetValue$2P = Phaser.Utils.Objects.GetValue; var SoundManager = /*#__PURE__*/function () { function SoundManager(game, config) { _classCallCheck(this, SoundManager); @@ -15387,26 +15387,26 @@ // Background music will be (fade out)destroyed when play next one. this.backgroundMusic = undefined; - this._backgroundMusicVolume = GetValue$2R(config, 'bgm.volume', 1); - this._backgroundMusicMute = GetValue$2R(config, 'bgm.mute', false); - this.setBackgroundMusicLoop(GetValue$2R(config, 'bgm.loop', true)); - this.setBackgroundMusicFadeTime(GetValue$2R(config, 'bgm.fade', 500)); + this._backgroundMusicVolume = GetValue$2P(config, 'bgm.volume', 1); + this._backgroundMusicMute = GetValue$2P(config, 'bgm.mute', false); + this.setBackgroundMusicLoop(GetValue$2P(config, 'bgm.loop', true)); + this.setBackgroundMusicFadeTime(GetValue$2P(config, 'bgm.fade', 500)); this.backgroundMusic2 = undefined; - this._backgroundMusic2Volume = GetValue$2R(config, 'bgm2.volume', 1); - this._backgroundMusic2Mute = GetValue$2R(config, 'bgm2.mute', false); - this.setBackgroundMusic2Loop(GetValue$2R(config, 'bgm2.loop', true)); - this.setBackgroundMusic2FadeTime(GetValue$2R(config, 'bgm2.fade', 500)); + this._backgroundMusic2Volume = GetValue$2P(config, 'bgm2.volume', 1); + this._backgroundMusic2Mute = GetValue$2P(config, 'bgm2.mute', false); + this.setBackgroundMusic2Loop(GetValue$2P(config, 'bgm2.loop', true)); + this.setBackgroundMusic2FadeTime(GetValue$2P(config, 'bgm2.fade', 500)); // Sound effect will be destroyed when completed this.soundEffects = []; - this._soundEffectsVolume = GetValue$2R(config, 'soundEffect.volume', 1); + this._soundEffectsVolume = GetValue$2P(config, 'soundEffect.volume', 1); this.soundEffects2 = []; - this._soundEffects2Volume = GetValue$2R(config, 'soundEffect2.volume', 1); - var initialBackgroundMusic = GetValue$2R(config, 'bgm.initial', undefined); + this._soundEffects2Volume = GetValue$2P(config, 'soundEffect2.volume', 1); + var initialBackgroundMusic = GetValue$2P(config, 'bgm.initial', undefined); if (initialBackgroundMusic) { this.setCurrentBackgroundMusic(initialBackgroundMusic); } - var initialBackgroundMusic2 = GetValue$2R(config, 'bgm2.initial', undefined); + var initialBackgroundMusic2 = GetValue$2P(config, 'bgm2.initial', undefined); if (initialBackgroundMusic2) { this.setCurrentBackgroundMusic2(initialBackgroundMusic2); } @@ -15554,7 +15554,7 @@ }(); Object.assign(SoundManager.prototype, Methods$f); - var GetValue$2Q = Phaser.Utils.Objects.GetValue; + var GetValue$2O = Phaser.Utils.Objects.GetValue; var BaseClock = /*#__PURE__*/function (_TickTask) { _inherits(BaseClock, _TickTask); var _super = _createSuper(BaseClock); @@ -15569,9 +15569,9 @@ _createClass(BaseClock, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.isRunning = GetValue$2Q(o, 'isRunning', false); - this.timeScale = GetValue$2Q(o, 'timeScale', 1); - this.now = GetValue$2Q(o, 'now', 0); + this.isRunning = GetValue$2O(o, 'isRunning', false); + this.timeScale = GetValue$2O(o, 'timeScale', 1); + this.now = GetValue$2O(o, 'now', 0); return this; } }, { @@ -15834,7 +15834,7 @@ return TimerPool; }(Stack); - var GetValue$2P = Phaser.Utils.Objects.GetValue; + var GetValue$2N = Phaser.Utils.Objects.GetValue; var TimerPool = new TimerPool$1(); var Timeline = /*#__PURE__*/function (_Clock) { _inherits(Timeline, _Clock); @@ -15845,7 +15845,7 @@ _this = _super.call(this, parent, config); _this.addedTimers = []; _this.timers = []; - _this.timerPool = GetValue$2P(config, 'pool', TimerPool); + _this.timerPool = GetValue$2N(config, 'pool', TimerPool); return _this; } _createClass(Timeline, [{ @@ -16343,9 +16343,9 @@ var _this; _classCallCheck(this, WaitEventManager); _this = _super.call(this, parent); - _this.waitCompleteEventName = GetValue$3n(config, 'completeEventName', _this.waitCompleteEventName); - _this.setClickTarget(GetValue$3n(config, 'clickTarget', _this.scene)); - _this.setCameraTarget(GetValue$3n(config, 'camera', _this.scene.cameras.main)); + _this.waitCompleteEventName = GetValue$3l(config, 'completeEventName', _this.waitCompleteEventName); + _this.setClickTarget(GetValue$3l(config, 'clickTarget', _this.scene)); + _this.setCameraTarget(GetValue$3l(config, 'camera', _this.scene.cameras.main)); return _this; } _createClass(WaitEventManager, [{ @@ -16384,17 +16384,17 @@ }; Object.assign(WaitEventManager.prototype, WaitTimeMethods, WaitInputMethods, WaitGameObjectMethods, WaitCameraMethods, WaitMusicMethods, Methods$e); - var GetValue$2O = Phaser.Utils.Objects.GetValue; + var GetValue$2M = Phaser.Utils.Objects.GetValue; var InitManagers = function InitManagers(scene, config) { this.clickTarget = undefined; this.cameraTarget = undefined; this.managersScene = scene; this.gameObjectManagers = {}; - var layerManagerConfig = GetValue$2O(config, 'layers', false); + var layerManagerConfig = GetValue$2M(config, 'layers', false); if (layerManagerConfig !== false) { this.gameObjectManagers.layer = new LayerManager(scene, layerManagerConfig); } - var soundManagerConfig = GetValue$2O(config, 'sounds'); + var soundManagerConfig = GetValue$2M(config, 'sounds'); if (soundManagerConfig !== false) { this.soundManager = new SoundManager(scene, soundManagerConfig); } @@ -16626,20 +16626,20 @@ function BracketParser(config) { _classCallCheck(this, BracketParser); // Event emitter - this.setEventEmitter(GetValue$3n(config, 'eventEmitter', undefined)); + this.setEventEmitter(GetValue$3l(config, 'eventEmitter', undefined)); // Value convert - this.setValueConverter(GetValue$3n(config, 'valueConvert', true)); + this.setValueConverter(GetValue$3l(config, 'valueConvert', true)); // Loop - this.setLoopEnable(GetValue$3n(config, 'loop', false)); + this.setLoopEnable(GetValue$3l(config, 'loop', false)); // Brackets and generate regex - this.setMultipleLinesTagEnable(GetValue$3n(config, 'multipleLinesTag', false)); - var delimiters = GetValue$3n(config, 'delimiters', '<>'); + this.setMultipleLinesTagEnable(GetValue$3l(config, 'multipleLinesTag', false)); + var delimiters = GetValue$3l(config, 'delimiters', '<>'); this.setDelimiters(delimiters[0], delimiters[1]); // Translate tagName callback - this.setTranslateTagNameCallback(GetValue$3n(config, 'translateTagNameCallback')); + this.setTranslateTagNameCallback(GetValue$3l(config, 'translateTagNameCallback')); this.isRunning = false; this.isPaused = false; this.skipEventFlag = false; @@ -16907,10 +16907,10 @@ _this = _super.call(this, config); // Parameters for regex - _this.setTagExpression(GetValue$3n(config, 'regex.tag', undefined)); - _this.setValueExpression(GetValue$3n(config, 'regex.value', undefined)); + _this.setTagExpression(GetValue$3l(config, 'regex.tag', undefined)); + _this.setValueExpression(GetValue$3l(config, 'regex.value', undefined)); // Brackets and generate regex - var delimiters = GetValue$3n(config, 'delimiters', '<>'); + var delimiters = GetValue$3l(config, 'delimiters', '<>'); _this.setDelimiters(delimiters[0], delimiters[1]); return _this; } @@ -18250,7 +18250,7 @@ return lines.join(''); }; - var GetValue$2N = Phaser.Utils.Objects.GetValue; + var GetValue$2L = Phaser.Utils.Objects.GetValue; var Parser = /*#__PURE__*/function (_BracketParser) { _inherits(Parser, _BracketParser); var _super = _createSuper(Parser); @@ -18265,7 +18265,7 @@ } _this = _super.call(this, config); AddParseCallbacks(textPlayer, _assertThisInitialized(_this), config); - _this.setCommentLineStartSymbol(GetValue$2N(config, 'comment', '//')); + _this.setCommentLineStartSymbol(GetValue$2L(config, 'comment', '//')); _this.setContentOutputEnable(); return _this; } @@ -18698,7 +18698,7 @@ }; Object.assign(Methods$d, TypingSpeedMethods$1); - var GetValue$2M = Phaser.Utils.Objects.GetValue; + var GetValue$2K = Phaser.Utils.Objects.GetValue; var TypeWriter = /*#__PURE__*/function () { function TypeWriter(textPlayer, config) { _classCallCheck(this, TypeWriter); @@ -18711,13 +18711,13 @@ this.isTypingPaused = false; // Used in this.wait(), this.pauseTyping(), this.resumeTyping() this.setIgnoreWait(false); this.setSkipTypingAnimation(false); - this.setTypingStartCallback(GetValue$2M(config, 'onTypingStart', SetChildrenInvisible)); - this.setDefaultTypingSpeed(GetValue$2M(config, 'speed', 250)); + this.setTypingStartCallback(GetValue$2K(config, 'onTypingStart', SetChildrenInvisible)); + this.setDefaultTypingSpeed(GetValue$2K(config, 'speed', 250)); this.setTypingSpeed(); - this.setSkipSpaceEnable(GetValue$2M(config, 'skipSpace', false)); - this.setAnimationConfig(GetValue$2M(config, 'animation', undefined)); - this.setMinSizeEnable(GetValue$2M(config, 'minSizeEnable', false)); - this.setFadeOutPageCallback(GetValue$2M(config, 'fadeOutPage')); + this.setSkipSpaceEnable(GetValue$2K(config, 'skipSpace', false)); + this.setAnimationConfig(GetValue$2K(config, 'animation', undefined)); + this.setMinSizeEnable(GetValue$2K(config, 'minSizeEnable', false)); + this.setFadeOutPageCallback(GetValue$2K(config, 'fadeOutPage')); } _createClass(TypeWriter, [{ key: "destroy", @@ -19624,7 +19624,7 @@ }; var IsPlainObject$L = Phaser.Utils.Objects.IsPlainObject; - var GetValue$2L = Phaser.Utils.Objects.GetValue; + var GetValue$2J = Phaser.Utils.Objects.GetValue; var TextPlayer = /*#__PURE__*/function (_Extend) { _inherits(TextPlayer, _Extend); var _super = _createSuper(TextPlayer); @@ -19646,19 +19646,19 @@ _this = _super.call(this, scene, x, y, fixedWidth, fixedHeight, config); _this.type = 'rexTextPlayer'; _this.initManagers(scene, config); - _this.parser = new Parser(_assertThisInitialized(_this), GetValue$2L(config, 'parser', undefined)); - _this.typeWriter = new TypeWriter(_assertThisInitialized(_this), GetValue$2L(config, 'typing', undefined)); + _this.parser = new Parser(_assertThisInitialized(_this), GetValue$2J(config, 'parser', undefined)); + _this.typeWriter = new TypeWriter(_assertThisInitialized(_this), GetValue$2J(config, 'typing', undefined)); _this._imageManager = undefined; - var imageData = GetValue$2L(config, 'images', undefined); + var imageData = GetValue$2J(config, 'images', undefined); if (imageData) { _this.addImage(imageData); } - var spriteManagerConfig = GetValue$2L(config, 'sprites'); + var spriteManagerConfig = GetValue$2J(config, 'sprites'); if (spriteManagerConfig !== false && spriteManagerConfig !== null) { AddSpriteManager.call(_assertThisInitialized(_this), spriteManagerConfig); } - _this.setIgnoreNextPageInput(GetValue$2L(config, 'ignoreNextPageInput', false)); - _this.setNextPageInput(GetValue$2L(config, 'nextPageInput', null)); + _this.setIgnoreNextPageInput(GetValue$2J(config, 'ignoreNextPageInput', false)); + _this.setNextPageInput(GetValue$2J(config, 'nextPageInput', null)); _this.isPlaying = false; if (content) { _this.play(content); @@ -19848,7 +19848,7 @@ LastOpenedEditor$1 = undefined; }; - var GetValue$2K = Phaser.Utils.Objects.GetValue; + var GetValue$2I = Phaser.Utils.Objects.GetValue; var SetProperties = function SetProperties(properties, config, out) { if (out === undefined) { out = {}; @@ -19856,7 +19856,7 @@ var property, value; for (var key in properties) { property = properties[key]; // [propName, defaultValue] - value = GetValue$2K(config, key, property[1]); + value = GetValue$2I(config, key, property[1]); if (value !== undefined) { out[property[0]] = value; } @@ -19925,12 +19925,12 @@ this.emit('close', this); }; - var GetValue$2J = Phaser.Utils.Objects.GetValue; + var GetValue$2H = Phaser.Utils.Objects.GetValue; var CreateElement = function CreateElement(parent, config) { var element; - var textType = GetValue$2J(config, 'inputType', undefined); + var textType = GetValue$2H(config, 'inputType', undefined); if (textType === undefined) { - textType = GetValue$2J(config, 'type', 'text'); + textType = GetValue$2H(config, 'type', 'text'); } if (textType === 'textarea') { element = document.createElement('textarea'); @@ -19939,7 +19939,7 @@ element = document.createElement('input'); element.type = textType; } - var style = GetValue$2J(config, 'style', undefined); + var style = GetValue$2H(config, 'style', undefined); // Apply other style properties var elementStyle = element.style; SetProperties(StyleProperties$1, style, elementStyle); @@ -20013,7 +20013,7 @@ close: Close$1 }; - var GetValue$2I = Phaser.Utils.Objects.GetValue; + var GetValue$2G = Phaser.Utils.Objects.GetValue; var HiddenTextEditBase = /*#__PURE__*/function (_ComponentBase) { _inherits(HiddenTextEditBase, _ComponentBase); var _super = _createSuper(HiddenTextEditBase); @@ -20023,22 +20023,22 @@ _this = _super.call(this, gameObject); // this.parent = gameObject; - var textType = GetValue$2I(config, 'inputType', undefined); + var textType = GetValue$2G(config, 'inputType', undefined); if (textType === undefined) { - textType = GetValue$2I(config, 'type', 'text'); + textType = GetValue$2G(config, 'type', 'text'); } - _this.setEnterCloseEnable(GetValue$2I(config, 'enterClose', textType !== 'textarea')); - var onOpen = GetValue$2I(config, 'onOpen', undefined); + _this.setEnterCloseEnable(GetValue$2G(config, 'enterClose', textType !== 'textarea')); + var onOpen = GetValue$2G(config, 'onOpen', undefined); if (!onOpen) { - onOpen = GetValue$2I(config, 'onFocus', undefined); + onOpen = GetValue$2G(config, 'onFocus', undefined); } _this.onOpenCallback = onOpen; - var onClose = GetValue$2I(config, 'onClose', undefined); + var onClose = GetValue$2G(config, 'onClose', undefined); if (!onClose) { - onClose = GetValue$2I(config, 'onBlur', undefined); + onClose = GetValue$2G(config, 'onBlur', undefined); } _this.onCloseCallback = onClose; - _this.onUpdateCallback = GetValue$2I(config, 'onUpdate', undefined); + _this.onUpdateCallback = GetValue$2G(config, 'onUpdate', undefined); _this.isOpened = false; gameObject.on('pointerdown', function () { this.open(); @@ -20543,7 +20543,7 @@ hiddenTextEdit.prevCursorPosition = null; }; - var GetValue$2H = Phaser.Utils.Objects.GetValue; + var GetValue$2F = Phaser.Utils.Objects.GetValue; var HiddenTextEdit$1 = /*#__PURE__*/function (_HiddenTextEditBase) { _inherits(HiddenTextEdit, _HiddenTextEditBase); var _super = _createSuper(HiddenTextEdit); @@ -20553,7 +20553,7 @@ _this = _super.call(this, gameObject, config); // this.parent = gameObject; - _this.setSelectAllWhenFocusEnable(GetValue$2H(config, 'selectAll', false)); + _this.setSelectAllWhenFocusEnable(GetValue$2F(config, 'selectAll', false)); _this.cursorMoveStartIndex = null; _this.prevCursorPosition = null; _this.prevSelectionStart = null; @@ -20652,10 +20652,10 @@ return HiddenTextEdit; }(HiddenTextEditBase); - var GetValue$2G = Phaser.Utils.Objects.GetValue; + var GetValue$2E = Phaser.Utils.Objects.GetValue; var PropertiesList = ['inputType', 'onOpen', 'onFocus', 'onClose', 'onBlur', 'onUpdate', 'enterClose', 'readOnly', 'maxLength', 'minLength', 'selectAll']; var CreateHiddenTextEdit = function CreateHiddenTextEdit(parent, parentConfig) { - var config = GetValue$2G(parentConfig, 'edit'); + var config = GetValue$2E(parentConfig, 'edit'); if (config === undefined) { config = {}; } @@ -21636,7 +21636,7 @@ return GetGame(game).loop.delta; }; - var GetValue$2F = Phaser.Utils.Objects.GetValue; + var GetValue$2D = Phaser.Utils.Objects.GetValue; var Wrap$2 = Phaser.Math.Wrap; var HiddenTextEdit = /*#__PURE__*/function (_HiddenTextEditBase) { _inherits(HiddenTextEdit, _HiddenTextEditBase); @@ -21653,8 +21653,8 @@ _this = _super.call(this, gameObject, config); // this.parent = gameObject; - _this.setCursor(GetValue$2F(config, 'cursor', '|')); - _this.setCursorFlashDuration(GetValue$2F(config, 'cursorFlashDuration', 1000)); + _this.setCursor(GetValue$2D(config, 'cursor', '|')); + _this.setCursorFlashDuration(GetValue$2D(config, 'cursorFlashDuration', 1000)); _this.cursorFlashTimer = 0; return _this; } @@ -23350,7 +23350,7 @@ return Rectangle; }(BaseGeom); - var GetValue$2E = Phaser.Utils.Objects.GetValue; + var GetValue$2C = Phaser.Utils.Objects.GetValue; var RoundRectangle = /*#__PURE__*/function (_PathBase) { _inherits(RoundRectangle, _PathBase); var _super = _createSuper(RoundRectangle); @@ -23512,10 +23512,10 @@ this.radiusBL = value; this.radiusBR = value; } else { - this.radiusTL = GetValue$2E(value, 'tl', 0); - this.radiusTR = GetValue$2E(value, 'tr', 0); - this.radiusBL = GetValue$2E(value, 'bl', 0); - this.radiusBR = GetValue$2E(value, 'br', 0); + this.radiusTL = GetValue$2C(value, 'tl', 0); + this.radiusTR = GetValue$2C(value, 'tr', 0); + this.radiusBL = GetValue$2C(value, 'bl', 0); + this.radiusBR = GetValue$2C(value, 'br', 0); } } }, { @@ -23848,7 +23848,7 @@ } }; - var GetValue$2D = Phaser.Utils.Objects.GetValue; + var GetValue$2B = Phaser.Utils.Objects.GetValue; var Linear$b = Phaser.Math.Linear; var EaseValueTask = /*#__PURE__*/function (_EaseValueTaskBase) { _inherits(EaseValueTask, _EaseValueTaskBase); @@ -23871,15 +23871,15 @@ return this; } var target = this.target; - this.propertyKey = GetValue$2D(config, 'key', 'value'); + this.propertyKey = GetValue$2B(config, 'key', 'value'); var currentValue = target[this.propertyKey]; - this.fromValue = GetValue$2D(config, 'from', currentValue); - this.toValue = GetValue$2D(config, 'to', currentValue); - this.setEase(GetValue$2D(config, 'ease', this.ease)); - this.setDuration(GetValue$2D(config, 'duration', this.duration)); - this.setRepeat(GetValue$2D(config, 'repeat', 0)); - this.setDelay(GetValue$2D(config, 'delay', 0)); - this.setRepeatDelay(GetValue$2D(config, 'repeatDelay', 0)); + this.fromValue = GetValue$2B(config, 'from', currentValue); + this.toValue = GetValue$2B(config, 'to', currentValue); + this.setEase(GetValue$2B(config, 'ease', this.ease)); + this.setDuration(GetValue$2B(config, 'duration', this.duration)); + this.setRepeat(GetValue$2B(config, 'repeat', 0)); + this.setDelay(GetValue$2B(config, 'delay', 0)); + this.setRepeatDelay(GetValue$2B(config, 'repeatDelay', 0)); this.timer.setDuration(this.duration).setRepeat(this.repeat).setDelay(this.delay).setRepeatDelay(this.repeatDelay); target[this.propertyKey] = this.fromValue; _get(_getPrototypeOf(EaseValueTask.prototype), "start", this).call(this); @@ -23930,7 +23930,7 @@ var methods$t = {}; Object.assign(methods$t, StyleMethods$2, SizeMethods$1, ShapesUpdateMethods$4, CheckerAnimationMethods); - var GetValue$2C = Phaser.Utils.Objects.GetValue; + var GetValue$2A = Phaser.Utils.Objects.GetValue; var IsPlainObject$J = Phaser.Utils.Objects.IsPlainObject; var DefaultBoxFillColor = 0x005cb2; var DefaultCheckerColor = 0xffffff; @@ -23942,33 +23942,33 @@ _classCallCheck(this, CheckboxShape); if (IsPlainObject$J(x)) { config = x; - x = GetValue$2C(config, 'x', 0); - y = GetValue$2C(config, 'y', 0); - width = GetValue$2C(config, 'width', 2); - height = GetValue$2C(config, 'height', 2); - color = GetValue$2C(config, 'color', DefaultBoxFillColor); + x = GetValue$2A(config, 'x', 0); + y = GetValue$2A(config, 'y', 0); + width = GetValue$2A(config, 'width', 2); + height = GetValue$2A(config, 'height', 2); + color = GetValue$2A(config, 'color', DefaultBoxFillColor); } else if (IsPlainObject$J(color)) { config = color; - color = GetValue$2C(config, 'color', DefaultBoxFillColor); + color = GetValue$2A(config, 'color', DefaultBoxFillColor); } _this = _super.call(this, scene, x, y, width, height); _this.type = 'rexCheckbox'; if (color === undefined) { color = DefaultBoxFillColor; } - _this.setBoxShape(GetValue$2C(config, 'circleBox', false)); - _this.setBoxFillStyle(color, GetValue$2C(config, 'boxFillAlpha', 1)); - _this.setUncheckedBoxFillStyle(GetValue$2C(config, 'uncheckedColor', null), GetValue$2C(config, 'uncheckedBoxFillAlpha', 1)); - _this.setBoxStrokeStyle(GetValue$2C(config, 'boxLineWidth', 4), GetValue$2C(config, 'boxStrokeColor', color), GetValue$2C(config, 'boxStrokeAlpha', 1)); - _this.setUncheckedBoxStrokeStyle(_this.boxLineWidth, GetValue$2C(config, 'uncheckedBoxStrokeColor', _this.boxStrokeColor), GetValue$2C(config, 'uncheckedBoxStrokeAlpha', _this.boxStrokeAlpha)); - _this.setCheckerStyle(GetValue$2C(config, 'checkerColor', DefaultCheckerColor), GetValue$2C(config, 'checkerAlpha', 1)); - _this.setBoxSize(GetValue$2C(config, 'boxSize', 1)); - _this.setCheckerSize(GetValue$2C(config, 'checkerSize', 1)); - _this.setCheckerAnimationDuration(GetValue$2C(config, 'animationDuration', 150)); + _this.setBoxShape(GetValue$2A(config, 'circleBox', false)); + _this.setBoxFillStyle(color, GetValue$2A(config, 'boxFillAlpha', 1)); + _this.setUncheckedBoxFillStyle(GetValue$2A(config, 'uncheckedColor', null), GetValue$2A(config, 'uncheckedBoxFillAlpha', 1)); + _this.setBoxStrokeStyle(GetValue$2A(config, 'boxLineWidth', 4), GetValue$2A(config, 'boxStrokeColor', color), GetValue$2A(config, 'boxStrokeAlpha', 1)); + _this.setUncheckedBoxStrokeStyle(_this.boxLineWidth, GetValue$2A(config, 'uncheckedBoxStrokeColor', _this.boxStrokeColor), GetValue$2A(config, 'uncheckedBoxStrokeAlpha', _this.boxStrokeAlpha)); + _this.setCheckerStyle(GetValue$2A(config, 'checkerColor', DefaultCheckerColor), GetValue$2A(config, 'checkerAlpha', 1)); + _this.setBoxSize(GetValue$2A(config, 'boxSize', 1)); + _this.setCheckerSize(GetValue$2A(config, 'checkerSize', 1)); + _this.setCheckerAnimationDuration(GetValue$2A(config, 'animationDuration', 150)); _this.buildShapes(); - var value = GetValue$2C(config, 'checked'); + var value = GetValue$2A(config, 'checked'); if (value === undefined) { - value = GetValue$2C(config, 'value', false); + value = GetValue$2A(config, 'value', false); } _this.setValue(value); return _this; @@ -24044,7 +24044,7 @@ }(BaseShapes); Object.assign(CheckboxShape.prototype, methods$t); - var GetValue$2B = Phaser.Utils.Objects.GetValue; + var GetValue$2z = Phaser.Utils.Objects.GetValue; var Button = /*#__PURE__*/function (_ComponentBase) { _inherits(Button, _ComponentBase); var _super = _createSuper(Button); @@ -24055,7 +24055,7 @@ // this.parent = gameObject; _this._enable = undefined; - gameObject.setInteractive(GetValue$2B(config, "inputConfig", undefined)); + gameObject.setInteractive(GetValue$2z(config, "inputConfig", undefined)); _this.resetFromJSON(config); _this.boot(); return _this; @@ -24065,10 +24065,10 @@ value: function resetFromJSON(o) { this.pointer = undefined; this.lastClickTime = undefined; - this.setEnable(GetValue$2B(o, "enable", true)); - this.setMode(GetValue$2B(o, "mode", 1)); - this.setClickInterval(GetValue$2B(o, "clickInterval", 100)); - this.setDragThreshold(GetValue$2B(o, 'threshold', undefined)); + this.setEnable(GetValue$2z(o, "enable", true)); + this.setMode(GetValue$2z(o, "mode", 1)); + this.setClickInterval(GetValue$2z(o, "clickInterval", 100)); + this.setDragThreshold(GetValue$2z(o, 'threshold', undefined)); return this; } }, { @@ -24253,7 +24253,7 @@ pointerup: 1 }; - var GetValue$2A = Phaser.Utils.Objects.GetValue; + var GetValue$2y = Phaser.Utils.Objects.GetValue; var Checkbox = /*#__PURE__*/function (_CheckboxShape) { _inherits(Checkbox, _CheckboxShape); var _super = _createSuper(Checkbox); @@ -24261,11 +24261,11 @@ var _this; _classCallCheck(this, Checkbox); _this = _super.call(this, scene, x, y, width, height, color, config); - _this._click = new Button(_assertThisInitialized(_this), GetValue$2A(config, 'click')); + _this._click = new Button(_assertThisInitialized(_this), GetValue$2y(config, 'click')); _this._click.on('click', function () { this.toggleValue(); }, _assertThisInitialized(_this)); - _this.setReadOnly(GetValue$2A(config, 'readOnly', false)); + _this.setReadOnly(GetValue$2y(config, 'readOnly', false)); return _this; } _createClass(Checkbox, [{ @@ -24482,7 +24482,7 @@ return (shade & 0xff) << 16 | (shade & 0xff) << 8 | shade & 0xff; }; - var GetValue$2z = Phaser.Utils.Objects.GetValue; + var GetValue$2x = Phaser.Utils.Objects.GetValue; var IsPlainObject$I = Phaser.Utils.Objects.IsPlainObject; var DefaultTrackFillColor = 0x005cb2; var DefaultThumbFillColor = 0xffffff; @@ -24494,37 +24494,37 @@ _classCallCheck(this, ToggleSwitchShape); if (IsPlainObject$I(x)) { config = x; - x = GetValue$2z(config, 'x', 0); - y = GetValue$2z(config, 'y', 0); - width = GetValue$2z(config, 'width', 2); - height = GetValue$2z(config, 'height', 2); - color = GetValue$2z(config, 'color', DefaultTrackFillColor); + x = GetValue$2x(config, 'x', 0); + y = GetValue$2x(config, 'y', 0); + width = GetValue$2x(config, 'width', 2); + height = GetValue$2x(config, 'height', 2); + color = GetValue$2x(config, 'color', DefaultTrackFillColor); } else if (IsPlainObject$I(color)) { config = color; - color = GetValue$2z(config, 'color', DefaultTrackFillColor); + color = GetValue$2x(config, 'color', DefaultTrackFillColor); } _this = _super.call(this, scene, x, y, width, height); _this.type = 'rexToggleSwitch'; if (color === undefined) { color = DefaultTrackFillColor; } - _this.setTrackFillStyle(color, GetValue$2z(config, 'trackFillAlpha', 1)); - _this.setFalseValueTrackFillStyle(GetValue$2z(config, 'falseValueTrackColor', GrayScale(color)), GetValue$2z(config, 'falseValueTrackFillAlpha', 1)); - _this.setThumbStyle(GetValue$2z(config, 'thumbColor', DefaultThumbFillColor), GetValue$2z(config, 'thumbAlpha', 1)); - _this.setTrackSize(GetValue$2z(config, 'trackWidth', 0.9), GetValue$2z(config, 'trackHeight', 0.5)); - _this.setTrackRadius(GetValue$2z(config, 'trackRadius', _this.trackHeight * 0.5)); - var thumbHeight = GetValue$2z(config, 'thumbHeight', undefined); - var thumbWidth = GetValue$2z(config, 'thumbWidth', thumbHeight); + _this.setTrackFillStyle(color, GetValue$2x(config, 'trackFillAlpha', 1)); + _this.setFalseValueTrackFillStyle(GetValue$2x(config, 'falseValueTrackColor', GrayScale(color)), GetValue$2x(config, 'falseValueTrackFillAlpha', 1)); + _this.setThumbStyle(GetValue$2x(config, 'thumbColor', DefaultThumbFillColor), GetValue$2x(config, 'thumbAlpha', 1)); + _this.setTrackSize(GetValue$2x(config, 'trackWidth', 0.9), GetValue$2x(config, 'trackHeight', 0.5)); + _this.setTrackRadius(GetValue$2x(config, 'trackRadius', _this.trackHeight * 0.5)); + var thumbHeight = GetValue$2x(config, 'thumbHeight', undefined); + var thumbWidth = GetValue$2x(config, 'thumbWidth', thumbHeight); if (thumbWidth === undefined) { thumbWidth = _this.trackHeight * 0.9; } _this.setThumbSize(thumbWidth, thumbHeight); - _this.setThumbRadius(GetValue$2z(config, 'thumbRadius', _this.thumbHeight * 0.5)); - _this.setThumbPosition(GetValue$2z(config, 'thumbLeft', 0.3), GetValue$2z(config, 'thumbRight', undefined)); - _this.setRTL(GetValue$2z(config, 'rtl', false)); - _this.setToggleAnimationDuration(GetValue$2z(config, 'animationDuration', 150)); + _this.setThumbRadius(GetValue$2x(config, 'thumbRadius', _this.thumbHeight * 0.5)); + _this.setThumbPosition(GetValue$2x(config, 'thumbLeft', 0.3), GetValue$2x(config, 'thumbRight', undefined)); + _this.setRTL(GetValue$2x(config, 'rtl', false)); + _this.setToggleAnimationDuration(GetValue$2x(config, 'animationDuration', 150)); _this.buildShapes(); - _this.setValue(GetValue$2z(config, 'value', false), 0); + _this.setValue(GetValue$2x(config, 'value', false), 0); return _this; } _createClass(ToggleSwitchShape, [{ @@ -24577,7 +24577,7 @@ }(BaseShapes); Object.assign(ToggleSwitchShape.prototype, methods$s); - var GetValue$2y = Phaser.Utils.Objects.GetValue; + var GetValue$2w = Phaser.Utils.Objects.GetValue; var ToggleSwitch = /*#__PURE__*/function (_ToggleSwitchShape) { _inherits(ToggleSwitch, _ToggleSwitchShape); var _super = _createSuper(ToggleSwitch); @@ -24585,11 +24585,11 @@ var _this; _classCallCheck(this, ToggleSwitch); _this = _super.call(this, scene, x, y, width, height, color, config); - _this._click = new Button(_assertThisInitialized(_this), GetValue$2y(config, 'click')); + _this._click = new Button(_assertThisInitialized(_this), GetValue$2w(config, 'click')); _this._click.on('click', function () { this.toggleValue(); }, _assertThisInitialized(_this)); - _this.setReadOnly(GetValue$2y(config, 'readOnly', false)); + _this.setReadOnly(GetValue$2w(config, 'readOnly', false)); return _this; } _createClass(ToggleSwitch, [{ @@ -24684,7 +24684,7 @@ }); SetValue(window, 'RexPlugins.UI.Canvas', Canvas); - var GetValue$2x = Phaser.Utils.Objects.GetValue; + var GetValue$2v = Phaser.Utils.Objects.GetValue; var CircleMaskImage = /*#__PURE__*/function (_Canvas) { _inherits(CircleMaskImage, _Canvas); var _super = _createSuper(CircleMaskImage); @@ -24708,11 +24708,11 @@ maskType: config }; } - var maskType = GetValue$2x(config, 'maskType', 0); - var backgroundColor = GetValue$2x(config, 'backgroundColor', undefined); - var strokeColor = GetValue$2x(config, 'strokeColor', undefined); + var maskType = GetValue$2v(config, 'maskType', 0); + var backgroundColor = GetValue$2v(config, 'backgroundColor', undefined); + var strokeColor = GetValue$2v(config, 'strokeColor', undefined); var defaultStrokeWidth = strokeColor != null ? 10 : 0; - var strokeWidth = GetValue$2x(config, 'strokeWidth', defaultStrokeWidth); + var strokeWidth = GetValue$2v(config, 'strokeWidth', defaultStrokeWidth); if (maskType === undefined) { maskType = 0; } else if (typeof maskType === 'string') { @@ -24760,8 +24760,8 @@ ctx.ellipse(centerX, centerY, radiusX, radiusY, 0, 0, 2 * Math.PI); break; case 2: - var radiusConfig = GetValue$2x(config, 'radius', 0); - var iteration = GetValue$2x(config, 'iteration', undefined); + var radiusConfig = GetValue$2v(config, 'radius', 0); + var iteration = GetValue$2v(config, 'iteration', undefined); AddRoundRectanglePath(ctx, halfStrokeLineWidth, halfStrokeLineWidth, width - strokeWidth, height - strokeWidth, radiusConfig, iteration); break; default: @@ -24810,7 +24810,7 @@ }); SetValue(window, 'RexPlugins.UI.CircleMaskImage', CircleMaskImage); - var GetValue$2w = Phaser.Utils.Objects.GetValue; + var GetValue$2u = Phaser.Utils.Objects.GetValue; var AlphaMaskImage = /*#__PURE__*/function (_Canvas) { _inherits(AlphaMaskImage, _Canvas); var _super = _createSuper(AlphaMaskImage); @@ -24837,11 +24837,11 @@ } }; } - var maskKey = GetValue$2w(config, 'mask.key'); - var maskFrame = GetValue$2w(config, 'mask.frame'); - var invertMaskAlpha = GetValue$2w(config, 'mask.invertAlpha', false); - var maskScale = GetValue$2w(config, 'mask.scale'); - var backgroundColor = GetValue$2w(config, 'backgroundColor'); + var maskKey = GetValue$2u(config, 'mask.key'); + var maskFrame = GetValue$2u(config, 'mask.frame'); + var invertMaskAlpha = GetValue$2u(config, 'mask.invertAlpha', false); + var maskScale = GetValue$2u(config, 'mask.scale'); + var backgroundColor = GetValue$2u(config, 'backgroundColor'); if (maskKey) { this._maskKey = maskKey; this._maskFrame = maskFrame; @@ -25007,7 +25007,7 @@ easeValueRepeat: EaseValueRepeat }; - var GetValue$2v = Phaser.Utils.Objects.GetValue; + var GetValue$2t = Phaser.Utils.Objects.GetValue; var Clamp$d = Phaser.Math.Clamp; function ProgressBase (BaseClass) { var ProgressBase = /*#__PURE__*/function (_BaseClass) { @@ -25020,13 +25020,13 @@ _createClass(ProgressBase, [{ key: "bootProgressBase", value: function bootProgressBase(config) { - this.eventEmitter = GetValue$2v(config, 'eventEmitter', this); - var callback = GetValue$2v(config, 'valuechangeCallback', null); + this.eventEmitter = GetValue$2t(config, 'eventEmitter', this); + var callback = GetValue$2t(config, 'valuechangeCallback', null); if (callback !== null) { - var scope = GetValue$2v(config, 'valuechangeCallbackScope', undefined); + var scope = GetValue$2t(config, 'valuechangeCallbackScope', undefined); this.eventEmitter.on('valuechange', callback, scope); } - this.setEaseValuePropName('value').setEaseValueDuration(GetValue$2v(config, 'easeValue.duration', 0)).setEaseValueFunction(GetValue$2v(config, 'easeValue.ease', 'Linear')); + this.setEaseValuePropName('value').setEaseValueDuration(GetValue$2t(config, 'easeValue.duration', 0)).setEaseValueFunction(GetValue$2t(config, 'easeValue.ease', 'Linear')); return this; } }, { @@ -25121,7 +25121,7 @@ } }; - var GetValue$2u = Phaser.Utils.Objects.GetValue; + var GetValue$2s = Phaser.Utils.Objects.GetValue; var IsPlainObject$H = Phaser.Utils.Objects.IsPlainObject; var Clamp$c = Phaser.Math.Clamp; var DefaultStartAngle$1 = Phaser.Math.DegToRad(270); @@ -25133,11 +25133,11 @@ _classCallCheck(this, CircularProgress); if (IsPlainObject$H(x)) { config = x; - x = GetValue$2u(config, 'x', 0); - y = GetValue$2u(config, 'y', 0); - radius = GetValue$2u(config, 'radius', 1); - barColor = GetValue$2u(config, 'barColor', undefined); - value = GetValue$2u(config, 'value', 0); + x = GetValue$2s(config, 'x', 0); + y = GetValue$2s(config, 'y', 0); + radius = GetValue$2s(config, 'radius', 1); + barColor = GetValue$2s(config, 'barColor', undefined); + value = GetValue$2s(config, 'value', 0); } if (radius === undefined) { radius = 1; @@ -25147,12 +25147,12 @@ _this.type = 'rexCircularProgress'; _this.bootProgressBase(config); _this.setRadius(radius); - _this.setTrackColor(GetValue$2u(config, 'trackColor', undefined)); + _this.setTrackColor(GetValue$2s(config, 'trackColor', undefined)); _this.setBarColor(barColor); - _this.setCenterColor(GetValue$2u(config, 'centerColor', undefined)); - _this.setThickness(GetValue$2u(config, 'thickness', 0.2)); - _this.setStartAngle(GetValue$2u(config, 'startAngle', DefaultStartAngle$1)); - _this.setAnticlockwise(GetValue$2u(config, 'anticlockwise', false)); + _this.setCenterColor(GetValue$2s(config, 'centerColor', undefined)); + _this.setThickness(GetValue$2s(config, 'thickness', 0.2)); + _this.setStartAngle(GetValue$2s(config, 'startAngle', DefaultStartAngle$1)); + _this.setAnticlockwise(GetValue$2s(config, 'anticlockwise', false)); _this.buildShapes(); _this.setValue(value); return _this; @@ -25400,7 +25400,7 @@ } }; - var GetValue$2t = Phaser.Utils.Objects.GetValue; + var GetValue$2r = Phaser.Utils.Objects.GetValue; var IsPlainObject$G = Phaser.Utils.Objects.IsPlainObject; var Clamp$b = Phaser.Math.Clamp; var DefaultStartAngle = Phaser.Math.DegToRad(270); @@ -25412,32 +25412,32 @@ _classCallCheck(this, CircularProgress); if (IsPlainObject$G(x)) { config = x; - x = GetValue$2t(config, 'x', 0); - y = GetValue$2t(config, 'y', 0); - radius = GetValue$2t(config, 'radius', 1); - barColor = GetValue$2t(config, 'barColor', undefined); - value = GetValue$2t(config, 'value', 0); + x = GetValue$2r(config, 'x', 0); + y = GetValue$2r(config, 'y', 0); + radius = GetValue$2r(config, 'radius', 1); + barColor = GetValue$2r(config, 'barColor', undefined); + value = GetValue$2r(config, 'value', 0); } var width = radius * 2; _this = _super.call(this, scene, x, y, width, width); _this.type = 'rexCircularProgressCanvas'; _this.bootProgressBase(config); _this.setRadius(radius); - _this.setTrackColor(GetValue$2t(config, 'trackColor', undefined)); + _this.setTrackColor(GetValue$2r(config, 'trackColor', undefined)); _this.setBarColor(barColor); - _this.setCenterColor(GetValue$2t(config, 'centerColor', undefined)); - _this.setThickness(GetValue$2t(config, 'thickness', 0.2)); - _this.setStartAngle(GetValue$2t(config, 'startAngle', DefaultStartAngle)); - _this.setAnticlockwise(GetValue$2t(config, 'anticlockwise', false)); - _this.setTextColor(GetValue$2t(config, 'textColor', undefined)); - _this.setTextStrokeColor(GetValue$2t(config, 'textStrokeColor', undefined), GetValue$2t(config, 'textStrokeThickness', undefined)); - var textFont = GetValue$2t(config, 'textFont', undefined); + _this.setCenterColor(GetValue$2r(config, 'centerColor', undefined)); + _this.setThickness(GetValue$2r(config, 'thickness', 0.2)); + _this.setStartAngle(GetValue$2r(config, 'startAngle', DefaultStartAngle)); + _this.setAnticlockwise(GetValue$2r(config, 'anticlockwise', false)); + _this.setTextColor(GetValue$2r(config, 'textColor', undefined)); + _this.setTextStrokeColor(GetValue$2r(config, 'textStrokeColor', undefined), GetValue$2r(config, 'textStrokeThickness', undefined)); + var textFont = GetValue$2r(config, 'textFont', undefined); if (textFont) { _this.setTextFont(textFont); } else { - _this.setTextFont(GetValue$2t(config, 'textSize', '16px'), GetValue$2t(config, 'textFamily', 'Courier'), GetValue$2t(config, 'textStyle', '')); + _this.setTextFont(GetValue$2r(config, 'textSize', '16px'), GetValue$2r(config, 'textFamily', 'Courier'), GetValue$2r(config, 'textStyle', '')); } - _this.setTextFormatCallback(GetValue$2t(config, 'textFormatCallback', undefined), GetValue$2t(config, 'textFormatCallbackScope', undefined)); + _this.setTextFormatCallback(GetValue$2r(config, 'textFormatCallback', undefined), GetValue$2r(config, 'textFormatCallbackScope', undefined)); _this.setValue(value); return _this; } @@ -25742,7 +25742,7 @@ return lines; }; - var GetValue$2s = Phaser.Utils.Objects.GetValue; + var GetValue$2q = Phaser.Utils.Objects.GetValue; var IsPlainObject$F = Phaser.Utils.Objects.IsPlainObject; var LineProgress$1 = /*#__PURE__*/function (_ProgressBase) { _inherits(LineProgress, _ProgressBase); @@ -25752,32 +25752,32 @@ _classCallCheck(this, LineProgress); if (IsPlainObject$F(x)) { config = x; - x = GetValue$2s(config, 'x', 0); - y = GetValue$2s(config, 'y', 0); - width = GetValue$2s(config, 'width', 2); - height = GetValue$2s(config, 'height', 2); - barColor = GetValue$2s(config, 'barColor', undefined); - value = GetValue$2s(config, 'value', 0); + x = GetValue$2q(config, 'x', 0); + y = GetValue$2q(config, 'y', 0); + width = GetValue$2q(config, 'width', 2); + height = GetValue$2q(config, 'height', 2); + barColor = GetValue$2q(config, 'barColor', undefined); + value = GetValue$2q(config, 'value', 0); } else if (IsPlainObject$F(width)) { config = width; - width = GetValue$2s(config, 'width', 2); - height = GetValue$2s(config, 'height', 2); - barColor = GetValue$2s(config, 'barColor', undefined); - value = GetValue$2s(config, 'value', 0); + width = GetValue$2q(config, 'width', 2); + height = GetValue$2q(config, 'height', 2); + barColor = GetValue$2q(config, 'barColor', undefined); + value = GetValue$2q(config, 'value', 0); } else if (IsPlainObject$F(barColor)) { config = barColor; - barColor = GetValue$2s(config, 'barColor', undefined); - value = GetValue$2s(config, 'value', 0); + barColor = GetValue$2q(config, 'barColor', undefined); + value = GetValue$2q(config, 'value', 0); } _this = _super.call(this, scene, x, y, width, height, config); _this.type = 'rexLineProgress'; _this.bootProgressBase(config); _this.addShape(new Lines().setName('trackFill')).addShape(new Lines().setName('bar')).addShape(new Lines().setName('trackStroke')); - _this.setTrackColor(GetValue$2s(config, 'trackColor', undefined)); + _this.setTrackColor(GetValue$2q(config, 'trackColor', undefined)); _this.setBarColor(barColor); - _this.setTrackStroke(GetValue$2s(config, 'trackStrokeThickness', 2), GetValue$2s(config, 'trackStrokeColor', undefined)); - _this.setSkewX(GetValue$2s(config, 'skewX', 0)); - _this.setRTL(GetValue$2s(config, 'rtl', false)); + _this.setTrackStroke(GetValue$2q(config, 'trackStrokeThickness', 2), GetValue$2q(config, 'trackStrokeColor', undefined)); + _this.setSkewX(GetValue$2q(config, 'skewX', 0)); + _this.setRTL(GetValue$2q(config, 'rtl', false)); _this.setValue(value); return _this; } @@ -26024,7 +26024,7 @@ return out; }; - var GetValue$2r = Phaser.Utils.Objects.GetValue; + var GetValue$2p = Phaser.Utils.Objects.GetValue; var IsPlainObject$E = Phaser.Utils.Objects.IsPlainObject; var LineProgress = /*#__PURE__*/function (_ProgressBase) { _inherits(LineProgress, _ProgressBase); @@ -26034,33 +26034,33 @@ _classCallCheck(this, LineProgress); if (IsPlainObject$E(x)) { config = x; - x = GetValue$2r(config, 'x', 0); - y = GetValue$2r(config, 'y', 0); - width = GetValue$2r(config, 'width', 2); - height = GetValue$2r(config, 'height', 2); - barColor = GetValue$2r(config, 'barColor', undefined); - value = GetValue$2r(config, 'value', 0); + x = GetValue$2p(config, 'x', 0); + y = GetValue$2p(config, 'y', 0); + width = GetValue$2p(config, 'width', 2); + height = GetValue$2p(config, 'height', 2); + barColor = GetValue$2p(config, 'barColor', undefined); + value = GetValue$2p(config, 'value', 0); } else if (IsPlainObject$E(width)) { config = width; - width = GetValue$2r(config, 'width', 2); - height = GetValue$2r(config, 'height', 2); - barColor = GetValue$2r(config, 'barColor', undefined); - value = GetValue$2r(config, 'value', 0); + width = GetValue$2p(config, 'width', 2); + height = GetValue$2p(config, 'height', 2); + barColor = GetValue$2p(config, 'barColor', undefined); + value = GetValue$2p(config, 'value', 0); } else if (IsPlainObject$E(barColor)) { config = barColor; - barColor = GetValue$2r(config, 'barColor', undefined); - value = GetValue$2r(config, 'value', 0); + barColor = GetValue$2p(config, 'barColor', undefined); + value = GetValue$2p(config, 'value', 0); } _this = _super.call(this, scene, x, y, width, height); _this.type = 'rexLineProgressCanvas'; _this.trackPoints = []; _this.barPoints = []; _this.bootProgressBase(config); - _this.setTrackColor(GetValue$2r(config, 'trackColor', undefined)); - _this.setBarColor(barColor, GetValue$2r(config, 'barColor2', undefined), GetValue$2r(config, 'isHorizontalGradient', undefined)); - _this.setTrackStroke(GetValue$2r(config, 'trackStrokeThickness', 2), GetValue$2r(config, 'trackStrokeColor', undefined)); - _this.setSkewX(GetValue$2r(config, 'skewX', 0)); - _this.setRTL(GetValue$2r(config, 'rtl', false)); + _this.setTrackColor(GetValue$2p(config, 'trackColor', undefined)); + _this.setBarColor(barColor, GetValue$2p(config, 'barColor2', undefined), GetValue$2p(config, 'isHorizontalGradient', undefined)); + _this.setTrackStroke(GetValue$2p(config, 'trackStrokeThickness', 2), GetValue$2p(config, 'trackStrokeColor', undefined)); + _this.setSkewX(GetValue$2p(config, 'skewX', 0)); + _this.setRTL(GetValue$2p(config, 'rtl', false)); _this.setValue(value); return _this; } @@ -26372,7 +26372,7 @@ } }; - var GetValue$2q = Phaser.Utils.Objects.GetValue; + var GetValue$2o = Phaser.Utils.Objects.GetValue; var IsPlainObject$D = Phaser.Utils.Objects.IsPlainObject; var DegToRad$7 = Phaser.Math.DegToRad; var RadToDeg$6 = Phaser.Math.RadToDeg; @@ -26519,21 +26519,21 @@ var config = left; // If they specify x and/or y this applies to all - var x = GetValue$2q(config, 'x', null); + var x = GetValue$2o(config, 'x', null); if (x !== null) { left = x; right = x; } else { - left = GetValue$2q(config, 'left', 0); - right = GetValue$2q(config, 'right', left); + left = GetValue$2o(config, 'left', 0); + right = GetValue$2o(config, 'right', left); } - var y = GetValue$2q(config, 'y', null); + var y = GetValue$2o(config, 'y', null); if (y !== null) { top = y; bottom = y; } else { - top = GetValue$2q(config, 'top', 0); - bottom = GetValue$2q(config, 'bottom', top); + top = GetValue$2o(config, 'top', 0); + bottom = GetValue$2o(config, 'bottom', top); } } else { if (left === undefined) { @@ -26855,7 +26855,7 @@ } }; - var GetValue$2p = Phaser.Utils.Objects.GetValue; + var GetValue$2n = Phaser.Utils.Objects.GetValue; var BaseAdd = Base$1.prototype.add; var Add$8 = function Add(gameObject, config) { this.setParent(gameObject); @@ -26910,11 +26910,11 @@ state.syncAlpha = config; state.syncScrollFactor = config; } else { - state.syncPosition = GetValue$2p(config, 'syncPosition', true); - state.syncRotation = GetValue$2p(config, 'syncRotation', true); - state.syncScale = GetValue$2p(config, 'syncScale', true); - state.syncAlpha = GetValue$2p(config, 'syncAlpha', true); - state.syncScrollFactor = GetValue$2p(config, 'syncScrollFactor', true); + state.syncPosition = GetValue$2n(config, 'syncPosition', true); + state.syncRotation = GetValue$2n(config, 'syncRotation', true); + state.syncScale = GetValue$2n(config, 'syncScale', true); + state.syncAlpha = GetValue$2n(config, 'syncAlpha', true); + state.syncScrollFactor = GetValue$2n(config, 'syncScrollFactor', true); } }; var AddChild$2 = { @@ -28024,7 +28024,7 @@ return object instanceof GameObjectClass; }; - var GetValue$2o = Phaser.Utils.Objects.GetValue; + var GetValue$2m = Phaser.Utils.Objects.GetValue; var DynamicTexture$1 = Phaser.Textures.DynamicTexture; var UUID$2 = Phaser.Utils.String.UUID; var Snapshot = function Snapshot(config) { @@ -28033,13 +28033,13 @@ } var gameObjects = config.gameObjects; var renderTexture = config.renderTexture; // renderTexture, or dynamicTexture - var x = GetValue$2o(config, 'x', undefined); - var y = GetValue$2o(config, 'y', undefined); - var width = GetValue$2o(config, 'width', undefined); - var height = GetValue$2o(config, 'height', undefined); - var originX = GetValue$2o(config, 'originX', 0); - var originY = GetValue$2o(config, 'originY', 0); - var padding = GetValue$2o(config, 'padding', 0); + var x = GetValue$2m(config, 'x', undefined); + var y = GetValue$2m(config, 'y', undefined); + var width = GetValue$2m(config, 'width', undefined); + var height = GetValue$2m(config, 'height', undefined); + var originX = GetValue$2m(config, 'originX', 0); + var originY = GetValue$2m(config, 'originY', 0); + var padding = GetValue$2m(config, 'padding', 0); var scrollX, scrollY; if (width === undefined || height === undefined || x === undefined || y === undefined) { // Union bounds of gameObjects @@ -28150,10 +28150,10 @@ } }; - var GetValue$2n = Phaser.Utils.Objects.GetValue; + var GetValue$2l = Phaser.Utils.Objects.GetValue; var DrawBounds$1 = function DrawBounds(graphics, config) { - var drawContainer = GetValue$2n(config, 'drawContainer', true); - var gameObjects = GetValue$2n(config, 'children'); + var drawContainer = GetValue$2l(config, 'drawContainer', true); + var gameObjects = GetValue$2l(config, 'children'); if (gameObjects === undefined) { gameObjects = this.getAllVisibleChildren([this]); } @@ -28844,7 +28844,7 @@ QuickSet(child, globZone, align); }; - var GetValue$2m = Phaser.Utils.Objects.GetValue; + var GetValue$2k = Phaser.Utils.Objects.GetValue; var Group$1 = Phaser.GameObjects.Group; var DrawBounds = function DrawBounds(graphics, config) { var scene = graphics.scene; @@ -28853,13 +28853,13 @@ if (typeof config === 'number') { color = config; } else { - color = GetValue$2m(config, 'color'); - lineWidth = GetValue$2m(config, 'lineWidth'); - var nameTextConfig = GetValue$2m(config, 'name', false); + color = GetValue$2k(config, 'color'); + lineWidth = GetValue$2k(config, 'lineWidth'); + var nameTextConfig = GetValue$2k(config, 'name', false); if (nameTextConfig) { - createTextCallback = GetValue$2m(nameTextConfig, 'createTextCallback', DefaultCreateTextCallback); - createTextCallbackScope = GetValue$2m(nameTextConfig, 'createTextCallbackScope', undefined); - textAlign = GetValue$2m(nameTextConfig, 'align', 'left-top'); + createTextCallback = GetValue$2k(nameTextConfig, 'createTextCallback', DefaultCreateTextCallback); + createTextCallbackScope = GetValue$2k(nameTextConfig, 'createTextCallbackScope', undefined); + textAlign = GetValue$2k(nameTextConfig, 'align', 'left-top'); if (typeof textAlign === 'string') { textAlign = AlignConst[textAlign]; } @@ -28916,7 +28916,7 @@ }; var GlobRect = undefined; - var GetValue$2l = Phaser.Utils.Objects.GetValue; + var GetValue$2j = Phaser.Utils.Objects.GetValue; var GetBoundsConfig = function GetBoundsConfig(config, out) { if (config === undefined) { config = 0; @@ -28930,10 +28930,10 @@ out.top = config; out.bottom = config; } else { - out.left = GetValue$2l(config, 'left', 0); - out.right = GetValue$2l(config, 'right', 0); - out.top = GetValue$2l(config, 'top', 0); - out.bottom = GetValue$2l(config, 'bottom', 0); + out.left = GetValue$2j(config, 'left', 0); + out.right = GetValue$2j(config, 'right', 0); + out.top = GetValue$2j(config, 'top', 0); + out.bottom = GetValue$2j(config, 'bottom', 0); } return out; }; @@ -29799,7 +29799,7 @@ return this; }; - var GetValue$2k = Phaser.Utils.Objects.GetValue; + var GetValue$2i = Phaser.Utils.Objects.GetValue; var GetAdvancedValue$3 = Phaser.Utils.Objects.GetAdvancedValue; var Linear$6 = Phaser.Math.Linear; var Scale = /*#__PURE__*/function (_EaseValueTaskBase) { @@ -29822,7 +29822,7 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Scale.prototype), "resetFromJSON", this).call(this, o); - this.setMode(GetValue$2k(o, 'mode', 0)); + this.setMode(GetValue$2i(o, 'mode', 0)); this.setScaleRange(GetAdvancedValue$3(o, 'start', undefined), GetAdvancedValue$3(o, 'end', 0)); return this; } @@ -30150,7 +30150,7 @@ } }; - var GetValue$2j = Phaser.Utils.Objects.GetValue; + var GetValue$2h = Phaser.Utils.Objects.GetValue; var GetAdvancedValue$2 = Phaser.Utils.Objects.GetAdvancedValue; var Linear$5 = Phaser.Math.Linear; var Fade$2 = /*#__PURE__*/function (_EaseValueTaskBase) { @@ -30171,7 +30171,7 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Fade.prototype), "resetFromJSON", this).call(this, o); - this.setMode(GetValue$2j(o, 'mode', 0)); + this.setMode(GetValue$2h(o, 'mode', 0)); this.setAlphaRange(GetAdvancedValue$2(o, 'start', this.parent.alpha), GetAdvancedValue$2(o, 'end', 0)); return this; } @@ -30351,7 +30351,7 @@ } }; - var GetValue$2i = Phaser.Utils.Objects.GetValue; + var GetValue$2g = Phaser.Utils.Objects.GetValue; var GetAdvancedValue$1 = Phaser.Utils.Objects.GetAdvancedValue; var Linear$4 = Phaser.Math.Linear; var EaseMove = /*#__PURE__*/function (_EaseValueTaskBase) { @@ -30372,7 +30372,7 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(EaseMove.prototype), "resetFromJSON", this).call(this, o); - this.setMode(GetValue$2i(o, 'mode', 0)); + this.setMode(GetValue$2g(o, 'mode', 0)); if (o && (o.hasOwnProperty('x') || o.hasOwnProperty('y'))) { var endX = GetAdvancedValue$1(o, 'x', undefined); var endY = GetAdvancedValue$1(o, 'y', undefined); @@ -30637,7 +30637,7 @@ } }; - var GetValue$2h = Phaser.Utils.Objects.GetValue; + var GetValue$2f = Phaser.Utils.Objects.GetValue; var ShakePosition = /*#__PURE__*/function (_TickTask) { _inherits(ShakePosition, _TickTask); var _super = _createSuper(ShakePosition); @@ -30655,16 +30655,16 @@ _createClass(ShakePosition, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.timer.resetFromJSON(GetValue$2h(o, 'timer')); - this.setEnable(GetValue$2h(o, 'enable', true)); - this.setMode(GetValue$2h(o, 'mode', 1)); - this.isRunning = GetValue$2h(o, 'isRunning', false); - this.setMagnitudeMode(GetValue$2h(o, 'magnitudeMode', 1)); - this.setAxisMode(GetValue$2h(o, "axis", 0)); - this.setDuration(GetValue$2h(o, 'duration', 500)); - this.setMagnitude(GetValue$2h(o, 'magnitude', 10)); - this.ox = GetValue$2h(o, 'ox', undefined); - this.oy = GetValue$2h(o, 'oy', undefined); + this.timer.resetFromJSON(GetValue$2f(o, 'timer')); + this.setEnable(GetValue$2f(o, 'enable', true)); + this.setMode(GetValue$2f(o, 'mode', 1)); + this.isRunning = GetValue$2f(o, 'isRunning', false); + this.setMagnitudeMode(GetValue$2f(o, 'magnitudeMode', 1)); + this.setAxisMode(GetValue$2f(o, "axis", 0)); + this.setDuration(GetValue$2f(o, 'duration', 500)); + this.setMagnitude(GetValue$2f(o, 'magnitude', 10)); + this.ox = GetValue$2f(o, 'ox', undefined); + this.oy = GetValue$2f(o, 'oy', undefined); return this; } }, { @@ -30777,8 +30777,8 @@ value: function start(duration, magnitude) { if (typeof duration !== 'number') { var config = duration; - magnitude = GetValue$2h(config, 'magnitude', undefined); - duration = GetValue$2h(config, 'duration', undefined); + magnitude = GetValue$2f(config, 'magnitude', undefined); + duration = GetValue$2f(config, 'duration', undefined); } if (magnitude !== undefined) { this.setMagnitude(magnitude); @@ -31607,13 +31607,13 @@ function FSM(config) { _classCallCheck(this, FSM); // Attach get-next-state function - var states = GetValue$3n(config, 'states', undefined); + var states = GetValue$3l(config, 'states', undefined); if (states) { this.addStates(states); } // Attach extend members - var extend = GetValue$3n(config, 'extend', undefined); + var extend = GetValue$3l(config, 'extend', undefined); if (extend) { for (var name in extend) { if (!this.hasOwnProperty(name) || this[name] === undefined) { @@ -31623,8 +31623,8 @@ } // Event emitter - var eventEmitter = GetValue$3n(config, 'eventEmitter', undefined); - var EventEmitterClass = GetValue$3n(config, 'EventEmitterClass', undefined); + var eventEmitter = GetValue$3l(config, 'eventEmitter', undefined); + var EventEmitterClass = GetValue$3l(config, 'EventEmitterClass', undefined); this.setEventEmitter(eventEmitter, EventEmitterClass); this._stateLock = false; this.resetFromJSON(config); @@ -31642,9 +31642,9 @@ }, { key: "resetFromJSON", value: function resetFromJSON(o) { - this.setEnable(GetValue$3n(o, 'enable', true)); - this.start(GetValue$3n(o, 'start', undefined)); - var init = GetValue$3n(o, 'init', undefined); + this.setEnable(GetValue$3l(o, 'enable', true)); + this.start(GetValue$3l(o, 'start', undefined)); + var init = GetValue$3l(o, 'init', undefined); if (init) { init.call(this); } @@ -31881,7 +31881,7 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(FSM.prototype), "resetFromJSON", this).call(this, o); - this._scene = GetValue$3n(o, 'scene', undefined); + this._scene = GetValue$3l(o, 'scene', undefined); return this; } }, { @@ -32220,7 +32220,7 @@ var methods$q = {}; Object.assign(methods$q, DelayCallMethods$1, ConfigurationMethods$1, OpenMethods, CloseMethods); - var GetValue$2g = Phaser.Utils.Objects.GetValue; + var GetValue$2e = Phaser.Utils.Objects.GetValue; var OpenCloseTransition = /*#__PURE__*/function (_ComponentBase) { _inherits(OpenCloseTransition, _ComponentBase); var _super = _createSuper(OpenCloseTransition); @@ -32231,15 +32231,15 @@ // this.parent = gameObject; // this.scene - _this.setTransitInTime(GetValue$2g(config, 'duration.in', 200)); - _this.setTransitOutTime(GetValue$2g(config, 'duration.out', 200)); - _this.setTransitInCallback(GetValue$2g(config, 'transitIn')); - _this.setTransitOutCallback(GetValue$2g(config, 'transitOut')); - _this.oneShotMode = GetValue$2g(config, 'destroy', false); + _this.setTransitInTime(GetValue$2e(config, 'duration.in', 200)); + _this.setTransitOutTime(GetValue$2e(config, 'duration.out', 200)); + _this.setTransitInCallback(GetValue$2e(config, 'transitIn')); + _this.setTransitOutCallback(GetValue$2e(config, 'transitOut')); + _this.oneShotMode = GetValue$2e(config, 'destroy', false); _this.delayCallTimer = undefined; _this._state = new State$1(_assertThisInitialized(_this), { eventEmitter: false, - initState: GetValue$2g(config, 'initState', 'IDLE') + initState: GetValue$2e(config, 'initState', 'IDLE') }); _this.openEventData = undefined; _this.closeEventData = undefined; @@ -32331,7 +32331,7 @@ return FullWindowRectangle; }(Rectangle); - var GetValue$2f = Phaser.Utils.Objects.GetValue; + var GetValue$2d = Phaser.Utils.Objects.GetValue; var TouchEventStop = /*#__PURE__*/function (_ComponentBase) { _inherits(TouchEventStop, _ComponentBase); var _super = _createSuper(TouchEventStop); @@ -32351,9 +32351,9 @@ _createClass(TouchEventStop, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.setHitAreaMode(GetValue$2f(o, 'hitAreaMode', 0)); - this.setEnable(GetValue$2f(o, 'enable', true)); - this.setStopMode(GetValue$2f(o, 'stopAllLevels', true)); + this.setHitAreaMode(GetValue$2d(o, 'hitAreaMode', 0)); + this.setEnable(GetValue$2d(o, 'enable', true)); + this.setStopMode(GetValue$2d(o, 'stopAllLevels', true)); return this; } }, { @@ -32440,15 +32440,15 @@ fullWindow: 1 }; - var GetValue$2e = Phaser.Utils.Objects.GetValue; + var GetValue$2c = Phaser.Utils.Objects.GetValue; var Cover = /*#__PURE__*/function (_FullWindowRectangle) { _inherits(Cover, _FullWindowRectangle); var _super = _createSuper(Cover); function Cover(scene, config) { var _this; _classCallCheck(this, Cover); - var fillColor = GetValue$2e(config, 'color', 0x0); - var fillAlpha = GetValue$2e(config, 'alpha', 0.8); + var fillColor = GetValue$2c(config, 'color', 0x0); + var fillAlpha = GetValue$2c(config, 'alpha', 0.8); _this = _super.call(this, scene, fillColor, fillAlpha); _this.touchEventStop = new TouchEventStop(_assertThisInitialized(_this), { hitAreaMode: 1 @@ -32537,7 +32537,7 @@ return true; }; - var GetValue$2d = Phaser.Utils.Objects.GetValue; + var GetValue$2b = Phaser.Utils.Objects.GetValue; var Modal$2 = /*#__PURE__*/function (_OpenCloseTransition) { _inherits(Modal, _OpenCloseTransition); var _super = _createSuper(Modal); @@ -32553,25 +32553,25 @@ if (config.transitOut == null) { config.transitOut = TransitionMode$1.scaleDown; } - config.destroy = GetValue$2d(config, 'destroy', true); + config.destroy = GetValue$2b(config, 'destroy', true); _this = _super.call(this, gameObject, config); // this.parent = gameObject; // this.scene // Cover : key of modal, to block touch input - var coverConfig = GetValue$2d(config, 'cover'); + var coverConfig = GetValue$2b(config, 'cover'); _this.cover = coverConfig !== false ? CreateCover(gameObject, coverConfig) : undefined; if (_this.cover) { - _this.setCoverTransitInCallback(GetValue$2d(coverConfig, 'transitIn', DefaultCoverTransitInCallback)); - _this.setCoverTransitOutCallback(GetValue$2d(coverConfig, 'transitOut', DefaultCoverTransitOutCallback)); + _this.setCoverTransitInCallback(GetValue$2b(coverConfig, 'transitIn', DefaultCoverTransitInCallback)); + _this.setCoverTransitOutCallback(GetValue$2b(coverConfig, 'transitOut', DefaultCoverTransitOutCallback)); } // Close conditions: - var touchOutsideClose = GetValue$2d(config, 'touchOutsideClose', false); - var timeOutDuration = GetValue$2d(config, 'duration.hold', -1); - var timeOutClose = GetValue$2d(config, 'timeOutClose', timeOutDuration >= 0); - var anyTouchClose = GetValue$2d(config, 'anyTouchClose', false); - var manualClose = GetValue$2d(config, 'manualClose', false); + var touchOutsideClose = GetValue$2b(config, 'touchOutsideClose', false); + var timeOutDuration = GetValue$2b(config, 'duration.hold', -1); + var timeOutClose = GetValue$2b(config, 'timeOutClose', timeOutDuration >= 0); + var anyTouchClose = GetValue$2b(config, 'anyTouchClose', false); + var manualClose = GetValue$2b(config, 'manualClose', false); if (manualClose) { touchOutsideClose = false; anyTouchClose = false; @@ -32592,7 +32592,7 @@ } else if (touchOutsideClose) { _this.once('open', _this.touchOutsideClose, _assertThisInitialized(_this)); } - if (GetValue$2d(config, 'openOnStart', true)) { + if (GetValue$2b(config, 'openOnStart', true)) { // Run this.requestOpen() next tick // User can register events before this.requestOpen() _this.delayCall(0, _this.requestOpen, _assertThisInitialized(_this)); @@ -33130,7 +33130,7 @@ } }; - var GetValue$2c = Phaser.Utils.Objects.GetValue; + var GetValue$2a = Phaser.Utils.Objects.GetValue; var ClickOutside = /*#__PURE__*/function (_ComponentBase) { _inherits(ClickOutside, _ComponentBase); var _super = _createSuper(ClickOutside); @@ -33141,7 +33141,7 @@ // this.parent = gameObject; _this._enable = undefined; - var inputConfig = GetValue$2c(config, "inputConfig", undefined); + var inputConfig = GetValue$2a(config, "inputConfig", undefined); if (inputConfig) { gameObject.setInteractive(inputConfig); } @@ -33154,10 +33154,10 @@ value: function resetFromJSON(o) { this.pointer = undefined; this.lastClickTime = undefined; - this.setEnable(GetValue$2c(o, "enable", true)); - this.setMode(GetValue$2c(o, "mode", 1)); - this.setClickInterval(GetValue$2c(o, "clickInterval", 100)); - this.setDragThreshold(GetValue$2c(o, 'threshold', undefined)); + this.setEnable(GetValue$2a(o, "enable", true)); + this.setMode(GetValue$2a(o, "mode", 1)); + this.setClickInterval(GetValue$2a(o, "clickInterval", 100)); + this.setDragThreshold(GetValue$2a(o, 'threshold', undefined)); return this; } }, { @@ -33449,7 +33449,7 @@ return Cooldown; }(FSM); - var GetValue$2b = Phaser.Utils.Objects.GetValue; + var GetValue$29 = Phaser.Utils.Objects.GetValue; var InTouching = /*#__PURE__*/function (_ComponentBase) { _inherits(InTouching, _ComponentBase); var _super = _createSuper(InTouching); @@ -33461,7 +33461,7 @@ _this._enable = undefined; _this.cooldown = new Cooldown(); - _this.parent.setInteractive(GetValue$2b(config, 'inputConfig', undefined)); + _this.parent.setInteractive(GetValue$29(config, 'inputConfig', undefined)); _this.resetFromJSON(config); _this.boot(); return _this; @@ -33472,8 +33472,8 @@ this.pointer = undefined; this.prevIsInTouch = false; this.isInTouching = false; - this.setEnable(GetValue$2b(o, 'enable', true)); - this.setCooldown(GetValue$2b(o, 'cooldown', undefined)); + this.setEnable(GetValue$29(o, 'enable', true)); + this.setCooldown(GetValue$29(o, 'cooldown', undefined)); return this; } }, { @@ -33704,9 +33704,9 @@ eventEmitter.emit(eventName, child, pointer, event); }; - var GetValue$2a = Phaser.Utils.Objects.GetValue; + var GetValue$28 = Phaser.Utils.Objects.GetValue; var DownChild = function DownChild(config) { - var downConfig = GetValue$2a(config, 'down', undefined); + var downConfig = GetValue$28(config, 'down', undefined); if (downConfig === false) { return; } else if (downConfig === true) { @@ -33719,9 +33719,9 @@ EmitChildEvent(childrenInteractive.eventEmitter, "".concat(childrenInteractive.eventNamePrefix, "down"), childrenInteractive.targetSizers, pointer.worldX, pointer.worldY, pointer, event); }; - var GetValue$29 = Phaser.Utils.Objects.GetValue; + var GetValue$27 = Phaser.Utils.Objects.GetValue; var UpChild = function UpChild(config) { - var upConfig = GetValue$29(config, 'up', undefined); + var upConfig = GetValue$27(config, 'up', undefined); if (upConfig === false) { return; } else if (upConfig === true) { @@ -33734,9 +33734,9 @@ EmitChildEvent(childrenInteractive.eventEmitter, "".concat(childrenInteractive.eventNamePrefix, "up"), childrenInteractive.targetSizers, pointer.worldX, pointer.worldY, pointer, event); }; - var GetValue$28 = Phaser.Utils.Objects.GetValue; + var GetValue$26 = Phaser.Utils.Objects.GetValue; var OverChild = function OverChild(config) { - var overConfig = GetValue$28(config, 'over', undefined); + var overConfig = GetValue$26(config, 'over', undefined); if (overConfig === false) { return; } else if (overConfig === true) { @@ -33763,9 +33763,9 @@ EmitChildEvent(childrenInteractive.eventEmitter, "".concat(childrenInteractive.eventNamePrefix, "out"), childrenInteractive.targetSizers, child, undefined, pointer, event); }; - var GetValue$27 = Phaser.Utils.Objects.GetValue; + var GetValue$25 = Phaser.Utils.Objects.GetValue; var ClickChild = function ClickChild(config) { - var clickConfig = GetValue$27(config, 'click', undefined); + var clickConfig = GetValue$25(config, 'click', undefined); if (clickConfig === false) { return; } else if (clickConfig === true) { @@ -33784,7 +33784,7 @@ }, this); }; - var GetValue$26 = Phaser.Utils.Objects.GetValue; + var GetValue$24 = Phaser.Utils.Objects.GetValue; var OnePointerTracer = /*#__PURE__*/function (_TickTask) { _inherits(OnePointerTracer, _TickTask); var _super = _createSuper(OnePointerTracer); @@ -33798,7 +33798,7 @@ _this = _super.call(this, scene, config); _this.gameObject = gameObject; if (gameObject) { - gameObject.setInteractive(GetValue$26(config, "inputConfig", undefined)); + gameObject.setInteractive(GetValue$24(config, "inputConfig", undefined)); } _this._enable = undefined; _this.resetFromJSON(config); @@ -33808,10 +33808,10 @@ _createClass(OnePointerTracer, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.setEnable(GetValue$26(o, 'enable', true)); + this.setEnable(GetValue$24(o, 'enable', true)); this.setDetectBounds(); if (this.gameObject === undefined) { - this.setDetectBounds(GetValue$26(o, 'bounds', undefined)); + this.setDetectBounds(GetValue$24(o, 'bounds', undefined)); } else { this.setDetectBounds(); } @@ -34036,7 +34036,7 @@ var TOUCH1$2 = 1; var IDLE$7 = 'IDLE'; - var GetValue$25 = Phaser.Utils.Objects.GetValue; + var GetValue$23 = Phaser.Utils.Objects.GetValue; var DistanceBetween$5 = Phaser.Math.Distance.Between; var Tap = /*#__PURE__*/function (_OnePointerTracer) { _inherits(Tap, _OnePointerTracer); @@ -34092,16 +34092,16 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Tap.prototype), "resetFromJSON", this).call(this, o); - this.setHoldTime(GetValue$25(o, 'time', 250)); // min-hold-time of Press is 251 - this.setTapInterval(GetValue$25(o, 'tapInterval', 200)); - this.setDragThreshold(GetValue$25(o, 'threshold', 9)); - this.setTapOffset(GetValue$25(o, 'tapOffset', 10)); - var taps = GetValue$25(o, 'taps', undefined); + this.setHoldTime(GetValue$23(o, 'time', 250)); // min-hold-time of Press is 251 + this.setTapInterval(GetValue$23(o, 'tapInterval', 200)); + this.setDragThreshold(GetValue$23(o, 'threshold', 9)); + this.setTapOffset(GetValue$23(o, 'tapOffset', 10)); + var taps = GetValue$23(o, 'taps', undefined); if (taps !== undefined) { this.setTaps(taps); } else { - this.setMaxTaps(GetValue$25(o, 'maxTaps', undefined)); - this.setMinTaps(GetValue$25(o, 'minTaps', undefined)); + this.setMaxTaps(GetValue$23(o, 'maxTaps', undefined)); + this.setMinTaps(GetValue$23(o, 'minTaps', undefined)); } return this; } @@ -34243,7 +34243,7 @@ var BEGIN$5 = 'BEGIN'; var RECOGNIZED$5 = 'RECOGNIZED'; - var GetValue$24 = Phaser.Utils.Objects.GetValue; + var GetValue$22 = Phaser.Utils.Objects.GetValue; var Press = /*#__PURE__*/function (_OnePointerTracer) { _inherits(Press, _OnePointerTracer); var _super = _createSuper(Press); @@ -34298,8 +34298,8 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Press.prototype), "resetFromJSON", this).call(this, o); - this.setDragThreshold(GetValue$24(o, 'threshold', 9)); - this.setHoldTime(GetValue$24(o, 'time', 251)); + this.setDragThreshold(GetValue$22(o, 'threshold', 9)); + this.setHoldTime(GetValue$22(o, 'time', 251)); return this; } }, { @@ -34362,7 +34362,7 @@ var BEGIN$4 = 'BEGIN'; var RECOGNIZED$4 = 'RECOGNIZED'; - var GetValue$23 = Phaser.Utils.Objects.GetValue; + var GetValue$21 = Phaser.Utils.Objects.GetValue; var Pan = /*#__PURE__*/function (_OnePointerTracer) { _inherits(Pan, _OnePointerTracer); var _super = _createSuper(Pan); @@ -34409,7 +34409,7 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Pan.prototype), "resetFromJSON", this).call(this, o); - this.setDragThreshold(GetValue$23(o, 'threshold', 10)); + this.setDragThreshold(GetValue$21(o, 'threshold', 10)); return this; } }, { @@ -34578,7 +34578,7 @@ }; var globOut$1 = {}; - var GetValue$22 = Phaser.Utils.Objects.GetValue; + var GetValue$20 = Phaser.Utils.Objects.GetValue; var RadToDeg$4 = Phaser.Math.RadToDeg; var Swipe = /*#__PURE__*/function (_OnePointerTracer) { _inherits(Swipe, _OnePointerTracer); @@ -34635,9 +34635,9 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Swipe.prototype), "resetFromJSON", this).call(this, o); - this.setDragThreshold(GetValue$22(o, 'threshold', 10)); - this.setVelocityThreshold(GetValue$22(o, 'velocityThreshold', 1000)); - this.setDirectionMode(GetValue$22(o, 'dir', '8dir')); + this.setDragThreshold(GetValue$20(o, 'threshold', 10)); + this.setVelocityThreshold(GetValue$20(o, 'velocityThreshold', 1000)); + this.setDirectionMode(GetValue$20(o, 'dir', '8dir')); return this; } }, { @@ -34744,7 +34744,7 @@ var BEGIN$2 = 'BEGIN'; var RECOGNIZED$2 = 'RECOGNIZED'; - var GetValue$21 = Phaser.Utils.Objects.GetValue; + var GetValue$1$ = Phaser.Utils.Objects.GetValue; var SpliceOne$2 = Phaser.Utils.Array.SpliceOne; var DistanceBetween$3 = Phaser.Math.Distance.Between; var AngleBetween = Phaser.Math.Angle.Between; @@ -34757,7 +34757,7 @@ } this.scene = scene; // Event emitter - this.setEventEmitter(GetValue$21(config, 'eventEmitter', undefined)); + this.setEventEmitter(GetValue$1$(config, 'eventEmitter', undefined)); this._enable = undefined; this.pointers = []; this.movedState = {}; @@ -34767,8 +34767,8 @@ _createClass(TwoPointersTracer, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.setEnable(GetValue$21(o, "enable", true)); - this.bounds = GetValue$21(o, 'bounds', undefined); + this.setEnable(GetValue$1$(o, "enable", true)); + this.bounds = GetValue$1$(o, 'bounds', undefined); this.tracerState = TOUCH0$1; this.pointers.length = 0; Clear(this.movedState); @@ -35081,7 +35081,7 @@ var TOUCH2 = 2; var IDLE$2 = 'IDLE'; - var GetValue$20 = Phaser.Utils.Objects.GetValue; + var GetValue$1_ = Phaser.Utils.Objects.GetValue; var Pinch = /*#__PURE__*/function (_TwoPointersTracer) { _inherits(Pinch, _TwoPointersTracer); var _super = _createSuper(Pinch); @@ -35120,7 +35120,7 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Pinch.prototype), "resetFromJSON", this).call(this, o); - this.setDragThreshold(GetValue$20(o, 'threshold', 0)); + this.setDragThreshold(GetValue$1_(o, 'threshold', 0)); return this; } }, { @@ -35223,7 +35223,7 @@ return this; }; - var GetValue$1$ = Phaser.Utils.Objects.GetValue; + var GetValue$1Z = Phaser.Utils.Objects.GetValue; var WrapDegrees = Phaser.Math.Angle.WrapDegrees; // Wrap degrees: -180 to 180 var ShortestBetween = Phaser.Math.Angle.ShortestBetween; var RadToDeg$3 = Phaser.Math.RadToDeg; @@ -35266,7 +35266,7 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Rotate.prototype), "resetFromJSON", this).call(this, o); - this.setDragThreshold(GetValue$1$(o, 'threshold', 0)); + this.setDragThreshold(GetValue$1Z(o, 'threshold', 0)); return this; } }, { @@ -35330,9 +35330,9 @@ var BEGIN = 'BEGIN'; var RECOGNIZED = 'RECOGNIZED'; - var GetValue$1_ = Phaser.Utils.Objects.GetValue; + var GetValue$1Y = Phaser.Utils.Objects.GetValue; var TapChild = function TapChild(config) { - var tapConfig = GetValue$1_(config, 'tap', undefined); + var tapConfig = GetValue$1Y(config, 'tap', undefined); if (tapConfig === false) { return; } else if (tapConfig === true) { @@ -35345,9 +35345,9 @@ }, this); }; - var GetValue$1Z = Phaser.Utils.Objects.GetValue; + var GetValue$1X = Phaser.Utils.Objects.GetValue; var PressChild = function PressChild(config) { - var pressConfig = GetValue$1Z(config, 'press', undefined); + var pressConfig = GetValue$1X(config, 'press', undefined); if (pressConfig === false) { return; } else if (pressConfig === true) { @@ -35362,9 +35362,9 @@ }, this); }; - var GetValue$1Y = Phaser.Utils.Objects.GetValue; + var GetValue$1W = Phaser.Utils.Objects.GetValue; var SwipeChild = function SwipeChild(config) { - var swipeConfig = GetValue$1Y(config, 'swipe', undefined); + var swipeConfig = GetValue$1W(config, 'swipe', undefined); if (swipeConfig === false) { return; } else if (swipeConfig === true) { @@ -35384,16 +35384,16 @@ }, this); }; - var GetValue$1X = Phaser.Utils.Objects.GetValue; + var GetValue$1V = Phaser.Utils.Objects.GetValue; var SetChildrenInteractive = function SetChildrenInteractive(gameObject, config) { gameObject.setInteractive(); - if (GetValue$1X(config, 'dropZone', false)) { + if (GetValue$1V(config, 'dropZone', false)) { gameObject.input.dropZone = true; } gameObject._childrenInteractive = { - targetSizers: GetValue$1X(config, 'targets', [gameObject]), - eventEmitter: GetValue$1X(config, 'eventEmitter', gameObject), - eventNamePrefix: GetValue$1X(config, 'inputEventPrefix', 'child.') + targetSizers: GetValue$1V(config, 'targets', [gameObject]), + eventEmitter: GetValue$1V(config, 'eventEmitter', gameObject), + eventNamePrefix: GetValue$1V(config, 'inputEventPrefix', 'child.') }; DownChild.call(gameObject, config); UpChild.call(gameObject, config); @@ -35457,7 +35457,7 @@ }; Object.assign(methods$o, PaddingMethods, AddChildMethods$8, RemoveChildMethods$7, GetParentSizerMethods, ScaleMethods, FadeMethods, EaseMoveMethods, ShakeMethods, EaseDataMethods, ClickMethods, ClickOutsideMethods, TouchingMethods, HideMethods, ModalMethods$1, GetShownChildrenMethods); - var GetValue$1W = Phaser.Utils.Objects.GetValue; + var GetValue$1U = Phaser.Utils.Objects.GetValue; var Base = /*#__PURE__*/function (_Container) { _inherits(Base, _Container); var _super = _createSuper(Base); @@ -35467,7 +35467,7 @@ _this = _super.call(this, scene, x, y, 1, 1); _this.isRexSizer = true; _this.setMinSize(minWidth, minHeight); - _this.setName(GetValue$1W(config, 'name', '')); + _this.setName(GetValue$1U(config, 'name', '')); _this.rexSizer = {}; _this.space = {}; _this.backgroundChildren = undefined; @@ -35475,18 +35475,18 @@ _this.childrenMap = {}; _this.layoutedChildren = undefined; _this.enableLayoutWarn(); - var anchorConfig = GetValue$1W(config, 'anchor', undefined); + var anchorConfig = GetValue$1U(config, 'anchor', undefined); if (anchorConfig) { _this.setAnchor(anchorConfig); } - _this.setInnerPadding(GetValue$1W(config, 'space', 0)); - var draggable = GetValue$1W(config, 'draggable', false); + _this.setInnerPadding(GetValue$1U(config, 'space', 0)); + var draggable = GetValue$1U(config, 'draggable', false); if (draggable) { _this.setDraggable(draggable); } - _this.setSizerEventsEnable(GetValue$1W(config, 'sizerEvents', false)); + _this.setSizerEventsEnable(GetValue$1U(config, 'sizerEvents', false)); _this.setDirty(true); - if (GetValue$1W(config, 'enableLayer', false)) { + if (GetValue$1U(config, 'enableLayer', false)) { _this.enableLayer(); } return _this; @@ -35851,23 +35851,23 @@ }; var IsPlainObject$v = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1V = Phaser.Utils.Objects.GetValue; + var GetValue$1T = Phaser.Utils.Objects.GetValue; var ALIGN_CENTER$3 = Phaser.Display.Align.CENTER; var UUID$1 = Phaser.Utils.String.UUID; var Add$7 = function Add(gameObject, childKey, align, padding, expand, minWidth, minHeight, offsetX, offsetY) { AddChild$1.call(this, gameObject); if (IsPlainObject$v(childKey)) { var config = childKey; - childKey = GetValue$1V(config, 'key', undefined); - align = GetValue$1V(config, 'align', ALIGN_CENTER$3); - offsetX = GetValue$1V(config, 'offsetX', 0); - offsetY = GetValue$1V(config, 'offsetY', 0); - padding = GetValue$1V(config, 'padding', 0); - expand = GetValue$1V(config, 'expand', true); + childKey = GetValue$1T(config, 'key', undefined); + align = GetValue$1T(config, 'align', ALIGN_CENTER$3); + offsetX = GetValue$1T(config, 'offsetX', 0); + offsetY = GetValue$1T(config, 'offsetY', 0); + padding = GetValue$1T(config, 'padding', 0); + expand = GetValue$1T(config, 'expand', true); if (!gameObject.isRexSizer) { // Get minWidth,minHeight from config - minWidth = GetValue$1V(config, 'minWidth', gameObject._minWidth); - minHeight = GetValue$1V(config, 'minHeight', gameObject._minHeighted); + minWidth = GetValue$1T(config, 'minWidth', gameObject._minWidth); + minHeight = GetValue$1T(config, 'minHeight', gameObject._minHeighted); } } var hasValidKey = childKey !== undefined; @@ -35907,8 +35907,8 @@ config.alignOffsetY = offsetY; config.padding = GetBoundsConfig(padding); if (IsPlainObject$v(expand)) { - config.expandWidth = GetValue$1V(expand, 'width', false); - config.expandHeight = GetValue$1V(expand, 'height', false); + config.expandWidth = GetValue$1T(expand, 'width', false); + config.expandHeight = GetValue$1T(expand, 'height', false); } else { config.expandWidth = expand; config.expandHeight = expand; @@ -36024,7 +36024,7 @@ }; var IsPlainObject$u = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1U = Phaser.Utils.Objects.GetValue; + var GetValue$1S = Phaser.Utils.Objects.GetValue; var OverlapSizer = /*#__PURE__*/function (_BaseSizer) { _inherits(OverlapSizer, _BaseSizer); var _super = _createSuper(OverlapSizer); @@ -36033,14 +36033,14 @@ _classCallCheck(this, OverlapSizer); if (IsPlainObject$u(x)) { config = x; - x = GetValue$1U(config, 'x', 0); - y = GetValue$1U(config, 'y', 0); - minWidth = GetValue$1U(config, 'width', undefined); - minHeight = GetValue$1U(config, 'height', undefined); + x = GetValue$1S(config, 'x', 0); + y = GetValue$1S(config, 'y', 0); + minWidth = GetValue$1S(config, 'width', undefined); + minHeight = GetValue$1S(config, 'height', undefined); } else if (IsPlainObject$u(minWidth)) { config = minWidth; - minWidth = GetValue$1U(config, 'width', undefined); - minHeight = GetValue$1U(config, 'height', undefined); + minWidth = GetValue$1S(config, 'width', undefined); + minHeight = GetValue$1S(config, 'height', undefined); } _this = _super.call(this, scene, x, y, minWidth, minHeight, config); _this.type = 'rexOverlapSizer'; @@ -36204,7 +36204,7 @@ updateText: UpdateText }; - var GetValue$1T = Phaser.Utils.Objects.GetValue; + var GetValue$1R = Phaser.Utils.Objects.GetValue; var SnapTo$1 = Phaser.Math.Snap.To; var Knob = /*#__PURE__*/function (_ProgressBase) { _inherits(Knob, _ProgressBase); @@ -36222,8 +36222,8 @@ _this.bootProgressBase(config); // Add elements - var background = GetValue$1T(config, 'background', undefined); - var textObject = GetValue$1T(config, 'text', undefined); + var background = GetValue$1R(config, 'background', undefined); + var textObject = GetValue$1R(config, 'text', undefined); if (background) { _this.addBackground(background); } @@ -36232,11 +36232,11 @@ // Don't draw text on knob directly config.textColor = undefined; config.textStrokeColor = undefined; - _this.setTextFormatCallback(GetValue$1T(config, 'textFormatCallback', undefined), GetValue$1T(config, 'textFormatCallbackScope', undefined)); + _this.setTextFormatCallback(GetValue$1R(config, 'textFormatCallback', undefined), GetValue$1R(config, 'textFormatCallbackScope', undefined)); } // Create circular progress object var knob = new CircularProgress$1(scene, config); - knob.setDepth(GetValue$1T(config, 'knobDepth', 0)); + knob.setDepth(GetValue$1R(config, 'knobDepth', 0)); knob._value = -1; // To trigger text updating scene.add.existing(knob); _this.add(knob, 'knob'); @@ -36248,12 +36248,12 @@ _this.addChildrenMap('background', background); _this.addChildrenMap('knob', knob); _this.addChildrenMap('text', textObject); - _this.setEnable(GetValue$1T(config, 'enable', undefined)); - _this.setGap(GetValue$1T(config, 'gap', undefined)); - _this.setValue(GetValue$1T(config, 'value', 0), GetValue$1T(config, 'min', undefined), GetValue$1T(config, 'max', undefined)); + _this.setEnable(GetValue$1R(config, 'enable', undefined)); + _this.setGap(GetValue$1R(config, 'gap', undefined)); + _this.setValue(GetValue$1R(config, 'value', 0), GetValue$1R(config, 'min', undefined), GetValue$1R(config, 'max', undefined)); // Input - var inputMode = GetValue$1T(config, 'input', 0); + var inputMode = GetValue$1R(config, 'input', 0); if (typeof inputMode === 'string') { inputMode = INPUTMODE$1[inputMode]; } @@ -36335,7 +36335,7 @@ roundRectangle: RoundRectangle, triangle: Triangle$1 }; - var GetValue$1S = Phaser.Utils.Objects.GetValue; + var GetValue$1Q = Phaser.Utils.Objects.GetValue; var IsPlainObject$t = Phaser.Utils.Objects.IsPlainObject; var ClearAll = function ClearAll() { var shapes = this.getShapes(); @@ -36353,7 +36353,7 @@ return shape; }, buildShapes: function buildShapes(config) { - var createCallback = GetValue$1S(config, 'create', undefined); + var createCallback = GetValue$1Q(config, 'create', undefined); if (IsPlainObject$t(createCallback)) { var shapes = createCallback; for (var shapeType in shapes) { @@ -36385,7 +36385,7 @@ } else if (typeof createCallback === 'function') { createCallback.call(this); } - this.setUpdateShapesCallback(GetValue$1S(config, 'update')); + this.setUpdateShapesCallback(GetValue$1Q(config, 'update')); }, setUpdateShapesCallback: function setUpdateShapesCallback(callback) { if (callback === undefined) { @@ -36432,7 +36432,7 @@ var tempMatrix$1, parentMatrix; var globOut = {}; - var GetValue$1R = Phaser.Utils.Objects.GetValue; + var GetValue$1P = Phaser.Utils.Objects.GetValue; var IsPlainObject$s = Phaser.Utils.Objects.IsPlainObject; var CustomShapes = /*#__PURE__*/function (_BaseShapes) { _inherits(CustomShapes, _BaseShapes); @@ -36442,13 +36442,13 @@ _classCallCheck(this, CustomShapes); if (IsPlainObject$s(x)) { config = x; - x = GetValue$1R(config, 'x', 0); - y = GetValue$1R(config, 'y', 0); - width = GetValue$1R(config, 'width', 2); - height = GetValue$1R(config, 'height', 2); + x = GetValue$1P(config, 'x', 0); + y = GetValue$1P(config, 'y', 0); + width = GetValue$1P(config, 'width', 2); + height = GetValue$1P(config, 'height', 2); } _this = _super.call(this, scene, x, y, width, height); - _this.type = GetValue$1R(config, 'type', 'rexCustomShapes'); + _this.type = GetValue$1P(config, 'type', 'rexCustomShapes'); _this.buildShapes(config); return _this; } @@ -36483,7 +36483,7 @@ }); SetValue(window, 'RexPlugins.UI.CustomShapes', CustomShapes); - var GetValue$1Q = Phaser.Utils.Objects.GetValue; + var GetValue$1O = Phaser.Utils.Objects.GetValue; var IsPlainObject$r = Phaser.Utils.Objects.IsPlainObject; var CustomProgress = /*#__PURE__*/function (_ProgressBase) { _inherits(CustomProgress, _ProgressBase); @@ -36493,10 +36493,10 @@ _classCallCheck(this, CustomProgress); if (IsPlainObject$r(x)) { config = x; - x = GetValue$1Q(config, 'x', 0); - y = GetValue$1Q(config, 'y', 0); - width = GetValue$1Q(config, 'width', 2); - height = GetValue$1Q(config, 'height', 2); + x = GetValue$1O(config, 'x', 0); + y = GetValue$1O(config, 'y', 0); + width = GetValue$1O(config, 'width', 2); + height = GetValue$1O(config, 'height', 2); } if (config === undefined) { config = {}; @@ -36506,7 +36506,7 @@ } _this = _super.call(this, scene, x, y, width, height, config); _this.bootProgressBase(config); - _this.setValue(GetValue$1Q(config, 'value', 0)); + _this.setValue(GetValue$1O(config, 'value', 0)); return _this; } _createClass(CustomProgress, [{ @@ -36554,7 +36554,7 @@ }; var IsPlainObject$q = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1P = Phaser.Utils.Objects.GetValue; + var GetValue$1N = Phaser.Utils.Objects.GetValue; var GetRandomItem = Phaser.Utils.Array.GetRandom; var DirMode = { out: 0, @@ -36605,9 +36605,9 @@ this.currentTransitionMode = undefined; if (IsPlainObject$q(texture)) { var config = texture; - texture = GetValue$1P(config, 'key', undefined); - frame = GetValue$1P(config, 'frame', undefined); - mode = GetValue$1P(config, 'mode'); + texture = GetValue$1N(config, 'key', undefined); + frame = GetValue$1N(config, 'frame', undefined); + mode = GetValue$1N(config, 'mode'); if (Array.isArray(mode)) { mode = GetRandomItem(mode); } @@ -36960,28 +36960,28 @@ }; }; - var GetValue$1O = Phaser.Utils.Objects.GetValue; + var GetValue$1M = Phaser.Utils.Objects.GetValue; var DefaultImageClass = Phaser.GameObjects.Image; var IsPlainObject$p = Phaser.Utils.Objects.IsPlainObject; var RotateAround$2 = Phaser.Math.RotateAround; var GridCutImage = function GridCutImage(gameObject, columns, rows, config) { if (IsPlainObject$p(columns)) { config = columns; - columns = GetValue$1O(config, 'columns', 1); - rows = GetValue$1O(config, 'rows', 1); + columns = GetValue$1M(config, 'columns', 1); + rows = GetValue$1M(config, 'rows', 1); } - var createImageCallback = GetValue$1O(config, 'createImageCallback'); + var createImageCallback = GetValue$1M(config, 'createImageCallback'); if (!createImageCallback) { - var ImageClass = GetValue$1O(config, 'ImageClass', DefaultImageClass); + var ImageClass = GetValue$1M(config, 'ImageClass', DefaultImageClass); createImageCallback = function createImageCallback(scene, key, frame) { return new ImageClass(scene, 0, 0, key, frame); }; } - var originX = GetValue$1O(config, 'originX', 0.5); - var originY = GetValue$1O(config, 'originY', 0.5); - var addToScene = GetValue$1O(config, 'add', true); - var align = GetValue$1O(config, 'align', addToScene); - var imageObjectPool = GetValue$1O(config, 'objectPool', undefined); + var originX = GetValue$1M(config, 'originX', 0.5); + var originY = GetValue$1M(config, 'originY', 0.5); + var addToScene = GetValue$1M(config, 'add', true); + var align = GetValue$1M(config, 'align', addToScene); + var imageObjectPool = GetValue$1M(config, 'objectPool', undefined); var scene = gameObject.scene; var texture = gameObject.texture; var frame = gameObject.frame; @@ -37116,7 +37116,7 @@ }; var IsPlainObject$o = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1N = Phaser.Utils.Objects.GetValue; + var GetValue$1L = Phaser.Utils.Objects.GetValue; var Clamp$a = Phaser.Math.Clamp; var TransitionImage = /*#__PURE__*/function (_Container) { _inherits(TransitionImage, _Container); @@ -37126,24 +37126,24 @@ _classCallCheck(this, TransitionImage); if (IsPlainObject$o(x)) { config = x; - x = GetValue$1N(config, 'x', 0); - y = GetValue$1N(config, 'y', 0); - texture = GetValue$1N(config, 'key', undefined); - frame = GetValue$1N(config, 'frame', undefined); + x = GetValue$1L(config, 'x', 0); + y = GetValue$1L(config, 'y', 0); + texture = GetValue$1L(config, 'key', undefined); + frame = GetValue$1L(config, 'frame', undefined); } else if (IsPlainObject$o(frame)) { config = frame; frame = undefined; } - var backImage = GetValue$1N(config, 'back', undefined); - var frontImage = GetValue$1N(config, 'front', undefined); + var backImage = GetValue$1L(config, 'back', undefined); + var frontImage = GetValue$1L(config, 'front', undefined); if (!backImage) { backImage = scene.add.image(x, y, texture, frame); } if (!frontImage) { frontImage = scene.add.image(x, y, texture, frame); } - var width = GetValue$1N(config, 'width', frontImage.width); - var height = GetValue$1N(config, 'height', frontImage.height); + var width = GetValue$1L(config, 'width', frontImage.width); + var height = GetValue$1L(config, 'height', frontImage.height); _this = _super.call(this, scene, x, y, width, height); _this.type = 'rexTransitionImage'; backImage.setVisible(false); @@ -37157,18 +37157,18 @@ _this.currentTransitionMode = undefined; // Transition parameters - var onStart = GetValue$1N(config, 'onStart', undefined); - var onProgress = GetValue$1N(config, 'onProgress', undefined); - var onComplete = GetValue$1N(config, 'onComplete', undefined); - var dir = GetValue$1N(config, 'dir', 0); + var onStart = GetValue$1L(config, 'onStart', undefined); + var onProgress = GetValue$1L(config, 'onProgress', undefined); + var onComplete = GetValue$1L(config, 'onComplete', undefined); + var dir = GetValue$1L(config, 'dir', 0); if (onStart === undefined && onProgress === undefined && onComplete === undefined) { onStart = OnStart; onProgress = OnProgress; onComplete = OnComplete; dir = 0; } - _this.setTransitionStartCallback(onStart, GetValue$1N(config, 'onStartScope', undefined)).setTransitionProgressCallback(onProgress, GetValue$1N(config, 'onProgressScope', undefined)).setTransitionCompleteCallback(onComplete, GetValue$1N(config, 'onCompleteScope', undefined)).setTransitionDirection(dir).setDuration(GetValue$1N(config, 'duration', 1000)).setEaseFunction(GetValue$1N(config, 'ease', 'Linear')); - var maskGameObject = GetValue$1N(config, 'mask', undefined); + _this.setTransitionStartCallback(onStart, GetValue$1L(config, 'onStartScope', undefined)).setTransitionProgressCallback(onProgress, GetValue$1L(config, 'onProgressScope', undefined)).setTransitionCompleteCallback(onComplete, GetValue$1L(config, 'onCompleteScope', undefined)).setTransitionDirection(dir).setDuration(GetValue$1L(config, 'duration', 1000)).setEaseFunction(GetValue$1L(config, 'ease', 'Linear')); + var maskGameObject = GetValue$1L(config, 'mask', undefined); if (maskGameObject) { _this.setMaskGameObject(maskGameObject); } @@ -38192,7 +38192,7 @@ var frag = "#ifdef GL_FRAGMENT_PRECISION_HIGH\n#define highmedp highp\n#else\n#define highmedp mediump\n#endif\nprecision highmedp float;\n// Scene buffer\nuniform sampler2D uMainSampler;\nuniform sampler2D uMainSampler2;\n\nuniform int resizeMode;\nuniform float progress;\nuniform float fromRatio;\nuniform float toRatio;\nvarying vec2 outFragCoord;\n// Effect parameters\nuniform float noiseX;\nuniform float noiseY;\nuniform float noiseZ;\nuniform float fromEdgeStart;\nuniform float fromEdgeWidth;\nuniform float toEdgeStart;\nuniform float toEdgeWidth;\n\n".concat(frag$1, "\n\nvec4 getFromColor (vec2 uv) {\n return texture2D(uMainSampler, uv);\n}\n\nvec4 getToColor (vec2 uv) {\n if (resizeMode == 2) {\n // cover\n return texture2D(uMainSampler2, 0.5 + (vec2(uv.x, 1.0 - uv.y) - 0.5) * vec2(min(fromRatio / toRatio, 1.0), min((toRatio / fromRatio), 1.0)));\n } else if (resizeMode == 1) {\n // contain\n return texture2D(uMainSampler2, 0.5 + (vec2(uv.x, 1.0 - uv.y) - 0.5) * vec2(max(fromRatio / toRatio, 1.0), max((toRatio / fromRatio), 1.0)));\n } else {\n // stretch\n return texture2D(uMainSampler2, vec2(uv.x, 1.0 - uv.y));\n }\n}\n\nvec4 transition (vec2 uv) { \n vec4 colorFront = getFromColor(uv);\n vec4 colorTo = getToColor(uv);\n\n float noise = (Perlin(vec3(uv.x * noiseX, uv.y * noiseY, noiseZ)) + 1.0) / 2.0\n * (1.0 - (fromEdgeStart + fromEdgeWidth + toEdgeStart + toEdgeWidth))\n + (fromEdgeStart + fromEdgeWidth + toEdgeStart + toEdgeWidth) * 0.5;\n vec4 colorResult = colorFront * smoothstep(progress - (fromEdgeStart + fromEdgeWidth), progress - fromEdgeStart, noise)\n + colorTo * smoothstep((1.0 - progress) - (toEdgeStart + toEdgeWidth), (1.0 - progress) - toEdgeStart, (1.0 - noise));\n return colorResult;\n}\n\nvoid main () {\n vec2 uv = outFragCoord;\n gl_FragColor = transition(uv);\n}\n"); var PostFXPipeline = Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; - var GetValue$1M = Phaser.Utils.Objects.GetValue; + var GetValue$1K = Phaser.Utils.Objects.GetValue; var Clamp$9 = Phaser.Math.Clamp; var DissolvePostFxPipeline = /*#__PURE__*/function (_PostFXPipeline) { _inherits(DissolvePostFxPipeline, _PostFXPipeline); @@ -38223,11 +38223,11 @@ _createClass(DissolvePostFxPipeline, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.setProgress(GetValue$1M(o, 'progress', 0)); - this.setTransitionTargetTexture(GetValue$1M(o, 'toTexture', '__DEFAULT'), GetValue$1M(o, 'toFrame', undefined), GetValue$1M(o, 'resizeMode', 1)); - this.setNoise(GetValue$1M(o, 'noiseX', undefined), GetValue$1M(o, 'noiseY', undefined), GetValue$1M(o, 'noiseZ', undefined)); - this.setFromEdge(GetValue$1M(o, 'fromEdgeStart', 0.01), GetValue$1M(o, 'fromEdgeWidth', 0.05)); - this.setToEdge(GetValue$1M(o, 'toEdgeStart', 0.01), GetValue$1M(o, 'toEdgeWidth', 0.05)); + this.setProgress(GetValue$1K(o, 'progress', 0)); + this.setTransitionTargetTexture(GetValue$1K(o, 'toTexture', '__DEFAULT'), GetValue$1K(o, 'toFrame', undefined), GetValue$1K(o, 'resizeMode', 1)); + this.setNoise(GetValue$1K(o, 'noiseX', undefined), GetValue$1K(o, 'noiseY', undefined), GetValue$1K(o, 'noiseZ', undefined)); + this.setFromEdge(GetValue$1K(o, 'fromEdgeStart', 0.01), GetValue$1K(o, 'fromEdgeWidth', 0.05)); + this.setToEdge(GetValue$1K(o, 'toEdgeStart', 0.01), GetValue$1K(o, 'toEdgeWidth', 0.05)); return this; } }, { @@ -38526,7 +38526,7 @@ var globalSize = {}; var IsPlainObject$n = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1L = Phaser.Utils.Objects.GetValue; + var GetValue$1J = Phaser.Utils.Objects.GetValue; var ImageBox = /*#__PURE__*/function (_Container) { _inherits(ImageBox, _Container); var _super = _createSuper(ImageBox); @@ -38535,15 +38535,15 @@ _classCallCheck(this, ImageBox); if (IsPlainObject$n(x)) { config = x; - x = GetValue$1L(config, 'x', 0); - y = GetValue$1L(config, 'y', 0); - texture = GetValue$1L(config, 'key', undefined); - frame = GetValue$1L(config, 'frame', undefined); + x = GetValue$1J(config, 'x', 0); + y = GetValue$1J(config, 'y', 0); + texture = GetValue$1J(config, 'key', undefined); + frame = GetValue$1J(config, 'frame', undefined); } else if (IsPlainObject$n(frame)) { config = frame; frame = undefined; } - var image = GetValue$1L(config, 'image'); + var image = GetValue$1J(config, 'image'); if (!image) { image = scene.add.image(x, y, texture, frame); if (texture === undefined) { @@ -38556,8 +38556,8 @@ _this.type = 'rexImageBox'; _this.add(image); _this.image = image; - var width = GetValue$1L(config, 'width', image.width); - var height = GetValue$1L(config, 'height', image.height); + var width = GetValue$1J(config, 'width', image.width); + var height = GetValue$1J(config, 'height', image.height); _this.resize(width, height); return _this; } @@ -38715,10 +38715,10 @@ select: 'select' }; - var GetValue$1K = Phaser.Utils.Objects.GetValue; + var GetValue$1I = Phaser.Utils.Objects.GetValue; var RouteEvents = function RouteEvents(gameObject, element, elementEvents, config) { - var preventDefault = GetValue$1K(config, 'preventDefault', false); - var preTest = GetValue$1K(config, 'preTest'); + var preventDefault = GetValue$1I(config, 'preventDefault', false); + var preTest = GetValue$1I(config, 'preTest'); var _loop = function _loop(elementEventName) { // Note: Don't use `var` here element.addEventListener(elementEventName, function (e) { @@ -38737,7 +38737,7 @@ var DOMElement$2 = Phaser.GameObjects.DOMElement; var IsPlainObject$m = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1J = Phaser.Utils.Objects.GetValue; + var GetValue$1H = Phaser.Utils.Objects.GetValue; var InputText = /*#__PURE__*/function (_DOMElement) { _inherits(InputText, _DOMElement); var _super = _createSuper(InputText); @@ -38746,22 +38746,22 @@ _classCallCheck(this, InputText); if (IsPlainObject$m(x)) { config = x; - x = GetValue$1J(config, 'x', 0); - y = GetValue$1J(config, 'y', 0); - width = GetValue$1J(config, 'width', 0); - height = GetValue$1J(config, 'height', 0); + x = GetValue$1H(config, 'x', 0); + y = GetValue$1H(config, 'y', 0); + width = GetValue$1H(config, 'width', 0); + height = GetValue$1H(config, 'height', 0); } else if (IsPlainObject$m(width)) { config = width; - width = GetValue$1J(config, 'width', 0); - height = GetValue$1J(config, 'height', 0); + width = GetValue$1H(config, 'width', 0); + height = GetValue$1H(config, 'height', 0); } if (config === undefined) { config = {}; } var element; - var textType = GetValue$1J(config, 'inputType', undefined); + var textType = GetValue$1H(config, 'inputType', undefined); if (textType === undefined) { - textType = GetValue$1J(config, 'type', 'text'); + textType = GetValue$1H(config, 'type', 'text'); } if (textType === 'textarea') { element = document.createElement('textarea'); @@ -38771,7 +38771,7 @@ element.type = textType; } SetProperties(ElementProperties, config, element); - var style = GetValue$1J(config, 'style', undefined); + var style = GetValue$1H(config, 'style', undefined); style = SetProperties(StyleProperties, config, style); // Apply other style properties var elementStyle = element.style; @@ -38792,7 +38792,7 @@ // Don't propagate touch/mouse events to parent(game canvas) StopPropagationTouchEvents(element); - if (GetValue$1J(config, 'selectAll', false)) { + if (GetValue$1H(config, 'selectAll', false)) { _this.selectAll(); } _this._isFocused = false; @@ -39043,12 +39043,12 @@ }); SetValue(window, 'RexPlugins.UI.InputText', InputText); - var GetValue$1I = Phaser.Utils.Objects.GetValue; + var GetValue$1G = Phaser.Utils.Objects.GetValue; var CreateFileInput = function CreateFileInput(config) { var fileInput = document.createElement('input'); fileInput.type = 'file'; - var accept = GetValue$1I(config, 'accept', ''); - var multiple = GetValue$1I(config, 'multiple', false); + var accept = GetValue$1G(config, 'accept', ''); + var multiple = GetValue$1G(config, 'multiple', false); fileInput.setAttribute('accept', accept); if (multiple) { fileInput.setAttribute('multiple', ''); @@ -39085,10 +39085,10 @@ // Note: Not working in iOS9+ - var GetValue$1H = Phaser.Utils.Objects.GetValue; + var GetValue$1F = Phaser.Utils.Objects.GetValue; var Open$1 = function Open(game, config) { // game: game, scene, or game object - var closeDelay = GetValue$1H(config, 'closeDelay', 200); + var closeDelay = GetValue$1F(config, 'closeDelay', 200); var fileInput = CreateFileInput(config); fileInput.click(); return ClickPromise({ @@ -39190,7 +39190,7 @@ var DOMElement$1 = Phaser.GameObjects.DOMElement; var IsPlainObject$l = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1G = Phaser.Utils.Objects.GetValue; + var GetValue$1E = Phaser.Utils.Objects.GetValue; var FileChooser = /*#__PURE__*/function (_DOMElement) { _inherits(FileChooser, _DOMElement); var _super = _createSuper(FileChooser); @@ -39199,14 +39199,14 @@ _classCallCheck(this, FileChooser); if (IsPlainObject$l(x)) { config = x; - x = GetValue$1G(config, 'x', 0); - y = GetValue$1G(config, 'y', 0); - width = GetValue$1G(config, 'width', 0); - height = GetValue$1G(config, 'height', 0); + x = GetValue$1E(config, 'x', 0); + y = GetValue$1E(config, 'y', 0); + width = GetValue$1E(config, 'width', 0); + height = GetValue$1E(config, 'height', 0); } else if (IsPlainObject$l(width)) { config = width; - width = GetValue$1G(config, 'width', 0); - height = GetValue$1G(config, 'height', 0); + width = GetValue$1E(config, 'width', 0); + height = GetValue$1E(config, 'height', 0); } // Create a hidden file input @@ -39218,7 +39218,7 @@ // Create a label parent var labelElement = document.createElement('label'); labelElement.appendChild(inputElement); - var style = GetValue$1G(config, 'style', undefined); + var style = GetValue$1E(config, 'style', undefined); _this = _super.call(this, scene, x, y, labelElement, style); _this.type = 'rexFileChooser'; _this.resetFromJSON(config); @@ -39229,7 +39229,7 @@ inputElement.onchange = function () { self.emit('change', self); }; - _this.setCloseDelay(GetValue$1G(config, 'closeDelay', 200)); + _this.setCloseDelay(GetValue$1E(config, 'closeDelay', 200)); inputElement.onclick = function () { ClickPromise({ game: scene, @@ -39244,8 +39244,8 @@ _createClass(FileChooser, [{ key: "resetFromJSON", value: function resetFromJSON(config) { - this.setAccept(GetValue$1G(config, 'accept', '')); - this.setMultiple(GetValue$1G(config, 'multiple', false)); + this.setAccept(GetValue$1E(config, 'accept', '')); + this.setMultiple(GetValue$1E(config, 'multiple', false)); return this; } }, { @@ -39360,7 +39360,7 @@ var DOMElement = Phaser.GameObjects.DOMElement; var IsPlainObject$k = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1F = Phaser.Utils.Objects.GetValue; + var GetValue$1D = Phaser.Utils.Objects.GetValue; var FileDropZone = /*#__PURE__*/function (_DOMElement) { _inherits(FileDropZone, _DOMElement); var _super = _createSuper(FileDropZone); @@ -39369,26 +39369,26 @@ _classCallCheck(this, FileDropZone); if (IsPlainObject$k(x)) { config = x; - x = GetValue$1F(config, 'x', 0); - y = GetValue$1F(config, 'y', 0); - width = GetValue$1F(config, 'width', 0); - height = GetValue$1F(config, 'height', 0); + x = GetValue$1D(config, 'x', 0); + y = GetValue$1D(config, 'y', 0); + width = GetValue$1D(config, 'width', 0); + height = GetValue$1D(config, 'height', 0); } else if (IsPlainObject$k(width)) { config = width; - width = GetValue$1F(config, 'width', 0); - height = GetValue$1F(config, 'height', 0); + width = GetValue$1D(config, 'width', 0); + height = GetValue$1D(config, 'height', 0); } if (config === undefined) { config = {}; } var element = document.createElement('div'); - var style = GetValue$1F(config, 'style', undefined); + var style = GetValue$1D(config, 'style', undefined); _this = _super.call(this, scene, x, y, element, style); _this.type = 'rexFileDropZone'; _this.resize(width, height); _this._files = []; - _this.setDropEnable(GetValue$1F(config, 'dropEnable', true)); - var filters = GetValue$1F(config, 'filters'); + _this.setDropEnable(GetValue$1D(config, 'dropEnable', true)); + var filters = GetValue$1D(config, 'filters'); if (filters) { _this.addFilters(filters); } @@ -39498,7 +39498,7 @@ return Style; }(ComponentBase); - var GetValue$1E = Phaser.Utils.Objects.GetValue; + var GetValue$1C = Phaser.Utils.Objects.GetValue; var StyleManager = /*#__PURE__*/function (_ComponentBase) { _inherits(StyleManager, _ComponentBase); var _super = _createSuper(StyleManager); @@ -39508,12 +39508,12 @@ _this = _super.call(this, gameObject, config); // this.parent = gameObject; - _this.style = GetValue$1E(config, 'style', _assertThisInitialized(_this)); - var propertiesMap = GetValue$1E(config, 'propertiesMap'); + _this.style = GetValue$1C(config, 'style', _assertThisInitialized(_this)); + var propertiesMap = GetValue$1C(config, 'propertiesMap'); _this.activeStyle = ExtractStyle(config, 'active', propertiesMap); _this.hoverStyle = ExtractStyle(config, 'hover', propertiesMap); _this.disableStyle = ExtractStyle(config, 'disable', propertiesMap); - _this.onModifyStyle = GetValue$1E(config, 'onModifyStyle'); + _this.onModifyStyle = GetValue$1C(config, 'onModifyStyle'); return _this; } _createClass(StyleManager, [{ @@ -39618,7 +39618,7 @@ }; var PhaserImage = Phaser.GameObjects.Image; - var GetValue$1D = Phaser.Utils.Objects.GetValue; + var GetValue$1B = Phaser.Utils.Objects.GetValue; var StatesImage = /*#__PURE__*/function (_PhaserImage) { _inherits(StatesImage, _PhaserImage); var _super = _createSuper(StatesImage); @@ -39628,13 +39628,13 @@ if (config === undefined) { config = {}; } - var x = GetValue$1D(config, 'x', 0); - var y = GetValue$1D(config, 'y', 0); - var key = GetValue$1D(config, 'key', ''); - var frame = GetValue$1D(config, 'frame', undefined); + var x = GetValue$1B(config, 'x', 0); + var y = GetValue$1B(config, 'y', 0); + var key = GetValue$1B(config, 'key', ''); + var frame = GetValue$1B(config, 'frame', undefined); _this = _super.call(this, scene, x, y, key, frame); _this.type = 'rexStatesImage'; - var effectConfig = GetValue$1D(config, 'effects', true); + var effectConfig = GetValue$1B(config, 'effects', true); if (effectConfig) { AddEffectProperties(_assertThisInitialized(_this), effectConfig); } @@ -39780,7 +39780,7 @@ }(ComponentBase); var PhaserNineSlice = Phaser.GameObjects.NineSlice; - var GetValue$1C = Phaser.Utils.Objects.GetValue; + var GetValue$1A = Phaser.Utils.Objects.GetValue; var StatesNineSlice = /*#__PURE__*/function (_PhaserNineSlice) { _inherits(StatesNineSlice, _PhaserNineSlice); var _super = _createSuper(StatesNineSlice); @@ -39790,19 +39790,19 @@ if (config === undefined) { config = {}; } - var x = GetValue$1C(config, 'x', 0); - var y = GetValue$1C(config, 'y', 0); - var key = GetValue$1C(config, 'key', null); - var frame = GetValue$1C(config, 'frame', null); - var width = GetValue$1C(config, 'width', 0); - var height = GetValue$1C(config, 'height', 0); - var leftWidth = GetValue$1C(config, 'leftWidth', 0); - var rightWidth = GetValue$1C(config, 'rightWidth', 0); - var topHeight = GetValue$1C(config, 'topHeight', 0); - var bottomHeight = GetValue$1C(config, 'bottomHeight', 0); + var x = GetValue$1A(config, 'x', 0); + var y = GetValue$1A(config, 'y', 0); + var key = GetValue$1A(config, 'key', null); + var frame = GetValue$1A(config, 'frame', null); + var width = GetValue$1A(config, 'width', 0); + var height = GetValue$1A(config, 'height', 0); + var leftWidth = GetValue$1A(config, 'leftWidth', 0); + var rightWidth = GetValue$1A(config, 'rightWidth', 0); + var topHeight = GetValue$1A(config, 'topHeight', 0); + var bottomHeight = GetValue$1A(config, 'bottomHeight', 0); _this = _super.call(this, scene, x, y, key, frame, width, height, leftWidth, rightWidth, topHeight, bottomHeight); _this.type = 'rexStatesNineSlice'; - var effectConfig = GetValue$1C(config, 'effects', true); + var effectConfig = GetValue$1A(config, 'effects', true); if (effectConfig) { AddEffectProperties(_assertThisInitialized(_this), effectConfig); } @@ -39824,7 +39824,7 @@ SetValue(window, 'RexPlugins.UI.StatesNineSlice', StatesNineSlice); var PhaserText = Phaser.GameObjects.Text; - var GetValue$1B = Phaser.Utils.Objects.GetValue; + var GetValue$1z = Phaser.Utils.Objects.GetValue; var StatesText = /*#__PURE__*/function (_PhaserText) { _inherits(StatesText, _PhaserText); var _super = _createSuper(StatesText); @@ -39834,9 +39834,9 @@ if (config === undefined) { config = {}; } - var x = GetValue$1B(config, 'x', 0); - var y = GetValue$1B(config, 'y', 0); - var text = GetValue$1B(config, 'text', ''); + var x = GetValue$1z(config, 'x', 0); + var y = GetValue$1z(config, 'y', 0); + var text = GetValue$1z(config, 'text', ''); _this = _super.call(this, scene, x, y, text, config); _this.type = 'rexStatesText'; config.style = _this.style; @@ -40443,7 +40443,7 @@ }; var IsPlainObject$j = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1A = Phaser.Utils.Objects.GetValue; + var GetValue$1y = Phaser.Utils.Objects.GetValue; var ALIGN_CENTER$2 = Phaser.Display.Align.CENTER; var PROPORTIONMODE = { min: 0, @@ -40459,17 +40459,17 @@ proportion = PROPORTIONMODE[proportion]; } else if (IsPlainObject$j(proportion)) { var config = proportion; - proportion = GetValue$1A(config, 'proportion', undefined); - align = GetValue$1A(config, 'align', ALIGN_CENTER$2); - paddingConfig = GetValue$1A(config, 'padding', 0); - expand = GetValue$1A(config, 'expand', false); - childKey = GetValue$1A(config, 'key', undefined); - index = GetValue$1A(config, 'index', undefined); + proportion = GetValue$1y(config, 'proportion', undefined); + align = GetValue$1y(config, 'align', ALIGN_CENTER$2); + paddingConfig = GetValue$1y(config, 'padding', 0); + expand = GetValue$1y(config, 'expand', false); + childKey = GetValue$1y(config, 'key', undefined); + index = GetValue$1y(config, 'index', undefined); if (!gameObject.isRexSizer) { - minWidth = GetValue$1A(config, 'minWidth', undefined); - minHeight = GetValue$1A(config, 'minHeight', undefined); + minWidth = GetValue$1y(config, 'minWidth', undefined); + minHeight = GetValue$1y(config, 'minHeight', undefined); } - fitRatio = GetValue$1A(config, 'fitRatio', 0); // width/height + fitRatio = GetValue$1y(config, 'fitRatio', 0); // width/height } if (typeof align === 'string') { @@ -40686,7 +40686,7 @@ }; var IsPlainObject$i = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1z = Phaser.Utils.Objects.GetValue; + var GetValue$1x = Phaser.Utils.Objects.GetValue; var Sizer = /*#__PURE__*/function (_BaseSizer) { _inherits(Sizer, _BaseSizer); var _super = _createSuper(Sizer); @@ -40695,19 +40695,19 @@ _classCallCheck(this, Sizer); if (IsPlainObject$i(x)) { config = x; - x = GetValue$1z(config, 'x', 0); - y = GetValue$1z(config, 'y', 0); - minWidth = GetValue$1z(config, 'width', undefined); - minHeight = GetValue$1z(config, 'height', undefined); - orientation = GetValue$1z(config, 'orientation', 0); + x = GetValue$1x(config, 'x', 0); + y = GetValue$1x(config, 'y', 0); + minWidth = GetValue$1x(config, 'width', undefined); + minHeight = GetValue$1x(config, 'height', undefined); + orientation = GetValue$1x(config, 'orientation', 0); } else if (IsPlainObject$i(minWidth)) { config = minWidth; - minWidth = GetValue$1z(config, 'width', undefined); - minHeight = GetValue$1z(config, 'height', undefined); - orientation = GetValue$1z(config, 'orientation', 0); + minWidth = GetValue$1x(config, 'width', undefined); + minHeight = GetValue$1x(config, 'height', undefined); + orientation = GetValue$1x(config, 'orientation', 0); } else if (IsPlainObject$i(orientation)) { config = orientation; - orientation = GetValue$1z(config, 'orientation', 0); + orientation = GetValue$1x(config, 'orientation', 0); } if (orientation === undefined) { orientation = 0; @@ -40716,9 +40716,9 @@ _this.type = 'rexSizer'; _this.sizerChildren = []; _this.setOrientation(orientation); - _this.setItemSpacing(GetValue$1z(config, 'space.item', 0)); - _this.setStartChildIndex(GetValue$1z(config, 'startChildIndex', 0)); - _this.setRTL(GetValue$1z(config, 'rtl', false)); + _this.setItemSpacing(GetValue$1x(config, 'space.item', 0)); + _this.setStartChildIndex(GetValue$1x(config, 'startChildIndex', 0)); + _this.setRTL(GetValue$1x(config, 'rtl', false)); _this.addChildrenMap('items', _this.sizerChildren); return _this; } @@ -41017,7 +41017,7 @@ }; var IsPlainObject$h = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1y = Phaser.Utils.Objects.GetValue; + var GetValue$1w = Phaser.Utils.Objects.GetValue; var ALIGN_CENTER$1 = Phaser.Display.Align.CENTER; var GetEmptyCellIndex = function GetEmptyCellIndex(columnIndex, rowIndex, cells, columnCount, rowCount) { if (typeof columnIndex === 'number' || typeof rowIndex === 'number') { @@ -41066,12 +41066,12 @@ AddChild$1.call(this, gameObject); if (IsPlainObject$h(columnIndex)) { var config = columnIndex; - columnIndex = GetValue$1y(config, 'column', undefined); - rowIndex = GetValue$1y(config, 'row', undefined); - align = GetValue$1y(config, 'align', ALIGN_CENTER$1); - paddingConfig = GetValue$1y(config, 'padding', 0); - expand = GetValue$1y(config, 'expand', false); - childKey = GetValue$1y(config, 'key', undefined); + columnIndex = GetValue$1w(config, 'column', undefined); + rowIndex = GetValue$1w(config, 'row', undefined); + align = GetValue$1w(config, 'align', ALIGN_CENTER$1); + paddingConfig = GetValue$1w(config, 'padding', 0); + expand = GetValue$1w(config, 'expand', false); + childKey = GetValue$1w(config, 'key', undefined); } // Get insert index @@ -41106,8 +41106,8 @@ config.align = align; config.padding = GetBoundsConfig(paddingConfig); if (IsPlainObject$h(expand)) { - config.expandWidth = GetValue$1y(expand, 'width', false); - config.expandHeight = GetValue$1y(expand, 'height', false); + config.expandWidth = GetValue$1w(expand, 'width', false); + config.expandHeight = GetValue$1w(expand, 'height', false); } else { config.expandWidth = expand; config.expandHeight = expand; @@ -41212,7 +41212,7 @@ } }; - var GetValue$1x = Phaser.Utils.Objects.GetValue; + var GetValue$1v = Phaser.Utils.Objects.GetValue; var ResetGrid = function ResetGrid(columnCount, rowCount, columnProportions, rowProportions, space) { if (columnProportions === undefined) { columnProportions = 0; @@ -41256,8 +41256,8 @@ this.rowHeight.length = rowCount; // space - this.setColumnSpace(GetValue$1x(space, 'column', 0)); - this.setRowSpace(GetValue$1x(space, 'row', 0)); + this.setColumnSpace(GetValue$1v(space, 'column', 0)); + this.setRowSpace(GetValue$1v(space, 'row', 0)); var scene = this.scene; var createCellContainerCallback = this.createCellContainerCallback; if (createCellContainerCallback) { @@ -41371,7 +41371,7 @@ }; var IsPlainObject$g = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1w = Phaser.Utils.Objects.GetValue; + var GetValue$1u = Phaser.Utils.Objects.GetValue; var GridSizer = /*#__PURE__*/function (_BaseSizer) { _inherits(GridSizer, _BaseSizer); var _super = _createSuper(GridSizer); @@ -41380,41 +41380,41 @@ _classCallCheck(this, GridSizer); if (IsPlainObject$g(x)) { config = x; - x = GetValue$1w(config, 'x', 0); - y = GetValue$1w(config, 'y', 0); - minWidth = GetValue$1w(config, 'width', undefined); - minHeight = GetValue$1w(config, 'height', undefined); - columnCount = GetValue$1w(config, 'column', config.col || 0); - rowCount = GetValue$1w(config, 'row', 0); - columnProportions = GetValue$1w(config, 'columnProportions', 0); - rowProportions = GetValue$1w(config, 'rowProportions', 0); + x = GetValue$1u(config, 'x', 0); + y = GetValue$1u(config, 'y', 0); + minWidth = GetValue$1u(config, 'width', undefined); + minHeight = GetValue$1u(config, 'height', undefined); + columnCount = GetValue$1u(config, 'column', config.col || 0); + rowCount = GetValue$1u(config, 'row', 0); + columnProportions = GetValue$1u(config, 'columnProportions', 0); + rowProportions = GetValue$1u(config, 'rowProportions', 0); } else if (IsPlainObject$g(minWidth)) { config = minWidth; - minWidth = GetValue$1w(config, 'width', undefined); - minHeight = GetValue$1w(config, 'height', undefined); - columnCount = GetValue$1w(config, 'column', config.col || 0); - rowCount = GetValue$1w(config, 'row', 0); - columnProportions = GetValue$1w(config, 'columnProportions', 0); - rowProportions = GetValue$1w(config, 'rowProportions', 0); + minWidth = GetValue$1u(config, 'width', undefined); + minHeight = GetValue$1u(config, 'height', undefined); + columnCount = GetValue$1u(config, 'column', config.col || 0); + rowCount = GetValue$1u(config, 'row', 0); + columnProportions = GetValue$1u(config, 'columnProportions', 0); + rowProportions = GetValue$1u(config, 'rowProportions', 0); } else if (IsPlainObject$g(columnCount)) { config = columnCount; - columnCount = GetValue$1w(config, 'column', config.col || 0); - rowCount = GetValue$1w(config, 'row', 0); - columnProportions = GetValue$1w(config, 'columnProportions', 0); - rowProportions = GetValue$1w(config, 'rowProportions', 0); + columnCount = GetValue$1u(config, 'column', config.col || 0); + rowCount = GetValue$1u(config, 'row', 0); + columnProportions = GetValue$1u(config, 'columnProportions', 0); + rowProportions = GetValue$1u(config, 'rowProportions', 0); } else if (IsPlainObject$g(columnProportions)) { config = columnProportions; - columnProportions = GetValue$1w(config, 'columnProportions', 0); - rowProportions = GetValue$1w(config, 'rowProportions', 0); + columnProportions = GetValue$1u(config, 'columnProportions', 0); + rowProportions = GetValue$1u(config, 'rowProportions', 0); } _this = _super.call(this, scene, x, y, minWidth, minHeight, config); _this.type = 'rexGridSizer'; _this.sizerChildren = []; _this.addChildrenMap('items', _this.sizerChildren); - _this.setCreateCellContainerCallback(GetValue$1w(config, 'createCellContainerCallback')); - _this.setIndentLeft(GetValue$1w(config, 'space.indentLeftOdd', 0), GetValue$1w(config, 'space.indentLeftEven', 0)); - _this.setIndentTop(GetValue$1w(config, 'space.indentTopOdd', 0), GetValue$1w(config, 'space.indentTopEven', 0)); - _this.resetGrid(columnCount, rowCount, columnProportions, rowProportions, GetValue$1w(config, 'space', undefined)); + _this.setCreateCellContainerCallback(GetValue$1u(config, 'createCellContainerCallback')); + _this.setIndentLeft(GetValue$1u(config, 'space.indentLeftOdd', 0), GetValue$1u(config, 'space.indentLeftEven', 0)); + _this.setIndentTop(GetValue$1u(config, 'space.indentTopOdd', 0), GetValue$1u(config, 'space.indentTopEven', 0)); + _this.resetGrid(columnCount, rowCount, columnProportions, rowProportions, GetValue$1u(config, 'space', undefined)); return _this; } _createClass(GridSizer, [{ @@ -41785,7 +41785,7 @@ }; var IsPlainObject$f = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1v = Phaser.Utils.Objects.GetValue; + var GetValue$1t = Phaser.Utils.Objects.GetValue; var ALIGN_CENTER = Phaser.Display.Align.CENTER; var Add$3 = function Add(gameObject, paddingConfig, childKey, index) { if (gameObject === '\n') { @@ -41795,9 +41795,9 @@ AddChild$1.call(this, gameObject); if (IsPlainObject$f(paddingConfig)) { var config = paddingConfig; - paddingConfig = GetValue$1v(config, 'padding', 0); - childKey = GetValue$1v(config, 'key', undefined); - index = GetValue$1v(config, 'index', undefined); + paddingConfig = GetValue$1t(config, 'padding', 0); + childKey = GetValue$1t(config, 'key', undefined); + index = GetValue$1t(config, 'index', undefined); } if (paddingConfig === undefined) { paddingConfig = 0; @@ -41913,7 +41913,7 @@ }; var IsPlainObject$e = Phaser.Utils.Objects.IsPlainObject; - var GetValue$1u = Phaser.Utils.Objects.GetValue; + var GetValue$1s = Phaser.Utils.Objects.GetValue; var FixWidthSizer = /*#__PURE__*/function (_BaseSizer) { _inherits(FixWidthSizer, _BaseSizer); var _super = _createSuper(FixWidthSizer); @@ -41922,26 +41922,26 @@ _classCallCheck(this, FixWidthSizer); if (IsPlainObject$e(x)) { config = x; - x = GetValue$1u(config, 'x', 0); - y = GetValue$1u(config, 'y', 0); - minWidth = GetValue$1u(config, 'width', undefined); - minHeight = GetValue$1u(config, 'height', undefined); + x = GetValue$1s(config, 'x', 0); + y = GetValue$1s(config, 'y', 0); + minWidth = GetValue$1s(config, 'width', undefined); + minHeight = GetValue$1s(config, 'height', undefined); } else if (IsPlainObject$e(minWidth)) { config = minWidth; - minWidth = GetValue$1u(config, 'width', undefined); - minHeight = GetValue$1u(config, 'height', undefined); + minWidth = GetValue$1s(config, 'width', undefined); + minHeight = GetValue$1s(config, 'height', undefined); } _this = _super.call(this, scene, x, y, minWidth, minHeight, config); _this.type = 'rexFixWidthSizer'; _this.sizerChildren = []; - _this.setOrientation(GetValue$1u(config, 'orientation', 0)); - _this.setItemSpacing(GetValue$1u(config, 'space.item', 0)); - _this.setLineSpacing(GetValue$1u(config, 'space.line', 0)); - _this.setIntentLeft(GetValue$1u(config, 'space.indentLeftOdd', 0), GetValue$1u(config, 'space.indentLeftEven', 0)); - _this.setIntentTop(GetValue$1u(config, 'space.indentTopOdd', 0), GetValue$1u(config, 'space.indentTopEven', 0)); - _this.setAlign(GetValue$1u(config, 'align', 0)); - _this.setJustifyPercentage(GetValue$1u(config, 'justifyPercentage', 0.25)); - _this.setRTL(GetValue$1u(config, 'rtl', false)); + _this.setOrientation(GetValue$1s(config, 'orientation', 0)); + _this.setItemSpacing(GetValue$1s(config, 'space.item', 0)); + _this.setLineSpacing(GetValue$1s(config, 'space.line', 0)); + _this.setIntentLeft(GetValue$1s(config, 'space.indentLeftOdd', 0), GetValue$1s(config, 'space.indentLeftEven', 0)); + _this.setIntentTop(GetValue$1s(config, 'space.indentTopOdd', 0), GetValue$1s(config, 'space.indentTopEven', 0)); + _this.setAlign(GetValue$1s(config, 'align', 0)); + _this.setJustifyPercentage(GetValue$1s(config, 'justifyPercentage', 0.25)); + _this.setRTL(GetValue$1s(config, 'rtl', false)); _this.addChildrenMap('items', _this.sizerChildren); return _this; } @@ -42337,7 +42337,7 @@ return maskGameObject; }; - var GetValue$1t = Phaser.Utils.Objects.GetValue; + var GetValue$1r = Phaser.Utils.Objects.GetValue; var Label = /*#__PURE__*/function (_LabelBase) { _inherits(Label, _LabelBase); var _super = _createSuper(Label); @@ -42349,14 +42349,14 @@ _this.type = 'rexLabel'; // Add elements - var background = GetValue$1t(config, 'background', undefined); - var icon = GetValue$1t(config, 'icon', undefined); - var iconMask = GetValue$1t(config, 'iconMask', undefined); - var text = GetValue$1t(config, 'text', undefined); - var action = GetValue$1t(config, 'action', undefined); - var actionMask = GetValue$1t(config, 'actionMask', undefined); + var background = GetValue$1r(config, 'background', undefined); + var icon = GetValue$1r(config, 'icon', undefined); + var iconMask = GetValue$1r(config, 'iconMask', undefined); + var text = GetValue$1r(config, 'text', undefined); + var action = GetValue$1r(config, 'action', undefined); + var actionMask = GetValue$1r(config, 'actionMask', undefined); // Align - var align = GetValue$1t(config, 'align', undefined); // undefined/left/top: no space + var align = GetValue$1r(config, 'align', undefined); // undefined/left/top: no space if (background) { _this.addBackground(background); @@ -42371,23 +42371,23 @@ if (_this.orientation === 0) { if (text || action) { padding = { - right: GetValue$1t(config, 'space.icon', 0), - top: GetValue$1t(config, 'space.iconTop', 0), - bottom: GetValue$1t(config, 'space.iconBottom', 0), - left: GetValue$1t(config, 'space.iconLeft', 0) + right: GetValue$1r(config, 'space.icon', 0), + top: GetValue$1r(config, 'space.iconTop', 0), + bottom: GetValue$1r(config, 'space.iconBottom', 0), + left: GetValue$1r(config, 'space.iconLeft', 0) }; } } else { if (text || action) { padding = { - bottom: GetValue$1t(config, 'space.icon', 0), - left: GetValue$1t(config, 'space.iconLeft', 0), - right: GetValue$1t(config, 'space.iconRight', 0), - top: GetValue$1t(config, 'space.iconTop', 0) + bottom: GetValue$1r(config, 'space.icon', 0), + left: GetValue$1r(config, 'space.iconLeft', 0), + right: GetValue$1r(config, 'space.iconRight', 0), + top: GetValue$1r(config, 'space.iconTop', 0) }; } } - var fitRatio = GetValue$1t(config, 'squareFitIcon', false) ? 1 : 0; + var fitRatio = GetValue$1r(config, 'squareFitIcon', false) ? 1 : 0; _this.add(icon, { proportion: 0, padding: padding, @@ -42398,14 +42398,14 @@ } if (!fitRatio) { - var iconSize = GetValue$1t(config, 'iconSize', undefined); - _this.setIconSize(GetValue$1t(config, 'iconWidth', iconSize), GetValue$1t(config, 'iconHeight', iconSize)); + var iconSize = GetValue$1r(config, 'iconSize', undefined); + _this.setIconSize(GetValue$1r(config, 'iconWidth', iconSize), GetValue$1r(config, 'iconHeight', iconSize)); } } if (text) { - var textSpace = GetValue$1t(config, 'space.text', 0); - var expandTextWidth = GetValue$1t(config, 'expandTextWidth', false); - var expandTextHeight = GetValue$1t(config, 'expandTextHeight', false); + var textSpace = GetValue$1r(config, 'space.text', 0); + var expandTextWidth = GetValue$1r(config, 'expandTextWidth', false); + var expandTextHeight = GetValue$1r(config, 'expandTextHeight', false); var proportion, padding, expand; if (_this.orientation === 0) { proportion = expandTextWidth ? 1 : 0; @@ -42434,18 +42434,18 @@ var padding; if (_this.orientation === 0) { padding = { - top: GetValue$1t(config, 'space.actionTop', 0), - bottom: GetValue$1t(config, 'space.actionBottom', 0), - right: GetValue$1t(config, 'space.actionRight', 0) + top: GetValue$1r(config, 'space.actionTop', 0), + bottom: GetValue$1r(config, 'space.actionBottom', 0), + right: GetValue$1r(config, 'space.actionRight', 0) }; } else { padding = { - left: GetValue$1t(config, 'space.actionLeft', 0), - right: GetValue$1t(config, 'space.actionRight', 0), - bottom: GetValue$1t(config, 'space.actionBottom', 0) + left: GetValue$1r(config, 'space.actionLeft', 0), + right: GetValue$1r(config, 'space.actionRight', 0), + bottom: GetValue$1r(config, 'space.actionBottom', 0) }; } - var fitRatio = GetValue$1t(config, 'squareFitAction', false) ? 1 : 0; + var fitRatio = GetValue$1r(config, 'squareFitAction', false) ? 1 : 0; _this.add(action, { proportion: 0, padding: padding, @@ -42456,8 +42456,8 @@ } if (!fitRatio) { - var actionSize = GetValue$1t(config, 'actionSize'); - _this.setActionSize(GetValue$1t(config, 'actionWidth', actionSize), GetValue$1t(config, 'actionHeight', actionSize)); + var actionSize = GetValue$1r(config, 'actionSize'); + _this.setActionSize(GetValue$1r(config, 'actionWidth', actionSize), GetValue$1r(config, 'actionHeight', actionSize)); } } @@ -42516,12 +42516,12 @@ return gameObject; }; - var GetValue$1s = Phaser.Utils.Objects.GetValue; + var GetValue$1q = Phaser.Utils.Objects.GetValue; var PhaserBitmapText = Phaser.GameObjects.BitmapText; var CreateText = function CreateText(scene, config) { - var type = GetValue$1s(config, '$type'); + var type = GetValue$1q(config, '$type'); if (type === undefined) { - if (!!GetValue$1s(config, 'key')) { + if (!!GetValue$1q(config, 'key')) { type = 'bitmaptext'; } } @@ -42529,13 +42529,13 @@ switch (type) { case 'bitmaptext': case 'bitmap': - var key = GetValue$1s(config, 'key'); - var size = GetValue$1s(config, 'size'); + var key = GetValue$1q(config, 'key'); + var size = GetValue$1q(config, 'size'); if (size === undefined) { - size = GetValue$1s(config, 'fontSize'); + size = GetValue$1q(config, 'fontSize'); } gameObject = new PhaserBitmapText(scene, 0, 0, key, '', size); - var color = GetValue$1s(config, 'color'); + var color = GetValue$1q(config, 'color'); if (color !== undefined) { gameObject.setTint(color); } @@ -42626,20 +42626,20 @@ return gameObject; }; - var GetValue$1r = Phaser.Utils.Objects.GetValue; + var GetValue$1p = Phaser.Utils.Objects.GetValue; var BuildLabelConfig = function BuildLabelConfig(scene, config, creators) { config = config ? DeepClone(config) : {}; - var createBackground = GetValue$1r(creators, 'background', CreateBackground$2); - var createText = GetValue$1r(creators, 'text', CreateText); - var createIcon = GetValue$1r(creators, 'icon', CreateImage); - var createAction = GetValue$1r(creators, 'action', CreateImage); + var createBackground = GetValue$1p(creators, 'background', CreateBackground$2); + var createText = GetValue$1p(creators, 'text', CreateText); + var createIcon = GetValue$1p(creators, 'icon', CreateImage); + var createAction = GetValue$1p(creators, 'action', CreateImage); if (createBackground) { config.background = createBackground(scene, config.background); } else { delete config.background; } if (createText) { - var wrapText = GetValue$1r(config, 'wrapText', false); + var wrapText = GetValue$1p(config, 'wrapText', false); if (wrapText) { if (wrapText === true) { wrapText = 'word'; @@ -42724,39 +42724,39 @@ */ - var GetValue$1q = Phaser.Utils.Objects.GetValue; + var GetValue$1o = Phaser.Utils.Objects.GetValue; var LayoutMode0$2 = function LayoutMode0(config) { var scene = this.scene; - var orientation = GetValue$1q(config, 'orientation', 0); + var orientation = GetValue$1o(config, 'orientation', 0); this.setOrientation(orientation); // Add elements - var icon = GetValue$1q(config, 'icon', undefined); - var iconMask = GetValue$1q(config, 'iconMask', undefined); - var innerBackground = GetValue$1q(config, 'innerBackground', undefined); - var title = GetValue$1q(config, 'title', undefined); - var separator = GetValue$1q(config, 'separator', undefined); - var text = GetValue$1q(config, 'text', undefined); - var action = GetValue$1q(config, 'action', undefined); - var actionMask = GetValue$1q(config, 'actionMask', undefined); + var icon = GetValue$1o(config, 'icon', undefined); + var iconMask = GetValue$1o(config, 'iconMask', undefined); + var innerBackground = GetValue$1o(config, 'innerBackground', undefined); + var title = GetValue$1o(config, 'title', undefined); + var separator = GetValue$1o(config, 'separator', undefined); + var text = GetValue$1o(config, 'text', undefined); + var action = GetValue$1o(config, 'action', undefined); + var actionMask = GetValue$1o(config, 'actionMask', undefined); if (icon) { var padding; if (this.orientation === 0) { padding = { - right: GetValue$1q(config, 'space.icon', 0), - top: GetValue$1q(config, 'space.iconTop', 0), - bottom: GetValue$1q(config, 'space.iconBottom', 0), - left: GetValue$1q(config, 'space.iconLeft', 0) + right: GetValue$1o(config, 'space.icon', 0), + top: GetValue$1o(config, 'space.iconTop', 0), + bottom: GetValue$1o(config, 'space.iconBottom', 0), + left: GetValue$1o(config, 'space.iconLeft', 0) }; } else { padding = { - bottom: GetValue$1q(config, 'space.icon', 0), - left: GetValue$1q(config, 'space.iconLeft', 0), - right: GetValue$1q(config, 'space.iconRight', 0), - top: GetValue$1q(config, 'space.iconTop', 0) + bottom: GetValue$1o(config, 'space.icon', 0), + left: GetValue$1o(config, 'space.iconLeft', 0), + right: GetValue$1o(config, 'space.iconRight', 0), + top: GetValue$1o(config, 'space.iconTop', 0) }; } - var fitRatio = GetValue$1q(config, 'squareFitIcon', false) ? 1 : 0; + var fitRatio = GetValue$1o(config, 'squareFitIcon', false) ? 1 : 0; this.add(icon, { proportion: 0, padding: padding, @@ -42767,8 +42767,8 @@ } if (!fitRatio) { - var iconSize = GetValue$1q(config, 'iconSize', undefined); - this.setIconSize(GetValue$1q(config, 'iconWidth', iconSize), GetValue$1q(config, 'iconHeight', iconSize)); + var iconSize = GetValue$1o(config, 'iconSize', undefined); + this.setIconSize(GetValue$1o(config, 'iconWidth', iconSize), GetValue$1o(config, 'iconHeight', iconSize)); } } @@ -42779,13 +42779,13 @@ if (innerBackground) { innerSizer.addBackground(innerBackground); } - var separatorSpace = GetValue$1q(config, 'space.separator', 0); + var separatorSpace = GetValue$1o(config, 'space.separator', 0); if (title) { - var align = GetValue$1q(config, 'align.title', 'left'); + var align = GetValue$1o(config, 'align.title', 'left'); var padding = { bottom: !separator && text ? separatorSpace : 0, - left: GetValue$1q(config, 'space.titleLeft', 0), - right: GetValue$1q(config, 'space.titleRight', 0) + left: GetValue$1o(config, 'space.titleLeft', 0), + right: GetValue$1o(config, 'space.titleRight', 0) }; innerSizer.add(title, { proportion: 0, @@ -42797,8 +42797,8 @@ var padding = { top: title ? separatorSpace : 0, bottom: text ? separatorSpace : 0, - left: GetValue$1q(config, 'space.separatorLeft', 0), - right: GetValue$1q(config, 'space.separatorRight', 0) + left: GetValue$1o(config, 'space.separatorLeft', 0), + right: GetValue$1o(config, 'space.separatorRight', 0) }; innerSizer.add(separator, { expand: true, @@ -42806,10 +42806,10 @@ }); } if (text) { - var align = GetValue$1q(config, 'align.text', 'left'); + var align = GetValue$1o(config, 'align.text', 'left'); var padding = { - left: GetValue$1q(config, 'space.textLeft', 0), - right: GetValue$1q(config, 'space.textRight', 0) + left: GetValue$1o(config, 'space.textLeft', 0), + right: GetValue$1o(config, 'space.textRight', 0) }; innerSizer.add(text, { proportion: 0, @@ -42820,7 +42820,7 @@ var padding = undefined; if (action) { padding = { - right: GetValue$1q(config, 'space.text', 0) + right: GetValue$1o(config, 'space.text', 0) }; } this.add(innerSizer, { @@ -42833,18 +42833,18 @@ var padding; if (this.orientation === 0) { padding = { - top: GetValue$1q(config, 'space.actionTop', 0), - bottom: GetValue$1q(config, 'space.actionBottom', 0), - right: GetValue$1q(config, 'space.actionRight', 0) + top: GetValue$1o(config, 'space.actionTop', 0), + bottom: GetValue$1o(config, 'space.actionBottom', 0), + right: GetValue$1o(config, 'space.actionRight', 0) }; } else { padding = { - left: GetValue$1q(config, 'space.actionLeft', 0), - right: GetValue$1q(config, 'space.actionRight', 0), - bottom: GetValue$1q(config, 'space.actionBottom', 0) + left: GetValue$1o(config, 'space.actionLeft', 0), + right: GetValue$1o(config, 'space.actionRight', 0), + bottom: GetValue$1o(config, 'space.actionBottom', 0) }; } - var fitRatio = GetValue$1q(config, 'squareFitAction', false) ? 1 : 0; + var fitRatio = GetValue$1o(config, 'squareFitAction', false) ? 1 : 0; this.add(action, { proportion: 0, padding: padding, @@ -42855,8 +42855,8 @@ } if (!fitRatio) { - var actionSize = GetValue$1q(config, 'actionSize'); - this.setActionSize(GetValue$1q(config, 'actionWidth', actionSize), GetValue$1q(config, 'actionHeight', actionSize)); + var actionSize = GetValue$1o(config, 'actionSize'); + this.setActionSize(GetValue$1o(config, 'actionWidth', actionSize), GetValue$1o(config, 'actionHeight', actionSize)); } } this.addChildrenMap('icon', icon); @@ -42879,27 +42879,27 @@ */ - var GetValue$1p = Phaser.Utils.Objects.GetValue; + var GetValue$1n = Phaser.Utils.Objects.GetValue; var LayoutMode1$1 = function LayoutMode1(config) { this.setOrientation(1); this.setRTL(false); var scene = this.scene; // Add elements - var title = GetValue$1p(config, 'title', undefined); - var separator = GetValue$1p(config, 'separator', undefined); - var innerBackground = GetValue$1p(config, 'innerBackground', undefined); - var icon = GetValue$1p(config, 'icon', undefined); - var iconMask = GetValue$1p(config, 'iconMask', undefined); - var text = GetValue$1p(config, 'text', undefined); - var action = GetValue$1p(config, 'action', undefined); - var actionMask = GetValue$1p(config, 'actionMask', undefined); + var title = GetValue$1n(config, 'title', undefined); + var separator = GetValue$1n(config, 'separator', undefined); + var innerBackground = GetValue$1n(config, 'innerBackground', undefined); + var icon = GetValue$1n(config, 'icon', undefined); + var iconMask = GetValue$1n(config, 'iconMask', undefined); + var text = GetValue$1n(config, 'text', undefined); + var action = GetValue$1n(config, 'action', undefined); + var actionMask = GetValue$1n(config, 'actionMask', undefined); if (title) { - var align = GetValue$1p(config, 'align.title', 'left'); + var align = GetValue$1n(config, 'align.title', 'left'); var padding = { - bottom: GetValue$1p(config, 'space.title', 0), - left: GetValue$1p(config, 'space.titleLeft', 0), - right: GetValue$1p(config, 'space.titleRight', 0) + bottom: GetValue$1n(config, 'space.title', 0), + left: GetValue$1n(config, 'space.titleLeft', 0), + right: GetValue$1n(config, 'space.titleRight', 0) }; this.add(title, { proportion: 0, @@ -42908,12 +42908,12 @@ }); } if (separator) { - var separatorSpace = GetValue$1p(config, 'space.separator', 0); + var separatorSpace = GetValue$1n(config, 'space.separator', 0); var padding = { top: title ? separatorSpace : 0, bottom: text ? separatorSpace : 0, - left: GetValue$1p(config, 'space.separatorLeft', 0), - right: GetValue$1p(config, 'space.separatorRight', 0) + left: GetValue$1n(config, 'space.separatorLeft', 0), + right: GetValue$1n(config, 'space.separatorRight', 0) }; this.add(separator, { proportion: 0, @@ -42921,15 +42921,15 @@ padding: padding }); } - var orientation = GetValue$1p(config, 'orientation', 0); + var orientation = GetValue$1n(config, 'orientation', 0); var innerSizer = new Sizer(scene, { orientation: orientation, - rtl: GetValue$1p(config, 'rtl', false), + rtl: GetValue$1n(config, 'rtl', false), space: { - left: GetValue$1p(config, 'space.innerLeft', 0), - right: GetValue$1p(config, 'space.innerRight', 0), - top: GetValue$1p(config, 'space.innerTop', 0), - bottom: GetValue$1p(config, 'space.innerBottom', 0) + left: GetValue$1n(config, 'space.innerLeft', 0), + right: GetValue$1n(config, 'space.innerRight', 0), + top: GetValue$1n(config, 'space.innerTop', 0), + bottom: GetValue$1n(config, 'space.innerBottom', 0) } }); if (innerBackground) { @@ -42943,20 +42943,20 @@ var padding = undefined; if (innerSizer.orientation === 0) { padding = { - right: GetValue$1p(config, 'space.icon', 0), - top: GetValue$1p(config, 'space.iconTop', 0), - bottom: GetValue$1p(config, 'space.iconBottom', 0), - left: GetValue$1p(config, 'space.iconLeft', 0) + right: GetValue$1n(config, 'space.icon', 0), + top: GetValue$1n(config, 'space.iconTop', 0), + bottom: GetValue$1n(config, 'space.iconBottom', 0), + left: GetValue$1n(config, 'space.iconLeft', 0) }; } else { padding = { - bottom: GetValue$1p(config, 'space.icon', 0), - left: GetValue$1p(config, 'space.iconLeft', 0), - right: GetValue$1p(config, 'space.iconRight', 0), - top: GetValue$1p(config, 'space.iconTop', 0) + bottom: GetValue$1n(config, 'space.icon', 0), + left: GetValue$1n(config, 'space.iconLeft', 0), + right: GetValue$1n(config, 'space.iconRight', 0), + top: GetValue$1n(config, 'space.iconTop', 0) }; } - var fitRatio = GetValue$1p(config, 'squareFitIcon', false) ? 1 : 0; + var fitRatio = GetValue$1n(config, 'squareFitIcon', false) ? 1 : 0; innerSizer.add(icon, { proportion: 0, padding: padding, @@ -42967,15 +42967,15 @@ } if (!fitRatio) { - var iconSize = GetValue$1p(config, 'iconSize', undefined); - this.setIconSize(GetValue$1p(config, 'iconWidth', iconSize), GetValue$1p(config, 'iconHeight', iconSize)); + var iconSize = GetValue$1n(config, 'iconSize', undefined); + this.setIconSize(GetValue$1n(config, 'iconWidth', iconSize), GetValue$1n(config, 'iconHeight', iconSize)); } } if (text) { - var align = GetValue$1p(config, 'align.text', 'left'); - var textSpace = GetValue$1p(config, 'space.text', 0); - var expandTextWidth = GetValue$1p(config, 'expandTextWidth', false); - var expandTextHeight = GetValue$1p(config, 'expandTextHeight', false); + var align = GetValue$1n(config, 'align.text', 'left'); + var textSpace = GetValue$1n(config, 'space.text', 0); + var expandTextWidth = GetValue$1n(config, 'expandTextWidth', false); + var expandTextHeight = GetValue$1n(config, 'expandTextHeight', false); var proportion, padding, expand; if (innerSizer.orientation === 0) { proportion = expandTextWidth ? 1 : 0; @@ -43005,18 +43005,18 @@ var padding; if (innerSizer.orientation === 0) { padding = { - top: GetValue$1p(config, 'space.actionTop', 0), - bottom: GetValue$1p(config, 'space.actionBottom', 0), - right: GetValue$1p(config, 'space.actionRight', 0) + top: GetValue$1n(config, 'space.actionTop', 0), + bottom: GetValue$1n(config, 'space.actionBottom', 0), + right: GetValue$1n(config, 'space.actionRight', 0) }; } else { padding = { - left: GetValue$1p(config, 'space.actionLeft', 0), - right: GetValue$1p(config, 'space.actionRight', 0), - bottom: GetValue$1p(config, 'space.actionBottom', 0) + left: GetValue$1n(config, 'space.actionLeft', 0), + right: GetValue$1n(config, 'space.actionRight', 0), + bottom: GetValue$1n(config, 'space.actionBottom', 0) }; } - var fitRatio = GetValue$1p(config, 'squareFitAction', false) ? 1 : 0; + var fitRatio = GetValue$1n(config, 'squareFitAction', false) ? 1 : 0; innerSizer.add(action, { proportion: 0, padding: padding, @@ -43027,8 +43027,8 @@ } if (!fitRatio) { - var actionSize = GetValue$1p(config, 'actionSize'); - this.setActionSize(GetValue$1p(config, 'actionWidth', actionSize), GetValue$1p(config, 'actionHeight', actionSize)); + var actionSize = GetValue$1n(config, 'actionSize'); + this.setActionSize(GetValue$1n(config, 'actionWidth', actionSize), GetValue$1n(config, 'actionHeight', actionSize)); } } this.addChildrenMap('title', title); @@ -43042,7 +43042,7 @@ this.addChildrenMap('actionMask', actionMask); }; - var GetValue$1o = Phaser.Utils.Objects.GetValue; + var GetValue$1m = Phaser.Utils.Objects.GetValue; var LayoutCallbacks$1 = [LayoutMode0$2, LayoutMode1$1]; var TitleLabel = /*#__PURE__*/function (_LabelBase) { _inherits(TitleLabel, _LabelBase); @@ -43055,11 +43055,11 @@ _this.type = 'rexTitleLabel'; // Add Background - var background = GetValue$1o(config, 'background', undefined); + var background = GetValue$1m(config, 'background', undefined); if (background) { _this.addBackground(background); } - var layoutMode = GetValue$1o(config, 'layoutMode', 0); + var layoutMode = GetValue$1m(config, 'layoutMode', 0); var layoutCallback = LayoutCallbacks$1[layoutMode] || LayoutCallbacks$1[0]; layoutCallback.call(_assertThisInitialized(_this), config); _this.addChildrenMap('background', config.background); @@ -43123,18 +43123,18 @@ }); SetValue(window, 'RexPlugins.UI.TitleLabel', TitleLabel); - var GetValue$1n = Phaser.Utils.Objects.GetValue; + var GetValue$1l = Phaser.Utils.Objects.GetValue; var IsPlainObject$d = Phaser.Utils.Objects.IsPlainObject; var Build$1 = function Build(scene, config) { // Add elements - var background = GetValue$1n(config, 'background', undefined); - var icon = GetValue$1n(config, 'icon', undefined); - var iconMask = GetValue$1n(config, 'iconMask', undefined); - var nameText = GetValue$1n(config, 'nameText', undefined); - var valueText = GetValue$1n(config, 'valueText', undefined); - var bar = GetValue$1n(config, 'bar', undefined); - var action = GetValue$1n(config, 'action', undefined); - var actionMask = GetValue$1n(config, 'actionMask', undefined); + var background = GetValue$1l(config, 'background', undefined); + var icon = GetValue$1l(config, 'icon', undefined); + var iconMask = GetValue$1l(config, 'iconMask', undefined); + var nameText = GetValue$1l(config, 'nameText', undefined); + var valueText = GetValue$1l(config, 'valueText', undefined); + var bar = GetValue$1l(config, 'bar', undefined); + var action = GetValue$1l(config, 'action', undefined); + var actionMask = GetValue$1l(config, 'actionMask', undefined); if (IsPlainObject$d(bar)) { bar = new LineProgress(scene, bar); scene.add.existing(bar); @@ -43155,17 +43155,17 @@ if (this.orientation === 0) { if (hasTextSizer || action) { padding = { - right: GetValue$1n(config, 'space.icon', 0), - top: GetValue$1n(config, 'space.iconTop', 0), - bottom: GetValue$1n(config, 'space.iconBottom', 0) + right: GetValue$1l(config, 'space.icon', 0), + top: GetValue$1l(config, 'space.iconTop', 0), + bottom: GetValue$1l(config, 'space.iconBottom', 0) }; } } else { if (hasTextSizer || action) { padding = { - bottom: GetValue$1n(config, 'space.icon', 0), - left: GetValue$1n(config, 'space.iconLeft', 0), - right: GetValue$1n(config, 'space.iconRight', 0) + bottom: GetValue$1l(config, 'space.icon', 0), + left: GetValue$1l(config, 'space.iconLeft', 0), + right: GetValue$1l(config, 'space.iconRight', 0) }; } } @@ -43194,7 +43194,7 @@ } nameText.setOrigin(0, nameText.originY); var padding = { - left: GetValue$1n(config, 'space.name', 0) + left: GetValue$1l(config, 'space.name', 0) }; nameValueSizer.add(nameText, { padding: padding @@ -43208,12 +43208,12 @@ valueText.setOrigin(1, valueText.originY); nameValueSizer.addSpace(); var padding = { - right: GetValue$1n(config, 'space.value', 0) + right: GetValue$1l(config, 'space.value', 0) }; nameValueSizer.add(valueText, { padding: padding }); - this.setValueTextFormatCallback(GetValue$1n(config, 'valueTextFormatCallback', DefaultValueTextFormatCallback), GetValue$1n(config, 'valueTextFormatCallbackScope', undefined)); + this.setValueTextFormatCallback(GetValue$1l(config, 'valueTextFormatCallback', DefaultValueTextFormatCallback), GetValue$1l(config, 'valueTextFormatCallbackScope', undefined)); } textSizer.add(nameValueSizer, { expand: true @@ -43221,10 +43221,10 @@ } if (bar) { var padding = { - top: nameValueSizer ? GetValue$1n(config, 'space.bar', 0) : 0, - bottom: GetValue$1n(config, 'space.barBottom', 0), - left: GetValue$1n(config, 'space.barLeft', 0), - right: GetValue$1n(config, 'space.barRight', 0) + top: nameValueSizer ? GetValue$1l(config, 'space.bar', 0) : 0, + bottom: GetValue$1l(config, 'space.barBottom', 0), + left: GetValue$1l(config, 'space.barLeft', 0), + right: GetValue$1l(config, 'space.barRight', 0) }; textSizer.add(bar, { expand: true, @@ -43234,10 +43234,10 @@ var padding = undefined; if (action) { padding = { - right: GetValue$1n(config, 'space.text', 0) + right: GetValue$1l(config, 'space.text', 0) }; } - var textAlign = GetValue$1n(config, 'align.text', 'bottom'); + var textAlign = GetValue$1l(config, 'align.text', 'bottom'); this.add(textSizer, { proportion: 1, align: textAlign, @@ -43248,13 +43248,13 @@ var padding; if (this.orientation === 0) { padding = { - top: GetValue$1n(config, 'space.actionTop', 0), - bottom: GetValue$1n(config, 'space.actionBottom', 0) + top: GetValue$1l(config, 'space.actionTop', 0), + bottom: GetValue$1l(config, 'space.actionBottom', 0) }; } else { padding = { - left: GetValue$1n(config, 'space.actionLeft', 0), - right: GetValue$1n(config, 'space.actionRight', 0) + left: GetValue$1l(config, 'space.actionLeft', 0), + right: GetValue$1l(config, 'space.actionRight', 0) }; } this.add(action, { @@ -43579,7 +43579,7 @@ var SizerRmove$2 = Sizer.prototype.remove; var SizerClear$2 = Sizer.prototype.clear; - var Remove$2 = function Remove(gameObject, destroyChild) { + var Remove$3 = function Remove(gameObject, destroyChild) { if (this.getParentSizer(gameObject) !== this) { return this; } @@ -43593,10 +43593,10 @@ if (IsArray(gameObject)) { var gameObjects = gameObject; for (var i = 0, cnt = gameObjects.length; i < cnt; i++) { - Remove$2.call(this, gameObjects[i], destroyChild); + Remove$3.call(this, gameObjects[i], destroyChild); } } else { - Remove$2.call(this, gameObject, destroyChild); + Remove$3.call(this, gameObject, destroyChild); } return this; }, @@ -43618,7 +43618,7 @@ clearButtons: function clearButtons(destroyChild) { var buttons = this.buttonGroup.buttons; for (var i = buttons.length - 1; i >= 0; i--) { - Remove$2.call(this, buttons[i], destroyChild); + Remove$3.call(this, buttons[i], destroyChild); } return this; } @@ -43758,13 +43758,13 @@ } }; - var GetValue$1m = Phaser.Utils.Objects.GetValue; + var GetValue$1k = Phaser.Utils.Objects.GetValue; var ButtonsTypeMethods = { setButtonsType: function setButtonsType(config) { if (config === undefined) { config = {}; } - var buttonsType = GetValue$1m(config, 'buttonsType', config.type); + var buttonsType = GetValue$1k(config, 'buttonsType', config.type); this.buttonsType = buttonsType; if (!this.buttonsType) { return this; @@ -43772,11 +43772,11 @@ // Assign this.setValueCallback, this.setValueCallbackScope var setValueCallback, setValueCallbackScope; - setValueCallback = GetValue$1m(config, 'setValueCallback', undefined); - setValueCallbackScope = GetValue$1m(config, 'setValueCallbackScope', undefined); + setValueCallback = GetValue$1k(config, 'setValueCallback', undefined); + setValueCallbackScope = GetValue$1k(config, 'setValueCallbackScope', undefined); if (setValueCallback === undefined) { - setValueCallback = GetValue$1m(config, 'setButtonStateCallback', undefined); - setValueCallbackScope = GetValue$1m(config, 'setButtonStateCallbackScope', undefined); + setValueCallback = GetValue$1k(config, 'setButtonStateCallback', undefined); + setValueCallbackScope = GetValue$1k(config, 'setButtonStateCallbackScope', undefined); } this.setValueCallback = setValueCallback; this.setValueCallbackScope = setValueCallbackScope; @@ -44077,7 +44077,7 @@ } }; - var GetValue$1l = Phaser.Utils.Objects.GetValue; + var GetValue$1j = Phaser.Utils.Objects.GetValue; var Buttons$1 = /*#__PURE__*/function (_Sizer) { _inherits(Buttons, _Sizer); var _super = _createSuper(Buttons); @@ -44099,18 +44099,18 @@ _this.type = 'rexButtons'; _this.buttonGroup = new ButtonGroup({ parent: _assertThisInitialized(_this), - eventEmitter: GetValue$1l(config, 'eventEmitter', _assertThisInitialized(_this)), - groupName: GetValue$1l(config, 'groupName', undefined), - clickConfig: GetValue$1l(config, 'click', undefined) + eventEmitter: GetValue$1j(config, 'eventEmitter', _assertThisInitialized(_this)), + groupName: GetValue$1j(config, 'groupName', undefined), + clickConfig: GetValue$1j(config, 'click', undefined) }).setButtonsType(config); // Add elements - var background = GetValue$1l(config, 'background', undefined); - var buttons = GetValue$1l(config, 'buttons', undefined); + var background = GetValue$1j(config, 'background', undefined); + var buttons = GetValue$1j(config, 'buttons', undefined); // Buttons properties - _this.buttonsExpand = GetValue$1l(config, 'expand', false); - _this.buttonsAlign = GetValue$1l(config, 'align', undefined); // undefined/left/top: no space + _this.buttonsExpand = GetValue$1j(config, 'expand', false); + _this.buttonsAlign = GetValue$1j(config, 'align', undefined); // undefined/left/top: no space if (background) { _this.addBackground(background); @@ -44180,7 +44180,7 @@ var SizerRmove$1 = GridSizer.prototype.remove; var SizerClear$1 = GridSizer.prototype.clear; - var Remove$1 = function Remove(gameObject, destroyChild) { + var Remove$2 = function Remove(gameObject, destroyChild) { var gameObject = this.getButton(gameObject); if (!gameObject) { return this; @@ -44194,10 +44194,10 @@ if (IsArray(gameObject)) { var gameObjects = gameObject; for (var i = 0, cnt = gameObjects.length; i < cnt; i++) { - Remove$1.call(this, gameObjects[i], destroyChild); + Remove$2.call(this, gameObjects[i], destroyChild); } } else { - Remove$1.call(this, gameObject, destroyChild); + Remove$2.call(this, gameObject, destroyChild); } return this; }, @@ -44214,13 +44214,13 @@ clearButtons: function clearButtons(destroyChild) { var buttons = this.buttonGroup.buttons; for (var i = buttons.length - 1; i >= 0; i--) { - Remove$1.call(this, buttons[i], destroyChild); + Remove$2.call(this, buttons[i], destroyChild); } return this; } }; - var GetValue$1k = Phaser.Utils.Objects.GetValue; + var GetValue$1i = Phaser.Utils.Objects.GetValue; var GridButtons = /*#__PURE__*/function (_GridSizer) { _inherits(GridButtons, _GridSizer); var _super = _createSuper(GridButtons); @@ -44230,11 +44230,11 @@ if (config === undefined) { config = {}; } - var rowCount = GetValue$1k(config, 'row', 0); - var columnCount = GetValue$1k(config, 'column', config.col || 0); - var createCellContainerCallback = GetValue$1k(config, 'createCellContainerCallback'); - var buttons = GetValue$1k(config, 'buttons', undefined); - var buttonsExpand = GetValue$1k(config, 'expand', true); + var rowCount = GetValue$1i(config, 'row', 0); + var columnCount = GetValue$1i(config, 'column', config.col || 0); + var createCellContainerCallback = GetValue$1i(config, 'createCellContainerCallback'); + var buttons = GetValue$1i(config, 'buttons', undefined); + var buttonsExpand = GetValue$1i(config, 'expand', true); var buttonProportion = buttonsExpand ? 1 : 0; if (createCellContainerCallback) { config.createCellContainerCallback = undefined; @@ -44255,17 +44255,17 @@ _this.type = 'rexGridButtons'; _this.buttonGroup = new ButtonGroup({ parent: _assertThisInitialized(_this), - eventEmitter: GetValue$1k(config, 'eventEmitter', _assertThisInitialized(_this)), - groupName: GetValue$1k(config, 'groupName', undefined), - clickConfig: GetValue$1k(config, 'click', undefined) + eventEmitter: GetValue$1i(config, 'eventEmitter', _assertThisInitialized(_this)), + groupName: GetValue$1i(config, 'groupName', undefined), + clickConfig: GetValue$1i(config, 'click', undefined) }).setButtonsType(config); // Add elements - var background = GetValue$1k(config, 'background', undefined); + var background = GetValue$1i(config, 'background', undefined); // Buttons properties _this.buttonsExpand = buttonsExpand; - GetValue$1k(config, 'space', undefined); + GetValue$1i(config, 'space', undefined); if (background) { _this.addBackground(background); } @@ -44381,7 +44381,7 @@ var SizerRmove = FixWidthSizer.prototype.remove; var SizerClear = FixWidthSizer.prototype.clear; - var Remove = function Remove(gameObject, destroyChild) { + var Remove$1 = function Remove(gameObject, destroyChild) { var gameObject = this.getButton(gameObject); if (!gameObject) { return this; @@ -44395,10 +44395,10 @@ if (IsArray(gameObject)) { var gameObjects = gameObject; for (var i = 0, cnt = gameObjects.length; i < cnt; i++) { - Remove.call(this, gameObjects[i], destroyChild); + Remove$1.call(this, gameObjects[i], destroyChild); } } else { - Remove.call(this, gameObject, destroyChild); + Remove$1.call(this, gameObject, destroyChild); } return this; }, @@ -44415,13 +44415,13 @@ clearButtons: function clearButtons(destroyChild) { var buttons = this.buttonGroup.buttons; for (var i = buttons.length - 1; i >= 0; i--) { - Remove.call(this, buttons[i], destroyChild); + Remove$1.call(this, buttons[i], destroyChild); } return this; } }; - var GetValue$1j = Phaser.Utils.Objects.GetValue; + var GetValue$1h = Phaser.Utils.Objects.GetValue; var Buttons = /*#__PURE__*/function (_FixWidthSizer) { _inherits(Buttons, _FixWidthSizer); var _super = _createSuper(Buttons); @@ -44444,17 +44444,17 @@ _this.type = 'rexFixWidthButtons'; _this.buttonGroup = new ButtonGroup({ parent: _assertThisInitialized(_this), - eventEmitter: GetValue$1j(config, 'eventEmitter', _assertThisInitialized(_this)), - groupName: GetValue$1j(config, 'groupName', undefined), - clickConfig: GetValue$1j(config, 'click', undefined) + eventEmitter: GetValue$1h(config, 'eventEmitter', _assertThisInitialized(_this)), + groupName: GetValue$1h(config, 'groupName', undefined), + clickConfig: GetValue$1h(config, 'click', undefined) }).setButtonsType(config); // Add elements - var background = GetValue$1j(config, 'background', undefined); - var buttons = GetValue$1j(config, 'buttons', undefined); + var background = GetValue$1h(config, 'background', undefined); + var buttons = GetValue$1h(config, 'buttons', undefined); // Buttons properties - _this.buttonsAlign = GetValue$1j(config, 'align', undefined); + _this.buttonsAlign = GetValue$1h(config, 'align', undefined); if (background) { _this.addBackground(background); } @@ -44524,7 +44524,7 @@ } }; - var GetValue$1i = Phaser.Utils.Objects.GetValue; + var GetValue$1g = Phaser.Utils.Objects.GetValue; var FileSelectorButton = /*#__PURE__*/function (_Label) { _inherits(FileSelectorButton, _Label); var _super = _createSuper(FileSelectorButton); @@ -44537,8 +44537,8 @@ scene.add.existing(fileChooser); _this.addBackground(fileChooser); _this.addChildrenMap('fileChooser', fileChooser); - _this.setAccept(GetValue$1i(config, 'accept', '')); - _this.setMultiple(GetValue$1i(config, 'multiple', false)); + _this.setAccept(GetValue$1g(config, 'accept', '')); + _this.setMultiple(GetValue$1g(config, 'multiple', false)); fileChooser.on('change', function (gameObject) { var files = gameObject.files; if (files.length === 0) { @@ -44886,7 +44886,7 @@ var Methods$7 = {}; Object.assign(Methods$7, ButtonMethods$1, ModalMethods); - var GetValue$1h = Phaser.Utils.Objects.GetValue; + var GetValue$1f = Phaser.Utils.Objects.GetValue; var Dialog = /*#__PURE__*/function (_Sizer) { _inherits(Dialog, _Sizer); var _super = _createSuper(Dialog); @@ -44900,24 +44900,24 @@ config.orientation = 1; // Top to bottom _this = _super.call(this, scene, config); _this.type = 'rexDialog'; - _this.eventEmitter = GetValue$1h(config, 'eventEmitter', _assertThisInitialized(_this)); + _this.eventEmitter = GetValue$1f(config, 'eventEmitter', _assertThisInitialized(_this)); // Add elements - var background = GetValue$1h(config, 'background', undefined); - var title = GetValue$1h(config, 'title', undefined); - var toolbar = GetValue$1h(config, 'toolbar', undefined); - var toolbarBackground = GetValue$1h(config, 'toolbarBackground', undefined); - var leftToolbar = GetValue$1h(config, 'leftToolbar', undefined); - var leftToolbarBackground = GetValue$1h(config, 'leftToolbarBackground', undefined); - var content = GetValue$1h(config, 'content', undefined); - var description = GetValue$1h(config, 'description', undefined); + var background = GetValue$1f(config, 'background', undefined); + var title = GetValue$1f(config, 'title', undefined); + var toolbar = GetValue$1f(config, 'toolbar', undefined); + var toolbarBackground = GetValue$1f(config, 'toolbarBackground', undefined); + var leftToolbar = GetValue$1f(config, 'leftToolbar', undefined); + var leftToolbarBackground = GetValue$1f(config, 'leftToolbarBackground', undefined); + var content = GetValue$1f(config, 'content', undefined); + var description = GetValue$1f(config, 'description', undefined); var choicesSizer; - var choices = GetValue$1h(config, 'choices', undefined); - var choicesBackground = GetValue$1h(config, 'choicesBackground', undefined); + var choices = GetValue$1f(config, 'choices', undefined); + var choicesBackground = GetValue$1f(config, 'choicesBackground', undefined); var actionsSizer; - var actions = GetValue$1h(config, 'actions', undefined); - var actionsBackground = GetValue$1h(config, 'actionsBackground', undefined); - var clickConfig = GetValue$1h(config, 'click', undefined); + var actions = GetValue$1f(config, 'actions', undefined); + var actionsBackground = GetValue$1f(config, 'actionsBackground', undefined); + var clickConfig = GetValue$1f(config, 'click', undefined); if (background) { _this.addBackground(background); } @@ -44930,7 +44930,7 @@ orientation: 0, // Left-right space: { - item: GetValue$1h(config, 'space.toolbarItem', 0) + item: GetValue$1f(config, 'space.toolbarItem', 0) }, click: clickConfig, eventEmitter: _this.eventEmitter @@ -44945,7 +44945,7 @@ orientation: 0, // Left-right space: { - item: GetValue$1h(config, 'space.leftToolbarItem', 0) + item: GetValue$1f(config, 'space.leftToolbarItem', 0) }, click: clickConfig, eventEmitter: _this.eventEmitter @@ -44954,8 +44954,8 @@ // title or toolbar or leftToolbar if (title || toolbar || leftToolbar) { - var titleExpandWidth = !!title && GetValue$1h(config, 'expand.title', true); - var titleAlign = GetValue$1h(config, 'align.title', 'center'); + var titleExpandWidth = !!title && GetValue$1f(config, 'expand.title', true); + var titleAlign = GetValue$1f(config, 'align.title', 'center'); var useOverlapSizer = // Has title, title is not exapnd-width, title align to center title && !titleExpandWidth && titleAlign === 'center' || @@ -44989,8 +44989,8 @@ titleSizer.addSpace(); } var padding = { - left: GetValue$1h(config, 'space.titleLeft', 0), - right: GetValue$1h(config, 'space.titleRight', 0) + left: GetValue$1f(config, 'space.titleLeft', 0), + right: GetValue$1f(config, 'space.titleRight', 0) }; var proportion = titleExpandWidth ? 1 : 0; titleSizer.add(title, { @@ -45022,11 +45022,11 @@ var padding; if (content || description || choices || actions) { padding = { - bottom: GetValue$1h(config, 'space.title', 0), - top: GetValue$1h(config, 'space.titleTop', 0) + bottom: GetValue$1f(config, 'space.title', 0), + top: GetValue$1f(config, 'space.titleTop', 0) }; } - var proportion = GetValue$1h(config, 'proportion.title', 0); + var proportion = GetValue$1f(config, 'proportion.title', 0); _this.add(titleSizer, { padding: padding, proportion: proportion, @@ -45034,15 +45034,15 @@ }); } if (content) { - var align = GetValue$1h(config, 'align.content', 'center'); - var contentSpace = GetValue$1h(config, 'space.content', 0); + var align = GetValue$1f(config, 'align.content', 'center'); + var contentSpace = GetValue$1f(config, 'space.content', 0); var padding = { - left: GetValue$1h(config, 'space.contentLeft', 0), - right: GetValue$1h(config, 'space.contentRight', 0), + left: GetValue$1f(config, 'space.contentLeft', 0), + right: GetValue$1f(config, 'space.contentRight', 0), bottom: description || choices || actions ? contentSpace : 0 }; - var proportion = GetValue$1h(config, 'proportion.content', 0); - var expand = GetValue$1h(config, 'expand.content', true); + var proportion = GetValue$1f(config, 'proportion.content', 0); + var expand = GetValue$1f(config, 'expand.content', true); _this.add(content, { align: align, padding: padding, @@ -45051,15 +45051,15 @@ }); } if (description) { - var align = GetValue$1h(config, 'align.description', 'center'); - var descriptionSpace = GetValue$1h(config, 'space.description', 0); + var align = GetValue$1f(config, 'align.description', 'center'); + var descriptionSpace = GetValue$1f(config, 'space.description', 0); var padding = { - left: GetValue$1h(config, 'space.descriptionLeft', 0), - right: GetValue$1h(config, 'space.descriptionRight', 0), + left: GetValue$1f(config, 'space.descriptionLeft', 0), + right: GetValue$1f(config, 'space.descriptionRight', 0), bottom: choices || actions ? descriptionSpace : 0 }; - var proportion = GetValue$1h(config, 'proportion.description', 0); - var expand = GetValue$1h(config, 'expand.description', true); + var proportion = GetValue$1f(config, 'proportion.description', 0); + var expand = GetValue$1f(config, 'expand.description', true); _this.add(description, { align: align, padding: padding, @@ -45068,29 +45068,29 @@ }); } if (choices) { - var choicesType = GetValue$1h(config, 'choicesType', '').split('-'); + var choicesType = GetValue$1f(config, 'choicesType', '').split('-'); var ButtonsClass = Contains(choicesType, 'wrap') ? Buttons : Contains(choicesType, 'grid') ? GridButtons : Buttons$1; var buttonsType = Contains(choicesType, 'radio') ? 'radio' : Contains(choicesType, 'checkboxes') ? 'checkboxes' : undefined; var space = { - left: GetValue$1h(config, 'space.choicesBackgroundLeft', 0), - right: GetValue$1h(config, 'space.choicesBackgroundRight', 0), - top: GetValue$1h(config, 'space.choicesBackgroundTop', 0), - bottom: GetValue$1h(config, 'space.choicesBackgroundBottom', 0) + left: GetValue$1f(config, 'space.choicesBackgroundLeft', 0), + right: GetValue$1f(config, 'space.choicesBackgroundRight', 0), + top: GetValue$1f(config, 'space.choicesBackgroundTop', 0), + bottom: GetValue$1f(config, 'space.choicesBackgroundBottom', 0) }; - var itemSpace = GetValue$1h(config, 'space.choice', 0); + var itemSpace = GetValue$1f(config, 'space.choice', 0); if (ButtonsClass === Buttons$1) { space.item = itemSpace; } else if (ButtonsClass === Buttons) { space.item = itemSpace; - space.line = GetValue$1h(config, 'space.choiceLine', itemSpace); + space.line = GetValue$1f(config, 'space.choiceLine', itemSpace); } else { // GridButtons - space.column = GetValue$1h(config, 'space.choiceColumn', itemSpace); - space.row = GetValue$1h(config, 'space.choiceRow', itemSpace); + space.column = GetValue$1f(config, 'space.choiceColumn', itemSpace); + space.row = GetValue$1f(config, 'space.choiceRow', itemSpace); } var choicesConfig = { - width: GetValue$1h(config, 'choicesWidth', undefined), - height: GetValue$1h(config, 'choicesHeight', undefined), + width: GetValue$1f(config, 'choicesWidth', undefined), + height: GetValue$1f(config, 'choicesHeight', undefined), groupName: 'choices', buttonsType: buttonsType, background: choicesBackground, @@ -45098,22 +45098,22 @@ space: space, click: clickConfig, eventEmitter: _this.eventEmitter, - setValueCallback: GetValue$1h(config, 'choicesSetValueCallback', undefined), - setValueCallbackScope: GetValue$1h(config, 'choicesSetValueCallbackScope', undefined) + setValueCallback: GetValue$1f(config, 'choicesSetValueCallback', undefined), + setValueCallbackScope: GetValue$1f(config, 'choicesSetValueCallbackScope', undefined) }; if (ButtonsClass === Buttons$1) { choicesConfig.orientation = Contains(choicesType, 'x') ? 0 : 1; } choicesSizer = new ButtonsClass(scene, choicesConfig); - var choicesSpace = GetValue$1h(config, 'space.choices', 0); + var choicesSpace = GetValue$1f(config, 'space.choices', 0); var padding = { - left: GetValue$1h(config, 'space.choicesLeft', 0), - right: GetValue$1h(config, 'space.choicesRight', 0), + left: GetValue$1f(config, 'space.choicesLeft', 0), + right: GetValue$1f(config, 'space.choicesRight', 0), bottom: actions ? choicesSpace : 0 }; - var align = GetValue$1h(config, 'align.choices', 'center'); - var proportion = GetValue$1h(config, 'proportion.choices', 0); - var expand = GetValue$1h(config, 'expand.choices', true); + var align = GetValue$1f(config, 'align.choices', 'center'); + var proportion = GetValue$1f(config, 'proportion.choices', 0); + var expand = GetValue$1f(config, 'expand.choices', true); _this.add(choicesSizer, { align: align, padding: padding, @@ -45130,19 +45130,19 @@ orientation: 0, // Left-right space: { - item: GetValue$1h(config, 'space.action', 0) + item: GetValue$1f(config, 'space.action', 0) }, - expand: GetValue$1h(config, 'expand.actions', false), - align: GetValue$1h(config, 'align.actions', 'center'), + expand: GetValue$1f(config, 'expand.actions', false), + align: GetValue$1f(config, 'align.actions', 'center'), click: clickConfig, eventEmitter: _this.eventEmitter }); var padding = { - left: GetValue$1h(config, 'space.actionsLeft', 0), - right: GetValue$1h(config, 'space.actionsRight', 0), - bottom: GetValue$1h(config, 'space.actionsBottom', 0) + left: GetValue$1f(config, 'space.actionsLeft', 0), + right: GetValue$1f(config, 'space.actionsRight', 0), + bottom: GetValue$1f(config, 'space.actionsBottom', 0) }; - var proportion = GetValue$1h(config, 'proportion.action', 0); + var proportion = GetValue$1f(config, 'proportion.action', 0); _this.add(actionsSizer, { align: 'center', padding: padding, @@ -45393,12 +45393,12 @@ return scrollMode; }; - var GetValue$1g = Phaser.Utils.Objects.GetValue; + var GetValue$1e = Phaser.Utils.Objects.GetValue; var AddChild = function AddChild(topPatent, childParent, config) { - var childConfig = GetValue$1g(config, 'child'); - var child = GetValue$1g(childConfig, 'gameObject', undefined); + var childConfig = GetValue$1e(config, 'child'); + var child = GetValue$1e(childConfig, 'gameObject', undefined); if (child) { - var childSpace = GetValue$1g(config, 'space.child', 0); + var childSpace = GetValue$1e(config, 'space.child', 0); topPatent.childMargin = {}; var childMargin = topPatent.childMargin; var childPadding = {}; @@ -45422,35 +45422,35 @@ } else { switch (topPatent.scrollMode) { case 0: - childMargin.top = GetValue$1g(childSpace, 'top', 0); - childMargin.bottom = GetValue$1g(childSpace, 'bottom', 0); - childPadding.left = GetValue$1g(childSpace, 'left', 0); - childPadding.right = GetValue$1g(childSpace, 'right', 0); + childMargin.top = GetValue$1e(childSpace, 'top', 0); + childMargin.bottom = GetValue$1e(childSpace, 'bottom', 0); + childPadding.left = GetValue$1e(childSpace, 'left', 0); + childPadding.right = GetValue$1e(childSpace, 'right', 0); break; case 1: - childMargin.top = GetValue$1g(childSpace, 'left', 0); - childMargin.bottom = GetValue$1g(childSpace, 'right', 0); - childPadding.top = GetValue$1g(childSpace, 'top', 0); - childPadding.bottom = GetValue$1g(childSpace, 'bottom', 0); + childMargin.top = GetValue$1e(childSpace, 'left', 0); + childMargin.bottom = GetValue$1e(childSpace, 'right', 0); + childPadding.top = GetValue$1e(childSpace, 'top', 0); + childPadding.bottom = GetValue$1e(childSpace, 'bottom', 0); break; default: // 2 - childMargin.top = GetValue$1g(childSpace, 'top', 0); - childMargin.bottom = GetValue$1g(childSpace, 'bottom', 0); - childMargin.left = GetValue$1g(childSpace, 'left', 0); - childMargin.right = GetValue$1g(childSpace, 'right', 0); + childMargin.top = GetValue$1e(childSpace, 'top', 0); + childMargin.bottom = GetValue$1e(childSpace, 'bottom', 0); + childMargin.left = GetValue$1e(childSpace, 'left', 0); + childMargin.right = GetValue$1e(childSpace, 'right', 0); break; } } childParent.add(child, { column: 1, row: 1, - align: GetValue$1g(childConfig, 'align', 'center'), + align: GetValue$1e(childConfig, 'align', 'center'), padding: childPadding, expand: { - width: GetValue$1g(childConfig, 'expandWidth', true), + width: GetValue$1e(childConfig, 'expandWidth', true), // Private - height: GetValue$1g(childConfig, 'expandHeight', true) // Private + height: GetValue$1e(childConfig, 'expandHeight', true) // Private } }); } @@ -45667,7 +45667,7 @@ this.resetChildPositionState(indicator); }; - var GetValue$1f = Phaser.Utils.Objects.GetValue; + var GetValue$1d = Phaser.Utils.Objects.GetValue; var IsPlainObject$c = Phaser.Utils.Objects.IsPlainObject; var Clamp$7 = Phaser.Math.Clamp; var SnapTo = Phaser.Math.Snap.To; @@ -45681,13 +45681,13 @@ _this = _super.call(this, scene, config); _this.type = 'rexSlider'; _this.bootProgressBase(config); - _this.reverseAxis = GetValue$1f(config, 'reverseAxis', false); + _this.reverseAxis = GetValue$1d(config, 'reverseAxis', false); // Add elements - var background = GetValue$1f(config, 'background', undefined); - var track = GetValue$1f(config, 'track', undefined); - var indicator = GetValue$1f(config, 'indicator', undefined); - var thumb = GetValue$1f(config, 'thumb', undefined); + var background = GetValue$1d(config, 'background', undefined); + var track = GetValue$1d(config, 'track', undefined); + var indicator = GetValue$1d(config, 'indicator', undefined); + var thumb = GetValue$1d(config, 'thumb', undefined); if (background) { if (IsPlainObject$c(background)) { background = CreateBackground$2(scene, background); @@ -45720,7 +45720,7 @@ } // Input - var inputMode = GetValue$1f(config, 'input', 0); + var inputMode = GetValue$1d(config, 'input', 0); if (typeof inputMode === 'string') { inputMode = INPUTMODE[inputMode]; } @@ -45758,9 +45758,9 @@ _this.addChildrenMap('track', track); _this.addChildrenMap('indicator', indicator); _this.addChildrenMap('thumb', thumb); - _this.setEnable(GetValue$1f(config, 'enable', undefined)); - _this.setGap(GetValue$1f(config, 'gap', undefined)); - _this.setValue(GetValue$1f(config, 'value', 0), GetValue$1f(config, 'min', undefined), GetValue$1f(config, 'max', undefined)); + _this.setEnable(GetValue$1d(config, 'enable', undefined)); + _this.setGap(GetValue$1d(config, 'gap', undefined)); + _this.setValue(GetValue$1d(config, 'value', 0), GetValue$1d(config, 'min', undefined), GetValue$1d(config, 'max', undefined)); return _this; } _createClass(Slider, [{ @@ -45832,7 +45832,7 @@ }; Object.assign(Slider.prototype, methods$d); - var GetValue$1e = Phaser.Utils.Objects.GetValue; + var GetValue$1c = Phaser.Utils.Objects.GetValue; var ScrollBar = /*#__PURE__*/function (_Sizer) { _inherits(ScrollBar, _Sizer); var _super = _createSuper(ScrollBar); @@ -45844,12 +45844,12 @@ _this.type = 'rexScrollBar'; // Add elements - var background = GetValue$1e(config, 'background', undefined); - var buttonsConfig = GetValue$1e(config, 'buttons', undefined); - var button0 = GetValue$1e(buttonsConfig, 'top', GetValue$1e(buttonsConfig, 'left', undefined)); - var button1 = GetValue$1e(buttonsConfig, 'bottom', GetValue$1e(buttonsConfig, 'right', undefined)); + var background = GetValue$1c(config, 'background', undefined); + var buttonsConfig = GetValue$1c(config, 'buttons', undefined); + var button0 = GetValue$1c(buttonsConfig, 'top', GetValue$1c(buttonsConfig, 'left', undefined)); + var button1 = GetValue$1c(buttonsConfig, 'bottom', GetValue$1c(buttonsConfig, 'right', undefined)); var slider, - sliderConfig = GetValue$1e(config, 'slider', undefined); + sliderConfig = GetValue$1c(config, 'slider', undefined); if (background) { _this.addBackground(background); } @@ -45870,10 +45870,10 @@ sliderConfig.value = null; var proportion; if (_this.orientation === 0) { - var sliderWidth = GetValue$1e(sliderConfig, 'width', undefined); + var sliderWidth = GetValue$1c(sliderConfig, 'width', undefined); proportion = sliderWidth === undefined ? 1 : 0; } else { - var sliderHeight = GetValue$1e(sliderConfig, 'height', undefined); + var sliderHeight = GetValue$1c(sliderConfig, 'height', undefined); proportion = sliderHeight === undefined ? 1 : 0; } slider = new Slider(scene, sliderConfig); @@ -45897,14 +45897,14 @@ _this.addChildrenMap('background', background); _this.addChildrenMap('slider', slider); _this.addChildrenMap('buttons', buttons); - var callback = GetValue$1e(config, 'valuechangeCallback', null); + var callback = GetValue$1c(config, 'valuechangeCallback', null); if (callback !== null) { - var scope = GetValue$1e(config, 'valuechangeCallbackScope', undefined); + var scope = GetValue$1c(config, 'valuechangeCallbackScope', undefined); _this.on('valuechange', callback, scope); } - _this.setEnable(GetValue$1e(config, 'enable', undefined)); - _this.setValue(GetValue$1e(config, 'value', 0)); - _this.setScrollStep(GetValue$1e(buttonsConfig, 'step', 0.01)); + _this.setEnable(GetValue$1c(config, 'enable', undefined)); + _this.setValue(GetValue$1c(config, 'value', 0)); + _this.setScrollStep(GetValue$1c(buttonsConfig, 'step', 0.01)); return _this; } _createClass(ScrollBar, [{ @@ -46206,7 +46206,7 @@ return State; }(FSM); - var GetValue$1d = Phaser.Utils.Objects.GetValue; + var GetValue$1b = Phaser.Utils.Objects.GetValue; var DistanceBetween$1 = Phaser.Math.Distance.Between; var DragSpeed = /*#__PURE__*/function (_ComponentBase) { _inherits(DragSpeed, _ComponentBase); @@ -46218,7 +46218,7 @@ // this.parent = gameObject; _this._enable = undefined; - gameObject.setInteractive(GetValue$1d(config, "inputConfig", undefined)); + gameObject.setInteractive(GetValue$1b(config, "inputConfig", undefined)); _this.resetFromJSON(config); _this.boot(); return _this; @@ -46236,9 +46236,9 @@ this.localX = undefined; this.localY = undefined; this.justMoved = false; - this.setEnable(GetValue$1d(o, 'enable', true)); - this.holdThreshold = GetValue$1d(o, 'holdThreshold', 50); // ms - this.pointerOutReleaseEnable = GetValue$1d(o, 'pointerOutRelease', true); + this.setEnable(GetValue$1b(o, 'enable', true)); + this.holdThreshold = GetValue$1b(o, 'holdThreshold', 50); // ms + this.pointerOutReleaseEnable = GetValue$1b(o, 'pointerOutRelease', true); return this; } }, { @@ -46435,7 +46435,7 @@ return DragSpeed; }(ComponentBase); - var GetValue$1c = Phaser.Utils.Objects.GetValue; + var GetValue$1a = Phaser.Utils.Objects.GetValue; var Movement = /*#__PURE__*/function () { function Movement(config) { _classCallCheck(this, Movement); @@ -46444,9 +46444,9 @@ _createClass(Movement, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.setValue(GetValue$1c(o, 'value', 0)); - this.setSpeed(GetValue$1c(o, 'speed', 0)); - this.setAcceleration(GetValue$1c(o, 'acceleration', 0)); + this.setValue(GetValue$1a(o, 'value', 0)); + this.setSpeed(GetValue$1a(o, 'speed', 0)); + this.setAcceleration(GetValue$1a(o, 'acceleration', 0)); return this; } }, { @@ -46584,7 +46584,7 @@ return SlowDown; }(); - var GetValue$1b = Phaser.Utils.Objects.GetValue; + var GetValue$19 = Phaser.Utils.Objects.GetValue; var Clamp$6 = Phaser.Math.Clamp; var Scroller = /*#__PURE__*/function (_ComponentBase) { _inherits(Scroller, _ComponentBase); @@ -46595,34 +46595,34 @@ _this = _super.call(this, gameObject, config); // this.parent = gameObject; - var enable = GetValue$1b(config, 'enable', true); + var enable = GetValue$19(config, 'enable', true); _this._state = new State(_assertThisInitialized(_this), { enable: enable, eventEmitter: false }); var drapSpeedConfig = { - inputConfig: GetValue$1b(config, 'inputConfig', undefined), + inputConfig: GetValue$19(config, 'inputConfig', undefined), enable: enable, - pointerOutRelease: GetValue$1b(config, 'pointerOutRelease', true), + pointerOutRelease: GetValue$19(config, 'pointerOutRelease', true), eventEmitter: false }; _this.dragState = new DragSpeed(gameObject, drapSpeedConfig); _this._enable = undefined; _this._value = undefined; _this._slowDown = new SlowDown(); - var callback = GetValue$1b(config, 'valuechangeCallback', null); + var callback = GetValue$19(config, 'valuechangeCallback', null); if (callback !== null) { - var scope = GetValue$1b(config, 'valuechangeCallbackScope', undefined); + var scope = GetValue$19(config, 'valuechangeCallbackScope', undefined); _this.on('valuechange', callback, scope); } - callback = GetValue$1b(config, 'overmaxCallback', null); + callback = GetValue$19(config, 'overmaxCallback', null); if (callback !== null) { - var scope = GetValue$1b(config, 'overmaxCallbackScope', undefined); + var scope = GetValue$19(config, 'overmaxCallbackScope', undefined); _this.on('overmax', callback, scope); } - callback = GetValue$1b(config, 'overminCallback', null); + callback = GetValue$19(config, 'overminCallback', null); if (callback !== null) { - var scope = GetValue$1b(config, 'overminCallbackScope', undefined); + var scope = GetValue$19(config, 'overminCallbackScope', undefined); _this.on('overmin', callback, scope); } _this.resetFromJSON(config); @@ -46632,21 +46632,21 @@ _createClass(Scroller, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.setOrientationMode(GetValue$1b(o, 'orientation', 0)); - this.setDragThreshold(GetValue$1b(o, 'threshold', 10)); - this.setSlidingDeceleration(GetValue$1b(o, 'slidingDeceleration', 5000)); - this.setBackDeceleration(GetValue$1b(o, 'backDeceleration', 2000)); - var dragRate = GetValue$1b(o, 'dragRate', 1); - dragRate = dragRate * (GetValue$1b(o, 'dragReverse', false) ? -1 : 1); + this.setOrientationMode(GetValue$19(o, 'orientation', 0)); + this.setDragThreshold(GetValue$19(o, 'threshold', 10)); + this.setSlidingDeceleration(GetValue$19(o, 'slidingDeceleration', 5000)); + this.setBackDeceleration(GetValue$19(o, 'backDeceleration', 2000)); + var dragRate = GetValue$19(o, 'dragRate', 1); + dragRate = dragRate * (GetValue$19(o, 'dragReverse', false) ? -1 : 1); this.setDragRate(dragRate); - var bounds = GetValue$1b(o, 'bounds', undefined); + var bounds = GetValue$19(o, 'bounds', undefined); if (bounds) { this.setBounds(bounds); } else { - this.setBounds(GetValue$1b(o, 'max', 0), GetValue$1b(o, 'min', 0)); + this.setBounds(GetValue$19(o, 'max', 0), GetValue$19(o, 'min', 0)); } - this.setValue(GetValue$1b(o, 'value', this.maxValue || 0)); - this.setEnable(GetValue$1b(o, "enable", true)); + this.setValue(GetValue$19(o, 'value', this.maxValue || 0)); + this.setEnable(GetValue$19(o, "enable", true)); return this; } }, { @@ -46978,7 +46978,7 @@ horizontal: 1 }; - var GetValue$1a = Phaser.Utils.Objects.GetValue; + var GetValue$18 = Phaser.Utils.Objects.GetValue; var MouseWheelScroller = /*#__PURE__*/function (_ComponentBase) { _inherits(MouseWheelScroller, _ComponentBase); var _super = _createSuper(MouseWheelScroller); @@ -46989,18 +46989,18 @@ // this.parent = gameObject; if (_this.parent !== _this.scene) { - _this.focusMode = GetValue$1a(config, 'focus', true); + _this.focusMode = GetValue$18(config, 'focus', true); } else { _this.focusMode = false; } - _this.setSpeed(GetValue$1a(config, 'speed', 0.1)); - _this.setEnable(GetValue$1a(config, 'enable', true)); + _this.setSpeed(GetValue$18(config, 'speed', 0.1)); + _this.setEnable(GetValue$18(config, 'enable', true)); if (!_this.focusMode) { // Register on scene _this.scene.input.on('wheel', _this.onSceneScroll, _assertThisInitialized(_this)); } else { var gameObject = _this.parent; - gameObject.setInteractive(GetValue$1a(config, "inputConfig", undefined)).on('wheel', function (pointer, dx, dy, dz, event) { + gameObject.setInteractive(GetValue$18(config, "inputConfig", undefined)).on('wheel', function (pointer, dx, dy, dz, event) { if (!this.enable) { return; } @@ -47049,7 +47049,7 @@ return MouseWheelScroller; }(ComponentBase); - var GetValue$19 = Phaser.Utils.Objects.GetValue; + var GetValue$17 = Phaser.Utils.Objects.GetValue; var AddSlider = function AddSlider(topPatent, sliderParent, axis, config) { axis = axis.toUpperCase(); var isAxisY = axis === 'Y'; @@ -47058,12 +47058,12 @@ var sliderConfig, slider; var sliderConfigKey = "slider".concat(axis); if (isScrollXYMode) { - sliderConfig = GetValue$19(config, sliderConfigKey, undefined); + sliderConfig = GetValue$17(config, sliderConfigKey, undefined); } else { if (config.hasOwnProperty(sliderConfigKey)) { - sliderConfig = GetValue$19(config, sliderConfigKey, undefined); + sliderConfig = GetValue$17(config, sliderConfigKey, undefined); } else { - sliderConfig = GetValue$19(config, 'slider', undefined); + sliderConfig = GetValue$17(config, 'slider', undefined); } } if (sliderConfig) { @@ -47073,7 +47073,7 @@ sliderConfig.orientation = isAxisY ? 1 : 0; slider = CreateScrollbar(topPatent.scene, sliderConfig); var column, row, padding; - var sliderPosition = GetValue$19(sliderConfig, 'position', 0); + var sliderPosition = GetValue$17(sliderConfig, 'position', 0); if (typeof sliderPosition === 'string') { sliderPosition = SLIDER_POSITION_MAP[sliderPosition]; } @@ -47083,15 +47083,15 @@ 2. space.slider 3. space.child */ - var sliderPadding = GetValue$19(config, "space.slider".concat(axis), undefined); + var sliderPadding = GetValue$17(config, "space.slider".concat(axis), undefined); if (sliderPadding === undefined) { - sliderPadding = GetValue$19(config, 'space.slider', undefined); + sliderPadding = GetValue$17(config, 'space.slider', undefined); if (sliderPadding === undefined) { if (isScrollXYMode) { sliderPadding = 0; } else { // Legacy - sliderPadding = GetValue$19(config, 'space.child', 0); + sliderPadding = GetValue$17(config, 'space.child', 0); } } } @@ -47136,9 +47136,9 @@ padding: padding, expand: true }); - topPatent["hideUnscrollableSlider".concat(axis)] = GetValue$19(sliderConfig, 'hideUnscrollableSlider', false); - topPatent["adaptThumb".concat(axis, "SizeMode")] = GetValue$19(sliderConfig, 'adaptThumbSize', false); - topPatent["minThumb".concat(axis, "Size")] = GetValue$19(sliderConfig, 'minThumbSize', undefined); + topPatent["hideUnscrollableSlider".concat(axis)] = GetValue$17(sliderConfig, 'hideUnscrollableSlider', false); + topPatent["adaptThumb".concat(axis, "SizeMode")] = GetValue$17(sliderConfig, 'adaptThumbSize', false); + topPatent["minThumb".concat(axis, "Size")] = GetValue$17(sliderConfig, 'minThumbSize', undefined); } else { topPatent["hideUnscrollableSlider".concat(axis)] = false; topPatent["adaptThumb".concat(axis, "SizeMode")] = false; @@ -47147,12 +47147,12 @@ var scrollerConfig, scroller; var scrollerConfigKey = "scroller".concat(axis); if (isScrollXYMode) { - scrollerConfig = GetValue$19(config, scrollerConfigKey, true); + scrollerConfig = GetValue$17(config, scrollerConfigKey, true); } else { if (config.hasOwnProperty(scrollerConfigKey)) { - scrollerConfig = GetValue$19(config, scrollerConfigKey, true); + scrollerConfig = GetValue$17(config, scrollerConfigKey, true); } else { - scrollerConfig = GetValue$19(config, 'scroller', true); + scrollerConfig = GetValue$17(config, 'scroller', true); } } if (scrollerConfig && child) { @@ -47162,7 +47162,7 @@ scrollerConfig.orientation = isAxisY ? 0 : 1; scroller = new Scroller(child, scrollerConfig); } - var mouseWheelScrollerConfig = GetValue$19(config, isScrollXYMode ? "mouseWheelScroller".concat(axis) : 'mouseWheelScroller', false), + var mouseWheelScrollerConfig = GetValue$17(config, isScrollXYMode ? "mouseWheelScroller".concat(axis) : 'mouseWheelScroller', false), mouseWheelScroller; if (mouseWheelScrollerConfig && child) { mouseWheelScroller = new MouseWheelScroller(child, mouseWheelScrollerConfig); @@ -47222,22 +47222,22 @@ top: 1 }; - var GetValue$18 = Phaser.Utils.Objects.GetValue; + var GetValue$16 = Phaser.Utils.Objects.GetValue; var CreateScrollableSizer = function CreateScrollableSizer(parent, config) { var scene = parent.scene; var columnProportions = [0, 1, 0], rowProportions = [0, 1, 0]; - var parentMinWidth = GetValue$18(config, 'width'); - var parentMinHeight = GetValue$18(config, 'height'); + var parentMinWidth = GetValue$16(config, 'width'); + var parentMinHeight = GetValue$16(config, 'height'); if (!parentMinWidth) { - var expandChildWidth = GetValue$18(config, 'child.expandWidth', true); + var expandChildWidth = GetValue$16(config, 'child.expandWidth', true); if (!expandChildWidth) { columnProportions[1] = 0; // Calculate parent's width by child's width } } if (!parentMinHeight) { - var expandChildHeight = GetValue$18(config, 'child.expandHeight', true); + var expandChildHeight = GetValue$16(config, 'child.expandHeight', true); if (!expandChildHeight) { rowProportions[1] = 0; // Calculate parent's height by child's height } @@ -47456,7 +47456,7 @@ } }; - var GetValue$17 = Phaser.Utils.Objects.GetValue; + var GetValue$15 = Phaser.Utils.Objects.GetValue; var Clamp$5 = Phaser.Math.Clamp; var Scrollable = /*#__PURE__*/function (_Sizer) { _inherits(Scrollable, _Sizer); @@ -47472,19 +47472,19 @@ var isRevererXY = scrollMode === 1; config.orientation = !isRevererXY ? 1 : 0; _this = _super.call(this, scene, config); - _this.type = GetValue$17(config, 'type', 'rexScrollable'); + _this.type = GetValue$15(config, 'type', 'rexScrollable'); _this.scrollMode = scrollMode; // Add elements // Background - var background = GetValue$17(config, 'background', undefined); + var background = GetValue$15(config, 'background', undefined); if (background) { _this.addBackground(background); } - var header = GetValue$17(config, 'header', undefined); + var header = GetValue$15(config, 'header', undefined); if (header) { - var align = GetValue$17(config, 'align.header', 'center'); - var headerSpace = GetValue$17(config, 'space.header', 0); + var align = GetValue$15(config, 'align.header', 'center'); + var headerSpace = GetValue$15(config, 'space.header', 0); var padding; if (!isRevererXY) { padding = { @@ -47499,7 +47499,7 @@ proportion: 0, align: align, padding: padding, - expand: GetValue$17(config, 'expand.header', true) + expand: GetValue$15(config, 'expand.header', true) }); } var scrollableSizer = CreateScrollableSizer(_assertThisInitialized(_this), config); @@ -47511,10 +47511,10 @@ expand: true }); } - var footer = GetValue$17(config, 'footer', undefined); + var footer = GetValue$15(config, 'footer', undefined); if (footer) { - var align = GetValue$17(config, 'align.footer', 'center'); - var footerSpace = GetValue$17(config, 'space.footer', 0); + var align = GetValue$15(config, 'align.footer', 'center'); + var footerSpace = GetValue$15(config, 'space.footer', 0); var padding; if (!isRevererXY) { padding = { @@ -47529,7 +47529,7 @@ proportion: 0, align: align, padding: padding, - expand: GetValue$17(config, 'expand.footer', true) + expand: GetValue$15(config, 'expand.footer', true) }); } _this.addChildrenMap('background', background); @@ -48280,7 +48280,7 @@ }; var IsPlainObject$b = Phaser.Utils.Objects.IsPlainObject; - var GetValue$16 = Phaser.Utils.Objects.GetValue; + var GetValue$14 = Phaser.Utils.Objects.GetValue; var ALIGN_LEFTTOP$1 = Phaser.Display.Align.TOP_LEFT; var TextBlock = /*#__PURE__*/function (_BaseSizer) { _inherits(TextBlock, _BaseSizer); @@ -48290,14 +48290,14 @@ _classCallCheck(this, TextBlock); if (IsPlainObject$b(x)) { config = x; - x = GetValue$16(config, 'x', 0); - y = GetValue$16(config, 'y', 0); - minWidth = GetValue$16(config, 'width', undefined); - minHeight = GetValue$16(config, 'height', undefined); + x = GetValue$14(config, 'x', 0); + y = GetValue$14(config, 'y', 0); + minWidth = GetValue$14(config, 'width', undefined); + minHeight = GetValue$14(config, 'height', undefined); } else if (IsPlainObject$b(minWidth)) { config = minWidth; - minWidth = GetValue$16(config, 'width', undefined); - minHeight = GetValue$16(config, 'height', undefined); + minWidth = GetValue$14(config, 'width', undefined); + minHeight = GetValue$14(config, 'height', undefined); } _this = _super.call(this, scene, x, y, minWidth, minHeight, config); _this.type = 'rexTextBlock'; @@ -48316,21 +48316,21 @@ // Tag text object : pens-manager // Bitmap text object : array of string - _this.text = GetValue$16(config, 'content', ''); + _this.text = GetValue$14(config, 'content', ''); _this._textOY = 0; _this.execeedTopState = false; _this.execeedBottomState = false; - _this.setClampMode(GetValue$16(config, 'clamplTextOY', true)); - _this.alwaysScrollable = GetValue$16(config, 'alwaysScrollable', false); + _this.setClampMode(GetValue$14(config, 'clamplTextOY', true)); + _this.alwaysScrollable = GetValue$14(config, 'alwaysScrollable', false); // Add elements - var background = GetValue$16(config, 'background', undefined); - var textObject = GetValue$16(config, 'text', undefined); + var background = GetValue$14(config, 'background', undefined); + var textObject = GetValue$14(config, 'text', undefined); if (textObject === undefined) { textObject = CreateDefaultTextObject(scene); } - _this.textCropEnable = GetValue$16(config, 'textCrop', !!textObject.setCrop); - var textMaskEnable = GetValue$16(config, 'textMask', !_this.textCropEnable); + _this.textCropEnable = GetValue$14(config, 'textCrop', !!textObject.setCrop); + var textMaskEnable = GetValue$14(config, 'textMask', !_this.textCropEnable); if (background) { _this.addBackground(background); } @@ -48614,7 +48614,7 @@ } }; - var GetValue$15 = Phaser.Utils.Objects.GetValue; + var GetValue$13 = Phaser.Utils.Objects.GetValue; var TextArea = /*#__PURE__*/function (_Scrollable) { _inherits(TextArea, _Scrollable); var _super = _createSuper(TextArea); @@ -48626,12 +48626,12 @@ } // Create text-block - var textObject = GetValue$15(config, 'text', undefined); - var textWidth = GetValue$15(config, 'textWidth', undefined); - var textHeight = GetValue$15(config, 'textHeight', undefined); - var textCrop = GetValue$15(config, 'textCrop', !!textObject.setCrop); - var textMask = GetValue$15(config, 'textMask', !textCrop); - var content = GetValue$15(config, 'content', ''); + var textObject = GetValue$13(config, 'text', undefined); + var textWidth = GetValue$13(config, 'textWidth', undefined); + var textHeight = GetValue$13(config, 'textHeight', undefined); + var textCrop = GetValue$13(config, 'textCrop', !!textObject.setCrop); + var textMask = GetValue$13(config, 'textMask', !textCrop); + var content = GetValue$13(config, 'content', ''); var textBlock = new TextBlock(scene, { width: textWidth, height: textHeight, @@ -48639,8 +48639,8 @@ textMask: textMask, textCrop: textCrop && !textMask, content: content, - clamplTextOY: GetValue$15(config, 'clamplChildOY', false), - alwaysScrollable: GetValue$15(config, 'alwaysScrollable', false) + clamplTextOY: GetValue$13(config, 'clamplChildOY', false), + alwaysScrollable: GetValue$13(config, 'alwaysScrollable', false) }); scene.add.existing(textBlock); // Important: Add to display list for touch detecting // Inject properties for scrollable interface @@ -48654,9 +48654,9 @@ expandWidth: textWidth === undefined, expandHeight: textHeight === undefined }; - var spaceConfig = GetValue$15(config, 'space', undefined); + var spaceConfig = GetValue$13(config, 'space', undefined); if (spaceConfig) { - spaceConfig.child = GetValue$15(spaceConfig, 'text', 0); + spaceConfig.child = GetValue$13(spaceConfig, 'text', 0); } _this = _super.call(this, scene, config); _this.addChildrenMap('text', textObject); @@ -48695,13 +48695,13 @@ }(Scrollable); Object.assign(TextArea.prototype, SetTextMethods$1, ScrollMethods$2); - var GetValue$14 = Phaser.Utils.Objects.GetValue; + var GetValue$12 = Phaser.Utils.Objects.GetValue; var CreateTextArea = function CreateTextArea(scene, config, creators) { config = config ? DeepClone(config) : {}; - var createBackground = GetValue$14(creators, 'background', CreateBackground$2); - var createText = GetValue$14(creators, 'text', CreateText); - var createTrack = GetValue$14(creators, 'track', CreateBackground$2); - var createThumb = GetValue$14(creators, 'thumb', CreateBackground$2); + var createBackground = GetValue$12(creators, 'background', CreateBackground$2); + var createText = GetValue$12(creators, 'text', CreateText); + var createTrack = GetValue$12(creators, 'track', CreateBackground$2); + var createThumb = GetValue$12(creators, 'thumb', CreateBackground$2); if (createBackground) { config.background = createBackground(scene, config.background); } else { @@ -48738,9 +48738,9 @@ return gameObject; }; - var GetValue$13 = Phaser.Utils.Objects.GetValue; + var GetValue$11 = Phaser.Utils.Objects.GetValue; var CreateContent = function CreateContent(scene, config, creators) { - var type = GetValue$13(config, '$type'); + var type = GetValue$11(config, '$type'); if (type === undefined) { if (config && (config.hasOwnProperty('slider') || config.hasOwnProperty('scroller'))) { type = 'textarea'; @@ -48759,7 +48759,7 @@ return gameObject; }; - var GetValue$12 = Phaser.Utils.Objects.GetValue; + var GetValue$10 = Phaser.Utils.Objects.GetValue; var ConfirmDialog = /*#__PURE__*/function (_Dialog) { _inherits(ConfirmDialog, _Dialog); var _super = _createSuper(ConfirmDialog); @@ -48770,7 +48770,7 @@ if (creators === undefined) { creators = {}; } - var createBackground = GetValue$12(creators, 'background', CreateBackground$2); + var createBackground = GetValue$10(creators, 'background', CreateBackground$2); if (createBackground) { config.background = createBackground(scene, config.background); } else { @@ -48836,17 +48836,17 @@ }); SetValue(window, 'RexPlugins.UI.ConfirmDialog', ConfirmDialog); - var GetValue$11 = Phaser.Utils.Objects.GetValue; + var GetValue$$ = Phaser.Utils.Objects.GetValue; var GetAddChildConfig = function GetAddChildConfig(config, key, defaultValues) { - var proportion = GetValue$11(config, "proportion.".concat(key), defaultValues.proportion); - var align = GetValue$11(config, "align.".concat(key), 'center'); - var padding = GetValue$11(config, "space.".concat(key), undefined); + var proportion = GetValue$$(config, "proportion.".concat(key), defaultValues.proportion); + var align = GetValue$$(config, "align.".concat(key), 'center'); + var padding = GetValue$$(config, "space.".concat(key), undefined); if (typeof padding === 'number' && defaultValues.paddingKey) { var paddingNum = padding; padding = {}; padding[defaultValues.paddingKey] = paddingNum; } - var expand = GetValue$11(config, "expand.".concat(key), true); + var expand = GetValue$$(config, "expand.".concat(key), true); return { proportion: proportion, align: align, @@ -49132,17 +49132,17 @@ } }; - var GetValue$10 = Phaser.Utils.Objects.GetValue; + var GetValue$_ = Phaser.Utils.Objects.GetValue; var LayoutCallbacks = [LayoutMode0$1, LayoutMode1, LayoutMode2, LayoutMode0]; var Build = function Build(config) { this.clear(true); // Add Background - var background = GetValue$10(config, 'background', undefined); + var background = GetValue$_(config, 'background', undefined); if (background) { this.addBackground(background); } - var layoutMode = GetValue$10(config, 'layoutMode', 0); + var layoutMode = GetValue$_(config, 'layoutMode', 0); if (typeof layoutMode === 'string') { layoutMode = LayoutModesMap[layoutMode.toUpperCase()]; } @@ -49409,7 +49409,7 @@ } }; - var GetValue$$ = Phaser.Utils.Objects.GetValue; + var GetValue$Z = Phaser.Utils.Objects.GetValue; var Tabs = /*#__PURE__*/function (_GridSizer) { _inherits(Tabs, _GridSizer); var _super = _createSuper(Tabs); @@ -49424,24 +49424,24 @@ config.row = 3; _this = _super.call(this, scene, config); _this.type = 'rexTabs'; - _this.eventEmitter = GetValue$$(config, 'eventEmitter', _assertThisInitialized(_this)); + _this.eventEmitter = GetValue$Z(config, 'eventEmitter', _assertThisInitialized(_this)); // Add elements - var background = GetValue$$(config, 'background', undefined); - var panel = GetValue$$(config, 'panel', undefined); - var leftButtons = GetValue$$(config, 'leftButtons', undefined); - var leftButtonsBackground = GetValue$$(config, 'leftButtonsBackground', undefined); + var background = GetValue$Z(config, 'background', undefined); + var panel = GetValue$Z(config, 'panel', undefined); + var leftButtons = GetValue$Z(config, 'leftButtons', undefined); + var leftButtonsBackground = GetValue$Z(config, 'leftButtonsBackground', undefined); var leftButtonsSizer; - var rightButtons = GetValue$$(config, 'rightButtons', undefined); - var rightButtonsBackground = GetValue$$(config, 'rightButtonsBackground', undefined); + var rightButtons = GetValue$Z(config, 'rightButtons', undefined); + var rightButtonsBackground = GetValue$Z(config, 'rightButtonsBackground', undefined); var rightButtonsSizer; - var topButtons = GetValue$$(config, 'topButtons', undefined); - var topButtonsBackground = GetValue$$(config, 'topButtonsBackground', undefined); + var topButtons = GetValue$Z(config, 'topButtons', undefined); + var topButtonsBackground = GetValue$Z(config, 'topButtonsBackground', undefined); var topButtonsSizer; - var bottomButtons = GetValue$$(config, 'bottomButtons', undefined); - var bottomButtonsBackground = GetValue$$(config, 'bottomButtonsBackground', undefined); + var bottomButtons = GetValue$Z(config, 'bottomButtons', undefined); + var bottomButtonsBackground = GetValue$Z(config, 'bottomButtonsBackground', undefined); var bottomButtonsSizer; - var clickConfig = GetValue$$(config, 'click', undefined); + var clickConfig = GetValue$Z(config, 'click', undefined); if (background) { _this.addBackground(background); } @@ -49449,8 +49449,8 @@ _this.add(panel, 1, 1, 'center', 0, true); } if (leftButtons) { - var leftButtonsOffset = GetValue$$(config, 'space.leftButtonsOffset', 0); - var leftButtonSpace = GetValue$$(config, 'space.leftButton', 0); + var leftButtonsOffset = GetValue$Z(config, 'space.leftButtonsOffset', 0); + var leftButtonSpace = GetValue$Z(config, 'space.leftButton', 0); leftButtonsSizer = new Buttons$1(scene, { groupName: 'left', background: leftButtonsBackground, @@ -49460,7 +49460,7 @@ space: { item: leftButtonSpace }, - align: GetValue$$(config, 'align.leftButtons', undefined), + align: GetValue$Z(config, 'align.leftButtons', undefined), click: clickConfig, eventEmitter: _this.eventEmitter }); @@ -49470,8 +49470,8 @@ _this.add(leftButtonsSizer, 0, 1, 'top', padding, false); } if (rightButtons) { - var rightButtonsOffset = GetValue$$(config, 'space.rightButtonsOffset', 0); - var rightButtonSpace = GetValue$$(config, 'space.rightButton', 0); + var rightButtonsOffset = GetValue$Z(config, 'space.rightButtonsOffset', 0); + var rightButtonSpace = GetValue$Z(config, 'space.rightButton', 0); rightButtonsSizer = new Buttons$1(scene, { groupName: 'right', background: rightButtonsBackground, @@ -49481,7 +49481,7 @@ space: { item: rightButtonSpace }, - align: GetValue$$(config, 'align.rightButtons', undefined), + align: GetValue$Z(config, 'align.rightButtons', undefined), click: clickConfig, eventEmitter: _this.eventEmitter }); @@ -49491,8 +49491,8 @@ _this.add(rightButtonsSizer, 2, 1, 'top', padding, false); } if (topButtons) { - var toptButtonsOffset = GetValue$$(config, 'space.topButtonsOffset', 0); - var topButtonSpace = GetValue$$(config, 'space.topButton', 0); + var toptButtonsOffset = GetValue$Z(config, 'space.topButtonsOffset', 0); + var topButtonSpace = GetValue$Z(config, 'space.topButton', 0); topButtonsSizer = new Buttons$1(scene, { groupName: 'top', background: topButtonsBackground, @@ -49502,7 +49502,7 @@ space: { item: topButtonSpace }, - align: GetValue$$(config, 'align.topButtons', undefined), + align: GetValue$Z(config, 'align.topButtons', undefined), click: clickConfig, eventEmitter: _this.eventEmitter }); @@ -49512,8 +49512,8 @@ _this.add(topButtonsSizer, 1, 0, 'left', padding, false); } if (bottomButtons) { - var bottomButtonsOffset = GetValue$$(config, 'space.bottomButtonsOffset', 0); - var bottomButtonSpace = GetValue$$(config, 'space.bottomButton', 0); + var bottomButtonsOffset = GetValue$Z(config, 'space.bottomButtonsOffset', 0); + var bottomButtonSpace = GetValue$Z(config, 'space.bottomButton', 0); bottomButtonsSizer = new Buttons$1(scene, { groupName: 'bottom', background: bottomButtonsBackground, @@ -49523,7 +49523,7 @@ space: { item: bottomButtonSpace }, - align: GetValue$$(config, 'align.bottomButtons', undefined), + align: GetValue$Z(config, 'align.bottomButtons', undefined), click: clickConfig, eventEmitter: _this.eventEmitter }); @@ -49770,7 +49770,7 @@ }(); Object.assign(Cell.prototype, DataMethods$2); - var GetValue$_ = Phaser.Utils.Objects.GetValue; + var GetValue$Y = Phaser.Utils.Objects.GetValue; var SpliceOne = Phaser.Utils.Array.SpliceOne; var Table = /*#__PURE__*/function () { function Table(parent, config) { @@ -49799,8 +49799,8 @@ } this.setDefaultCellHeight(cellHeight); this.setDefaultCellWidth(cellWidth); - this.initCells(GetValue$_(o, 'cellsCount', 0)); - this.setColumnCount(GetValue$_(o, 'columns', 1)); + this.initCells(GetValue$Y(o, 'cellsCount', 0)); + this.setColumnCount(GetValue$Y(o, 'columns', 1)); return this; } }, { @@ -50343,7 +50343,7 @@ } }; - var GetValue$Z = Phaser.Utils.Objects.GetValue; + var GetValue$X = Phaser.Utils.Objects.GetValue; var MASKUPDATEMODE = { update: 0, everyTick: 1 @@ -50354,9 +50354,9 @@ // No children mask return this; } - this.setMaskUpdateMode(GetValue$Z(config, 'updateMode', 0)); - this.enableChildrenMask(GetValue$Z(config, 'padding', 0)); - this.setMaskLayer(GetValue$Z(config, 'layer', undefined)); + this.setMaskUpdateMode(GetValue$X(config, 'updateMode', 0)); + this.enableChildrenMask(GetValue$X(config, 'padding', 0)); + this.setMaskLayer(GetValue$X(config, 'layer', undefined)); this.startMaskUpdate(); return this; }, @@ -50741,7 +50741,7 @@ var Group = Phaser.GameObjects.Group; var Set = Phaser.Structs.Set; - var GetValue$Y = Phaser.Utils.Objects.GetValue; + var GetValue$W = Phaser.Utils.Objects.GetValue; var GridTable$1 = /*#__PURE__*/function (_ContainerLite) { _inherits(GridTable, _ContainerLite); var _super = _createSuper(GridTable); @@ -50761,27 +50761,27 @@ _this.execeedBottomState = false; _this.execeedLeftState = false; _this.execeedRightState = false; - var reuseCellContainer = GetValue$Y(config, 'reuseCellContainer', false); + var reuseCellContainer = GetValue$W(config, 'reuseCellContainer', false); if (reuseCellContainer) { _this.cellContainersPool = new Group(scene); // Don't add Group into update list, I will destroy it manually } - var callback = GetValue$Y(config, 'cellVisibleCallback', null); + var callback = GetValue$W(config, 'cellVisibleCallback', null); if (callback !== null) { - var scope = GetValue$Y(config, 'cellVisibleCallbackScope', undefined); + var scope = GetValue$W(config, 'cellVisibleCallbackScope', undefined); _this.on('cellvisible', callback, scope); } - callback = GetValue$Y(config, 'cellInvisibleCallback', null); + callback = GetValue$W(config, 'cellInvisibleCallback', null); if (callback !== null) { - var scope = GetValue$Y(config, 'cellInvisibleCallbackScope', undefined); + var scope = GetValue$W(config, 'cellInvisibleCallbackScope', undefined); _this.on('cellinvisible', callback, scope); } - if (GetValue$Y(config, 'enableLayer', false)) { + if (GetValue$W(config, 'enableLayer', false)) { _this.enableLayer(); } - _this.setupChildrenMask(GetValue$Y(config, 'mask', undefined)); - _this.setScrollMode(GetValue$Y(config, 'scrollMode', 0)); - _this.setClampMode(GetValue$Y(config, 'clamplTableOXY', true)); + _this.setupChildrenMask(GetValue$W(config, 'mask', undefined)); + _this.setScrollMode(GetValue$W(config, 'scrollMode', 0)); + _this.setClampMode(GetValue$W(config, 'clamplTableOXY', true)); // Pre-process cell size var cellWidth, cellHeight, columns; @@ -50795,7 +50795,7 @@ // scroll x cellWidth = config.cellHeight; cellHeight = config.cellWidth; - columns = GetValue$Y(config, 'rows', config.columns); + columns = GetValue$W(config, 'rows', config.columns); } if (!columns) { columns = 1; // Default columns @@ -51277,9 +51277,9 @@ EmitCellEvent(this.eventEmitter, 'cell.out', table, cellIndex, undefined, pointer, event); }; - var GetValue$X = Phaser.Utils.Objects.GetValue; + var GetValue$V = Phaser.Utils.Objects.GetValue; var ClickCell = function ClickCell(table, tableConfig) { - var buttonConfig = GetValue$X(tableConfig, 'click', undefined); + var buttonConfig = GetValue$V(tableConfig, 'click', undefined); if (buttonConfig === false) { return; } else if (buttonConfig === undefined) { @@ -51292,9 +51292,9 @@ }, this); }; - var GetValue$W = Phaser.Utils.Objects.GetValue; + var GetValue$U = Phaser.Utils.Objects.GetValue; var TapCell = function TapCell(table, tableConfig) { - var tapConfig = GetValue$W(tableConfig, 'tap', undefined); + var tapConfig = GetValue$U(tableConfig, 'tap', undefined); if (tapConfig === false) { return; } @@ -51305,9 +51305,9 @@ }, this); }; - var GetValue$V = Phaser.Utils.Objects.GetValue; + var GetValue$T = Phaser.Utils.Objects.GetValue; var PressCell = function PressCell(table, tableConfig) { - var pressConfig = GetValue$V(tableConfig, 'press', undefined); + var pressConfig = GetValue$T(tableConfig, 'press', undefined); if (pressConfig === false) { return; } @@ -51319,9 +51319,9 @@ }, this); }; - var GetValue$U = Phaser.Utils.Objects.GetValue; + var GetValue$S = Phaser.Utils.Objects.GetValue; var SwipeCell = function SwipeCell(table, tableConfig) { - var swipeConfig = GetValue$U(tableConfig, 'swipe', undefined); + var swipeConfig = GetValue$S(tableConfig, 'swipe', undefined); if (swipeConfig === false) { return; } else if (swipeConfig === undefined) { @@ -51371,7 +51371,7 @@ } }; - var GetValue$T = Phaser.Utils.Objects.GetValue; + var GetValue$R = Phaser.Utils.Objects.GetValue; var GridTable = /*#__PURE__*/function (_Scrollable) { _inherits(GridTable, _Scrollable); var _super = _createSuper(GridTable); @@ -51384,14 +51384,14 @@ // Create grid table core var scrollMode = GetScrollMode(config); - var tableConfig = GetValue$T(config, 'table', undefined); + var tableConfig = GetValue$R(config, 'table', undefined); if (tableConfig === undefined) { tableConfig = {}; } tableConfig.scrollMode = scrollMode === 2 ? 0 : scrollMode; - tableConfig.clamplTableOXY = GetValue$T(config, 'clamplChildOY', false); - var tableWidth = GetValue$T(tableConfig, 'width', undefined); - var tableHeight = GetValue$T(tableConfig, 'height', undefined); + tableConfig.clamplTableOXY = GetValue$R(config, 'clamplChildOY', false); + var tableWidth = GetValue$R(tableConfig, 'width', undefined); + var tableHeight = GetValue$R(tableConfig, 'height', undefined); var table = new GridTable$1(scene, 0, 0, tableWidth, tableHeight, tableConfig); scene.add.existing(table); // Important: Add to display list for touch detecting var expandWidth, expandHeight; @@ -51415,16 +51415,16 @@ expandWidth: expandWidth, expandHeight: expandHeight }; - var spaceConfig = GetValue$T(config, 'space', undefined); + var spaceConfig = GetValue$R(config, 'space', undefined); if (spaceConfig) { - spaceConfig.child = GetValue$T(spaceConfig, 'table', 0); + spaceConfig.child = GetValue$R(spaceConfig, 'table', 0); } _this = _super.call(this, scene, config); _this.addChildrenMap('table', table); _this.addChildrenMap('tableLayer', table.maskLayer); - _this.eventEmitter = GetValue$T(config, 'eventEmitter', _assertThisInitialized(_this)); - var callback = GetValue$T(config, 'createCellContainerCallback', NOOP); - var scope = GetValue$T(config, 'createCellContainerCallbackScope', undefined); + _this.eventEmitter = GetValue$R(config, 'eventEmitter', _assertThisInitialized(_this)); + var callback = GetValue$R(config, 'createCellContainerCallback', NOOP); + var scope = GetValue$R(config, 'createCellContainerCallbackScope', undefined); _this.setCreateCellContainerCallback(callback, scope); TableOnCellVisible.call(_assertThisInitialized(_this), table); _this.resizeControllerFlag = false; @@ -51432,10 +51432,10 @@ table.on(eventName, function () { this.resizeControllerFlag = true; }, _assertThisInitialized(_this)); - if (GetValue$T(tableConfig, 'interactive', true)) { + if (GetValue$R(tableConfig, 'interactive', true)) { TableSetInteractive.call(_assertThisInitialized(_this), table, tableConfig); } - _this.setItems(GetValue$T(config, 'items', [])); + _this.setItems(GetValue$R(config, 'items', [])); scene.game.events.on('poststep', _this.onPostStep, _assertThisInitialized(_this)); return _this; } @@ -51648,7 +51648,7 @@ return background; }; - var CreateButtons$2 = function CreateButtons(scene, items, callback, scope) { + var CreateButtons$3 = function CreateButtons(scene, items, callback, scope) { var item; var buttons = [], button; @@ -51738,7 +51738,7 @@ } }; - var GetValue$S = Phaser.Utils.Objects.GetValue; + var GetValue$Q = Phaser.Utils.Objects.GetValue; var Menu = /*#__PURE__*/function (_Buttons) { _inherits(Menu, _Buttons); var _super = _createSuper(Menu); @@ -51759,17 +51759,17 @@ var parentMenu = config._parentMenu; var parentButton = config._parentButton; // Popup, root menu can be static, sub-menus are always popup. - var popUp = GetValue$S(config, 'popup', true); + var popUp = GetValue$Q(config, 'popup', true); // Items - var items = GetValue$S(config, 'items', undefined); + var items = GetValue$Q(config, 'items', undefined); // Background - var createBackgroundCallback = GetValue$S(config, 'createBackgroundCallback', undefined); - var createBackgroundCallbackScope = GetValue$S(config, 'createBackgroundCallbackScope', undefined); + var createBackgroundCallback = GetValue$Q(config, 'createBackgroundCallback', undefined); + var createBackgroundCallbackScope = GetValue$Q(config, 'createBackgroundCallbackScope', undefined); config.background = CreateBackground$1(scene, items, createBackgroundCallback, createBackgroundCallbackScope); // Buttons - var createButtonCallback = GetValue$S(config, 'createButtonCallback', undefined); - var createButtonCallbackScope = GetValue$S(config, 'createButtonCallbackScope', undefined); - config.buttons = CreateButtons$2(scene, items, createButtonCallback, createButtonCallbackScope); + var createButtonCallback = GetValue$Q(config, 'createButtonCallback', undefined); + var createButtonCallbackScope = GetValue$Q(config, 'createButtonCallbackScope', undefined); + config.buttons = CreateButtons$3(scene, items, createButtonCallback, createButtonCallbackScope); _this = _super.call(this, scene, config); _this.type = 'rexMenu'; _this.items = items; @@ -51792,7 +51792,7 @@ // Side of submenu _this.subMenuSide = [_this.y < bounds.centerY ? SUBMENU_DOWN : SUBMENU_UP, _this.x < bounds.centerX ? SUBMENU_RIGHT : SUBMENU_LEFT]; // Overwrite subMenuSide value if given - var subMenuSide = GetValue$S(config, 'subMenuSide', undefined); + var subMenuSide = GetValue$Q(config, 'subMenuSide', undefined); if (subMenuSide !== undefined) { if (typeof subMenuSide === 'string') { subMenuSide = SubMenuSideMode[subMenuSide]; @@ -51800,26 +51800,26 @@ _this.subMenuSide[_this.orientation] = subMenuSide; } // ToggleOrientation mode - _this.toggleOrientation = GetValue$S(config, 'toggleOrientation', false); + _this.toggleOrientation = GetValue$Q(config, 'toggleOrientation', false); // Expand mode - _this.expandEventName = GetValue$S(config, 'expandEvent', 'button.click'); + _this.expandEventName = GetValue$Q(config, 'expandEvent', 'button.click'); // Transition - _this.easeIn = ParseEaseConfig(_assertThisInitialized(_this), GetValue$S(config, 'easeIn', 0)); - _this.easeOut = ParseEaseConfig(_assertThisInitialized(_this), GetValue$S(config, 'easeOut', 0)); - _this.setTransitInCallback(GetValue$S(config, 'transitIn')); - _this.setTransitOutCallback(GetValue$S(config, 'transitOut')); + _this.easeIn = ParseEaseConfig(_assertThisInitialized(_this), GetValue$Q(config, 'easeIn', 0)); + _this.easeOut = ParseEaseConfig(_assertThisInitialized(_this), GetValue$Q(config, 'easeOut', 0)); + _this.setTransitInCallback(GetValue$Q(config, 'transitIn')); + _this.setTransitOutCallback(GetValue$Q(config, 'transitOut')); // Callbacks _this.createBackgroundCallback = createBackgroundCallback; _this.createBackgroundCallbackScope = createBackgroundCallbackScope; _this.createButtonCallback = createButtonCallback; _this.createButtonCallbackScope = createButtonCallbackScope; // Children key - _this.childrenKey = GetValue$S(config, 'childrenKey', 'children'); + _this.childrenKey = GetValue$Q(config, 'childrenKey', 'children'); // Event flag _this._isPassedEvent = false; // pointerdown-outside-collapse - _this.pointerDownOutsideCollapsing = GetValue$S(config, 'pointerDownOutsideCollapsing', true); + _this.pointerDownOutsideCollapsing = GetValue$Q(config, 'pointerDownOutsideCollapsing', true); if (_this.pointerDownOutsideCollapsing) { scene.input.on('pointerdown', _this.onPointerDownOutside, _assertThisInitialized(_this)); } @@ -52127,29 +52127,29 @@ var GetValueFromAliasKeys = function GetValueFromAliasKeys(source, key0, key1, key2, defaultValue) { if (HasValue(source, key0)) { - return GetValue$3n(source, key0); + return GetValue$3l(source, key0); } else if (key1 && HasValue(source, key1)) { - return GetValue$3n(source, key1); + return GetValue$3l(source, key1); } else if (key2 && HasValue(source, key2)) { - return GetValue$3n(source, key2); + return GetValue$3l(source, key2); } else { return defaultValue; } }; - var GetValue$R = Phaser.Utils.Objects.GetValue; + var GetValue$P = Phaser.Utils.Objects.GetValue; var SetPosition = function SetPosition(gameObject, config) { - var expandDirection = GetValue$R(config, 'expandDirection', undefined); + var expandDirection = GetValue$P(config, 'expandDirection', undefined); if (typeof expandDirection === 'string') { expandDirection = ExpandDirections[expandDirection]; } var alignTargetX = GetValueFromAliasKeys(config, 'alignTarget', 'alignTargetX'); - var alignTargetY = GetValue$R(config, 'alignTargetY', alignTargetX); - var alignOffsetX = GetValue$R(config, 'alignOffsetX', 0); - var alignOffsetY = GetValue$R(config, 'alignOffsetY', 0); - var alignSide = GetValue$R(config, 'alignSide', ''); + var alignTargetY = GetValue$P(config, 'alignTargetY', alignTargetX); + var alignOffsetX = GetValue$P(config, 'alignOffsetX', 0); + var alignOffsetY = GetValue$P(config, 'alignOffsetY', 0); + var alignSide = GetValue$P(config, 'alignSide', ''); var alignRight = alignSide.includes('right'); - var positionBounds = GetValue$R(config, 'bounds'); + var positionBounds = GetValue$P(config, 'bounds'); // Expand direction var isExpandDown = expandDirection === 0; @@ -52181,7 +52181,7 @@ up: 1 }; - var GetValue$Q = Phaser.Utils.Objects.GetValue; + var GetValue$O = Phaser.Utils.Objects.GetValue; var DropDown = /*#__PURE__*/function (_OpenCloseTransition) { _inherits(DropDown, _OpenCloseTransition); var _super = _createSuper(DropDown); @@ -52215,8 +52215,8 @@ } // Close conditions: - var touchOutsideClose = GetValue$Q(config, 'touchOutsideClose', false); - var anyTouchClose = GetValue$Q(config, 'anyTouchClose', false); + var touchOutsideClose = GetValue$O(config, 'touchOutsideClose', false); + var anyTouchClose = GetValue$O(config, 'anyTouchClose', false); if (anyTouchClose) { touchOutsideClose = false; } @@ -52363,7 +52363,7 @@ }; Object.assign(Methods$2, methods$9); - var GetValue$P = Phaser.Utils.Objects.GetValue; + var GetValue$N = Phaser.Utils.Objects.GetValue; var DropDownList = /*#__PURE__*/function (_Label) { _inherits(DropDownList, _Label); var _super = _createSuper(DropDownList); @@ -52373,27 +52373,27 @@ _this = _super.call(this, scene, config); _this.type = 'rexDropDownList'; _this.timer = undefined; - _this.setOptions(GetValue$P(config, 'options')); - var listConfig = GetValue$P(config, 'list'); - _this.setWrapEnable(GetValue$P(listConfig, 'wrap', false)); - _this.setCreateButtonCallback(GetValue$P(listConfig, 'createButtonCallback')); - _this.setCreateListBackgroundCallback(GetValue$P(listConfig, 'createBackgroundCallback')); - _this.setButtonClickCallback(GetValue$P(listConfig, 'onButtonClick')); - _this.setButtonOverCallback(GetValue$P(listConfig, 'onButtonOver')); - _this.setButtonOutCallback(GetValue$P(listConfig, 'onButtonOut')); - _this.setListExpandDirection(GetValue$P(listConfig, 'expandDirection')); - _this.setListEaseInDuration(GetValue$P(listConfig, 'easeIn', 500)); - _this.setListEaseOutDuration(GetValue$P(listConfig, 'easeOut', 100)); - _this.setListTransitInCallback(GetValue$P(listConfig, 'transitIn')); - _this.settListTransitOutCallback(GetValue$P(listConfig, 'transitOut')); - _this.setListSize(GetValue$P(listConfig, 'width'), GetValue$P(listConfig, 'height')); - _this.setListAlignmentMode(GetValue$P(listConfig, 'alignParent', 'text')); - _this.setListAlignmentSide(GetValue$P(listConfig, 'alignSide', '')); - _this.setListBounds(GetValue$P(listConfig, 'bounds')); - _this.setListSpace(GetValue$P(listConfig, 'space')); - _this.setListDraggable(GetValue$P(listConfig, 'draggable', false)); - _this.setValueChangeCallback(GetValue$P(config, 'setValueCallback'), GetValue$P(config, 'setValueCallbackScope')); - _this.setValue(GetValue$P(config, 'value')); + _this.setOptions(GetValue$N(config, 'options')); + var listConfig = GetValue$N(config, 'list'); + _this.setWrapEnable(GetValue$N(listConfig, 'wrap', false)); + _this.setCreateButtonCallback(GetValue$N(listConfig, 'createButtonCallback')); + _this.setCreateListBackgroundCallback(GetValue$N(listConfig, 'createBackgroundCallback')); + _this.setButtonClickCallback(GetValue$N(listConfig, 'onButtonClick')); + _this.setButtonOverCallback(GetValue$N(listConfig, 'onButtonOver')); + _this.setButtonOutCallback(GetValue$N(listConfig, 'onButtonOut')); + _this.setListExpandDirection(GetValue$N(listConfig, 'expandDirection')); + _this.setListEaseInDuration(GetValue$N(listConfig, 'easeIn', 500)); + _this.setListEaseOutDuration(GetValue$N(listConfig, 'easeOut', 100)); + _this.setListTransitInCallback(GetValue$N(listConfig, 'transitIn')); + _this.settListTransitOutCallback(GetValue$N(listConfig, 'transitOut')); + _this.setListSize(GetValue$N(listConfig, 'width'), GetValue$N(listConfig, 'height')); + _this.setListAlignmentMode(GetValue$N(listConfig, 'alignParent', 'text')); + _this.setListAlignmentSide(GetValue$N(listConfig, 'alignSide', '')); + _this.setListBounds(GetValue$N(listConfig, 'bounds')); + _this.setListSpace(GetValue$N(listConfig, 'space')); + _this.setListDraggable(GetValue$N(listConfig, 'draggable', false)); + _this.setValueChangeCallback(GetValue$N(config, 'setValueCallback'), GetValue$N(config, 'setValueCallbackScope')); + _this.setValue(GetValue$N(config, 'value')); _this.onClick(_this.toggleListPanel, _assertThisInitialized(_this)); return _this; } @@ -52723,7 +52723,7 @@ }; Object.assign(Methods$1, SetContentMethods, GetPageMethods, ShowMethods); - var GetValue$O = Phaser.Utils.Objects.GetValue; + var GetValue$M = Phaser.Utils.Objects.GetValue; var Clamp$2 = Phaser.Math.Clamp; var TextPage = /*#__PURE__*/function (_ComponentBase) { _inherits(TextPage, _ComponentBase); @@ -52751,11 +52751,11 @@ _createClass(TextPage, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.setMaxLines(GetValue$O(o, 'maxLines', undefined)); - this.setPageBreak(GetValue$O(o, 'pageBreak', '\f\n')); - this.setText(GetValue$O(o, 'text', '')); - this.setStartLineIndex(GetValue$O(o, 'start', 0)); - this.setPageIndex(GetValue$O(o, 'page', -1)); + this.setMaxLines(GetValue$M(o, 'maxLines', undefined)); + this.setPageBreak(GetValue$M(o, 'pageBreak', '\f\n')); + this.setText(GetValue$M(o, 'text', '')); + this.setStartLineIndex(GetValue$M(o, 'start', 0)); + this.setPageIndex(GetValue$M(o, 'page', -1)); return this; } }, { @@ -52898,7 +52898,7 @@ }; var GetFastValue = Phaser.Utils.Objects.GetFastValue; - var GetValue$N = Phaser.Utils.Objects.GetValue; + var GetValue$L = Phaser.Utils.Objects.GetValue; var TextTyping = /*#__PURE__*/function (_ComponentBase) { _inherits(TextTyping, _ComponentBase); var _super = _createSuper(TextTyping); @@ -52915,9 +52915,9 @@ _createClass(TextTyping, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.setTextWrapEnable(GetValue$N(o, 'wrap', false)); - this.setTypeMode(GetValue$N(o, 'typeMode', 0)); - this.setTypingSpeed(GetValue$N(o, 'speed', 333)); + this.setTextWrapEnable(GetValue$L(o, 'wrap', false)); + this.setTypeMode(GetValue$L(o, 'typeMode', 0)); + this.setTypingSpeed(GetValue$L(o, 'speed', 333)); this.setTextCallback = GetFastValue(o, 'setTextCallback', null); this.setTextCallbackScope = GetFastValue(o, 'setTextCallbackScope', null); this.setTypingContent(GetFastValue(o, 'text', '')); @@ -53231,7 +53231,7 @@ 'sides-to-middle': 3 }; - var GetValue$M = Phaser.Utils.Objects.GetValue; + var GetValue$K = Phaser.Utils.Objects.GetValue; var TextBoxBase = function TextBoxBase(GOClass, type) { if (type === undefined) { type = 'rexTextBox'; @@ -53247,8 +53247,8 @@ // childrenMap must have 'text' element var text = _this.childrenMap.text; - _this.page = new TextPage(text, GetValue$M(config, 'page', undefined)); - _this.typing = new TextTyping(text, GetValue$M(config, 'typing', config.type)); + _this.page = new TextPage(text, GetValue$K(config, 'page', undefined)); + _this.typing = new TextTyping(text, GetValue$K(config, 'typing', config.type)); _this.typing.on('complete', _this.onPageEnd, _assertThisInitialized(_this)).on('type', _this.onType, _assertThisInitialized(_this)).on('typechar', _this.onTypeChar, _assertThisInitialized(_this)); _this.textWidth = text.width; _this.textHeight = text.height; @@ -53409,7 +53409,7 @@ }); SetValue(window, 'RexPlugins.UI.TextBox', TextBox); - var GetValue$L = Phaser.Utils.Objects.GetValue; + var GetValue$J = Phaser.Utils.Objects.GetValue; var NumberBar = /*#__PURE__*/function (_Sizer) { _inherits(NumberBar, _Sizer); var _super = _createSuper(NumberBar); @@ -53421,15 +53421,15 @@ _this.type = 'rexNumberBar'; // Add elements - var background = GetValue$L(config, 'background', undefined); - var icon = GetValue$L(config, 'icon', undefined); - var iconMask = GetValue$L(config, 'iconMask', undefined); - var sliderConfig = GetValue$L(config, 'slider', undefined); - var text = GetValue$L(config, 'text', undefined); + var background = GetValue$J(config, 'background', undefined); + var icon = GetValue$J(config, 'icon', undefined); + var iconMask = GetValue$J(config, 'iconMask', undefined); + var sliderConfig = GetValue$J(config, 'slider', undefined); + var text = GetValue$J(config, 'text', undefined); // Space - var iconSpace = GetValue$L(config, 'space.icon', 0); - var sliderSpace = GetValue$L(config, 'space.slider', 0); + var iconSpace = GetValue$J(config, 'space.icon', 0); + var sliderSpace = GetValue$J(config, 'space.slider', 0); if (background) { _this.addBackground(background); } @@ -53484,10 +53484,10 @@ } var proportion; if (_this.orientation === 0) { - var sliderWidth = GetValue$L(sliderConfig, 'width', undefined); + var sliderWidth = GetValue$J(sliderConfig, 'width', undefined); proportion = sliderWidth === undefined ? 1 : 0; } else { - var sliderHeight = GetValue$L(sliderConfig, 'height', undefined); + var sliderHeight = GetValue$J(sliderConfig, 'height', undefined); proportion = sliderHeight === undefined ? 1 : 0; } _this.add(slider, { @@ -53504,13 +53504,13 @@ _this.addChildrenMap('iconMask', iconMask); _this.addChildrenMap('slider', slider); _this.addChildrenMap('text', text); - var callback = GetValue$L(config, 'valuechangeCallback', null); + var callback = GetValue$J(config, 'valuechangeCallback', null); if (callback !== null) { - var scope = GetValue$L(config, 'valuechangeCallbackScope', undefined); + var scope = GetValue$J(config, 'valuechangeCallbackScope', undefined); _this.on('valuechange', callback, scope); } - _this.setEnable(GetValue$L(config, 'enable', undefined)); - _this.setValue(GetValue$L(config, 'value', 0)); + _this.setEnable(GetValue$J(config, 'enable', undefined)); + _this.setValue(GetValue$J(config, 'value', 0)); return _this; } _createClass(NumberBar, [{ @@ -53658,7 +53658,7 @@ }); SetValue(window, 'RexPlugins.UI.ScrollBar', ScrollBar); - var GetValue$K = Phaser.Utils.Objects.GetValue; + var GetValue$I = Phaser.Utils.Objects.GetValue; var BadgeKeys = { leftTop: 'left-top', centerTop: 'center-top', @@ -53681,14 +53681,14 @@ _this.type = 'rexBadge'; // Add elements - var background = GetValue$K(config, 'background', undefined); + var background = GetValue$I(config, 'background', undefined); if (background) { _this.addBackground(background); } _this.addChildrenMap('background', background); // Base item - var main = GetValue$K(config, 'main', undefined); + var main = GetValue$I(config, 'main', undefined); if (main) { _this.add(main, { key: 'main', @@ -53700,7 +53700,7 @@ // Badges for (var key in BadgeKeys) { - var badge = GetValue$K(config, key, undefined); + var badge = GetValue$I(config, key, undefined); if (badge) { _this.add(badge, { key: key, @@ -53786,7 +53786,7 @@ }; Object.assign(methods$8, AddChildMethods); - var GetValue$J = Phaser.Utils.Objects.GetValue; + var GetValue$H = Phaser.Utils.Objects.GetValue; var Pages = /*#__PURE__*/function (_OverlapSizer) { _inherits(Pages, _OverlapSizer); var _super = _createSuper(Pages); @@ -53798,8 +53798,8 @@ _this.childrenMap = _this.sizerChildren; _this._previousKey = undefined; _this._currentKey = undefined; - _this.setSwapMode(GetValue$J(config, 'swapMode', 0)); - _this.setFadeInDuration(GetValue$J(config, 'fadeIn', 0)); + _this.setSwapMode(GetValue$H(config, 'swapMode', 0)); + _this.setFadeInDuration(GetValue$H(config, 'fadeIn', 0)); return _this; } _createClass(Pages, [{ @@ -53939,7 +53939,7 @@ }; var IsPlainObject$a = Phaser.Utils.Objects.IsPlainObject; - var GetValue$I = Phaser.Utils.Objects.GetValue; + var GetValue$G = Phaser.Utils.Objects.GetValue; var GenerateGridVerts = Phaser.Geom.Mesh.GenerateGridVerts; var RadToDeg$2 = Phaser.Math.RadToDeg; var DegToRad$3 = Phaser.Math.DegToRad; @@ -53953,19 +53953,19 @@ _classCallCheck(this, Image); if (IsPlainObject$a(x)) { config = x; - x = GetValue$I(config, 'x', 0); - y = GetValue$I(config, 'y', 0); - key = GetValue$I(config, 'key', null); - frame = GetValue$I(config, 'frame', null); + x = GetValue$G(config, 'x', 0); + y = GetValue$G(config, 'y', 0); + key = GetValue$G(config, 'key', null); + frame = GetValue$G(config, 'frame', null); } _this = _super.call(this, scene, x, y, key, frame); _this.type = 'rexPerspectiveImage'; _this.setSizeToFrame(); _this.resetPerspective(); _this.panZ(PanZ); - _this.hideCCW = GetValue$I(config, 'hideCCW', true); - var gridWidth = GetValue$I(config, 'gridWidth', 0); - var gridHeight = GetValue$I(config, 'gridHeight', gridWidth); + _this.hideCCW = GetValue$G(config, 'hideCCW', true); + var gridWidth = GetValue$G(config, 'gridWidth', 0); + var gridHeight = GetValue$G(config, 'gridHeight', gridWidth); _this.resetVerts(gridWidth, gridHeight); _this.prevFrame = _this.frame; return _this; @@ -54147,7 +54147,7 @@ }; var IsPlainObject$9 = Phaser.Utils.Objects.IsPlainObject; - var GetValue$H = Phaser.Utils.Objects.GetValue; + var GetValue$F = Phaser.Utils.Objects.GetValue; var RenderTexture = /*#__PURE__*/function (_Image) { _inherits(RenderTexture, _Image); var _super = _createSuper(RenderTexture); @@ -54156,10 +54156,10 @@ _classCallCheck(this, RenderTexture); if (IsPlainObject$9(x)) { config = x; - x = GetValue$H(config, 'x', 0); - y = GetValue$H(config, 'y', 0); - width = GetValue$H(config, 'width', 32); - height = GetValue$H(config, 'height', 32); + x = GetValue$F(config, 'x', 0); + y = GetValue$F(config, 'y', 0); + width = GetValue$F(config, 'width', 32); + height = GetValue$F(config, 'height', 32); } // dynamic-texture -> quad-image @@ -54468,7 +54468,7 @@ } }; - var GetValue$G = Phaser.Utils.Objects.GetValue; + var GetValue$E = Phaser.Utils.Objects.GetValue; var Linear$2 = Phaser.Math.Linear; var Flip$1 = /*#__PURE__*/function (_EaseValueTaskBase) { _inherits(Flip, _EaseValueTaskBase); @@ -54488,9 +54488,9 @@ key: "resetFromJSON", value: function resetFromJSON(o) { _get(_getPrototypeOf(Flip.prototype), "resetFromJSON", this).call(this, o); - this.setEase(GetValue$G(o, 'ease', 'Cubic')); - this.setFrontToBackDirection(GetValue$G(o, 'frontToBack', 0)); - this.setBackToFrontDirection(GetValue$G(o, 'backToFront', 1)); + this.setEase(GetValue$E(o, 'ease', 'Cubic')); + this.setFrontToBackDirection(GetValue$E(o, 'frontToBack', 0)); + this.setBackToFrontDirection(GetValue$E(o, 'backToFront', 1)); return this; } }, { @@ -54598,7 +54598,7 @@ }; var IsPlainObject$7 = Phaser.Utils.Objects.IsPlainObject; - var GetValue$F = Phaser.Utils.Objects.GetValue; + var GetValue$D = Phaser.Utils.Objects.GetValue; var FaceNames = ['back', 'front']; var Card = /*#__PURE__*/function (_FaceContainer) { _inherits(Card, _FaceContainer); @@ -54608,14 +54608,14 @@ _classCallCheck(this, Card); if (IsPlainObject$7(x)) { config = x; - x = GetValue$F(config, 'x', 0); - y = GetValue$F(config, 'y', 0); + x = GetValue$D(config, 'x', 0); + y = GetValue$D(config, 'y', 0); } var faces = CreateFaces(scene, config, FaceNames); var backFace = faces.back; var frontFace = faces.front; - var width = GetValue$F(config, 'width'); - var height = GetValue$F(config, 'height'); + var width = GetValue$D(config, 'width'); + var height = GetValue$D(config, 'height'); if (width === undefined || height === undefined) { if (width === undefined) { var frontFaceWidth = frontFace ? frontFace.width : 0; @@ -54636,13 +54636,13 @@ ForEachFace(faces, function (face, name) { this["".concat(name, "Face")] = face; }, _assertThisInitialized(_this)); - var flipConfig = GetValue$F(config, 'flip', undefined); + var flipConfig = GetValue$D(config, 'flip', undefined); if (flipConfig !== false) { _this.flip = new Flip$1(_assertThisInitialized(_this), flipConfig); } - _this.setOrientation(GetValue$F(config, 'orientation', 0)); + _this.setOrientation(GetValue$D(config, 'orientation', 0)); LayoutFaces(_assertThisInitialized(_this), faces); - _this.setFace(GetValue$F(config, 'face', 0)); + _this.setFace(GetValue$D(config, 'face', 0)); return _this; } _createClass(Card, [{ @@ -54765,11 +54765,11 @@ Phaser.Utils.Objects.GetValue; Phaser.Math.Wrap; - var GetValue$E = Phaser.Utils.Objects.GetValue; + var GetValue$C = Phaser.Utils.Objects.GetValue; var Init = function Init(parentContainer, rtOwner, config) { rtOwner.visibleSibling = []; rtOwner.isRunning = false; - rtOwner.useParentBounds = GetValue$E(config, 'useParentBounds', false); + rtOwner.useParentBounds = GetValue$C(config, 'useParentBounds', false); rtOwner.setPosition(parentContainer.x, parentContainer.y).setVisible(false); parentContainer.pin(rtOwner); }; @@ -54885,10 +54885,10 @@ return ContainerPerspective; }(MeshRenderTextureBase(RenderTexture)); - var GetValue$D = Phaser.Utils.Objects.GetValue; + var GetValue$B = Phaser.Utils.Objects.GetValue; var CreatePerspectiveCardMesh = function CreatePerspectiveCardMesh(config) { var scene = this.scene; - this.setSnapshotPadding(GetValue$D(config, 'snapshotPadding', 0)); + this.setSnapshotPadding(GetValue$B(config, 'snapshotPadding', 0)); config = Clone$1(config); // Remove size config delete config.width; @@ -54973,7 +54973,7 @@ } }; - var GetValue$C = Phaser.Utils.Objects.GetValue; + var GetValue$A = Phaser.Utils.Objects.GetValue; var PerspectiveCard = /*#__PURE__*/function (_OverlapSizer) { _inherits(PerspectiveCard, _OverlapSizer); var _super = _createSuper(PerspectiveCard); @@ -54985,13 +54985,13 @@ // Layout faces var backFace = config.back; - var backFaceExpand = GetValue$C(config, 'expand.back', true); + var backFaceExpand = GetValue$A(config, 'expand.back', true); _this.add(backFace, { key: 'back', expand: backFaceExpand }); var frontFace = config.front; - var frontFaceExpand = GetValue$C(config, 'expand.front', true); + var frontFaceExpand = GetValue$A(config, 'expand.front', true); _this.add(frontFace, { key: 'front', expand: frontFaceExpand @@ -55163,14 +55163,14 @@ }; var IsPlainObject$6 = Phaser.Utils.Objects.IsPlainObject; - var GetValue$B = Phaser.Utils.Objects.GetValue; + var GetValue$z = Phaser.Utils.Objects.GetValue; var UUID = Phaser.Utils.String.UUID; var AddPage = function AddPage(key, tabGameObject, pageGameObject) { if (IsPlainObject$6(key)) { var config = key; - key = GetValue$B(config, 'key'); - tabGameObject = GetValue$B(config, 'tab'); - pageGameObject = GetValue$B(config, 'page'); + key = GetValue$z(config, 'key'); + tabGameObject = GetValue$z(config, 'tab'); + pageGameObject = GetValue$z(config, 'page'); } if (!key) { key = UUID(); @@ -55268,7 +55268,7 @@ }; Object.assign(methods$7, SwapPageMethods, RemovePageMethods); - var GetValue$A = Phaser.Utils.Objects.GetValue; + var GetValue$y = Phaser.Utils.Objects.GetValue; var SizerAdd = Sizer.prototype.add; var TabPages$1 = /*#__PURE__*/function (_Sizer) { _inherits(TabPages, _Sizer); @@ -55279,23 +55279,23 @@ if (config === undefined) { config = {}; } - var tabsPosition = GetValue$A(config, 'tabPosition', 'top'); + var tabsPosition = GetValue$y(config, 'tabPosition', 'top'); var sizerOrientation = tabsPosition === 'left' || tabsPosition === 'right' ? 'x' : 'y'; config.orientation = sizerOrientation; _this = _super.call(this, scene, config); _this.type = 'rexTabPages'; // Add elements - var background = GetValue$A(config, 'background', undefined); + var background = GetValue$y(config, 'background', undefined); if (background) { _this.addBackground(background); } - var pagesConfig = GetValue$A(config, 'pages'); + var pagesConfig = GetValue$y(config, 'pages'); var pages = new Pages(scene, pagesConfig); scene.add.existing(pages); var isHorizontalTabs = sizerOrientation === 'y'; - var wrapTabs = isHorizontalTabs ? GetValue$A(config, 'wrapTabs', false) : false; - var tabsConfig = GetValue$A(config, 'tabs', undefined); + var wrapTabs = isHorizontalTabs ? GetValue$y(config, 'wrapTabs', false) : false; + var tabsConfig = GetValue$y(config, 'tabs', undefined); if (tabsConfig === undefined) { tabsConfig = {}; } @@ -55304,8 +55304,8 @@ tabsConfig.buttonsType = 'radio'; var tabs = new ButtonsClass(scene, tabsConfig); scene.add.existing(tabs); - var tabsExpand = wrapTabs ? true : GetValue$A(config, 'expand.tabs', false); - var tabAlign = GetValue$A(config, 'align.tabs', 'left'); + var tabsExpand = wrapTabs ? true : GetValue$y(config, 'expand.tabs', false); + var tabAlign = GetValue$y(config, 'align.tabs', 'left'); switch (tabsPosition) { case 'top': case 'left': @@ -55498,7 +55498,7 @@ } }; - var GetValue$z = Phaser.Utils.Objects.GetValue; + var GetValue$x = Phaser.Utils.Objects.GetValue; var Folder$1 = /*#__PURE__*/function (_Sizer) { _inherits(Folder, _Sizer); var _super = _createSuper(Folder); @@ -55526,15 +55526,15 @@ // title var defaultAlign = _this.orientation === 1 ? 'left' : 'top'; - var align = GetValue$z(config, 'align.title', defaultAlign); - var expand = GetValue$z(config, 'expand.title', true); + var align = GetValue$x(config, 'align.title', defaultAlign); + var expand = GetValue$x(config, 'expand.title', true); _this.add(title, { proportion: 0, align: align, expand: expand }); - var toggleByTarget = GetValue$z(config, 'toggleByTarget', undefined); - var toggleClickConfig = GetValue$z(config, 'toggleClickConfig'); + var toggleByTarget = GetValue$x(config, 'toggleByTarget', undefined); + var toggleClickConfig = GetValue$x(config, 'toggleClickConfig'); if (toggleByTarget === undefined) { toggleByTarget = title; } @@ -55546,13 +55546,13 @@ // child _this.childTransition = new Transition(child); - var customOrigin = GetValue$z(config, 'customChildOrigin', false); + var customOrigin = GetValue$x(config, 'customChildOrigin', false); if (!customOrigin) { var origin = !_this.rtl ? 0 : 1; child.setOrigin(origin); } - var align = GetValue$z(config, 'align.child', 'left'); - var expand = GetValue$z(config, 'expand.child', true); + var align = GetValue$x(config, 'align.child', 'left'); + var expand = GetValue$x(config, 'expand.child', true); var proportion = expand ? 1 : 0; _this.add(child, { proportion: proportion, @@ -55563,10 +55563,10 @@ _this.addChildrenMap('child', child); _this.addChildrenMap('background', background); var transitionConfig = config.transition; - _this.setTransitionDuration(GetValue$z(transitionConfig, 'duration', 200)); - _this.setExpandCallback(GetValue$z(transitionConfig, 'expandCallback', undefined)); - _this.setCollapseCallback(GetValue$z(transitionConfig, 'collapseCallback', undefined)); - _this.reLayoutTarget = GetValue$z(config, 'reLayoutTarget', undefined); + _this.setTransitionDuration(GetValue$x(transitionConfig, 'duration', 200)); + _this.setExpandCallback(GetValue$x(transitionConfig, 'expandCallback', undefined)); + _this.setCollapseCallback(GetValue$x(transitionConfig, 'collapseCallback', undefined)); + _this.reLayoutTarget = GetValue$x(config, 'reLayoutTarget', undefined); var onExpandStart = config.onExpandStart; if (onExpandStart) { _this.on('expand.start', onExpandStart); @@ -55662,8 +55662,8 @@ } }; - var GetValue$y = Phaser.Utils.Objects.GetValue; - var TextAreaInput$1 = /*#__PURE__*/function (_Scrollable) { + var GetValue$w = Phaser.Utils.Objects.GetValue; + var TextAreaInput = /*#__PURE__*/function (_Scrollable) { _inherits(TextAreaInput, _Scrollable); var _super = _createSuper(TextAreaInput); function TextAreaInput(scene, config) { @@ -55674,7 +55674,7 @@ } // Create inputText - var inputTextConfig = GetValue$y(config, 'text'); + var inputTextConfig = GetValue$w(config, 'text'); var inputText; if (IsGameObject(inputTextConfig)) { inputText = inputTextConfig; @@ -55706,9 +55706,9 @@ expandWidth: expandInputTextWidth, expandHeight: expandInputTextHeight }; - var spaceConfig = GetValue$y(config, 'space', undefined); + var spaceConfig = GetValue$w(config, 'space', undefined); if (spaceConfig) { - spaceConfig.child = GetValue$y(spaceConfig, 'text', 0); + spaceConfig.child = GetValue$w(spaceConfig, 'text', 0); } config.scroller = false; // No scroller supported _this = _super.call(this, scene, config); @@ -55739,7 +55739,7 @@ }, _assertThisInitialized(_this)); // Set initial text if given - var content = GetValue$y(config, 'content', undefined); + var content = GetValue$w(config, 'content', undefined); if (content) { _this.setText(content); } @@ -55793,14 +55793,14 @@ }]); return TextAreaInput; }(Scrollable); - Object.assign(TextAreaInput$1.prototype, SetTextMethods, ScrollMethods); + Object.assign(TextAreaInput.prototype, SetTextMethods, ScrollMethods); ObjectFactory.register('textAreaInput', function (config) { - var gameObject = new TextAreaInput$1(this.scene, config); + var gameObject = new TextAreaInput(this.scene, config); this.scene.add.existing(gameObject); return gameObject; }); - SetValue(window, 'RexPlugins.UI.TextAreaInput', TextAreaInput$1); + SetValue(window, 'RexPlugins.UI.TextAreaInput', TextAreaInput); var GetChildrenWidth = function GetChildrenWidth() { if (this.rexSizer.hidden) { @@ -55932,7 +55932,7 @@ Object.assign(methods$6, ChildrenMaskMethods); var IsPlainObject$5 = Phaser.Utils.Objects.IsPlainObject; - var GetValue$x = Phaser.Utils.Objects.GetValue; + var GetValue$v = Phaser.Utils.Objects.GetValue; var ALIGN_LEFTTOP = Phaser.Display.Align.TOP_LEFT; var ScrollableBlock = /*#__PURE__*/function (_BaseSizer) { _inherits(ScrollableBlock, _BaseSizer); @@ -55942,14 +55942,14 @@ _classCallCheck(this, ScrollableBlock); if (IsPlainObject$5(x)) { config = x; - x = GetValue$x(config, 'x', 0); - y = GetValue$x(config, 'y', 0); - minWidth = GetValue$x(config, 'width', undefined); - minHeight = GetValue$x(config, 'height', undefined); + x = GetValue$v(config, 'x', 0); + y = GetValue$v(config, 'y', 0); + minWidth = GetValue$v(config, 'width', undefined); + minHeight = GetValue$v(config, 'height', undefined); } else if (IsPlainObject$5(minWidth)) { config = minWidth; - minWidth = GetValue$x(config, 'width', undefined); - minHeight = GetValue$x(config, 'height', undefined); + minWidth = GetValue$v(config, 'width', undefined); + minHeight = GetValue$v(config, 'height', undefined); } _this = _super.call(this, scene, x, y, minWidth, minHeight, config); _this.type = 'rexScrollableBlock'; @@ -55961,15 +55961,15 @@ _this.execeedBottomState = false; _this.execeedLeftState = false; _this.execeedRightState = false; - _this.setScrollMode(GetValue$x(config, 'scrollMode', 0)); - var clampChildOY = GetValue$x(config, 'clamplChildOY', true); - var clampChildOX = GetValue$x(config, 'clamplChildOX', clampChildOY); + _this.setScrollMode(GetValue$v(config, 'scrollMode', 0)); + var clampChildOY = GetValue$v(config, 'clamplChildOY', true); + var clampChildOX = GetValue$v(config, 'clamplChildOX', clampChildOY); _this.setClampMode(clampChildOY, clampChildOX); // Add elements // No background object, and child does not have padding - var child = GetValue$x(config, 'child', undefined); - var expand = GetValue$x(config, 'expand', true); + var child = GetValue$v(config, 'child', undefined); + var expand = GetValue$v(config, 'expand', true); if (child.setOrigin) { child.setOrigin(0); } @@ -55981,7 +55981,7 @@ _this.child = child; // Create mask of child object - _this.setupChildrenMask(GetValue$x(config, 'mask', undefined)); + _this.setupChildrenMask(GetValue$v(config, 'mask', undefined)); if (_this.childrenMask) { _this.maskGameObject = MaskToGameObject(_this.childrenMask); } @@ -56358,7 +56358,7 @@ } }; - var GetValue$w = Phaser.Utils.Objects.GetValue; + var GetValue$u = Phaser.Utils.Objects.GetValue; var ScrollablePanel = /*#__PURE__*/function (_Scrollable) { _inherits(ScrollablePanel, _Scrollable); var _super = _createSuper(ScrollablePanel); @@ -56371,25 +56371,25 @@ // Create scrollable-block var scrollMode = GetScrollMode(config); - var panelConfig = GetValue$w(config, 'panel', undefined); + var panelConfig = GetValue$u(config, 'panel', undefined); if (panelConfig === undefined) { panelConfig = {}; } panelConfig.scrollMode = scrollMode; - panelConfig.clamplChildOY = GetValue$w(config, 'clamplChildOY', false); - panelConfig.clamplChildOX = GetValue$w(config, 'clamplChildOX', false); + panelConfig.clamplChildOY = GetValue$u(config, 'clamplChildOY', false); + panelConfig.clamplChildOX = GetValue$u(config, 'clamplChildOX', false); var scrollableBlock = new ScrollableBlock(scene, panelConfig); scene.add.existing(scrollableBlock); // Important: Add to display list for touch detecting var expandPanelWidth, expandPanelHeight; switch (scrollMode) { case 0: - expandPanelWidth = GetValue$w(config, 'expand.panel', true); + expandPanelWidth = GetValue$u(config, 'expand.panel', true); expandPanelHeight = true; break; case 1: expandPanelWidth = true; - expandPanelHeight = GetValue$w(config, 'expand.panel', true); + expandPanelHeight = GetValue$u(config, 'expand.panel', true); break; default: // 2 @@ -56403,11 +56403,11 @@ gameObject: scrollableBlock, expandWidth: expandPanelWidth, expandHeight: expandPanelHeight, - align: GetValue$w(config, 'align.panel', 'center') + align: GetValue$u(config, 'align.panel', 'center') }; - var spaceConfig = GetValue$w(config, 'space', undefined); + var spaceConfig = GetValue$u(config, 'space', undefined); if (spaceConfig) { - spaceConfig.child = GetValue$w(spaceConfig, 'panel', 0); + spaceConfig.child = GetValue$u(spaceConfig, 'panel', 0); } _this = _super.call(this, scene, config); _this.addChildrenMap('panel', scrollableBlock.child); @@ -56462,7 +56462,7 @@ }; var RunCommands = function RunCommands(queue, scope, config) { - var reverse = GetValue$3n(config, 'reverse', false); + var reverse = GetValue$3l(config, 'reverse', false); var retVal; if (IsArray(queue[0])) { if (!reverse) { @@ -56480,8 +56480,8 @@ return retVal; }; var RunCommand = function RunCommand(cmd, scope, config) { - var argsConvert = GetValue$3n(config, 'argsConvert', undefined); - var argsConvertScope = GetValue$3n(config, 'argsConvertScope', undefined); + var argsConvert = GetValue$3l(config, 'argsConvert', undefined); + var argsConvertScope = GetValue$3l(config, 'argsConvertScope', undefined); var fnName = cmd[0]; ARGS = Copy(ARGS, cmd, 1); if (argsConvert) { @@ -56502,7 +56502,7 @@ if (typeof fnName === 'string') { fn = scope[fnName]; if (fn == null) { - fn = GetValue$3n(scope, fnName, null); + fn = GetValue$3l(scope, fnName, null); } } else { fn = fnName; @@ -56512,7 +56512,7 @@ }; var ARGS = []; // reuse this array - var GetValue$v = Phaser.Utils.Objects.GetValue; + var GetValue$t = Phaser.Utils.Objects.GetValue; var Player = /*#__PURE__*/function (_ComponentBase) { _inherits(Player, _ComponentBase); var _super = _createSuper(Player); @@ -56520,7 +56520,7 @@ var _this; _classCallCheck(this, Player); _this = _super.call(this, parent, config); - var clock = GetValue$v(config, 'clock', undefined); + var clock = GetValue$t(config, 'clock', undefined); if (!clock) { clock = new Clock(parent); } @@ -56532,14 +56532,14 @@ _createClass(Player, [{ key: "resetFromJSON", value: function resetFromJSON(o) { - this.clock.resetFromJSON(GetValue$v(o, 'clock', undefined)); - this.state = GetValue$v(o, 'state', 0); // 0=idle, 1=run, 2=completed - this.commands = GetValue$v(o, 'commands', []); // [[time, cmds], [time, cmds], ...] - this.scope = GetValue$v(o, 'scope', undefined); - this.setTimeUnit(GetValue$v(o, 'timeUnit', 0)); - this.setDtMode(GetValue$v(o, 'dtMode', 0)); - this.index = GetValue$v(o, 'index', 0); - this.nextTime = GetValue$v(o, 'nextTime', 0); + this.clock.resetFromJSON(GetValue$t(o, 'clock', undefined)); + this.state = GetValue$t(o, 'state', 0); // 0=idle, 1=run, 2=completed + this.commands = GetValue$t(o, 'commands', []); // [[time, cmds], [time, cmds], ...] + this.scope = GetValue$t(o, 'scope', undefined); + this.setTimeUnit(GetValue$t(o, 'timeUnit', 0)); + this.setDtMode(GetValue$t(o, 'dtMode', 0)); + this.index = GetValue$t(o, 'index', 0); + this.nextTime = GetValue$t(o, 'nextTime', 0); return this; } }, { @@ -56571,11 +56571,11 @@ key: "load", value: function load(commands, scope, config) { this.stop(); - var timeUnit = GetValue$v(config, 'timeUnit', undefined); + var timeUnit = GetValue$t(config, 'timeUnit', undefined); if (timeUnit !== undefined) { this.setTimeUnit(timeUnit); } - var dtMode = GetValue$v(config, 'dtMode', undefined); + var dtMode = GetValue$t(config, 'dtMode', undefined); if (dtMode !== undefined) { this.setDtMode(dtMode); } @@ -56766,7 +56766,7 @@ increment: 1 }; - var GetValue$u = Phaser.Utils.Objects.GetValue; + var GetValue$s = Phaser.Utils.Objects.GetValue; var Toast = /*#__PURE__*/function (_Label) { _inherits(Toast, _Label); var _super = _createSuper(Toast); @@ -56780,11 +56780,11 @@ } _this = _super.call(this, scene, config); _this.type = 'rexToast'; - _this.setTransitInTime(GetValue$u(config, 'duration.in', 200)); - _this.setDisplayTime(GetValue$u(config, 'duration.hold', 1200)); - _this.setTransitOutTime(GetValue$u(config, 'duration.out', 200)); - _this.setTransitInCallback(GetValue$u(config, 'transitIn', TransitionMode.popUp)); - _this.setTransitOutCallback(GetValue$u(config, 'transitOut', TransitionMode.scaleDown)); + _this.setTransitInTime(GetValue$s(config, 'duration.in', 200)); + _this.setDisplayTime(GetValue$s(config, 'duration.hold', 1200)); + _this.setTransitOutTime(GetValue$s(config, 'duration.out', 200)); + _this.setTransitInCallback(GetValue$s(config, 'transitIn', TransitionMode.popUp)); + _this.setTransitOutCallback(GetValue$s(config, 'transitOut', TransitionMode.scaleDown)); _this.player = new Player(_assertThisInitialized(_this), { dtMode: 1 }); @@ -57025,10 +57025,10 @@ } }; - var GetValue$t = Phaser.Utils.Objects.GetValue; + var GetValue$r = Phaser.Utils.Objects.GetValue; var IsPlainObject$4 = Phaser.Utils.Objects.IsPlainObject; var Clamp$1 = Phaser.Math.Clamp; - var ColorInput$2 = /*#__PURE__*/function (_Sizer) { + var ColorInput$1 = /*#__PURE__*/function (_Sizer) { _inherits(ColorInput, _Sizer); var _super = _createSuper(ColorInput); function ColorInput(scene, config) { @@ -57042,14 +57042,14 @@ _this.type = 'rexColorInputLite'; // Add elements - var background = GetValue$t(config, 'background', undefined); - var swatchConfig = GetValue$t(config, 'swatch'); + var background = GetValue$r(config, 'background', undefined); + var swatchConfig = GetValue$r(config, 'swatch'); var swatchSize; if (IsPlainObject$4(swatchConfig)) { - swatchSize = GetValue$t(swatchConfig, 'size'); + swatchSize = GetValue$r(swatchConfig, 'size'); } - var swatch = CreateSwatch(scene, GetValue$t(config, 'swatch')); - var inputTextConfig = GetValue$t(config, 'inputText', true); + var swatch = CreateSwatch(scene, GetValue$r(config, 'swatch')); + var inputTextConfig = GetValue$r(config, 'inputText', true); var inputText; if (inputTextConfig) { inputText = CreateInputText$1(scene, inputTextConfig); @@ -57058,13 +57058,13 @@ _this.addBackground(background); } if (swatch) { - swatchSize = GetValue$t(config, 'swatchSize', swatchSize); + swatchSize = GetValue$r(config, 'swatchSize', swatchSize); var squareExpandSwatch; if (swatchSize !== undefined) { ResizeGameObject(swatch, swatchSize, swatchSize); squareExpandSwatch = false; } else { - squareExpandSwatch = GetValue$t(config, 'squareExpandSwatch', true); + squareExpandSwatch = GetValue$r(config, 'squareExpandSwatch', true); } var fitRatio = squareExpandSwatch ? 1 : 0; _this.add(swatch, { @@ -57074,8 +57074,8 @@ }); } if (inputText) { - var proportion = GetValue$t(inputTextConfig, 'width') === undefined ? 1 : 0; - var expand = GetValue$t(inputTextConfig, 'height') === undefined ? true : false; + var proportion = GetValue$r(inputTextConfig, 'width') === undefined ? 1 : 0; + var expand = GetValue$r(inputTextConfig, 'height') === undefined ? true : false; _this.add(inputText, { proportion: proportion, expand: expand @@ -57089,12 +57089,12 @@ this.setValue(inputText.value); }, _assertThisInitialized(_this)); } - var callback = GetValue$t(config, 'valuechangeCallback', null); + var callback = GetValue$r(config, 'valuechangeCallback', null); if (callback !== null) { - var scope = GetValue$t(config, 'valuechangeCallbackScope', undefined); + var scope = GetValue$r(config, 'valuechangeCallbackScope', undefined); _this.on('valuechange', callback, scope); } - _this.setValue(GetValue$t(config, 'value', 0x0)); + _this.setValue(GetValue$r(config, 'value', 0x0)); return _this; } _createClass(ColorInput, [{ @@ -57691,7 +57691,7 @@ return SVPalette; }(OverlapSizer); - var GetValue$s = Phaser.Utils.Objects.GetValue; + var GetValue$q = Phaser.Utils.Objects.GetValue; var ColorPicker = /*#__PURE__*/function (_Sizer) { _inherits(ColorPicker, _Sizer); var _super = _createSuper(ColorPicker); @@ -57703,7 +57703,7 @@ _this.freezePalettes = false; // orientation - var hPalettePosition = GetValue$s(config, 'hPalette.position', 0); + var hPalettePosition = GetValue$q(config, 'hPalette.position', 0); if (typeof hPalettePosition === 'string') { hPalettePosition = HPalettePositionNamesMap[hPalettePosition]; } @@ -57716,17 +57716,17 @@ _this.setOrientation(orientation); // Add elements - var background = GetValue$s(config, 'background', undefined); + var background = GetValue$q(config, 'background', undefined); var hPaletteWidth, hPaletteHeight; if (_this.orientation === 0) { - var hPaletteWidth = GetValue$s(config, 'hPalette.width', undefined); + var hPaletteWidth = GetValue$q(config, 'hPalette.width', undefined); if (hPaletteWidth === undefined) { - hPaletteWidth = GetValue$s(config, 'hPalette.size', 10); + hPaletteWidth = GetValue$q(config, 'hPalette.size', 10); } } else { - hPaletteHeight = GetValue$s(config, 'hPalette.height', undefined); + hPaletteHeight = GetValue$q(config, 'hPalette.height', undefined); if (hPaletteHeight === undefined) { - hPaletteHeight = GetValue$s(config, 'hPalette.size', 10); + hPaletteHeight = GetValue$q(config, 'hPalette.size', 10); } } var hPalette = new HPalette(scene, { @@ -57734,8 +57734,8 @@ height: hPaletteHeight }); scene.add.existing(hPalette); - var svPaletteWidth = GetValue$s(config, 'svPalette.width', undefined); - var svPaletteHeight = GetValue$s(config, 'svPalette.height', undefined); + var svPaletteWidth = GetValue$q(config, 'svPalette.width', undefined); + var svPaletteHeight = GetValue$q(config, 'svPalette.height', undefined); var svPalette = new SVPalette(scene, { width: svPaletteWidth, height: svPaletteHeight @@ -57777,12 +57777,12 @@ _this.addChildrenMap('background', background); _this.addChildrenMap('hPalette', hPalette); _this.addChildrenMap('svPalette', svPalette); - var callback = GetValue$s(config, 'valuechangeCallback', null); + var callback = GetValue$q(config, 'valuechangeCallback', null); if (callback !== null) { - var scope = GetValue$s(config, 'valuechangeCallbackScope', undefined); + var scope = GetValue$q(config, 'valuechangeCallbackScope', undefined); _this.on('valuechange', callback, scope); } - _this.setValue(GetValue$s(config, 'value', 0xffffff)); + _this.setValue(GetValue$q(config, 'value', 0xffffff)); return _this; } _createClass(ColorPicker, [{ @@ -57851,7 +57851,7 @@ right: 3 }; - var GetValue$r = Phaser.Utils.Objects.GetValue; + var GetValue$p = Phaser.Utils.Objects.GetValue; var Color = Phaser.Display.Color; var ColorToRGBA = Phaser.Display.Color.ColorToRGBA; var HSVToRGB = Phaser.Display.Color.HSVToRGB; @@ -57871,8 +57871,8 @@ _this.colorObject = new Color(); // Add elements - var background = GetValue$r(config, 'background', undefined); - var formatLabel = GetValue$r(config, 'formatLabel', undefined); + var background = GetValue$p(config, 'background', undefined); + var formatLabel = GetValue$p(config, 'formatLabel', undefined); if (!IsGameObject(formatLabel)) { formatLabel = CreateLabel(scene, formatLabel).resetDisplayContent(); } @@ -57882,7 +57882,7 @@ components.push(config.inputText1); components.push(config.inputText2); } else { - var inputTextConfig = GetValue$r(config, 'inputText'); + var inputTextConfig = GetValue$p(config, 'inputText'); for (var i = 0; i < 3; i++) { var inputText = CreateInputText$1(scene, inputTextConfig).setMaxLength(3).setNumberInput(); components.push(inputText); @@ -57891,15 +57891,15 @@ if (background) { _this.addBackground(background); } - var proportion = GetValue$r(config, 'proportion.formatLabel', 0); + var proportion = GetValue$p(config, 'proportion.formatLabel', 0); var defaultExpand = formatLabel.isRexContainerLite ? true : false; - var expand = GetValue$r(config, 'expand.formatLabel', defaultExpand); + var expand = GetValue$p(config, 'expand.formatLabel', defaultExpand); _this.add(formatLabel, { proportion: proportion, expand: expand }); - var proportion = GetValue$r(inputTextConfig, 'width') === undefined ? 1 : 0; - var expand = GetValue$r(inputTextConfig, 'height') === undefined ? true : false; + var proportion = GetValue$p(inputTextConfig, 'width') === undefined ? 1 : 0; + var expand = GetValue$p(inputTextConfig, 'height') === undefined ? true : false; for (var i = 0, cnt = components.length; i < cnt; i++) { _this.add(components[i], { proportion: proportion, @@ -57916,13 +57916,13 @@ this.setValue(this.colorObject.color); }, _assertThisInitialized(_this)); } - var callback = GetValue$r(config, 'valuechangeCallback', null); + var callback = GetValue$p(config, 'valuechangeCallback', null); if (callback !== null) { - var scope = GetValue$r(config, 'valuechangeCallbackScope', undefined); + var scope = GetValue$p(config, 'valuechangeCallbackScope', undefined); _this.on('valuechange', callback, scope); } formatLabel.setText('RGB'); - _this.setValue(GetValue$r(config, 'value', 0xffffff)); + _this.setValue(GetValue$p(config, 'value', 0xffffff)); return _this; } _createClass(ColorComponents, [{ @@ -58025,7 +58025,7 @@ return ColorComponents; }(Sizer); - var GetValue$q = Phaser.Utils.Objects.GetValue; + var GetValue$o = Phaser.Utils.Objects.GetValue; var ColorPickerPanel = /*#__PURE__*/function (_Sizer) { _inherits(ColorPickerPanel, _Sizer); var _super = _createSuper(ColorPickerPanel); @@ -58040,12 +58040,12 @@ _this.type = 'rexColorInput.ColorPickerPanel'; // Add elements - var background = GetValue$q(config, 'background', undefined); + var background = GetValue$o(config, 'background', undefined); var colorPicker = new ColorPicker(scene, { hPalette: config.hPalette || {}, svPalette: config.svPalette || {}, space: { - item: GetValue$q(config, 'space.hPalette', 8) + item: GetValue$o(config, 'space.hPalette', 8) } }); scene.add.existing(colorPicker); @@ -58081,7 +58081,7 @@ this.setValue(value); }, _assertThisInitialized(_this)); } - _this.setValue(GetValue$q(config, 'value', 0xffffff)); + _this.setValue(GetValue$o(config, 'value', 0xffffff)); return _this; } _createClass(ColorPickerPanel, [{ @@ -58198,8 +58198,8 @@ }; Object.assign(methods$3, methods$4); - var GetValue$p = Phaser.Utils.Objects.GetValue; - var ColorInput$1 = /*#__PURE__*/function (_ColorInputBase) { + var GetValue$n = Phaser.Utils.Objects.GetValue; + var ColorInput = /*#__PURE__*/function (_ColorInputBase) { _inherits(ColorInput, _ColorInputBase); var _super = _createSuper(ColorInput); function ColorInput(scene, config) { @@ -58220,25 +58220,25 @@ var colorPickerConfig = config.colorPicker; var hasColorPicker = colorPickerConfig !== false && colorPickerConfig !== null; if (hasColorPicker) { - _this.setColorPickerSize(GetValue$p(colorPickerConfig, 'width', 160), GetValue$p(colorPickerConfig, 'height', 170)); + _this.setColorPickerSize(GetValue$n(colorPickerConfig, 'width', 160), GetValue$n(colorPickerConfig, 'height', 170)); var createBackgroundCallback; - var background = GetValue$p(colorPickerConfig, 'background'); + var background = GetValue$n(colorPickerConfig, 'background'); if (background) { createBackgroundCallback = function createBackgroundCallback(scene) { return CreateBackground$2(scene, background); }; } else { - createBackgroundCallback = GetValue$p(colorPickerConfig, 'createBackgroundCallback'); + createBackgroundCallback = GetValue$n(colorPickerConfig, 'createBackgroundCallback'); } _this.setCreateColorPickerBackgroundCallback(createBackgroundCallback); - _this.setColorPickerHPalettePosition(GetValue$p(colorPickerConfig, 'hPalettePosition', 0)); - _this.setColorPickerExpandDirection(GetValue$p(colorPickerConfig, 'expandDirection')); - _this.setColorPickerEaseInDuration(GetValue$p(colorPickerConfig, 'easeIn', 200)); - _this.setColorPickerEaseOutDuration(GetValue$p(colorPickerConfig, 'easeOut', 200)); - _this.setColorPickerTransitInCallback(GetValue$p(colorPickerConfig, 'transitIn')); - _this.setColorPickerTransitOutCallback(GetValue$p(colorPickerConfig, 'transitOut')); - _this.setColorPickerBounds(GetValue$p(colorPickerConfig, 'bounds')); - var colorPickerSpaceConfig = GetValue$p(colorPickerConfig, 'space'); + _this.setColorPickerHPalettePosition(GetValue$n(colorPickerConfig, 'hPalettePosition', 0)); + _this.setColorPickerExpandDirection(GetValue$n(colorPickerConfig, 'expandDirection')); + _this.setColorPickerEaseInDuration(GetValue$n(colorPickerConfig, 'easeIn', 200)); + _this.setColorPickerEaseOutDuration(GetValue$n(colorPickerConfig, 'easeOut', 200)); + _this.setColorPickerTransitInCallback(GetValue$n(colorPickerConfig, 'transitIn')); + _this.setColorPickerTransitOutCallback(GetValue$n(colorPickerConfig, 'transitOut')); + _this.setColorPickerBounds(GetValue$n(colorPickerConfig, 'bounds')); + var colorPickerSpaceConfig = GetValue$n(colorPickerConfig, 'space'); if (colorPickerSpaceConfig === undefined) { colorPickerSpaceConfig = { left: 10, @@ -58253,14 +58253,14 @@ var colorComponentsConfig = config.colorComponents; var hasColorComponents = colorComponentsConfig !== false && colorComponentsConfig !== null; if (hasColorPicker && hasColorComponents) { - _this.setColorComponentsHeight(GetValue$p(colorComponentsConfig, 'height', 30)); - _this.setColorComponentsFormatLabelConfig(GetValue$p(colorComponentsConfig, 'formatLabel')); - var colorComponentsInputTextConfig = GetValue$p(colorComponentsConfig, 'inputText'); + _this.setColorComponentsHeight(GetValue$n(colorComponentsConfig, 'height', 30)); + _this.setColorComponentsFormatLabelConfig(GetValue$n(colorComponentsConfig, 'formatLabel')); + var colorComponentsInputTextConfig = GetValue$n(colorComponentsConfig, 'inputText'); if (!colorComponentsInputTextConfig) { - colorComponentsInputTextConfig = GetValue$p(config, 'inputText'); + colorComponentsInputTextConfig = GetValue$n(config, 'inputText'); } _this.setColorComponentsInputTextConfig(colorComponentsInputTextConfig); - var colorComponentsSpace = GetValue$p(colorComponentsConfig, 'space'); + var colorComponentsSpace = GetValue$n(colorComponentsConfig, 'space'); if (colorComponentsSpace === undefined) { colorComponentsSpace = { item: 8 @@ -58275,22 +58275,22 @@ return _this; } return _createClass(ColorInput); - }(ColorInput$2); - Object.assign(ColorInput$1.prototype, methods$3); + }(ColorInput$1); + Object.assign(ColorInput.prototype, methods$3); ObjectFactory.register('colorInput', function (config) { - var gameObject = new ColorInput$1(this.scene, config); + var gameObject = new ColorInput(this.scene, config); this.scene.add.existing(gameObject); return gameObject; }); - SetValue(window, 'RexPlugins.UI.ColorInput', ColorInput$1); + SetValue(window, 'RexPlugins.UI.ColorInput', ColorInput); ObjectFactory.register('colorInputLite', function (config) { - var gameObject = new ColorInput$2(this.scene, config); + var gameObject = new ColorInput$1(this.scene, config); this.scene.add.existing(gameObject); return gameObject; }); - SetValue(window, 'RexPlugins.UI.ColorInputBase', ColorInput$2); + SetValue(window, 'RexPlugins.UI.ColorInputBase', ColorInput$1); ObjectFactory.register('colorPicker', function (config) { var gameObject = new ColorPicker(this.scene, config); @@ -58701,7 +58701,7 @@ var methods$2 = {}; Object.assign(methods$2, Visible, Fade, Move); - var GetValue$o = Phaser.Utils.Objects.GetValue; + var GetValue$m = Phaser.Utils.Objects.GetValue; var Sides = /*#__PURE__*/function (_OverlapSizer) { _inherits(Sides, _OverlapSizer); var _super = _createSuper(Sides); @@ -58715,15 +58715,15 @@ _this.currentChildKey = undefined; // Callbacks - var showChildCallback = GetValue$o(config, 'showChildCallback', undefined); + var showChildCallback = GetValue$m(config, 'showChildCallback', undefined); if (showChildCallback) { // Has showChildCallback, and hideChildCallback if (IsFunction(showChildCallback)) { // Custom callbacks - var showChildCallbackScope = GetValue$o(config, 'showChildCallbackScope', undefined); + var showChildCallbackScope = GetValue$m(config, 'showChildCallbackScope', undefined); _this.on('showchild', showChildCallback, showChildCallbackScope); - var hideChildCallback = GetValue$o(config, 'hideChildCallback', undefined); - var hideChildCallbackScope = GetValue$o(config, 'hideChildCallbackScope', undefined); + var hideChildCallback = GetValue$m(config, 'hideChildCallback', undefined); + var hideChildCallbackScope = GetValue$m(config, 'hideChildCallbackScope', undefined); _this.on('hidechild', hideChildCallback, hideChildCallbackScope); } else { // Default callbacks @@ -58734,12 +58734,12 @@ } // Add elements - var background = GetValue$o(config, 'background', undefined); - var panel = GetValue$o(config, 'panel', undefined); - var leftSide = GetValue$o(config, 'leftSide', undefined); - var rightSide = GetValue$o(config, 'rightSide', undefined); - var topSide = GetValue$o(config, 'topSide', undefined); - var bottomSide = GetValue$o(config, 'bottomSide', undefined); + var background = GetValue$m(config, 'background', undefined); + var panel = GetValue$m(config, 'panel', undefined); + var leftSide = GetValue$m(config, 'leftSide', undefined); + var rightSide = GetValue$m(config, 'rightSide', undefined); + var topSide = GetValue$m(config, 'topSide', undefined); + var bottomSide = GetValue$m(config, 'bottomSide', undefined); if (background) { _this.addBackground(background); } @@ -58747,25 +58747,25 @@ _this.add(panel, 'panel', 'center', 0, true); } if (leftSide) { - var expand = GetValue$o(config, 'expand.left', true); + var expand = GetValue$m(config, 'expand.left', true); _this.add(leftSide, 'leftSide', 'left-top', 0, { height: expand }); } if (rightSide) { - var expand = GetValue$o(config, 'expand.right', true); + var expand = GetValue$m(config, 'expand.right', true); _this.add(rightSide, 'rightSide', 'right-top', 0, { height: expand }); } if (topSide) { - var expand = GetValue$o(config, 'expand.top', true); + var expand = GetValue$m(config, 'expand.top', true); _this.add(topSide, 'topSide', 'left-top', 0, { width: expand }); } if (bottomSide) { - var expand = GetValue$o(config, 'expand.bottom', true); + var expand = GetValue$m(config, 'expand.bottom', true); _this.add(bottomSide, 'bottomSide', 'left-bottom', 0, { width: expand }); @@ -58796,6 +58796,32 @@ }); SetValue(window, 'RexPlugins.UI.Sides', Sides); + var RegisterInputHandler = function RegisterInputHandler(config) { + var isValidInputHandler = true; + if (!config.hasOwnProperty('accept')) { + isValidInputHandler = false; + console.error("[Tweaker] Can't register inputHandler '".concat(config.name, "', missing 'accept' callback.")); + } + if (!config.hasOwnProperty('build')) { + isValidInputHandler = false; + console.error("[Tweaker] Can't register inputHandler '".concat(config.name, "', missing 'build' callback.")); + } + if (isValidInputHandler) { + this.inputHandlers.unshift(config); + } + return this; + }; + + var GetFirst = Phaser.Utils.Array.GetFirst; + var Remove = Phaser.Utils.Array.Remove; + var RemoveInputHandler = function RemoveInputHandler(name) { + var handler = GetFirst(this.inputHandlers, 'name', name); + if (handler) { + Remove(this.inputHandlers, handler); + } + return this; + }; + var Title = /*#__PURE__*/function (_Label) { _inherits(Title, _Label); var _super = _createSuper(Title); @@ -58915,10 +58941,10 @@ }(Folder$1); Object.assign(Folder.prototype, BindingTargetMethods$2, InputRowTitleWidthMethods$1); - var GetValue$n = Phaser.Utils.Objects.GetValue; + var GetValue$l = Phaser.Utils.Objects.GetValue; var CreateFolder = function CreateFolder(scene, config, style) { // Create Folder-title - var titleStyle = GetValue$n(style, 'title') || {}; + var titleStyle = GetValue$l(style, 'title') || {}; var title = new FolderTitle(scene, titleStyle); scene.add.existing(title); title.on('folder.expand', function () { @@ -58927,12 +58953,12 @@ title.setExpandedState(false); }); var tweakerConfig = { - root: GetValue$n(style, 'root'), - styles: GetValue$n(style, 'tweaker'), - space: GetValue$n(style, 'space') || {} + root: GetValue$l(style, 'root'), + styles: GetValue$l(style, 'tweaker'), + space: GetValue$l(style, 'space') || {} }; var child = CreateTweaker(scene, tweakerConfig); - var backgroundStyle = GetValue$n(style, 'background'); + var backgroundStyle = GetValue$l(style, 'background'); var background = CreateBackground(scene, config, backgroundStyle); var folder = new Folder(scene, { orientation: 1, @@ -58940,19 +58966,19 @@ child: child, background: background, transition: { - duration: GetValue$n(style, 'transition.duration', 200) + duration: GetValue$l(style, 'transition.duration', 200) } }); scene.add.existing(folder); return folder; }; - var GetValue$m = Phaser.Utils.Objects.GetValue; + var GetValue$k = Phaser.Utils.Objects.GetValue; var AddFolder = function AddFolder(config) { var scene = this.scene; // Create folder - var folderStyle = GetValue$m(this.styles, 'folder') || {}; + var folderStyle = GetValue$k(this.styles, 'folder') || {}; folderStyle.tweaker = this.styles; folderStyle.root = this.root; var folder = CreateFolder(scene, config, folderStyle); @@ -58966,7 +58992,7 @@ // Set content folder.setTitle(config); - var expanded = GetValue$m(config, 'expanded', true); + var expanded = GetValue$k(config, 'expanded', true); if (expanded) { folder.expand(0); } else { @@ -59022,16 +59048,16 @@ }(TabPages$1); Object.assign(TabPages.prototype, BindingTargetMethods$1, InputRowTitleWidthMethods); - var GetValue$l = Phaser.Utils.Objects.GetValue; + var GetValue$j = Phaser.Utils.Objects.GetValue; var CreateTab = function CreateTab(scene, config, style) { var tabPages = new TabPages(scene, style); scene.add.existing(tabPages); - var tabConfig = GetValue$l(style, 'tab'); + var tabConfig = GetValue$j(style, 'tab'); var tweakerConfig = { - root: GetValue$l(style, 'root'), - styles: GetValue$l(style, 'tweaker') + root: GetValue$j(style, 'root'), + styles: GetValue$j(style, 'tweaker') }; - var pages = GetValue$l(config, 'pages') || []; + var pages = GetValue$j(config, 'pages') || []; for (var i = 0, cnt = pages.length; i < cnt; i++) { var page = pages[i]; tabPages.addPage({ @@ -59050,12 +59076,12 @@ return tabPages; }; - var GetValue$k = Phaser.Utils.Objects.GetValue; + var GetValue$i = Phaser.Utils.Objects.GetValue; var AddTab = function AddTab(config) { var scene = this.scene; // Create tab - var tabStyle = GetValue$k(this.styles, 'tab') || {}; + var tabStyle = GetValue$i(this.styles, 'tab') || {}; tabStyle.tweaker = this.styles; tabStyle.root = this.root; var tab = CreateTab(scene, config, tabStyle); @@ -59066,7 +59092,7 @@ this.add(tab, { expand: true }); - var pagesConfig = GetValue$k(config, 'pages') || []; + var pagesConfig = GetValue$i(config, 'pages') || []; var pages = []; var shownPageIndex = 0; for (var i = 0, cnt = pagesConfig.length; i < cnt; i++) { @@ -59085,54 +59111,6 @@ return pages; }; - var StringType = 'string'; - var TextAreaType = 'textarea'; - var NumberType = 'number'; - var RangeType = 'range'; - var ListType = 'list'; - var ButtonsType = 'buttons'; - var BooleanType = 'boolean'; - var ToggleSwitchType = 'toggleSwitch'; - var ColorType = 'color'; - - var GetInputType = function GetInputType(object, key, config) { - // Force input type to view - if (config.view) { - return config.view; - } - if (config.options) { - return ListType; - } - if (!object) { - return StringType; - } - var value = object[key]; - switch (_typeof(value)) { - case 'number': - if (HasProperties(config, 'min', 'max')) { - return RangeType; - } - return NumberType; - case 'string': - return StringType; - case 'boolean': - return BooleanType; - default: - return StringType; - } - }; - var HasProperties = function HasProperties(object) { - for (var _len = arguments.length, keys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - keys[_key - 1] = arguments[_key]; - } - for (var i = 0, cnt = keys.length; i < cnt; i++) { - if (object[keys[i]] === undefined) { - return false; - } - } - return true; - }; - var BindingTargetMethods = { setupBinding: function setupBinding() { var inputField = this.childrenMap.inputField; @@ -59230,7 +59208,7 @@ } }; - var GetValue$j = Phaser.Utils.Objects.GetValue; + var GetValue$h = Phaser.Utils.Objects.GetValue; var InputRow = /*#__PURE__*/function (_Sizer) { _inherits(InputRow, _Sizer); var _super = _createSuper(InputRow); @@ -59245,8 +59223,8 @@ var inputTitle = config.inputTitle; var inputField = config.inputField; var background = config.background; - var proportion = GetValue$j(config, 'proportion.title', 0); - var titleSpace = GetValue$j(config, 'space.title', 0); + var proportion = GetValue$h(config, 'proportion.title', 0); + var titleSpace = GetValue$h(config, 'space.title', 0); var padding; if (_this.orientation === 0) { padding = { @@ -59263,7 +59241,7 @@ padding: padding }); var defaultProportion = config.parentOrientation === 1 ? 1 : 0; - var proportion = GetValue$j(config, 'proportion.inputField', defaultProportion); + var proportion = GetValue$h(config, 'proportion.inputField', defaultProportion); _this.add(inputField, { proportion: proportion, expand: true @@ -59314,825 +59292,173 @@ return gameObject; }; - var InputFiledBase = /*#__PURE__*/function (_Sizer) { - _inherits(InputFiledBase, _Sizer); - var _super = _createSuper(InputFiledBase); - function InputFiledBase() { - _classCallCheck(this, InputFiledBase); - return _super.apply(this, arguments); + var GenerateInputFieldClass = function GenerateInputFieldClass(BaseClass) { + if (BaseClass === undefined) { + BaseClass = Sizer; } - _createClass(InputFiledBase, [{ - key: "bindingTarget", - get: function get() { - return this.getParentSizer().bindingTarget; - } - }, { - key: "bindingKey", - get: function get() { - return this.getParentSizer().bindTargetKey; - } - }, { - key: "value", - get: function get() { - return this._value; - }, - set: - // Override - function set(value) { - if (this._value === value) { - return; - } - var oldValue = this._value; - this._value = value; - if (!this.syncValueFlag) { - this.emit('valuechange', value, oldValue, this.bindingTarget, this.bindingKey); - } - } - }, { - key: "validate", - value: function validate(newValue) { - if (this.syncValueFlag || !this.validateCallback) { - return true; - } - return this.validateCallback(newValue, this._value, this.bindingTarget, this.bindingKey); - } - }, { - key: "getValue", - value: function getValue() { - return this.value; - } - }, { - key: "setValue", - value: function setValue(value) { - this.value = value; - return this; - } - - /* - Internal method invoked when - - inputRow.setBindingTarget(target), or - - inputRow.syncTargetValue() - */ - }, { - key: "syncValue", - value: function syncValue(value) { - this.syncValueFlag = true; - this.value = value; - this.syncValueFlag = false; - return this; - } - - // Override - }, { - key: "readOnly", - get: function get() { - return this._readOnly; - } - - // Override - , - set: function set(value) { - this._readOnly = value; - } - }, { - key: "setReadOnly", - value: function setReadOnly(enable) { - if (enable === undefined) { - enable = true; - } - this.readOnly = enable; - return true; - } - }, { - key: "setTextFormatCallback", - value: function setTextFormatCallback(callback) { - this.textFormatCallback = callback; - return this; - } - }, { - key: "setValidateCallback", - value: function setValidateCallback(callback) { - this.validateCallback = callback; - return this; - } - }]); - return InputFiledBase; - }(Sizer); - - var TextInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(TextInput, _InputFiledBase); - var _super = _createSuper(TextInput); - function TextInput(scene, config) { - var _this; - _classCallCheck(this, TextInput); - if (config === undefined) { - config = {}; + var InputFiled = /*#__PURE__*/function (_BaseClass) { + _inherits(InputFiled, _BaseClass); + var _super = _createSuper(InputFiled); + function InputFiled() { + _classCallCheck(this, InputFiled); + return _super.apply(this, arguments); } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.TextInput'; - var inputTextConfig = config.inputText; - var inputText = CreateInputText$1(scene, inputTextConfig); - _this.add(inputText, { - proportion: 1, - expand: true - }); - _this.addChildrenMap('inputText', inputText); - inputText.on('close', function () { - this.setValue(inputText.value); - }, _assertThisInitialized(_this)); - return _this; - } - _createClass(TextInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; - } - if (!this.validate(value)) { - value = this._value; // Back to previous value + _createClass(InputFiled, [{ + key: "bindingTarget", + get: function get() { + return this.getParentSizer().bindingTarget; } - - var text = this.textFormatCallback ? this.textFormatCallback(value) : value; - this.childrenMap.inputText.setText(text); - _set(_getPrototypeOf(TextInput.prototype), "value", value, this, true); // Fire 'valuechange' event - } - }, { - key: "setInputTextReadOnly", - value: function setInputTextReadOnly(enable) { - if (enable === undefined) { - enable = true; + }, { + key: "bindingKey", + get: function get() { + return this.getParentSizer().bindTargetKey; } - this.childrenMap.inputText.setReadOnly(enable); - return this; - } - }]); - return TextInput; - }(InputFiledBase); - - var CreateTextInput = function CreateTextInput(scene, config, style) { - var gameObject = new TextInput(scene, style); - scene.add.existing(gameObject); - gameObject.setInputTextReadOnly(!!config.inputTextReadOnly); - return gameObject; - }; - - var CreateInputTextArea = function CreateInputTextArea(scene, config, deepCloneConfig) { - if (deepCloneConfig === undefined) { - deepCloneConfig = true; - } - if (deepCloneConfig) { - config = config ? DeepClone(config) : {}; - } else if (!config) { - config = {}; - } - var inputText = new TextAreaInput$1(scene, config); - scene.add.existing(inputText); - return inputText; - }; + }, { + key: "value", + get: function get() { + return this._value; + }, + set: function set(value) { + if (this._value === value) { + return; + } + if (!this.validate(value)) { + value = this._value; // Back to previous value + } - var TextAreaInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(TextAreaInput, _InputFiledBase); - var _super = _createSuper(TextAreaInput); - function TextAreaInput(scene, config) { - var _this; - _classCallCheck(this, TextAreaInput); - if (config === undefined) { - config = {}; - } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.TextAreaInput'; - var inputTextAreaConfig = config.inputTextArea; - if (inputTextAreaConfig === undefined) { - inputTextAreaConfig = {}; - } - if (!inputTextAreaConfig.hasOwnProperty('text')) { - inputTextAreaConfig.text = config.inputText; - } - if (!inputTextAreaConfig.hasOwnProperty('slider')) { - inputTextAreaConfig.slider = config.slider; - } - var inputText = CreateInputTextArea(scene, inputTextAreaConfig); - _this.add(inputText, { - proportion: 1, - expand: true - }); - _this.addChildrenMap('inputText', inputText); - inputText.on('close', function () { - this.setValue(inputText.value); - }, _assertThisInitialized(_this)); - return _this; - } - _createClass(TextAreaInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; - } - if (!this.validate(value)) { - value = this._value; // Back to previous value + if (this.displayValueCallback) { + this.displayValueCallback(this, value); + } + if (this._value === value) { + return; + } + var oldValue = this._value; + this._value = value; + if (!this.syncValueFlag) { + this.emit('valuechange', value, oldValue, this.bindingTarget, this.bindingKey); + } } - - var text = this.textFormatCallback ? this.textFormatCallback(value) : value; - this.childrenMap.inputText.setText(text); - _set(_getPrototypeOf(TextAreaInput.prototype), "value", value, this, true); // Fire 'valuechange' event - } - }, { - key: "setInputTextReadOnly", - value: function setInputTextReadOnly(enable) { - if (enable === undefined) { - enable = true; + }, { + key: "validate", + value: function validate(newValue) { + if (this.syncValueFlag || !this.validateCallback) { + return true; + } + return this.validateCallback(newValue, this._value, this.bindingTarget, this.bindingKey); } - this.childrenMap.inputText.setReadOnly(enable); - return this; - } - }]); - return TextAreaInput; - }(InputFiledBase); - - var CreateTextAreaInput = function CreateTextAreaInput(scene, config, style) { - var gameObject = new TextAreaInput(scene, style); - scene.add.existing(gameObject); - gameObject.setInputTextReadOnly(!!config.inputTextReadOnly); - return gameObject; - }; - - var NumberInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(NumberInput, _InputFiledBase); - var _super = _createSuper(NumberInput); - function NumberInput(scene, config) { - var _this; - _classCallCheck(this, NumberInput); - if (config === undefined) { - config = {}; - } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.NumberInput'; - var inputTextConfig = config.inputNumber || config.inputText; - var inputText = CreateInputText$1(scene, inputTextConfig).setNumberInput(); - _this.add(inputText, { - proportion: 1, - expand: true - }); - _this.addChildrenMap('inputText', inputText); - inputText.on('close', function () { - this.setValue(inputText.value); - }, _assertThisInitialized(_this)); - return _this; - } - _createClass(NumberInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; + }, { + key: "getFotmatText", + value: function getFotmatText(value) { + if (this.textFormatCallback) { + value = this.textFormatCallback(value); + } else { + value = value.toString(); + } + return value; } - if (!this.validate(value)) { - value = this._value; // Back to previous value + }, { + key: "getValue", + value: function getValue() { + return this.value; } - - var text = this.textFormatCallback ? this.textFormatCallback(value) : value; - this.childrenMap.inputText.setText(text); - _set(_getPrototypeOf(NumberInput.prototype), "value", value, this, true); // Fire 'valuechange' event - } - }, { - key: "setInputTextReadOnly", - value: function setInputTextReadOnly(enable) { - if (enable === undefined) { - enable = true; + }, { + key: "setValue", + value: function setValue(value) { + this.value = value; + return this; } - this.childrenMap.inputText.setReadOnly(enable); - return this; - } - }]); - return NumberInput; - }(InputFiledBase); - - var CreateNumberInput = function CreateNumberInput(scene, config, style) { - var gameObject = new NumberInput(scene, style); - scene.add.existing(gameObject); - gameObject.setInputTextReadOnly(!!config.inputTextReadOnly); - return gameObject; - }; - - var CreateSlider = function CreateSlider(scene, config) { - var gameObject = new Slider(scene, config); - scene.add.existing(gameObject); - return gameObject; - }; - var GetValue$i = Phaser.Utils.Objects.GetValue; - var Linear$1 = Phaser.Math.Linear; - var SnapFloor = Phaser.Math.Snap.Floor; - var RangeInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(RangeInput, _InputFiledBase); - var _super = _createSuper(RangeInput); - function RangeInput(scene, config) { - var _this; - _classCallCheck(this, RangeInput); - if (config === undefined) { - config = {}; - } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.RangeInput'; - var sliderConfig = config.slider; - var trackSizeKey = _this.orientation === 0 ? 'track.height' : 'track.width'; - var trackSize = GetValue$i(sliderConfig, trackSizeKey); - var slider = CreateSlider(scene, sliderConfig); - var defaultProportion = config.parentOrientation === 1 ? 2 : 0; - var proportion = GetValue$i(config, 'proportion.range.slider', defaultProportion); - var expand = trackSize === undefined; - _this.add(slider, { - proportion: proportion, - expand: expand - }); - var inputTextConfig = config.inputNumber || config.inputText; - var inputText = CreateInputText$1(scene, inputTextConfig).setNumberInput(); - var defaultProportion = config.parentOrientation === 1 ? 1 : 0; - var proportion = GetValue$i(config, 'proportion.range.inputText', defaultProportion); - _this.add(inputText, { - proportion: proportion, - expand: true - }); - _this.addChildrenMap('slider', slider); - _this.addChildrenMap('inputText', inputText); - inputText.on('close', function () { - this.setValue(inputText.value); - }, _assertThisInitialized(_this)); - slider.on('valuechange', function () { - var value = Linear$1(this.minValue, this.maxValue, slider.value); - if (this.step) { - value = SnapFloor(value, this.step, this.minValue); + /* + Internal method invoked when + - inputRow.setBindingTarget(target), or + - inputRow.syncTargetValue() + */ + }, { + key: "syncValue", + value: function syncValue(value) { + this.syncValueFlag = true; + this.value = value; + this.syncValueFlag = false; + return this; } - this.setValue(value); - }, _assertThisInitialized(_this)); - return _this; - } - _createClass(RangeInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; + }, { + key: "setup", + value: function setup(config, setDefaults) { + if (setDefaults === undefined) { + setDefaults = false; + } + if (setDefaults || config.hasOwnProperty('format')) { + this.setTextFormatCallback(config.format); + } + if (setDefaults || config.hasOwnProperty('onValidate')) { + this.setValidateCallback(config.onValidate); + } + if (this.setupCallback) { + this.setupCallback(this, config, setDefaults); + } + return this; } - if (!this.validate(value)) { - value = this._value; // Back to previous value + }, { + key: "setSetupCallback", + value: function setSetupCallback(callback) { + this.setupCallback = callback; + return this; } - - var text = this.textFormatCallback ? this.textFormatCallback(value) : value; - this.childrenMap.inputText.setText('').setText(text); - this.childrenMap.slider.setValue(value, this.minValue, this.maxValue); - _set(_getPrototypeOf(RangeInput.prototype), "value", value, this, true); // Fire 'valuechange' event - } - }, { - key: "setRange", - value: function setRange(min, max, step) { - this.minValue = min; - this.maxValue = max; - this.step = step; - this.childrenMap.slider.setGap(step, min, max); - return this; - } - }, { - key: "setInputTextReadOnly", - value: function setInputTextReadOnly(enable) { - if (enable === undefined) { - enable = true; + }, { + key: "setDisplayValueCallback", + value: function setDisplayValueCallback(callback) { + this.displayValueCallback = callback; + return this; } - this.childrenMap.inputText.setReadOnly(enable); - return this; - } - }]); - return RangeInput; - }(InputFiledBase); - - var CreateRangeInput = function CreateRangeInput(scene, config, style) { - var gameObject = new RangeInput(scene, style); - scene.add.existing(gameObject); - gameObject.setRange(config.min, config.max, config.step); - gameObject.setInputTextReadOnly(!!config.inputTextReadOnly); - return gameObject; - }; - - var CreateDropDownList = function CreateDropDownList(scene, config) { - config = BuildListConfig(scene, config); - var gameObject = new DropDownList(scene, config); - scene.add.existing(gameObject); - return gameObject; - }; - - var GetOptionIndex = function GetOptionIndex(options, value) { - for (var i = 0, cnt = options.length; i < cnt; i++) { - var option = options[i]; - if (option.value === value) { - return i; - } - } - return undefined; - }; - var GetOptionText = function GetOptionText(options, value) { - var index = GetOptionIndex(options, value); - if (index == null) { - return undefined; - } - return options[index].text; - }; - - var ListInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(ListInput, _InputFiledBase); - var _super = _createSuper(ListInput); - function ListInput(scene, config) { - var _this; - _classCallCheck(this, ListInput); - if (config === undefined) { - config = {}; - } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.ListInput'; - var list = CreateDropDownList(scene, config.list); - _this.add(list, { - proportion: 1, - expand: true - }); - _this.addChildrenMap('list', list); - list.on('button.click', function (dropDownList, listPanel, button, index, pointer, event) { - this.setValue(button.value); - }, _assertThisInitialized(_this)); - return _this; - } - _createClass(ListInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; + }, { + key: "setTextFormatCallback", + value: function setTextFormatCallback(callback) { + this.textFormatCallback = callback; + return this; } - if (!this.validate(value)) { - value = this._value; // Back to previous value + }, { + key: "setValidateCallback", + value: function setValidateCallback(callback) { + this.validateCallback = callback; + return this; } - - var list = this.childrenMap.list; - var text = GetOptionText(list.options, value); - list.resetDisplayContent({ - text: text - }); - _set(_getPrototypeOf(ListInput.prototype), "value", value, this, true); // Fire 'valuechange' event - } - }, { - key: "setOptions", - value: function setOptions(options) { - this.childrenMap.list.setOptions(options); - return this; - } - }]); - return ListInput; - }(InputFiledBase); - - var CreateListInput = function CreateListInput(scene, config, style) { - var gameObject = new ListInput(scene, style); - scene.add.existing(gameObject); - gameObject.setOptions(config.options); - return gameObject; - }; - - var CreateButtons$1 = function CreateButtons(scene, config) { - var gameObject = new Buttons$1(scene, config); - scene.add.existing(gameObject); - return gameObject; - }; - - var SetButtonsActiveStateByIndex = function SetButtonsActiveStateByIndex(buttons, index) { - for (var i = 0, cnt = buttons.length; i < cnt; i++) { - var button = buttons[i]; - if (!button) { - continue; - } - button.setActiveState(i === index); - } + }]); + return InputFiled; + }(BaseClass); + return InputFiled; }; - var GetValue$h = Phaser.Utils.Objects.GetValue; - var ButtonsInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(ButtonsInput, _InputFiledBase); - var _super = _createSuper(ButtonsInput); - function ButtonsInput(scene, config) { - var _this; - _classCallCheck(this, ButtonsInput); - if (config === undefined) { - config = {}; - } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.ButtonsInput'; - var buttonConfig = config.button ? DeepClone(config.button) : {}; - var buttonExpand = GetValue$h(buttonConfig, 'expand', true); - if (buttonExpand) { - buttonConfig.align = 'center'; + var CreateInputField = function CreateInputField(scene, config, style) { + var inputField; + var inputHandlers = this.inputHandlers; + for (var i = 0, cnt = inputHandlers.length; i < cnt; i++) { + var handler = inputHandlers[i]; + if (handler.accept(config)) { + var InputFieldClass = GenerateInputFieldClass(handler.baseClass); + inputField = new InputFieldClass(scene); + scene.add.existing(inputField); + inputField.setSetupCallback(handler.setup).setDisplayValueCallback(handler.displayValue); + handler.build(inputField, style); + break; } - delete buttonConfig.expand; - var list = CreateButtons$1(scene, { - expand: buttonExpand - }); - list.buttonConfig = buttonConfig; - _this.add(list, { - proportion: 1, - expand: true - }); - _this.addChildrenMap('list', list); - list.on('button.click', function (button, index, pointer, event) { - var option = list.options[index]; - if (!option) { - return; // ?? - } - - this._selectedIndex = index; - this.setValue(option.value); - this._selectedIndex = undefined; - }, _assertThisInitialized(_this)); - return _this; } - _createClass(ButtonsInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; - } - if (!this.validate(value)) { - value = this._value; // Back to previous value - } - - var list = this.childrenMap.list; - var index = this._selectedIndex; // See list's 'button.click' event - if (index === undefined) { - index = GetOptionIndex(list.options, value); - } - SetButtonsActiveStateByIndex(list.childrenMap.buttons, index); - _set(_getPrototypeOf(ButtonsInput.prototype), "value", value, this, true); // Fire 'valuechange' event - } - }, { - key: "setOptions", - value: function setOptions(options) { - var list = this.childrenMap.list; - list.options = options; - var scene = this.scene; - var buttonConfig = list.buttonConfig; - list.clearButtons(true); - for (var i = 0, cnt = options.length; i < cnt; i++) { - var option = options[i]; - var button = CreateLabel(scene, buttonConfig).setActiveState(false).resetDisplayContent({ - text: option.text - }); - list.addButton(button); - } - return this; - } - }]); - return ButtonsInput; - }(InputFiledBase); - var CreateButtonsInput = function CreateButtonsInput(scene, config, style) { - var gameObject = new ButtonsInput(scene, style); - scene.add.existing(gameObject); - gameObject.setOptions(config.options); - return gameObject; - }; - - var CreateCheckbox = function CreateCheckbox(scene, config) { - var gameObject = new Checkbox(scene, config); - scene.add.existing(gameObject); - return gameObject; + // Setup by config + inputField.setup(config, true); + return inputField; }; var GetValue$g = Phaser.Utils.Objects.GetValue; - var CheckboxInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(CheckboxInput, _InputFiledBase); - var _super = _createSuper(CheckboxInput); - function CheckboxInput(scene, config) { - var _this; - _classCallCheck(this, CheckboxInput); - if (config === undefined) { - config = {}; - } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.CheckboxInput'; - var checkboxConfig = config.checkbox; - var checkbox = CreateCheckbox(scene, checkboxConfig); - var size = GetValue$g(checkboxConfig, 'size'); - if (size !== undefined) { - checkbox.setSize(size, size); - } - var fitRatio = size !== undefined ? 0 : 1; - _this.add(checkbox, { - proportion: 0, - expand: false, - fitRatio: fitRatio - }); - _this.addChildrenMap('checkbox', checkbox); - checkbox.on('valuechange', function (value) { - this.setValue(value); - }, _assertThisInitialized(_this)); - return _this; - } - _createClass(CheckboxInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; - } - if (!this.validate(value)) { - value = this._value; // Back to previous value - } - - this.childrenMap.checkbox.setValue(value); - _set(_getPrototypeOf(CheckboxInput.prototype), "value", value, this, true); // Fire 'valuechange' event - } - }]); - return CheckboxInput; - }(InputFiledBase); - - var CreateCheckboxInput = function CreateCheckboxInput(scene, config, style) { - var gameObject = new CheckboxInput(scene, style); - scene.add.existing(gameObject); - return gameObject; - }; - - var CreateToggleSwitch = function CreateToggleSwitch(scene, config) { - var gameObject = new ToggleSwitch(scene, config); - scene.add.existing(gameObject); - return gameObject; - }; - - var GetValue$f = Phaser.Utils.Objects.GetValue; - var ToggleSwitchInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(ToggleSwitchInput, _InputFiledBase); - var _super = _createSuper(ToggleSwitchInput); - function ToggleSwitchInput(scene, config) { - var _this; - _classCallCheck(this, ToggleSwitchInput); - if (config === undefined) { - config = {}; - } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.ToggleSwitchInput'; - var toggleSwitchConfig = config.toggleSwitch; - var toggleSwitch = CreateToggleSwitch(scene, toggleSwitchConfig); - var size = GetValue$f(toggleSwitchConfig, 'size'); - if (size !== undefined) { - toggleSwitch.setSize(size, size); - } - var fitRatio = size !== undefined ? 0 : 1; - _this.addSpace().add(toggleSwitch, { - proportion: 0, - expand: false, - fitRatio: fitRatio - }); - _this.addChildrenMap('toggleSwitch', toggleSwitch); - toggleSwitch.on('valuechange', function (value) { - this.setValue(value); - }, _assertThisInitialized(_this)); - return _this; - } - _createClass(ToggleSwitchInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; - } - if (!this.validate(value)) { - value = this._value; // Back to previous value - } - - this.childrenMap.toggleSwitch.setValue(value); - _set(_getPrototypeOf(ToggleSwitchInput.prototype), "value", value, this, true); // Fire 'valuechange' event - } - }]); - return ToggleSwitchInput; - }(InputFiledBase); - - var CreateToggleSwitchInput = function CreateToggleSwitchInput(scene, config, style) { - var gameObject = new ToggleSwitchInput(scene, style); - scene.add.existing(gameObject); - return gameObject; - }; - - var CreateColorInput$1 = function CreateColorInput(scene, config, deepCloneConfig) { - if (deepCloneConfig === undefined) { - deepCloneConfig = true; - } - if (deepCloneConfig) { - config = config ? DeepClone(config) : {}; - } else if (!config) { - config = {}; - } - var inputText = new ColorInput$1(scene, config); - scene.add.existing(inputText); - return inputText; - }; - - var ColorInput = /*#__PURE__*/function (_InputFiledBase) { - _inherits(ColorInput, _InputFiledBase); - var _super = _createSuper(ColorInput); - function ColorInput(scene, config) { - var _this; - _classCallCheck(this, ColorInput); - if (config === undefined) { - config = {}; - } - _this = _super.call(this, scene); - _this.type = 'rexTweaker.ColorInput'; - var colorInputConfig = config.colorInput; - var colorInput = CreateColorInput$1(scene, colorInputConfig); - _this.add(colorInput, { - proportion: 1, - expand: true - }); - _this.addChildrenMap('colorInput', colorInput); - colorInput.on('valuechange', function (value) { - this.setValue(value); - }, _assertThisInitialized(_this)); - return _this; - } - _createClass(ColorInput, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(value) { - if (this._value === value) { - return; - } - if (!this.validate(value)) { - value = this._value; // Back to previous value - } - - this.childrenMap.colorInput.setValue(value); - _set(_getPrototypeOf(ColorInput.prototype), "value", value, this, true); // Fire 'valuechange' event - } - }]); - return ColorInput; - }(InputFiledBase); - - var CreateColorInput = function CreateColorInput(scene, config, style) { - var gameObject = new ColorInput(scene, style); - scene.add.existing(gameObject); - return gameObject; - }; - - var CallbacksMap = {}; - CallbacksMap[StringType] = CreateTextInput; - CallbacksMap[TextAreaType] = CreateTextAreaInput; - CallbacksMap[NumberType] = CreateNumberInput; - CallbacksMap[RangeType] = CreateRangeInput; - CallbacksMap[ListType] = CreateListInput; - CallbacksMap[ButtonsType] = CreateButtonsInput; - CallbacksMap[BooleanType] = CreateCheckboxInput; - CallbacksMap[ToggleSwitchType] = CreateToggleSwitchInput; - CallbacksMap[ColorType] = CreateColorInput; - var CreateInputField = function CreateInputField(scene, config, style) { - var viewType = config.view; - var callback; - if (IsFunction(viewType)) { - callback = viewType; - } else { - callback = CallbacksMap.hasOwnProperty(viewType) ? CallbacksMap[viewType] : CreateTextInput; - } - var gameObject = callback(scene, config, style); - - // Extra settings - gameObject.setTextFormatCallback(config.format); - return gameObject; - }; - - var GetValue$e = Phaser.Utils.Objects.GetValue; var CreateInputRow = function CreateInputRow(scene, config, style) { // Title - var titleStyle = GetValue$e(style, 'title') || {}; + var titleStyle = GetValue$g(style, 'title') || {}; var inputTitle = CreateTitleLabel(scene, config, titleStyle); // InputField - var inputField = CreateInputField(scene, config, style); + var inputField = CreateInputField.call(this, scene, config, style); // Background - var backgroundStyle = GetValue$e(style, 'background') || {}; + var backgroundStyle = GetValue$g(style, 'background') || {}; var background = CreateBackground$2(scene, backgroundStyle); var inputRow = new InputRow(scene, _objectSpread2(_objectSpread2(_objectSpread2({}, config), style), {}, { inputTitle: inputTitle, @@ -60144,26 +59470,31 @@ return inputRow; }; - Phaser.Utils.Objects.GetValue; var AddInput = function AddInput(object, key, config) { if (arguments.length === 1) { config = object; object = config.bindingTarget; key = config.bindingKey; - } else if (config === undefined) { - config = {}; + } else { + if (config === undefined) { + config = {}; + } + config.bindingTarget = object; + config.bindingKey = key; } if (!config.title) { config.title = key; } - if (!config.view) { - config.view = GetInputType(object, key, config); + if (config.bindingTarget && config.bindingKey) { + config.value = config.bindingTarget[config.bindingKey]; + } else { + config.value = undefined; } // Create InputRow var inputRowStyle = this.styles.inputRow || {}; inputRowStyle.parentOrientation = this.styles.orientation; - var inputSizer = CreateInputRow(this.scene, config, inputRowStyle); + var inputSizer = CreateInputRow.call(this, this.scene, config, inputRowStyle); var inputField = inputSizer.childrenMap.inputField; var proportion; if (this.orientation === 1) { @@ -60183,9 +59514,6 @@ if (config.onValueChange) { inputField.on('valuechange', config.onValueChange); } - if (config.onValidate) { - inputField.setValidateCallback(config.onValidate); - } // Bind target inputSizer.setAutoUpdateEnable(config.autoUpdate); @@ -60205,15 +59533,21 @@ return gameObject; }; - var GetValue$d = Phaser.Utils.Objects.GetValue; - var CreateButtons = function CreateButtons(scene, config, style) { + var CreateButtons$2 = function CreateButtons(scene, config) { + var gameObject = new Buttons$1(scene, config); + scene.add.existing(gameObject); + return gameObject; + }; + + var GetValue$f = Phaser.Utils.Objects.GetValue; + var CreateButtons$1 = function CreateButtons(scene, config, style) { // Title - var titleStyle = GetValue$d(style, 'title') || {}; + var titleStyle = GetValue$f(style, 'title') || {}; var title = CreateTitleLabel(scene, config, titleStyle); // Buttons var buttonsConfig = config.buttons; - var buttonStyle = GetValue$d(style, 'button') || {}; + var buttonStyle = GetValue$f(style, 'button') || {}; var buttons = []; for (var i = 0, cnt = buttonsConfig.length; i < cnt; i++) { var button = CreateLabel(scene, buttonStyle); @@ -60224,13 +59558,13 @@ }); button.callback = buttonConfig.callback; } - var buttonsSizer = CreateButtons$1(scene, { + var buttonsSizer = CreateButtons$2(scene, { buttons: buttons, expand: buttons.length === 1 }); // Background - var backgroundStyle = GetValue$d(style, 'background') || {}; + var backgroundStyle = GetValue$f(style, 'background') || {}; var background = CreateRoundRectangle(scene, backgroundStyle); // InputRow @@ -60247,7 +59581,7 @@ return inputRow; }; - var GetValue$c = Phaser.Utils.Objects.GetValue; + var GetValue$e = Phaser.Utils.Objects.GetValue; var AddButtons = function AddButtons(config) { var scene = this.scene; if (config === undefined) { @@ -60265,8 +59599,8 @@ delete config.bindingTarget; // Create buttons - var buttonsStyle = GetValue$c(this.styles, 'inputRow') || {}; - var buttons = CreateButtons(scene, config, buttonsStyle); + var buttonsStyle = GetValue$e(this.styles, 'inputRow') || {}; + var buttons = CreateButtons$1(scene, config, buttonsStyle); // Add buttons this.add(buttons, { @@ -60283,12 +59617,12 @@ return this; }; - var GetValue$b = Phaser.Utils.Objects.GetValue; + var GetValue$d = Phaser.Utils.Objects.GetValue; var AddSeparator = function AddSeparator(config) { var scene = this.scene; // Create separator - var separatorStyle = GetValue$b(this.styles, 'separator'); + var separatorStyle = GetValue$d(this.styles, 'separator'); var separator = CreateBackground(scene, config, separatorStyle); // Add separator @@ -60349,6 +59683,8 @@ }; var methods$1 = { + registerInputHandler: RegisterInputHandler, + removeInputHandler: RemoveInputHandler, addFolder: AddFolder, addTab: AddTab, addInput: AddInput, @@ -60360,7 +59696,7 @@ setInputRowTitleWidth: SetInputRowTitleWidth }; - var GetValue$a = Phaser.Utils.Objects.GetValue; + var GetValue$c = Phaser.Utils.Objects.GetValue; var TweakerShell = /*#__PURE__*/function (_Sizer) { _inherits(TweakerShell, _Sizer); var _super = _createSuper(TweakerShell); @@ -60378,13 +59714,13 @@ _this = _super.call(this, scene, config); _this.type = 'rexTweakerShell'; _this.root = config.root || _assertThisInitialized(_this); - _this.styles = GetValue$a(config, 'styles') || {}; + _this.styles = GetValue$c(config, 'styles') || {}; _this.styles.orientation = _this.orientation; - _this.itemWidth = GetValue$a(_this.styles, 'itemWidth', 0); + _this.itemWidth = GetValue$c(_this.styles, 'itemWidth', 0); if (_this.root === _assertThisInitialized(_this) && _this.orientation === 1) { - var alignTitle = GetValue$a(config, 'inputRow.alignTitle'); + var alignTitle = GetValue$c(config, 'inputRow.alignTitle'); if (alignTitle === undefined) { - var titleProportion = GetValue$a(_this.styles, 'inputRow.proportion.title'); + var titleProportion = GetValue$c(_this.styles, 'inputRow.proportion.title'); alignTitle = !titleProportion; } else { if (alignTitle) { @@ -60395,6 +59731,7 @@ _this.alignInputRowTitle = alignTitle; } else { _this.alignInputRowTitle = false; + _this.inputHandlers = _this.root.inputHandlers; } var background = CreateBackground(scene, undefined, config.background); if (background) { @@ -60415,6 +59752,529 @@ }(Sizer); Object.assign(TweakerShell.prototype, methods$1); + var SetInputTextReadOnly$3 = function SetInputTextReadOnly(gameObject, enable) { + if (enable === undefined) { + enable = true; + } + var inputText = gameObject.getElement('inputText'); + inputText.setReadOnly(enable); + }; + var TextInputHandler = { + name: 'TextInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'string'; + } + return typeof config.value === 'string'; + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.TextInput'; + var inputTextConfig = style.inputText; + var inputText = CreateInputText$1(scene, inputTextConfig); + gameObject.add(inputText, { + proportion: 1, + expand: true, + key: 'inputText' + }); + inputText.on('close', function () { + gameObject.setValue(inputText.value); + }); + }, + // Callback inside `setup()` + setup: function setup(gameObject, config, setDefaults) { + if (setDefaults || config.hasOwnProperty('inputTextReadOnly')) { + SetInputTextReadOnly$3(gameObject, !!config.inputTextReadOnly); + } + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var inputText = gameObject.getElement('inputText'); + inputText.setText(gameObject.getFotmatText(value)); + } + }; + + var CreateInputTextArea = function CreateInputTextArea(scene, config, deepCloneConfig) { + if (deepCloneConfig === undefined) { + deepCloneConfig = true; + } + if (deepCloneConfig) { + config = config ? DeepClone(config) : {}; + } else if (!config) { + config = {}; + } + var inputText = new TextAreaInput(scene, config); + scene.add.existing(inputText); + return inputText; + }; + + var SetInputTextReadOnly$2 = function SetInputTextReadOnly(gameObject, enable) { + if (enable === undefined) { + enable = true; + } + var inputText = gameObject.getElement('inputText'); + inputText.setReadOnly(enable); + }; + var TextAreaInputHandler = { + name: 'TextAreaInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'textarea'; + } + return false; + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + this.type = 'rexTweaker.TextAreaInput'; + var inputTextAreaConfig = style.inputTextArea; + if (inputTextAreaConfig === undefined) { + inputTextAreaConfig = {}; + } + if (!inputTextAreaConfig.hasOwnProperty('text')) { + inputTextAreaConfig.text = style.inputText; + } + if (!inputTextAreaConfig.hasOwnProperty('slider')) { + inputTextAreaConfig.slider = style.slider; + } + var inputText = CreateInputTextArea(scene, inputTextAreaConfig); + gameObject.add(inputText, { + proportion: 1, + expand: true, + key: 'inputText' + }); + inputText.on('close', function () { + gameObject.setValue(inputText.value); + }); + }, + // Callback inside `setup()` + setup: function setup(gameObject, config, setDefaults) { + if (setDefaults || config.hasOwnProperty('inputTextReadOnly')) { + SetInputTextReadOnly$2(gameObject, !!config.inputTextReadOnly); + } + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var inputText = gameObject.getElement('inputText'); + inputText.setText(gameObject.getFotmatText(value)); + } + }; + + var SetInputTextReadOnly$1 = function SetInputTextReadOnly(gameObject, enable) { + if (enable === undefined) { + enable = true; + } + var inputText = gameObject.getElement('inputText'); + inputText.setReadOnly(enable); + }; + var NumberInputHandler = { + name: 'NumberInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'number'; + } + return typeof config.value === 'number'; + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.NumberInput'; + var inputTextConfig = style.inputNumber || style.inputText; + var inputText = CreateInputText$1(scene, inputTextConfig).setNumberInput(); + gameObject.add(inputText, { + proportion: 1, + expand: true, + key: 'inputText' + }); + inputText.on('close', function () { + gameObject.setValue(inputText.value); + }); + }, + // Callback inside `setup()` + setup: function setup(gameObject, config, setDefaults) { + if (setDefaults || config.hasOwnProperty('inputTextReadOnly')) { + SetInputTextReadOnly$1(gameObject, !!config.inputTextReadOnly); + } + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var inputText = gameObject.getElement('inputText'); + inputText.setText(gameObject.getFotmatText(value)); + } + }; + + var CreateSlider = function CreateSlider(scene, config) { + var gameObject = new Slider(scene, config); + scene.add.existing(gameObject); + return gameObject; + }; + + var GetValue$b = Phaser.Utils.Objects.GetValue; + var Linear$1 = Phaser.Math.Linear; + var SnapFloor = Phaser.Math.Snap.Floor; + var SetRange = function SetRange(gameObject, min, max, step) { + gameObject.minValue = min; + gameObject.maxValue = max; + gameObject.step = step; + var slider = gameObject.getElement('slider'); + slider.setGap(step, min, max); + }; + var SetInputTextReadOnly = function SetInputTextReadOnly(gameObject, enable) { + if (enable === undefined) { + enable = true; + } + var inputText = gameObject.getElement('inputText'); + inputText.setReadOnly(enable); + }; + var RangeInputHandler = { + name: 'RangeInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'range'; + } + return typeof config.value === 'number' && config.hasOwnProperty('min') && config.hasOwnProperty('max'); + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.RangeInput'; + var sliderConfig = style.slider; + var trackSizeKey = gameObject.orientation === 0 ? 'track.height' : 'track.width'; + var trackSize = GetValue$b(sliderConfig, trackSizeKey); + var slider = CreateSlider(scene, sliderConfig); + var defaultProportion = style.parentOrientation === 1 ? 2 : 0; + var proportion = GetValue$b(style, 'proportion.range.slider', defaultProportion); + var expand = trackSize === undefined; + gameObject.add(slider, { + proportion: proportion, + expand: expand, + key: 'slider' + }); + var inputTextConfig = style.inputNumber || style.inputText; + var inputText = CreateInputText$1(scene, inputTextConfig).setNumberInput(); + var defaultProportion = style.parentOrientation === 1 ? 1 : 0; + var proportion = GetValue$b(style, 'proportion.range.inputText', defaultProportion); + gameObject.add(inputText, { + proportion: proportion, + expand: true, + key: 'inputText' + }); + inputText.on('close', function () { + gameObject.setValue(inputText.value); + }); + slider.on('valuechange', function () { + var value = Linear$1(gameObject.minValue, gameObject.maxValue, slider.value); + if (gameObject.step) { + value = SnapFloor(value, gameObject.step, gameObject.minValue); + } + gameObject.setValue(value); + }); + }, + // Callback inside `setup()` + setup: function setup(gameObject, config, setDefaults) { + if (setDefaults || config.hasOwnProperty('max')) { + SetRange(gameObject, config.min, config.max, config.step); + } + if (setDefaults || config.hasOwnProperty('inputTextReadOnly')) { + SetInputTextReadOnly(gameObject, !!config.inputTextReadOnly); + } + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var slider = gameObject.getElement('slider'); + slider.setValue(value, gameObject.minValue, gameObject.maxValue); + var inputText = gameObject.getElement('inputText'); + inputText.setText('').setText(gameObject.getFotmatText(value)); + } + }; + + var CreateColorInput = function CreateColorInput(scene, config, deepCloneConfig) { + if (deepCloneConfig === undefined) { + deepCloneConfig = true; + } + if (deepCloneConfig) { + config = config ? DeepClone(config) : {}; + } else if (!config) { + config = {}; + } + var inputText = new ColorInput(scene, config); + scene.add.existing(inputText); + return inputText; + }; + + var ColorInputHandler = { + name: 'ColorInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'color'; + } + return false; + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.ColorInput'; + var colorInputConfig = style.colorInput; + var colorInput = CreateColorInput(scene, colorInputConfig); + gameObject.add(colorInput, { + proportion: 1, + expand: true, + key: 'colorInput' + }); + colorInput.on('valuechange', function (value) { + gameObject.setValue(value); + }); + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var colorInput = gameObject.getElement('colorInput'); + colorInput.setValue(value); + } + }; + + var CreateCheckbox = function CreateCheckbox(scene, config) { + var gameObject = new Checkbox(scene, config); + scene.add.existing(gameObject); + return gameObject; + }; + + var CheckboxInputHandler = { + name: 'CheckboxInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'boolean'; + } + return typeof config.value === 'boolean'; + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.CheckboxInput'; + var checkboxConfig = style.checkbox; + var checkbox = CreateCheckbox(scene, checkboxConfig); + var size = checkboxConfig.size; + if (size !== undefined) { + checkbox.setSize(size, size); + } + var fitRatio = size !== undefined ? 0 : 1; + gameObject.add(checkbox, { + proportion: 0, + expand: false, + fitRatio: fitRatio, + key: 'checkbox' + }); + checkbox.on('valuechange', function (value) { + gameObject.setValue(value); + }); + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var checkbox = gameObject.getElement('checkbox'); + checkbox.setValue(value); + } + }; + + var CreateToggleSwitch = function CreateToggleSwitch(scene, config) { + var gameObject = new ToggleSwitch(scene, config); + scene.add.existing(gameObject); + return gameObject; + }; + + var ToggleSwitchInputHandler = { + name: 'ToggleSwitchInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'toggleSwitch'; + } + return false; + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.ToggleSwitchInput'; + var toggleSwitchConfig = style.toggleSwitch; + var toggleSwitch = CreateToggleSwitch(scene, toggleSwitchConfig); + var size = toggleSwitchConfig.size; + if (size !== undefined) { + toggleSwitch.setSize(size, size); + } + var fitRatio = size !== undefined ? 0 : 1; + gameObject.addSpace().add(toggleSwitch, { + proportion: 0, + expand: false, + fitRatio: fitRatio, + key: 'toggleSwitch' + }); + toggleSwitch.on('valuechange', function (value) { + gameObject.setValue(value); + }); + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var toggleSwitch = gameObject.getElement('toggleSwitch'); + toggleSwitch.setValue(value); + } + }; + + var CreateDropDownList = function CreateDropDownList(scene, config) { + config = BuildListConfig(scene, config); + var gameObject = new DropDownList(scene, config); + scene.add.existing(gameObject); + return gameObject; + }; + + var GetOptionIndex = function GetOptionIndex(options, value) { + for (var i = 0, cnt = options.length; i < cnt; i++) { + var option = options[i]; + if (option.value === value) { + return i; + } + } + return undefined; + }; + var GetOptionText = function GetOptionText(options, value) { + var index = GetOptionIndex(options, value); + if (index == null) { + return undefined; + } + return options[index].text; + }; + + var SetOptions$1 = function SetOptions(gameObject, options) { + var list = gameObject.getElement('list'); + list.setOptions(options); + }; + var ListInputHandler = { + name: 'ListInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'list'; + } + return config.hasOwnProperty('options'); + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.ListInput'; + var list = CreateDropDownList(scene, style.list); + gameObject.add(list, { + proportion: 1, + expand: true, + key: 'list' + }); + list.on('button.click', function (dropDownList, listPanel, button, index, pointer, event) { + gameObject.setValue(button.value); + }); + }, + // Callback inside `setup()` + setup: function setup(gameObject, config, setDefaults) { + if (setDefaults || config.hasOwnProperty('options')) { + SetOptions$1(gameObject, config.options); + } + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var list = gameObject.getElement('list'); + var text = GetOptionText(list.options, value); + list.resetDisplayContent({ + text: text + }); + } + }; + + var CreateButtons = function CreateButtons(scene, config) { + var gameObject = new Buttons$1(scene, config); + scene.add.existing(gameObject); + return gameObject; + }; + + var SetButtonsActiveStateByIndex = function SetButtonsActiveStateByIndex(buttons, index) { + for (var i = 0, cnt = buttons.length; i < cnt; i++) { + var button = buttons[i]; + if (!button) { + continue; + } + button.setActiveState(i === index); + } + }; + + var GetValue$a = Phaser.Utils.Objects.GetValue; + var SetOptions = function SetOptions(gameObject, options) { + var list = gameObject.getElement('list'); + list.options = options; + var scene = gameObject.scene; + var buttonConfig = list.buttonConfig; + list.clearButtons(true); + for (var i = 0, cnt = options.length; i < cnt; i++) { + var option = options[i]; + var button = CreateLabel(scene, buttonConfig).setActiveState(false).resetDisplayContent({ + text: option.text + }); + list.addButton(button); + } + }; + var ButtonsInputHandler = { + name: 'ButtonsInput', + accept: function accept(config) { + if (config.hasOwnProperty('view')) { + return config.view === 'buttons'; + } + return false; + }, + // Callback after `constructor()` + build: function build(gameObject, style) { + var scene = gameObject.scene; + gameObject.type = 'rexTweaker.ButtonsInput'; + + // TODO : DeepClone? + var buttonConfig = style.button ? DeepClone(style.button) : {}; + var buttonExpand = GetValue$a(buttonConfig, 'expand', true); + if (buttonExpand) { + buttonConfig.align = 'center'; + } + delete buttonConfig.expand; + var list = CreateButtons(scene, { + expand: buttonExpand + }); + list.buttonConfig = buttonConfig; + gameObject.add(list, { + proportion: 1, + expand: true, + key: 'list' + }); + list.on('button.click', function (button, index, pointer, event) { + var option = list.options[index]; + if (!option) { + return; // ?? + } + + gameObject._selectedIndex = index; + gameObject.setValue(option.value); + gameObject._selectedIndex = undefined; + }); + }, + // Callback inside `setup()` + setup: function setup(gameObject, config, setDefaults) { + if (setDefaults || config.hasOwnProperty('options')) { + SetOptions(gameObject, config.options); + } + }, + // Callback inside `setValue()` + displayValue: function displayValue(gameObject, value) { + var list = gameObject.getElement('list'); + var index = gameObject._selectedIndex; // See list's 'button.click' event + if (index === undefined) { + index = GetOptionIndex(list.options, value); + } + SetButtonsActiveStateByIndex(list.childrenMap.buttons, index); + } + }; + + var RegisterDefaultInputHandlers = function RegisterDefaultInputHandlers() { + this.registerInputHandler(TextInputHandler).registerInputHandler(TextAreaInputHandler).registerInputHandler(NumberInputHandler).registerInputHandler(RangeInputHandler).registerInputHandler(ColorInputHandler).registerInputHandler(CheckboxInputHandler).registerInputHandler(ToggleSwitchInputHandler).registerInputHandler(ListInputHandler).registerInputHandler(ButtonsInputHandler); + }; + var Tweaker = /*#__PURE__*/function (_TweakerShell) { _inherits(Tweaker, _TweakerShell); var _super = _createSuper(Tweaker); @@ -60434,9 +60294,22 @@ // Create sizer _this = _super.call(this, scene, config); _this.type = 'rexTweaker'; + _this.inputHandlers = []; + RegisterDefaultInputHandlers.call(_assertThisInitialized(_this)); return _this; } - return _createClass(Tweaker); + _createClass(Tweaker, [{ + key: "destroy", + value: function destroy(fromScene) { + // This Game Object has already been destroyed + if (!this.scene || this.ignoreDestroy) { + return; + } + _get(_getPrototypeOf(Tweaker.prototype), "destroy", this).call(this, fromScene); + this.inputHandlers = undefined; + } + }]); + return Tweaker; }(TweakerShell); ObjectFactory.register('tweaker', function (config) { diff --git a/dist/rexuiplugin.min.js b/dist/rexuiplugin.min.js index 0fe4a9c3e4..409a4e21bd 100644 --- a/dist/rexuiplugin.min.js +++ b/dist/rexuiplugin.min.js @@ -1,17 +1,17 @@ -!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).rexuiplugin=e();}(undefined,(function(){function t(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n);}return i}function e(e){for(var i=1;it.length)&&(e=t.length);for(var i=0,n=new Array(e);i=6?(n=[arguments[2],void 0,arguments[3]],s=[arguments[4],void 0,arguments[5]]):(n=M(n),s=M(s)),this.textureKey=t,this.baseFrameName=e,this.columns.data=n,this.columns.count=n?n.length:0,this.columns.stretch=0,this.columns.minWidth=0,this.columns.scale=1,this.rows.data=s,this.rows.count=s?s.length:0,this.rows.stretch=0,this.rows.minHeight=0,this.rows.scale=1;var r=this.scene.sys.textures.get(t);if(!r)return this.clear(),this;if(!n||!s)return this.clear(),this;for(var o=r.get(e),a=o.width,h=0,l=0,u=n.length;l0?0:g,b=0;l=0;for(var S=n.length;l0?0:y),y>=1&&g>=1){var P=i(k=this.getFrameNameCallback(l,C,e));"string"!==P&&"number"!==P||r.add(k,0,b+o.cutX,x+o.cutY,y,g);}b+=y;}x+=g;}return this.updateTexture(),this},updateTexture:function(){if(this.clear(),void 0===this.textureKey)return this;var t=this.scene.sys.textures.get(this.textureKey);if(!t)return this;var e,i,n,s,r,o,a,h=this.columns.minWidth*this.maxFixedPartScaleX,l=this.rows.minHeight*this.maxFixedPartScaleY,u=this.width-h,c=this.height-l,d=u>=0?this.maxFixedPartScaleX:this.width/h,f=c>=0?this.maxFixedPartScaleY:this.height/l;if(this.preserveRatio){var p=Math.min(d,f);if(d>p){var v=(d-p)*h;u>=0?u+=v:u=v,d=p;}if(f>p){var g=(f-p)*l;c>=0?c+=g:c=g,f=p;}}this.columns.scale=d,this.rows.scale=f,e=u>0&&this.columns.stretch>0?u/this.columns.stretch:0,i=c>0&&this.rows.stretch>0?c/this.rows.stretch:0;var y=0,k=0;this._beginDraw();for(var m=0,b=this.rows.count;m0&&a>0&&(0===(0===r.stretch&&0===s.stretch||0===this.getStretchMode(x,m)?0:1)?this._drawImage(this.textureKey,n,y,k,o,a):this._drawTileSprite(this.textureKey,n,y,k,o,a)),y+=o;k+=a;}this._endDraw();},setStretchMode:function(t){return E(t)?(this.stretchMode.edge=R(_(t,"edge",0)),this.stretchMode.internal=R(_(t,"internal",0))):(t=R(t),this.stretchMode.edge=t,this.stretchMode.internal=t),this},getStretchMode:function(t,e){return B.call(this,t,e)?this.stretchMode.edge:this.stretchMode.internal},setPreserveRatio:function(t){return null==t&&(t=!0),this.preserveRatio=t,this},setMaxFixedPartScale:function(t,e){return void 0===e&&(e=t),this.maxFixedPartScaleX=t,this.maxFixedPartScaleY=e,this}},j=Phaser.Utils.Objects.IsPlainObject,z=Phaser.Utils.Objects.GetValue,A=function(t,e){var i=function(t){a(s,t);var i=d(s);function s(t,r,o,a,h,l,u,c,d,f){var p;if(n(this,s),j(r)?(r=z(f=r,"x",0),o=z(f,"y",0),a=z(f,"width",1),h=z(f,"height",1),l=z(f,"key",void 0),u=z(f,"baseFrame",void 0),c=z(f,"columns",void 0),d=z(f,"rows",void 0)):j(a)?(a=z(f=a,"width",1),h=z(f,"height",1),l=z(f,"key",void 0),u=z(f,"baseFrame",void 0),c=z(f,"columns",void 0),d=z(f,"rows",void 0)):j(l)?(l=z(f=l,"key",void 0),u=z(f,"baseFrame",void 0),c=z(f,"columns",void 0),d=z(f,"rows",void 0)):j(u)?(u=z(f=u,"baseFrame",void 0),c=z(f,"columns",void 0),d=z(f,"rows",void 0)):Array.isArray(u)?(f=d,d=c,c=u,u=z(f,"baseFrame",void 0)):j(c)&&(c=z(f=c,"columns",void 0),d=z(f,"rows",void 0)),void 0===c){var v=z(f,"leftWidth",void 0),g=z(f,"rightWidth",void 0);void 0!==v&&void 0!==g&&(c=[v,void 0,g]);}if(void 0===d){var y=z(f,"topHeight",void 0),k=z(f,"bottomHeight",void 0);void 0!==y&&void 0!==k&&(d=[y,void 0,k]);}(p=i.call(this,t)).type=e,p.setPosition(r,o).setSize(a,h).setOrigin(.5,.5),p.columns={},p.rows={},p.stretchMode={},p._tileSprite=void 0,p._image=void 0,p.setGetFrameNameCallback(z(f,"getFrameNameCallback",void 0)),p.setStretchMode(z(f,"stretchMode",0)),p.setPreserveRatio(z(f,"preserveRatio",!0));var m=z(f,"maxFixedPartScale",1),b=z(f,"maxFixedPartScaleX",m),x=z(f,"maxFixedPartScaleY",void 0);return p.setMaxFixedPartScale(b,x),p.setBaseTexture(l,u,c,d),p}return r(s,[{key:"minWidth",get:function(){return this.columns.minWidth}},{key:"minHeight",get:function(){return this.rows.minHeight}},{key:"fixedPartScaleX",get:function(){return this.columns.scale}},{key:"fixedPartScaleY",get:function(){return this.rows.scale}},{key:"resize",value:function(t,e){return this.width===t&&this.height===e||(p(h(s.prototype),"resize",this)?p(h(s.prototype),"resize",this).call(this,t,e):p(h(s.prototype),"setSize",this).call(this,t,e),this.updateTexture()),this}}]),s}(t);return Object.assign(i.prototype,I),i},F=Phaser.Game,Y=function(t){return t instanceof F},W=Phaser.Scene,V=function(t){return t instanceof W},X=function(t){return null==t||"object"!==i(t)?null:Y(t)?t:Y(t.game)?t.game:V(t)?t.sys.game:V(t.scene)?t.scene.sys.game:void 0},G=Phaser.GameObjects,U=void 0,H=function(t,e){if(U||(U={},X(t).events.once("destroy",(function(){for(var t in U)U[t].destroy();U=void 0;}))),!U.hasOwnProperty(e)){var i=X(t).scene.systemScene;(t=new G[e](i)).setOrigin(0),U[e]=t;}return U[e]},N=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i)}(A(Phaser.GameObjects.RenderTexture,"rexNinePatch")),K={_drawImage:function(t,e,i,n,s,r){var o=H(this,"Image").setTexture(t,e).setDisplaySize(s,r);this.draw(o,i,n);},_drawTileSprite:function(t,e,i,n,s,r){var o=H(this,"TileSprite").setTexture(t,e).setSize(s,r);this.draw(o,i,n);}};Object.assign(N.prototype,K);var J=function(t){return null==t||""===t||0===t.length},Z=function(t,e,n,s){if(void 0===s&&(s="."),"object"===i(t)){if(J(e)){if(null==n)return;"object"===i(n)&&(t=n);}else {"string"==typeof e&&(e=e.split(s));var r=e.pop(),o=function(t,e,n){var s=t;if(J(e));else {var r;"string"==typeof e&&(e=e.split("."));for(var o=0,a=e.length;o0?this.items.pop():null}},{key:"push",value:function(t){return this.items.push(t),this}},{key:"pushMultiple",value:function(t){return this.items.push.apply(this.items,t),t.length=0,this}},{key:"clear",value:function(){return this.items.length=0,this}}]),t}(),rt=Phaser.Utils.Objects.GetValue,ot={},at=function(){function t(e){n(this,t),this.pools=rt(e,"pools",ot);}return r(t,[{key:"destroy",value:function(){this.pools=void 0;}},{key:"free",value:function(t){if(!this.pools)return this;var e=t.type;return this.pools.hasOwnProperty(e)||(this.pools[e]=new st),this.pools[e].push(t),t.onFree(),this}},{key:"freeMultiple",value:function(t){if(!this.pools)return this;for(var e=0,i=t.length;e0},yt=function(t,e){return t._depth-e._depth},kt=Phaser.GameObjects.Components;Phaser.Class.mixin(vt,[kt.Alpha,kt.BlendMode,kt.ComputedSize,kt.Depth,kt.GetBounds,kt.Mask,kt.Origin,kt.Pipeline,kt.PostPipeline,kt.ScrollFactor,kt.Transform,kt.Visible,Q,nt]);var mt="image",bt=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),s=t,r=i,o=0;ot.length)&&(e=t.length);for(var i=0,n=new Array(e);i=6?(n=[arguments[2],void 0,arguments[3]],s=[arguments[4],void 0,arguments[5]]):(n=M(n),s=M(s)),this.textureKey=t,this.baseFrameName=e,this.columns.data=n,this.columns.count=n?n.length:0,this.columns.stretch=0,this.columns.minWidth=0,this.columns.scale=1,this.rows.data=s,this.rows.count=s?s.length:0,this.rows.stretch=0,this.rows.minHeight=0,this.rows.scale=1;var r=this.scene.sys.textures.get(t);if(!r)return this.clear(),this;if(!n||!s)return this.clear(),this;for(var o=r.get(e),a=o.width,h=0,l=0,u=n.length;l0?0:g,b=0;l=0;for(var S=n.length;l0?0:y),y>=1&&g>=1){var P=i(k=this.getFrameNameCallback(l,C,e));"string"!==P&&"number"!==P||r.add(k,0,b+o.cutX,x+o.cutY,y,g);}b+=y;}x+=g;}return this.updateTexture(),this},updateTexture:function(){if(this.clear(),void 0===this.textureKey)return this;var t=this.scene.sys.textures.get(this.textureKey);if(!t)return this;var e,i,n,s,r,o,a,h=this.columns.minWidth*this.maxFixedPartScaleX,l=this.rows.minHeight*this.maxFixedPartScaleY,u=this.width-h,c=this.height-l,d=u>=0?this.maxFixedPartScaleX:this.width/h,f=c>=0?this.maxFixedPartScaleY:this.height/l;if(this.preserveRatio){var p=Math.min(d,f);if(d>p){var v=(d-p)*h;u>=0?u+=v:u=v,d=p;}if(f>p){var g=(f-p)*l;c>=0?c+=g:c=g,f=p;}}this.columns.scale=d,this.rows.scale=f,e=u>0&&this.columns.stretch>0?u/this.columns.stretch:0,i=c>0&&this.rows.stretch>0?c/this.rows.stretch:0;var y=0,k=0;this._beginDraw();for(var m=0,b=this.rows.count;m0&&a>0&&(0===(0===r.stretch&&0===s.stretch||0===this.getStretchMode(x,m)?0:1)?this._drawImage(this.textureKey,n,y,k,o,a):this._drawTileSprite(this.textureKey,n,y,k,o,a)),y+=o;k+=a;}this._endDraw();},setStretchMode:function(t){return E(t)?(this.stretchMode.edge=R(_(t,"edge",0)),this.stretchMode.internal=R(_(t,"internal",0))):(t=R(t),this.stretchMode.edge=t,this.stretchMode.internal=t),this},getStretchMode:function(t,e){return B.call(this,t,e)?this.stretchMode.edge:this.stretchMode.internal},setPreserveRatio:function(t){return null==t&&(t=!0),this.preserveRatio=t,this},setMaxFixedPartScale:function(t,e){return void 0===e&&(e=t),this.maxFixedPartScaleX=t,this.maxFixedPartScaleY=e,this}},j=Phaser.Utils.Objects.IsPlainObject,z=Phaser.Utils.Objects.GetValue,A=function(t,e){var i=function(t){a(s,t);var i=d(s);function s(t,r,o,a,h,l,u,c,d,f){var p;if(n(this,s),j(r)?(r=z(f=r,"x",0),o=z(f,"y",0),a=z(f,"width",1),h=z(f,"height",1),l=z(f,"key",void 0),u=z(f,"baseFrame",void 0),c=z(f,"columns",void 0),d=z(f,"rows",void 0)):j(a)?(a=z(f=a,"width",1),h=z(f,"height",1),l=z(f,"key",void 0),u=z(f,"baseFrame",void 0),c=z(f,"columns",void 0),d=z(f,"rows",void 0)):j(l)?(l=z(f=l,"key",void 0),u=z(f,"baseFrame",void 0),c=z(f,"columns",void 0),d=z(f,"rows",void 0)):j(u)?(u=z(f=u,"baseFrame",void 0),c=z(f,"columns",void 0),d=z(f,"rows",void 0)):Array.isArray(u)?(f=d,d=c,c=u,u=z(f,"baseFrame",void 0)):j(c)&&(c=z(f=c,"columns",void 0),d=z(f,"rows",void 0)),void 0===c){var v=z(f,"leftWidth",void 0),g=z(f,"rightWidth",void 0);void 0!==v&&void 0!==g&&(c=[v,void 0,g]);}if(void 0===d){var y=z(f,"topHeight",void 0),k=z(f,"bottomHeight",void 0);void 0!==y&&void 0!==k&&(d=[y,void 0,k]);}(p=i.call(this,t)).type=e,p.setPosition(r,o).setSize(a,h).setOrigin(.5,.5),p.columns={},p.rows={},p.stretchMode={},p._tileSprite=void 0,p._image=void 0,p.setGetFrameNameCallback(z(f,"getFrameNameCallback",void 0)),p.setStretchMode(z(f,"stretchMode",0)),p.setPreserveRatio(z(f,"preserveRatio",!0));var m=z(f,"maxFixedPartScale",1),b=z(f,"maxFixedPartScaleX",m),x=z(f,"maxFixedPartScaleY",void 0);return p.setMaxFixedPartScale(b,x),p.setBaseTexture(l,u,c,d),p}return r(s,[{key:"minWidth",get:function(){return this.columns.minWidth}},{key:"minHeight",get:function(){return this.rows.minHeight}},{key:"fixedPartScaleX",get:function(){return this.columns.scale}},{key:"fixedPartScaleY",get:function(){return this.rows.scale}},{key:"resize",value:function(t,e){return this.width===t&&this.height===e||(p(h(s.prototype),"resize",this)?p(h(s.prototype),"resize",this).call(this,t,e):p(h(s.prototype),"setSize",this).call(this,t,e),this.updateTexture()),this}}]),s}(t);return Object.assign(i.prototype,I),i},F=Phaser.Game,Y=function(t){return t instanceof F},W=Phaser.Scene,V=function(t){return t instanceof W},X=function(t){return null==t||"object"!==i(t)?null:Y(t)?t:Y(t.game)?t.game:V(t)?t.sys.game:V(t.scene)?t.scene.sys.game:void 0},G=Phaser.GameObjects,H=void 0,U=function(t,e){if(H||(H={},X(t).events.once("destroy",(function(){for(var t in H)H[t].destroy();H=void 0;}))),!H.hasOwnProperty(e)){var i=X(t).scene.systemScene;(t=new G[e](i)).setOrigin(0),H[e]=t;}return H[e]},N=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i)}(A(Phaser.GameObjects.RenderTexture,"rexNinePatch")),K={_drawImage:function(t,e,i,n,s,r){var o=U(this,"Image").setTexture(t,e).setDisplaySize(s,r);this.draw(o,i,n);},_drawTileSprite:function(t,e,i,n,s,r){var o=U(this,"TileSprite").setTexture(t,e).setSize(s,r);this.draw(o,i,n);}};Object.assign(N.prototype,K);var J=function(t){return null==t||""===t||0===t.length},Z=function(t,e,n,s){if(void 0===s&&(s="."),"object"===i(t)){if(J(e)){if(null==n)return;"object"===i(n)&&(t=n);}else {"string"==typeof e&&(e=e.split(s));var r=e.pop(),o=function(t,e,n){var s=t;if(J(e));else {var r;"string"==typeof e&&(e=e.split("."));for(var o=0,a=e.length;o0?this.items.pop():null}},{key:"push",value:function(t){return this.items.push(t),this}},{key:"pushMultiple",value:function(t){return this.items.push.apply(this.items,t),t.length=0,this}},{key:"clear",value:function(){return this.items.length=0,this}}]),t}(),rt=Phaser.Utils.Objects.GetValue,ot={},at=function(){function t(e){n(this,t),this.pools=rt(e,"pools",ot);}return r(t,[{key:"destroy",value:function(){this.pools=void 0;}},{key:"free",value:function(t){if(!this.pools)return this;var e=t.type;return this.pools.hasOwnProperty(e)||(this.pools[e]=new st),this.pools[e].push(t),t.onFree(),this}},{key:"freeMultiple",value:function(t){if(!this.pools)return this;for(var e=0,i=t.length;e0},yt=function(t,e){return t._depth-e._depth},kt=Phaser.GameObjects.Components;Phaser.Class.mixin(vt,[kt.Alpha,kt.BlendMode,kt.ComputedSize,kt.Depth,kt.GetBounds,kt.Mask,kt.Origin,kt.Pipeline,kt.PostPipeline,kt.ScrollFactor,kt.Transform,kt.Visible,Q,nt]);var mt="image",bt=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),s=t,r=i,o=0;o * @copyright 2019 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */Object.assign(wt.prototype,Ct);var St=Phaser.Math.DegToRad,Pt=Phaser.Math.RadToDeg,Tt=Phaser.Utils.Objects.GetValue,Ot=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"visible",get:function(){return this._visible},set:function(t){this.setDisplayListDirty(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.setDisplayListDirty(!!this._alpha!=!!t),this._alpha=t;}},{key:"setAlpha",value:function(t){return this.alpha=t,this}},{key:"setX",value:function(t){return this.x=t,this}},{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:"setRotation",value:function(t){return this.rotation=t,this}},{key:"angle",get:function(){return Pt(this.rotation)},set:function(t){this.rotation=St(t);}},{key:"setAngle",value:function(t){return this.angle=t,this}},{key:"setScaleX",value:function(t){return this.scaleX=t,this}},{key:"width",get:function(){return this._width},set:function(t){this._width=t;}},{key:"setWidth",value:function(t,e){return void 0===e&&(e=!1),this.width=t,e&&(this.scaleY=this.scaleX),this}},{key:"setScaleY",value:function(t){return this.scaleY=t,this}},{key:"setScale",value:function(t,e){return void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this}},{key:"height",get:function(){return this._height},set:function(t){this._height=t;}},{key:"setHeight",value:function(t,e){return void 0===e&&(e=!1),this.height=t,e&&(this.scaleX=this.scaleY),this}},{key:"displayWidth",get:function(){return this._width*this.scaleX},set:function(t){this.scaleX=t/this._width;}},{key:"setDisplayWidth",value:function(t,e){return void 0===e&&(e=!1),this.displayWidth=t,e&&(this.scaleY=this.scaleX),this}},{key:"displayHeight",get:function(){return this._height*this.scaleY},set:function(t){this.scaleY=t/this._height;}},{key:"setDisplayHeight",value:function(t,e){return void 0===e&&(e=!1),this.displayHeight=t,e&&(this.scaleX=this.scaleY),this}},{key:"setOriginX",value:function(t){return this.originX=t,this._displayOriginX=this.width*t,this}},{key:"setOriginY",value:function(t){return this.originY=t,this._displayOriginY=this.height*t,this}},{key:"setOrigin",value:function(t,e){return void 0===e&&(e=t),this.setOriginX(t).setOriginY(e),this}},{key:"depth",get:function(){return this._depth},set:function(t){this.setDisplayListDirty(this._depth!=t),this._depth=t;}},{key:"setDepth",value:function(t){return void 0===t&&(t=0),this.depth=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=Tt(t,"width",void 0),i=Tt(t,"height",void 0),n=Tt(t,"scale",void 0),s=Tt(t,"scaleX",n),r=Tt(t,"scaleY",n);void 0!==e?void 0===i&&void 0===r?this.setWidth(e,!0):this.setWidth(e):void 0!==s?this.setScaleX(s):t.hasOwnProperty("displayWidth")&&this.setDisplayWidth(t.displayWidth),void 0!==i?void 0===e&&void 0===s?this.setHeight(i,!0):this.setHeight(i):void 0!==r?this.setScaleY(r):t.hasOwnProperty("displayHeight")&&this.setDisplayHeight(t.displayHeight);var o=Tt(t,"origin",void 0);return void 0!==o?this.setOrigin(o):(t.hasOwnProperty("originX")&&this.setOriginX(t.originX),t.hasOwnProperty("originY")&&this.setOriginY(t.originY)),t.hasOwnProperty("depth")&&this.setDepth(t.depth),this}},{key:"reset",value:function(){return p(h(i.prototype),"reset",this).call(this),this.setVisible().setAlpha(1).setPosition(0,0).setRotation(0).setScale(1,1).setOrigin(0).setDepth(0),this}},{key:"webglRender",value:function(t,e,i,n,s,r,o,a){}},{key:"canvasRender",value:function(t,e,i,n){}}]),i}(wt),Mt=Phaser.GameObjects.Components.TransformMatrix,Et=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,_t=new Mt,Rt=Phaser.Utils.Objects.IsPlainObject,Lt=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,mt)).setFrame(s),r}return r(i,[{key:"width",get:function(){return this._width},set:function(t){}},{key:"height",get:function(){return this._height},set:function(t){}},{key:"setFrame",value:function(t){return arguments.length>0&&!Rt(t)&&(t=this.parent.texture.get(t)),this.frame=t,this._width=t?t.width:0,this._height=t?t.height:0,this}},{key:"setFlipX",value:function(t){return void 0===t&&(t=!0),this.flipX=t,this}},{key:"setFlipY",value:function(t){return void 0===t&&(t=!0),this.flipY=t,this}},{key:"resetFlip",value:function(){return this.flipX=!1,this.flipY=!1,this}},{key:"tint",get:function(){return void 0===this._tint?this.parent.tint:this._tint},set:function(t){this._tint=t;}},{key:"setTint",value:function(t){return this.tint=t,this.tintFill=!1,this}},{key:"setTintFill",value:function(t){return this.tint=t,this.tintFill=!0,this}},{key:"clearTint",value:function(){return this.setTint(16777215),this}},{key:"resetTint",value:function(){return this.tint=void 0,this.tintFill=void 0,this}},{key:"tintFill",get:function(){return void 0===this._tintFill?this.parent.tintFill:this._tintFill},set:function(t){this._tintFill=t;}},{key:"reset",value:function(){return p(h(i.prototype),"reset",this).call(this),this.resetFlip().resetTint().setFrame(),this}},{key:"modifyPorperties",value:function(t){return t?(t.hasOwnProperty("width")&&(t.displayWidth=t.width,delete t.width),t.hasOwnProperty("height")&&(t.displayHeight=t.height,delete t.height),t.hasOwnProperty("frame")&&this.setFrame(t.frame),p(h(i.prototype),"modifyPorperties",this).call(this,t),t.hasOwnProperty("flipX")&&this.setFlipX(t.flipX),t.hasOwnProperty("flipY")&&this.setFlipY(t.flipY),t.hasOwnProperty("tint")&&this.setTint(t.tint),t.hasOwnProperty("tintFill")&&this.setTintFill(t.tintFill),this):this}}]),i}(Ot),Bt={webglRender:function(t,e,i,n,s,r,o,a){var h=this._width,l=this._height,u=h*this.originX,c=l*this.originY,d=this.x-n,f=this.y-s,p=1,v=1;this.flipX&&(d+=h-2*u,p=-1),this.flipY&&(f+=l-2*c,v=-1),_t.applyITRS(d,f,this.rotation,this.scaleX*p,this.scaleY*v),e.multiply(_t,_t);var g=-u,y=-c,k=g+h,m=y+l,b=_t.setQuad(g,y,k,m,a),x=this.frame.u0,C=this.frame.v0,w=this.frame.u1,S=this.frame.v1,P=Et(this.tint,this.alpha*i);t.batchQuad(this.parent,b[0],b[1],b[2],b[3],b[4],b[5],b[6],b[7],x,C,w,S,P,P,P,P,this.tintFill,r,o);},canvasRender:function(t,e,i,n){t.save();var s=this._width,r=this._height,o=s*this.originX,a=r*this.originY,h=this.x-o,l=this.y-a,u=1,c=1;this.flipX&&(h+=s,u=-1),this.flipY&&(l+=r,c=-1),n&&(h=Math.round(h),l=Math.round(l)),t.translate(h,l),t.rotate(this.rotation),t.scale(this.scaleX*u,this.scaleY*c);var d=this.frame;t.drawImage(d.source.image,d.cutX,d.cutY,s,r,0,0,s,r),t.restore();}};Object.assign(Lt.prototype,Bt);var Dt=function(t,e){"string"==typeof e&&(e={frame:e});var i=t.poolManager?t.poolManager.allocate(mt):null;return null===i?i=new Lt(t):i.setParent(t).setActive(),i.modifyPorperties(e),t.addChild(i),i},It={_drawImage:function(t,e,i,n,s,r){Dt(this,{frame:e,x:i,y:n,width:s,height:r});},_drawTileSprite:function(t,e,i,n,s,r){var o=this.texture.get(e),a=o.width,h=o.height,l=Math.floor(s/a),u=Math.floor(r/h);i+=(s-l*a)/2,n+=(r-u*h)/2;for(var c=0;c=0||t.y>=0,t.x=Math.abs(t.x),t.y=Math.abs(t.y);},Vt=function(t,e,i){var n=i.length;if(n>=2){var s=i[n-2],r=i[n-1];if(t===s&&e===r)return i}return i.push(t,e),i},Xt=Phaser.Math.DegToRad,Gt=function(t,e,i,n,s,r,o,a,h){o&&r>s?r-=360:!o&&r>>16,a=(65280&s)>>>8,h=255&s;t.fillStyle="rgba("+o+","+a+","+h+","+r+")";},qt=function(t,e,i,n){var s=i||e.strokeColor,r=n||e.strokeAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.strokeStyle="rgba("+o+","+a+","+h+","+r+")",t.lineWidth=e.lineWidth;},$t=Phaser.Renderer.Canvas.SetTransform,Qt={renderWebGL:function(t,e,i,n){e.dirty&&(e.updateData(),e.dirty=!1),i.addToRenderList(e);var s=t.pipelines.set(e.pipeline),r=Jt(e,i,n),o=s.calcMatrix.copyFrom(r.calc),a=e._displayOriginX,h=e._displayOriginY,l=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&Ht(s,o,e,l,a,h),e.isStroked&&Kt(s,e,l,a,h),t.pipelines.postBatch(e);},renderCanvas:function(t,e,i,n){e.dirty&&(e.updateData(),e.dirty=!1),i.addToRenderList(e);var s=t.currentContext;if($t(t,s,e,i,n)){var r=e._displayOriginX,o=e._displayOriginY,a=e.pathData,h=a.length-1,l=a[0]-r,u=a[1]-o;s.beginPath(),s.moveTo(l,u),e.closePath||(h-=2);for(var c=2;c0;}},{key:"fillAlpha",get:function(){return this._fillAlpha},set:function(t){this._fillAlpha=t,this.isFilled=t>0&&null!=this._fillColor;}},{key:"setFillStyle",value:function(t,e){return void 0===e&&(e=1),this.fillColor=t,this.fillAlpha=e,this}},{key:"strokeColor",get:function(){return this._strokeColor},set:function(t){this._strokeColor=t,this.isStroked=null!=t&&this._strokeAlpha>0&&this._lineWidth>0;}},{key:"strokeAlpha",get:function(){return this._strokeAlpha},set:function(t){this._strokeAlpha=t,this.isStroked=t>0&&null!=this._strokeColor&&this._lineWidth>0;}},{key:"lineWidth",get:function(){return this._lineWidth},set:function(t){this._lineWidth=t,this.isStroked=t>0&&null!=this._strokeColor;}},{key:"setStrokeStyle",value:function(t,e,i){return void 0===i&&(i=1),this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this}},{key:"updateData",value:function(){var t=this.geom,e=this.pathData;e.length=0;var i,n=t.width,s=t.height,r=t.cornerRadius,o=this.iteration+1;if(i=r.tl,re(i))if(i.convex){var a=i.x,h=i.y;Gt(a,h,i.x,i.y,180,270,!1,o,e);}else {Gt(a=0,h=0,i.x,i.y,90,0,!0,o,e);}else Vt(0,0,e);if(i=r.tr,re(i))if(i.convex){a=n-i.x,h=i.y;Gt(a,h,i.x,i.y,270,360,!1,o,e);}else {Gt(a=n,h=0,i.x,i.y,180,90,!0,o,e);}else Vt(n,0,e);if(i=r.br,re(i))if(i.convex){a=n-i.x,h=s-i.y;Gt(a,h,i.x,i.y,0,90,!1,o,e);}else {Gt(a=n,h=s,i.x,i.y,270,180,!0,o,e);}else Vt(n,s,e);if(i=r.bl,re(i))if(i.convex){a=i.x,h=s-i.y;Gt(a,h,i.x,i.y,90,180,!1,o,e);}else {Gt(a=0,h=s,i.x,i.y,360,270,!0,o,e);}else Vt(0,s,e);return e.push(e[0],e[1]),this.pathIndexes=ne(e),this}},{key:"setShapeType",value:function(t){return "string"==typeof t&&(t=oe[t]),this.shapeType=t,this}},{key:"width",get:function(){return this.geom.width},set:function(t){this.resize(t,this.height);}},{key:"height",get:function(){return this.geom.height},set:function(t){this.resize(this.width,t);}},{key:"setSize",value:function(t,e){if(void 0===e&&(e=t),this.geom.width===t&&this.geom.height===e)return this;this.geom.setSize(t,e),1===this.shapeType&&this.setRadius({x:t/2,y:e/2}),this.updateDisplayOrigin(),this.dirty=!0;var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this}},{key:"resize",value:function(t,e){return this.setSize(t,e),this}},{key:"radius",get:function(){return this.geom.radius},set:function(t){this.geom.setRadius(t),this.updateDisplayOrigin(),this.dirty=!0;}},{key:"radiusTL",get:function(){return this.geom.radiusTL},set:function(t){this.geom.radiusTL=t,this.dirty=!0;}},{key:"radiusTR",get:function(){return this.geom.radiusTR},set:function(t){this.geom.radiusTR=t,this.dirty=!0;}},{key:"radiusBL",get:function(){return this.geom.radiusBL},set:function(t){this.geom.radiusBL=t,this.dirty=!0;}},{key:"radiusBR",get:function(){return this.geom.radiusBR},set:function(t){this.geom.radiusBR=t,this.dirty=!0;}},{key:"setRadius",value:function(t){return void 0===t&&(t=0),this.radius=t,this}},{key:"setRadiusTL",value:function(t){return void 0===t&&(t=0),this.radiusTL=t,this}},{key:"setRadiusTR",value:function(t){return void 0===t&&(t=0),this.radiusTR=t,this}},{key:"setRadiusBL",value:function(t){return void 0===t&&(t=0),this.radiusBL=t,this}},{key:"setRadiusBR",value:function(t){return void 0===t&&(t=0),this.radiusBR=t,this}},{key:"cornerRadius",get:function(){return this.geom.cornerRadius},set:function(t){this.radius=t;}},{key:"setCornerRadius",value:function(t){return this.setRadius(t)}},{key:"iteration",get:function(){return this._iteration},set:function(t){void 0!==this._iteration?this._iteration!==t&&(this._iteration=t,this.dirty=!0):this._iteration=t;}},{key:"setIteration",value:function(t){return void 0===t&&(t=6),this.iteration=t,this}}]),i}(te),re=function(t){return t.x>0&&t.y>0},oe={rectangle:0,circle:1};Object.assign(se.prototype,Qt),T.register("roundRectangle",(function(t,e,i,n,s,r,o){var a=new se(this.scene,t,e,i,n,s,r,o);return this.scene.add.existing(a),a})),Z(window,"RexPlugins.UI.RoundRectangle",se);var ae=Phaser.Renderer.WebGL.Utils,he={renderWebGL:function(t,e,i,n){if(e.dirty&&(e.updateTexture(),e.dirty=!1),0!==e.width&&0!==e.height){i.addToRenderList(e);var s=e.frame,r=s.width,o=s.height,a=ae.getTintAppendFloatAlpha,h=t.pipelines.set(e.pipeline,e),l=h.setTexture2D(s.glTexture,e);t.pipelines.preBatch(e),h.batchTexture(e,s.glTexture,r,o,e.x,e.y,r/e.resolution,o/e.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,r,o,a(e.tintTopLeft,i.alpha*e._alphaTL),a(e.tintTopRight,i.alpha*e._alphaTR),a(e.tintBottomLeft,i.alpha*e._alphaBL),a(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,0,0,i,n,!1,l),t.pipelines.postBatch(e);}},renderCanvas:function(t,e,i,n){e.dirty&&(e.updateTexture(),e.dirty=!1),0!==e.width&&0!==e.height&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,n));}},le=Phaser.Display.Color,ue={clear:function(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.dirty=!0,this},fill:function(t){return this.context.fillStyle=t,this.context.fillRect(0,0,this.canvas.width,this.canvas.height),this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r,o,a,h,l){var u=this.scene.sys.textures.getFrame(t,e);if(!u)return this;var c=u.cutWidth,d=u.cutHeight;void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=c),void 0===r&&(r=d),void 0===o&&(o=0),void 0===a&&(a=0),void 0===h&&(h=c),void 0===l&&(l=d);var f=u.cutX+o,p=u.cutY+a;return this.context.drawImage(u.source.image,f,p,h,l,i,n,s,r),this.dirty=!0,this},getDataURL:function(t,e){return this.canvas.toDataURL(t,e)},getPixel:function(t,e,i){void 0===i&&(i=new le);var n=this.context.getImageData(t,e,1,1);return i.setTo(n.data[0],n.data[1],n.data[2],n.data[3]),i},setPixel:function(t,e,i,n,s,r){if("number"!=typeof i){var o=i;i=o.red,n=o.green,s=o.blue,r=o.alpha;}void 0===r&&(r=0!==i||0!==n||0!==s?255:0);var a=this.context.createImageData(1,1);return a.data[0]=i,a.data[1]=n,a.data[2]=s,a.data[3]=r,this.context.putImageData(a,t,e),this.dirty=!0,this}},ce=function(t,e,i,n,s,r,o){var a,h=t.sys.textures,l=t.renderer;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=e.width),void 0===o&&(o=e.height);var u=(a=h.exists(i)?h.get(i):h.createCanvas(i,r,o)).getSourceImage();u.width!==r&&(u.width=r),u.height!==o&&(u.height=o);var c=u.getContext("2d",{willReadFrequently:!0});c.clearRect(0,0,r,o),c.drawImage(e,n,s,r,o),l.gl&&a&&l.canvasToTexture(u,a.source[0].glTexture,!0,0);},de={updateTexture:function(t,e){t&&(e?t.call(e,this.canvas,this.context):t(this.canvas,this.context)),this.canvas.width===this.frame.width&&this.canvas.height===this.frame.height||this.frame.setSize(this.canvas.width,this.canvas.height),this.renderer&&this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(this.canvas,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!1;var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=this.width,i.hitArea.height=this.height),this},generateTexture:function(t,e,i,n,s){var r=this.canvas;return void 0===n?n=r.width:n*=this.resolution,void 0===s?s=r.height:s*=this.resolution,ce(this.scene,r,t,e,i,n,s),this},loadTexture:function(t,e){var i=this.scene.sys.textures.getFrame(t,e);return i?(this.width!==i.cutWidth||this.height!==i.cutHeight?this.setSize(i.cutWidth,i.cutHeight):this.clear(),this.drawFrame(t,e),this.dirty=!0,this):this}};lt();var fe=Phaser.Display.Canvas.CanvasPool,pe=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,"rexCanvas")).renderer=t.sys.game.renderer,h.resolution=1,h._width=o,h._height=a,o=Math.max(Math.ceil(o*h.resolution),1),a=Math.max(Math.ceil(a*h.resolution),1),h.canvas=fe.create(u(h),o,a),h.context=h.canvas.getContext("2d",{willReadFrequently:!0}),h.dirty=!1,h.setPosition(s,r),h.setOrigin(.5,.5),h.initPipeline(),h.initPostPipeline(!0),h._crop=h.resetCropObject(),h.texture=t.sys.textures.addCanvas(null,h.canvas,!0),h.frame=h.texture.get(),h.frame.source.resolution=h.resolution,h.renderer&&h.renderer.gl&&(h.renderer.deleteTexture(h.frame.source.glTexture),h.frame.source.glTexture=null),h.dirty=!0,h}return r(i,[{key:"preDestroy",value:function(){fe.remove(this.canvas),this.texture.destroy(),this.canvas=null,this.context=null;}},{key:"width",get:function(){return this._width},set:function(t){this.setSize(t,this._height);}},{key:"height",get:function(){return this._height},set:function(t){this.setSize(this._width,t);}},{key:"setCanvasSize",value:function(t,e){return this._width===t&&this._height===e||(this._width=t,this._height=e,this.updateDisplayOrigin(),t=Math.max(Math.ceil(t*this.resolution),1),e=Math.max(Math.ceil(e*this.resolution),1),this.canvas.width=t,this.canvas.height=e,this.frame.setSize(t,e),this.dirty=!0),this}},{key:"setSize",value:function(t,e){return this.setCanvasSize(t,e),this}},{key:"displayWidth",get:function(){return this.scaleX*this._width},set:function(t){this.scaleX=t/this._width;}},{key:"displayHeight",get:function(){return this.scaleY*this._height},set:function(t){this.scaleY=t/this._height;}},{key:"setDisplaySize",value:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}},{key:"getCanvas",value:function(t){return t||(this.dirty=!0),this.canvas}},{key:"getContext",value:function(t){return t||(this.dirty=!0),this.context}},{key:"needRedraw",value:function(){return this.dirty=!0,this}},{key:"resize",value:function(t,e){return this.setSize(t,e),this}}]),i}(Phaser.GameObjects.GameObject),ve=Phaser.GameObjects.Components;Phaser.Class.mixin(pe,[ve.Alpha,ve.BlendMode,ve.Crop,ve.Depth,ve.Flip,ve.GetBounds,ve.Mask,ve.Origin,ve.Pipeline,ve.PostPipeline,ve.ScrollFactor,ve.Tint,ve.Transform,ve.Visible,he,ue,de]);var ge=Phaser.Utils.String.Pad,ye=function(t,e,n){if(null==t)return t;switch(i(t)){case"string":default:return t;case"number":return "#".concat(ge(Math.floor(t).toString(16),6,"0",1));case"function":return t(e,n);case"object":return t.hasOwnProperty("r")?t.hasOwnProperty("a")?"rgba(".concat(t.r,",").concat(t.g,",").concat(t.b,",").concat(t.a,")"):"rgb(".concat(t.r,",").concat(t.g,",").concat(t.b,")"):t.hasOwnProperty("h")?t.hasOwnProperty("a")?"hsla(".concat(t.h,",").concat(t.s,",").concat(t.l,",").concat(t.a,")"):"hsl(".concat(t.h,",").concat(t.s,",").concat(t.l,")"):t}},ke=Phaser.Math.DegToRad,me=function(t,e,i,n,s,r,o){var a,h,l,u,c,d=new At(e,i,n,s,r),f=d.minWidth,p=d.minHeight,v=n>=f?1:n/f,g=s>=p?1:s/p,y=d.cornerRadius;t.save(),t.beginPath(),t.translate(e,i),a=y.tl,xe(a)?(h=a.x*v,l=a.y*g,be(a)?Ce(t,h,l,h,l,180,270,!1,o):Ce(t,0,0,h,l,90,0,!0,o),u=0,c=l):(t.lineTo(0,0),u=0,c=0),a=y.tr,xe(a)?(h=a.x*v,l=a.y*g,be(a)?Ce(t,n-h,l,h,l,270,360,!1,o):Ce(t,n,0,h,l,180,90,!0,o)):t.lineTo(n,0),a=y.br,xe(a)?(h=a.x*v,l=a.y*g,be(a)?Ce(t,n-h,s-l,h,l,0,90,!1,o):Ce(t,n,s,h,l,270,180,!0,o)):t.lineTo(n,s),a=y.bl,xe(a)?(h=a.x*v,l=a.y*g,be(a)?Ce(t,h,s-l,h,l,90,180,!1,o):Ce(t,0,s,h,l,360,270,!0,o)):t.lineTo(0,s),t.lineTo(u,c),t.closePath(),t.restore();},be=function(t){return !t.hasOwnProperty("convex")||t.convex},xe=function(t){return t.x>0&&t.y>0},Ce=function(t,e,i,n,s,r,o,a,h){if(a&&o>r?o-=360:!a&&o0&&(e.strokeStyle=h,e.lineWidth=l,e.stroke());}(t.canvas,t.context,u,u,h,l,s,e,i,n,r,o,a);}},Se=function(){we(this,this.fillStyle,this.strokeStyle,this.lineWidth,this.radius,this.fillColor2,this.isHorizontalGradient,this.iteration);},Pe=Phaser.Utils.Objects.GetValue,Te=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l,u,c,d,f){var p;n(this,i),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=1),void 0===a&&(a=o),void 0===h&&(h=0),(p=e.call(this,t,s,r,o,a)).type="rexRoundRectangleCanvas";var v=Pe(h,"radius",h),g=Pe(h,"iteration",void 0);return p.setRadius(v),p.setIteration(g),p.setFillStyle(l,d,f),p.setStrokeStyle(u,c),p}return r(i,[{key:"radius",get:function(){return this._radius},set:function(t){this.dirty|=this._radius!=t,this._radius=t;}},{key:"setRadius",value:function(t){return this.radius=t,this}},{key:"iteration",get:function(){return this._iteration},set:function(t){this.dirty|=this._iteration!=t,this._iteration=t;}},{key:"setIteration",value:function(t){return this.iteration=t,this}},{key:"fillStyle",get:function(){return this._fillStyle},set:function(t){t=ye(t,this.canvas,this.context),this.dirty|=this._fillStyle!=t,this._fillStyle=t;}},{key:"fillColor2",get:function(){return this._fillColor2},set:function(t){t=ye(t,this.canvas,this.context),this.dirty|=this._fillColor2!=t,this._fillColor2=t;}},{key:"isHorizontalGradient",get:function(){return this._isHorizontalGradient},set:function(t){this.dirty|=this._isHorizontalGradient!=t,this._isHorizontalGradient=t;}},{key:"setFillStyle",value:function(t,e,i){return void 0===i&&(i=!0),this.fillStyle=t,this.fillColor2=e,this.isHorizontalGradient=i,this}},{key:"strokeStyle",get:function(){return this._strokeStyle},set:function(t){t=ye(t,this.canvas,this.context),this.dirty|=this._strokeStyle!=t,this._strokeStyle=t;}},{key:"lineWidth",get:function(){return this._lineWidth},set:function(t){this.dirty|=this._lineWidth!=t,this._lineWidth=t;}},{key:"setStrokeStyle",value:function(t,e){return this.strokeStyle=t,this.lineWidth=e,this}},{key:"updateTexture",value:function(){return this.clear(),Se.call(this),p(h(i.prototype),"updateTexture",this).call(this),this}}]),i}(pe);T.register("roundRectangleCanvas",(function(t,e,i,n,s,r,o,a,h,l){var u=new Te(this.scene,t,e,i,n,s,r,o,a,h,l);return this.scene.add.existing(u),u})),Z(window,"RexPlugins.UI.RoundRectangleCanvas",Te); + */Object.assign(wt.prototype,Ct);var St=Phaser.Math.DegToRad,Pt=Phaser.Math.RadToDeg,Tt=Phaser.Utils.Objects.GetValue,Ot=function(t){a(i,t);var e=d(i);function i(){return n(this,i),e.apply(this,arguments)}return r(i,[{key:"visible",get:function(){return this._visible},set:function(t){this.setDisplayListDirty(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.setDisplayListDirty(!!this._alpha!=!!t),this._alpha=t;}},{key:"setAlpha",value:function(t){return this.alpha=t,this}},{key:"setX",value:function(t){return this.x=t,this}},{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:"setRotation",value:function(t){return this.rotation=t,this}},{key:"angle",get:function(){return Pt(this.rotation)},set:function(t){this.rotation=St(t);}},{key:"setAngle",value:function(t){return this.angle=t,this}},{key:"setScaleX",value:function(t){return this.scaleX=t,this}},{key:"width",get:function(){return this._width},set:function(t){this._width=t;}},{key:"setWidth",value:function(t,e){return void 0===e&&(e=!1),this.width=t,e&&(this.scaleY=this.scaleX),this}},{key:"setScaleY",value:function(t){return this.scaleY=t,this}},{key:"setScale",value:function(t,e){return void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this}},{key:"height",get:function(){return this._height},set:function(t){this._height=t;}},{key:"setHeight",value:function(t,e){return void 0===e&&(e=!1),this.height=t,e&&(this.scaleX=this.scaleY),this}},{key:"displayWidth",get:function(){return this._width*this.scaleX},set:function(t){this.scaleX=t/this._width;}},{key:"setDisplayWidth",value:function(t,e){return void 0===e&&(e=!1),this.displayWidth=t,e&&(this.scaleY=this.scaleX),this}},{key:"displayHeight",get:function(){return this._height*this.scaleY},set:function(t){this.scaleY=t/this._height;}},{key:"setDisplayHeight",value:function(t,e){return void 0===e&&(e=!1),this.displayHeight=t,e&&(this.scaleX=this.scaleY),this}},{key:"setOriginX",value:function(t){return this.originX=t,this._displayOriginX=this.width*t,this}},{key:"setOriginY",value:function(t){return this.originY=t,this._displayOriginY=this.height*t,this}},{key:"setOrigin",value:function(t,e){return void 0===e&&(e=t),this.setOriginX(t).setOriginY(e),this}},{key:"depth",get:function(){return this._depth},set:function(t){this.setDisplayListDirty(this._depth!=t),this._depth=t;}},{key:"setDepth",value:function(t){return void 0===t&&(t=0),this.depth=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=Tt(t,"width",void 0),i=Tt(t,"height",void 0),n=Tt(t,"scale",void 0),s=Tt(t,"scaleX",n),r=Tt(t,"scaleY",n);void 0!==e?void 0===i&&void 0===r?this.setWidth(e,!0):this.setWidth(e):void 0!==s?this.setScaleX(s):t.hasOwnProperty("displayWidth")&&this.setDisplayWidth(t.displayWidth),void 0!==i?void 0===e&&void 0===s?this.setHeight(i,!0):this.setHeight(i):void 0!==r?this.setScaleY(r):t.hasOwnProperty("displayHeight")&&this.setDisplayHeight(t.displayHeight);var o=Tt(t,"origin",void 0);return void 0!==o?this.setOrigin(o):(t.hasOwnProperty("originX")&&this.setOriginX(t.originX),t.hasOwnProperty("originY")&&this.setOriginY(t.originY)),t.hasOwnProperty("depth")&&this.setDepth(t.depth),this}},{key:"reset",value:function(){return p(h(i.prototype),"reset",this).call(this),this.setVisible().setAlpha(1).setPosition(0,0).setRotation(0).setScale(1,1).setOrigin(0).setDepth(0),this}},{key:"webglRender",value:function(t,e,i,n,s,r,o,a){}},{key:"canvasRender",value:function(t,e,i,n){}}]),i}(wt),Mt=Phaser.GameObjects.Components.TransformMatrix,Et=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,_t=new Mt,Rt=Phaser.Utils.Objects.IsPlainObject,Lt=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),(r=e.call(this,t,mt)).setFrame(s),r}return r(i,[{key:"width",get:function(){return this._width},set:function(t){}},{key:"height",get:function(){return this._height},set:function(t){}},{key:"setFrame",value:function(t){return arguments.length>0&&!Rt(t)&&(t=this.parent.texture.get(t)),this.frame=t,this._width=t?t.width:0,this._height=t?t.height:0,this}},{key:"setFlipX",value:function(t){return void 0===t&&(t=!0),this.flipX=t,this}},{key:"setFlipY",value:function(t){return void 0===t&&(t=!0),this.flipY=t,this}},{key:"resetFlip",value:function(){return this.flipX=!1,this.flipY=!1,this}},{key:"tint",get:function(){return void 0===this._tint?this.parent.tint:this._tint},set:function(t){this._tint=t;}},{key:"setTint",value:function(t){return this.tint=t,this.tintFill=!1,this}},{key:"setTintFill",value:function(t){return this.tint=t,this.tintFill=!0,this}},{key:"clearTint",value:function(){return this.setTint(16777215),this}},{key:"resetTint",value:function(){return this.tint=void 0,this.tintFill=void 0,this}},{key:"tintFill",get:function(){return void 0===this._tintFill?this.parent.tintFill:this._tintFill},set:function(t){this._tintFill=t;}},{key:"reset",value:function(){return p(h(i.prototype),"reset",this).call(this),this.resetFlip().resetTint().setFrame(),this}},{key:"modifyPorperties",value:function(t){return t?(t.hasOwnProperty("width")&&(t.displayWidth=t.width,delete t.width),t.hasOwnProperty("height")&&(t.displayHeight=t.height,delete t.height),t.hasOwnProperty("frame")&&this.setFrame(t.frame),p(h(i.prototype),"modifyPorperties",this).call(this,t),t.hasOwnProperty("flipX")&&this.setFlipX(t.flipX),t.hasOwnProperty("flipY")&&this.setFlipY(t.flipY),t.hasOwnProperty("tint")&&this.setTint(t.tint),t.hasOwnProperty("tintFill")&&this.setTintFill(t.tintFill),this):this}}]),i}(Ot),Bt={webglRender:function(t,e,i,n,s,r,o,a){var h=this._width,l=this._height,u=h*this.originX,c=l*this.originY,d=this.x-n,f=this.y-s,p=1,v=1;this.flipX&&(d+=h-2*u,p=-1),this.flipY&&(f+=l-2*c,v=-1),_t.applyITRS(d,f,this.rotation,this.scaleX*p,this.scaleY*v),e.multiply(_t,_t);var g=-u,y=-c,k=g+h,m=y+l,b=_t.setQuad(g,y,k,m,a),x=this.frame.u0,C=this.frame.v0,w=this.frame.u1,S=this.frame.v1,P=Et(this.tint,this.alpha*i);t.batchQuad(this.parent,b[0],b[1],b[2],b[3],b[4],b[5],b[6],b[7],x,C,w,S,P,P,P,P,this.tintFill,r,o);},canvasRender:function(t,e,i,n){t.save();var s=this._width,r=this._height,o=s*this.originX,a=r*this.originY,h=this.x-o,l=this.y-a,u=1,c=1;this.flipX&&(h+=s,u=-1),this.flipY&&(l+=r,c=-1),n&&(h=Math.round(h),l=Math.round(l)),t.translate(h,l),t.rotate(this.rotation),t.scale(this.scaleX*u,this.scaleY*c);var d=this.frame;t.drawImage(d.source.image,d.cutX,d.cutY,s,r,0,0,s,r),t.restore();}};Object.assign(Lt.prototype,Bt);var Dt=function(t,e){"string"==typeof e&&(e={frame:e});var i=t.poolManager?t.poolManager.allocate(mt):null;return null===i?i=new Lt(t):i.setParent(t).setActive(),i.modifyPorperties(e),t.addChild(i),i},It={_drawImage:function(t,e,i,n,s,r){Dt(this,{frame:e,x:i,y:n,width:s,height:r});},_drawTileSprite:function(t,e,i,n,s,r){var o=this.texture.get(e),a=o.width,h=o.height,l=Math.floor(s/a),u=Math.floor(r/h);i+=(s-l*a)/2,n+=(r-u*h)/2;for(var c=0;c=0||t.y>=0,t.x=Math.abs(t.x),t.y=Math.abs(t.y);},Vt=function(t,e,i){var n=i.length;if(n>=2){var s=i[n-2],r=i[n-1];if(t===s&&e===r)return i}return i.push(t,e),i},Xt=Phaser.Math.DegToRad,Gt=function(t,e,i,n,s,r,o,a,h){o&&r>s?r-=360:!o&&r>>16,a=(65280&s)>>>8,h=255&s;t.fillStyle="rgba("+o+","+a+","+h+","+r+")";},qt=function(t,e,i,n){var s=i||e.strokeColor,r=n||e.strokeAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.strokeStyle="rgba("+o+","+a+","+h+","+r+")",t.lineWidth=e.lineWidth;},$t=Phaser.Renderer.Canvas.SetTransform,Qt={renderWebGL:function(t,e,i,n){e.dirty&&(e.updateData(),e.dirty=!1),i.addToRenderList(e);var s=t.pipelines.set(e.pipeline),r=Jt(e,i,n),o=s.calcMatrix.copyFrom(r.calc),a=e._displayOriginX,h=e._displayOriginY,l=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&Ut(s,o,e,l,a,h),e.isStroked&&Kt(s,e,l,a,h),t.pipelines.postBatch(e);},renderCanvas:function(t,e,i,n){e.dirty&&(e.updateData(),e.dirty=!1),i.addToRenderList(e);var s=t.currentContext;if($t(t,s,e,i,n)){var r=e._displayOriginX,o=e._displayOriginY,a=e.pathData,h=a.length-1,l=a[0]-r,u=a[1]-o;s.beginPath(),s.moveTo(l,u),e.closePath||(h-=2);for(var c=2;c0;}},{key:"fillAlpha",get:function(){return this._fillAlpha},set:function(t){this._fillAlpha=t,this.isFilled=t>0&&null!=this._fillColor;}},{key:"setFillStyle",value:function(t,e){return void 0===e&&(e=1),this.fillColor=t,this.fillAlpha=e,this}},{key:"strokeColor",get:function(){return this._strokeColor},set:function(t){this._strokeColor=t,this.isStroked=null!=t&&this._strokeAlpha>0&&this._lineWidth>0;}},{key:"strokeAlpha",get:function(){return this._strokeAlpha},set:function(t){this._strokeAlpha=t,this.isStroked=t>0&&null!=this._strokeColor&&this._lineWidth>0;}},{key:"lineWidth",get:function(){return this._lineWidth},set:function(t){this._lineWidth=t,this.isStroked=t>0&&null!=this._strokeColor;}},{key:"setStrokeStyle",value:function(t,e,i){return void 0===i&&(i=1),this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this}},{key:"updateData",value:function(){var t=this.geom,e=this.pathData;e.length=0;var i,n=t.width,s=t.height,r=t.cornerRadius,o=this.iteration+1;if(i=r.tl,re(i))if(i.convex){var a=i.x,h=i.y;Gt(a,h,i.x,i.y,180,270,!1,o,e);}else {Gt(a=0,h=0,i.x,i.y,90,0,!0,o,e);}else Vt(0,0,e);if(i=r.tr,re(i))if(i.convex){a=n-i.x,h=i.y;Gt(a,h,i.x,i.y,270,360,!1,o,e);}else {Gt(a=n,h=0,i.x,i.y,180,90,!0,o,e);}else Vt(n,0,e);if(i=r.br,re(i))if(i.convex){a=n-i.x,h=s-i.y;Gt(a,h,i.x,i.y,0,90,!1,o,e);}else {Gt(a=n,h=s,i.x,i.y,270,180,!0,o,e);}else Vt(n,s,e);if(i=r.bl,re(i))if(i.convex){a=i.x,h=s-i.y;Gt(a,h,i.x,i.y,90,180,!1,o,e);}else {Gt(a=0,h=s,i.x,i.y,360,270,!0,o,e);}else Vt(0,s,e);return e.push(e[0],e[1]),this.pathIndexes=ne(e),this}},{key:"setShapeType",value:function(t){return "string"==typeof t&&(t=oe[t]),this.shapeType=t,this}},{key:"width",get:function(){return this.geom.width},set:function(t){this.resize(t,this.height);}},{key:"height",get:function(){return this.geom.height},set:function(t){this.resize(this.width,t);}},{key:"setSize",value:function(t,e){if(void 0===e&&(e=t),this.geom.width===t&&this.geom.height===e)return this;this.geom.setSize(t,e),1===this.shapeType&&this.setRadius({x:t/2,y:e/2}),this.updateDisplayOrigin(),this.dirty=!0;var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this}},{key:"resize",value:function(t,e){return this.setSize(t,e),this}},{key:"radius",get:function(){return this.geom.radius},set:function(t){this.geom.setRadius(t),this.updateDisplayOrigin(),this.dirty=!0;}},{key:"radiusTL",get:function(){return this.geom.radiusTL},set:function(t){this.geom.radiusTL=t,this.dirty=!0;}},{key:"radiusTR",get:function(){return this.geom.radiusTR},set:function(t){this.geom.radiusTR=t,this.dirty=!0;}},{key:"radiusBL",get:function(){return this.geom.radiusBL},set:function(t){this.geom.radiusBL=t,this.dirty=!0;}},{key:"radiusBR",get:function(){return this.geom.radiusBR},set:function(t){this.geom.radiusBR=t,this.dirty=!0;}},{key:"setRadius",value:function(t){return void 0===t&&(t=0),this.radius=t,this}},{key:"setRadiusTL",value:function(t){return void 0===t&&(t=0),this.radiusTL=t,this}},{key:"setRadiusTR",value:function(t){return void 0===t&&(t=0),this.radiusTR=t,this}},{key:"setRadiusBL",value:function(t){return void 0===t&&(t=0),this.radiusBL=t,this}},{key:"setRadiusBR",value:function(t){return void 0===t&&(t=0),this.radiusBR=t,this}},{key:"cornerRadius",get:function(){return this.geom.cornerRadius},set:function(t){this.radius=t;}},{key:"setCornerRadius",value:function(t){return this.setRadius(t)}},{key:"iteration",get:function(){return this._iteration},set:function(t){void 0!==this._iteration?this._iteration!==t&&(this._iteration=t,this.dirty=!0):this._iteration=t;}},{key:"setIteration",value:function(t){return void 0===t&&(t=6),this.iteration=t,this}}]),i}(te),re=function(t){return t.x>0&&t.y>0},oe={rectangle:0,circle:1};Object.assign(se.prototype,Qt),T.register("roundRectangle",(function(t,e,i,n,s,r,o){var a=new se(this.scene,t,e,i,n,s,r,o);return this.scene.add.existing(a),a})),Z(window,"RexPlugins.UI.RoundRectangle",se);var ae=Phaser.Renderer.WebGL.Utils,he={renderWebGL:function(t,e,i,n){if(e.dirty&&(e.updateTexture(),e.dirty=!1),0!==e.width&&0!==e.height){i.addToRenderList(e);var s=e.frame,r=s.width,o=s.height,a=ae.getTintAppendFloatAlpha,h=t.pipelines.set(e.pipeline,e),l=h.setTexture2D(s.glTexture,e);t.pipelines.preBatch(e),h.batchTexture(e,s.glTexture,r,o,e.x,e.y,r/e.resolution,o/e.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,r,o,a(e.tintTopLeft,i.alpha*e._alphaTL),a(e.tintTopRight,i.alpha*e._alphaTR),a(e.tintBottomLeft,i.alpha*e._alphaBL),a(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,0,0,i,n,!1,l),t.pipelines.postBatch(e);}},renderCanvas:function(t,e,i,n){e.dirty&&(e.updateTexture(),e.dirty=!1),0!==e.width&&0!==e.height&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,n));}},le=Phaser.Display.Color,ue={clear:function(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.dirty=!0,this},fill:function(t){return this.context.fillStyle=t,this.context.fillRect(0,0,this.canvas.width,this.canvas.height),this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r,o,a,h,l){var u=this.scene.sys.textures.getFrame(t,e);if(!u)return this;var c=u.cutWidth,d=u.cutHeight;void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=c),void 0===r&&(r=d),void 0===o&&(o=0),void 0===a&&(a=0),void 0===h&&(h=c),void 0===l&&(l=d);var f=u.cutX+o,p=u.cutY+a;return this.context.drawImage(u.source.image,f,p,h,l,i,n,s,r),this.dirty=!0,this},getDataURL:function(t,e){return this.canvas.toDataURL(t,e)},getPixel:function(t,e,i){void 0===i&&(i=new le);var n=this.context.getImageData(t,e,1,1);return i.setTo(n.data[0],n.data[1],n.data[2],n.data[3]),i},setPixel:function(t,e,i,n,s,r){if("number"!=typeof i){var o=i;i=o.red,n=o.green,s=o.blue,r=o.alpha;}void 0===r&&(r=0!==i||0!==n||0!==s?255:0);var a=this.context.createImageData(1,1);return a.data[0]=i,a.data[1]=n,a.data[2]=s,a.data[3]=r,this.context.putImageData(a,t,e),this.dirty=!0,this}},ce=function(t,e,i,n,s,r,o){var a,h=t.sys.textures,l=t.renderer;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=e.width),void 0===o&&(o=e.height);var u=(a=h.exists(i)?h.get(i):h.createCanvas(i,r,o)).getSourceImage();u.width!==r&&(u.width=r),u.height!==o&&(u.height=o);var c=u.getContext("2d",{willReadFrequently:!0});c.clearRect(0,0,r,o),c.drawImage(e,n,s,r,o),l.gl&&a&&l.canvasToTexture(u,a.source[0].glTexture,!0,0);},de={updateTexture:function(t,e){t&&(e?t.call(e,this.canvas,this.context):t(this.canvas,this.context)),this.canvas.width===this.frame.width&&this.canvas.height===this.frame.height||this.frame.setSize(this.canvas.width,this.canvas.height),this.renderer&&this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(this.canvas,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!1;var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=this.width,i.hitArea.height=this.height),this},generateTexture:function(t,e,i,n,s){var r=this.canvas;return void 0===n?n=r.width:n*=this.resolution,void 0===s?s=r.height:s*=this.resolution,ce(this.scene,r,t,e,i,n,s),this},loadTexture:function(t,e){var i=this.scene.sys.textures.getFrame(t,e);return i?(this.width!==i.cutWidth||this.height!==i.cutHeight?this.setSize(i.cutWidth,i.cutHeight):this.clear(),this.drawFrame(t,e),this.dirty=!0,this):this}};lt();var fe=Phaser.Display.Canvas.CanvasPool,pe=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,"rexCanvas")).renderer=t.sys.game.renderer,h.resolution=1,h._width=o,h._height=a,o=Math.max(Math.ceil(o*h.resolution),1),a=Math.max(Math.ceil(a*h.resolution),1),h.canvas=fe.create(u(h),o,a),h.context=h.canvas.getContext("2d",{willReadFrequently:!0}),h.dirty=!1,h.setPosition(s,r),h.setOrigin(.5,.5),h.initPipeline(),h.initPostPipeline(!0),h._crop=h.resetCropObject(),h.texture=t.sys.textures.addCanvas(null,h.canvas,!0),h.frame=h.texture.get(),h.frame.source.resolution=h.resolution,h.renderer&&h.renderer.gl&&(h.renderer.deleteTexture(h.frame.source.glTexture),h.frame.source.glTexture=null),h.dirty=!0,h}return r(i,[{key:"preDestroy",value:function(){fe.remove(this.canvas),this.texture.destroy(),this.canvas=null,this.context=null;}},{key:"width",get:function(){return this._width},set:function(t){this.setSize(t,this._height);}},{key:"height",get:function(){return this._height},set:function(t){this.setSize(this._width,t);}},{key:"setCanvasSize",value:function(t,e){return this._width===t&&this._height===e||(this._width=t,this._height=e,this.updateDisplayOrigin(),t=Math.max(Math.ceil(t*this.resolution),1),e=Math.max(Math.ceil(e*this.resolution),1),this.canvas.width=t,this.canvas.height=e,this.frame.setSize(t,e),this.dirty=!0),this}},{key:"setSize",value:function(t,e){return this.setCanvasSize(t,e),this}},{key:"displayWidth",get:function(){return this.scaleX*this._width},set:function(t){this.scaleX=t/this._width;}},{key:"displayHeight",get:function(){return this.scaleY*this._height},set:function(t){this.scaleY=t/this._height;}},{key:"setDisplaySize",value:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}},{key:"getCanvas",value:function(t){return t||(this.dirty=!0),this.canvas}},{key:"getContext",value:function(t){return t||(this.dirty=!0),this.context}},{key:"needRedraw",value:function(){return this.dirty=!0,this}},{key:"resize",value:function(t,e){return this.setSize(t,e),this}}]),i}(Phaser.GameObjects.GameObject),ve=Phaser.GameObjects.Components;Phaser.Class.mixin(pe,[ve.Alpha,ve.BlendMode,ve.Crop,ve.Depth,ve.Flip,ve.GetBounds,ve.Mask,ve.Origin,ve.Pipeline,ve.PostPipeline,ve.ScrollFactor,ve.Tint,ve.Transform,ve.Visible,he,ue,de]);var ge=Phaser.Utils.String.Pad,ye=function(t,e,n){if(null==t)return t;switch(i(t)){case"string":default:return t;case"number":return "#".concat(ge(Math.floor(t).toString(16),6,"0",1));case"function":return t(e,n);case"object":return t.hasOwnProperty("r")?t.hasOwnProperty("a")?"rgba(".concat(t.r,",").concat(t.g,",").concat(t.b,",").concat(t.a,")"):"rgb(".concat(t.r,",").concat(t.g,",").concat(t.b,")"):t.hasOwnProperty("h")?t.hasOwnProperty("a")?"hsla(".concat(t.h,",").concat(t.s,",").concat(t.l,",").concat(t.a,")"):"hsl(".concat(t.h,",").concat(t.s,",").concat(t.l,")"):t}},ke=Phaser.Math.DegToRad,me=function(t,e,i,n,s,r,o){var a,h,l,u,c,d=new At(e,i,n,s,r),f=d.minWidth,p=d.minHeight,v=n>=f?1:n/f,g=s>=p?1:s/p,y=d.cornerRadius;t.save(),t.beginPath(),t.translate(e,i),a=y.tl,xe(a)?(h=a.x*v,l=a.y*g,be(a)?Ce(t,h,l,h,l,180,270,!1,o):Ce(t,0,0,h,l,90,0,!0,o),u=0,c=l):(t.lineTo(0,0),u=0,c=0),a=y.tr,xe(a)?(h=a.x*v,l=a.y*g,be(a)?Ce(t,n-h,l,h,l,270,360,!1,o):Ce(t,n,0,h,l,180,90,!0,o)):t.lineTo(n,0),a=y.br,xe(a)?(h=a.x*v,l=a.y*g,be(a)?Ce(t,n-h,s-l,h,l,0,90,!1,o):Ce(t,n,s,h,l,270,180,!0,o)):t.lineTo(n,s),a=y.bl,xe(a)?(h=a.x*v,l=a.y*g,be(a)?Ce(t,h,s-l,h,l,90,180,!1,o):Ce(t,0,s,h,l,360,270,!0,o)):t.lineTo(0,s),t.lineTo(u,c),t.closePath(),t.restore();},be=function(t){return !t.hasOwnProperty("convex")||t.convex},xe=function(t){return t.x>0&&t.y>0},Ce=function(t,e,i,n,s,r,o,a,h){if(a&&o>r?o-=360:!a&&o0&&(e.strokeStyle=h,e.lineWidth=l,e.stroke());}(t.canvas,t.context,u,u,h,l,s,e,i,n,r,o,a);}},Se=function(){we(this,this.fillStyle,this.strokeStyle,this.lineWidth,this.radius,this.fillColor2,this.isHorizontalGradient,this.iteration);},Pe=Phaser.Utils.Objects.GetValue,Te=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l,u,c,d,f){var p;n(this,i),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=1),void 0===a&&(a=o),void 0===h&&(h=0),(p=e.call(this,t,s,r,o,a)).type="rexRoundRectangleCanvas";var v=Pe(h,"radius",h),g=Pe(h,"iteration",void 0);return p.setRadius(v),p.setIteration(g),p.setFillStyle(l,d,f),p.setStrokeStyle(u,c),p}return r(i,[{key:"radius",get:function(){return this._radius},set:function(t){this.dirty|=this._radius!=t,this._radius=t;}},{key:"setRadius",value:function(t){return this.radius=t,this}},{key:"iteration",get:function(){return this._iteration},set:function(t){this.dirty|=this._iteration!=t,this._iteration=t;}},{key:"setIteration",value:function(t){return this.iteration=t,this}},{key:"fillStyle",get:function(){return this._fillStyle},set:function(t){t=ye(t,this.canvas,this.context),this.dirty|=this._fillStyle!=t,this._fillStyle=t;}},{key:"fillColor2",get:function(){return this._fillColor2},set:function(t){t=ye(t,this.canvas,this.context),this.dirty|=this._fillColor2!=t,this._fillColor2=t;}},{key:"isHorizontalGradient",get:function(){return this._isHorizontalGradient},set:function(t){this.dirty|=this._isHorizontalGradient!=t,this._isHorizontalGradient=t;}},{key:"setFillStyle",value:function(t,e,i){return void 0===i&&(i=!0),this.fillStyle=t,this.fillColor2=e,this.isHorizontalGradient=i,this}},{key:"strokeStyle",get:function(){return this._strokeStyle},set:function(t){t=ye(t,this.canvas,this.context),this.dirty|=this._strokeStyle!=t,this._strokeStyle=t;}},{key:"lineWidth",get:function(){return this._lineWidth},set:function(t){this.dirty|=this._lineWidth!=t,this._lineWidth=t;}},{key:"setStrokeStyle",value:function(t,e){return this.strokeStyle=t,this.lineWidth=e,this}},{key:"updateTexture",value:function(){return this.clear(),Se.call(this),p(h(i.prototype),"updateTexture",this).call(this),this}}]),i}(pe);T.register("roundRectangleCanvas",(function(t,e,i,n,s,r,o,a,h,l){var u=new Te(this.scene,t,e,i,n,s,r,o,a,h,l);return this.scene.add.existing(u),u})),Z(window,"RexPlugins.UI.RoundRectangleCanvas",Te); /** * @author Richard Davey * @copyright 2019 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Oe=Phaser.Renderer.WebGL.Utils,Me={renderWebGL:function(t,e,i,n){if(0!==e.width&&0!==e.height){i.addToRenderList(e);var s=e.frame,r=s.width,o=s.height,a=Oe.getTintAppendFloatAlpha,h=t.pipelines.set(e.pipeline,e),l=h.setTexture2D(s.glTexture,e);t.pipelines.preBatch(e),h.batchTexture(e,s.glTexture,r,o,e.x,e.y,r/e.style.resolution,o/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,r,o,a(e.tintTopLeft,i.alpha*e._alphaTL),a(e.tintTopRight,i.alpha*e._alphaTR),a(e.tintBottomLeft,i.alpha*e._alphaBL),a(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,0,0,i,n,!1,l),t.pipelines.postBatch(e);}},renderCanvas:function(t,e,i,n){0!==e.width&&0!==e.height&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,n));}},Ee=Phaser.Display.Canvas.CanvasPool;lt();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:"setStyle",value:function(t){return this.style.setStyle(t)}},{key:"setFont",value:function(t){return this.style.setFont(t)}},{key:"setFontFamily",value:function(t){return this.style.setFontFamily(t)}},{key:"setFontSize",value:function(t){return this.style.setFontSize(t)}},{key:"setFontStyle",value:function(t){return this.style.setFontStyle(t)}},{key:"setTestString",value:function(t){return this.style.setTestString(t)}},{key:"setFixedSize",value:function(t,e){return this.style.setFixedSize(t,e)}},{key:"setBackgroundColor",value:function(t,e,i){return this.style.setBackgroundColor(t,e,i)}},{key:"setBackgroundStrokeColor",value:function(t,e){return this.style.setBackgroundStrokeColor(t,e)}},{key:"setBackgroundCornerRadius",value:function(t,e){return this.style.setBackgroundCornerRadius(t,e)}},{key:"setFill",value:function(t){return this.style.setFill(t)}},{key:"setColor",value:function(t){return this.style.setColor(t)}},{key:"setStroke",value:function(t,e){return this.style.setStroke(t,e)}},{key:"setShadow",value:function(t,e,i,n,s,r){return this.style.setShadow(t,e,i,n,s,r)}},{key:"setShadowOffset",value:function(t,e){return this.style.setShadowOffset(t,e)}},{key:"setShadowColor",value:function(t){return this.style.setShadowColor(t)}},{key:"setShadowBlur",value:function(t){return this.style.setShadowBlur(t)}},{key:"setShadowStroke",value:function(t){return this.style.setShadowStroke(t)}},{key:"setShadowFill",value:function(t){return this.style.setShadowFill(t)}},{key:"setWrapMode",value:function(t){return this.style.setWrapMode(t)}},{key:"setWrapWidth",value:function(t){return this.style.setWrapWidth(t)}},{key:"setWordWrapWidth",value:function(t){return this.style.setWrapWidth(t)}},{key:"setAlign",value:function(t){return this.style.setHAlign(t)}},{key:"setHAlign",value:function(t){return this.style.setHAlign(t)}},{key:"setVAlign",value:function(t){return this.style.setVAlign(t)}},{key:"setLineSpacing",value:function(t){return this.style.setLineSpacing(t)}},{key:"lineSpacing",get:function(){return this.style.lineSpacing},set:function(t){this.setLineSpacing(t);}},{key:"setXOffset",value:function(t){return this.style.setXOffset(t)}},{key:"setMaxLines",value:function(t){return this.style.setMaxLines(t)}},{key:"setResolution",value:function(t){return this.style.setResolution(t)}},{key:"getTextMetrics",value:function(){return this.style.getTextMetrics()}},{key:"setTextMetrics",value:function(t,e){return this.style.setTextMetrics(t,e)}},{key:"measureTextMargins",value:function(t,e){return function(t,e,i){void 0===i&&(i={});var n=Ee.create(this),s=n.getContext("2d",{willReadFrequently:!0});t.syncFont(n,s);var r=s.measureText(e),o=Math.ceil(r.width*t.baselineX),a=o,h=2*a;if(a=a*t.baselineY|0,n.width=o,n.height=h,s.fillStyle="#f00",s.fillRect(0,0,o,h),s.font=t._font,s.textBaseline="alphabetic",s.fillStyle="#000",s.fillText(t.testString,0,a),i.left=0,0===o||0===h||!s.getImageData(0,0,o,h))return Ee.remove(n),i;for(var l=s.getImageData(0,0,o,h).data,u=!1,c=0;ch;u--){for(c=0;c0&&this.wrapMode!==Ae&&0===this.wrapWidth}},{key:"setStyle",value:function(t,e,i){if(void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("wrap")){var n=t.wrap;if(n.hasOwnProperty("mode")){var s=n.mode;"string"==typeof s&&(n.mode=Ue[s]);}else n.hasOwnProperty("width")&&(n.mode=1);}t&&t.rtl&&i&&!t.hasOwnProperty("halign")&&(t.halign="right"),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px");var r=this.propertyMap;for(var o in r){var a=r[o],h=a[0],l=i?a[1]:this[o],u=a[2];if("wrapCallback"===o||"wrapCallbackScope"===o)this[o]=Xe(t,h,l);else {var c=Ve(t,h,l);u&&(c=u(c)),this[o]=c;}}var d=Xe(t,"font",null);this._font=null===d?this.fontStyle+" "+this.fontSize+" "+this.fontFamily:d;var f=Xe(t,"fill",null);null!==f&&(this.color=ye(f));var p=Xe(t,"metrics",!1);return p?this.metrics={ascent:Xe(p,"ascent",0),descent:Xe(p,"descent",0),fontSize:Xe(p,"fontSize",0)}:!e&&this.metrics||(this.metrics=De(this)),e?this.parent.updateText():this.parent}},{key:"syncFont",value:function(t,e){e.font=this._font;}},{key:"syncStyle",value:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round";}},{key:"syncShadow",value:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0);}},{key:"update",value:function(t){return t&&(this._font="".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily).trim(),this.metrics=De(this)),this.parent.updateText(t)}},{key:"buildFont",value:function(){var t="".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily).trim();return t!==this._font&&(this._font=t),this}},{key:"setFont",value:function(t){return "string"==typeof t?(this.fontFamily=t,this.fontSize="",this.fontStyle=""):(this.fontFamily=Xe(t,"fontFamily","Courier"),this.fontSize=Xe(t,"fontSize","16px"),this.fontStyle=Xe(t,"fontStyle","")),this.update(!0)}},{key:"setFontFamily",value:function(t){return this.fontFamily=t,this.update(!0)}},{key:"setFontStyle",value:function(t){return this.fontStyle=t,this.update(!0)}},{key:"setFontSize",value:function(t){return "number"==typeof t&&(t=t.toString()+"px"),this.fontSize=t,this.update(!0)}},{key:"setTestString",value:function(t){return this.testString=t,this.update(!0)}},{key:"setFixedSize",value:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(this.isWrapFitMode)}},{key:"setResolution",value:function(t){return this.resolution=t,this.update(!1)}},{key:"setLineSpacing",value:function(t){return this.lineSpacing=t,this.update(!1)}},{key:"setXOffset",value:function(t){return this.xOffset=t,this.update(!1)}},{key:"setBackgroundColor",value:function(t,e,i){return void 0===i&&(i=!0),this.backgroundColor=ye(t,this.parent.canvas,this.parent.context),this.backgroundColor2=ye(e,this.parent.canvas,this.parent.context),this.backgroundHorizontalGradient=i,this.update(!1)}},{key:"setBackgroundStrokeColor",value:function(t,e){return this.backgroundStrokeColor=ye(t,this.parent.canvas,this.parent.context),this.backgroundStrokeLineWidth=e,this.update(!1)}},{key:"setBackgroundCornerRadius",value:function(t,e){return this.backgroundCornerRadius=t,this.backgroundCornerIteration=e,this.update(!1)}},{key:"setFill",value:function(t){return this.color=ye(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setColor",value:function(t){return this.color=ye(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setStroke",value:function(t,e){return void 0===t?this.strokeThickness=0:(void 0===e&&(e=this.strokeThickness),this.stroke=ye(t,this.parent.canvas,this.parent.context),this.strokeThickness=e),this.update(!0)}},{key:"setShadow",value:function(t,e,i,n,s,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===s&&(s=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=ye(i,this.parent.canvas,this.parent.context),this.shadowBlur=n,this.shadowStroke=s,this.shadowFill=r,this.update(!1)}},{key:"setShadowOffset",value:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)}},{key:"setShadowColor",value:function(t){return void 0===t&&(t="#000"),this.shadowColor=ye(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setShadowBlur",value:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)}},{key:"setShadowStroke",value:function(t){return this.shadowStroke=t,this.update(!1)}},{key:"setShadowFill",value:function(t){return this.shadowFill=t,this.update(!1)}},{key:"setUnderline",value:function(t,e,i){return void 0===t&&(t="#000"),void 0===e&&(e=0),void 0===i&&(i=0),this.underlineColor=ye(t,this.parent.canvas,this.parent.context),this.underlineThickness=e,this.underlineOffset=i,this.update(!1)}},{key:"setUnderlineColor",value:function(t){return void 0===t&&(t="#000"),this.underlineColor=ye(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setUnderlineThickness",value:function(t){return void 0===t&&(t=0),this.underlineThickness=t,this.update(!1)}},{key:"setUnderlineOffset",value:function(t){return void 0===t&&(t=0),this.underlineOffset=t,this.update(!1)}},{key:"setStrikethrough",value:function(t,e,i){return void 0===t&&(t="#000"),void 0===e&&(e=0),void 0===i&&(i=0),this.strikethroughColor=ye(t,this.parent.canvas,this.parent.context),this.strikethroughThickness=e,this.strikethroughOffset=i,this.update(!1)}},{key:"setStrikethroughColor",value:function(t){return void 0===t&&(t="#000"),this.strikethroughColor=ye(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setStrikethroughThickness",value:function(t){return void 0===t&&(t=0),this.strikethroughThickness=t,this.update(!1)}},{key:"setStrikethroughOffset",value:function(t){return void 0===t&&(t=0),this.strikethroughOffset=t,this.update(!1)}},{key:"setWrapMode",value:function(t){return "string"==typeof t&&(t=Ue[t.toLowerCase()]||0),this.wrapMode=t,this.update(!0)}},{key:"setWrapWidth",value:function(t){return this.wrapWidth=t,this.update(!1)}},{key:"setAlign",value:function(t,e){return void 0===t&&(t="left"),void 0===e&&(e="top"),this.halign=t,this.valign=e,this.update(!1)}},{key:"setHAlign",value:function(t){return void 0===t&&(t="left"),this.halign=t,this.update(!1)}},{key:"setVAlign",value:function(t){return void 0===t&&(t="top"),this.valign=t,this.update(!1)}},{key:"setMaxLines",value:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)}},{key:"getTextMetrics",value:function(){var t=this.metrics;return {ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}}},{key:"setTextMetrics",value:function(t,e){return this.metrics.ascent=t.ascent,this.metrics.descent=t.descent,this.metrics.fontSize=t.fontSize,e&&("string"==typeof e?(this.fontFamily=e,this.fontSize="",this.fontStyle=""):(this.fontFamily=Xe(e,"fontFamily",this.fontFamily),this.fontSize=Xe(e,"fontSize",this.fontSize),this.fontStyle=Xe(e,"fontStyle",this.fontStyle))),this.parent.updateText(!0)}},{key:"lineHeight",get:function(){return this.metrics.fontSize+this.strokeThickness+this.lineSpacing}},{key:"toJSON",value:function(){var t={},e=this.propertyMap;for(var i in e)t[i]=this[i];return t.metrics=this.getTextMetrics(),t}},{key:"destroy",value:function(){this.parent=void 0;}}]),t}(),Ue={none:Ae,word:Fe,char:Ye,character:Ye},He={draw:function(t,e,i,n){var s=this.penManager;this.hitAreaManager.clear();var r=this.context;r.save();var o=this.defaultStyle;this.clear(),we(this,o.backgroundColor,o.backgroundStrokeColor,o.backgroundStrokeLineWidth,o.backgroundCornerRadius,o.backgroundColor2,o.backgroundHorizontalGradient,o.backgroundCornerIteration),t+=this.startXOffset,e+=this.startYOffset;var a,h,l,u,c,d,f=o.halign,p=o.valign,v=o.lineHeight,g=s.lines,y=g.length,k=o.maxLines;k>0&&y>k?(h=k,l="center"===p?Math.floor((y-h)/2):"bottom"===p?y-h:0):(h=y,l=0),u=l+h;var m=this.rtl,b=m?this.parent.width:void 0;d="center"===p?Math.max((n-h*v)/2,0):"bottom"===p?Math.max(n-h*v-2,0):0,d+=e;for(var x=l;x0&&t.width>0){var a=i+o.underlineOffset-o.underlineThickness/2;this.drawLine(e,a,t.width,o.underlineThickness,o.underlineColor,o);}if(t.isTextPen&&this.drawText(e,i,t.text,o),t.isImagePen&&this.drawImage(e,i,t.prop.img,o),o.strikethroughThickness>0&&t.width>0){a=i+o.strikethroughOffset-o.strikethroughThickness/2;this.drawLine(e,a,t.width,o.strikethroughThickness,o.strikethroughColor,o);}if(r.restore(),t.hasAreaMarker&&t.width>0){var h,l=t.prop.area;if(l)h={key:l};else {var u=t.prop.url;h={key:"url:".concat(u),url:u};}this.hitAreaManager.add(e,i-this.startYOffset,t.width,this.defaultStyle.lineHeight,h);}},clear:function(){var t=this.canvas;this.context.clearRect(0,0,t.width,t.height);},drawLine:function(t,e,i,n,s,r){this.autoRound&&(t=Math.round(t),e=Math.round(e));var o=this.context;r.syncShadow(o,r.shadowStroke);var a=o.lineCap;o.lineCap="butt",o.strokeStyle=s,o.lineWidth=n,o.beginPath(),o.moveTo(t,e),o.lineTo(t+i,e),o.stroke(),o.lineCap=a;},drawText:function(t,e,i,n){this.autoRound&&(t=Math.round(t),e=Math.round(e));var s=this.context;n.stroke&&"none"!==n.stroke&&n.strokeThickness>0&&(n.syncShadow(s,n.shadowStroke),s.strokeText(i,t,e)),n.color&&"none"!==n.color&&(n.syncShadow(s,n.shadowFill),s.fillText(i,t,e));},drawImage:function(t,e,i,n){e-=this.startYOffset,this.parent.imageManager.draw(i,this.context,t,e,this.autoRound);}},Ne=Phaser.Utils.Objects.GetValue,Ke=Ie,Je=je,Ze=function(){function t(e){n(this,t),this.prop={},this.resetFromJSON(e);}return r(t,[{key:"resetFromJSON",value:function(t){this.text=Ne(t,"text",""),this.x=Ne(t,"x",0),this.y=Ne(t,"y",0),this.width=Ne(t,"width",0);var e=Ne(t,"prop",null);null===e&&(e={}),this.prop=e,this.newLineMode=Ne(t,"newLineMode",0),this.startIndex=Ne(t,"startIndex",0);}},{key:"plainText",get:function(){var t=this.text;return this.newLineMode===Je&&(t+="\n"),t}},{key:"wrapText",get:function(){var t=this.text;return this.newLineMode!==Ke&&(t+="\n"),t}},{key:"rawTextLength",get:function(){var t=this.text.length;return this.newLineMode===Je&&(t+=1),t}},{key:"endIndex",get:function(){return this.startIndex+this.rawTextLength}},{key:"lastX",get:function(){return this.x+this.width}},{key:"isTextPen",get:function(){return ""!==this.text}},{key:"isImagePen",get:function(){return !!this.prop.img}},{key:"hasAreaMarker",get:function(){return !!this.prop.area||!!this.prop.url}}]),t}(),qe=function(t,e){var i=Array.isArray(t);if(void 0===e?e=i?[]:{}:xt(e),i){e.length=t.length;for(var n=0,s=t.length;n=this.lines.length)return this.getLineEndIndex(t);var e=this.lines[t];return e&&e[0]?e[0].startIndex:0}},{key:"getLineEndIndex",value:function(t){t>=this.lines.length&&(t=this.lines.length-1);var e,i,n=!1;for(e=t;e>=0&&!(n=null!=(i=this.lines[e])&&i.length>0);e--);return n?i[i.length-1].endIndex:0}},{key:"getLineWidth",value:function(t){var e=this.lines[t];if(!e)return 0;var i=e[e.length-1];return null==i?0:i.lastX}},{key:"getMaxLineWidth",value:function(){if(void 0!==this.maxLinesWidth)return this.maxLinesWidth;for(var t,e=0,i=0,n=this.lines.length;ie&&(e=t);return this.maxLinesWidth=e,e}},{key:"getLineWidths",value:function(){for(var t=[],e=0,i=this.lines.length;e=t&&h<=e||(o=o.substring(t-a,e-a)),this.tagToTextScope?c+=this.tagToText.call(this.tagToTextScope,o,l,u):c+=this.tagToText(o,l,u),u=l,!(h>=e)));d++);return c}},{key:"length",get:function(){return this.lines.length},set:function(t){this.clear();}}]),t}(),ii={},ni=Phaser.Geom.Rectangle,si=new st,ri=function(){function t(){n(this,t),this.hitAreas=[];}return r(t,[{key:"destroy",value:function(){this.clear();}},{key:"clear",value:function(){for(var t=0,e=this.hitAreas.length;ts){""!==S?a.push(o.getLine(S,P,di)):0===O&&r>0&&a.push(o.getLine("",0,di)),a.push.apply(a,m(t(b,i,vi,s,0,o)));var E=a.pop();S=E.text,P=E.width,o.freeLine(E)," "===S&&(S="",P=0);}else (w=P+x)>l?(a.push(o.getLine(S,P,di)),S=b,P=x,l=s):(S+=b,P=w),C&&a.push(o.getLine(S,P,u));}return a},ki=Phaser.Utils.Objects.GetValue,mi=Ae,bi=Ie,xi=function(){function t(e){n(this,t),this.parent=e.parent,this.scene=this.parent.scene,this.context=ki(e,"context",null),this.canvas=this.context.canvas,this.parser=ki(e,"parser",null),this.defaultStyle=ki(e,"style",null),this.autoRound=!0,this.pensPool=e.pensPool,this.linesPool=e.linesPool,this.wrapTextLinesPool=e.wrapTextLinesPool,this.penManager=this.newPenManager(),this._tmpPenManager=null,this.hitAreaManager=new ri,this.lastHitAreaKey=null,this.urlTagCursorStyle=null;var i=this.context;this.getTextWidth=function(t){return i.measureText(t).width};}return r(t,[{key:"destroy",value:function(){this.parent=void 0,this.scene=void 0,this.context=void 0,this.canvas=void 0,this.parser=void 0,this.defaultStyle=void 0,this.penManager&&(this.penManager.destroy(),this.penManager=void 0),this._tmpPenManager&&(this._tmpPenManager.destroy(),this._tmpPenManager=void 0),this.hitAreaManager&&(this.hitAreaManager.destroy(),this.hitAreaManager=void 0),this.pensPool=void 0,this.linesPool=void 0,this.wrapTextLinesPool=void 0;}},{key:"updatePenManager",value:function(t,e,i,n,s){if(void 0===s&&(s=this.penManager),s.clear(),""===t)return s;var r=this.parent.style;if(r.isWrapFitMode){var o=this.parent.padding;i=r.fixedWidth-o.left-o.right;}for(var a,h,l,u,c,d=this.canvas,f=this.context,p=function(t){return f.measureText(t).width},v=0,g=0,y=r.wrapCallback,k=r.wrapCallbackScope,m=!0,b=this.parser.splitText(t),x=this.wrapTextLinesPool,C=0,w=b.length;C0&&e!==mi&&i0&&t>e&&(t=e),t}},{key:"linesWidth",get:function(){return Math.ceil(this.penManager.getMaxLineWidth())}},{key:"linesHeight",get:function(){var t=this.desplayLinesCount,e=this.defaultStyle.lineHeight*t;return t>0&&(e-=this.defaultStyle.lineSpacing),e}},{key:"imageManager",get:function(){return this.parent.imageManager}},{key:"rtl",get:function(){return this.parent.style.rtl}},{key:"newPenManager",value:function(){return new ei({pensPool:this.pensPool,linesPool:this.linesPool,tagToText:this.parser.propToTagText,tagToTextScope:this.parser})}},{key:"tmpPenManager",get:function(){return null===this._tmpPenManager&&(this._tmpPenManager=this.newPenManager()),this._tmpPenManager}},{key:"getPlainText",value:function(t,e,i){var n;if(null==t)n=this.penManager.plainText;else {var s=this.parser.splitText(t,1);n="";for(var r=0,o=s.length;rh;u--){for(c=0;c0&&this.wrapMode!==Ae&&0===this.wrapWidth}},{key:"setStyle",value:function(t,e,i){if(void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("wrap")){var n=t.wrap;if(n.hasOwnProperty("mode")){var s=n.mode;"string"==typeof s&&(n.mode=He[s]);}else n.hasOwnProperty("width")&&(n.mode=1);}t&&t.rtl&&i&&!t.hasOwnProperty("halign")&&(t.halign="right"),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px");var r=this.propertyMap;for(var o in r){var a=r[o],h=a[0],l=i?a[1]:this[o],u=a[2];if("wrapCallback"===o||"wrapCallbackScope"===o)this[o]=Xe(t,h,l);else {var c=Ve(t,h,l);u&&(c=u(c)),this[o]=c;}}var d=Xe(t,"font",null);this._font=null===d?this.fontStyle+" "+this.fontSize+" "+this.fontFamily:d;var f=Xe(t,"fill",null);null!==f&&(this.color=ye(f));var p=Xe(t,"metrics",!1);return p?this.metrics={ascent:Xe(p,"ascent",0),descent:Xe(p,"descent",0),fontSize:Xe(p,"fontSize",0)}:!e&&this.metrics||(this.metrics=De(this)),e?this.parent.updateText():this.parent}},{key:"syncFont",value:function(t,e){e.font=this._font;}},{key:"syncStyle",value:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round";}},{key:"syncShadow",value:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0);}},{key:"update",value:function(t){return t&&(this._font="".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily).trim(),this.metrics=De(this)),this.parent.updateText(t)}},{key:"buildFont",value:function(){var t="".concat(this.fontStyle," ").concat(this.fontSize," ").concat(this.fontFamily).trim();return t!==this._font&&(this._font=t),this}},{key:"setFont",value:function(t){return "string"==typeof t?(this.fontFamily=t,this.fontSize="",this.fontStyle=""):(this.fontFamily=Xe(t,"fontFamily","Courier"),this.fontSize=Xe(t,"fontSize","16px"),this.fontStyle=Xe(t,"fontStyle","")),this.update(!0)}},{key:"setFontFamily",value:function(t){return this.fontFamily=t,this.update(!0)}},{key:"setFontStyle",value:function(t){return this.fontStyle=t,this.update(!0)}},{key:"setFontSize",value:function(t){return "number"==typeof t&&(t=t.toString()+"px"),this.fontSize=t,this.update(!0)}},{key:"setTestString",value:function(t){return this.testString=t,this.update(!0)}},{key:"setFixedSize",value:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(this.isWrapFitMode)}},{key:"setResolution",value:function(t){return this.resolution=t,this.update(!1)}},{key:"setLineSpacing",value:function(t){return this.lineSpacing=t,this.update(!1)}},{key:"setXOffset",value:function(t){return this.xOffset=t,this.update(!1)}},{key:"setBackgroundColor",value:function(t,e,i){return void 0===i&&(i=!0),this.backgroundColor=ye(t,this.parent.canvas,this.parent.context),this.backgroundColor2=ye(e,this.parent.canvas,this.parent.context),this.backgroundHorizontalGradient=i,this.update(!1)}},{key:"setBackgroundStrokeColor",value:function(t,e){return this.backgroundStrokeColor=ye(t,this.parent.canvas,this.parent.context),this.backgroundStrokeLineWidth=e,this.update(!1)}},{key:"setBackgroundCornerRadius",value:function(t,e){return this.backgroundCornerRadius=t,this.backgroundCornerIteration=e,this.update(!1)}},{key:"setFill",value:function(t){return this.color=ye(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setColor",value:function(t){return this.color=ye(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setStroke",value:function(t,e){return void 0===t?this.strokeThickness=0:(void 0===e&&(e=this.strokeThickness),this.stroke=ye(t,this.parent.canvas,this.parent.context),this.strokeThickness=e),this.update(!0)}},{key:"setShadow",value:function(t,e,i,n,s,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===s&&(s=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=ye(i,this.parent.canvas,this.parent.context),this.shadowBlur=n,this.shadowStroke=s,this.shadowFill=r,this.update(!1)}},{key:"setShadowOffset",value:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)}},{key:"setShadowColor",value:function(t){return void 0===t&&(t="#000"),this.shadowColor=ye(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setShadowBlur",value:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)}},{key:"setShadowStroke",value:function(t){return this.shadowStroke=t,this.update(!1)}},{key:"setShadowFill",value:function(t){return this.shadowFill=t,this.update(!1)}},{key:"setUnderline",value:function(t,e,i){return void 0===t&&(t="#000"),void 0===e&&(e=0),void 0===i&&(i=0),this.underlineColor=ye(t,this.parent.canvas,this.parent.context),this.underlineThickness=e,this.underlineOffset=i,this.update(!1)}},{key:"setUnderlineColor",value:function(t){return void 0===t&&(t="#000"),this.underlineColor=ye(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setUnderlineThickness",value:function(t){return void 0===t&&(t=0),this.underlineThickness=t,this.update(!1)}},{key:"setUnderlineOffset",value:function(t){return void 0===t&&(t=0),this.underlineOffset=t,this.update(!1)}},{key:"setStrikethrough",value:function(t,e,i){return void 0===t&&(t="#000"),void 0===e&&(e=0),void 0===i&&(i=0),this.strikethroughColor=ye(t,this.parent.canvas,this.parent.context),this.strikethroughThickness=e,this.strikethroughOffset=i,this.update(!1)}},{key:"setStrikethroughColor",value:function(t){return void 0===t&&(t="#000"),this.strikethroughColor=ye(t,this.parent.canvas,this.parent.context),this.update(!1)}},{key:"setStrikethroughThickness",value:function(t){return void 0===t&&(t=0),this.strikethroughThickness=t,this.update(!1)}},{key:"setStrikethroughOffset",value:function(t){return void 0===t&&(t=0),this.strikethroughOffset=t,this.update(!1)}},{key:"setWrapMode",value:function(t){return "string"==typeof t&&(t=He[t.toLowerCase()]||0),this.wrapMode=t,this.update(!0)}},{key:"setWrapWidth",value:function(t){return this.wrapWidth=t,this.update(!1)}},{key:"setAlign",value:function(t,e){return void 0===t&&(t="left"),void 0===e&&(e="top"),this.halign=t,this.valign=e,this.update(!1)}},{key:"setHAlign",value:function(t){return void 0===t&&(t="left"),this.halign=t,this.update(!1)}},{key:"setVAlign",value:function(t){return void 0===t&&(t="top"),this.valign=t,this.update(!1)}},{key:"setMaxLines",value:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)}},{key:"getTextMetrics",value:function(){var t=this.metrics;return {ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}}},{key:"setTextMetrics",value:function(t,e){return this.metrics.ascent=t.ascent,this.metrics.descent=t.descent,this.metrics.fontSize=t.fontSize,e&&("string"==typeof e?(this.fontFamily=e,this.fontSize="",this.fontStyle=""):(this.fontFamily=Xe(e,"fontFamily",this.fontFamily),this.fontSize=Xe(e,"fontSize",this.fontSize),this.fontStyle=Xe(e,"fontStyle",this.fontStyle))),this.parent.updateText(!0)}},{key:"lineHeight",get:function(){return this.metrics.fontSize+this.strokeThickness+this.lineSpacing}},{key:"toJSON",value:function(){var t={},e=this.propertyMap;for(var i in e)t[i]=this[i];return t.metrics=this.getTextMetrics(),t}},{key:"destroy",value:function(){this.parent=void 0;}}]),t}(),He={none:Ae,word:Fe,char:Ye,character:Ye},Ue={draw:function(t,e,i,n){var s=this.penManager;this.hitAreaManager.clear();var r=this.context;r.save();var o=this.defaultStyle;this.clear(),we(this,o.backgroundColor,o.backgroundStrokeColor,o.backgroundStrokeLineWidth,o.backgroundCornerRadius,o.backgroundColor2,o.backgroundHorizontalGradient,o.backgroundCornerIteration),t+=this.startXOffset,e+=this.startYOffset;var a,h,l,u,c,d,f=o.halign,p=o.valign,v=o.lineHeight,g=s.lines,y=g.length,k=o.maxLines;k>0&&y>k?(h=k,l="center"===p?Math.floor((y-h)/2):"bottom"===p?y-h:0):(h=y,l=0),u=l+h;var m=this.rtl,b=m?this.parent.width:void 0;d="center"===p?Math.max((n-h*v)/2,0):"bottom"===p?Math.max(n-h*v-2,0):0,d+=e;for(var x=l;x0&&t.width>0){var a=i+o.underlineOffset-o.underlineThickness/2;this.drawLine(e,a,t.width,o.underlineThickness,o.underlineColor,o);}if(t.isTextPen&&this.drawText(e,i,t.text,o),t.isImagePen&&this.drawImage(e,i,t.prop.img,o),o.strikethroughThickness>0&&t.width>0){a=i+o.strikethroughOffset-o.strikethroughThickness/2;this.drawLine(e,a,t.width,o.strikethroughThickness,o.strikethroughColor,o);}if(r.restore(),t.hasAreaMarker&&t.width>0){var h,l=t.prop.area;if(l)h={key:l};else {var u=t.prop.url;h={key:"url:".concat(u),url:u};}this.hitAreaManager.add(e,i-this.startYOffset,t.width,this.defaultStyle.lineHeight,h);}},clear:function(){var t=this.canvas;this.context.clearRect(0,0,t.width,t.height);},drawLine:function(t,e,i,n,s,r){this.autoRound&&(t=Math.round(t),e=Math.round(e));var o=this.context;r.syncShadow(o,r.shadowStroke);var a=o.lineCap;o.lineCap="butt",o.strokeStyle=s,o.lineWidth=n,o.beginPath(),o.moveTo(t,e),o.lineTo(t+i,e),o.stroke(),o.lineCap=a;},drawText:function(t,e,i,n){this.autoRound&&(t=Math.round(t),e=Math.round(e));var s=this.context;n.stroke&&"none"!==n.stroke&&n.strokeThickness>0&&(n.syncShadow(s,n.shadowStroke),s.strokeText(i,t,e)),n.color&&"none"!==n.color&&(n.syncShadow(s,n.shadowFill),s.fillText(i,t,e));},drawImage:function(t,e,i,n){e-=this.startYOffset,this.parent.imageManager.draw(i,this.context,t,e,this.autoRound);}},Ne=Phaser.Utils.Objects.GetValue,Ke=Ie,Je=je,Ze=function(){function t(e){n(this,t),this.prop={},this.resetFromJSON(e);}return r(t,[{key:"resetFromJSON",value:function(t){this.text=Ne(t,"text",""),this.x=Ne(t,"x",0),this.y=Ne(t,"y",0),this.width=Ne(t,"width",0);var e=Ne(t,"prop",null);null===e&&(e={}),this.prop=e,this.newLineMode=Ne(t,"newLineMode",0),this.startIndex=Ne(t,"startIndex",0);}},{key:"plainText",get:function(){var t=this.text;return this.newLineMode===Je&&(t+="\n"),t}},{key:"wrapText",get:function(){var t=this.text;return this.newLineMode!==Ke&&(t+="\n"),t}},{key:"rawTextLength",get:function(){var t=this.text.length;return this.newLineMode===Je&&(t+=1),t}},{key:"endIndex",get:function(){return this.startIndex+this.rawTextLength}},{key:"lastX",get:function(){return this.x+this.width}},{key:"isTextPen",get:function(){return ""!==this.text}},{key:"isImagePen",get:function(){return !!this.prop.img}},{key:"hasAreaMarker",get:function(){return !!this.prop.area||!!this.prop.url}}]),t}(),qe=function(t,e){var i=Array.isArray(t);if(void 0===e?e=i?[]:{}:xt(e),i){e.length=t.length;for(var n=0,s=t.length;n=this.lines.length)return this.getLineEndIndex(t);var e=this.lines[t];return e&&e[0]?e[0].startIndex:0}},{key:"getLineEndIndex",value:function(t){t>=this.lines.length&&(t=this.lines.length-1);var e,i,n=!1;for(e=t;e>=0&&!(n=null!=(i=this.lines[e])&&i.length>0);e--);return n?i[i.length-1].endIndex:0}},{key:"getLineWidth",value:function(t){var e=this.lines[t];if(!e)return 0;var i=e[e.length-1];return null==i?0:i.lastX}},{key:"getMaxLineWidth",value:function(){if(void 0!==this.maxLinesWidth)return this.maxLinesWidth;for(var t,e=0,i=0,n=this.lines.length;ie&&(e=t);return this.maxLinesWidth=e,e}},{key:"getLineWidths",value:function(){for(var t=[],e=0,i=this.lines.length;e=t&&h<=e||(o=o.substring(t-a,e-a)),this.tagToTextScope?c+=this.tagToText.call(this.tagToTextScope,o,l,u):c+=this.tagToText(o,l,u),u=l,!(h>=e)));d++);return c}},{key:"length",get:function(){return this.lines.length},set:function(t){this.clear();}}]),t}(),ii={},ni=Phaser.Geom.Rectangle,si=new st,ri=function(){function t(){n(this,t),this.hitAreas=[];}return r(t,[{key:"destroy",value:function(){this.clear();}},{key:"clear",value:function(){for(var t=0,e=this.hitAreas.length;ts){""!==S?a.push(o.getLine(S,P,di)):0===O&&r>0&&a.push(o.getLine("",0,di)),a.push.apply(a,m(t(b,i,vi,s,0,o)));var E=a.pop();S=E.text,P=E.width,o.freeLine(E)," "===S&&(S="",P=0);}else (w=P+x)>l?(a.push(o.getLine(S,P,di)),S=b,P=x,l=s):(S+=b,P=w),C&&a.push(o.getLine(S,P,u));}return a},ki=Phaser.Utils.Objects.GetValue,mi=Ae,bi=Ie,xi=function(){function t(e){n(this,t),this.parent=e.parent,this.scene=this.parent.scene,this.context=ki(e,"context",null),this.canvas=this.context.canvas,this.parser=ki(e,"parser",null),this.defaultStyle=ki(e,"style",null),this.autoRound=!0,this.pensPool=e.pensPool,this.linesPool=e.linesPool,this.wrapTextLinesPool=e.wrapTextLinesPool,this.penManager=this.newPenManager(),this._tmpPenManager=null,this.hitAreaManager=new ri,this.lastHitAreaKey=null,this.urlTagCursorStyle=null;var i=this.context;this.getTextWidth=function(t){return i.measureText(t).width};}return r(t,[{key:"destroy",value:function(){this.parent=void 0,this.scene=void 0,this.context=void 0,this.canvas=void 0,this.parser=void 0,this.defaultStyle=void 0,this.penManager&&(this.penManager.destroy(),this.penManager=void 0),this._tmpPenManager&&(this._tmpPenManager.destroy(),this._tmpPenManager=void 0),this.hitAreaManager&&(this.hitAreaManager.destroy(),this.hitAreaManager=void 0),this.pensPool=void 0,this.linesPool=void 0,this.wrapTextLinesPool=void 0;}},{key:"updatePenManager",value:function(t,e,i,n,s){if(void 0===s&&(s=this.penManager),s.clear(),""===t)return s;var r=this.parent.style;if(r.isWrapFitMode){var o=this.parent.padding;i=r.fixedWidth-o.left-o.right;}for(var a,h,l,u,c,d=this.canvas,f=this.context,p=function(t){return f.measureText(t).width},v=0,g=0,y=r.wrapCallback,k=r.wrapCallbackScope,m=!0,b=this.parser.splitText(t),x=this.wrapTextLinesPool,C=0,w=b.length;C0&&e!==mi&&i0&&t>e&&(t=e),t}},{key:"linesWidth",get:function(){return Math.ceil(this.penManager.getMaxLineWidth())}},{key:"linesHeight",get:function(){var t=this.desplayLinesCount,e=this.defaultStyle.lineHeight*t;return t>0&&(e-=this.defaultStyle.lineSpacing),e}},{key:"imageManager",get:function(){return this.parent.imageManager}},{key:"rtl",get:function(){return this.parent.style.rtl}},{key:"newPenManager",value:function(){return new ei({pensPool:this.pensPool,linesPool:this.linesPool,tagToText:this.parser.propToTagText,tagToTextScope:this.parser})}},{key:"tmpPenManager",get:function(){return null===this._tmpPenManager&&(this._tmpPenManager=this.newPenManager()),this._tmpPenManager}},{key:"getPlainText",value:function(t,e,i){var n;if(null==t)n=this.penManager.plainText;else {var s=this.parser.splitText(t,1);n="";for(var r=0,o=s.length;r * @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}(Yi);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,Yn=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},Wn=Phaser.GameObjects.Components.TransformMatrix,Vn={},Xn=function(t,e,i,n,s){var r=Yn(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 Wn,Dn=new Wn),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,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=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}},Yo=Phaser.Utils.Array.Remove,Wo=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:Wo(e,"mute",this.soundEffectsMute),volume:Wo(e,"volume",this.soundEffectsVolume),detune:Wo(e,"detune",0),rate:Wo(e,"rate",1)});return this.soundEffects.push(i),i.once("complete",(function(){i.destroy(),this.sound&&Yo(this.soundEffects,i);}),this).once("destroy",(function(){this.sound&&Yo(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=function(){return this.close(),this.emit("keydown-ENTER",this.parent,this),this},Sl=function(){this.isOpened=!0,this.initText(),this.enterCloseEnable&&this.scene.input.keyboard.once("keydown-ENTER",wl,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);},Pl=function(){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);},Tl=Phaser.Utils.Objects.GetValue,Ol=function(t,e){var i,n=Tl(e,"inputType",void 0);void 0===n&&(n=Tl(e,"type","text")),"textarea"===n?(i=document.createElement("textarea")).style.resize="none":(i=document.createElement("input")).type=n;var s=Tl(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.addEventListener("focus",(function(e){Sl.call(t);})),i.addEventListener("blur",(function(e){Pl.call(t);})),i},Ml={open:function(){return this.isOpened||this.readOnly||((t=this)!==kl&&(void 0!==kl&&kl.close(),kl=t),this.node||(this.node=Ol(this,this.nodeConfig)),this.setFocus()),this;var t;},close:function(){return this.isOpened?(this===kl&&(kl=void 0),this.setBlur(),this):this}},El=Phaser.Utils.Objects.GetValue,_l=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=El(s,"inputType",void 0);void 0===o&&(o=El(s,"type","text")),r.setEnterCloseEnable(El(s,"enterClose","textarea"!==o));var a=El(s,"onOpen",void 0);a||(a=El(s,"onFocus",void 0)),r.onOpenCallback=a;var h=El(s,"onClose",void 0);return h||(h=El(s,"onBlur",void 0)),r.onCloseCallback=h,r.onUpdateCallback=El(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(_l.prototype,Ml);var Rl=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},Ll=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)):(Ll(this),Bl(this)),this}},{key:"setNumberInput",value:function(){return this.onUpdateCallback=Rl,this}},{key:"setSelectAllWhenFocusEnable",value:function(t){return void 0===t&&(t=!0),this.selectAllWhenFocus=t,this}}]),i}(_l),jl=Phaser.Utils.Objects.GetValue,zl=["inputType","onOpen","onFocus","onClose","onBlur","onUpdate","enterClose","readOnly","maxLength","minLength","selectAll"],Al=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}Gl.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(Ul(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=qu(t,"tl",0),this.radiusTR=qu(t,"tr",0),this.radiusBL=qu(t,"bl",0),this.radiusBR=qu(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]),Lu(this.x,this.y,t),p(h(i.prototype),"updateData",this).call(this),this}}]),i}(bu),Qu=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,tc=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=Qu(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}(ku),ec={buildShapes:function(){this.addShape((new $u).setName("box")).addShape((new Ku).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);}},ic=Phaser.Utils.Objects.GetValue,nc=Phaser.Math.Linear,sc=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=ic(t,"key","value");var n=e[this.propertyKey];return this.fromValue=ic(t,"from",n),this.toValue=ic(t,"to",n),this.setEase(ic(t,"ease",this.ease)),this.setDuration(ic(t,"duration",this.duration)),this.setRepeat(ic(t,"repeat",0)),this.setDelay(ic(t,"delay",0)),this.setRepeatDelay(ic(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]=nc(this.fromValue,this.toValue,i);}}]),i}(To),rc={setCheckerAnimationDuration:function(t){return void 0===t&&(t=0),this.checkerAnimDuration=t,this},playCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask&&(this.checkerAnimProgressTask=new sc(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}},oc={};Object.assign(oc,gu,{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}},ec,rc);var ac=Phaser.Utils.Objects.GetValue,hc=Phaser.Utils.Objects.IsPlainObject,lc=23730,uc=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),hc(s)?(s=ac(l=s,"x",0),r=ac(l,"y",0),o=ac(l,"width",2),a=ac(l,"height",2),h=ac(l,"color",lc)):hc(h)&&(h=ac(l=h,"color",lc)),(u=e.call(this,t,s,r,o,a)).type="rexCheckbox",void 0===h&&(h=lc),u.setBoxShape(ac(l,"circleBox",!1)),u.setBoxFillStyle(h,ac(l,"boxFillAlpha",1)),u.setUncheckedBoxFillStyle(ac(l,"uncheckedColor",null),ac(l,"uncheckedBoxFillAlpha",1)),u.setBoxStrokeStyle(ac(l,"boxLineWidth",4),ac(l,"boxStrokeColor",h),ac(l,"boxStrokeAlpha",1)),u.setUncheckedBoxStrokeStyle(u.boxLineWidth,ac(l,"uncheckedBoxStrokeColor",u.boxStrokeColor),ac(l,"uncheckedBoxStrokeAlpha",u.boxStrokeAlpha)),u.setCheckerStyle(ac(l,"checkerColor",16777215),ac(l,"checkerAlpha",1)),u.setBoxSize(ac(l,"boxSize",1)),u.setCheckerSize(ac(l,"checkerSize",1)),u.setCheckerAnimationDuration(ac(l,"animationDuration",150)),u.buildShapes();var c=ac(l,"checked");return void 0===c&&(c=ac(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}(vu);Object.assign(uc.prototype,oc);var cc=Phaser.Utils.Objects.GetValue,dc=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(cc(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(cc(t,"enable",!0)),this.setMode(cc(t,"mode",1)),this.setClickInterval(cc(t,"clickInterval",100)),this.setDragThreshold(cc(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=fc[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),fc={press:0,pointerdown:0,release:1,pointerup:1},pc=Phaser.Utils.Objects.GetValue,vc=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 dc(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}(uc);T.register("checkbox",(function(t,e,i,n,s,r){var o=new vc(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.Checkbox",vc);var gc={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}},yc={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}},kc={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}},mc=function(t,e,i){return (e-t)*i+t},bc=Phaser.Math.Linear,xc={buildShapes:function(){this.addShape((new $u).setName("track")).addShape((new $u).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&mc(yr(l),yr(u),c))<<16|(255&mc(kr(l),kr(u),c))<<8|255&mc(mr(l),mr(u),c)),f=bc(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=bc(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);}},Cc={setToggleAnimationDuration:function(t){return void 0===t&&(t=0),this.toggleAnimDuration=t,this},playToggleAnimation:function(){return void 0===this.toggleAnimProgressTask&&(this.toggleAnimProgressTask=new sc(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}},wc={};Object.assign(wc,gc,yc,kc,xc,Cc);var Sc=Phaser.Utils.Objects.GetValue,Pc=Phaser.Utils.Objects.IsPlainObject,Tc=23730,Oc=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),Pc(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",Tc)):Pc(h)&&(h=Sc(l=h,"color",Tc)),(u=e.call(this,t,s,r,o,a)).type="rexToggleSwitch",void 0===h&&(h=Tc),u.setTrackFillStyle(h,Sc(l,"trackFillAlpha",1)),u.setFalseValueTrackFillStyle(Sc(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)),Sc(l,"falseValueTrackFillAlpha",1)),u.setThumbStyle(Sc(l,"thumbColor",16777215),Sc(l,"thumbAlpha",1)),u.setTrackSize(Sc(l,"trackWidth",.9),Sc(l,"trackHeight",.5)),u.setTrackRadius(Sc(l,"trackRadius",.5*u.trackHeight));var c=Sc(l,"thumbHeight",void 0),d=Sc(l,"thumbWidth",c);return void 0===d&&(d=.9*u.trackHeight),u.setThumbSize(d,c),u.setThumbRadius(Sc(l,"thumbRadius",.5*u.thumbHeight)),u.setThumbPosition(Sc(l,"thumbLeft",.3),Sc(l,"thumbRight",void 0)),u.setRTL(Sc(l,"rtl",!1)),u.setToggleAnimationDuration(Sc(l,"animationDuration",150)),u.buildShapes(),u.setValue(Sc(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}(vu);Object.assign(Oc.prototype,wc);var Mc=Phaser.Utils.Objects.GetValue,Ec=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 dc(u(c),Mc(l,"click")),c._click.on("click",(function(){this.toggleValue();}),u(c)),c.setReadOnly(Mc(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}(Oc);T.register("toggleSwitch",(function(t,e,i,n,s,r){var o=new Ec(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.ToggleSwitch",Ec);var _c={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);}))}},Rc=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(Rc.prototype,_c),T.register("canvas",(function(t,e,i,n){var s=new Rc(this.scene,t,e,i,n);return this.scene.add.existing(s),s})),Z(window,"RexPlugins.UI.Canvas",Rc);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="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=Lc(n,"maskType",0),r=Lc(n,"backgroundColor",void 0),o=Lc(n,"strokeColor",void 0),a=Lc(n,"strokeWidth",null!=o?10:0);if(void 0===s?s=0:"string"==typeof s&&(s=Dc[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=Lc(n,"radius",0),y=Lc(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),Dc={circle:0,ellipse:1,roundRectangle:2};T.register("circleMaskImage",(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.CircleMaskImage",Bc);var Ic=Phaser.Utils.Objects.GetValue,jc=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=Ic(n,"mask.key"),r=Ic(n,"mask.frame"),o=Ic(n,"mask.invertAlpha",!1),a=Ic(n,"mask.scale"),h=Ic(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 jc(this.scene,t,e,i,n,s);return this.scene.add.existing(r),r})),Z(window,"RexPlugins.UI.AlphaMaskImage",jc);var zc=Phaser.Math.Linear,Ac=Phaser.Math.Percent,Fc={setValue:function(t,e,i){return null==t||(void 0!==e&&(t=Ac(t,e,i)),this.value=t),this},addValue:function(t,e,i){return void 0!==e&&(t=Ac(t,e,i)),this.value+=t,this},getValue:function(t,e){var i=this.value;return void 0!==t&&(i=zc(t,e,i)),i}},Yc=Phaser.Math.Percent,Wc={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=Yc(t,e,i)),void 0===this.easeValueTask&&(this.easeValueTask=new sc(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 sc(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,from:t,to:e,duration:this.easeValueDuration,ease:this.easeFunction,repeat:i,repeatDelay:n}),this}},Vc=Phaser.Utils.Objects.GetValue,Xc=Phaser.Math.Clamp;function Gc(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=Vc(t,"eventEmitter",this);var e=Vc(t,"valuechangeCallback",null);if(null!==e){var i=Vc(t,"valuechangeCallbackScope",void 0);this.eventEmitter.on("valuechange",e,i);}return this.setEaseValuePropName("value").setEaseValueDuration(Vc(t,"easeValue.duration",0)).setEaseValueFunction(Vc(t,"easeValue.ease","Linear")),this}},{key:"value",get:function(){return this._value},set:function(t){t=Xc(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,Fc,Wc),e}var Uc=Phaser.Math.RadToDeg,Hc=Phaser.Math.DegToRad,Nc=function(t,e,i,n,s,r,o,a){var h=360===Math.abs(o-r),l=Hc(r),u=Hc(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},Kc={buildShapes:function(){this.addShape((new Ku).setName("track")).addShape((new Ku).setName("bar")).addShape((new wu).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),Nc(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=Uc(this.startAngle),h=360*(o?1-this.value:this.value)+a;r.fillStyle(this.barColor),Nc(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();}},Jc=Phaser.Utils.Objects.GetValue,Zc=Phaser.Utils.Objects.IsPlainObject,qc=Phaser.Math.Clamp,$c=Phaser.Math.DegToRad(270),Qc=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),Zc(s)&&(s=Jc(l=s,"x",0),r=Jc(l,"y",0),o=Jc(l,"radius",1),a=Jc(l,"barColor",void 0),h=Jc(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(Jc(l,"trackColor",void 0)),u.setBarColor(a),u.setCenterColor(Jc(l,"centerColor",void 0)),u.setThickness(Jc(l,"thickness",.2)),u.setStartAngle(Jc(l,"startAngle",$c)),u.setAnticlockwise(Jc(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=qc(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}(Gc(vu));Object.assign(Qc.prototype,Kc),T.register("circularProgress",(function(t,e,i,n,s,r){var o=new Qc(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.CircularProgress",Qc);var td=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());},ed=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(),td(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(),td(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(),td(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());},id=Phaser.Utils.Objects.GetValue,nd=Phaser.Utils.Objects.IsPlainObject,sd=Phaser.Math.Clamp,rd=Phaser.Math.DegToRad(270),od=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),nd(s)&&(s=id(l=s,"x",0),r=id(l,"y",0),o=id(l,"radius",1),a=id(l,"barColor",void 0),h=id(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(id(l,"trackColor",void 0)),u.setBarColor(a),u.setCenterColor(id(l,"centerColor",void 0)),u.setThickness(id(l,"thickness",.2)),u.setStartAngle(id(l,"startAngle",rd)),u.setAnticlockwise(id(l,"anticlockwise",!1)),u.setTextColor(id(l,"textColor",void 0)),u.setTextStrokeColor(id(l,"textStrokeColor",void 0),id(l,"textStrokeThickness",void 0));var d=id(l,"textFont",void 0);return d?u.setTextFont(d):u.setTextFont(id(l,"textSize","16px"),id(l,"textFamily","Courier"),id(l,"textStyle","")),u.setTextFormatCallback(id(l,"textFormatCallback",void 0),id(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=sd(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(),ed.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}(Gc(pe));T.register("circularProgressCanvas",(function(t,e,i,n,s,r){var o=new od(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.CircularProgressCanvas",od);var ad=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},hd=Phaser.Utils.Objects.GetValue,ld=Phaser.Utils.Objects.IsPlainObject,ud=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),ld(s)?(s=hd(u=s,"x",0),r=hd(u,"y",0),o=hd(u,"width",2),a=hd(u,"height",2),h=hd(u,"barColor",void 0),l=hd(u,"value",0)):ld(o)?(o=hd(u=o,"width",2),a=hd(u,"height",2),h=hd(u,"barColor",void 0),l=hd(u,"value",0)):ld(h)&&(h=hd(u=h,"barColor",void 0),l=hd(u,"value",0)),(c=e.call(this,t,s,r,o,a,u)).type="rexLineProgress",c.bootProgressBase(u),c.addShape((new Ku).setName("trackFill")).addShape((new Ku).setName("bar")).addShape((new Ku).setName("trackStroke")),c.setTrackColor(hd(u,"trackColor",void 0)),c.setBarColor(h),c.setTrackStroke(hd(u,"trackStrokeThickness",2),hd(u,"trackStrokeColor",void 0)),c.setSkewX(hd(u,"skewX",0)),c.setRTL(hd(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}(Gc(vu)),cd={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&&ad(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),ad(o,s,0,r,i,t).close());var a=this.getShape("trackStroke");a.lineStyle(this.trackStrokeThickness,this.trackStrokeColor),a.isStroked&&ad(a,0,0,e,i,t).end();}};Object.assign(ud.prototype,cd),T.register("lineProgress",(function(t,e,i,n,s,r,o){var a=new ud(this.scene,t,e,i,n,s,r,o);return this.scene.add.existing(a),a})),Z(window,"RexPlugins.UI.LineProgress",ud);var dd=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(),dd(0,r,this.trackPoints,void 0,this.trackStrokeColor,this.trackStrokeThickness),r.restore());},pd=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},vd=Phaser.Utils.Objects.GetValue,gd=Phaser.Utils.Objects.IsPlainObject,yd=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),gd(s)?(s=vd(u=s,"x",0),r=vd(u,"y",0),o=vd(u,"width",2),a=vd(u,"height",2),h=vd(u,"barColor",void 0),l=vd(u,"value",0)):gd(o)?(o=vd(u=o,"width",2),a=vd(u,"height",2),h=vd(u,"barColor",void 0),l=vd(u,"value",0)):gd(h)&&(h=vd(u=h,"barColor",void 0),l=vd(u,"value",0)),(c=e.call(this,t,s,r,o,a)).type="rexLineProgressCanvas",c.trackPoints=[],c.barPoints=[],c.bootProgressBase(u),c.setTrackColor(vd(u,"trackColor",void 0)),c.setBarColor(h,vd(u,"barColor2",void 0),vd(u,"isHorizontalGradient",void 0)),c.setTrackStroke(vd(u,"trackStrokeThickness",2),vd(u,"trackStrokeColor",void 0)),c.setSkewX(vd(u,"skewX",0)),c.setRTL(vd(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(),fd.call(this),p(h(i.prototype),"updateTexture",this).call(this),this}}]),i}(Gc(pe));T.register("circularProgressCanvas",(function(t,e,i,n,s,r,o){var a=new yd(this.scene,t,e,i,n,s,r,o);return this.scene.add.existing(a),a})),Z(window,"RexPlugins.UI.LineProgressCanvas",yd),Phaser.Math.Wrap;var kd=Phaser.Math.Linear,md=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=kd(m.a.x,b.a.x,x),e=kd(m.a.y,b.a.y,x),i=kd(m.b.x,b.b.x,x),n=kd(m.b.y,b.b.y,x),s=kd(m.c.x,b.c.x,x),r=kd(m.c.y,b.c.y,x);}o.startAt(t,e).lineTo(i,n).lineTo(s,r),this.arrowOnly?o.end():o.close();},bd=(0, Phaser.Math.DegToRad)(120),xd=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+bd),i+n*Math.sin(s+bd)).lineTo(e+n*Math.cos(s),i+n*Math.sin(s)).lineTo(e+n*Math.cos(s-bd),i+n*Math.sin(s-bd)),this.arrowOnly?t.end():t.close();},Cd={buildShapes:function(){this.addShape((new Ku).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?md.call(this):xd.call(this);}},wd={setEaseDuration:function(t){return void 0===t&&(t=0),this.easeDuration=t,this},playEaseDirectionation:function(){return void 0===this.easeDirectionProgressTask&&(this.easeDirectionProgressTask=new sc(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}},Sd=Phaser.Utils.Objects.GetValue,Pd=Phaser.Utils.Objects.IsPlainObject,Td=Phaser.Math.DegToRad,Od=Phaser.Math.RadToDeg,Md=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),Pd(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=_d(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=Sd(r,"x",null);null!==o?(t=o,n=o):(t=Sd(r,"left",0),n=Sd(r,"right",t));var a=Sd(r,"y",null);null!==a?(e=a,s=a):(e=Sd(r,"top",0),s=Sd(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 Od(this.verticeRotation)},set:function(t){this.verticeRotation=Td(t);}},{key:"setVerticeAngle",value:function(t){return this.verticeAngle=t,this}}]),s}(vu),Ed={right:0,down:1,left:2,up:3},_d=function(t){return "string"==typeof t&&(t=Ed[t]),t%=4};Object.assign(Md.prototype,Cd,wd),T.register("triangle",(function(t,e,i,n,s,r){var o=new Md(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.Triangle",Md),lt();var Rd=Phaser.GameObjects.Zone,Ld=Phaser.Utils.Array.Add,Bd=Phaser.Utils.Array.Remove,Dd=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 Ld(this.children,t,0,(function(t){t.once("destroy",e.onChildDestroy,e);}),this),this}},{key:"remove",value:function(t,e){var i=this;return Bd(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));}},vf=Phaser.Utils.Array,gf={getChildren:function(t){if(t)for(var e=0,i=this.children.length;e=0;e--)this.remove(this.backgroundChildren[e],t);return this}},Lp=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},Bp=/(\S+)\[(\d+)\]/i,Dp={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}},Ip=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},jp=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},zp={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}},Ap=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}(Xv),Uv={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}},Hv={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}},Nv={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}},Kv={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}},Jv={};Object.assign(Jv,Uv,Hv,Nv,Kv);var 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,s)).setTransitInTime(Zv(s,"duration.in",200)),r.setTransitOutTime(Zv(s,"duration.out",200)),r.setTransitInCallback(Zv(s,"transitIn")),r.setTransitOutCallback(Zv(s,"transitOut")),r.oneShotMode=Zv(s,"destroy",!1),r.delayCallTimer=void 0,r._state=new Gv(u(r),{eventEmitter:!1,initState:Zv(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(qv.prototype,Jv);var $v=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),Qv=Phaser.Utils.Objects.GetValue,tg=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(Qv(t,"hitAreaMode",0)),this.setEnable(Qv(t,"enable",!0)),this.setStopMode(Qv(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=eg[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),eg={default:0,fullWindow:1},ig=Phaser.Utils.Objects.GetValue,ng=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=ig(s,"color",0),a=ig(s,"alpha",.8);return (r=e.call(this,t,o,a)).touchEventStop=new tg(u(r),{hitAreaMode:1}),r}return r(i)}($v),sg=function(t,e){void 0!==t._modalScaleSave?(t.scaleX=t._modalScaleSave,t.scaleY=t._modalScaleSave):t._modalScaleSave=t.scaleX,Hp(t,e);},rg=function(t,e){Np(t,e,void 0,void 0,!1);},og=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,nv(t,e);},ag=function(t,e){sv(t,e,!1);},hg=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,nv(t,e,t.alpha);},lg=function(t,e){sv(t,e,!1);},ug=function(t,e,i,n,s){return !!t&&(!(n&&!n(t,e,i))&&(!!Ir(t,!0).contains(e,i)&&!(s&&!s(t,e,i))))},cg=Phaser.Utils.Objects.GetValue,dg=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=fg.popUp),null==s.transitOut&&(s.transitOut=fg.scaleDown),s.destroy=cg(s,"destroy",!0),r=e.call(this,t,s);var o=cg(s,"cover");r.cover=!1!==o?function(t,e){var i=t.scene,n=new ng(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(cg(o,"transitIn",hg)),r.setCoverTransitOutCallback(cg(o,"transitOut",lg)));var a=cg(s,"touchOutsideClose",!1),h=cg(s,"duration.hold",-1),l=cg(s,"timeOutClose",h>=0),c=cg(s,"anyTouchClose",!1);return cg(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)),cg(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&&ug(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=fg[t]),t){case fg.popUp:t=sg;break;case fg.fadeIn:t=og;}return p(h(i.prototype),"setTransitInCallback",this).call(this,t),this}},{key:"setTransitOutCallback",value:function(t){switch("string"==typeof t&&(t=fg[t]),t){case fg.scaleDown:t=rg;break;case fg.fadeOut:t=ag;}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}(qv),fg={popUp:0,fadeIn:1,scaleDown:0,fadeOut:1},pg=function(t,e){var i=new dg(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},vg=function(t,e){t.emit("modal.requestClose",e);},gg=function(t){return t&&"function"==typeof t},yg={modal:function(t,e){return gg(t)&&(e=t,t=void 0),void 0===this._modalBehavior&&(this.onCreateModalBehavior&&this.onCreateModalBehavior(this,t),this._modalBehavior=pg(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 vg(this,t),this}},kg=function(t,e,i,n){if(e)return ug(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),Ig={press:0,pointerdown:0,release:1,pointerup:1},jg={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 Dg(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}},zg=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}(Xv),Ag=Phaser.Utils.Objects.GetValue,Fg=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 zg,r.parent.setInteractive(Ag(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(Ag(t,"enable",!0)),this.setCooldown(Ag(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),Yg={isPointerInBounds:function(t){return void 0===t?t=this:"string"==typeof t&&(t=this.getElement(t)),!!t&&kg(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 Fg(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 Fg(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}},Wg=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=ny,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===sy&&this.onDragEnd(),this.pointer=void 0,this.tracerState=ny,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=ry,this}}]),i}(ho),ny=0,sy=1,ry="IDLE",oy=Phaser.Utils.Objects.GetValue,ay=Phaser.Math.Distance.Between,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.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=ly;},eventEmitter:!1};return r.setRecongizedStateObject(new Xv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setHoldTime(oy(t,"time",250)),this.setTapInterval(oy(t,"tapInterval",200)),this.setDragThreshold(oy(t,"threshold",9)),this.setTapOffset(oy(t,"tapOffset",10));var e=oy(t,"taps",void 0);return void 0!==e?this.setTaps(e):(this.setMaxTaps(oy(t,"maxTaps",void 0)),this.setMinTaps(oy(t,"minTaps",void 0))),this}},{key:"onDragStart",value:function(){switch(this.state){case ly:this.state=uy;break;case uy:var t=this.lastPointer;ay(t.upX,t.upY,t.x,t.y)>this.tapOffset&&(this.state=cy,this.state=uy);break;case cy:this.state=uy;}}},{key:"onDragEnd",value:function(){this.state===uy&&(this.tapsCount++,this.emit("tapping",this,this.gameObject,this.lastPointer),void 0!==this.maxTaps&&this.tapsCount===this.maxTaps&&(this.state=cy));}},{key:"onDrag",value:function(){this.state!==ly&&this.pointer.getDistance()>this.dragThreshold&&(this.state=ly);}},{key:"preUpdate",value:function(t,e){if(this.isRunning&&this.enable&&this.state===uy){var i=this.lastPointer;if(i.isDown)t-i.downTime>this.holdTime&&(this.state=ly);else t-i.upTime>this.tapInterval&&(void 0===this.minTaps||this.tapsCount>=this.minTaps?this.state=cy:this.state=ly);}}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===cy&&(this.state=ly);}},{key:"isTapped",get:function(){return this.state===cy}},{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}(iy),ly="IDLE",uy="BEGIN",cy="RECOGNIZED",dy=Phaser.Utils.Objects.GetValue,fy=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=py;},eventEmitter:!1};return r.setRecongizedStateObject(new Xv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(dy(t,"threshold",9)),this.setHoldTime(dy(t,"time",251)),this}},{key:"onDragStart",value:function(){this.state=vy,0===this.holdTime&&(this.state=gy);}},{key:"onDragEnd",value:function(){this.state=py;}},{key:"onDrag",value:function(){this.state!==py&&this.pointer.getDistance()>this.dragThreshold&&(this.state=py);}},{key:"preUpdate",value:function(t,e){this.isRunning&&this.enable&&(this.state===vy&&t-this.pointer.downTime>=this.holdTime&&(this.state=gy));}},{key:"isPressed",get:function(){return this.state===gy}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(iy),py="IDLE",vy="BEGIN",gy="RECOGNIZED",yy=Phaser.Utils.Objects.GetValue,ky=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=my;},eventEmitter:!1};return r.setRecongizedStateObject(new Xv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(yy(t,"threshold",10)),this}},{key:"onDragStart",value:function(){this.state=by,0===this.dragThreshold&&(this.state=xy);}},{key:"onDragEnd",value:function(){this.state=my;}},{key:"onDrag",value:function(){switch(this.state){case by:this.pointer.getDistance()>=this.dragThreshold&&(this.state=xy);break;case xy: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===xy}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(iy),my="IDLE",by="BEGIN",xy="RECOGNIZED",Cy=Phaser.Math.Distance.Between,wy=Phaser.Math.Angle.Between,Sy={getDt:function(){return ou(this.scene)},getVelocity:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Cy(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 wy(e.x,e.y,t.x,t.y)}},Py={"up&down":0,"left&right":1,"4dir":2,"8dir":3},Ty={},Oy=Phaser.Utils.Objects.GetValue,My=Phaser.Math.RadToDeg,Ey=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=_y;},eventEmitter:!1};return r.setRecongizedStateObject(new Xv(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=Ry;}},{key:"onDragEnd",value:function(){this.state=_y;}},{key:"onDrag",value:function(){this.state===Ry&&(this.validDrag||(this.validDrag=0===this.dragThreshold||this.pointer.getDistance()>=this.dragThreshold),this.validDrag&&this.dragVelocity>this.velocityThreshold&&(this.state=Ly));}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===Ly&&(this.state=_y);}},{key:"isSwiped",get:function(){return this.state===Ly}},{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=Py[t]),this.dirMode=t,this}},{key:"updateDirectionStates",value:function(){return function(t,e,i){switch(void 0===i?i={}:!0===i&&(i=Ty),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;}}(My(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}(iy);Object.assign(Ey.prototype,Sy);var _y="IDLE",Ry="BEGIN",Ly="RECOGNIZED",By=Phaser.Utils.Objects.GetValue,Dy=Phaser.Utils.Array.SpliceOne,Iy=Phaser.Math.Distance.Between,jy=Phaser.Math.Angle.Between,zy=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(By(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(By(t,"enable",!0)),this.bounds=By(t,"bounds",void 0),this.tracerState=Fy,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 Fy:this.tracerState=Yy,this.onDrag1Start();break;case Yy:this.tracerState=Wy,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],Dy(this.pointers,e),this.tracerState){case Yy:this.tracerState=Fy,this.onDrag1End();break;case Wy:this.tracerState=Yy,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 Yy:this.onDrag1();break;case Wy:this.onDrag2();}}}},{key:"dragCancel",value:function(){return this.tracerState===Wy&&this.onDrag2End(),this.pointers.length=0,xt(this.movedState),this.tracerState=Fy,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!==Wy)return 0;var t=this.pointers[0],e=this.pointers[1];return Iy(t.x,t.y,e.x,e.y)}},{key:"angleBetween",get:function(){if(this.tracerState!==Wy)return 0;var t=this.pointers[0],e=this.pointers[1];return jy(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;Ay.x=e.x-i.x,Ay.y=e.y-i.y;}else Ay.x=0,Ay.y=0;return Ay}},{key:"centerX",get:function(){if(this.tracerState!==Wy)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!==Wy)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!==Wy)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!==Wy)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=Vy,this}}]),t}();Object.assign(zy.prototype,sr);var Ay={},Fy=0,Yy=1,Wy=2,Vy="IDLE",Xy=Phaser.Utils.Objects.GetValue,Gy=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=Uy;},eventEmitter:!1};return r.setRecongizedStateObject(new Xv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Xy(t,"threshold",0)),this}},{key:"onDrag2Start",value:function(){this.scaleFactor=1,this.prevDistance=this.distanceBetween,this.state=Hy,0===this.dragThreshold&&(this.state=Ny);}},{key:"onDrag2End",value:function(){this.state=Uy;}},{key:"onDrag2",value:function(){switch(this.state){case Hy: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=Ny;}break;case Ny:t=this.distanceBetween;this.scaleFactor=t/this.prevDistance,this.emit("pinch",this),this.prevDistance=t;}}},{key:"isPinched",get:function(){return this.state===Ny}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(zy),Uy="IDLE",Hy="BEGIN",Ny="RECOGNIZED",Ky=Phaser.Math.RotateAround,Jy=function(t,e,i,n){return Ky(t,e,i,n),t.rotation+=n,t},Zy={},qy=Phaser.Utils.Objects.GetValue,$y=Phaser.Math.Angle.WrapDegrees,Qy=Phaser.Math.Angle.ShortestBetween,tk=Phaser.Math.RadToDeg,ek=Phaser.Math.DegToRad,ik=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=sk;},eventEmitter:!1};return r.setRecongizedStateObject(new Xv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(qy(t,"threshold",0)),this}},{key:"onDrag2Start",value:function(){this.prevAngle=$y(tk(this.angleBetween)),this.state=rk,0===this.dragThreshold&&(this.state=ok);}},{key:"onDrag2End",value:function(){this.state=sk;}},{key:"onDrag2",value:function(){switch(this.state){case rk:if(this.pointers[0].getDistance()>=this.dragThreshold&&this.pointers[1].getDistance()>=this.dragThreshold){var t=$y(tk(this.angleBetween));this.angle=Qy(this.prevAngle,t),this.prevAngle=t,this.state=ok;}break;case ok:t=$y(tk(this.angleBetween));this.angle=Qy(this.prevAngle,t),this.prevAngle=t,this.emit("rotate",this);}}},{key:"isRotated",get:function(){return this.state===ok}},{key:"rotation",get:function(){return ek(this.angle)}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(zy),nk={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=Zy),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),Rm(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(),Jm(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}(Yf);Object.assign(ib.prototype,Bm),T.register("imageBox",(function(t,e,i,n,s){var r=new ib(this.scene,t,e,i,n,s);return this.scene.add.existing(r),r})),Z(window,"RexPlugins.UI.ImageBox",ib),T.register("fullWindowRectangle",(function(t,e){var i=new $v(this.scene,t,e);return this.scene.add.existing(i),i})),Z(window,"RexPlugins.UI.FullWindowRectangle",$v),T.register("cover",(function(t){var e=new ng(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Cover",ng);var nb=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},sb={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"]},rb={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]},ob={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"},ab=Phaser.Utils.Objects.GetValue,hb=function(t,e,i,n){var s=ab(n,"preventDefault",!1),r=ab(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);},lb=Phaser.GameObjects.DOMElement,ub=Phaser.Utils.Objects.IsPlainObject,cb=Phaser.Utils.Objects.GetValue,db=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l,c;n(this,i),ub(s)?(s=cb(h=s,"x",0),r=cb(h,"y",0),o=cb(h,"width",0),a=cb(h,"height",0)):ub(o)&&(o=cb(h=o,"width",0),a=cb(h,"height",0)),void 0===h&&(h={});var d=cb(h,"inputType",void 0);void 0===d&&(d=cb(h,"type","text")),"textarea"===d?(c=document.createElement("textarea")).style.resize="none":(c=document.createElement("input")).type=d,bl(sb,h,c);var f=cb(h,"style",void 0);f=bl(rb,h,f);var p=c.style;for(var v in h)v in sb||v in rb||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),hb(u(l),c,ob),xl(c),cb(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}(lb),fb={resize:nb};Object.assign(db.prototype,fb),T.register("inputText",(function(t){var e=new db(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.InputText",db);var pb=Phaser.Utils.Objects.GetValue,vb=function(t,e){return void 0===t&&(t=0),new Promise((function(i,n){setTimeout((function(){i(e);}),t);}))},gb=function(t){var e=t.game,i=t.fileInput,n=t.closeDelay;return Sh(X(e).events,"focus").then((function(){return vb(n)})).then((function(){var t={files:i.files};return Promise.resolve(t)}))},yb=Phaser.Utils.Objects.GetValue,kb=function(t){return this.setOrigin(t.originX,t.originY),this.setPosition(t.x,t.y),this.resize(t.displayWidth,t.displayHeight),this},mb=function(t,e,i,n,s,r){if(null===s||!1===s);else if(gg(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);})),gg(e))e();else {var h=window.URL.createObjectURL(e);a[i](n,h);}a.start();},bb={loadFile:function(t,e,i,n,s){var r=this.scene;return mb(r,t,e,i,n,s),this},loadFilePromise:function(t,e,i,n){var s=this.scene;return new Promise((function(r,o){mb(s,t,e,i,n,(function(t){r(t);}));}))}},xb=Phaser.GameObjects.DOMElement,Cb=Phaser.Utils.Objects.IsPlainObject,wb=Phaser.Utils.Objects.GetValue,Sb=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),Cb(s)?(s=wb(h=s,"x",0),r=wb(h,"y",0),o=wb(h,"width",0),a=wb(h,"height",0)):Cb(o)&&(o=wb(h=o,"width",0),a=wb(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=wb(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(wb(h,"closeDelay",200)),c.onclick=function(){gb({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(wb(t,"accept","")),this.setMultiple(wb(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}(xb),Pb={resize:nb,syncTo:kb};Object.assign(Sb.prototype,Pb,bb),T.register("fileChooser",(function(t){var e=new Sb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.FileChooser",Sb);var Tb={setDropEnable:function(t){return void 0===t&&(t=!0),this.dropEnable=t,this},toggleDropEnable:function(){return this.dropEnable=!this.dropEnable,this}},Ob={resize:nb,syncTo:kb};Object.assign(Ob,Tb,{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}},bb);var Mb={dragenter:"dragenter",dragleave:"dragleave",dragover:"dragover",drop:"drop"},Eb=Phaser.GameObjects.DOMElement,_b=Phaser.Utils.Objects.IsPlainObject,Rb=Phaser.Utils.Objects.GetValue,Lb=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),_b(s)?(s=Rb(h=s,"x",0),r=Rb(h,"y",0),o=Rb(h,"width",0),a=Rb(h,"height",0)):_b(o)&&(o=Rb(h=o,"width",0),a=Rb(h,"height",0)),void 0===h&&(h={});var c=document.createElement("div"),d=Rb(h,"style",void 0);(l=e.call(this,t,s,r,c,d)).type="rexFileDropZone",l.resize(o,a),l._files=[],l.setDropEnable(Rb(h,"dropEnable",!0));var f=Rb(h,"filters");return f&&l.addFilters(f),hb(u(l),c,Mb,{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}(Eb);Object.assign(Lb.prototype,Ob),T.register("fileDropZone",(function(t){var e=new Lb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.FileDropZone",Lb);var Bb=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),Db=Phaser.Utils.Objects.GetValue,Ib=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=Db(s,"style",u(r));var o=Db(s,"propertiesMap");return r.activeStyle=jb(s,"active",o),r.hoverStyle=jb(s,"hover",o),r.disableStyle=jb(s,"disable",o),r.onModifyStyle=Db(s,"onModifyStyle"),r}return r(i,[{key:"getStyle",value:function(t){return Yl(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 Wl(e,t)?void 0:(this.modifyStyle(t),e)}}},{key:"setActiveState",value:function(t){return zb.call(this,"active",t),this}},{key:"setHoverState",value:function(t){return zb.call(this,"hover",t),this}},{key:"setDisableState",value:function(t){return zb.call(this,"disable",t),this}}]),i}(oo),jb=function(t,e,i){var n=Fl(t,e);if(i)for(var s in n)i.hasOwnProperty(s)&&(n[i[s]]=n[s],delete n[s]);return n},zb=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));},Ab={addStyleManager:function(t){return this.styleManager=new Ib(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}},Fb=Phaser.GameObjects.Image,Yb=Phaser.Utils.Objects.GetValue,Wb=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=Yb(s,"x",0),a=Yb(s,"y",0),h=Yb(s,"key",""),l=Yb(s,"frame",void 0);(r=e.call(this,t,o,a,h,l)).type="rexStatesImage";var c=Yb(s,"effects",!0);return c&&pr(u(r),c),r.style=new Bb(u(r),s),s.style=r.style,r.addStyleManager(s),delete s.style,r}return r(i)}(Fb);Object.assign(Wb.prototype,Ab),T.register("statesImage",(function(t){var e=new Wb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.StatesImage",Wb);var Vb=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=Xb,r.addStyleManager(s),delete s.style,delete s.propertiesMap,r}return r(i)}(se),Xb={color:"fillColor",alpha:"fillAlpha",strokeWidth:"lineWidth"};Object.assign(Vb.prototype,Ab),T.register("statesRoundRectangle",(function(t){var e=new Vb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.StatesRoundRectangle",Vb);var Gb=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),Ub=Phaser.GameObjects.NineSlice,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,"key",null),l=Hb(s,"frame",null),c=Hb(s,"width",0),d=Hb(s,"height",0),f=Hb(s,"leftWidth",0),p=Hb(s,"rightWidth",0),v=Hb(s,"topHeight",0),g=Hb(s,"bottomHeight",0);(r=e.call(this,t,o,a,h,l,c,d,f,p,v,g)).type="rexStatesNineSlice";var y=Hb(s,"effects",!0);return y&&pr(u(r),y),r.style=new Gb(u(r),s),s.style=r.style,r.addStyleManager(s),delete s.style,r}return r(i)}(Ub);Object.assign(Nb.prototype,Ab),T.register("statesNineSlice",(function(t){var e=new Nb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.StatesNineSlice",Nb);var Kb=Phaser.GameObjects.Text,Jb=Phaser.Utils.Objects.GetValue,Zb=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=Jb(s,"x",0),a=Jb(s,"y",0),h=Jb(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)}(Kb);Object.assign(Zb.prototype,Ab),T.register("statesText",(function(t){var e=new Zb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.StatesText",Zb);var qb=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},$b=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}(Rc),Qb={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,qb(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},nx=Phaser.Utils.Objects.IsPlainObject,sx=Phaser.Utils.Objects.GetValue,rx=Phaser.Display.Align.CENTER,ox={min:0,full:-1},ax=function(t,e,n,s,r,o,a,h,l,u){xp.call(this,t);var c=t.isRexSpace,d=i(e);if(null===e)return this;if("number"===d);else if("string"===d)e=ox[e];else if(nx(e)){var f;e=sx(f=e,"proportion",void 0),n=sx(f,"align",rx),s=sx(f,"padding",0),r=sx(f,"expand",!1),o=sx(f,"key",void 0),a=sx(f,"index",void 0),t.isRexSizer||(h=sx(f,"minWidth",void 0),l=sx(f,"minHeight",void 0)),u=sx(f,"fitRatio",0);}return "string"==typeof n&&(n=Xf[n]),void 0===e&&(e=c?1:0),void 0===n&&(n=rx),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=mp(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},hx={add:ax,addSpace:function(t){return this.insertSpace(void 0,t),this},insertSpace:function(t,e){return void 0===e&&(e=1),ax.call(this,new ex(this.scene),{proportion:e,minWidth:0,minHeight:0,index:t}),this},insert:function(t,e,i,n,s,r,o,a){return nx(i)&&(i.index=t),ax.call(this,e,i,n,s,r,o,t,a),this},insertAtPosition:function(t,e,i,n,s,r,o,a,h){var l=ix.call(this,t,e);return -1===l&&(l=void 0),this.insert(l,i,n,s,r,o,a,h),this}},lx=Phaser.Utils.Array.Remove,ux={remove:function(t,e){return this.getParentSizer(t)!==this||(lx(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,Pk.call(this,t),this}},cx={getChildAlign:function(t){return this.getSizerConfig(t).align},setChildAlign:function(t,e){return "string"==typeof e&&(e=Xf[e]),this.getSizerConfig(t).align=e,this}},dx={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=jp.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(dx,hx,ux,cx,{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 fx=function(){for(var t,e,i=0,n=this.sizerChildren,s=0,r=n.length;s0&&(i+=e);return i},px={x:0,h:0,horizontal:0,"left-to-right":0,y:1,v:1,vertical:1,"top-to-bottom":1},vx=function(t){return "string"==typeof t&&(t=px[t]),t},gx=Phaser.Utils.Objects.IsPlainObject,yx=Phaser.Utils.Objects.GetValue,kx=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;return n(this,i),gx(s)?(s=yx(l=s,"x",0),r=yx(l,"y",0),o=yx(l,"width",void 0),a=yx(l,"height",void 0),h=yx(l,"orientation",0)):gx(o)?(o=yx(l=o,"width",void 0),a=yx(l,"height",void 0),h=yx(l,"orientation",0)):gx(h)&&(h=yx(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(yx(l,"space.item",0)),u.setStartChildIndex(yx(l,"startChildIndex",0)),u.setRTL(yx(l,"rtl",!1)),u.addChildrenMap("items",u.sizerChildren),u}return r(i,[{key:"setOrientation",value:function(t){return this.orientation=vx(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=fx.call(this)),this._childrenProportion}}]),i}(yk);Object.assign(kx.prototype,dx),T.register("sizer",(function(t,e,i,n,s,r){var o=new kx(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.Sizer",kx);var mx=function(){return Array.prototype.reduce.call(arguments,bx,0)},bx=function(t,e){return t+e},xx=Phaser.Utils.Objects.IsPlainObject,Cx=Phaser.Utils.Objects.GetValue,wx=Phaser.Display.Align.CENTER,Sx=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 Tx(this.sizerChildren,null),Pk.call(this,t),this}},Mx={setColumnSpace:function(t){if(this.space.column||(this.space.column=[]),this.space.column.length=this.columnCount-1,"number"==typeof t)Tx(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},Lx={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=jp.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,Tx(this.sizerChildren,null),this.columnProportions=[],this.columnProportions.length=t,"number"==typeof i)Tx(this.columnProportions,i);else for(var r=0;r0&&(e+=t);return e},Dx=function(){for(var t,e=0,i=0;i0&&(e+=t);return e},Ix=Phaser.Utils.Objects.IsPlainObject,jx=Phaser.Utils.Objects.GetValue,zx=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),Ix(s)?(s=jx(d=s,"x",0),r=jx(d,"y",0),o=jx(d,"width",void 0),a=jx(d,"height",void 0),h=jx(d,"column",d.col||0),l=jx(d,"row",0),u=jx(d,"columnProportions",0),c=jx(d,"rowProportions",0)):Ix(o)?(o=jx(d=o,"width",void 0),a=jx(d,"height",void 0),h=jx(d,"column",d.col||0),l=jx(d,"row",0),u=jx(d,"columnProportions",0),c=jx(d,"rowProportions",0)):Ix(h)?(h=jx(d=h,"column",d.col||0),l=jx(d,"row",0),u=jx(d,"columnProportions",0),c=jx(d,"rowProportions",0)):Ix(u)&&(u=jx(d=u,"columnProportions",0),c=jx(d,"rowProportions",0)),(f=e.call(this,t,s,r,o,a,d)).type="rexGridSizer",f.sizerChildren=[],f.addChildrenMap("items",f.sizerChildren),f.setCreateCellContainerCallback(jx(d,"createCellContainerCallback")),f.setIndentLeft(jx(d,"space.indentLeftOdd",0),jx(d,"space.indentLeftEven",0)),f.setIndentTop(jx(d,"space.indentTopOdd",0),jx(d,"space.indentTopEven",0)),f.resetGrid(h,l,u,c,jx(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=Bx.call(this)),this._totalColumnProportions}},{key:"totalRowProportions",get:function(){return void 0===this._totalRowProportions&&(this._totalRowProportions=Dx.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}(yk);Object.assign(zx.prototype,Lx),T.register("gridSizer",(function(t,e,i,n,s,r,o,a,h){var l=new zx(this.scene,t,e,i,n,s,r,o,a,h);return this.scene.add.existing(l),l})),Z(window,"RexPlugins.UI.GridSizer",zx);var Ax=function(t,e,i,n){return e/t<=i?e/(n-1):0},Fx=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=Vx(a.left,a.centerY,t,e))&&(s=h,n=r);var h,l=i[r+1];if(!l||l.y!==a.y)s>(h=Vx(a.right,a.centerY,t,e))&&(s=h,n=r+1);}}return n},Gx=Phaser.Utils.Objects.IsPlainObject,Ux=Phaser.Utils.Objects.GetValue,Hx=Phaser.Display.Align.CENTER,Nx=function(t,e,i,n){if("\n"===t)return this.addNewLine(),this;var s;(xp.call(this,t),Gx(e))&&(e=Ux(s=e,"padding",0),i=Ux(s,"key",void 0),n=Ux(s,"index",void 0));return void 0===e&&(e=0),(s=this.getSizerConfig(t)).align=Hx,s.padding=mp(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},Kx={add:function(t,e,i){if(mg(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,Pk.call(this,t),this}},qx={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--)VC.call(this,e[i],t);return this}},GC=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);}},UC=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,GC.call(e,t,i,n);}},enumerable:!0,configurable:!0}),t.selected=!1;},HC={add:function(t){return this.buttons.push(t),t._click||(t._click=new dc(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")),UC.call(this,t)),this},addMultiple:function(t){for(var e=0,i=t.length;e2?o-2:0),h=2;h=0;i--)hw.call(this,e[i],t);return this}},uw=Phaser.Utils.Objects.GetValue,cw=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=uw(s,"row",0),a=uw(s,"column",s.col||0),h=uw(s,"createCellContainerCallback"),l=uw(s,"buttons",void 0),c=uw(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&&dw.addNewLine(this);}else for(r=0,o=t.length;r=0;i--)yw.call(this,e[i],t);return this}},mw=Phaser.Utils.Objects.GetValue,bw=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 QC({parent:u(r),eventEmitter:mw(s,"eventEmitter",u(r)),groupName:mw(s,"groupName",void 0),clickConfig:mw(s,"click",void 0)}).setButtonsType(s);var a=mw(s,"background",void 0),h=mw(s,"buttons",void 0);return r.buttonsAlign=mw(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}(iC);Object.assign(bw.prototype,pw,kw,$C,ew),T.register("fixWidthButtons",(function(t){var e=new bw(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.FixWidthButtons",bw);var xw=Phaser.Utils.Objects.GetValue,Cw=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 Sb(t);return t.add.existing(o),r.addBackground(o),r.addChildrenMap("fileChooser",o),r.setAccept(xw(s,"accept","")),r.setMultiple(xw(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}(lC);Object.assign(Cw.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 Cw(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.FileSelectorButton",Cw);var ww={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}},Sw={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,yg.modal.call(this,t,e),this}},Pw={};Object.assign(Pw,ww,Sw);var Tw=Phaser.Utils.Objects.GetValue,Ow=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=Tw(s,"eventEmitter",u(r));var o,a,h,l,c=Tw(s,"background",void 0),d=Tw(s,"title",void 0),f=Tw(s,"toolbar",void 0),p=Tw(s,"toolbarBackground",void 0),v=Tw(s,"leftToolbar",void 0),g=Tw(s,"leftToolbarBackground",void 0),y=Tw(s,"content",void 0),k=Tw(s,"description",void 0),m=Tw(s,"choices",void 0),b=Tw(s,"choicesBackground",void 0),x=Tw(s,"actions",void 0),C=Tw(s,"actionsBackground",void 0),w=Tw(s,"click",void 0);if(c&&r.addBackground(c),f&&(h=new nw(t,{groupName:"toolbar",background:p,buttons:f,orientation:0,space:{item:Tw(s,"space.toolbarItem",0)},click:w,eventEmitter:r.eventEmitter})),v&&(l=new nw(t,{groupName:"leftToolbar",background:g,buttons:v,orientation:0,space:{item:Tw(s,"space.leftToolbarItem",0)},click:w,eventEmitter:r.eventEmitter})),d||f||v){var S,P=!!d&&Tw(s,"expand.title",!0),T=Tw(s,"align.title","center"),O=!(d&&!P&&"center"===T||!d&&(f||v));S=O?new kx(t,{orientation:0}):new Rk(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:Tw(s,"space.titleLeft",0),right:Tw(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:Tw(s,"space.title",0),top:Tw(s,"space.titleTop",0)});_=Tw(s,"proportion.title",0);r.add(S,{padding:E,proportion:_,expand:!0});}if(y){var R=Tw(s,"align.content","center"),L=Tw(s,"space.content",0),B=(E={left:Tw(s,"space.contentLeft",0),right:Tw(s,"space.contentRight",0),bottom:k||m||x?L:0},_=Tw(s,"proportion.content",0),Tw(s,"expand.content",!0));r.add(y,{align:R,padding:E,proportion:_,expand:B});}if(k){R=Tw(s,"align.description","center");var D=Tw(s,"space.description",0);E={left:Tw(s,"space.descriptionLeft",0),right:Tw(s,"space.descriptionRight",0),bottom:m||x?D:0},_=Tw(s,"proportion.description",0),B=Tw(s,"expand.description",!0);r.add(k,{align:R,padding:E,proportion:_,expand:B});}if(m){var I=Tw(s,"choicesType","").split("-"),j=Mw(I,"wrap")?bw:Mw(I,"grid")?cw:nw,z=Mw(I,"radio")?"radio":Mw(I,"checkboxes")?"checkboxes":void 0,A={left:Tw(s,"space.choicesBackgroundLeft",0),right:Tw(s,"space.choicesBackgroundRight",0),top:Tw(s,"space.choicesBackgroundTop",0),bottom:Tw(s,"space.choicesBackgroundBottom",0)},F=Tw(s,"space.choice",0);j===nw?A.item=F:j===bw?(A.item=F,A.line=Tw(s,"space.choiceLine",F)):(A.column=Tw(s,"space.choiceColumn",F),A.row=Tw(s,"space.choiceRow",F));var Y={width:Tw(s,"choicesWidth",void 0),height:Tw(s,"choicesHeight",void 0),groupName:"choices",buttonsType:z,background:b,buttons:m,space:A,click:w,eventEmitter:r.eventEmitter,setValueCallback:Tw(s,"choicesSetValueCallback",void 0),setValueCallbackScope:Tw(s,"choicesSetValueCallbackScope",void 0)};j===nw&&(Y.orientation=Mw(I,"x")?0:1),o=new j(t,Y);var W=Tw(s,"space.choices",0);E={left:Tw(s,"space.choicesLeft",0),right:Tw(s,"space.choicesRight",0),bottom:x?W:0},R=Tw(s,"align.choices","center"),_=Tw(s,"proportion.choices",0),B=Tw(s,"expand.choices",!0);r.add(o,{align:R,padding:E,proportion:_,expand:B}),r.buttonsType=z;}if(x){a=new nw(t,{groupName:"actions",background:C,buttons:x,orientation:0,space:{item:Tw(s,"space.action",0)},expand:Tw(s,"expand.actions",!1),align:Tw(s,"align.actions","center"),click:w,eventEmitter:r.eventEmitter});E={left:Tw(s,"space.actionsLeft",0),right:Tw(s,"space.actionsRight",0),bottom:Tw(s,"space.actionsBottom",0)},_=Tw(s,"proportion.action",0);r.add(a,{align:"center",padding:E,proportion:_,expand:!0});}return _w(u(r),"click"),_w(u(r),"over"),_w(u(r),"out"),_w(u(r),"enable"),_w(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)}(kx),Mw=function(t,e){return -1!==t.indexOf(e)},Ew={actions:"action",choices:"choice",toolbar:"toolbar",leftToolbar:"leftToolbar"},_w=function(t,e){t.on("button.".concat(e),(function(i,n,s,r,o){Ew.hasOwnProperty(n)&&t.emit("".concat(Ew[n],".").concat(e),i,s,r,o);}));};Object.assign(Ow.prototype,Pw),T.register("dialog",(function(t){var e=new Ow(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Dialog",Ow);var Rw=function(t,e,i){var n=new CC(t,e,i);return t.add.existing(n),n},Lw=function(t){this.childrenMap.title.resetDisplayContent(t.title);},Bw=function(t){var e=this.childrenMap.content;if(e.resetDisplayContent)e.resetDisplayContent(t.content);else {var i=t.content||"";e.setText(i);}},Dw=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}(Xv),wS=Phaser.Utils.Objects.GetValue,SS=Phaser.Math.Distance.Between,PS=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(wS(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(wS(t,"enable",!0)),this.holdThreshold=wS(t,"holdThreshold",50),this.pointerOutReleaseEnable=wS(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 ou(this.scene)}},{key:"speed",get:function(){return this.x===this.preX&&this.y===this.preY?0:SS(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),TS=Phaser.Utils.Objects.GetValue,OS=function(){function t(e){n(this,t),this.resetFromJSON(e);}return r(t,[{key:"resetFromJSON",value:function(t){return this.setValue(TS(t,"value",0)),this.setSpeed(TS(t,"speed",0)),this.setAcceleration(TS(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}(),MS=function(){function t(){n(this,t),this.value,this.dir,this.movement=new OS;}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),LS={y:0,v:0,vertical:0,x:1,h:1,horizontal:1},BS=Phaser.Utils.Objects.GetValue,DS=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=BS(s,"focus",!0):r.focusMode=!1,r.setSpeed(BS(s,"speed",.1)),r.setEnable(BS(s,"enable",!0)),r.focusMode)?(t=r.parent).setInteractive(BS(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),IS=Phaser.Utils.Objects.GetValue,jS=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)?IS(n,c,void 0):IS(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 xS(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=IS(s,"position",0);"string"==typeof v&&(v=zS[v]);var g=IS(n,"space.slider".concat(i),void 0);void 0===g&&void 0===(g=IS(n,"space.slider",void 0))&&(g=l?0:IS(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)]=IS(s,"hideUnscrollableSlider",!1),t["adaptThumb".concat(i,"SizeMode")]=IS(s,"adaptThumbSize",!1),t["minThumb".concat(i,"Size")]=IS(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)?IS(n,k,!0):IS(n,"scroller",!0))&&u&&(!0===o&&(o={}),o.orientation=h?0:1,a=new RS(u,o));var m,b,x,C,w=IS(n,l?"mouseWheelScroller".concat(i):"mouseWheelScroller",!1);(w&&u&&(m=new DS(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);}));}},zS={right:0,left:1,bottom:0,top:1},AS=Phaser.Utils.Objects.GetValue,FS=function(t,e){var i=t.scene,n=[0,1,0],s=[0,1,0],r=AS(e,"width"),o=AS(e,"height");r||(AS(e,"child.expandWidth",!0)||(n[1]=0));o||(AS(e,"child.expandHeight",!0)||(s[1]=0));var a=new zx(i,{column:3,row:3,columnProportions:n,rowProportions:s});switch(function(t,e,i){var n=Hw(i,"child"),s=Hw(n,"gameObject",void 0);if(s){var r=Hw(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=Hw(r,"top",0),o.bottom=Hw(r,"bottom",0),a.left=Hw(r,"left",0),a.right=Hw(r,"right",0);break;case 1:o.top=Hw(r,"left",0),o.bottom=Hw(r,"right",0),a.top=Hw(r,"top",0),a.bottom=Hw(r,"bottom",0);break;default:o.top=Hw(r,"top",0),o.bottom=Hw(r,"bottom",0),o.left=Hw(r,"left",0),o.right=Hw(r,"right",0);}e.add(s,{column:1,row:1,align:Hw(n,"align","center"),padding:a,expand:{width:Hw(n,"expandWidth",!0),height:Hw(n,"expandHeight",!0)}});}t.addChildrenMap("child",s);}(t,a,e),t.scrollMode){case 0:jS(t,a,"y",e);break;case 1:jS(t,a,"x",e);break;default:jS(t,a,"y",e),jS(t,a,"x",e);}return a},YS=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);},WS=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);}},VS=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},ZS=function(t){return (t-this.textLineSpacing)/(this.textLineHeight+this.textLineSpacing)},qS=function(t){return t*(this.textLineHeight+this.textLineSpacing)-this.textLineSpacing},$S=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},QS=function(t,e){switch(KS(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;}},tP=function(){var t=this.textObject.rexSizer;this.textObject.y+=t.offsetY-t.preOffsetY,t.preOffsetY=t.offsetY,this.resetChildPositionState(this.textObject),this.textCropEnable&&eP.call(this);},eP=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);}},iP=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();}},nP={setText:function(t){return void 0!==t&&(this.text=t),this.lines=JS(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(ZS.call(this,-this.textOY)),0),e=qS.call(this,t)+this.textOY,i=$S.call(this,t);return QS(this.textObject,i),this.textObject.rexSizer.offsetY=e,tP.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,Ap.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,iP.call(this,t,r,o),fp(t,n,s,r,o,e.align),e.preOffsetY=0,tP.call(this),this.textMask&&(this.textMask.setPosition().resize(),this.resetChildPositionState(this.textMask)));}},sP=Phaser.Utils.Objects.IsPlainObject,rP=Phaser.Utils.Objects.GetValue,oP=Phaser.Display.Align.TOP_LEFT,aP=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),sP(s)?(s=rP(h=s,"x",0),r=rP(h,"y",0),o=rP(h,"width",void 0),a=rP(h,"height",void 0)):sP(o)&&(o=rP(h=o,"width",void 0),a=rP(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=rP(h,"content",""),l._textOY=0,l.execeedTopState=!1,l.execeedBottomState=!1,l.setClampMode(rP(h,"clamplTextOY",!0)),l.alwaysScrollable=rP(h,"alwaysScrollable",!1);var c=rP(h,"background",void 0),d=rP(h,"text",void 0);void 0===d&&(d=hP(t)),l.textCropEnable=rP(h,"textCrop",!!d.setCrop);var f=rP(h,"textMask",!l.textCropEnable);c&&l.addBackground(c),l.add(d),l.sizerChildren=[d];var p=l.getSizerConfig(d);return p.align=oP,p.padding=mp(0),p.expand=!0,l.textObject=d,l.textObjectType=KS(d),p.preOffsetY=0,p.offsetY=0,f&&(l.textMask=aC.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(ZS.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=qS.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}(yk),hP=function(t){return t.add.text(0,0,"")};Object.assign(aP.prototype,nP);var lP={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}},uP=Phaser.Utils.Objects.GetValue,cP=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=uP(s,"text",void 0),a=uP(s,"textWidth",void 0),h=uP(s,"textHeight",void 0),l=uP(s,"textCrop",!!o.setCrop),u=uP(s,"textMask",!l),c=uP(s,"content",""),d=new aP(t,{width:a,height:h,text:o,textMask:u,textCrop:l&&!u,content:c,clamplTextOY:uP(s,"clamplChildOY",!1),alwaysScrollable:uP(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=uP(s,"space",void 0);return f&&(f.child=uP(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}(HS);Object.assign(cP.prototype,{setText:function(t){return this.childrenMap.child.setText(t),this.resizeController(),this},appendText:function(t){return this.setText(this.text+t),this}},lP);var dP=Phaser.Utils.Objects.GetValue,fP=function(t,e,i){e=e?M(e):{};var n=dP(i,"background",uC),s=dP(i,"text",fC),r=dP(i,"track",uC),o=dP(i,"thumb",uC);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 cP(t,e);return t.add.existing(h),h},pP=Phaser.Utils.Objects.GetValue,vP=Phaser.Utils.Objects.GetValue,gP=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=vP(r,"background",uC);a?s.background=a(t,s.background):delete s.background,s.title=Rw(t,s.title,r.title),s.content=function(t,e,i){var n,s=pP(e,"$type");void 0===s&&e&&(e.hasOwnProperty("slider")||e.hasOwnProperty("scroller"))&&(s="textarea"),n="textarea"===s?new fP(t,e,i):new Rw(t,e,i);return t.add.existing(n),n}(t,s.content,r.content),s.content instanceof cP&&Al(s,"height")&&!Al(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=[Rw(t,l,p),Rw(t,c,v)];break;case 1:s.actions=[Rw(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),Vw.call(u(o)),o}return r(i)}(Ow);Object.assign(gP.prototype,jw),T.register("confirmDialog",(function(t,e){var i=new gP(this.scene,t,e);return this.scene.add.existing(i),i})),Z(window,"RexPlugins.UI.ConfirmDialog",gP);var yP=Phaser.Utils.Objects.GetValue,kP=function(t,e,i){var n=yP(t,"proportion.".concat(e),i.proportion),s=yP(t,"align.".concat(e),"center"),r=yP(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:yP(t,"expand.".concat(e),!0)}},mP=function(t){return kP(t,"header",{proportion:0,paddingKey:"bottom"})},bP=function(t){return kP(t,"leftSide",{proportion:0,paddingKey:"right"})},xP=function(t){return kP(t,"content",{proportion:1})},CP=function(t){return kP(t,"rightSide",{proportion:0,paddingKey:"left"})},wP=function(t){return kP(t,"footer",{proportion:0,paddingKey:"top"})},SP=function(t,e){var i=new kx(t,{orientation:e});return t.add.existing(i),i},PP=Phaser.Utils.Objects.GetValue,TP=[function(t){var e=this.scene,i=t.header;i&&this.add(i,mP(t));var n=SP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,bP(t));var r=t.content;r&&n.add(r,xP(t));var o=t.rightSide;o&&n.add(o,CP(t));var a=t.footer;a&&this.add(a,wP(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,mP(t));var n=SP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,bP(t));var r=SP(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=SP(e,0);r.add(o,{proportion:1,align:"center",padding:0,expand:!0});var a=t.content;a&&o.add(a,xP(t));var h=t.rightSide;h&&o.add(h,CP(t));var l=t.footer;l&&r.add(l,wP(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,mP(t));var n=SP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=SP(e,1);n.add(s,{proportion:1,align:"center",padding:0,expand:!0});var r=SP(e,0);s.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.leftSide;o&&r.add(o,bP(t));var a=t.content;a&&r.add(a,xP(t));var h=t.footer;h&&s.add(h,wP(t));var l=t.rightSide;l&&n.add(l,CP(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,mP(t));var n=SP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,bP(t));var r=SP(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.content;o&&r.add(o,xP(t));var a=t.footer;a&&r.add(a,wP(t));var h=t.rightSide;h&&n.add(h,CP(t));}],OP={FFF:0,LFF:1,FFR:2,LFR:3},MP=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)}(kx),EP={build:function(t){this.clear(!0);var e=PP(t,"background",void 0);e&&this.addBackground(e);var i=PP(t,"layoutMode",0);"string"==typeof i&&(i=OP[i.toUpperCase()]),(TP[i]||TP[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(MP.prototype,EP),T.register("holyGrail",(function(t){var e=new MP(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.HolyGrail",MP);var _P={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 _v(this.getButton(t,e)),this},showLeftButton:function(t){return _v(this.getLeftButton(t)),this},showRightButton:function(t){return _v(this.getRightButton(t)),this},showTopButton:function(t){return _v(this.getTopButton(t)),this},showBottomButton:function(t){return _v(this.getBottomButton(t)),this},hideButton:function(t,e){return Rv(this.getButton(t,e)),this},hideLeftButton:function(t){return Rv(this.getLeftButton(t)),this},hideRightButton:function(t){return Rv(this.getRightButton(t)),this},hideTopButton:function(t){return Rv(this.getTopButton(t)),this},hideBottomButton:function(t){return Rv(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}},RP=Phaser.Utils.Objects.GetValue,LP=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=RP(s,"eventEmitter",u(r));var o,a,h,l,c=RP(s,"background",void 0),d=RP(s,"panel",void 0),f=RP(s,"leftButtons",void 0),p=RP(s,"leftButtonsBackground",void 0),v=RP(s,"rightButtons",void 0),g=RP(s,"rightButtonsBackground",void 0),y=RP(s,"topButtons",void 0),k=RP(s,"topButtonsBackground",void 0),m=RP(s,"bottomButtons",void 0),b=RP(s,"bottomButtonsBackground",void 0),x=RP(s,"click",void 0);if(c&&r.addBackground(c),d&&r.add(d,1,1,"center",0,!0),f){var C=RP(s,"space.leftButtonsOffset",0),w=RP(s,"space.leftButton",0);o=new nw(t,{groupName:"left",background:p,buttons:f,orientation:1,space:{item:w},align:RP(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=RP(s,"space.rightButtonsOffset",0),T=RP(s,"space.rightButton",0);a=new nw(t,{groupName:"right",background:g,buttons:v,orientation:1,space:{item:T},align:RP(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=RP(s,"space.topButtonsOffset",0),M=RP(s,"space.topButton",0);h=new nw(t,{groupName:"top",background:k,buttons:y,orientation:0,space:{item:M},align:RP(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=RP(s,"space.bottomButtonsOffset",0),_=RP(s,"space.bottomButton",0);l=new nw(t,{groupName:"bottom",background:b,buttons:m,orientation:0,space:{item:_},align:RP(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)}(zx);Object.assign(LP.prototype,_P),T.register("tabs",(function(t){var e=new LP(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Tabs",LP),T.register("slider",(function(t){var e=new yS(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Slider",yS);var BP=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=Xf[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(BP.prototype,Ct);var DP=Phaser.Utils.Objects.GetValue,IP=Phaser.Utils.Array.SpliceOne,jP=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(DP(t,"cellsCount",0)),this.setColumnCount(DP(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=$P(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));},XT={down:0,up:1},GT=Phaser.Utils.Objects.GetValue,UT=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){Hp(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 Gp(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),VT(t,s),t.isRexSizer&&t.layout();var o=GT(s,"touchOutsideClose",!1),a=GT(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&&ug(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}(qv),HT={openListPanel:function(){if(this.listPanel)return this;var t,e=YT.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 UT(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(HT,AT);var NT=Phaser.Utils.Objects.GetValue,KT=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(NT(s,"options"));var o=NT(s,"list");return r.setWrapEnable(NT(o,"wrap",!1)),r.setCreateButtonCallback(NT(o,"createButtonCallback")),r.setCreateListBackgroundCallback(NT(o,"createBackgroundCallback")),r.setButtonClickCallback(NT(o,"onButtonClick")),r.setButtonOverCallback(NT(o,"onButtonOver")),r.setButtonOutCallback(NT(o,"onButtonOut")),r.setListExpandDirection(NT(o,"expandDirection")),r.setListEaseInDuration(NT(o,"easeIn",500)),r.setListEaseOutDuration(NT(o,"easeOut",100)),r.setListTransitInCallback(NT(o,"transitIn")),r.settListTransitOutCallback(NT(o,"transitOut")),r.setListSize(NT(o,"width"),NT(o,"height")),r.setListAlignmentMode(NT(o,"alignParent","text")),r.setListAlignmentSide(NT(o,"alignSide","")),r.setListBounds(NT(o,"bounds")),r.setListSpace(NT(o,"space")),r.setListDraggable(NT(o,"draggable",!1)),r.setValueChangeCallback(NT(s,"setValueCallback"),NT(s,"setValueCallbackScope")),r.setValue(NT(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}(lC);Object.assign(KT.prototype,HT),T.register("dropDownList",(function(t){var e=new KT(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.DropDownList",KT);var JT=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=xC(t,n,r);return a.list=e.list||{},a.list.createButtonCallback=function(t,e){var i=Rw(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},ZT=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;return n(this,i),s=JT(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=sO(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(KS(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(rO.prototype,iO);var oO,aO=Phaser.Utils.Objects.GetFastValue,hO=Phaser.Utils.Objects.GetValue,lO=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(hO(t,"wrap",!1)),this.setTypeMode(hO(t,"typeMode",0)),this.setTypingSpeed(hO(t,"speed",333)),this.setTextCallback=aO(t,"setTextCallback",null),this.setTextCallbackScope=aO(t,"setTextCallbackScope",null),this.setTypingContent(aO(t,"text","")),this.typingIdx=aO(t,"typingIdx",0),this.insertIdx=null,this.insertChar=null;var e=aO(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=cO[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=uO(t);this.textWrapEnable&&(e=function(t,e){switch(KS(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(uO(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?QS(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),uO=function(t){return Array.isArray(t)?t=t.join("\n"):"number"==typeof t&&(t=t.toString()),t},cO={"left-to-right":0,"right-to-left":1,"middle-to-sides":2,"sides-to-middle":3},dO=Phaser.Utils.Objects.GetValue,fO=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===oO&&(oO="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=oO;var o=r.childrenMap.text;return r.page=new rO(o,dO(s,"page",void 0)),r.typing=new lO(o,dO(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}(MC)));T.register("textBox",(function(t){var e=new fO(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.TextBox",fO);var pO=Phaser.Utils.Objects.GetValue,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="rexNumberBar";var o,a=pO(s,"background",void 0),h=pO(s,"icon",void 0),l=pO(s,"iconMask",void 0),c=pO(s,"slider",void 0),d=pO(s,"text",void 0),f=pO(s,"space.icon",0),p=pO(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=aC.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 yS(t,c),t.add.existing(o),0===r.orientation?d&&(v={right:p}):d&&(v={bottom:p}),0===r.orientation)g=void 0===pO(c,"width",void 0)?1:0;else g=void 0===pO(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=pO(s,"valuechangeCallback",null);if(null!==y){var k=pO(s,"valuechangeCallbackScope",void 0);r.on("valuechange",y,k);}return r.setEnable(pO(s,"enable",void 0)),r.setValue(pO(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}(kx);T.register("numberBar",(function(t){var e=new vO(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.NumberBar",vO),T.register("scrollBar",(function(t){var e=new xS(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ScrollBar",xS);var gO=Phaser.Utils.Objects.GetValue,yO={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"},kO=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=gO(s,"background",void 0);o&&r.addBackground(o),r.addChildrenMap("background",o);var a=gO(s,"main",void 0);for(var h in a&&r.add(a,{key:"main",align:"center",expand:!1}),r.addChildrenMap("main",a),yO){var l=gO(s,h,void 0);l&&(r.add(l,{key:h,align:yO[h],expand:!1}),r.addChildrenMap(h,l));}return r}return r(i)}(Rk);T.register("badgeLabel",(function(t){var e=new kO(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.BadgeLabel",kO);var mO=Rk.prototype.add,bO=function(t,e,i,n,s,r,o,a,h){return t.setVisible(!1),mO.call(this,t,e,i,n,s,r,o,a,h),this},xO={add:bO,addPage:bO},CO=Yf.prototype.setChildVisible,wO={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?(CO.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&&(CO.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(wO,xO);var SO=Phaser.Utils.Objects.GetValue,PO=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(SO(s,"swapMode",0)),r.setFadeInDuration(SO(s,"fadeIn",0)),r}return r(i,[{key:"setSwapMode",value:function(t){return "string"==typeof t&&(t=TO[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(PO.prototype,wO);var TO={invisible:0,destroy:1};T.register("pages",(function(t){var e=new PO(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Pages",PO);var OO=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}(yk);Object.assign(XM.prototype,FM);var GM=["top","bottom","centerY","center"],UM=["left","right","centerX","center"],HM=function(t,e,i){var n,s="Y"===(e=e.toUpperCase()),r=this.childrenMap.child;if(s){if(i)for(var o=0,a=GM.length;o=0?0:Math.abs(l)<=Math.abs(u)?l:u;}}else {if(i)for(o=0,a=UM.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;}},NM=Phaser.Utils.Objects.GetValue,KM=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=Gw(s),a=NM(s,"panel",void 0);void 0===a&&(a={}),a.scrollMode=o,a.clamplChildOY=NM(s,"clamplChildOY",!1),a.clamplChildOX=NM(s,"clamplChildOX",!1);var h,l,u=new XM(t,a);switch(t.add.existing(u),o){case 0:h=NM(s,"expand.panel",!0),l=!0;break;case 1:h=!0,l=NM(s,"expand.panel",!0);break;default:h=!0,l=!0;}s.type="rexScrollablePanel",s.child={gameObject:u,expandWidth:h,expandHeight:l,align:NM(s,"align.panel","center")};var c=NM(s,"space",void 0);return c&&(c.child=NM(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]),pk(this.childrenMap.child,t),this}}]),i}(HS),JM={scrollToChild:function(t,e){if(!this.hasChild(t))return this;switch(this.scrollMode){case 0:HM.call(this,t,"y",e);break;case 1:HM.call(this,t,"x",e);break;default:HM.call(this,t,"y",e),HM.call(this,t,"x",e);}return this}};Object.assign(KM.prototype,JM),T.register("scrollablePanel",(function(t){var e=new KM(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ScrollablePanel",KM);var ZM=function(t,e){t.popUp(e);},qM=function(t,e){t.scaleDown(e);},$M=function(t,e){t.fadeIn(e);},QM=function(t,e){t.fadeOut(e);},tE=function t(e,i,n){var s,r=bt(n,"reverse",!1);if(mg(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(mg(n)||(n=ju(rE,i,1)),tE(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=aE[t]),this.dtMode=t,this}},{key:"setTimeUnit",value:function(t){return "string"==typeof t&&(t=oE[t]),this.timeUnit=t,this}}]),i}(oo),rE=[],oE={ms:0,s:1,sec:1},aE={abs:0,absolute:0,inc:1,increment:1},hE=Phaser.Utils.Objects.GetValue,lE=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(hE(s,"duration.in",200)),r.setDisplayTime(hE(s,"duration.hold",1200)),r.setTransitOutTime(hE(s,"duration.out",200)),r.setTransitInCallback(hE(s,"transitIn",uE.popUp)),r.setTransitOutCallback(hE(s,"transitOut",uE.scaleDown)),r.player=new sE(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=uE[t]),t){case uE.popUp:t=ZM;break;case uE.fadeIn:t=$M;}return t||(t=D),this.transitInCallback=t,this}},{key:"setTransitOutCallback",value:function(t){switch("string"==typeof t&&(t=uE[t]),t){case uE.scaleDown:t=qM;break;case uE.fadeOut:t=QM;}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}(lC),uE={popUp:0,fadeIn:1,scaleDown:0,fadeOut:1};T.register("toast",(function(t){var e=new lE(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Toast",lE);for(var cE,dE=function(t,e,i){void 0===i&&(i=!0),i?e=e?M(e):{}:e||(e={});var n=new su(t,e);return t.add.existing(n),n},fE=["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"],pE=[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],vE={},gE=0,yE=fE.length;gE0&&{height:this.colorComponentsHeight,formatLabel:this.colorComponentsFormatLabelConfig,inputText:this.colorComponentsInputTextConfig,space:this.colorComponentsSpace};var o=new i_(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},s_={openColorPicker:function(){if(!this.colorPicker){var t=n_.call(this).layout(),e=new UT(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(s_,TE);var r_=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={}),(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(r_(o,"width",160),r_(o,"height",170));var l=r_(o,"background");h=l?function(t){return uC(t,l)}:r_(o,"createBackgroundCallback"),r.setCreateColorPickerBackgroundCallback(h),r.setColorPickerHPalettePosition(r_(o,"hPalettePosition",0)),r.setColorPickerExpandDirection(r_(o,"expandDirection")),r.setColorPickerEaseInDuration(r_(o,"easeIn",200)),r.setColorPickerEaseOutDuration(r_(o,"easeOut",200)),r.setColorPickerTransitInCallback(r_(o,"transitIn")),r.setColorPickerTransitOutCallback(r_(o,"transitOut")),r.setColorPickerBounds(r_(o,"bounds"));var c=r_(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(r_(d,"height",30)),r.setColorComponentsFormatLabelConfig(r_(d,"formatLabel"));var f=r_(d,"inputText");f||(f=r_(s,"inputText")),r.setColorComponentsInputTextConfig(f);var p=r_(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)}(PE);Object.assign(o_.prototype,s_),T.register("colorInput",(function(t){var e=new o_(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ColorInput",o_),T.register("colorInputLite",(function(t){var e=new PE(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ColorInputBase",PE),T.register("colorPicker",(function(t){var e=new NE(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ColorPicker",NE),T.register("colorComponents",(function(t){var e=new t_(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ColorComponents",t_);var a_=function(t,e){return function(i,n,s,r){"panel"!==n&&s.moveChild(i,r?0:t,e);}},h_=function(t,e){return function(i,n,s,r){"panel"===n&&s.moveChild(i,r?0:t,e);}},l_={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:a_,hide:a_},"move-panel":{show:h_,hide:h_}},u_=Yf.prototype.setChildVisible,c_={setChildVisible:function(t,e){if("string"==typeof t){var i=t;t=this.sizerChildren[i];}else i=Mk(this.sizerChildren,t);return void 0===e&&(e=this.currentChildKey===i),u_.call(this,t,e),this}},d_={fadeChild:function(t,e,i){var n;return "string"==typeof t?(n=t,t=this.sizerChildren[n]):n=Mk(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()}},f_={moveChild:function(t,e,i,n){var s;"string"==typeof t?(s=t,t=this.sizerChildren[s]):s=Mk(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()}},p_={};Object.assign(p_,c_,d_,f_);var v_=Phaser.Utils.Objects.GetValue,g_=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=v_(s,"showChildCallback",void 0);if(o)if(gg(o)){var a=v_(s,"showChildCallbackScope",void 0);r.on("showchild",o,a);var h=v_(s,"hideChildCallback",void 0),l=v_(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),l_.hasOwnProperty(e)?(n=l_[e].show.apply(null,i),s=l_[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=v_(s,"background",void 0),d=v_(s,"panel",void 0),f=v_(s,"leftSide",void 0),p=v_(s,"rightSide",void 0),v=v_(s,"topSide",void 0),g=v_(s,"bottomSide",void 0);if(c&&r.addBackground(c),d&&r.add(d,"panel","center",0,!0),f){var y=v_(s,"expand.left",!0);r.add(f,"leftSide","left-top",0,{height:y});}if(p){y=v_(s,"expand.right",!0);r.add(p,"rightSide","right-top",0,{height:y});}if(v){y=v_(s,"expand.top",!0);r.add(v,"topSide","left-top",0,{width:y});}if(g){y=v_(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}(Rk);Object.assign(g_.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}},p_),T.register("sides",(function(t){var e=new g_(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Sides",g_);var y_=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),s=xC(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}(lC),k_=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 Md(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}(y_),m_=function(t,e){var i=new fR(t,e);return t.add.existing(i),i},b_=function(t,e,i){return uC(t,i)},x_=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}(IM);Object.assign(x_.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 C_=Phaser.Utils.Objects.GetValue,w_=Phaser.Utils.Objects.GetValue,S_={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:lR,addButtons:lR,addSeparator:function(t){var e=this.scene,i=uR(this.styles,"separator"),n=b_(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);}},XR=Phaser.Utils.Objects.IsPlainObject,GR=Phaser.Utils.Objects.GetValue,UR=Phaser.Math.DegToRad,HR=Phaser.Math.RadToDeg,NR=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a){var h;if(n(this,i),XR(s)){var l=s;s=GR(l,"x",0),r=GR(l,"y",0),o=GR(l,"key",null),a=GR(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,VR(this,this._skewX,this._skewY);}},{key:"skewXDeg",get:function(){return HR(this._skewX)},set:function(t){this.skewX=UR(t);}},{key:"skewY",get:function(){return this._skewY},set:function(t){this._skewY=t,VR(this,this._skewX,this._skewY);}},{key:"skewYDeg",get:function(){return HR(this._skewY)},set:function(t){this.skewY=UR(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}(WR),KR=Phaser.Utils.Objects.IsPlainObject,JR=Phaser.Utils.Objects.GetValue,ZR=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}(dM(function(t){a(i,t);var e=d(i);function i(t,s,r,o,a){var h;if(n(this,i),KR(s)){var l=s;s=JR(l,"x",0),r=JR(l,"y",0),o=JR(l,"width",32),a=JR(l,"height",32);}var u=WO(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}(NR)));T.register("skew",(function(t,e){return new ZR(t,e)})),Z(window,"RexPlugins.UI.Skew",ZR),T.register("anchor",(function(t,e){return new Yp(t,e)})),Z(window,"RexPlugins.UI.Anchor",Yp),T.register("textTyping",(function(t,e){return new lO(t,e)})),Z(window,"RexPlugins.UI.TextTyping",lO),T.register("textPage",(function(t,e){return new rO(t,e)})),Z(window,"RexPlugins.UI.TextPage",rO);var qR=void 0,$R=Phaser.Utils.Objects.GetValue,QR=Phaser.Utils.Objects.Clone,tL=function(t){return t.hasOwnProperty("align")?t.align:t.hasOwnProperty("halign")?t.halign:"left"},eL=Phaser.Utils.Objects.GetValue,iL=Phaser.Utils.Objects.Merge,nL={open:function(t,e){var i;void 0===t&&(t={}),t=iL(t,this.openConfig),(i=this)!==qR&&(void 0!==qR&&qR.close(),qR=i),gg(t)&&(e=t,t=void 0);var n=eL(t,"inputType",void 0);void 0===n&&(n=eL(t,"type","text")),void 0===e&&(e=eL(t,"onClose",void 0));var s=eL(t,"onOpen",void 0),r=eL(t,"onTextChanged",void 0);return this.inputText=function(t,e){void 0===e&&(e={}),e=QR(e);var i=t.scene,n=t.style,s=$R(e,"backgroundColor",n.backgroundColor);null===s&&(s="transparent"),e.text=$R(e,"text",t.text),e.fontFamily=$R(e,"fontFamily",n.fontFamily),e.fontSize=$R(e,"fontSize",n.fontSize),e.color=$R(e,"color",n.color),e.backgroundColor=s,e.direction=$R(e,"rtl",n.rtl)?"rtl":"ltr",e.align=$R(e,"align",tL(n)),"rtl"===e.direction&&yC(t)&&(e.align="right");var r=new db(i,t.x,t.y,$R(e,"width",t.width),$R(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,eL(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===qR&&(qR=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}},sL=Phaser.Utils.Objects.GetValue,rL=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),sL(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(rL.prototype,nL);T.register("textEdit",(function(t,e){return new rL(t,e)})),Z(window,"RexPlugins.UI.TextEdit",rL);var oL=65535,aL=function(t,e,i){if(null==e)return t;if(0===e)return uL(t,0,i),t;var n=t.text.length;if(0===n)return uL(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=lL(t,s,e,i,r),a=0;a<=oL&&0!==o;a++){if((s+=o)<0){s=0;break}o=lL(t,s,e,i,r);}return a===oL&&console.warn("FontSizeFit: Test count exceeds ".concat(oL)),t.setFontSize(s),uL(t,e,i),t},hL=function(t,e,i){return void 0===i[e]&&(t.setFontSize(e),i[e]={width:t.width,height:t.height}),i[e]},lL=function(t,e,i,n,s){var r,o=hL(t,e,s),a=hL(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)},uL=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));},cL=Phaser.Utils.Objects.GetValue,dL=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&&kg(t,e,i,n)}},{key:"viewport",get:function(){return Zr(this.scene,this.scene.cameras.main,!0)}}]),i}(),fL={getParentSizer:zd,getTopmostSizer:Ad,hide:Rv,show:_v,isShown:Lv,edit:function(t,e,i){return t._edit||(t._edit=new rL(t,{clickEnable:!1})),t._edit.open(e,i),t._edit},wrapExpandText:kC,fontSizeExpandText:function(t,e){"number"==typeof e&&(e={minWidth:e});var i=cL(e,"minWidth",0),n=cL(e,"minHeight",0),s=cL(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 aL(t,e,i),t}):(t.runWidthWrap=function(e){return t.setFixedSize&&t.setFixedSize(0,0),aL(t,e,void 0),t},t.resize=function(e,i){return t.width===e&&t.height===i||t.setFixedSize(e,i),t}),t},fontSizeResize:aL,setFontSizeToFitWidth:aL,waitEvent:Sh,waitComplete:Ph,delayPromise:vb,setChildrenInteractive:pk,fadeIn:nv,fadeOutDestroy:sv,easeMoveTo:pv,easeMoveFrom:vv,modal:pg,modalPromise:function(t,e){var i=pg(t,e);return new Promise((function(t,e){i.once("close",(function(e){t(e);}));}))},modalClose:vg,requestDrag:vR,openFileChooser:function(t,e){var i=yb(e,"closeDelay",200),n=function(t){var e=document.createElement("input");e.type="file";var i=pb(t,"accept",""),n=pb(t,"multiple",!1);return e.setAttribute("accept",i),n?e.setAttribute("multiple",""):e.removeAttribute("multiple"),e}(e);return n.click(),gb({game:t,fileInput:n,closeDelay:i}).then((function(t){return n.remove(),Promise.resolve(t)}))}};return Object.assign(dL.prototype,fL),dL})); + */Object.assign(xi.prototype,Ue,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}(Yi);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,Yn=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},Wn=Phaser.GameObjects.Components.TransformMatrix,Vn={},Xn=function(t,e,i,n,s){var r=Yn(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 Wn,Dn=new Wn),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)},Hn={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(Hn,In);var Un=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=Un(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,Hn);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,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=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}},Yo=Phaser.Utils.Array.Remove,Wo=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:Wo(e,"mute",this.soundEffectsMute),volume:Wo(e,"volume",this.soundEffectsVolume),detune:Wo(e,"detune",0),rate:Wo(e,"rate",1)});return this.soundEffects.push(i),i.once("complete",(function(){i.destroy(),this.sound&&Yo(this.soundEffects,i);}),this).once("destroy",(function(){this.sound&&Yo(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));},Hh=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));},Uh=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=function(){return this.close(),this.emit("keydown-ENTER",this.parent,this),this},Sl=function(){this.isOpened=!0,this.initText(),this.enterCloseEnable&&this.scene.input.keyboard.once("keydown-ENTER",wl,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);},Pl=function(){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);},Tl=Phaser.Utils.Objects.GetValue,Ol=function(t,e){var i,n=Tl(e,"inputType",void 0);void 0===n&&(n=Tl(e,"type","text")),"textarea"===n?(i=document.createElement("textarea")).style.resize="none":(i=document.createElement("input")).type=n;var s=Tl(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.addEventListener("focus",(function(e){Sl.call(t);})),i.addEventListener("blur",(function(e){Pl.call(t);})),i},Ml={open:function(){return this.isOpened||this.readOnly||((t=this)!==kl&&(void 0!==kl&&kl.close(),kl=t),this.node||(this.node=Ol(this,this.nodeConfig)),this.setFocus()),this;var t;},close:function(){return this.isOpened?(this===kl&&(kl=void 0),this.setBlur(),this):this}},El=Phaser.Utils.Objects.GetValue,_l=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=El(s,"inputType",void 0);void 0===o&&(o=El(s,"type","text")),r.setEnterCloseEnable(El(s,"enterClose","textarea"!==o));var a=El(s,"onOpen",void 0);a||(a=El(s,"onFocus",void 0)),r.onOpenCallback=a;var h=El(s,"onClose",void 0);return h||(h=El(s,"onBlur",void 0)),r.onCloseCallback=h,r.onUpdateCallback=El(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(_l.prototype,Ml);var Rl=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},Ll=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)):(Ll(this),Bl(this)),this}},{key:"setNumberInput",value:function(){return this.onUpdateCallback=Rl,this}},{key:"setSelectAllWhenFocusEnable",value:function(t){return void 0===t&&(t=!0),this.selectAllWhenFocus=t,this}}]),i}(_l),jl=Phaser.Utils.Objects.GetValue,zl=["inputType","onOpen","onFocus","onClose","onBlur","onUpdate","enterClose","readOnly","maxLength","minLength","selectAll"],Al=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}Gl.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(Hl(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=qu(t,"tl",0),this.radiusTR=qu(t,"tr",0),this.radiusBL=qu(t,"bl",0),this.radiusBR=qu(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]),Lu(this.x,this.y,t),p(h(i.prototype),"updateData",this).call(this),this}}]),i}(bu),Qu=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha,tc=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=Qu(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}(ku),ec={buildShapes:function(){this.addShape((new $u).setName("box")).addShape((new Ku).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);}},ic=Phaser.Utils.Objects.GetValue,nc=Phaser.Math.Linear,sc=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=ic(t,"key","value");var n=e[this.propertyKey];return this.fromValue=ic(t,"from",n),this.toValue=ic(t,"to",n),this.setEase(ic(t,"ease",this.ease)),this.setDuration(ic(t,"duration",this.duration)),this.setRepeat(ic(t,"repeat",0)),this.setDelay(ic(t,"delay",0)),this.setRepeatDelay(ic(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]=nc(this.fromValue,this.toValue,i);}}]),i}(To),rc={setCheckerAnimationDuration:function(t){return void 0===t&&(t=0),this.checkerAnimDuration=t,this},playCheckerAnimation:function(){return void 0===this.checkerAnimProgressTask&&(this.checkerAnimProgressTask=new sc(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}},oc={};Object.assign(oc,gu,{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}},ec,rc);var ac=Phaser.Utils.Objects.GetValue,hc=Phaser.Utils.Objects.IsPlainObject,lc=23730,uc=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),hc(s)?(s=ac(l=s,"x",0),r=ac(l,"y",0),o=ac(l,"width",2),a=ac(l,"height",2),h=ac(l,"color",lc)):hc(h)&&(h=ac(l=h,"color",lc)),(u=e.call(this,t,s,r,o,a)).type="rexCheckbox",void 0===h&&(h=lc),u.setBoxShape(ac(l,"circleBox",!1)),u.setBoxFillStyle(h,ac(l,"boxFillAlpha",1)),u.setUncheckedBoxFillStyle(ac(l,"uncheckedColor",null),ac(l,"uncheckedBoxFillAlpha",1)),u.setBoxStrokeStyle(ac(l,"boxLineWidth",4),ac(l,"boxStrokeColor",h),ac(l,"boxStrokeAlpha",1)),u.setUncheckedBoxStrokeStyle(u.boxLineWidth,ac(l,"uncheckedBoxStrokeColor",u.boxStrokeColor),ac(l,"uncheckedBoxStrokeAlpha",u.boxStrokeAlpha)),u.setCheckerStyle(ac(l,"checkerColor",16777215),ac(l,"checkerAlpha",1)),u.setBoxSize(ac(l,"boxSize",1)),u.setCheckerSize(ac(l,"checkerSize",1)),u.setCheckerAnimationDuration(ac(l,"animationDuration",150)),u.buildShapes();var c=ac(l,"checked");return void 0===c&&(c=ac(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}(vu);Object.assign(uc.prototype,oc);var cc=Phaser.Utils.Objects.GetValue,dc=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(cc(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(cc(t,"enable",!0)),this.setMode(cc(t,"mode",1)),this.setClickInterval(cc(t,"clickInterval",100)),this.setDragThreshold(cc(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=fc[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),fc={press:0,pointerdown:0,release:1,pointerup:1},pc=Phaser.Utils.Objects.GetValue,vc=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 dc(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}(uc);T.register("checkbox",(function(t,e,i,n,s,r){var o=new vc(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.Checkbox",vc);var gc={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}},yc={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}},kc={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}},mc=function(t,e,i){return (e-t)*i+t},bc=Phaser.Math.Linear,xc={buildShapes:function(){this.addShape((new $u).setName("track")).addShape((new $u).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&mc(yr(l),yr(u),c))<<16|(255&mc(kr(l),kr(u),c))<<8|255&mc(mr(l),mr(u),c)),f=bc(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=bc(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);}},Cc={setToggleAnimationDuration:function(t){return void 0===t&&(t=0),this.toggleAnimDuration=t,this},playToggleAnimation:function(){return void 0===this.toggleAnimProgressTask&&(this.toggleAnimProgressTask=new sc(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}},wc={};Object.assign(wc,gc,yc,kc,xc,Cc);var Sc=Phaser.Utils.Objects.GetValue,Pc=Phaser.Utils.Objects.IsPlainObject,Tc=23730,Oc=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),Pc(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",Tc)):Pc(h)&&(h=Sc(l=h,"color",Tc)),(u=e.call(this,t,s,r,o,a)).type="rexToggleSwitch",void 0===h&&(h=Tc),u.setTrackFillStyle(h,Sc(l,"trackFillAlpha",1)),u.setFalseValueTrackFillStyle(Sc(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)),Sc(l,"falseValueTrackFillAlpha",1)),u.setThumbStyle(Sc(l,"thumbColor",16777215),Sc(l,"thumbAlpha",1)),u.setTrackSize(Sc(l,"trackWidth",.9),Sc(l,"trackHeight",.5)),u.setTrackRadius(Sc(l,"trackRadius",.5*u.trackHeight));var c=Sc(l,"thumbHeight",void 0),d=Sc(l,"thumbWidth",c);return void 0===d&&(d=.9*u.trackHeight),u.setThumbSize(d,c),u.setThumbRadius(Sc(l,"thumbRadius",.5*u.thumbHeight)),u.setThumbPosition(Sc(l,"thumbLeft",.3),Sc(l,"thumbRight",void 0)),u.setRTL(Sc(l,"rtl",!1)),u.setToggleAnimationDuration(Sc(l,"animationDuration",150)),u.buildShapes(),u.setValue(Sc(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}(vu);Object.assign(Oc.prototype,wc);var Mc=Phaser.Utils.Objects.GetValue,Ec=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 dc(u(c),Mc(l,"click")),c._click.on("click",(function(){this.toggleValue();}),u(c)),c.setReadOnly(Mc(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}(Oc);T.register("toggleSwitch",(function(t,e,i,n,s,r){var o=new Ec(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.ToggleSwitch",Ec);var _c={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);}))}},Rc=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(Rc.prototype,_c),T.register("canvas",(function(t,e,i,n){var s=new Rc(this.scene,t,e,i,n);return this.scene.add.existing(s),s})),Z(window,"RexPlugins.UI.Canvas",Rc);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="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=Lc(n,"maskType",0),r=Lc(n,"backgroundColor",void 0),o=Lc(n,"strokeColor",void 0),a=Lc(n,"strokeWidth",null!=o?10:0);if(void 0===s?s=0:"string"==typeof s&&(s=Dc[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=Lc(n,"radius",0),y=Lc(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),Dc={circle:0,ellipse:1,roundRectangle:2};T.register("circleMaskImage",(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.CircleMaskImage",Bc);var Ic=Phaser.Utils.Objects.GetValue,jc=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=Ic(n,"mask.key"),r=Ic(n,"mask.frame"),o=Ic(n,"mask.invertAlpha",!1),a=Ic(n,"mask.scale"),h=Ic(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 jc(this.scene,t,e,i,n,s);return this.scene.add.existing(r),r})),Z(window,"RexPlugins.UI.AlphaMaskImage",jc);var zc=Phaser.Math.Linear,Ac=Phaser.Math.Percent,Fc={setValue:function(t,e,i){return null==t||(void 0!==e&&(t=Ac(t,e,i)),this.value=t),this},addValue:function(t,e,i){return void 0!==e&&(t=Ac(t,e,i)),this.value+=t,this},getValue:function(t,e){var i=this.value;return void 0!==t&&(i=zc(t,e,i)),i}},Yc=Phaser.Math.Percent,Wc={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=Yc(t,e,i)),void 0===this.easeValueTask&&(this.easeValueTask=new sc(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 sc(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,from:t,to:e,duration:this.easeValueDuration,ease:this.easeFunction,repeat:i,repeatDelay:n}),this}},Vc=Phaser.Utils.Objects.GetValue,Xc=Phaser.Math.Clamp;function Gc(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=Vc(t,"eventEmitter",this);var e=Vc(t,"valuechangeCallback",null);if(null!==e){var i=Vc(t,"valuechangeCallbackScope",void 0);this.eventEmitter.on("valuechange",e,i);}return this.setEaseValuePropName("value").setEaseValueDuration(Vc(t,"easeValue.duration",0)).setEaseValueFunction(Vc(t,"easeValue.ease","Linear")),this}},{key:"value",get:function(){return this._value},set:function(t){t=Xc(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,Fc,Wc),e}var Hc=Phaser.Math.RadToDeg,Uc=Phaser.Math.DegToRad,Nc=function(t,e,i,n,s,r,o,a){var h=360===Math.abs(o-r),l=Uc(r),u=Uc(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},Kc={buildShapes:function(){this.addShape((new Ku).setName("track")).addShape((new Ku).setName("bar")).addShape((new wu).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),Nc(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=Hc(this.startAngle),h=360*(o?1-this.value:this.value)+a;r.fillStyle(this.barColor),Nc(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();}},Jc=Phaser.Utils.Objects.GetValue,Zc=Phaser.Utils.Objects.IsPlainObject,qc=Phaser.Math.Clamp,$c=Phaser.Math.DegToRad(270),Qc=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),Zc(s)&&(s=Jc(l=s,"x",0),r=Jc(l,"y",0),o=Jc(l,"radius",1),a=Jc(l,"barColor",void 0),h=Jc(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(Jc(l,"trackColor",void 0)),u.setBarColor(a),u.setCenterColor(Jc(l,"centerColor",void 0)),u.setThickness(Jc(l,"thickness",.2)),u.setStartAngle(Jc(l,"startAngle",$c)),u.setAnticlockwise(Jc(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=qc(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}(Gc(vu));Object.assign(Qc.prototype,Kc),T.register("circularProgress",(function(t,e,i,n,s,r){var o=new Qc(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.CircularProgress",Qc);var td=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());},ed=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(),td(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(),td(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(),td(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());},id=Phaser.Utils.Objects.GetValue,nd=Phaser.Utils.Objects.IsPlainObject,sd=Phaser.Math.Clamp,rd=Phaser.Math.DegToRad(270),od=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;n(this,i),nd(s)&&(s=id(l=s,"x",0),r=id(l,"y",0),o=id(l,"radius",1),a=id(l,"barColor",void 0),h=id(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(id(l,"trackColor",void 0)),u.setBarColor(a),u.setCenterColor(id(l,"centerColor",void 0)),u.setThickness(id(l,"thickness",.2)),u.setStartAngle(id(l,"startAngle",rd)),u.setAnticlockwise(id(l,"anticlockwise",!1)),u.setTextColor(id(l,"textColor",void 0)),u.setTextStrokeColor(id(l,"textStrokeColor",void 0),id(l,"textStrokeThickness",void 0));var d=id(l,"textFont",void 0);return d?u.setTextFont(d):u.setTextFont(id(l,"textSize","16px"),id(l,"textFamily","Courier"),id(l,"textStyle","")),u.setTextFormatCallback(id(l,"textFormatCallback",void 0),id(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=sd(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(),ed.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}(Gc(pe));T.register("circularProgressCanvas",(function(t,e,i,n,s,r){var o=new od(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.CircularProgressCanvas",od);var ad=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},hd=Phaser.Utils.Objects.GetValue,ld=Phaser.Utils.Objects.IsPlainObject,ud=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),ld(s)?(s=hd(u=s,"x",0),r=hd(u,"y",0),o=hd(u,"width",2),a=hd(u,"height",2),h=hd(u,"barColor",void 0),l=hd(u,"value",0)):ld(o)?(o=hd(u=o,"width",2),a=hd(u,"height",2),h=hd(u,"barColor",void 0),l=hd(u,"value",0)):ld(h)&&(h=hd(u=h,"barColor",void 0),l=hd(u,"value",0)),(c=e.call(this,t,s,r,o,a,u)).type="rexLineProgress",c.bootProgressBase(u),c.addShape((new Ku).setName("trackFill")).addShape((new Ku).setName("bar")).addShape((new Ku).setName("trackStroke")),c.setTrackColor(hd(u,"trackColor",void 0)),c.setBarColor(h),c.setTrackStroke(hd(u,"trackStrokeThickness",2),hd(u,"trackStrokeColor",void 0)),c.setSkewX(hd(u,"skewX",0)),c.setRTL(hd(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}(Gc(vu)),cd={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&&ad(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),ad(o,s,0,r,i,t).close());var a=this.getShape("trackStroke");a.lineStyle(this.trackStrokeThickness,this.trackStrokeColor),a.isStroked&&ad(a,0,0,e,i,t).end();}};Object.assign(ud.prototype,cd),T.register("lineProgress",(function(t,e,i,n,s,r,o){var a=new ud(this.scene,t,e,i,n,s,r,o);return this.scene.add.existing(a),a})),Z(window,"RexPlugins.UI.LineProgress",ud);var dd=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(),dd(0,r,this.trackPoints,void 0,this.trackStrokeColor,this.trackStrokeThickness),r.restore());},pd=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},vd=Phaser.Utils.Objects.GetValue,gd=Phaser.Utils.Objects.IsPlainObject,yd=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),gd(s)?(s=vd(u=s,"x",0),r=vd(u,"y",0),o=vd(u,"width",2),a=vd(u,"height",2),h=vd(u,"barColor",void 0),l=vd(u,"value",0)):gd(o)?(o=vd(u=o,"width",2),a=vd(u,"height",2),h=vd(u,"barColor",void 0),l=vd(u,"value",0)):gd(h)&&(h=vd(u=h,"barColor",void 0),l=vd(u,"value",0)),(c=e.call(this,t,s,r,o,a)).type="rexLineProgressCanvas",c.trackPoints=[],c.barPoints=[],c.bootProgressBase(u),c.setTrackColor(vd(u,"trackColor",void 0)),c.setBarColor(h,vd(u,"barColor2",void 0),vd(u,"isHorizontalGradient",void 0)),c.setTrackStroke(vd(u,"trackStrokeThickness",2),vd(u,"trackStrokeColor",void 0)),c.setSkewX(vd(u,"skewX",0)),c.setRTL(vd(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(),fd.call(this),p(h(i.prototype),"updateTexture",this).call(this),this}}]),i}(Gc(pe));T.register("circularProgressCanvas",(function(t,e,i,n,s,r,o){var a=new yd(this.scene,t,e,i,n,s,r,o);return this.scene.add.existing(a),a})),Z(window,"RexPlugins.UI.LineProgressCanvas",yd),Phaser.Math.Wrap;var kd=Phaser.Math.Linear,md=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=kd(m.a.x,b.a.x,x),e=kd(m.a.y,b.a.y,x),i=kd(m.b.x,b.b.x,x),n=kd(m.b.y,b.b.y,x),s=kd(m.c.x,b.c.x,x),r=kd(m.c.y,b.c.y,x);}o.startAt(t,e).lineTo(i,n).lineTo(s,r),this.arrowOnly?o.end():o.close();},bd=(0, Phaser.Math.DegToRad)(120),xd=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+bd),i+n*Math.sin(s+bd)).lineTo(e+n*Math.cos(s),i+n*Math.sin(s)).lineTo(e+n*Math.cos(s-bd),i+n*Math.sin(s-bd)),this.arrowOnly?t.end():t.close();},Cd={buildShapes:function(){this.addShape((new Ku).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?md.call(this):xd.call(this);}},wd={setEaseDuration:function(t){return void 0===t&&(t=0),this.easeDuration=t,this},playEaseDirectionation:function(){return void 0===this.easeDirectionProgressTask&&(this.easeDirectionProgressTask=new sc(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}},Sd=Phaser.Utils.Objects.GetValue,Pd=Phaser.Utils.Objects.IsPlainObject,Td=Phaser.Math.DegToRad,Od=Phaser.Math.RadToDeg,Md=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),Pd(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=_d(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=Sd(r,"x",null);null!==o?(t=o,n=o):(t=Sd(r,"left",0),n=Sd(r,"right",t));var a=Sd(r,"y",null);null!==a?(e=a,s=a):(e=Sd(r,"top",0),s=Sd(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 Od(this.verticeRotation)},set:function(t){this.verticeRotation=Td(t);}},{key:"setVerticeAngle",value:function(t){return this.verticeAngle=t,this}}]),s}(vu),Ed={right:0,down:1,left:2,up:3},_d=function(t){return "string"==typeof t&&(t=Ed[t]),t%=4};Object.assign(Md.prototype,Cd,wd),T.register("triangle",(function(t,e,i,n,s,r){var o=new Md(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.Triangle",Md),lt();var Rd=Phaser.GameObjects.Zone,Ld=Phaser.Utils.Array.Add,Bd=Phaser.Utils.Array.Remove,Dd=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 Ld(this.children,t,0,(function(t){t.once("destroy",e.onChildDestroy,e);}),this),this}},{key:"remove",value:function(t,e){var i=this;return Bd(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));}},vf=Phaser.Utils.Array,gf={getChildren:function(t){if(t)for(var e=0,i=this.children.length;e=0;e--)this.remove(this.backgroundChildren[e],t);return this}},Lp=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},Bp=/(\S+)\[(\d+)\]/i,Dp={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}},Ip=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},jp=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},zp={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}},Ap=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}(Xv),Hv={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}},Uv={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}},Nv={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}},Kv={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}},Jv={};Object.assign(Jv,Hv,Uv,Nv,Kv);var 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,s)).setTransitInTime(Zv(s,"duration.in",200)),r.setTransitOutTime(Zv(s,"duration.out",200)),r.setTransitInCallback(Zv(s,"transitIn")),r.setTransitOutCallback(Zv(s,"transitOut")),r.oneShotMode=Zv(s,"destroy",!1),r.delayCallTimer=void 0,r._state=new Gv(u(r),{eventEmitter:!1,initState:Zv(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(qv.prototype,Jv);var $v=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),Qv=Phaser.Utils.Objects.GetValue,tg=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(Qv(t,"hitAreaMode",0)),this.setEnable(Qv(t,"enable",!0)),this.setStopMode(Qv(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=eg[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),eg={default:0,fullWindow:1},ig=Phaser.Utils.Objects.GetValue,ng=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i);var o=ig(s,"color",0),a=ig(s,"alpha",.8);return (r=e.call(this,t,o,a)).touchEventStop=new tg(u(r),{hitAreaMode:1}),r}return r(i)}($v),sg=function(t,e){void 0!==t._modalScaleSave?(t.scaleX=t._modalScaleSave,t.scaleY=t._modalScaleSave):t._modalScaleSave=t.scaleX,Up(t,e);},rg=function(t,e){Np(t,e,void 0,void 0,!1);},og=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,nv(t,e);},ag=function(t,e){sv(t,e,!1);},hg=function(t,e){void 0!==t._modalAlphaSave?t.alpha=t._modalAlphaSave:t._modalAlphaSave=t.alpha,nv(t,e,t.alpha);},lg=function(t,e){sv(t,e,!1);},ug=function(t,e,i,n,s){return !!t&&(!(n&&!n(t,e,i))&&(!!Ir(t,!0).contains(e,i)&&!(s&&!s(t,e,i))))},cg=Phaser.Utils.Objects.GetValue,dg=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=fg.popUp),null==s.transitOut&&(s.transitOut=fg.scaleDown),s.destroy=cg(s,"destroy",!0),r=e.call(this,t,s);var o=cg(s,"cover");r.cover=!1!==o?function(t,e){var i=t.scene,n=new ng(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(cg(o,"transitIn",hg)),r.setCoverTransitOutCallback(cg(o,"transitOut",lg)));var a=cg(s,"touchOutsideClose",!1),h=cg(s,"duration.hold",-1),l=cg(s,"timeOutClose",h>=0),c=cg(s,"anyTouchClose",!1);return cg(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)),cg(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&&ug(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=fg[t]),t){case fg.popUp:t=sg;break;case fg.fadeIn:t=og;}return p(h(i.prototype),"setTransitInCallback",this).call(this,t),this}},{key:"setTransitOutCallback",value:function(t){switch("string"==typeof t&&(t=fg[t]),t){case fg.scaleDown:t=rg;break;case fg.fadeOut:t=ag;}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}(qv),fg={popUp:0,fadeIn:1,scaleDown:0,fadeOut:1},pg=function(t,e){var i=new dg(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},vg=function(t,e){t.emit("modal.requestClose",e);},gg=function(t){return t&&"function"==typeof t},yg={modal:function(t,e){return gg(t)&&(e=t,t=void 0),void 0===this._modalBehavior&&(this.onCreateModalBehavior&&this.onCreateModalBehavior(this,t),this._modalBehavior=pg(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 vg(this,t),this}},kg=function(t,e,i,n){if(e)return ug(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),Ig={press:0,pointerdown:0,release:1,pointerup:1},jg={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 Dg(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}},zg=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}(Xv),Ag=Phaser.Utils.Objects.GetValue,Fg=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 zg,r.parent.setInteractive(Ag(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(Ag(t,"enable",!0)),this.setCooldown(Ag(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),Yg={isPointerInBounds:function(t){return void 0===t?t=this:"string"==typeof t&&(t=this.getElement(t)),!!t&&kg(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 Fg(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 Fg(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}},Wg=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=ny,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===sy&&this.onDragEnd(),this.pointer=void 0,this.tracerState=ny,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=ry,this}}]),i}(ho),ny=0,sy=1,ry="IDLE",oy=Phaser.Utils.Objects.GetValue,ay=Phaser.Math.Distance.Between,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.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=ly;},eventEmitter:!1};return r.setRecongizedStateObject(new Xv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setHoldTime(oy(t,"time",250)),this.setTapInterval(oy(t,"tapInterval",200)),this.setDragThreshold(oy(t,"threshold",9)),this.setTapOffset(oy(t,"tapOffset",10));var e=oy(t,"taps",void 0);return void 0!==e?this.setTaps(e):(this.setMaxTaps(oy(t,"maxTaps",void 0)),this.setMinTaps(oy(t,"minTaps",void 0))),this}},{key:"onDragStart",value:function(){switch(this.state){case ly:this.state=uy;break;case uy:var t=this.lastPointer;ay(t.upX,t.upY,t.x,t.y)>this.tapOffset&&(this.state=cy,this.state=uy);break;case cy:this.state=uy;}}},{key:"onDragEnd",value:function(){this.state===uy&&(this.tapsCount++,this.emit("tapping",this,this.gameObject,this.lastPointer),void 0!==this.maxTaps&&this.tapsCount===this.maxTaps&&(this.state=cy));}},{key:"onDrag",value:function(){this.state!==ly&&this.pointer.getDistance()>this.dragThreshold&&(this.state=ly);}},{key:"preUpdate",value:function(t,e){if(this.isRunning&&this.enable&&this.state===uy){var i=this.lastPointer;if(i.isDown)t-i.downTime>this.holdTime&&(this.state=ly);else t-i.upTime>this.tapInterval&&(void 0===this.minTaps||this.tapsCount>=this.minTaps?this.state=cy:this.state=ly);}}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===cy&&(this.state=ly);}},{key:"isTapped",get:function(){return this.state===cy}},{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}(iy),ly="IDLE",uy="BEGIN",cy="RECOGNIZED",dy=Phaser.Utils.Objects.GetValue,fy=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=py;},eventEmitter:!1};return r.setRecongizedStateObject(new Xv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(dy(t,"threshold",9)),this.setHoldTime(dy(t,"time",251)),this}},{key:"onDragStart",value:function(){this.state=vy,0===this.holdTime&&(this.state=gy);}},{key:"onDragEnd",value:function(){this.state=py;}},{key:"onDrag",value:function(){this.state!==py&&this.pointer.getDistance()>this.dragThreshold&&(this.state=py);}},{key:"preUpdate",value:function(t,e){this.isRunning&&this.enable&&(this.state===vy&&t-this.pointer.downTime>=this.holdTime&&(this.state=gy));}},{key:"isPressed",get:function(){return this.state===gy}},{key:"setHoldTime",value:function(t){return this.holdTime=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(iy),py="IDLE",vy="BEGIN",gy="RECOGNIZED",yy=Phaser.Utils.Objects.GetValue,ky=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=my;},eventEmitter:!1};return r.setRecongizedStateObject(new Xv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(yy(t,"threshold",10)),this}},{key:"onDragStart",value:function(){this.state=by,0===this.dragThreshold&&(this.state=xy);}},{key:"onDragEnd",value:function(){this.state=my;}},{key:"onDrag",value:function(){switch(this.state){case by:this.pointer.getDistance()>=this.dragThreshold&&(this.state=xy);break;case xy: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===xy}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(iy),my="IDLE",by="BEGIN",xy="RECOGNIZED",Cy=Phaser.Math.Distance.Between,wy=Phaser.Math.Angle.Between,Sy={getDt:function(){return ou(this.scene)},getVelocity:function(){var t=this.pointer.position,e=this.pointer.prevPosition;return Cy(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 wy(e.x,e.y,t.x,t.y)}},Py={"up&down":0,"left&right":1,"4dir":2,"8dir":3},Ty={},Oy=Phaser.Utils.Objects.GetValue,My=Phaser.Math.RadToDeg,Ey=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=_y;},eventEmitter:!1};return r.setRecongizedStateObject(new Xv(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=Ry;}},{key:"onDragEnd",value:function(){this.state=_y;}},{key:"onDrag",value:function(){this.state===Ry&&(this.validDrag||(this.validDrag=0===this.dragThreshold||this.pointer.getDistance()>=this.dragThreshold),this.validDrag&&this.dragVelocity>this.velocityThreshold&&(this.state=Ly));}},{key:"postUpdate",value:function(t,e){this.isRunning&&this.enable&&this.state===Ly&&(this.state=_y);}},{key:"isSwiped",get:function(){return this.state===Ly}},{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=Py[t]),this.dirMode=t,this}},{key:"updateDirectionStates",value:function(){return function(t,e,i){switch(void 0===i?i={}:!0===i&&(i=Ty),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;}}(My(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}(iy);Object.assign(Ey.prototype,Sy);var _y="IDLE",Ry="BEGIN",Ly="RECOGNIZED",By=Phaser.Utils.Objects.GetValue,Dy=Phaser.Utils.Array.SpliceOne,Iy=Phaser.Math.Distance.Between,jy=Phaser.Math.Angle.Between,zy=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(By(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(By(t,"enable",!0)),this.bounds=By(t,"bounds",void 0),this.tracerState=Fy,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 Fy:this.tracerState=Yy,this.onDrag1Start();break;case Yy:this.tracerState=Wy,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],Dy(this.pointers,e),this.tracerState){case Yy:this.tracerState=Fy,this.onDrag1End();break;case Wy:this.tracerState=Yy,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 Yy:this.onDrag1();break;case Wy:this.onDrag2();}}}},{key:"dragCancel",value:function(){return this.tracerState===Wy&&this.onDrag2End(),this.pointers.length=0,xt(this.movedState),this.tracerState=Fy,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!==Wy)return 0;var t=this.pointers[0],e=this.pointers[1];return Iy(t.x,t.y,e.x,e.y)}},{key:"angleBetween",get:function(){if(this.tracerState!==Wy)return 0;var t=this.pointers[0],e=this.pointers[1];return jy(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;Ay.x=e.x-i.x,Ay.y=e.y-i.y;}else Ay.x=0,Ay.y=0;return Ay}},{key:"centerX",get:function(){if(this.tracerState!==Wy)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!==Wy)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!==Wy)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!==Wy)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=Vy,this}}]),t}();Object.assign(zy.prototype,sr);var Ay={},Fy=0,Yy=1,Wy=2,Vy="IDLE",Xy=Phaser.Utils.Objects.GetValue,Gy=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=Hy;},eventEmitter:!1};return r.setRecongizedStateObject(new Xv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(Xy(t,"threshold",0)),this}},{key:"onDrag2Start",value:function(){this.scaleFactor=1,this.prevDistance=this.distanceBetween,this.state=Uy,0===this.dragThreshold&&(this.state=Ny);}},{key:"onDrag2End",value:function(){this.state=Hy;}},{key:"onDrag2",value:function(){switch(this.state){case Uy: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=Ny;}break;case Ny:t=this.distanceBetween;this.scaleFactor=t/this.prevDistance,this.emit("pinch",this),this.prevDistance=t;}}},{key:"isPinched",get:function(){return this.state===Ny}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(zy),Hy="IDLE",Uy="BEGIN",Ny="RECOGNIZED",Ky=Phaser.Math.RotateAround,Jy=function(t,e,i,n){return Ky(t,e,i,n),t.rotation+=n,t},Zy={},qy=Phaser.Utils.Objects.GetValue,$y=Phaser.Math.Angle.WrapDegrees,Qy=Phaser.Math.Angle.ShortestBetween,tk=Phaser.Math.RadToDeg,ek=Phaser.Math.DegToRad,ik=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=sk;},eventEmitter:!1};return r.setRecongizedStateObject(new Xv(a)),r}return r(i,[{key:"resetFromJSON",value:function(t){return p(h(i.prototype),"resetFromJSON",this).call(this,t),this.setDragThreshold(qy(t,"threshold",0)),this}},{key:"onDrag2Start",value:function(){this.prevAngle=$y(tk(this.angleBetween)),this.state=rk,0===this.dragThreshold&&(this.state=ok);}},{key:"onDrag2End",value:function(){this.state=sk;}},{key:"onDrag2",value:function(){switch(this.state){case rk:if(this.pointers[0].getDistance()>=this.dragThreshold&&this.pointers[1].getDistance()>=this.dragThreshold){var t=$y(tk(this.angleBetween));this.angle=Qy(this.prevAngle,t),this.prevAngle=t,this.state=ok;}break;case ok:t=$y(tk(this.angleBetween));this.angle=Qy(this.prevAngle,t),this.prevAngle=t,this.emit("rotate",this);}}},{key:"isRotated",get:function(){return this.state===ok}},{key:"rotation",get:function(){return ek(this.angle)}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}}]),i}(zy),nk={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=Zy),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),Rm(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(),Jm(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}(Yf);Object.assign(ib.prototype,Bm),T.register("imageBox",(function(t,e,i,n,s){var r=new ib(this.scene,t,e,i,n,s);return this.scene.add.existing(r),r})),Z(window,"RexPlugins.UI.ImageBox",ib),T.register("fullWindowRectangle",(function(t,e){var i=new $v(this.scene,t,e);return this.scene.add.existing(i),i})),Z(window,"RexPlugins.UI.FullWindowRectangle",$v),T.register("cover",(function(t){var e=new ng(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Cover",ng);var nb=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},sb={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"]},rb={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]},ob={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"},ab=Phaser.Utils.Objects.GetValue,hb=function(t,e,i,n){var s=ab(n,"preventDefault",!1),r=ab(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);},lb=Phaser.GameObjects.DOMElement,ub=Phaser.Utils.Objects.IsPlainObject,cb=Phaser.Utils.Objects.GetValue,db=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l,c;n(this,i),ub(s)?(s=cb(h=s,"x",0),r=cb(h,"y",0),o=cb(h,"width",0),a=cb(h,"height",0)):ub(o)&&(o=cb(h=o,"width",0),a=cb(h,"height",0)),void 0===h&&(h={});var d=cb(h,"inputType",void 0);void 0===d&&(d=cb(h,"type","text")),"textarea"===d?(c=document.createElement("textarea")).style.resize="none":(c=document.createElement("input")).type=d,bl(sb,h,c);var f=cb(h,"style",void 0);f=bl(rb,h,f);var p=c.style;for(var v in h)v in sb||v in rb||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),hb(u(l),c,ob),xl(c),cb(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}(lb),fb={resize:nb};Object.assign(db.prototype,fb),T.register("inputText",(function(t){var e=new db(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.InputText",db);var pb=Phaser.Utils.Objects.GetValue,vb=function(t,e){return void 0===t&&(t=0),new Promise((function(i,n){setTimeout((function(){i(e);}),t);}))},gb=function(t){var e=t.game,i=t.fileInput,n=t.closeDelay;return Sh(X(e).events,"focus").then((function(){return vb(n)})).then((function(){var t={files:i.files};return Promise.resolve(t)}))},yb=Phaser.Utils.Objects.GetValue,kb=function(t){return this.setOrigin(t.originX,t.originY),this.setPosition(t.x,t.y),this.resize(t.displayWidth,t.displayHeight),this},mb=function(t,e,i,n,s,r){if(null===s||!1===s);else if(gg(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);})),gg(e))e();else {var h=window.URL.createObjectURL(e);a[i](n,h);}a.start();},bb={loadFile:function(t,e,i,n,s){var r=this.scene;return mb(r,t,e,i,n,s),this},loadFilePromise:function(t,e,i,n){var s=this.scene;return new Promise((function(r,o){mb(s,t,e,i,n,(function(t){r(t);}));}))}},xb=Phaser.GameObjects.DOMElement,Cb=Phaser.Utils.Objects.IsPlainObject,wb=Phaser.Utils.Objects.GetValue,Sb=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),Cb(s)?(s=wb(h=s,"x",0),r=wb(h,"y",0),o=wb(h,"width",0),a=wb(h,"height",0)):Cb(o)&&(o=wb(h=o,"width",0),a=wb(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=wb(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(wb(h,"closeDelay",200)),c.onclick=function(){gb({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(wb(t,"accept","")),this.setMultiple(wb(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}(xb),Pb={resize:nb,syncTo:kb};Object.assign(Sb.prototype,Pb,bb),T.register("fileChooser",(function(t){var e=new Sb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.FileChooser",Sb);var Tb={setDropEnable:function(t){return void 0===t&&(t=!0),this.dropEnable=t,this},toggleDropEnable:function(){return this.dropEnable=!this.dropEnable,this}},Ob={resize:nb,syncTo:kb};Object.assign(Ob,Tb,{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}},bb);var Mb={dragenter:"dragenter",dragleave:"dragleave",dragover:"dragover",drop:"drop"},Eb=Phaser.GameObjects.DOMElement,_b=Phaser.Utils.Objects.IsPlainObject,Rb=Phaser.Utils.Objects.GetValue,Lb=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),_b(s)?(s=Rb(h=s,"x",0),r=Rb(h,"y",0),o=Rb(h,"width",0),a=Rb(h,"height",0)):_b(o)&&(o=Rb(h=o,"width",0),a=Rb(h,"height",0)),void 0===h&&(h={});var c=document.createElement("div"),d=Rb(h,"style",void 0);(l=e.call(this,t,s,r,c,d)).type="rexFileDropZone",l.resize(o,a),l._files=[],l.setDropEnable(Rb(h,"dropEnable",!0));var f=Rb(h,"filters");return f&&l.addFilters(f),hb(u(l),c,Mb,{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}(Eb);Object.assign(Lb.prototype,Ob),T.register("fileDropZone",(function(t){var e=new Lb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.FileDropZone",Lb);var Bb=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),Db=Phaser.Utils.Objects.GetValue,Ib=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=Db(s,"style",u(r));var o=Db(s,"propertiesMap");return r.activeStyle=jb(s,"active",o),r.hoverStyle=jb(s,"hover",o),r.disableStyle=jb(s,"disable",o),r.onModifyStyle=Db(s,"onModifyStyle"),r}return r(i,[{key:"getStyle",value:function(t){return Yl(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 Wl(e,t)?void 0:(this.modifyStyle(t),e)}}},{key:"setActiveState",value:function(t){return zb.call(this,"active",t),this}},{key:"setHoverState",value:function(t){return zb.call(this,"hover",t),this}},{key:"setDisableState",value:function(t){return zb.call(this,"disable",t),this}}]),i}(oo),jb=function(t,e,i){var n=Fl(t,e);if(i)for(var s in n)i.hasOwnProperty(s)&&(n[i[s]]=n[s],delete n[s]);return n},zb=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));},Ab={addStyleManager:function(t){return this.styleManager=new Ib(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}},Fb=Phaser.GameObjects.Image,Yb=Phaser.Utils.Objects.GetValue,Wb=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=Yb(s,"x",0),a=Yb(s,"y",0),h=Yb(s,"key",""),l=Yb(s,"frame",void 0);(r=e.call(this,t,o,a,h,l)).type="rexStatesImage";var c=Yb(s,"effects",!0);return c&&pr(u(r),c),r.style=new Bb(u(r),s),s.style=r.style,r.addStyleManager(s),delete s.style,r}return r(i)}(Fb);Object.assign(Wb.prototype,Ab),T.register("statesImage",(function(t){var e=new Wb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.StatesImage",Wb);var Vb=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=Xb,r.addStyleManager(s),delete s.style,delete s.propertiesMap,r}return r(i)}(se),Xb={color:"fillColor",alpha:"fillAlpha",strokeWidth:"lineWidth"};Object.assign(Vb.prototype,Ab),T.register("statesRoundRectangle",(function(t){var e=new Vb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.StatesRoundRectangle",Vb);var Gb=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),Hb=Phaser.GameObjects.NineSlice,Ub=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=Ub(s,"x",0),a=Ub(s,"y",0),h=Ub(s,"key",null),l=Ub(s,"frame",null),c=Ub(s,"width",0),d=Ub(s,"height",0),f=Ub(s,"leftWidth",0),p=Ub(s,"rightWidth",0),v=Ub(s,"topHeight",0),g=Ub(s,"bottomHeight",0);(r=e.call(this,t,o,a,h,l,c,d,f,p,v,g)).type="rexStatesNineSlice";var y=Ub(s,"effects",!0);return y&&pr(u(r),y),r.style=new Gb(u(r),s),s.style=r.style,r.addStyleManager(s),delete s.style,r}return r(i)}(Hb);Object.assign(Nb.prototype,Ab),T.register("statesNineSlice",(function(t){var e=new Nb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.StatesNineSlice",Nb);var Kb=Phaser.GameObjects.Text,Jb=Phaser.Utils.Objects.GetValue,Zb=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=Jb(s,"x",0),a=Jb(s,"y",0),h=Jb(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)}(Kb);Object.assign(Zb.prototype,Ab),T.register("statesText",(function(t){var e=new Zb(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.StatesText",Zb);var qb=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},$b=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}(Rc),Qb={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,qb(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},nx=Phaser.Utils.Objects.IsPlainObject,sx=Phaser.Utils.Objects.GetValue,rx=Phaser.Display.Align.CENTER,ox={min:0,full:-1},ax=function(t,e,n,s,r,o,a,h,l,u){xp.call(this,t);var c=t.isRexSpace,d=i(e);if(null===e)return this;if("number"===d);else if("string"===d)e=ox[e];else if(nx(e)){var f;e=sx(f=e,"proportion",void 0),n=sx(f,"align",rx),s=sx(f,"padding",0),r=sx(f,"expand",!1),o=sx(f,"key",void 0),a=sx(f,"index",void 0),t.isRexSizer||(h=sx(f,"minWidth",void 0),l=sx(f,"minHeight",void 0)),u=sx(f,"fitRatio",0);}return "string"==typeof n&&(n=Xf[n]),void 0===e&&(e=c?1:0),void 0===n&&(n=rx),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=mp(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},hx={add:ax,addSpace:function(t){return this.insertSpace(void 0,t),this},insertSpace:function(t,e){return void 0===e&&(e=1),ax.call(this,new ex(this.scene),{proportion:e,minWidth:0,minHeight:0,index:t}),this},insert:function(t,e,i,n,s,r,o,a){return nx(i)&&(i.index=t),ax.call(this,e,i,n,s,r,o,t,a),this},insertAtPosition:function(t,e,i,n,s,r,o,a,h){var l=ix.call(this,t,e);return -1===l&&(l=void 0),this.insert(l,i,n,s,r,o,a,h),this}},lx=Phaser.Utils.Array.Remove,ux={remove:function(t,e){return this.getParentSizer(t)!==this||(lx(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,Pk.call(this,t),this}},cx={getChildAlign:function(t){return this.getSizerConfig(t).align},setChildAlign:function(t,e){return "string"==typeof e&&(e=Xf[e]),this.getSizerConfig(t).align=e,this}},dx={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=jp.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(dx,hx,ux,cx,{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 fx=function(){for(var t,e,i=0,n=this.sizerChildren,s=0,r=n.length;s0&&(i+=e);return i},px={x:0,h:0,horizontal:0,"left-to-right":0,y:1,v:1,vertical:1,"top-to-bottom":1},vx=function(t){return "string"==typeof t&&(t=px[t]),t},gx=Phaser.Utils.Objects.IsPlainObject,yx=Phaser.Utils.Objects.GetValue,kx=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h,l){var u;return n(this,i),gx(s)?(s=yx(l=s,"x",0),r=yx(l,"y",0),o=yx(l,"width",void 0),a=yx(l,"height",void 0),h=yx(l,"orientation",0)):gx(o)?(o=yx(l=o,"width",void 0),a=yx(l,"height",void 0),h=yx(l,"orientation",0)):gx(h)&&(h=yx(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(yx(l,"space.item",0)),u.setStartChildIndex(yx(l,"startChildIndex",0)),u.setRTL(yx(l,"rtl",!1)),u.addChildrenMap("items",u.sizerChildren),u}return r(i,[{key:"setOrientation",value:function(t){return this.orientation=vx(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=fx.call(this)),this._childrenProportion}}]),i}(yk);Object.assign(kx.prototype,dx),T.register("sizer",(function(t,e,i,n,s,r){var o=new kx(this.scene,t,e,i,n,s,r);return this.scene.add.existing(o),o})),Z(window,"RexPlugins.UI.Sizer",kx);var mx=function(){return Array.prototype.reduce.call(arguments,bx,0)},bx=function(t,e){return t+e},xx=Phaser.Utils.Objects.IsPlainObject,Cx=Phaser.Utils.Objects.GetValue,wx=Phaser.Display.Align.CENTER,Sx=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 Tx(this.sizerChildren,null),Pk.call(this,t),this}},Mx={setColumnSpace:function(t){if(this.space.column||(this.space.column=[]),this.space.column.length=this.columnCount-1,"number"==typeof t)Tx(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},Lx={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=jp.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,Tx(this.sizerChildren,null),this.columnProportions=[],this.columnProportions.length=t,"number"==typeof i)Tx(this.columnProportions,i);else for(var r=0;r0&&(e+=t);return e},Dx=function(){for(var t,e=0,i=0;i0&&(e+=t);return e},Ix=Phaser.Utils.Objects.IsPlainObject,jx=Phaser.Utils.Objects.GetValue,zx=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),Ix(s)?(s=jx(d=s,"x",0),r=jx(d,"y",0),o=jx(d,"width",void 0),a=jx(d,"height",void 0),h=jx(d,"column",d.col||0),l=jx(d,"row",0),u=jx(d,"columnProportions",0),c=jx(d,"rowProportions",0)):Ix(o)?(o=jx(d=o,"width",void 0),a=jx(d,"height",void 0),h=jx(d,"column",d.col||0),l=jx(d,"row",0),u=jx(d,"columnProportions",0),c=jx(d,"rowProportions",0)):Ix(h)?(h=jx(d=h,"column",d.col||0),l=jx(d,"row",0),u=jx(d,"columnProportions",0),c=jx(d,"rowProportions",0)):Ix(u)&&(u=jx(d=u,"columnProportions",0),c=jx(d,"rowProportions",0)),(f=e.call(this,t,s,r,o,a,d)).type="rexGridSizer",f.sizerChildren=[],f.addChildrenMap("items",f.sizerChildren),f.setCreateCellContainerCallback(jx(d,"createCellContainerCallback")),f.setIndentLeft(jx(d,"space.indentLeftOdd",0),jx(d,"space.indentLeftEven",0)),f.setIndentTop(jx(d,"space.indentTopOdd",0),jx(d,"space.indentTopEven",0)),f.resetGrid(h,l,u,c,jx(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=Bx.call(this)),this._totalColumnProportions}},{key:"totalRowProportions",get:function(){return void 0===this._totalRowProportions&&(this._totalRowProportions=Dx.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}(yk);Object.assign(zx.prototype,Lx),T.register("gridSizer",(function(t,e,i,n,s,r,o,a,h){var l=new zx(this.scene,t,e,i,n,s,r,o,a,h);return this.scene.add.existing(l),l})),Z(window,"RexPlugins.UI.GridSizer",zx);var Ax=function(t,e,i,n){return e/t<=i?e/(n-1):0},Fx=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=Vx(a.left,a.centerY,t,e))&&(s=h,n=r);var h,l=i[r+1];if(!l||l.y!==a.y)s>(h=Vx(a.right,a.centerY,t,e))&&(s=h,n=r+1);}}return n},Gx=Phaser.Utils.Objects.IsPlainObject,Hx=Phaser.Utils.Objects.GetValue,Ux=Phaser.Display.Align.CENTER,Nx=function(t,e,i,n){if("\n"===t)return this.addNewLine(),this;var s;(xp.call(this,t),Gx(e))&&(e=Hx(s=e,"padding",0),i=Hx(s,"key",void 0),n=Hx(s,"index",void 0));return void 0===e&&(e=0),(s=this.getSizerConfig(t)).align=Ux,s.padding=mp(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},Kx={add:function(t,e,i){if(mg(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,Pk.call(this,t),this}},qx={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--)VC.call(this,e[i],t);return this}},GC=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);}},HC=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,GC.call(e,t,i,n);}},enumerable:!0,configurable:!0}),t.selected=!1;},UC={add:function(t){return this.buttons.push(t),t._click||(t._click=new dc(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")),HC.call(this,t)),this},addMultiple:function(t){for(var e=0,i=t.length;e2?o-2:0),h=2;h=0;i--)hw.call(this,e[i],t);return this}},uw=Phaser.Utils.Objects.GetValue,cw=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=uw(s,"row",0),a=uw(s,"column",s.col||0),h=uw(s,"createCellContainerCallback"),l=uw(s,"buttons",void 0),c=uw(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&&dw.addNewLine(this);}else for(r=0,o=t.length;r=0;i--)yw.call(this,e[i],t);return this}},mw=Phaser.Utils.Objects.GetValue,bw=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 QC({parent:u(r),eventEmitter:mw(s,"eventEmitter",u(r)),groupName:mw(s,"groupName",void 0),clickConfig:mw(s,"click",void 0)}).setButtonsType(s);var a=mw(s,"background",void 0),h=mw(s,"buttons",void 0);return r.buttonsAlign=mw(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}(iC);Object.assign(bw.prototype,pw,kw,$C,ew),T.register("fixWidthButtons",(function(t){var e=new bw(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.FixWidthButtons",bw);var xw=Phaser.Utils.Objects.GetValue,Cw=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 Sb(t);return t.add.existing(o),r.addBackground(o),r.addChildrenMap("fileChooser",o),r.setAccept(xw(s,"accept","")),r.setMultiple(xw(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}(lC);Object.assign(Cw.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 Cw(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.FileSelectorButton",Cw);var ww={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}},Sw={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,yg.modal.call(this,t,e),this}},Pw={};Object.assign(Pw,ww,Sw);var Tw=Phaser.Utils.Objects.GetValue,Ow=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=Tw(s,"eventEmitter",u(r));var o,a,h,l,c=Tw(s,"background",void 0),d=Tw(s,"title",void 0),f=Tw(s,"toolbar",void 0),p=Tw(s,"toolbarBackground",void 0),v=Tw(s,"leftToolbar",void 0),g=Tw(s,"leftToolbarBackground",void 0),y=Tw(s,"content",void 0),k=Tw(s,"description",void 0),m=Tw(s,"choices",void 0),b=Tw(s,"choicesBackground",void 0),x=Tw(s,"actions",void 0),C=Tw(s,"actionsBackground",void 0),w=Tw(s,"click",void 0);if(c&&r.addBackground(c),f&&(h=new nw(t,{groupName:"toolbar",background:p,buttons:f,orientation:0,space:{item:Tw(s,"space.toolbarItem",0)},click:w,eventEmitter:r.eventEmitter})),v&&(l=new nw(t,{groupName:"leftToolbar",background:g,buttons:v,orientation:0,space:{item:Tw(s,"space.leftToolbarItem",0)},click:w,eventEmitter:r.eventEmitter})),d||f||v){var S,P=!!d&&Tw(s,"expand.title",!0),T=Tw(s,"align.title","center"),O=!(d&&!P&&"center"===T||!d&&(f||v));S=O?new kx(t,{orientation:0}):new Rk(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:Tw(s,"space.titleLeft",0),right:Tw(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:Tw(s,"space.title",0),top:Tw(s,"space.titleTop",0)});_=Tw(s,"proportion.title",0);r.add(S,{padding:E,proportion:_,expand:!0});}if(y){var R=Tw(s,"align.content","center"),L=Tw(s,"space.content",0),B=(E={left:Tw(s,"space.contentLeft",0),right:Tw(s,"space.contentRight",0),bottom:k||m||x?L:0},_=Tw(s,"proportion.content",0),Tw(s,"expand.content",!0));r.add(y,{align:R,padding:E,proportion:_,expand:B});}if(k){R=Tw(s,"align.description","center");var D=Tw(s,"space.description",0);E={left:Tw(s,"space.descriptionLeft",0),right:Tw(s,"space.descriptionRight",0),bottom:m||x?D:0},_=Tw(s,"proportion.description",0),B=Tw(s,"expand.description",!0);r.add(k,{align:R,padding:E,proportion:_,expand:B});}if(m){var I=Tw(s,"choicesType","").split("-"),j=Mw(I,"wrap")?bw:Mw(I,"grid")?cw:nw,z=Mw(I,"radio")?"radio":Mw(I,"checkboxes")?"checkboxes":void 0,A={left:Tw(s,"space.choicesBackgroundLeft",0),right:Tw(s,"space.choicesBackgroundRight",0),top:Tw(s,"space.choicesBackgroundTop",0),bottom:Tw(s,"space.choicesBackgroundBottom",0)},F=Tw(s,"space.choice",0);j===nw?A.item=F:j===bw?(A.item=F,A.line=Tw(s,"space.choiceLine",F)):(A.column=Tw(s,"space.choiceColumn",F),A.row=Tw(s,"space.choiceRow",F));var Y={width:Tw(s,"choicesWidth",void 0),height:Tw(s,"choicesHeight",void 0),groupName:"choices",buttonsType:z,background:b,buttons:m,space:A,click:w,eventEmitter:r.eventEmitter,setValueCallback:Tw(s,"choicesSetValueCallback",void 0),setValueCallbackScope:Tw(s,"choicesSetValueCallbackScope",void 0)};j===nw&&(Y.orientation=Mw(I,"x")?0:1),o=new j(t,Y);var W=Tw(s,"space.choices",0);E={left:Tw(s,"space.choicesLeft",0),right:Tw(s,"space.choicesRight",0),bottom:x?W:0},R=Tw(s,"align.choices","center"),_=Tw(s,"proportion.choices",0),B=Tw(s,"expand.choices",!0);r.add(o,{align:R,padding:E,proportion:_,expand:B}),r.buttonsType=z;}if(x){a=new nw(t,{groupName:"actions",background:C,buttons:x,orientation:0,space:{item:Tw(s,"space.action",0)},expand:Tw(s,"expand.actions",!1),align:Tw(s,"align.actions","center"),click:w,eventEmitter:r.eventEmitter});E={left:Tw(s,"space.actionsLeft",0),right:Tw(s,"space.actionsRight",0),bottom:Tw(s,"space.actionsBottom",0)},_=Tw(s,"proportion.action",0);r.add(a,{align:"center",padding:E,proportion:_,expand:!0});}return _w(u(r),"click"),_w(u(r),"over"),_w(u(r),"out"),_w(u(r),"enable"),_w(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)}(kx),Mw=function(t,e){return -1!==t.indexOf(e)},Ew={actions:"action",choices:"choice",toolbar:"toolbar",leftToolbar:"leftToolbar"},_w=function(t,e){t.on("button.".concat(e),(function(i,n,s,r,o){Ew.hasOwnProperty(n)&&t.emit("".concat(Ew[n],".").concat(e),i,s,r,o);}));};Object.assign(Ow.prototype,Pw),T.register("dialog",(function(t){var e=new Ow(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Dialog",Ow);var Rw=function(t,e,i){var n=new CC(t,e,i);return t.add.existing(n),n},Lw=function(t){this.childrenMap.title.resetDisplayContent(t.title);},Bw=function(t){var e=this.childrenMap.content;if(e.resetDisplayContent)e.resetDisplayContent(t.content);else {var i=t.content||"";e.setText(i);}},Dw=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}(Xv),wS=Phaser.Utils.Objects.GetValue,SS=Phaser.Math.Distance.Between,PS=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(wS(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(wS(t,"enable",!0)),this.holdThreshold=wS(t,"holdThreshold",50),this.pointerOutReleaseEnable=wS(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 ou(this.scene)}},{key:"speed",get:function(){return this.x===this.preX&&this.y===this.preY?0:SS(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),TS=Phaser.Utils.Objects.GetValue,OS=function(){function t(e){n(this,t),this.resetFromJSON(e);}return r(t,[{key:"resetFromJSON",value:function(t){return this.setValue(TS(t,"value",0)),this.setSpeed(TS(t,"speed",0)),this.setAcceleration(TS(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}(),MS=function(){function t(){n(this,t),this.value,this.dir,this.movement=new OS;}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),LS={y:0,v:0,vertical:0,x:1,h:1,horizontal:1},BS=Phaser.Utils.Objects.GetValue,DS=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=BS(s,"focus",!0):r.focusMode=!1,r.setSpeed(BS(s,"speed",.1)),r.setEnable(BS(s,"enable",!0)),r.focusMode)?(t=r.parent).setInteractive(BS(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),IS=Phaser.Utils.Objects.GetValue,jS=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)?IS(n,c,void 0):IS(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 xS(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=IS(s,"position",0);"string"==typeof v&&(v=zS[v]);var g=IS(n,"space.slider".concat(i),void 0);void 0===g&&void 0===(g=IS(n,"space.slider",void 0))&&(g=l?0:IS(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)]=IS(s,"hideUnscrollableSlider",!1),t["adaptThumb".concat(i,"SizeMode")]=IS(s,"adaptThumbSize",!1),t["minThumb".concat(i,"Size")]=IS(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)?IS(n,k,!0):IS(n,"scroller",!0))&&u&&(!0===o&&(o={}),o.orientation=h?0:1,a=new RS(u,o));var m,b,x,C,w=IS(n,l?"mouseWheelScroller".concat(i):"mouseWheelScroller",!1);(w&&u&&(m=new DS(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);}));}},zS={right:0,left:1,bottom:0,top:1},AS=Phaser.Utils.Objects.GetValue,FS=function(t,e){var i=t.scene,n=[0,1,0],s=[0,1,0],r=AS(e,"width"),o=AS(e,"height");r||(AS(e,"child.expandWidth",!0)||(n[1]=0));o||(AS(e,"child.expandHeight",!0)||(s[1]=0));var a=new zx(i,{column:3,row:3,columnProportions:n,rowProportions:s});switch(function(t,e,i){var n=Uw(i,"child"),s=Uw(n,"gameObject",void 0);if(s){var r=Uw(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=Uw(r,"top",0),o.bottom=Uw(r,"bottom",0),a.left=Uw(r,"left",0),a.right=Uw(r,"right",0);break;case 1:o.top=Uw(r,"left",0),o.bottom=Uw(r,"right",0),a.top=Uw(r,"top",0),a.bottom=Uw(r,"bottom",0);break;default:o.top=Uw(r,"top",0),o.bottom=Uw(r,"bottom",0),o.left=Uw(r,"left",0),o.right=Uw(r,"right",0);}e.add(s,{column:1,row:1,align:Uw(n,"align","center"),padding:a,expand:{width:Uw(n,"expandWidth",!0),height:Uw(n,"expandHeight",!0)}});}t.addChildrenMap("child",s);}(t,a,e),t.scrollMode){case 0:jS(t,a,"y",e);break;case 1:jS(t,a,"x",e);break;default:jS(t,a,"y",e),jS(t,a,"x",e);}return a},YS=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);},WS=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);}},VS=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},ZS=function(t){return (t-this.textLineSpacing)/(this.textLineHeight+this.textLineSpacing)},qS=function(t){return t*(this.textLineHeight+this.textLineSpacing)-this.textLineSpacing},$S=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},QS=function(t,e){switch(KS(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;}},tP=function(){var t=this.textObject.rexSizer;this.textObject.y+=t.offsetY-t.preOffsetY,t.preOffsetY=t.offsetY,this.resetChildPositionState(this.textObject),this.textCropEnable&&eP.call(this);},eP=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);}},iP=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();}},nP={setText:function(t){return void 0!==t&&(this.text=t),this.lines=JS(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(ZS.call(this,-this.textOY)),0),e=qS.call(this,t)+this.textOY,i=$S.call(this,t);return QS(this.textObject,i),this.textObject.rexSizer.offsetY=e,tP.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,Ap.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,iP.call(this,t,r,o),fp(t,n,s,r,o,e.align),e.preOffsetY=0,tP.call(this),this.textMask&&(this.textMask.setPosition().resize(),this.resetChildPositionState(this.textMask)));}},sP=Phaser.Utils.Objects.IsPlainObject,rP=Phaser.Utils.Objects.GetValue,oP=Phaser.Display.Align.TOP_LEFT,aP=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a,h){var l;n(this,i),sP(s)?(s=rP(h=s,"x",0),r=rP(h,"y",0),o=rP(h,"width",void 0),a=rP(h,"height",void 0)):sP(o)&&(o=rP(h=o,"width",void 0),a=rP(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=rP(h,"content",""),l._textOY=0,l.execeedTopState=!1,l.execeedBottomState=!1,l.setClampMode(rP(h,"clamplTextOY",!0)),l.alwaysScrollable=rP(h,"alwaysScrollable",!1);var c=rP(h,"background",void 0),d=rP(h,"text",void 0);void 0===d&&(d=hP(t)),l.textCropEnable=rP(h,"textCrop",!!d.setCrop);var f=rP(h,"textMask",!l.textCropEnable);c&&l.addBackground(c),l.add(d),l.sizerChildren=[d];var p=l.getSizerConfig(d);return p.align=oP,p.padding=mp(0),p.expand=!0,l.textObject=d,l.textObjectType=KS(d),p.preOffsetY=0,p.offsetY=0,f&&(l.textMask=aC.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(ZS.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=qS.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}(yk),hP=function(t){return t.add.text(0,0,"")};Object.assign(aP.prototype,nP);var lP={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}},uP=Phaser.Utils.Objects.GetValue,cP=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=uP(s,"text",void 0),a=uP(s,"textWidth",void 0),h=uP(s,"textHeight",void 0),l=uP(s,"textCrop",!!o.setCrop),u=uP(s,"textMask",!l),c=uP(s,"content",""),d=new aP(t,{width:a,height:h,text:o,textMask:u,textCrop:l&&!u,content:c,clamplTextOY:uP(s,"clamplChildOY",!1),alwaysScrollable:uP(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=uP(s,"space",void 0);return f&&(f.child=uP(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}(US);Object.assign(cP.prototype,{setText:function(t){return this.childrenMap.child.setText(t),this.resizeController(),this},appendText:function(t){return this.setText(this.text+t),this}},lP);var dP=Phaser.Utils.Objects.GetValue,fP=function(t,e,i){e=e?M(e):{};var n=dP(i,"background",uC),s=dP(i,"text",fC),r=dP(i,"track",uC),o=dP(i,"thumb",uC);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 cP(t,e);return t.add.existing(h),h},pP=Phaser.Utils.Objects.GetValue,vP=Phaser.Utils.Objects.GetValue,gP=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=vP(r,"background",uC);a?s.background=a(t,s.background):delete s.background,s.title=Rw(t,s.title,r.title),s.content=function(t,e,i){var n,s=pP(e,"$type");void 0===s&&e&&(e.hasOwnProperty("slider")||e.hasOwnProperty("scroller"))&&(s="textarea"),n="textarea"===s?new fP(t,e,i):new Rw(t,e,i);return t.add.existing(n),n}(t,s.content,r.content),s.content instanceof cP&&Al(s,"height")&&!Al(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=[Rw(t,l,p),Rw(t,c,v)];break;case 1:s.actions=[Rw(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),Vw.call(u(o)),o}return r(i)}(Ow);Object.assign(gP.prototype,jw),T.register("confirmDialog",(function(t,e){var i=new gP(this.scene,t,e);return this.scene.add.existing(i),i})),Z(window,"RexPlugins.UI.ConfirmDialog",gP);var yP=Phaser.Utils.Objects.GetValue,kP=function(t,e,i){var n=yP(t,"proportion.".concat(e),i.proportion),s=yP(t,"align.".concat(e),"center"),r=yP(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:yP(t,"expand.".concat(e),!0)}},mP=function(t){return kP(t,"header",{proportion:0,paddingKey:"bottom"})},bP=function(t){return kP(t,"leftSide",{proportion:0,paddingKey:"right"})},xP=function(t){return kP(t,"content",{proportion:1})},CP=function(t){return kP(t,"rightSide",{proportion:0,paddingKey:"left"})},wP=function(t){return kP(t,"footer",{proportion:0,paddingKey:"top"})},SP=function(t,e){var i=new kx(t,{orientation:e});return t.add.existing(i),i},PP=Phaser.Utils.Objects.GetValue,TP=[function(t){var e=this.scene,i=t.header;i&&this.add(i,mP(t));var n=SP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,bP(t));var r=t.content;r&&n.add(r,xP(t));var o=t.rightSide;o&&n.add(o,CP(t));var a=t.footer;a&&this.add(a,wP(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,mP(t));var n=SP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,bP(t));var r=SP(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=SP(e,0);r.add(o,{proportion:1,align:"center",padding:0,expand:!0});var a=t.content;a&&o.add(a,xP(t));var h=t.rightSide;h&&o.add(h,CP(t));var l=t.footer;l&&r.add(l,wP(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,mP(t));var n=SP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=SP(e,1);n.add(s,{proportion:1,align:"center",padding:0,expand:!0});var r=SP(e,0);s.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.leftSide;o&&r.add(o,bP(t));var a=t.content;a&&r.add(a,xP(t));var h=t.footer;h&&s.add(h,wP(t));var l=t.rightSide;l&&n.add(l,CP(t));},function(t){var e=this.scene,i=t.header;i&&this.add(i,mP(t));var n=SP(e,0);this.add(n,{proportion:1,align:"center",padding:0,expand:!0});var s=t.leftSide;s&&n.add(s,bP(t));var r=SP(e,1);n.add(r,{proportion:1,align:"center",padding:0,expand:!0});var o=t.content;o&&r.add(o,xP(t));var a=t.footer;a&&r.add(a,wP(t));var h=t.rightSide;h&&n.add(h,CP(t));}],OP={FFF:0,LFF:1,FFR:2,LFR:3},MP=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)}(kx),EP={build:function(t){this.clear(!0);var e=PP(t,"background",void 0);e&&this.addBackground(e);var i=PP(t,"layoutMode",0);"string"==typeof i&&(i=OP[i.toUpperCase()]),(TP[i]||TP[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(MP.prototype,EP),T.register("holyGrail",(function(t){var e=new MP(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.HolyGrail",MP);var _P={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 _v(this.getButton(t,e)),this},showLeftButton:function(t){return _v(this.getLeftButton(t)),this},showRightButton:function(t){return _v(this.getRightButton(t)),this},showTopButton:function(t){return _v(this.getTopButton(t)),this},showBottomButton:function(t){return _v(this.getBottomButton(t)),this},hideButton:function(t,e){return Rv(this.getButton(t,e)),this},hideLeftButton:function(t){return Rv(this.getLeftButton(t)),this},hideRightButton:function(t){return Rv(this.getRightButton(t)),this},hideTopButton:function(t){return Rv(this.getTopButton(t)),this},hideBottomButton:function(t){return Rv(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}},RP=Phaser.Utils.Objects.GetValue,LP=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=RP(s,"eventEmitter",u(r));var o,a,h,l,c=RP(s,"background",void 0),d=RP(s,"panel",void 0),f=RP(s,"leftButtons",void 0),p=RP(s,"leftButtonsBackground",void 0),v=RP(s,"rightButtons",void 0),g=RP(s,"rightButtonsBackground",void 0),y=RP(s,"topButtons",void 0),k=RP(s,"topButtonsBackground",void 0),m=RP(s,"bottomButtons",void 0),b=RP(s,"bottomButtonsBackground",void 0),x=RP(s,"click",void 0);if(c&&r.addBackground(c),d&&r.add(d,1,1,"center",0,!0),f){var C=RP(s,"space.leftButtonsOffset",0),w=RP(s,"space.leftButton",0);o=new nw(t,{groupName:"left",background:p,buttons:f,orientation:1,space:{item:w},align:RP(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=RP(s,"space.rightButtonsOffset",0),T=RP(s,"space.rightButton",0);a=new nw(t,{groupName:"right",background:g,buttons:v,orientation:1,space:{item:T},align:RP(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=RP(s,"space.topButtonsOffset",0),M=RP(s,"space.topButton",0);h=new nw(t,{groupName:"top",background:k,buttons:y,orientation:0,space:{item:M},align:RP(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=RP(s,"space.bottomButtonsOffset",0),_=RP(s,"space.bottomButton",0);l=new nw(t,{groupName:"bottom",background:b,buttons:m,orientation:0,space:{item:_},align:RP(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)}(zx);Object.assign(LP.prototype,_P),T.register("tabs",(function(t){var e=new LP(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Tabs",LP),T.register("slider",(function(t){var e=new yS(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Slider",yS);var BP=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=Xf[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(BP.prototype,Ct);var DP=Phaser.Utils.Objects.GetValue,IP=Phaser.Utils.Array.SpliceOne,jP=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(DP(t,"cellsCount",0)),this.setColumnCount(DP(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=$P(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));},XT={down:0,up:1},GT=Phaser.Utils.Objects.GetValue,HT=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){Up(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 Gp(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),VT(t,s),t.isRexSizer&&t.layout();var o=GT(s,"touchOutsideClose",!1),a=GT(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&&ug(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}(qv),UT={openListPanel:function(){if(this.listPanel)return this;var t,e=YT.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 HT(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(UT,AT);var NT=Phaser.Utils.Objects.GetValue,KT=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(NT(s,"options"));var o=NT(s,"list");return r.setWrapEnable(NT(o,"wrap",!1)),r.setCreateButtonCallback(NT(o,"createButtonCallback")),r.setCreateListBackgroundCallback(NT(o,"createBackgroundCallback")),r.setButtonClickCallback(NT(o,"onButtonClick")),r.setButtonOverCallback(NT(o,"onButtonOver")),r.setButtonOutCallback(NT(o,"onButtonOut")),r.setListExpandDirection(NT(o,"expandDirection")),r.setListEaseInDuration(NT(o,"easeIn",500)),r.setListEaseOutDuration(NT(o,"easeOut",100)),r.setListTransitInCallback(NT(o,"transitIn")),r.settListTransitOutCallback(NT(o,"transitOut")),r.setListSize(NT(o,"width"),NT(o,"height")),r.setListAlignmentMode(NT(o,"alignParent","text")),r.setListAlignmentSide(NT(o,"alignSide","")),r.setListBounds(NT(o,"bounds")),r.setListSpace(NT(o,"space")),r.setListDraggable(NT(o,"draggable",!1)),r.setValueChangeCallback(NT(s,"setValueCallback"),NT(s,"setValueCallbackScope")),r.setValue(NT(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}(lC);Object.assign(KT.prototype,UT),T.register("dropDownList",(function(t){var e=new KT(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.DropDownList",KT);var JT=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=xC(t,n,r);return a.list=e.list||{},a.list.createButtonCallback=function(t,e){var i=Rw(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},ZT=function(t){a(i,t);var e=d(i);function i(t,s,r){var o;return n(this,i),s=JT(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=sO(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(KS(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(rO.prototype,iO);var oO,aO=Phaser.Utils.Objects.GetFastValue,hO=Phaser.Utils.Objects.GetValue,lO=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(hO(t,"wrap",!1)),this.setTypeMode(hO(t,"typeMode",0)),this.setTypingSpeed(hO(t,"speed",333)),this.setTextCallback=aO(t,"setTextCallback",null),this.setTextCallbackScope=aO(t,"setTextCallbackScope",null),this.setTypingContent(aO(t,"text","")),this.typingIdx=aO(t,"typingIdx",0),this.insertIdx=null,this.insertChar=null;var e=aO(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=cO[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=uO(t);this.textWrapEnable&&(e=function(t,e){switch(KS(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(uO(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?QS(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),uO=function(t){return Array.isArray(t)?t=t.join("\n"):"number"==typeof t&&(t=t.toString()),t},cO={"left-to-right":0,"right-to-left":1,"middle-to-sides":2,"sides-to-middle":3},dO=Phaser.Utils.Objects.GetValue,fO=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===oO&&(oO="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=oO;var o=r.childrenMap.text;return r.page=new rO(o,dO(s,"page",void 0)),r.typing=new lO(o,dO(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}(MC)));T.register("textBox",(function(t){var e=new fO(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.TextBox",fO);var pO=Phaser.Utils.Objects.GetValue,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="rexNumberBar";var o,a=pO(s,"background",void 0),h=pO(s,"icon",void 0),l=pO(s,"iconMask",void 0),c=pO(s,"slider",void 0),d=pO(s,"text",void 0),f=pO(s,"space.icon",0),p=pO(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=aC.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 yS(t,c),t.add.existing(o),0===r.orientation?d&&(v={right:p}):d&&(v={bottom:p}),0===r.orientation)g=void 0===pO(c,"width",void 0)?1:0;else g=void 0===pO(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=pO(s,"valuechangeCallback",null);if(null!==y){var k=pO(s,"valuechangeCallbackScope",void 0);r.on("valuechange",y,k);}return r.setEnable(pO(s,"enable",void 0)),r.setValue(pO(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}(kx);T.register("numberBar",(function(t){var e=new vO(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.NumberBar",vO),T.register("scrollBar",(function(t){var e=new xS(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ScrollBar",xS);var gO=Phaser.Utils.Objects.GetValue,yO={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"},kO=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=gO(s,"background",void 0);o&&r.addBackground(o),r.addChildrenMap("background",o);var a=gO(s,"main",void 0);for(var h in a&&r.add(a,{key:"main",align:"center",expand:!1}),r.addChildrenMap("main",a),yO){var l=gO(s,h,void 0);l&&(r.add(l,{key:h,align:yO[h],expand:!1}),r.addChildrenMap(h,l));}return r}return r(i)}(Rk);T.register("badgeLabel",(function(t){var e=new kO(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.BadgeLabel",kO);var mO=Rk.prototype.add,bO=function(t,e,i,n,s,r,o,a,h){return t.setVisible(!1),mO.call(this,t,e,i,n,s,r,o,a,h),this},xO={add:bO,addPage:bO},CO=Yf.prototype.setChildVisible,wO={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?(CO.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&&(CO.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(wO,xO);var SO=Phaser.Utils.Objects.GetValue,PO=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(SO(s,"swapMode",0)),r.setFadeInDuration(SO(s,"fadeIn",0)),r}return r(i,[{key:"setSwapMode",value:function(t){return "string"==typeof t&&(t=TO[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(PO.prototype,wO);var TO={invisible:0,destroy:1};T.register("pages",(function(t){var e=new PO(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Pages",PO);var OO=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}(yk);Object.assign(XM.prototype,FM);var GM=["top","bottom","centerY","center"],HM=["left","right","centerX","center"],UM=function(t,e,i){var n,s="Y"===(e=e.toUpperCase()),r=this.childrenMap.child;if(s){if(i)for(var o=0,a=GM.length;o=0?0:Math.abs(l)<=Math.abs(u)?l:u;}}else {if(i)for(o=0,a=HM.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;}},NM=Phaser.Utils.Objects.GetValue,KM=function(t){a(i,t);var e=d(i);function i(t,s){var r;n(this,i),void 0===s&&(s={});var o=Gw(s),a=NM(s,"panel",void 0);void 0===a&&(a={}),a.scrollMode=o,a.clamplChildOY=NM(s,"clamplChildOY",!1),a.clamplChildOX=NM(s,"clamplChildOX",!1);var h,l,u=new XM(t,a);switch(t.add.existing(u),o){case 0:h=NM(s,"expand.panel",!0),l=!0;break;case 1:h=!0,l=NM(s,"expand.panel",!0);break;default:h=!0,l=!0;}s.type="rexScrollablePanel",s.child={gameObject:u,expandWidth:h,expandHeight:l,align:NM(s,"align.panel","center")};var c=NM(s,"space",void 0);return c&&(c.child=NM(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]),pk(this.childrenMap.child,t),this}}]),i}(US),JM={scrollToChild:function(t,e){if(!this.hasChild(t))return this;switch(this.scrollMode){case 0:UM.call(this,t,"y",e);break;case 1:UM.call(this,t,"x",e);break;default:UM.call(this,t,"y",e),UM.call(this,t,"x",e);}return this}};Object.assign(KM.prototype,JM),T.register("scrollablePanel",(function(t){var e=new KM(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ScrollablePanel",KM);var ZM=function(t,e){t.popUp(e);},qM=function(t,e){t.scaleDown(e);},$M=function(t,e){t.fadeIn(e);},QM=function(t,e){t.fadeOut(e);},tE=function t(e,i,n){var s,r=bt(n,"reverse",!1);if(mg(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(mg(n)||(n=ju(rE,i,1)),tE(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=aE[t]),this.dtMode=t,this}},{key:"setTimeUnit",value:function(t){return "string"==typeof t&&(t=oE[t]),this.timeUnit=t,this}}]),i}(oo),rE=[],oE={ms:0,s:1,sec:1},aE={abs:0,absolute:0,inc:1,increment:1},hE=Phaser.Utils.Objects.GetValue,lE=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(hE(s,"duration.in",200)),r.setDisplayTime(hE(s,"duration.hold",1200)),r.setTransitOutTime(hE(s,"duration.out",200)),r.setTransitInCallback(hE(s,"transitIn",uE.popUp)),r.setTransitOutCallback(hE(s,"transitOut",uE.scaleDown)),r.player=new sE(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=uE[t]),t){case uE.popUp:t=ZM;break;case uE.fadeIn:t=$M;}return t||(t=D),this.transitInCallback=t,this}},{key:"setTransitOutCallback",value:function(t){switch("string"==typeof t&&(t=uE[t]),t){case uE.scaleDown:t=qM;break;case uE.fadeOut:t=QM;}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}(lC),uE={popUp:0,fadeIn:1,scaleDown:0,fadeOut:1};T.register("toast",(function(t){var e=new lE(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Toast",lE);for(var cE,dE=function(t,e,i){void 0===i&&(i=!0),i?e=e?M(e):{}:e||(e={});var n=new su(t,e);return t.add.existing(n),n},fE=["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"],pE=[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],vE={},gE=0,yE=fE.length;gE0&&{height:this.colorComponentsHeight,formatLabel:this.colorComponentsFormatLabelConfig,inputText:this.colorComponentsInputTextConfig,space:this.colorComponentsSpace};var o=new i_(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},s_={openColorPicker:function(){if(!this.colorPicker){var t=n_.call(this).layout(),e=new HT(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(s_,TE);var r_=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={}),(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(r_(o,"width",160),r_(o,"height",170));var l=r_(o,"background");h=l?function(t){return uC(t,l)}:r_(o,"createBackgroundCallback"),r.setCreateColorPickerBackgroundCallback(h),r.setColorPickerHPalettePosition(r_(o,"hPalettePosition",0)),r.setColorPickerExpandDirection(r_(o,"expandDirection")),r.setColorPickerEaseInDuration(r_(o,"easeIn",200)),r.setColorPickerEaseOutDuration(r_(o,"easeOut",200)),r.setColorPickerTransitInCallback(r_(o,"transitIn")),r.setColorPickerTransitOutCallback(r_(o,"transitOut")),r.setColorPickerBounds(r_(o,"bounds"));var c=r_(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(r_(d,"height",30)),r.setColorComponentsFormatLabelConfig(r_(d,"formatLabel"));var f=r_(d,"inputText");f||(f=r_(s,"inputText")),r.setColorComponentsInputTextConfig(f);var p=r_(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)}(PE);Object.assign(o_.prototype,s_),T.register("colorInput",(function(t){var e=new o_(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ColorInput",o_),T.register("colorInputLite",(function(t){var e=new PE(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ColorInputBase",PE),T.register("colorPicker",(function(t){var e=new NE(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ColorPicker",NE),T.register("colorComponents",(function(t){var e=new t_(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.ColorComponents",t_);var a_=function(t,e){return function(i,n,s,r){"panel"!==n&&s.moveChild(i,r?0:t,e);}},h_=function(t,e){return function(i,n,s,r){"panel"===n&&s.moveChild(i,r?0:t,e);}},l_={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:a_,hide:a_},"move-panel":{show:h_,hide:h_}},u_=Yf.prototype.setChildVisible,c_={setChildVisible:function(t,e){if("string"==typeof t){var i=t;t=this.sizerChildren[i];}else i=Mk(this.sizerChildren,t);return void 0===e&&(e=this.currentChildKey===i),u_.call(this,t,e),this}},d_={fadeChild:function(t,e,i){var n;return "string"==typeof t?(n=t,t=this.sizerChildren[n]):n=Mk(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()}},f_={moveChild:function(t,e,i,n){var s;"string"==typeof t?(s=t,t=this.sizerChildren[s]):s=Mk(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()}},p_={};Object.assign(p_,c_,d_,f_);var v_=Phaser.Utils.Objects.GetValue,g_=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=v_(s,"showChildCallback",void 0);if(o)if(gg(o)){var a=v_(s,"showChildCallbackScope",void 0);r.on("showchild",o,a);var h=v_(s,"hideChildCallback",void 0),l=v_(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),l_.hasOwnProperty(e)?(n=l_[e].show.apply(null,i),s=l_[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=v_(s,"background",void 0),d=v_(s,"panel",void 0),f=v_(s,"leftSide",void 0),p=v_(s,"rightSide",void 0),v=v_(s,"topSide",void 0),g=v_(s,"bottomSide",void 0);if(c&&r.addBackground(c),d&&r.add(d,"panel","center",0,!0),f){var y=v_(s,"expand.left",!0);r.add(f,"leftSide","left-top",0,{height:y});}if(p){y=v_(s,"expand.right",!0);r.add(p,"rightSide","right-top",0,{height:y});}if(v){y=v_(s,"expand.top",!0);r.add(v,"topSide","left-top",0,{width:y});}if(g){y=v_(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}(Rk);Object.assign(g_.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}},p_),T.register("sides",(function(t){var e=new g_(this.scene,t);return this.scene.add.existing(e),e})),Z(window,"RexPlugins.UI.Sides",g_);var y_=Phaser.Utils.Array.GetFirst,k_=Phaser.Utils.Array.Remove,m_=function(t){a(i,t);var e=d(i);function i(t,s){var r;return n(this,i),s=xC(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}(lC),b_=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 Md(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}(m_),x_=function(t,e){var i=new H_(t,e);return t.add.existing(i),i},C_=function(t,e,i){return uC(t,i)},w_=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}(IM);Object.assign(w_.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 S_=Phaser.Utils.Objects.GetValue,P_=Phaser.Utils.Objects.GetValue,T_={getMaxInputRowTitleWidth:function(){for(var t=0,e=this.childrenMap.pages.children,i=0,n=e.length;i0?0:1,r.setMinWidth(this.itemWidth)),this.add(r,{proportion:s,expand:!0}),i.onValueChange&&o.on("valuechange",i.onValueChange),r.setAutoUpdateEnable(i.autoUpdate),r.setBindingTarget(t,e),i.monitor&&r.startMonitorTarget(),i.key&&this.root.addChildrenMap(i.key,r),this},addButton:W_,addButtons:W_,addSeparator:function(t){var e=this.scene,i=V_(this.styles,"separator"),n=C_(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);}},jR=Phaser.Utils.Objects.IsPlainObject,zR=Phaser.Utils.Objects.GetValue,AR=Phaser.Math.DegToRad,FR=Phaser.Math.RadToDeg,YR=function(t){a(i,t);var e=d(i);function i(t,s,r,o,a){var h;if(n(this,i),jR(s)){var l=s;s=zR(l,"x",0),r=zR(l,"y",0),o=zR(l,"key",null),a=zR(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,IR(this,this._skewX,this._skewY);}},{key:"skewXDeg",get:function(){return FR(this._skewX)},set:function(t){this.skewX=AR(t);}},{key:"skewY",get:function(){return this._skewY},set:function(t){this._skewY=t,IR(this,this._skewX,this._skewY);}},{key:"skewYDeg",get:function(){return FR(this._skewY)},set:function(t){this.skewY=AR(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}(DR),WR=Phaser.Utils.Objects.IsPlainObject,VR=Phaser.Utils.Objects.GetValue,XR=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}(dM(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=VR(l,"x",0),r=VR(l,"y",0),o=VR(l,"width",32),a=VR(l,"height",32);}var u=WO(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}(YR)));T.register("skew",(function(t,e){return new XR(t,e)})),Z(window,"RexPlugins.UI.Skew",XR),T.register("anchor",(function(t,e){return new Yp(t,e)})),Z(window,"RexPlugins.UI.Anchor",Yp),T.register("textTyping",(function(t,e){return new lO(t,e)})),Z(window,"RexPlugins.UI.TextTyping",lO),T.register("textPage",(function(t,e){return new rO(t,e)})),Z(window,"RexPlugins.UI.TextPage",rO);var GR=void 0,HR=Phaser.Utils.Objects.GetValue,UR=Phaser.Utils.Objects.Clone,NR=function(t){return t.hasOwnProperty("align")?t.align:t.hasOwnProperty("halign")?t.halign:"left"},KR=Phaser.Utils.Objects.GetValue,JR=Phaser.Utils.Objects.Merge,ZR={open:function(t,e){var i;void 0===t&&(t={}),t=JR(t,this.openConfig),(i=this)!==GR&&(void 0!==GR&&GR.close(),GR=i),gg(t)&&(e=t,t=void 0);var n=KR(t,"inputType",void 0);void 0===n&&(n=KR(t,"type","text")),void 0===e&&(e=KR(t,"onClose",void 0));var s=KR(t,"onOpen",void 0),r=KR(t,"onTextChanged",void 0);return this.inputText=function(t,e){void 0===e&&(e={}),e=UR(e);var i=t.scene,n=t.style,s=HR(e,"backgroundColor",n.backgroundColor);null===s&&(s="transparent"),e.text=HR(e,"text",t.text),e.fontFamily=HR(e,"fontFamily",n.fontFamily),e.fontSize=HR(e,"fontSize",n.fontSize),e.color=HR(e,"color",n.color),e.backgroundColor=s,e.direction=HR(e,"rtl",n.rtl)?"rtl":"ltr",e.align=HR(e,"align",NR(n)),"rtl"===e.direction&&yC(t)&&(e.align="right");var r=new db(i,t.x,t.y,HR(e,"width",t.width),HR(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,KR(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===GR&&(GR=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}},qR=Phaser.Utils.Objects.GetValue,$R=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),qR(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($R.prototype,ZR);T.register("textEdit",(function(t,e){return new $R(t,e)})),Z(window,"RexPlugins.UI.TextEdit",$R);var QR=65535,tL=function(t,e,i){if(null==e)return t;if(0===e)return nL(t,0,i),t;var n=t.text.length;if(0===n)return nL(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=iL(t,s,e,i,r),a=0;a<=QR&&0!==o;a++){if((s+=o)<0){s=0;break}o=iL(t,s,e,i,r);}return a===QR&&console.warn("FontSizeFit: Test count exceeds ".concat(QR)),t.setFontSize(s),nL(t,e,i),t},eL=function(t,e,i){return void 0===i[e]&&(t.setFontSize(e),i[e]={width:t.width,height:t.height}),i[e]},iL=function(t,e,i,n,s){var r,o=eL(t,e,s),a=eL(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)},nL=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));},sL=Phaser.Utils.Objects.GetValue,rL=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&&kg(t,e,i,n)}},{key:"viewport",get:function(){return Zr(this.scene,this.scene.cameras.main,!0)}}]),i}(),oL={getParentSizer:zd,getTopmostSizer:Ad,hide:Rv,show:_v,isShown:Lv,edit:function(t,e,i){return t._edit||(t._edit=new $R(t,{clickEnable:!1})),t._edit.open(e,i),t._edit},wrapExpandText:kC,fontSizeExpandText:function(t,e){"number"==typeof e&&(e={minWidth:e});var i=sL(e,"minWidth",0),n=sL(e,"minHeight",0),s=sL(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 tL(t,e,i),t}):(t.runWidthWrap=function(e){return t.setFixedSize&&t.setFixedSize(0,0),tL(t,e,void 0),t},t.resize=function(e,i){return t.width===e&&t.height===i||t.setFixedSize(e,i),t}),t},fontSizeResize:tL,setFontSizeToFitWidth:tL,waitEvent:Sh,waitComplete:Ph,delayPromise:vb,setChildrenInteractive:pk,fadeIn:nv,fadeOutDestroy:sv,easeMoveTo:pv,easeMoveFrom:vv,modal:pg,modalPromise:function(t,e){var i=pg(t,e);return new Promise((function(t,e){i.once("close",(function(e){t(e);}));}))},modalClose:vg,requestDrag:hR,openFileChooser:function(t,e){var i=yb(e,"closeDelay",200),n=function(t){var e=document.createElement("input");e.type="file";var i=pb(t,"accept",""),n=pb(t,"multiple",!1);return e.setAttribute("accept",i),n?e.setAttribute("multiple",""):e.removeAttribute("multiple"),e}(e);return n.click(),gb({game:t,fileInput:n,closeDelay:i}).then((function(t){return n.remove(),Promise.resolve(t)}))}};return Object.assign(rL.prototype,oL),rL})); diff --git a/templates/ui/tweaker/Tweaker.d.ts b/templates/ui/tweaker/Tweaker.d.ts index 1a331a4248..c7b2cffc9a 100644 --- a/templates/ui/tweaker/Tweaker.d.ts +++ b/templates/ui/tweaker/Tweaker.d.ts @@ -121,34 +121,6 @@ declare namespace Tweaker { } } - interface IInputHandlerConfig { - name?: string, - - baseClass?: BaseSizer, - - accept: ( - config: IAddInputConfig, - value: unknown - ) => boolean, - - build: ( - gameObject: BaseSizer, - style: IInputRowStyle - ) => void, - - setup?: ( - gameObject: BaseSizer, - config: IAddInputConfig, - setDefaults: boolean, - ) => void, - - displayValue?: ( - gameObject: BaseSizer, - value: unknown - ) => void, - - } - interface IAddInputConfig { bindingTarget?: Object, bindingKey?: string, @@ -223,6 +195,38 @@ declare namespace Tweaker { key?: string, } + + interface IAcceptConfig extends IAddInputConfig { + value: unknown + } + + interface IInputHandlerConfig { + name?: string, + + baseClass?: BaseSizer, + + accept: ( + config: IAcceptConfig, + ) => boolean, + + build: ( + gameObject: BaseSizer, + style: IInputRowStyle + ) => void, + + setup?: ( + gameObject: BaseSizer, + config: IAddInputConfig, + setDefaults: boolean, + ) => void, + + displayValue?: ( + gameObject: BaseSizer, + value: unknown + ) => void, + + } + } declare class Tweaker extends Sizer { diff --git a/templates/ui/tweaker/builders/CreateInputField.js b/templates/ui/tweaker/builders/CreateInputField.js index e371afb832..325ab81e5e 100644 --- a/templates/ui/tweaker/builders/CreateInputField.js +++ b/templates/ui/tweaker/builders/CreateInputField.js @@ -1,17 +1,11 @@ import GenerateInputFieldClass from '../gameobjects/inputfield/GenerateInputFieldClass.js'; var CreateInputField = function (scene, config, style) { - var value = undefined; - var bindingTarget = config.bindingTarget; - if (bindingTarget && (typeof (bindingTarget) === 'object')) { - value = bindingTarget[config.bindingKey]; - } - var inputField; var inputHandlers = this.inputHandlers; for (var i = 0, cnt = inputHandlers.length; i < cnt; i++) { var handler = inputHandlers[i]; - if (handler.accept(config, value)) { + if (handler.accept(config)) { var InputFieldClass = GenerateInputFieldClass(handler.baseClass); inputField = new InputFieldClass(scene); scene.add.existing(inputField); diff --git a/templates/ui/tweaker/inputhandlers/ButtonsInputHandler.js b/templates/ui/tweaker/inputhandlers/ButtonsInputHandler.js index 10b9c96374..f6469376b2 100644 --- a/templates/ui/tweaker/inputhandlers/ButtonsInputHandler.js +++ b/templates/ui/tweaker/inputhandlers/ButtonsInputHandler.js @@ -26,7 +26,7 @@ var SetOptions = function (gameObject, options) { export default { name: 'ButtonsInput', - accept(config, value) { + accept(config) { if (config.hasOwnProperty('view')) { return (config.view === 'buttons') } @@ -34,7 +34,7 @@ export default { return false; }, - // Callback inside `constructor()` + // Callback after `constructor()` build(gameObject, style) { var scene = gameObject.scene; diff --git a/templates/ui/tweaker/inputhandlers/CheckboxInputHandler.js b/templates/ui/tweaker/inputhandlers/CheckboxInputHandler.js index 593afe0076..5229baccde 100644 --- a/templates/ui/tweaker/inputhandlers/CheckboxInputHandler.js +++ b/templates/ui/tweaker/inputhandlers/CheckboxInputHandler.js @@ -3,15 +3,15 @@ import CreateCheckbox from './utils/CreateCheckbox.js'; export default { name: 'CheckboxInput', - accept(config, value) { + accept(config) { if (config.hasOwnProperty('view')) { return (config.view === 'boolean') } - return typeof (value) === 'boolean'; + return typeof (config.value) === 'boolean'; }, - // Callback inside `constructor()` + // Callback after `constructor()` build(gameObject, style) { var scene = gameObject.scene; diff --git a/templates/ui/tweaker/inputhandlers/ColorInputHandler.js b/templates/ui/tweaker/inputhandlers/ColorInputHandler.js index 3302c9fb6b..63f486ccaa 100644 --- a/templates/ui/tweaker/inputhandlers/ColorInputHandler.js +++ b/templates/ui/tweaker/inputhandlers/ColorInputHandler.js @@ -3,14 +3,14 @@ import CreateColorInput from './utils/CreateColorInput.js'; export default { name: 'ColorInput', - accept(config, value) { + accept(config) { if (config.hasOwnProperty('view')) { return (config.view === 'color') } return false; }, - // Callback inside `constructor()` + // Callback after `constructor()` build(gameObject, style) { var scene = gameObject.scene; diff --git a/templates/ui/tweaker/inputhandlers/ListInputHandler.js b/templates/ui/tweaker/inputhandlers/ListInputHandler.js index 87fa0dc5c7..c72ec59fc6 100644 --- a/templates/ui/tweaker/inputhandlers/ListInputHandler.js +++ b/templates/ui/tweaker/inputhandlers/ListInputHandler.js @@ -9,7 +9,7 @@ var SetOptions = function (gameObject, options) { export default { name: 'ListInput', - accept(config, value) { + accept(config) { if (config.hasOwnProperty('view')) { return (config.view === 'list') } @@ -17,7 +17,7 @@ export default { return (config.hasOwnProperty('options')); }, - // Callback inside `constructor()` + // Callback after `constructor()` build(gameObject, style) { var scene = gameObject.scene; diff --git a/templates/ui/tweaker/inputhandlers/NumberInputHandler.js b/templates/ui/tweaker/inputhandlers/NumberInputHandler.js index 099639c517..9fca8a8244 100644 --- a/templates/ui/tweaker/inputhandlers/NumberInputHandler.js +++ b/templates/ui/tweaker/inputhandlers/NumberInputHandler.js @@ -11,15 +11,15 @@ var SetInputTextReadOnly = function (gameObject, enable) { export default { name: 'NumberInput', - accept(config, value) { + accept(config) { if (config.hasOwnProperty('view')) { return (config.view === 'number') } - return typeof (value) === 'number'; + return typeof (config.value) === 'number'; }, - // Callback inside `constructor()` + // Callback after `constructor()` build(gameObject, style) { var scene = gameObject.scene; diff --git a/templates/ui/tweaker/inputhandlers/RangeInputHandler.js b/templates/ui/tweaker/inputhandlers/RangeInputHandler.js index b3a75b4b28..e5e1962934 100644 --- a/templates/ui/tweaker/inputhandlers/RangeInputHandler.js +++ b/templates/ui/tweaker/inputhandlers/RangeInputHandler.js @@ -26,18 +26,18 @@ var SetInputTextReadOnly = function (gameObject, enable) { export default { name: 'RangeInput', - accept(config, value) { + accept(config) { if (config.hasOwnProperty('view')) { return (config.view === 'range') } - return (typeof (value) === 'number') && + return (typeof (config.value) === 'number') && config.hasOwnProperty('min') && config.hasOwnProperty('max'); }, - // Callback inside `constructor()` + // Callback after `constructor()` build(gameObject, style) { var scene = gameObject.scene; diff --git a/templates/ui/tweaker/inputhandlers/TextAreaInputHandler.js b/templates/ui/tweaker/inputhandlers/TextAreaInputHandler.js index 5fe6b314e3..1bd190a23f 100644 --- a/templates/ui/tweaker/inputhandlers/TextAreaInputHandler.js +++ b/templates/ui/tweaker/inputhandlers/TextAreaInputHandler.js @@ -12,7 +12,7 @@ var SetInputTextReadOnly = function (gameObject, enable) { export default { name: 'TextAreaInput', - accept(config, value) { + accept(config) { if (config.hasOwnProperty('view')) { return (config.view === 'textarea') } @@ -20,7 +20,7 @@ export default { return false; }, - // Callback inside `constructor()` + // Callback after `constructor()` build(gameObject, style) { var scene = gameObject.scene; diff --git a/templates/ui/tweaker/inputhandlers/TextInputHandler.js b/templates/ui/tweaker/inputhandlers/TextInputHandler.js index 4dee72f33e..107b2e1a6d 100644 --- a/templates/ui/tweaker/inputhandlers/TextInputHandler.js +++ b/templates/ui/tweaker/inputhandlers/TextInputHandler.js @@ -12,15 +12,15 @@ var SetInputTextReadOnly = function (gameObject, enable) { export default { name: 'TextInput', - accept(config, value) { + accept(config) { if (config.hasOwnProperty('view')) { return (config.view === 'string') } - return typeof (value) === 'string'; + return typeof (config.value) === 'string'; }, - // Callback inside `constructor()` + // Callback after `constructor()` build(gameObject, style) { var scene = gameObject.scene; diff --git a/templates/ui/tweaker/inputhandlers/ToggleSwitchInputHandler.js b/templates/ui/tweaker/inputhandlers/ToggleSwitchInputHandler.js index aed2667bcc..b6745a1d5f 100644 --- a/templates/ui/tweaker/inputhandlers/ToggleSwitchInputHandler.js +++ b/templates/ui/tweaker/inputhandlers/ToggleSwitchInputHandler.js @@ -3,7 +3,7 @@ import CreateToggleSwitch from './utils/CreateToggleSwitch.js'; export default { name: 'ToggleSwitchInput', - accept(config, value) { + accept(config) { if (config.hasOwnProperty('view')) { return (config.view === 'toggleSwitch') } @@ -11,7 +11,7 @@ export default { return false; }, - // Callback inside `constructor()` + // Callback after `constructor()` build(gameObject, style) { var scene = gameObject.scene; diff --git a/templates/ui/tweaker/methods/AddInput.js b/templates/ui/tweaker/methods/AddInput.js index 378f7e6c50..6c71db18b4 100644 --- a/templates/ui/tweaker/methods/AddInput.js +++ b/templates/ui/tweaker/methods/AddInput.js @@ -17,6 +17,12 @@ var AddInput = function (object, key, config) { config.title = key; } + if (config.bindingTarget && config.bindingKey) { + config.value = config.bindingTarget[config.bindingKey]; + } else { + config.value = undefined; + } + // Create InputRow var inputRowStyle = this.styles.inputRow || {}; inputRowStyle.parentOrientation = this.styles.orientation;