modern-canvas 0.3.2 → 0.3.3

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.mjs CHANGED
@@ -2202,13 +2202,13 @@ class Vector3 extends Vector {
2202
2202
  }
2203
2203
  }
2204
2204
 
2205
- var __defProp$O = Object.defineProperty;
2206
- var __decorateClass$O = (decorators, target, key, kind) => {
2205
+ var __defProp$P = Object.defineProperty;
2206
+ var __decorateClass$P = (decorators, target, key, kind) => {
2207
2207
  var result = undefined ;
2208
2208
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
2209
2209
  if (decorator = decorators[i])
2210
2210
  result = (decorator(target, key, result) ) || result;
2211
- if (result) __defProp$O(target, key, result);
2211
+ if (result) __defProp$P(target, key, result);
2212
2212
  return result;
2213
2213
  };
2214
2214
  class MainLoop extends CoreObject {
@@ -2249,10 +2249,10 @@ class MainLoop extends CoreObject {
2249
2249
  }
2250
2250
  }
2251
2251
  }
2252
- __decorateClass$O([
2252
+ __decorateClass$P([
2253
2253
  property({ default: 24 })
2254
2254
  ], MainLoop.prototype, "fps");
2255
- __decorateClass$O([
2255
+ __decorateClass$P([
2256
2256
  property({ default: 1 })
2257
2257
  ], MainLoop.prototype, "speed");
2258
2258
 
@@ -4396,13 +4396,13 @@ class Geometry extends Resource {
4396
4396
  }
4397
4397
  }
4398
4398
 
4399
- var __defProp$N = Object.defineProperty;
4400
- var __decorateClass$N = (decorators, target, key, kind) => {
4399
+ var __defProp$O = Object.defineProperty;
4400
+ var __decorateClass$O = (decorators, target, key, kind) => {
4401
4401
  var result = undefined ;
4402
4402
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4403
4403
  if (decorator = decorators[i])
4404
4404
  result = (decorator(target, key, result) ) || result;
4405
- if (result) __defProp$N(target, key, result);
4405
+ if (result) __defProp$O(target, key, result);
4406
4406
  return result;
4407
4407
  };
4408
4408
  class IndexBuffer extends Resource {
@@ -4446,20 +4446,20 @@ class IndexBuffer extends Resource {
4446
4446
  return result;
4447
4447
  }
4448
4448
  }
4449
- __decorateClass$N([
4449
+ __decorateClass$O([
4450
4450
  protectedProperty({ default: null })
4451
4451
  ], IndexBuffer.prototype, "data");
4452
- __decorateClass$N([
4452
+ __decorateClass$O([
4453
4453
  protectedProperty({ default: false })
4454
4454
  ], IndexBuffer.prototype, "dynamic");
4455
4455
 
4456
- var __defProp$M = Object.defineProperty;
4457
- var __decorateClass$M = (decorators, target, key, kind) => {
4456
+ var __defProp$N = Object.defineProperty;
4457
+ var __decorateClass$N = (decorators, target, key, kind) => {
4458
4458
  var result = undefined ;
4459
4459
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4460
4460
  if (decorator = decorators[i])
4461
4461
  result = (decorator(target, key, result) ) || result;
4462
- if (result) __defProp$M(target, key, result);
4462
+ if (result) __defProp$N(target, key, result);
4463
4463
  return result;
4464
4464
  };
4465
4465
  class VertexBuffer extends Resource {
@@ -4503,20 +4503,20 @@ class VertexBuffer extends Resource {
4503
4503
  return result;
4504
4504
  }
4505
4505
  }
4506
- __decorateClass$M([
4506
+ __decorateClass$N([
4507
4507
  protectedProperty({ default: null })
4508
4508
  ], VertexBuffer.prototype, "data");
4509
- __decorateClass$M([
4509
+ __decorateClass$N([
4510
4510
  protectedProperty({ default: false })
4511
4511
  ], VertexBuffer.prototype, "dynamic");
4512
4512
 
4513
- var __defProp$L = Object.defineProperty;
4514
- var __decorateClass$L = (decorators, target, key, kind) => {
4513
+ var __defProp$M = Object.defineProperty;
4514
+ var __decorateClass$M = (decorators, target, key, kind) => {
4515
4515
  var result = undefined ;
4516
4516
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4517
4517
  if (decorator = decorators[i])
4518
4518
  result = (decorator(target, key, result) ) || result;
4519
- if (result) __defProp$L(target, key, result);
4519
+ if (result) __defProp$M(target, key, result);
4520
4520
  return result;
4521
4521
  };
4522
4522
  class VertexAttribute extends Resource {
@@ -4553,25 +4553,25 @@ class VertexAttribute extends Resource {
4553
4553
  return result;
4554
4554
  }
4555
4555
  }
4556
- __decorateClass$L([
4556
+ __decorateClass$M([
4557
4557
  protectedProperty()
4558
4558
  ], VertexAttribute.prototype, "buffer");
4559
- __decorateClass$L([
4559
+ __decorateClass$M([
4560
4560
  protectedProperty({ default: 0 })
4561
4561
  ], VertexAttribute.prototype, "size");
4562
- __decorateClass$L([
4562
+ __decorateClass$M([
4563
4563
  protectedProperty({ default: false })
4564
4564
  ], VertexAttribute.prototype, "normalized");
4565
- __decorateClass$L([
4565
+ __decorateClass$M([
4566
4566
  protectedProperty({ default: "float" })
4567
4567
  ], VertexAttribute.prototype, "type");
4568
- __decorateClass$L([
4568
+ __decorateClass$M([
4569
4569
  protectedProperty()
4570
4570
  ], VertexAttribute.prototype, "stride");
4571
- __decorateClass$L([
4571
+ __decorateClass$M([
4572
4572
  protectedProperty()
4573
4573
  ], VertexAttribute.prototype, "offset");
4574
- __decorateClass$L([
4574
+ __decorateClass$M([
4575
4575
  protectedProperty()
4576
4576
  ], VertexAttribute.prototype, "divisor");
4577
4577
 
@@ -4821,13 +4821,13 @@ class UvGeometry extends Geometry {
4821
4821
  }
4822
4822
  }
4823
4823
 
4824
- var __defProp$K = Object.defineProperty;
4825
- var __decorateClass$K = (decorators, target, key, kind) => {
4824
+ var __defProp$L = Object.defineProperty;
4825
+ var __decorateClass$L = (decorators, target, key, kind) => {
4826
4826
  var result = undefined ;
4827
4827
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4828
4828
  if (decorator = decorators[i])
4829
4829
  result = (decorator(target, key, result) ) || result;
4830
- if (result) __defProp$K(target, key, result);
4830
+ if (result) __defProp$L(target, key, result);
4831
4831
  return result;
4832
4832
  };
4833
4833
  const style2DFilterDefault = {
@@ -5044,58 +5044,58 @@ class CanvasItemStyle extends Resource {
5044
5044
  return m;
5045
5045
  }
5046
5046
  }
5047
- __decorateClass$K([
5047
+ __decorateClass$L([
5048
5048
  property({ default: "none" })
5049
5049
  ], CanvasItemStyle.prototype, "backgroundColor");
5050
- __decorateClass$K([
5050
+ __decorateClass$L([
5051
5051
  property({ default: "none" })
5052
5052
  ], CanvasItemStyle.prototype, "backgroundImage");
5053
- __decorateClass$K([
5053
+ __decorateClass$L([
5054
5054
  property({ default: "none" })
5055
5055
  ], CanvasItemStyle.prototype, "filter");
5056
- __decorateClass$K([
5056
+ __decorateClass$L([
5057
5057
  property({ default: "inherit" })
5058
5058
  ], CanvasItemStyle.prototype, "direction");
5059
- __decorateClass$K([
5059
+ __decorateClass$L([
5060
5060
  property({ default: "none" })
5061
5061
  ], CanvasItemStyle.prototype, "boxShadow");
5062
- __decorateClass$K([
5062
+ __decorateClass$L([
5063
5063
  property({ default: "none" })
5064
5064
  ], CanvasItemStyle.prototype, "maskImage");
5065
- __decorateClass$K([
5065
+ __decorateClass$L([
5066
5066
  property({ default: 1 })
5067
5067
  ], CanvasItemStyle.prototype, "opacity");
5068
- __decorateClass$K([
5068
+ __decorateClass$L([
5069
5069
  property({ default: 0 })
5070
5070
  ], CanvasItemStyle.prototype, "borderWidth");
5071
- __decorateClass$K([
5071
+ __decorateClass$L([
5072
5072
  property({ default: 0 })
5073
5073
  ], CanvasItemStyle.prototype, "borderRadius");
5074
- __decorateClass$K([
5074
+ __decorateClass$L([
5075
5075
  property({ default: "#000000" })
5076
5076
  ], CanvasItemStyle.prototype, "borderColor");
5077
- __decorateClass$K([
5077
+ __decorateClass$L([
5078
5078
  property({ default: "none" })
5079
5079
  ], CanvasItemStyle.prototype, "borderStyle");
5080
- __decorateClass$K([
5080
+ __decorateClass$L([
5081
5081
  property({ default: 0 })
5082
5082
  ], CanvasItemStyle.prototype, "outlineWidth");
5083
- __decorateClass$K([
5083
+ __decorateClass$L([
5084
5084
  property({ default: 0 })
5085
5085
  ], CanvasItemStyle.prototype, "outlineOffset");
5086
- __decorateClass$K([
5086
+ __decorateClass$L([
5087
5087
  property({ default: "#000000" })
5088
5088
  ], CanvasItemStyle.prototype, "outlineColor");
5089
- __decorateClass$K([
5089
+ __decorateClass$L([
5090
5090
  property({ default: "none" })
5091
5091
  ], CanvasItemStyle.prototype, "outlineStyle");
5092
- __decorateClass$K([
5092
+ __decorateClass$L([
5093
5093
  property({ default: "visible" })
5094
5094
  ], CanvasItemStyle.prototype, "visibility");
5095
- __decorateClass$K([
5095
+ __decorateClass$L([
5096
5096
  property({ default: "visible" })
5097
5097
  ], CanvasItemStyle.prototype, "overflow");
5098
- __decorateClass$K([
5098
+ __decorateClass$L([
5099
5099
  property({ default: "auto" })
5100
5100
  ], CanvasItemStyle.prototype, "pointerEvents");
5101
5101
  const transformStyle$1 = getDefaultTransformStyle();
@@ -5107,13 +5107,13 @@ for (const key in textStyle$1) {
5107
5107
  defineProperty(CanvasItemStyle, key, { default: textStyle$1[key] });
5108
5108
  }
5109
5109
 
5110
- var __defProp$J = Object.defineProperty;
5111
- var __decorateClass$J = (decorators, target, key, kind) => {
5110
+ var __defProp$K = Object.defineProperty;
5111
+ var __decorateClass$K = (decorators, target, key, kind) => {
5112
5112
  var result = undefined ;
5113
5113
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5114
5114
  if (decorator = decorators[i])
5115
5115
  result = (decorator(target, key, result) ) || result;
5116
- if (result) __defProp$J(target, key, result);
5116
+ if (result) __defProp$K(target, key, result);
5117
5117
  return result;
5118
5118
  };
5119
5119
  class Texture2D extends Resource {
@@ -5239,32 +5239,58 @@ class Texture2D extends Resource {
5239
5239
  }
5240
5240
  }
5241
5241
  }
5242
- __decorateClass$J([
5242
+ __decorateClass$K([
5243
5243
  protectedProperty()
5244
5244
  ], Texture2D.prototype, "source");
5245
- __decorateClass$J([
5245
+ __decorateClass$K([
5246
5246
  property({ default: 0 })
5247
5247
  ], Texture2D.prototype, "width");
5248
- __decorateClass$J([
5248
+ __decorateClass$K([
5249
5249
  property({ default: 0 })
5250
5250
  ], Texture2D.prototype, "height");
5251
- __decorateClass$J([
5251
+ __decorateClass$K([
5252
5252
  property({ default: "linear" })
5253
5253
  ], Texture2D.prototype, "filterMode");
5254
- __decorateClass$J([
5254
+ __decorateClass$K([
5255
5255
  property({ default: "clamp_to_edge" })
5256
5256
  ], Texture2D.prototype, "wrapMode");
5257
- __decorateClass$J([
5257
+ __decorateClass$K([
5258
5258
  property({ default: 1 })
5259
5259
  ], Texture2D.prototype, "pixelRatio");
5260
5260
 
5261
- var __defProp$I = Object.defineProperty;
5262
- var __decorateClass$I = (decorators, target, key, kind) => {
5261
+ class AnimatedTexture extends Resource {
5262
+ frames;
5263
+ constructor(source) {
5264
+ super();
5265
+ let frames;
5266
+ if (Array.isArray(source)) {
5267
+ frames = source;
5268
+ } else if (source instanceof Texture2D) {
5269
+ frames = [{ texture: source, duration: 0 }];
5270
+ } else {
5271
+ throw new TypeError("Failed new AnimatedTexture");
5272
+ }
5273
+ this.frames = frames;
5274
+ this.updateDuration();
5275
+ }
5276
+ updateDuration() {
5277
+ this.duration = this.frames.reduce((duration, frame) => frame.duration + duration, 0);
5278
+ return this;
5279
+ }
5280
+ destroy() {
5281
+ this.frames.forEach((frame) => {
5282
+ frame.texture.destroy();
5283
+ });
5284
+ }
5285
+ }
5286
+
5287
+ var __defProp$J = Object.defineProperty;
5288
+ var __decorateClass$J = (decorators, target, key, kind) => {
5263
5289
  var result = undefined ;
5264
5290
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5265
5291
  if (decorator = decorators[i])
5266
5292
  result = (decorator(target, key, result) ) || result;
5267
- if (result) __defProp$I(target, key, result);
5293
+ if (result) __defProp$J(target, key, result);
5268
5294
  return result;
5269
5295
  };
5270
5296
  class CanvasTexture extends Texture2D {
@@ -5283,7 +5309,7 @@ class CanvasTexture extends Texture2D {
5283
5309
  super._updateProperty(key, value, oldValue, declaration);
5284
5310
  }
5285
5311
  }
5286
- __decorateClass$I([
5312
+ __decorateClass$J([
5287
5313
  property({ default: 2 })
5288
5314
  ], CanvasTexture.prototype, "pixelRatio");
5289
5315
 
@@ -5441,13 +5467,13 @@ class PixelsTexture extends Texture2D {
5441
5467
  }
5442
5468
  }
5443
5469
 
5444
- var __defProp$H = Object.defineProperty;
5445
- var __decorateClass$H = (decorators, target, key, kind) => {
5470
+ var __defProp$I = Object.defineProperty;
5471
+ var __decorateClass$I = (decorators, target, key, kind) => {
5446
5472
  var result = undefined ;
5447
5473
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5448
5474
  if (decorator = decorators[i])
5449
5475
  result = (decorator(target, key, result) ) || result;
5450
- if (result) __defProp$H(target, key, result);
5476
+ if (result) __defProp$I(target, key, result);
5451
5477
  return result;
5452
5478
  };
5453
5479
  function resolveOptions(options) {
@@ -5691,10 +5717,10 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
5691
5717
  }
5692
5718
  }
5693
5719
  };
5694
- __decorateClass$H([
5720
+ __decorateClass$I([
5695
5721
  protectedProperty({ default: true })
5696
5722
  ], _VideoTexture.prototype, "autoUpdate");
5697
- __decorateClass$H([
5723
+ __decorateClass$I([
5698
5724
  protectedProperty({ default: 0 })
5699
5725
  ], _VideoTexture.prototype, "fps");
5700
5726
  let VideoTexture = _VideoTexture;
@@ -5712,8 +5738,8 @@ class CanvasContext extends Path2D {
5712
5738
  lineWidth;
5713
5739
  miterLimit;
5714
5740
  _defaultStyle = Texture2D.EMPTY;
5715
- _stroke = [];
5716
- _fille = [];
5741
+ _strokes = [];
5742
+ _fills = [];
5717
5743
  stroke() {
5718
5744
  let texture = this._defaultStyle;
5719
5745
  if (this.strokeStyle) {
@@ -5724,7 +5750,7 @@ class CanvasContext extends Path2D {
5724
5750
  }
5725
5751
  }
5726
5752
  if (this.curves.length) {
5727
- this._stroke.push({
5753
+ this._strokes.push({
5728
5754
  path: new Path2D(this),
5729
5755
  texture,
5730
5756
  textureTransform: this.textureTransform,
@@ -5755,7 +5781,7 @@ class CanvasContext extends Path2D {
5755
5781
  texture = new ColorTexture(this.fillStyle);
5756
5782
  }
5757
5783
  }
5758
- this._fille.push({
5784
+ this._fills.push({
5759
5785
  path: new Path2D(this),
5760
5786
  texture,
5761
5787
  textureTransform: this.textureTransform
@@ -5772,8 +5798,8 @@ class CanvasContext extends Path2D {
5772
5798
  this.lineJoin = source.lineJoin;
5773
5799
  this.lineWidth = source.lineWidth;
5774
5800
  this.miterLimit = source.miterLimit;
5775
- this._stroke = source._stroke.slice();
5776
- this._fille = source._fille.slice();
5801
+ this._strokes = source._strokes.slice();
5802
+ this._fills = source._fills.slice();
5777
5803
  return this;
5778
5804
  }
5779
5805
  reset() {
@@ -5785,8 +5811,8 @@ class CanvasContext extends Path2D {
5785
5811
  this.lineJoin = undefined;
5786
5812
  this.lineWidth = undefined;
5787
5813
  this.miterLimit = undefined;
5788
- this._stroke.length = 0;
5789
- this._fille.length = 0;
5814
+ this._strokes.length = 0;
5815
+ this._fills.length = 0;
5790
5816
  return this;
5791
5817
  }
5792
5818
  buildUvs(start, vertices, uvs, texture, textureTransform) {
@@ -5812,6 +5838,7 @@ class CanvasContext extends Path2D {
5812
5838
  let uvs = [];
5813
5839
  let startUv = 0;
5814
5840
  let texture;
5841
+ let verticesLen = vertices.length;
5815
5842
  const push = (type) => {
5816
5843
  batchables.push({
5817
5844
  type,
@@ -5824,12 +5851,13 @@ class CanvasContext extends Path2D {
5824
5851
  indices = [];
5825
5852
  uvs = [];
5826
5853
  texture = undefined;
5854
+ verticesLen = vertices.length;
5827
5855
  };
5828
- let verticesLen = vertices.length;
5829
- for (let len = this._fille.length, i = 0; i < len; i++) {
5830
- const graphics = this._fille[i];
5831
- texture ??= graphics.texture;
5832
- if (texture !== graphics.texture) {
5856
+ for (let len = this._fills.length, i = 0; i < len; i++) {
5857
+ const graphics = this._fills[i];
5858
+ if (!texture) {
5859
+ texture = graphics.texture;
5860
+ } else if (!texture.is(graphics.texture)) {
5833
5861
  push("fill");
5834
5862
  }
5835
5863
  startUv = vertices.length;
@@ -5838,14 +5866,17 @@ class CanvasContext extends Path2D {
5838
5866
  indices
5839
5867
  });
5840
5868
  this.buildUvs(startUv, vertices, uvs, graphics.texture, graphics.textureTransform);
5869
+ if (!texture) {
5870
+ texture = graphics.texture;
5871
+ }
5841
5872
  }
5842
5873
  if (vertices.length - verticesLen > 0) {
5843
5874
  push("fill");
5844
5875
  }
5845
5876
  verticesLen = vertices.length;
5846
- for (let len = this._stroke.length, i = 0; i < len; i++) {
5877
+ for (let len = this._strokes.length, i = 0; i < len; i++) {
5847
5878
  startUv = vertices.length;
5848
- const graphics = this._stroke[i];
5879
+ const graphics = this._strokes[i];
5849
5880
  texture ??= graphics.texture;
5850
5881
  graphics.path.strokeTriangulate({
5851
5882
  vertices,
@@ -5864,14 +5895,14 @@ class CanvasContext extends Path2D {
5864
5895
  }
5865
5896
  }
5866
5897
 
5867
- var __defProp$G = Object.defineProperty;
5898
+ var __defProp$H = Object.defineProperty;
5868
5899
  var __getOwnPropDesc$E = Object.getOwnPropertyDescriptor;
5869
- var __decorateClass$G = (decorators, target, key, kind) => {
5900
+ var __decorateClass$H = (decorators, target, key, kind) => {
5870
5901
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$E(target, key) : target;
5871
5902
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5872
5903
  if (decorator = decorators[i])
5873
5904
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5874
- if (kind && result) __defProp$G(target, key, result);
5905
+ if (kind && result) __defProp$H(target, key, result);
5875
5906
  return result;
5876
5907
  };
5877
5908
  const tagUidMap = {};
@@ -6300,33 +6331,33 @@ let Node = class extends CoreObject {
6300
6331
  return node;
6301
6332
  }
6302
6333
  };
6303
- __decorateClass$G([
6334
+ __decorateClass$H([
6304
6335
  property()
6305
6336
  ], Node.prototype, "name", 2);
6306
- __decorateClass$G([
6337
+ __decorateClass$H([
6307
6338
  property()
6308
6339
  ], Node.prototype, "mask", 2);
6309
- __decorateClass$G([
6340
+ __decorateClass$H([
6310
6341
  property({ default: "inherit" })
6311
6342
  ], Node.prototype, "processMode", 2);
6312
- __decorateClass$G([
6343
+ __decorateClass$H([
6313
6344
  property({ default: "inherit" })
6314
6345
  ], Node.prototype, "renderMode", 2);
6315
- __decorateClass$G([
6346
+ __decorateClass$H([
6316
6347
  property({ default: "default" })
6317
6348
  ], Node.prototype, "internalMode", 2);
6318
- Node = __decorateClass$G([
6349
+ Node = __decorateClass$H([
6319
6350
  customNode("Node")
6320
6351
  ], Node);
6321
6352
 
6322
- var __defProp$F = Object.defineProperty;
6353
+ var __defProp$G = Object.defineProperty;
6323
6354
  var __getOwnPropDesc$D = Object.getOwnPropertyDescriptor;
6324
- var __decorateClass$F = (decorators, target, key, kind) => {
6355
+ var __decorateClass$G = (decorators, target, key, kind) => {
6325
6356
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$D(target, key) : target;
6326
6357
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6327
6358
  if (decorator = decorators[i])
6328
6359
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6329
- if (kind && result) __defProp$F(target, key, result);
6360
+ if (kind && result) __defProp$G(target, key, result);
6330
6361
  return result;
6331
6362
  };
6332
6363
  let TimelineNode = class extends Node {
@@ -6385,27 +6416,27 @@ let TimelineNode = class extends Node {
6385
6416
  super._process(delta);
6386
6417
  }
6387
6418
  };
6388
- __decorateClass$F([
6419
+ __decorateClass$G([
6389
6420
  property({ default: 0 })
6390
6421
  ], TimelineNode.prototype, "delay", 2);
6391
- __decorateClass$F([
6422
+ __decorateClass$G([
6392
6423
  property({ default: 0 })
6393
6424
  ], TimelineNode.prototype, "duration", 2);
6394
- __decorateClass$F([
6425
+ __decorateClass$G([
6395
6426
  property({ default: false })
6396
6427
  ], TimelineNode.prototype, "paused", 2);
6397
- TimelineNode = __decorateClass$F([
6428
+ TimelineNode = __decorateClass$G([
6398
6429
  customNode("TimelineNode")
6399
6430
  ], TimelineNode);
6400
6431
 
6401
- var __defProp$E = Object.defineProperty;
6432
+ var __defProp$F = Object.defineProperty;
6402
6433
  var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor;
6403
- var __decorateClass$E = (decorators, target, key, kind) => {
6434
+ var __decorateClass$F = (decorators, target, key, kind) => {
6404
6435
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$C(target, key) : target;
6405
6436
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6406
6437
  if (decorator = decorators[i])
6407
6438
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6408
- if (kind && result) __defProp$E(target, key, result);
6439
+ if (kind && result) __defProp$F(target, key, result);
6409
6440
  return result;
6410
6441
  };
6411
6442
  let Viewport = class extends Node {
@@ -6543,30 +6574,30 @@ let Viewport = class extends Node {
6543
6574
  return this._projection.toArray(transpose);
6544
6575
  }
6545
6576
  };
6546
- __decorateClass$E([
6577
+ __decorateClass$F([
6547
6578
  property({ default: 0 })
6548
6579
  ], Viewport.prototype, "x", 2);
6549
- __decorateClass$E([
6580
+ __decorateClass$F([
6550
6581
  property({ default: 0 })
6551
6582
  ], Viewport.prototype, "y", 2);
6552
- __decorateClass$E([
6583
+ __decorateClass$F([
6553
6584
  property({ default: 0 })
6554
6585
  ], Viewport.prototype, "width", 2);
6555
- __decorateClass$E([
6586
+ __decorateClass$F([
6556
6587
  property({ default: 0 })
6557
6588
  ], Viewport.prototype, "height", 2);
6558
- Viewport = __decorateClass$E([
6589
+ Viewport = __decorateClass$F([
6559
6590
  customNode("Viewport")
6560
6591
  ], Viewport);
6561
6592
 
6562
- var __defProp$D = Object.defineProperty;
6593
+ var __defProp$E = Object.defineProperty;
6563
6594
  var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor;
6564
- var __decorateClass$D = (decorators, target, key, kind) => {
6595
+ var __decorateClass$E = (decorators, target, key, kind) => {
6565
6596
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$B(target, key) : target;
6566
6597
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6567
6598
  if (decorator = decorators[i])
6568
6599
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6569
- if (kind && result) __defProp$D(target, key, result);
6600
+ if (kind && result) __defProp$E(target, key, result);
6570
6601
  return result;
6571
6602
  };
6572
6603
  let Effect = class extends TimelineNode {
@@ -6622,6 +6653,8 @@ let Effect = class extends TimelineNode {
6622
6653
  this.viewport2.setTree(undefined);
6623
6654
  }
6624
6655
  _onProcessing() {
6656
+ if (!this.canProcess())
6657
+ return;
6625
6658
  this._updateCurrentTime();
6626
6659
  switch (this._effectMode) {
6627
6660
  case "transition":
@@ -6635,6 +6668,8 @@ let Effect = class extends TimelineNode {
6635
6668
  }
6636
6669
  }
6637
6670
  _onNodeProcessed(node) {
6671
+ if (!this.canProcess())
6672
+ return;
6638
6673
  if (!this.isInsideTimeRange())
6639
6674
  return;
6640
6675
  const renderStack = this._tree?.renderStack;
@@ -6803,31 +6838,31 @@ let Effect = class extends TimelineNode {
6803
6838
  }
6804
6839
  }
6805
6840
  };
6806
- __decorateClass$D([
6841
+ __decorateClass$E([
6807
6842
  protectedProperty()
6808
6843
  ], Effect.prototype, "material", 2);
6809
- __decorateClass$D([
6844
+ __decorateClass$E([
6810
6845
  property()
6811
6846
  ], Effect.prototype, "effectMode", 2);
6812
- __decorateClass$D([
6847
+ __decorateClass$E([
6813
6848
  property({ default: "" })
6814
6849
  ], Effect.prototype, "glsl", 2);
6815
- __decorateClass$D([
6850
+ __decorateClass$E([
6816
6851
  property({ default: "" })
6817
6852
  ], Effect.prototype, "glslSrc", 2);
6818
- Effect = __decorateClass$D([
6853
+ Effect = __decorateClass$E([
6819
6854
  customNode("Effect")
6820
6855
  ], Effect);
6821
6856
 
6822
- var __defProp$C = Object.defineProperty;
6857
+ var __defProp$D = Object.defineProperty;
6823
6858
  var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor;
6824
- var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6825
- var __decorateClass$C = (decorators, target, key, kind) => {
6859
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6860
+ var __decorateClass$D = (decorators, target, key, kind) => {
6826
6861
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$A(target, key) : target;
6827
6862
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6828
6863
  if (decorator = decorators[i])
6829
6864
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6830
- if (kind && result) __defProp$C(target, key, result);
6865
+ if (kind && result) __defProp$D(target, key, result);
6831
6866
  return result;
6832
6867
  };
6833
6868
  var __publicField$i = (obj, key, value) => __defNormalProp$i(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -6924,25 +6959,25 @@ __publicField$i(BlurEffect, "materialY", new Material({
6924
6959
  vert: vertY,
6925
6960
  frag
6926
6961
  }));
6927
- __decorateClass$C([
6962
+ __decorateClass$D([
6928
6963
  property({ default: 8 })
6929
6964
  ], BlurEffect.prototype, "strength", 2);
6930
- __decorateClass$C([
6965
+ __decorateClass$D([
6931
6966
  property({ default: 4 })
6932
6967
  ], BlurEffect.prototype, "quality", 2);
6933
- BlurEffect = __decorateClass$C([
6968
+ BlurEffect = __decorateClass$D([
6934
6969
  customNode("BlurEffect")
6935
6970
  ], BlurEffect);
6936
6971
 
6937
- var __defProp$B = Object.defineProperty;
6972
+ var __defProp$C = Object.defineProperty;
6938
6973
  var __getOwnPropDesc$z = Object.getOwnPropertyDescriptor;
6939
- var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6940
- var __decorateClass$B = (decorators, target, key, kind) => {
6974
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6975
+ var __decorateClass$C = (decorators, target, key, kind) => {
6941
6976
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$z(target, key) : target;
6942
6977
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6943
6978
  if (decorator = decorators[i])
6944
6979
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6945
- if (kind && result) __defProp$B(target, key, result);
6980
+ if (kind && result) __defProp$C(target, key, result);
6946
6981
  return result;
6947
6982
  };
6948
6983
  var __publicField$h = (obj, key, value) => __defNormalProp$h(obj, key + "" , value);
@@ -7006,43 +7041,43 @@ void main(void) {
7006
7041
  gl_FragColor = c * alpha;
7007
7042
  }`
7008
7043
  }));
7009
- __decorateClass$B([
7044
+ __decorateClass$C([
7010
7045
  property()
7011
7046
  ], ColorAdjustEffect.prototype, "saturation", 2);
7012
- __decorateClass$B([
7047
+ __decorateClass$C([
7013
7048
  property()
7014
7049
  ], ColorAdjustEffect.prototype, "contrast", 2);
7015
- __decorateClass$B([
7050
+ __decorateClass$C([
7016
7051
  property()
7017
7052
  ], ColorAdjustEffect.prototype, "brightness", 2);
7018
- __decorateClass$B([
7053
+ __decorateClass$C([
7019
7054
  property()
7020
7055
  ], ColorAdjustEffect.prototype, "red", 2);
7021
- __decorateClass$B([
7056
+ __decorateClass$C([
7022
7057
  property()
7023
7058
  ], ColorAdjustEffect.prototype, "green", 2);
7024
- __decorateClass$B([
7059
+ __decorateClass$C([
7025
7060
  property()
7026
7061
  ], ColorAdjustEffect.prototype, "blue", 2);
7027
- __decorateClass$B([
7062
+ __decorateClass$C([
7028
7063
  property()
7029
7064
  ], ColorAdjustEffect.prototype, "alpha", 2);
7030
- __decorateClass$B([
7065
+ __decorateClass$C([
7031
7066
  property()
7032
7067
  ], ColorAdjustEffect.prototype, "gamma", 2);
7033
- ColorAdjustEffect = __decorateClass$B([
7068
+ ColorAdjustEffect = __decorateClass$C([
7034
7069
  customNode("ColorAdjustEffect")
7035
7070
  ], ColorAdjustEffect);
7036
7071
 
7037
- var __defProp$A = Object.defineProperty;
7072
+ var __defProp$B = Object.defineProperty;
7038
7073
  var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor;
7039
- var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7040
- var __decorateClass$A = (decorators, target, key, kind) => {
7074
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7075
+ var __decorateClass$B = (decorators, target, key, kind) => {
7041
7076
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$y(target, key) : target;
7042
7077
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7043
7078
  if (decorator = decorators[i])
7044
7079
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7045
- if (kind && result) __defProp$A(target, key, result);
7080
+ if (kind && result) __defProp$B(target, key, result);
7046
7081
  return result;
7047
7082
  };
7048
7083
  var __publicField$g = (obj, key, value) => __defNormalProp$g(obj, key + "" , value);
@@ -7122,22 +7157,22 @@ void main(void) {
7122
7157
  );
7123
7158
  }`
7124
7159
  }));
7125
- __decorateClass$A([
7160
+ __decorateClass$B([
7126
7161
  property({ default: "" })
7127
7162
  ], ColorFilterEffect.prototype, "filter", 2);
7128
- ColorFilterEffect = __decorateClass$A([
7163
+ ColorFilterEffect = __decorateClass$B([
7129
7164
  customNode("ColorFilterEffect")
7130
7165
  ], ColorFilterEffect);
7131
7166
 
7132
- var __defProp$z = Object.defineProperty;
7167
+ var __defProp$A = Object.defineProperty;
7133
7168
  var __getOwnPropDesc$x = Object.getOwnPropertyDescriptor;
7134
- var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7135
- var __decorateClass$z = (decorators, target, key, kind) => {
7169
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7170
+ var __decorateClass$A = (decorators, target, key, kind) => {
7136
7171
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$x(target, key) : target;
7137
7172
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7138
7173
  if (decorator = decorators[i])
7139
7174
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7140
- if (kind && result) __defProp$z(target, key, result);
7175
+ if (kind && result) __defProp$A(target, key, result);
7141
7176
  return result;
7142
7177
  };
7143
7178
  var __publicField$f = (obj, key, value) => __defNormalProp$f(obj, key + "" , value);
@@ -7211,25 +7246,25 @@ void main(void) {
7211
7246
  gl_FragColor = vec4(mix(color.rgb, mask.rgb, color.a * mask.a), color.a);
7212
7247
  }`
7213
7248
  }));
7214
- __decorateClass$z([
7249
+ __decorateClass$A([
7215
7250
  property()
7216
7251
  ], ColorOverlayEffect.prototype, "colors", 2);
7217
- __decorateClass$z([
7252
+ __decorateClass$A([
7218
7253
  property()
7219
7254
  ], ColorOverlayEffect.prototype, "alpha", 2);
7220
- ColorOverlayEffect = __decorateClass$z([
7255
+ ColorOverlayEffect = __decorateClass$A([
7221
7256
  customNode("ColorOverlayEffect")
7222
7257
  ], ColorOverlayEffect);
7223
7258
 
7224
- var __defProp$y = Object.defineProperty;
7259
+ var __defProp$z = Object.defineProperty;
7225
7260
  var __getOwnPropDesc$w = Object.getOwnPropertyDescriptor;
7226
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7227
- var __decorateClass$y = (decorators, target, key, kind) => {
7261
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7262
+ var __decorateClass$z = (decorators, target, key, kind) => {
7228
7263
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$w(target, key) : target;
7229
7264
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7230
7265
  if (decorator = decorators[i])
7231
7266
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7232
- if (kind && result) __defProp$y(target, key, result);
7267
+ if (kind && result) __defProp$z(target, key, result);
7233
7268
  return result;
7234
7269
  };
7235
7270
  var __publicField$e = (obj, key, value) => __defNormalProp$e(obj, key + "" , value);
@@ -7294,25 +7329,25 @@ void main(void) {
7294
7329
  gl_FragColor = color;
7295
7330
  }`
7296
7331
  }));
7297
- __decorateClass$y([
7332
+ __decorateClass$z([
7298
7333
  property()
7299
7334
  ], ColorRemoveEffect.prototype, "colors", 2);
7300
- __decorateClass$y([
7335
+ __decorateClass$z([
7301
7336
  property()
7302
7337
  ], ColorRemoveEffect.prototype, "epsilon", 2);
7303
- ColorRemoveEffect = __decorateClass$y([
7338
+ ColorRemoveEffect = __decorateClass$z([
7304
7339
  customNode("ColorRemoveEffect")
7305
7340
  ], ColorRemoveEffect);
7306
7341
 
7307
- var __defProp$x = Object.defineProperty;
7342
+ var __defProp$y = Object.defineProperty;
7308
7343
  var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
7309
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7310
- var __decorateClass$x = (decorators, target, key, kind) => {
7344
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7345
+ var __decorateClass$y = (decorators, target, key, kind) => {
7311
7346
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$v(target, key) : target;
7312
7347
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7313
7348
  if (decorator = decorators[i])
7314
7349
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7315
- if (kind && result) __defProp$x(target, key, result);
7350
+ if (kind && result) __defProp$y(target, key, result);
7316
7351
  return result;
7317
7352
  };
7318
7353
  var __publicField$d = (obj, key, value) => __defNormalProp$d(obj, key + "" , value);
@@ -7399,25 +7434,25 @@ void main(void) {
7399
7434
  }
7400
7435
  }`
7401
7436
  }));
7402
- __decorateClass$x([
7437
+ __decorateClass$y([
7403
7438
  property()
7404
7439
  ], ColorReplaceEffect.prototype, "colors", 2);
7405
- __decorateClass$x([
7440
+ __decorateClass$y([
7406
7441
  property()
7407
7442
  ], ColorReplaceEffect.prototype, "epsilon", 2);
7408
- ColorReplaceEffect = __decorateClass$x([
7443
+ ColorReplaceEffect = __decorateClass$y([
7409
7444
  customNode("ColorReplaceEffect")
7410
7445
  ], ColorReplaceEffect);
7411
7446
 
7412
- var __defProp$w = Object.defineProperty;
7447
+ var __defProp$x = Object.defineProperty;
7413
7448
  var __getOwnPropDesc$u = Object.getOwnPropertyDescriptor;
7414
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7415
- var __decorateClass$w = (decorators, target, key, kind) => {
7449
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7450
+ var __decorateClass$x = (decorators, target, key, kind) => {
7416
7451
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$u(target, key) : target;
7417
7452
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7418
7453
  if (decorator = decorators[i])
7419
7454
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7420
- if (kind && result) __defProp$w(target, key, result);
7455
+ if (kind && result) __defProp$x(target, key, result);
7421
7456
  return result;
7422
7457
  };
7423
7458
  var __publicField$c = (obj, key, value) => __defNormalProp$c(obj, key + "" , value);
@@ -7463,22 +7498,22 @@ void main(void) {
7463
7498
  gl_FragColor = vec4(color.rgb * alpha, alpha);
7464
7499
  }`
7465
7500
  }));
7466
- __decorateClass$w([
7501
+ __decorateClass$x([
7467
7502
  property()
7468
7503
  ], EmbossEffect.prototype, "strength", 2);
7469
- EmbossEffect = __decorateClass$w([
7504
+ EmbossEffect = __decorateClass$x([
7470
7505
  customNode("EmbossEffect")
7471
7506
  ], EmbossEffect);
7472
7507
 
7473
- var __defProp$v = Object.defineProperty;
7508
+ var __defProp$w = Object.defineProperty;
7474
7509
  var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor;
7475
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7476
- var __decorateClass$v = (decorators, target, key, kind) => {
7510
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7511
+ var __decorateClass$w = (decorators, target, key, kind) => {
7477
7512
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$t(target, key) : target;
7478
7513
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7479
7514
  if (decorator = decorators[i])
7480
7515
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7481
- if (kind && result) __defProp$v(target, key, result);
7516
+ if (kind && result) __defProp$w(target, key, result);
7482
7517
  return result;
7483
7518
  };
7484
7519
  var __publicField$b = (obj, key, value) => __defNormalProp$b(obj, key + "" , value);
@@ -7660,46 +7695,46 @@ void main(void) {
7660
7695
  gl_FragColor.a = texture2D(sampler, coord).a;
7661
7696
  }`
7662
7697
  }));
7663
- __decorateClass$v([
7698
+ __decorateClass$w([
7664
7699
  property()
7665
7700
  ], GlitchEffect.prototype, "slices", 2);
7666
- __decorateClass$v([
7701
+ __decorateClass$w([
7667
7702
  property()
7668
7703
  ], GlitchEffect.prototype, "sampleSize", 2);
7669
- __decorateClass$v([
7704
+ __decorateClass$w([
7670
7705
  property()
7671
7706
  ], GlitchEffect.prototype, "offset", 2);
7672
- __decorateClass$v([
7707
+ __decorateClass$w([
7673
7708
  property()
7674
7709
  ], GlitchEffect.prototype, "direction", 2);
7675
- __decorateClass$v([
7710
+ __decorateClass$w([
7676
7711
  property()
7677
7712
  ], GlitchEffect.prototype, "fillMode", 2);
7678
- __decorateClass$v([
7713
+ __decorateClass$w([
7679
7714
  property()
7680
7715
  ], GlitchEffect.prototype, "seed", 2);
7681
- __decorateClass$v([
7716
+ __decorateClass$w([
7682
7717
  property()
7683
7718
  ], GlitchEffect.prototype, "red", 2);
7684
- __decorateClass$v([
7719
+ __decorateClass$w([
7685
7720
  property()
7686
7721
  ], GlitchEffect.prototype, "green", 2);
7687
- __decorateClass$v([
7722
+ __decorateClass$w([
7688
7723
  property()
7689
7724
  ], GlitchEffect.prototype, "blue", 2);
7690
- GlitchEffect = __decorateClass$v([
7725
+ GlitchEffect = __decorateClass$w([
7691
7726
  customNode("GlitchEffect")
7692
7727
  ], GlitchEffect);
7693
7728
 
7694
- var __defProp$u = Object.defineProperty;
7729
+ var __defProp$v = Object.defineProperty;
7695
7730
  var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor;
7696
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7697
- var __decorateClass$u = (decorators, target, key, kind) => {
7731
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7732
+ var __decorateClass$v = (decorators, target, key, kind) => {
7698
7733
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$s(target, key) : target;
7699
7734
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7700
7735
  if (decorator = decorators[i])
7701
7736
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7702
- if (kind && result) __defProp$u(target, key, result);
7737
+ if (kind && result) __defProp$v(target, key, result);
7703
7738
  return result;
7704
7739
  };
7705
7740
  var __publicField$a = (obj, key, value) => __defNormalProp$a(obj, key + "" , value);
@@ -7861,37 +7896,37 @@ void main(void) {
7861
7896
  gl_FragColor = vec4(color.rgb + mist.rgb, color.a);
7862
7897
  }`
7863
7898
  }));
7864
- __decorateClass$u([
7899
+ __decorateClass$v([
7865
7900
  property()
7866
7901
  ], GodrayEffect.prototype, "angle", 2);
7867
- __decorateClass$u([
7902
+ __decorateClass$v([
7868
7903
  property()
7869
7904
  ], GodrayEffect.prototype, "gain", 2);
7870
- __decorateClass$u([
7905
+ __decorateClass$v([
7871
7906
  property()
7872
7907
  ], GodrayEffect.prototype, "lacunarity", 2);
7873
- __decorateClass$u([
7908
+ __decorateClass$v([
7874
7909
  property()
7875
7910
  ], GodrayEffect.prototype, "parallel", 2);
7876
- __decorateClass$u([
7911
+ __decorateClass$v([
7877
7912
  property()
7878
7913
  ], GodrayEffect.prototype, "center", 2);
7879
- __decorateClass$u([
7914
+ __decorateClass$v([
7880
7915
  property()
7881
7916
  ], GodrayEffect.prototype, "alpha", 2);
7882
- GodrayEffect = __decorateClass$u([
7917
+ GodrayEffect = __decorateClass$v([
7883
7918
  customNode("GodrayEffect")
7884
7919
  ], GodrayEffect);
7885
7920
 
7886
- var __defProp$t = Object.defineProperty;
7921
+ var __defProp$u = Object.defineProperty;
7887
7922
  var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
7888
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7889
- var __decorateClass$t = (decorators, target, key, kind) => {
7923
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7924
+ var __decorateClass$u = (decorators, target, key, kind) => {
7890
7925
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$r(target, key) : target;
7891
7926
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7892
7927
  if (decorator = decorators[i])
7893
7928
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7894
- if (kind && result) __defProp$t(target, key, result);
7929
+ if (kind && result) __defProp$u(target, key, result);
7895
7930
  return result;
7896
7931
  };
7897
7932
  var __publicField$9 = (obj, key, value) => __defNormalProp$9(obj, key + "" , value);
@@ -7965,25 +8000,25 @@ void main(void) {
7965
8000
  }
7966
8001
  }`
7967
8002
  }));
7968
- __decorateClass$t([
8003
+ __decorateClass$u([
7969
8004
  protectedProperty()
7970
8005
  ], MaskEffect.prototype, "texture", 2);
7971
- __decorateClass$t([
8006
+ __decorateClass$u([
7972
8007
  property({ default: "" })
7973
8008
  ], MaskEffect.prototype, "src", 2);
7974
- MaskEffect = __decorateClass$t([
8009
+ MaskEffect = __decorateClass$u([
7975
8010
  customNode("MaskEffect")
7976
8011
  ], MaskEffect);
7977
8012
 
7978
- var __defProp$s = Object.defineProperty;
8013
+ var __defProp$t = Object.defineProperty;
7979
8014
  var __getOwnPropDesc$q = Object.getOwnPropertyDescriptor;
7980
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7981
- var __decorateClass$s = (decorators, target, key, kind) => {
8015
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8016
+ var __decorateClass$t = (decorators, target, key, kind) => {
7982
8017
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$q(target, key) : target;
7983
8018
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7984
8019
  if (decorator = decorators[i])
7985
8020
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7986
- if (kind && result) __defProp$s(target, key, result);
8021
+ if (kind && result) __defProp$t(target, key, result);
7987
8022
  return result;
7988
8023
  };
7989
8024
  var __publicField$8 = (obj, key, value) => __defNormalProp$8(obj, key + "" , value);
@@ -8040,22 +8075,22 @@ void main(void) {
8040
8075
  gl_FragColor = texture2D(sampler, coord);
8041
8076
  }`
8042
8077
  }));
8043
- __decorateClass$s([
8078
+ __decorateClass$t([
8044
8079
  property()
8045
8080
  ], PixelateEffect.prototype, "size", 2);
8046
- PixelateEffect = __decorateClass$s([
8081
+ PixelateEffect = __decorateClass$t([
8047
8082
  customNode("PixelateEffect")
8048
8083
  ], PixelateEffect);
8049
8084
 
8050
- var __defProp$r = Object.defineProperty;
8085
+ var __defProp$s = Object.defineProperty;
8051
8086
  var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
8052
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8053
- var __decorateClass$r = (decorators, target, key, kind) => {
8087
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8088
+ var __decorateClass$s = (decorators, target, key, kind) => {
8054
8089
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$p(target, key) : target;
8055
8090
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8056
8091
  if (decorator = decorators[i])
8057
8092
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8058
- if (kind && result) __defProp$r(target, key, result);
8093
+ if (kind && result) __defProp$s(target, key, result);
8059
8094
  return result;
8060
8095
  };
8061
8096
  var __publicField$7 = (obj, key, value) => __defNormalProp$7(obj, key + "" , value);
@@ -8108,19 +8143,19 @@ void main(void) {
8108
8143
  gl_FragColor = sample;
8109
8144
  }`
8110
8145
  }));
8111
- ShadowEffect = __decorateClass$r([
8146
+ ShadowEffect = __decorateClass$s([
8112
8147
  customNode("ShadowEffect")
8113
8148
  ], ShadowEffect);
8114
8149
 
8115
- var __defProp$q = Object.defineProperty;
8150
+ var __defProp$r = Object.defineProperty;
8116
8151
  var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
8117
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8118
- var __decorateClass$q = (decorators, target, key, kind) => {
8152
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8153
+ var __decorateClass$r = (decorators, target, key, kind) => {
8119
8154
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$o(target, key) : target;
8120
8155
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8121
8156
  if (decorator = decorators[i])
8122
8157
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8123
- if (kind && result) __defProp$q(target, key, result);
8158
+ if (kind && result) __defProp$r(target, key, result);
8124
8159
  return result;
8125
8160
  };
8126
8161
  var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, key + "" , value);
@@ -8226,30 +8261,30 @@ void main() {
8226
8261
  gl_FragColor = color;
8227
8262
  }`
8228
8263
  }));
8229
- __decorateClass$q([
8264
+ __decorateClass$r([
8230
8265
  property()
8231
8266
  ], ZoomBlurEffect.prototype, "center", 2);
8232
- __decorateClass$q([
8267
+ __decorateClass$r([
8233
8268
  property()
8234
8269
  ], ZoomBlurEffect.prototype, "innerRadius", 2);
8235
- __decorateClass$q([
8270
+ __decorateClass$r([
8236
8271
  property()
8237
8272
  ], ZoomBlurEffect.prototype, "radius", 2);
8238
- __decorateClass$q([
8273
+ __decorateClass$r([
8239
8274
  property()
8240
8275
  ], ZoomBlurEffect.prototype, "strength", 2);
8241
- ZoomBlurEffect = __decorateClass$q([
8276
+ ZoomBlurEffect = __decorateClass$r([
8242
8277
  customNode("ZoomBlurEffect")
8243
8278
  ], ZoomBlurEffect);
8244
8279
 
8245
- var __defProp$p = Object.defineProperty;
8280
+ var __defProp$q = Object.defineProperty;
8246
8281
  var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
8247
- var __decorateClass$p = (decorators, target, key, kind) => {
8282
+ var __decorateClass$q = (decorators, target, key, kind) => {
8248
8283
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$n(target, key) : target;
8249
8284
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8250
8285
  if (decorator = decorators[i])
8251
8286
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8252
- if (kind && result) __defProp$p(target, key, result);
8287
+ if (kind && result) __defProp$q(target, key, result);
8253
8288
  return result;
8254
8289
  };
8255
8290
  let CanvasItem = class extends TimelineNode {
@@ -8337,31 +8372,31 @@ let CanvasItem = class extends TimelineNode {
8337
8372
  }
8338
8373
  }
8339
8374
  _updateBoxShadow() {
8340
- const nodePath = "__$style.shadow";
8375
+ const name = "__$style.shadow";
8341
8376
  if (this.style.boxShadow !== "none") {
8342
- const node = this.getNode(nodePath);
8377
+ const node = this.getNode(name);
8343
8378
  if (node) ; else {
8344
- this.appendChild(new ShadowEffect(), "back");
8379
+ this.appendChild(new ShadowEffect({ name }), "back");
8345
8380
  }
8346
8381
  } else {
8347
- const node = this.getNode(nodePath);
8382
+ const node = this.getNode(name);
8348
8383
  if (node) {
8349
8384
  this.removeChild(node);
8350
8385
  }
8351
8386
  }
8352
8387
  }
8353
8388
  _updateMaskImage() {
8354
- const nodePath = "__$style.maskImage";
8389
+ const name = "__$style.maskImage";
8355
8390
  const maskImage = this.style.maskImage;
8356
8391
  if (maskImage && maskImage !== "none") {
8357
- const node = this.getNode(nodePath);
8392
+ const node = this.getNode(name);
8358
8393
  if (node) {
8359
8394
  node.src = maskImage;
8360
8395
  } else {
8361
- this.appendChild(new MaskEffect({ src: maskImage }), "back");
8396
+ this.appendChild(new MaskEffect({ name, src: maskImage }), "back");
8362
8397
  }
8363
8398
  } else {
8364
- const node = this.getNode(nodePath);
8399
+ const node = this.getNode(name);
8365
8400
  if (node) {
8366
8401
  this.removeChild(node);
8367
8402
  }
@@ -8544,13 +8579,13 @@ let CanvasItem = class extends TimelineNode {
8544
8579
  };
8545
8580
  }
8546
8581
  };
8547
- __decorateClass$p([
8582
+ __decorateClass$q([
8548
8583
  property()
8549
8584
  ], CanvasItem.prototype, "modulate", 2);
8550
- __decorateClass$p([
8585
+ __decorateClass$q([
8551
8586
  property()
8552
8587
  ], CanvasItem.prototype, "blendMode", 2);
8553
- CanvasItem = __decorateClass$p([
8588
+ CanvasItem = __decorateClass$q([
8554
8589
  customNode("CanvasItem")
8555
8590
  ], CanvasItem);
8556
8591
 
@@ -8580,14 +8615,14 @@ class RenderStack {
8580
8615
  }
8581
8616
  }
8582
8617
 
8583
- var __defProp$o = Object.defineProperty;
8618
+ var __defProp$p = Object.defineProperty;
8584
8619
  var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
8585
- var __decorateClass$o = (decorators, target, key, kind) => {
8620
+ var __decorateClass$p = (decorators, target, key, kind) => {
8586
8621
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$m(target, key) : target;
8587
8622
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8588
8623
  if (decorator = decorators[i])
8589
8624
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8590
- if (kind && result) __defProp$o(target, key, result);
8625
+ if (kind && result) __defProp$p(target, key, result);
8591
8626
  return result;
8592
8627
  };
8593
8628
  let Timeline = class extends Node {
@@ -8632,29 +8667,29 @@ let Timeline = class extends Node {
8632
8667
  this.addTime(delta);
8633
8668
  }
8634
8669
  };
8635
- __decorateClass$o([
8670
+ __decorateClass$p([
8636
8671
  property({ default: 0 })
8637
8672
  ], Timeline.prototype, "startTime", 2);
8638
- __decorateClass$o([
8673
+ __decorateClass$p([
8639
8674
  property({ default: 0 })
8640
8675
  ], Timeline.prototype, "currentTime", 2);
8641
- __decorateClass$o([
8676
+ __decorateClass$p([
8642
8677
  property({ default: Number.MAX_SAFE_INTEGER })
8643
8678
  ], Timeline.prototype, "endTime", 2);
8644
- __decorateClass$o([
8679
+ __decorateClass$p([
8645
8680
  property({ default: false })
8646
8681
  ], Timeline.prototype, "loop", 2);
8647
- Timeline = __decorateClass$o([
8682
+ Timeline = __decorateClass$p([
8648
8683
  customNode("Timeline")
8649
8684
  ], Timeline);
8650
8685
 
8651
- var __defProp$n = Object.defineProperty;
8652
- var __decorateClass$n = (decorators, target, key, kind) => {
8686
+ var __defProp$o = Object.defineProperty;
8687
+ var __decorateClass$o = (decorators, target, key, kind) => {
8653
8688
  var result = undefined ;
8654
8689
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8655
8690
  if (decorator = decorators[i])
8656
8691
  result = (decorator(target, key, result) ) || result;
8657
- if (result) __defProp$n(target, key, result);
8692
+ if (result) __defProp$o(target, key, result);
8658
8693
  return result;
8659
8694
  };
8660
8695
  class SceneTree extends MainLoop {
@@ -8715,21 +8750,21 @@ class SceneTree extends MainLoop {
8715
8750
  renderer.texture.unbind(texture);
8716
8751
  }
8717
8752
  }
8718
- __decorateClass$n([
8753
+ __decorateClass$o([
8719
8754
  property({ default: false })
8720
8755
  ], SceneTree.prototype, "paused");
8721
- __decorateClass$n([
8756
+ __decorateClass$o([
8722
8757
  property()
8723
8758
  ], SceneTree.prototype, "backgroundColor");
8724
8759
 
8725
- var __defProp$m = Object.defineProperty;
8760
+ var __defProp$n = Object.defineProperty;
8726
8761
  var __getOwnPropDesc$l = Object.getOwnPropertyDescriptor;
8727
- var __decorateClass$m = (decorators, target, key, kind) => {
8762
+ var __decorateClass$n = (decorators, target, key, kind) => {
8728
8763
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$l(target, key) : target;
8729
8764
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8730
8765
  if (decorator = decorators[i])
8731
8766
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8732
- if (kind && result) __defProp$m(target, key, result);
8767
+ if (kind && result) __defProp$n(target, key, result);
8733
8768
  return result;
8734
8769
  };
8735
8770
  let Transition = class extends Effect {
@@ -8738,7 +8773,7 @@ let Transition = class extends Effect {
8738
8773
  this.setProperties(properties).append(children);
8739
8774
  }
8740
8775
  };
8741
- Transition = __decorateClass$m([
8776
+ Transition = __decorateClass$n([
8742
8777
  customNode("Transition", {
8743
8778
  effectMode: "transition",
8744
8779
  processMode: "pausable",
@@ -8746,14 +8781,14 @@ Transition = __decorateClass$m([
8746
8781
  })
8747
8782
  ], Transition);
8748
8783
 
8749
- var __defProp$l = Object.defineProperty;
8784
+ var __defProp$m = Object.defineProperty;
8750
8785
  var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
8751
- var __decorateClass$l = (decorators, target, key, kind) => {
8786
+ var __decorateClass$m = (decorators, target, key, kind) => {
8752
8787
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$k(target, key) : target;
8753
8788
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8754
8789
  if (decorator = decorators[i])
8755
8790
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8756
- if (kind && result) __defProp$l(target, key, result);
8791
+ if (kind && result) __defProp$m(target, key, result);
8757
8792
  return result;
8758
8793
  };
8759
8794
  let Node2D = class extends CanvasItem {
@@ -8763,8 +8798,8 @@ let Node2D = class extends CanvasItem {
8763
8798
  super();
8764
8799
  this.setProperties(properties).append(children);
8765
8800
  }
8766
- _updateStyleProperty(key, value, oldValue) {
8767
- super._updateStyleProperty(key, value, oldValue);
8801
+ _updateStyleProperty(key, value, oldValue, declaration) {
8802
+ super._updateStyleProperty(key, value, oldValue, declaration);
8768
8803
  switch (key) {
8769
8804
  case "width":
8770
8805
  case "height":
@@ -8894,18 +8929,18 @@ let Node2D = class extends CanvasItem {
8894
8929
  );
8895
8930
  }
8896
8931
  };
8897
- Node2D = __decorateClass$l([
8932
+ Node2D = __decorateClass$m([
8898
8933
  customNode("Node2D")
8899
8934
  ], Node2D);
8900
8935
 
8901
- var __defProp$k = Object.defineProperty;
8936
+ var __defProp$l = Object.defineProperty;
8902
8937
  var __getOwnPropDesc$j = Object.getOwnPropertyDescriptor;
8903
- var __decorateClass$k = (decorators, target, key, kind) => {
8938
+ var __decorateClass$l = (decorators, target, key, kind) => {
8904
8939
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$j(target, key) : target;
8905
8940
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8906
8941
  if (decorator = decorators[i])
8907
8942
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8908
- if (kind && result) __defProp$k(target, key, result);
8943
+ if (kind && result) __defProp$l(target, key, result);
8909
8944
  return result;
8910
8945
  };
8911
8946
  function proxy(options) {
@@ -8950,98 +8985,72 @@ let Graphics2D = class extends Node2D {
8950
8985
  return this;
8951
8986
  }
8952
8987
  };
8953
- __decorateClass$k([
8988
+ __decorateClass$l([
8954
8989
  proxy()
8955
8990
  ], Graphics2D.prototype, "lineCap", 2);
8956
- __decorateClass$k([
8991
+ __decorateClass$l([
8957
8992
  proxy()
8958
8993
  ], Graphics2D.prototype, "lineJoin", 2);
8959
- __decorateClass$k([
8994
+ __decorateClass$l([
8960
8995
  proxy()
8961
8996
  ], Graphics2D.prototype, "fillStyle", 2);
8962
- __decorateClass$k([
8997
+ __decorateClass$l([
8963
8998
  proxy()
8964
8999
  ], Graphics2D.prototype, "strokeStyle", 2);
8965
- __decorateClass$k([
9000
+ __decorateClass$l([
8966
9001
  proxy()
8967
9002
  ], Graphics2D.prototype, "lineWidth", 2);
8968
- __decorateClass$k([
9003
+ __decorateClass$l([
8969
9004
  proxy()
8970
9005
  ], Graphics2D.prototype, "miterLimit", 2);
8971
- __decorateClass$k([
9006
+ __decorateClass$l([
8972
9007
  proxy({ method: true })
8973
9008
  ], Graphics2D.prototype, "rect", 2);
8974
- __decorateClass$k([
9009
+ __decorateClass$l([
8975
9010
  proxy({ method: true, redraw: true })
8976
9011
  ], Graphics2D.prototype, "fillRect", 2);
8977
- __decorateClass$k([
9012
+ __decorateClass$l([
8978
9013
  proxy({ method: true, redraw: true })
8979
9014
  ], Graphics2D.prototype, "strokeRect", 2);
8980
- __decorateClass$k([
9015
+ __decorateClass$l([
8981
9016
  proxy({ method: true })
8982
9017
  ], Graphics2D.prototype, "roundRect", 2);
8983
- __decorateClass$k([
9018
+ __decorateClass$l([
8984
9019
  proxy({ method: true })
8985
9020
  ], Graphics2D.prototype, "ellipse", 2);
8986
- __decorateClass$k([
9021
+ __decorateClass$l([
8987
9022
  proxy({ method: true })
8988
9023
  ], Graphics2D.prototype, "arc", 2);
8989
- __decorateClass$k([
9024
+ __decorateClass$l([
8990
9025
  proxy({ method: true })
8991
9026
  ], Graphics2D.prototype, "beginPath", 2);
8992
- __decorateClass$k([
9027
+ __decorateClass$l([
8993
9028
  proxy({ method: true })
8994
9029
  ], Graphics2D.prototype, "moveTo", 2);
8995
- __decorateClass$k([
9030
+ __decorateClass$l([
8996
9031
  proxy({ method: true })
8997
9032
  ], Graphics2D.prototype, "lineTo", 2);
8998
- __decorateClass$k([
9033
+ __decorateClass$l([
8999
9034
  proxy({ method: true })
9000
9035
  ], Graphics2D.prototype, "closePath", 2);
9001
- __decorateClass$k([
9036
+ __decorateClass$l([
9002
9037
  proxy({ method: true, redraw: true })
9003
9038
  ], Graphics2D.prototype, "fill", 2);
9004
- __decorateClass$k([
9039
+ __decorateClass$l([
9005
9040
  proxy({ method: true, redraw: true })
9006
9041
  ], Graphics2D.prototype, "stroke", 2);
9007
- Graphics2D = __decorateClass$k([
9042
+ Graphics2D = __decorateClass$l([
9008
9043
  customNode("Graphics2D")
9009
9044
  ], Graphics2D);
9010
9045
 
9011
- class Image2DResource extends Resource {
9012
- frames;
9013
- constructor(source) {
9014
- super();
9015
- let frames;
9016
- if (Array.isArray(source)) {
9017
- frames = source;
9018
- } else if (source instanceof Texture2D) {
9019
- frames = [{ texture: source, duration: 0 }];
9020
- } else {
9021
- throw new TypeError("Failed new Image2DResource");
9022
- }
9023
- this.frames = frames;
9024
- this.updateDuration();
9025
- }
9026
- updateDuration() {
9027
- this.duration = this.frames.reduce((duration, frame) => frame.duration + duration, 0);
9028
- return this;
9029
- }
9030
- destroy() {
9031
- this.frames.forEach((frame) => {
9032
- frame.texture.destroy();
9033
- });
9034
- }
9035
- }
9036
-
9037
- var __defProp$j = Object.defineProperty;
9046
+ var __defProp$k = Object.defineProperty;
9038
9047
  var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
9039
- var __decorateClass$j = (decorators, target, key, kind) => {
9048
+ var __decorateClass$k = (decorators, target, key, kind) => {
9040
9049
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$i(target, key) : target;
9041
9050
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9042
9051
  if (decorator = decorators[i])
9043
9052
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9044
- if (kind && result) __defProp$j(target, key, result);
9053
+ if (kind && result) __defProp$k(target, key, result);
9045
9054
  return result;
9046
9055
  };
9047
9056
  let Image2D = class extends Node2D {
@@ -9083,10 +9092,10 @@ let Image2D = class extends Node2D {
9083
9092
  }
9084
9093
  setResource(source) {
9085
9094
  let resource;
9086
- if (source instanceof Image2DResource) {
9095
+ if (source instanceof AnimatedTexture) {
9087
9096
  resource = source;
9088
9097
  } else {
9089
- resource = new Image2DResource(source);
9098
+ resource = new AnimatedTexture(source);
9090
9099
  }
9091
9100
  this.resource = resource.updateDuration();
9092
9101
  if (this.currentTexture && (!this.style.width || !this.style.height)) {
@@ -9161,16 +9170,16 @@ let Image2D = class extends Node2D {
9161
9170
  }
9162
9171
  }
9163
9172
  };
9164
- __decorateClass$j([
9173
+ __decorateClass$k([
9165
9174
  protectedProperty()
9166
9175
  ], Image2D.prototype, "resource", 2);
9167
- __decorateClass$j([
9176
+ __decorateClass$k([
9168
9177
  property({ default: false })
9169
9178
  ], Image2D.prototype, "gif", 2);
9170
- __decorateClass$j([
9179
+ __decorateClass$k([
9171
9180
  property({ default: "" })
9172
9181
  ], Image2D.prototype, "src", 2);
9173
- Image2D = __decorateClass$j([
9182
+ Image2D = __decorateClass$k([
9174
9183
  customNode("Image2D")
9175
9184
  ], Image2D);
9176
9185
 
@@ -9188,14 +9197,14 @@ class TextureRect2D extends Node2D {
9188
9197
  }
9189
9198
  }
9190
9199
 
9191
- var __defProp$i = Object.defineProperty;
9200
+ var __defProp$j = Object.defineProperty;
9192
9201
  var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
9193
- var __decorateClass$i = (decorators, target, key, kind) => {
9202
+ var __decorateClass$j = (decorators, target, key, kind) => {
9194
9203
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$h(target, key) : target;
9195
9204
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9196
9205
  if (decorator = decorators[i])
9197
9206
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9198
- if (kind && result) __defProp$i(target, key, result);
9207
+ if (kind && result) __defProp$j(target, key, result);
9199
9208
  return result;
9200
9209
  };
9201
9210
  let Lottie2D = class extends TextureRect2D {
@@ -9238,21 +9247,21 @@ let Lottie2D = class extends TextureRect2D {
9238
9247
  super._process(delta);
9239
9248
  }
9240
9249
  };
9241
- __decorateClass$i([
9250
+ __decorateClass$j([
9242
9251
  property({ default: "" })
9243
9252
  ], Lottie2D.prototype, "src", 2);
9244
- Lottie2D = __decorateClass$i([
9253
+ Lottie2D = __decorateClass$j([
9245
9254
  customNode("Lottie2D")
9246
9255
  ], Lottie2D);
9247
9256
 
9248
- var __defProp$h = Object.defineProperty;
9257
+ var __defProp$i = Object.defineProperty;
9249
9258
  var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
9250
- var __decorateClass$h = (decorators, target, key, kind) => {
9259
+ var __decorateClass$i = (decorators, target, key, kind) => {
9251
9260
  var result = kind > 1 ? undefined : kind ? __getOwnPropDesc$g(target, key) : target;
9252
9261
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9253
9262
  if (decorator = decorators[i])
9254
9263
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9255
- if (kind && result) __defProp$h(target, key, result);
9264
+ if (kind && result) __defProp$i(target, key, result);
9256
9265
  return result;
9257
9266
  };
9258
9267
  const textStyles = new Set(Object.keys(textDefaultStyle));
@@ -9390,25 +9399,77 @@ let Text2D = class extends TextureRect2D {
9390
9399
  }
9391
9400
  }
9392
9401
  };
9393
- __decorateClass$h([
9402
+ __decorateClass$i([
9394
9403
  property({ default: false })
9395
9404
  ], Text2D.prototype, "split", 2);
9396
- __decorateClass$h([
9405
+ __decorateClass$i([
9397
9406
  property({ default: "" })
9398
9407
  ], Text2D.prototype, "content", 2);
9399
- __decorateClass$h([
9408
+ __decorateClass$i([
9400
9409
  property()
9401
9410
  ], Text2D.prototype, "effects", 2);
9402
- __decorateClass$h([
9411
+ __decorateClass$i([
9403
9412
  protectedProperty()
9404
9413
  ], Text2D.prototype, "measureDom", 2);
9405
- __decorateClass$h([
9414
+ __decorateClass$i([
9406
9415
  protectedProperty()
9407
9416
  ], Text2D.prototype, "fonts", 2);
9408
- Text2D = __decorateClass$h([
9417
+ Text2D = __decorateClass$i([
9409
9418
  customNode("Text2D")
9410
9419
  ], Text2D);
9411
9420
 
9421
+ var __defProp$h = Object.defineProperty;
9422
+ var __decorateClass$h = (decorators, target, key, kind) => {
9423
+ var result = undefined ;
9424
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
9425
+ if (decorator = decorators[i])
9426
+ result = (decorator(target, key, result) ) || result;
9427
+ if (result) __defProp$h(target, key, result);
9428
+ return result;
9429
+ };
9430
+ class TransformRect2D extends Node2D {
9431
+ _updateStyleProperty(key, value, oldValue, declaration) {
9432
+ super._updateStyleProperty(key, value, oldValue, declaration);
9433
+ switch (key) {
9434
+ case "width":
9435
+ case "height":
9436
+ this.requestRedraw();
9437
+ break;
9438
+ }
9439
+ }
9440
+ _drawCircle(x, y) {
9441
+ this.context.arc(x, y, this.size, 0, Math.PI * 2, true);
9442
+ this.context.fillStyle = Texture2D.WHITE;
9443
+ this.context.fill();
9444
+ this.context.arc(x, y, this.size, 0, Math.PI * 2, true);
9445
+ this.context.strokeStyle = "rgba(0, 0, 0, 0.2)";
9446
+ this.context.stroke();
9447
+ }
9448
+ _drawEllipse(x, y) {
9449
+ this.context.roundRect(x - this.size, y - this.size * 2, this.size * 2, this.size * 4, this.size);
9450
+ this.context.fillStyle = Texture2D.WHITE;
9451
+ this.context.fill();
9452
+ this.context.roundRect(x - this.size, y - this.size * 2, this.size * 2, this.size * 4, this.size);
9453
+ this.context.strokeStyle = "rgba(0, 0, 0, 0.2)";
9454
+ this.context.stroke();
9455
+ }
9456
+ _draw() {
9457
+ const { width, height } = this.style;
9458
+ this.context.rect(0, 0, width, height);
9459
+ this.context.strokeStyle = "#00FF00";
9460
+ this.context.stroke();
9461
+ this._drawCircle(0, 0);
9462
+ this._drawCircle(width, height);
9463
+ this._drawCircle(0, height);
9464
+ this._drawEllipse(0, height / 2);
9465
+ this._drawCircle(width, 0);
9466
+ this._drawEllipse(width, height / 2);
9467
+ }
9468
+ }
9469
+ __decorateClass$h([
9470
+ property({ default: 6 })
9471
+ ], TransformRect2D.prototype, "size");
9472
+
9412
9473
  var __defProp$g = Object.defineProperty;
9413
9474
  var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
9414
9475
  var __decorateClass$g = (decorators, target, key, kind) => {
@@ -12879,11 +12940,11 @@ TwistTransition = __decorateClass([
12879
12940
  customNode("TwistTransition")
12880
12941
  ], TwistTransition);
12881
12942
 
12882
- class GifLoader extends Loader {
12943
+ class GIFLoader extends Loader {
12883
12944
  install(assets) {
12884
12945
  const handler = async (url) => {
12885
12946
  const { decodeFrames } = await import('modern-gif');
12886
- return await assets.fetch(url).then((res) => res.arrayBuffer()).then((buffer) => decodeFrames(buffer)).then((frames) => new Image2DResource(
12947
+ return await assets.fetch(url).then((res) => res.arrayBuffer()).then((buffer) => decodeFrames(buffer)).then((frames) => new AnimatedTexture(
12887
12948
  frames.map((frame) => {
12888
12949
  return {
12889
12950
  duration: frame.delay,
@@ -12905,7 +12966,7 @@ class GifLoader extends Loader {
12905
12966
  }
12906
12967
  }
12907
12968
 
12908
- class JsonLoader extends Loader {
12969
+ class JSONLoader extends Loader {
12909
12970
  install(assets) {
12910
12971
  const handler = (url) => {
12911
12972
  return assets.fetch(url).then((rep) => rep.json());
@@ -13215,9 +13276,14 @@ class Assets {
13215
13276
  this._handled.clear();
13216
13277
  }
13217
13278
  }
13218
- 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());
13279
+ 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());
13219
13280
 
13220
13281
  class CanvasItemEditor extends Control {
13282
+ _pointerStart;
13283
+ _pointerOffset;
13284
+ selected;
13285
+ dragging;
13286
+ hovered;
13221
13287
  hover = new Node2D({
13222
13288
  name: "hover",
13223
13289
  internalMode: "back",
@@ -13229,28 +13295,20 @@ class CanvasItemEditor extends Control {
13229
13295
  pointerEvents: "none"
13230
13296
  }
13231
13297
  });
13232
- selectionRect = new Node2D({
13233
- name: "selectionRect",
13298
+ transformRect = new TransformRect2D({
13299
+ name: "transformRect",
13234
13300
  internalMode: "back",
13235
13301
  style: {
13236
13302
  visibility: "hidden",
13237
- width: 1,
13238
- height: 1,
13239
- backgroundColor: 16711695,
13240
- outlineStyle: "solid",
13241
- outlineColor: 16711935,
13242
- outlineWidth: 2,
13243
13303
  pointerEvents: "none"
13244
13304
  }
13245
13305
  });
13246
- selector = new Node2D({
13247
- name: "selector"
13248
- });
13249
13306
  scaler = new Scaler({
13250
13307
  internalMode: "back"
13251
13308
  }).on("updateScale", (scale) => {
13252
13309
  this.ruler.scale = scale;
13253
13310
  this._updateScrollbars();
13311
+ this._updateSelectionRect();
13254
13312
  });
13255
13313
  xScrollBar = new XScrollBar({
13256
13314
  internalMode: "back",
@@ -13284,13 +13342,10 @@ class CanvasItemEditor extends Control {
13284
13342
  }, [
13285
13343
  this.drawboard,
13286
13344
  this.hover,
13287
- this.selectionRect,
13345
+ this.transformRect,
13288
13346
  this.xScrollBar,
13289
13347
  this.yScrollBar
13290
13348
  ]);
13291
- _pointerStart;
13292
- _pointerOffset;
13293
- selected;
13294
13349
  constructor() {
13295
13350
  super();
13296
13351
  this._onPointerdown = this._onPointerdown.bind(this);
@@ -13328,51 +13383,60 @@ class CanvasItemEditor extends Control {
13328
13383
  _onPointerdown(e) {
13329
13384
  const target = e.target;
13330
13385
  this._pointerOffset = { x: e.offsetX, y: e.offsetY };
13386
+ this.selected = target;
13387
+ this.dragging = target;
13331
13388
  if (target instanceof Node2D) {
13332
- this.selected = target;
13333
13389
  this._pointerStart = target.style.clone();
13334
13390
  } else {
13335
- this.selected = undefined;
13336
13391
  this._pointerStart = undefined;
13337
- this.selectionRect.style.visibility = "visible";
13338
- this.selectionRect.style.left = e.screen.x;
13339
- this.selectionRect.style.top = e.screen.y;
13340
- this.selectionRect.style.width = 1;
13341
- this.selectionRect.style.height = 1;
13342
13392
  }
13343
- this._onHover();
13393
+ this._updateHover();
13394
+ this._updateSelectionRect();
13344
13395
  }
13345
13396
  _onPointermove(e) {
13346
- const { selected, _pointerStart, _pointerOffset } = this;
13347
- const offset = _pointerOffset ? { x: e.offsetX - _pointerOffset.x, y: e.offsetY - _pointerOffset.y } : { x: 0, y: 0 };
13348
- if (selected && _pointerStart) {
13349
- selected.style.left = _pointerStart.left + offset.x;
13350
- selected.style.top = _pointerStart.top + offset.y;
13397
+ const target = e.target;
13398
+ const { selected, dragging, _pointerStart, _pointerOffset } = this;
13399
+ if (selected && target?.is(selected)) {
13400
+ this.hovered = undefined;
13351
13401
  } else {
13352
- if (this.selectionRect.isVisibleInTree()) {
13353
- this.selectionRect.style.width = offset.x;
13354
- this.selectionRect.style.height = offset.y;
13355
- }
13402
+ this.hovered = target;
13403
+ }
13404
+ const offset = _pointerOffset ? { x: e.offsetX - _pointerOffset.x, y: e.offsetY - _pointerOffset.y } : { x: 0, y: 0 };
13405
+ if (dragging && _pointerStart) {
13406
+ dragging.style.left = _pointerStart.left + offset.x;
13407
+ dragging.style.top = _pointerStart.top + offset.y;
13356
13408
  }
13357
- this._onHover();
13409
+ this._updateHover();
13410
+ this._updateSelectionRect();
13358
13411
  }
13359
13412
  _onPointerup() {
13360
- this.selected = undefined;
13361
- this.selectionRect.style.visibility = "hidden";
13362
- this._onHover();
13413
+ this.dragging = undefined;
13414
+ this._updateHover();
13415
+ this._updateSelectionRect();
13363
13416
  }
13364
- _onHover() {
13365
- const selected = this.selected;
13366
- if (selected instanceof Node2D) {
13417
+ _updateHover() {
13418
+ const hovered = this.hovered;
13419
+ if (hovered instanceof Node2D) {
13367
13420
  this.hover.style.visibility = "visible";
13368
- this.hover.style.width = selected.style.width;
13369
- this.hover.style.height = selected.style.height;
13370
- this.hover.transform.set(selected.transform);
13421
+ this.hover.style.width = hovered.style.width;
13422
+ this.hover.style.height = hovered.style.height;
13423
+ this.hover.transform.set(hovered.transform);
13371
13424
  this.hover.requestRedraw();
13372
13425
  } else {
13373
13426
  this.hover.style.visibility = "hidden";
13374
13427
  }
13375
13428
  }
13429
+ _updateSelectionRect() {
13430
+ if (this.selected) {
13431
+ this.transformRect.style.visibility = "visible";
13432
+ this.transformRect.style.width = this.selected.style.width;
13433
+ this.transformRect.style.height = this.selected.style.height;
13434
+ this.transformRect.transform.set(this.selected.transform);
13435
+ this.transformRect.requestReflow();
13436
+ } else {
13437
+ this.transformRect.style.visibility = "hidden";
13438
+ }
13439
+ }
13376
13440
  _updateScrollbars() {
13377
13441
  const scale = this.ruler.scale;
13378
13442
  const scrollHeight = this.drawboard.style.height * scale;
@@ -13600,4 +13664,4 @@ async function render(options) {
13600
13664
  });
13601
13665
  }
13602
13666
 
13603
- export { Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BlurEffect, CanvasContext, CanvasItem, CanvasItemEditor, CanvasItemStyle, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, Control, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, Effect, EffectMaterial, Element, ElementStyle, EmbossEffect, Engine, EventEmitter, FontLoader, Geometry, GifLoader, GlitchEffect, GodrayEffect, Graphics2D, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, Image2DResource, ImageTexture, IndexBuffer, Input, InputEvent, JsonLoader, KawaseTransition, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, MouseInputEvent, Node, Node2D, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, RawWeakMap, Rect2, RefCounted, Renderer, Resource, Ruler, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, SceneTree, ScrollBar, ShadowEffect, Text2D, TextLoader, Texture2D, TextureLoader, TextureRect2D, Ticker, TiltShiftTransition, Timeline, TimelineNode, Transform2D, Transition, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, VertexAttribute, VertexBuffer, Video2D, VideoLoader, VideoTexture, Viewport, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, WebGLBufferModule, WebGLFramebufferModule, WebGLMaskModule, WebGLModule, WebGLProgramModule, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, WebGLTextureModule, WebGLVertexArrayModule, WebGLViewportModule, WebSound, WheelInputEvent, XScrollBar, YScrollBar, ZoomBlurEffect, assets, clamp, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, defineProperty, determineCrossOrigin, ease, easeIn, easeInOut, easeOut, getDeclarations, getDefaultCssPropertyValue, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, parseCssFunctions, parseCssProperty, property, protectedProperty, render, timingFunctions, uid };
13667
+ export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BlurEffect, CanvasContext, CanvasItem, CanvasItemEditor, CanvasItemStyle, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, Control, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, Effect, EffectMaterial, Element, ElementStyle, EmbossEffect, Engine, EventEmitter, FontLoader, GIFLoader, Geometry, GlitchEffect, GodrayEffect, Graphics2D, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JSONLoader, KawaseTransition, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, MouseInputEvent, Node, Node2D, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, RawWeakMap, Rect2, RefCounted, Renderer, Resource, Ruler, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, SceneTree, ScrollBar, ShadowEffect, Text2D, TextLoader, Texture2D, TextureLoader, TextureRect2D, Ticker, TiltShiftTransition, Timeline, TimelineNode, Transform2D, TransformRect2D, Transition, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, VertexAttribute, VertexBuffer, Video2D, VideoLoader, VideoTexture, Viewport, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, WebGLBufferModule, WebGLFramebufferModule, WebGLMaskModule, WebGLModule, WebGLProgramModule, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, WebGLTextureModule, WebGLVertexArrayModule, WebGLViewportModule, WebSound, WheelInputEvent, XScrollBar, YScrollBar, ZoomBlurEffect, assets, clamp, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, defineProperty, determineCrossOrigin, ease, easeIn, easeInOut, easeOut, getDeclarations, getDefaultCssPropertyValue, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, parseCssFunctions, parseCssProperty, property, protectedProperty, render, timingFunctions, uid };