@eva/plugin-ui 2.1.0-beta.1 → 2.1.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,17 +8,18 @@ globalThis.EVA = globalThis.EVA || {};
8
8
  globalThis.EVA.plugin = globalThis.EVA.plugin || {};
9
9
  var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
10
10
  'use strict';
11
- exports.UIShapeType = void 0;
12
- (function (UIShapeType) {
13
- UIShapeType["RECT"] = "rect";
14
- UIShapeType["CIRCLE"] = "circle";
15
- UIShapeType["ELLIPSE"] = "ellipse";
16
- UIShapeType["ROUNDED_RECT"] = "roundedRect";
17
- })(exports.UIShapeType || (exports.UIShapeType = {}));
18
- class UI extends eva_js.Component {
11
+ exports.ShapeType = void 0;
12
+ (function (ShapeType) {
13
+ ShapeType["RECT"] = "rect";
14
+ ShapeType["CIRCLE"] = "circle";
15
+ ShapeType["ELLIPSE"] = "ellipse";
16
+ ShapeType["ROUNDED_RECT"] = "roundedRect";
17
+ })(exports.ShapeType || (exports.ShapeType = {}));
18
+ const UIShapeType = exports.ShapeType;
19
+ class Shape extends eva_js.Component {
19
20
  constructor() {
20
21
  super(...arguments);
21
- this.componentName = 'UI';
22
+ this.componentName = 'Shape';
22
23
  this.shapes = [];
23
24
  }
24
25
  static getInspectorMetadata() {
@@ -60,7 +61,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
60
61
  isArray: false
61
62
  }];
62
63
  return {
63
- name: UI.componentName,
64
+ name: Shape.componentName,
64
65
  type: 'object',
65
66
  isArray: false,
66
67
  isFolder: true,
@@ -185,22 +186,22 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
185
186
  const x = style.x || 0;
186
187
  const y = style.y || 0;
187
188
  switch (type) {
188
- case exports.UIShapeType.RECT:
189
- case exports.UIShapeType.ROUNDED_RECT:
189
+ case exports.ShapeType.RECT:
190
+ case exports.ShapeType.ROUNDED_RECT:
190
191
  return {
191
192
  width: style.width,
192
193
  height: style.height,
193
194
  x,
194
195
  y
195
196
  };
196
- case exports.UIShapeType.CIRCLE:
197
+ case exports.ShapeType.CIRCLE:
197
198
  return {
198
199
  width: style.radius * 2,
199
200
  height: style.radius * 2,
200
201
  x,
201
202
  y
202
203
  };
203
- case exports.UIShapeType.ELLIPSE:
204
+ case exports.ShapeType.ELLIPSE:
204
205
  return {
205
206
  width: style.width,
206
207
  height: style.height,
@@ -233,37 +234,27 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
233
234
  });
234
235
  }
235
236
  drawShape(graphics, type, style) {
237
+ var _a;
236
238
  if (style.alpha !== undefined) {
237
239
  graphics.alpha = style.alpha;
238
240
  }
239
- if (style.stroke && style.lineWidth !== undefined) {
240
- graphics.setStrokeStyle({
241
- color: style.stroke,
242
- width: style.lineWidth
243
- });
244
- } else if (style.stroke) {
245
- graphics.setStrokeStyle({
246
- color: style.stroke,
247
- width: 1
248
- });
249
- }
250
241
  switch (type) {
251
- case exports.UIShapeType.RECT:
242
+ case exports.ShapeType.RECT:
252
243
  this.drawRect(graphics, style);
253
244
  break;
254
- case exports.UIShapeType.CIRCLE:
245
+ case exports.ShapeType.CIRCLE:
255
246
  this.drawCircle(graphics, style);
256
247
  break;
257
- case exports.UIShapeType.ELLIPSE:
248
+ case exports.ShapeType.ELLIPSE:
258
249
  this.drawEllipse(graphics, style);
259
250
  break;
260
- case exports.UIShapeType.ROUNDED_RECT:
251
+ case exports.ShapeType.ROUNDED_RECT:
261
252
  this.drawRoundedRect(graphics, style);
262
253
  break;
263
254
  default:
264
255
  console.warn(`Unknown shape type: ${type}`);
265
256
  }
266
- if (style.fill) {
257
+ if (style.fill !== undefined) {
267
258
  if (typeof style.fill === 'string' && style.fill.includes('linear-gradient')) {
268
259
  const gradientInfo = this.parseLinearGradient(style.fill);
269
260
  if (gradientInfo) {
@@ -278,6 +269,12 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
278
269
  graphics.fill(style.fill);
279
270
  }
280
271
  }
272
+ if (style.stroke !== undefined) {
273
+ graphics.stroke({
274
+ color: style.stroke,
275
+ width: (_a = style.lineWidth) !== null && _a !== void 0 ? _a : 1
276
+ });
277
+ }
281
278
  }
282
279
  drawRect(graphics, style) {
283
280
  const x = style.x || 0;
@@ -355,7 +352,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
355
352
  this.redraw();
356
353
  }
357
354
  }
358
- UI.componentName = 'UI';
355
+ Shape.componentName = 'Shape';
359
356
  function createCommonjsModule(fn) {
360
357
  var module = {
361
358
  exports: {}
@@ -953,8 +950,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
953
950
  const exID = this.active;
954
951
  this.forceSwitch(id);
955
952
  if (exID !== this.active) {
956
- var _this$active;
957
- const res = this.views.length > 2 ? (_this$active = this.active) != null ? _this$active : 0 : this.active === 1;
953
+ const res = this.views.length > 2 ? this.active ?? 0 : this.active === 1;
958
954
  this.onChange.emit(res);
959
955
  }
960
956
  }
@@ -1001,16 +997,15 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
1001
997
  var __publicField$h = (obj, key, value) => __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
1002
998
  class CheckBox$1 extends Switcher$1 {
1003
999
  constructor(options) {
1004
- var _options$TextClass, _options$text, _options$checked;
1005
1000
  super();
1006
1001
  __publicField$h(this, "labelText");
1007
1002
  __publicField$h(this, "onCheck");
1008
1003
  __publicField$h(this, "_style");
1009
1004
  __publicField$h(this, "_textClass");
1010
- this._textClass = (_options$TextClass = options.TextClass) != null ? _options$TextClass : pixi_js.Text;
1011
- this.text = (_options$text = options.text) != null ? _options$text : "";
1005
+ this._textClass = options.TextClass ?? pixi_js.Text;
1006
+ this.text = options.text ?? "";
1012
1007
  this.style = options.style;
1013
- this.checked = (_options$checked = options.checked) != null ? _options$checked : false;
1008
+ this.checked = options.checked ?? false;
1014
1009
  this.triggerEvents = ["onPress"];
1015
1010
  this.innerView.cursor = "pointer";
1016
1011
  this.onCheck = new dist.Signal();
@@ -1020,8 +1015,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
1020
1015
  var _this$_style;
1021
1016
  if (!text) return;
1022
1017
  this.labelText = new this._textClass({
1023
- text: text != null ? text : "",
1024
- style: style != null ? style : (_this$_style = this._style) === null || _this$_style === void 0 ? void 0 : _this$_style.text
1018
+ text: text ?? "",
1019
+ style: style ?? ((_this$_style = this._style) === null || _this$_style === void 0 ? void 0 : _this$_style.text)
1025
1020
  });
1026
1021
  this.addChild(this.labelText);
1027
1022
  this.labelText.cursor = "pointer";
@@ -1045,8 +1040,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
1045
1040
  this.alignText();
1046
1041
  }
1047
1042
  get text() {
1048
- var _this$labelText$text, _this$labelText;
1049
- return (_this$labelText$text = (_this$labelText = this.labelText) === null || _this$labelText === void 0 ? void 0 : _this$labelText.text) != null ? _this$labelText$text : "";
1043
+ var _this$labelText;
1044
+ return ((_this$labelText = this.labelText) === null || _this$labelText === void 0 ? void 0 : _this$labelText.text) ?? "";
1050
1045
  }
1051
1046
  set style(style) {
1052
1047
  const wasChecked = this.checked;
@@ -1081,9 +1076,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
1081
1076
  if (!this.views) return;
1082
1077
  const uncheckedView = this.views[0];
1083
1078
  if (uncheckedView) {
1084
- var _this$_style$textOffs, _this$_style2, _this$_style2$textOff, _this$_style$textOffs2, _this$_style3, _this$_style3$textOff;
1085
- this.labelText.x = uncheckedView.width + 10 + ((_this$_style$textOffs = (_this$_style2 = this._style) === null || _this$_style2 === void 0 ? void 0 : (_this$_style2$textOff = _this$_style2.textOffset) === null || _this$_style2$textOff === void 0 ? void 0 : _this$_style2$textOff.x) != null ? _this$_style$textOffs : 0);
1086
- this.labelText.y = (uncheckedView.height - this.labelText.height) / 2 + ((_this$_style$textOffs2 = (_this$_style3 = this._style) === null || _this$_style3 === void 0 ? void 0 : (_this$_style3$textOff = _this$_style3.textOffset) === null || _this$_style3$textOff === void 0 ? void 0 : _this$_style3$textOff.y) != null ? _this$_style$textOffs2 : 0);
1079
+ var _this$_style2, _this$_style2$textOff, _this$_style3, _this$_style3$textOff;
1080
+ this.labelText.x = uncheckedView.width + 10 + (((_this$_style2 = this._style) === null || _this$_style2 === void 0 ? void 0 : (_this$_style2$textOff = _this$_style2.textOffset) === null || _this$_style2$textOff === void 0 ? void 0 : _this$_style2$textOff.x) ?? 0);
1081
+ this.labelText.y = (uncheckedView.height - this.labelText.height) / 2 + (((_this$_style3 = this._style) === null || _this$_style3 === void 0 ? void 0 : (_this$_style3$textOff = _this$_style3.textOffset) === null || _this$_style3$textOff === void 0 ? void 0 : _this$_style3$textOff.y) ?? 0);
1087
1082
  }
1088
1083
  }
1089
1084
  get checked() {
@@ -1112,7 +1107,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
1112
1107
  __publicField$g(this, "bgCircle", new pixi_js.Graphics());
1113
1108
  __publicField$g(this, "fillCircle", new pixi_js.Graphics());
1114
1109
  __publicField$g(this, "innerView", new pixi_js.Container());
1115
- this.options = options != null ? options : {};
1110
+ this.options = options ?? {};
1116
1111
  this.addChild(this.innerView);
1117
1112
  this.innerView.addChild(this.bgCircle, this.fillCircle);
1118
1113
  this.addBackground();
@@ -2474,7 +2469,6 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
2474
2469
  var __publicField$f = (obj, key, value) => __defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
2475
2470
  class FancyButton$1 extends ButtonContainer {
2476
2471
  constructor(options) {
2477
- var _ref, _ref2;
2478
2472
  super();
2479
2473
  __publicField$f(this, "animations");
2480
2474
  __publicField$f(this, "originalInnerViewState");
@@ -2504,7 +2498,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
2504
2498
  x: 0.5,
2505
2499
  y: 0.5
2506
2500
  });
2507
- this.options = options != null ? options : {};
2501
+ this.options = options ?? {};
2508
2502
  const {
2509
2503
  defaultView,
2510
2504
  hoverView,
@@ -2525,33 +2519,33 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
2525
2519
  anchorY,
2526
2520
  icon,
2527
2521
  animations
2528
- } = options != null ? options : {};
2522
+ } = options ?? {};
2529
2523
  this.addChild(this.innerView);
2530
2524
  this.anchor = new pixi_js.ObservablePoint({
2531
2525
  _onUpdate: () => this.updateAnchor()
2532
2526
  });
2533
- this.anchor.set((_ref = anchorX != null ? anchorX : anchor) != null ? _ref : 0, (_ref2 = anchorY != null ? anchorY : anchor) != null ? _ref2 : 0);
2534
- this.padding = padding != null ? padding : 0;
2535
- this.offset = offset != null ? offset : {};
2536
- this.textOffset = textOffset != null ? textOffset : {};
2537
- this.iconOffset = iconOffset != null ? iconOffset : {};
2538
- this.defaultTextScale = textScale != null ? textScale : {
2527
+ this.anchor.set(anchorX ?? anchor ?? 0, anchorY ?? anchor ?? 0);
2528
+ this.padding = padding ?? 0;
2529
+ this.offset = offset ?? {};
2530
+ this.textOffset = textOffset ?? {};
2531
+ this.iconOffset = iconOffset ?? {};
2532
+ this.defaultTextScale = textScale ?? {
2539
2533
  x: 1,
2540
2534
  y: 1
2541
2535
  };
2542
- this.defaultIconScale = iconScale != null ? iconScale : {
2536
+ this.defaultIconScale = iconScale ?? {
2543
2537
  x: 1,
2544
2538
  y: 1
2545
2539
  };
2546
- this.defaultTextAnchor = textAnchor != null ? textAnchor : {
2540
+ this.defaultTextAnchor = textAnchor ?? {
2547
2541
  x: 0.5,
2548
2542
  y: 0.5
2549
2543
  };
2550
- this.defaultIconAnchor = iconAnchor != null ? iconAnchor : {
2544
+ this.defaultIconAnchor = iconAnchor ?? {
2551
2545
  x: 0.5,
2552
2546
  y: 0.5
2553
2547
  };
2554
- this.scale.set(scale != null ? scale : 1);
2548
+ this.scale.set(scale ?? 1);
2555
2549
  if (animations) {
2556
2550
  this.animations = animations;
2557
2551
  this.setOriginalInnerViewState();
@@ -2562,7 +2556,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
2562
2556
  this.hoverView = hoverView;
2563
2557
  this.pressedView = pressedView;
2564
2558
  this.disabledView = disabledView;
2565
- this.text = text != null ? text : "";
2559
+ this.text = text ?? "";
2566
2560
  if (icon !== void 0) {
2567
2561
  this.iconView = icon;
2568
2562
  }
@@ -2628,42 +2622,37 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
2628
2622
  };
2629
2623
  const defaultStateOffset = offset === null || offset === void 0 ? void 0 : offset.default;
2630
2624
  if (stateOffset) {
2631
- var _stateOffset$x, _stateOffset$y;
2632
- view.x += (_stateOffset$x = stateOffset.x) != null ? _stateOffset$x : 0;
2633
- view.y += (_stateOffset$y = stateOffset.y) != null ? _stateOffset$y : 0;
2625
+ view.x += stateOffset.x ?? 0;
2626
+ view.y += stateOffset.y ?? 0;
2634
2627
  } else if (defaultStateOffset) {
2635
- var _defaultStateOffset$x, _defaultStateOffset$y;
2636
- view.x += (_defaultStateOffset$x = defaultStateOffset.x) != null ? _defaultStateOffset$x : 0;
2637
- view.y += (_defaultStateOffset$y = defaultStateOffset.y) != null ? _defaultStateOffset$y : 0;
2628
+ view.x += defaultStateOffset.x ?? 0;
2629
+ view.y += defaultStateOffset.y ?? 0;
2638
2630
  } else if (offset.x || offset.y) {
2639
- var _offset$x, _offset$y;
2640
- view.x += (_offset$x = offset.x) != null ? _offset$x : 0;
2641
- view.y += (_offset$y = offset.y) != null ? _offset$y : 0;
2631
+ view.x += offset.x ?? 0;
2632
+ view.y += offset.y ?? 0;
2642
2633
  }
2643
2634
  }
2644
2635
  getStateView(state) {
2645
- var _ref3, _this$_views$hoverVie, _ref4, _ref5, _this$_views$pressedV, _ref6, _this$_views$disabled, _this$_views$defaultV;
2646
2636
  if (!this._views) return void 0;
2647
2637
  switch (state) {
2648
2638
  case "hover":
2649
- return (_ref3 = (_this$_views$hoverVie = this._views.hoverView) != null ? _this$_views$hoverVie : this._views.defaultView) != null ? _ref3 : void 0;
2639
+ return this._views.hoverView ?? this._views.defaultView ?? void 0;
2650
2640
  case "pressed":
2651
- return (_ref4 = (_ref5 = (_this$_views$pressedV = this._views.pressedView) != null ? _this$_views$pressedV : this._views.hoverView) != null ? _ref5 : this._views.defaultView) != null ? _ref4 : void 0;
2641
+ return this._views.pressedView ?? this._views.hoverView ?? this._views.defaultView ?? void 0;
2652
2642
  case "disabled":
2653
- return (_ref6 = (_this$_views$disabled = this._views.disabledView) != null ? _this$_views$disabled : this._views.defaultView) != null ? _ref6 : void 0;
2643
+ return this._views.disabledView ?? this._views.defaultView ?? void 0;
2654
2644
  case "default":
2655
- return (_this$_views$defaultV = this._views.defaultView) != null ? _this$_views$defaultV : void 0;
2645
+ return this._views.defaultView ?? void 0;
2656
2646
  default:
2657
2647
  return void 0;
2658
2648
  }
2659
2649
  }
2660
2650
  adjustTextView(state) {
2661
- var _this$_defaultTextAnc, _this$_defaultTextAnc2;
2662
2651
  if (!this.text) return;
2663
2652
  if (!this._views.textView) return;
2664
2653
  const activeView = this.getStateView(this.state);
2665
- const anchorX = (_this$_defaultTextAnc = this._defaultTextAnchor.x) != null ? _this$_defaultTextAnc : 0.5;
2666
- const anchorY = (_this$_defaultTextAnc2 = this._defaultTextAnchor.y) != null ? _this$_defaultTextAnc2 : 0.5;
2654
+ const anchorX = this._defaultTextAnchor.x ?? 0.5;
2655
+ const anchorY = this._defaultTextAnchor.y ?? 0.5;
2667
2656
  if (activeView) {
2668
2657
  var _this$options2;
2669
2658
  if (!((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.ignoreRefitting)) {
@@ -2673,14 +2662,13 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
2673
2662
  fitToView(activeView, this._views.textView, this.padding, false);
2674
2663
  }
2675
2664
  if (this.contentFittingMode === "fill") {
2676
- var _this$_defaultTextSca, _this$_defaultTextSca2;
2677
2665
  this._views.textView.scale.set(1);
2678
2666
  const availableWidth = activeView.width - this.padding * 2;
2679
2667
  const availableHeight = activeView.height - this.padding * 2;
2680
2668
  const targetScaleX = availableWidth / this._views.textView.width;
2681
2669
  const targetScaleY = availableHeight / this._views.textView.height;
2682
2670
  const scale = Math.min(targetScaleX, targetScaleY);
2683
- this._views.textView.scale.set(scale * ((_this$_defaultTextSca = this._defaultTextScale.x) != null ? _this$_defaultTextSca : 1), scale * ((_this$_defaultTextSca2 = this._defaultTextScale.y) != null ? _this$_defaultTextSca2 : 1));
2671
+ this._views.textView.scale.set(scale * (this._defaultTextScale.x ?? 1), scale * (this._defaultTextScale.y ?? 1));
2684
2672
  }
2685
2673
  this._views.textView.x = activeView.x + activeView.width / 2;
2686
2674
  this._views.textView.y = activeView.y + activeView.height / 2;
@@ -2689,7 +2677,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
2689
2677
  this.setOffset(this._views.textView, state, this.textOffset);
2690
2678
  }
2691
2679
  adjustIconView(state) {
2692
- var _this$options3, _this$_defaultIconAnc, _this$_defaultIconAnc2;
2680
+ var _this$options3;
2693
2681
  if (!this._views.iconView) {
2694
2682
  return;
2695
2683
  }
@@ -2704,17 +2692,16 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
2704
2692
  fitToView(activeView, this._views.iconView, this.padding, false);
2705
2693
  }
2706
2694
  if (this.contentFittingMode === "fill") {
2707
- var _this$_defaultIconSca, _this$_defaultIconSca2;
2708
2695
  this._views.iconView.scale.set(1);
2709
2696
  const availableWidth = activeView.width - this.padding * 2;
2710
2697
  const availableHeight = activeView.height - this.padding * 2;
2711
2698
  const targetScaleX = availableWidth / this._views.iconView.width;
2712
2699
  const targetScaleY = availableHeight / this._views.iconView.height;
2713
2700
  const scale = Math.min(targetScaleX, targetScaleY);
2714
- this._views.iconView.scale.set(scale * ((_this$_defaultIconSca = this._defaultIconScale.x) != null ? _this$_defaultIconSca : 1), scale * ((_this$_defaultIconSca2 = this._defaultIconScale.y) != null ? _this$_defaultIconSca2 : 1));
2701
+ this._views.iconView.scale.set(scale * (this._defaultIconScale.x ?? 1), scale * (this._defaultIconScale.y ?? 1));
2715
2702
  }
2716
- const anchorX = (_this$_defaultIconAnc = this._defaultIconAnchor.x) != null ? _this$_defaultIconAnc : 0.5;
2717
- const anchorY = (_this$_defaultIconAnc2 = this._defaultIconAnchor.y) != null ? _this$_defaultIconAnc2 : 0.5;
2703
+ const anchorX = this._defaultIconAnchor.x ?? 0.5;
2704
+ const anchorY = this._defaultIconAnchor.y ?? 0.5;
2718
2705
  if ("anchor" in this._views.iconView) {
2719
2706
  this._views.iconView.anchor.set(anchorX, anchorY);
2720
2707
  } else {
@@ -2725,10 +2712,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
2725
2712
  this.setOffset(this._views.iconView, state, this.iconOffset);
2726
2713
  }
2727
2714
  updateAnchor() {
2728
- var _this$anchor$x, _this$anchor$y;
2729
2715
  if (!this._views) return;
2730
- const anchorX = (_this$anchor$x = this.anchor.x) != null ? _this$anchor$x : 0;
2731
- const anchorY = (_this$anchor$y = this.anchor.y) != null ? _this$anchor$y : 0;
2716
+ const anchorX = this.anchor.x ?? 0;
2717
+ const anchorY = this.anchor.y ?? 0;
2732
2718
  const views = [this._views.defaultView, this._views.hoverView, this._views.pressedView, this._views.disabledView];
2733
2719
  views.forEach(view => {
2734
2720
  var _view$anchor;
@@ -2753,8 +2739,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
2753
2739
  this.options.contentFittingMode = mode;
2754
2740
  }
2755
2741
  get contentFittingMode() {
2756
- var _this$options$content;
2757
- return (_this$options$content = this.options.contentFittingMode) != null ? _this$options$content : "default";
2742
+ return this.options.contentFittingMode ?? "default";
2758
2743
  }
2759
2744
  set defaultView(view) {
2760
2745
  this.updateView("defaultView", view);
@@ -2877,13 +2862,11 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
2877
2862
  return this._views.iconView;
2878
2863
  }
2879
2864
  playAnimations(state) {
2880
- var _this$animations$stat;
2881
2865
  if (!this.animations) return;
2882
- const stateAnimation = (_this$animations$stat = this.animations[state]) != null ? _this$animations$stat : this.animations.default;
2866
+ const stateAnimation = this.animations[state] ?? this.animations.default;
2883
2867
  if (stateAnimation) {
2884
- var _data$duration;
2885
2868
  const data = stateAnimation;
2886
- this.defaultDuration = (_data$duration = data.duration) != null ? _data$duration : this.defaultDuration;
2869
+ this.defaultDuration = data.duration ?? this.defaultDuration;
2887
2870
  new Tween(this.innerView).to(data.props, data.duration).start();
2888
2871
  return;
2889
2872
  }
@@ -2903,13 +2886,13 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
2903
2886
  };
2904
2887
  const defaultStateAnimation = (_this$animations = this.animations) === null || _this$animations === void 0 ? void 0 : _this$animations.default;
2905
2888
  if (defaultStateAnimation) {
2906
- var _ref7, _defaultStateAnimatio, _ref8, _defaultStateAnimatio2, _ref9, _defaultStateAnimatio3, _ref0, _defaultStateAnimatio4, _ref1, _defaultStateAnimatio5, _defaultStateAnimatio6, _this$originalInnerVi, _ref10, _defaultStateAnimatio7, _defaultStateAnimatio8, _this$originalInnerVi2;
2907
- this.innerView.x = (_ref7 = (_defaultStateAnimatio = defaultStateAnimation.props.x) != null ? _defaultStateAnimatio : this.originalInnerViewState.x) != null ? _ref7 : 0;
2908
- this.innerView.y = (_ref8 = (_defaultStateAnimatio2 = defaultStateAnimation.props.y) != null ? _defaultStateAnimatio2 : this.originalInnerViewState.y) != null ? _ref8 : 0;
2909
- this.innerView.width = (_ref9 = (_defaultStateAnimatio3 = defaultStateAnimation.props.width) != null ? _defaultStateAnimatio3 : this.originalInnerViewState.width) != null ? _ref9 : 0;
2910
- this.innerView.height = (_ref0 = (_defaultStateAnimatio4 = defaultStateAnimation.props.height) != null ? _defaultStateAnimatio4 : this.originalInnerViewState.height) != null ? _ref0 : 0;
2911
- this.innerView.scale.x = (_ref1 = (_defaultStateAnimatio5 = (_defaultStateAnimatio6 = defaultStateAnimation.props.scale) === null || _defaultStateAnimatio6 === void 0 ? void 0 : _defaultStateAnimatio6.x) != null ? _defaultStateAnimatio5 : (_this$originalInnerVi = this.originalInnerViewState.scale) === null || _this$originalInnerVi === void 0 ? void 0 : _this$originalInnerVi.x) != null ? _ref1 : 1;
2912
- this.innerView.scale.y = (_ref10 = (_defaultStateAnimatio7 = (_defaultStateAnimatio8 = defaultStateAnimation.props.scale) === null || _defaultStateAnimatio8 === void 0 ? void 0 : _defaultStateAnimatio8.y) != null ? _defaultStateAnimatio7 : (_this$originalInnerVi2 = this.originalInnerViewState.scale) === null || _this$originalInnerVi2 === void 0 ? void 0 : _this$originalInnerVi2.y) != null ? _ref10 : 1;
2889
+ var _defaultStateAnimatio, _this$originalInnerVi, _defaultStateAnimatio2, _this$originalInnerVi2;
2890
+ this.innerView.x = defaultStateAnimation.props.x ?? this.originalInnerViewState.x ?? 0;
2891
+ this.innerView.y = defaultStateAnimation.props.y ?? this.originalInnerViewState.y ?? 0;
2892
+ this.innerView.width = defaultStateAnimation.props.width ?? this.originalInnerViewState.width ?? 0;
2893
+ this.innerView.height = defaultStateAnimation.props.height ?? this.originalInnerViewState.height ?? 0;
2894
+ this.innerView.scale.x = ((_defaultStateAnimatio = defaultStateAnimation.props.scale) === null || _defaultStateAnimatio === void 0 ? void 0 : _defaultStateAnimatio.x) ?? ((_this$originalInnerVi = this.originalInnerViewState.scale) === null || _this$originalInnerVi === void 0 ? void 0 : _this$originalInnerVi.x) ?? 1;
2895
+ this.innerView.scale.y = ((_defaultStateAnimatio2 = defaultStateAnimation.props.scale) === null || _defaultStateAnimatio2 === void 0 ? void 0 : _defaultStateAnimatio2.y) ?? ((_this$originalInnerVi2 = this.originalInnerViewState.scale) === null || _this$originalInnerVi2 === void 0 ? void 0 : _this$originalInnerVi2.y) ?? 1;
2913
2896
  }
2914
2897
  }
2915
2898
  initStateControl() {
@@ -2959,48 +2942,44 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
2959
2942
  return this._textOffset;
2960
2943
  }
2961
2944
  set defaultTextScale(scale) {
2962
- var _scale$x, _scale$y;
2963
2945
  if (scale === void 0) return;
2964
2946
  this.options.defaultTextScale = scale;
2965
2947
  const isNumber = typeof scale === "number";
2966
- this._defaultTextScale.x = isNumber ? scale : (_scale$x = scale.x) != null ? _scale$x : 1;
2967
- this._defaultTextScale.y = isNumber ? scale : (_scale$y = scale.y) != null ? _scale$y : 1;
2948
+ this._defaultTextScale.x = isNumber ? scale : scale.x ?? 1;
2949
+ this._defaultTextScale.y = isNumber ? scale : scale.y ?? 1;
2968
2950
  this.adjustTextView(this.state);
2969
2951
  }
2970
2952
  get defaultTextScale() {
2971
2953
  return this.defaultTextScale;
2972
2954
  }
2973
2955
  set defaultIconScale(scale) {
2974
- var _scale$x2, _scale$y2;
2975
2956
  if (scale === void 0) return;
2976
2957
  this.options.defaultIconScale = scale;
2977
2958
  const isNumber = typeof scale === "number";
2978
- this._defaultIconScale.x = isNumber ? scale : (_scale$x2 = scale.x) != null ? _scale$x2 : 1;
2979
- this._defaultIconScale.y = isNumber ? scale : (_scale$y2 = scale.y) != null ? _scale$y2 : 1;
2959
+ this._defaultIconScale.x = isNumber ? scale : scale.x ?? 1;
2960
+ this._defaultIconScale.y = isNumber ? scale : scale.y ?? 1;
2980
2961
  this.adjustIconView(this.state);
2981
2962
  }
2982
2963
  get defaultIconScale() {
2983
2964
  return this.defaultIconScale;
2984
2965
  }
2985
2966
  set defaultTextAnchor(anchor) {
2986
- var _anchor$x, _anchor$y;
2987
2967
  if (anchor === void 0) return;
2988
2968
  this.options.defaultTextAnchor = anchor;
2989
2969
  const isNumber = typeof anchor === "number";
2990
- this._defaultTextAnchor.x = isNumber ? anchor : (_anchor$x = anchor.x) != null ? _anchor$x : 1;
2991
- this._defaultTextAnchor.y = isNumber ? anchor : (_anchor$y = anchor.y) != null ? _anchor$y : 1;
2970
+ this._defaultTextAnchor.x = isNumber ? anchor : anchor.x ?? 1;
2971
+ this._defaultTextAnchor.y = isNumber ? anchor : anchor.y ?? 1;
2992
2972
  this.adjustTextView(this.state);
2993
2973
  }
2994
2974
  get defaultTextAnchor() {
2995
2975
  return this.defaultTextAnchor;
2996
2976
  }
2997
2977
  set defaultIconAnchor(anchor) {
2998
- var _anchor$x2, _anchor$y2;
2999
2978
  if (anchor === void 0) return;
3000
2979
  this.options.defaultIconAnchor = anchor;
3001
2980
  const isNumber = typeof anchor === "number";
3002
- this._defaultIconAnchor.x = isNumber ? anchor : (_anchor$x2 = anchor.x) != null ? _anchor$x2 : 1;
3003
- this._defaultIconAnchor.y = isNumber ? anchor : (_anchor$y2 = anchor.y) != null ? _anchor$y2 : 1;
2981
+ this._defaultIconAnchor.x = isNumber ? anchor : anchor.x ?? 1;
2982
+ this._defaultIconAnchor.y = isNumber ? anchor : anchor.y ?? 1;
3004
2983
  this.adjustIconView(this.state);
3005
2984
  }
3006
2985
  get defaultIconAnchor() {
@@ -3127,8 +3106,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3127
3106
  this.arrangeChildren();
3128
3107
  }
3129
3108
  get elementsMargin() {
3130
- var _this$options$element, _this$options9;
3131
- return (_this$options$element = (_this$options9 = this.options) === null || _this$options9 === void 0 ? void 0 : _this$options9.elementsMargin) != null ? _this$options$element : 0;
3109
+ var _this$options9;
3110
+ return ((_this$options9 = this.options) === null || _this$options9 === void 0 ? void 0 : _this$options9.elementsMargin) ?? 0;
3132
3111
  }
3133
3112
  set padding(padding) {
3134
3113
  if (!this.options) throw new Error("List has not been initiated!");
@@ -3142,8 +3121,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3142
3121
  this.arrangeChildren();
3143
3122
  }
3144
3123
  get padding() {
3145
- var _this$options$padding, _this$options0;
3146
- return (_this$options$padding = (_this$options0 = this.options) === null || _this$options0 === void 0 ? void 0 : _this$options0.padding) != null ? _this$options$padding : 0;
3124
+ var _this$options0;
3125
+ return ((_this$options0 = this.options) === null || _this$options0 === void 0 ? void 0 : _this$options0.padding) ?? 0;
3147
3126
  }
3148
3127
  set vertPadding(padding) {
3149
3128
  if (!this.options) throw new Error("List has not been initiated!");
@@ -3153,8 +3132,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3153
3132
  this.arrangeChildren();
3154
3133
  }
3155
3134
  get vertPadding() {
3156
- var _ref11, _this$options$vertPad, _this$options1;
3157
- return (_ref11 = (_this$options$vertPad = (_this$options1 = this.options) === null || _this$options1 === void 0 ? void 0 : _this$options1.vertPadding) != null ? _this$options$vertPad : this.padding) != null ? _ref11 : 0;
3135
+ var _this$options1;
3136
+ return ((_this$options1 = this.options) === null || _this$options1 === void 0 ? void 0 : _this$options1.vertPadding) ?? this.padding ?? 0;
3158
3137
  }
3159
3138
  set horPadding(padding) {
3160
3139
  if (!this.options) throw new Error("List has not been initiated!");
@@ -3164,8 +3143,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3164
3143
  this.arrangeChildren();
3165
3144
  }
3166
3145
  get horPadding() {
3167
- var _ref12, _this$options$horPadd, _this$options10;
3168
- return (_ref12 = (_this$options$horPadd = (_this$options10 = this.options) === null || _this$options10 === void 0 ? void 0 : _this$options10.horPadding) != null ? _this$options$horPadd : this.padding) != null ? _ref12 : 0;
3146
+ var _this$options10;
3147
+ return ((_this$options10 = this.options) === null || _this$options10 === void 0 ? void 0 : _this$options10.horPadding) ?? this.padding ?? 0;
3169
3148
  }
3170
3149
  set leftPadding(padding) {
3171
3150
  if (!this.options) throw new Error("List has not been initiated!");
@@ -3173,8 +3152,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3173
3152
  this.arrangeChildren();
3174
3153
  }
3175
3154
  get leftPadding() {
3176
- var _this$options$leftPad, _this$options11;
3177
- return (_this$options$leftPad = (_this$options11 = this.options) === null || _this$options11 === void 0 ? void 0 : _this$options11.leftPadding) != null ? _this$options$leftPad : this.horPadding;
3155
+ var _this$options11;
3156
+ return ((_this$options11 = this.options) === null || _this$options11 === void 0 ? void 0 : _this$options11.leftPadding) ?? this.horPadding;
3178
3157
  }
3179
3158
  set rightPadding(padding) {
3180
3159
  if (!this.options) throw new Error("List has not been initiated!");
@@ -3182,8 +3161,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3182
3161
  this.arrangeChildren();
3183
3162
  }
3184
3163
  get rightPadding() {
3185
- var _this$options$rightPa, _this$options12;
3186
- return (_this$options$rightPa = (_this$options12 = this.options) === null || _this$options12 === void 0 ? void 0 : _this$options12.rightPadding) != null ? _this$options$rightPa : this.horPadding;
3164
+ var _this$options12;
3165
+ return ((_this$options12 = this.options) === null || _this$options12 === void 0 ? void 0 : _this$options12.rightPadding) ?? this.horPadding;
3187
3166
  }
3188
3167
  set topPadding(padding) {
3189
3168
  if (!this.options) throw new Error("List has not been initiated!");
@@ -3191,8 +3170,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3191
3170
  this.arrangeChildren();
3192
3171
  }
3193
3172
  get topPadding() {
3194
- var _this$options$topPadd, _this$options13;
3195
- return (_this$options$topPadd = (_this$options13 = this.options) === null || _this$options13 === void 0 ? void 0 : _this$options13.topPadding) != null ? _this$options$topPadd : this.vertPadding;
3173
+ var _this$options13;
3174
+ return ((_this$options13 = this.options) === null || _this$options13 === void 0 ? void 0 : _this$options13.topPadding) ?? this.vertPadding;
3196
3175
  }
3197
3176
  set bottomPadding(padding) {
3198
3177
  if (!this.options) throw new Error("List has not been initiated!");
@@ -3200,15 +3179,15 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3200
3179
  this.arrangeChildren();
3201
3180
  }
3202
3181
  get bottomPadding() {
3203
- var _this$options$bottomP, _this$options14;
3204
- return (_this$options$bottomP = (_this$options14 = this.options) === null || _this$options14 === void 0 ? void 0 : _this$options14.bottomPadding) != null ? _this$options$bottomP : this.vertPadding;
3182
+ var _this$options14;
3183
+ return ((_this$options14 = this.options) === null || _this$options14 === void 0 ? void 0 : _this$options14.bottomPadding) ?? this.vertPadding;
3205
3184
  }
3206
3185
  arrangeChildren() {
3207
- var _this$options$element2, _this$options15, _this$parent;
3186
+ var _this$options15, _this$parent;
3208
3187
  let maxHeight = 0;
3209
3188
  let x = this.leftPadding;
3210
3189
  let y = this.topPadding;
3211
- const elementsMargin = (_this$options$element2 = (_this$options15 = this.options) === null || _this$options15 === void 0 ? void 0 : _this$options15.elementsMargin) != null ? _this$options$element2 : 0;
3190
+ const elementsMargin = ((_this$options15 = this.options) === null || _this$options15 === void 0 ? void 0 : _this$options15.elementsMargin) ?? 0;
3212
3191
  let maxWidth = this.maxWidth || ((_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.width);
3213
3192
  if (this.rightPadding) {
3214
3193
  maxWidth -= this.rightPadding;
@@ -3268,7 +3247,6 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3268
3247
  var __publicField$d = (obj, key, value) => __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
3269
3248
  class Spring {
3270
3249
  constructor(options = {}) {
3271
- var _options$max, _options$damp, _options$springiness;
3272
3250
  __publicField$d(this, "x");
3273
3251
  __publicField$d(this, "ax");
3274
3252
  __publicField$d(this, "dx");
@@ -3279,9 +3257,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3279
3257
  this.dx = 0;
3280
3258
  this.tx = 0;
3281
3259
  this._options = {
3282
- max: (_options$max = options.max) != null ? _options$max : 160,
3283
- damp: (_options$damp = options.damp) != null ? _options$damp : 0.8,
3284
- springiness: (_options$springiness = options.springiness) != null ? _options$springiness : 0.1
3260
+ max: options.max ?? 160,
3261
+ damp: options.damp ?? 0.8,
3262
+ springiness: options.springiness ?? 0.1
3285
3263
  };
3286
3264
  }
3287
3265
  update() {
@@ -3385,7 +3363,6 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3385
3363
  var __publicField$b = (obj, key, value) => __defNormalProp$b(obj, typeof key !== "symbol" ? key + "" : key, value);
3386
3364
  class SlidingNumber {
3387
3365
  constructor(options = {}) {
3388
- var _options$constrain, _options$maxSpeed, _options$ease;
3389
3366
  __publicField$b(this, "position", 0);
3390
3367
  __publicField$b(this, "constrain", true);
3391
3368
  __publicField$b(this, "min", 0);
@@ -3400,9 +3377,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3400
3377
  __publicField$b(this, "_speedChecker", 0);
3401
3378
  __publicField$b(this, "_grab", 0);
3402
3379
  __publicField$b(this, "_activeEase");
3403
- this.constrain = (_options$constrain = options.constrain) != null ? _options$constrain : true;
3404
- this.maxSpeed = (_options$maxSpeed = options.maxSpeed) != null ? _options$maxSpeed : 400;
3405
- this._ease = (_options$ease = options.ease) != null ? _options$ease : new ScrollSpring();
3380
+ this.constrain = options.constrain ?? true;
3381
+ this.maxSpeed = options.maxSpeed ?? 400;
3382
+ this._ease = options.ease ?? new ScrollSpring();
3406
3383
  }
3407
3384
  set value(n) {
3408
3385
  this._speed = 0;
@@ -3499,7 +3476,6 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3499
3476
  var __publicField$a = (obj, key, value) => __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
3500
3477
  class Trackpad {
3501
3478
  constructor(options) {
3502
- var _options$disableEasin;
3503
3479
  __publicField$a(this, "xAxis");
3504
3480
  __publicField$a(this, "yAxis");
3505
3481
  __publicField$a(this, "_isDown", false);
@@ -3518,7 +3494,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3518
3494
  maxSpeed: options.maxSpeed,
3519
3495
  constrain: options.constrain
3520
3496
  });
3521
- this.disableEasing = (_options$disableEasin = options.disableEasing) != null ? _options$disableEasin : false;
3497
+ this.disableEasing = options.disableEasing ?? false;
3522
3498
  this._frame = new pixi_js.Rectangle();
3523
3499
  this._bounds = new pixi_js.Rectangle();
3524
3500
  this._globalPosition = new pixi_js.Point();
@@ -3617,12 +3593,12 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3617
3593
  this.ticker.add(this.update, this);
3618
3594
  }
3619
3595
  init(options) {
3620
- var _ref13, _options$width, _this$background, _ref14, _options$height, _this$background2, _options$proximityRan, _this$list, _options$globalScroll, _options$shiftScroll;
3596
+ var _this$background, _this$background2, _this$list;
3621
3597
  this.options = options;
3622
3598
  this.setBackground(options.background);
3623
- this._width = (_ref13 = (_options$width = options.width) != null ? _options$width : (_this$background = this.background) === null || _this$background === void 0 ? void 0 : _this$background.width) != null ? _ref13 : 100;
3624
- this._height = (_ref14 = (_options$height = options.height) != null ? _options$height : (_this$background2 = this.background) === null || _this$background2 === void 0 ? void 0 : _this$background2.height) != null ? _ref14 : 100;
3625
- this.proximityRange = (_options$proximityRan = options.proximityRange) != null ? _options$proximityRan : 0;
3599
+ this._width = options.width ?? ((_this$background = this.background) === null || _this$background === void 0 ? void 0 : _this$background.width) ?? 100;
3600
+ this._height = options.height ?? ((_this$background2 = this.background) === null || _this$background2 === void 0 ? void 0 : _this$background2.height) ?? 100;
3601
+ this.proximityRange = options.proximityRange ?? 0;
3626
3602
  if (!this.list) {
3627
3603
  this.list = new List$1();
3628
3604
  super.addChild(this.list);
@@ -3650,8 +3626,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3650
3626
  this._trackpad.xAxis.value = 0;
3651
3627
  this._trackpad.yAxis.value = 0;
3652
3628
  }
3653
- this.options.globalScroll = (_options$globalScroll = options.globalScroll) != null ? _options$globalScroll : true;
3654
- this.options.shiftScroll = (_options$shiftScroll = options.shiftScroll) != null ? _options$shiftScroll : false;
3629
+ this.options.globalScroll = options.globalScroll ?? true;
3630
+ this.options.shiftScroll = options.shiftScroll ?? false;
3655
3631
  this.resize();
3656
3632
  }
3657
3633
  get hasBounds() {
@@ -3696,24 +3672,22 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3696
3672
  const list = this.list;
3697
3673
  if (!list) return false;
3698
3674
  if (this.isVertical || this.isBidirectional) {
3699
- var _this$options$height;
3700
3675
  const posY = item.y + list.y;
3701
- if (posY + item.height >= -padding && posY <= ((_this$options$height = this.options.height) != null ? _this$options$height : this._height) + padding) {
3676
+ if (posY + item.height >= -padding && posY <= (this.options.height ?? this._height) + padding) {
3702
3677
  isVisible = true;
3703
3678
  }
3704
3679
  }
3705
3680
  if (this.isHorizontal || this.isBidirectional) {
3706
- var _this$options$width;
3707
3681
  const posX = item.x + list.x;
3708
- if (posX + item.width >= -padding && posX <= ((_this$options$width = this.options.width) != null ? _this$options$width : this._width) + padding) {
3682
+ if (posX + item.width >= -padding && posX <= (this.options.width ?? this._width) + padding) {
3709
3683
  isVisible = true;
3710
3684
  }
3711
3685
  }
3712
3686
  return isVisible;
3713
3687
  }
3714
3688
  get items() {
3715
- var _this$list$children, _this$list5;
3716
- return (_this$list$children = (_this$list5 = this.list) === null || _this$list5 === void 0 ? void 0 : _this$list5.children) != null ? _this$list$children : [];
3689
+ var _this$list5;
3690
+ return ((_this$list5 = this.list) === null || _this$list5 === void 0 ? void 0 : _this$list5.children) ?? [];
3717
3691
  }
3718
3692
  setBackground(background) {
3719
3693
  if (this.background) {
@@ -3782,8 +3756,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3782
3756
  if (!this.isDragging) return;
3783
3757
  const touchPoint = this.worldTransform.applyInverse(e.global);
3784
3758
  if (this.dragStarTouchPoint) {
3785
- var _this$options$dragTra;
3786
- const dragTrashHold = (_this$options$dragTra = this.options.dragTrashHold) != null ? _this$options$dragTra : 10;
3759
+ const dragTrashHold = this.options.dragTrashHold ?? 10;
3787
3760
  if (this.isHorizontal || this.isBidirectional) {
3788
3761
  const xDist = touchPoint.x - this.dragStarTouchPoint.x;
3789
3762
  if (Math.abs(xDist) > dragTrashHold) {
@@ -3820,29 +3793,29 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3820
3793
  this.eventMode = interactive ? "static" : "auto";
3821
3794
  }
3822
3795
  get listHeight() {
3823
- var _this$list$height, _this$list7, _this$list$topPadding, _this$list8, _this$list$bottomPadd, _this$list9;
3824
- return ((_this$list$height = (_this$list7 = this.list) === null || _this$list7 === void 0 ? void 0 : _this$list7.height) != null ? _this$list$height : 0) + ((_this$list$topPadding = (_this$list8 = this.list) === null || _this$list8 === void 0 ? void 0 : _this$list8.topPadding) != null ? _this$list$topPadding : 0) + ((_this$list$bottomPadd = (_this$list9 = this.list) === null || _this$list9 === void 0 ? void 0 : _this$list9.bottomPadding) != null ? _this$list$bottomPadd : 0);
3796
+ var _this$list7, _this$list8, _this$list9;
3797
+ return (((_this$list7 = this.list) === null || _this$list7 === void 0 ? void 0 : _this$list7.height) ?? 0) + (((_this$list8 = this.list) === null || _this$list8 === void 0 ? void 0 : _this$list8.topPadding) ?? 0) + (((_this$list9 = this.list) === null || _this$list9 === void 0 ? void 0 : _this$list9.bottomPadding) ?? 0);
3825
3798
  }
3826
3799
  get listWidth() {
3827
- var _this$list$width, _this$list0, _this$list$leftPaddin, _this$list1, _this$list$rightPaddi, _this$list10;
3828
- return ((_this$list$width = (_this$list0 = this.list) === null || _this$list0 === void 0 ? void 0 : _this$list0.width) != null ? _this$list$width : 0) + ((_this$list$leftPaddin = (_this$list1 = this.list) === null || _this$list1 === void 0 ? void 0 : _this$list1.leftPadding) != null ? _this$list$leftPaddin : 0) + ((_this$list$rightPaddi = (_this$list10 = this.list) === null || _this$list10 === void 0 ? void 0 : _this$list10.rightPadding) != null ? _this$list$rightPaddi : 0);
3800
+ var _this$list0, _this$list1, _this$list10;
3801
+ return (((_this$list0 = this.list) === null || _this$list0 === void 0 ? void 0 : _this$list0.width) ?? 0) + (((_this$list1 = this.list) === null || _this$list1 === void 0 ? void 0 : _this$list1.leftPadding) ?? 0) + (((_this$list10 = this.list) === null || _this$list10 === void 0 ? void 0 : _this$list10.rightPadding) ?? 0);
3829
3802
  }
3830
3803
  resize(force = false) {
3831
3804
  if (!this.hasBounds) return;
3832
3805
  this.renderAllItems();
3833
3806
  if (this.borderMask && (force || this._dimensionChanged || this.lastWidth !== this.listWidth || this.lastHeight !== this.listHeight)) {
3834
- var _this$borderMask, _this$options$radius, _this$background3, _this$options$radius2;
3807
+ var _this$borderMask, _this$background3;
3835
3808
  if (!this.options.width) {
3836
3809
  this._width += this.listWidth;
3837
3810
  }
3838
3811
  if (!this.options.height) {
3839
3812
  this._height += this.listHeight;
3840
3813
  }
3841
- (_this$borderMask = this.borderMask) === null || _this$borderMask === void 0 ? void 0 : _this$borderMask.clear().roundRect(0, 0, this._width, this._height, ((_this$options$radius = this.options.radius) != null ? _this$options$radius : 0) | 0).fill(16711935).stroke(0);
3814
+ (_this$borderMask = this.borderMask) === null || _this$borderMask === void 0 ? void 0 : _this$borderMask.clear().roundRect(0, 0, this._width, this._height, (this.options.radius ?? 0) | 0).fill(16711935).stroke(0);
3842
3815
  if (this.borderMask) this.borderMask.eventMode = "none";
3843
3816
  const color = this.options.background;
3844
- (_this$background3 = this.background) === null || _this$background3 === void 0 ? void 0 : _this$background3.clear().roundRect(0, 0, this._width, this._height, ((_this$options$radius2 = this.options.radius) != null ? _this$options$radius2 : 0) | 0).fill({
3845
- color: color != null ? color : 0,
3817
+ (_this$background3 = this.background) === null || _this$background3 === void 0 ? void 0 : _this$background3.clear().roundRect(0, 0, this._width, this._height, (this.options.radius ?? 0) | 0).fill({
3818
+ color: color ?? 0,
3846
3819
  alpha: color ? 1 : 1e-7
3847
3820
  });
3848
3821
  if (this.isBidirectional) {
@@ -3856,9 +3829,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3856
3829
  this.lastHeight = this.listHeight;
3857
3830
  }
3858
3831
  if (this._trackpad && this.borderMask) {
3859
- var _this$list$width2, _this$list11, _this$list$leftPaddin2, _this$list12, _this$list$rightPaddi2, _this$list13, _this$list$height2, _this$list14, _this$list$topPadding2, _this$list15, _this$list$bottomPadd2, _this$list16;
3860
- const maxWidth = this.borderMask.width - ((_this$list$width2 = (_this$list11 = this.list) === null || _this$list11 === void 0 ? void 0 : _this$list11.width) != null ? _this$list$width2 : 0) - ((_this$list$leftPaddin2 = (_this$list12 = this.list) === null || _this$list12 === void 0 ? void 0 : _this$list12.leftPadding) != null ? _this$list$leftPaddin2 : 0) - ((_this$list$rightPaddi2 = (_this$list13 = this.list) === null || _this$list13 === void 0 ? void 0 : _this$list13.rightPadding) != null ? _this$list$rightPaddi2 : 0);
3861
- const maxHeight = this.borderMask.height - ((_this$list$height2 = (_this$list14 = this.list) === null || _this$list14 === void 0 ? void 0 : _this$list14.height) != null ? _this$list$height2 : 0) - ((_this$list$topPadding2 = (_this$list15 = this.list) === null || _this$list15 === void 0 ? void 0 : _this$list15.topPadding) != null ? _this$list$topPadding2 : 0) - ((_this$list$bottomPadd2 = (_this$list16 = this.list) === null || _this$list16 === void 0 ? void 0 : _this$list16.bottomPadding) != null ? _this$list$bottomPadd2 : 0);
3832
+ var _this$list11, _this$list12, _this$list13, _this$list14, _this$list15, _this$list16;
3833
+ const maxWidth = this.borderMask.width - (((_this$list11 = this.list) === null || _this$list11 === void 0 ? void 0 : _this$list11.width) ?? 0) - (((_this$list12 = this.list) === null || _this$list12 === void 0 ? void 0 : _this$list12.leftPadding) ?? 0) - (((_this$list13 = this.list) === null || _this$list13 === void 0 ? void 0 : _this$list13.rightPadding) ?? 0);
3834
+ const maxHeight = this.borderMask.height - (((_this$list14 = this.list) === null || _this$list14 === void 0 ? void 0 : _this$list14.height) ?? 0) - (((_this$list15 = this.list) === null || _this$list15 === void 0 ? void 0 : _this$list15.topPadding) ?? 0) - (((_this$list16 = this.list) === null || _this$list16 === void 0 ? void 0 : _this$list16.bottomPadding) ?? 0);
3862
3835
  if (this.isBidirectional) {
3863
3836
  this._trackpad.yAxis.max = -Math.abs(maxHeight);
3864
3837
  this._trackpad.xAxis.max = -Math.abs(maxWidth);
@@ -3888,9 +3861,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3888
3861
  const scrollOnX = shiftScroll ? typeof event.deltaX !== "undefined" || typeof event.deltaY !== "undefined" : typeof event.deltaX !== "undefined";
3889
3862
  const scrollOnY = typeof event.deltaY !== "undefined";
3890
3863
  if ((this.isHorizontal || this.isBidirectional) && scrollOnX) {
3891
- var _this$list$x, _this$list19;
3864
+ var _this$list19;
3892
3865
  const delta = shiftScroll || this.isBidirectional ? event.deltaX : event.deltaY;
3893
- const targetPos = ((_this$list$x = (_this$list19 = this.list) === null || _this$list19 === void 0 ? void 0 : _this$list19.x) != null ? _this$list$x : 0) - delta;
3866
+ const targetPos = (((_this$list19 = this.list) === null || _this$list19 === void 0 ? void 0 : _this$list19.x) ?? 0) - delta;
3894
3867
  if (this.listWidth < this._width) {
3895
3868
  this._trackpad && (this._trackpad.xAxis.value = 0);
3896
3869
  } else {
@@ -3900,8 +3873,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3900
3873
  }
3901
3874
  }
3902
3875
  if ((this.isVertical || this.isBidirectional) && scrollOnY) {
3903
- var _this$list$y, _this$list20;
3904
- const targetPos = ((_this$list$y = (_this$list20 = this.list) === null || _this$list20 === void 0 ? void 0 : _this$list20.y) != null ? _this$list$y : 0) - event.deltaY;
3876
+ var _this$list20;
3877
+ const targetPos = (((_this$list20 = this.list) === null || _this$list20 === void 0 ? void 0 : _this$list20.y) ?? 0) - event.deltaY;
3905
3878
  if (this.listHeight < this._height) {
3906
3879
  this._trackpad && (this._trackpad.yAxis.value = 0);
3907
3880
  } else {
@@ -3911,17 +3884,17 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3911
3884
  }
3912
3885
  }
3913
3886
  if (this.isBidirectional && (scrollOnX || scrollOnY)) {
3914
- var _this$onScroll3, _this$_trackpad$xAxis, _this$_trackpad4, _this$_trackpad$yAxis, _this$_trackpad5;
3887
+ var _this$onScroll3, _this$_trackpad4, _this$_trackpad5;
3915
3888
  (_this$onScroll3 = this.onScroll) === null || _this$onScroll3 === void 0 ? void 0 : _this$onScroll3.emit({
3916
- x: (_this$_trackpad$xAxis = (_this$_trackpad4 = this._trackpad) === null || _this$_trackpad4 === void 0 ? void 0 : _this$_trackpad4.xAxis.value) != null ? _this$_trackpad$xAxis : 0,
3917
- y: (_this$_trackpad$yAxis = (_this$_trackpad5 = this._trackpad) === null || _this$_trackpad5 === void 0 ? void 0 : _this$_trackpad5.yAxis.value) != null ? _this$_trackpad$yAxis : 0
3889
+ x: ((_this$_trackpad4 = this._trackpad) === null || _this$_trackpad4 === void 0 ? void 0 : _this$_trackpad4.xAxis.value) ?? 0,
3890
+ y: ((_this$_trackpad5 = this._trackpad) === null || _this$_trackpad5 === void 0 ? void 0 : _this$_trackpad5.yAxis.value) ?? 0
3918
3891
  });
3919
3892
  } else if (this.isHorizontal && scrollOnX) {
3920
- var _this$onScroll4, _this$_trackpad$xAxis2, _this$_trackpad6;
3921
- (_this$onScroll4 = this.onScroll) === null || _this$onScroll4 === void 0 ? void 0 : _this$onScroll4.emit((_this$_trackpad$xAxis2 = (_this$_trackpad6 = this._trackpad) === null || _this$_trackpad6 === void 0 ? void 0 : _this$_trackpad6.xAxis.value) != null ? _this$_trackpad$xAxis2 : 0);
3893
+ var _this$onScroll4, _this$_trackpad6;
3894
+ (_this$onScroll4 = this.onScroll) === null || _this$onScroll4 === void 0 ? void 0 : _this$onScroll4.emit(((_this$_trackpad6 = this._trackpad) === null || _this$_trackpad6 === void 0 ? void 0 : _this$_trackpad6.xAxis.value) ?? 0);
3922
3895
  } else if (this.isVertical && scrollOnY) {
3923
- var _this$onScroll5, _this$_trackpad$yAxis2, _this$_trackpad7;
3924
- (_this$onScroll5 = this.onScroll) === null || _this$onScroll5 === void 0 ? void 0 : _this$onScroll5.emit((_this$_trackpad$yAxis2 = (_this$_trackpad7 = this._trackpad) === null || _this$_trackpad7 === void 0 ? void 0 : _this$_trackpad7.yAxis.value) != null ? _this$_trackpad$yAxis2 : 0);
3896
+ var _this$onScroll5, _this$_trackpad7;
3897
+ (_this$onScroll5 = this.onScroll) === null || _this$onScroll5 === void 0 ? void 0 : _this$onScroll5.emit(((_this$_trackpad7 = this._trackpad) === null || _this$_trackpad7 === void 0 ? void 0 : _this$_trackpad7.yAxis.value) ?? 0);
3925
3898
  }
3926
3899
  this.stopRenderHiddenItems();
3927
3900
  }
@@ -3929,8 +3902,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
3929
3902
  if (!this.interactive) {
3930
3903
  this.scrollTop();
3931
3904
  } else {
3932
- var _this$list$children$l, _this$list21;
3933
- this.scrollTo(((_this$list$children$l = (_this$list21 = this.list) === null || _this$list21 === void 0 ? void 0 : _this$list21.children.length) != null ? _this$list$children$l : 1) - 1);
3905
+ var _this$list21;
3906
+ this.scrollTo((((_this$list21 = this.list) === null || _this$list21 === void 0 ? void 0 : _this$list21.children.length) ?? 1) - 1);
3934
3907
  }
3935
3908
  }
3936
3909
  scrollTop() {
@@ -4011,11 +3984,10 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4011
3984
  }
4012
3985
  setSize(value, height) {
4013
3986
  if (typeof value === "object") {
4014
- var _value$height;
4015
- height = (_value$height = value.height) != null ? _value$height : value.width;
3987
+ height = value.height ?? value.width;
4016
3988
  value = value.width;
4017
3989
  } else {
4018
- height = height != null ? height : value;
3990
+ height = height ?? value;
4019
3991
  }
4020
3992
  this._width = value;
4021
3993
  this._height = height;
@@ -4033,15 +4005,15 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4033
4005
  return out;
4034
4006
  }
4035
4007
  get scrollX() {
4036
- var _this$_trackpad$xAxis3, _this$_trackpad8;
4037
- return (_this$_trackpad$xAxis3 = (_this$_trackpad8 = this._trackpad) === null || _this$_trackpad8 === void 0 ? void 0 : _this$_trackpad8.xAxis.value) != null ? _this$_trackpad$xAxis3 : 0;
4008
+ var _this$_trackpad8;
4009
+ return ((_this$_trackpad8 = this._trackpad) === null || _this$_trackpad8 === void 0 ? void 0 : _this$_trackpad8.xAxis.value) ?? 0;
4038
4010
  }
4039
4011
  set scrollX(value) {
4040
4012
  if (this._trackpad) this._trackpad.xAxis.value = value;
4041
4013
  }
4042
4014
  get scrollY() {
4043
- var _this$_trackpad$yAxis3, _this$_trackpad9;
4044
- return (_this$_trackpad$yAxis3 = (_this$_trackpad9 = this._trackpad) === null || _this$_trackpad9 === void 0 ? void 0 : _this$_trackpad9.yAxis.value) != null ? _this$_trackpad$yAxis3 : 0;
4015
+ var _this$_trackpad9;
4016
+ return ((_this$_trackpad9 = this._trackpad) === null || _this$_trackpad9 === void 0 ? void 0 : _this$_trackpad9.yAxis.value) ?? 0;
4045
4017
  }
4046
4018
  set scrollY(value) {
4047
4019
  if (this._trackpad) this._trackpad.yAxis.value = value;
@@ -4060,9 +4032,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4060
4032
  }
4061
4033
  }
4062
4034
  if (!this.options.disableProximityCheck && (this._trackpad.x !== this.lastScrollX || this._trackpad.y !== this.lastScrollY)) {
4063
- var _this$options$proximi;
4064
4035
  this.proximityCheckFrameCounter++;
4065
- if (this.proximityCheckFrameCounter >= ((_this$options$proximi = this.options.proximityDebounce) != null ? _this$options$proximi : 10)) {
4036
+ if (this.proximityCheckFrameCounter >= (this.options.proximityDebounce ?? 10)) {
4066
4037
  this.items.forEach((item, index) => {
4067
4038
  const inRange = this.isItemVisible(item, this.proximityRange);
4068
4039
  const wasInRange = this.proximityStatusCache[index];
@@ -4097,7 +4068,6 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4097
4068
  }
4098
4069
  revertClick(item) {
4099
4070
  if (item.eventMode !== "auto") {
4100
- var _item$eventMode;
4101
4071
  if (pixi_js.isMobile.any) {
4102
4072
  item.emit("pointerupoutside", {
4103
4073
  target: item
@@ -4109,7 +4079,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4109
4079
  }
4110
4080
  this.interactiveStorage.push({
4111
4081
  item,
4112
- eventMode: (_item$eventMode = item.eventMode) != null ? _item$eventMode : "auto"
4082
+ eventMode: item.eventMode ?? "auto"
4113
4083
  });
4114
4084
  item.eventMode = "auto";
4115
4085
  }
@@ -4118,16 +4088,15 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4118
4088
  }
4119
4089
  }
4120
4090
  get scrollHeight() {
4121
- var _this$list$height3, _this$list23;
4122
- return (_this$list$height3 = (_this$list23 = this.list) === null || _this$list23 === void 0 ? void 0 : _this$list23.height) != null ? _this$list$height3 : 0;
4091
+ var _this$list23;
4092
+ return ((_this$list23 = this.list) === null || _this$list23 === void 0 ? void 0 : _this$list23.height) ?? 0;
4123
4093
  }
4124
4094
  get scrollWidth() {
4125
- var _this$list$width3, _this$list24;
4126
- return (_this$list$width3 = (_this$list24 = this.list) === null || _this$list24 === void 0 ? void 0 : _this$list24.width) != null ? _this$list$width3 : 0;
4095
+ var _this$list24;
4096
+ return ((_this$list24 = this.list) === null || _this$list24 === void 0 ? void 0 : _this$list24.width) ?? 0;
4127
4097
  }
4128
4098
  get isVertical() {
4129
- var _this$options$type;
4130
- const type = (_this$options$type = this.options.type) != null ? _this$options$type : "vertical";
4099
+ const type = this.options.type ?? "vertical";
4131
4100
  return type === "vertical";
4132
4101
  }
4133
4102
  get isHorizontal() {
@@ -4203,16 +4172,15 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4203
4172
  pixi_js.Ticker.shared.add(() => Group.shared.update());
4204
4173
  }
4205
4174
  get dialogWidth() {
4206
- var _ref15, _this$options$width2, _this$innerView2;
4207
- return (_ref15 = (_this$options$width2 = this.options.width) != null ? _this$options$width2 : (_this$innerView2 = this.innerView) === null || _this$innerView2 === void 0 ? void 0 : _this$innerView2.width) != null ? _ref15 : 0;
4175
+ var _this$innerView2;
4176
+ return this.options.width ?? ((_this$innerView2 = this.innerView) === null || _this$innerView2 === void 0 ? void 0 : _this$innerView2.width) ?? 0;
4208
4177
  }
4209
4178
  get dialogHeight() {
4210
- var _ref16, _this$options$height2, _this$innerView3;
4211
- return (_ref16 = (_this$options$height2 = this.options.height) != null ? _this$options$height2 : (_this$innerView3 = this.innerView) === null || _this$innerView3 === void 0 ? void 0 : _this$innerView3.height) != null ? _ref16 : 0;
4179
+ var _this$innerView3;
4180
+ return this.options.height ?? ((_this$innerView3 = this.innerView) === null || _this$innerView3 === void 0 ? void 0 : _this$innerView3.height) ?? 0;
4212
4181
  }
4213
4182
  get dialogPadding() {
4214
- var _this$options$padding2;
4215
- return (_this$options$padding2 = this.options.padding) != null ? _this$options$padding2 : 20;
4183
+ return this.options.padding ?? 20;
4216
4184
  }
4217
4185
  get isOpen() {
4218
4186
  return this._isOpen;
@@ -4221,10 +4189,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4221
4189
  if (this.options.backdrop) {
4222
4190
  this.backdrop = getView(this.options.backdrop);
4223
4191
  } else {
4224
- var _this$options$backdro, _this$options$backdro2;
4225
4192
  const backdropSprite = new pixi_js.Sprite(pixi_js.Texture.WHITE);
4226
- backdropSprite.tint = (_this$options$backdro = this.options.backdropColor) != null ? _this$options$backdro : 0;
4227
- backdropSprite.alpha = (_this$options$backdro2 = this.options.backdropAlpha) != null ? _this$options$backdro2 : 0.5;
4193
+ backdropSprite.tint = this.options.backdropColor ?? 0;
4194
+ backdropSprite.alpha = this.options.backdropAlpha ?? 0.5;
4228
4195
  backdropSprite.width = 1e4;
4229
4196
  backdropSprite.height = 1e4;
4230
4197
  this.backdrop = backdropSprite;
@@ -4330,16 +4297,14 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4330
4297
  break;
4331
4298
  case btn instanceof FancyButton$1:
4332
4299
  btn.onPress.connect(() => {
4333
- var _btn$text;
4334
- this.onSelect.emit(index, (_btn$text = btn.text) != null ? _btn$text : "");
4300
+ this.onSelect.emit(index, btn.text ?? "");
4335
4301
  });
4336
4302
  this.buttonContainer.addChild(btn);
4337
4303
  break;
4338
4304
  default:
4339
4305
  button = new FancyButton$1(btn);
4340
4306
  button.onPress.connect(() => {
4341
- var _button$text;
4342
- this.onSelect.emit(index, (_button$text = button.text) != null ? _button$text : "");
4307
+ this.onSelect.emit(index, button.text ?? "");
4343
4308
  });
4344
4309
  this.buttonContainer.addChild(button);
4345
4310
  break;
@@ -4350,22 +4315,21 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4350
4315
  this.contentView.addChild(this.buttonContainer);
4351
4316
  }
4352
4317
  open() {
4353
- var _this$options$animati, _openAnimation$durati, _this$options$backdro4;
4318
+ var _this$options$animati;
4354
4319
  if (!this.innerView) return;
4355
4320
  this.visible = true;
4356
4321
  this._isOpen = true;
4357
4322
  const openAnimation = (_this$options$animati = this.options.animations) === null || _this$options$animati === void 0 ? void 0 : _this$options$animati.open;
4358
4323
  if (!openAnimation) {
4359
- var _this$options$backdro3;
4360
- this.backdrop.alpha = (_this$options$backdro3 = this.options.backdropAlpha) != null ? _this$options$backdro3 : 0.5;
4324
+ this.backdrop.alpha = this.options.backdropAlpha ?? 0.5;
4361
4325
  this.innerView.scale.set(1);
4362
4326
  return;
4363
4327
  }
4364
4328
  this.backdrop.alpha = 0;
4365
4329
  this.innerView.scale.set(0.8);
4366
- const duration = (_openAnimation$durati = openAnimation.duration) != null ? _openAnimation$durati : 300;
4330
+ const duration = openAnimation.duration ?? 300;
4367
4331
  new Tween(this.backdrop).to({
4368
- alpha: (_this$options$backdro4 = this.options.backdropAlpha) != null ? _this$options$backdro4 : 0.5
4332
+ alpha: this.options.backdropAlpha ?? 0.5
4369
4333
  }, duration).start();
4370
4334
  new Tween(this.innerView.scale).to({
4371
4335
  x: 1,
@@ -4373,7 +4337,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4373
4337
  }, duration).start();
4374
4338
  }
4375
4339
  close() {
4376
- var _this$options$animati2, _closeAnimation$durat;
4340
+ var _this$options$animati2;
4377
4341
  if (!this.innerView) return;
4378
4342
  const closeAnimation = (_this$options$animati2 = this.options.animations) === null || _this$options$animati2 === void 0 ? void 0 : _this$options$animati2.close;
4379
4343
  if (!closeAnimation) {
@@ -4382,7 +4346,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4382
4346
  this.onClose.emit();
4383
4347
  return;
4384
4348
  }
4385
- const duration = (_closeAnimation$durat = closeAnimation.duration) != null ? _closeAnimation$durat : 300;
4349
+ const duration = closeAnimation.duration ?? 300;
4386
4350
  new Tween(this.backdrop).to({
4387
4351
  alpha: 0
4388
4352
  }, duration).start();
@@ -4444,7 +4408,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4444
4408
  }) {
4445
4409
  this.setBackground(bg);
4446
4410
  this.setFill(fill, fillPaddings);
4447
- this.progress = progress != null ? progress : 0;
4411
+ this.progress = progress ?? 0;
4448
4412
  }
4449
4413
  setBackground(bg) {
4450
4414
  var _this$options16;
@@ -4479,7 +4443,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4479
4443
  this.innerView.addChildAt(this.bg, 0);
4480
4444
  }
4481
4445
  setFill(fill, fillPadding) {
4482
- var _this$options17, _fillPadding$left, _fillPadding$top;
4446
+ var _this$options17;
4483
4447
  if (this.fill) {
4484
4448
  this.fill.destroy();
4485
4449
  }
@@ -4505,8 +4469,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4505
4469
  this.fill = getView(fill);
4506
4470
  }
4507
4471
  this.innerView.addChildAt(this.fill, 1);
4508
- const offsetX = (_fillPadding$left = fillPadding === null || fillPadding === void 0 ? void 0 : fillPadding.left) != null ? _fillPadding$left : 0;
4509
- const offsetY = (_fillPadding$top = fillPadding === null || fillPadding === void 0 ? void 0 : fillPadding.top) != null ? _fillPadding$top : 0;
4472
+ const offsetX = (fillPadding === null || fillPadding === void 0 ? void 0 : fillPadding.left) ?? 0;
4473
+ const offsetY = (fillPadding === null || fillPadding === void 0 ? void 0 : fillPadding.top) ?? 0;
4510
4474
  this.fill.x = offsetX;
4511
4475
  this.fill.y = offsetY;
4512
4476
  if (this.fillMask) {
@@ -4563,9 +4527,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4563
4527
  this.bg.width = width;
4564
4528
  }
4565
4529
  if (this.fill) {
4566
- var _this$options$fillPad, _this$options$fillPad2, _this$options$fillPad3, _this$options$fillPad4;
4567
- const leftPadding = (_this$options$fillPad = (_this$options$fillPad2 = this.options.fillPaddings) === null || _this$options$fillPad2 === void 0 ? void 0 : _this$options$fillPad2.left) != null ? _this$options$fillPad : 0;
4568
- const rightPadding = (_this$options$fillPad3 = (_this$options$fillPad4 = this.options.fillPaddings) === null || _this$options$fillPad4 === void 0 ? void 0 : _this$options$fillPad4.right) != null ? _this$options$fillPad3 : 0;
4530
+ var _this$options$fillPad, _this$options$fillPad2;
4531
+ const leftPadding = ((_this$options$fillPad = this.options.fillPaddings) === null || _this$options$fillPad === void 0 ? void 0 : _this$options$fillPad.left) ?? 0;
4532
+ const rightPadding = ((_this$options$fillPad2 = this.options.fillPaddings) === null || _this$options$fillPad2 === void 0 ? void 0 : _this$options$fillPad2.right) ?? 0;
4569
4533
  this.fill.width = width - leftPadding - rightPadding;
4570
4534
  this.fillMask.width = width - leftPadding - rightPadding;
4571
4535
  }
@@ -4584,9 +4548,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4584
4548
  this.bg.height = height;
4585
4549
  }
4586
4550
  if (this.fill) {
4587
- var _this$options$fillPad5, _this$options$fillPad6, _this$options$fillPad7, _this$options$fillPad8;
4588
- const topPadding = (_this$options$fillPad5 = (_this$options$fillPad6 = this.options.fillPaddings) === null || _this$options$fillPad6 === void 0 ? void 0 : _this$options$fillPad6.top) != null ? _this$options$fillPad5 : 0;
4589
- const bottomPadding = (_this$options$fillPad7 = (_this$options$fillPad8 = this.options.fillPaddings) === null || _this$options$fillPad8 === void 0 ? void 0 : _this$options$fillPad8.bottom) != null ? _this$options$fillPad7 : 0;
4551
+ var _this$options$fillPad3, _this$options$fillPad4;
4552
+ const topPadding = ((_this$options$fillPad3 = this.options.fillPaddings) === null || _this$options$fillPad3 === void 0 ? void 0 : _this$options$fillPad3.top) ?? 0;
4553
+ const bottomPadding = ((_this$options$fillPad4 = this.options.fillPaddings) === null || _this$options$fillPad4 === void 0 ? void 0 : _this$options$fillPad4.bottom) ?? 0;
4590
4554
  this.fill.height = height - topPadding - bottomPadding;
4591
4555
  this.fillMask.height = height - topPadding - bottomPadding;
4592
4556
  }
@@ -4605,18 +4569,17 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4605
4569
  this.bg.setSize(value, height);
4606
4570
  }
4607
4571
  if (this.fill) {
4608
- var _this$options$fillPad9, _this$options$fillPad0, _this$options$fillPad1, _this$options$fillPad10, _this$options$fillPad11, _this$options$fillPad12, _this$options$fillPad13, _this$options$fillPad14;
4572
+ var _this$options$fillPad5, _this$options$fillPad6, _this$options$fillPad7, _this$options$fillPad8;
4609
4573
  if (typeof value === "object") {
4610
- var _value$height2;
4611
- height = (_value$height2 = value.height) != null ? _value$height2 : value.width;
4574
+ height = value.height ?? value.width;
4612
4575
  value = value.width;
4613
4576
  } else {
4614
- height = height != null ? height : value;
4577
+ height = height ?? value;
4615
4578
  }
4616
- const topPadding = (_this$options$fillPad9 = (_this$options$fillPad0 = this.options.fillPaddings) === null || _this$options$fillPad0 === void 0 ? void 0 : _this$options$fillPad0.top) != null ? _this$options$fillPad9 : 0;
4617
- const bottomPadding = (_this$options$fillPad1 = (_this$options$fillPad10 = this.options.fillPaddings) === null || _this$options$fillPad10 === void 0 ? void 0 : _this$options$fillPad10.bottom) != null ? _this$options$fillPad1 : 0;
4618
- const leftPadding = (_this$options$fillPad11 = (_this$options$fillPad12 = this.options.fillPaddings) === null || _this$options$fillPad12 === void 0 ? void 0 : _this$options$fillPad12.left) != null ? _this$options$fillPad11 : 0;
4619
- const rightPadding = (_this$options$fillPad13 = (_this$options$fillPad14 = this.options.fillPaddings) === null || _this$options$fillPad14 === void 0 ? void 0 : _this$options$fillPad14.right) != null ? _this$options$fillPad13 : 0;
4579
+ const topPadding = ((_this$options$fillPad5 = this.options.fillPaddings) === null || _this$options$fillPad5 === void 0 ? void 0 : _this$options$fillPad5.top) ?? 0;
4580
+ const bottomPadding = ((_this$options$fillPad6 = this.options.fillPaddings) === null || _this$options$fillPad6 === void 0 ? void 0 : _this$options$fillPad6.bottom) ?? 0;
4581
+ const leftPadding = ((_this$options$fillPad7 = this.options.fillPaddings) === null || _this$options$fillPad7 === void 0 ? void 0 : _this$options$fillPad7.left) ?? 0;
4582
+ const rightPadding = ((_this$options$fillPad8 = this.options.fillPaddings) === null || _this$options$fillPad8 === void 0 ? void 0 : _this$options$fillPad8.right) ?? 0;
4620
4583
  this.fill.setSize(value - leftPadding - rightPadding, height - topPadding - bottomPadding);
4621
4584
  this.fillMask.setSize(value - leftPadding - rightPadding, height - topPadding - bottomPadding);
4622
4585
  }
@@ -4636,7 +4599,6 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4636
4599
  var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
4637
4600
  class SliderBase extends ProgressBar$1 {
4638
4601
  constructor(options) {
4639
- var _options$min, _options$max2;
4640
4602
  super(options);
4641
4603
  __publicField$6(this, "_slider1");
4642
4604
  __publicField$6(this, "_slider2");
@@ -4659,8 +4621,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4659
4621
  if (options.slider2) {
4660
4622
  this.slider2 = options.slider2;
4661
4623
  }
4662
- this.min = (_options$min = options.min) != null ? _options$min : 0;
4663
- this.max = (_options$max2 = options.max) != null ? _options$max2 : 100;
4624
+ this.min = options.min ?? 0;
4625
+ this.max = options.max ?? 100;
4664
4626
  }
4665
4627
  init(progressBarOptions) {
4666
4628
  super.init(progressBarOptions);
@@ -4676,8 +4638,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4676
4638
  }
4677
4639
  this._slider1 = this.createSlider(value);
4678
4640
  if (this.settings.showValue && !this.value1Text) {
4679
- var _this$settings$valueT;
4680
- const TextClass = (_this$settings$valueT = this.settings.valueTextClass) != null ? _this$settings$valueT : pixi_js.Text;
4641
+ const TextClass = this.settings.valueTextClass ?? pixi_js.Text;
4681
4642
  this.value1Text = new TextClass({
4682
4643
  text: "",
4683
4644
  style: this.settings.valueTextStyle || {
@@ -4699,8 +4660,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4699
4660
  }
4700
4661
  this._slider2 = this.createSlider(value);
4701
4662
  if (this.settings.showValue && !this.value2Text) {
4702
- var _this$settings$valueT2;
4703
- const TextClass = (_this$settings$valueT2 = this.settings.valueTextClass) != null ? _this$settings$valueT2 : pixi_js.Text;
4663
+ const TextClass = this.settings.valueTextClass ?? pixi_js.Text;
4704
4664
  this.value2Text = new TextClass({
4705
4665
  text: "",
4706
4666
  style: this.settings.valueTextStyle || {
@@ -4820,25 +4780,24 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4820
4780
  value2
4821
4781
  } = this.sliderOptions;
4822
4782
  this.updateProgress(value1, value2);
4823
- this.value2 = value2 != null ? value2 : 0;
4824
- this.value1 = value1 != null ? value1 : 0;
4783
+ this.value2 = value2 ?? 0;
4784
+ this.value1 = value1 ?? 0;
4825
4785
  }
4826
4786
  updateProgress(value1 = this.value1, value2 = this.value2) {
4827
4787
  this.progressStart = (value1 - this.min) / (this.max - this.min) * 100;
4828
4788
  this.progress = (value2 - this.min) / (this.max - this.min) * 100;
4829
4789
  }
4830
4790
  validateValues() {
4831
- var _this$sliderOptions$m, _this$sliderOptions$m2, _this$sliderOptions$v, _this$sliderOptions$v2;
4832
- const min = (_this$sliderOptions$m = this.sliderOptions.min) != null ? _this$sliderOptions$m : this.min;
4833
- const max = (_this$sliderOptions$m2 = this.sliderOptions.max) != null ? _this$sliderOptions$m2 : this.max;
4791
+ const min = this.sliderOptions.min ?? this.min;
4792
+ const max = this.sliderOptions.max ?? this.max;
4834
4793
  if (!this.sliderOptions.value1) {
4835
4794
  this.sliderOptions.value1 = min;
4836
4795
  }
4837
4796
  if (!this.sliderOptions.value2) {
4838
4797
  this.sliderOptions.value2 = max;
4839
4798
  }
4840
- let value1 = (_this$sliderOptions$v = this.sliderOptions.value1) != null ? _this$sliderOptions$v : min;
4841
- let value2 = (_this$sliderOptions$v2 = this.sliderOptions.value2) != null ? _this$sliderOptions$v2 : max;
4799
+ let value1 = this.sliderOptions.value1 ?? min;
4800
+ let value2 = this.sliderOptions.value2 ?? max;
4842
4801
  if (value2 < value1) {
4843
4802
  value2 = value1;
4844
4803
  }
@@ -4931,39 +4890,39 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
4931
4890
  return this._slider2;
4932
4891
  }
4933
4892
  updateSlider1() {
4934
- var _this$bg$width, _this$bg4, _this$bg$height, _this$bg5, _this$sliderOptions;
4893
+ var _this$bg4, _this$bg5, _this$sliderOptions;
4935
4894
  if (!this._slider1) return;
4936
4895
  this.updateProgress(this.value1, this.value2);
4937
- this._slider1.x = ((_this$bg$width = (_this$bg4 = this.bg) === null || _this$bg4 === void 0 ? void 0 : _this$bg4.width) != null ? _this$bg$width : 0) / 100 * this.progressStart - this._slider1.width / 2;
4938
- this._slider1.y = ((_this$bg$height = (_this$bg5 = this.bg) === null || _this$bg5 === void 0 ? void 0 : _this$bg5.height) != null ? _this$bg$height : 0) / 2;
4896
+ this._slider1.x = (((_this$bg4 = this.bg) === null || _this$bg4 === void 0 ? void 0 : _this$bg4.width) ?? 0) / 100 * this.progressStart - this._slider1.width / 2;
4897
+ this._slider1.y = (((_this$bg5 = this.bg) === null || _this$bg5 === void 0 ? void 0 : _this$bg5.height) ?? 0) / 2;
4939
4898
  if (this._slider2 && this._slider1.x > this._slider2.x) {
4940
4899
  this._slider1.x = this._slider2.x;
4941
4900
  }
4942
4901
  if ((_this$sliderOptions = this.sliderOptions) !== null && _this$sliderOptions !== void 0 && _this$sliderOptions.showValue && this.value1Text && this._slider1) {
4943
- var _this$sliderOptions$v3, _this$sliderOptions$v4, _this$sliderOptions$v5, _this$sliderOptions$v6;
4902
+ var _this$sliderOptions$v, _this$sliderOptions$v2;
4944
4903
  this.value1Text.text = `${Math.round(this.value1)}`;
4945
4904
  const sliderPosX = this._slider1.x + this._slider1.width / 2;
4946
4905
  const sliderPosY = this._slider1.y;
4947
- this.value1Text.x = sliderPosX + ((_this$sliderOptions$v3 = (_this$sliderOptions$v4 = this.sliderOptions.valueTextOffset) === null || _this$sliderOptions$v4 === void 0 ? void 0 : _this$sliderOptions$v4.x) != null ? _this$sliderOptions$v3 : 0);
4948
- this.value1Text.y = sliderPosY + ((_this$sliderOptions$v5 = (_this$sliderOptions$v6 = this.sliderOptions.valueTextOffset) === null || _this$sliderOptions$v6 === void 0 ? void 0 : _this$sliderOptions$v6.y) != null ? _this$sliderOptions$v5 : 0);
4906
+ this.value1Text.x = sliderPosX + (((_this$sliderOptions$v = this.sliderOptions.valueTextOffset) === null || _this$sliderOptions$v === void 0 ? void 0 : _this$sliderOptions$v.x) ?? 0);
4907
+ this.value1Text.y = sliderPosY + (((_this$sliderOptions$v2 = this.sliderOptions.valueTextOffset) === null || _this$sliderOptions$v2 === void 0 ? void 0 : _this$sliderOptions$v2.y) ?? 0);
4949
4908
  }
4950
4909
  }
4951
4910
  updateSlider2() {
4952
- var _this$bg$width2, _this$bg6, _this$bg$height2, _this$bg7, _this$sliderOptions2;
4911
+ var _this$bg6, _this$bg7, _this$sliderOptions2;
4953
4912
  if (!this._slider2) return;
4954
4913
  this.updateProgress(this.value1, this.value2);
4955
- this._slider2.x = ((_this$bg$width2 = (_this$bg6 = this.bg) === null || _this$bg6 === void 0 ? void 0 : _this$bg6.width) != null ? _this$bg$width2 : 0) / 100 * this.progress - this._slider2.width / 2;
4956
- this._slider2.y = ((_this$bg$height2 = (_this$bg7 = this.bg) === null || _this$bg7 === void 0 ? void 0 : _this$bg7.height) != null ? _this$bg$height2 : 0) / 2;
4914
+ this._slider2.x = (((_this$bg6 = this.bg) === null || _this$bg6 === void 0 ? void 0 : _this$bg6.width) ?? 0) / 100 * this.progress - this._slider2.width / 2;
4915
+ this._slider2.y = (((_this$bg7 = this.bg) === null || _this$bg7 === void 0 ? void 0 : _this$bg7.height) ?? 0) / 2;
4957
4916
  if (this._slider1 && this._slider2.x < this._slider1.x) {
4958
4917
  this._slider2.x = this._slider1.x;
4959
4918
  }
4960
4919
  if ((_this$sliderOptions2 = this.sliderOptions) !== null && _this$sliderOptions2 !== void 0 && _this$sliderOptions2.showValue && this.value2Text && this._slider2) {
4961
- var _this$sliderOptions$v7, _this$sliderOptions$v8, _this$sliderOptions$v9, _this$sliderOptions$v0;
4920
+ var _this$sliderOptions$v3, _this$sliderOptions$v4;
4962
4921
  this.value2Text.text = `${Math.round(this.value2)}`;
4963
4922
  const sliderPosX = this._slider2.x + this._slider2.width / 2;
4964
4923
  const sliderPosY = this._slider2.y;
4965
- this.value2Text.x = sliderPosX + ((_this$sliderOptions$v7 = (_this$sliderOptions$v8 = this.sliderOptions.valueTextOffset) === null || _this$sliderOptions$v8 === void 0 ? void 0 : _this$sliderOptions$v8.x) != null ? _this$sliderOptions$v7 : 0);
4966
- this.value2Text.y = sliderPosY + ((_this$sliderOptions$v9 = (_this$sliderOptions$v0 = this.sliderOptions.valueTextOffset) === null || _this$sliderOptions$v0 === void 0 ? void 0 : _this$sliderOptions$v0.y) != null ? _this$sliderOptions$v9 : 0);
4924
+ this.value2Text.x = sliderPosX + (((_this$sliderOptions$v3 = this.sliderOptions.valueTextOffset) === null || _this$sliderOptions$v3 === void 0 ? void 0 : _this$sliderOptions$v3.x) ?? 0);
4925
+ this.value2Text.y = sliderPosY + (((_this$sliderOptions$v4 = this.sliderOptions.valueTextOffset) === null || _this$sliderOptions$v4 === void 0 ? void 0 : _this$sliderOptions$v4.y) ?? 0);
4967
4926
  }
4968
4927
  }
4969
4928
  set width(value) {
@@ -5064,8 +5023,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5064
5023
  }
5065
5024
  }
5066
5025
  onInput(e) {
5067
- var _e$data;
5068
- this.lastInputData = (_e$data = e.data) != null ? _e$data : "";
5026
+ this.lastInputData = e.data ?? "";
5069
5027
  }
5070
5028
  onKeyUp(e) {
5071
5029
  const key = e.key;
@@ -5087,7 +5045,6 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5087
5045
  }
5088
5046
  }
5089
5047
  init() {
5090
- var _this$options$value;
5091
5048
  const {
5092
5049
  textStyle = {
5093
5050
  fill: 0,
@@ -5113,7 +5070,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5113
5070
  });
5114
5071
  this.placeholder.visible = !!placeholder;
5115
5072
  this.addChild(this.inputField, this.placeholder, this._cursor);
5116
- this.value = (_this$options$value = this.options.value) != null ? _this$options$value : "";
5073
+ this.value = this.options.value ?? "";
5117
5074
  this.align();
5118
5075
  }
5119
5076
  set bg(bg) {
@@ -5121,7 +5078,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5121
5078
  if (this._bg) {
5122
5079
  this._bg.destroy();
5123
5080
  }
5124
- const bgValue = bg != null ? bg : pixi_js.Texture.WHITE;
5081
+ const bgValue = bg ?? pixi_js.Texture.WHITE;
5125
5082
  if ((_this$options21 = this.options) !== null && _this$options21 !== void 0 && _this$options21.nineSliceSprite) {
5126
5083
  if (typeof bgValue === "string") {
5127
5084
  this._bg = new pixi_js.NineSliceSprite({
@@ -5192,7 +5149,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5192
5149
  this.align();
5193
5150
  }
5194
5151
  createInputField() {
5195
- var _this$_bg$width, _this$_bg, _this$_bg$height, _this$_bg2;
5152
+ var _this$_bg, _this$_bg2;
5196
5153
  if (this.input) {
5197
5154
  var _this$input, _this$input2;
5198
5155
  this.input.removeEventListener("blur", this.stopEditingBinding);
@@ -5209,8 +5166,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5209
5166
  input.style.left = `${this.getGlobalPosition().x}px`;
5210
5167
  input.style.top = `${this.getGlobalPosition().y}px`;
5211
5168
  input.style.opacity = "0.0000001";
5212
- input.style.width = `${(_this$_bg$width = (_this$_bg = this._bg) === null || _this$_bg === void 0 ? void 0 : _this$_bg.width) != null ? _this$_bg$width : 100}px`;
5213
- input.style.height = `${(_this$_bg$height = (_this$_bg2 = this._bg) === null || _this$_bg2 === void 0 ? void 0 : _this$_bg2.height) != null ? _this$_bg$height : 30}px`;
5169
+ input.style.width = `${((_this$_bg = this._bg) === null || _this$_bg === void 0 ? void 0 : _this$_bg.width) ?? 100}px`;
5170
+ input.style.height = `${((_this$_bg2 = this._bg) === null || _this$_bg2 === void 0 ? void 0 : _this$_bg2.height) ?? 30}px`;
5214
5171
  input.style.border = "none";
5215
5172
  input.style.outline = "none";
5216
5173
  input.style.background = "white";
@@ -5341,17 +5298,15 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5341
5298
  this.paddingLeft = value;
5342
5299
  }
5343
5300
  if (Array.isArray(value)) {
5344
- var _value$, _ref17, _value$2, _ref18, _value$3, _ref19, _ref20, _value$4;
5345
- this.paddingTop = (_value$ = value[0]) != null ? _value$ : 0;
5346
- this.paddingRight = (_ref17 = (_value$2 = value[1]) != null ? _value$2 : value[0]) != null ? _ref17 : 0;
5347
- this.paddingBottom = (_ref18 = (_value$3 = value[2]) != null ? _value$3 : value[0]) != null ? _ref18 : 0;
5348
- this.paddingLeft = (_ref19 = (_ref20 = (_value$4 = value[3]) != null ? _value$4 : value[1]) != null ? _ref20 : value[0]) != null ? _ref19 : 0;
5301
+ this.paddingTop = value[0] ?? 0;
5302
+ this.paddingRight = value[1] ?? value[0] ?? 0;
5303
+ this.paddingBottom = value[2] ?? value[0] ?? 0;
5304
+ this.paddingLeft = value[3] ?? value[1] ?? value[0] ?? 0;
5349
5305
  } else if (typeof value === "object") {
5350
- var _value$top, _value$right, _value$bottom, _value$left;
5351
- this.paddingTop = (_value$top = value.top) != null ? _value$top : 0;
5352
- this.paddingRight = (_value$right = value.right) != null ? _value$right : 0;
5353
- this.paddingBottom = (_value$bottom = value.bottom) != null ? _value$bottom : 0;
5354
- this.paddingLeft = (_value$left = value.left) != null ? _value$left : 0;
5306
+ this.paddingTop = value.top ?? 0;
5307
+ this.paddingRight = value.right ?? 0;
5308
+ this.paddingBottom = value.bottom ?? 0;
5309
+ this.paddingLeft = value.left ?? 0;
5355
5310
  }
5356
5311
  }
5357
5312
  get padding() {
@@ -5489,7 +5444,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5489
5444
  this.addChild(this.target);
5490
5445
  }
5491
5446
  if (mask) this.applyMask(mask);
5492
- if (borderWidth) this.setBorder(borderWidth, borderColor != null ? borderColor : 0);
5447
+ if (borderWidth) this.setBorder(borderWidth, borderColor ?? 0);
5493
5448
  }
5494
5449
  applyMask(mask) {
5495
5450
  this.maskData = mask;
@@ -5551,10 +5506,10 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5551
5506
  this.init(this.options);
5552
5507
  }
5553
5508
  init(options) {
5554
- var _options$selectedItem, _options$items$this$s, _options$items$this$s2, _options$items$this$s3;
5509
+ var _options$items$this$s, _options$items$this$s2;
5555
5510
  this.options = options;
5556
- this.selected = (_options$selectedItem = options.selectedItem) != null ? _options$selectedItem : 0;
5557
- this.value = (_options$items$this$s = (_options$items$this$s2 = options.items[this.selected]) === null || _options$items$this$s2 === void 0 ? void 0 : (_options$items$this$s3 = _options$items$this$s2.labelText) === null || _options$items$this$s3 === void 0 ? void 0 : _options$items$this$s3.text) != null ? _options$items$this$s : "";
5511
+ this.selected = options.selectedItem ?? 0;
5512
+ this.value = ((_options$items$this$s = options.items[this.selected]) === null || _options$items$this$s === void 0 ? void 0 : (_options$items$this$s2 = _options$items$this$s.labelText) === null || _options$items$this$s2 === void 0 ? void 0 : _options$items$this$s2.text) ?? "";
5558
5513
  if (this.innerView) {
5559
5514
  this.innerView.type = options.type;
5560
5515
  this.innerView.elementsMargin = options.elementsMargin;
@@ -5587,15 +5542,15 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5587
5542
  });
5588
5543
  }
5589
5544
  selectItem(id) {
5590
- var _this$options$items$i, _this$options$items$i2;
5545
+ var _this$options$items$i;
5591
5546
  this.items.forEach((item, key) => {
5592
5547
  item.forceCheck(key === id);
5593
5548
  });
5594
5549
  if (this.selected !== id) {
5595
- var _this$items$id$labelT, _this$items$id$labelT2;
5596
- this.onChange.emit(id, (_this$items$id$labelT = (_this$items$id$labelT2 = this.items[id].labelText) === null || _this$items$id$labelT2 === void 0 ? void 0 : _this$items$id$labelT2.text) != null ? _this$items$id$labelT : "");
5550
+ var _this$items$id$labelT;
5551
+ this.onChange.emit(id, ((_this$items$id$labelT = this.items[id].labelText) === null || _this$items$id$labelT === void 0 ? void 0 : _this$items$id$labelT.text) ?? "");
5597
5552
  }
5598
- this.value = (_this$options$items$i = (_this$options$items$i2 = this.options.items[id].labelText) === null || _this$options$items$i2 === void 0 ? void 0 : _this$options$items$i2.text) != null ? _this$options$items$i : "";
5553
+ this.value = ((_this$options$items$i = this.options.items[id].labelText) === null || _this$options$items$i === void 0 ? void 0 : _this$options$items$i.text) ?? "";
5599
5554
  this.selected = id;
5600
5555
  }
5601
5556
  }
@@ -5635,7 +5590,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5635
5590
  scrollBox,
5636
5591
  visibleItems
5637
5592
  }) {
5638
- TextClass = TextClass != null ? TextClass : pixi_js.Text;
5593
+ TextClass = TextClass ?? pixi_js.Text;
5639
5594
  if (this.openView && this.openView !== openBG) {
5640
5595
  this.view.removeChild(this.openView);
5641
5596
  }
@@ -5656,7 +5611,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5656
5611
  text: items !== null && items !== void 0 && items.items ? items.items[0] : "",
5657
5612
  style: textStyle
5658
5613
  });
5659
- this.openButton.textOffset = selectedTextOffset != null ? selectedTextOffset : {};
5614
+ this.openButton.textOffset = selectedTextOffset ?? {};
5660
5615
  }
5661
5616
  if (this.openView !== openBG) {
5662
5617
  this.openView = getView(openBG);
@@ -5686,7 +5641,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5686
5641
  text: items !== null && items !== void 0 && items.items ? items.items[0] : "",
5687
5642
  style: textStyle
5688
5643
  });
5689
- this.openButton.textOffset = selectedTextOffset != null ? selectedTextOffset : {};
5644
+ this.openButton.textOffset = selectedTextOffset ?? {};
5690
5645
  }
5691
5646
  if (!this.scrollBox) {
5692
5647
  this.scrollBox = new ScrollBox$1();
@@ -5698,15 +5653,14 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5698
5653
  type: "vertical",
5699
5654
  elementsMargin: 0,
5700
5655
  width: this.openButton.width,
5701
- height: this.openButton.height * (visibleItems != null ? visibleItems : defaultVisibleItems),
5656
+ height: this.openButton.height * (visibleItems ?? defaultVisibleItems),
5702
5657
  radius: 0,
5703
5658
  padding: 0
5704
5659
  }, scrollBox));
5705
5660
  this.scrollBox.y = this.openButton.height;
5706
5661
  if (scrollBox !== null && scrollBox !== void 0 && scrollBox.offset) {
5707
- var _scrollBox$offset$x, _scrollBox$offset$y;
5708
- this.scrollBox.x = (_scrollBox$offset$x = scrollBox.offset.x) != null ? _scrollBox$offset$x : 0;
5709
- this.scrollBox.y += (_scrollBox$offset$y = scrollBox.offset.y) != null ? _scrollBox$offset$y : 0;
5662
+ this.scrollBox.x = scrollBox.offset.x ?? 0;
5663
+ this.scrollBox.y += scrollBox.offset.y ?? 0;
5710
5664
  }
5711
5665
  this.addItems(items, selected);
5712
5666
  }
@@ -5715,14 +5669,14 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5715
5669
  var _this$scrollBox;
5716
5670
  const text = button.text;
5717
5671
  if (id === selected) {
5718
- this.openButton.text = text != null ? text : "";
5719
- this.closeButton.text = text != null ? text : "";
5672
+ this.openButton.text = text ?? "";
5673
+ this.closeButton.text = text ?? "";
5720
5674
  }
5721
5675
  button.onPress.connect(() => {
5722
5676
  this.value = id;
5723
- this.onSelect.emit(id, text != null ? text : "");
5724
- this.openButton.text = text != null ? text : "";
5725
- this.closeButton.text = text != null ? text : "";
5677
+ this.onSelect.emit(id, text ?? "");
5678
+ this.openButton.text = text ?? "";
5679
+ this.closeButton.text = text ?? "";
5726
5680
  this.close();
5727
5681
  });
5728
5682
  (_this$scrollBox = this.scrollBox) === null || _this$scrollBox === void 0 ? void 0 : _this$scrollBox.addItem(button);
@@ -5754,11 +5708,11 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5754
5708
  TextClass,
5755
5709
  radius
5756
5710
  }) {
5757
- TextClass = TextClass != null ? TextClass : pixi_js.Text;
5711
+ TextClass = TextClass ?? pixi_js.Text;
5758
5712
  const buttons = [];
5759
5713
  items.forEach(item => {
5760
5714
  const defaultView = new pixi_js.Graphics().roundRect(0, 0, width, height, radius).fill(backgroundColor);
5761
- const color = hoverColor != null ? hoverColor : backgroundColor;
5715
+ const color = hoverColor ?? backgroundColor;
5762
5716
  const hoverView = new pixi_js.Graphics().roundRect(0, 0, width, height, radius).fill(color);
5763
5717
  const text = new TextClass({
5764
5718
  text: item,
@@ -5784,7 +5738,6 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5784
5738
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5785
5739
  class Slider$1 extends SliderBase {
5786
5740
  constructor(options) {
5787
- var _options$value;
5788
5741
  super(_objectSpread({
5789
5742
  slider1: options.slider,
5790
5743
  value1: options.value
@@ -5794,7 +5747,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5794
5747
  __publicField(this, "onChange", new dist.Signal());
5795
5748
  this.sliderOptions = options;
5796
5749
  this.step = options.step || 1;
5797
- this.value = (_options$value = options.value) != null ? _options$value : this.min;
5750
+ this.value = options.value ?? this.min;
5798
5751
  this.updateSlider();
5799
5752
  }
5800
5753
  get value() {
@@ -5851,18 +5804,18 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5851
5804
  (_this$onChange2 = this.onChange) === null || _this$onChange2 === void 0 ? void 0 : _this$onChange2.emit(this.value);
5852
5805
  }
5853
5806
  updateSlider() {
5854
- var _this$value, _this$bg$width3, _this$bg9, _this$bg$height3, _this$bg0, _this$sliderOptions3;
5807
+ var _this$bg9, _this$bg0, _this$sliderOptions3;
5855
5808
  if (!this._slider1) return;
5856
- this.progress = (((_this$value = this.value) != null ? _this$value : this.min) - this.min) / (this.max - this.min) * 100;
5857
- this._slider1.x = ((_this$bg$width3 = (_this$bg9 = this.bg) === null || _this$bg9 === void 0 ? void 0 : _this$bg9.width) != null ? _this$bg$width3 : 0) / 100 * this.progress - this._slider1.width / 2;
5858
- this._slider1.y = ((_this$bg$height3 = (_this$bg0 = this.bg) === null || _this$bg0 === void 0 ? void 0 : _this$bg0.height) != null ? _this$bg$height3 : 0) / 2;
5809
+ this.progress = ((this.value ?? this.min) - this.min) / (this.max - this.min) * 100;
5810
+ this._slider1.x = (((_this$bg9 = this.bg) === null || _this$bg9 === void 0 ? void 0 : _this$bg9.width) ?? 0) / 100 * this.progress - this._slider1.width / 2;
5811
+ this._slider1.y = (((_this$bg0 = this.bg) === null || _this$bg0 === void 0 ? void 0 : _this$bg0.height) ?? 0) / 2;
5859
5812
  if ((_this$sliderOptions3 = this.sliderOptions) !== null && _this$sliderOptions3 !== void 0 && _this$sliderOptions3.showValue && this.value1Text) {
5860
- var _this$sliderOptions$v1, _this$sliderOptions$v10, _this$sliderOptions$v11, _this$sliderOptions$v12;
5813
+ var _this$sliderOptions$v5, _this$sliderOptions$v6;
5861
5814
  this.value1Text.text = `${Math.round(this.value)}`;
5862
5815
  const sliderPosX = this._slider1.x + this._slider1.width / 2;
5863
5816
  const sliderPosY = this._slider1.y;
5864
- this.value1Text.x = sliderPosX + ((_this$sliderOptions$v1 = (_this$sliderOptions$v10 = this.sliderOptions.valueTextOffset) === null || _this$sliderOptions$v10 === void 0 ? void 0 : _this$sliderOptions$v10.x) != null ? _this$sliderOptions$v1 : 0);
5865
- this.value1Text.y = sliderPosY + ((_this$sliderOptions$v11 = (_this$sliderOptions$v12 = this.sliderOptions.valueTextOffset) === null || _this$sliderOptions$v12 === void 0 ? void 0 : _this$sliderOptions$v12.y) != null ? _this$sliderOptions$v11 : 0);
5817
+ this.value1Text.x = sliderPosX + (((_this$sliderOptions$v5 = this.sliderOptions.valueTextOffset) === null || _this$sliderOptions$v5 === void 0 ? void 0 : _this$sliderOptions$v5.x) ?? 0);
5818
+ this.value1Text.y = sliderPosY + (((_this$sliderOptions$v6 = this.sliderOptions.valueTextOffset) === null || _this$sliderOptions$v6 === void 0 ? void 0 : _this$sliderOptions$v6.y) ?? 0);
5866
5819
  }
5867
5820
  }
5868
5821
  set width(value) {
@@ -5946,7 +5899,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5946
5899
  queueMicrotask(() => whenContainerReady(game, go, fn, attempts - 1));
5947
5900
  }
5948
5901
  function resolveViewRef(game, go, ref) {
5949
- var _a;
5902
+ var _a, _b;
5950
5903
  if (!ref) return null;
5951
5904
  if ('entityName' in ref) {
5952
5905
  const child = findChildEntity$1(go, ref.entityName);
@@ -5958,14 +5911,17 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5958
5911
  childContainer.parent.removeChild(childContainer);
5959
5912
  }
5960
5913
  } catch (_) {}
5961
- return childContainer;
5914
+ return wrapBorrowedEntityView(childContainer, child.name);
5962
5915
  }
5963
5916
  }
5964
5917
  if (ref.fallback) return resolveViewRef(game, go, ref.fallback);
5965
5918
  return null;
5966
5919
  }
5920
+ if ('shape' in ref) {
5921
+ return (_a = drawInlineShape(ref.shape)) !== null && _a !== void 0 ? _a : ref.fallback ? resolveViewRef(game, go, ref.fallback) : null;
5922
+ }
5967
5923
  if ('ui' in ref) {
5968
- return (_a = drawInlineShape(ref.ui)) !== null && _a !== void 0 ? _a : ref.fallback ? resolveViewRef(game, go, ref.fallback) : null;
5924
+ return (_b = drawInlineShape(ref.ui)) !== null && _b !== void 0 ? _b : ref.fallback ? resolveViewRef(game, go, ref.fallback) : null;
5969
5925
  }
5970
5926
  if ('texture' in ref) {
5971
5927
  const tex = resolveTexture(game, ref.texture);
@@ -5990,8 +5946,14 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5990
5946
  }
5991
5947
  return null;
5992
5948
  }
5949
+ function wrapBorrowedEntityView(childContainer, childName) {
5950
+ const wrapper = new pixi_js.Container();
5951
+ wrapper.label = childName ? `${childName}:view-ref` : 'plugin-ui-view-ref';
5952
+ wrapper.addChild(childContainer);
5953
+ return wrapper;
5954
+ }
5993
5955
  function resolveTexture(game, key) {
5994
- var _a, _b;
5956
+ var _a, _b, _c;
5995
5957
  const resourceModule = (_a = game === null || game === void 0 ? void 0 : game.resource) !== null && _a !== void 0 ? _a : null;
5996
5958
  if ((_b = resourceModule === null || resourceModule === void 0 ? void 0 : resourceModule.instances) === null || _b === void 0 ? void 0 : _b[key]) {
5997
5959
  const inst = resourceModule.instances[key];
@@ -5999,7 +5961,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
5999
5961
  if ((inst === null || inst === void 0 ? void 0 : inst.image) instanceof pixi_js.Texture) return inst.image;
6000
5962
  }
6001
5963
  try {
6002
- return pixi_js.Texture.from(key);
5964
+ return (_c = pixi_js.Texture.from(key)) !== null && _c !== void 0 ? _c : null;
6003
5965
  } catch (_) {
6004
5966
  return null;
6005
5967
  }
@@ -6030,13 +5992,26 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6030
5992
  }
6031
5993
  if (style.fill !== undefined) g.fill(style.fill);
6032
5994
  if (style.stroke !== undefined && style.lineWidth !== undefined) {
6033
- g.setStrokeStyle({
5995
+ g.stroke({
6034
5996
  color: style.stroke,
6035
5997
  width: style.lineWidth
6036
5998
  });
6037
- g.stroke();
5999
+ } else if (style.stroke !== undefined) {
6000
+ g.stroke({
6001
+ color: style.stroke,
6002
+ width: 1
6003
+ });
6038
6004
  }
6039
6005
  if (style.alpha !== undefined) g.alpha = style.alpha;
6006
+ try {
6007
+ Object.defineProperty(g, 'clone', {
6008
+ value: () => {
6009
+ var _a;
6010
+ return (_a = drawInlineShape(shape)) !== null && _a !== void 0 ? _a : new pixi_js.Graphics();
6011
+ },
6012
+ configurable: true
6013
+ });
6014
+ } catch (_) {}
6040
6015
  return g;
6041
6016
  }
6042
6017
  function findChildEntity$1(go, name) {
@@ -6058,11 +6033,18 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6058
6033
  super(...arguments);
6059
6034
  this.toggleCount = 0;
6060
6035
  this.pressCount = 0;
6036
+ this.downCount = 0;
6037
+ this.upCount = 0;
6061
6038
  this.hoverCount = 0;
6039
+ this.outCount = 0;
6040
+ this.upOutCount = 0;
6062
6041
  this.changeCount = 0;
6063
6042
  this.updateCount = 0;
6064
6043
  this.selectCount = 0;
6044
+ this.lastSignal = 'idle';
6045
+ this.visualState = 'default';
6065
6046
  this.focused = false;
6047
+ this.__evaExplicitFields = new Set();
6066
6048
  }
6067
6049
  init(p) {
6068
6050
  if (p) this.applyParams(p);
@@ -6077,6 +6059,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6077
6059
  if (!(name in p)) continue;
6078
6060
  const v = p[name];
6079
6061
  if (v === undefined) continue;
6062
+ this.__evaExplicitFields.add(name);
6080
6063
  switch (spec.kind) {
6081
6064
  case 'scalar':
6082
6065
  this[name] = v;
@@ -6194,6 +6177,99 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6194
6177
  }
6195
6178
  }
6196
6179
  }
6180
+ function readTransformRenderSize(go, options = {}) {
6181
+ var _a;
6182
+ const size = (_a = go === null || go === void 0 ? void 0 : go.transform) === null || _a === void 0 ? void 0 : _a.size;
6183
+ if (!size) return null;
6184
+ const width = normalizeSizeValue(size.width, options.allowZero);
6185
+ const height = normalizeSizeValue(size.height, options.allowZero);
6186
+ if (width === undefined && height === undefined) return null;
6187
+ return {
6188
+ width,
6189
+ height
6190
+ };
6191
+ }
6192
+ function hasExplicitRenderSize(component) {
6193
+ if (!component) return false;
6194
+ const explicitFields = component.__evaExplicitFields;
6195
+ if (explicitFields && typeof explicitFields.has === 'function') {
6196
+ return explicitFields.has('width') || explicitFields.has('height');
6197
+ }
6198
+ return component.width !== undefined || component.height !== undefined;
6199
+ }
6200
+ function applyTransformSizeToInstance(def, instance, component, go, source) {
6201
+ const size = readTransformRenderSize(go, {
6202
+ allowZero: source === 'transform-change'
6203
+ });
6204
+ if (!size) return false;
6205
+ const context = {
6206
+ componentName: def.name,
6207
+ component,
6208
+ gameObject: go,
6209
+ source
6210
+ };
6211
+ if (def.applySize) def.applySize(instance, size, component !== null && component !== void 0 ? component : {}, context);else applyRuntimeSize(instance, size);
6212
+ return true;
6213
+ }
6214
+ function applyRuntimeSize(instance, size) {
6215
+ if (!instance || !size) return;
6216
+ const width = normalizeSizeValue(size.width, true);
6217
+ const height = normalizeSizeValue(size.height, true);
6218
+ if (width === undefined && height === undefined) return;
6219
+ const nextWidth = width !== null && width !== void 0 ? width : getCurrentSize(instance, 'width');
6220
+ const nextHeight = height !== null && height !== void 0 ? height : getCurrentSize(instance, 'height');
6221
+ let applied = false;
6222
+ if (typeof instance.setSize === 'function' && nextWidth !== undefined && nextHeight !== undefined) {
6223
+ try {
6224
+ instance.setSize(nextWidth, nextHeight);
6225
+ applied = true;
6226
+ } catch (_) {
6227
+ applied = false;
6228
+ }
6229
+ }
6230
+ if (!applied) {
6231
+ if (width !== undefined) instance.width = width;
6232
+ if (height !== undefined) instance.height = height;
6233
+ }
6234
+ relayoutRuntimeInstance(instance);
6235
+ }
6236
+ function applyListLayoutSize(instance, size) {
6237
+ const width = normalizeSizeValue(size.width, true);
6238
+ const height = normalizeSizeValue(size.height, true);
6239
+ if (width !== undefined) {
6240
+ try {
6241
+ instance.maxWidth = width;
6242
+ } catch (_) {}
6243
+ }
6244
+ if (height !== undefined) {
6245
+ try {
6246
+ instance.maxHeight = height;
6247
+ } catch (_) {}
6248
+ }
6249
+ relayoutRuntimeInstance(instance);
6250
+ }
6251
+ function relayoutRuntimeInstance(instance) {
6252
+ var _a, _b, _c, _d;
6253
+ try {
6254
+ (_b = (_a = instance === null || instance === void 0 ? void 0 : instance.list) === null || _a === void 0 ? void 0 : _a.arrangeChildren) === null || _b === void 0 ? void 0 : _b.call(_a);
6255
+ } catch (_) {}
6256
+ try {
6257
+ (_c = instance === null || instance === void 0 ? void 0 : instance.arrangeChildren) === null || _c === void 0 ? void 0 : _c.call(instance);
6258
+ } catch (_) {}
6259
+ try {
6260
+ (_d = instance === null || instance === void 0 ? void 0 : instance.resize) === null || _d === void 0 ? void 0 : _d.call(instance, true);
6261
+ } catch (_) {}
6262
+ }
6263
+ function normalizeSizeValue(value, allowZero = false) {
6264
+ const n = Number(value);
6265
+ if (!Number.isFinite(n)) return undefined;
6266
+ if (allowZero ? n < 0 : n <= 0) return undefined;
6267
+ return n;
6268
+ }
6269
+ function getCurrentSize(instance, key) {
6270
+ const n = Number(instance === null || instance === void 0 ? void 0 : instance[key]);
6271
+ return Number.isFinite(n) && n >= 0 ? n : undefined;
6272
+ }
6197
6273
  const ENABLED = {
6198
6274
  kind: 'scalar',
6199
6275
  default: true,
@@ -6247,11 +6323,64 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6247
6323
  signalMap: c => ({
6248
6324
  press: () => {
6249
6325
  c.pressCount += 1;
6250
- return {};
6326
+ c.lastSignal = 'press';
6327
+ c.visualState = 'default';
6328
+ return {
6329
+ pressCount: c.pressCount,
6330
+ lastSignal: c.lastSignal,
6331
+ visualState: c.visualState
6332
+ };
6251
6333
  },
6252
- down: true,
6253
- up: true,
6254
- hover: true
6334
+ down: () => {
6335
+ c.downCount += 1;
6336
+ c.lastSignal = 'down';
6337
+ c.visualState = 'pressed';
6338
+ return {
6339
+ downCount: c.downCount,
6340
+ lastSignal: c.lastSignal,
6341
+ visualState: c.visualState
6342
+ };
6343
+ },
6344
+ up: () => {
6345
+ c.upCount += 1;
6346
+ c.lastSignal = 'up';
6347
+ c.visualState = 'default';
6348
+ return {
6349
+ upCount: c.upCount,
6350
+ lastSignal: c.lastSignal,
6351
+ visualState: c.visualState
6352
+ };
6353
+ },
6354
+ hover: () => {
6355
+ c.hoverCount += 1;
6356
+ c.lastSignal = 'hover';
6357
+ c.visualState = 'hover';
6358
+ return {
6359
+ hoverCount: c.hoverCount,
6360
+ lastSignal: c.lastSignal,
6361
+ visualState: c.visualState
6362
+ };
6363
+ },
6364
+ out: () => {
6365
+ c.outCount += 1;
6366
+ c.lastSignal = 'out';
6367
+ c.visualState = 'default';
6368
+ return {
6369
+ outCount: c.outCount,
6370
+ lastSignal: c.lastSignal,
6371
+ visualState: c.visualState
6372
+ };
6373
+ },
6374
+ upOut: () => {
6375
+ c.upOutCount += 1;
6376
+ c.lastSignal = 'upOut';
6377
+ c.visualState = 'default';
6378
+ return {
6379
+ upOutCount: c.upOutCount,
6380
+ lastSignal: c.lastSignal,
6381
+ visualState: c.visualState
6382
+ };
6383
+ }
6255
6384
  }),
6256
6385
  syncOnChange: (inst, c) => {
6257
6386
  inst.enabled = c.enabled;
@@ -6320,6 +6449,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6320
6449
  }, {
6321
6450
  name: 'disabled',
6322
6451
  type: 'object'
6452
+ }, {
6453
+ name: 'icon',
6454
+ type: 'object'
6323
6455
  }]
6324
6456
  }
6325
6457
  },
@@ -6331,8 +6463,71 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6331
6463
  kind: 'shallowMerge',
6332
6464
  default: {}
6333
6465
  },
6466
+ iconOffset: {
6467
+ kind: 'shallowMerge',
6468
+ default: {}
6469
+ },
6334
6470
  nineSliceSprite: {
6335
6471
  kind: 'opaque'
6472
+ },
6473
+ textStyle: {
6474
+ kind: 'shallowMerge',
6475
+ default: {}
6476
+ },
6477
+ textClass: {
6478
+ kind: 'scalar',
6479
+ default: 'text'
6480
+ },
6481
+ bitmapFontName: {
6482
+ kind: 'scalar',
6483
+ default: 'TitleFont'
6484
+ },
6485
+ defaultTextScale: {
6486
+ kind: 'opaque'
6487
+ },
6488
+ defaultIconScale: {
6489
+ kind: 'opaque'
6490
+ },
6491
+ defaultTextAnchor: {
6492
+ kind: 'opaque'
6493
+ },
6494
+ defaultIconAnchor: {
6495
+ kind: 'opaque'
6496
+ },
6497
+ anchor: {
6498
+ kind: 'scalar'
6499
+ },
6500
+ anchorX: {
6501
+ kind: 'scalar'
6502
+ },
6503
+ anchorY: {
6504
+ kind: 'scalar'
6505
+ },
6506
+ scale: {
6507
+ kind: 'scalar'
6508
+ },
6509
+ animations: {
6510
+ kind: 'opaque'
6511
+ },
6512
+ contentFittingMode: {
6513
+ kind: 'scalar'
6514
+ },
6515
+ ignoreRefitting: {
6516
+ kind: 'scalar'
6517
+ },
6518
+ width: {
6519
+ kind: 'scalar',
6520
+ inspector: {
6521
+ name: 'width',
6522
+ type: 'number'
6523
+ }
6524
+ },
6525
+ height: {
6526
+ kind: 'scalar',
6527
+ inspector: {
6528
+ name: 'height',
6529
+ type: 'number'
6530
+ }
6336
6531
  }
6337
6532
  },
6338
6533
  views: {
@@ -6350,25 +6545,44 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6350
6545
  }, {
6351
6546
  name: 'disabled',
6352
6547
  required: false
6548
+ }, {
6549
+ name: 'icon',
6550
+ required: false
6353
6551
  }]
6354
6552
  },
6355
6553
  optionsBuilder: (c, v) => {
6356
- var _a, _b, _d, _e;
6554
+ var _a, _b, _d, _e, _f;
6357
6555
  const opts = {
6358
- text: c.text,
6556
+ text: makeFancyButtonText(c),
6359
6557
  padding: c.padding,
6360
6558
  offset: c.offset,
6361
6559
  textOffset: c.textOffset,
6362
- nineSliceSprite: c.nineSliceSprite
6560
+ iconOffset: c.iconOffset,
6561
+ nineSliceSprite: c.nineSliceSprite,
6562
+ defaultTextScale: c.defaultTextScale,
6563
+ defaultIconScale: c.defaultIconScale,
6564
+ defaultTextAnchor: c.defaultTextAnchor,
6565
+ defaultIconAnchor: c.defaultIconAnchor,
6566
+ anchor: c.anchor,
6567
+ anchorX: c.anchorX,
6568
+ anchorY: c.anchorY,
6569
+ scale: c.scale,
6570
+ animations: c.animations,
6571
+ contentFittingMode: c.contentFittingMode,
6572
+ ignoreRefitting: c.ignoreRefitting
6363
6573
  };
6364
- if ((_a = v.object) === null || _a === void 0 ? void 0 : _a.default) opts.defaultView = v.object.default;
6365
- if ((_b = v.object) === null || _b === void 0 ? void 0 : _b.hover) opts.hoverView = v.object.hover;
6366
- if ((_d = v.object) === null || _d === void 0 ? void 0 : _d.pressed) opts.pressedView = v.object.pressed;
6367
- if ((_e = v.object) === null || _e === void 0 ? void 0 : _e.disabled) opts.disabledView = v.object.disabled;
6574
+ if ((_a = v.object) === null || _a === void 0 ? void 0 : _a.default) opts.defaultView = getFancyButtonView(c, 'default', v.object.default);
6575
+ if ((_b = v.object) === null || _b === void 0 ? void 0 : _b.hover) opts.hoverView = getFancyButtonView(c, 'hover', v.object.hover);
6576
+ if ((_d = v.object) === null || _d === void 0 ? void 0 : _d.pressed) opts.pressedView = getFancyButtonView(c, 'pressed', v.object.pressed);
6577
+ if ((_e = v.object) === null || _e === void 0 ? void 0 : _e.disabled) opts.disabledView = getFancyButtonView(c, 'disabled', v.object.disabled);
6578
+ if ((_f = v.object) === null || _f === void 0 ? void 0 : _f.icon) opts.icon = v.object.icon;
6368
6579
  return opts;
6369
6580
  },
6370
6581
  postCreate: (inst, c) => {
6371
6582
  inst.enabled = c.enabled;
6583
+ if (c.state && typeof inst.setState === 'function') inst.setState(c.state, true);
6584
+ applyFancyButtonAnchor(inst, c);
6585
+ applyOptionalSize(inst, c);
6372
6586
  if (c.selected) applySelectedTint(inst, c);
6373
6587
  },
6374
6588
  signalMap: c => ({
@@ -6387,15 +6601,96 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6387
6601
  inst.enabled = c.enabled;
6388
6602
  if (c.text !== undefined && inst.text !== c.text) inst.text = c.text;
6389
6603
  if (c.padding !== undefined && inst.padding !== c.padding) inst.padding = c.padding;
6604
+ if (c.textOffset !== undefined) inst.textOffset = c.textOffset;
6605
+ if (c.iconOffset !== undefined) inst.iconOffset = c.iconOffset;
6606
+ if (c.defaultTextScale !== undefined) inst.defaultTextScale = c.defaultTextScale;
6607
+ if (c.defaultIconScale !== undefined) inst.defaultIconScale = c.defaultIconScale;
6608
+ if (c.defaultTextAnchor !== undefined) inst.defaultTextAnchor = c.defaultTextAnchor;
6609
+ if (c.defaultIconAnchor !== undefined) inst.defaultIconAnchor = c.defaultIconAnchor;
6610
+ if (c.contentFittingMode !== undefined) inst.contentFittingMode = c.contentFittingMode;
6611
+ if (c.ignoreRefitting !== undefined && inst.options) inst.options.ignoreRefitting = c.ignoreRefitting;
6612
+ if (c.state && typeof inst.setState === 'function') inst.setState(c.state, true);
6613
+ applyFancyButtonAnchor(inst, c);
6614
+ applyOptionalSize(inst, c);
6390
6615
  applySelectedTint(inst, c);
6391
6616
  }
6392
6617
  };
6618
+ function applyFancyButtonAnchor(inst, c) {
6619
+ var _a, _b, _d, _e, _f, _g, _h;
6620
+ const hasAnchor = c.anchor !== undefined || c.anchorX !== undefined || c.anchorY !== undefined;
6621
+ if (!hasAnchor || !((_a = inst === null || inst === void 0 ? void 0 : inst.anchor) === null || _a === void 0 ? void 0 : _a.set)) return;
6622
+ const x = (_e = (_d = (_b = c.anchorX) !== null && _b !== void 0 ? _b : c.anchor) !== null && _d !== void 0 ? _d : inst.anchor.x) !== null && _e !== void 0 ? _e : 0;
6623
+ const y = (_h = (_g = (_f = c.anchorY) !== null && _f !== void 0 ? _f : c.anchor) !== null && _g !== void 0 ? _g : inst.anchor.y) !== null && _h !== void 0 ? _h : 0;
6624
+ try {
6625
+ inst.anchor.set(x, y);
6626
+ } catch (_) {}
6627
+ }
6628
+ function makeFancyButtonText(c) {
6629
+ var _a, _b, _d;
6630
+ if (c.text === undefined) return undefined;
6631
+ const text = String(c.text);
6632
+ if (c.textClass === 'html') {
6633
+ return new pixi_js.HTMLText({
6634
+ text,
6635
+ style: c.textStyle
6636
+ });
6637
+ }
6638
+ if (c.textClass === 'bitmap') {
6639
+ const fontFamily = (_a = c.bitmapFontName) !== null && _a !== void 0 ? _a : 'TitleFont';
6640
+ ensureBitmapFont(fontFamily, c.textStyle);
6641
+ return new pixi_js.BitmapText({
6642
+ text,
6643
+ style: {
6644
+ fontFamily,
6645
+ fontSize: (_d = (_b = c.textStyle) === null || _b === void 0 ? void 0 : _b.fontSize) !== null && _d !== void 0 ? _d : 40
6646
+ }
6647
+ });
6648
+ }
6649
+ if (c.textStyle && Object.keys(c.textStyle).length > 0) {
6650
+ return new pixi_js.Text({
6651
+ text,
6652
+ style: c.textStyle
6653
+ });
6654
+ }
6655
+ return c.text;
6656
+ }
6657
+ const installedBitmapFonts = new Set();
6658
+ function ensureBitmapFont(name, style) {
6659
+ if (installedBitmapFonts.has(name)) return;
6660
+ try {
6661
+ pixi_js.BitmapFontManager.install({
6662
+ name,
6663
+ style: style !== null && style !== void 0 ? style : {}
6664
+ });
6665
+ } catch (_) {}
6666
+ installedBitmapFonts.add(name);
6667
+ }
6668
+ function getFancyButtonView(c, key, resolved) {
6669
+ var _a;
6670
+ const ref = (_a = c.views) === null || _a === void 0 ? void 0 : _a[key];
6671
+ if (c.nineSliceSprite && ref && 'texture' in ref) return getTextureView(ref.texture);
6672
+ return resolved;
6673
+ }
6393
6674
  function applySelectedTint(inst, c) {
6394
6675
  try {
6395
6676
  const dv = inst.defaultView;
6396
6677
  if (dv && 'tint' in dv) dv.tint = c.selected ? c.selectedTint : 0xFFFFFF;
6397
6678
  } catch (_) {}
6398
6679
  }
6680
+ function syncCheckBoxTextStyle(inst, c) {
6681
+ var _a, _b, _d;
6682
+ const style = inst.style;
6683
+ if (!style || !c.textStyle && !c.textOffset) return;
6684
+ const nextStyle = _extends(_extends({}, style), {
6685
+ text: (_a = c.textStyle) !== null && _a !== void 0 ? _a : style.text,
6686
+ textOffset: (_b = c.textOffset) !== null && _b !== void 0 ? _b : style.textOffset
6687
+ });
6688
+ inst._style = nextStyle;
6689
+ if (inst.labelText && c.textStyle) inst.labelText.style = c.textStyle;
6690
+ try {
6691
+ (_d = inst.alignText) === null || _d === void 0 ? void 0 : _d.call(inst);
6692
+ } catch (_) {}
6693
+ }
6399
6694
  const CHECKBOX_DEF = {
6400
6695
  name: 'CheckBox',
6401
6696
  signalPrefix: 'checkbox',
@@ -6434,6 +6729,16 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6434
6729
  }]
6435
6730
  }
6436
6731
  },
6732
+ textStyle: {
6733
+ kind: 'shallowMerge',
6734
+ default: {
6735
+ fill: 0xffffff
6736
+ }
6737
+ },
6738
+ textOffset: {
6739
+ kind: 'shallowMerge',
6740
+ default: {}
6741
+ },
6437
6742
  disabledStyle: {
6438
6743
  kind: 'shallowMerge',
6439
6744
  default: {
@@ -6456,7 +6761,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6456
6761
  optionsBuilder: (c, v) => ({
6457
6762
  style: {
6458
6763
  checked: v.object.checked,
6459
- unchecked: v.object.unchecked
6764
+ unchecked: v.object.unchecked,
6765
+ text: c.textStyle,
6766
+ textOffset: c.textOffset
6460
6767
  },
6461
6768
  text: c.text,
6462
6769
  checked: c.checked
@@ -6472,6 +6779,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6472
6779
  }),
6473
6780
  syncOnChange: (inst, c) => {
6474
6781
  if (inst.checked !== c.checked) inst.checked = c.checked;
6782
+ if (c.text !== undefined && inst.text !== c.text) inst.text = c.text;
6783
+ syncCheckBoxTextStyle(inst, c);
6475
6784
  }
6476
6785
  };
6477
6786
  const SWITCHER_DEF = {
@@ -6519,6 +6828,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6519
6828
  }),
6520
6829
  syncOnChange: (inst, c) => {
6521
6830
  if (inst.active !== c.active) inst.active = c.active;
6831
+ if (c.triggerEvent !== undefined) inst.triggerEvents = c.triggerEvent;
6522
6832
  }
6523
6833
  };
6524
6834
  const SLIDER_DEF = {
@@ -6579,6 +6889,37 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6579
6889
  kind: 'shallowMerge',
6580
6890
  default: {}
6581
6891
  },
6892
+ nineSliceSprite: {
6893
+ kind: 'opaque'
6894
+ },
6895
+ fillPaddings: {
6896
+ kind: 'shallowMerge',
6897
+ default: {}
6898
+ },
6899
+ valueTextStyle: {
6900
+ kind: 'shallowMerge',
6901
+ default: {
6902
+ fill: 0xffffff
6903
+ }
6904
+ },
6905
+ valueTextOffset: {
6906
+ kind: 'shallowMerge',
6907
+ default: {}
6908
+ },
6909
+ width: {
6910
+ kind: 'scalar',
6911
+ inspector: {
6912
+ name: 'width',
6913
+ type: 'number'
6914
+ }
6915
+ },
6916
+ height: {
6917
+ kind: 'scalar',
6918
+ inspector: {
6919
+ name: 'height',
6920
+ type: 'number'
6921
+ }
6922
+ },
6582
6923
  bindToStore: BIND_STORE
6583
6924
  },
6584
6925
  views: {
@@ -6596,18 +6937,26 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6596
6937
  }]
6597
6938
  },
6598
6939
  optionsBuilder: (c, v) => {
6599
- centerThumbPivot(v.object.thumb);
6940
+ var _a, _b, _d;
6941
+ const bg = getSliderView((_a = c.views) === null || _a === void 0 ? void 0 : _a.bg, v.object.bg);
6942
+ const fill = getSliderView((_b = c.views) === null || _b === void 0 ? void 0 : _b.fill, v.object.fill);
6943
+ const thumb = getSliderView((_d = c.views) === null || _d === void 0 ? void 0 : _d.thumb, v.object.thumb);
6600
6944
  return {
6601
- bg: v.object.bg,
6602
- fill: v.object.fill,
6603
- slider: v.object.thumb,
6945
+ bg,
6946
+ fill,
6947
+ slider: thumb,
6604
6948
  min: c.min,
6605
6949
  max: c.max,
6606
6950
  step: c.step,
6607
6951
  value: c.value,
6608
- showValue: c.showValue
6952
+ showValue: c.showValue,
6953
+ fillPaddings: c.fillPaddings,
6954
+ nineSliceSprite: c.nineSliceSprite,
6955
+ valueTextStyle: c.valueTextStyle,
6956
+ valueTextOffset: c.valueTextOffset
6609
6957
  };
6610
6958
  },
6959
+ postCreate: (inst, c) => applyOptionalSize(inst, c),
6611
6960
  signalMap: c => ({
6612
6961
  update: vv => {
6613
6962
  c.value = vv;
@@ -6626,23 +6975,9 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6626
6975
  }),
6627
6976
  syncOnChange: (inst, c) => {
6628
6977
  if (inst.value !== c.value) inst.value = c.value;
6978
+ applyOptionalSize(inst, c);
6629
6979
  }
6630
6980
  };
6631
- function centerThumbPivot(thumb) {
6632
- var _a, _b, _d, _e;
6633
- if (!thumb) return;
6634
- if (thumb.anchor) return;
6635
- let h = 0;
6636
- try {
6637
- const b = (_a = thumb.getBounds) === null || _a === void 0 ? void 0 : _a.call(thumb);
6638
- h = (_d = (_b = b === null || b === void 0 ? void 0 : b.height) !== null && _b !== void 0 ? _b : thumb.height) !== null && _d !== void 0 ? _d : 0;
6639
- } catch (_) {
6640
- h = (_e = thumb.height) !== null && _e !== void 0 ? _e : 0;
6641
- }
6642
- if (h > 0 && thumb.pivot) {
6643
- thumb.pivot.set(0, h / 2);
6644
- }
6645
- }
6646
6981
  const DOUBLE_SLIDER_DEF = {
6647
6982
  name: 'DoubleSlider',
6648
6983
  signalPrefix: 'doubleslider',
@@ -6697,6 +7032,37 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6697
7032
  kind: 'shallowMerge',
6698
7033
  default: {}
6699
7034
  },
7035
+ nineSliceSprite: {
7036
+ kind: 'opaque'
7037
+ },
7038
+ fillPaddings: {
7039
+ kind: 'shallowMerge',
7040
+ default: {}
7041
+ },
7042
+ valueTextStyle: {
7043
+ kind: 'shallowMerge',
7044
+ default: {
7045
+ fill: 0xffffff
7046
+ }
7047
+ },
7048
+ valueTextOffset: {
7049
+ kind: 'shallowMerge',
7050
+ default: {}
7051
+ },
7052
+ width: {
7053
+ kind: 'scalar',
7054
+ inspector: {
7055
+ name: 'width',
7056
+ type: 'number'
7057
+ }
7058
+ },
7059
+ height: {
7060
+ kind: 'scalar',
7061
+ inspector: {
7062
+ name: 'height',
7063
+ type: 'number'
7064
+ }
7065
+ },
6700
7066
  bindToStore1: {
6701
7067
  kind: 'scalar'
6702
7068
  },
@@ -6722,20 +7088,29 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6722
7088
  }]
6723
7089
  },
6724
7090
  optionsBuilder: (c, v) => {
6725
- centerThumbPivot(v.object.slider1);
6726
- centerThumbPivot(v.object.slider2);
7091
+ var _a, _b, _d, _e;
7092
+ const bg = getSliderView((_a = c.views) === null || _a === void 0 ? void 0 : _a.bg, v.object.bg);
7093
+ const fill = getSliderView((_b = c.views) === null || _b === void 0 ? void 0 : _b.fill, v.object.fill);
7094
+ const slider1 = getSliderView((_d = c.views) === null || _d === void 0 ? void 0 : _d.slider1, v.object.slider1);
7095
+ const slider2 = getSliderView((_e = c.views) === null || _e === void 0 ? void 0 : _e.slider2, v.object.slider2);
6727
7096
  return {
6728
- bg: v.object.bg,
6729
- fill: v.object.fill,
6730
- slider1: v.object.slider1,
6731
- slider2: v.object.slider2,
7097
+ bg,
7098
+ fill,
7099
+ slider1,
7100
+ slider2,
6732
7101
  min: c.min,
6733
7102
  max: c.max,
7103
+ step: c.step,
6734
7104
  value1: c.value1,
6735
7105
  value2: c.value2,
6736
- showValue: c.showValue
7106
+ showValue: c.showValue,
7107
+ fillPaddings: c.fillPaddings,
7108
+ nineSliceSprite: c.nineSliceSprite,
7109
+ valueTextStyle: c.valueTextStyle,
7110
+ valueTextOffset: c.valueTextOffset
6737
7111
  };
6738
7112
  },
7113
+ postCreate: (inst, c) => applyOptionalSize(inst, c),
6739
7114
  signalMap: c => ({
6740
7115
  update: (v1, v2) => {
6741
7116
  c.value1 = v1;
@@ -6759,6 +7134,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6759
7134
  syncOnChange: (inst, c) => {
6760
7135
  if (inst.value1 !== c.value1) inst.value1 = c.value1;
6761
7136
  if (inst.value2 !== c.value2) inst.value2 = c.value2;
7137
+ applyOptionalSize(inst, c);
6762
7138
  }
6763
7139
  };
6764
7140
  const PROGRESS_BAR_DEF = {
@@ -6797,6 +7173,20 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6797
7173
  kind: 'shallowMerge',
6798
7174
  default: {}
6799
7175
  },
7176
+ width: {
7177
+ kind: 'scalar',
7178
+ inspector: {
7179
+ name: 'width',
7180
+ type: 'number'
7181
+ }
7182
+ },
7183
+ height: {
7184
+ kind: 'scalar',
7185
+ inspector: {
7186
+ name: 'height',
7187
+ type: 'number'
7188
+ }
7189
+ },
6800
7190
  bindToStore: BIND_STORE
6801
7191
  },
6802
7192
  views: {
@@ -6805,19 +7195,52 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6805
7195
  keys: []
6806
7196
  },
6807
7197
  optionsBuilder: (c, _v) => ({
6808
- bg: c.__resolved_bg,
6809
- fill: c.__resolved_fill,
7198
+ bg: c.__resolved_bg_view,
7199
+ fill: c.__resolved_fill_view,
6810
7200
  fillPaddings: c.fillPaddings,
7201
+ nineSliceSprite: c.nineSliceSprite,
6811
7202
  progress: computeProgressPct(c)
6812
7203
  }),
7204
+ postCreate: (inst, c) => applyOptionalSize(inst, c),
6813
7205
  syncOnChange: (inst, c) => {
6814
7206
  const pct = computeProgressPct(c);
6815
7207
  if (inst.progress !== pct) inst.progress = pct;
7208
+ applyOptionalSize(inst, c);
6816
7209
  },
6817
7210
  mixin: {
6818
7211
  getProgressPct: getProgressPctMixin
6819
7212
  }
6820
7213
  };
7214
+ function getSliderView(ref, resolved) {
7215
+ if (ref && 'texture' in ref) {
7216
+ return getTextureView(ref.texture);
7217
+ }
7218
+ return resolved;
7219
+ }
7220
+ function getProgressView(ref, resolved, nineSliceSprite) {
7221
+ if (nineSliceSprite && ref && 'texture' in ref) {
7222
+ return getTextureView(ref.texture);
7223
+ }
7224
+ return resolved;
7225
+ }
7226
+ function getTextureView(textureKey) {
7227
+ var _a;
7228
+ return (_a = resolveTexture(undefined, textureKey)) !== null && _a !== void 0 ? _a : textureKey;
7229
+ }
7230
+ function applyOptionalSize(inst, c) {
7231
+ var _a, _b;
7232
+ if (c.width === undefined && c.height === undefined) return;
7233
+ const width = (_a = c.width) !== null && _a !== void 0 ? _a : inst.width;
7234
+ const height = (_b = c.height) !== null && _b !== void 0 ? _b : inst.height;
7235
+ if (typeof inst.setSize === 'function') {
7236
+ try {
7237
+ inst.setSize(width, height);
7238
+ return;
7239
+ } catch (_) {}
7240
+ }
7241
+ if (c.width !== undefined) inst.width = c.width;
7242
+ if (c.height !== undefined) inst.height = c.height;
7243
+ }
6821
7244
  function computeProgressPct(c) {
6822
7245
  const [min, max] = c.valueRange;
6823
7246
  if (max <= min) return 0;
@@ -6906,6 +7329,21 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6906
7329
  step: 0.05
6907
7330
  }
6908
7331
  },
7332
+ cap: {
7333
+ kind: 'scalar',
7334
+ inspector: {
7335
+ name: 'cap',
7336
+ type: 'string'
7337
+ }
7338
+ },
7339
+ rotation: {
7340
+ kind: 'scalar',
7341
+ default: 0
7342
+ },
7343
+ offset: {
7344
+ kind: 'shallowMerge',
7345
+ default: {}
7346
+ },
6909
7347
  bindToStore: BIND_STORE
6910
7348
  },
6911
7349
  optionsBuilder: c => ({
@@ -6915,16 +7353,27 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
6915
7353
  fillColor: c.fillColor,
6916
7354
  backgroundAlpha: c.backgroundAlpha,
6917
7355
  fillAlpha: c.fillAlpha,
7356
+ cap: c.cap,
6918
7357
  value: computeProgressPct(c)
6919
7358
  }),
7359
+ postCreate: (inst, c) => applyCircularProgressTransform(inst, c),
6920
7360
  syncOnChange: (inst, c) => {
6921
7361
  const pct = computeProgressPct(c);
6922
7362
  if (inst.progress !== pct) inst.progress = pct;
7363
+ applyCircularProgressTransform(inst, c);
6923
7364
  },
6924
7365
  mixin: {
6925
7366
  getProgressPct: getProgressPctMixin
6926
7367
  }
6927
7368
  };
7369
+ function applyCircularProgressTransform(inst, c) {
7370
+ var _a, _b;
7371
+ if (c.rotation !== undefined) inst.rotation = c.rotation;
7372
+ if (c.offset) {
7373
+ inst.x = (_a = c.offset.x) !== null && _a !== void 0 ? _a : 0;
7374
+ inst.y = (_b = c.offset.y) !== null && _b !== void 0 ? _b : 0;
7375
+ }
7376
+ }
6928
7377
  const INPUT_DEF = {
6929
7378
  name: 'Input',
6930
7379
  signalPrefix: 'input',
@@ -7006,6 +7455,20 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7006
7455
  type: 'boolean'
7007
7456
  }
7008
7457
  },
7458
+ width: {
7459
+ kind: 'scalar',
7460
+ inspector: {
7461
+ name: 'width',
7462
+ type: 'number'
7463
+ }
7464
+ },
7465
+ height: {
7466
+ kind: 'scalar',
7467
+ inspector: {
7468
+ name: 'height',
7469
+ type: 'number'
7470
+ }
7471
+ },
7009
7472
  bindToStore: BIND_STORE
7010
7473
  },
7011
7474
  views: {
@@ -7014,7 +7477,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7014
7477
  required: true
7015
7478
  },
7016
7479
  optionsBuilder: (c, v) => ({
7017
- bg: v.single,
7480
+ bg: getProgressView(c.bgView, v.single, c.nineSliceSprite),
7018
7481
  textStyle: c.textStyle,
7019
7482
  placeholder: c.placeholder,
7020
7483
  value: c.value,
@@ -7026,6 +7489,10 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7026
7489
  nineSliceSprite: c.nineSliceSprite,
7027
7490
  addMask: c.addMask
7028
7491
  }),
7492
+ postCreate: (inst, c) => {
7493
+ inst.enabled = c.enabled;
7494
+ applyOptionalSize(inst, c);
7495
+ },
7029
7496
  signalMap: c => ({
7030
7497
  change: text => {
7031
7498
  c.value = text;
@@ -7040,6 +7507,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7040
7507
  }),
7041
7508
  syncOnChange: (inst, c) => {
7042
7509
  if (inst.value !== c.value) inst.value = c.value;
7510
+ if (inst.enabled !== c.enabled) inst.enabled = c.enabled;
7511
+ applyOptionalSize(inst, c);
7043
7512
  }
7044
7513
  };
7045
7514
  const LIST_DEF = {
@@ -7095,28 +7564,34 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7095
7564
  default: 'items'
7096
7565
  }
7097
7566
  },
7098
- optionsBuilder: (c, _v) => {
7567
+ optionsBuilder: (c, _v) => ({
7568
+ type: c.type,
7569
+ elementsMargin: c.elementsMargin,
7570
+ padding: c.padding,
7571
+ vertPadding: c.vertPadding,
7572
+ horPadding: c.horPadding,
7573
+ topPadding: c.topPadding,
7574
+ bottomPadding: c.bottomPadding,
7575
+ leftPadding: c.leftPadding,
7576
+ rightPadding: c.rightPadding,
7577
+ maxWidth: c.maxWidth,
7578
+ maxHeight: c.maxHeight
7579
+ }),
7580
+ postCreate: (inst, c) => {
7099
7581
  var _a;
7100
- return {
7101
- type: c.type,
7102
- elementsMargin: c.elementsMargin,
7103
- padding: c.padding,
7104
- vertPadding: c.vertPadding,
7105
- horPadding: c.horPadding,
7106
- topPadding: c.topPadding,
7107
- bottomPadding: c.bottomPadding,
7108
- leftPadding: c.leftPadding,
7109
- rightPadding: c.rightPadding,
7110
- maxWidth: c.maxWidth,
7111
- maxHeight: c.maxHeight,
7112
- children: (_a = c.__resolved_items) !== null && _a !== void 0 ? _a : []
7113
- };
7582
+ for (const item of (_a = c.__resolved_items) !== null && _a !== void 0 ? _a : []) {
7583
+ try {
7584
+ inst.addChild(item);
7585
+ } catch (_) {}
7586
+ }
7587
+ if (typeof inst.arrangeChildren === 'function') inst.arrangeChildren();
7114
7588
  },
7115
7589
  syncOnChange: (inst, c) => {
7116
7590
  if (inst.type !== c.type) inst.type = c.type;
7117
7591
  if (inst.elementsMargin !== c.elementsMargin) inst.elementsMargin = c.elementsMargin;
7118
7592
  if (typeof inst.arrangeChildren === 'function') inst.arrangeChildren();
7119
- }
7593
+ },
7594
+ applySize: applyListLayoutSize
7120
7595
  };
7121
7596
  const SCROLL_BOX_DEF = {
7122
7597
  name: 'ScrollBox',
@@ -7153,7 +7628,6 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7153
7628
  },
7154
7629
  background: {
7155
7630
  kind: 'scalar',
7156
- default: 0x111111,
7157
7631
  inspector: {
7158
7632
  name: 'background',
7159
7633
  type: 'color'
@@ -7187,6 +7661,38 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7187
7661
  kind: 'scalar',
7188
7662
  default: 0
7189
7663
  },
7664
+ vertPadding: {
7665
+ kind: 'scalar'
7666
+ },
7667
+ horPadding: {
7668
+ kind: 'scalar'
7669
+ },
7670
+ topPadding: {
7671
+ kind: 'scalar'
7672
+ },
7673
+ bottomPadding: {
7674
+ kind: 'scalar'
7675
+ },
7676
+ leftPadding: {
7677
+ kind: 'scalar'
7678
+ },
7679
+ rightPadding: {
7680
+ kind: 'scalar'
7681
+ },
7682
+ globalScroll: {
7683
+ kind: 'scalar',
7684
+ default: true
7685
+ },
7686
+ shiftScroll: {
7687
+ kind: 'scalar',
7688
+ default: false
7689
+ },
7690
+ proximityRange: {
7691
+ kind: 'scalar'
7692
+ },
7693
+ proximityDebounce: {
7694
+ kind: 'scalar'
7695
+ },
7190
7696
  inertia: {
7191
7697
  kind: 'scalar',
7192
7698
  default: true
@@ -7212,7 +7718,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7212
7718
  }
7213
7719
  },
7214
7720
  optionsBuilder: (c, _v) => {
7215
- var _a, _b;
7721
+ var _a;
7216
7722
  const typeMap = {
7217
7723
  horizontal: 'horizontal',
7218
7724
  vertical: 'vertical',
@@ -7226,9 +7732,18 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7226
7732
  radius: c.radius,
7227
7733
  elementsMargin: c.elementsMargin,
7228
7734
  padding: c.padding,
7735
+ vertPadding: c.vertPadding,
7736
+ horPadding: c.horPadding,
7737
+ topPadding: c.topPadding,
7738
+ bottomPadding: c.bottomPadding,
7739
+ leftPadding: c.leftPadding,
7740
+ rightPadding: c.rightPadding,
7229
7741
  disableEasing: c.disableEasing,
7230
7742
  disableDynamicRendering: c.disableDynamicRendering,
7231
- items: (_b = c.__resolved_items) !== null && _b !== void 0 ? _b : []
7743
+ globalScroll: c.globalScroll,
7744
+ shiftScroll: c.shiftScroll,
7745
+ proximityRange: c.proximityRange,
7746
+ proximityDebounce: c.proximityDebounce
7232
7747
  };
7233
7748
  },
7234
7749
  signalMap: () => ({
@@ -7236,12 +7751,22 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7236
7751
  value: v
7237
7752
  })
7238
7753
  }),
7239
- syncOnChange: (inst, c) => {
7754
+ postCreate: (inst, c) => {
7755
+ var _a, _b;
7756
+ if (typeof inst.addItems === 'function') {
7757
+ try {
7758
+ inst.addItems((_a = c.__resolved_items) !== null && _a !== void 0 ? _a : []);
7759
+ } catch (_) {}
7760
+ }
7761
+ if (typeof ((_b = inst.list) === null || _b === void 0 ? void 0 : _b.arrangeChildren) === 'function') inst.list.arrangeChildren();
7240
7762
  if (typeof inst.resize === 'function') {
7241
7763
  try {
7242
- inst.resize(c.width, c.height);
7764
+ inst.resize();
7243
7765
  } catch (_) {}
7244
7766
  }
7767
+ },
7768
+ syncOnChange: (inst, c) => {
7769
+ applyOptionalSize(inst, c);
7245
7770
  }
7246
7771
  };
7247
7772
  const SELECT_DEF = {
@@ -7286,6 +7811,57 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7286
7811
  nineSliceSprite: {
7287
7812
  kind: 'opaque'
7288
7813
  },
7814
+ width: {
7815
+ kind: 'scalar',
7816
+ inspector: {
7817
+ name: 'width',
7818
+ type: 'number'
7819
+ }
7820
+ },
7821
+ height: {
7822
+ kind: 'scalar',
7823
+ inspector: {
7824
+ name: 'height',
7825
+ type: 'number'
7826
+ }
7827
+ },
7828
+ radius: {
7829
+ kind: 'scalar',
7830
+ default: 4
7831
+ },
7832
+ visibleItems: {
7833
+ kind: 'scalar'
7834
+ },
7835
+ itemWidth: {
7836
+ kind: 'scalar'
7837
+ },
7838
+ itemHeight: {
7839
+ kind: 'scalar'
7840
+ },
7841
+ itemBackgroundColor: {
7842
+ kind: 'scalar',
7843
+ default: 0x000000
7844
+ },
7845
+ itemHoverColor: {
7846
+ kind: 'scalar',
7847
+ default: 0x666666
7848
+ },
7849
+ selectedTextOffset: {
7850
+ kind: 'shallowMerge',
7851
+ default: {}
7852
+ },
7853
+ scrollBox: {
7854
+ kind: 'shallowMerge',
7855
+ default: {}
7856
+ },
7857
+ textClass: {
7858
+ kind: 'scalar',
7859
+ default: 'text'
7860
+ },
7861
+ open: {
7862
+ kind: 'scalar',
7863
+ default: false
7864
+ },
7289
7865
  bindToStore: BIND_STORE
7290
7866
  },
7291
7867
  views: {
@@ -7294,24 +7870,36 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7294
7870
  keys: []
7295
7871
  },
7296
7872
  optionsBuilder: c => {
7297
- var _a;
7873
+ var _a, _b, _d, _e, _f;
7298
7874
  return {
7299
7875
  closedBG: c.__resolved_closedView,
7300
7876
  openBG: c.__resolved_openView,
7301
7877
  textStyle: c.textStyle,
7878
+ TextClass: c.textClass === 'html' ? pixi_js.HTMLText : undefined,
7879
+ selectedTextOffset: c.selectedTextOffset,
7302
7880
  items: {
7303
7881
  items: ((_a = c.items) !== null && _a !== void 0 ? _a : []).map(it => it.text),
7304
- backgroundColor: 0x000000,
7305
- hoverColor: 0x666666,
7306
- width: 200,
7307
- height: 30,
7882
+ backgroundColor: c.itemBackgroundColor,
7883
+ hoverColor: c.itemHoverColor,
7884
+ width: (_d = (_b = c.itemWidth) !== null && _b !== void 0 ? _b : c.width) !== null && _d !== void 0 ? _d : 200,
7885
+ height: (_f = (_e = c.itemHeight) !== null && _e !== void 0 ? _e : c.height) !== null && _f !== void 0 ? _f : 30,
7308
7886
  textStyle: c.textStyle,
7309
- radius: 4
7887
+ TextClass: c.textClass === 'html' ? pixi_js.HTMLText : undefined,
7888
+ radius: c.radius
7310
7889
  },
7311
7890
  selected: c.selectedIndex >= 0 ? c.selectedIndex : undefined,
7891
+ visibleItems: c.visibleItems,
7892
+ scrollBox: _extends({
7893
+ width: c.width,
7894
+ height: c.height && c.visibleItems ? c.height * c.visibleItems : undefined,
7895
+ radius: c.radius
7896
+ }, c.scrollBox),
7312
7897
  nineSliceSprite: c.nineSliceSprite
7313
7898
  };
7314
7899
  },
7900
+ postCreate: (inst, c) => {
7901
+ if (c.open && typeof inst.open === 'function') inst.open();
7902
+ },
7315
7903
  signalMap: c => ({
7316
7904
  select: (value, text) => {
7317
7905
  c.selectedIndex = value;
@@ -7321,7 +7909,11 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7321
7909
  text
7322
7910
  };
7323
7911
  }
7324
- })
7912
+ }),
7913
+ syncOnChange: (inst, c) => {
7914
+ if (c.open && typeof inst.open === 'function') inst.open();
7915
+ if (!c.open && typeof inst.close === 'function') inst.close();
7916
+ }
7325
7917
  };
7326
7918
  const DIALOG_DEF = {
7327
7919
  name: 'Dialog',
@@ -7406,26 +7998,75 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7406
7998
  nineSliceSprite: {
7407
7999
  kind: 'opaque'
7408
8000
  },
8001
+ titleStyle: {
8002
+ kind: 'shallowMerge',
8003
+ default: {}
8004
+ },
8005
+ content: {
8006
+ kind: 'scalar'
8007
+ },
8008
+ contentStyle: {
8009
+ kind: 'shallowMerge',
8010
+ default: {}
8011
+ },
8012
+ contentButtons: {
8013
+ kind: 'arrayCopy',
8014
+ default: []
8015
+ },
8016
+ contentCheckBoxes: {
8017
+ kind: 'arrayCopy',
8018
+ default: []
8019
+ },
8020
+ buttons: {
8021
+ kind: 'arrayCopy',
8022
+ default: []
8023
+ },
8024
+ buttonList: {
8025
+ kind: 'shallowMerge',
8026
+ default: {}
8027
+ },
8028
+ buttonListOffset: {
8029
+ kind: 'shallowMerge',
8030
+ default: {}
8031
+ },
8032
+ scrollBox: {
8033
+ kind: 'shallowMerge',
8034
+ default: {}
8035
+ },
8036
+ animations: {
8037
+ kind: 'opaque'
8038
+ },
7409
8039
  bindToStore: BIND_STORE
7410
8040
  },
7411
8041
  optionsBuilder: c => {
7412
8042
  var _a;
8043
+ const background = c.nineSliceSprite && c.backgroundView && 'texture' in c.backgroundView ? c.backgroundView.texture : (_a = c.__resolved_background_view) !== null && _a !== void 0 ? _a : new pixi_js.Container();
7413
8044
  return {
7414
8045
  backdrop: c.__resolved_backdropView,
7415
8046
  backdropColor: backdropColorToNumber(c.backdropColor),
7416
8047
  backdropAlpha: c.backdropAlpha,
7417
- background: (_a = c.__resolved_backgroundView) !== null && _a !== void 0 ? _a : new pixi_js.Container(),
7418
- title: c.title,
8048
+ background,
8049
+ title: makeDialogText(c.title, c.titleStyle),
8050
+ content: makeDialogContent(c),
8051
+ buttons: makeDialogButtons(c.buttons),
8052
+ buttonList: c.buttonList,
8053
+ scrollBox: c.scrollBox,
7419
8054
  width: c.width,
7420
8055
  height: c.height,
7421
8056
  padding: c.padding,
7422
8057
  closeOnBackdropClick: c.closeOnBackdropClick,
7423
- nineSliceSprite: c.nineSliceSprite
8058
+ nineSliceSprite: c.nineSliceSprite,
8059
+ animations: c.animations
7424
8060
  };
7425
8061
  },
7426
8062
  postCreate: (inst, c) => {
8063
+ alignDialogAnchoredContent(inst, c);
7427
8064
  if (c.open && typeof inst.open === 'function') inst.open();
7428
8065
  },
8066
+ applySize: applyDialogSize,
8067
+ onAttachedExtra: (inst, c, go) => {
8068
+ wireDialogContentButtonPresses(inst, c, go);
8069
+ },
7429
8070
  signalMap: c => ({
7430
8071
  close: () => {
7431
8072
  c.open = false;
@@ -7437,9 +8078,282 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7437
8078
  })
7438
8079
  }),
7439
8080
  syncOnChange: (inst, c) => {
8081
+ alignDialogAnchoredContent(inst, c);
7440
8082
  if (c.open && !inst.isOpen && typeof inst.open === 'function') inst.open();else if (!c.open && inst.isOpen && typeof inst.close === 'function') inst.close();
7441
8083
  }
7442
8084
  };
8085
+ function applyDialogSize(inst, size, c) {
8086
+ var _a, _b, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _w, _x, _y;
8087
+ const width = readPositiveSize((_b = (_a = size.width) !== null && _a !== void 0 ? _a : c.width) !== null && _b !== void 0 ? _b : (_d = inst === null || inst === void 0 ? void 0 : inst.options) === null || _d === void 0 ? void 0 : _d.width);
8088
+ const height = readPositiveSize((_f = (_e = size.height) !== null && _e !== void 0 ? _e : c.height) !== null && _f !== void 0 ? _f : (_g = inst === null || inst === void 0 ? void 0 : inst.options) === null || _g === void 0 ? void 0 : _g.height);
8089
+ if (width === undefined && height === undefined) return;
8090
+ inst.options = (_h = inst.options) !== null && _h !== void 0 ? _h : {};
8091
+ if (width !== undefined) inst.options.width = width;
8092
+ if (height !== undefined) inst.options.height = height;
8093
+ const dialogWidth = width !== null && width !== void 0 ? width : Number(inst.options.width) || Number((_j = inst.innerView) === null || _j === void 0 ? void 0 : _j.width) || 0;
8094
+ const dialogHeight = height !== null && height !== void 0 ? height : Number(inst.options.height) || Number((_k = inst.innerView) === null || _k === void 0 ? void 0 : _k.height) || 0;
8095
+ const padding = Number((_m = (_l = c.padding) !== null && _l !== void 0 ? _l : inst.options.padding) !== null && _m !== void 0 ? _m : 20) || 20;
8096
+ if (inst.innerView) {
8097
+ if (width !== undefined) inst.innerView.width = width;
8098
+ if (height !== undefined) inst.innerView.height = height;
8099
+ if ('anchor' in inst.innerView && ((_o = inst.innerView.anchor) === null || _o === void 0 ? void 0 : _o.set)) {
8100
+ inst.innerView.anchor.set(0.5, 0.5);
8101
+ } else {
8102
+ try {
8103
+ (_q = (_p = inst.innerView.pivot) === null || _p === void 0 ? void 0 : _p.set) === null || _q === void 0 ? void 0 : _q.call(_p, dialogWidth / 2, dialogHeight / 2);
8104
+ } catch (_) {}
8105
+ }
8106
+ }
8107
+ if (inst.titleText) {
8108
+ inst.titleText.x = dialogWidth / 2;
8109
+ inst.titleText.y = padding;
8110
+ }
8111
+ const titleHeight = Number((_r = inst.titleText) === null || _r === void 0 ? void 0 : _r.height) || 0;
8112
+ const buttonHeight = Number((_s = inst.buttonContainer) === null || _s === void 0 ? void 0 : _s.height) || 0;
8113
+ if (inst.buttonContainer) {
8114
+ inst.buttonContainer.x = dialogWidth / 2 - (Number(inst.buttonContainer.width) || 0) / 2;
8115
+ inst.buttonContainer.y = dialogHeight - padding - buttonHeight;
8116
+ }
8117
+ if (inst.scrollBox) {
8118
+ inst.scrollBox.x = padding;
8119
+ inst.scrollBox.y = padding + titleHeight;
8120
+ const overrideSize = (_t = c.scrollBox) === null || _t === void 0 ? void 0 : _t.size;
8121
+ const scrollWidth = (_u = readPositiveSize(overrideSize === null || overrideSize === void 0 ? void 0 : overrideSize.width)) !== null && _u !== void 0 ? _u : Math.max(0, dialogWidth - padding * 2);
8122
+ const scrollHeight = (_w = readPositiveSize(overrideSize === null || overrideSize === void 0 ? void 0 : overrideSize.height)) !== null && _w !== void 0 ? _w : Math.max(0, dialogHeight - padding * 2 - titleHeight - buttonHeight);
8123
+ if (typeof inst.scrollBox.setSize === 'function') inst.scrollBox.setSize(scrollWidth, scrollHeight);else {
8124
+ inst.scrollBox.width = scrollWidth;
8125
+ inst.scrollBox.height = scrollHeight;
8126
+ }
8127
+ try {
8128
+ (_y = (_x = inst.scrollBox).resize) === null || _y === void 0 ? void 0 : _y.call(_x, true);
8129
+ } catch (_) {}
8130
+ }
8131
+ alignDialogAnchoredContent(inst, _extends(_extends({}, c), {
8132
+ width: dialogWidth,
8133
+ height: dialogHeight
8134
+ }));
8135
+ }
8136
+ function readPositiveSize(value) {
8137
+ const n = Number(value);
8138
+ return Number.isFinite(n) && n > 0 ? n : undefined;
8139
+ }
8140
+ function alignDialogAnchoredContent(inst, c) {
8141
+ var _a, _b;
8142
+ const innerView = inst === null || inst === void 0 ? void 0 : inst.innerView;
8143
+ const contentView = inst === null || inst === void 0 ? void 0 : inst.contentView;
8144
+ if ((innerView === null || innerView === void 0 ? void 0 : innerView.anchor) && contentView && c.width && c.height) {
8145
+ contentView.x = -c.width / 2;
8146
+ contentView.y = -c.height / 2;
8147
+ }
8148
+ applyDialogOffset(inst, 'buttonListOffset', inst.buttonContainer, c.buttonListOffset);
8149
+ applyDialogOffset(inst, 'scrollBoxOffset', inst.scrollBox, (_a = c.scrollBox) === null || _a === void 0 ? void 0 : _a.offset);
8150
+ applyDialogScrollBoxSize(inst, (_b = c.scrollBox) === null || _b === void 0 ? void 0 : _b.size);
8151
+ }
8152
+ function applyDialogOffset(inst, key, target, nextOffset) {
8153
+ var _a, _b, _d, _e;
8154
+ if (!target) return;
8155
+ const applied = (_a = inst.__evaDialogAppliedOffsets) !== null && _a !== void 0 ? _a : {};
8156
+ const prev = (_b = applied[key]) !== null && _b !== void 0 ? _b : {
8157
+ x: 0,
8158
+ y: 0
8159
+ };
8160
+ const next = {
8161
+ x: (_d = nextOffset === null || nextOffset === void 0 ? void 0 : nextOffset.x) !== null && _d !== void 0 ? _d : 0,
8162
+ y: (_e = nextOffset === null || nextOffset === void 0 ? void 0 : nextOffset.y) !== null && _e !== void 0 ? _e : 0
8163
+ };
8164
+ target.x += next.x - prev.x;
8165
+ target.y += next.y - prev.y;
8166
+ inst.__evaDialogAppliedOffsets = _extends(_extends({}, applied), {
8167
+ [key]: next
8168
+ });
8169
+ }
8170
+ function applyDialogScrollBoxSize(inst, nextSize) {
8171
+ var _a, _b, _d;
8172
+ const scrollBox = inst === null || inst === void 0 ? void 0 : inst.scrollBox;
8173
+ if (!scrollBox) return;
8174
+ const base = (_a = inst.__evaDialogBaseScrollBoxSize) !== null && _a !== void 0 ? _a : {
8175
+ width: scrollBox.width,
8176
+ height: scrollBox.height
8177
+ };
8178
+ inst.__evaDialogBaseScrollBoxSize = base;
8179
+ const wasApplied = inst.__evaDialogAppliedScrollBoxSize;
8180
+ if (!nextSize && !wasApplied) return;
8181
+ const width = (_b = nextSize === null || nextSize === void 0 ? void 0 : nextSize.width) !== null && _b !== void 0 ? _b : base.width;
8182
+ const height = (_d = nextSize === null || nextSize === void 0 ? void 0 : nextSize.height) !== null && _d !== void 0 ? _d : base.height;
8183
+ if (typeof scrollBox.setSize === 'function') scrollBox.setSize(width, height);else {
8184
+ scrollBox.width = width;
8185
+ scrollBox.height = height;
8186
+ }
8187
+ if (typeof scrollBox.resize === 'function') scrollBox.resize(true);
8188
+ inst.__evaDialogAppliedScrollBoxSize = !!nextSize;
8189
+ }
8190
+ function makeDialogText(text, style) {
8191
+ if (text === undefined) return undefined;
8192
+ if (style && Object.keys(style).length > 0) {
8193
+ return new pixi_js.Text({
8194
+ text,
8195
+ style: style
8196
+ });
8197
+ }
8198
+ return text;
8199
+ }
8200
+ function makeDialogContent(c) {
8201
+ var _a, _b;
8202
+ if ((_a = c.contentButtons) === null || _a === void 0 ? void 0 : _a.length) {
8203
+ const records = [];
8204
+ const buttons = c.contentButtons.map((button, index) => {
8205
+ const pixiButton = new FancyButton$1(makeDialogButtonOptions(button));
8206
+ applyOptionalSize(pixiButton, button);
8207
+ if (button.disabled !== undefined) pixiButton.enabled = !button.disabled;
8208
+ records.push({
8209
+ button: pixiButton,
8210
+ params: button,
8211
+ index
8212
+ });
8213
+ return pixiButton;
8214
+ });
8215
+ c.__dialogContentButtons = records;
8216
+ return buttons;
8217
+ }
8218
+ if ((_b = c.contentCheckBoxes) === null || _b === void 0 ? void 0 : _b.length) {
8219
+ return c.contentCheckBoxes.map(checkBox => new CheckBox$1(makeDialogCheckBoxOptions(checkBox)));
8220
+ }
8221
+ return makeDialogText(c.content, c.contentStyle);
8222
+ }
8223
+ function wireDialogContentButtonPresses(inst, c, go) {
8224
+ const records = c.__dialogContentButtons;
8225
+ if (!Array.isArray(records) || records.length === 0 || inst.__evaDialogContentButtonPressesWired) return;
8226
+ inst.__evaDialogContentButtonPressesWired = true;
8227
+ inst.__evaDialogContentButtonPressCleanups = records.map(record => {
8228
+ var _a;
8229
+ const signal = (_a = record.button) === null || _a === void 0 ? void 0 : _a.onPress;
8230
+ if (!signal || typeof signal.connect !== 'function') return undefined;
8231
+ const conn = signal.connect(() => {
8232
+ var _a, _b, _d, _e;
8233
+ const value = (_b = (_a = record.params.value) !== null && _a !== void 0 ? _a : record.params.text) !== null && _b !== void 0 ? _b : record.index;
8234
+ c.selectedContentIndex = record.index;
8235
+ c.selectedContentValue = value;
8236
+ c.selectCount = ((_d = c.selectCount) !== null && _d !== void 0 ? _d : 0) + 1;
8237
+ c.lastSignal = 'select';
8238
+ emitDialogSelection(go, {
8239
+ index: record.index,
8240
+ text: String((_e = record.params.text) !== null && _e !== void 0 ? _e : ''),
8241
+ value
8242
+ });
8243
+ if (record.params.closeOnPress && typeof inst.close === 'function') inst.close();
8244
+ const reopenDelay = Number(record.params.reopenDelay);
8245
+ if (Number.isFinite(reopenDelay) && reopenDelay >= 0 && typeof inst.open === 'function') {
8246
+ setTimeout(() => {
8247
+ try {
8248
+ inst.open();
8249
+ } catch (_) {}
8250
+ }, reopenDelay);
8251
+ }
8252
+ });
8253
+ return () => {
8254
+ try {
8255
+ conn.disconnect();
8256
+ } catch (_) {}
8257
+ };
8258
+ }).filter(Boolean);
8259
+ }
8260
+ function emitDialogSelection(go, payload) {
8261
+ var _a, _b, _d;
8262
+ const eventPayload = _extends({
8263
+ entityName: go === null || go === void 0 ? void 0 : go.name
8264
+ }, payload);
8265
+ try {
8266
+ (_a = go === null || go === void 0 ? void 0 : go.emit) === null || _a === void 0 ? void 0 : _a.call(go, 'select', eventPayload);
8267
+ } catch (_) {}
8268
+ try {
8269
+ (_b = go === null || go === void 0 ? void 0 : go.emit) === null || _b === void 0 ? void 0 : _b.call(go, 'dialog:select', eventPayload);
8270
+ } catch (_) {}
8271
+ const mx = typeof globalThis !== 'undefined' ? globalThis.mx : undefined;
8272
+ if ((_d = mx === null || mx === void 0 ? void 0 : mx.event) === null || _d === void 0 ? void 0 : _d.emit) {
8273
+ try {
8274
+ mx.event.emit('dialog:select', eventPayload);
8275
+ } catch (_) {}
8276
+ }
8277
+ }
8278
+ function makeDialogButtons(buttons) {
8279
+ if (!(buttons === null || buttons === void 0 ? void 0 : buttons.length)) return undefined;
8280
+ return buttons.map(button => {
8281
+ const options = makeDialogButtonOptions(button);
8282
+ const shouldMaterialize = button.disabled !== undefined || !!(button.nineSliceSprite && (button.width !== undefined || button.height !== undefined));
8283
+ if (button.kind === 'button' || !shouldMaterialize) return options;
8284
+ const pixiButton = new FancyButton$1(options);
8285
+ applyOptionalSize(pixiButton, button);
8286
+ pixiButton.enabled = !button.disabled;
8287
+ return pixiButton;
8288
+ });
8289
+ }
8290
+ function makeDialogButtonOptions(button) {
8291
+ var _a, _b, _d, _e, _f, _g, _h, _j, _k, _l;
8292
+ if (button.kind === 'button') return makeDialogBareButton(button);
8293
+ const width = (_a = button.width) !== null && _a !== void 0 ? _a : 110;
8294
+ const height = (_b = button.height) !== null && _b !== void 0 ? _b : 48;
8295
+ const radius = (_d = button.radius) !== null && _d !== void 0 ? _d : 12;
8296
+ const color = (_e = button.color) !== null && _e !== void 0 ? _e : pixiStoryDefaultButtonColor;
8297
+ return {
8298
+ text: makeDialogText(button.text, button.textStyle),
8299
+ defaultView: (_f = resolveDialogButtonView(button.defaultView)) !== null && _f !== void 0 ? _f : makeDialogButtonView(width, height, radius, color),
8300
+ hoverView: (_g = resolveDialogButtonView(button.hoverView)) !== null && _g !== void 0 ? _g : makeDialogButtonView(width, height, radius, (_h = button.hoverColor) !== null && _h !== void 0 ? _h : color),
8301
+ pressedView: (_j = resolveDialogButtonView(button.pressedView)) !== null && _j !== void 0 ? _j : makeDialogButtonView(width, height, radius, (_k = button.pressedColor) !== null && _k !== void 0 ? _k : color),
8302
+ disabledView: (_l = resolveDialogButtonView(button.disabledView)) !== null && _l !== void 0 ? _l : button.disabledColor ? makeDialogButtonView(width, height, radius, button.disabledColor) : undefined,
8303
+ nineSliceSprite: button.nineSliceSprite,
8304
+ enabled: button.disabled === undefined ? undefined : !button.disabled,
8305
+ animations: button.animations
8306
+ };
8307
+ }
8308
+ function resolveDialogButtonView(view) {
8309
+ return view ? getTextureView(view) : undefined;
8310
+ }
8311
+ const pixiStoryDefaultButtonColor = '#e91e63';
8312
+ const pixiStoryDefaultTextColor = '#ffffff';
8313
+ function makeDialogButtonView(width, height, radius, color) {
8314
+ return new pixi_js.Graphics().roundRect(0, 0, width, height, radius).fill(color);
8315
+ }
8316
+ function makeDialogBareButton(button) {
8317
+ var _a, _b, _d, _e, _f, _g;
8318
+ const width = (_a = button.width) !== null && _a !== void 0 ? _a : 110;
8319
+ const height = (_b = button.height) !== null && _b !== void 0 ? _b : 48;
8320
+ const radius = (_d = button.radius) !== null && _d !== void 0 ? _d : 12;
8321
+ const view = makeDialogButtonView(width, height, radius, (_e = button.color) !== null && _e !== void 0 ? _e : pixiStoryDefaultButtonColor);
8322
+ const label = makeDialogText(button.text, button.textStyle);
8323
+ if (label) {
8324
+ label.x = width / 2;
8325
+ label.y = height / 2;
8326
+ try {
8327
+ (_g = (_f = label.anchor) === null || _f === void 0 ? void 0 : _f.set) === null || _g === void 0 ? void 0 : _g.call(_f, 0.5);
8328
+ } catch (_) {}
8329
+ view.addChild(label);
8330
+ }
8331
+ const pixiButton = new Button$1(view);
8332
+ if (button.disabled !== undefined) pixiButton.enabled = !button.disabled;
8333
+ return pixiButton;
8334
+ }
8335
+ function makeDialogCheckBoxOptions(checkBox) {
8336
+ var _a, _b, _d, _e, _f, _g;
8337
+ const size = (_a = checkBox.size) !== null && _a !== void 0 ? _a : 30;
8338
+ const radius = (_b = checkBox.radius) !== null && _b !== void 0 ? _b : 5;
8339
+ const strokeColor = (_d = checkBox.strokeColor) !== null && _d !== void 0 ? _d : pixiStoryDefaultTextColor;
8340
+ const strokeWidth = (_e = checkBox.strokeWidth) !== null && _e !== void 0 ? _e : 2;
8341
+ return {
8342
+ style: {
8343
+ unchecked: new pixi_js.Graphics().roundRect(0, 0, size, size, radius).fill((_f = checkBox.uncheckedColor) !== null && _f !== void 0 ? _f : '#3e3f40').stroke({
8344
+ color: strokeColor,
8345
+ width: strokeWidth
8346
+ }),
8347
+ checked: new pixi_js.Graphics().roundRect(0, 0, size, size, radius).fill((_g = checkBox.checkedColor) !== null && _g !== void 0 ? _g : pixiStoryDefaultButtonColor).stroke({
8348
+ color: strokeColor,
8349
+ width: strokeWidth
8350
+ }),
8351
+ text: checkBox.textStyle
8352
+ },
8353
+ text: checkBox.text,
8354
+ checked: checkBox.checked
8355
+ };
8356
+ }
7443
8357
  const MASKED_FRAME_DEF = {
7444
8358
  name: 'MaskedFrame',
7445
8359
  signalPrefix: 'maskedframe',
@@ -7453,13 +8367,29 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7453
8367
  },
7454
8368
  borderView: {
7455
8369
  kind: 'opaque'
8370
+ },
8371
+ borderWidth: {
8372
+ kind: 'scalar',
8373
+ default: 0,
8374
+ inspector: {
8375
+ name: 'borderWidth',
8376
+ type: 'number'
8377
+ }
8378
+ },
8379
+ borderColor: {
8380
+ kind: 'scalar',
8381
+ default: 0x000000,
8382
+ inspector: {
8383
+ name: 'borderColor',
8384
+ type: 'color'
8385
+ }
7456
8386
  }
7457
8387
  },
7458
8388
  optionsBuilder: c => ({
7459
- target: c.__resolved_targetView,
7460
- mask: c.__resolved_maskView,
7461
- borderWidth: 0,
7462
- borderColor: 0
8389
+ target: c.__resolved_target_view,
8390
+ mask: c.__resolved_mask_view,
8391
+ borderWidth: c.borderWidth,
8392
+ borderColor: c.borderColor
7463
8393
  })
7464
8394
  };
7465
8395
  const Button = defineUiComponent(BUTTON_DEF);
@@ -7615,10 +8545,22 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7615
8545
  }
7616
8546
  function buildObserverSchema() {
7617
8547
  const out = {
8548
+ Transform: [{
8549
+ prop: ['size'],
8550
+ deep: true
8551
+ }],
8552
+ Shape: [{
8553
+ prop: ['shapes'],
8554
+ deep: true
8555
+ }],
7618
8556
  UI: [{
7619
8557
  prop: ['shapes'],
7620
8558
  deep: true
7621
8559
  }],
8560
+ UIComponent: [{
8561
+ prop: ['shapes'],
8562
+ deep: true
8563
+ }],
7622
8564
  RadioGroup: [{
7623
8565
  prop: ['selectedId'],
7624
8566
  deep: false
@@ -7643,12 +8585,16 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7643
8585
  }
7644
8586
  return out;
7645
8587
  }
8588
+ function isShapeComponentName(name) {
8589
+ return name === 'Shape' || name === 'UI' || name === 'UIComponent';
8590
+ }
7646
8591
  let UISystem = class UISystem extends eva_js.System {
7647
8592
  constructor() {
7648
8593
  super(...arguments);
7649
8594
  this.name = 'UISystem';
7650
8595
  this.instances = new Map();
7651
8596
  this.signalCleanups = new Map();
8597
+ this.transformSizeAuthorities = new Set();
7652
8598
  this.radioGroupInstances = new Map();
7653
8599
  }
7654
8600
  get checkBoxInstances() {
@@ -7668,15 +8614,16 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7668
8614
  }
7669
8615
  componentChanged(changed) {
7670
8616
  const name = changed.componentName;
7671
- if (name === 'UI') return this.handleUI(changed);
8617
+ if (name === 'Transform') return this.handleTransformSizeChanged(changed);
8618
+ if (isShapeComponentName(name)) return this.handleShape(changed);
7672
8619
  if (name === 'RadioGroup') return this.handleRadioGroup(changed);
7673
8620
  const def = COMPONENT_DEFINITIONS[name];
7674
8621
  if (def) return this.handleGeneric(def, changed);
7675
8622
  }
7676
- handleUI(changed) {
8623
+ handleShape(changed) {
7677
8624
  if (changed.type === eva_js.OBSERVER_TYPE.ADD || changed.type === eva_js.OBSERVER_TYPE.CHANGE) {
7678
- const ui = changed.component;
7679
- if (typeof ui.redraw === 'function') ui.redraw();
8625
+ const shape = changed.component;
8626
+ if (typeof shape.redraw === 'function') shape.redraw();
7680
8627
  }
7681
8628
  }
7682
8629
  handleGeneric(def, changed) {
@@ -7694,12 +8641,15 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7694
8641
  return;
7695
8642
  }
7696
8643
  (_a = def.syncOnChange) === null || _a === void 0 ? void 0 : _a.call(def, inst, c);
8644
+ if (this.transformSizeAuthorities.has(go.id)) {
8645
+ applyTransformSizeToInstance(def, inst, c, go, 'component-change');
8646
+ }
7697
8647
  } else if (changed.type === eva_js.OBSERVER_TYPE.REMOVE) {
7698
8648
  this.detachGeneric(go.id, instMap, go);
7699
8649
  }
7700
8650
  }
7701
8651
  attachGeneric(def, c, go, instMap) {
7702
- var _a, _b, _c, _d, _f, _g, _h;
8652
+ var _a, _b, _c, _d, _f, _g, _h, _j, _k;
7703
8653
  if (instMap.has(go.id)) return;
7704
8654
  const game = this.gameRef(go);
7705
8655
  const views = resolveViewsBySchema(game, go, c, def.views);
@@ -7709,19 +8659,30 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7709
8659
  if (def.name === 'List' || def.name === 'ScrollBox') {
7710
8660
  const childName = def.name === 'List' ? c.itemsChildName : c.contentChildName;
7711
8661
  c.__resolved_items = collectChildContainers(game, go, childName);
8662
+ const expectedCount = getCollectedChildCount(go, childName);
8663
+ if (expectedCount > 0 && c.__resolved_items.length < expectedCount && ((_a = c.__collect_retry) !== null && _a !== void 0 ? _a : 0) < 10) {
8664
+ c.__collect_retry = ((_b = c.__collect_retry) !== null && _b !== void 0 ? _b : 0) + 1;
8665
+ requestAnimationFrame(() => this.attachGeneric(def, c, go, instMap));
8666
+ return;
8667
+ }
7712
8668
  }
8669
+ const restoreTransientSize = this.applyTransientTransformSize(c, go);
7713
8670
  const built = def.optionsBuilder(c, views !== null && views !== void 0 ? views : {});
7714
8671
  const inst = def.positional ? new def.pixiClass(...built) : new def.pixiClass(built);
7715
- (_a = def.postCreate) === null || _a === void 0 ? void 0 : _a.call(def, inst, c);
8672
+ (_c = def.postCreate) === null || _c === void 0 ? void 0 : _c.call(def, inst, c);
8673
+ if (this.transformSizeAuthorities.has(go.id) || !hasExplicitRenderSize(c)) {
8674
+ const applied = applyTransformSizeToInstance(def, inst, c, go, 'initial-transform');
8675
+ if (applied) this.transformSizeAuthorities.add(go.id);
8676
+ }
7716
8677
  instMap.set(go.id, inst);
7717
8678
  attachToGameObject(game, go, inst);
7718
8679
  if (def.name === 'Dialog') {
7719
- const contentChild = findChildEntity(go, (_b = c.contentChildName) !== null && _b !== void 0 ? _b : 'content');
8680
+ const contentChild = findChildEntity(go, (_d = c.contentChildName) !== null && _d !== void 0 ? _d : 'content');
7720
8681
  if (contentChild) {
7721
8682
  const cc = getEvaContainer(game, contentChild);
7722
8683
  if (cc) {
7723
8684
  try {
7724
- (_d = (_c = inst).addChild) === null || _d === void 0 ? void 0 : _d.call(_c, cc);
8685
+ (_g = (_f = inst).addChild) === null || _g === void 0 ? void 0 : _g.call(_f, cc);
7725
8686
  } catch (_) {}
7726
8687
  }
7727
8688
  }
@@ -7730,7 +8691,7 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7730
8691
  const border = resolveViewRef(game, go, c.borderView);
7731
8692
  if (border) {
7732
8693
  try {
7733
- (_g = (_f = inst).addChild) === null || _g === void 0 ? void 0 : _g.call(_f, border);
8694
+ (_j = (_h = inst).addChild) === null || _j === void 0 ? void 0 : _j.call(_h, border);
7734
8695
  } catch (_) {}
7735
8696
  }
7736
8697
  }
@@ -7741,7 +8702,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7741
8702
  }, def.signalMap(c));
7742
8703
  this.signalCleanups.set(go.id, offs);
7743
8704
  }
7744
- (_h = def.onAttachedExtra) === null || _h === void 0 ? void 0 : _h.call(def, inst, c, go, game);
8705
+ (_k = def.onAttachedExtra) === null || _k === void 0 ? void 0 : _k.call(def, inst, c, go, game);
8706
+ restoreTransientSize();
7745
8707
  }
7746
8708
  detachGeneric(id, instMap, go) {
7747
8709
  const inst = instMap.get(id);
@@ -7812,6 +8774,12 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7812
8774
  elementsMargin: c.elementsMargin,
7813
8775
  selectedItem: initialIndex
7814
8776
  });
8777
+ if (this.transformSizeAuthorities.has(go.id)) {
8778
+ const size = readTransformRenderSize(go, {
8779
+ allowZero: true
8780
+ });
8781
+ if (size) applyRuntimeSize(inst, size);
8782
+ }
7815
8783
  this.radioGroupInstances.set(go.id, inst);
7816
8784
  attachToGameObject(game, go, inst);
7817
8785
  const offs = bridgeSignals(inst, {
@@ -7847,6 +8815,58 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7847
8815
  }
7848
8816
  return null;
7849
8817
  }
8818
+ handleTransformSizeChanged(changed) {
8819
+ var _a, _b;
8820
+ if (changed.type !== eva_js.OBSERVER_TYPE.CHANGE) return;
8821
+ const transform = changed.component;
8822
+ const go = (_a = changed.gameObject) !== null && _a !== void 0 ? _a : transform === null || transform === void 0 ? void 0 : transform.gameObject;
8823
+ if (!go) return;
8824
+ let applied = false;
8825
+ for (const [componentName, def] of Object.entries(COMPONENT_DEFINITIONS)) {
8826
+ const inst = (_b = this.instances.get(componentName)) === null || _b === void 0 ? void 0 : _b.get(go.id);
8827
+ if (!inst) continue;
8828
+ const component = getComponentSafe(go, componentName);
8829
+ if (applyTransformSizeToInstance(def, inst, component, go, 'transform-change')) {
8830
+ applied = true;
8831
+ }
8832
+ }
8833
+ const radioGroup = this.radioGroupInstances.get(go.id);
8834
+ if (radioGroup) {
8835
+ const size = readTransformRenderSize(go, {
8836
+ allowZero: true
8837
+ });
8838
+ if (size) {
8839
+ applyRuntimeSize(radioGroup, size);
8840
+ applied = true;
8841
+ }
8842
+ }
8843
+ if (applied) this.transformSizeAuthorities.add(go.id);
8844
+ this.relayoutLayoutInstances();
8845
+ }
8846
+ relayoutLayoutInstances() {
8847
+ for (const name of ['List', 'ScrollBox']) {
8848
+ const instMap = this.instances.get(name);
8849
+ if (!instMap) continue;
8850
+ for (const inst of instMap.values()) {
8851
+ relayoutRuntimeInstance(inst);
8852
+ }
8853
+ }
8854
+ }
8855
+ applyTransientTransformSize(c, go) {
8856
+ if (hasExplicitRenderSize(c)) return () => {};
8857
+ const size = readTransformRenderSize(go);
8858
+ if (!size) return () => {};
8859
+ const hadWidth = Object.prototype.hasOwnProperty.call(c, 'width');
8860
+ const hadHeight = Object.prototype.hasOwnProperty.call(c, 'height');
8861
+ const prevWidth = c.width;
8862
+ const prevHeight = c.height;
8863
+ if (size.width !== undefined) c.width = size.width;
8864
+ if (size.height !== undefined) c.height = size.height;
8865
+ return () => {
8866
+ if (hadWidth) c.width = prevWidth;else delete c.width;
8867
+ if (hadHeight) c.height = prevHeight;else delete c.height;
8868
+ };
8869
+ }
7850
8870
  };
7851
8871
  UISystem.systemName = 'UISystem';
7852
8872
  UISystem = __decorate([eva_js.decorators.componentObserver(buildObserverSchema())], UISystem);
@@ -7856,6 +8876,8 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7856
8876
  case 'ProgressBar':
7857
8877
  c.__resolved_bg = resolveViewRef(game, go, c.bgView);
7858
8878
  c.__resolved_fill = resolveViewRef(game, go, c.fillView);
8879
+ c.__resolved_bg_view = c.nineSliceSprite && c.bgView && 'texture' in c.bgView ? c.bgView.texture : c.__resolved_bg;
8880
+ c.__resolved_fill_view = c.nineSliceSprite && c.fillView && 'texture' in c.fillView ? c.fillView.texture : c.__resolved_fill;
7859
8881
  break;
7860
8882
  case 'Select':
7861
8883
  c.__resolved_closedView = resolveViewRef(game, go, c.closedView);
@@ -7864,23 +8886,26 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7864
8886
  case 'Dialog':
7865
8887
  c.__resolved_backdropView = resolveViewRef(game, go, c.backdropView);
7866
8888
  c.__resolved_backgroundView = resolveViewRef(game, go, c.backgroundView);
8889
+ c.__resolved_background_view = c.nineSliceSprite && c.backgroundView && 'texture' in c.backgroundView ? c.backgroundView.texture : c.__resolved_backgroundView;
7867
8890
  break;
7868
8891
  case 'MaskedFrame':
7869
8892
  c.__resolved_targetView = resolveViewRef(game, go, c.targetView);
7870
8893
  c.__resolved_maskView = resolveViewRef(game, go, c.maskView);
8894
+ c.__resolved_target_view = c.targetView && 'texture' in c.targetView ? c.targetView.texture : c.__resolved_targetView;
8895
+ c.__resolved_mask_view = c.maskView && 'texture' in c.maskView ? c.maskView.texture : c.__resolved_maskView;
7871
8896
  break;
7872
8897
  }
7873
8898
  }
7874
8899
  function validateInlineResolved(name, c) {
7875
8900
  switch (name) {
7876
8901
  case 'ProgressBar':
7877
- return !!(c.__resolved_bg && c.__resolved_fill);
8902
+ return !!(c.__resolved_bg_view && c.__resolved_fill_view);
7878
8903
  case 'Select':
7879
8904
  return !!(c.__resolved_closedView && c.__resolved_openView);
7880
8905
  case 'Dialog':
7881
8906
  return true;
7882
8907
  case 'MaskedFrame':
7883
- return !!(c.__resolved_targetView && c.__resolved_maskView);
8908
+ return !!(c.__resolved_target_view && c.__resolved_mask_view);
7884
8909
  default:
7885
8910
  return true;
7886
8911
  }
@@ -7896,14 +8921,44 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7896
8921
  if (!child) continue;
7897
8922
  const childContainer = getEvaContainer(game, child);
7898
8923
  if (childContainer) {
8924
+ if (childContainer.width <= 0 || childContainer.height <= 0) continue;
7899
8925
  try {
7900
8926
  (_c = (_b = childContainer.parent) === null || _b === void 0 ? void 0 : _b.removeChild) === null || _c === void 0 ? void 0 : _c.call(_b, childContainer);
7901
8927
  } catch (_) {}
7902
- result.push(childContainer);
8928
+ result.push(wrapLayoutItem(childContainer, child));
7903
8929
  }
7904
8930
  }
7905
8931
  return result;
7906
8932
  }
8933
+ function wrapLayoutItem(childContainer, child) {
8934
+ const wrapper = new pixi_js.Container();
8935
+ const childName = child === null || child === void 0 ? void 0 : child.name;
8936
+ wrapper.label = childName ? `${childName}:layout-item` : 'plugin-ui-layout-item';
8937
+ wrapper.addChild(childContainer);
8938
+ Object.defineProperty(wrapper, 'width', {
8939
+ get: () => resolveLayoutItemSize(child, childContainer, 'width'),
8940
+ set: () => {},
8941
+ configurable: true
8942
+ });
8943
+ Object.defineProperty(wrapper, 'height', {
8944
+ get: () => resolveLayoutItemSize(child, childContainer, 'height'),
8945
+ set: () => {},
8946
+ configurable: true
8947
+ });
8948
+ return wrapper;
8949
+ }
8950
+ function resolveLayoutItemSize(child, childContainer, key) {
8951
+ var _a, _b;
8952
+ const transformSize = Number((_b = (_a = child === null || child === void 0 ? void 0 : child.transform) === null || _a === void 0 ? void 0 : _a.size) === null || _b === void 0 ? void 0 : _b[key]);
8953
+ if (Number.isFinite(transformSize) && transformSize > 0) return transformSize;
8954
+ const containerSize = Number(childContainer === null || childContainer === void 0 ? void 0 : childContainer[key]);
8955
+ return Number.isFinite(containerSize) ? containerSize : 0;
8956
+ }
8957
+ function getCollectedChildCount(go, childName) {
8958
+ var _a, _b, _c;
8959
+ const contentChild = findChildEntity(go, childName);
8960
+ return (_c = (_b = (_a = contentChild === null || contentChild === void 0 ? void 0 : contentChild.transform) === null || _a === void 0 ? void 0 : _a.children) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0;
8961
+ }
7907
8962
  function findChildEntity(go, name) {
7908
8963
  var _a, _b;
7909
8964
  if (!go) return null;
@@ -7919,6 +8974,14 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7919
8974
  }
7920
8975
  return null;
7921
8976
  }
8977
+ function getComponentSafe(go, componentName) {
8978
+ var _a;
8979
+ try {
8980
+ return (_a = go === null || go === void 0 ? void 0 : go.getComponent) === null || _a === void 0 ? void 0 : _a.call(go, componentName);
8981
+ } catch (_) {
8982
+ return undefined;
8983
+ }
8984
+ }
7922
8985
  exports.Button = Button;
7923
8986
  exports.COMPONENT_DEFINITIONS = COMPONENT_DEFINITIONS;
7924
8987
  exports.CheckBox = CheckBox;
@@ -7935,9 +8998,11 @@ var _EVA_IIFE_ui = function (exports, eva_js, pluginRendererGraphics, pixi_js) {
7935
8998
  exports.RadioGroup = RadioGroup;
7936
8999
  exports.ScrollBox = ScrollBox;
7937
9000
  exports.Select = Select;
9001
+ exports.Shape = Shape;
7938
9002
  exports.Slider = Slider;
7939
9003
  exports.Switcher = Switcher;
7940
- exports.UI = UI;
9004
+ exports.UI = Shape;
9005
+ exports.UIShapeType = UIShapeType;
7941
9006
  exports.UISystem = UISystem$1;
7942
9007
  exports.defineUiComponent = defineUiComponent;
7943
9008
  Object.defineProperty(exports, '__esModule', {