modern-canvas 0.24.1 → 0.24.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.js CHANGED
@@ -531,7 +531,7 @@ var ut = class e {
531
531
  destroy() {
532
532
  this.destroyed || (this.destroyed = !0, this._destroy(), this.emit("destroy"), this.removeAllListeners());
533
533
  }
534
- }, _t = class extends T {}, E = class extends _t {}, vt = class e {
534
+ }, _t = class extends T {}, vt = class extends _t {}, yt = class e {
535
535
  get x() {
536
536
  return this.min.x;
537
537
  }
@@ -665,7 +665,7 @@ var ut = class e {
665
665
  //#endregion
666
666
  //#region src/core/math/Color.ts
667
667
  pe([me]);
668
- var yt = class {
668
+ var E = class {
669
669
  get value() {
670
670
  return this._value;
671
671
  }
@@ -749,15 +749,15 @@ var yt = class {
749
749
  ];
750
750
  }
751
751
  }, bt = xe / 180, xt = 180 / xe;
752
- function St(e, t, n) {
752
+ function D(e, t, n) {
753
753
  return Math.max(t, Math.min(e, n));
754
754
  }
755
- function D(e, t, n) {
755
+ function O(e, t, n) {
756
756
  return (1 - n) * e + n * t;
757
757
  }
758
758
  //#endregion
759
759
  //#region src/core/math/ColorMatrix.ts
760
- var Ct = class {
760
+ var St = class {
761
761
  _array = new Float32Array(20);
762
762
  constructor() {
763
763
  this.identity();
@@ -887,7 +887,7 @@ var Ct = class {
887
887
  ]);
888
888
  }
889
889
  invert(e = 1) {
890
- let t = D(1, -1, e), n = D(0, 255, e);
890
+ let t = O(1, -1, e), n = O(0, 255, e);
891
891
  return this.multiply([
892
892
  t,
893
893
  0,
@@ -912,21 +912,21 @@ var Ct = class {
912
912
  ]);
913
913
  }
914
914
  sepia(e = 1) {
915
- let t = St(e, 0, 1);
915
+ let t = D(e, 0, 1);
916
916
  return this.multiply([
917
- D(1, .393, t),
918
- D(0, .7689999, t),
919
- D(0, .18899999, t),
917
+ O(1, .393, t),
918
+ O(0, .7689999, t),
919
+ O(0, .18899999, t),
920
920
  0,
921
921
  0,
922
- D(0, .349, t),
923
- D(1, .6859999, t),
924
- D(0, .16799999, t),
922
+ O(0, .349, t),
923
+ O(1, .6859999, t),
924
+ O(0, .16799999, t),
925
925
  0,
926
926
  0,
927
- D(0, .272, t),
928
- D(0, .5339999, t),
929
- D(1, .13099999, t),
927
+ O(0, .272, t),
928
+ O(0, .5339999, t),
929
+ O(1, .13099999, t),
930
930
  0,
931
931
  0,
932
932
  0,
@@ -961,7 +961,7 @@ var Ct = class {
961
961
  ]);
962
962
  }
963
963
  grayscale(e = 1) {
964
- let t = St(e, 0, 1), n = D(1, .3, t), r = D(0, .3, t), i = D(1, .59, t), a = D(0, .59, t), o = D(1, .11, t), s = D(0, .11, t);
964
+ let t = D(e, 0, 1), n = O(1, .3, t), r = O(0, .3, t), i = O(1, .59, t), a = O(0, .59, t), o = O(1, .11, t), s = O(0, .11, t);
965
965
  return this.multiply([
966
966
  n,
967
967
  a,
@@ -1013,7 +1013,7 @@ var Ct = class {
1013
1013
  toArray() {
1014
1014
  return this._array;
1015
1015
  }
1016
- }, wt = class e extends vt {
1016
+ }, Ct = class e extends yt {
1017
1017
  rotation;
1018
1018
  get rotationDegrees() {
1019
1019
  return this.rotation / bt;
@@ -1068,7 +1068,7 @@ var Ct = class {
1068
1068
  clone() {
1069
1069
  return new e(this.toJSON());
1070
1070
  }
1071
- }, Tt = class {
1071
+ }, wt = class {
1072
1072
  _array;
1073
1073
  x = 0;
1074
1074
  y = 0;
@@ -1092,12 +1092,12 @@ var Ct = class {
1092
1092
  };
1093
1093
  //#endregion
1094
1094
  //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorateMetadata.js
1095
- function O(e, t) {
1095
+ function k(e, t) {
1096
1096
  if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
1097
1097
  }
1098
1098
  //#endregion
1099
1099
  //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorate.js
1100
- function k(e, t, n, r) {
1100
+ function A(e, t, n, r) {
1101
1101
  var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
1102
1102
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
1103
1103
  else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
@@ -1105,7 +1105,7 @@ function k(e, t, n, r) {
1105
1105
  }
1106
1106
  //#endregion
1107
1107
  //#region src/core/os/MainLoop.ts
1108
- var Et = class extends T {
1108
+ var Tt = class extends T {
1109
1109
  _starting = !1;
1110
1110
  _nextDeltaTime = 0;
1111
1111
  _startedProcess;
@@ -1135,22 +1135,22 @@ var Et = class extends T {
1135
1135
  super._destroy(), this.stop();
1136
1136
  }
1137
1137
  };
1138
- k([_({ fallback: 60 }), O("design:type", Number)], Et.prototype, "fps", void 0), k([_({ fallback: 1 }), O("design:type", Number)], Et.prototype, "speed", void 0);
1138
+ A([_({ fallback: 60 }), k("design:type", Number)], Tt.prototype, "fps", void 0), A([_({ fallback: 1 }), k("design:type", Number)], Tt.prototype, "speed", void 0);
1139
1139
  //#endregion
1140
1140
  //#region src/core/renderers/gl/buffer/const.ts
1141
- var Dt = /* @__PURE__ */ function(e) {
1141
+ var Et = /* @__PURE__ */ function(e) {
1142
1142
  return e[e.elementArrayBuffer = 34963] = "elementArrayBuffer", e[e.arrayBuffer = 34962] = "arrayBuffer", e[e.uniformBuffer = 35345] = "uniformBuffer", e;
1143
- }({}), Ot = class {
1143
+ }({}), Dt = class {
1144
1144
  native;
1145
- target = Dt.arrayBuffer;
1145
+ target = Et.arrayBuffer;
1146
1146
  byteLength = 0;
1147
1147
  dirty = !0;
1148
1148
  constructor(e) {
1149
1149
  this.native = e;
1150
1150
  }
1151
- }, A = /* @__PURE__ */ function(e) {
1151
+ }, j = /* @__PURE__ */ function(e) {
1152
1152
  return e[e.mapRead = 1] = "mapRead", e[e.mapWrite = 2] = "mapWrite", e[e.copySrc = 4] = "copySrc", e[e.copyDst = 8] = "copyDst", e[e.index = 16] = "index", e[e.vertex = 32] = "vertex", e[e.uniform = 64] = "uniform", e[e.storage = 128] = "storage", e[e.indirect = 256] = "indirect", e[e.queryResolve = 512] = "queryResolve", e[e.static = 1024] = "static", e;
1153
- }({}), kt = class extends n {
1153
+ }({}), Ot = class extends n {
1154
1154
  screen = {
1155
1155
  x: 0,
1156
1156
  y: 0,
@@ -1169,12 +1169,12 @@ var Dt = /* @__PURE__ */ function(e) {
1169
1169
  this.view && (this.view.width = Math.floor(e * this.pixelRatio), this.view.height = Math.floor(t * this.pixelRatio)), this.screen.width = e, this.screen.height = t, n && this.view && (this.view.style.width = `${e}px`, this.view.style.height = `${t}px`);
1170
1170
  }
1171
1171
  };
1172
- k([_({ fallback: Je }), O("design:type", Number)], kt.prototype, "pixelRatio", void 0), k([_({ internal: !0 }), O("design:type", typeof HTMLCanvasElement > "u" ? Object : HTMLCanvasElement)], kt.prototype, "view", void 0);
1172
+ A([_({ fallback: Je }), k("design:type", Number)], Ot.prototype, "pixelRatio", void 0), A([_({ internal: !0 }), k("design:type", typeof HTMLCanvasElement > "u" ? Object : HTMLCanvasElement)], Ot.prototype, "view", void 0);
1173
1173
  //#endregion
1174
1174
  //#region src/core/renderers/shared/shader/UniformGroup.ts
1175
- var At = 0, jt = class {
1175
+ var kt = 0, At = class {
1176
1176
  isUniformGroup = !0;
1177
- uid = ++At;
1177
+ uid = ++kt;
1178
1178
  uniforms;
1179
1179
  ubo;
1180
1180
  isStatic;
@@ -1185,14 +1185,14 @@ var At = 0, jt = class {
1185
1185
  update() {
1186
1186
  this._dirtyId++;
1187
1187
  }
1188
- }, Mt = Object.create(null), Nt = Object.create(null);
1189
- function Pt(e, t) {
1190
- let n = Nt[e];
1191
- return n === void 0 && (Mt[t] === void 0 && (Mt[t] = 1), Nt[e] = n = Mt[t]++), n;
1188
+ }, jt = Object.create(null), Mt = Object.create(null);
1189
+ function Nt(e, t) {
1190
+ let n = Mt[e];
1191
+ return n === void 0 && (jt[t] === void 0 && (jt[t] = 1), Mt[e] = n = jt[t]++), n;
1192
1192
  }
1193
1193
  //#endregion
1194
1194
  //#region src/core/renderers/gl/system/GlSystem.ts
1195
- var j = class extends e {
1195
+ var M = class extends e {
1196
1196
  get _gl() {
1197
1197
  return this._renderer.gl;
1198
1198
  }
@@ -1206,7 +1206,7 @@ var j = class extends e {
1206
1206
  _setup() {}
1207
1207
  flush() {}
1208
1208
  reset() {}
1209
- }, Ft = class extends j {
1209
+ }, Pt = class extends M {
1210
1210
  install(e) {
1211
1211
  super.install(e), e.buffer = this;
1212
1212
  }
@@ -1216,8 +1216,8 @@ var j = class extends e {
1216
1216
  return this.glBuffers.get(e.instanceId) || this._createGlBuffer(e);
1217
1217
  }
1218
1218
  _createGlBuffer(e) {
1219
- let t = this._gl, n = new Ot(t.createBuffer()), r = Dt.arrayBuffer;
1220
- return e.usage & A.index ? r = Dt.elementArrayBuffer : e.usage & A.uniform && (r = Dt.uniformBuffer), n.target = r, this.glBuffers.set(e.instanceId, n), this.buffers.get(e.instanceId) || ("on" in e && (e.on("updateProperty", (e) => {
1219
+ let t = this._gl, n = new Dt(t.createBuffer()), r = Et.arrayBuffer;
1220
+ return e.usage & j.index ? r = Et.elementArrayBuffer : e.usage & j.uniform && (r = Et.uniformBuffer), n.target = r, this.glBuffers.set(e.instanceId, n), this.buffers.get(e.instanceId) || ("on" in e && (e.on("updateProperty", (e) => {
1221
1221
  switch (e) {
1222
1222
  case "usage":
1223
1223
  case "data":
@@ -1240,7 +1240,7 @@ var j = class extends e {
1240
1240
  n.dirty = !1;
1241
1241
  let { _gl: r } = this, { usage: i, data: a } = e;
1242
1242
  r.bindBuffer(n.target, n.native);
1243
- let o = i & A.static ? r.STATIC_DRAW : r.DYNAMIC_DRAW;
1243
+ let o = i & j.static ? r.STATIC_DRAW : r.DYNAMIC_DRAW;
1244
1244
  if (a) if (n.byteLength >= a.byteLength) {
1245
1245
  let e = a.length * a.BYTES_PER_ELEMENT;
1246
1246
  r.bufferSubData(n.target, 0, a, 0, e / a.BYTES_PER_ELEMENT);
@@ -1255,13 +1255,13 @@ var j = class extends e {
1255
1255
  }
1256
1256
  this.buffers.clear(), this.glBuffers.clear();
1257
1257
  }
1258
- }, It;
1259
- function Lt() {
1260
- return It ||= "mediump", It;
1258
+ }, Ft;
1259
+ function It() {
1260
+ return Ft ||= "mediump", Ft;
1261
1261
  }
1262
1262
  //#endregion
1263
1263
  //#region src/core/renderers/gl/shader/preprocessors/addProgramDefines.ts
1264
- function Rt(e, t, n) {
1264
+ function Lt(e, t, n) {
1265
1265
  return t ? e : n ? (e = e.replace("out vec4 finalColor;", ""), `#ifdef GL_ES
1266
1266
  #define in varying
1267
1267
  #define finalColor gl_FragColor
@@ -1275,7 +1275,7 @@ ${e}`;
1275
1275
  }
1276
1276
  //#endregion
1277
1277
  //#region src/core/renderers/gl/shader/preprocessors/ensurePrecision.ts
1278
- function zt(e, t, n) {
1278
+ function Rt(e, t, n) {
1279
1279
  let r = n ? t.maxSupportedFragmentPrecision : t.maxSupportedVertexPrecision;
1280
1280
  if (e.substring(0, 9) !== "precision") {
1281
1281
  let i = n ? t.requestedFragmentPrecision : t.requestedVertexPrecision;
@@ -1285,31 +1285,31 @@ function zt(e, t, n) {
1285
1285
  }
1286
1286
  //#endregion
1287
1287
  //#region src/core/renderers/gl/shader/preprocessors/insertVersion.ts
1288
- function Bt(e, t) {
1288
+ function zt(e, t) {
1289
1289
  return t ? `#version 300 es\n${e}` : e;
1290
1290
  }
1291
1291
  //#endregion
1292
1292
  //#region src/core/renderers/gl/shader/preprocessors/setProgramName.ts
1293
- var Vt = {}, Ht = {};
1294
- function Ut(e, { name: t = "program" }, n = !0) {
1293
+ var Bt = {}, Vt = {};
1294
+ function Ht(e, { name: t = "program" }, n = !0) {
1295
1295
  t = t.replace(/\s+/g, "-"), t += n ? "-fragment" : "-vertex";
1296
- let r = n ? Vt : Ht;
1296
+ let r = n ? Bt : Vt;
1297
1297
  return r[t] ? (r[t]++, t += `-${r[t]}`) : r[t] = 1, e.includes("#define SHADER_NAME") ? e : `${`#define SHADER_NAME ${t}`}\n${e}`;
1298
1298
  }
1299
1299
  //#endregion
1300
1300
  //#region src/core/renderers/gl/shader/preprocessors/stripVersion.ts
1301
- function Wt(e, t) {
1301
+ function Ut(e, t) {
1302
1302
  return t ? e.replace("#version 300 es", "") : e;
1303
1303
  }
1304
1304
  //#endregion
1305
1305
  //#region src/core/renderers/gl/shader/GlProgram.ts
1306
- var Gt = Object.create(null), Kt = {
1307
- stripVersion: Wt,
1308
- ensurePrecision: zt,
1309
- addProgramDefines: Rt,
1310
- setProgramName: Ut,
1311
- insertVersion: Bt
1312
- }, qt = class e {
1306
+ var Wt = Object.create(null), Gt = {
1307
+ stripVersion: Ut,
1308
+ ensurePrecision: Rt,
1309
+ addProgramDefines: Lt,
1310
+ setProgramName: Ht,
1311
+ insertVersion: zt
1312
+ }, Kt = class e {
1313
1313
  static defaultOptions = {
1314
1314
  preferredVertexPrecision: "highp",
1315
1315
  preferredFragmentPrecision: "mediump"
@@ -1332,25 +1332,25 @@ var Gt = Object.create(null), Kt = {
1332
1332
  requestedFragmentPrecision: t.preferredFragmentPrecision,
1333
1333
  requestedVertexPrecision: t.preferredVertexPrecision,
1334
1334
  maxSupportedVertexPrecision: "highp",
1335
- maxSupportedFragmentPrecision: Lt()
1335
+ maxSupportedFragmentPrecision: It()
1336
1336
  },
1337
1337
  setProgramName: { name: t.name },
1338
1338
  addProgramDefines: i,
1339
1339
  insertVersion: i
1340
1340
  };
1341
- Object.keys(Kt).forEach((e) => {
1341
+ Object.keys(Gt).forEach((e) => {
1342
1342
  let t = a[e];
1343
- n = Kt[e](n, t, !0), r = Kt[e](r, t, !1);
1344
- }), this.fragment = n, this.vertex = r, this.transformFeedbackVaryings = t.transformFeedbackVaryings, this.id = Pt(`${r}:${n}`, "GlProgram");
1343
+ n = Gt[e](n, t, !0), r = Gt[e](r, t, !1);
1344
+ }), this.fragment = n, this.vertex = r, this.transformFeedbackVaryings = t.transformFeedbackVaryings, this.id = Nt(`${r}:${n}`, "GlProgram");
1345
1345
  }
1346
1346
  destroy() {
1347
- this.fragment = "", this.vertex = "", this.attributes = Object.create(null), this.uniforms = Object.create(null), this.transformFeedbackVaryings = void 0, this._cacheKey && delete Gt[this._cacheKey];
1347
+ this.fragment = "", this.vertex = "", this.attributes = Object.create(null), this.uniforms = Object.create(null), this.transformFeedbackVaryings = void 0, this._cacheKey && delete Wt[this._cacheKey];
1348
1348
  }
1349
1349
  static from(t) {
1350
1350
  let n = `${t.vertex}:${t.fragment}`;
1351
- return Gt[n] || (Gt[n] = new e(t), Gt[n]._cacheKey = n), Gt[n];
1351
+ return Wt[n] || (Wt[n] = new e(t), Wt[n]._cacheKey = n), Wt[n];
1352
1352
  }
1353
- }, Jt = {
1353
+ }, qt = {
1354
1354
  uint8x2: {
1355
1355
  size: 2,
1356
1356
  stride: 2,
@@ -1502,18 +1502,18 @@ var Gt = Object.create(null), Kt = {
1502
1502
  normalized: !1
1503
1503
  }
1504
1504
  };
1505
- function Yt(e) {
1506
- return Jt[e] ?? Jt.float32;
1505
+ function Jt(e) {
1506
+ return qt[e] ?? qt.float32;
1507
1507
  }
1508
1508
  //#endregion
1509
1509
  //#region src/core/renderers/gl/shader/GlProgramData.ts
1510
- var Xt = class {
1510
+ var Yt = class {
1511
1511
  native;
1512
1512
  uniformDirtyGroups = Object.create(null);
1513
1513
  constructor(e) {
1514
1514
  this.native = e;
1515
1515
  }
1516
- }, Zt, Qt = {
1516
+ }, Xt, Zt = {
1517
1517
  FLOAT: "float",
1518
1518
  FLOAT_VEC2: "vec2",
1519
1519
  FLOAT_VEC3: "vec3",
@@ -1542,7 +1542,7 @@ var Xt = class {
1542
1542
  SAMPLER_2D_ARRAY: "sampler2DArray",
1543
1543
  INT_SAMPLER_2D_ARRAY: "sampler2DArray",
1544
1544
  UNSIGNED_INT_SAMPLER_2D_ARRAY: "sampler2DArray"
1545
- }, $t = {
1545
+ }, Qt = {
1546
1546
  float: "float32",
1547
1547
  vec2: "float32x2",
1548
1548
  vec3: "float32x3",
@@ -1560,29 +1560,29 @@ var Xt = class {
1560
1560
  bvec3: "uint32x3",
1561
1561
  bvec4: "uint32x4"
1562
1562
  };
1563
- function en(e, t) {
1564
- if (!Zt) {
1565
- let t = Object.keys(Qt);
1566
- Zt = {};
1563
+ function $t(e, t) {
1564
+ if (!Xt) {
1565
+ let t = Object.keys(Zt);
1566
+ Xt = {};
1567
1567
  for (let n = 0; n < t.length; ++n) {
1568
1568
  let r = t[n];
1569
- Zt[e[r]] = Qt[r];
1569
+ Xt[e[r]] = Zt[r];
1570
1570
  }
1571
1571
  }
1572
- return Zt[t];
1572
+ return Xt[t];
1573
1573
  }
1574
- function tn(e, t) {
1575
- return $t[en(e, t)] || "float32";
1574
+ function en(e, t) {
1575
+ return Qt[$t(e, t)] || "float32";
1576
1576
  }
1577
1577
  //#endregion
1578
1578
  //#region src/core/renderers/gl/shader/GlShaderSystem.ts
1579
- var nn = class extends j {
1579
+ var tn = class extends M {
1580
1580
  install(e) {
1581
1581
  super.install(e), e.shader = this;
1582
1582
  }
1583
1583
  glProgramDatas = /* @__PURE__ */ new Map();
1584
1584
  currentProgram = null;
1585
- globalUniforms = new jt({
1585
+ globalUniforms = new At({
1586
1586
  projectionMatrix: new Float32Array([
1587
1587
  1,
1588
1588
  0,
@@ -1623,7 +1623,7 @@ var nn = class extends j {
1623
1623
  return this.glProgramDatas.get(e.id) || this._createGlProgramData(e);
1624
1624
  }
1625
1625
  _createGlProgramData(e) {
1626
- let t = this._gl, n = new Xt(t.createProgram());
1626
+ let t = this._gl, n = new Yt(t.createProgram());
1627
1627
  this.glProgramDatas.set(e.id, n), this.useProgram(e);
1628
1628
  let r = this._createGlShader(e.vertex, t.VERTEX_SHADER), i = this._createGlShader(e.fragment, t.FRAGMENT_SHADER);
1629
1629
  if (t.attachShader(n.native, r), t.attachShader(n.native, i), t.linkProgram(n.native), !t.getProgramParameter(n.native, t.LINK_STATUS)) throw Error(`Failed to link program: ${t.getProgramInfoLog(n.native)}`);
@@ -1631,11 +1631,11 @@ var nn = class extends j {
1631
1631
  for (let e = t.getProgramParameter(n.native, t.ACTIVE_ATTRIBUTES), r = 0; r < e; r++) {
1632
1632
  let e = t.getActiveAttrib(n.native, r);
1633
1633
  if (!e || e.name.startsWith("gl_")) continue;
1634
- let i = tn(t, e.type);
1634
+ let i = en(t, e.type);
1635
1635
  a[e.name] = {
1636
1636
  location: 0,
1637
1637
  format: i,
1638
- stride: Yt(i).stride,
1638
+ stride: Jt(i).stride,
1639
1639
  offset: 0,
1640
1640
  instance: !1,
1641
1641
  start: 0
@@ -1652,7 +1652,7 @@ var nn = class extends j {
1652
1652
  for (let e = t.getProgramParameter(n.native, t.ACTIVE_UNIFORMS), r = 0; r < e; r++) {
1653
1653
  let e = t.getActiveUniform(n.native, r);
1654
1654
  if (!e) continue;
1655
- let i = e.name.replace(/\[.*?\]$/, ""), a = en(t, e.type), o = e.size;
1655
+ let i = e.name.replace(/\[.*?\]$/, ""), a = $t(t, e.type), o = e.size;
1656
1656
  c[i] = {
1657
1657
  name: i,
1658
1658
  index: r,
@@ -1687,7 +1687,7 @@ var nn = class extends j {
1687
1687
  let { type: s, isArray: c, name: l } = o;
1688
1688
  o.location === void 0 && (o.location = r.getUniformLocation(t.native, l));
1689
1689
  let u = o.location;
1690
- if (rn(o.value, a)) switch (o.value = an(o.value, a), s) {
1690
+ if (nn(o.value, a)) switch (o.value = rn(o.value, a), s) {
1691
1691
  case "float":
1692
1692
  c ? r.uniform1fv(u, a) : r.uniform1f(u, a);
1693
1693
  break;
@@ -1774,7 +1774,7 @@ var nn = class extends j {
1774
1774
  super.destroy(), this.bind(null);
1775
1775
  }
1776
1776
  };
1777
- function rn(e, t) {
1777
+ function nn(e, t) {
1778
1778
  if (typeof t == "object" && t) {
1779
1779
  let n = t.length;
1780
1780
  if (typeof e != "object" || !e || e.length !== n) return !0;
@@ -1783,7 +1783,7 @@ function rn(e, t) {
1783
1783
  }
1784
1784
  return e !== t;
1785
1785
  }
1786
- function an(e, t) {
1786
+ function rn(e, t) {
1787
1787
  if (typeof t == "object" && t) {
1788
1788
  let n = t.length;
1789
1789
  if (typeof e == "object" && e && e.length === n) {
@@ -1796,10 +1796,10 @@ function an(e, t) {
1796
1796
  }
1797
1797
  //#endregion
1798
1798
  //#region src/core/renderers/gl/state/GlBlendMode.ts
1799
- var on = /* @__PURE__ */ function(e) {
1799
+ var an = /* @__PURE__ */ function(e) {
1800
1800
  return e.normal = "normal", e.add = "add", e.multiply = "multiply", e.screen = "screen", e.none = "none", e.normalNpm = "normalNpm", e.addNpm = "add_npm", e.screenNpm = "screenNpm", e.srcIn = "srcIn", e.srcOut = "srcOut", e.srcAtop = "srcAtop", e.dstOver = "dstOver", e.dstIn = "dstIn", e.dstOut = "dstOut", e.dstAtop = "dstAtop", e.xor = "xor", e.subtract = "subtract", e;
1801
1801
  }({});
1802
- function sn(e) {
1802
+ function on(e) {
1803
1803
  return {
1804
1804
  normal: [e.ONE, e.ONE_MINUS_SRC_ALPHA],
1805
1805
  add: [e.ONE, e.ONE],
@@ -1854,7 +1854,7 @@ function sn(e) {
1854
1854
  }
1855
1855
  //#endregion
1856
1856
  //#region src/core/renderers/gl/state/GlStateSystem.ts
1857
- var cn = class e {
1857
+ var sn = class e {
1858
1858
  static _properties = [
1859
1859
  "blend",
1860
1860
  "offsets",
@@ -1881,14 +1881,14 @@ var cn = class e {
1881
1881
  let t = new e();
1882
1882
  return t.depthTest = !1, t.blend = !0, t;
1883
1883
  }
1884
- _blendMode = on.normal;
1884
+ _blendMode = an.normal;
1885
1885
  _polygonOffset = 0;
1886
1886
  bitmap = 0;
1887
1887
  get blendMode() {
1888
1888
  return this._blendMode;
1889
1889
  }
1890
1890
  set blendMode(e) {
1891
- this.blend = e !== on.none, this._blendMode = e;
1891
+ this.blend = e !== an.none, this._blendMode = e;
1892
1892
  }
1893
1893
  get polygonOffset() {
1894
1894
  return this._polygonOffset;
@@ -1900,19 +1900,19 @@ var cn = class e {
1900
1900
  if (e) for (let t in e) this[t] = e[t];
1901
1901
  }
1902
1902
  };
1903
- cn._init();
1904
- var ln = class extends j {
1903
+ sn._init();
1904
+ var cn = class extends M {
1905
1905
  install(e) {
1906
1906
  super.install(e), e.state = this;
1907
1907
  }
1908
1908
  _blendEq = !1;
1909
- _setters = cn._properties.map((e) => this[`set${e.replace(/^\S/, (e) => e.toUpperCase())}`]);
1909
+ _setters = sn._properties.map((e) => this[`set${e.replace(/^\S/, (e) => e.toUpperCase())}`]);
1910
1910
  boundStateBitmap = 0;
1911
1911
  boundBlendMode;
1912
1912
  blendModes;
1913
- defaultState = new cn({ blend: !0 });
1913
+ defaultState = new sn({ blend: !0 });
1914
1914
  _updateContext(e) {
1915
- super._updateContext(e), this.blendModes = sn(e);
1915
+ super._updateContext(e), this.blendModes = on(e);
1916
1916
  }
1917
1917
  toggle(e, t) {
1918
1918
  this._renderer.gl[t ? "enable" : "disable"](e);
@@ -1955,14 +1955,14 @@ var ln = class extends j {
1955
1955
  }
1956
1956
  reset() {
1957
1957
  super.reset();
1958
- let e = (1 << cn._properties.length) - 1;
1958
+ let e = (1 << sn._properties.length) - 1;
1959
1959
  this.boundStateBitmap = ~this.defaultState.bitmap & e, this.boundBlendMode = void 0, this._blendEq = !0, this.bind(this.defaultState);
1960
1960
  }
1961
- }, un = class extends j {
1961
+ }, ln = class extends M {
1962
1962
  install(e) {
1963
1963
  super.install(e), e.batch2D = this;
1964
1964
  }
1965
- _state = cn.for2D();
1965
+ _state = sn.for2D();
1966
1966
  _batchSize = 4096 * 4;
1967
1967
  _batchables = [];
1968
1968
  _vertexCount = 0;
@@ -1984,7 +1984,7 @@ var ln = class extends j {
1984
1984
  _createShader(e) {
1985
1985
  let t = this._renderer, n = {
1986
1986
  instanceId: lt(),
1987
- glProgram: new qt({
1987
+ glProgram: new Kt({
1988
1988
  vertex: "precision highp float;\nin vec2 aPosition;\nin vec2 aUv;\nin vec4 aTextureParams;\nin vec4 aModulate;\n\nuniform vec2 size;\nuniform mat3 projectionMatrix;\nuniform mat3 viewMatrix;\n\nout float vTextureId;\nout float vClipOutsideUv;\nout vec2 vUv;\nout vec4 vModulate;\n\nvec2 roundPixels(vec2 position, vec2 targetSize) {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n}\n\nvoid main(void) {\n mat3 modelMatrix = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n mat3 modelViewProjectionMatrix = projectionMatrix * viewMatrix * modelMatrix;\n gl_Position = vec4((modelViewProjectionMatrix * vec3(aPosition, 1.0)).xy, 0.0, 1.0);\n vTextureId = aTextureParams.x;\n vClipOutsideUv = aTextureParams.y;\n if (aTextureParams.z == 1.) {\n gl_Position.xy = roundPixels(gl_Position.xy, size);\n }\n vUv = aUv;\n vModulate = aModulate;\n}",
1989
1989
  fragment: `precision highp float;
1990
1990
  in float vTextureId;
@@ -2014,11 +2014,11 @@ void main(void) {
2014
2014
  })
2015
2015
  }, r = {
2016
2016
  instanceId: lt(),
2017
- usage: A.vertex,
2017
+ usage: j.vertex,
2018
2018
  data: new Float32Array()
2019
2019
  }, i = {
2020
2020
  instanceId: lt(),
2021
- usage: A.index,
2021
+ usage: j.index,
2022
2022
  data: new Uint32Array()
2023
2023
  }, a = {
2024
2024
  instanceId: lt(),
@@ -2061,7 +2061,7 @@ void main(void) {
2061
2061
  let { indices: r, vertices: p, uvs: h = new Float32Array(), size: g = {
2062
2062
  width: 0,
2063
2063
  height: 0
2064
- }, texture: ee, blendMode: te = on.normal, clipOutsideUv: ne, roundPixels: re, modulate: ie = [
2064
+ }, texture: ee, blendMode: te = an.normal, clipOutsideUv: ne, roundPixels: re, modulate: ie = [
2065
2065
  255,
2066
2066
  255,
2067
2067
  255,
@@ -2091,22 +2091,22 @@ void main(void) {
2091
2091
  }
2092
2092
  }
2093
2093
  _getBufferData(e) {
2094
- let t = dn(Math.ceil(e / 8)), n = fn(t), r = t * 8;
2094
+ let t = un(Math.ceil(e / 8)), n = dn(t), r = t * 8;
2095
2095
  this._attributeBuffer.length <= n && (this._attributeBuffer.length = n + 1);
2096
2096
  let i = this._attributeBuffer[n];
2097
2097
  return i || (this._attributeBuffer[n] = i = /* @__PURE__ */ new ArrayBuffer(r * this._vertexSize * 4)), i;
2098
2098
  }
2099
2099
  _getIndexBufferData(e) {
2100
- let t = dn(Math.ceil(e / 12)), n = fn(t), r = t * 12;
2100
+ let t = un(Math.ceil(e / 12)), n = dn(t), r = t * 12;
2101
2101
  this._indexBuffers.length <= n && (this._indexBuffers.length = n + 1);
2102
2102
  let i = this._indexBuffers[n];
2103
2103
  return i || (this._indexBuffers[n] = i = new Uint32Array(r)), i;
2104
2104
  }
2105
2105
  };
2106
- function dn(e) {
2106
+ function un(e) {
2107
2107
  return e += +(e === 0), --e, e |= e >>> 1, e |= e >>> 2, e |= e >>> 4, e |= e >>> 8, e |= e >>> 16, e + 1;
2108
2108
  }
2109
- function fn(e) {
2109
+ function dn(e) {
2110
2110
  let t = (e > 65535) << 4;
2111
2111
  e >>>= t;
2112
2112
  let n = (e > 255) << 3;
@@ -2114,11 +2114,11 @@ function fn(e) {
2114
2114
  }
2115
2115
  //#endregion
2116
2116
  //#region src/core/renderers/gl/const.ts
2117
- var M = /* @__PURE__ */ function(e) {
2117
+ var N = /* @__PURE__ */ function(e) {
2118
2118
  return e[e.disabled = 0] = "disabled", e[e.renderingMaskAdd = 1] = "renderingMaskAdd", e[e.maskActive = 2] = "maskActive", e[e.inverseMaskActive = 3] = "inverseMaskActive", e[e.renderingMaskRemove = 4] = "renderingMaskRemove", e[e.none = 5] = "none", e;
2119
- }({}), pn = /* @__PURE__ */ function(e) {
2119
+ }({}), fn = /* @__PURE__ */ function(e) {
2120
2120
  return e[e.none = 0] = "none", e[e.color = 16384] = "color", e[e.stencil = 1024] = "stencil", e[e.depth = 256] = "depth", e[e.colorDepth = 16640] = "colorDepth", e[e.colorStencil = 17408] = "colorStencil", e[e.depthStencil = 1280] = "depthStencil", e[e.all = 17664] = "all", e;
2121
- }({}), mn = class extends j {
2121
+ }({}), pn = class extends M {
2122
2122
  install(e) {
2123
2123
  super.install(e), e.mask = this;
2124
2124
  }
@@ -2137,16 +2137,16 @@ var M = /* @__PURE__ */ function(e) {
2137
2137
  };
2138
2138
  this.stack.push(n);
2139
2139
  let r = this._renderer.renderTarget.current?.instanceId ?? -1, i = this._maskStackHash[r] ?? 0;
2140
- "x" in t ? this._renderer.scissor.push(t) : "render" in t && (this._renderer.flush(), this._renderer.renderTarget.ensureDepthStencil(), this._renderer.stencil.bind(M.renderingMaskAdd, i), this._renderer.colorMask.bind(0), i++, t.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(M.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
2140
+ "x" in t ? this._renderer.scissor.push(t) : "render" in t && (this._renderer.flush(), this._renderer.renderTarget.ensureDepthStencil(), this._renderer.stencil.bind(N.renderingMaskAdd, i), this._renderer.colorMask.bind(0), i++, t.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(N.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
2141
2141
  }
2142
2142
  pop(e) {
2143
2143
  let t = this.stack.pop();
2144
2144
  if (!t || t.source !== e) return;
2145
2145
  let { mask: n } = t, r = this._renderer.renderTarget.current?.instanceId ?? -1, i = this._maskStackHash[r] ?? 0;
2146
- "x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(pn.stencil), this._renderer.stencil.bind(M.disabled, i)) : this._renderer.stencil.bind(M.renderingMaskRemove, i), i--, n.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(M.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
2146
+ "x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(fn.stencil), this._renderer.stencil.bind(N.disabled, i)) : this._renderer.stencil.bind(N.renderingMaskRemove, i), i--, n.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(N.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
2147
2147
  }
2148
- }, hn = [];
2149
- hn[M.none] = {}, hn[M.disabled] = {}, hn[M.renderingMaskAdd] = {
2148
+ }, mn = [];
2149
+ mn[N.none] = {}, mn[N.disabled] = {}, mn[N.renderingMaskAdd] = {
2150
2150
  stencilFront: {
2151
2151
  compare: "equal",
2152
2152
  passOp: "increment-clamp"
@@ -2155,7 +2155,7 @@ hn[M.none] = {}, hn[M.disabled] = {}, hn[M.renderingMaskAdd] = {
2155
2155
  compare: "equal",
2156
2156
  passOp: "increment-clamp"
2157
2157
  }
2158
- }, hn[M.renderingMaskRemove] = {
2158
+ }, mn[N.renderingMaskRemove] = {
2159
2159
  stencilFront: {
2160
2160
  compare: "equal",
2161
2161
  passOp: "decrement-clamp"
@@ -2164,7 +2164,7 @@ hn[M.none] = {}, hn[M.disabled] = {}, hn[M.renderingMaskAdd] = {
2164
2164
  compare: "equal",
2165
2165
  passOp: "decrement-clamp"
2166
2166
  }
2167
- }, hn[M.maskActive] = {
2167
+ }, mn[N.maskActive] = {
2168
2168
  stencilFront: {
2169
2169
  compare: "equal",
2170
2170
  passOp: "keep"
@@ -2173,7 +2173,7 @@ hn[M.none] = {}, hn[M.disabled] = {}, hn[M.renderingMaskAdd] = {
2173
2173
  compare: "equal",
2174
2174
  passOp: "keep"
2175
2175
  }
2176
- }, hn[M.inverseMaskActive] = {
2176
+ }, mn[N.inverseMaskActive] = {
2177
2177
  stencilFront: {
2178
2178
  compare: "not-equal",
2179
2179
  passOp: "keep"
@@ -2183,17 +2183,17 @@ hn[M.none] = {}, hn[M.disabled] = {}, hn[M.renderingMaskAdd] = {
2183
2183
  passOp: "keep"
2184
2184
  }
2185
2185
  };
2186
- var gn = class extends j {
2186
+ var hn = class extends M {
2187
2187
  install(e) {
2188
2188
  super.install(e), e.stencil = this;
2189
2189
  }
2190
2190
  _cache = {
2191
2191
  enabled: !1,
2192
- stencilMode: M.none,
2192
+ stencilMode: N.none,
2193
2193
  refCount: 0
2194
2194
  };
2195
2195
  current = { [-1]: {
2196
- stencilMode: M.disabled,
2196
+ stencilMode: N.disabled,
2197
2197
  refCount: 0
2198
2198
  } };
2199
2199
  _passOpMap;
@@ -2223,20 +2223,20 @@ var gn = class extends j {
2223
2223
  super._setup(), this._renderer.renderTarget.on("updateRenderTarget", this._updateRenderTarget);
2224
2224
  }
2225
2225
  reset() {
2226
- this._cache.enabled = !1, this._cache.stencilMode = M.none, this._cache.refCount = 0;
2226
+ this._cache.enabled = !1, this._cache.stencilMode = N.none, this._cache.refCount = 0;
2227
2227
  }
2228
2228
  _updateRenderTarget = (e) => {
2229
2229
  if (e) {
2230
2230
  let t = this.current[e.instanceId];
2231
2231
  t ||= this.current[e.instanceId] = {
2232
- stencilMode: M.disabled,
2232
+ stencilMode: N.disabled,
2233
2233
  refCount: 0
2234
2234
  }, this.bind(t.stencilMode, t.refCount);
2235
2235
  }
2236
2236
  };
2237
2237
  bind(e, t) {
2238
- let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], r = this._gl, i = hn[e], a = this._cache;
2239
- if (n.stencilMode = e, n.refCount = t, e === M.disabled) {
2238
+ let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], r = this._gl, i = mn[e], a = this._cache;
2239
+ if (n.stencilMode = e, n.refCount = t, e === N.disabled) {
2240
2240
  this._cache.enabled && (this._cache.enabled = !1, r.disable(r.STENCIL_TEST));
2241
2241
  return;
2242
2242
  }
@@ -2245,8 +2245,8 @@ var gn = class extends j {
2245
2245
  destroy() {
2246
2246
  super.destroy(), this._renderer.renderTarget.off("updateRenderTarget", this._updateRenderTarget);
2247
2247
  }
2248
- }, _n = class extends j {
2249
- current = new vt(0, 0, 0, 0);
2248
+ }, gn = class extends M {
2249
+ current = new yt(0, 0, 0, 0);
2250
2250
  install(e) {
2251
2251
  super.install(e), e.viewport = this;
2252
2252
  }
@@ -2254,7 +2254,7 @@ var gn = class extends j {
2254
2254
  let t = this.current, n = Math.floor(e.x), r = Math.floor(e.y), i = Math.floor(e.width), a = Math.floor(e.height);
2255
2255
  t.x === n && t.y === r && t.width === i && t.height === a || (this._gl.viewport(n, r, i, a), t.x = n, t.y = r, t.width = i, t.height = a);
2256
2256
  }
2257
- }, vn = class {
2257
+ }, _n = class {
2258
2258
  framebuffer;
2259
2259
  width = -1;
2260
2260
  height = -1;
@@ -2265,7 +2265,7 @@ var gn = class extends j {
2265
2265
  constructor(e) {
2266
2266
  this.framebuffer = e;
2267
2267
  }
2268
- }, yn = class extends j {
2268
+ }, vn = class extends M {
2269
2269
  install(e) {
2270
2270
  super.install(e), e.renderTarget = this;
2271
2271
  }
@@ -2275,7 +2275,7 @@ var gn = class extends j {
2275
2275
  _msaaSamples = [];
2276
2276
  _hasMRT = !0;
2277
2277
  _writeDepthTexture = !0;
2278
- projection = new Tt();
2278
+ projection = new wt();
2279
2279
  _updateContext(e) {
2280
2280
  if (super._updateContext(e), this._hasMRT = !0, this._writeDepthTexture = !0, this._renderer.version === 1) {
2281
2281
  let t = this._renderer.extensions.drawBuffers, n = this._renderer.extensions.depthTexture;
@@ -2311,7 +2311,7 @@ var gn = class extends j {
2311
2311
  return this.glRenderTargets.get(e.instanceId) || this._createGlRenderTarget(e);
2312
2312
  }
2313
2313
  _createGlRenderTarget(e) {
2314
- let t = this._gl, n = new vn(t.createFramebuffer());
2314
+ let t = this._gl, n = new _n(t.createFramebuffer());
2315
2315
  return this.glRenderTargets.set(e.instanceId, n), this.renderTargets.get(e.instanceId) || (this.renderTargets.set(e.instanceId, e), this._update(e, n), "on" in e && (e.on("updateProperty", (t) => {
2316
2316
  switch (t) {
2317
2317
  case "width":
@@ -2388,28 +2388,28 @@ var gn = class extends j {
2388
2388
  reset() {
2389
2389
  super.reset(), this._renderer.contextLost || this.glRenderTargets.forEach((e) => this.destroyGpuRenderTarget(e)), this.renderTargets.clear(), this.glRenderTargets.clear(), this.current = null, this._msaaSamples.length = 0;
2390
2390
  }
2391
- }, bn = /* @__PURE__ */ function(e) {
2391
+ }, yn = /* @__PURE__ */ function(e) {
2392
2392
  return e[e.RGBA = 6408] = "RGBA", e[e.RGB = 6407] = "RGB", e[e.RG = 33319] = "RG", e[e.RED = 6403] = "RED", e[e.RGBA_INTEGER = 36249] = "RGBA_INTEGER", e[e.RGB_INTEGER = 36248] = "RGB_INTEGER", e[e.RG_INTEGER = 33320] = "RG_INTEGER", e[e.RED_INTEGER = 36244] = "RED_INTEGER", e[e.ALPHA = 6406] = "ALPHA", e[e.LUMINANCE = 6409] = "LUMINANCE", e[e.LUMINANCE_ALPHA = 6410] = "LUMINANCE_ALPHA", e[e.DEPTH_COMPONENT = 6402] = "DEPTH_COMPONENT", e[e.DEPTH_STENCIL = 34041] = "DEPTH_STENCIL", e;
2393
- }({}), xn = /* @__PURE__ */ function(e) {
2393
+ }({}), bn = /* @__PURE__ */ function(e) {
2394
2394
  return e[e.TEXTURE_2D = 3553] = "TEXTURE_2D", e[e.TEXTURE_CUBE_MAP = 34067] = "TEXTURE_CUBE_MAP", e[e.TEXTURE_2D_ARRAY = 35866] = "TEXTURE_2D_ARRAY", e[e.TEXTURE_CUBE_MAP_POSITIVE_X = 34069] = "TEXTURE_CUBE_MAP_POSITIVE_X", e[e.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070] = "TEXTURE_CUBE_MAP_NEGATIVE_X", e[e.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071] = "TEXTURE_CUBE_MAP_POSITIVE_Y", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072] = "TEXTURE_CUBE_MAP_NEGATIVE_Y", e[e.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073] = "TEXTURE_CUBE_MAP_POSITIVE_Z", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074] = "TEXTURE_CUBE_MAP_NEGATIVE_Z", e;
2395
- }({}), N = /* @__PURE__ */ function(e) {
2395
+ }({}), P = /* @__PURE__ */ function(e) {
2396
2396
  return e[e.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE", e[e.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT", e[e.UNSIGNED_SHORT_5_6_5 = 33635] = "UNSIGNED_SHORT_5_6_5", e[e.UNSIGNED_SHORT_4_4_4_4 = 32819] = "UNSIGNED_SHORT_4_4_4_4", e[e.UNSIGNED_SHORT_5_5_5_1 = 32820] = "UNSIGNED_SHORT_5_5_5_1", e[e.UNSIGNED_INT = 5125] = "UNSIGNED_INT", e[e.UNSIGNED_INT_10F_11F_11F_REV = 35899] = "UNSIGNED_INT_10F_11F_11F_REV", e[e.UNSIGNED_INT_2_10_10_10_REV = 33640] = "UNSIGNED_INT_2_10_10_10_REV", e[e.UNSIGNED_INT_24_8 = 34042] = "UNSIGNED_INT_24_8", e[e.UNSIGNED_INT_5_9_9_9_REV = 35902] = "UNSIGNED_INT_5_9_9_9_REV", e[e.BYTE = 5120] = "BYTE", e[e.SHORT = 5122] = "SHORT", e[e.INT = 5124] = "INT", e[e.FLOAT = 5126] = "FLOAT", e[e.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269] = "FLOAT_32_UNSIGNED_INT_24_8_REV", e[e.HALF_FLOAT = 36193] = "HALF_FLOAT", e;
2397
- }({}), Sn = class {
2397
+ }({}), xn = class {
2398
2398
  native;
2399
- target = xn.TEXTURE_2D;
2399
+ target = bn.TEXTURE_2D;
2400
2400
  width = -1;
2401
2401
  height = -1;
2402
2402
  mipmap = !1;
2403
- type = N.UNSIGNED_BYTE;
2404
- internalFormat = bn.RGBA;
2405
- format = bn.RGBA;
2403
+ type = P.UNSIGNED_BYTE;
2404
+ internalFormat = yn.RGBA;
2405
+ format = yn.RGBA;
2406
2406
  constructor(e) {
2407
2407
  this.native = e;
2408
2408
  }
2409
2409
  };
2410
2410
  //#endregion
2411
2411
  //#region src/core/renderers/gl/texture/mapFormatToGlFormat.ts
2412
- function Cn(e) {
2412
+ function Sn(e) {
2413
2413
  return {
2414
2414
  r8unorm: e.RED,
2415
2415
  r8snorm: e.RED,
@@ -2457,7 +2457,7 @@ function Cn(e) {
2457
2457
  }
2458
2458
  //#endregion
2459
2459
  //#region src/core/renderers/gl/texture/mapFormatToGlInternalFormat.ts
2460
- function wn(e, t) {
2460
+ function Cn(e, t) {
2461
2461
  let n = {}, r = e.RGBA;
2462
2462
  return e instanceof WebGLRenderingContext ? t.srgb && (n = {
2463
2463
  "rgba8unorm-srgb": t.srgb.SRGB8_ALPHA8_EXT,
@@ -2573,7 +2573,7 @@ function wn(e, t) {
2573
2573
  }
2574
2574
  //#endregion
2575
2575
  //#region src/core/renderers/gl/texture/mapFormatToGlType.ts
2576
- function Tn(e) {
2576
+ function wn(e) {
2577
2577
  return {
2578
2578
  r8unorm: e.UNSIGNED_BYTE,
2579
2579
  r8snorm: e.BYTE,
@@ -2621,7 +2621,7 @@ function Tn(e) {
2621
2621
  }
2622
2622
  //#endregion
2623
2623
  //#region src/core/renderers/gl/texture/updateTextureStyle.ts
2624
- var En = {
2624
+ var Tn = {
2625
2625
  linear: {
2626
2626
  linear: 9987,
2627
2627
  nearest: 9985
@@ -2630,10 +2630,10 @@ var En = {
2630
2630
  linear: 9986,
2631
2631
  nearest: 9984
2632
2632
  }
2633
- }, Dn = {
2633
+ }, En = {
2634
2634
  linear: 9729,
2635
2635
  nearest: 9728
2636
- }, On = {
2636
+ }, Dn = {
2637
2637
  never: 512,
2638
2638
  less: 513,
2639
2639
  equal: 514,
@@ -2642,32 +2642,32 @@ var En = {
2642
2642
  "not-equal": 517,
2643
2643
  "greater-equal": 518,
2644
2644
  always: 519
2645
- }, kn = {
2645
+ }, On = {
2646
2646
  "clamp-to-edge": 33071,
2647
2647
  repeat: 10497,
2648
2648
  "mirror-repeat": 33648
2649
2649
  };
2650
- function An(e, t, n, r, i, a, o, s) {
2650
+ function kn(e, t, n, r, i, a, o, s) {
2651
2651
  let { addressModeU: c = "repeat", addressModeV: l = "repeat", addressModeW: u = "repeat", magFilter: d = "linear", minFilter: f = "linear", mipmapFilter: p = "linear", maxAnisotropy: m = 0, compare: h } = e, g = a;
2652
2652
  if (!s || c !== "repeat" || l !== "repeat" || u !== "repeat") {
2653
- let e = kn[o ? "clamp-to-edge" : c], n = kn[o ? "clamp-to-edge" : l], r = kn[o ? "clamp-to-edge" : u];
2653
+ let e = On[o ? "clamp-to-edge" : c], n = On[o ? "clamp-to-edge" : l], r = On[o ? "clamp-to-edge" : u];
2654
2654
  t[i](g, t.TEXTURE_WRAP_S, e), t[i](g, t.TEXTURE_WRAP_T, n), t.TEXTURE_WRAP_R && t[i](g, t.TEXTURE_WRAP_R, r);
2655
2655
  }
2656
- if ((!s || d !== "linear") && t[i](g, t.TEXTURE_MAG_FILTER, Dn[d]), n) {
2656
+ if ((!s || d !== "linear") && t[i](g, t.TEXTURE_MAG_FILTER, En[d]), n) {
2657
2657
  if (!s || p !== "linear") {
2658
- let e = En[f][p];
2658
+ let e = Tn[f][p];
2659
2659
  t[i](g, t.TEXTURE_MIN_FILTER, e);
2660
2660
  }
2661
- } else t[i](g, t.TEXTURE_MIN_FILTER, Dn[f]);
2661
+ } else t[i](g, t.TEXTURE_MIN_FILTER, En[f]);
2662
2662
  if (r && m > 1) {
2663
2663
  let e = Math.min(m, t.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));
2664
2664
  t[i](g, r.TEXTURE_MAX_ANISOTROPY_EXT, e);
2665
2665
  }
2666
- h && t[i](g, t.TEXTURE_COMPARE_FUNC, On[h]);
2666
+ h && t[i](g, t.TEXTURE_COMPARE_FUNC, Dn[h]);
2667
2667
  }
2668
2668
  //#endregion
2669
2669
  //#region src/core/renderers/gl/texture/uploaders/index.ts
2670
- var jn = {
2670
+ var An = {
2671
2671
  buffer: {
2672
2672
  id: "buffer",
2673
2673
  upload: (e, t, n) => {
@@ -2681,8 +2681,8 @@ var jn = {
2681
2681
  c < o || l < s ? ((i !== o || a !== s) && n.texImage2D(t.target, 0, t.internalFormat, o, s, 0, t.format, t.type, null), r === 2 ? n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, c, l, t.format, t.type, e.source) : n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, t.format, t.type, e.source)) : i === o && a === s ? n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, t.format, t.type, e.source) : r === 2 ? n.texImage2D(t.target, 0, t.internalFormat, o, s, 0, t.format, t.type, e.source) : n.texImage2D(t.target, 0, t.internalFormat, t.format, t.type, e.source), t.width = o, t.height = s;
2682
2682
  }
2683
2683
  }
2684
- }, Mn = class extends j {
2685
- uploaders = { ...jn };
2684
+ }, jn = class extends M {
2685
+ uploaders = { ...An };
2686
2686
  textures = /* @__PURE__ */ new Map();
2687
2687
  glTextures = /* @__PURE__ */ new Map();
2688
2688
  _mapFormatToInternalFormat = Object.create(null);
@@ -2697,14 +2697,14 @@ var jn = {
2697
2697
  super.install(e), e.texture = this;
2698
2698
  }
2699
2699
  _updateContext(e) {
2700
- super._updateContext(e), Object.keys(this._mapFormatToInternalFormat).length || (this._mapFormatToInternalFormat = wn(e, this._renderer.extensions), this._mapFormatToType = Tn(e), this._mapFormatToFormat = Cn(e)), this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE), this.maxTextureImageUnits = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);
2700
+ super._updateContext(e), Object.keys(this._mapFormatToInternalFormat).length || (this._mapFormatToInternalFormat = Cn(e, this._renderer.extensions), this._mapFormatToType = wn(e), this._mapFormatToFormat = Sn(e)), this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE), this.maxTextureImageUnits = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);
2701
2701
  for (let e = 0; e < this.maxTextureImageUnits; e++) this.unbind(e);
2702
2702
  }
2703
2703
  getGlTexture(e) {
2704
2704
  return this.glTextures.get(e.instanceId) || this._createGlTexture(e);
2705
2705
  }
2706
2706
  _createGlTexture(e) {
2707
- let t = this._gl, n = new Sn(t.createTexture());
2707
+ let t = this._gl, n = new xn(t.createTexture());
2708
2708
  if (t.bindTexture(n.target, n.native), n.type = this._mapFormatToType[e.format], n.internalFormat = this._mapFormatToInternalFormat[e.format], n.format = this._mapFormatToFormat[e.format], this.glTextures.set(e.instanceId, n), e.mipmap && (this._renderer.supports.nonPowOf2mipmaps || e.isPowerOfTwo)) {
2709
2709
  let t = Math.max(e.width, e.height);
2710
2710
  e.mipLevelCount = Math.floor(Math.log2(t)) + 1;
@@ -2764,7 +2764,7 @@ var jn = {
2764
2764
  }
2765
2765
  updateStyle(e, t = !1) {
2766
2766
  let n = this._gl;
2767
- An(e, n, e.mipLevelCount > 1, this._renderer.extensions.anisotropicFiltering, "texParameteri", n.TEXTURE_2D, !this._renderer.supports.nonPowOf2wrapping && !e.isPowerOfTwo, t);
2767
+ kn(e, n, e.mipLevelCount > 1, this._renderer.extensions.anisotropicFiltering, "texParameteri", n.TEXTURE_2D, !this._renderer.supports.nonPowOf2wrapping && !e.isPowerOfTwo, t);
2768
2768
  }
2769
2769
  updateGpuTexture(e) {
2770
2770
  this.bind(e);
@@ -2779,50 +2779,50 @@ var jn = {
2779
2779
  let e = this._gl;
2780
2780
  this._renderer.contextLost || this.glTextures.forEach((t) => e.deleteTexture(t.native)), this.textures.clear(), this.glTextures.clear(), this._location = 0, this.current.length = 0, this._premultiplyAlpha = !1, this._renderer.contextLost || e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this._premultiplyAlpha);
2781
2781
  }
2782
- }, Nn = {
2783
- uint8x2: N.UNSIGNED_BYTE,
2784
- uint8x4: N.UNSIGNED_BYTE,
2785
- sint8x2: N.BYTE,
2786
- sint8x4: N.BYTE,
2787
- unorm8x2: N.UNSIGNED_BYTE,
2788
- unorm8x4: N.UNSIGNED_BYTE,
2789
- snorm8x2: N.BYTE,
2790
- snorm8x4: N.BYTE,
2791
- uint16x2: N.UNSIGNED_SHORT,
2792
- uint16x4: N.UNSIGNED_SHORT,
2793
- sint16x2: N.SHORT,
2794
- sint16x4: N.SHORT,
2795
- unorm16x2: N.UNSIGNED_SHORT,
2796
- unorm16x4: N.UNSIGNED_SHORT,
2797
- snorm16x2: N.SHORT,
2798
- snorm16x4: N.SHORT,
2799
- float16x2: N.HALF_FLOAT,
2800
- float16x4: N.HALF_FLOAT,
2801
- float32: N.FLOAT,
2802
- float32x2: N.FLOAT,
2803
- float32x3: N.FLOAT,
2804
- float32x4: N.FLOAT,
2805
- uint32: N.UNSIGNED_INT,
2806
- uint32x2: N.UNSIGNED_INT,
2807
- uint32x3: N.UNSIGNED_INT,
2808
- uint32x4: N.UNSIGNED_INT,
2809
- sint32: N.INT,
2810
- sint32x2: N.INT,
2811
- sint32x3: N.INT,
2812
- sint32x4: N.INT
2782
+ }, Mn = {
2783
+ uint8x2: P.UNSIGNED_BYTE,
2784
+ uint8x4: P.UNSIGNED_BYTE,
2785
+ sint8x2: P.BYTE,
2786
+ sint8x4: P.BYTE,
2787
+ unorm8x2: P.UNSIGNED_BYTE,
2788
+ unorm8x4: P.UNSIGNED_BYTE,
2789
+ snorm8x2: P.BYTE,
2790
+ snorm8x4: P.BYTE,
2791
+ uint16x2: P.UNSIGNED_SHORT,
2792
+ uint16x4: P.UNSIGNED_SHORT,
2793
+ sint16x2: P.SHORT,
2794
+ sint16x4: P.SHORT,
2795
+ unorm16x2: P.UNSIGNED_SHORT,
2796
+ unorm16x4: P.UNSIGNED_SHORT,
2797
+ snorm16x2: P.SHORT,
2798
+ snorm16x4: P.SHORT,
2799
+ float16x2: P.HALF_FLOAT,
2800
+ float16x4: P.HALF_FLOAT,
2801
+ float32: P.FLOAT,
2802
+ float32x2: P.FLOAT,
2803
+ float32x3: P.FLOAT,
2804
+ float32x4: P.FLOAT,
2805
+ uint32: P.UNSIGNED_INT,
2806
+ uint32x2: P.UNSIGNED_INT,
2807
+ uint32x3: P.UNSIGNED_INT,
2808
+ uint32x4: P.UNSIGNED_INT,
2809
+ sint32: P.INT,
2810
+ sint32x2: P.INT,
2811
+ sint32x3: P.INT,
2812
+ sint32x4: P.INT
2813
2813
  };
2814
- function Pn(e) {
2815
- return Nn[e] ?? Nn.float32;
2814
+ function Nn(e) {
2815
+ return Mn[e] ?? Mn.float32;
2816
2816
  }
2817
2817
  //#endregion
2818
2818
  //#region src/core/renderers/gl/geometry/GlGeometrySystem.ts
2819
- var Fn = {
2819
+ var Pn = {
2820
2820
  "point-list": 0,
2821
2821
  "line-list": 1,
2822
2822
  "line-strip": 3,
2823
2823
  "triangle-list": 4,
2824
2824
  "triangle-strip": 5
2825
- }, In = class extends j {
2825
+ }, Fn = class extends M {
2826
2826
  _geometryVaoHash = {};
2827
2827
  hasInstance = !1;
2828
2828
  current = null;
@@ -2861,11 +2861,11 @@ var Fn = {
2861
2861
  }
2862
2862
  for (let e in r) {
2863
2863
  let t = r[e];
2864
- i[t.buffer.instanceId] += Yt(t.format).stride;
2864
+ i[t.buffer.instanceId] += Jt(t.format).stride;
2865
2865
  }
2866
2866
  for (let e in r) {
2867
2867
  let t = r[e];
2868
- t.stride ??= i[t.buffer.instanceId], t.start ??= a[t.buffer.instanceId], a[t.buffer.instanceId] += Yt(t.format).stride;
2868
+ t.stride ??= i[t.buffer.instanceId], t.start ??= a[t.buffer.instanceId], a[t.buffer.instanceId] += Jt(t.format).stride;
2869
2869
  }
2870
2870
  }
2871
2871
  _createVao(e, t) {
@@ -2900,7 +2900,7 @@ var Fn = {
2900
2900
  a !== c && (r.bind(s), a = c);
2901
2901
  let e = l.location;
2902
2902
  n.enableVertexAttribArray(e);
2903
- let t = Yt(o.format), i = Pn(o.format);
2903
+ let t = Jt(o.format), i = Nn(o.format);
2904
2904
  if (l.format?.substring(1, 4) === "int" ? n.vertexAttribIPointer(e, t.size, i, o.stride ?? 0, o.start ?? 0) : n.vertexAttribPointer(e, t.size, i, t.normalized, o.stride ?? 0, o.start ?? 0), o.instance) if (this.hasInstance) {
2905
2905
  let t = o.divisor ?? 1;
2906
2906
  n.vertexAttribDivisor(e, t);
@@ -2933,7 +2933,7 @@ var Fn = {
2933
2933
  let { topology: t, size: n, start: r = 0, instanceCount: i } = e, { gl: a } = this._renderer, o = this.current;
2934
2934
  if (!o) return this;
2935
2935
  t = t || o.topology || "triangle-list";
2936
- let s = Fn[t];
2936
+ let s = Pn[t];
2937
2937
  if (i = i || o.instanceCount || 1, o.indexBuffer) {
2938
2938
  n ||= o.indexBuffer.data.length;
2939
2939
  let e = o.indexBuffer.data.BYTES_PER_ELEMENT, t = e === 2 ? a.UNSIGNED_SHORT : a.UNSIGNED_INT;
@@ -2954,7 +2954,7 @@ var Fn = {
2954
2954
  }
2955
2955
  this._geometryVaoHash = {}, this.current = null, this.currentVao = null;
2956
2956
  }
2957
- }, Ln = class extends j {
2957
+ }, In = class extends M {
2958
2958
  install(e) {
2959
2959
  super.install(e), e.colorMask = this;
2960
2960
  }
@@ -2965,19 +2965,19 @@ var Fn = {
2965
2965
  };
2966
2966
  //#endregion
2967
2967
  //#region src/core/renderers/gl/GlScissorSystem.ts
2968
- function Rn(e, t, n) {
2968
+ function Ln(e, t, n) {
2969
2969
  let [r, i, a, o, s, c, l, u, d] = e, f = r * t + o * n + l, p = i * t + s * n + u, m = a * t + c * n + d;
2970
2970
  return {
2971
2971
  x: f / m,
2972
2972
  y: p / m
2973
2973
  };
2974
2974
  }
2975
- function zn(e, t) {
2975
+ function Rn(e, t) {
2976
2976
  let { x: n, y: r, width: i, height: a } = t, o = [
2977
- Rn(e, n, r),
2978
- Rn(e, n + i, r),
2979
- Rn(e, n + i, r + a),
2980
- Rn(e, n, r + a)
2977
+ Ln(e, n, r),
2978
+ Ln(e, n + i, r),
2979
+ Ln(e, n + i, r + a),
2980
+ Ln(e, n, r + a)
2981
2981
  ], s = o.map((e) => e.x), c = o.map((e) => e.y), l = Math.min(...s), u = Math.max(...s), d = Math.min(...c), f = Math.max(...c);
2982
2982
  return {
2983
2983
  x: l,
@@ -2986,7 +2986,7 @@ function zn(e, t) {
2986
2986
  height: f - d
2987
2987
  };
2988
2988
  }
2989
- var Bn = class extends j {
2989
+ var zn = class extends M {
2990
2990
  install(e) {
2991
2991
  super.install(e), e.scissor = this;
2992
2992
  }
@@ -3013,28 +3013,28 @@ var Bn = class extends j {
3013
3013
  bind(e) {
3014
3014
  let t = this._gl;
3015
3015
  if (e) {
3016
- let { pixelRatio: n, viewport: r } = this._renderer, { viewMatrix: i } = this._renderer.shader.uniforms, { x: a, y: o, width: s, height: c } = zn(i, e), l = r.current.height / n - (o + c);
3016
+ let { pixelRatio: n, viewport: r } = this._renderer, { viewMatrix: i } = this._renderer.shader.uniforms, { x: a, y: o, width: s, height: c } = Rn(i, e), l = r.current.height / n - (o + c);
3017
3017
  t.scissor(a * n, l * n, s * n, c * n);
3018
3018
  } else t.disable(t.SCISSOR_TEST);
3019
3019
  }
3020
3020
  destroy() {
3021
3021
  super.destroy(), this._renderer.renderTarget.off("updateRenderTarget", this._updateRenderTarget);
3022
3022
  }
3023
- }, Vn = class extends kt {
3023
+ }, Bn = class extends Ot {
3024
3024
  contextLost = !1;
3025
3025
  _systems = [
3026
- new Mn(),
3027
- new Ft(),
3028
- new nn(),
3026
+ new jn(),
3027
+ new Pt(),
3028
+ new tn(),
3029
+ new Fn(),
3030
+ new vn(),
3031
+ new cn(),
3032
+ new pn(),
3029
3033
  new In(),
3030
- new yn(),
3034
+ new hn(),
3035
+ new zn(),
3031
3036
  new ln(),
3032
- new mn(),
3033
- new Ln(),
3034
- new gn(),
3035
- new Bn(),
3036
- new un(),
3037
- new _n()
3037
+ new gn()
3038
3038
  ];
3039
3039
  bindPoints = /* @__PURE__ */ new Map();
3040
3040
  supports = {
@@ -3128,8 +3128,8 @@ var Bn = class extends j {
3128
3128
  height: this.screen.height * this.pixelRatio
3129
3129
  });
3130
3130
  }
3131
- clear(e = pn.all) {
3132
- typeof e == "boolean" && (e = e ? pn.all : pn.none), e && this.gl.clear(e);
3131
+ clear(e = fn.all) {
3132
+ typeof e == "boolean" && (e = e ? fn.all : fn.none), e && this.gl.clear(e);
3133
3133
  }
3134
3134
  reset() {
3135
3135
  this._systems.forEach((e) => e.reset());
@@ -3146,7 +3146,7 @@ var Bn = class extends j {
3146
3146
  for (let e = 0; e < i; e += a) c.set(s.subarray(e, e + a), o - e);
3147
3147
  return c;
3148
3148
  }
3149
- }, Hn = class {}, Un = class extends Hn {
3149
+ }, Vn = class {}, Hn = class extends Vn {
3150
3150
  install(e) {
3151
3151
  let t = async (e) => {
3152
3152
  let { parseFont: t } = await import("modern-font");
@@ -3160,15 +3160,15 @@ var Bn = class extends j {
3160
3160
  e.register(n, t);
3161
3161
  }), e.font = this, this;
3162
3162
  }
3163
- }, Wn = class extends E {
3163
+ }, Un = class extends vt {
3164
3164
  constructor(e) {
3165
3165
  super(), this.setProperties(e);
3166
3166
  }
3167
3167
  };
3168
- k([_({ fallback: A.index }), O("design:type", A === void 0 ? Object : A)], Wn.prototype, "usage", void 0), k([_({ default: () => new Uint32Array() }), O("design:type", Object)], Wn.prototype, "data", void 0);
3168
+ A([_({ fallback: j.index }), k("design:type", j === void 0 ? Object : j)], Un.prototype, "usage", void 0), A([_({ default: () => new Uint32Array() }), k("design:type", Object)], Un.prototype, "data", void 0);
3169
3169
  //#endregion
3170
3170
  //#region src/scene/resources/geometries/Geometry.ts
3171
- var Gn = class extends E {
3171
+ var Wn = class extends vt {
3172
3172
  constructor(e = {}) {
3173
3173
  super(), this.setProperties(e);
3174
3174
  }
@@ -3176,32 +3176,32 @@ var Gn = class extends E {
3176
3176
  e.flush(), t.activate(e, n), e.geometry.bind(this, t.glProgram), e.geometry.draw(), e.geometry.unbind();
3177
3177
  }
3178
3178
  };
3179
- k([_({ fallback: "triangle-list" }), O("design:type", Object)], Gn.prototype, "topology", void 0), k([_({ default: () => ({}) }), O("design:type", typeof Record > "u" ? Object : Record)], Gn.prototype, "attributes", void 0), k([_({ default: () => new Wn() }), O("design:type", Wn === void 0 ? Object : Wn)], Gn.prototype, "indexBuffer", void 0), k([_({ fallback: 1 }), O("design:type", Number)], Gn.prototype, "instanceCount", void 0);
3179
+ A([_({ fallback: "triangle-list" }), k("design:type", Object)], Wn.prototype, "topology", void 0), A([_({ default: () => ({}) }), k("design:type", typeof Record > "u" ? Object : Record)], Wn.prototype, "attributes", void 0), A([_({ default: () => new Un() }), k("design:type", Un === void 0 ? Object : Un)], Wn.prototype, "indexBuffer", void 0), A([_({ fallback: 1 }), k("design:type", Number)], Wn.prototype, "instanceCount", void 0);
3180
3180
  //#endregion
3181
3181
  //#region src/scene/resources/geometries/VertexBuffer.ts
3182
- var P = class extends E {
3182
+ var F = class extends vt {
3183
3183
  constructor(e) {
3184
3184
  super(), this.setProperties(e);
3185
3185
  }
3186
3186
  };
3187
- k([_({ fallback: A.vertex }), O("design:type", A === void 0 ? Object : A)], P.prototype, "usage", void 0), k([_({ default: () => new Float32Array() }), O("design:type", Object)], P.prototype, "data", void 0);
3187
+ A([_({ fallback: j.vertex }), k("design:type", j === void 0 ? Object : j)], F.prototype, "usage", void 0), A([_({ default: () => new Float32Array() }), k("design:type", Object)], F.prototype, "data", void 0);
3188
3188
  //#endregion
3189
3189
  //#region src/scene/resources/geometries/VertexAttribute.ts
3190
- var F = class extends E {
3190
+ var I = class extends vt {
3191
3191
  constructor(e) {
3192
3192
  super(), this.setProperties(e);
3193
3193
  }
3194
3194
  };
3195
- k([_({ default: () => new P() }), O("design:type", P === void 0 ? Object : P)], F.prototype, "buffer", void 0), k([_({ fallback: "float32" }), O("design:type", Object)], F.prototype, "format", void 0), k([_(), O("design:type", Boolean)], F.prototype, "instance", void 0), k([_(), O("design:type", Number)], F.prototype, "stride", void 0), k([_(), O("design:type", Number)], F.prototype, "offset", void 0), k([_(), O("design:type", Number)], F.prototype, "start", void 0), k([_(), O("design:type", Number)], F.prototype, "divisor", void 0);
3195
+ A([_({ default: () => new F() }), k("design:type", F === void 0 ? Object : F)], I.prototype, "buffer", void 0), A([_({ fallback: "float32" }), k("design:type", Object)], I.prototype, "format", void 0), A([_(), k("design:type", Boolean)], I.prototype, "instance", void 0), A([_(), k("design:type", Number)], I.prototype, "stride", void 0), A([_(), k("design:type", Number)], I.prototype, "offset", void 0), A([_(), k("design:type", Number)], I.prototype, "start", void 0), A([_(), k("design:type", Number)], I.prototype, "divisor", void 0);
3196
3196
  //#endregion
3197
3197
  //#region src/scene/resources/geometries/QuadGeometry.ts
3198
- var Kn = class extends Gn {
3198
+ var Gn = class extends Wn {
3199
3199
  constructor() {
3200
3200
  super({
3201
3201
  topology: "triangle-strip",
3202
- attributes: { position: new F({
3202
+ attributes: { position: new I({
3203
3203
  format: "float32x2",
3204
- buffer: new P({ data: new Float32Array([
3204
+ buffer: new F({ data: new Float32Array([
3205
3205
  0,
3206
3206
  0,
3207
3207
  1,
@@ -3212,7 +3212,7 @@ var Kn = class extends Gn {
3212
3212
  1
3213
3213
  ]) })
3214
3214
  }) },
3215
- indexBuffer: new Wn({ data: new Uint32Array([
3215
+ indexBuffer: new Un({ data: new Uint32Array([
3216
3216
  0,
3217
3217
  1,
3218
3218
  3,
@@ -3223,7 +3223,7 @@ var Kn = class extends Gn {
3223
3223
  };
3224
3224
  //#endregion
3225
3225
  //#region src/scene/resources/materials/Material.ts
3226
- function qn() {
3226
+ function Kn() {
3227
3227
  return {
3228
3228
  projectionMatrix: new Float32Array([
3229
3229
  1,
@@ -3255,13 +3255,13 @@ function qn() {
3255
3255
  ])
3256
3256
  };
3257
3257
  }
3258
- var I = class extends E {
3258
+ var L = class extends vt {
3259
3259
  static instance = new this();
3260
3260
  glProgram;
3261
3261
  constructor(e = {}) {
3262
3262
  super();
3263
3263
  let { uniforms: t, gl: n } = e;
3264
- t && (this.uniforms = t), this.glProgram = new qt({
3264
+ t && (this.uniforms = t), this.glProgram = new Kt({
3265
3265
  vertex: "in vec2 position;\nuniform mat3 projectionMatrix;\nuniform mat3 modelViewMatrix;\nvoid main(void) {\n gl_Position = vec4((projectionMatrix * modelViewMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}",
3266
3266
  fragment: "uniform vec4 tint;\nvoid main(void) {\n gl_FragColor = tint;\n}",
3267
3267
  ...n
@@ -3274,13 +3274,13 @@ var I = class extends E {
3274
3274
  }, e.shader.updateUniforms(this);
3275
3275
  }
3276
3276
  };
3277
- k([_({ default: qn }), O("design:type", typeof Record > "u" ? Object : Record)], I.prototype, "uniforms", void 0);
3277
+ A([_({ default: Kn }), k("design:type", typeof Record > "u" ? Object : Record)], L.prototype, "uniforms", void 0);
3278
3278
  //#endregion
3279
3279
  //#region src/scene/resources/materials/EffectMaterial.ts
3280
- var Jn = /^uniform \w+ (.+?);\s*\/\/\s*=\s*([^;]+?)[\s;]*$/gm, Yn = /vec(\d)\((.*)\)/;
3281
- function Xn(e) {
3280
+ var qn = /^uniform \w+ (.+?);\s*\/\/\s*=\s*([^;]+?)[\s;]*$/gm, Jn = /vec(\d)\((.*)\)/;
3281
+ function Yn(e) {
3282
3282
  e = e.trim();
3283
- let t = e.match(Yn);
3283
+ let t = e.match(Jn);
3284
3284
  if (t) {
3285
3285
  let e = Array.from({ length: Number(t[1]) }, () => 0);
3286
3286
  return t[2].split(",").forEach((t, n) => {
@@ -3289,7 +3289,7 @@ function Xn(e) {
3289
3289
  }
3290
3290
  return Number(e);
3291
3291
  }
3292
- var Zn = class e extends I {
3292
+ var Xn = class e extends L {
3293
3293
  static RE = {
3294
3294
  getColor: /\sgetColor\s*\(/,
3295
3295
  getFromColor: /\sgetFromColor\s*\(/,
@@ -3325,12 +3325,12 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3325
3325
  progress: 0
3326
3326
  }
3327
3327
  }), this.has = n;
3328
- let r = t.matchAll(Jn);
3328
+ let r = t.matchAll(qn);
3329
3329
  for (let e of r) e[1] && e[2] && e[1].split(",").forEach((t) => {
3330
- this.uniforms[t.trim()] = Xn(e[2]);
3330
+ this.uniforms[t.trim()] = Yn(e[2]);
3331
3331
  });
3332
3332
  }
3333
- }, Qn = class extends I {
3333
+ }, Zn = class extends L {
3334
3334
  static _instance;
3335
3335
  static get instance() {
3336
3336
  return this._instance ??= new this();
@@ -3374,20 +3374,20 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3374
3374
  }
3375
3375
  });
3376
3376
  }
3377
- }, L = class extends Gn {
3377
+ }, R = class extends Wn {
3378
3378
  static _instance;
3379
3379
  static get instance() {
3380
3380
  return this._instance ??= new this();
3381
3381
  }
3382
- static draw(e, t = Qn.instance, n) {
3382
+ static draw(e, t = Zn.instance, n) {
3383
3383
  this.instance.draw(e, t, n);
3384
3384
  }
3385
3385
  constructor() {
3386
3386
  super({
3387
3387
  attributes: {
3388
- position: new F({
3388
+ position: new I({
3389
3389
  format: "float32x2",
3390
- buffer: new P({ data: new Float32Array([
3390
+ buffer: new F({ data: new Float32Array([
3391
3391
  -1,
3392
3392
  -1,
3393
3393
  1,
@@ -3398,9 +3398,9 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3398
3398
  1
3399
3399
  ]) })
3400
3400
  }),
3401
- uv: new F({
3401
+ uv: new I({
3402
3402
  format: "float32x2",
3403
- buffer: new P({ data: new Float32Array([
3403
+ buffer: new F({ data: new Float32Array([
3404
3404
  0,
3405
3405
  0,
3406
3406
  1,
@@ -3412,7 +3412,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3412
3412
  ]) })
3413
3413
  })
3414
3414
  },
3415
- indexBuffer: new Wn({ data: new Uint32Array([
3415
+ indexBuffer: new Un({ data: new Uint32Array([
3416
3416
  0,
3417
3417
  1,
3418
3418
  2,
@@ -3422,27 +3422,27 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3422
3422
  ]) })
3423
3423
  });
3424
3424
  }
3425
- }, $n = class extends Gn {
3425
+ }, Qn = class extends Wn {
3426
3426
  positionBuffer;
3427
3427
  uvBuffer;
3428
3428
  constructor(e) {
3429
- let t = new P({ data: new Float32Array() }), n = new P({ data: new Float32Array() });
3429
+ let t = new F({ data: new Float32Array() }), n = new F({ data: new Float32Array() });
3430
3430
  super({
3431
3431
  ...e,
3432
3432
  attributes: {
3433
- position: new F({
3433
+ position: new I({
3434
3434
  format: "float32x2",
3435
3435
  buffer: t
3436
3436
  }),
3437
- uv: new F({
3437
+ uv: new I({
3438
3438
  format: "float32x2",
3439
3439
  buffer: n
3440
3440
  })
3441
3441
  },
3442
- indexBuffer: new Wn({ data: new Uint32Array() })
3442
+ indexBuffer: new Un({ data: new Uint32Array() })
3443
3443
  }), this.positionBuffer = t, this.uvBuffer = n;
3444
3444
  }
3445
- }, R = class extends E {
3445
+ }, z = class extends vt {
3446
3446
  get valid() {
3447
3447
  return !!(this.width && this.height);
3448
3448
  }
@@ -3456,10 +3456,10 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3456
3456
  super._destroy(), this.colorTextures.forEach((e) => e.destroy());
3457
3457
  }
3458
3458
  };
3459
- k([_({ fallback: !1 }), O("design:type", Boolean)], R.prototype, "isRoot", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "x", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "y", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "height", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "mipLevel", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], R.prototype, "msaa", void 0), k([_({ default: () => [new z()] }), O("design:type", Array)], R.prototype, "colorTextures", void 0);
3459
+ A([_({ fallback: !1 }), k("design:type", Boolean)], z.prototype, "isRoot", void 0), A([_({ fallback: 0 }), k("design:type", Number)], z.prototype, "x", void 0), A([_({ fallback: 0 }), k("design:type", Number)], z.prototype, "y", void 0), A([_({ fallback: 0 }), k("design:type", Number)], z.prototype, "width", void 0), A([_({ fallback: 0 }), k("design:type", Number)], z.prototype, "height", void 0), A([_({ fallback: 0 }), k("design:type", Number)], z.prototype, "mipLevel", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], z.prototype, "msaa", void 0), A([_({ default: () => [new B()] }), k("design:type", Array)], z.prototype, "colorTextures", void 0);
3460
3460
  //#endregion
3461
3461
  //#region src/scene/resources/textures/Texture2D.ts
3462
- var z = class extends E {
3462
+ var B = class extends vt {
3463
3463
  static get EMPTY() {
3464
3464
  return new this({
3465
3465
  width: 1,
@@ -3570,10 +3570,10 @@ var z = class extends E {
3570
3570
  super._destroy(), Ne && this.source instanceof ImageBitmap && this.source.close();
3571
3571
  }
3572
3572
  };
3573
- k([_({ fallback: "unknown" }), O("design:type", String)], z.prototype, "uploadMethodId", void 0), k([_({ internal: !0 }), O("design:type", Object)], z.prototype, "source", void 0), k([_({ fallback: 0 }), O("design:type", Number)], z.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], z.prototype, "height", void 0), k([_({ fallback: 1 }), O("design:type", Number)], z.prototype, "pixelRatio", void 0), k([_({ fallback: "bgra8unorm" }), O("design:type", Object)], z.prototype, "format", void 0), k([_({ fallback: "premultiply-alpha-on-upload" }), O("design:type", Object)], z.prototype, "alphaMode", void 0), k([_({ fallback: 1 }), O("design:type", Number)], z.prototype, "mipLevelCount", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], z.prototype, "mipmap", void 0), k([_({ fallback: "clamp-to-edge" }), O("design:type", Object)], z.prototype, "addressModeU", void 0), k([_({ fallback: "clamp-to-edge" }), O("design:type", Object)], z.prototype, "addressModeV", void 0), k([_({ fallback: "clamp-to-edge" }), O("design:type", Object)], z.prototype, "addressModeW", void 0), k([_({ fallback: "linear" }), O("design:type", Object)], z.prototype, "magFilter", void 0), k([_({ fallback: "linear" }), O("design:type", Object)], z.prototype, "minFilter", void 0), k([_({ fallback: "linear" }), O("design:type", Object)], z.prototype, "mipmapFilter", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], z.prototype, "isPowerOfTwo", void 0);
3573
+ A([_({ fallback: "unknown" }), k("design:type", String)], B.prototype, "uploadMethodId", void 0), A([_({ internal: !0 }), k("design:type", Object)], B.prototype, "source", void 0), A([_({ fallback: 0 }), k("design:type", Number)], B.prototype, "width", void 0), A([_({ fallback: 0 }), k("design:type", Number)], B.prototype, "height", void 0), A([_({ fallback: 1 }), k("design:type", Number)], B.prototype, "pixelRatio", void 0), A([_({ fallback: "bgra8unorm" }), k("design:type", Object)], B.prototype, "format", void 0), A([_({ fallback: "premultiply-alpha-on-upload" }), k("design:type", Object)], B.prototype, "alphaMode", void 0), A([_({ fallback: 1 }), k("design:type", Number)], B.prototype, "mipLevelCount", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], B.prototype, "mipmap", void 0), A([_({ fallback: "clamp-to-edge" }), k("design:type", Object)], B.prototype, "addressModeU", void 0), A([_({ fallback: "clamp-to-edge" }), k("design:type", Object)], B.prototype, "addressModeV", void 0), A([_({ fallback: "clamp-to-edge" }), k("design:type", Object)], B.prototype, "addressModeW", void 0), A([_({ fallback: "linear" }), k("design:type", Object)], B.prototype, "magFilter", void 0), A([_({ fallback: "linear" }), k("design:type", Object)], B.prototype, "minFilter", void 0), A([_({ fallback: "linear" }), k("design:type", Object)], B.prototype, "mipmapFilter", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], B.prototype, "isPowerOfTwo", void 0);
3574
3574
  //#endregion
3575
3575
  //#region src/scene/resources/textures/AnimatedTexture.ts
3576
- var er = class extends E {
3576
+ var $n = class extends vt {
3577
3577
  frames;
3578
3578
  frameIndex = 0;
3579
3579
  get currentFrame() {
@@ -3583,7 +3583,7 @@ var er = class extends E {
3583
3583
  super();
3584
3584
  let t;
3585
3585
  if (Array.isArray(e)) t = e;
3586
- else if (e instanceof z) t = [{
3586
+ else if (e instanceof B) t = [{
3587
3587
  texture: e,
3588
3588
  duration: 0
3589
3589
  }];
@@ -3598,7 +3598,7 @@ var er = class extends E {
3598
3598
  e.texture.destroy();
3599
3599
  });
3600
3600
  }
3601
- }, tr = class extends z {
3601
+ }, er = class extends B {
3602
3602
  constructor(e = {}) {
3603
3603
  super({
3604
3604
  pixelRatio: 2,
@@ -3618,14 +3618,14 @@ var er = class extends E {
3618
3618
  }
3619
3619
  super._updateProperty(e, t, n);
3620
3620
  }
3621
- }, nr = class e extends z {
3621
+ }, tr = class e extends B {
3622
3622
  static _cached = /* @__PURE__ */ new Map();
3623
3623
  static get(t) {
3624
- let n = new yt(t), r = n.toHex(), i = this._cached.get(r);
3624
+ let n = new E(t), r = n.toHex(), i = this._cached.get(r);
3625
3625
  return i || (i = new e(n), this._cached.set(r, i)), i;
3626
3626
  }
3627
3627
  constructor(e) {
3628
- let t = e instanceof yt ? e : new yt(e);
3628
+ let t = e instanceof E ? e : new E(e);
3629
3629
  super({
3630
3630
  width: 1,
3631
3631
  height: 1,
@@ -3639,7 +3639,7 @@ var er = class extends E {
3639
3639
  mipmap: !0
3640
3640
  });
3641
3641
  }
3642
- }, rr = class e extends z {
3642
+ }, nr = class e extends B {
3643
3643
  static test(e) {
3644
3644
  return u(e);
3645
3645
  }
@@ -3673,7 +3673,7 @@ var er = class extends E {
3673
3673
  constructor(t, n, r) {
3674
3674
  super(e.linearGradient(t, n, r));
3675
3675
  }
3676
- }, ir = class extends z {
3676
+ }, rr = class extends B {
3677
3677
  constructor(e = {}) {
3678
3678
  super({
3679
3679
  ...e,
@@ -3683,7 +3683,7 @@ var er = class extends E {
3683
3683
  };
3684
3684
  //#endregion
3685
3685
  //#region src/scene/resources/textures/VideoTexture.ts
3686
- function ar(e) {
3686
+ function ir(e) {
3687
3687
  return {
3688
3688
  autoLoad: !!(e?.autoLoad ?? !0),
3689
3689
  autoPlay: !!(e?.autoPlay ?? !1),
@@ -3694,7 +3694,7 @@ function ar(e) {
3694
3694
  playsinline: !!(e?.playsinline ?? !0)
3695
3695
  };
3696
3696
  }
3697
- var or = class e extends z {
3697
+ var ar = class e extends B {
3698
3698
  static mimeTypes = new Map(Object.entries({
3699
3699
  ogv: "video/ogg",
3700
3700
  mov: "video/quicktime",
@@ -3718,6 +3718,34 @@ var or = class e extends z {
3718
3718
  set currentTime(e) {
3719
3719
  this.source.currentTime = e;
3720
3720
  }
3721
+ get paused() {
3722
+ return this.source.paused;
3723
+ }
3724
+ get muted() {
3725
+ return this.source.muted;
3726
+ }
3727
+ set muted(e) {
3728
+ this.source.muted !== e && (this.source.muted = e);
3729
+ }
3730
+ get loop() {
3731
+ return this.source.loop;
3732
+ }
3733
+ set loop(e) {
3734
+ this.source.loop !== e && (this.source.loop = e);
3735
+ }
3736
+ get playbackRate() {
3737
+ return this.source.playbackRate;
3738
+ }
3739
+ set playbackRate(e) {
3740
+ this.source.playbackRate !== e && (this.source.playbackRate = e);
3741
+ }
3742
+ play() {
3743
+ let e = this.source.play();
3744
+ e && typeof e.catch == "function" && e.catch(() => {});
3745
+ }
3746
+ pause() {
3747
+ this.source.pause();
3748
+ }
3721
3749
  _spf = 0;
3722
3750
  _autoPlay = !1;
3723
3751
  _sourceLoad;
@@ -3728,7 +3756,7 @@ var or = class e extends z {
3728
3756
  _reject;
3729
3757
  _seekResolves = [];
3730
3758
  constructor(t, n) {
3731
- let r = ar(n);
3759
+ let r = ir(n);
3732
3760
  if (!Xe(t)) {
3733
3761
  typeof t == "string" && (t = [t]);
3734
3762
  let n = t[0].src || t[0];
@@ -3821,16 +3849,16 @@ var or = class e extends z {
3821
3849
  e && (e.removeEventListener("play", this._onPlayStart), e.removeEventListener("pause", this._onPlayStop), e.removeEventListener("seeked", this._onSeeked), e.removeEventListener("canplay", this._onCanPlay), e.removeEventListener("canplaythrough", this._onCanPlay), e.removeEventListener("error", this._onError, !0), e.pause(), e.src = "", e.load());
3822
3850
  }
3823
3851
  };
3824
- k([_({
3852
+ A([_({
3825
3853
  internal: !0,
3826
3854
  fallback: !0
3827
- }), O("design:type", Boolean)], or.prototype, "autoUpdate", void 0), k([_({
3855
+ }), k("design:type", Boolean)], ar.prototype, "autoUpdate", void 0), A([_({
3828
3856
  internal: !0,
3829
3857
  fallback: 0
3830
- }), O("design:type", Number)], or.prototype, "fps", void 0);
3858
+ }), k("design:type", Number)], ar.prototype, "fps", void 0);
3831
3859
  //#endregion
3832
3860
  //#region src/scene/resources/textures/ViewportTexture.ts
3833
- var sr = class extends z {}, cr = class extends v {
3861
+ var or = class extends B {}, sr = class extends v {
3834
3862
  fillStyle;
3835
3863
  fillRule;
3836
3864
  strokeStyle;
@@ -3844,7 +3872,7 @@ var sr = class extends z {}, cr = class extends v {
3844
3872
  _draws = [];
3845
3873
  _triCache = [];
3846
3874
  _parseDrawStyle(e) {
3847
- return e ? e instanceof z ? { texture: e } : { texture: nr.get(e) } : {};
3875
+ return e ? e instanceof B ? { texture: e } : { texture: tr.get(e) } : {};
3848
3876
  }
3849
3877
  stroke(e) {
3850
3878
  if (!this.curves.length) return;
@@ -3961,7 +3989,7 @@ var sr = class extends z {}, cr = class extends v {
3961
3989
  destroy() {
3962
3990
  this.reset(), this._triCache.length = 0;
3963
3991
  }
3964
- }, lr = class {
3992
+ }, cr = class {
3965
3993
  front = [];
3966
3994
  default = [];
3967
3995
  back = [];
@@ -4004,7 +4032,7 @@ var sr = class extends z {}, cr = class extends v {
4004
4032
  toJSON() {
4005
4033
  return [...this.default];
4006
4034
  }
4007
- }, ur = class extends T {
4035
+ }, lr = class extends T {
4008
4036
  parent;
4009
4037
  getPropertyDeclarations() {
4010
4038
  super.getPropertyDeclarations();
@@ -4023,22 +4051,22 @@ var sr = class extends z {}, cr = class extends v {
4023
4051
  deleteProperty: (e, t) => Reflect.has(e, t) || String(t).startsWith("_") ? Reflect.deleteProperty(e, t) : (e.setProperty(String(t), void 0), !0)
4024
4052
  });
4025
4053
  }
4026
- }, dr, fr = {};
4027
- function pr(e) {
4028
- let t = fr[e] ?? 0;
4029
- return t++, fr[e] = t, t;
4054
+ }, ur, dr = {};
4055
+ function fr(e) {
4056
+ let t = dr[e] ?? 0;
4057
+ return t++, dr[e] = t, t;
4030
4058
  }
4031
- var B = dr = class extends T {
4059
+ var V = ur = class extends T {
4032
4060
  static parse(e, t = "Node") {
4033
4061
  if (Array.isArray(e)) return e.map((e) => this.parse(e));
4034
- let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((ve.get(n ?? r.inCanvasIs ?? t)) ?? dr)({
4062
+ let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((ve.get(n ?? r.inCanvasIs ?? t)) ?? ur)({
4035
4063
  ...a,
4036
4064
  meta: r
4037
4065
  });
4038
4066
  return i?.forEach((e) => o.appendChild(this.parse(e))), o;
4039
4067
  }
4040
4068
  _mask;
4041
- _meta = new ur(this);
4069
+ _meta = new lr(this);
4042
4070
  get meta() {
4043
4071
  return this._meta;
4044
4072
  }
@@ -4061,7 +4089,7 @@ var B = dr = class extends T {
4061
4089
  }).append(t), 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), this.updateProcessable(), this.updateRenderable();
4062
4090
  }
4063
4091
  _defaultName() {
4064
- return `@${this.is}@${pr(this.is)}`;
4092
+ return `@${this.is}@${fr(this.is)}`;
4065
4093
  }
4066
4094
  setProperties(e) {
4067
4095
  if (e) {
@@ -4128,7 +4156,7 @@ var B = dr = class extends T {
4128
4156
  }
4129
4157
  return this;
4130
4158
  }
4131
- _children = new lr();
4159
+ _children = new cr();
4132
4160
  get children() {
4133
4161
  return this._children.default;
4134
4162
  }
@@ -4288,7 +4316,7 @@ var B = dr = class extends T {
4288
4316
  append(...e) {
4289
4317
  let t;
4290
4318
  t = Array.isArray(e[0]) ? e[0] : e, t.forEach((e) => {
4291
- e instanceof dr ? this.appendChild(e) : this.appendChild(dr.parse(e));
4319
+ e instanceof ur ? this.appendChild(e) : this.appendChild(ur.parse(e));
4292
4320
  });
4293
4321
  }
4294
4322
  before(...e) {
@@ -4391,13 +4419,13 @@ var B = dr = class extends T {
4391
4419
  });
4392
4420
  }
4393
4421
  };
4394
- k([_({ default: () => c() }), O("design:type", String)], B.prototype, "id", void 0), k([_({ default: () => c() }), O("design:type", String)], B.prototype, "name", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], B.prototype, "processMode", void 0), k([_({ fallback: "default" }), O("design:type", Object)], B.prototype, "processSortMode", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], B.prototype, "renderMode", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], B.prototype, "inputMode", void 0), k([_({ fallback: "default" }), O("design:type", Object)], B.prototype, "internalMode", void 0), k([_({
4422
+ A([_({ default: () => c() }), k("design:type", String)], V.prototype, "id", void 0), A([_({ default: () => c() }), k("design:type", String)], V.prototype, "name", void 0), A([_({ fallback: "inherit" }), k("design:type", Object)], V.prototype, "processMode", void 0), A([_({ fallback: "default" }), k("design:type", Object)], V.prototype, "processSortMode", void 0), A([_({ fallback: "inherit" }), k("design:type", Object)], V.prototype, "renderMode", void 0), A([_({ fallback: "inherit" }), k("design:type", Object)], V.prototype, "inputMode", void 0), A([_({ fallback: "default" }), k("design:type", Object)], V.prototype, "internalMode", void 0), A([_({
4395
4423
  internal: !0,
4396
4424
  default: !0
4397
- }), O("design:type", Boolean)], B.prototype, "needsRender", void 0), B = dr = k([S("Node"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], B);
4425
+ }), k("design:type", Boolean)], V.prototype, "needsRender", void 0), V = ur = A([S("Node"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], V);
4398
4426
  //#endregion
4399
4427
  //#region src/scene/main/TimelineNode.ts
4400
- var V = class extends B {
4428
+ var H = class extends V {
4401
4429
  insideTimeRange = !1;
4402
4430
  get _timeline() {
4403
4431
  return this._tree?.timeline;
@@ -4433,7 +4461,7 @@ var V = class extends B {
4433
4461
  return this._globalStartTime + this._globalDuration;
4434
4462
  }
4435
4463
  get currentTimeProgress() {
4436
- return this._duration ? St(this._currentTime / this._duration, 0, 1) : 0;
4464
+ return this._duration ? D(this._currentTime / this._duration, 0, 1) : 0;
4437
4465
  }
4438
4466
  isInsideTimeRange() {
4439
4467
  let e = this._currentTime;
@@ -4479,18 +4507,18 @@ var V = class extends B {
4479
4507
  super._process(e), this._updateCurrentTime();
4480
4508
  }
4481
4509
  };
4482
- k([_({ fallback: !1 }), O("design:type", Boolean)], V.prototype, "loop", void 0), k([_({ fallback: 0 }), O("design:type", Number)], V.prototype, "delay", void 0), k([_({ fallback: 0 }), O("design:type", Number)], V.prototype, "duration", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], V.prototype, "paused", void 0), V = k([S("TimelineNode"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], V);
4510
+ A([_({ fallback: !1 }), k("design:type", Boolean)], H.prototype, "loop", void 0), A([_({ fallback: 0 }), k("design:type", Number)], H.prototype, "delay", void 0), A([_({ fallback: 0 }), k("design:type", Number)], H.prototype, "duration", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], H.prototype, "paused", void 0), H = A([S("TimelineNode"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], H);
4483
4511
  //#endregion
4484
4512
  //#region src/scene/main/CanvasItem.ts
4485
- var mr = [], hr = 0;
4486
- function gr() {
4487
- hr = 0;
4513
+ var pr = [], mr = 0;
4514
+ function hr() {
4515
+ mr = 0;
4488
4516
  }
4489
- function _r(e, t, n, r) {
4490
- let i = mr[hr];
4491
- return i || (i = {}, mr[hr] = i), hr++, Object.assign(i, e), i.roundPixels = t, i.size = n, i.texture = r, i;
4517
+ function gr(e, t, n, r) {
4518
+ let i = pr[mr];
4519
+ return i || (i = {}, pr[mr] = i), mr++, Object.assign(i, e), i.roundPixels = t, i.size = n, i.texture = r, i;
4492
4520
  }
4493
- var vr = class extends V {
4521
+ var _r = class extends H {
4494
4522
  _blendMode;
4495
4523
  _parentGlobalVisible;
4496
4524
  _globalVisible;
@@ -4508,7 +4536,7 @@ var vr = class extends V {
4508
4536
  255,
4509
4537
  255
4510
4538
  ];
4511
- context = new cr();
4539
+ context = new sr();
4512
4540
  _resetContext = !0;
4513
4541
  needsDraw = !0;
4514
4542
  needsLayout = !1;
@@ -4570,7 +4598,7 @@ var vr = class extends V {
4570
4598
  }
4571
4599
  _updateGlobalOpacity() {
4572
4600
  this._parentGlobalOpacity = this.getParent()?.opacity;
4573
- let e = St(this.opacity, 0, 1) * (this._parentGlobalOpacity ?? 1);
4601
+ let e = D(this.opacity, 0, 1) * (this._parentGlobalOpacity ?? 1);
4574
4602
  this._globalOpacity !== e && (this._globalOpacity = e, this._updateModulate(), this.requestPaint(), this.updateRenderable());
4575
4603
  }
4576
4604
  _draw() {
@@ -4639,7 +4667,7 @@ var vr = class extends V {
4639
4667
  return;
4640
4668
  }
4641
4669
  let t = this._tree?.pixelate, n = this._tree?.roundPixels, r = this._batchables;
4642
- for (let i, a, o = r.length, s = 0; s < o; s++) i = r[s], a = i.texture, a instanceof sr && (a = this._handleViewportTexture(i)), e.batch2D.render(_r(i, n, t ? i.size : void 0, a));
4670
+ for (let i, a, o = r.length, s = 0; s < o; s++) i = r[s], a = i.texture, a instanceof or && (a = this._handleViewportTexture(i)), e.batch2D.render(gr(i, n, t ? i.size : void 0, a));
4643
4671
  super._render(e);
4644
4672
  }
4645
4673
  _cullsRender() {
@@ -4649,19 +4677,19 @@ var vr = class extends V {
4649
4677
  super._destroy(), this.context.destroy(), this._drawBatchables = [], this._layoutBatchables = [], this._batchables = [];
4650
4678
  }
4651
4679
  };
4652
- k([_(), O("design:type", Object)], vr.prototype, "blendMode", void 0), k([_({
4680
+ A([_(), k("design:type", Object)], _r.prototype, "blendMode", void 0), A([_({
4653
4681
  internal: !0,
4654
4682
  fallback: !0
4655
- }), O("design:type", Boolean)], vr.prototype, "visible", void 0), k([_({
4683
+ }), k("design:type", Boolean)], _r.prototype, "visible", void 0), A([_({
4656
4684
  internal: !0,
4657
4685
  fallback: 1
4658
- }), O("design:type", Number)], vr.prototype, "opacity", void 0), vr = k([S("CanvasItem"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], vr);
4686
+ }), k("design:type", Number)], _r.prototype, "opacity", void 0), _r = A([S("CanvasItem"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], _r);
4659
4687
  //#endregion
4660
4688
  //#region src/scene/main/Viewport.ts
4661
- var H = class extends B {
4689
+ var U = class extends V {
4662
4690
  canvasTransform = new b();
4663
4691
  renderTargetIndex = 0;
4664
- renderTargets = [new R(), new R()];
4692
+ renderTargets = [new z(), new z()];
4665
4693
  get valid() {
4666
4694
  return !!(this.width && this.height);
4667
4695
  }
@@ -4708,7 +4736,7 @@ var H = class extends B {
4708
4736
  return !1;
4709
4737
  }
4710
4738
  activateWithCopy(e, t) {
4711
- this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0), L.draw(e, Qn.instance, { sampler: 0 }));
4739
+ this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0), R.draw(e, Zn.instance, { sampler: 0 }));
4712
4740
  }
4713
4741
  renderStart(e, t) {
4714
4742
  this.activate(e, t) && e.clear();
@@ -4721,7 +4749,7 @@ var H = class extends B {
4721
4749
  this.renderStart(e), super.render(e, t), this.renderEnd(e, n);
4722
4750
  }
4723
4751
  getRect() {
4724
- return new vt(this.x, this.y, this.width, this.height);
4752
+ return new yt(this.x, this.y, this.width, this.height);
4725
4753
  }
4726
4754
  toCanvasGlobal(e, t) {
4727
4755
  return this.canvasTransform.applyAffineInverse(e, t);
@@ -4733,16 +4761,16 @@ var H = class extends B {
4733
4761
  super._destroy(), this.canvasTransform.destroy(), this.renderTargets.forEach((e) => e.destroy());
4734
4762
  }
4735
4763
  };
4736
- k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "x", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "y", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "height", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "mipLevel", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], H.prototype, "msaa", void 0), H = k([S("Viewport")], H);
4764
+ A([_({ fallback: 0 }), k("design:type", Number)], U.prototype, "x", void 0), A([_({ fallback: 0 }), k("design:type", Number)], U.prototype, "y", void 0), A([_({ fallback: 0 }), k("design:type", Number)], U.prototype, "width", void 0), A([_({ fallback: 0 }), k("design:type", Number)], U.prototype, "height", void 0), A([_({ fallback: 0 }), k("design:type", Number)], U.prototype, "mipLevel", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], U.prototype, "msaa", void 0), U = A([S("Viewport")], U);
4737
4765
  //#endregion
4738
4766
  //#region src/scene/main/Effect.ts
4739
- var U = class extends V {
4767
+ var W = class extends H {
4740
4768
  material;
4741
4769
  get _effectMode() {
4742
4770
  return this.effectMode ?? "parent";
4743
4771
  }
4744
- viewport1 = new H();
4745
- viewport2 = new H();
4772
+ viewport1 = new U();
4773
+ viewport2 = new U();
4746
4774
  _renderId = 0;
4747
4775
  _renderViewport;
4748
4776
  _previousSibling;
@@ -4759,7 +4787,7 @@ var U = class extends V {
4759
4787
  _updateProperty(e, t, n) {
4760
4788
  switch (super._updateProperty(e, t, n), e) {
4761
4789
  case "glsl": {
4762
- let e = new Zn(t);
4790
+ let e = new Xn(t);
4763
4791
  !this.effectMode && e.has.transition && (this.effectMode = "transition"), this.material = e;
4764
4792
  break;
4765
4793
  }
@@ -4794,7 +4822,7 @@ var U = class extends V {
4794
4822
  }
4795
4823
  }
4796
4824
  getRect() {
4797
- return new vt(this._rect);
4825
+ return new yt(this._rect);
4798
4826
  }
4799
4827
  _processParent() {
4800
4828
  let e = this._tree?.renderStack;
@@ -4947,13 +4975,13 @@ var U = class extends V {
4947
4975
  }
4948
4976
  apply(e, t, n) {
4949
4977
  this.material && (n?.redraw ? t.redraw(e, () => {
4950
- L.draw(e, this.material, {
4978
+ R.draw(e, this.material, {
4951
4979
  from: 0,
4952
4980
  to: 1,
4953
4981
  progress: this.currentTimeProgress,
4954
4982
  ratio: t.width / t.height
4955
4983
  });
4956
- }) : L.draw(e, this.material, {
4984
+ }) : R.draw(e, this.material, {
4957
4985
  from: 0,
4958
4986
  to: 1,
4959
4987
  progress: this.currentTimeProgress,
@@ -4964,10 +4992,10 @@ var U = class extends V {
4964
4992
  super._destroy(), this.viewport1.destroy(), this.viewport2.destroy();
4965
4993
  }
4966
4994
  };
4967
- k([_({ internal: !0 }), O("design:type", Object)], U.prototype, "material", void 0), k([_(), O("design:type", Object)], U.prototype, "effectMode", void 0), k([_(), O("design:type", String)], U.prototype, "glsl", void 0), k([_(), O("design:type", String)], U.prototype, "glslSrc", void 0), U = k([S("Effect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], U);
4995
+ A([_({ internal: !0 }), k("design:type", Object)], W.prototype, "material", void 0), A([_(), k("design:type", Object)], W.prototype, "effectMode", void 0), A([_(), k("design:type", String)], W.prototype, "glsl", void 0), A([_(), k("design:type", String)], W.prototype, "glslSrc", void 0), W = A([S("Effect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], W);
4968
4996
  //#endregion
4969
4997
  //#region src/scene/main/RenderStack.ts
4970
- var yr = class {
4998
+ var vr = class {
4971
4999
  currentCall;
4972
5000
  calls = [];
4973
5001
  createCall(e) {
@@ -4989,11 +5017,28 @@ var yr = class {
4989
5017
  });
4990
5018
  }), this.calls = [];
4991
5019
  }
4992
- }, br, xr = br = class extends B {
5020
+ }, yr, br = yr = class extends V {
4993
5021
  currentTime = 0;
5022
+ playing = !1;
5023
+ playbackRate = 1;
5024
+ _rate = 1;
5025
+ _direction = 1;
5026
+ _loopMode = "none";
5027
+ get loopMode() {
5028
+ return this._loopMode;
5029
+ }
5030
+ set loopMode(e) {
5031
+ this._loopMode = e, this.loop = e === "loop";
5032
+ }
5033
+ get rate() {
5034
+ return this._rate;
5035
+ }
5036
+ set rate(e) {
5037
+ this._rate = e, this.playbackRate = e * this._direction;
5038
+ }
4994
5039
  static from(e, t = !1) {
4995
5040
  let [n, r] = e ? Array.isArray(e) ? e : [0, e] : [];
4996
- return new br({
5041
+ return new yr({
4997
5042
  startTime: n,
4998
5043
  endTime: r,
4999
5044
  loop: t
@@ -5011,16 +5056,38 @@ var yr = class {
5011
5056
  }
5012
5057
  addTime(e) {
5013
5058
  let t = this.endTime, n = Math.min(this.startTime, this.endTime), r = this.currentTime;
5014
- return r += e, this.loop && r > t && (r = n + r % t), r = St(r, n, t), this.currentTime = r, this.emit("updateCurrentTime", r, e), this;
5059
+ return r += e, this.loop && r > t && (r = n + r % t), r = D(r, n, t), this.currentTime = r, this.emit("updateCurrentTime", r, e), this;
5060
+ }
5061
+ play(e) {
5062
+ return e?.rate !== void 0 && (this._rate = e.rate), e?.loopMode !== void 0 && (this.loopMode = e.loopMode), this._direction = 1, (!Number.isFinite(this.currentTime) || this.currentTime >= this.endTime) && (this.currentTime = Math.min(this.startTime, this.endTime)), this.playing = !0, this.playbackRate = this._rate * this._direction, this;
5063
+ }
5064
+ pause() {
5065
+ return this.playing = !1, this;
5066
+ }
5067
+ advance(e) {
5068
+ if (!this.playing) return this;
5069
+ this.playbackRate = this._rate * this._direction;
5070
+ let t = Math.min(this.startTime, this.endTime), n = this.endTime;
5071
+ if (this.addTime(e * this._rate * this._direction), n <= t) return this;
5072
+ let r = this.currentTime;
5073
+ switch (this._loopMode) {
5074
+ case "none":
5075
+ (this._direction > 0 && r >= n || this._direction < 0 && r <= t) && (this.pause(), this.emit("ended"));
5076
+ break;
5077
+ case "alternate":
5078
+ this._direction > 0 && r >= n ? this._direction = -1 : this._direction < 0 && r <= t && (this._direction = 1);
5079
+ break;
5080
+ }
5081
+ return this;
5015
5082
  }
5016
5083
  _process(e) {
5017
5084
  super._process(e), this.paused || this.addTime(e);
5018
5085
  }
5019
5086
  };
5020
- k([_({ fallback: 0 }), O("design:type", Number)], xr.prototype, "startTime", void 0), k([_({ fallback: 2 ** 53 - 1 }), O("design:type", Number)], xr.prototype, "endTime", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], xr.prototype, "loop", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], xr.prototype, "paused", void 0), xr = br = k([S("Timeline"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], xr);
5087
+ A([_({ fallback: 0 }), k("design:type", Number)], br.prototype, "startTime", void 0), A([_({ fallback: 2 ** 53 - 1 }), k("design:type", Number)], br.prototype, "endTime", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], br.prototype, "loop", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], br.prototype, "paused", void 0), br = yr = A([S("Timeline"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], br);
5021
5088
  //#endregion
5022
5089
  //#region src/scene/main/Window.ts
5023
- var Sr = class extends H {
5090
+ var xr = class extends U {
5024
5091
  constructor() {
5025
5092
  super(), this.renderTargets.forEach((e) => e.isRoot = !0);
5026
5093
  }
@@ -5031,22 +5098,22 @@ var Sr = class extends H {
5031
5098
  super.flush(e), this.finish(e);
5032
5099
  }
5033
5100
  };
5034
- Sr = k([S("Window", {
5101
+ xr = A([S("Window", {
5035
5102
  processMode: "always",
5036
5103
  renderMode: "always"
5037
- }), O("design:paramtypes", [])], Sr);
5104
+ }), k("design:paramtypes", [])], xr);
5038
5105
  //#endregion
5039
5106
  //#region src/scene/main/SceneTree.ts
5040
- var Cr = class extends Et {
5107
+ var Sr = class extends Tt {
5041
5108
  input = new gt();
5042
- renderStack = new yr();
5043
- root = new Sr().setTree(this);
5044
- timeline = new xr().setTree(this);
5109
+ renderStack = new vr();
5110
+ root = new xr().setTree(this);
5111
+ timeline = new br().setTree(this);
5045
5112
  nodeMap = /* @__PURE__ */ new Map();
5046
5113
  _boundFonts;
5047
5114
  _textRemeasureScheduled = !1;
5048
5115
  _onFontLoad = () => this._scheduleTextRemeasure();
5049
- _backgroundColor = new yt();
5116
+ _backgroundColor = new E();
5050
5117
  _previousViewport;
5051
5118
  _currentViewport;
5052
5119
  getPreviousViewport() {
@@ -5099,41 +5166,41 @@ var Cr = class extends Et {
5099
5166
  this.timeline.emit("process", e), this.emit("processing"), this.root.emit("process", e), this.emit("processed");
5100
5167
  }
5101
5168
  _render(e) {
5102
- this.emit("rendering"), gr(), this.renderStack.render(e), this._renderScreen(e), this.emit("rendered");
5169
+ this.emit("rendering"), hr(), this.renderStack.render(e), this._renderScreen(e), this.emit("rendered");
5103
5170
  }
5104
5171
  _renderScreen(e) {
5105
5172
  this.root.finish(e), e.state.reset(), e.renderTarget.unbind(), this.backgroundColor && e.gl.clearColor(...this._backgroundColor.toArray()), e.clear(), this.backgroundColor && e.gl.clearColor(0, 0, 0, 0);
5106
5173
  let t = this.root.texture;
5107
- t.activate(e, 0), L.draw(e), t.inactivate(e);
5174
+ t.activate(e, 0), R.draw(e), t.inactivate(e);
5108
5175
  }
5109
5176
  _destroy() {
5110
5177
  super._destroy(), this._bindFonts(void 0), this.root.destroy(), this.input.destroy(), this.nodeMap.clear();
5111
5178
  }
5112
5179
  };
5113
- k([_({ alias: "root.msaa" }), O("design:type", Boolean)], Cr.prototype, "msaa", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Cr.prototype, "pixelate", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Cr.prototype, "roundPixels", void 0), k([_(), O("design:type", Object)], Cr.prototype, "backgroundColor", void 0), k([_({
5180
+ A([_({ alias: "root.msaa" }), k("design:type", Boolean)], Sr.prototype, "msaa", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], Sr.prototype, "pixelate", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], Sr.prototype, "roundPixels", void 0), A([_(), k("design:type", Object)], Sr.prototype, "backgroundColor", void 0), A([_({
5114
5181
  internal: !0,
5115
5182
  fallback: !1
5116
- }), O("design:type", Boolean)], Cr.prototype, "debug", void 0), k([_({
5183
+ }), k("design:type", Boolean)], Sr.prototype, "debug", void 0), A([_({
5117
5184
  internal: !0,
5118
5185
  fallback: !1
5119
- }), O("design:type", Boolean)], Cr.prototype, "processPaused", void 0), k([_({
5186
+ }), k("design:type", Boolean)], Sr.prototype, "processPaused", void 0), A([_({
5120
5187
  internal: !0,
5121
5188
  default: () => he
5122
- }), O("design:type", Object)], Cr.prototype, "fonts", void 0);
5189
+ }), k("design:type", Object)], Sr.prototype, "fonts", void 0);
5123
5190
  //#endregion
5124
5191
  //#region src/scene/main/Transition.ts
5125
- var wr = class extends U {
5192
+ var Cr = class extends W {
5126
5193
  constructor(e, t = []) {
5127
5194
  super(), this.setProperties(e).append(t);
5128
5195
  }
5129
5196
  };
5130
- wr = k([S("Transition", {
5197
+ Cr = A([S("Transition", {
5131
5198
  effectMode: "transition",
5132
5199
  duration: 2e3
5133
- }), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], wr);
5200
+ }), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Cr);
5134
5201
  //#endregion
5135
5202
  //#region src/scene/2d/Node2D.ts
5136
- var Tr = class extends vr {
5203
+ var wr = class extends _r {
5137
5204
  rotation = 0;
5138
5205
  position = new x(0, 0, () => this.updateGlobalTransform());
5139
5206
  scale = new x(1, 1, () => this.updateGlobalTransform());
@@ -5185,10 +5252,10 @@ var Tr = class extends vr {
5185
5252
  super._destroy(), this.position.destroy(), this.scale.destroy(), this.skew.destroy(), this.pivot.destroy(), this.extraTransform.destroy(), this.transform.destroy(), this.globalPosition.destroy(), this.globalScale.destroy(), this.globalSkew.destroy(), this.globalTransform.destroy();
5186
5253
  }
5187
5254
  };
5188
- Tr = k([S("Node2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Tr);
5255
+ wr = A([S("Node2D"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], wr);
5189
5256
  //#endregion
5190
5257
  //#region src/scene/2d/Camera2D.ts
5191
- var Er = class extends Tr {
5258
+ var Tr = class extends wr {
5192
5259
  canvasTransform = new b();
5193
5260
  _screenOffset = {
5194
5261
  x: 0,
@@ -5229,7 +5296,7 @@ var Er = class extends Tr {
5229
5296
  return this.setZoom(this._zoom.x + e, this._zoom.y + t);
5230
5297
  }
5231
5298
  setZoom(e, t = e) {
5232
- return this._zoom.set(St(e, this._minZoom.x, this._maxZoom.x), St(t, this._minZoom.y, this._maxZoom.y)), this;
5299
+ return this._zoom.set(D(e, this._minZoom.x, this._maxZoom.x), D(t, this._minZoom.y, this._maxZoom.y)), this;
5233
5300
  }
5234
5301
  setZoomAtOrigin(e, t, n) {
5235
5302
  let r;
@@ -5332,19 +5399,19 @@ var Er = class extends Tr {
5332
5399
  };
5333
5400
  }
5334
5401
  };
5335
- k([_({
5402
+ A([_({
5336
5403
  internal: !0,
5337
5404
  fallback: !1
5338
- }), O("design:type", Boolean)], Er.prototype, "spaceKey", void 0), k([_({
5405
+ }), k("design:type", Boolean)], Tr.prototype, "spaceKey", void 0), A([_({
5339
5406
  internal: !0,
5340
5407
  fallback: !1
5341
- }), O("design:type", Boolean)], Er.prototype, "grabbing", void 0), Er = k([S("Camera2D", {
5408
+ }), k("design:type", Boolean)], Tr.prototype, "grabbing", void 0), Tr = A([S("Camera2D", {
5342
5409
  processMode: "disabled",
5343
5410
  renderMode: "disabled"
5344
- }), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Er);
5411
+ }), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Tr);
5345
5412
  //#endregion
5346
5413
  //#region src/scene/2d/element/connectionRouter.ts
5347
- function Dr(e, t) {
5414
+ function Er(e, t) {
5348
5415
  return Math.abs(e) >= Math.abs(t) ? {
5349
5416
  x: Math.sign(e) || 1,
5350
5417
  y: 0
@@ -5353,11 +5420,11 @@ function Dr(e, t) {
5353
5420
  y: Math.sign(t) || 1
5354
5421
  };
5355
5422
  }
5356
- function Or(e, t, n, r = {}) {
5423
+ function Dr(e, t, n, r = {}) {
5357
5424
  let i = t.point, a = n.point, o = new v();
5358
5425
  switch (e) {
5359
5426
  case "curved": {
5360
- let e = t.dir ?? Dr(a.x - i.x, a.y - i.y), s = n.dir ?? Dr(i.x - a.x, i.y - a.y), c = a.x - i.x, l = a.y - i.y, u = Math.hypot(c, l) || 1, d = c / u, f = l / u, p = Math.max((r.stub ?? 16) * 2, u * .4), m = (e, t, n, r) => Math.max(.1, (1 + e * n + t * r) / 2), h = p * m(e.x, e.y, d, f), g = p * m(s.x, s.y, -d, -f), ee = i.x + e.x * h, te = i.y + e.y * h, ne = a.x + s.x * g, re = a.y + s.y * g;
5427
+ let e = t.dir ?? Er(a.x - i.x, a.y - i.y), s = n.dir ?? Er(i.x - a.x, i.y - a.y), c = a.x - i.x, l = a.y - i.y, u = Math.hypot(c, l) || 1, d = c / u, f = l / u, p = Math.max((r.stub ?? 16) * 2, u * .4), m = (e, t, n, r) => Math.max(.1, (1 + e * n + t * r) / 2), h = p * m(e.x, e.y, d, f), g = p * m(s.x, s.y, -d, -f), ee = i.x + e.x * h, te = i.y + e.y * h, ne = a.x + s.x * g, re = a.y + s.y * g;
5361
5428
  for (let e = 0; e <= 32; e++) {
5362
5429
  let t = e / 32, n = 1 - t, r = n * n * n, s = 3 * n * n * t, c = 3 * n * t * t, l = t * t * t, u = r * i.x + s * ee + c * ne + l * a.x, d = r * i.y + s * te + c * re + l * a.y;
5363
5430
  e === 0 ? o.moveTo(u, d) : o.lineTo(u, d);
@@ -5365,7 +5432,7 @@ function Or(e, t, n, r = {}) {
5365
5432
  break;
5366
5433
  }
5367
5434
  case "orthogonal": {
5368
- let e = Ar(t, n, r);
5435
+ let e = kr(t, n, r);
5369
5436
  for (let t = 0; t < e.length; t++) t === 0 ? o.moveTo(e[t].x, e[t].y) : o.lineTo(e[t].x, e[t].y);
5370
5437
  break;
5371
5438
  }
@@ -5375,11 +5442,11 @@ function Or(e, t, n, r = {}) {
5375
5442
  }
5376
5443
  return o;
5377
5444
  }
5378
- function kr(e) {
5379
- return Dr(e.x, e.y);
5445
+ function Or(e) {
5446
+ return Er(e.x, e.y);
5380
5447
  }
5381
- function Ar(e, t, n) {
5382
- let r = e.point, i = t.point, a = n.stub ?? 16, o = kr(e.dir ?? Dr(i.x - r.x, i.y - r.y)), s = kr(t.dir ?? Dr(r.x - i.x, r.y - i.y)), c = {
5448
+ function kr(e, t, n) {
5449
+ let r = e.point, i = t.point, a = n.stub ?? 16, o = Or(e.dir ?? Er(i.x - r.x, i.y - r.y)), s = Or(t.dir ?? Er(r.x - i.x, r.y - i.y)), c = {
5383
5450
  x: r.x + o.x * a,
5384
5451
  y: r.y + o.y * a
5385
5452
  }, l = {
@@ -5391,12 +5458,12 @@ function Ar(e, t, n) {
5391
5458
  x: r.x,
5392
5459
  y: r.y
5393
5460
  }, c];
5394
- return d.push(...Mr(c, o, l, s, a, u)), d.push(l, {
5461
+ return d.push(...jr(c, o, l, s, a, u)), d.push(l, {
5395
5462
  x: i.x,
5396
5463
  y: i.y
5397
- }), Nr(d);
5464
+ }), Mr(d);
5398
5465
  }
5399
- function jr(e, t, n, r, i) {
5466
+ function Ar(e, t, n, r, i) {
5400
5467
  let a = Infinity, o = -Infinity, s = t === "y" ? "x" : "y";
5401
5468
  for (let e of r) {
5402
5469
  let r = e.min[s], i = r + e.size[s];
@@ -5407,7 +5474,7 @@ function jr(e, t, n, r, i) {
5407
5474
  }
5408
5475
  return e > a && e < o ? a - i : e;
5409
5476
  }
5410
- function Mr(e, t, n, r, i, a = []) {
5477
+ function jr(e, t, n, r, i, a = []) {
5411
5478
  let o = t.y === 0;
5412
5479
  if (o === (r.y === 0)) {
5413
5480
  if (o) {
@@ -5422,7 +5489,7 @@ function Mr(e, t, n, r, i, a = []) {
5422
5489
  }];
5423
5490
  }
5424
5491
  let o = Math.abs(e.y - n.y) < .001 ? e.y + i : (e.y + n.y) / 2;
5425
- return o = jr(o, "y", [Math.min(e.x, n.x), Math.max(e.x, n.x)], a, i), [{
5492
+ return o = Ar(o, "y", [Math.min(e.x, n.x), Math.max(e.x, n.x)], a, i), [{
5426
5493
  x: e.x,
5427
5494
  y: o
5428
5495
  }, {
@@ -5441,7 +5508,7 @@ function Mr(e, t, n, r, i, a = []) {
5441
5508
  }];
5442
5509
  }
5443
5510
  let s = Math.abs(e.x - n.x) < .001 ? e.x + i : (e.x + n.x) / 2;
5444
- return s = jr(s, "x", [Math.min(e.y, n.y), Math.max(e.y, n.y)], a, i), [{
5511
+ return s = Ar(s, "x", [Math.min(e.y, n.y), Math.max(e.y, n.y)], a, i), [{
5445
5512
  x: s,
5446
5513
  y: e.y
5447
5514
  }, {
@@ -5468,7 +5535,7 @@ function Mr(e, t, n, r, i, a = []) {
5468
5535
  y: l.y
5469
5536
  }];
5470
5537
  }
5471
- function Nr(e) {
5538
+ function Mr(e) {
5472
5539
  let t = [];
5473
5540
  for (let n = 0; n < e.length; n++) {
5474
5541
  let r = e[n], i = t[t.length - 1];
@@ -5478,7 +5545,7 @@ function Nr(e) {
5478
5545
  }
5479
5546
  //#endregion
5480
5547
  //#region src/css/parseCssFilter.ts
5481
- var Pr = {
5548
+ var Nr = {
5482
5549
  brightness: 1,
5483
5550
  contrast: 1,
5484
5551
  grayscale: 0,
@@ -5488,12 +5555,12 @@ var Pr = {
5488
5555
  saturate: 1,
5489
5556
  sepia: 0
5490
5557
  };
5491
- function Fr(e) {
5492
- let t = new Ct();
5558
+ function Pr(e) {
5559
+ let t = new St();
5493
5560
  if (e === "none") return t;
5494
5561
  let n = ke(e).reduce((e, { name: t, args: n }) => (e[t] = n[0].normalizedIntValue, e), {});
5495
- Object.keys(Pr).forEach((e) => {
5496
- n[e] = n[e] ?? Pr[e];
5562
+ Object.keys(Nr).forEach((e) => {
5563
+ n[e] = n[e] ?? Nr[e];
5497
5564
  });
5498
5565
  for (let e in n) {
5499
5566
  let r = n[e];
@@ -5528,7 +5595,7 @@ function Fr(e) {
5528
5595
  }
5529
5596
  //#endregion
5530
5597
  //#region src/css/parseCssTransformOrigin.ts
5531
- function Ir(e) {
5598
+ function Fr(e) {
5532
5599
  let [t, n = t] = e.split(" ");
5533
5600
  return [t, n].map((e) => {
5534
5601
  switch (e = e.trim(), e) {
@@ -5543,11 +5610,11 @@ function Ir(e) {
5543
5610
  }
5544
5611
  //#endregion
5545
5612
  //#region src/scene/effects/ColorAdjustEffect.ts
5546
- var Lr, W = class extends U {
5613
+ var Ir, G = class extends W {
5547
5614
  static {
5548
- Lr = this;
5615
+ Ir = this;
5549
5616
  }
5550
- static material = new I({ gl: {
5617
+ static material = new L({ gl: {
5551
5618
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5552
5619
  fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform float gamma;\nuniform float contrast;\nuniform float saturation;\nuniform float brightness;\nuniform float red;\nuniform float green;\nuniform float blue;\nuniform float alpha;\n\nvoid main(void) {\n vec4 c = texture2D(sampler, vUv);\n if (c.a > 0.0) {\n c.rgb /= c.a;\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n rgb.r *= red;\n rgb.g *= green;\n rgb.b *= blue;\n c.rgb = rgb * brightness;\n c.rgb *= c.a;\n }\n gl_FragColor = c * alpha;\n}"
5553
5620
  } });
@@ -5556,7 +5623,7 @@ var Lr, W = class extends U {
5556
5623
  }
5557
5624
  apply(e, t) {
5558
5625
  t.redraw(e, () => {
5559
- L.draw(e, Lr.material, {
5626
+ R.draw(e, Ir.material, {
5560
5627
  sampler: 0,
5561
5628
  saturation: this.saturation,
5562
5629
  contrast: this.contrast,
@@ -5570,18 +5637,18 @@ var Lr, W = class extends U {
5570
5637
  });
5571
5638
  }
5572
5639
  };
5573
- k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "saturation", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "contrast", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "brightness", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "red", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "green", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "blue", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "alpha", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "gamma", void 0), W = Lr = k([S("ColorAdjustEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], W);
5640
+ A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "saturation", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "contrast", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "brightness", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "red", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "green", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "blue", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "alpha", void 0), A([_({ fallback: 1 }), k("design:type", Number)], G.prototype, "gamma", void 0), G = Ir = A([S("ColorAdjustEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], G);
5574
5641
  //#endregion
5575
5642
  //#region src/scene/effects/ColorFilterEffect.ts
5576
- var Rr, zr = class extends U {
5643
+ var Lr, Rr = class extends W {
5577
5644
  static {
5578
- Rr = this;
5645
+ Lr = this;
5579
5646
  }
5580
- static material = new I({ gl: {
5647
+ static material = new L({ gl: {
5581
5648
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5582
5649
  fragment: "in vec2 vUv;\nuniform sampler2D sampler;\nuniform float m[20];\n\nvoid main(void) {\n vec4 c = texture2D(sampler, vUv);\n if (c.a > 0.0) {\n c.rgb /= c.a;\n }\n gl_FragColor = vec4(\n m[0] * c.r + m[1] * c.g + m[2] * c.b + m[3] * c.a + m[4] / 255.0,\n m[5] * c.r + m[6] * c.g + m[7] * c.b + m[8] * c.a + m[9] / 255.0,\n m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14] / 255.0,\n m[15] * c.r + m[16] * c.g + m[17] * c.b + m[18] * c.a + m[19] / 255.0\n );\n}"
5583
5650
  } });
5584
- _colorMatrix = new Ct();
5651
+ _colorMatrix = new St();
5585
5652
  constructor(e, t = []) {
5586
5653
  super(), this.setProperties(e).append(t);
5587
5654
  }
@@ -5625,25 +5692,25 @@ var Rr, zr = class extends U {
5625
5692
  break;
5626
5693
  }
5627
5694
  }), t.redraw(e, () => {
5628
- L.draw(e, Rr.material, {
5695
+ R.draw(e, Lr.material, {
5629
5696
  sampler: 0,
5630
5697
  m: r.toArray()
5631
5698
  });
5632
5699
  });
5633
5700
  }
5634
5701
  };
5635
- k([_(), O("design:type", String)], zr.prototype, "filter", void 0), zr = Rr = k([S("ColorFilterEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], zr);
5702
+ A([_(), k("design:type", String)], Rr.prototype, "filter", void 0), Rr = Lr = A([S("ColorFilterEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Rr);
5636
5703
  //#endregion
5637
5704
  //#region src/scene/effects/ColorOverlayEffect.ts
5638
- var Br, Vr = 50, Hr = class extends U {
5705
+ var zr, Br = 50, Vr = class extends W {
5639
5706
  static {
5640
- Br = this;
5707
+ zr = this;
5641
5708
  }
5642
- static material = new I({ gl: {
5709
+ static material = new L({ gl: {
5643
5710
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5644
5711
  fragment: `precision mediump float;
5645
5712
  uniform sampler2D sampler;
5646
- uniform vec4 colors[${Vr}];
5713
+ uniform vec4 colors[${Br}];
5647
5714
  varying vec2 vUv;
5648
5715
 
5649
5716
  float calcWidth() {
@@ -5652,7 +5719,7 @@ float calcWidth() {
5652
5719
 
5653
5720
  int calcCount() {
5654
5721
  int count = 0;
5655
- for (int i = 0; i < ${Vr}; i++) {
5722
+ for (int i = 0; i < ${Br}; i++) {
5656
5723
  if (colors[i] != vec4(0,0,0,0)){
5657
5724
  count++;
5658
5725
  }
@@ -5664,7 +5731,7 @@ vec4 calcColor(float x) {
5664
5731
  float perUnit = calcWidth() / float(calcCount());
5665
5732
  int index = int(x / perUnit);
5666
5733
 
5667
- for(int i=0; i<${Vr}; i++){
5734
+ for(int i=0; i<${Br}; i++){
5668
5735
  if(i==index){
5669
5736
  return colors[i];
5670
5737
  }
@@ -5679,7 +5746,7 @@ void main(void) {
5679
5746
  gl_FragColor = vec4(mix(color.rgb, mask.rgb, color.a * mask.a), color.a);
5680
5747
  }`
5681
5748
  } });
5682
- _color = new yt();
5749
+ _color = new E();
5683
5750
  constructor(e, t = []) {
5684
5751
  super(), this.setProperties(e).append(t);
5685
5752
  }
@@ -5690,31 +5757,31 @@ void main(void) {
5690
5757
  let t = this._color.toArray();
5691
5758
  return t[3] = this.alpha, t;
5692
5759
  });
5693
- for (; t.length < Vr;) t.push([
5760
+ for (; t.length < Br;) t.push([
5694
5761
  0,
5695
5762
  0,
5696
5763
  0,
5697
5764
  0
5698
5765
  ]);
5699
- L.draw(e, Br.material, {
5766
+ R.draw(e, zr.material, {
5700
5767
  sampler: 0,
5701
- colors: t.slice(0, Vr).flatMap((e) => e)
5768
+ colors: t.slice(0, Br).flatMap((e) => e)
5702
5769
  });
5703
5770
  });
5704
5771
  }
5705
5772
  };
5706
- k([_({ default: () => [] }), O("design:type", Array)], Hr.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Hr.prototype, "alpha", void 0), Hr = Br = k([S("ColorOverlayEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Hr);
5773
+ A([_({ default: () => [] }), k("design:type", Array)], Vr.prototype, "colors", void 0), A([_({ fallback: .5 }), k("design:type", Number)], Vr.prototype, "alpha", void 0), Vr = zr = A([S("ColorOverlayEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Vr);
5707
5774
  //#endregion
5708
5775
  //#region src/scene/effects/ColorRemoveEffect.ts
5709
- var Ur, Wr = class extends U {
5776
+ var Hr, Ur = class extends W {
5710
5777
  static {
5711
- Ur = this;
5778
+ Hr = this;
5712
5779
  }
5713
- static material = new I({ gl: {
5780
+ static material = new L({ gl: {
5714
5781
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5715
5782
  fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform float epsilon;\nconst int MAX_COLORS = 50;\nuniform vec3 originalColors[MAX_COLORS];\n\nvoid main(void) {\n vec4 color = texture2D(sampler, vUv);\n\n for (int i = 0; i < MAX_COLORS; i++) {\n vec3 origColor = originalColors[i];\n if (origColor.r < 0.0) {\n break;\n }\n vec3 colorDiff = origColor - color.rgb;\n if (length(colorDiff) < epsilon) {\n gl_FragColor = vec4(0, 0, 0, 0);\n return;\n }\n }\n\n gl_FragColor = color;\n}"
5716
5783
  } });
5717
- _color = new yt();
5784
+ _color = new E();
5718
5785
  constructor(e, t = []) {
5719
5786
  super(), this.setProperties(e).append(t);
5720
5787
  }
@@ -5728,7 +5795,7 @@ var Ur, Wr = class extends U {
5728
5795
  r.slice(0, 50).forEach((e, t) => {
5729
5796
  n[t * 3] = e[0], n[t * 3 + 1] = e[1], n[t * 3 + 2] = e[2];
5730
5797
  }), t.redraw(e, () => {
5731
- L.draw(e, Ur.material, {
5798
+ R.draw(e, Hr.material, {
5732
5799
  sampler: 0,
5733
5800
  epsilon: this.epsilon,
5734
5801
  originalColors: n
@@ -5736,19 +5803,19 @@ var Ur, Wr = class extends U {
5736
5803
  });
5737
5804
  }
5738
5805
  };
5739
- k([_({ default: () => [] }), O("design:type", Array)], Wr.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Wr.prototype, "epsilon", void 0), Wr = Ur = k([S("ColorRemoveEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Wr);
5806
+ A([_({ default: () => [] }), k("design:type", Array)], Ur.prototype, "colors", void 0), A([_({ fallback: .5 }), k("design:type", Number)], Ur.prototype, "epsilon", void 0), Ur = Hr = A([S("ColorRemoveEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Ur);
5740
5807
  //#endregion
5741
5808
  //#region src/scene/effects/ColorReplaceEffect.ts
5742
- var Gr, Kr = 50, qr = class extends U {
5809
+ var Wr, Gr = 50, Kr = class extends W {
5743
5810
  static {
5744
- Gr = this;
5811
+ Wr = this;
5745
5812
  }
5746
- static material = new I({ gl: {
5813
+ static material = new L({ gl: {
5747
5814
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5748
5815
  fragment: `varying vec2 vUv;
5749
5816
  uniform sampler2D sampler;
5750
5817
  uniform float epsilon;
5751
- const int MAX_COLORS = ${Kr};
5818
+ const int MAX_COLORS = ${Gr};
5752
5819
  uniform vec3 originalColors[MAX_COLORS];
5753
5820
  uniform vec3 targetColors[MAX_COLORS];
5754
5821
 
@@ -5776,7 +5843,7 @@ void main(void) {
5776
5843
  }
5777
5844
  }`
5778
5845
  } });
5779
- _color = new yt();
5846
+ _color = new E();
5780
5847
  constructor(e, t = []) {
5781
5848
  super(), this.setProperties(e).append(t);
5782
5849
  }
@@ -5785,8 +5852,8 @@ void main(void) {
5785
5852
  this._color.value = e[0];
5786
5853
  let t = this._color.toArray().slice(0, 3);
5787
5854
  return this._color.value = e[1], [t, this._color.toArray().slice(0, 3)];
5788
- }), r = this.epsilon, i = new Float32Array(Kr * 3), a = new Float32Array(Kr * 3);
5789
- for (; n.length < Kr;) n.push([[
5855
+ }), r = this.epsilon, i = new Float32Array(Gr * 3), a = new Float32Array(Gr * 3);
5856
+ for (; n.length < Gr;) n.push([[
5790
5857
  -1,
5791
5858
  0,
5792
5859
  0
@@ -5796,10 +5863,10 @@ void main(void) {
5796
5863
  0,
5797
5864
  1
5798
5865
  ]]);
5799
- n.slice(0, Kr).forEach(([e, t], n) => {
5866
+ n.slice(0, Gr).forEach(([e, t], n) => {
5800
5867
  i[n * 3] = e[0], i[n * 3 + 1] = e[1], i[n * 3 + 2] = e[2], a[n * 3] = t[0], a[n * 3 + 1] = t[1], a[n * 3 + 2] = t[2];
5801
5868
  }), t.redraw(e, () => {
5802
- L.draw(e, Gr.material, {
5869
+ R.draw(e, Wr.material, {
5803
5870
  sampler: 0,
5804
5871
  epsilon: r,
5805
5872
  originalColors: i,
@@ -5808,17 +5875,17 @@ void main(void) {
5808
5875
  });
5809
5876
  }
5810
5877
  };
5811
- k([_({ default: () => [] }), O("design:type", Array)], qr.prototype, "colors", void 0), k([_({ fallback: .05 }), O("design:type", Number)], qr.prototype, "epsilon", void 0), qr = Gr = k([S("ColorReplaceEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], qr);
5878
+ A([_({ default: () => [] }), k("design:type", Array)], Kr.prototype, "colors", void 0), A([_({ fallback: .05 }), k("design:type", Number)], Kr.prototype, "epsilon", void 0), Kr = Wr = A([S("ColorReplaceEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Kr);
5812
5879
  //#endregion
5813
5880
  //#region src/scene/effects/DrawboardEffect.frag?raw
5814
- var Jr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nuniform vec2 inputSize;\nuniform vec2 zoom;\nuniform vec2 translate;\nuniform float gridScale;\nuniform vec2 gridSize;\nuniform int checkerboard;\nuniform int checkerboardStyle;\nuniform float dotBackgroundBaseColor;\nuniform float dotBackgroundZoomedOutColor;\nuniform float dotColorDiff;\nuniform int pixelGrid;\nuniform int watermark;\nuniform sampler2D watermarkTexture;\nuniform vec2 watermarkSize;\nuniform vec2 watermarkOffset;\nuniform vec2 watermarkSpacing;\nuniform float watermarkRotation;\nuniform float watermarkAlpha;\n\nconst float VIEWPORT_SPACE_MIN_DOT_RADIUS = 0.5;\nconst float CANVAS_SPACE_DOT_RADIUS = 1.;\nconst float CANVAS_SPACE_DOT_GRID_SIZE_PX = 16.;\n\nconst int CHECKERBOARD_STYLE_NONE = 0;\nconst int CHECKERBOARD_STYLE_GRID = 1;\nconst int CHECKERBOARD_STYLE_GRID_DARK = 2;\nconst int CHECKERBOARD_STYLE_DOTS = 3;\nconst int CHECKERBOARD_STYLE_DOTS_DARK = 4;\n\nfloat _round(float val) {\n return floor(val + .5);\n}\n\nvec2 _round(vec2 pt) {\n return floor(pt + .5);\n}\n\nfloat scaledGridSize(float zoomScale) {\n if (zoomScale < 0.03125) {\n return 32.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.0625) {\n return 16.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.125) {\n return 8.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.25) {\n return 4.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.5) {\n return 2.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else {\n return CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n}\n\nvec4 renderCheckerboard(vec2 coord, vec4 color) {\n float value;\n if (checkerboardStyle == CHECKERBOARD_STYLE_GRID) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 1.0 : 0.95;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_GRID_DARK) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 0.12 : 0.17;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_DOTS || checkerboardStyle == CHECKERBOARD_STYLE_DOTS_DARK) {\n // light vs dark dots share this path; the base/dot colours are supplied as\n // uniforms (set per style on the CPU side), so only the values differ.\n float zoomScale = zoom.x;\n float gridPixelSize = scaledGridSize(zoomScale);\n float zoomInterpolationFactor = smoothstep(0.5, 1.0, zoomScale);\n float dotColor = dotBackgroundZoomedOutColor + dotColorDiff * zoomInterpolationFactor;\n vec2 nearestGridPoint = _round(coord / gridPixelSize) * gridPixelSize;\n float canvasSpaceDist = length(coord - nearestGridPoint);\n float viewportSpaceDist = canvasSpaceDist * zoomScale;\n float viewportSpaceDotRadius = max(VIEWPORT_SPACE_MIN_DOT_RADIUS, CANVAS_SPACE_DOT_RADIUS * zoomScale);\n float dist = 1.0 - smoothstep(0., 1., (viewportSpaceDist - viewportSpaceDotRadius + .5));\n value = mix(dotBackgroundBaseColor, dotColor, dist);\n }\n return vec4(value * (1.0 - color.a) + color.rgb, 1);\n}\n\nvec4 renderPixelGrid(vec2 coord, vec4 color) {\n vec3 rgb = color.rgb;\n vec2 corner = fract(coord);\n float gridWeight = max(float(corner.x < gridSize.x), float(corner.y < gridSize.y));\n vec3 gridColor;\n vec3 weights = vec3(0.299, 0.587, 0.114);\n float c2 = dot(rgb * rgb, weights);\n float luminance = sqrt(c2);\n if (luminance > 0.5) {\n float target = (luminance - 0.05) / luminance;\n gridColor = rgb * target;\n }\n else {\n float target = luminance * 0.8 + 0.15;\n float c1 = dot(rgb, weights);\n float a = 1.0 - 2.0 * c1 + c2;\n float b = c2 - c1;\n gridColor = mix(rgb, vec3(1), (b + sqrt(b * b - a * (c2 - target * target))) / a);\n }\n return vec4(mix(rgb, gridColor, gridWeight), color.a);\n}\n\nvec4 renderWatermark(vec2 coord, vec4 color) {\n float hw = watermarkSize.x * 0.5;\n float hh = watermarkSize.y * 0.5;\n float c = cos(-watermarkRotation);\n float s = sin(-watermarkRotation);\n vec2 blockSize = watermarkSize + watermarkSpacing;\n vec2 tiles = max(floor(inputSize / blockSize), vec2(1.0));\n vec2 gridCoverage = tiles * blockSize;\n vec2 startPos = watermarkOffset;\n vec2 localPix = coord - startPos;\n vec2 blockIndex = floor(localPix / blockSize);\n vec2 wmCenter = startPos + blockIndex * blockSize + watermarkSize * 0.5 + watermarkSpacing / 2.0;\n vec2 local = coord - wmCenter;\n vec2 inv = vec2(\n local.x * c + local.y * s,\n -local.x * s + local.y * c\n );\n if (inv.x >= -hw && inv.x <= hw && inv.y >= -hh && inv.y <= hh) {\n vec2 wmUV = (inv + vec2(hw, hh)) / watermarkSize;\n vec4 wmColor = texture(watermarkTexture, wmUV);\n float alpha = wmColor.a * watermarkAlpha;\n return mix(color, wmColor, alpha);\n } else {\n return color;\n }\n}\n\nvoid main(void) {\n vec4 color = texture(uTexture, vUv);\n vec2 coord = vec2(vUv.x, 1.0 - vUv.y);\n coord = (coord * inputSize - translate) / zoom;\n if (checkerboard > 0) {\n color = renderCheckerboard(coord, color);\n }\n if (watermark > 0) {\n color = renderWatermark(coord, color);\n }\n if (pixelGrid > 0) {\n color = renderPixelGrid(coord, color);\n }\n gl_FragColor = color;\n}\n", Yr, G = class extends U {
5881
+ var qr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nuniform vec2 inputSize;\nuniform vec2 zoom;\nuniform vec2 translate;\nuniform float gridScale;\nuniform vec2 gridSize;\nuniform int checkerboard;\nuniform int checkerboardStyle;\nuniform float dotBackgroundBaseColor;\nuniform float dotBackgroundZoomedOutColor;\nuniform float dotColorDiff;\nuniform int pixelGrid;\nuniform int watermark;\nuniform sampler2D watermarkTexture;\nuniform vec2 watermarkSize;\nuniform vec2 watermarkOffset;\nuniform vec2 watermarkSpacing;\nuniform float watermarkRotation;\nuniform float watermarkAlpha;\n\nconst float VIEWPORT_SPACE_MIN_DOT_RADIUS = 0.5;\nconst float CANVAS_SPACE_DOT_RADIUS = 1.;\nconst float CANVAS_SPACE_DOT_GRID_SIZE_PX = 16.;\n\nconst int CHECKERBOARD_STYLE_NONE = 0;\nconst int CHECKERBOARD_STYLE_GRID = 1;\nconst int CHECKERBOARD_STYLE_GRID_DARK = 2;\nconst int CHECKERBOARD_STYLE_DOTS = 3;\nconst int CHECKERBOARD_STYLE_DOTS_DARK = 4;\n\nfloat _round(float val) {\n return floor(val + .5);\n}\n\nvec2 _round(vec2 pt) {\n return floor(pt + .5);\n}\n\nfloat scaledGridSize(float zoomScale) {\n if (zoomScale < 0.03125) {\n return 32.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.0625) {\n return 16.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.125) {\n return 8.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.25) {\n return 4.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.5) {\n return 2.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else {\n return CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n}\n\nvec4 renderCheckerboard(vec2 coord, vec4 color) {\n float value;\n if (checkerboardStyle == CHECKERBOARD_STYLE_GRID) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 1.0 : 0.95;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_GRID_DARK) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 0.12 : 0.17;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_DOTS || checkerboardStyle == CHECKERBOARD_STYLE_DOTS_DARK) {\n // light vs dark dots share this path; the base/dot colours are supplied as\n // uniforms (set per style on the CPU side), so only the values differ.\n float zoomScale = zoom.x;\n float gridPixelSize = scaledGridSize(zoomScale);\n float zoomInterpolationFactor = smoothstep(0.5, 1.0, zoomScale);\n float dotColor = dotBackgroundZoomedOutColor + dotColorDiff * zoomInterpolationFactor;\n vec2 nearestGridPoint = _round(coord / gridPixelSize) * gridPixelSize;\n float canvasSpaceDist = length(coord - nearestGridPoint);\n float viewportSpaceDist = canvasSpaceDist * zoomScale;\n float viewportSpaceDotRadius = max(VIEWPORT_SPACE_MIN_DOT_RADIUS, CANVAS_SPACE_DOT_RADIUS * zoomScale);\n float dist = 1.0 - smoothstep(0., 1., (viewportSpaceDist - viewportSpaceDotRadius + .5));\n value = mix(dotBackgroundBaseColor, dotColor, dist);\n }\n return vec4(value * (1.0 - color.a) + color.rgb, 1);\n}\n\nvec4 renderPixelGrid(vec2 coord, vec4 color) {\n vec3 rgb = color.rgb;\n vec2 corner = fract(coord);\n float gridWeight = max(float(corner.x < gridSize.x), float(corner.y < gridSize.y));\n vec3 gridColor;\n vec3 weights = vec3(0.299, 0.587, 0.114);\n float c2 = dot(rgb * rgb, weights);\n float luminance = sqrt(c2);\n if (luminance > 0.5) {\n float target = (luminance - 0.05) / luminance;\n gridColor = rgb * target;\n }\n else {\n float target = luminance * 0.8 + 0.15;\n float c1 = dot(rgb, weights);\n float a = 1.0 - 2.0 * c1 + c2;\n float b = c2 - c1;\n gridColor = mix(rgb, vec3(1), (b + sqrt(b * b - a * (c2 - target * target))) / a);\n }\n return vec4(mix(rgb, gridColor, gridWeight), color.a);\n}\n\nvec4 renderWatermark(vec2 coord, vec4 color) {\n float hw = watermarkSize.x * 0.5;\n float hh = watermarkSize.y * 0.5;\n float c = cos(-watermarkRotation);\n float s = sin(-watermarkRotation);\n vec2 blockSize = watermarkSize + watermarkSpacing;\n vec2 tiles = max(floor(inputSize / blockSize), vec2(1.0));\n vec2 gridCoverage = tiles * blockSize;\n vec2 startPos = watermarkOffset;\n vec2 localPix = coord - startPos;\n vec2 blockIndex = floor(localPix / blockSize);\n vec2 wmCenter = startPos + blockIndex * blockSize + watermarkSize * 0.5 + watermarkSpacing / 2.0;\n vec2 local = coord - wmCenter;\n vec2 inv = vec2(\n local.x * c + local.y * s,\n -local.x * s + local.y * c\n );\n if (inv.x >= -hw && inv.x <= hw && inv.y >= -hh && inv.y <= hh) {\n vec2 wmUV = (inv + vec2(hw, hh)) / watermarkSize;\n vec4 wmColor = texture(watermarkTexture, wmUV);\n float alpha = wmColor.a * watermarkAlpha;\n return mix(color, wmColor, alpha);\n } else {\n return color;\n }\n}\n\nvoid main(void) {\n vec4 color = texture(uTexture, vUv);\n vec2 coord = vec2(vUv.x, 1.0 - vUv.y);\n coord = (coord * inputSize - translate) / zoom;\n if (checkerboard > 0) {\n color = renderCheckerboard(coord, color);\n }\n if (watermark > 0) {\n color = renderWatermark(coord, color);\n }\n if (pixelGrid > 0) {\n color = renderPixelGrid(coord, color);\n }\n gl_FragColor = color;\n}\n", Jr, K = class extends W {
5815
5882
  static {
5816
- Yr = this;
5883
+ Jr = this;
5817
5884
  }
5818
5885
  _watermark;
5819
- static material = new I({ gl: {
5886
+ static material = new L({ gl: {
5820
5887
  vertex: "attribute vec2 position;\nin vec2 uv;\nuniform mat3 projectionMatrix;\nuniform mat3 viewMatrix;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position.xy, 0.0, 1.0);\n vUv = uv;\n}",
5821
- fragment: Jr
5888
+ fragment: qr
5822
5889
  } });
5823
5890
  constructor(e, t = []) {
5824
5891
  super(), this.setProperties(e).append(t);
@@ -5867,7 +5934,7 @@ var Jr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
5867
5934
  zoomedOut: this.dotColor ?? a.zoomedOut,
5868
5935
  diff: this.dotZoomDiff ?? a.diff
5869
5936
  };
5870
- L.draw(e, Yr.material, {
5937
+ R.draw(e, Jr.material, {
5871
5938
  uTexture: 0,
5872
5939
  inputSize: [t.width, t.height],
5873
5940
  zoom: [n[0], n[4]],
@@ -5891,20 +5958,20 @@ var Jr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
5891
5958
  });
5892
5959
  }
5893
5960
  };
5894
- k([_({ fallback: !1 }), O("design:type", Boolean)], G.prototype, "checkerboard", void 0), k([_({ fallback: "grid" }), O("design:type", Object)], G.prototype, "checkerboardStyle", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], G.prototype, "pixelGrid", void 0), k([_(), O("design:type", Number)], G.prototype, "dotBaseColor", void 0), k([_(), O("design:type", Number)], G.prototype, "dotColor", void 0), k([_(), O("design:type", Number)], G.prototype, "dotZoomDiff", void 0), k([_(), O("design:type", String)], G.prototype, "watermark", void 0), k([_({ fallback: 100 }), O("design:type", Number)], G.prototype, "watermarkWidth", void 0), k([_({ fallback: .05 }), O("design:type", Number)], G.prototype, "watermarkAlpha", void 0), k([_({ fallback: .5236 }), O("design:type", Number)], G.prototype, "watermarkRotation", void 0), G = Yr = k([S("DrawboardEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], G);
5961
+ A([_({ fallback: !1 }), k("design:type", Boolean)], K.prototype, "checkerboard", void 0), A([_({ fallback: "grid" }), k("design:type", Object)], K.prototype, "checkerboardStyle", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], K.prototype, "pixelGrid", void 0), A([_(), k("design:type", Number)], K.prototype, "dotBaseColor", void 0), A([_(), k("design:type", Number)], K.prototype, "dotColor", void 0), A([_(), k("design:type", Number)], K.prototype, "dotZoomDiff", void 0), A([_(), k("design:type", String)], K.prototype, "watermark", void 0), A([_({ fallback: 100 }), k("design:type", Number)], K.prototype, "watermarkWidth", void 0), A([_({ fallback: .05 }), k("design:type", Number)], K.prototype, "watermarkAlpha", void 0), A([_({ fallback: .5236 }), k("design:type", Number)], K.prototype, "watermarkRotation", void 0), K = Jr = A([S("DrawboardEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], K);
5895
5962
  //#endregion
5896
5963
  //#region src/scene/effects/GaussianBlurEffect.ts
5897
- var Xr, Zr = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void) {\n gl_FragColor = vec4(0.0);\n float flag = 0.0;\n for (int i = 0; i < 9; i++) {\n vec2 uv = vUv[i];\n if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) {\n flag = 1.0;\n break;\n }\n }\n if (flag == 1.0) {\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n } else {\n gl_FragColor += texture2D(sampler, vUv[0]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[1]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[2]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[3]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[5]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[6]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[7]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[8]) * 0.028532;\n }\n}", Qr = class extends U {
5964
+ var Yr, Xr = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void) {\n gl_FragColor = vec4(0.0);\n float flag = 0.0;\n for (int i = 0; i < 9; i++) {\n vec2 uv = vUv[i];\n if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) {\n flag = 1.0;\n break;\n }\n }\n if (flag == 1.0) {\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n } else {\n gl_FragColor += texture2D(sampler, vUv[0]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[1]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[2]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[3]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[5]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[6]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[7]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[8]) * 0.028532;\n }\n}", Zr = class extends W {
5898
5965
  static {
5899
- Xr = this;
5966
+ Yr = this;
5900
5967
  }
5901
- static materialX = new I({ gl: {
5968
+ static materialX = new L({ gl: {
5902
5969
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nuniform float uStrength;\nvarying vec2 vUv[9];\n\nvoid main(void) {\n gl_Position = vec4(position, 0, 1);\n vUv[0] = uv + vec2(-4.0 * uStrength, 0.0);\n vUv[1] = uv + vec2(-3.0 * uStrength, 0.0);\n vUv[2] = uv + vec2(-2.0 * uStrength, 0.0);\n vUv[3] = uv + vec2(-1.0 * uStrength, 0.0);\n vUv[4] = uv + vec2(0.0 * uStrength, 0.0);\n vUv[5] = uv + vec2(1.0 * uStrength, 0.0);\n vUv[6] = uv + vec2(2.0 * uStrength, 0.0);\n vUv[7] = uv + vec2(3.0 * uStrength, 0.0);\n vUv[8] = uv + vec2(4.0 * uStrength, 0.0);\n}",
5903
- fragment: Zr
5970
+ fragment: Xr
5904
5971
  } });
5905
- static materialY = new I({ gl: {
5972
+ static materialY = new L({ gl: {
5906
5973
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nuniform float uStrength;\nvarying vec2 vUv[9];\n\nvoid main(void) {\n gl_Position = vec4(position, 0, 1);\n vUv[0] = uv + vec2(0.0, -4.0 * uStrength);\n vUv[1] = uv + vec2(0.0, -3.0 * uStrength);\n vUv[2] = uv + vec2(0.0, -2.0 * uStrength);\n vUv[3] = uv + vec2(0.0, -1.0 * uStrength);\n vUv[4] = uv + vec2(0.0, 0.0 * uStrength);\n vUv[5] = uv + vec2(0.0, 1.0 * uStrength);\n vUv[6] = uv + vec2(0.0, 2.0 * uStrength);\n vUv[7] = uv + vec2(0.0, 3.0 * uStrength);\n vUv[8] = uv + vec2(0.0, 4.0 * uStrength);\n}",
5907
- fragment: Zr
5974
+ fragment: Xr
5908
5975
  } });
5909
5976
  constructor(e, t = []) {
5910
5977
  super(), this.setProperties(e).append(t);
@@ -5912,39 +5979,39 @@ var Xr, Zr = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void
5912
5979
  apply(e, t) {
5913
5980
  let n = 1 / t.width, r = 1 / t.height, i = Math.max(this.quality, 1);
5914
5981
  for (let r = 0; r < i; r++) t.redraw(e, () => {
5915
- L.draw(e, Xr.materialX, {
5982
+ R.draw(e, Yr.materialX, {
5916
5983
  sampler: 0,
5917
5984
  uStrength: n * (this.strength / i)
5918
5985
  });
5919
5986
  });
5920
5987
  for (let n = 0; n < i; n++) t.redraw(e, () => {
5921
- L.draw(e, Xr.materialY, {
5988
+ R.draw(e, Yr.materialY, {
5922
5989
  sampler: 0,
5923
5990
  uStrength: r * (this.strength / i)
5924
5991
  });
5925
5992
  });
5926
5993
  }
5927
5994
  };
5928
- k([_({ fallback: 4 }), O("design:type", Number)], Qr.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], Qr.prototype, "quality", void 0), Qr = Xr = k([S("GaussianBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Qr);
5995
+ A([_({ fallback: 4 }), k("design:type", Number)], Zr.prototype, "strength", void 0), A([_({ fallback: 3 }), k("design:type", Number)], Zr.prototype, "quality", void 0), Zr = Yr = A([S("GaussianBlurEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Zr);
5929
5996
  //#endregion
5930
5997
  //#region src/scene/effects/DropShadowEffect.ts
5931
- var $r, ei = class extends U {
5998
+ var Qr, $r = class extends W {
5932
5999
  static {
5933
- $r = this;
6000
+ Qr = this;
5934
6001
  }
5935
- static material = new I({ gl: {
6002
+ static material = new L({ gl: {
5936
6003
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5937
6004
  fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float uAlpha;\nuniform vec3 uColor;\nuniform vec2 uOffset;\nuniform vec4 uInputSize;\n\nvoid main(void) {\n vec4 sample = texture2D(sampler, vUv + uOffset * uInputSize.zw);\n sample.rgb = uColor.rgb * sample.a;\n sample *= uAlpha;\n gl_FragColor = sample;\n}"
5938
6005
  } });
5939
- blurEffect = new Qr();
5940
- viewport3 = new H();
5941
- _color = new yt();
6006
+ blurEffect = new Zr();
6007
+ viewport3 = new U();
6008
+ _color = new E();
5942
6009
  constructor(e, t = []) {
5943
6010
  super(), this.setProperties(e).append(t);
5944
6011
  }
5945
6012
  apply(e, t) {
5946
6013
  this.viewport3.activateWithCopy(e, t), this.viewport3.redraw(e, () => {
5947
- this._color.value = this.color, L.draw(e, $r.material, {
6014
+ this._color.value = this.color, R.draw(e, Qr.material, {
5948
6015
  sampler: 0,
5949
6016
  uAlpha: this._color.a,
5950
6017
  uColor: this._color.toArray().slice(0, 3),
@@ -5957,18 +6024,18 @@ var $r, ei = class extends U {
5957
6024
  ]
5958
6025
  });
5959
6026
  }), this.blurEffect.strength = this.blur, this.blurEffect.apply(e, this.viewport3), t.redraw(e, () => {
5960
- this.viewport3.texture.activate(e, 1), L.draw(e, Qn.instance, { sampler: 1 }), this.shadowOnly || L.draw(e, Qn.instance, { sampler: 0 }), e.texture.unbind(1);
6027
+ this.viewport3.texture.activate(e, 1), R.draw(e, Zn.instance, { sampler: 1 }), this.shadowOnly || R.draw(e, Zn.instance, { sampler: 0 }), e.texture.unbind(1);
5961
6028
  });
5962
6029
  }
5963
6030
  };
5964
- k([_({ fallback: "#000000FF" }), O("design:type", Object)], ei.prototype, "color", void 0), k([_({ fallback: 4 }), O("design:type", Number)], ei.prototype, "blur", void 0), k([_({ fallback: 4 }), O("design:type", Number)], ei.prototype, "offsetX", void 0), k([_({ fallback: 4 }), O("design:type", Number)], ei.prototype, "offsetY", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], ei.prototype, "shadowOnly", void 0), ei = $r = k([S("DropShadowEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ei);
6031
+ A([_({ fallback: "#000000FF" }), k("design:type", Object)], $r.prototype, "color", void 0), A([_({ fallback: 4 }), k("design:type", Number)], $r.prototype, "blur", void 0), A([_({ fallback: 4 }), k("design:type", Number)], $r.prototype, "offsetX", void 0), A([_({ fallback: 4 }), k("design:type", Number)], $r.prototype, "offsetY", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], $r.prototype, "shadowOnly", void 0), $r = Qr = A([S("DropShadowEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], $r);
5965
6032
  //#endregion
5966
6033
  //#region src/scene/effects/EmbossEffect.ts
5967
- var ti, ni = class extends U {
6034
+ var ei, ti = class extends W {
5968
6035
  static {
5969
- ti = this;
6036
+ ei = this;
5970
6037
  }
5971
- static material = new I({ gl: {
6038
+ static material = new L({ gl: {
5972
6039
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
5973
6040
  fragment: "precision mediump float;\nuniform sampler2D sampler;\nuniform vec4 inputSize;\nuniform float strength;\nvarying vec2 vUv;\n\nvoid main(void) {\n vec2 onePixel = inputSize.zw;\n vec4 color;\n color.rgb = vec3(0.5);\n color -= texture2D(sampler, vUv - onePixel) * strength;\n color += texture2D(sampler, vUv + onePixel) * strength;\n color.rgb = vec3((color.r + color.g + color.b) / 3.0);\n float alpha = texture2D(sampler, vUv).a;\n gl_FragColor = vec4(color.rgb * alpha, alpha);\n}"
5974
6041
  } });
@@ -5977,7 +6044,7 @@ var ti, ni = class extends U {
5977
6044
  }
5978
6045
  apply(e, t) {
5979
6046
  t.redraw(e, () => {
5980
- L.draw(e, ti.material, {
6047
+ R.draw(e, ei.material, {
5981
6048
  sampler: 0,
5982
6049
  strength: this.strength,
5983
6050
  inputSize: [
@@ -5990,14 +6057,14 @@ var ti, ni = class extends U {
5990
6057
  });
5991
6058
  }
5992
6059
  };
5993
- k([_({ fallback: 5 }), O("design:type", Number)], ni.prototype, "strength", void 0), ni = ti = k([S("EmbossEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ni);
6060
+ A([_({ fallback: 5 }), k("design:type", Number)], ti.prototype, "strength", void 0), ti = ei = A([S("EmbossEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ti);
5994
6061
  //#endregion
5995
6062
  //#region src/scene/effects/GlitchEffect.ts
5996
- var ri, K = class extends U {
6063
+ var ni, q = class extends W {
5997
6064
  static {
5998
- ri = this;
6065
+ ni = this;
5999
6066
  }
6000
- static material = new I({ gl: {
6067
+ static material = new L({ gl: {
6001
6068
  vertex: "in vec2 position;\nin vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
6002
6069
  fragment: "\nin vec2 vUv;\nuniform sampler2D sampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\nuniform float aspect;\n\nuniform sampler2D displacementMap;\nuniform float offset;\nuniform float sinDir;\nuniform float cosDir;\nuniform int fillMode;\n\nuniform float seed;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nconst int TRANSPARENT = 0;\nconst int ORIGINAL = 1;\nconst int LOOP = 2;\nconst int CLAMP = 3;\nconst int MIRROR = 4;\n\nvoid main(void) {\n vec2 coord = (vUv * filterArea.xy) / dimensions;\n\n if (coord.x > 1.0 || coord.y > 1.0) {\n return;\n }\n\n float cx = coord.x - 0.5;\n float cy = (coord.y - 0.5) * aspect;\n float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;\n\n // displacementMap: repeat\n // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\n\n // displacementMap: mirror\n ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\n\n vec4 dc = texture(displacementMap, vec2(0.5, ny));\n\n float displacement = (dc.r - dc.g) * (offset / filterArea.x);\n\n coord = vUv + vec2(cosDir * displacement, sinDir * displacement * aspect);\n\n if (fillMode == CLAMP) {\n coord = clamp(coord, filterClamp.xy, filterClamp.zw);\n } else {\n if (coord.x > filterClamp.z) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x -= filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x = filterClamp.z * 2.0 - coord.x;\n }\n } else if (coord.x < filterClamp.x) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x += filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x *= -filterClamp.z;\n }\n }\n\n if (coord.y > filterClamp.w) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y -= filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y = filterClamp.w * 2.0 - coord.y;\n }\n } else if (coord.y < filterClamp.y) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y += filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y *= -filterClamp.w;\n }\n }\n }\n\n gl_FragColor.r = texture(sampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\n gl_FragColor.g = texture(sampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;\n gl_FragColor.b = texture(sampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;\n gl_FragColor.a = texture(sampler, coord).a;\n}"
6003
6070
  } });
@@ -6010,7 +6077,7 @@ var ri, K = class extends U {
6010
6077
  super(), this.setProperties(e).append(t);
6011
6078
  let n = w(4, this.sampleSize);
6012
6079
  if (!n) throw Error("GlitchEffect requires a canvas; call setCanvasFactory() in non-browser environments.");
6013
- this._canvas = n, this._texture = new z(this._canvas), this._sizes = new Float32Array(this.slices), this._offsets = new Float32Array(this.slices);
6080
+ this._canvas = n, this._texture = new B(this._canvas), this._sizes = new Float32Array(this.slices), this._offsets = new Float32Array(this.slices);
6014
6081
  }
6015
6082
  redraw() {
6016
6083
  let e = this.sampleSize, t = this._texture, n = this._canvas.getContext("2d");
@@ -6027,7 +6094,7 @@ var ri, K = class extends U {
6027
6094
  this._needsRedraw || (this._needsRedraw = !0, this.redraw());
6028
6095
  let n = t.width, r = t.height, i = this.direction * (Math.PI / 180), a = Math.sin(i), o = Math.cos(i);
6029
6096
  t.redraw(e, () => {
6030
- this._texture.activate(e, 1), L.draw(e, ri.material, {
6097
+ this._texture.activate(e, 1), R.draw(e, ni.material, {
6031
6098
  sampler: 0,
6032
6099
  filterClamp: [
6033
6100
  0,
@@ -6056,14 +6123,14 @@ var ri, K = class extends U {
6056
6123
  });
6057
6124
  }
6058
6125
  };
6059
- k([_({ fallback: 10 }), O("design:type", Number)], K.prototype, "slices", void 0), k([_({ fallback: 512 }), O("design:type", Number)], K.prototype, "sampleSize", void 0), k([_({ fallback: 100 }), O("design:type", Number)], K.prototype, "offset", void 0), k([_({ fallback: 0 }), O("design:type", Number)], K.prototype, "direction", void 0), k([_({ fallback: 2 }), O("design:type", Number)], K.prototype, "fillMode", void 0), k([_({ fallback: 0 }), O("design:type", Number)], K.prototype, "seed", void 0), k([_({ default: () => [2, 2] }), O("design:type", Array)], K.prototype, "red", void 0), k([_({ default: () => [-10, 4] }), O("design:type", Array)], K.prototype, "green", void 0), k([_({ default: () => [10, -4] }), O("design:type", Array)], K.prototype, "blue", void 0), K = ri = k([S("GlitchEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], K);
6126
+ A([_({ fallback: 10 }), k("design:type", Number)], q.prototype, "slices", void 0), A([_({ fallback: 512 }), k("design:type", Number)], q.prototype, "sampleSize", void 0), A([_({ fallback: 100 }), k("design:type", Number)], q.prototype, "offset", void 0), A([_({ fallback: 0 }), k("design:type", Number)], q.prototype, "direction", void 0), A([_({ fallback: 2 }), k("design:type", Number)], q.prototype, "fillMode", void 0), A([_({ fallback: 0 }), k("design:type", Number)], q.prototype, "seed", void 0), A([_({ default: () => [2, 2] }), k("design:type", Array)], q.prototype, "red", void 0), A([_({ default: () => [-10, 4] }), k("design:type", Array)], q.prototype, "green", void 0), A([_({ default: () => [10, -4] }), k("design:type", Array)], q.prototype, "blue", void 0), q = ni = A([S("GlitchEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], q);
6060
6127
  //#endregion
6061
6128
  //#region src/scene/effects/GodrayEffect.ts
6062
- var ii, ai = "vec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 permute(vec4 x) {\n return mod289(((x * 34.0) + 1.0) * x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\nvec3 fade(vec3 t) {\n return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\n}\n// Classic Perlin noise, periodic variant\nfloat pnoise(vec3 P, vec3 rep) {\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n vec3 g000 = vec3(gx0.x, gy0.x, gz0.x);\n vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);\n vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);\n vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);\n vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);\n vec3 g101 = vec3(gx1.y, gy1.y, gz1.y);\n vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);\n vec3 g111 = vec3(gx1.w, gy1.w, gz1.w);\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\nfloat turb(vec3 P, vec3 rep, float lacunarity, float gain) {\n float sum = 0.0;\n float sc = 1.0;\n float totalgain = 1.0;\n for (float i = 0.0; i < 6.0; i++) {\n sum += totalgain * pnoise(P * sc, rep);\n sc *= lacunarity;\n totalgain *= gain;\n }\n return abs(sum);\n}", q = class extends U {
6129
+ var ri, ii = "vec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 permute(vec4 x) {\n return mod289(((x * 34.0) + 1.0) * x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\nvec3 fade(vec3 t) {\n return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\n}\n// Classic Perlin noise, periodic variant\nfloat pnoise(vec3 P, vec3 rep) {\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n vec3 g000 = vec3(gx0.x, gy0.x, gz0.x);\n vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);\n vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);\n vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);\n vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);\n vec3 g101 = vec3(gx1.y, gy1.y, gz1.y);\n vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);\n vec3 g111 = vec3(gx1.w, gy1.w, gz1.w);\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\nfloat turb(vec3 P, vec3 rep, float lacunarity, float gain) {\n float sum = 0.0;\n float sc = 1.0;\n float totalgain = 1.0;\n for (float i = 0.0; i < 6.0; i++) {\n sum += totalgain * pnoise(P * sc, rep);\n sc *= lacunarity;\n totalgain *= gain;\n }\n return abs(sum);\n}", J = class extends W {
6063
6130
  static {
6064
- ii = this;
6131
+ ri = this;
6065
6132
  }
6066
- static material = new I({ gl: {
6133
+ static material = new L({ gl: {
6067
6134
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
6068
6135
  fragment: `precision highp float;
6069
6136
  varying vec2 vUv;
@@ -6076,7 +6143,7 @@ uniform float uTime;
6076
6143
  uniform vec3 uRay;
6077
6144
  uniform vec4 uInputSize;
6078
6145
 
6079
- ${ai}
6146
+ ${ii}
6080
6147
 
6081
6148
  void main(void) {
6082
6149
  bool uParallel = uParallel > 0.5;
@@ -6115,7 +6182,7 @@ void main(void) {
6115
6182
  apply(e, t) {
6116
6183
  let n = this.angle * (Math.PI / 180), r = this.parallel ? [Math.cos(n), Math.sin(n)] : this.center;
6117
6184
  t.redraw(e, () => {
6118
- L.draw(e, ii.material, {
6185
+ R.draw(e, ri.material, {
6119
6186
  sampler: 0,
6120
6187
  uDimensions: [t.width, t.height],
6121
6188
  uParallel: +!!this.parallel,
@@ -6137,15 +6204,15 @@ void main(void) {
6137
6204
  });
6138
6205
  }
6139
6206
  };
6140
- k([_({ fallback: 0 }), O("design:type", Number)], q.prototype, "time", void 0), k([_({ fallback: 30 }), O("design:type", Number)], q.prototype, "angle", void 0), k([_({ fallback: .5 }), O("design:type", Number)], q.prototype, "gain", void 0), k([_({ fallback: 2.5 }), O("design:type", Number)], q.prototype, "lacunarity", void 0), k([_({ fallback: !0 }), O("design:type", Boolean)], q.prototype, "parallel", void 0), k([_({ default: () => [0, 0] }), O("design:type", Array)], q.prototype, "center", void 0), k([_({ fallback: 1 }), O("design:type", Number)], q.prototype, "alpha", void 0), q = ii = k([S("GodrayEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], q);
6207
+ A([_({ fallback: 0 }), k("design:type", Number)], J.prototype, "time", void 0), A([_({ fallback: 30 }), k("design:type", Number)], J.prototype, "angle", void 0), A([_({ fallback: .5 }), k("design:type", Number)], J.prototype, "gain", void 0), A([_({ fallback: 2.5 }), k("design:type", Number)], J.prototype, "lacunarity", void 0), A([_({ fallback: !0 }), k("design:type", Boolean)], J.prototype, "parallel", void 0), A([_({ default: () => [0, 0] }), k("design:type", Array)], J.prototype, "center", void 0), A([_({ fallback: 1 }), k("design:type", Number)], J.prototype, "alpha", void 0), J = ri = A([S("GodrayEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], J);
6141
6208
  //#endregion
6142
6209
  //#region src/scene/effects/KawaseBlurEffect.ts
6143
- var oi = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y - uOffset.y));\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y - uOffset.y));\n color *= 0.25;\n gl_FragColor = color;\n}", si = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\nuniform vec4 uInputClamp;\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color *= 0.25;\n gl_FragColor = color;\n}", ci = class extends U {
6210
+ var ai = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y - uOffset.y));\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y - uOffset.y));\n color *= 0.25;\n gl_FragColor = color;\n}", oi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\nuniform vec4 uInputClamp;\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color *= 0.25;\n gl_FragColor = color;\n}", si = class extends W {
6144
6211
  _kernels = [0];
6145
6212
  constructor(e, t = []) {
6146
- super(), this.material = new I({ gl: {
6213
+ super(), this.material = new L({ gl: {
6147
6214
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
6148
- fragment: e?.clamp ? si : oi
6215
+ fragment: e?.clamp ? oi : ai
6149
6216
  } }), this.setProperties(e).append(t), this._generateKernels();
6150
6217
  }
6151
6218
  _updateProperty(e, t, n) {
@@ -6169,7 +6236,7 @@ var oi = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n
6169
6236
  this._kernels.forEach((i) => {
6170
6237
  let a = i + .5;
6171
6238
  t.redraw(e, () => {
6172
- L.draw(e, this.material, {
6239
+ R.draw(e, this.material, {
6173
6240
  sampler: 0,
6174
6241
  uOffset: [a * n, a * r],
6175
6242
  uInputClamp: [
@@ -6183,14 +6250,14 @@ var oi = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n
6183
6250
  });
6184
6251
  }
6185
6252
  };
6186
- k([_({ fallback: 4 }), O("design:type", Number)], ci.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], ci.prototype, "quality", void 0), k([_({ default: () => [1, 1] }), O("design:type", Array)], ci.prototype, "pixelSize", void 0), ci = k([S("KawaseBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ci);
6253
+ A([_({ fallback: 4 }), k("design:type", Number)], si.prototype, "strength", void 0), A([_({ fallback: 3 }), k("design:type", Number)], si.prototype, "quality", void 0), A([_({ default: () => [1, 1] }), k("design:type", Array)], si.prototype, "pixelSize", void 0), si = A([S("KawaseBlurEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], si);
6187
6254
  //#endregion
6188
6255
  //#region src/scene/effects/MaskEffect.ts
6189
- var li, ui = class extends U {
6256
+ var ci, li = class extends W {
6190
6257
  static {
6191
- li = this;
6258
+ ci = this;
6192
6259
  }
6193
- static material = new I({ gl: {
6260
+ static material = new L({ gl: {
6194
6261
  vertex: "attribute vec2 position;\nin vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
6195
6262
  fragment: "in vec2 vUv;\n\nuniform sampler2D sampler;\nuniform sampler2D mask;\nuniform float rotation;\n\nvec2 rotateUV(vec2 uv, float angle) {\n uv -= 0.5;\n float cosAngle = cos(angle);\n float sinAngle = sin(angle);\n mat2 rotationMatrix = mat2(\n cosAngle, -sinAngle,\n sinAngle, cosAngle\n );\n uv = rotationMatrix * uv;\n uv += 0.5;\n return uv;\n}\n\nvoid main(void) {\n vec4 color = texture(sampler, vUv);\n vec4 maskColor = texture(mask, rotateUV(vUv, rotation));\n gl_FragColor = mix(vec4(0.), color, maskColor.a);\n}"
6196
6263
  } });
@@ -6210,7 +6277,7 @@ var li, ui = class extends U {
6210
6277
  }
6211
6278
  apply(e, t, n) {
6212
6279
  this.texture && t.redraw(e, () => {
6213
- this.texture.activate(e, 1), L.draw(e, li.material, {
6280
+ this.texture.activate(e, 1), R.draw(e, ci.material, {
6214
6281
  sampler: 0,
6215
6282
  mask: 1,
6216
6283
  rotation: n.target?.globalRotation ?? 0
@@ -6218,33 +6285,33 @@ var li, ui = class extends U {
6218
6285
  });
6219
6286
  }
6220
6287
  };
6221
- k([_({ fallback: "" }), O("design:type", String)], ui.prototype, "image", void 0), ui = li = k([S("MaskEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ui);
6288
+ A([_({ fallback: "" }), k("design:type", String)], li.prototype, "image", void 0), li = ci = A([S("MaskEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], li);
6222
6289
  //#endregion
6223
6290
  //#region src/scene/effects/OutlineEffect.ts
6224
- var di, fi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uThickness;\nuniform vec3 uColor;\nuniform float uAlpha;\nuniform float uKnockout;\nuniform vec4 uInputClamp;\n\nconst float DOUBLE_PI = 2. * 3.14159265358979323846264;\nconst float ANGLE_STEP = {ANGLE_STEP};\n\nfloat outlineMaxAlphaAtPos(vec2 pos) {\n if (uThickness.x == 0. || uThickness.y == 0.) {\n return 0.;\n }\n vec4 displacedColor;\n vec2 displacedPos;\n float maxAlpha = 0.;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ANGLE_STEP) {\n displacedPos.x = vUv.x + uThickness.x * cos(angle);\n displacedPos.y = vUv.y + uThickness.y * sin(angle);\n displacedColor = texture2D(sampler, clamp(displacedPos, uInputClamp.xy, uInputClamp.zw));\n maxAlpha = max(maxAlpha, displacedColor.a);\n }\n return maxAlpha;\n}\n\nvoid main(void) {\n vec4 sourceColor = texture2D(sampler, vUv);\n vec4 contentColor = sourceColor * float(uKnockout < 0.5);\n float outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vUv.xy) * (1.-sourceColor.a);\n vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);\n gl_FragColor = contentColor + outlineColor;\n}", J = class extends U {
6291
+ var ui, di = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uThickness;\nuniform vec3 uColor;\nuniform float uAlpha;\nuniform float uKnockout;\nuniform vec4 uInputClamp;\n\nconst float DOUBLE_PI = 2. * 3.14159265358979323846264;\nconst float ANGLE_STEP = {ANGLE_STEP};\n\nfloat outlineMaxAlphaAtPos(vec2 pos) {\n if (uThickness.x == 0. || uThickness.y == 0.) {\n return 0.;\n }\n vec4 displacedColor;\n vec2 displacedPos;\n float maxAlpha = 0.;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ANGLE_STEP) {\n displacedPos.x = vUv.x + uThickness.x * cos(angle);\n displacedPos.y = vUv.y + uThickness.y * sin(angle);\n displacedColor = texture2D(sampler, clamp(displacedPos, uInputClamp.xy, uInputClamp.zw));\n maxAlpha = max(maxAlpha, displacedColor.a);\n }\n return maxAlpha;\n}\n\nvoid main(void) {\n vec4 sourceColor = texture2D(sampler, vUv);\n vec4 contentColor = sourceColor * float(uKnockout < 0.5);\n float outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vUv.xy) * (1.-sourceColor.a);\n vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);\n gl_FragColor = contentColor + outlineColor;\n}", fi = class extends W {
6225
6292
  static {
6226
- di = this;
6293
+ ui = this;
6227
6294
  }
6228
6295
  static MIN_SAMPLES = 1;
6229
6296
  static MAX_SAMPLES = 100;
6230
6297
  static getAngleStep(e) {
6231
- return Number.parseFloat((Math.PI * 2 / Math.max(e * di.MAX_SAMPLES, di.MIN_SAMPLES)).toFixed(7));
6298
+ return Number.parseFloat((Math.PI * 2 / Math.max(e * ui.MAX_SAMPLES, ui.MIN_SAMPLES)).toFixed(7));
6232
6299
  }
6233
- _color = new yt();
6300
+ _color = new E();
6234
6301
  constructor(e, t = []) {
6235
- super(), this.setProperties(e).append(t), this.material = new I({ gl: {
6302
+ super(), this.setProperties(e).append(t), this.material = new L({ gl: {
6236
6303
  vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
6237
- fragment: fi.replace(/\{ANGLE_STEP\}/, di.getAngleStep(this.quality).toFixed(7))
6304
+ fragment: di.replace(/\{ANGLE_STEP\}/, ui.getAngleStep(this.quality).toFixed(7))
6238
6305
  } });
6239
6306
  }
6240
6307
  apply(e, t) {
6241
6308
  t.redraw(e, () => {
6242
- this._color.value = this.color, L.draw(e, this.material, {
6309
+ this._color.value = this.color, R.draw(e, this.material, {
6243
6310
  sampler: 0,
6244
6311
  uThickness: [this.width / t.width, this.width / t.height],
6245
6312
  uColor: this._color.toArray().slice(0, 3),
6246
6313
  uAlpha: this.opacity === 1 ? this._color.a : this.opacity,
6247
- uAngleStep: di.getAngleStep(this.quality),
6314
+ uAngleStep: ui.getAngleStep(this.quality),
6248
6315
  uKnockout: +!!this.knockout,
6249
6316
  uInputClamp: [
6250
6317
  0,
@@ -6256,14 +6323,14 @@ var di, fi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampl
6256
6323
  });
6257
6324
  }
6258
6325
  };
6259
- k([_({ fallback: "#000000ff" }), O("design:type", Object)], J.prototype, "color", void 0), k([_({ fallback: 1 }), O("design:type", Number)], J.prototype, "width", void 0), k([_({ fallback: "solid" }), O("design:type", String)], J.prototype, "style", void 0), k([_(), O("design:type", Object)], J.prototype, "image", void 0), k([_({ fallback: 1 }), O("design:type", Number)], J.prototype, "opacity", void 0), k([_({ fallback: .1 }), O("design:type", Number)], J.prototype, "quality", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], J.prototype, "knockout", void 0), J = di = k([S("OutlineEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], J);
6326
+ A([_({ fallback: "#000000ff" }), k("design:type", Object)], fi.prototype, "color", void 0), A([_({ fallback: 1 }), k("design:type", Number)], fi.prototype, "width", void 0), A([_({ fallback: "solid" }), k("design:type", String)], fi.prototype, "style", void 0), A([_(), k("design:type", Object)], fi.prototype, "image", void 0), A([_({ fallback: 1 }), k("design:type", Number)], fi.prototype, "opacity", void 0), A([_({ fallback: .1 }), k("design:type", Number)], fi.prototype, "quality", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], fi.prototype, "knockout", void 0), fi = ui = A([S("OutlineEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], fi);
6260
6327
  //#endregion
6261
6328
  //#region src/scene/effects/PixelateEffect.ts
6262
- var pi, mi = class extends U {
6329
+ var pi, mi = class extends W {
6263
6330
  static {
6264
6331
  pi = this;
6265
6332
  }
6266
- static material = new I({ gl: {
6333
+ static material = new L({ gl: {
6267
6334
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
6268
6335
  fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 offset;\nuniform vec2 step;\n\nvoid main(void) {\n vec2 uv = vUv;\n uv = floor((uv - offset) / step) * step + offset + step / 2.0;\n gl_FragColor = texture2D(sampler, uv);\n}"
6269
6336
  } });
@@ -6277,18 +6344,18 @@ var pi, mi = class extends U {
6277
6344
  offset: [(r[0] + i[0]) / t.width, 1 - (r[1] + i[1]) / t.height],
6278
6345
  step: [this.strength * r[0] / t.width, this.strength * r[1] / t.height]
6279
6346
  };
6280
- L.draw(e, pi.material, a);
6347
+ R.draw(e, pi.material, a);
6281
6348
  });
6282
6349
  }
6283
6350
  };
6284
- k([_({ fallback: 10 }), O("design:type", Number)], mi.prototype, "strength", void 0), mi = pi = k([S("PixelateEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], mi);
6351
+ A([_({ fallback: 10 }), k("design:type", Number)], mi.prototype, "strength", void 0), mi = pi = A([S("PixelateEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], mi);
6285
6352
  //#endregion
6286
6353
  //#region src/scene/effects/ZoomBlurEffect.ts
6287
- var hi, gi = class extends U {
6354
+ var hi, gi = class extends W {
6288
6355
  static {
6289
6356
  hi = this;
6290
6357
  }
6291
- static material = new I({ gl: {
6358
+ static material = new L({ gl: {
6292
6359
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
6293
6360
  fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec4 uInputSize;\n\nuniform vec2 uCenter;\nuniform float uStrength;\nuniform float uInnerRadius;\nuniform float uRadius;\n\nconst float MAX_KERNEL_SIZE = 32.0;\n\nhighp float rand(vec2 co, float seed) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159);\n return fract(sin(sn) * c + seed);\n}\n\nvoid main() {\n float minGradient = uInnerRadius * 0.3;\n float innerRadius1 = (uInnerRadius + minGradient * 0.5) / uInputSize.x;\n\n float gradient = uRadius * 0.3;\n float radius1 = (uRadius - gradient * 0.5) / uInputSize.x;\n\n float countLimit = MAX_KERNEL_SIZE;\n\n vec2 dir = vec2(uCenter.xy / uInputSize.xy - vUv);\n float dist = length(vec2(dir.x, dir.y * uInputSize.y / uInputSize.x));\n\n float strength1 = uStrength;\n\n float delta = 0.0;\n float gap;\n if (dist < innerRadius1) {\n delta = innerRadius1 - dist;\n gap = minGradient;\n } else if (radius1 >= 0.0 && dist > radius1) { // radius1 < 0 means it's infinity\n delta = dist - radius1;\n gap = gradient;\n }\n\n if (delta > 0.0) {\n float normalCount = gap / uInputSize.x;\n delta = (normalCount - delta) / normalCount;\n countLimit *= delta;\n strength1 *= delta;\n if (countLimit < 1.0) {\n gl_FragColor = texture2D(sampler, vUv);\n return;\n }\n }\n\n float offset = rand(vUv, 0.0);\n\n float total = 0.0;\n vec4 color = vec4(0.0);\n\n dir *= strength1;\n\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\n float percent = (t + offset) / MAX_KERNEL_SIZE;\n float weight = 4.0 * (percent - percent * percent);\n vec2 p = vUv + dir * percent;\n color += texture2D(sampler, p) * weight;\n total += weight;\n\n if (t > countLimit){\n break;\n }\n }\n\n color /= total;\n\n gl_FragColor = color;\n}"
6294
6361
  } });
@@ -6297,7 +6364,7 @@ var hi, gi = class extends U {
6297
6364
  }
6298
6365
  apply(e, t) {
6299
6366
  t.redraw(e, () => {
6300
- L.draw(e, hi.material, {
6367
+ R.draw(e, hi.material, {
6301
6368
  sampler: 0,
6302
6369
  uCenter: [t.width / 2, t.height / 2],
6303
6370
  uInnerRadius: this.innerRadius,
@@ -6313,7 +6380,7 @@ var hi, gi = class extends U {
6313
6380
  });
6314
6381
  }
6315
6382
  };
6316
- k([_(), O("design:type", Array)], gi.prototype, "center", void 0), k([_({ fallback: 20 }), O("design:type", Number)], gi.prototype, "innerRadius", void 0), k([_({ fallback: -1 }), O("design:type", Number)], gi.prototype, "radius", void 0), k([_({ fallback: .1 }), O("design:type", Number)], gi.prototype, "strength", void 0), gi = hi = k([S("ZoomBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], gi);
6383
+ A([_(), k("design:type", Array)], gi.prototype, "center", void 0), A([_({ fallback: 20 }), k("design:type", Number)], gi.prototype, "innerRadius", void 0), A([_({ fallback: -1 }), k("design:type", Number)], gi.prototype, "radius", void 0), A([_({ fallback: .1 }), k("design:type", Number)], gi.prototype, "strength", void 0), gi = hi = A([S("ZoomBlurEffect"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], gi);
6317
6384
  //#endregion
6318
6385
  //#region src/scene/2d/element/utils.ts
6319
6386
  function _i(e, t) {
@@ -6371,7 +6438,7 @@ var Y = class extends T {
6371
6438
  }
6372
6439
  }
6373
6440
  async loadTexture() {
6374
- if (this.linearGradient || this.radialGradient) this.texture = new rr(this.linearGradient ?? this.radialGradient, Math.floor(this._parent.size.width), Math.floor(this._parent.size.height));
6441
+ if (this.linearGradient || this.radialGradient) this.texture = new nr(this.linearGradient ?? this.radialGradient, Math.floor(this._parent.size.width), Math.floor(this._parent.size.height));
6375
6442
  else if (d(this.image)) this.animatedTexture = void 0, this.texture = void 0;
6376
6443
  else if (this._parent.tree?.log(`load image ${this.image}`), this.image !== "viewport") {
6377
6444
  let e = this.image.split("?")[0].endsWith(".gif"), t = this.image, n = await $.loadBy(t, async () => {
@@ -6392,7 +6459,7 @@ var Y = class extends T {
6392
6459
  width: e,
6393
6460
  height: t
6394
6461
  } };
6395
- if (this.image === "viewport") n.fillStyle = new sr();
6462
+ if (this.image === "viewport") n.fillStyle = new or();
6396
6463
  else {
6397
6464
  let i = this.animatedTexture?.currentFrame.texture ?? this.texture;
6398
6465
  r = {
@@ -6433,7 +6500,7 @@ var Y = class extends T {
6433
6500
  this.updateFrameIndex();
6434
6501
  }
6435
6502
  };
6436
- k([_({ fallback: !0 }), O("design:type", Boolean)], Y.prototype, "enabled", void 0), k([_(), O("design:type", Object)], Y.prototype, "color", void 0), k([_(), O("design:type", Object)], Y.prototype, "image", void 0), k([_(), O("design:type", Object)], Y.prototype, "linearGradient", void 0), k([_(), O("design:type", Object)], Y.prototype, "radialGradient", void 0), k([_(), O("design:type", Object)], Y.prototype, "cropRect", void 0), k([_(), O("design:type", Object)], Y.prototype, "stretchRect", void 0), k([_(), O("design:type", Object)], Y.prototype, "dpi", void 0), k([_(), O("design:type", Object)], Y.prototype, "rotateWithShape", void 0), k([_(), O("design:type", Object)], Y.prototype, "tile", void 0), k([_(), O("design:type", Object)], Y.prototype, "opacity", void 0);
6503
+ A([_({ fallback: !0 }), k("design:type", Boolean)], Y.prototype, "enabled", void 0), A([_(), k("design:type", Object)], Y.prototype, "color", void 0), A([_(), k("design:type", Object)], Y.prototype, "image", void 0), A([_(), k("design:type", Object)], Y.prototype, "linearGradient", void 0), A([_(), k("design:type", Object)], Y.prototype, "radialGradient", void 0), A([_(), k("design:type", Object)], Y.prototype, "cropRect", void 0), A([_(), k("design:type", Object)], Y.prototype, "stretchRect", void 0), A([_(), k("design:type", Object)], Y.prototype, "dpi", void 0), A([_(), k("design:type", Object)], Y.prototype, "rotateWithShape", void 0), A([_(), k("design:type", Object)], Y.prototype, "tile", void 0), A([_(), k("design:type", Object)], Y.prototype, "opacity", void 0);
6437
6504
  //#endregion
6438
6505
  //#region src/scene/2d/element/Element2DBackground.ts
6439
6506
  var vi = class extends Y {
@@ -6448,7 +6515,7 @@ var vi = class extends Y {
6448
6515
  }
6449
6516
  }
6450
6517
  };
6451
- k([_(), O("design:type", Object)], vi.prototype, "fillWithShape", void 0);
6518
+ A([_(), k("design:type", Object)], vi.prototype, "fillWithShape", void 0);
6452
6519
  //#endregion
6453
6520
  //#region src/scene/2d/element/Element2DChart.ts
6454
6521
  var yi;
@@ -6546,7 +6613,7 @@ var X = class extends T {
6546
6613
  }), this._instance.setOption(this._toOption(), !0), !this._texture) {
6547
6614
  let e = this._container.querySelector("canvas");
6548
6615
  if (!e) return;
6549
- this._texture = new tr({
6616
+ this._texture = new er({
6550
6617
  source: e,
6551
6618
  pixelRatio: 1
6552
6619
  });
@@ -6559,7 +6626,7 @@ var X = class extends T {
6559
6626
  let n = document.createElement("canvas");
6560
6627
  n.width = Math.ceil(e), n.height = Math.ceil(t);
6561
6628
  let r = n.getContext("2d");
6562
- r && (r.fillStyle = "#f3f4f6", r.fillRect(0, 0, e, t), r.strokeStyle = "#d1d5db", r.setLineDash([6, 4]), r.strokeRect(1, 1, e - 2, t - 2), r.fillStyle = "#9ca3af", r.font = "14px sans-serif", r.textAlign = "center", r.textBaseline = "middle", r.fillText("图表需安装 echarts", e / 2, t / 2), this._texture ? this._texture.source = n : this._texture = new tr({
6629
+ r && (r.fillStyle = "#f3f4f6", r.fillRect(0, 0, e, t), r.strokeStyle = "#d1d5db", r.setLineDash([6, 4]), r.strokeRect(1, 1, e - 2, t - 2), r.fillStyle = "#9ca3af", r.font = "14px sans-serif", r.textAlign = "center", r.textBaseline = "middle", r.fillText("图表需安装 echarts", e / 2, t / 2), this._texture ? this._texture.source = n : this._texture = new er({
6563
6630
  source: n,
6564
6631
  pixelRatio: 1
6565
6632
  }), this._texture.requestUpdate("source"), this._parent.requestDraw());
@@ -6624,7 +6691,7 @@ var X = class extends T {
6624
6691
  this._teardown();
6625
6692
  }
6626
6693
  };
6627
- k([_({ fallback: !0 }), O("design:type", Boolean)], X.prototype, "enabled", void 0), k([_({ fallback: "column" }), O("design:type", Object)], X.prototype, "type", void 0), k([_(), O("design:type", Object)], X.prototype, "grouping", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], X.prototype, "categories", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], X.prototype, "series", void 0), k([_(), O("design:type", Object)], X.prototype, "title", void 0), k([_(), O("design:type", Object)], X.prototype, "legend", void 0), k([_(), O("design:type", Object)], X.prototype, "categoryAxis", void 0), k([_(), O("design:type", Object)], X.prototype, "valueAxis", void 0);
6694
+ A([_({ fallback: !0 }), k("design:type", Boolean)], X.prototype, "enabled", void 0), A([_({ fallback: "column" }), k("design:type", Object)], X.prototype, "type", void 0), A([_(), k("design:type", Object)], X.prototype, "grouping", void 0), A([_({ fallback: () => [] }), k("design:type", Object)], X.prototype, "categories", void 0), A([_({ fallback: () => [] }), k("design:type", Object)], X.prototype, "series", void 0), A([_(), k("design:type", Object)], X.prototype, "title", void 0), A([_(), k("design:type", Object)], X.prototype, "legend", void 0), A([_(), k("design:type", Object)], X.prototype, "categoryAxis", void 0), A([_(), k("design:type", Object)], X.prototype, "valueAxis", void 0);
6628
6695
  //#endregion
6629
6696
  //#region src/scene/2d/element/Element2DComments.ts
6630
6697
  var Si = class extends T {
@@ -6704,7 +6771,7 @@ var Si = class extends T {
6704
6771
  let n = t.shape.connectionPoints?.find((t) => t.idx === e.idx);
6705
6772
  if (n) {
6706
6773
  let e = t.globalTransform.apply(new x(n.x * t.size.x, n.y * t.size.y)), i;
6707
- return i = n.ang === void 0 ? Dr(n.x - .5, n.y - .5) : {
6774
+ return i = n.ang === void 0 ? Er(n.x - .5, n.y - .5) : {
6708
6775
  x: Math.cos(n.ang),
6709
6776
  y: Math.sin(n.ang)
6710
6777
  }, {
@@ -6732,10 +6799,10 @@ var Si = class extends T {
6732
6799
  return;
6733
6800
  }
6734
6801
  let n = (e) => e ? `${e.point.x},${e.point.y},${e.dir?.x ?? ""},${e.dir?.y ?? ""}` : "-", r = `${this.mode}|${n(e)}|${n(t)}`;
6735
- return (r !== this._routeSig || !this._routePath) && (this._routeSig = r, this._routePath = Or(this.mode, e ?? t, t ?? e)), this._routePath;
6802
+ return (r !== this._routeSig || !this._routePath) && (this._routeSig = r, this._routePath = Dr(this.mode, e ?? t, t ?? e)), this._routePath;
6736
6803
  }
6737
6804
  };
6738
- k([_(), O("design:type", Object)], Ci.prototype, "start", void 0), k([_(), O("design:type", Object)], Ci.prototype, "end", void 0), k([_({ fallback: "straight" }), O("design:type", Object)], Ci.prototype, "mode", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Ci.prototype, "labelPosition", void 0);
6805
+ A([_(), k("design:type", Object)], Ci.prototype, "start", void 0), A([_(), k("design:type", Object)], Ci.prototype, "end", void 0), A([_({ fallback: "straight" }), k("design:type", Object)], Ci.prototype, "mode", void 0), A([_({ fallback: .5 }), k("design:type", Number)], Ci.prototype, "labelPosition", void 0);
6739
6806
  function wi(e, t) {
6740
6807
  if (!t) return e;
6741
6808
  let n = Math.cos(t), r = Math.sin(t);
@@ -6835,7 +6902,7 @@ var ji = class extends Y {
6835
6902
  let e = await this._resolveSourceCanvas();
6836
6903
  if (!e) return;
6837
6904
  let t = e.width, n = e.height, r = await this._resolvePatterns(), i = Ai(e, this.effects, t, n, r);
6838
- this.texture = new z({
6905
+ this.texture = new B({
6839
6906
  source: i,
6840
6907
  width: t,
6841
6908
  height: n,
@@ -6869,7 +6936,7 @@ var ji = class extends Y {
6869
6936
  if (!(!r || !i)) return i.drawImage(e, 0, 0, t, n), r;
6870
6937
  }
6871
6938
  };
6872
- k([_(), O("design:type", Object)], ji.prototype, "fillWithShape", void 0), k([_(), O("design:type", Array)], ji.prototype, "effects", void 0);
6939
+ A([_(), k("design:type", Object)], ji.prototype, "fillWithShape", void 0), A([_(), k("design:type", Array)], ji.prototype, "effects", void 0);
6873
6940
  //#endregion
6874
6941
  //#region src/scene/2d/element/Element2DOutline.ts
6875
6942
  var Mi = {
@@ -6898,7 +6965,7 @@ var Mi = {
6898
6965
  }
6899
6966
  draw() {
6900
6967
  let { width: e, height: t } = this._parent.size, n = this._parent.context;
6901
- this.image === "viewport" ? n.strokeStyle = new sr() : n.strokeStyle = this.texture ?? this.color ?? "#000000FF", n.lineWidth = this.width || 1, n.lineCap = this.lineCap, n.lineJoin = this.lineJoin, n.stroke({ ..._i(this, {
6968
+ this.image === "viewport" ? n.strokeStyle = new or() : n.strokeStyle = this.texture ?? this.color ?? "#000000FF", n.lineWidth = this.width || 1, n.lineCap = this.lineCap, n.lineJoin = this.lineJoin, n.stroke({ ..._i(this, {
6902
6969
  x: 0,
6903
6970
  y: 0,
6904
6971
  width: e,
@@ -6925,7 +6992,7 @@ var Mi = {
6925
6992
  ee.fillStyle = i, ee.moveTo(e.x, e.y).lineTo(p + h, m + g).lineTo(p - h, m - g).closePath().fill();
6926
6993
  }
6927
6994
  };
6928
- k([_(), O("design:type", Object)], Ni.prototype, "color", void 0), k([_(), O("design:type", Object)], Ni.prototype, "width", void 0), k([_({ fallback: "solid" }), O("design:type", Object)], Ni.prototype, "style", void 0), k([_({ fallback: "butt" }), O("design:type", Object)], Ni.prototype, "lineCap", void 0), k([_({ fallback: "miter" }), O("design:type", Object)], Ni.prototype, "lineJoin", void 0), k([_(), O("design:type", Object)], Ni.prototype, "headEnd", void 0), k([_(), O("design:type", Object)], Ni.prototype, "tailEnd", void 0);
6995
+ A([_(), k("design:type", Object)], Ni.prototype, "color", void 0), A([_(), k("design:type", Object)], Ni.prototype, "width", void 0), A([_({ fallback: "solid" }), k("design:type", Object)], Ni.prototype, "style", void 0), A([_({ fallback: "butt" }), k("design:type", Object)], Ni.prototype, "lineCap", void 0), A([_({ fallback: "miter" }), k("design:type", Object)], Ni.prototype, "lineJoin", void 0), A([_(), k("design:type", Object)], Ni.prototype, "headEnd", void 0), A([_(), k("design:type", Object)], Ni.prototype, "tailEnd", void 0);
6929
6996
  //#endregion
6930
6997
  //#region src/scene/2d/element/Element2DShadow.ts
6931
6998
  var Pi = class extends T {
@@ -6949,10 +7016,10 @@ var Pi = class extends T {
6949
7016
  }
6950
7017
  updateEffect() {
6951
7018
  let e = "__$shadow", t = this._parent.getNode(e);
6952
- this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new ei({ name: e }), this._parent.appendChild(t, "back")), t.setProperties(this.getProperties())) : t && this._parent.removeChild(t);
7019
+ this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new $r({ name: e }), this._parent.appendChild(t, "back")), t.setProperties(this.getProperties())) : t && this._parent.removeChild(t);
6953
7020
  }
6954
7021
  };
6955
- k([_({ fallback: !0 }), O("design:type", Boolean)], Pi.prototype, "enabled", void 0), k([_({ fallback: "#000000FF" }), O("design:type", Object)], Pi.prototype, "color", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Pi.prototype, "blur", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Pi.prototype, "offsetY", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Pi.prototype, "offsetX", void 0);
7022
+ A([_({ fallback: !0 }), k("design:type", Boolean)], Pi.prototype, "enabled", void 0), A([_({ fallback: "#000000FF" }), k("design:type", Object)], Pi.prototype, "color", void 0), A([_({ fallback: 0 }), k("design:type", Object)], Pi.prototype, "blur", void 0), A([_({ fallback: 0 }), k("design:type", Object)], Pi.prototype, "offsetY", void 0), A([_({ fallback: 0 }), k("design:type", Object)], Pi.prototype, "offsetX", void 0);
6956
7023
  //#endregion
6957
7024
  //#region src/scene/2d/element/Element2DShape.ts
6958
7025
  var Fi = class extends T {
@@ -7053,10 +7120,10 @@ var Fi = class extends T {
7053
7120
  t && n && (r ? e.roundRect(0, 0, t, n, r) : e.rect(0, 0, t, n));
7054
7121
  }
7055
7122
  };
7056
- k([_({ fallback: !0 }), O("design:type", Boolean)], Fi.prototype, "enabled", void 0), k([_(), O("design:type", Object)], Fi.prototype, "preset", void 0), k([_(), O("design:type", Object)], Fi.prototype, "svg", void 0), k([_(), O("design:type", Object)], Fi.prototype, "viewBox", void 0), k([_(), O("design:type", Object)], Fi.prototype, "paths", void 0), k([_(), O("design:type", Object)], Fi.prototype, "connectionPoints", void 0);
7123
+ A([_({ fallback: !0 }), k("design:type", Boolean)], Fi.prototype, "enabled", void 0), A([_(), k("design:type", Object)], Fi.prototype, "preset", void 0), A([_(), k("design:type", Object)], Fi.prototype, "svg", void 0), A([_(), k("design:type", Object)], Fi.prototype, "viewBox", void 0), A([_(), k("design:type", Object)], Fi.prototype, "paths", void 0), A([_(), k("design:type", Object)], Fi.prototype, "connectionPoints", void 0);
7057
7124
  //#endregion
7058
7125
  //#region src/scene/2d/element/Element2DStyle.ts
7059
- var Ii = class extends E {
7126
+ var Ii = class extends vt {
7060
7127
  constructor(e) {
7061
7128
  super(), this.setProperties(e);
7062
7129
  }
@@ -7130,7 +7197,7 @@ var Ri = 100, zi = 40, Bi = class extends T {
7130
7197
  }, r = `${JSON.stringify(e)}|${n.left},${n.top},${n.width},${n.height}`;
7131
7198
  if (this._cellNodes.has(t) && this._cellSnapshots.get(t) === r) continue;
7132
7199
  let i = this._cellNodes.get(t);
7133
- i || (i = B.parse({ is: "Element2D" }, "Element2D"), this._parent.appendChild(i, "back"), this._cellNodes.set(t, i)), this._applyCell(i, e, n), this._cellSnapshots.set(t, r);
7200
+ i || (i = V.parse({ is: "Element2D" }, "Element2D"), this._parent.appendChild(i, "back"), this._cellNodes.set(t, i)), this._applyCell(i, e, n), this._cellSnapshots.set(t, r);
7134
7201
  }
7135
7202
  for (let [e, t] of this._cellNodes) s.has(e) || (this._parent.removeChild(t), t.destroy(), this._cellNodes.delete(e), this._cellSnapshots.delete(e));
7136
7203
  this._parent.requestDraw();
@@ -7142,7 +7209,7 @@ var Ri = 100, zi = 40, Bi = class extends T {
7142
7209
  }, e.background = t.background;
7143
7210
  for (let t of [...e.getChildren(!0)]) e.removeChild(t), t.destroy();
7144
7211
  t.children?.forEach((t) => {
7145
- e.appendChild(B.parse(t, "Element2D"));
7212
+ e.appendChild(V.parse(t, "Element2D"));
7146
7213
  });
7147
7214
  }
7148
7215
  _clearCells() {
@@ -7153,7 +7220,7 @@ var Ri = 100, zi = 40, Bi = class extends T {
7153
7220
  this._clearCells();
7154
7221
  }
7155
7222
  };
7156
- k([_({ fallback: !0 }), O("design:type", Boolean)], Bi.prototype, "enabled", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Bi.prototype, "columns", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Bi.prototype, "rows", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Bi.prototype, "cells", void 0);
7223
+ A([_({ fallback: !0 }), k("design:type", Boolean)], Bi.prototype, "enabled", void 0), A([_({ fallback: () => [] }), k("design:type", Object)], Bi.prototype, "columns", void 0), A([_({ fallback: () => [] }), k("design:type", Object)], Bi.prototype, "rows", void 0), A([_({ fallback: () => [] }), k("design:type", Object)], Bi.prototype, "cells", void 0);
7157
7224
  //#endregion
7158
7225
  //#region src/scene/2d/element/Element2DText.ts
7159
7226
  var Z = class extends T {
@@ -7167,7 +7234,7 @@ var Z = class extends T {
7167
7234
  }
7168
7235
  _textContent = "";
7169
7236
  _autoDrawMode;
7170
- _texture = new tr({ mipmap: !0 });
7237
+ _texture = new er({ mipmap: !0 });
7171
7238
  _textureMap = /* @__PURE__ */ new Map();
7172
7239
  constructor(e) {
7173
7240
  super(), this._parent = e, this.base = new _e(), this.base.setPropertyAccessor(this);
@@ -7239,7 +7306,7 @@ var Z = class extends T {
7239
7306
  }), this._parent.requestDraw());
7240
7307
  }
7241
7308
  async _loadTexture(e, t) {
7242
- return e.linearGradient || e.radialGradient ? new rr(e.linearGradient ?? e.radialGradient, t.width, t.height) : d(e.image) ? void 0 : (this._parent.tree?.log(`load image ${e.image}`), await $.texture.load(e.image));
7309
+ return e.linearGradient || e.radialGradient ? new nr(e.linearGradient ?? e.radialGradient, t.width, t.height) : d(e.image) ? void 0 : (this._parent.tree?.log(`load image ${e.image}`), await $.texture.load(e.image));
7243
7310
  }
7244
7311
  setContent(e) {
7245
7312
  this.content = oe(e);
@@ -7310,7 +7377,7 @@ var Z = class extends T {
7310
7377
  }
7311
7378
  process(e) {}
7312
7379
  };
7313
- k([_({ fallback: !0 }), O("design:type", Object)], Z.prototype, "enabled", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Z.prototype, "content", void 0), k([_({ alias: "_parent.style.json" }), O("design:type", Object)], Z.prototype, "style", void 0), k([_(), O("design:type", Object)], Z.prototype, "effects", void 0), k([_(), O("design:type", Object)], Z.prototype, "fill", void 0), k([_(), O("design:type", Object)], Z.prototype, "outline", void 0), k([_(), O("design:type", Object)], Z.prototype, "deformation", void 0), k([_({ alias: "base.measureDom" }), O("design:type", typeof HTMLElement > "u" ? Object : HTMLElement)], Z.prototype, "measureDom", void 0), k([_({ alias: "base.fonts" }), O("design:type", Object)], Z.prototype, "fonts", void 0), k([_({ fallback: "auto" }), O("design:type", Object)], Z.prototype, "drawMode", void 0);
7380
+ A([_({ fallback: !0 }), k("design:type", Object)], Z.prototype, "enabled", void 0), A([_({ fallback: () => [] }), k("design:type", Object)], Z.prototype, "content", void 0), A([_({ alias: "_parent.style.json" }), k("design:type", Object)], Z.prototype, "style", void 0), A([_(), k("design:type", Object)], Z.prototype, "effects", void 0), A([_(), k("design:type", Object)], Z.prototype, "fill", void 0), A([_(), k("design:type", Object)], Z.prototype, "outline", void 0), A([_(), k("design:type", Object)], Z.prototype, "deformation", void 0), A([_({ alias: "base.measureDom" }), k("design:type", typeof HTMLElement > "u" ? Object : HTMLElement)], Z.prototype, "measureDom", void 0), A([_({ alias: "base.fonts" }), k("design:type", Object)], Z.prototype, "fonts", void 0), A([_({ fallback: "auto" }), k("design:type", Object)], Z.prototype, "drawMode", void 0);
7314
7381
  //#endregion
7315
7382
  //#region src/scene/2d/element/Flexbox.ts
7316
7383
  var Q = {
@@ -7542,10 +7609,10 @@ var Q = {
7542
7609
  [1, 0],
7543
7610
  [1, 1],
7544
7611
  [0, 1]
7545
- ], na = class extends Tr {
7612
+ ], na = class extends wr {
7546
7613
  flexbox = new Zi(this);
7547
- aabb = new vt();
7548
- globalAabb = new vt();
7614
+ aabb = new yt();
7615
+ globalAabb = new yt();
7549
7616
  _parentGlobalDisplay;
7550
7617
  _globalDisplay;
7551
7618
  get globalDisplay() {
@@ -7746,7 +7813,7 @@ var Q = {
7746
7813
  }), this.extraTransform.translate(this.pivot.x, this.pivot.y), this.updateGlobalTransform();
7747
7814
  break;
7748
7815
  case "transformOrigin": {
7749
- let e = Ir(t ?? "");
7816
+ let e = Fr(t ?? "");
7750
7817
  this.pivot.set(e[0] * this.size.width, e[1] * this.size.height);
7751
7818
  break;
7752
7819
  }
@@ -7823,7 +7890,11 @@ var Q = {
7823
7890
  let i = e.clone().applyTransform(new b().translate(-t.x, -t.y));
7824
7891
  this._shape.setLocalPath(i);
7825
7892
  }
7893
+ _renderCulled = !1;
7826
7894
  _cullsRender() {
7895
+ return this._renderCulled = this._computeCullsRender(), this._renderCulled;
7896
+ }
7897
+ _computeCullsRender() {
7827
7898
  if (this._colorFilterEffect || this._maskEffect || this._overflowHidden || this._connection.isValid()) return !1;
7828
7899
  let e = this.tree?.getCurrentViewport();
7829
7900
  return e?.valid ? !this._intersectsViewport(e) : !1;
@@ -7848,13 +7919,13 @@ var Q = {
7848
7919
  }
7849
7920
  _applyColorFilter() {
7850
7921
  let e = [this._styleFilter, this._elementFilter].filter(Boolean).join(" ").trim();
7851
- e ? (this._colorFilterEffect || (this._colorFilterEffect = new zr({
7922
+ e ? (this._colorFilterEffect || (this._colorFilterEffect = new Rr({
7852
7923
  name: "styleFilter",
7853
7924
  internalMode: "front"
7854
7925
  }), this.append(this._colorFilterEffect)), this._colorFilterEffect.filter = e) : (this._colorFilterEffect?.remove(), this._colorFilterEffect = void 0, this.requestRender());
7855
7926
  }
7856
7927
  _updateStyleMaskImage(e) {
7857
- d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new ui({
7928
+ d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new li({
7858
7929
  name: "styleMaskImage",
7859
7930
  internalMode: "back"
7860
7931
  }), this.append(this._maskEffect)), this._maskEffect.image = e);
@@ -7885,11 +7956,11 @@ var Q = {
7885
7956
  }
7886
7957
  getObb() {
7887
7958
  let e = this.pivot, t = this.transform.apply(e).sub(e);
7888
- return new wt(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.rotation);
7959
+ return new Ct(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.rotation);
7889
7960
  }
7890
7961
  getGlobalObb() {
7891
7962
  let e = this.pivot, t = this.globalTransform.apply(e).sub(e);
7892
- return new wt(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.globalRotation);
7963
+ return new Ct(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.globalRotation);
7893
7964
  }
7894
7965
  _draw() {
7895
7966
  super._draw(), this._background.isValid() && (this._shape.draw(!this._background.fillWithShape), this._background.draw()), this._fill.isValid() && (this._shape.draw(), this._fill.draw()), this._outline.isValid() && (this._shape.draw(), this._outline.draw()), this._foreground.isValid() && (this._shape.draw(!this._foreground.fillWithShape), this._foreground.draw()), this._text.isValid() && this._text.draw(), this._chart.isValid() && this._chart.draw(), this._drawContent();
@@ -7944,7 +8015,7 @@ var Q = {
7944
8015
  super._destroy(), this.flexbox.destroy(), this.aabb.destroy(), this.globalAabb.destroy(), this.size.destroy(), this.style.destroy(), this.background.destroy(), this.shape.destroy(), this.fill.destroy(), this.outline.destroy(), this.text.destroy(), this.foreground.destroy(), this.shadow.destroy(), this.connection.destroy(), this.comments.destroy(), this._colorFilterEffect = void 0, this._maskEffect = void 0;
7945
8016
  }
7946
8017
  };
7947
- na = k([S("Element2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], na);
8018
+ na = A([S("Element2D"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], na);
7948
8019
  //#endregion
7949
8020
  //#region src/scene/2d/TextureRect2D.ts
7950
8021
  var ra = class extends na {
@@ -7971,7 +8042,7 @@ var ra = class extends na {
7971
8042
  }
7972
8043
  }
7973
8044
  }, ia = class extends ra {
7974
- texture = new tr();
8045
+ texture = new er();
7975
8046
  animation;
7976
8047
  _lastTime = NaN;
7977
8048
  constructor(e, t = []) {
@@ -8001,7 +8072,7 @@ var ra = class extends na {
8001
8072
  this.currentTime !== this._lastTime && (this._lastTime = this.currentTime, this.animation?.goToAndStop(this.currentTime, !1), this.texture.requestUpdate("source"), this.requestDraw()), super._process(e);
8002
8073
  }
8003
8074
  };
8004
- k([_({ fallback: "" }), O("design:type", String)], ia.prototype, "src", void 0), ia = k([S("Lottie2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ia);
8075
+ A([_({ fallback: "" }), k("design:type", String)], ia.prototype, "src", void 0), ia = A([S("Lottie2D"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ia);
8005
8076
  //#endregion
8006
8077
  //#region src/scene/2d/Mesh2D.ts
8007
8078
  var aa = class extends na {
@@ -8048,17 +8119,17 @@ var aa = class extends na {
8048
8119
  }
8049
8120
  }
8050
8121
  _drawCircle(e, t) {
8051
- this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.fillStyle = z.WHITE, this.context.fill(), this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
8122
+ this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.fillStyle = B.WHITE, this.context.fill(), this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
8052
8123
  }
8053
8124
  _drawEllipse(e, t) {
8054
- this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.fillStyle = z.WHITE, this.context.fill(), this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
8125
+ this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.fillStyle = B.WHITE, this.context.fill(), this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
8055
8126
  }
8056
8127
  _draw() {
8057
8128
  let { width: e, height: t } = this.getRect();
8058
8129
  this.context.rect(0, 0, e, t), this.context.strokeStyle = "#00FF00", this.context.stroke(), this._drawCircle(0, 0), this._drawCircle(e, t), this._drawCircle(0, t), this._drawEllipse(0, t / 2), this._drawCircle(e, 0), this._drawEllipse(e, t / 2);
8059
8130
  }
8060
8131
  };
8061
- k([_({ fallback: 6 }), O("design:type", Number)], oa.prototype, "handleSize", void 0);
8132
+ A([_({ fallback: 6 }), k("design:type", Number)], oa.prototype, "handleSize", void 0);
8062
8133
  //#endregion
8063
8134
  //#region src/scene/2d/Video2D.ts
8064
8135
  var sa = class extends ra {
@@ -8092,16 +8163,25 @@ var sa = class extends ra {
8092
8163
  }
8093
8164
  _updateVideoCurrentTime() {
8094
8165
  let e = this.texture;
8095
- if (e && !e.isPlaying && !e.seeking) {
8096
- let t = ~~Math.max(0, this.currentTime % this.videoDuration) / 1e3;
8097
- e.currentTime !== t && (e.currentTime = t, $.awaitBy(() => e.waitSeek(this._loadAbort?.signal)));
8166
+ if (!e) return;
8167
+ let t = this.videoDuration;
8168
+ if (!t) return;
8169
+ if (!this.isVisibleInTree() || this._renderCulled) {
8170
+ e.paused || e.pause();
8171
+ return;
8098
8172
  }
8173
+ let n = Math.max(0, this.currentTime % t) / 1e3, r = this._timeline, i = r?.playbackRate ?? 1;
8174
+ if (r?.playing && i > 0) {
8175
+ e.muted = !0, e.loop = this.loop, e.playbackRate = D(i, .0625, 16), e.paused && e.isReady && e.play();
8176
+ let t = Math.abs(e.currentTime - n);
8177
+ !e.seeking && t > Math.max(.3, D(i, 1, 16) * .2) && (e.currentTime = n);
8178
+ } else e.paused || e.pause(), !e.isPlaying && !e.seeking && e.currentTime !== n && (e.currentTime = n, $.awaitBy(() => e.waitSeek(this._loadAbort?.signal)));
8099
8179
  }
8100
8180
  _process(e) {
8101
8181
  super._process(e), this._updateVideoCurrentTime();
8102
8182
  }
8103
8183
  };
8104
- k([_({ fallback: "" }), O("design:type", String)], sa.prototype, "src", void 0), sa = k([S("Video2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], sa);
8184
+ A([_({ fallback: "" }), k("design:type", String)], sa.prototype, "src", void 0), sa = A([S("Video2D"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], sa);
8105
8185
  //#endregion
8106
8186
  //#region src/scene/animation/Animation.ts
8107
8187
  function ca(e) {
@@ -8209,7 +8289,7 @@ var fa = {
8209
8289
  .355,
8210
8290
  1
8211
8291
  ]
8212
- }, pa = Object.fromEntries(Object.entries(fa).map(([e, [t, n, r, i]]) => [e, da(t, n, r, i)])), ma = class extends V {
8292
+ }, pa = Object.fromEntries(Object.entries(fa).map(([e, [t, n, r, i]]) => [e, da(t, n, r, i)])), ma = class extends H {
8213
8293
  _keyframes = [];
8214
8294
  _isFirstUpdatePosition = !1;
8215
8295
  _cachedProps = new t();
@@ -8278,7 +8358,7 @@ var fa = {
8278
8358
  }
8279
8359
  let e = this._getTargets(), t = 1 / e.length, n = this.currentTimeProgress;
8280
8360
  e.forEach((e, r) => {
8281
- let i = t === 1 ? n : St(Math.max(0, n - t * r) / t, 0, 1), a = this._cachedProps.get(e);
8361
+ let i = t === 1 ? n : D(Math.max(0, n - t * r) / t, 0, 1), a = this._cachedProps.get(e);
8282
8362
  if (!a) return;
8283
8363
  let o = this._parseKeyframes(i, a);
8284
8364
  o?.length && this._commitStyle(i, e, a, o[0], o[1]);
@@ -8349,7 +8429,7 @@ var fa = {
8349
8429
  startY: t.y
8350
8430
  }, this._pathMeasures.set(o, s);
8351
8431
  }
8352
- let c = St(D(ca(r.offsetDistance ?? i.offsetDistance), ca(i.offsetDistance ?? r.offsetDistance), a), 0, 1), { position: l, angle: u } = s.measure.getPosTanAtProgress(c), d = l.x - s.startX, f = l.y - s.startY, p = la(i.offsetRotate ?? r.offsetRotate, u), m = n.get("transform");
8432
+ let c = D(O(ca(r.offsetDistance ?? i.offsetDistance), ca(i.offsetDistance ?? r.offsetDistance), a), 0, 1), { position: l, angle: u } = s.measure.getPosTanAtProgress(c), d = l.x - s.startX, f = l.y - s.startY, p = la(i.offsetRotate ?? r.offsetRotate, u), m = n.get("transform");
8353
8433
  e.onUpdateStyleProperty("transform", `${m ? `${m} ` : ""}translate(${d}px, ${f}px) rotate(${p}deg)`, void 0);
8354
8434
  }
8355
8435
  _getDiffValue(e, t, n, r, i) {
@@ -8370,10 +8450,10 @@ var fa = {
8370
8450
  let a = Math.max(t[e]?.length ?? 0, n[e]?.length ?? 0), o = t[e], s = n[e];
8371
8451
  i += `${e}(${Array.from({ length: a }, (e, t) => {
8372
8452
  let n = o?.[t], i = s?.[t], a = n?.normalizedIntValue ?? 0, c = i?.normalizedIntValue ?? 0;
8373
- return Number.isNaN(a) || Number.isNaN(c) ? i?.value ?? 0 : D(a, c, r);
8453
+ return Number.isNaN(a) || Number.isNaN(c) ? i?.value ?? 0 : O(a, c, r);
8374
8454
  }).join(", ")}) `;
8375
8455
  }), i;
8376
- } else if (!Array.isArray(a) && !Array.isArray(o)) return Number.isNaN(a.normalizedIntValue) || Number.isNaN(o.normalizedIntValue) ? o.value : D(a.normalizedIntValue, o.normalizedIntValue, r);
8456
+ } else if (!Array.isArray(a) && !Array.isArray(o)) return Number.isNaN(a.normalizedIntValue) || Number.isNaN(o.normalizedIntValue) ? o.value : O(a.normalizedIntValue, o.normalizedIntValue, r);
8377
8457
  }
8378
8458
  isPlaying() {
8379
8459
  return !this.paused && this.isInsideTimeRange();
@@ -8396,11 +8476,11 @@ var fa = {
8396
8476
  });
8397
8477
  }
8398
8478
  };
8399
- k([_({ fallback: "parent" }), O("design:type", Object)], ma.prototype, "effectMode", void 0), k([_({ default: () => [] }), O("design:type", Array)], ma.prototype, "keyframes", void 0), k([_(), O("design:type", Object)], ma.prototype, "easing", void 0), ma = k([S("Animation", {
8479
+ A([_({ fallback: "parent" }), k("design:type", Object)], ma.prototype, "effectMode", void 0), A([_({ default: () => [] }), k("design:type", Array)], ma.prototype, "keyframes", void 0), A([_(), k("design:type", Object)], ma.prototype, "easing", void 0), ma = A([S("Animation", {
8400
8480
  renderMode: "disabled",
8401
8481
  processSortMode: "parent-before",
8402
8482
  duration: 2e3
8403
- }), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ma);
8483
+ }), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ma);
8404
8484
  //#endregion
8405
8485
  //#region src/scene/audio/html/HTMLAudioContext.ts
8406
8486
  var ha = class t extends e {
@@ -8905,7 +8985,7 @@ var Sa = class e extends va {
8905
8985
  createSound() {
8906
8986
  return new Ca();
8907
8987
  }
8908
- }, Ta, Ea = class extends V {
8988
+ }, Ta, Ea = class extends H {
8909
8989
  static {
8910
8990
  Ta = this;
8911
8991
  }
@@ -9036,14 +9116,14 @@ var Sa = class e extends va {
9036
9116
  }, 100);
9037
9117
  }
9038
9118
  };
9039
- Ea = Ta = k([S("Audio"), O("design:paramtypes", [Object])], Ea);
9119
+ Ea = Ta = A([S("Audio"), k("design:paramtypes", [Object])], Ea);
9040
9120
  //#endregion
9041
9121
  //#region src/scene/audio/AudioSpectrum.ts
9042
- var Da = class extends Tr {}, Oa = class extends na {
9122
+ var Da = class extends wr {}, Oa = class extends na {
9043
9123
  _audioBuffer;
9044
9124
  _src = (() => {
9045
9125
  let e = w();
9046
- return e ? new z({ source: e }) : void 0;
9126
+ return e ? new B({ source: e }) : void 0;
9047
9127
  })();
9048
9128
  _needsUpdateTexture = !1;
9049
9129
  constructor(e = {}) {
@@ -9098,16 +9178,16 @@ var Da = class extends Tr {}, Oa = class extends na {
9098
9178
  this.syncTexture(), super._process(e);
9099
9179
  }
9100
9180
  };
9101
- k([_(), O("design:type", Object)], Oa.prototype, "src", void 0), k([_({ fallback: 0 }), O("design:type", Number)], Oa.prototype, "gap", void 0), k([_({ fallback: "#000000" }), O("design:type", String)], Oa.prototype, "color", void 0), Oa = k([S("AudioWaveform"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], Oa);
9181
+ A([_(), k("design:type", Object)], Oa.prototype, "src", void 0), A([_({ fallback: 0 }), k("design:type", Number)], Oa.prototype, "gap", void 0), A([_({ fallback: "#000000" }), k("design:type", String)], Oa.prototype, "color", void 0), Oa = A([S("AudioWaveform"), k("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], Oa);
9102
9182
  //#endregion
9103
9183
  //#region src/scene/transitions/KawaseTransition.ts
9104
- var ka, Aa = class extends wr {
9184
+ var ka, Aa = class extends Cr {
9105
9185
  static {
9106
9186
  ka = this;
9107
9187
  }
9108
9188
  blur = 10;
9109
9189
  quality = 10;
9110
- static material = new I({ gl: {
9190
+ static material = new L({ gl: {
9111
9191
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
9112
9192
  fragment: "precision highp float;\nin vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 offset;\nuniform float progress;\n\nvoid main(void) {\n vec2 offset1 = vec2(offset.x - progress * offset.x, offset.y - progress * offset.y);\n vec4 color = vec4(0.0);\n color += texture(sampler, vec2(vUv.x - offset1.x, vUv.y + offset1.y));\n color += texture(sampler, vec2(vUv.x + offset1.x, vUv.y + offset1.y));\n color += texture(sampler, vec2(vUv.x + offset1.x, vUv.y - offset1.y));\n color += texture(sampler, vec2(vUv.x - offset1.x, vUv.y - offset1.y));\n color *= 0.25;\n gl_FragColor = color;\n}"
9113
9193
  } });
@@ -9122,7 +9202,7 @@ var ka, Aa = class extends wr {
9122
9202
  let d = 1 / s, f = 1 / c, p = [], m, h = o - 1;
9123
9203
  for (let e = 0; e < h; e++) m = u[e] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p });
9124
9204
  m = u[h] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p }), l.forEach((t) => {
9125
- L.draw(e, ka.material, {
9205
+ R.draw(e, ka.material, {
9126
9206
  sampler: r,
9127
9207
  progress: i,
9128
9208
  ...t
@@ -9130,35 +9210,35 @@ var ka, Aa = class extends wr {
9130
9210
  });
9131
9211
  }
9132
9212
  };
9133
- Aa = ka = k([S("KawaseTransition")], Aa);
9213
+ Aa = ka = A([S("KawaseTransition")], Aa);
9134
9214
  //#endregion
9135
9215
  //#region src/scene/transitions/LeftEraseTransition.ts
9136
- var ja, Ma = class extends wr {
9216
+ var ja, Ma = class extends Cr {
9137
9217
  static {
9138
9218
  ja = this;
9139
9219
  }
9140
- static material = new I({ gl: {
9220
+ static material = new L({ gl: {
9141
9221
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
9142
9222
  fragment: "precision highp float;\nvarying vec2 vUv;\nuniform float progress;\nuniform sampler2D previous;\nuniform sampler2D next;\n\nfloat easeInOutQuint(float t) {\n return t < 0.5 ? 16.0*t*t*t*t*t : 1.0+16.0*(--t)*t*t*t*t;\n}\n\nvoid main() {\n vec4 src1Color = texture2D(previous, vUv);\n vec4 src2Color = texture2D(next, vUv);\n float mProgress = 1.0 - progress;\n float mixPercent = 0.0;\n if (vUv.x <= mProgress) {\n mixPercent = 1.0;\n }\n gl_FragColor = mix(src2Color, src1Color, mixPercent);\n}"
9143
9223
  } });
9144
9224
  apply(e) {
9145
- L.draw(e, ja.material, {
9225
+ R.draw(e, ja.material, {
9146
9226
  previous: 0,
9147
9227
  next: 1,
9148
9228
  progress: this.currentTimeProgress
9149
9229
  });
9150
9230
  }
9151
9231
  };
9152
- Ma = ja = k([S("LeftEraseTransition")], Ma);
9232
+ Ma = ja = A([S("LeftEraseTransition")], Ma);
9153
9233
  //#endregion
9154
9234
  //#region src/scene/transitions/TiltShiftTransition.ts
9155
- var Na, Pa = class extends wr {
9235
+ var Na, Pa = class extends Cr {
9156
9236
  static {
9157
9237
  Na = this;
9158
9238
  }
9159
9239
  blur = 100;
9160
9240
  gradientBlur = 600;
9161
- static material = new I({ gl: {
9241
+ static material = new L({ gl: {
9162
9242
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
9163
9243
  fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\nuniform float progress;\n\nfloat random(vec3 scale, float seed) {\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void) {\n float blur1 = blur - progress * blur;\n float gradientBlur1 = progress * gradientBlur;\n\n vec4 color = vec4(0.0);\n float total = 0.0;\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vUv * texSize - start, normal)) / gradientBlur1) * blur1;\n\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample1 = texture2D(sampler, vUv + delta / texSize * percent * radius);\n sample1.rgb *= sample1.a;\n color += sample1 * weight;\n total += weight;\n }\n\n color /= total;\n color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}"
9164
9244
  } });
@@ -9166,7 +9246,7 @@ var Na, Pa = class extends wr {
9166
9246
  let n = this.currentTimeProgress, r, i;
9167
9247
  n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
9168
9248
  let a = t.width, o = t.height, s = [0, o / 2], c = [600, o / 2], l = [a, o], u = c[0] - s[0], d = c[1] - s[1], f = Math.sqrt(u * u + d * d);
9169
- L.draw(e, Na.material, {
9249
+ R.draw(e, Na.material, {
9170
9250
  sampler: r,
9171
9251
  progress: i,
9172
9252
  blur: this.blur,
@@ -9175,7 +9255,7 @@ var Na, Pa = class extends wr {
9175
9255
  end: c,
9176
9256
  delta: [u / f, d / f],
9177
9257
  texSize: l
9178
- }), L.draw(e, Na.material, {
9258
+ }), R.draw(e, Na.material, {
9179
9259
  sampler: r,
9180
9260
  progress: i,
9181
9261
  blur: this.blur,
@@ -9187,10 +9267,10 @@ var Na, Pa = class extends wr {
9187
9267
  });
9188
9268
  }
9189
9269
  };
9190
- Pa = Na = k([S("TiltShiftTransition")], Pa);
9270
+ Pa = Na = A([S("TiltShiftTransition")], Pa);
9191
9271
  //#endregion
9192
9272
  //#region src/scene/transitions/TwistTransition.ts
9193
- var Fa, Ia = class extends wr {
9273
+ var Fa, Ia = class extends Cr {
9194
9274
  static {
9195
9275
  Fa = this;
9196
9276
  }
@@ -9198,7 +9278,7 @@ var Fa, Ia = class extends wr {
9198
9278
  angle = 4;
9199
9279
  padding = 20;
9200
9280
  offset;
9201
- static material = new I({ gl: {
9281
+ static material = new L({ gl: {
9202
9282
  vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
9203
9283
  fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4 filterArea;\nuniform float progress;\n\nvec2 mapCoord(vec2 coord) {\n coord -= filterArea.zw;\n coord *= filterArea.xy;\n return coord;\n}\n\nvec2 unmapCoord(vec2 coord) {\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n return coord;\n}\n\nvec2 twist(vec2 coord, float radius) {\n coord -= offset;\n float dist = length(coord);\n if (dist < radius) {\n float ratioDist = (radius - dist) / radius;\n float angleMod = ratioDist * ratioDist * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n coord += offset;\n return coord;\n}\n\nvoid main(void) {\n vec2 coord = mapCoord(vUv);\n coord = twist(coord, radius - (progress * radius));\n coord = unmapCoord(coord);\n gl_FragColor = texture2D(sampler, coord);\n}"
9204
9284
  } });
@@ -9206,7 +9286,7 @@ var Fa, Ia = class extends wr {
9206
9286
  let n = this.currentTimeProgress, r, i;
9207
9287
  n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
9208
9288
  let a = t.width, o = t.height;
9209
- L.draw(e, Fa.material, {
9289
+ R.draw(e, Fa.material, {
9210
9290
  sampler: r,
9211
9291
  progress: i,
9212
9292
  filterArea: [
@@ -9222,16 +9302,16 @@ var Fa, Ia = class extends wr {
9222
9302
  });
9223
9303
  }
9224
9304
  };
9225
- Ia = Fa = k([S("TwistTransition")], Ia);
9305
+ Ia = Fa = A([S("TwistTransition")], Ia);
9226
9306
  //#endregion
9227
9307
  //#region src/asset/loaders/GifLoader.ts
9228
- var La = class extends Hn {
9308
+ var La = class extends Vn {
9229
9309
  install(e) {
9230
9310
  let t = async (t) => {
9231
9311
  let { decodeFrames: n } = await import("modern-gif");
9232
- return await t.arrayBuffer().then((t) => n(t, e.gifWorkerUrl ? { workerUrl: e.gifWorkerUrl } : void 0)).then((e) => new er(e.map((e) => ({
9312
+ return await t.arrayBuffer().then((t) => n(t, e.gifWorkerUrl ? { workerUrl: e.gifWorkerUrl } : void 0)).then((e) => new $n(e.map((e) => ({
9233
9313
  duration: e.delay,
9234
- texture: new ir({
9314
+ texture: new rr({
9235
9315
  source: e.data,
9236
9316
  width: e.width,
9237
9317
  height: e.height
@@ -9242,14 +9322,14 @@ var La = class extends Hn {
9242
9322
  e.register(n, t);
9243
9323
  }), e.gif = this, this;
9244
9324
  }
9245
- }, Ra = class extends Hn {
9325
+ }, Ra = class extends Vn {
9246
9326
  install(e) {
9247
9327
  let t = async (e) => JSON.parse(await e.text());
9248
9328
  return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), ["application/json"].forEach((n) => {
9249
9329
  e.register(n, t);
9250
9330
  }), e.json = this, this;
9251
9331
  }
9252
- }, za = class extends Hn {
9332
+ }, za = class extends Vn {
9253
9333
  install(e) {
9254
9334
  return this.load = async (t, n) => (await import("lottie-web").then((e) => e.default)).loadAnimation({
9255
9335
  container: null,
@@ -9260,14 +9340,14 @@ var La = class extends Hn {
9260
9340
  animationData: await e.loadBy(t, () => e.fetch(t).then((e) => e.json()))
9261
9341
  }), e.lottie = this, this;
9262
9342
  }
9263
- }, Ba = class extends Hn {
9343
+ }, Ba = class extends Vn {
9264
9344
  install(e) {
9265
9345
  let t = async (e) => e.text();
9266
9346
  return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), e.text = this, this;
9267
9347
  }
9268
- }, Va = class extends Hn {
9348
+ }, Va = class extends Vn {
9269
9349
  install(e) {
9270
- let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new z({
9350
+ let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new B({
9271
9351
  source: e,
9272
9352
  uploadMethodId: "image",
9273
9353
  mipmap: !0,
@@ -9289,9 +9369,9 @@ var La = class extends Hn {
9289
9369
  e.register(n, t);
9290
9370
  }), e.texture = this, this;
9291
9371
  }
9292
- }, Ha = class extends Hn {
9372
+ }, Ha = class extends Vn {
9293
9373
  install(e) {
9294
- return this.load = (t) => e.awaitBy(() => new or(t).load()), e.video = this, this;
9374
+ return this.load = (t) => e.awaitBy(() => new ar(t).load()), e.video = this, this;
9295
9375
  }
9296
9376
  }, Ua = Object.entries({
9297
9377
  "font/woff": ["woff"],
@@ -9415,14 +9495,14 @@ var Ka = "WeakRef" in globalThis, qa = class extends e {
9415
9495
  n && "destroy" in n && n.destroy();
9416
9496
  }), this._handled.clear();
9417
9497
  }
9418
- }, $ = new qa().use(new Un()).use(new La()).use(new Ra()).use(new za()).use(new Ba()).use(new Va()).use(new Ha()), Ja = {
9498
+ }, $ = new qa().use(new Hn()).use(new La()).use(new Ra()).use(new za()).use(new Ba()).use(new Va()).use(new Ha()), Ja = {
9419
9499
  alpha: !0,
9420
9500
  stencil: !0,
9421
9501
  antialias: !1,
9422
9502
  premultipliedAlpha: !0,
9423
9503
  preserveDrawingBuffer: !1,
9424
9504
  powerPreference: "default"
9425
- }, Ya = class extends Cr {
9505
+ }, Ya = class extends Sr {
9426
9506
  renderer;
9427
9507
  get view() {
9428
9508
  return this.renderer.view;
@@ -9454,7 +9534,7 @@ var Ka = "WeakRef" in globalThis, qa = class extends e {
9454
9534
  }) : void 0;
9455
9535
  constructor(e = {}) {
9456
9536
  let { view: t, width: n, height: r, pixelRatio: i = Je, autoResize: a, data: o } = e;
9457
- super(), this.renderer = new Vn(t, {
9537
+ super(), this.renderer = new Bn(t, {
9458
9538
  alpha: Ja.alpha ?? e.alpha,
9459
9539
  stencil: Ja.stencil ?? e.stencil,
9460
9540
  antialias: Ja.antialias ?? e.antialias,
@@ -9543,7 +9623,7 @@ var Ka = "WeakRef" in globalThis, qa = class extends e {
9543
9623
  super._destroy(), this._resizeObserver?.disconnect(), this.renderer.destroy();
9544
9624
  }
9545
9625
  };
9546
- k([_({ fallback: !1 }), O("design:type", Boolean)], Ya.prototype, "autoResize", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Ya.prototype, "autoStart", void 0);
9626
+ A([_({ fallback: !1 }), k("design:type", Boolean)], Ya.prototype, "autoResize", void 0), A([_({ fallback: !1 }), k("design:type", Boolean)], Ya.prototype, "autoStart", void 0);
9547
9627
  //#endregion
9548
9628
  //#region src/render.ts
9549
9629
  var Xa, Za = [], Qa = !1;
@@ -9599,4 +9679,4 @@ async function ro(e) {
9599
9679
  });
9600
9680
  }
9601
9681
  //#endregion
9602
- export { vt as Aabb2D, er as AnimatedTexture, ma as Animation, qa as Assets, Ea as Audio, va as AudioPipeline, ya as AudioProcessor, Da as AudioSpectrum, Oa as AudioWaveform, A as BufferUsage, Er as Camera2D, cr as CanvasContext, vr as CanvasItem, tr as CanvasTexture, yt as Color, W as ColorAdjustEffect, zr as ColorFilterEffect, Ct as ColorMatrix, Hr as ColorOverlayEffect, Wr as ColorRemoveEffect, qr as ColorReplaceEffect, nr as ColorTexture, T as CoreObject, bt as DEG_TO_RAD, Je as DEVICE_PIXEL_RATIO, G as DrawboardEffect, ei as DropShadowEffect, U as Effect, Zn as EffectMaterial, na as Element2D, vi as Element2DBackground, X as Element2DChart, Si as Element2DComments, Ci as Element2DConnection, Y as Element2DFill, ji as Element2DForeground, Ni as Element2DOutline, Pi as Element2DShadow, Fi as Element2DShape, Ii as Element2DStyle, Bi as Element2DTable, Z as Element2DText, ni as EmbossEffect, Ya as Engine, Zi as Flexbox, Un as FontLoader, Qr as GaussianBlurEffect, Gn as Geometry, La as GifLoader, un as GlBatch2DSystem, on as GlBlendMode, Ot as GlBuffer, Ft as GlBufferSystem, Dt as GlBufferTarget, mn as GlMaskSystem, qt as GlProgram, vn as GlRenderTarget, yn as GlRenderTargetSystem, nn as GlShaderSystem, cn as GlState, ln as GlStateSystem, gn as GlStencilSystem, j as GlSystem, _n as GlViewportSystem, K as GlitchEffect, q as GodrayEffect, rr as GradientTexture, _a as HTMLAudio, ha as HTMLAudioContext, ga as HTMLSound, Ke as IN_BROWSER, qe as IN_MAC_OS, Wn as IndexBuffer, gt as Input, ut as InputEvent, Ra as JsonLoader, ci as KawaseBlurEffect, Aa as KawaseTransition, dt as KeyboardInputEvent, Ma as LeftEraseTransition, Hn as Loader, ia as Lottie2D, za as LottieLoader, Et as MainLoop, ui as MaskEffect, I as Material, aa as Mesh2D, ur as Meta, ft as MouseInputEvent, B as Node, Tr as Node2D, wt as Obb2D, J as OutlineEffect, xe as PI, Se as PI_2, mi as PixelateEffect, ir as PixelsTexture, pt as PointerInputEvent, Tt as Projection2D, Kn as QuadGeometry, L as QuadUvGeometry, xt as RAD_TO_DEG, _t as RefCounted, R as RenderTarget, kt as Renderer, E as Resource, Ve as SUPPORTS_AUDIO_CONTEXT, ze as SUPPORTS_CLICK_EVENTS, Be as SUPPORTS_CREATE_IMAGE_BITMAP, Ne as SUPPORTS_IMAGE_BITMAP, Le as SUPPORTS_MOUSE_EVENTS, Ue as SUPPORTS_OFFLINE_AUDIO_CONTEXT, Fe as SUPPORTS_POINTER_EVENTS, Pe as SUPPORTS_RESIZE_OBSERVER, Re as SUPPORTS_TOUCH_EVENTS, Me as SUPPORTS_WEBGL2, He as SUPPORTS_WEBKIT_AUDIO_CONTEXT, We as SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, Ge as SUPPORTS_WEB_AUDIO, Ie as SUPPORTS_WHEEL_EVENTS, Cr as SceneTree, Ba as TextLoader, z as Texture2D, Va as TextureLoader, ra as TextureRect2D, C as Ticker, Pa as TiltShiftTransition, xr as Timeline, V as TimelineNode, oa as TransformRect2D, wr as Transition, Ia as TwistTransition, jt as UniformGroup, $n as UvGeometry, Qn as UvMaterial, F as VertexAttribute, P as VertexBuffer, sa as Video2D, Ha as VideoLoader, or as VideoTexture, H as Viewport, sr as ViewportTexture, wa as WebAudio, Sa as WebAudioContext, Vn as WebGLRenderer, Ca as WebSound, mt as WheelInputEvent, Sr as Window, gi as ZoomBlurEffect, Hi as alignMap, $ as assets, Dr as axisDir, Xi as boxSizingMap, St as clamp, si as clampFrag, w as createHTMLCanvas, Pt as createIdFromString, ye as createNode, st as crossOrigin, fa as cssEasingPresets, da as cubicBezier, S as customNode, ve as customNodes, Ja as defaultOptions, ot as determineCrossOrigin, Wi as directionMap, Ui as displayMap, Q as edgeMap, Gi as flexDirectionMap, Ki as flexWrapMap, oi as frag, nt as getCanvasFactory, De as getDefaultCssPropertyValue, at as getGlContextProvider, $a as getRenderEngine, Vi as gutterMap, lt as instanceId, Qe as isCanvasElement, Ye as isElementNode, Ze as isImageElement, Ce as isPow2, Xe as isVideoElement, $e as isWebgl2, qi as justifyMap, D as lerp, fn as log2, sn as mapGlBlendModes, dn as nextPow2, be as nextTick, Ji as overflowMap, Fr as parseCssFilter, ke as parseCssFunctions, Oe as parseCssProperty, Ir as parseCssTransformOrigin, Yi as positionTypeMap, no as render, ro as renderPixels, gr as resetBatchPool, Or as routeConnection, tt as setCanvasFactory, it as setGlContextProvider, hn as stencilModeMap };
9682
+ export { yt as Aabb2D, $n as AnimatedTexture, ma as Animation, qa as Assets, Ea as Audio, va as AudioPipeline, ya as AudioProcessor, Da as AudioSpectrum, Oa as AudioWaveform, j as BufferUsage, Tr as Camera2D, sr as CanvasContext, _r as CanvasItem, er as CanvasTexture, E as Color, G as ColorAdjustEffect, Rr as ColorFilterEffect, St as ColorMatrix, Vr as ColorOverlayEffect, Ur as ColorRemoveEffect, Kr as ColorReplaceEffect, tr as ColorTexture, T as CoreObject, bt as DEG_TO_RAD, Je as DEVICE_PIXEL_RATIO, K as DrawboardEffect, $r as DropShadowEffect, W as Effect, Xn as EffectMaterial, na as Element2D, vi as Element2DBackground, X as Element2DChart, Si as Element2DComments, Ci as Element2DConnection, Y as Element2DFill, ji as Element2DForeground, Ni as Element2DOutline, Pi as Element2DShadow, Fi as Element2DShape, Ii as Element2DStyle, Bi as Element2DTable, Z as Element2DText, ti as EmbossEffect, Ya as Engine, Zi as Flexbox, Hn as FontLoader, Zr as GaussianBlurEffect, Wn as Geometry, La as GifLoader, ln as GlBatch2DSystem, an as GlBlendMode, Dt as GlBuffer, Pt as GlBufferSystem, Et as GlBufferTarget, pn as GlMaskSystem, Kt as GlProgram, _n as GlRenderTarget, vn as GlRenderTargetSystem, tn as GlShaderSystem, sn as GlState, cn as GlStateSystem, hn as GlStencilSystem, M as GlSystem, gn as GlViewportSystem, q as GlitchEffect, J as GodrayEffect, nr as GradientTexture, _a as HTMLAudio, ha as HTMLAudioContext, ga as HTMLSound, Ke as IN_BROWSER, qe as IN_MAC_OS, Un as IndexBuffer, gt as Input, ut as InputEvent, Ra as JsonLoader, si as KawaseBlurEffect, Aa as KawaseTransition, dt as KeyboardInputEvent, Ma as LeftEraseTransition, Vn as Loader, ia as Lottie2D, za as LottieLoader, Tt as MainLoop, li as MaskEffect, L as Material, aa as Mesh2D, lr as Meta, ft as MouseInputEvent, V as Node, wr as Node2D, Ct as Obb2D, fi as OutlineEffect, xe as PI, Se as PI_2, mi as PixelateEffect, rr as PixelsTexture, pt as PointerInputEvent, wt as Projection2D, Gn as QuadGeometry, R as QuadUvGeometry, xt as RAD_TO_DEG, _t as RefCounted, z as RenderTarget, Ot as Renderer, vt as Resource, Ve as SUPPORTS_AUDIO_CONTEXT, ze as SUPPORTS_CLICK_EVENTS, Be as SUPPORTS_CREATE_IMAGE_BITMAP, Ne as SUPPORTS_IMAGE_BITMAP, Le as SUPPORTS_MOUSE_EVENTS, Ue as SUPPORTS_OFFLINE_AUDIO_CONTEXT, Fe as SUPPORTS_POINTER_EVENTS, Pe as SUPPORTS_RESIZE_OBSERVER, Re as SUPPORTS_TOUCH_EVENTS, Me as SUPPORTS_WEBGL2, He as SUPPORTS_WEBKIT_AUDIO_CONTEXT, We as SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, Ge as SUPPORTS_WEB_AUDIO, Ie as SUPPORTS_WHEEL_EVENTS, Sr as SceneTree, Ba as TextLoader, B as Texture2D, Va as TextureLoader, ra as TextureRect2D, C as Ticker, Pa as TiltShiftTransition, br as Timeline, H as TimelineNode, oa as TransformRect2D, Cr as Transition, Ia as TwistTransition, At as UniformGroup, Qn as UvGeometry, Zn as UvMaterial, I as VertexAttribute, F as VertexBuffer, sa as Video2D, Ha as VideoLoader, ar as VideoTexture, U as Viewport, or as ViewportTexture, wa as WebAudio, Sa as WebAudioContext, Bn as WebGLRenderer, Ca as WebSound, mt as WheelInputEvent, xr as Window, gi as ZoomBlurEffect, Hi as alignMap, $ as assets, Er as axisDir, Xi as boxSizingMap, D as clamp, oi as clampFrag, w as createHTMLCanvas, Nt as createIdFromString, ye as createNode, st as crossOrigin, fa as cssEasingPresets, da as cubicBezier, S as customNode, ve as customNodes, Ja as defaultOptions, ot as determineCrossOrigin, Wi as directionMap, Ui as displayMap, Q as edgeMap, Gi as flexDirectionMap, Ki as flexWrapMap, ai as frag, nt as getCanvasFactory, De as getDefaultCssPropertyValue, at as getGlContextProvider, $a as getRenderEngine, Vi as gutterMap, lt as instanceId, Qe as isCanvasElement, Ye as isElementNode, Ze as isImageElement, Ce as isPow2, Xe as isVideoElement, $e as isWebgl2, qi as justifyMap, O as lerp, dn as log2, on as mapGlBlendModes, un as nextPow2, be as nextTick, Ji as overflowMap, Pr as parseCssFilter, ke as parseCssFunctions, Oe as parseCssProperty, Fr as parseCssTransformOrigin, Yi as positionTypeMap, no as render, ro as renderPixels, hr as resetBatchPool, Dr as routeConnection, tt as setCanvasFactory, it as setGlContextProvider, mn as stencilModeMap };