modern-canvas 0.2.4 → 0.3.0

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.
package/dist/index.cjs CHANGED
@@ -5,6 +5,7 @@ const namesPlugin = require('colord/plugins/names');
5
5
  const modernPath2d = require('modern-path2d');
6
6
  const modernIdoc = require('modern-idoc');
7
7
  const modernText = require('modern-text');
8
+ const load = require('yoga-layout/load');
8
9
 
9
10
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
10
11
 
@@ -483,12 +484,12 @@ class CoreObject extends EventEmitter {
483
484
  _performUpdate() {
484
485
  if (!this._updating)
485
486
  return;
486
- this._onUpdate(this._updatedProperties);
487
+ this._update(this._updatedProperties);
487
488
  this._updatedProperties = /* @__PURE__ */ new Map();
488
489
  this._updating = false;
489
490
  }
490
491
  // eslint-disable-next-line unused-imports/no-unused-vars
491
- _onUpdate(changed) {
492
+ _update(changed) {
492
493
  }
493
494
  // eslint-disable-next-line unused-imports/no-unused-vars
494
495
  _updateProperty(key, value, oldValue, declaration) {
@@ -2204,13 +2205,13 @@ class Vector3 extends Vector {
2204
2205
  }
2205
2206
  }
2206
2207
 
2207
- var __defProp$M = Object.defineProperty;
2208
- var __decorateClass$M = (decorators, target, key, kind) => {
2208
+ var __defProp$O = Object.defineProperty;
2209
+ var __decorateClass$O = (decorators, target, key, kind) => {
2209
2210
  var result = undefined ;
2210
2211
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
2211
2212
  if (decorator = decorators[i])
2212
2213
  result = (decorator(target, key, result) ) || result;
2213
- if (result) __defProp$M(target, key, result);
2214
+ if (result) __defProp$O(target, key, result);
2214
2215
  return result;
2215
2216
  };
2216
2217
  class MainLoop extends CoreObject {
@@ -2251,10 +2252,10 @@ class MainLoop extends CoreObject {
2251
2252
  }
2252
2253
  }
2253
2254
  }
2254
- __decorateClass$M([
2255
+ __decorateClass$O([
2255
2256
  property({ default: 24 })
2256
2257
  ], MainLoop.prototype, "fps");
2257
- __decorateClass$M([
2258
+ __decorateClass$O([
2258
2259
  property({ default: 1 })
2259
2260
  ], MainLoop.prototype, "speed");
2260
2261
 
@@ -4398,13 +4399,13 @@ class Geometry extends Resource {
4398
4399
  }
4399
4400
  }
4400
4401
 
4401
- var __defProp$L = Object.defineProperty;
4402
- var __decorateClass$L = (decorators, target, key, kind) => {
4402
+ var __defProp$N = Object.defineProperty;
4403
+ var __decorateClass$N = (decorators, target, key, kind) => {
4403
4404
  var result = undefined ;
4404
4405
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4405
4406
  if (decorator = decorators[i])
4406
4407
  result = (decorator(target, key, result) ) || result;
4407
- if (result) __defProp$L(target, key, result);
4408
+ if (result) __defProp$N(target, key, result);
4408
4409
  return result;
4409
4410
  };
4410
4411
  class IndexBuffer extends Resource {
@@ -4448,20 +4449,20 @@ class IndexBuffer extends Resource {
4448
4449
  return result;
4449
4450
  }
4450
4451
  }
4451
- __decorateClass$L([
4452
+ __decorateClass$N([
4452
4453
  protectedProperty({ default: null })
4453
4454
  ], IndexBuffer.prototype, "data");
4454
- __decorateClass$L([
4455
+ __decorateClass$N([
4455
4456
  protectedProperty({ default: false })
4456
4457
  ], IndexBuffer.prototype, "dynamic");
4457
4458
 
4458
- var __defProp$K = Object.defineProperty;
4459
- var __decorateClass$K = (decorators, target, key, kind) => {
4459
+ var __defProp$M = Object.defineProperty;
4460
+ var __decorateClass$M = (decorators, target, key, kind) => {
4460
4461
  var result = undefined ;
4461
4462
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4462
4463
  if (decorator = decorators[i])
4463
4464
  result = (decorator(target, key, result) ) || result;
4464
- if (result) __defProp$K(target, key, result);
4465
+ if (result) __defProp$M(target, key, result);
4465
4466
  return result;
4466
4467
  };
4467
4468
  class VertexBuffer extends Resource {
@@ -4505,20 +4506,20 @@ class VertexBuffer extends Resource {
4505
4506
  return result;
4506
4507
  }
4507
4508
  }
4508
- __decorateClass$K([
4509
+ __decorateClass$M([
4509
4510
  protectedProperty({ default: null })
4510
4511
  ], VertexBuffer.prototype, "data");
4511
- __decorateClass$K([
4512
+ __decorateClass$M([
4512
4513
  protectedProperty({ default: false })
4513
4514
  ], VertexBuffer.prototype, "dynamic");
4514
4515
 
4515
- var __defProp$J = Object.defineProperty;
4516
- var __decorateClass$J = (decorators, target, key, kind) => {
4516
+ var __defProp$L = Object.defineProperty;
4517
+ var __decorateClass$L = (decorators, target, key, kind) => {
4517
4518
  var result = undefined ;
4518
4519
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4519
4520
  if (decorator = decorators[i])
4520
4521
  result = (decorator(target, key, result) ) || result;
4521
- if (result) __defProp$J(target, key, result);
4522
+ if (result) __defProp$L(target, key, result);
4522
4523
  return result;
4523
4524
  };
4524
4525
  class VertexAttribute extends Resource {
@@ -4555,25 +4556,25 @@ class VertexAttribute extends Resource {
4555
4556
  return result;
4556
4557
  }
4557
4558
  }
4558
- __decorateClass$J([
4559
+ __decorateClass$L([
4559
4560
  protectedProperty()
4560
4561
  ], VertexAttribute.prototype, "buffer");
4561
- __decorateClass$J([
4562
+ __decorateClass$L([
4562
4563
  protectedProperty({ default: 0 })
4563
4564
  ], VertexAttribute.prototype, "size");
4564
- __decorateClass$J([
4565
+ __decorateClass$L([
4565
4566
  protectedProperty({ default: false })
4566
4567
  ], VertexAttribute.prototype, "normalized");
4567
- __decorateClass$J([
4568
+ __decorateClass$L([
4568
4569
  protectedProperty({ default: "float" })
4569
4570
  ], VertexAttribute.prototype, "type");
4570
- __decorateClass$J([
4571
+ __decorateClass$L([
4571
4572
  protectedProperty()
4572
4573
  ], VertexAttribute.prototype, "stride");
4573
- __decorateClass$J([
4574
+ __decorateClass$L([
4574
4575
  protectedProperty()
4575
4576
  ], VertexAttribute.prototype, "offset");
4576
- __decorateClass$J([
4577
+ __decorateClass$L([
4577
4578
  protectedProperty()
4578
4579
  ], VertexAttribute.prototype, "divisor");
4579
4580
 
@@ -4823,13 +4824,13 @@ class UvGeometry extends Geometry {
4823
4824
  }
4824
4825
  }
4825
4826
 
4826
- var __defProp$I = Object.defineProperty;
4827
- var __decorateClass$I = (decorators, target, key, kind) => {
4827
+ var __defProp$K = Object.defineProperty;
4828
+ var __decorateClass$K = (decorators, target, key, kind) => {
4828
4829
  var result = undefined ;
4829
4830
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4830
4831
  if (decorator = decorators[i])
4831
4832
  result = (decorator(target, key, result) ) || result;
4832
- if (result) __defProp$I(target, key, result);
4833
+ if (result) __defProp$K(target, key, result);
4833
4834
  return result;
4834
4835
  };
4835
4836
  const style2DFilterDefault = {
@@ -5046,76 +5047,76 @@ class CanvasItemStyle extends Resource {
5046
5047
  return m;
5047
5048
  }
5048
5049
  }
5049
- __decorateClass$I([
5050
+ __decorateClass$K([
5050
5051
  property({ default: "none" })
5051
5052
  ], CanvasItemStyle.prototype, "backgroundColor");
5052
- __decorateClass$I([
5053
+ __decorateClass$K([
5053
5054
  property({ default: "none" })
5054
5055
  ], CanvasItemStyle.prototype, "backgroundImage");
5055
- __decorateClass$I([
5056
+ __decorateClass$K([
5056
5057
  property({ default: "none" })
5057
5058
  ], CanvasItemStyle.prototype, "filter");
5058
- __decorateClass$I([
5059
+ __decorateClass$K([
5059
5060
  property({ default: "inherit" })
5060
5061
  ], CanvasItemStyle.prototype, "direction");
5061
- __decorateClass$I([
5062
+ __decorateClass$K([
5062
5063
  property({ default: "none" })
5063
5064
  ], CanvasItemStyle.prototype, "boxShadow");
5064
- __decorateClass$I([
5065
+ __decorateClass$K([
5065
5066
  property({ default: "none" })
5066
5067
  ], CanvasItemStyle.prototype, "maskImage");
5067
- __decorateClass$I([
5068
+ __decorateClass$K([
5068
5069
  property({ default: 1 })
5069
5070
  ], CanvasItemStyle.prototype, "opacity");
5070
- __decorateClass$I([
5071
+ __decorateClass$K([
5071
5072
  property({ default: 0 })
5072
5073
  ], CanvasItemStyle.prototype, "borderWidth");
5073
- __decorateClass$I([
5074
+ __decorateClass$K([
5074
5075
  property({ default: 0 })
5075
5076
  ], CanvasItemStyle.prototype, "borderRadius");
5076
- __decorateClass$I([
5077
+ __decorateClass$K([
5077
5078
  property({ default: "#000000" })
5078
5079
  ], CanvasItemStyle.prototype, "borderColor");
5079
- __decorateClass$I([
5080
+ __decorateClass$K([
5080
5081
  property({ default: "none" })
5081
5082
  ], CanvasItemStyle.prototype, "borderStyle");
5082
- __decorateClass$I([
5083
+ __decorateClass$K([
5083
5084
  property({ default: 0 })
5084
5085
  ], CanvasItemStyle.prototype, "outlineWidth");
5085
- __decorateClass$I([
5086
+ __decorateClass$K([
5086
5087
  property({ default: 0 })
5087
5088
  ], CanvasItemStyle.prototype, "outlineOffset");
5088
- __decorateClass$I([
5089
+ __decorateClass$K([
5089
5090
  property({ default: "#000000" })
5090
5091
  ], CanvasItemStyle.prototype, "outlineColor");
5091
- __decorateClass$I([
5092
+ __decorateClass$K([
5092
5093
  property({ default: "none" })
5093
5094
  ], CanvasItemStyle.prototype, "outlineStyle");
5094
- __decorateClass$I([
5095
+ __decorateClass$K([
5095
5096
  property({ default: "visible" })
5096
5097
  ], CanvasItemStyle.prototype, "visibility");
5097
- __decorateClass$I([
5098
+ __decorateClass$K([
5098
5099
  property({ default: "visible" })
5099
5100
  ], CanvasItemStyle.prototype, "overflow");
5100
- __decorateClass$I([
5101
+ __decorateClass$K([
5101
5102
  property({ default: "auto" })
5102
5103
  ], CanvasItemStyle.prototype, "pointerEvents");
5103
- const transformStyle = modernIdoc.getDefaultTransformStyle();
5104
- for (const key in transformStyle) {
5105
- defineProperty(CanvasItemStyle, key, { default: transformStyle[key] });
5104
+ const transformStyle$1 = modernIdoc.getDefaultTransformStyle();
5105
+ for (const key in transformStyle$1) {
5106
+ defineProperty(CanvasItemStyle, key, { default: transformStyle$1[key] });
5106
5107
  }
5107
- const textStyle = modernIdoc.getDefaultTextStyle();
5108
- for (const key in textStyle) {
5109
- defineProperty(CanvasItemStyle, key, { default: textStyle[key] });
5108
+ const textStyle$1 = modernIdoc.getDefaultTextStyle();
5109
+ for (const key in textStyle$1) {
5110
+ defineProperty(CanvasItemStyle, key, { default: textStyle$1[key] });
5110
5111
  }
5111
5112
 
5112
- var __defProp$H = Object.defineProperty;
5113
- var __decorateClass$H = (decorators, target, key, kind) => {
5113
+ var __defProp$J = Object.defineProperty;
5114
+ var __decorateClass$J = (decorators, target, key, kind) => {
5114
5115
  var result = undefined ;
5115
5116
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5116
5117
  if (decorator = decorators[i])
5117
5118
  result = (decorator(target, key, result) ) || result;
5118
- if (result) __defProp$H(target, key, result);
5119
+ if (result) __defProp$J(target, key, result);
5119
5120
  return result;
5120
5121
  };
5121
5122
  class Texture2D extends Resource {
@@ -5241,32 +5242,32 @@ class Texture2D extends Resource {
5241
5242
  }
5242
5243
  }
5243
5244
  }
5244
- __decorateClass$H([
5245
+ __decorateClass$J([
5245
5246
  protectedProperty()
5246
5247
  ], Texture2D.prototype, "source");
5247
- __decorateClass$H([
5248
+ __decorateClass$J([
5248
5249
  property({ default: 0 })
5249
5250
  ], Texture2D.prototype, "width");
5250
- __decorateClass$H([
5251
+ __decorateClass$J([
5251
5252
  property({ default: 0 })
5252
5253
  ], Texture2D.prototype, "height");
5253
- __decorateClass$H([
5254
+ __decorateClass$J([
5254
5255
  property({ default: "linear" })
5255
5256
  ], Texture2D.prototype, "filterMode");
5256
- __decorateClass$H([
5257
+ __decorateClass$J([
5257
5258
  property({ default: "clamp_to_edge" })
5258
5259
  ], Texture2D.prototype, "wrapMode");
5259
- __decorateClass$H([
5260
+ __decorateClass$J([
5260
5261
  property({ default: 1 })
5261
5262
  ], Texture2D.prototype, "pixelRatio");
5262
5263
 
5263
- var __defProp$G = Object.defineProperty;
5264
- var __decorateClass$G = (decorators, target, key, kind) => {
5264
+ var __defProp$I = Object.defineProperty;
5265
+ var __decorateClass$I = (decorators, target, key, kind) => {
5265
5266
  var result = undefined ;
5266
5267
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5267
5268
  if (decorator = decorators[i])
5268
5269
  result = (decorator(target, key, result) ) || result;
5269
- if (result) __defProp$G(target, key, result);
5270
+ if (result) __defProp$I(target, key, result);
5270
5271
  return result;
5271
5272
  };
5272
5273
  class CanvasTexture extends Texture2D {
@@ -5285,7 +5286,7 @@ class CanvasTexture extends Texture2D {
5285
5286
  super._updateProperty(key, value, oldValue, declaration);
5286
5287
  }
5287
5288
  }
5288
- __decorateClass$G([
5289
+ __decorateClass$I([
5289
5290
  property({ default: 2 })
5290
5291
  ], CanvasTexture.prototype, "pixelRatio");
5291
5292
 
@@ -5443,13 +5444,13 @@ class PixelsTexture extends Texture2D {
5443
5444
  }
5444
5445
  }
5445
5446
 
5446
- var __defProp$F = Object.defineProperty;
5447
- var __decorateClass$F = (decorators, target, key, kind) => {
5447
+ var __defProp$H = Object.defineProperty;
5448
+ var __decorateClass$H = (decorators, target, key, kind) => {
5448
5449
  var result = undefined ;
5449
5450
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5450
5451
  if (decorator = decorators[i])
5451
5452
  result = (decorator(target, key, result) ) || result;
5452
- if (result) __defProp$F(target, key, result);
5453
+ if (result) __defProp$H(target, key, result);
5453
5454
  return result;
5454
5455
  };
5455
5456
  function resolveOptions(options) {
@@ -5693,10 +5694,10 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
5693
5694
  }
5694
5695
  }
5695
5696
  };
5696
- __decorateClass$F([
5697
+ __decorateClass$H([
5697
5698
  protectedProperty({ default: true })
5698
5699
  ], _VideoTexture.prototype, "autoUpdate");
5699
- __decorateClass$F([
5700
+ __decorateClass$H([
5700
5701
  protectedProperty({ default: 0 })
5701
5702
  ], _VideoTexture.prototype, "fps");
5702
5703
  let VideoTexture = _VideoTexture;
@@ -5866,18 +5867,25 @@ class CanvasContext extends modernPath2d.Path2D {
5866
5867
  }
5867
5868
  }
5868
5869
 
5869
- var __defProp$E = Object.defineProperty;
5870
- var __getOwnPropDesc$D = Object.getOwnPropertyDescriptor;
5871
- var __decorateClass$E = (decorators, target, key, kind) => {
5872
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$D(target, key) : target;
5870
+ var __defProp$G = Object.defineProperty;
5871
+ var __getOwnPropDesc$E = Object.getOwnPropertyDescriptor;
5872
+ var __decorateClass$G = (decorators, target, key, kind) => {
5873
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$E(target, key) : target;
5873
5874
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5874
5875
  if (decorator = decorators[i])
5875
5876
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5876
- if (kind && result) __defProp$E(target, key, result);
5877
+ if (kind && result) __defProp$G(target, key, result);
5877
5878
  return result;
5878
5879
  };
5880
+ const tagUidMap = {};
5881
+ function getTagUid(tag) {
5882
+ let uid = tagUidMap[tag] ?? 0;
5883
+ uid++;
5884
+ tagUidMap[tag] = uid;
5885
+ return uid;
5886
+ }
5879
5887
  exports.Node = class Node extends CoreObject {
5880
- name = `${this.tag}:${String(this.instanceId)}`;
5888
+ name = `${this.tag}:${getTagUid(this.tag)}`;
5881
5889
  mask;
5882
5890
  _readyed = false;
5883
5891
  constructor(properties, children = []) {
@@ -5888,7 +5896,8 @@ exports.Node = class Node extends CoreObject {
5888
5896
  this._onUnparented = this._onUnparented.bind(this);
5889
5897
  this._onReady = this._onReady.bind(this);
5890
5898
  this._onProcess = this._onProcess.bind(this);
5891
- this.setProperties(properties).append(children).on("treeEnter", this._onTreeEnter).on("treeExit", this._onTreeExit).on("parented", this._onParented).on("unparented", this._onUnparented).on("ready", this._onReady).on("process", this._onProcess);
5899
+ this.setProperties(properties).append(children);
5900
+ this.on("treeEnter", this._onTreeEnter).on("treeExit", this._onTreeExit).on("parented", this._onParented).on("unparented", this._onUnparented).on("ready", this._onReady).on("process", this._onProcess);
5892
5901
  }
5893
5902
  /** Name */
5894
5903
  getName() {
@@ -6075,7 +6084,7 @@ exports.Node = class Node extends CoreObject {
6075
6084
  if (this.mask instanceof exports.Node) {
6076
6085
  if (!this.getNode("__$mask")) {
6077
6086
  this.mask.processMode = "disabled";
6078
- this.addChild(this.mask, "front");
6087
+ this.appendChild(this.mask, "front");
6079
6088
  }
6080
6089
  } else {
6081
6090
  const mask = this.getNode("__$mask");
@@ -6141,42 +6150,41 @@ exports.Node = class Node extends CoreObject {
6141
6150
  this._parent.moveChild(sibling, this.getIndex(true) + 1);
6142
6151
  return this;
6143
6152
  }
6144
- append(...children) {
6145
- let nodes;
6146
- if (Array.isArray(children[0])) {
6147
- nodes = children[0];
6153
+ append(...nodes) {
6154
+ let _nodes;
6155
+ if (Array.isArray(nodes[0])) {
6156
+ _nodes = nodes[0];
6148
6157
  } else {
6149
- nodes = children;
6158
+ _nodes = nodes;
6150
6159
  }
6151
- nodes.forEach((node) => {
6152
- this.addChild(node);
6160
+ _nodes.forEach((node) => {
6161
+ this.appendChild(node);
6153
6162
  });
6154
- return this;
6155
6163
  }
6156
- addChild(child, internalMode = child.internalMode) {
6157
- if (this.is(child) || child.hasParent()) {
6158
- return this;
6164
+ appendChild(node, internalMode = node.internalMode) {
6165
+ if (this.is(node) || node.hasParent()) {
6166
+ return node;
6159
6167
  }
6160
6168
  switch (internalMode) {
6161
6169
  case "default":
6162
6170
  case "front": {
6163
6171
  const targetMode = internalMode === "default" ? "back" : "front";
6164
- const index = this._children.findIndex((child2) => child2.internalMode === targetMode);
6172
+ const index = this._children.findIndex((node2) => node2.internalMode === targetMode);
6165
6173
  if (index > -1) {
6166
- this._children.splice(index, 0, child);
6174
+ this._children.splice(index, 0, node);
6167
6175
  } else {
6168
- this._children.push(child);
6176
+ this._children.push(node);
6169
6177
  }
6170
6178
  break;
6171
6179
  }
6172
6180
  case "back":
6173
- this._children.push(child);
6181
+ this._children.push(node);
6174
6182
  break;
6175
6183
  }
6176
- child.internalMode = internalMode;
6177
- child.setParent(this);
6178
- this.emit("addChild", child);
6179
- return this;
6184
+ node.internalMode = internalMode;
6185
+ node.setParent(this);
6186
+ this.emit("appendChild", node);
6187
+ return node;
6180
6188
  }
6181
6189
  moveChild(child, toIndex, internalMode = child.internalMode) {
6182
6190
  if (this.is(child) || child.hasParent() && !this.is(child.parent)) {
@@ -6207,7 +6215,7 @@ exports.Node = class Node extends CoreObject {
6207
6215
  return false;
6208
6216
  }
6209
6217
  });
6210
- maxIndex = maxIndex > -1 ? minIndex + maxIndex : Math.max(0, this._children.length - 1);
6218
+ maxIndex = maxIndex > -1 ? minIndex + maxIndex : Math.max(0, this._children.length);
6211
6219
  const newIndex = clamp(minIndex, toIndex > -1 ? toIndex : maxIndex, maxIndex);
6212
6220
  if (newIndex !== oldIndex) {
6213
6221
  if (oldIndex > -1) {
@@ -6222,7 +6230,7 @@ exports.Node = class Node extends CoreObject {
6222
6230
  if (oldIndex > -1) {
6223
6231
  this.emit("moveChild", child, newIndex, oldIndex);
6224
6232
  } else {
6225
- this.emit("addChild", child);
6233
+ this.emit("appendChild", child);
6226
6234
  }
6227
6235
  }
6228
6236
  return this;
@@ -6234,7 +6242,7 @@ exports.Node = class Node extends CoreObject {
6234
6242
  child.setParent(undefined);
6235
6243
  this.emit("removeChild", child, index);
6236
6244
  }
6237
- return this;
6245
+ return child;
6238
6246
  }
6239
6247
  removeChildren() {
6240
6248
  this.getChildren().forEach((child) => this.removeChild(child));
@@ -6294,37 +6302,37 @@ exports.Node = class Node extends CoreObject {
6294
6302
  const { tag, props, children } = JSON;
6295
6303
  const NodeClass = customNodes.get(tag) ?? exports.Node;
6296
6304
  const node = new NodeClass(props);
6297
- children?.forEach((child) => node.addChild(this.parse(child)));
6305
+ children?.forEach((child) => node.appendChild(this.parse(child)));
6298
6306
  return node;
6299
6307
  }
6300
6308
  };
6301
- __decorateClass$E([
6309
+ __decorateClass$G([
6302
6310
  property()
6303
6311
  ], exports.Node.prototype, "name", 2);
6304
- __decorateClass$E([
6312
+ __decorateClass$G([
6305
6313
  property()
6306
6314
  ], exports.Node.prototype, "mask", 2);
6307
- __decorateClass$E([
6315
+ __decorateClass$G([
6308
6316
  property({ default: "inherit" })
6309
6317
  ], exports.Node.prototype, "processMode", 2);
6310
- __decorateClass$E([
6318
+ __decorateClass$G([
6311
6319
  property({ default: "inherit" })
6312
6320
  ], exports.Node.prototype, "renderMode", 2);
6313
- __decorateClass$E([
6321
+ __decorateClass$G([
6314
6322
  property({ default: "default" })
6315
6323
  ], exports.Node.prototype, "internalMode", 2);
6316
- exports.Node = __decorateClass$E([
6324
+ exports.Node = __decorateClass$G([
6317
6325
  customNode("Node")
6318
6326
  ], exports.Node);
6319
6327
 
6320
- var __defProp$D = Object.defineProperty;
6321
- var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor;
6322
- var __decorateClass$D = (decorators, target, key, kind) => {
6323
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$C(target, key) : target;
6328
+ var __defProp$F = Object.defineProperty;
6329
+ var __getOwnPropDesc$D = Object.getOwnPropertyDescriptor;
6330
+ var __decorateClass$F = (decorators, target, key, kind) => {
6331
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$D(target, key) : target;
6324
6332
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6325
6333
  if (decorator = decorators[i])
6326
6334
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6327
- if (kind && result) __defProp$D(target, key, result);
6335
+ if (kind && result) __defProp$F(target, key, result);
6328
6336
  return result;
6329
6337
  };
6330
6338
  exports.TimelineNode = class TimelineNode extends exports.Node {
@@ -6383,27 +6391,27 @@ exports.TimelineNode = class TimelineNode extends exports.Node {
6383
6391
  super._process(delta);
6384
6392
  }
6385
6393
  };
6386
- __decorateClass$D([
6394
+ __decorateClass$F([
6387
6395
  property({ default: 0 })
6388
6396
  ], exports.TimelineNode.prototype, "delay", 2);
6389
- __decorateClass$D([
6397
+ __decorateClass$F([
6390
6398
  property({ default: 0 })
6391
6399
  ], exports.TimelineNode.prototype, "duration", 2);
6392
- __decorateClass$D([
6400
+ __decorateClass$F([
6393
6401
  property({ default: false })
6394
6402
  ], exports.TimelineNode.prototype, "paused", 2);
6395
- exports.TimelineNode = __decorateClass$D([
6403
+ exports.TimelineNode = __decorateClass$F([
6396
6404
  customNode("TimelineNode")
6397
6405
  ], exports.TimelineNode);
6398
6406
 
6399
- var __defProp$C = Object.defineProperty;
6400
- var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor;
6401
- var __decorateClass$C = (decorators, target, key, kind) => {
6402
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$B(target, key) : target;
6407
+ var __defProp$E = Object.defineProperty;
6408
+ var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor;
6409
+ var __decorateClass$E = (decorators, target, key, kind) => {
6410
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$C(target, key) : target;
6403
6411
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6404
6412
  if (decorator = decorators[i])
6405
6413
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6406
- if (kind && result) __defProp$C(target, key, result);
6414
+ if (kind && result) __defProp$E(target, key, result);
6407
6415
  return result;
6408
6416
  };
6409
6417
  exports.Viewport = class Viewport extends exports.Node {
@@ -6541,35 +6549,33 @@ exports.Viewport = class Viewport extends exports.Node {
6541
6549
  return this._projection.toArray(transpose);
6542
6550
  }
6543
6551
  };
6544
- __decorateClass$C([
6552
+ __decorateClass$E([
6545
6553
  property({ default: 0 })
6546
6554
  ], exports.Viewport.prototype, "x", 2);
6547
- __decorateClass$C([
6555
+ __decorateClass$E([
6548
6556
  property({ default: 0 })
6549
6557
  ], exports.Viewport.prototype, "y", 2);
6550
- __decorateClass$C([
6558
+ __decorateClass$E([
6551
6559
  property({ default: 0 })
6552
6560
  ], exports.Viewport.prototype, "width", 2);
6553
- __decorateClass$C([
6561
+ __decorateClass$E([
6554
6562
  property({ default: 0 })
6555
6563
  ], exports.Viewport.prototype, "height", 2);
6556
- exports.Viewport = __decorateClass$C([
6564
+ exports.Viewport = __decorateClass$E([
6557
6565
  customNode("Viewport")
6558
6566
  ], exports.Viewport);
6559
6567
 
6560
- var __defProp$B = Object.defineProperty;
6561
- var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor;
6562
- var __decorateClass$B = (decorators, target, key, kind) => {
6563
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$A(target, key) : target;
6568
+ var __defProp$D = Object.defineProperty;
6569
+ var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor;
6570
+ var __decorateClass$D = (decorators, target, key, kind) => {
6571
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$B(target, key) : target;
6564
6572
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6565
6573
  if (decorator = decorators[i])
6566
6574
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6567
- if (kind && result) __defProp$B(target, key, result);
6575
+ if (kind && result) __defProp$D(target, key, result);
6568
6576
  return result;
6569
6577
  };
6570
6578
  exports.Effect = class Effect extends exports.TimelineNode {
6571
- material;
6572
- effectMode;
6573
6579
  get _effectMode() {
6574
6580
  return this.effectMode ?? "parent";
6575
6581
  }
@@ -6803,34 +6809,34 @@ exports.Effect = class Effect extends exports.TimelineNode {
6803
6809
  }
6804
6810
  }
6805
6811
  };
6806
- __decorateClass$B([
6812
+ __decorateClass$D([
6807
6813
  protectedProperty()
6808
6814
  ], exports.Effect.prototype, "material", 2);
6809
- __decorateClass$B([
6815
+ __decorateClass$D([
6810
6816
  property()
6811
6817
  ], exports.Effect.prototype, "effectMode", 2);
6812
- __decorateClass$B([
6818
+ __decorateClass$D([
6813
6819
  property({ default: "" })
6814
6820
  ], exports.Effect.prototype, "glsl", 2);
6815
- __decorateClass$B([
6821
+ __decorateClass$D([
6816
6822
  property({ default: "" })
6817
6823
  ], exports.Effect.prototype, "glslSrc", 2);
6818
- exports.Effect = __decorateClass$B([
6824
+ exports.Effect = __decorateClass$D([
6819
6825
  customNode("Effect")
6820
6826
  ], exports.Effect);
6821
6827
 
6822
- var __defProp$A = Object.defineProperty;
6823
- var __getOwnPropDesc$z = Object.getOwnPropertyDescriptor;
6824
- var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6825
- var __decorateClass$A = (decorators, target, key, kind) => {
6826
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$z(target, key) : target;
6828
+ var __defProp$C = Object.defineProperty;
6829
+ var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor;
6830
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6831
+ var __decorateClass$C = (decorators, target, key, kind) => {
6832
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$A(target, key) : target;
6827
6833
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6828
6834
  if (decorator = decorators[i])
6829
6835
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6830
- if (kind && result) __defProp$A(target, key, result);
6836
+ if (kind && result) __defProp$C(target, key, result);
6831
6837
  return result;
6832
6838
  };
6833
- var __publicField$h = (obj, key, value) => __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
6839
+ var __publicField$i = (obj, key, value) => __defNormalProp$i(obj, typeof key !== "symbol" ? key + "" : key, value);
6834
6840
  const vertX = `attribute vec2 position;
6835
6841
  attribute vec2 uv;
6836
6842
  varying vec2 vUv[9];
@@ -6916,36 +6922,36 @@ exports.BlurEffect = class BlurEffect extends exports.Effect {
6916
6922
  });
6917
6923
  }
6918
6924
  };
6919
- __publicField$h(exports.BlurEffect, "materialX", new Material({
6925
+ __publicField$i(exports.BlurEffect, "materialX", new Material({
6920
6926
  vert: vertX,
6921
6927
  frag
6922
6928
  }));
6923
- __publicField$h(exports.BlurEffect, "materialY", new Material({
6929
+ __publicField$i(exports.BlurEffect, "materialY", new Material({
6924
6930
  vert: vertY,
6925
6931
  frag
6926
6932
  }));
6927
- __decorateClass$A([
6933
+ __decorateClass$C([
6928
6934
  property({ default: 8 })
6929
6935
  ], exports.BlurEffect.prototype, "strength", 2);
6930
- __decorateClass$A([
6936
+ __decorateClass$C([
6931
6937
  property({ default: 4 })
6932
6938
  ], exports.BlurEffect.prototype, "quality", 2);
6933
- exports.BlurEffect = __decorateClass$A([
6939
+ exports.BlurEffect = __decorateClass$C([
6934
6940
  customNode("BlurEffect")
6935
6941
  ], exports.BlurEffect);
6936
6942
 
6937
- var __defProp$z = Object.defineProperty;
6938
- var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor;
6939
- var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6940
- var __decorateClass$z = (decorators, target, key, kind) => {
6941
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$y(target, key) : target;
6943
+ var __defProp$B = Object.defineProperty;
6944
+ var __getOwnPropDesc$z = Object.getOwnPropertyDescriptor;
6945
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6946
+ var __decorateClass$B = (decorators, target, key, kind) => {
6947
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$z(target, key) : target;
6942
6948
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6943
6949
  if (decorator = decorators[i])
6944
6950
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6945
- if (kind && result) __defProp$z(target, key, result);
6951
+ if (kind && result) __defProp$B(target, key, result);
6946
6952
  return result;
6947
6953
  };
6948
- var __publicField$g = (obj, key, value) => __defNormalProp$g(obj, key + "" , value);
6954
+ var __publicField$h = (obj, key, value) => __defNormalProp$h(obj, key + "" , value);
6949
6955
  exports.ColorAdjustEffect = class ColorAdjustEffect extends exports.Effect {
6950
6956
  saturation = 1;
6951
6957
  contrast = 1;
@@ -6971,7 +6977,7 @@ exports.ColorAdjustEffect = class ColorAdjustEffect extends exports.Effect {
6971
6977
  });
6972
6978
  }
6973
6979
  };
6974
- __publicField$g(exports.ColorAdjustEffect, "material", new Material({
6980
+ __publicField$h(exports.ColorAdjustEffect, "material", new Material({
6975
6981
  vert: `precision mediump float;
6976
6982
  attribute vec2 position;
6977
6983
  attribute vec2 uv;
@@ -7006,46 +7012,46 @@ void main(void) {
7006
7012
  gl_FragColor = c * alpha;
7007
7013
  }`
7008
7014
  }));
7009
- __decorateClass$z([
7015
+ __decorateClass$B([
7010
7016
  property()
7011
7017
  ], exports.ColorAdjustEffect.prototype, "saturation", 2);
7012
- __decorateClass$z([
7018
+ __decorateClass$B([
7013
7019
  property()
7014
7020
  ], exports.ColorAdjustEffect.prototype, "contrast", 2);
7015
- __decorateClass$z([
7021
+ __decorateClass$B([
7016
7022
  property()
7017
7023
  ], exports.ColorAdjustEffect.prototype, "brightness", 2);
7018
- __decorateClass$z([
7024
+ __decorateClass$B([
7019
7025
  property()
7020
7026
  ], exports.ColorAdjustEffect.prototype, "red", 2);
7021
- __decorateClass$z([
7027
+ __decorateClass$B([
7022
7028
  property()
7023
7029
  ], exports.ColorAdjustEffect.prototype, "green", 2);
7024
- __decorateClass$z([
7030
+ __decorateClass$B([
7025
7031
  property()
7026
7032
  ], exports.ColorAdjustEffect.prototype, "blue", 2);
7027
- __decorateClass$z([
7033
+ __decorateClass$B([
7028
7034
  property()
7029
7035
  ], exports.ColorAdjustEffect.prototype, "alpha", 2);
7030
- __decorateClass$z([
7036
+ __decorateClass$B([
7031
7037
  property()
7032
7038
  ], exports.ColorAdjustEffect.prototype, "gamma", 2);
7033
- exports.ColorAdjustEffect = __decorateClass$z([
7039
+ exports.ColorAdjustEffect = __decorateClass$B([
7034
7040
  customNode("ColorAdjustEffect")
7035
7041
  ], exports.ColorAdjustEffect);
7036
7042
 
7037
- var __defProp$y = Object.defineProperty;
7038
- var __getOwnPropDesc$x = Object.getOwnPropertyDescriptor;
7039
- var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7040
- var __decorateClass$y = (decorators, target, key, kind) => {
7041
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$x(target, key) : target;
7043
+ var __defProp$A = Object.defineProperty;
7044
+ var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor;
7045
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7046
+ var __decorateClass$A = (decorators, target, key, kind) => {
7047
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$y(target, key) : target;
7042
7048
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7043
7049
  if (decorator = decorators[i])
7044
7050
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7045
- if (kind && result) __defProp$y(target, key, result);
7051
+ if (kind && result) __defProp$A(target, key, result);
7046
7052
  return result;
7047
7053
  };
7048
- var __publicField$f = (obj, key, value) => __defNormalProp$f(obj, key + "" , value);
7054
+ var __publicField$g = (obj, key, value) => __defNormalProp$g(obj, key + "" , value);
7049
7055
  exports.ColorFilterEffect = class ColorFilterEffect extends exports.Effect {
7050
7056
  _colorMatrix = new ColorMatrix();
7051
7057
  constructor(properties) {
@@ -7095,7 +7101,7 @@ exports.ColorFilterEffect = class ColorFilterEffect extends exports.Effect {
7095
7101
  });
7096
7102
  }
7097
7103
  };
7098
- __publicField$f(exports.ColorFilterEffect, "material", new Material({
7104
+ __publicField$g(exports.ColorFilterEffect, "material", new Material({
7099
7105
  vert: `precision mediump float;
7100
7106
  attribute vec2 position;
7101
7107
  attribute vec2 uv;
@@ -7122,25 +7128,25 @@ void main(void) {
7122
7128
  );
7123
7129
  }`
7124
7130
  }));
7125
- __decorateClass$y([
7131
+ __decorateClass$A([
7126
7132
  property({ default: "" })
7127
7133
  ], exports.ColorFilterEffect.prototype, "filter", 2);
7128
- exports.ColorFilterEffect = __decorateClass$y([
7134
+ exports.ColorFilterEffect = __decorateClass$A([
7129
7135
  customNode("ColorFilterEffect")
7130
7136
  ], exports.ColorFilterEffect);
7131
7137
 
7132
- var __defProp$x = Object.defineProperty;
7133
- var __getOwnPropDesc$w = Object.getOwnPropertyDescriptor;
7134
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7135
- var __decorateClass$x = (decorators, target, key, kind) => {
7136
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$w(target, key) : target;
7138
+ var __defProp$z = Object.defineProperty;
7139
+ var __getOwnPropDesc$x = Object.getOwnPropertyDescriptor;
7140
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7141
+ var __decorateClass$z = (decorators, target, key, kind) => {
7142
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$x(target, key) : target;
7137
7143
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7138
7144
  if (decorator = decorators[i])
7139
7145
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7140
- if (kind && result) __defProp$x(target, key, result);
7146
+ if (kind && result) __defProp$z(target, key, result);
7141
7147
  return result;
7142
7148
  };
7143
- var __publicField$e = (obj, key, value) => __defNormalProp$e(obj, key + "" , value);
7149
+ var __publicField$f = (obj, key, value) => __defNormalProp$f(obj, key + "" , value);
7144
7150
  const MAX_COLORS$1 = 50;
7145
7151
  exports.ColorOverlayEffect = class ColorOverlayEffect extends exports.Effect {
7146
7152
  colors = [];
@@ -7164,7 +7170,7 @@ exports.ColorOverlayEffect = class ColorOverlayEffect extends exports.Effect {
7164
7170
  });
7165
7171
  }
7166
7172
  };
7167
- __publicField$e(exports.ColorOverlayEffect, "material", new Material({
7173
+ __publicField$f(exports.ColorOverlayEffect, "material", new Material({
7168
7174
  vert: `precision mediump float;
7169
7175
  attribute vec2 position;
7170
7176
  attribute vec2 uv;
@@ -7211,28 +7217,28 @@ void main(void) {
7211
7217
  gl_FragColor = vec4(mix(color.rgb, mask.rgb, color.a * mask.a), color.a);
7212
7218
  }`
7213
7219
  }));
7214
- __decorateClass$x([
7220
+ __decorateClass$z([
7215
7221
  property()
7216
7222
  ], exports.ColorOverlayEffect.prototype, "colors", 2);
7217
- __decorateClass$x([
7223
+ __decorateClass$z([
7218
7224
  property()
7219
7225
  ], exports.ColorOverlayEffect.prototype, "alpha", 2);
7220
- exports.ColorOverlayEffect = __decorateClass$x([
7226
+ exports.ColorOverlayEffect = __decorateClass$z([
7221
7227
  customNode("ColorOverlayEffect")
7222
7228
  ], exports.ColorOverlayEffect);
7223
7229
 
7224
- var __defProp$w = Object.defineProperty;
7225
- var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
7226
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7227
- var __decorateClass$w = (decorators, target, key, kind) => {
7228
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$v(target, key) : target;
7230
+ var __defProp$y = Object.defineProperty;
7231
+ var __getOwnPropDesc$w = Object.getOwnPropertyDescriptor;
7232
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7233
+ var __decorateClass$y = (decorators, target, key, kind) => {
7234
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$w(target, key) : target;
7229
7235
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7230
7236
  if (decorator = decorators[i])
7231
7237
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7232
- if (kind && result) __defProp$w(target, key, result);
7238
+ if (kind && result) __defProp$y(target, key, result);
7233
7239
  return result;
7234
7240
  };
7235
- var __publicField$d = (obj, key, value) => __defNormalProp$d(obj, key + "" , value);
7241
+ var __publicField$e = (obj, key, value) => __defNormalProp$e(obj, key + "" , value);
7236
7242
  exports.ColorRemoveEffect = class ColorRemoveEffect extends exports.Effect {
7237
7243
  colors = [];
7238
7244
  epsilon = 0.5;
@@ -7261,7 +7267,7 @@ exports.ColorRemoveEffect = class ColorRemoveEffect extends exports.Effect {
7261
7267
  });
7262
7268
  }
7263
7269
  };
7264
- __publicField$d(exports.ColorRemoveEffect, "material", new Material({
7270
+ __publicField$e(exports.ColorRemoveEffect, "material", new Material({
7265
7271
  vert: `precision mediump float;
7266
7272
  attribute vec2 position;
7267
7273
  attribute vec2 uv;
@@ -7294,28 +7300,28 @@ void main(void) {
7294
7300
  gl_FragColor = color;
7295
7301
  }`
7296
7302
  }));
7297
- __decorateClass$w([
7303
+ __decorateClass$y([
7298
7304
  property()
7299
7305
  ], exports.ColorRemoveEffect.prototype, "colors", 2);
7300
- __decorateClass$w([
7306
+ __decorateClass$y([
7301
7307
  property()
7302
7308
  ], exports.ColorRemoveEffect.prototype, "epsilon", 2);
7303
- exports.ColorRemoveEffect = __decorateClass$w([
7309
+ exports.ColorRemoveEffect = __decorateClass$y([
7304
7310
  customNode("ColorRemoveEffect")
7305
7311
  ], exports.ColorRemoveEffect);
7306
7312
 
7307
- var __defProp$v = Object.defineProperty;
7308
- var __getOwnPropDesc$u = Object.getOwnPropertyDescriptor;
7309
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7310
- var __decorateClass$v = (decorators, target, key, kind) => {
7311
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$u(target, key) : target;
7313
+ var __defProp$x = Object.defineProperty;
7314
+ var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
7315
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7316
+ var __decorateClass$x = (decorators, target, key, kind) => {
7317
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$v(target, key) : target;
7312
7318
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7313
7319
  if (decorator = decorators[i])
7314
7320
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7315
- if (kind && result) __defProp$v(target, key, result);
7321
+ if (kind && result) __defProp$x(target, key, result);
7316
7322
  return result;
7317
7323
  };
7318
- var __publicField$c = (obj, key, value) => __defNormalProp$c(obj, key + "" , value);
7324
+ var __publicField$d = (obj, key, value) => __defNormalProp$d(obj, key + "" , value);
7319
7325
  const MAX_COLORS = 50;
7320
7326
  exports.ColorReplaceEffect = class ColorReplaceEffect extends exports.Effect {
7321
7327
  colors = [];
@@ -7359,7 +7365,7 @@ exports.ColorReplaceEffect = class ColorReplaceEffect extends exports.Effect {
7359
7365
  });
7360
7366
  }
7361
7367
  };
7362
- __publicField$c(exports.ColorReplaceEffect, "material", new Material({
7368
+ __publicField$d(exports.ColorReplaceEffect, "material", new Material({
7363
7369
  vert: `precision mediump float;
7364
7370
  attribute vec2 position;
7365
7371
  attribute vec2 uv;
@@ -7399,28 +7405,28 @@ void main(void) {
7399
7405
  }
7400
7406
  }`
7401
7407
  }));
7402
- __decorateClass$v([
7408
+ __decorateClass$x([
7403
7409
  property()
7404
7410
  ], exports.ColorReplaceEffect.prototype, "colors", 2);
7405
- __decorateClass$v([
7411
+ __decorateClass$x([
7406
7412
  property()
7407
7413
  ], exports.ColorReplaceEffect.prototype, "epsilon", 2);
7408
- exports.ColorReplaceEffect = __decorateClass$v([
7414
+ exports.ColorReplaceEffect = __decorateClass$x([
7409
7415
  customNode("ColorReplaceEffect")
7410
7416
  ], exports.ColorReplaceEffect);
7411
7417
 
7412
- var __defProp$u = Object.defineProperty;
7413
- var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor;
7414
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7415
- var __decorateClass$u = (decorators, target, key, kind) => {
7416
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$t(target, key) : target;
7418
+ var __defProp$w = Object.defineProperty;
7419
+ var __getOwnPropDesc$u = Object.getOwnPropertyDescriptor;
7420
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7421
+ var __decorateClass$w = (decorators, target, key, kind) => {
7422
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$u(target, key) : target;
7417
7423
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7418
7424
  if (decorator = decorators[i])
7419
7425
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7420
- if (kind && result) __defProp$u(target, key, result);
7426
+ if (kind && result) __defProp$w(target, key, result);
7421
7427
  return result;
7422
7428
  };
7423
- var __publicField$b = (obj, key, value) => __defNormalProp$b(obj, key + "" , value);
7429
+ var __publicField$c = (obj, key, value) => __defNormalProp$c(obj, key + "" , value);
7424
7430
  exports.EmbossEffect = class EmbossEffect extends exports.Effect {
7425
7431
  strength;
7426
7432
  constructor(strength = 5) {
@@ -7437,7 +7443,7 @@ exports.EmbossEffect = class EmbossEffect extends exports.Effect {
7437
7443
  });
7438
7444
  }
7439
7445
  };
7440
- __publicField$b(exports.EmbossEffect, "material", new Material({
7446
+ __publicField$c(exports.EmbossEffect, "material", new Material({
7441
7447
  vert: `precision mediump float;
7442
7448
  attribute vec2 position;
7443
7449
  attribute vec2 uv;
@@ -7463,25 +7469,25 @@ void main(void) {
7463
7469
  gl_FragColor = vec4(color.rgb * alpha, alpha);
7464
7470
  }`
7465
7471
  }));
7466
- __decorateClass$u([
7472
+ __decorateClass$w([
7467
7473
  property()
7468
7474
  ], exports.EmbossEffect.prototype, "strength", 2);
7469
- exports.EmbossEffect = __decorateClass$u([
7475
+ exports.EmbossEffect = __decorateClass$w([
7470
7476
  customNode("EmbossEffect")
7471
7477
  ], exports.EmbossEffect);
7472
7478
 
7473
- var __defProp$t = Object.defineProperty;
7474
- var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor;
7475
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7476
- var __decorateClass$t = (decorators, target, key, kind) => {
7477
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$s(target, key) : target;
7479
+ var __defProp$v = Object.defineProperty;
7480
+ var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor;
7481
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7482
+ var __decorateClass$v = (decorators, target, key, kind) => {
7483
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$t(target, key) : target;
7478
7484
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7479
7485
  if (decorator = decorators[i])
7480
7486
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7481
- if (kind && result) __defProp$t(target, key, result);
7487
+ if (kind && result) __defProp$v(target, key, result);
7482
7488
  return result;
7483
7489
  };
7484
- var __publicField$a = (obj, key, value) => __defNormalProp$a(obj, key + "" , value);
7490
+ var __publicField$b = (obj, key, value) => __defNormalProp$b(obj, key + "" , value);
7485
7491
  exports.GlitchEffect = class GlitchEffect extends exports.Effect {
7486
7492
  _canvas;
7487
7493
  _texture;
@@ -7555,7 +7561,7 @@ exports.GlitchEffect = class GlitchEffect extends exports.Effect {
7555
7561
  });
7556
7562
  }
7557
7563
  };
7558
- __publicField$a(exports.GlitchEffect, "material", new Material({
7564
+ __publicField$b(exports.GlitchEffect, "material", new Material({
7559
7565
  vert: `precision mediump float;
7560
7566
  attribute vec2 position;
7561
7567
  attribute vec2 uv;
@@ -7660,49 +7666,49 @@ void main(void) {
7660
7666
  gl_FragColor.a = texture2D(sampler, coord).a;
7661
7667
  }`
7662
7668
  }));
7663
- __decorateClass$t([
7669
+ __decorateClass$v([
7664
7670
  property()
7665
7671
  ], exports.GlitchEffect.prototype, "slices", 2);
7666
- __decorateClass$t([
7672
+ __decorateClass$v([
7667
7673
  property()
7668
7674
  ], exports.GlitchEffect.prototype, "sampleSize", 2);
7669
- __decorateClass$t([
7675
+ __decorateClass$v([
7670
7676
  property()
7671
7677
  ], exports.GlitchEffect.prototype, "offset", 2);
7672
- __decorateClass$t([
7678
+ __decorateClass$v([
7673
7679
  property()
7674
7680
  ], exports.GlitchEffect.prototype, "direction", 2);
7675
- __decorateClass$t([
7681
+ __decorateClass$v([
7676
7682
  property()
7677
7683
  ], exports.GlitchEffect.prototype, "fillMode", 2);
7678
- __decorateClass$t([
7684
+ __decorateClass$v([
7679
7685
  property()
7680
7686
  ], exports.GlitchEffect.prototype, "seed", 2);
7681
- __decorateClass$t([
7687
+ __decorateClass$v([
7682
7688
  property()
7683
7689
  ], exports.GlitchEffect.prototype, "red", 2);
7684
- __decorateClass$t([
7690
+ __decorateClass$v([
7685
7691
  property()
7686
7692
  ], exports.GlitchEffect.prototype, "green", 2);
7687
- __decorateClass$t([
7693
+ __decorateClass$v([
7688
7694
  property()
7689
7695
  ], exports.GlitchEffect.prototype, "blue", 2);
7690
- exports.GlitchEffect = __decorateClass$t([
7696
+ exports.GlitchEffect = __decorateClass$v([
7691
7697
  customNode("GlitchEffect")
7692
7698
  ], exports.GlitchEffect);
7693
7699
 
7694
- var __defProp$s = Object.defineProperty;
7695
- var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
7696
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7697
- var __decorateClass$s = (decorators, target, key, kind) => {
7698
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$r(target, key) : target;
7700
+ var __defProp$u = Object.defineProperty;
7701
+ var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor;
7702
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7703
+ var __decorateClass$u = (decorators, target, key, kind) => {
7704
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$s(target, key) : target;
7699
7705
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7700
7706
  if (decorator = decorators[i])
7701
7707
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7702
- if (kind && result) __defProp$s(target, key, result);
7708
+ if (kind && result) __defProp$u(target, key, result);
7703
7709
  return result;
7704
7710
  };
7705
- var __publicField$9 = (obj, key, value) => __defNormalProp$9(obj, key + "" , value);
7711
+ var __publicField$a = (obj, key, value) => __defNormalProp$a(obj, key + "" , value);
7706
7712
  exports.GodrayEffect = class GodrayEffect extends exports.Effect {
7707
7713
  angle = 30;
7708
7714
  gain = 0.5;
@@ -7727,7 +7733,7 @@ exports.GodrayEffect = class GodrayEffect extends exports.Effect {
7727
7733
  });
7728
7734
  }
7729
7735
  };
7730
- __publicField$9(exports.GodrayEffect, "material", new Material({
7736
+ __publicField$a(exports.GodrayEffect, "material", new Material({
7731
7737
  vert: `precision mediump float;
7732
7738
  attribute vec2 position;
7733
7739
  attribute vec2 uv;
@@ -7861,40 +7867,40 @@ void main(void) {
7861
7867
  gl_FragColor = vec4(color.rgb + mist.rgb, color.a);
7862
7868
  }`
7863
7869
  }));
7864
- __decorateClass$s([
7870
+ __decorateClass$u([
7865
7871
  property()
7866
7872
  ], exports.GodrayEffect.prototype, "angle", 2);
7867
- __decorateClass$s([
7873
+ __decorateClass$u([
7868
7874
  property()
7869
7875
  ], exports.GodrayEffect.prototype, "gain", 2);
7870
- __decorateClass$s([
7876
+ __decorateClass$u([
7871
7877
  property()
7872
7878
  ], exports.GodrayEffect.prototype, "lacunarity", 2);
7873
- __decorateClass$s([
7879
+ __decorateClass$u([
7874
7880
  property()
7875
7881
  ], exports.GodrayEffect.prototype, "parallel", 2);
7876
- __decorateClass$s([
7882
+ __decorateClass$u([
7877
7883
  property()
7878
7884
  ], exports.GodrayEffect.prototype, "center", 2);
7879
- __decorateClass$s([
7885
+ __decorateClass$u([
7880
7886
  property()
7881
7887
  ], exports.GodrayEffect.prototype, "alpha", 2);
7882
- exports.GodrayEffect = __decorateClass$s([
7888
+ exports.GodrayEffect = __decorateClass$u([
7883
7889
  customNode("GodrayEffect")
7884
7890
  ], exports.GodrayEffect);
7885
7891
 
7886
- var __defProp$r = Object.defineProperty;
7887
- var __getOwnPropDesc$q = Object.getOwnPropertyDescriptor;
7888
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7889
- var __decorateClass$r = (decorators, target, key, kind) => {
7890
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$q(target, key) : target;
7892
+ var __defProp$t = Object.defineProperty;
7893
+ var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
7894
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7895
+ var __decorateClass$t = (decorators, target, key, kind) => {
7896
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$r(target, key) : target;
7891
7897
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7892
7898
  if (decorator = decorators[i])
7893
7899
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7894
- if (kind && result) __defProp$r(target, key, result);
7900
+ if (kind && result) __defProp$t(target, key, result);
7895
7901
  return result;
7896
7902
  };
7897
- var __publicField$8 = (obj, key, value) => __defNormalProp$8(obj, key + "" , value);
7903
+ var __publicField$9 = (obj, key, value) => __defNormalProp$9(obj, key + "" , value);
7898
7904
  exports.MaskEffect = class MaskEffect extends exports.Effect {
7899
7905
  texture;
7900
7906
  constructor(properties, children = []) {
@@ -7932,7 +7938,7 @@ exports.MaskEffect = class MaskEffect extends exports.Effect {
7932
7938
  }
7933
7939
  }
7934
7940
  };
7935
- __publicField$8(exports.MaskEffect, "material", new Material({
7941
+ __publicField$9(exports.MaskEffect, "material", new Material({
7936
7942
  vert: `precision mediump float;
7937
7943
  attribute vec2 position;
7938
7944
  attribute vec2 uv;
@@ -7965,28 +7971,28 @@ void main(void) {
7965
7971
  }
7966
7972
  }`
7967
7973
  }));
7968
- __decorateClass$r([
7974
+ __decorateClass$t([
7969
7975
  protectedProperty()
7970
7976
  ], exports.MaskEffect.prototype, "texture", 2);
7971
- __decorateClass$r([
7977
+ __decorateClass$t([
7972
7978
  property({ default: "" })
7973
7979
  ], exports.MaskEffect.prototype, "src", 2);
7974
- exports.MaskEffect = __decorateClass$r([
7980
+ exports.MaskEffect = __decorateClass$t([
7975
7981
  customNode("MaskEffect")
7976
7982
  ], exports.MaskEffect);
7977
7983
 
7978
- var __defProp$q = Object.defineProperty;
7979
- var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
7980
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7981
- var __decorateClass$q = (decorators, target, key, kind) => {
7982
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$p(target, key) : target;
7984
+ var __defProp$s = Object.defineProperty;
7985
+ var __getOwnPropDesc$q = Object.getOwnPropertyDescriptor;
7986
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7987
+ var __decorateClass$s = (decorators, target, key, kind) => {
7988
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$q(target, key) : target;
7983
7989
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7984
7990
  if (decorator = decorators[i])
7985
7991
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7986
- if (kind && result) __defProp$q(target, key, result);
7992
+ if (kind && result) __defProp$s(target, key, result);
7987
7993
  return result;
7988
7994
  };
7989
- var __publicField$7 = (obj, key, value) => __defNormalProp$7(obj, key + "" , value);
7995
+ var __publicField$8 = (obj, key, value) => __defNormalProp$8(obj, key + "" , value);
7990
7996
  exports.PixelateEffect = class PixelateEffect extends exports.Effect {
7991
7997
  size;
7992
7998
  constructor(size = 10) {
@@ -8003,7 +8009,7 @@ exports.PixelateEffect = class PixelateEffect extends exports.Effect {
8003
8009
  });
8004
8010
  }
8005
8011
  };
8006
- __publicField$7(exports.PixelateEffect, "material", new Material({
8012
+ __publicField$8(exports.PixelateEffect, "material", new Material({
8007
8013
  vert: `precision mediump float;
8008
8014
  attribute vec2 position;
8009
8015
  attribute vec2 uv;
@@ -8040,25 +8046,25 @@ void main(void) {
8040
8046
  gl_FragColor = texture2D(sampler, coord);
8041
8047
  }`
8042
8048
  }));
8043
- __decorateClass$q([
8049
+ __decorateClass$s([
8044
8050
  property()
8045
8051
  ], exports.PixelateEffect.prototype, "size", 2);
8046
- exports.PixelateEffect = __decorateClass$q([
8052
+ exports.PixelateEffect = __decorateClass$s([
8047
8053
  customNode("PixelateEffect")
8048
8054
  ], exports.PixelateEffect);
8049
8055
 
8050
- var __defProp$p = Object.defineProperty;
8051
- var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
8052
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8053
- var __decorateClass$p = (decorators, target, key, kind) => {
8054
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$o(target, key) : target;
8056
+ var __defProp$r = Object.defineProperty;
8057
+ var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
8058
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8059
+ var __decorateClass$r = (decorators, target, key, kind) => {
8060
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$p(target, key) : target;
8055
8061
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8056
8062
  if (decorator = decorators[i])
8057
8063
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8058
- if (kind && result) __defProp$p(target, key, result);
8064
+ if (kind && result) __defProp$r(target, key, result);
8059
8065
  return result;
8060
8066
  };
8061
- var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, key + "" , value);
8067
+ var __publicField$7 = (obj, key, value) => __defNormalProp$7(obj, key + "" , value);
8062
8068
  exports.ShadowEffect = class ShadowEffect extends exports.Effect {
8063
8069
  blur = new exports.BlurEffect();
8064
8070
  viewport3 = new exports.Viewport();
@@ -8085,7 +8091,7 @@ exports.ShadowEffect = class ShadowEffect extends exports.Effect {
8085
8091
  });
8086
8092
  }
8087
8093
  };
8088
- __publicField$6(exports.ShadowEffect, "material", new Material({
8094
+ __publicField$7(exports.ShadowEffect, "material", new Material({
8089
8095
  vert: `precision mediump float;
8090
8096
  attribute vec2 position;
8091
8097
  attribute vec2 uv;
@@ -8108,22 +8114,22 @@ void main(void) {
8108
8114
  gl_FragColor = sample;
8109
8115
  }`
8110
8116
  }));
8111
- exports.ShadowEffect = __decorateClass$p([
8117
+ exports.ShadowEffect = __decorateClass$r([
8112
8118
  customNode("ShadowEffect")
8113
8119
  ], exports.ShadowEffect);
8114
8120
 
8115
- var __defProp$o = Object.defineProperty;
8116
- var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
8117
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8118
- var __decorateClass$o = (decorators, target, key, kind) => {
8119
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$n(target, key) : target;
8121
+ var __defProp$q = Object.defineProperty;
8122
+ var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
8123
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8124
+ var __decorateClass$q = (decorators, target, key, kind) => {
8125
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$o(target, key) : target;
8120
8126
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8121
8127
  if (decorator = decorators[i])
8122
8128
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8123
- if (kind && result) __defProp$o(target, key, result);
8129
+ if (kind && result) __defProp$q(target, key, result);
8124
8130
  return result;
8125
8131
  };
8126
- var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, key + "" , value);
8132
+ var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, key + "" , value);
8127
8133
  exports.ZoomBlurEffect = class ZoomBlurEffect extends exports.Effect {
8128
8134
  center;
8129
8135
  innerRadius = 20;
@@ -8142,7 +8148,7 @@ exports.ZoomBlurEffect = class ZoomBlurEffect extends exports.Effect {
8142
8148
  });
8143
8149
  }
8144
8150
  };
8145
- __publicField$5(exports.ZoomBlurEffect, "material", new Material({
8151
+ __publicField$6(exports.ZoomBlurEffect, "material", new Material({
8146
8152
  vert: `attribute vec2 position;
8147
8153
  attribute vec2 uv;
8148
8154
  varying vec2 vUv;
@@ -8226,30 +8232,30 @@ void main() {
8226
8232
  gl_FragColor = color;
8227
8233
  }`
8228
8234
  }));
8229
- __decorateClass$o([
8235
+ __decorateClass$q([
8230
8236
  property()
8231
8237
  ], exports.ZoomBlurEffect.prototype, "center", 2);
8232
- __decorateClass$o([
8238
+ __decorateClass$q([
8233
8239
  property()
8234
8240
  ], exports.ZoomBlurEffect.prototype, "innerRadius", 2);
8235
- __decorateClass$o([
8241
+ __decorateClass$q([
8236
8242
  property()
8237
8243
  ], exports.ZoomBlurEffect.prototype, "radius", 2);
8238
- __decorateClass$o([
8244
+ __decorateClass$q([
8239
8245
  property()
8240
8246
  ], exports.ZoomBlurEffect.prototype, "strength", 2);
8241
- exports.ZoomBlurEffect = __decorateClass$o([
8247
+ exports.ZoomBlurEffect = __decorateClass$q([
8242
8248
  customNode("ZoomBlurEffect")
8243
8249
  ], exports.ZoomBlurEffect);
8244
8250
 
8245
- var __defProp$n = Object.defineProperty;
8246
- var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
8247
- var __decorateClass$n = (decorators, target, key, kind) => {
8248
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$m(target, key) : target;
8251
+ var __defProp$p = Object.defineProperty;
8252
+ var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
8253
+ var __decorateClass$p = (decorators, target, key, kind) => {
8254
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$n(target, key) : target;
8249
8255
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8250
8256
  if (decorator = decorators[i])
8251
8257
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8252
- if (kind && result) __defProp$n(target, key, result);
8258
+ if (kind && result) __defProp$p(target, key, result);
8253
8259
  return result;
8254
8260
  };
8255
8261
  exports.CanvasItem = class CanvasItem extends exports.TimelineNode {
@@ -8341,7 +8347,7 @@ exports.CanvasItem = class CanvasItem extends exports.TimelineNode {
8341
8347
  if (this.style.boxShadow !== "none") {
8342
8348
  const node = this.getNode(nodePath);
8343
8349
  if (node) ; else {
8344
- this.addChild(new exports.ShadowEffect(), "back");
8350
+ this.appendChild(new exports.ShadowEffect(), "back");
8345
8351
  }
8346
8352
  } else {
8347
8353
  const node = this.getNode(nodePath);
@@ -8358,7 +8364,7 @@ exports.CanvasItem = class CanvasItem extends exports.TimelineNode {
8358
8364
  if (node) {
8359
8365
  node.src = maskImage;
8360
8366
  } else {
8361
- this.addChild(new exports.MaskEffect({ src: maskImage }), "back");
8367
+ this.appendChild(new exports.MaskEffect({ src: maskImage }), "back");
8362
8368
  }
8363
8369
  } else {
8364
8370
  const node = this.getNode(nodePath);
@@ -8544,17 +8550,17 @@ exports.CanvasItem = class CanvasItem extends exports.TimelineNode {
8544
8550
  };
8545
8551
  }
8546
8552
  };
8547
- __decorateClass$n([
8553
+ __decorateClass$p([
8548
8554
  property()
8549
8555
  ], exports.CanvasItem.prototype, "modulate", 2);
8550
- __decorateClass$n([
8556
+ __decorateClass$p([
8551
8557
  property()
8552
8558
  ], exports.CanvasItem.prototype, "blendMode", 2);
8553
- exports.CanvasItem = __decorateClass$n([
8559
+ exports.CanvasItem = __decorateClass$p([
8554
8560
  customNode("CanvasItem")
8555
8561
  ], exports.CanvasItem);
8556
8562
 
8557
- class RenderStack extends exports.Node {
8563
+ class RenderStack {
8558
8564
  currentCall;
8559
8565
  calls = [];
8560
8566
  createCall(renderable) {
@@ -8580,14 +8586,14 @@ class RenderStack extends exports.Node {
8580
8586
  }
8581
8587
  }
8582
8588
 
8583
- var __defProp$m = Object.defineProperty;
8584
- var __getOwnPropDesc$l = Object.getOwnPropertyDescriptor;
8585
- var __decorateClass$m = (decorators, target, key, kind) => {
8586
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$l(target, key) : target;
8589
+ var __defProp$o = Object.defineProperty;
8590
+ var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
8591
+ var __decorateClass$o = (decorators, target, key, kind) => {
8592
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$m(target, key) : target;
8587
8593
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8588
8594
  if (decorator = decorators[i])
8589
8595
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8590
- if (kind && result) __defProp$m(target, key, result);
8596
+ if (kind && result) __defProp$o(target, key, result);
8591
8597
  return result;
8592
8598
  };
8593
8599
  exports.Timeline = class Timeline extends exports.Node {
@@ -8632,29 +8638,29 @@ exports.Timeline = class Timeline extends exports.Node {
8632
8638
  this.addTime(delta);
8633
8639
  }
8634
8640
  };
8635
- __decorateClass$m([
8641
+ __decorateClass$o([
8636
8642
  property({ default: 0 })
8637
8643
  ], exports.Timeline.prototype, "startTime", 2);
8638
- __decorateClass$m([
8644
+ __decorateClass$o([
8639
8645
  property({ default: 0 })
8640
8646
  ], exports.Timeline.prototype, "currentTime", 2);
8641
- __decorateClass$m([
8647
+ __decorateClass$o([
8642
8648
  property({ default: Number.MAX_SAFE_INTEGER })
8643
8649
  ], exports.Timeline.prototype, "endTime", 2);
8644
- __decorateClass$m([
8650
+ __decorateClass$o([
8645
8651
  property({ default: false })
8646
8652
  ], exports.Timeline.prototype, "loop", 2);
8647
- exports.Timeline = __decorateClass$m([
8653
+ exports.Timeline = __decorateClass$o([
8648
8654
  customNode("Timeline")
8649
8655
  ], exports.Timeline);
8650
8656
 
8651
- var __defProp$l = Object.defineProperty;
8652
- var __decorateClass$l = (decorators, target, key, kind) => {
8657
+ var __defProp$n = Object.defineProperty;
8658
+ var __decorateClass$n = (decorators, target, key, kind) => {
8653
8659
  var result = undefined ;
8654
8660
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8655
8661
  if (decorator = decorators[i])
8656
8662
  result = (decorator(target, key, result) ) || result;
8657
- if (result) __defProp$l(target, key, result);
8663
+ if (result) __defProp$n(target, key, result);
8658
8664
  return result;
8659
8665
  };
8660
8666
  class SceneTree extends MainLoop {
@@ -8715,21 +8721,21 @@ class SceneTree extends MainLoop {
8715
8721
  renderer.texture.unbind(texture);
8716
8722
  }
8717
8723
  }
8718
- __decorateClass$l([
8724
+ __decorateClass$n([
8719
8725
  property({ default: false })
8720
8726
  ], SceneTree.prototype, "paused");
8721
- __decorateClass$l([
8727
+ __decorateClass$n([
8722
8728
  property()
8723
8729
  ], SceneTree.prototype, "backgroundColor");
8724
8730
 
8725
- var __defProp$k = Object.defineProperty;
8726
- var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
8727
- var __decorateClass$k = (decorators, target, key, kind) => {
8728
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$k(target, key) : target;
8731
+ var __defProp$m = Object.defineProperty;
8732
+ var __getOwnPropDesc$l = Object.getOwnPropertyDescriptor;
8733
+ var __decorateClass$m = (decorators, target, key, kind) => {
8734
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$l(target, key) : target;
8729
8735
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8730
8736
  if (decorator = decorators[i])
8731
8737
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8732
- if (kind && result) __defProp$k(target, key, result);
8738
+ if (kind && result) __defProp$m(target, key, result);
8733
8739
  return result;
8734
8740
  };
8735
8741
  exports.Transition = class Transition extends exports.Effect {
@@ -8738,7 +8744,7 @@ exports.Transition = class Transition extends exports.Effect {
8738
8744
  this.setProperties(properties).append(children);
8739
8745
  }
8740
8746
  };
8741
- exports.Transition = __decorateClass$k([
8747
+ exports.Transition = __decorateClass$m([
8742
8748
  customNode("Transition", {
8743
8749
  effectMode: "transition",
8744
8750
  processMode: "pausable",
@@ -8746,14 +8752,14 @@ exports.Transition = __decorateClass$k([
8746
8752
  })
8747
8753
  ], exports.Transition);
8748
8754
 
8749
- var __defProp$j = Object.defineProperty;
8750
- var __getOwnPropDesc$j = Object.getOwnPropertyDescriptor;
8751
- var __decorateClass$j = (decorators, target, key, kind) => {
8752
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$j(target, key) : target;
8755
+ var __defProp$l = Object.defineProperty;
8756
+ var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
8757
+ var __decorateClass$l = (decorators, target, key, kind) => {
8758
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$k(target, key) : target;
8753
8759
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8754
8760
  if (decorator = decorators[i])
8755
8761
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8756
- if (kind && result) __defProp$j(target, key, result);
8762
+ if (kind && result) __defProp$l(target, key, result);
8757
8763
  return result;
8758
8764
  };
8759
8765
  exports.Node2D = class Node2D extends exports.CanvasItem {
@@ -8894,18 +8900,18 @@ exports.Node2D = class Node2D extends exports.CanvasItem {
8894
8900
  );
8895
8901
  }
8896
8902
  };
8897
- exports.Node2D = __decorateClass$j([
8903
+ exports.Node2D = __decorateClass$l([
8898
8904
  customNode("Node2D")
8899
8905
  ], exports.Node2D);
8900
8906
 
8901
- var __defProp$i = Object.defineProperty;
8902
- var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
8903
- var __decorateClass$i = (decorators, target, key, kind) => {
8904
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$i(target, key) : target;
8907
+ var __defProp$k = Object.defineProperty;
8908
+ var __getOwnPropDesc$j = Object.getOwnPropertyDescriptor;
8909
+ var __decorateClass$k = (decorators, target, key, kind) => {
8910
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$j(target, key) : target;
8905
8911
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8906
8912
  if (decorator = decorators[i])
8907
8913
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8908
- if (kind && result) __defProp$i(target, key, result);
8914
+ if (kind && result) __defProp$k(target, key, result);
8909
8915
  return result;
8910
8916
  };
8911
8917
  function proxy(options) {
@@ -8950,61 +8956,61 @@ exports.Graphics2D = class Graphics2D extends exports.Node2D {
8950
8956
  return this;
8951
8957
  }
8952
8958
  };
8953
- __decorateClass$i([
8959
+ __decorateClass$k([
8954
8960
  proxy()
8955
8961
  ], exports.Graphics2D.prototype, "lineCap", 2);
8956
- __decorateClass$i([
8962
+ __decorateClass$k([
8957
8963
  proxy()
8958
8964
  ], exports.Graphics2D.prototype, "lineJoin", 2);
8959
- __decorateClass$i([
8965
+ __decorateClass$k([
8960
8966
  proxy()
8961
8967
  ], exports.Graphics2D.prototype, "fillStyle", 2);
8962
- __decorateClass$i([
8968
+ __decorateClass$k([
8963
8969
  proxy()
8964
8970
  ], exports.Graphics2D.prototype, "strokeStyle", 2);
8965
- __decorateClass$i([
8971
+ __decorateClass$k([
8966
8972
  proxy()
8967
8973
  ], exports.Graphics2D.prototype, "lineWidth", 2);
8968
- __decorateClass$i([
8974
+ __decorateClass$k([
8969
8975
  proxy()
8970
8976
  ], exports.Graphics2D.prototype, "miterLimit", 2);
8971
- __decorateClass$i([
8977
+ __decorateClass$k([
8972
8978
  proxy({ method: true })
8973
8979
  ], exports.Graphics2D.prototype, "rect", 2);
8974
- __decorateClass$i([
8980
+ __decorateClass$k([
8975
8981
  proxy({ method: true, redraw: true })
8976
8982
  ], exports.Graphics2D.prototype, "fillRect", 2);
8977
- __decorateClass$i([
8983
+ __decorateClass$k([
8978
8984
  proxy({ method: true, redraw: true })
8979
8985
  ], exports.Graphics2D.prototype, "strokeRect", 2);
8980
- __decorateClass$i([
8986
+ __decorateClass$k([
8981
8987
  proxy({ method: true })
8982
8988
  ], exports.Graphics2D.prototype, "roundRect", 2);
8983
- __decorateClass$i([
8989
+ __decorateClass$k([
8984
8990
  proxy({ method: true })
8985
8991
  ], exports.Graphics2D.prototype, "ellipse", 2);
8986
- __decorateClass$i([
8992
+ __decorateClass$k([
8987
8993
  proxy({ method: true })
8988
8994
  ], exports.Graphics2D.prototype, "arc", 2);
8989
- __decorateClass$i([
8995
+ __decorateClass$k([
8990
8996
  proxy({ method: true })
8991
8997
  ], exports.Graphics2D.prototype, "beginPath", 2);
8992
- __decorateClass$i([
8998
+ __decorateClass$k([
8993
8999
  proxy({ method: true })
8994
9000
  ], exports.Graphics2D.prototype, "moveTo", 2);
8995
- __decorateClass$i([
9001
+ __decorateClass$k([
8996
9002
  proxy({ method: true })
8997
9003
  ], exports.Graphics2D.prototype, "lineTo", 2);
8998
- __decorateClass$i([
9004
+ __decorateClass$k([
8999
9005
  proxy({ method: true })
9000
9006
  ], exports.Graphics2D.prototype, "closePath", 2);
9001
- __decorateClass$i([
9007
+ __decorateClass$k([
9002
9008
  proxy({ method: true, redraw: true })
9003
9009
  ], exports.Graphics2D.prototype, "fill", 2);
9004
- __decorateClass$i([
9010
+ __decorateClass$k([
9005
9011
  proxy({ method: true, redraw: true })
9006
9012
  ], exports.Graphics2D.prototype, "stroke", 2);
9007
- exports.Graphics2D = __decorateClass$i([
9013
+ exports.Graphics2D = __decorateClass$k([
9008
9014
  customNode("Graphics2D")
9009
9015
  ], exports.Graphics2D);
9010
9016
 
@@ -9034,14 +9040,14 @@ class Image2DResource extends Resource {
9034
9040
  }
9035
9041
  }
9036
9042
 
9037
- var __defProp$h = Object.defineProperty;
9038
- var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
9039
- var __decorateClass$h = (decorators, target, key, kind) => {
9040
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$h(target, key) : target;
9041
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
9042
- if (decorator = decorators[i])
9043
+ var __defProp$j = Object.defineProperty;
9044
+ var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
9045
+ var __decorateClass$j = (decorators, target, key, kind) => {
9046
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$i(target, key) : target;
9047
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
9048
+ if (decorator = decorators[i])
9043
9049
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9044
- if (kind && result) __defProp$h(target, key, result);
9050
+ if (kind && result) __defProp$j(target, key, result);
9045
9051
  return result;
9046
9052
  };
9047
9053
  exports.Image2D = class Image2D extends exports.Node2D {
@@ -9161,16 +9167,16 @@ exports.Image2D = class Image2D extends exports.Node2D {
9161
9167
  }
9162
9168
  }
9163
9169
  };
9164
- __decorateClass$h([
9170
+ __decorateClass$j([
9165
9171
  protectedProperty()
9166
9172
  ], exports.Image2D.prototype, "resource", 2);
9167
- __decorateClass$h([
9173
+ __decorateClass$j([
9168
9174
  property({ default: false })
9169
9175
  ], exports.Image2D.prototype, "gif", 2);
9170
- __decorateClass$h([
9176
+ __decorateClass$j([
9171
9177
  property({ default: "" })
9172
9178
  ], exports.Image2D.prototype, "src", 2);
9173
- exports.Image2D = __decorateClass$h([
9179
+ exports.Image2D = __decorateClass$j([
9174
9180
  customNode("Image2D")
9175
9181
  ], exports.Image2D);
9176
9182
 
@@ -9188,14 +9194,14 @@ class TextureRect2D extends exports.Node2D {
9188
9194
  }
9189
9195
  }
9190
9196
 
9191
- var __defProp$g = Object.defineProperty;
9192
- var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
9193
- var __decorateClass$g = (decorators, target, key, kind) => {
9194
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$g(target, key) : target;
9197
+ var __defProp$i = Object.defineProperty;
9198
+ var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
9199
+ var __decorateClass$i = (decorators, target, key, kind) => {
9200
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$h(target, key) : target;
9195
9201
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9196
9202
  if (decorator = decorators[i])
9197
9203
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9198
- if (kind && result) __defProp$g(target, key, result);
9204
+ if (kind && result) __defProp$i(target, key, result);
9199
9205
  return result;
9200
9206
  };
9201
9207
  exports.Lottie2D = class Lottie2D extends TextureRect2D {
@@ -9238,21 +9244,21 @@ exports.Lottie2D = class Lottie2D extends TextureRect2D {
9238
9244
  super._process(delta);
9239
9245
  }
9240
9246
  };
9241
- __decorateClass$g([
9247
+ __decorateClass$i([
9242
9248
  property({ default: "" })
9243
9249
  ], exports.Lottie2D.prototype, "src", 2);
9244
- exports.Lottie2D = __decorateClass$g([
9250
+ exports.Lottie2D = __decorateClass$i([
9245
9251
  customNode("Lottie2D")
9246
9252
  ], exports.Lottie2D);
9247
9253
 
9248
- var __defProp$f = Object.defineProperty;
9249
- var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
9250
- var __decorateClass$f = (decorators, target, key, kind) => {
9251
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$f(target, key) : target;
9254
+ var __defProp$h = Object.defineProperty;
9255
+ var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
9256
+ var __decorateClass$h = (decorators, target, key, kind) => {
9257
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$g(target, key) : target;
9252
9258
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9253
9259
  if (decorator = decorators[i])
9254
9260
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9255
- if (kind && result) __defProp$f(target, key, result);
9261
+ if (kind && result) __defProp$h(target, key, result);
9256
9262
  return result;
9257
9263
  };
9258
9264
  const textStyles = new Set(Object.keys(modernText.textDefaultStyle));
@@ -9353,7 +9359,7 @@ exports.Text2D = class Text2D extends TextureRect2D {
9353
9359
  result.paragraphs.forEach((p) => {
9354
9360
  p.fragments.forEach((f) => {
9355
9361
  f.characters.forEach((c) => {
9356
- this.addChild(
9362
+ this.appendChild(
9357
9363
  new exports.Text2D({
9358
9364
  content: c.content,
9359
9365
  style: {
@@ -9390,33 +9396,33 @@ exports.Text2D = class Text2D extends TextureRect2D {
9390
9396
  }
9391
9397
  }
9392
9398
  };
9393
- __decorateClass$f([
9399
+ __decorateClass$h([
9394
9400
  property({ default: false })
9395
9401
  ], exports.Text2D.prototype, "split", 2);
9396
- __decorateClass$f([
9402
+ __decorateClass$h([
9397
9403
  property({ default: "" })
9398
9404
  ], exports.Text2D.prototype, "content", 2);
9399
- __decorateClass$f([
9405
+ __decorateClass$h([
9400
9406
  property()
9401
9407
  ], exports.Text2D.prototype, "effects", 2);
9402
- __decorateClass$f([
9408
+ __decorateClass$h([
9403
9409
  protectedProperty()
9404
9410
  ], exports.Text2D.prototype, "measureDom", 2);
9405
- __decorateClass$f([
9411
+ __decorateClass$h([
9406
9412
  protectedProperty()
9407
9413
  ], exports.Text2D.prototype, "fonts", 2);
9408
- exports.Text2D = __decorateClass$f([
9414
+ exports.Text2D = __decorateClass$h([
9409
9415
  customNode("Text2D")
9410
9416
  ], exports.Text2D);
9411
9417
 
9412
- var __defProp$e = Object.defineProperty;
9413
- var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
9414
- var __decorateClass$e = (decorators, target, key, kind) => {
9415
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$e(target, key) : target;
9418
+ var __defProp$g = Object.defineProperty;
9419
+ var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
9420
+ var __decorateClass$g = (decorators, target, key, kind) => {
9421
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$f(target, key) : target;
9416
9422
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9417
9423
  if (decorator = decorators[i])
9418
9424
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9419
- if (kind && result) __defProp$e(target, key, result);
9425
+ if (kind && result) __defProp$g(target, key, result);
9420
9426
  return result;
9421
9427
  };
9422
9428
  exports.Video2D = class Video2D extends TextureRect2D {
@@ -9469,21 +9475,21 @@ exports.Video2D = class Video2D extends TextureRect2D {
9469
9475
  super._process(delta);
9470
9476
  }
9471
9477
  };
9472
- __decorateClass$e([
9478
+ __decorateClass$g([
9473
9479
  property({ default: "" })
9474
9480
  ], exports.Video2D.prototype, "src", 2);
9475
- exports.Video2D = __decorateClass$e([
9481
+ exports.Video2D = __decorateClass$g([
9476
9482
  customNode("Video2D")
9477
9483
  ], exports.Video2D);
9478
9484
 
9479
- var __defProp$d = Object.defineProperty;
9480
- var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
9481
- var __decorateClass$d = (decorators, target, key, kind) => {
9482
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$d(target, key) : target;
9485
+ var __defProp$f = Object.defineProperty;
9486
+ var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
9487
+ var __decorateClass$f = (decorators, target, key, kind) => {
9488
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$e(target, key) : target;
9483
9489
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9484
9490
  if (decorator = decorators[i])
9485
9491
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9486
- if (kind && result) __defProp$d(target, key, result);
9492
+ if (kind && result) __defProp$f(target, key, result);
9487
9493
  return result;
9488
9494
  };
9489
9495
  const linear = (amount) => amount;
@@ -9802,19 +9808,19 @@ exports.Animation = class Animation extends exports.TimelineNode {
9802
9808
  });
9803
9809
  }
9804
9810
  };
9805
- __decorateClass$d([
9811
+ __decorateClass$f([
9806
9812
  property({ default: "parent" })
9807
9813
  ], exports.Animation.prototype, "effectMode", 2);
9808
- __decorateClass$d([
9814
+ __decorateClass$f([
9809
9815
  property({ default: false })
9810
9816
  ], exports.Animation.prototype, "loop", 2);
9811
- __decorateClass$d([
9817
+ __decorateClass$f([
9812
9818
  property({ default: [] })
9813
9819
  ], exports.Animation.prototype, "keyframes", 2);
9814
- __decorateClass$d([
9820
+ __decorateClass$f([
9815
9821
  property()
9816
9822
  ], exports.Animation.prototype, "easing", 2);
9817
- exports.Animation = __decorateClass$d([
9823
+ exports.Animation = __decorateClass$f([
9818
9824
  customNode("Animation", {
9819
9825
  renderMode: "disabled",
9820
9826
  processMode: "pausable",
@@ -10697,18 +10703,18 @@ class WebAudio extends AudioPipeline {
10697
10703
  }
10698
10704
  }
10699
10705
 
10700
- var __defProp$c = Object.defineProperty;
10701
- var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
10702
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10703
- var __decorateClass$c = (decorators, target, key, kind) => {
10704
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$c(target, key) : target;
10706
+ var __defProp$e = Object.defineProperty;
10707
+ var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
10708
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10709
+ var __decorateClass$e = (decorators, target, key, kind) => {
10710
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$d(target, key) : target;
10705
10711
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
10706
10712
  if (decorator = decorators[i])
10707
10713
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
10708
- if (kind && result) __defProp$c(target, key, result);
10714
+ if (kind && result) __defProp$e(target, key, result);
10709
10715
  return result;
10710
10716
  };
10711
- var __publicField$4 = (obj, key, value) => __defNormalProp$4(obj, key + "" , value);
10717
+ var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, key + "" , value);
10712
10718
  exports.Audio = class Audio extends exports.TimelineNode {
10713
10719
  _sounds = [];
10714
10720
  /** PlatformAudio */
@@ -10912,8 +10918,8 @@ exports.Audio = class Audio extends exports.TimelineNode {
10912
10918
  }, 100);
10913
10919
  }
10914
10920
  };
10915
- __publicField$4(exports.Audio, "_soundPool", []);
10916
- exports.Audio = __decorateClass$c([
10921
+ __publicField$5(exports.Audio, "_soundPool", []);
10922
+ exports.Audio = __decorateClass$e([
10917
10923
  customNode("Audio")
10918
10924
  ], exports.Audio);
10919
10925
 
@@ -10921,14 +10927,14 @@ class AudioSpectrum extends exports.Node2D {
10921
10927
  //
10922
10928
  }
10923
10929
 
10924
- var __defProp$b = Object.defineProperty;
10925
- var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
10926
- var __decorateClass$b = (decorators, target, key, kind) => {
10927
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$b(target, key) : target;
10930
+ var __defProp$d = Object.defineProperty;
10931
+ var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
10932
+ var __decorateClass$d = (decorators, target, key, kind) => {
10933
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$c(target, key) : target;
10928
10934
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
10929
10935
  if (decorator = decorators[i])
10930
10936
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
10931
- if (kind && result) __defProp$b(target, key, result);
10937
+ if (kind && result) __defProp$d(target, key, result);
10932
10938
  return result;
10933
10939
  };
10934
10940
  exports.AudioWaveform = class AudioWaveform extends exports.Node2D {
@@ -11022,27 +11028,27 @@ exports.AudioWaveform = class AudioWaveform extends exports.Node2D {
11022
11028
  }
11023
11029
  }
11024
11030
  };
11025
- __decorateClass$b([
11031
+ __decorateClass$d([
11026
11032
  property()
11027
11033
  ], exports.AudioWaveform.prototype, "src", 2);
11028
- __decorateClass$b([
11034
+ __decorateClass$d([
11029
11035
  property()
11030
11036
  ], exports.AudioWaveform.prototype, "gap", 2);
11031
- __decorateClass$b([
11037
+ __decorateClass$d([
11032
11038
  property()
11033
11039
  ], exports.AudioWaveform.prototype, "color", 2);
11034
- exports.AudioWaveform = __decorateClass$b([
11040
+ exports.AudioWaveform = __decorateClass$d([
11035
11041
  customNode("AudioWaveform")
11036
11042
  ], exports.AudioWaveform);
11037
11043
 
11038
- var __defProp$a = Object.defineProperty;
11039
- var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
11040
- var __decorateClass$a = (decorators, target, key, kind) => {
11041
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$a(target, key) : target;
11044
+ var __defProp$c = Object.defineProperty;
11045
+ var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
11046
+ var __decorateClass$c = (decorators, target, key, kind) => {
11047
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$b(target, key) : target;
11042
11048
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11043
11049
  if (decorator = decorators[i])
11044
11050
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11045
- if (kind && result) __defProp$a(target, key, result);
11051
+ if (kind && result) __defProp$c(target, key, result);
11046
11052
  return result;
11047
11053
  };
11048
11054
  exports.Control = class Control extends exports.CanvasItem {
@@ -11102,18 +11108,18 @@ exports.Control = class Control extends exports.CanvasItem {
11102
11108
  return new Rect2(left, top, width, height);
11103
11109
  }
11104
11110
  };
11105
- exports.Control = __decorateClass$a([
11111
+ exports.Control = __decorateClass$c([
11106
11112
  customNode("Control")
11107
11113
  ], exports.Control);
11108
11114
 
11109
- var __defProp$9 = Object.defineProperty;
11110
- var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
11111
- var __decorateClass$9 = (decorators, target, key, kind) => {
11112
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$9(target, key) : target;
11115
+ var __defProp$b = Object.defineProperty;
11116
+ var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
11117
+ var __decorateClass$b = (decorators, target, key, kind) => {
11118
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$a(target, key) : target;
11113
11119
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11114
11120
  if (decorator = decorators[i])
11115
11121
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11116
- if (kind && result) __defProp$9(target, key, result);
11122
+ if (kind && result) __defProp$b(target, key, result);
11117
11123
  return result;
11118
11124
  };
11119
11125
  exports.Range = class Range extends exports.Control {
@@ -11136,39 +11142,39 @@ exports.Range = class Range extends exports.Control {
11136
11142
  }
11137
11143
  }
11138
11144
  };
11139
- __decorateClass$9([
11145
+ __decorateClass$b([
11140
11146
  property({ default: false })
11141
11147
  ], exports.Range.prototype, "allowGreater", 2);
11142
- __decorateClass$9([
11148
+ __decorateClass$b([
11143
11149
  property({ default: false })
11144
11150
  ], exports.Range.prototype, "allowLesser", 2);
11145
- __decorateClass$9([
11151
+ __decorateClass$b([
11146
11152
  property({ default: 1 })
11147
11153
  ], exports.Range.prototype, "page", 2);
11148
- __decorateClass$9([
11154
+ __decorateClass$b([
11149
11155
  property({ default: 0 })
11150
11156
  ], exports.Range.prototype, "minValue", 2);
11151
- __decorateClass$9([
11157
+ __decorateClass$b([
11152
11158
  property({ default: 100 })
11153
11159
  ], exports.Range.prototype, "maxValue", 2);
11154
- __decorateClass$9([
11160
+ __decorateClass$b([
11155
11161
  property({ default: 0.01 })
11156
11162
  ], exports.Range.prototype, "step", 2);
11157
- __decorateClass$9([
11163
+ __decorateClass$b([
11158
11164
  property({ default: 0 })
11159
11165
  ], exports.Range.prototype, "value", 2);
11160
- exports.Range = __decorateClass$9([
11166
+ exports.Range = __decorateClass$b([
11161
11167
  customNode("Range")
11162
11168
  ], exports.Range);
11163
11169
 
11164
- var __defProp$8 = Object.defineProperty;
11165
- var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
11166
- var __decorateClass$8 = (decorators, target, key, kind) => {
11167
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$8(target, key) : target;
11170
+ var __defProp$a = Object.defineProperty;
11171
+ var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
11172
+ var __decorateClass$a = (decorators, target, key, kind) => {
11173
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$9(target, key) : target;
11168
11174
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11169
11175
  if (decorator = decorators[i])
11170
11176
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11171
- if (kind && result) __defProp$8(target, key, result);
11177
+ if (kind && result) __defProp$a(target, key, result);
11172
11178
  return result;
11173
11179
  };
11174
11180
  exports.Ruler = class Ruler extends exports.Control {
@@ -11319,45 +11325,45 @@ exports.Ruler = class Ruler extends exports.Control {
11319
11325
  }
11320
11326
  }
11321
11327
  };
11322
- __decorateClass$8([
11328
+ __decorateClass$a([
11323
11329
  property({ default: 0 })
11324
11330
  ], exports.Ruler.prototype, "offsetX", 2);
11325
- __decorateClass$8([
11331
+ __decorateClass$a([
11326
11332
  property({ default: 0 })
11327
11333
  ], exports.Ruler.prototype, "offsetY", 2);
11328
- __decorateClass$8([
11334
+ __decorateClass$a([
11329
11335
  property({ default: 20 })
11330
11336
  ], exports.Ruler.prototype, "thickness", 2);
11331
- __decorateClass$8([
11337
+ __decorateClass$a([
11332
11338
  property({ default: 3 })
11333
11339
  ], exports.Ruler.prototype, "markHeight", 2);
11334
- __decorateClass$8([
11340
+ __decorateClass$a([
11335
11341
  property({ default: "#b2b6bc" })
11336
11342
  ], exports.Ruler.prototype, "color", 2);
11337
- __decorateClass$8([
11343
+ __decorateClass$a([
11338
11344
  property({ default: "#f9f9fa" })
11339
11345
  ], exports.Ruler.prototype, "markBackgroundColor", 2);
11340
- __decorateClass$8([
11346
+ __decorateClass$a([
11341
11347
  property({ default: "#b2b6bc" })
11342
11348
  ], exports.Ruler.prototype, "markColor", 2);
11343
- __decorateClass$8([
11349
+ __decorateClass$a([
11344
11350
  property({ default: 300 })
11345
11351
  ], exports.Ruler.prototype, "gap", 2);
11346
- __decorateClass$8([
11352
+ __decorateClass$a([
11347
11353
  property({ default: 1 })
11348
11354
  ], exports.Ruler.prototype, "scale", 2);
11349
- exports.Ruler = __decorateClass$8([
11355
+ exports.Ruler = __decorateClass$a([
11350
11356
  customNode("Ruler")
11351
11357
  ], exports.Ruler);
11352
11358
 
11353
- var __defProp$7 = Object.defineProperty;
11354
- var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
11355
- var __decorateClass$7 = (decorators, target, key, kind) => {
11356
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$7(target, key) : target;
11359
+ var __defProp$9 = Object.defineProperty;
11360
+ var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
11361
+ var __decorateClass$9 = (decorators, target, key, kind) => {
11362
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$8(target, key) : target;
11357
11363
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11358
11364
  if (decorator = decorators[i])
11359
11365
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11360
- if (kind && result) __defProp$7(target, key, result);
11366
+ if (kind && result) __defProp$9(target, key, result);
11361
11367
  return result;
11362
11368
  };
11363
11369
  exports.ScrollBar = class ScrollBar extends exports.Range {
@@ -11399,21 +11405,21 @@ exports.ScrollBar = class ScrollBar extends exports.Range {
11399
11405
  this.context.fill();
11400
11406
  }
11401
11407
  };
11402
- __decorateClass$7([
11408
+ __decorateClass$9([
11403
11409
  property({ default: "vertical" })
11404
11410
  ], exports.ScrollBar.prototype, "direction", 2);
11405
- exports.ScrollBar = __decorateClass$7([
11411
+ exports.ScrollBar = __decorateClass$9([
11406
11412
  customNode("ScrollBar")
11407
11413
  ], exports.ScrollBar);
11408
11414
 
11409
- var __defProp$6 = Object.defineProperty;
11410
- var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
11411
- var __decorateClass$6 = (decorators, target, key, kind) => {
11412
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$6(target, key) : target;
11415
+ var __defProp$8 = Object.defineProperty;
11416
+ var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
11417
+ var __decorateClass$8 = (decorators, target, key, kind) => {
11418
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$7(target, key) : target;
11413
11419
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11414
11420
  if (decorator = decorators[i])
11415
11421
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11416
- if (kind && result) __defProp$6(target, key, result);
11422
+ if (kind && result) __defProp$8(target, key, result);
11417
11423
  return result;
11418
11424
  };
11419
11425
  exports.XScrollBar = class XScrollBar extends exports.ScrollBar {
@@ -11422,20 +11428,20 @@ exports.XScrollBar = class XScrollBar extends exports.ScrollBar {
11422
11428
  this.setProperties(properties).append(children);
11423
11429
  }
11424
11430
  };
11425
- exports.XScrollBar = __decorateClass$6([
11431
+ exports.XScrollBar = __decorateClass$8([
11426
11432
  customNode("XScrollBar", {
11427
11433
  direction: "horizontal"
11428
11434
  })
11429
11435
  ], exports.XScrollBar);
11430
11436
 
11431
- var __defProp$5 = Object.defineProperty;
11432
- var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
11433
- var __decorateClass$5 = (decorators, target, key, kind) => {
11434
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$5(target, key) : target;
11437
+ var __defProp$7 = Object.defineProperty;
11438
+ var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
11439
+ var __decorateClass$7 = (decorators, target, key, kind) => {
11440
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$6(target, key) : target;
11435
11441
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11436
11442
  if (decorator = decorators[i])
11437
11443
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11438
- if (kind && result) __defProp$5(target, key, result);
11444
+ if (kind && result) __defProp$7(target, key, result);
11439
11445
  return result;
11440
11446
  };
11441
11447
  exports.YScrollBar = class YScrollBar extends exports.ScrollBar {
@@ -11444,93 +11450,1088 @@ exports.YScrollBar = class YScrollBar extends exports.ScrollBar {
11444
11450
  this.setProperties(properties).append(children);
11445
11451
  }
11446
11452
  };
11447
- exports.YScrollBar = __decorateClass$5([
11453
+ exports.YScrollBar = __decorateClass$7([
11448
11454
  customNode("YScrollBar", {
11449
11455
  direction: "vertical"
11450
11456
  })
11451
11457
  ], exports.YScrollBar);
11452
11458
 
11453
- var __defProp$4 = Object.defineProperty;
11454
- var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
11455
- var __decorateClass$4 = (decorators, target, key, kind) => {
11456
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$4(target, key) : target;
11459
+ var __defProp$6 = Object.defineProperty;
11460
+ var __decorateClass$6 = (decorators, target, key, kind) => {
11461
+ var result = undefined ;
11457
11462
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11458
11463
  if (decorator = decorators[i])
11459
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11460
- if (kind && result) __defProp$4(target, key, result);
11464
+ result = (decorator(target, key, result) ) || result;
11465
+ if (result) __defProp$6(target, key, result);
11461
11466
  return result;
11462
11467
  };
11463
- exports.Scaler = class Scaler extends exports.Node {
11464
- get target() {
11465
- if (this.parent?.style) {
11466
- return this.parent;
11467
- }
11468
- return undefined;
11469
- }
11470
- constructor(properties, children = []) {
11468
+ class ElementStyle extends Resource {
11469
+ _backgroundColor = new Color();
11470
+ constructor(properties) {
11471
11471
  super();
11472
11472
  this.setProperties(properties);
11473
- this.append(children);
11474
11473
  }
11475
11474
  _updateProperty(key, value, oldValue, declaration) {
11476
11475
  super._updateProperty(key, value, oldValue, declaration);
11477
11476
  switch (key) {
11478
- case "value":
11479
- case "min":
11480
- case "max": {
11481
- this.value = clamp(this.minValue, this.value, this.maxValue);
11482
- this._updateScale();
11477
+ case "backgroundColor":
11478
+ this._backgroundColor.value = this.backgroundColor === "none" ? undefined : this.backgroundColor;
11483
11479
  break;
11484
- }
11485
11480
  }
11486
11481
  }
11487
- _updateScale() {
11488
- const target = this.target;
11489
- if (target) {
11490
- target.style.scaleX = this.value;
11491
- target.style.scaleY = this.value;
11492
- this.emit("updateScale", this.value);
11493
- }
11482
+ canPointeEvents() {
11483
+ return this.pointerEvents !== "none";
11494
11484
  }
11495
- _onWheel(e) {
11496
- const target = this.target;
11497
- if (!target)
11498
- return;
11499
- e.preventDefault();
11500
- const isTouchPad = e.wheelDeltaY ? Math.abs(Math.abs(e.wheelDeltaY) - Math.abs(3 * e.deltaY)) < 3 : e.deltaMode === 0;
11501
- if (!isTouchPad && e.ctrlKey) {
11502
- e.preventDefault();
11503
- let distance = e.deltaY / (e.ctrlKey ? 1 : 100);
11504
- distance *= -0.015;
11505
- this.value += distance;
11506
- }
11485
+ getComputedOpacity() {
11486
+ return clamp(0, this.opacity, 1);
11507
11487
  }
11508
- _input(event, key) {
11509
- super._input(event, key);
11510
- switch (key) {
11511
- case "wheel":
11512
- this._onWheel(event);
11513
- break;
11488
+ getComputedBackgroundColor() {
11489
+ return this._backgroundColor;
11490
+ }
11491
+ async loadBackgroundImage() {
11492
+ if (this.backgroundImage !== "none") {
11493
+ return await assets.texture.load(this.backgroundImage);
11514
11494
  }
11515
11495
  }
11516
- };
11517
- __decorateClass$4([
11518
- property({ default: 1 })
11519
- ], exports.Scaler.prototype, "value", 2);
11520
- __decorateClass$4([
11521
- property({ default: 0.05 })
11522
- ], exports.Scaler.prototype, "minValue", 2);
11523
- __decorateClass$4([
11524
- property({ default: 10 })
11525
- ], exports.Scaler.prototype, "maxValue", 2);
11526
- exports.Scaler = __decorateClass$4([
11527
- customNode("Scaler", {
11528
- processMode: "disabled",
11529
- renderMode: "disabled"
11530
- })
11531
- ], exports.Scaler);
11532
-
11533
- var __defProp$3 = Object.defineProperty;
11496
+ getComputedTransformOrigin() {
11497
+ const [originX, originY = originX] = this.transformOrigin.split(" ");
11498
+ return [originX, originY].map((val) => {
11499
+ val = val.trim();
11500
+ switch (val) {
11501
+ case "left":
11502
+ case "top":
11503
+ return 0;
11504
+ case "center":
11505
+ return 0.5;
11506
+ case "right":
11507
+ case "bottom":
11508
+ return 1;
11509
+ default:
11510
+ return Number(val);
11511
+ }
11512
+ });
11513
+ }
11514
+ _defaultFilter = {
11515
+ "brightness": 1,
11516
+ "contrast": 1,
11517
+ "grayscale": 0,
11518
+ "hue-rotate": 0,
11519
+ "invert": 0,
11520
+ "opacity": 1,
11521
+ "saturate": 1,
11522
+ "sepia": 0
11523
+ };
11524
+ getComputedFilter() {
11525
+ let filter = {};
11526
+ if (this.filter === "none") {
11527
+ return filter;
11528
+ }
11529
+ filter = parseCssFunctions(this.filter).reduce((filter2, { name, args }) => {
11530
+ filter2[name] = args[0].normalizedIntValue;
11531
+ return filter2;
11532
+ }, filter);
11533
+ Object.keys(this._defaultFilter).forEach((name) => {
11534
+ filter[name] = filter[name] ?? this._defaultFilter[name];
11535
+ });
11536
+ return filter;
11537
+ }
11538
+ getComputedFilterColorMatrix() {
11539
+ const m = new ColorMatrix();
11540
+ const filter = this.getComputedFilter();
11541
+ for (const name in filter) {
11542
+ const value = filter[name];
11543
+ switch (name) {
11544
+ case "hue-rotate":
11545
+ m.hueRotate(value * PI_2);
11546
+ break;
11547
+ case "saturate":
11548
+ m.saturate(value);
11549
+ break;
11550
+ case "brightness":
11551
+ m.brightness(value);
11552
+ break;
11553
+ case "contrast":
11554
+ m.contrast(value);
11555
+ break;
11556
+ case "invert":
11557
+ m.invert(value);
11558
+ break;
11559
+ case "sepia":
11560
+ m.sepia(value);
11561
+ break;
11562
+ case "opacity":
11563
+ m.opacity(value);
11564
+ break;
11565
+ case "grayscale":
11566
+ m.grayscale(value);
11567
+ break;
11568
+ }
11569
+ }
11570
+ return m;
11571
+ }
11572
+ }
11573
+ __decorateClass$6([
11574
+ property({ default: "none" })
11575
+ ], ElementStyle.prototype, "backgroundColor");
11576
+ __decorateClass$6([
11577
+ property({ default: "none" })
11578
+ ], ElementStyle.prototype, "backgroundImage");
11579
+ __decorateClass$6([
11580
+ property({ default: "none" })
11581
+ ], ElementStyle.prototype, "filter");
11582
+ __decorateClass$6([
11583
+ property({ default: "none" })
11584
+ ], ElementStyle.prototype, "boxShadow");
11585
+ __decorateClass$6([
11586
+ property({ default: "none" })
11587
+ ], ElementStyle.prototype, "maskImage");
11588
+ __decorateClass$6([
11589
+ property({ default: 1 })
11590
+ ], ElementStyle.prototype, "opacity");
11591
+ __decorateClass$6([
11592
+ property({ default: 0 })
11593
+ ], ElementStyle.prototype, "borderRadius");
11594
+ __decorateClass$6([
11595
+ property({ default: "#000000" })
11596
+ ], ElementStyle.prototype, "borderColor");
11597
+ __decorateClass$6([
11598
+ property({ default: "none" })
11599
+ ], ElementStyle.prototype, "borderStyle");
11600
+ __decorateClass$6([
11601
+ property({ default: 0 })
11602
+ ], ElementStyle.prototype, "outlineWidth");
11603
+ __decorateClass$6([
11604
+ property({ default: 0 })
11605
+ ], ElementStyle.prototype, "outlineOffset");
11606
+ __decorateClass$6([
11607
+ property({ default: "#000000" })
11608
+ ], ElementStyle.prototype, "outlineColor");
11609
+ __decorateClass$6([
11610
+ property({ default: "none" })
11611
+ ], ElementStyle.prototype, "outlineStyle");
11612
+ __decorateClass$6([
11613
+ property({ default: "visible" })
11614
+ ], ElementStyle.prototype, "visibility");
11615
+ __decorateClass$6([
11616
+ property({ default: "visible" })
11617
+ ], ElementStyle.prototype, "overflow");
11618
+ __decorateClass$6([
11619
+ property({ default: "auto" })
11620
+ ], ElementStyle.prototype, "pointerEvents");
11621
+ __decorateClass$6([
11622
+ property()
11623
+ ], ElementStyle.prototype, "alignContent");
11624
+ __decorateClass$6([
11625
+ property()
11626
+ ], ElementStyle.prototype, "alignItems");
11627
+ __decorateClass$6([
11628
+ property()
11629
+ ], ElementStyle.prototype, "alignSelf");
11630
+ __decorateClass$6([
11631
+ property()
11632
+ ], ElementStyle.prototype, "borderTop");
11633
+ __decorateClass$6([
11634
+ property()
11635
+ ], ElementStyle.prototype, "borderLeft");
11636
+ __decorateClass$6([
11637
+ property()
11638
+ ], ElementStyle.prototype, "borderRight");
11639
+ __decorateClass$6([
11640
+ property()
11641
+ ], ElementStyle.prototype, "borderBottom");
11642
+ __decorateClass$6([
11643
+ property()
11644
+ ], ElementStyle.prototype, "borderWidth");
11645
+ __decorateClass$6([
11646
+ property()
11647
+ ], ElementStyle.prototype, "border");
11648
+ __decorateClass$6([
11649
+ property()
11650
+ ], ElementStyle.prototype, "direction");
11651
+ __decorateClass$6([
11652
+ property()
11653
+ ], ElementStyle.prototype, "display");
11654
+ __decorateClass$6([
11655
+ property()
11656
+ ], ElementStyle.prototype, "flex");
11657
+ __decorateClass$6([
11658
+ property()
11659
+ ], ElementStyle.prototype, "flexBasis");
11660
+ __decorateClass$6([
11661
+ property()
11662
+ ], ElementStyle.prototype, "flexDirection");
11663
+ __decorateClass$6([
11664
+ property()
11665
+ ], ElementStyle.prototype, "flexGrow");
11666
+ __decorateClass$6([
11667
+ property()
11668
+ ], ElementStyle.prototype, "flexShrink");
11669
+ __decorateClass$6([
11670
+ property()
11671
+ ], ElementStyle.prototype, "flexWrap");
11672
+ __decorateClass$6([
11673
+ property()
11674
+ ], ElementStyle.prototype, "height");
11675
+ __decorateClass$6([
11676
+ property()
11677
+ ], ElementStyle.prototype, "justifyContent");
11678
+ __decorateClass$6([
11679
+ property()
11680
+ ], ElementStyle.prototype, "gap");
11681
+ __decorateClass$6([
11682
+ property()
11683
+ ], ElementStyle.prototype, "marginTop");
11684
+ __decorateClass$6([
11685
+ property()
11686
+ ], ElementStyle.prototype, "marginLeft");
11687
+ __decorateClass$6([
11688
+ property()
11689
+ ], ElementStyle.prototype, "marginRight");
11690
+ __decorateClass$6([
11691
+ property()
11692
+ ], ElementStyle.prototype, "marginBottom");
11693
+ __decorateClass$6([
11694
+ property()
11695
+ ], ElementStyle.prototype, "margin");
11696
+ __decorateClass$6([
11697
+ property()
11698
+ ], ElementStyle.prototype, "maxHeight");
11699
+ __decorateClass$6([
11700
+ property()
11701
+ ], ElementStyle.prototype, "maxWidth");
11702
+ __decorateClass$6([
11703
+ property()
11704
+ ], ElementStyle.prototype, "minHeight");
11705
+ __decorateClass$6([
11706
+ property()
11707
+ ], ElementStyle.prototype, "minWidth");
11708
+ __decorateClass$6([
11709
+ property()
11710
+ ], ElementStyle.prototype, "paddingTop");
11711
+ __decorateClass$6([
11712
+ property()
11713
+ ], ElementStyle.prototype, "paddingLeft");
11714
+ __decorateClass$6([
11715
+ property()
11716
+ ], ElementStyle.prototype, "paddingRight");
11717
+ __decorateClass$6([
11718
+ property()
11719
+ ], ElementStyle.prototype, "paddingBottom");
11720
+ __decorateClass$6([
11721
+ property()
11722
+ ], ElementStyle.prototype, "padding");
11723
+ __decorateClass$6([
11724
+ property()
11725
+ ], ElementStyle.prototype, "top");
11726
+ __decorateClass$6([
11727
+ property()
11728
+ ], ElementStyle.prototype, "bottom");
11729
+ __decorateClass$6([
11730
+ property()
11731
+ ], ElementStyle.prototype, "left");
11732
+ __decorateClass$6([
11733
+ property()
11734
+ ], ElementStyle.prototype, "right");
11735
+ __decorateClass$6([
11736
+ property()
11737
+ ], ElementStyle.prototype, "position");
11738
+ __decorateClass$6([
11739
+ property()
11740
+ ], ElementStyle.prototype, "boxSizing");
11741
+ __decorateClass$6([
11742
+ property()
11743
+ ], ElementStyle.prototype, "width");
11744
+ const transformStyle = modernIdoc.getDefaultTransformStyle();
11745
+ for (const key in transformStyle) {
11746
+ defineProperty(ElementStyle, key, { default: transformStyle[key] });
11747
+ }
11748
+ const textStyle = modernIdoc.getDefaultTextStyle();
11749
+ for (const key in textStyle) {
11750
+ defineProperty(ElementStyle, key, { default: textStyle[key] });
11751
+ }
11752
+
11753
+ var __defProp$5 = Object.defineProperty;
11754
+ var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
11755
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11756
+ var __decorateClass$5 = (decorators, target, key, kind) => {
11757
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$5(target, key) : target;
11758
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
11759
+ if (decorator = decorators[i])
11760
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11761
+ if (kind && result) __defProp$5(target, key, result);
11762
+ return result;
11763
+ };
11764
+ var __publicField$4 = (obj, key, value) => __defNormalProp$4(obj, key + "" , value);
11765
+ const alignMap = {
11766
+ "auto": load.Align.Auto,
11767
+ "flex-start": load.Align.FlexStart,
11768
+ "center": load.Align.Center,
11769
+ "flex-end": load.Align.FlexEnd,
11770
+ "stretch": load.Align.Stretch,
11771
+ "baseline": load.Align.Baseline,
11772
+ "space-between": load.Align.SpaceBetween,
11773
+ "space-around": load.Align.SpaceAround,
11774
+ "space-evenly": load.Align.SpaceEvenly
11775
+ };
11776
+ const displayMap = {
11777
+ none: load.Display.None,
11778
+ flex: load.Display.Flex,
11779
+ contents: load.Display.Contents
11780
+ };
11781
+ const directionMap = {
11782
+ inherit: load.Direction.Inherit,
11783
+ ltr: load.Direction.LTR,
11784
+ rtl: load.Direction.RTL
11785
+ };
11786
+ const flexDirectionMap = {
11787
+ "column": load.FlexDirection.Column,
11788
+ "column-reverse": load.FlexDirection.ColumnReverse,
11789
+ "row": load.FlexDirection.Row,
11790
+ "row-reverse": load.FlexDirection.RowReverse
11791
+ };
11792
+ const flexWrapMap = {
11793
+ "no-wrap": load.Wrap.NoWrap,
11794
+ "wrap": load.Wrap.Wrap,
11795
+ "Wrap-reverse": load.Wrap.WrapReverse
11796
+ };
11797
+ const justifyMap = {
11798
+ "flex-start": load.Justify.FlexStart,
11799
+ "center": load.Justify.Center,
11800
+ "flex-end": load.Justify.FlexEnd,
11801
+ "space-between": load.Justify.SpaceBetween,
11802
+ "space-around": load.Justify.SpaceAround,
11803
+ "space-evenly": load.Justify.SpaceEvenly
11804
+ };
11805
+ const overflowMap = {
11806
+ visible: load.Overflow.Visible,
11807
+ hidden: load.Overflow.Hidden,
11808
+ scroll: load.Overflow.Scroll
11809
+ };
11810
+ const positionTypeMap = {
11811
+ static: load.PositionType.Static,
11812
+ relative: load.PositionType.Relative,
11813
+ absolute: load.PositionType.Absolute
11814
+ };
11815
+ const boxSizingMap = {
11816
+ "border-box": load.BoxSizing.BorderBox,
11817
+ "content-box": load.BoxSizing.ContentBox
11818
+ };
11819
+ exports.Element = class Element extends exports.Node {
11820
+ static async loadLayoutEngine() {
11821
+ this.layoutEngine = await load.loadYoga();
11822
+ }
11823
+ get style() {
11824
+ return this._style;
11825
+ }
11826
+ set style(style) {
11827
+ const cb = (...args) => {
11828
+ this.emit("updateStyleProperty", ...args);
11829
+ this._updateStyleProperty(args[0], args[1], args[2], args[3]);
11830
+ };
11831
+ style.on("updateProperty", cb);
11832
+ this._style?.off("updateProperty", cb);
11833
+ this._style = style;
11834
+ }
11835
+ _layout = exports.Element.layoutEngine.Node.create();
11836
+ transform = new Transform2D();
11837
+ _parentTransformDirtyId;
11838
+ opacity = 1;
11839
+ visible = true;
11840
+ _parentOpacity;
11841
+ _parentVisible;
11842
+ _modulate = new Color(4294967295);
11843
+ _backgroundImage;
11844
+ context = new CanvasContext();
11845
+ _resetContext = true;
11846
+ _redrawing = false;
11847
+ _reflowing = false;
11848
+ _repainting = false;
11849
+ _originalBatchables = [];
11850
+ _layoutedBatchables = [];
11851
+ _batchables = [];
11852
+ constructor(properties, children = []) {
11853
+ super();
11854
+ this._updateStyleProperty = this._updateStyleProperty.bind(this);
11855
+ this.style = new ElementStyle();
11856
+ this.setProperties(properties).append(children);
11857
+ }
11858
+ setProperties(properties) {
11859
+ if (properties) {
11860
+ const { style, ...restProperties } = properties;
11861
+ style && this.style.setProperties(style);
11862
+ super.setProperties(restProperties);
11863
+ }
11864
+ return this;
11865
+ }
11866
+ _parented(parent) {
11867
+ super._parented(parent);
11868
+ if (parent._layout && this._layout) {
11869
+ parent._layout.insertChild(
11870
+ this._layout,
11871
+ parent._layout.getChildCount()
11872
+ );
11873
+ }
11874
+ }
11875
+ _unparented(oldParent) {
11876
+ super._unparented(oldParent);
11877
+ if (oldParent._layout && this._layout) {
11878
+ oldParent._layout.removeChild(this._layout);
11879
+ }
11880
+ }
11881
+ _updateProperty(key, value, oldValue, declaration) {
11882
+ super._updateProperty(key, value, oldValue, declaration);
11883
+ switch (key) {
11884
+ case "modulate":
11885
+ this._modulate.value = value;
11886
+ this.requestRepaint();
11887
+ break;
11888
+ case "blendMode":
11889
+ return this.requestRepaint();
11890
+ }
11891
+ }
11892
+ // eslint-disable-next-line unused-imports/no-unused-vars
11893
+ _updateStyleProperty(key, value, oldValue, declaration) {
11894
+ switch (key) {
11895
+ /** layout */
11896
+ case "alignContent":
11897
+ this._layout.setAlignContent(alignMap[this.style.alignContent]);
11898
+ break;
11899
+ case "alignItems":
11900
+ this._layout.setAlignItems(alignMap[this.style.alignItems]);
11901
+ break;
11902
+ case "alignSelf":
11903
+ this._layout.setAlignSelf(alignMap[this.style.alignSelf]);
11904
+ break;
11905
+ case "aspectRatio":
11906
+ this._layout.setAspectRatio(value);
11907
+ break;
11908
+ case "borderTop":
11909
+ this._layout.setBorder(load.Edge.Top, this.style.borderWidth);
11910
+ break;
11911
+ case "borderBottom":
11912
+ this._layout.setBorder(load.Edge.Bottom, this.style.borderWidth);
11913
+ break;
11914
+ case "borderLeft":
11915
+ this._layout.setBorder(load.Edge.Left, this.style.borderWidth);
11916
+ break;
11917
+ case "borderRight":
11918
+ this._layout.setBorder(load.Edge.Right, this.style.borderWidth);
11919
+ break;
11920
+ case "border":
11921
+ this._layout.setBorder(load.Edge.All, this.style.borderWidth);
11922
+ break;
11923
+ case "direction":
11924
+ this._layout.setDirection(directionMap[this.style.direction]);
11925
+ break;
11926
+ case "display":
11927
+ this._layout.setDisplay(displayMap[this.style.display]);
11928
+ break;
11929
+ case "flex":
11930
+ this._layout.setFlex(this.style.flex);
11931
+ break;
11932
+ case "flexBasis":
11933
+ this._layout.setFlexBasis(this.style.flexBasis);
11934
+ break;
11935
+ case "flexDirection":
11936
+ this._layout.setFlexDirection(flexDirectionMap[this.style.flexDirection]);
11937
+ break;
11938
+ case "flexGrow":
11939
+ this._layout.setFlexGrow(this.style.flexGrow);
11940
+ break;
11941
+ case "flexShrink":
11942
+ this._layout.setFlexShrink(this.style.flexShrink);
11943
+ break;
11944
+ case "flexWrap":
11945
+ this._layout.setFlexWrap(flexWrapMap[this.style.flexWrap]);
11946
+ break;
11947
+ case "height":
11948
+ this._layout.setHeight(this.style.height);
11949
+ break;
11950
+ case "justifyContent":
11951
+ this._layout.setJustifyContent(justifyMap[this.style.justifyContent]);
11952
+ break;
11953
+ case "gap":
11954
+ this._layout.setGap(load.Gutter.All, this.style.gap);
11955
+ break;
11956
+ case "marginTop":
11957
+ this._layout.setMargin(load.Edge.Top, this.style.marginTop);
11958
+ break;
11959
+ case "marginBottom":
11960
+ this._layout.setMargin(load.Edge.Top, this.style.marginBottom);
11961
+ break;
11962
+ case "marginLeft":
11963
+ this._layout.setMargin(load.Edge.Left, this.style.marginLeft);
11964
+ break;
11965
+ case "marginRight":
11966
+ this._layout.setMargin(load.Edge.Top, this.style.marginRight);
11967
+ break;
11968
+ case "margin":
11969
+ this._layout.setMargin(load.Edge.All, this.style.margin);
11970
+ break;
11971
+ case "maxHeight":
11972
+ this._layout.setMaxHeight(this.style.maxHeight);
11973
+ break;
11974
+ case "maxWidth":
11975
+ this._layout.setMaxWidth(this.style.maxWidth);
11976
+ break;
11977
+ // setDirtiedFunc(dirtiedFunc: DirtiedFunction | null): void;
11978
+ // setMeasureFunc(measureFunc: MeasureFunction | null): void;
11979
+ case "minHeight":
11980
+ this._layout.setMinHeight(this.style.minHeight);
11981
+ break;
11982
+ case "minWidth":
11983
+ this._layout.setMinWidth(this.style.minWidth);
11984
+ break;
11985
+ case "overflow":
11986
+ this._layout.setOverflow(overflowMap[this.style.overflow]);
11987
+ break;
11988
+ case "paddingTop":
11989
+ this._layout.setPadding(load.Edge.Top, this.style.paddingTop);
11990
+ break;
11991
+ case "paddingBottom":
11992
+ this._layout.setPadding(load.Edge.Bottom, this.style.paddingBottom);
11993
+ break;
11994
+ case "paddingLeft":
11995
+ this._layout.setPadding(load.Edge.Left, this.style.paddingLeft);
11996
+ break;
11997
+ case "paddingRight":
11998
+ this._layout.setPadding(load.Edge.Right, this.style.paddingRight);
11999
+ break;
12000
+ case "padding":
12001
+ this._layout.setPadding(load.Edge.All, this.style.padding);
12002
+ break;
12003
+ case "top":
12004
+ this._layout.setPosition(load.Edge.Top, this.style.top);
12005
+ break;
12006
+ case "bottom":
12007
+ this._layout.setPosition(load.Edge.Bottom, this.style.bottom);
12008
+ break;
12009
+ case "left":
12010
+ this._layout.setPosition(load.Edge.Left, this.style.left);
12011
+ break;
12012
+ case "right":
12013
+ this._layout.setPosition(load.Edge.Right, this.style.right);
12014
+ break;
12015
+ case "position":
12016
+ this._layout.setPositionType(positionTypeMap[this.style.position]);
12017
+ break;
12018
+ case "boxSizing":
12019
+ this._layout.setBoxSizing(boxSizingMap[this.style.boxSizing]);
12020
+ break;
12021
+ case "width":
12022
+ this._layout.setWidth(this.style.width);
12023
+ break;
12024
+ case "scaleX":
12025
+ case "scaleY":
12026
+ case "rotate":
12027
+ case "transform":
12028
+ case "transformOrigin":
12029
+ this._updateTransform();
12030
+ break;
12031
+ /** draw */
12032
+ case "backgroundColor":
12033
+ this._updateBackgroundColor();
12034
+ break;
12035
+ case "backgroundImage":
12036
+ this._updateBackgroundImage();
12037
+ break;
12038
+ case "opacity":
12039
+ this._updateOpacity();
12040
+ break;
12041
+ case "visibility":
12042
+ this._updateVisible();
12043
+ break;
12044
+ case "filter":
12045
+ this.requestRepaint();
12046
+ break;
12047
+ case "boxShadow":
12048
+ this._updateBoxShadow();
12049
+ break;
12050
+ case "maskImage":
12051
+ this._updateMaskImage();
12052
+ break;
12053
+ case "borderRadius":
12054
+ this.requestRedraw();
12055
+ break;
12056
+ }
12057
+ }
12058
+ _updateBoxShadow() {
12059
+ const nodePath = "__$style.shadow";
12060
+ if (this.style.boxShadow !== "none") {
12061
+ const node = this.getNode(nodePath);
12062
+ if (node) ; else {
12063
+ this.appendChild(new exports.ShadowEffect(), "back");
12064
+ }
12065
+ } else {
12066
+ const node = this.getNode(nodePath);
12067
+ if (node) {
12068
+ this.removeChild(node);
12069
+ }
12070
+ }
12071
+ }
12072
+ _updateMaskImage() {
12073
+ const nodePath = "__$style.maskImage";
12074
+ const maskImage = this.style.maskImage;
12075
+ if (maskImage && maskImage !== "none") {
12076
+ const node = this.getNode(nodePath);
12077
+ if (node) {
12078
+ node.src = maskImage;
12079
+ } else {
12080
+ this.appendChild(new exports.MaskEffect({ src: maskImage }), "back");
12081
+ }
12082
+ } else {
12083
+ const node = this.getNode(nodePath);
12084
+ if (node) {
12085
+ this.removeChild(node);
12086
+ }
12087
+ }
12088
+ }
12089
+ _updateBackgroundColor() {
12090
+ const backgroundColor = this.style.getComputedBackgroundColor();
12091
+ if (this._originalBatchables.length) {
12092
+ this.requestRepaint();
12093
+ } else if (backgroundColor.a > 0) {
12094
+ this.requestRedraw();
12095
+ }
12096
+ }
12097
+ async _updateBackgroundImage() {
12098
+ this._backgroundImage = await this.style.loadBackgroundImage();
12099
+ this.requestRedraw();
12100
+ }
12101
+ _updateOpacity() {
12102
+ const opacity = this.style.getComputedOpacity() * (this.getParent()?.opacity ?? 1);
12103
+ if (this.opacity !== opacity) {
12104
+ this.opacity = opacity;
12105
+ this.requestRepaint();
12106
+ }
12107
+ }
12108
+ _updateVisible() {
12109
+ this.visible = this.style.visibility === "visible" && (this.getParent()?.visible ?? true);
12110
+ }
12111
+ _updateTransform() {
12112
+ this.calculateLayout(undefined, undefined, load.Direction.LTR);
12113
+ const layout = this._layout.getComputedLayout();
12114
+ const { left, top, width, height } = layout;
12115
+ const {
12116
+ scaleX,
12117
+ scaleY,
12118
+ rotate
12119
+ } = this.style;
12120
+ const t3d = new Transform2D(false);
12121
+ const t2d = new Transform2D(false).scale(scaleX, scaleY).translate(left, top).rotate(rotate * DEG_TO_RAD);
12122
+ const _t3d = new Transform2D();
12123
+ parseCssFunctions(
12124
+ !this.style.transform || this.style.transform === "none" ? "" : this.style.transform,
12125
+ { width, height }
12126
+ ).forEach(({ name, args }) => {
12127
+ const values = args.map((arg) => arg.normalizedIntValue);
12128
+ _t3d.identity();
12129
+ switch (name) {
12130
+ case "translate":
12131
+ _t3d.translate(values[0] * width, (values[1] ?? values[0]) * height);
12132
+ break;
12133
+ case "translateX":
12134
+ _t3d.translateX(values[0] * width);
12135
+ break;
12136
+ case "translateY":
12137
+ _t3d.translateY(values[0] * height);
12138
+ break;
12139
+ case "translateZ":
12140
+ _t3d.translateZ(values[0]);
12141
+ break;
12142
+ case "translate3d":
12143
+ _t3d.translate3d(
12144
+ values[0] * width,
12145
+ (values[1] ?? values[0]) * height,
12146
+ values[2] ?? values[1] ?? values[0]
12147
+ );
12148
+ break;
12149
+ case "scale":
12150
+ _t3d.scale(values[0], values[1] ?? values[0]);
12151
+ break;
12152
+ case "scaleX":
12153
+ _t3d.scaleX(values[0]);
12154
+ break;
12155
+ case "scaleY":
12156
+ _t3d.scaleY(values[0]);
12157
+ break;
12158
+ case "scale3d":
12159
+ _t3d.scale3d(values[0], values[1] ?? values[0], values[2] ?? values[1] ?? values[0]);
12160
+ break;
12161
+ case "rotate":
12162
+ _t3d.rotate(values[0] * PI_2);
12163
+ break;
12164
+ case "rotateX":
12165
+ _t3d.rotateX(values[0] * PI_2);
12166
+ break;
12167
+ case "rotateY":
12168
+ _t3d.rotateY(values[0] * PI_2);
12169
+ break;
12170
+ case "rotateZ":
12171
+ _t3d.rotateZ(values[0] * PI_2);
12172
+ break;
12173
+ case "rotate3d":
12174
+ _t3d.rotate3d(
12175
+ values[0] * PI_2,
12176
+ (values[1] ?? values[0]) * PI_2,
12177
+ (values[2] ?? values[1] ?? values[0]) * PI_2,
12178
+ (values[3] ?? values[2] ?? values[1] ?? values[0]) * PI_2
12179
+ );
12180
+ break;
12181
+ case "skew":
12182
+ _t3d.skew(values[0], values[0] ?? values[1]);
12183
+ break;
12184
+ case "skewX":
12185
+ _t3d.skewX(values[0]);
12186
+ break;
12187
+ case "skewY":
12188
+ _t3d.skewY(values[0]);
12189
+ break;
12190
+ case "matrix":
12191
+ _t3d.set(values);
12192
+ break;
12193
+ }
12194
+ t3d.multiply(_t3d);
12195
+ });
12196
+ t2d.update();
12197
+ t3d.update();
12198
+ const t2dArr = t2d.toArray();
12199
+ const t3dArr = t3d.toArray();
12200
+ const t3dT2dArr = [
12201
+ t3dArr[0] * t2dArr[0] + t3dArr[3] * t2dArr[1],
12202
+ t3dArr[1] * t2dArr[0] + t3dArr[4] * t2dArr[1],
12203
+ t3dArr[2] * t2dArr[0] + t3dArr[5] * t2dArr[1] + t2dArr[2],
12204
+ t3dArr[0] * t2dArr[3] + t3dArr[3] * t2dArr[4],
12205
+ t3dArr[1] * t2dArr[3] + t3dArr[4] * t2dArr[4],
12206
+ t3dArr[2] * t2dArr[3] + t3dArr[5] * t2dArr[4] + t2dArr[5],
12207
+ 0,
12208
+ 0,
12209
+ 1
12210
+ ];
12211
+ const [originX, originY] = this.style.getComputedTransformOrigin();
12212
+ const offsetX = originX * width;
12213
+ const offsetY = originY * height;
12214
+ t3dT2dArr[2] += t3dT2dArr[0] * -offsetX + t3dT2dArr[1] * -offsetY + offsetX;
12215
+ t3dT2dArr[5] += t3dT2dArr[3] * -offsetX + t3dT2dArr[4] * -offsetY + offsetY;
12216
+ const parent = this.getParent();
12217
+ const parentTransform = parent?.transform;
12218
+ this._parentTransformDirtyId = parentTransform?.dirtyId;
12219
+ let transform;
12220
+ if (parentTransform) {
12221
+ const pt = parentTransform.toArray();
12222
+ transform = [
12223
+ t3dT2dArr[0] * pt[0] + t3dT2dArr[3] * pt[1],
12224
+ t3dT2dArr[1] * pt[0] + t3dT2dArr[4] * pt[1],
12225
+ t3dT2dArr[2] * pt[0] + t3dT2dArr[5] * pt[1] + pt[2],
12226
+ t3dT2dArr[0] * pt[3] + t3dT2dArr[3] * pt[4],
12227
+ t3dT2dArr[1] * pt[3] + t3dT2dArr[4] * pt[4],
12228
+ t3dT2dArr[2] * pt[3] + t3dT2dArr[5] * pt[4] + pt[5],
12229
+ 0,
12230
+ 0,
12231
+ 1
12232
+ ];
12233
+ } else {
12234
+ transform = t3dT2dArr;
12235
+ }
12236
+ this.transform.set(transform);
12237
+ this._updateOverflow();
12238
+ this.requestRedraw();
12239
+ }
12240
+ getRect() {
12241
+ const [a, c, tx, b, d, ty] = this.transform.toArray();
12242
+ const width = this._layout.getComputedWidth() ?? 0;
12243
+ const height = this._layout.getComputedHeight() ?? 0;
12244
+ return new Rect2(
12245
+ tx,
12246
+ ty,
12247
+ a * width + c * height,
12248
+ b * width + d * height
12249
+ );
12250
+ }
12251
+ _updateOverflow() {
12252
+ if (this.style.overflow === "hidden") {
12253
+ const rect = this.getRect();
12254
+ this.mask = {
12255
+ x: rect.x,
12256
+ y: rect.y,
12257
+ width: rect.width,
12258
+ height: rect.height
12259
+ };
12260
+ } else {
12261
+ this.mask = undefined;
12262
+ }
12263
+ }
12264
+ show() {
12265
+ this.style.visibility = "visible";
12266
+ }
12267
+ hide() {
12268
+ this.style.visibility = "hidden";
12269
+ }
12270
+ isVisibleInTree() {
12271
+ return this.opacity > 0 && this.visible;
12272
+ }
12273
+ canRender() {
12274
+ return super.canRender() && this.isVisibleInTree();
12275
+ }
12276
+ requestRedraw() {
12277
+ this._redrawing = true;
12278
+ }
12279
+ requestReflow() {
12280
+ this._reflowing = true;
12281
+ }
12282
+ requestRepaint() {
12283
+ this._repainting = true;
12284
+ }
12285
+ _process(delta) {
12286
+ const parent = this.getParent();
12287
+ if (this._parentVisible !== parent?.visible) {
12288
+ this._parentVisible = parent?.visible;
12289
+ this._updateVisible();
12290
+ }
12291
+ if (this._parentOpacity !== parent?.opacity) {
12292
+ this._parentOpacity = parent?.opacity;
12293
+ this._updateOpacity();
12294
+ }
12295
+ if (this._layout.hasNewLayout() || parent?.transform?.dirtyId !== this._parentTransformDirtyId) {
12296
+ this._layout.markLayoutSeen();
12297
+ this._updateTransform();
12298
+ }
12299
+ super._process(delta);
12300
+ }
12301
+ _transformVertices(vertices) {
12302
+ const [a, c, tx, b, d, ty] = this.transform.toArray();
12303
+ const newVertices = vertices.slice();
12304
+ for (let len = vertices.length, i = 0; i < len; i += 2) {
12305
+ const x = vertices[i];
12306
+ const y = vertices[i + 1];
12307
+ newVertices[i] = a * x + c * y + tx;
12308
+ newVertices[i + 1] = b * x + d * y + ty;
12309
+ }
12310
+ return newVertices;
12311
+ }
12312
+ _draw() {
12313
+ this._drawBackground();
12314
+ this._drawContent();
12315
+ this._drawBorder();
12316
+ this._drawOutline();
12317
+ }
12318
+ _drawBackground() {
12319
+ const texture = this._backgroundImage;
12320
+ if (texture?.valid) {
12321
+ this.context.fillStyle = texture;
12322
+ this.context.textureTransform = new Transform2D().scale(
12323
+ this._layout.getComputedWidth() / texture.width,
12324
+ this._layout.getComputedHeight() / texture.height
12325
+ );
12326
+ this._fillBoundingRect();
12327
+ }
12328
+ }
12329
+ _drawContent() {
12330
+ this._fillBoundingRect();
12331
+ }
12332
+ _drawBorder() {
12333
+ if (this.style.borderWidth && this.style.borderStyle !== "none") {
12334
+ this.context.lineWidth = this.style.borderWidth;
12335
+ this.context.strokeStyle = this.style.borderColor;
12336
+ this._strokeBoundingRect();
12337
+ }
12338
+ }
12339
+ _drawOutline() {
12340
+ if (this.style.outlineWidth && this.style.outlineColor !== "none") {
12341
+ this.context.lineWidth = this.style.outlineWidth;
12342
+ this.context.strokeStyle = this.style.outlineColor;
12343
+ this._strokeBoundingRect();
12344
+ }
12345
+ }
12346
+ _drawBoundingRect() {
12347
+ const { borderRadius } = this.style;
12348
+ const width = this._layout.getComputedWidth();
12349
+ const height = this._layout.getComputedHeight();
12350
+ if (width && height) {
12351
+ if (borderRadius) {
12352
+ this.context.roundRect(0, 0, width, height, borderRadius);
12353
+ } else {
12354
+ this.context.rect(0, 0, width, height);
12355
+ }
12356
+ }
12357
+ }
12358
+ _fillBoundingRect() {
12359
+ this._drawBoundingRect();
12360
+ this.context.fill();
12361
+ }
12362
+ _strokeBoundingRect() {
12363
+ this._drawBoundingRect();
12364
+ this.context.stroke();
12365
+ }
12366
+ _relayout(batchables) {
12367
+ return this._reflow(batchables);
12368
+ }
12369
+ _reflow(batchables) {
12370
+ return this._repaint(
12371
+ batchables.map((batchable) => {
12372
+ return {
12373
+ ...batchable,
12374
+ vertices: this._transformVertices(batchable.vertices)
12375
+ };
12376
+ })
12377
+ );
12378
+ }
12379
+ _repaint(batchables) {
12380
+ const colorMatrix = this.style.getComputedFilterColorMatrix();
12381
+ return batchables.map((batchable) => {
12382
+ return {
12383
+ ...batchable,
12384
+ backgroundColor: this.style.getComputedBackgroundColor().abgr,
12385
+ modulate: this._modulate.toArgb(this.opacity, true),
12386
+ colorMatrix: colorMatrix.toMatrix4().toArray(true),
12387
+ colorMatrixOffset: colorMatrix.toVector4().toArray(),
12388
+ blendMode: this.blendMode
12389
+ };
12390
+ });
12391
+ }
12392
+ calculateLayout(width, height, direction) {
12393
+ const parent = this.getParent();
12394
+ if (parent?.calculateLayout) {
12395
+ parent.calculateLayout(width, height, direction);
12396
+ } else {
12397
+ this._layout.calculateLayout(width, height, direction);
12398
+ }
12399
+ }
12400
+ _render(renderer) {
12401
+ let batchables;
12402
+ if (this._redrawing) {
12403
+ this.emit("draw");
12404
+ this._draw();
12405
+ this._originalBatchables = this.context.toBatchables();
12406
+ this._layoutedBatchables = this._relayout(this._originalBatchables);
12407
+ batchables = this._layoutedBatchables;
12408
+ if (this._resetContext) {
12409
+ this.context.reset();
12410
+ }
12411
+ } else if (this._reflowing) {
12412
+ this._layoutedBatchables = this._reflow(this._originalBatchables);
12413
+ batchables = this._layoutedBatchables;
12414
+ } else if (this._repainting) {
12415
+ batchables = this._repaint(this._layoutedBatchables);
12416
+ }
12417
+ if (batchables) {
12418
+ this._batchables = batchables;
12419
+ this._redrawing = false;
12420
+ this._reflowing = false;
12421
+ this._repainting = false;
12422
+ }
12423
+ this._batchables.forEach((batchable) => {
12424
+ batchable.texture?.upload(renderer);
12425
+ renderer.batch2D.render({
12426
+ ...batchable,
12427
+ texture: batchable.texture?._glTexture(renderer)
12428
+ });
12429
+ });
12430
+ super._render(renderer);
12431
+ }
12432
+ toJSON() {
12433
+ const json = super.toJSON();
12434
+ return {
12435
+ ...json,
12436
+ props: {
12437
+ style: this.style.toJSON(),
12438
+ ...json.props
12439
+ }
12440
+ };
12441
+ }
12442
+ };
12443
+ __publicField$4(exports.Element, "layoutEngine");
12444
+ __decorateClass$5([
12445
+ property()
12446
+ ], exports.Element.prototype, "modulate", 2);
12447
+ __decorateClass$5([
12448
+ property()
12449
+ ], exports.Element.prototype, "blendMode", 2);
12450
+ exports.Element = __decorateClass$5([
12451
+ customNode("Element")
12452
+ ], exports.Element);
12453
+
12454
+ var __defProp$4 = Object.defineProperty;
12455
+ var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
12456
+ var __decorateClass$4 = (decorators, target, key, kind) => {
12457
+ var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$4(target, key) : target;
12458
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
12459
+ if (decorator = decorators[i])
12460
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
12461
+ if (kind && result) __defProp$4(target, key, result);
12462
+ return result;
12463
+ };
12464
+ exports.Scaler = class Scaler extends exports.Node {
12465
+ get target() {
12466
+ if (this.parent?.style) {
12467
+ return this.parent;
12468
+ }
12469
+ return undefined;
12470
+ }
12471
+ constructor(properties, children = []) {
12472
+ super();
12473
+ this.setProperties(properties);
12474
+ this.append(children);
12475
+ }
12476
+ _updateProperty(key, value, oldValue, declaration) {
12477
+ super._updateProperty(key, value, oldValue, declaration);
12478
+ switch (key) {
12479
+ case "value":
12480
+ case "min":
12481
+ case "max": {
12482
+ this.value = clamp(this.minValue, this.value, this.maxValue);
12483
+ this._updateScale();
12484
+ break;
12485
+ }
12486
+ }
12487
+ }
12488
+ _updateScale() {
12489
+ const target = this.target;
12490
+ if (target) {
12491
+ target.style.scaleX = this.value;
12492
+ target.style.scaleY = this.value;
12493
+ this.emit("updateScale", this.value);
12494
+ }
12495
+ }
12496
+ _onWheel(e) {
12497
+ const target = this.target;
12498
+ if (!target)
12499
+ return;
12500
+ e.preventDefault();
12501
+ const isTouchPad = e.wheelDeltaY ? Math.abs(Math.abs(e.wheelDeltaY) - Math.abs(3 * e.deltaY)) < 3 : e.deltaMode === 0;
12502
+ if (!isTouchPad && e.ctrlKey) {
12503
+ e.preventDefault();
12504
+ let distance = e.deltaY / (e.ctrlKey ? 1 : 100);
12505
+ distance *= -0.015;
12506
+ this.value += distance;
12507
+ }
12508
+ }
12509
+ _input(event, key) {
12510
+ super._input(event, key);
12511
+ switch (key) {
12512
+ case "wheel":
12513
+ this._onWheel(event);
12514
+ break;
12515
+ }
12516
+ }
12517
+ };
12518
+ __decorateClass$4([
12519
+ property({ default: 1 })
12520
+ ], exports.Scaler.prototype, "value", 2);
12521
+ __decorateClass$4([
12522
+ property({ default: 0.05 })
12523
+ ], exports.Scaler.prototype, "minValue", 2);
12524
+ __decorateClass$4([
12525
+ property({ default: 10 })
12526
+ ], exports.Scaler.prototype, "maxValue", 2);
12527
+ exports.Scaler = __decorateClass$4([
12528
+ customNode("Scaler", {
12529
+ processMode: "disabled",
12530
+ renderMode: "disabled"
12531
+ })
12532
+ ], exports.Scaler);
12533
+
12534
+ var __defProp$3 = Object.defineProperty;
11534
12535
  var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
11535
12536
  var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11536
12537
  var __decorateClass$3 = (decorators, target, key, kind) => {
@@ -12222,8 +13223,7 @@ class Assets {
12222
13223
  }
12223
13224
  const assets = new Assets().use(new FontLoader()).use(new GifLoader()).use(new JsonLoader()).use(new LottieLoader()).use(new TextLoader()).use(new TextureLoader()).use(new VideoLoader());
12224
13225
 
12225
- class CanvasEditor extends exports.Control {
12226
- name = "CanvasEditor";
13226
+ class CanvasItemEditor extends exports.Control {
12227
13227
  hover = new exports.Node2D({
12228
13228
  name: "hover",
12229
13229
  internalMode: "back",
@@ -12256,22 +13256,7 @@ class CanvasEditor extends exports.Control {
12256
13256
  internalMode: "back"
12257
13257
  }).on("updateScale", (scale) => {
12258
13258
  this.ruler.scale = scale;
12259
- const scrollHeight = this.drawboard.style.height * scale;
12260
- const scrollWidth = this.drawboard.style.width * scale;
12261
- if (scrollHeight > this.style.height) {
12262
- this.yScrollBar.style.visibility = "visible";
12263
- this.yScrollBar.maxValue = scrollHeight;
12264
- this.yScrollBar.page = this.style.height;
12265
- } else {
12266
- this.yScrollBar.style.visibility = "hidden";
12267
- }
12268
- if (scrollWidth > this.style.width) {
12269
- this.xScrollBar.style.visibility = "visible";
12270
- this.xScrollBar.maxValue = scrollWidth;
12271
- this.xScrollBar.page = this.style.width;
12272
- } else {
12273
- this.xScrollBar.style.visibility = "hidden";
12274
- }
13259
+ this._updateScrollbars();
12275
13260
  });
12276
13261
  xScrollBar = new exports.XScrollBar({
12277
13262
  internalMode: "back",
@@ -12295,20 +13280,20 @@ class CanvasEditor extends exports.Control {
12295
13280
  pointerEvents: "none",
12296
13281
  boxShadow: "2px 2px 2px 1px rgba(0, 0, 0, 0.2)"
12297
13282
  }
12298
- }).append(
13283
+ }, [
12299
13284
  this.scaler
12300
- );
13285
+ ]);
12301
13286
  ruler = new exports.Ruler({
12302
13287
  name: "ruler",
12303
13288
  offsetX: 100,
12304
13289
  offsetY: 100
12305
- }).append(
13290
+ }, [
12306
13291
  this.drawboard,
12307
13292
  this.hover,
12308
13293
  this.selectionRect,
12309
13294
  this.xScrollBar,
12310
13295
  this.yScrollBar
12311
- );
13296
+ ]);
12312
13297
  _pointerStart;
12313
13298
  _pointerOffset;
12314
13299
  selected;
@@ -12394,6 +13379,25 @@ class CanvasEditor extends exports.Control {
12394
13379
  this.hover.style.visibility = "hidden";
12395
13380
  }
12396
13381
  }
13382
+ _updateScrollbars() {
13383
+ const scale = this.ruler.scale;
13384
+ const scrollHeight = this.drawboard.style.height * scale;
13385
+ const scrollWidth = this.drawboard.style.width * scale;
13386
+ if (scrollHeight > this.style.height) {
13387
+ this.yScrollBar.style.visibility = "visible";
13388
+ this.yScrollBar.maxValue = scrollHeight;
13389
+ this.yScrollBar.page = this.style.height;
13390
+ } else {
13391
+ this.yScrollBar.style.visibility = "hidden";
13392
+ }
13393
+ if (scrollWidth > this.style.width) {
13394
+ this.xScrollBar.style.visibility = "visible";
13395
+ this.xScrollBar.maxValue = scrollWidth;
13396
+ this.xScrollBar.page = this.style.width;
13397
+ } else {
13398
+ this.xScrollBar.style.visibility = "hidden";
13399
+ }
13400
+ }
12397
13401
  }
12398
13402
 
12399
13403
  const defaultOptions = {
@@ -12587,9 +13591,9 @@ async function performRender(options) {
12587
13591
  engine.resize(width, height);
12588
13592
  (Array.isArray(data) ? data : [data]).forEach((v) => {
12589
13593
  if (v instanceof exports.Node) {
12590
- root.addChild(v);
13594
+ root.appendChild(v);
12591
13595
  } else {
12592
- root.addChild(exports.Node.parse(v));
13596
+ root.appendChild(exports.Node.parse(v));
12593
13597
  }
12594
13598
  });
12595
13599
  await engine.waitUntilLoad();
@@ -12607,7 +13611,7 @@ exports.AudioPipeline = AudioPipeline;
12607
13611
  exports.AudioProcessor = AudioProcessor;
12608
13612
  exports.AudioSpectrum = AudioSpectrum;
12609
13613
  exports.CanvasContext = CanvasContext;
12610
- exports.CanvasEditor = CanvasEditor;
13614
+ exports.CanvasItemEditor = CanvasItemEditor;
12611
13615
  exports.CanvasItemStyle = CanvasItemStyle;
12612
13616
  exports.CanvasTexture = CanvasTexture;
12613
13617
  exports.Color = Color;
@@ -12617,6 +13621,7 @@ exports.CoreObject = CoreObject;
12617
13621
  exports.DEG_TO_RAD = DEG_TO_RAD;
12618
13622
  exports.DEVICE_PIXEL_RATIO = DEVICE_PIXEL_RATIO;
12619
13623
  exports.EffectMaterial = EffectMaterial;
13624
+ exports.ElementStyle = ElementStyle;
12620
13625
  exports.Engine = Engine;
12621
13626
  exports.EventEmitter = EventEmitter;
12622
13627
  exports.FontLoader = FontLoader;