modern-canvas 0.17.1 → 0.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import { Observable as e, RawWeakMap as t, Reactivable as n, clearUndef as r, defineProperty as i, getDefaultLayoutStyle as a, getDefaultStyle as o, getDefaultTextStyle as s, idGenerator as c, isColorFillObject as l, isGradient as u, isNone as d, normalizeBackground as f, normalizeFill as p, normalizeForeground as m, normalizeOutline as h, normalizeShadow as g, normalizeShape as ee, normalizeText as te, normalizeTextContent as ne, parseColor as re, property as _ } from "modern-idoc";
2
- import { BoundingBox as ie, Path2D as ae, Path2DSet as oe, Transform2D as v, Vector2 as y, svgToDom as se, svgToPath2DSet as ce } from "modern-path2d";
3
- import { extend as le } from "colord";
4
- import b from "colord/plugins/names";
5
- import { fonts as ue } from "modern-font";
6
- import { Character as de, Text as fe } from "modern-text";
1
+ import { Observable as e, RawWeakMap as t, Reactivable as n, clearUndef as r, defineProperty as i, getDefaultLayoutStyle as a, getDefaultStyle as o, getDefaultTextStyle as s, idGenerator as c, isColorFillObject as l, isGradient as u, isNone as d, normalizeBackground as f, normalizeConnection as p, normalizeFill as m, normalizeForeground as h, normalizeOutline as g, normalizeShadow as ee, normalizeShape as te, normalizeText as ne, normalizeTextContent as re, parseColor as ie, property as _ } from "modern-idoc";
2
+ import { BoundingBox as ae, Path2D as oe, Path2DSet as se, Transform2D as v, Vector2 as y, svgToDom as ce, svgToPath2DSet as le } from "modern-path2d";
3
+ import { extend as b } from "colord";
4
+ import ue from "colord/plugins/names";
5
+ import { fonts as de } from "modern-font";
6
+ import { Character as fe, Text as pe } from "modern-text";
7
7
  //#region src/core/decorators/customNode.ts
8
- var pe = /* @__PURE__ */ new Map();
8
+ var me = /* @__PURE__ */ new Map();
9
9
  function x(e, t) {
10
10
  return function(n) {
11
11
  Object.defineProperty(n.prototype, "is", {
@@ -14,13 +14,13 @@ function x(e, t) {
14
14
  configurable: !0
15
15
  }), t && Object.keys(t).forEach((e) => {
16
16
  i(n, e, { fallback: t[e] });
17
- }), pe.set(e, n);
17
+ }), me.set(e, n);
18
18
  };
19
19
  }
20
20
  //#endregion
21
21
  //#region src/core/global/createNode.ts
22
- function me(e = "node", t = {}) {
23
- let n = pe.get(e);
22
+ function he(e = "node", t = {}) {
23
+ let n = me.get(e);
24
24
  if (!n) throw Error(`Failed to createNode, tag: ${e}`);
25
25
  return new n().setProperties(t);
26
26
  }
@@ -86,7 +86,7 @@ var S = class {
86
86
  S.start();
87
87
  //#endregion
88
88
  //#region src/core/global/nextTick.ts
89
- async function he(e) {
89
+ async function ge(e) {
90
90
  return new Promise((t) => {
91
91
  S.on(() => {
92
92
  e?.(), t();
@@ -98,14 +98,14 @@ async function he(e) {
98
98
  }
99
99
  //#endregion
100
100
  //#region src/core/shared/utils.ts
101
- var ge = Math.PI, _e = ge * 2;
102
- function ve(e) {
101
+ var _e = Math.PI, ve = _e * 2;
102
+ function ye(e) {
103
103
  return !(e & e - 1) && !!e;
104
104
  }
105
105
  //#endregion
106
106
  //#region src/core/shared/css.ts
107
- var ye = /([\w-]+)\((.+?)\)/g, be = /[^,]+/g, xe = /([-e.\d]+)(.*)/;
108
- function Se(e) {
107
+ var be = /([\w-]+)\((.+?)\)/g, xe = /[^,]+/g, Se = /([-e.\d]+)(.*)/;
108
+ function Ce(e) {
109
109
  return Array.isArray(e) ? e.map((e) => ({
110
110
  name: e.name,
111
111
  args: e.args.map((e) => ({
@@ -117,31 +117,31 @@ function Se(e) {
117
117
  normalizedIntValue: e.normalizedDefaultIntValue
118
118
  };
119
119
  }
120
- function Ce(e, t, n = {}) {
121
- let r = we(t, n);
122
- return r.length ? r : Ee(e, t, n);
120
+ function we(e, t, n = {}) {
121
+ let r = Te(t, n);
122
+ return r.length ? r : De(e, t, n);
123
123
  }
124
- function we(e, t = {}) {
124
+ function Te(e, t = {}) {
125
125
  let n = [], r;
126
- for (; (r = ye.exec(e)) !== null;) {
126
+ for (; (r = be.exec(e)) !== null;) {
127
127
  let [, e, i] = r;
128
128
  e && n.push({
129
129
  name: e,
130
- args: Te(e, i, t)
130
+ args: Ee(e, i, t)
131
131
  });
132
132
  }
133
133
  return n;
134
134
  }
135
- function Te(e, t, n = {}) {
135
+ function Ee(e, t, n = {}) {
136
136
  let r = [], i, a = 0;
137
- for (; (i = be.exec(t)) !== null;) r.push(Ee(e, i[0], {
137
+ for (; (i = xe.exec(t)) !== null;) r.push(De(e, i[0], {
138
138
  ...n,
139
139
  index: a++
140
140
  }));
141
141
  return r;
142
142
  }
143
- function Ee(e, t, n = {}) {
144
- let { width: r = 1, height: i = 1, index: a = 0 } = n, o = t.match(xe), s = {
143
+ function De(e, t, n = {}) {
144
+ let { width: r = 1, height: i = 1, index: a = 0 } = n, o = t.match(Se), s = {
145
145
  unit: o?.[2] ?? null,
146
146
  value: t,
147
147
  intValue: Number(o?.[1]),
@@ -161,7 +161,7 @@ function Ee(e, t, n = {}) {
161
161
  s.normalizedIntValue = s.intValue / 100;
162
162
  break;
163
163
  case "rad":
164
- s.normalizedIntValue = s.intValue / _e;
164
+ s.normalizedIntValue = s.intValue / ve;
165
165
  break;
166
166
  case "deg":
167
167
  s.normalizedIntValue = s.intValue / 360;
@@ -184,34 +184,34 @@ function Ee(e, t, n = {}) {
184
184
  }
185
185
  //#endregion
186
186
  //#region src/core/shared/dom.ts
187
- var De = "WebGL2RenderingContext" in globalThis, Oe = "ImageBitmap" in globalThis, ke = "ResizeObserver" in globalThis, Ae = "PointerEvent" in globalThis, je = "WheelEvent" in globalThis, Me = "MouseEvent" in globalThis, C = "ontouchstart" in globalThis, Ne = "onclick" in globalThis, Pe = "createImageBitmap" in globalThis, Fe = "AudioContext" in globalThis, Ie = "webkitAudioContext" in globalThis, Le = "OfflineAudioContext" in globalThis, Re = "webkitOfflineAudioContext" in globalThis, ze = Fe || Ie, Be = typeof window < "u", Ve = typeof navigator < "u" && navigator?.userAgent?.indexOf("Mac") >= 0, He = globalThis.devicePixelRatio || 1, Ue = (e) => typeof e == "object" && !!e && e.nodeType === 1, We = (e) => Ue(e) && e.tagName === "VIDEO", Ge = (e) => Ue(e) && e.tagName === "IMG";
188
- function Ke(e) {
187
+ var Oe = "WebGL2RenderingContext" in globalThis, ke = "ImageBitmap" in globalThis, Ae = "ResizeObserver" in globalThis, je = "PointerEvent" in globalThis, Me = "WheelEvent" in globalThis, Ne = "MouseEvent" in globalThis, Pe = "ontouchstart" in globalThis, Fe = "onclick" in globalThis, Ie = "createImageBitmap" in globalThis, Le = "AudioContext" in globalThis, Re = "webkitAudioContext" in globalThis, ze = "OfflineAudioContext" in globalThis, Be = "webkitOfflineAudioContext" in globalThis, Ve = Le || Re, He = typeof window < "u", Ue = typeof navigator < "u" && navigator?.userAgent?.indexOf("Mac") >= 0, We = globalThis.devicePixelRatio || 1, Ge = (e) => typeof e == "object" && !!e && e.nodeType === 1, Ke = (e) => Ge(e) && e.tagName === "VIDEO", qe = (e) => Ge(e) && e.tagName === "IMG";
188
+ function Je(e) {
189
189
  return typeof e == "object" && !!e && e.nodeType === 1 && e.tagName === "CANVAS";
190
190
  }
191
- function qe(e) {
192
- return De && e instanceof globalThis.WebGL2RenderingContext;
191
+ function Ye(e) {
192
+ return Oe && e instanceof globalThis.WebGL2RenderingContext;
193
193
  }
194
- function Je() {
195
- if (Be) return globalThis.document.createElement("canvas");
194
+ function Xe() {
195
+ if (He) return globalThis.document.createElement("canvas");
196
196
  }
197
- function Ye(e, t = globalThis.location) {
197
+ function Ze(e, t = globalThis.location) {
198
198
  if (e.startsWith("data:")) return "";
199
199
  t ||= globalThis.location;
200
200
  let n = new URL(e, document.baseURI);
201
201
  return n.hostname !== t.hostname || n.port !== t.port || n.protocol !== t.protocol ? "anonymous" : "";
202
202
  }
203
- function Xe(e, t, n) {
204
- n === null && !t.startsWith("data:") ? e.crossOrigin = Ye(t) : n !== !1 && (e.crossOrigin = typeof n == "string" ? n : "anonymous");
203
+ function Qe(e, t, n) {
204
+ n === null && !t.startsWith("data:") ? e.crossOrigin = Ze(t) : n !== !1 && (e.crossOrigin = typeof n == "string" ? n : "anonymous");
205
205
  }
206
206
  //#endregion
207
207
  //#region src/core/shared/id.ts
208
- var Ze = 0;
209
- function Qe() {
210
- return ++Ze;
208
+ var $e = 0;
209
+ function et() {
210
+ return ++$e;
211
211
  }
212
212
  //#endregion
213
213
  //#region src/core/input/InputEvent.ts
214
- var $e = class e {
214
+ var tt = class e {
215
215
  cursor;
216
216
  bubbles = !1;
217
217
  cancelBubble = !1;
@@ -246,14 +246,14 @@ var $e = class e {
246
246
  initUIEvent(...e) {
247
247
  throw Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
248
248
  }
249
- }, et = class extends $e {
249
+ }, nt = class extends tt {
250
250
  getModifierState(...e) {
251
251
  throw Error("getModifierState() is a legacy DOM API. It is not implemented in the Federated Events API.");
252
252
  }
253
253
  initKeyboardEvent(...e) {
254
254
  throw Error("initKeyboardEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
255
255
  }
256
- }, tt = class extends $e {
256
+ }, rt = class extends tt {
257
257
  client = {
258
258
  x: 0,
259
259
  y: 0
@@ -336,7 +336,7 @@ var $e = class e {
336
336
  get globalY() {
337
337
  return this.global.y;
338
338
  }
339
- }, nt = class extends tt {
339
+ }, it = class extends rt {
340
340
  width = 0;
341
341
  height = 0;
342
342
  isPrimary = !1;
@@ -346,20 +346,20 @@ var $e = class e {
346
346
  getPredictedEvents() {
347
347
  throw Error("getPredictedEvents is not supported!");
348
348
  }
349
- }, rt = class extends tt {
349
+ }, at = class extends rt {
350
350
  static DOM_DELTA_PIXEL = 0;
351
351
  DOM_DELTA_PIXEL = 0;
352
352
  static DOM_DELTA_LINE = 1;
353
353
  DOM_DELTA_LINE = 1;
354
354
  static DOM_DELTA_PAGE = 2;
355
355
  DOM_DELTA_PAGE = 2;
356
- }, it = {
356
+ }, ot = {
357
357
  touchstart: "pointerdown",
358
358
  touchend: "pointerup",
359
359
  touchendoutside: "pointerupoutside",
360
360
  touchmove: "pointermove",
361
361
  touchcancel: "pointercancel"
362
- }, at = class extends e {
362
+ }, st = class extends e {
363
363
  event;
364
364
  target;
365
365
  cursor = "default";
@@ -377,21 +377,21 @@ var $e = class e {
377
377
  removeEventListeners() {
378
378
  if (!this.setuped || !this.target) return;
379
379
  let e = this.target.style;
380
- globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "", e.msTouchAction = "") : Ae && (e.touchAction = ""), Ae ? (this.target.removeEventListener("pointerdown", this._onPointerDown), this.target.removeEventListener("pointerleave", this._onPointerOver), this.target.removeEventListener("pointerover", this._onPointerOver), this.target.removeEventListener("pointermove", this._onPointerMove), this.target.removeEventListener("pointerup", this._onPointerUp)) : (this.target.removeEventListener("mousedown", this._onPointerDown), this.target.removeEventListener("mouseout", this._onPointerOver), this.target.removeEventListener("mouseover", this._onPointerOver), this.target.removeEventListener("mousemove", this._onPointerMove), this.target.removeEventListener("mouseup", this._onPointerUp)), C && (this.target.removeEventListener("touchstart", this._onPointerDown), this.target.removeEventListener("touchmove", this._onPointerMove), this.target.removeEventListener("touchend", this._onPointerUp)), this.target.removeEventListener("wheel", this._onWheel), document.removeEventListener("keydown", this._onKeyDown), document.removeEventListener("keypress", this._onKeyPress), document.removeEventListener("keyup", this._onKeyUp), this.target = void 0, this.setuped = !1;
380
+ globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "", e.msTouchAction = "") : je && (e.touchAction = ""), je ? (this.target.removeEventListener("pointerdown", this._onPointerDown), this.target.removeEventListener("pointerleave", this._onPointerOver), this.target.removeEventListener("pointerover", this._onPointerOver), this.target.removeEventListener("pointermove", this._onPointerMove), this.target.removeEventListener("pointerup", this._onPointerUp)) : (this.target.removeEventListener("mousedown", this._onPointerDown), this.target.removeEventListener("mouseout", this._onPointerOver), this.target.removeEventListener("mouseover", this._onPointerOver), this.target.removeEventListener("mousemove", this._onPointerMove), this.target.removeEventListener("mouseup", this._onPointerUp)), Pe && (this.target.removeEventListener("touchstart", this._onPointerDown), this.target.removeEventListener("touchmove", this._onPointerMove), this.target.removeEventListener("touchend", this._onPointerUp)), this.target.removeEventListener("wheel", this._onWheel), document.removeEventListener("keydown", this._onKeyDown), document.removeEventListener("keypress", this._onKeyPress), document.removeEventListener("keyup", this._onKeyUp), this.target = void 0, this.setuped = !1;
381
381
  }
382
382
  addEventListeners() {
383
383
  if (this.setuped || !this.target) return;
384
384
  let e = this.target.style;
385
- e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "none", e.msTouchAction = "none") : Ae && (e.touchAction = "none")), Ae ? (this.target.addEventListener("pointerdown", this._onPointerDown), this.target.addEventListener("pointerleave", this._onPointerOver), this.target.addEventListener("pointerover", this._onPointerOver), this.target.addEventListener("pointermove", this._onPointerMove), this.target.addEventListener("pointerup", this._onPointerUp)) : (this.target.addEventListener("mousedown", this._onPointerDown), this.target.addEventListener("mouseout", this._onPointerOver), this.target.addEventListener("mouseover", this._onPointerOver), this.target.addEventListener("mousemove", this._onPointerMove), this.target.addEventListener("mouseup", this._onPointerUp)), C && (this.target.addEventListener("touchstart", this._onPointerDown), this.target.addEventListener("touchmove", this._onPointerMove), this.target.addEventListener("touchend", this._onPointerUp)), this.target.addEventListener("wheel", this._onWheel), document.addEventListener("keydown", this._onKeyDown), document.addEventListener("keypress", this._onKeyPress), document.addEventListener("keyup", this._onKeyUp), this.setuped = !0;
385
+ e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "none", e.msTouchAction = "none") : je && (e.touchAction = "none")), je ? (this.target.addEventListener("pointerdown", this._onPointerDown), this.target.addEventListener("pointerleave", this._onPointerOver), this.target.addEventListener("pointerover", this._onPointerOver), this.target.addEventListener("pointermove", this._onPointerMove), this.target.addEventListener("pointerup", this._onPointerUp)) : (this.target.addEventListener("mousedown", this._onPointerDown), this.target.addEventListener("mouseout", this._onPointerOver), this.target.addEventListener("mouseover", this._onPointerOver), this.target.addEventListener("mousemove", this._onPointerMove), this.target.addEventListener("mouseup", this._onPointerUp)), Pe && (this.target.addEventListener("touchstart", this._onPointerDown), this.target.addEventListener("touchmove", this._onPointerMove), this.target.addEventListener("touchend", this._onPointerUp)), this.target.addEventListener("wheel", this._onWheel), document.addEventListener("keydown", this._onKeyDown), document.addEventListener("keypress", this._onKeyPress), document.addEventListener("keyup", this._onKeyUp), this.setuped = !0;
386
386
  }
387
387
  normalize(e) {
388
388
  let t = [];
389
- if (C && e instanceof globalThis.TouchEvent) for (let n = 0, r = e.changedTouches.length; n < r; n++) {
389
+ if (Pe && e instanceof globalThis.TouchEvent) for (let n = 0, r = e.changedTouches.length; n < r; n++) {
390
390
  let r = e.changedTouches[n];
391
391
  r.button === void 0 && (r.button = 0), r.buttons === void 0 && (r.buttons = 1), r.isPrimary === void 0 && (r.isPrimary = e.touches.length === 1 && e.type === "touchstart"), r.width === void 0 && (r.width = r.radiusX || 1), r.height === void 0 && (r.height = r.radiusY || 1), r.tiltX === void 0 && (r.tiltX = 0), r.tiltY === void 0 && (r.tiltY = 0), r.pointerType === void 0 && (r.pointerType = "touch"), r.pointerId === void 0 && (r.pointerId = r.identifier || 0), r.pressure === void 0 && (r.pressure = r.force || .5), r.twist === void 0 && (r.twist = 0), r.tangentialPressure === void 0 && (r.tangentialPressure = 0), r.layerX === void 0 && (r.layerX = r.offsetX = r.clientX), r.layerY === void 0 && (r.layerY = r.offsetY = r.clientY), r.type = e.type, t.push(r);
392
392
  }
393
- else if (je && e instanceof globalThis.WheelEvent) t.push(e);
394
- else if (Ae && e instanceof globalThis.PointerEvent) t.push(e);
393
+ else if (Me && e instanceof globalThis.WheelEvent) t.push(e);
394
+ else if (je && e instanceof globalThis.PointerEvent) t.push(e);
395
395
  else {
396
396
  let n = e;
397
397
  n.isPrimary === void 0 && (n.isPrimary = !0), n.width === void 0 && (n.width = 1), n.height === void 0 && (n.height = 1), n.tiltX === void 0 && (n.tiltX = 0), n.tiltY === void 0 && (n.tiltY = 0), n.pointerType === void 0 && (n.pointerType = "mouse"), n.pointerId === void 0 && (n.pointerId = 1), n.pressure === void 0 && (n.pressure = .5), n.twist === void 0 && (n.twist = 0), n.tangentialPressure === void 0 && (n.tangentialPressure = 0), t.push(n);
@@ -399,8 +399,8 @@ var $e = class e {
399
399
  return t;
400
400
  }
401
401
  _clonePointerEvent(e) {
402
- let t = new nt();
403
- return t.nativeEvent = e, t.pointerId = e.pointerId, t.width = e.width, t.height = e.height, t.isPrimary = e.isPrimary, t.pointerType = e.pointerType, t.pressure = e.pressure, t.tangentialPressure = e.tangentialPressure, t.tiltX = e.tiltX, t.tiltY = e.tiltY, t.twist = e.twist, t.isTrusted = e.isTrusted, this._copyMouseEvent(t, e), this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.x = t.screen.x, t.global.y = t.screen.y, t.offset.x = t.screen.x, t.offset.y = t.screen.y, t.type === "pointerleave" ? t.type = "pointerout" : t.type.startsWith("mouse") ? t.type = t.type.replace("mouse", "pointer") : t.type.startsWith("touch") && (t.type = it[t.type] || t.type), t;
402
+ let t = new it();
403
+ return t.nativeEvent = e, t.pointerId = e.pointerId, t.width = e.width, t.height = e.height, t.isPrimary = e.isPrimary, t.pointerType = e.pointerType, t.pressure = e.pressure, t.tangentialPressure = e.tangentialPressure, t.tiltX = e.tiltX, t.tiltY = e.tiltY, t.twist = e.twist, t.isTrusted = e.isTrusted, this._copyMouseEvent(t, e), this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.x = t.screen.x, t.global.y = t.screen.y, t.offset.x = t.screen.x, t.offset.y = t.screen.y, t.type === "pointerleave" ? t.type = "pointerout" : t.type.startsWith("mouse") ? t.type = t.type.replace("mouse", "pointer") : t.type.startsWith("touch") && (t.type = ot[t.type] || t.type), t;
404
404
  }
405
405
  _copyInputEvent(e, t) {
406
406
  e.nativeEvent = t, e.bubbles = t.bubbles, e.cancelBubble = t.cancelBubble, e.cancelable = t.cancelable, e.composed = t.composed, e.currentTarget = t.currentTarget, e.defaultPrevented = t.defaultPrevented, e.eventPhase = t.eventPhase, e.isTrusted = t.isTrusted, e.returnValue = t.returnValue, e.srcElement = t.srcElement, e.timeStamp = t.timeStamp, e.type = t.type;
@@ -409,11 +409,11 @@ var $e = class e {
409
409
  this._copyInputEvent(e, t), e.altKey = t.altKey, e.button = t.button, e.buttons = t.buttons, e.client.x = t.clientX, e.client.y = t.clientY, e.ctrlKey = t.ctrlKey, e.metaKey = t.metaKey, e.movement.x = t.movementX, e.movement.y = t.movementY, e.page.x = t.pageX, e.page.y = t.pageY, e.relatedTarget = null, e.shiftKey = t.shiftKey;
410
410
  }
411
411
  _cloneWheelEvent(e) {
412
- let t = new rt();
412
+ let t = new at();
413
413
  return this._copyMouseEvent(t, e), t.wheelDeltaY = e.wheelDeltaY, t.deltaX = e.deltaX, t.deltaY = e.deltaY, t.deltaZ = e.deltaZ, t.deltaMode = e.deltaMode, this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.x = t.screen.x, t.global.y = t.screen.y, t.offset.x = t.screen.x, t.offset.y = t.screen.y, t;
414
414
  }
415
415
  _cloneKeyboardEvent(e) {
416
- let t = new et();
416
+ let t = new nt();
417
417
  return this._copyInputEvent(t, e), t.altKey = e.altKey, t.charCode = e.charCode, t.code = e.code, t.ctrlKey = e.ctrlKey, t.isComposing = e.isComposing, t.key = e.key, t.keyCode = e.keyCode, t.location = e.location, t.metaKey = e.metaKey, t.repeat = e.repeat, t.shiftKey = e.shiftKey, t;
418
418
  }
419
419
  setCursor(e = "default") {
@@ -461,25 +461,25 @@ var $e = class e {
461
461
  this.event?.cursor && this.setCursor(this.event.cursor);
462
462
  };
463
463
  _onPointerDown = (e) => {
464
- if (C && e.pointerType === "touch") return;
464
+ if (Pe && e.pointerType === "touch") return;
465
465
  let t = this.normalize(e);
466
466
  for (let e = 0, n = t.length; e < n; e++) this.emit("pointerdown", this.event = this._clonePointerEvent(t[e]));
467
467
  this.event?.cursor && this.setCursor(this.event.cursor);
468
468
  };
469
469
  _onPointerOver = (e) => {
470
- if (!this.enableClickEvent || C && e.pointerType === "touch") return;
470
+ if (!this.enableClickEvent || Pe && e.pointerType === "touch") return;
471
471
  let t = this.normalize(e);
472
472
  for (let e = 0, n = t.length; e < n; e++) this.emit("pointerover", this.event = this._clonePointerEvent(t[e]));
473
473
  this.event?.cursor && this.setCursor(this.event.cursor);
474
474
  };
475
475
  _onPointerMove = (e) => {
476
- if (!this.enableMoveEvent || C && e.pointerType === "touch") return;
476
+ if (!this.enableMoveEvent || Pe && e.pointerType === "touch") return;
477
477
  let t = this.normalize(e);
478
478
  for (let e = 0, n = t.length; e < n; e++) this.emit("pointermove", this.event = this._clonePointerEvent(t[e]));
479
479
  this.event?.cursor && this.setCursor(this.event.cursor);
480
480
  };
481
481
  _onPointerUp = (e) => {
482
- if (!this.enableClickEvent || C && e.pointerType === "touch") return;
482
+ if (!this.enableClickEvent || Pe && e.pointerType === "touch") return;
483
483
  let t = e.target;
484
484
  e.composedPath && e.composedPath().length > 0 && (t = e.composedPath()[0]);
485
485
  let n = t === this.target ? "" : "outside", r = this.normalize(e);
@@ -498,8 +498,8 @@ var $e = class e {
498
498
  destroy() {
499
499
  this.removeEventListeners(), super.destroy();
500
500
  }
501
- }, w = class extends n {
502
- instanceId = Qe();
501
+ }, C = class extends n {
502
+ instanceId = et();
503
503
  destroyed = !1;
504
504
  get json() {
505
505
  return this.toJSON();
@@ -508,7 +508,7 @@ var $e = class e {
508
508
  this.setProperties(e);
509
509
  }
510
510
  _nextTick() {
511
- return he();
511
+ return ge();
512
512
  }
513
513
  equal(e) {
514
514
  return !!(e && this.instanceId === e.instanceId);
@@ -517,7 +517,7 @@ var $e = class e {
517
517
  destroy() {
518
518
  this.destroyed || (this.destroyed = !0, this._destroy(), this.emit("destroy"), this.removeAllListeners());
519
519
  }
520
- }, ot = class extends w {}, T = class extends ot {}, st = class e {
520
+ }, ct = class extends C {}, w = class extends ct {}, lt = class e {
521
521
  get x() {
522
522
  return this.min.x;
523
523
  }
@@ -650,13 +650,13 @@ var $e = class e {
650
650
  };
651
651
  //#endregion
652
652
  //#region src/core/math/Color.ts
653
- le([b]);
654
- var E = class {
653
+ b([ue]);
654
+ var T = class {
655
655
  get value() {
656
656
  return this._value;
657
657
  }
658
658
  set value(e) {
659
- this._value = e, this._colord = re(e ?? "none");
659
+ this._value = e, this._colord = ie(e ?? "none");
660
660
  }
661
661
  get r8() {
662
662
  return this._colord.rgba.r;
@@ -734,8 +734,8 @@ var E = class {
734
734
  this.a
735
735
  ];
736
736
  }
737
- }, ct = ge / 180, lt = 180 / ge;
738
- function ut(e, t, n) {
737
+ }, ut = _e / 180, dt = 180 / _e;
738
+ function E(e, t, n) {
739
739
  return Math.max(t, Math.min(e, n));
740
740
  }
741
741
  function D(e, t, n) {
@@ -743,7 +743,7 @@ function D(e, t, n) {
743
743
  }
744
744
  //#endregion
745
745
  //#region src/core/math/ColorMatrix.ts
746
- var dt = class {
746
+ var ft = class {
747
747
  _array = new Float32Array(20);
748
748
  constructor() {
749
749
  this.identity();
@@ -898,7 +898,7 @@ var dt = class {
898
898
  ]);
899
899
  }
900
900
  sepia(e = 1) {
901
- let t = ut(e, 0, 1);
901
+ let t = E(e, 0, 1);
902
902
  return this.multiply([
903
903
  D(1, .393, t),
904
904
  D(0, .7689999, t),
@@ -947,7 +947,7 @@ var dt = class {
947
947
  ]);
948
948
  }
949
949
  grayscale(e = 1) {
950
- let t = ut(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);
950
+ let t = E(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);
951
951
  return this.multiply([
952
952
  n,
953
953
  a,
@@ -999,10 +999,10 @@ var dt = class {
999
999
  toArray() {
1000
1000
  return this._array;
1001
1001
  }
1002
- }, ft = class e extends st {
1002
+ }, pt = class e extends lt {
1003
1003
  rotation;
1004
1004
  get rotationDegrees() {
1005
- return this.rotation / ct;
1005
+ return this.rotation / ut;
1006
1006
  }
1007
1007
  constructor(...e) {
1008
1008
  let t, n;
@@ -1012,7 +1012,7 @@ var dt = class {
1012
1012
  if (!this.rotation && (!("rotation" in e) || !e.rotation)) return super.overlap(e, t);
1013
1013
  {
1014
1014
  let t = (e, t) => Math.abs(e.x * t.x + e.y * t.y), n = (e) => {
1015
- let { width: n, height: r, rotation: i = 0 } = e, a = i / ct;
1015
+ let { width: n, height: r, rotation: i = 0 } = e, a = i / ut;
1016
1016
  a = -a % 180;
1017
1017
  let o = a / 180 * Math.PI, s = {
1018
1018
  x: Math.cos(o),
@@ -1054,7 +1054,7 @@ var dt = class {
1054
1054
  clone() {
1055
1055
  return new e(this.toJSON());
1056
1056
  }
1057
- }, pt = class {
1057
+ }, mt = class {
1058
1058
  _array;
1059
1059
  x = 0;
1060
1060
  y = 0;
@@ -1091,7 +1091,7 @@ function k(e, t, n, r) {
1091
1091
  }
1092
1092
  //#endregion
1093
1093
  //#region src/core/os/MainLoop.ts
1094
- var mt = class extends w {
1094
+ var ht = class extends C {
1095
1095
  _starting = !1;
1096
1096
  _nextDeltaTime = 0;
1097
1097
  _startedProcess;
@@ -1121,13 +1121,13 @@ var mt = class extends w {
1121
1121
  super._destroy(), this.stop();
1122
1122
  }
1123
1123
  };
1124
- k([_({ fallback: 60 }), O("design:type", Number)], mt.prototype, "fps", void 0), k([_({ fallback: 1 }), O("design:type", Number)], mt.prototype, "speed", void 0);
1124
+ k([_({ fallback: 60 }), O("design:type", Number)], ht.prototype, "fps", void 0), k([_({ fallback: 1 }), O("design:type", Number)], ht.prototype, "speed", void 0);
1125
1125
  //#endregion
1126
1126
  //#region src/core/renderers/gl/buffer/const.ts
1127
- var ht = /* @__PURE__ */ function(e) {
1127
+ var gt = /* @__PURE__ */ function(e) {
1128
1128
  return e[e.elementArrayBuffer = 34963] = "elementArrayBuffer", e[e.arrayBuffer = 34962] = "arrayBuffer", e[e.uniformBuffer = 35345] = "uniformBuffer", e;
1129
- }({}), gt = class {
1130
- target = ht.arrayBuffer;
1129
+ }({}), _t = class {
1130
+ target = gt.arrayBuffer;
1131
1131
  byteLength = 0;
1132
1132
  dirty = !0;
1133
1133
  constructor(e) {
@@ -1135,7 +1135,7 @@ var ht = /* @__PURE__ */ function(e) {
1135
1135
  }
1136
1136
  }, A = /* @__PURE__ */ function(e) {
1137
1137
  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;
1138
- }({}), _t, vt = class extends n {
1138
+ }({}), vt, yt = class extends n {
1139
1139
  screen = {
1140
1140
  x: 0,
1141
1141
  y: 0,
@@ -1154,13 +1154,13 @@ var ht = /* @__PURE__ */ function(e) {
1154
1154
  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`);
1155
1155
  }
1156
1156
  };
1157
- k([_({ fallback: He }), O("design:type", Number)], vt.prototype, "pixelRatio", void 0), k([_({ internal: !0 }), O("design:type", typeof (_t = typeof HTMLCanvasElement < "u" && HTMLCanvasElement) == "function" ? _t : Object)], vt.prototype, "view", void 0);
1157
+ k([_({ fallback: We }), O("design:type", Number)], yt.prototype, "pixelRatio", void 0), k([_({ internal: !0 }), O("design:type", typeof (vt = typeof HTMLCanvasElement < "u" && HTMLCanvasElement) == "function" ? vt : Object)], yt.prototype, "view", void 0);
1158
1158
  //#endregion
1159
1159
  //#region src/core/renderers/shared/utils/createIdFromString.ts
1160
- var yt = Object.create(null), bt = Object.create(null);
1161
- function xt(e, t) {
1162
- let n = bt[e];
1163
- return n === void 0 && (yt[t] === void 0 && (yt[t] = 1), bt[e] = n = yt[t]++), n;
1160
+ var bt = Object.create(null), xt = Object.create(null);
1161
+ function St(e, t) {
1162
+ let n = xt[e];
1163
+ return n === void 0 && (bt[t] === void 0 && (bt[t] = 1), xt[e] = n = bt[t]++), n;
1164
1164
  }
1165
1165
  //#endregion
1166
1166
  //#region src/core/renderers/gl/system/GlSystem.ts
@@ -1178,7 +1178,7 @@ var j = class extends e {
1178
1178
  _setup() {}
1179
1179
  flush() {}
1180
1180
  reset() {}
1181
- }, St = class extends j {
1181
+ }, Ct = class extends j {
1182
1182
  install(e) {
1183
1183
  super.install(e), e.buffer = this;
1184
1184
  }
@@ -1188,8 +1188,8 @@ var j = class extends e {
1188
1188
  return this.glBuffers.get(e.instanceId) || this._createGlBuffer(e);
1189
1189
  }
1190
1190
  _createGlBuffer(e) {
1191
- let t = this._gl, n = new gt(t.createBuffer()), r = ht.arrayBuffer;
1192
- return e.usage & A.index ? r = ht.elementArrayBuffer : e.usage & A.uniform && (r = ht.uniformBuffer), n.target = r, this.glBuffers.set(e.instanceId, n), this.buffers.get(e.instanceId) || ("on" in e && (e.on("updateProperty", (e) => {
1191
+ let t = this._gl, n = new _t(t.createBuffer()), r = gt.arrayBuffer;
1192
+ return e.usage & A.index ? r = gt.elementArrayBuffer : e.usage & A.uniform && (r = gt.uniformBuffer), n.target = r, this.glBuffers.set(e.instanceId, n), this.buffers.get(e.instanceId) || ("on" in e && (e.on("updateProperty", (e) => {
1193
1193
  switch (e) {
1194
1194
  case "usage":
1195
1195
  case "data":
@@ -1221,13 +1221,13 @@ var j = class extends e {
1221
1221
  reset() {
1222
1222
  super.reset(), this.buffers.clear(), this.glBuffers.clear();
1223
1223
  }
1224
- }, Ct;
1225
- function wt() {
1226
- return Ct ||= "mediump", Ct;
1224
+ }, wt;
1225
+ function Tt() {
1226
+ return wt ||= "mediump", wt;
1227
1227
  }
1228
1228
  //#endregion
1229
1229
  //#region src/core/renderers/gl/shader/preprocessors/addProgramDefines.ts
1230
- function Tt(e, t, n) {
1230
+ function Et(e, t, n) {
1231
1231
  return t ? e : n ? (e = e.replace("out vec4 finalColor;", ""), `#ifdef GL_ES
1232
1232
  #define in varying
1233
1233
  #define finalColor gl_FragColor
@@ -1241,7 +1241,7 @@ ${e}`;
1241
1241
  }
1242
1242
  //#endregion
1243
1243
  //#region src/core/renderers/gl/shader/preprocessors/ensurePrecision.ts
1244
- function Et(e, t, n) {
1244
+ function Dt(e, t, n) {
1245
1245
  let r = n ? t.maxSupportedFragmentPrecision : t.maxSupportedVertexPrecision;
1246
1246
  if (e.substring(0, 9) !== "precision") {
1247
1247
  let i = n ? t.requestedFragmentPrecision : t.requestedVertexPrecision;
@@ -1251,31 +1251,31 @@ function Et(e, t, n) {
1251
1251
  }
1252
1252
  //#endregion
1253
1253
  //#region src/core/renderers/gl/shader/preprocessors/insertVersion.ts
1254
- function Dt(e, t) {
1254
+ function Ot(e, t) {
1255
1255
  return t ? `#version 300 es\n${e}` : e;
1256
1256
  }
1257
1257
  //#endregion
1258
1258
  //#region src/core/renderers/gl/shader/preprocessors/setProgramName.ts
1259
- var Ot = {}, kt = {};
1260
- function At(e, { name: t = "program" }, n = !0) {
1259
+ var kt = {}, At = {};
1260
+ function jt(e, { name: t = "program" }, n = !0) {
1261
1261
  t = t.replace(/\s+/g, "-"), t += n ? "-fragment" : "-vertex";
1262
- let r = n ? Ot : kt;
1262
+ let r = n ? kt : At;
1263
1263
  return r[t] ? (r[t]++, t += `-${r[t]}`) : r[t] = 1, e.includes("#define SHADER_NAME") ? e : `${`#define SHADER_NAME ${t}`}\n${e}`;
1264
1264
  }
1265
1265
  //#endregion
1266
1266
  //#region src/core/renderers/gl/shader/preprocessors/stripVersion.ts
1267
- function jt(e, t) {
1267
+ function Mt(e, t) {
1268
1268
  return t ? e.replace("#version 300 es", "") : e;
1269
1269
  }
1270
1270
  //#endregion
1271
1271
  //#region src/core/renderers/gl/shader/GlProgram.ts
1272
- var Mt = Object.create(null), Nt = {
1273
- stripVersion: jt,
1274
- ensurePrecision: Et,
1275
- addProgramDefines: Tt,
1276
- setProgramName: At,
1277
- insertVersion: Dt
1278
- }, Pt = class e {
1272
+ var Nt = Object.create(null), Pt = {
1273
+ stripVersion: Mt,
1274
+ ensurePrecision: Dt,
1275
+ addProgramDefines: Et,
1276
+ setProgramName: jt,
1277
+ insertVersion: Ot
1278
+ }, Ft = class e {
1279
1279
  static defaultOptions = {
1280
1280
  preferredVertexPrecision: "highp",
1281
1281
  preferredFragmentPrecision: "mediump"
@@ -1298,25 +1298,25 @@ var Mt = Object.create(null), Nt = {
1298
1298
  requestedFragmentPrecision: t.preferredFragmentPrecision,
1299
1299
  requestedVertexPrecision: t.preferredVertexPrecision,
1300
1300
  maxSupportedVertexPrecision: "highp",
1301
- maxSupportedFragmentPrecision: wt()
1301
+ maxSupportedFragmentPrecision: Tt()
1302
1302
  },
1303
1303
  setProgramName: { name: t.name },
1304
1304
  addProgramDefines: i,
1305
1305
  insertVersion: i
1306
1306
  };
1307
- Object.keys(Nt).forEach((e) => {
1307
+ Object.keys(Pt).forEach((e) => {
1308
1308
  let t = a[e];
1309
- n = Nt[e](n, t, !0), r = Nt[e](r, t, !1);
1310
- }), this.fragment = n, this.vertex = r, this.transformFeedbackVaryings = t.transformFeedbackVaryings, this.id = xt(`${r}:${n}`, "GlProgram");
1309
+ n = Pt[e](n, t, !0), r = Pt[e](r, t, !1);
1310
+ }), this.fragment = n, this.vertex = r, this.transformFeedbackVaryings = t.transformFeedbackVaryings, this.id = St(`${r}:${n}`, "GlProgram");
1311
1311
  }
1312
1312
  destroy() {
1313
- this.fragment = "", this.vertex = "", this.attributes = Object.create(null), this.uniforms = Object.create(null), this.transformFeedbackVaryings = void 0, this._cacheKey && delete Mt[this._cacheKey];
1313
+ this.fragment = "", this.vertex = "", this.attributes = Object.create(null), this.uniforms = Object.create(null), this.transformFeedbackVaryings = void 0, this._cacheKey && delete Nt[this._cacheKey];
1314
1314
  }
1315
1315
  static from(t) {
1316
1316
  let n = `${t.vertex}:${t.fragment}`;
1317
- return Mt[n] || (Mt[n] = new e(t), Mt[n]._cacheKey = n), Mt[n];
1317
+ return Nt[n] || (Nt[n] = new e(t), Nt[n]._cacheKey = n), Nt[n];
1318
1318
  }
1319
- }, Ft = {
1319
+ }, It = {
1320
1320
  uint8x2: {
1321
1321
  size: 2,
1322
1322
  stride: 2,
@@ -1468,17 +1468,17 @@ var Mt = Object.create(null), Nt = {
1468
1468
  normalized: !1
1469
1469
  }
1470
1470
  };
1471
- function It(e) {
1472
- return Ft[e] ?? Ft.float32;
1471
+ function Lt(e) {
1472
+ return It[e] ?? It.float32;
1473
1473
  }
1474
1474
  //#endregion
1475
1475
  //#region src/core/renderers/gl/shader/defaultValue.ts
1476
- function Lt(e) {
1476
+ function Rt(e) {
1477
1477
  let t = Array.from({ length: e });
1478
1478
  for (let e = 0; e < t.length; e++) t[e] = !1;
1479
1479
  return t;
1480
1480
  }
1481
- function Rt(e, t) {
1481
+ function zt(e, t) {
1482
1482
  switch (e) {
1483
1483
  case "float": return 0;
1484
1484
  case "vec2": return new Float32Array(2 * t);
@@ -1495,9 +1495,9 @@ function Rt(e, t) {
1495
1495
  case "uvec3": return new Uint32Array(3 * t);
1496
1496
  case "uvec4": return new Uint32Array(4 * t);
1497
1497
  case "bool": return !1;
1498
- case "bvec2": return Lt(2 * t);
1499
- case "bvec3": return Lt(3 * t);
1500
- case "bvec4": return Lt(4 * t);
1498
+ case "bvec2": return Rt(2 * t);
1499
+ case "bvec3": return Rt(3 * t);
1500
+ case "bvec4": return Rt(4 * t);
1501
1501
  case "mat2": return new Float32Array([
1502
1502
  1,
1503
1503
  0,
@@ -1538,11 +1538,11 @@ function Rt(e, t) {
1538
1538
  }
1539
1539
  //#endregion
1540
1540
  //#region src/core/renderers/gl/shader/GlProgramData.ts
1541
- var zt = class {
1541
+ var Bt = class {
1542
1542
  constructor(e) {
1543
1543
  this.native = e;
1544
1544
  }
1545
- }, Bt, Vt = {
1545
+ }, Vt, Ht = {
1546
1546
  FLOAT: "float",
1547
1547
  FLOAT_VEC2: "vec2",
1548
1548
  FLOAT_VEC3: "vec3",
@@ -1571,7 +1571,7 @@ var zt = class {
1571
1571
  SAMPLER_2D_ARRAY: "sampler2DArray",
1572
1572
  INT_SAMPLER_2D_ARRAY: "sampler2DArray",
1573
1573
  UNSIGNED_INT_SAMPLER_2D_ARRAY: "sampler2DArray"
1574
- }, Ht = {
1574
+ }, Ut = {
1575
1575
  float: "float32",
1576
1576
  vec2: "float32x2",
1577
1577
  vec3: "float32x3",
@@ -1589,23 +1589,23 @@ var zt = class {
1589
1589
  bvec3: "uint32x3",
1590
1590
  bvec4: "uint32x4"
1591
1591
  };
1592
- function Ut(e, t) {
1593
- if (!Bt) {
1594
- let t = Object.keys(Vt);
1595
- Bt = {};
1592
+ function Wt(e, t) {
1593
+ if (!Vt) {
1594
+ let t = Object.keys(Ht);
1595
+ Vt = {};
1596
1596
  for (let n = 0; n < t.length; ++n) {
1597
1597
  let r = t[n];
1598
- Bt[e[r]] = Vt[r];
1598
+ Vt[e[r]] = Ht[r];
1599
1599
  }
1600
1600
  }
1601
- return Bt[t];
1601
+ return Vt[t];
1602
1602
  }
1603
- function Wt(e, t) {
1604
- return Ht[Ut(e, t)] || "float32";
1603
+ function Gt(e, t) {
1604
+ return Ut[Wt(e, t)] || "float32";
1605
1605
  }
1606
1606
  //#endregion
1607
1607
  //#region src/core/renderers/gl/shader/GlShaderSystem.ts
1608
- var Gt = class extends j {
1608
+ var Kt = class extends j {
1609
1609
  install(e) {
1610
1610
  super.install(e), e.shader = this;
1611
1611
  }
@@ -1646,7 +1646,7 @@ var Gt = class extends j {
1646
1646
  return this.glProgramDatas.get(e.id) || this._createGlProgramData(e);
1647
1647
  }
1648
1648
  _createGlProgramData(e) {
1649
- let t = this._gl, n = new zt(t.createProgram());
1649
+ let t = this._gl, n = new Bt(t.createProgram());
1650
1650
  this.glProgramDatas.set(e.id, n), this.useProgram(e);
1651
1651
  let r = this._createGlShader(e.vertex, t.VERTEX_SHADER), i = this._createGlShader(e.fragment, t.FRAGMENT_SHADER);
1652
1652
  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)}`);
@@ -1654,11 +1654,11 @@ var Gt = class extends j {
1654
1654
  for (let e = t.getProgramParameter(n.native, t.ACTIVE_ATTRIBUTES), r = 0; r < e; r++) {
1655
1655
  let e = t.getActiveAttrib(n.native, r);
1656
1656
  if (!e || e.name.startsWith("gl_")) continue;
1657
- let i = Wt(t, e.type);
1657
+ let i = Gt(t, e.type);
1658
1658
  a[e.name] = {
1659
1659
  location: 0,
1660
1660
  format: i,
1661
- stride: It(i).stride,
1661
+ stride: Lt(i).stride,
1662
1662
  offset: 0,
1663
1663
  instance: !1,
1664
1664
  start: 0
@@ -1675,14 +1675,14 @@ var Gt = class extends j {
1675
1675
  for (let e = t.getProgramParameter(n.native, t.ACTIVE_UNIFORMS), r = 0; r < e; r++) {
1676
1676
  let e = t.getActiveUniform(n.native, r);
1677
1677
  if (!e) continue;
1678
- let i = e.name.replace(/\[.*?\]$/, ""), a = Ut(t, e.type), o = e.size;
1678
+ let i = e.name.replace(/\[.*?\]$/, ""), a = Wt(t, e.type), o = e.size;
1679
1679
  c[i] = {
1680
1680
  name: i,
1681
1681
  index: r,
1682
1682
  type: a,
1683
1683
  size: o,
1684
1684
  isArray: !!e.name.match(/\[.*?\]$/),
1685
- value: Rt(a, o)
1685
+ value: zt(a, o)
1686
1686
  };
1687
1687
  }
1688
1688
  return e.uniforms = c, t.deleteShader(r), t.deleteShader(i), n;
@@ -1788,10 +1788,10 @@ var Gt = class extends j {
1788
1788
  destroy() {
1789
1789
  super.destroy(), this.bind(null);
1790
1790
  }
1791
- }, Kt = /* @__PURE__ */ function(e) {
1791
+ }, qt = /* @__PURE__ */ function(e) {
1792
1792
  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;
1793
1793
  }({});
1794
- function qt(e) {
1794
+ function Jt(e) {
1795
1795
  return {
1796
1796
  normal: [e.ONE, e.ONE_MINUS_SRC_ALPHA],
1797
1797
  add: [e.ONE, e.ONE],
@@ -1846,7 +1846,7 @@ function qt(e) {
1846
1846
  }
1847
1847
  //#endregion
1848
1848
  //#region src/core/renderers/gl/state/GlStateSystem.ts
1849
- var Jt = class e {
1849
+ var Yt = class e {
1850
1850
  static _properties = [
1851
1851
  "blend",
1852
1852
  "offsets",
@@ -1873,14 +1873,14 @@ var Jt = class e {
1873
1873
  let t = new e();
1874
1874
  return t.depthTest = !1, t.blend = !0, t;
1875
1875
  }
1876
- _blendMode = Kt.normal;
1876
+ _blendMode = qt.normal;
1877
1877
  _polygonOffset = 0;
1878
1878
  bitmap = 0;
1879
1879
  get blendMode() {
1880
1880
  return this._blendMode;
1881
1881
  }
1882
1882
  set blendMode(e) {
1883
- this.blend = e !== Kt.none, this._blendMode = e;
1883
+ this.blend = e !== qt.none, this._blendMode = e;
1884
1884
  }
1885
1885
  get polygonOffset() {
1886
1886
  return this._polygonOffset;
@@ -1892,19 +1892,19 @@ var Jt = class e {
1892
1892
  if (e) for (let t in e) this[t] = e[t];
1893
1893
  }
1894
1894
  };
1895
- Jt._init();
1896
- var Yt = class extends j {
1895
+ Yt._init();
1896
+ var Xt = class extends j {
1897
1897
  install(e) {
1898
1898
  super.install(e), e.state = this;
1899
1899
  }
1900
1900
  _blendEq = !1;
1901
- _setters = Jt._properties.map((e) => this[`set${e.replace(/^\S/, (e) => e.toUpperCase())}`]);
1901
+ _setters = Yt._properties.map((e) => this[`set${e.replace(/^\S/, (e) => e.toUpperCase())}`]);
1902
1902
  boundStateBitmap = 0;
1903
1903
  boundBlendMode;
1904
1904
  blendModes;
1905
- defaultState = new Jt({ blend: !0 });
1905
+ defaultState = new Yt({ blend: !0 });
1906
1906
  _updateContext(e) {
1907
- super._updateContext(e), this.blendModes = qt(e);
1907
+ super._updateContext(e), this.blendModes = Jt(e);
1908
1908
  }
1909
1909
  toggle(e, t) {
1910
1910
  this._renderer.gl[t ? "enable" : "disable"](e);
@@ -1946,13 +1946,13 @@ var Yt = class extends j {
1946
1946
  e.blend && this.setBlendMode(e.blendMode), e.offsets && this.setPolygonOffset(1, e.polygonOffset);
1947
1947
  }
1948
1948
  reset() {
1949
- super.reset(), this.bind(this.defaultState), this._blendEq = !0, this.setBlendMode(Kt.normal);
1949
+ super.reset(), this.bind(this.defaultState), this._blendEq = !0, this.setBlendMode(qt.normal);
1950
1950
  }
1951
- }, Xt = class extends j {
1951
+ }, Zt = class extends j {
1952
1952
  install(e) {
1953
1953
  super.install(e), e.batch2D = this;
1954
1954
  }
1955
- _state = Jt.for2D();
1955
+ _state = Yt.for2D();
1956
1956
  _batchSize = 4096 * 4;
1957
1957
  _batchables = [];
1958
1958
  _vertexCount = 0;
@@ -1973,8 +1973,8 @@ var Yt = class extends j {
1973
1973
  }
1974
1974
  _createShader(e) {
1975
1975
  let t = this._renderer, n = {
1976
- instanceId: Qe(),
1977
- glProgram: new Pt({
1976
+ instanceId: et(),
1977
+ glProgram: new Ft({
1978
1978
  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}",
1979
1979
  fragment: `precision highp float;
1980
1980
  in float vTextureId;
@@ -2003,15 +2003,15 @@ void main(void) {
2003
2003
  }`
2004
2004
  })
2005
2005
  }, r = {
2006
- instanceId: Qe(),
2006
+ instanceId: et(),
2007
2007
  usage: A.vertex,
2008
2008
  data: new Float32Array()
2009
2009
  }, i = {
2010
- instanceId: Qe(),
2010
+ instanceId: et(),
2011
2011
  usage: A.index,
2012
2012
  data: new Uint32Array()
2013
2013
  }, a = {
2014
- instanceId: Qe(),
2014
+ instanceId: et(),
2015
2015
  topology: "triangle-list",
2016
2016
  attributes: Object.fromEntries(Object.entries(this._attributes).map(([e, t]) => [e, {
2017
2017
  ...t,
@@ -2052,15 +2052,15 @@ void main(void) {
2052
2052
  let { indices: r, vertices: p, uvs: h = new Float32Array(), size: g = {
2053
2053
  width: 0,
2054
2054
  height: 0
2055
- }, texture: ee, blendMode: te = Kt.normal, clipOutsideUv: ne, roundPixels: re, modulate: _ = [
2055
+ }, texture: ee, blendMode: te = qt.normal, clipOutsideUv: ne, roundPixels: re, modulate: ie = [
2056
2056
  255,
2057
2057
  255,
2058
2058
  255,
2059
2059
  255
2060
2060
  ] } = n[e];
2061
2061
  m < e && t.blendMode !== te && (t.size = l - t.start, u.push(t), m = e, t = { id: ++d }, t.textures = i, t.start = l);
2062
- let { width: ie, height: ae } = g, oe = c / this._vertexSize, v = (ee ? f.get(ee) : 255) ?? 255, y = +!!re, se = +!!ne, ce, le, b;
2063
- for (let e = p.length, t = 0; t < e; t += 2) ce = h[t], le = h[t + 1], ie > 0 && ae > 0 && (ce = Math.ceil(ce * ie) / ie, le = Math.ceil(le * ae) / ae), a[c++] = p[t], a[c++] = p[t + 1], a[c++] = ce, a[c++] = le, b = c * 4, o[b] = v, o[b + 1] = se, o[b + 2] = y, o[b + 3] = 0, c++, b = c * 4, o[b] = _[0], o[b + 1] = _[1], o[b + 2] = _[2], o[b + 3] = _[3], c++;
2062
+ let { width: _, height: ae } = g, oe = c / this._vertexSize, se = (ee ? f.get(ee) : 255) ?? 255, v = +!!re, y = +!!ne, ce, le, b;
2063
+ for (let e = p.length, t = 0; t < e; t += 2) ce = h[t], le = h[t + 1], _ > 0 && ae > 0 && (ce = Math.ceil(ce * _) / _, le = Math.ceil(le * ae) / ae), a[c++] = p[t], a[c++] = p[t + 1], a[c++] = ce, a[c++] = le, b = c * 4, o[b] = se, o[b + 1] = y, o[b + 2] = v, o[b + 3] = 0, c++, b = c * 4, o[b] = ie[0], o[b + 1] = ie[1], o[b + 2] = ie[2], o[b + 3] = ie[3], c++;
2064
2064
  for (let e = r.length, t = 0; t < e; t++) s[l++] = oe + r[t];
2065
2065
  t.blendMode = te;
2066
2066
  }
@@ -2082,22 +2082,22 @@ void main(void) {
2082
2082
  }
2083
2083
  }
2084
2084
  _getBufferData(e) {
2085
- let t = Zt(Math.ceil(e / 8)), n = Qt(t), r = t * 8;
2085
+ let t = Qt(Math.ceil(e / 8)), n = $t(t), r = t * 8;
2086
2086
  this._attributeBuffer.length <= n && (this._indexBuffers.length = n + 1);
2087
2087
  let i = this._attributeBuffer[r];
2088
2088
  return i || (this._attributeBuffer[r] = i = /* @__PURE__ */ new ArrayBuffer(r * this._vertexSize * 4)), i;
2089
2089
  }
2090
2090
  _getIndexBufferData(e) {
2091
- let t = Zt(Math.ceil(e / 12)), n = Qt(t), r = t * 12;
2091
+ let t = Qt(Math.ceil(e / 12)), n = $t(t), r = t * 12;
2092
2092
  this._indexBuffers.length <= n && (this._indexBuffers.length = n + 1);
2093
2093
  let i = this._indexBuffers[n];
2094
2094
  return i || (this._indexBuffers[n] = i = new Uint32Array(r)), i;
2095
2095
  }
2096
2096
  };
2097
- function Zt(e) {
2097
+ function Qt(e) {
2098
2098
  return e += +(e === 0), --e, e |= e >>> 1, e |= e >>> 2, e |= e >>> 4, e |= e >>> 8, e |= e >>> 16, e + 1;
2099
2099
  }
2100
- function Qt(e) {
2100
+ function $t(e) {
2101
2101
  let t = (e > 65535) << 4;
2102
2102
  e >>>= t;
2103
2103
  let n = (e > 255) << 3;
@@ -2107,9 +2107,9 @@ function Qt(e) {
2107
2107
  //#region src/core/renderers/gl/const.ts
2108
2108
  var M = /* @__PURE__ */ function(e) {
2109
2109
  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;
2110
- }({}), $t = /* @__PURE__ */ function(e) {
2110
+ }({}), en = /* @__PURE__ */ function(e) {
2111
2111
  return e[e.none = 0] = "none", e[e.color = 16384] = "color", e[e.stencil = 1024] = "stencil", e[e.depth = 256] = "depth", e[e.colorDepth = e.color | e.depth] = "colorDepth", e[e.colorStencil = e.color | e.stencil] = "colorStencil", e[e.depthStencil = e.depth | e.stencil] = "depthStencil", e[e.all = e.color | e.depth | e.stencil] = "all", e;
2112
- }({}), en = class extends j {
2112
+ }({}), tn = class extends j {
2113
2113
  install(e) {
2114
2114
  super.install(e), e.mask = this;
2115
2115
  }
@@ -2134,13 +2134,13 @@ var M = /* @__PURE__ */ function(e) {
2134
2134
  let t = this.stack.pop();
2135
2135
  if (!t || t.source !== e) return;
2136
2136
  let { mask: n } = t, r = this._renderer.renderTarget.current?.instanceId ?? -1, i = this._maskStackHash[r] ?? 0;
2137
- "x" in n && this._renderer.scissor.pop(), "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear($t.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;
2137
+ "x" in n && this._renderer.scissor.pop(), "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(en.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;
2138
2138
  }
2139
- }, tn = [];
2140
- tn[M.none] = {}, tn[M.disabled] = {
2139
+ }, nn = [];
2140
+ nn[M.none] = {}, nn[M.disabled] = {
2141
2141
  stencilWriteMask: 0,
2142
2142
  stencilReadMask: 0
2143
- }, tn[M.renderingMaskAdd] = {
2143
+ }, nn[M.renderingMaskAdd] = {
2144
2144
  stencilFront: {
2145
2145
  compare: "equal",
2146
2146
  passOp: "increment-clamp"
@@ -2149,7 +2149,7 @@ tn[M.none] = {}, tn[M.disabled] = {
2149
2149
  compare: "equal",
2150
2150
  passOp: "increment-clamp"
2151
2151
  }
2152
- }, tn[M.renderingMaskRemove] = {
2152
+ }, nn[M.renderingMaskRemove] = {
2153
2153
  stencilFront: {
2154
2154
  compare: "equal",
2155
2155
  passOp: "decrement-clamp"
@@ -2158,7 +2158,7 @@ tn[M.none] = {}, tn[M.disabled] = {
2158
2158
  compare: "equal",
2159
2159
  passOp: "decrement-clamp"
2160
2160
  }
2161
- }, tn[M.maskActive] = {
2161
+ }, nn[M.maskActive] = {
2162
2162
  stencilWriteMask: 0,
2163
2163
  stencilFront: {
2164
2164
  compare: "equal",
@@ -2168,7 +2168,7 @@ tn[M.none] = {}, tn[M.disabled] = {
2168
2168
  compare: "equal",
2169
2169
  passOp: "keep"
2170
2170
  }
2171
- }, tn[M.inverseMaskActive] = {
2171
+ }, nn[M.inverseMaskActive] = {
2172
2172
  stencilWriteMask: 0,
2173
2173
  stencilFront: {
2174
2174
  compare: "not-equal",
@@ -2179,7 +2179,7 @@ tn[M.none] = {}, tn[M.disabled] = {
2179
2179
  passOp: "keep"
2180
2180
  }
2181
2181
  };
2182
- var nn = class extends j {
2182
+ var rn = class extends j {
2183
2183
  install(e) {
2184
2184
  super.install(e), e.stencil = this;
2185
2185
  }
@@ -2231,7 +2231,7 @@ var nn = class extends j {
2231
2231
  }
2232
2232
  };
2233
2233
  bind(e, t) {
2234
- let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], r = this._gl, i = tn[e], a = this._cache;
2234
+ let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], r = this._gl, i = nn[e], a = this._cache;
2235
2235
  if (n.stencilMode = e, n.refCount = t, e === M.disabled) {
2236
2236
  this._cache.enabled && (this._cache.enabled = !1, r.disable(r.STENCIL_TEST));
2237
2237
  return;
@@ -2241,8 +2241,8 @@ var nn = class extends j {
2241
2241
  destroy() {
2242
2242
  super.destroy(), this._renderer.renderTarget.off("updateRenderTarget", this._updateRenderTarget);
2243
2243
  }
2244
- }, rn = class extends j {
2245
- current = new st(0, 0, 0, 0);
2244
+ }, an = class extends j {
2245
+ current = new lt(0, 0, 0, 0);
2246
2246
  install(e) {
2247
2247
  super.install(e), e.viewport = this;
2248
2248
  }
@@ -2250,7 +2250,7 @@ var nn = class extends j {
2250
2250
  let t = this.current, n = Math.floor(e.x), r = Math.floor(e.y), i = Math.floor(e.width), a = Math.floor(e.height);
2251
2251
  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);
2252
2252
  }
2253
- }, an = class {
2253
+ }, on = class {
2254
2254
  width = -1;
2255
2255
  height = -1;
2256
2256
  msaa = !1;
@@ -2260,7 +2260,7 @@ var nn = class extends j {
2260
2260
  constructor(e) {
2261
2261
  this.framebuffer = e;
2262
2262
  }
2263
- }, on = class extends j {
2263
+ }, sn = class extends j {
2264
2264
  install(e) {
2265
2265
  super.install(e), e.renderTarget = this;
2266
2266
  }
@@ -2270,7 +2270,7 @@ var nn = class extends j {
2270
2270
  _msaaSamples = [];
2271
2271
  _hasMRT = !0;
2272
2272
  _writeDepthTexture = !0;
2273
- projection = new pt();
2273
+ projection = new mt();
2274
2274
  _updateContext(e) {
2275
2275
  if (super._updateContext(e), this._hasMRT = !0, this._writeDepthTexture = !0, this._renderer.version === 1) {
2276
2276
  let t = this._renderer.extensions.drawBuffers, n = this._renderer.extensions.depthTexture;
@@ -2306,7 +2306,7 @@ var nn = class extends j {
2306
2306
  return this.glRenderTargets.get(e.instanceId) || this._createGlRenderTarget(e);
2307
2307
  }
2308
2308
  _createGlRenderTarget(e) {
2309
- let t = this._gl, n = new an(t.createFramebuffer());
2309
+ let t = this._gl, n = new on(t.createFramebuffer());
2310
2310
  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) => {
2311
2311
  switch (t) {
2312
2312
  case "width":
@@ -2383,27 +2383,27 @@ var nn = class extends j {
2383
2383
  reset() {
2384
2384
  super.reset(), this.renderTargets.clear(), this.glRenderTargets.clear(), this.current = null, this._msaaSamples.length = 0;
2385
2385
  }
2386
- }, sn = /* @__PURE__ */ function(e) {
2386
+ }, cn = /* @__PURE__ */ function(e) {
2387
2387
  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;
2388
- }({}), cn = /* @__PURE__ */ function(e) {
2388
+ }({}), ln = /* @__PURE__ */ function(e) {
2389
2389
  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;
2390
2390
  }({}), N = /* @__PURE__ */ function(e) {
2391
2391
  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;
2392
- }({}), ln = class {
2393
- target = cn.TEXTURE_2D;
2392
+ }({}), un = class {
2393
+ target = ln.TEXTURE_2D;
2394
2394
  width = -1;
2395
2395
  height = -1;
2396
2396
  mipmap = !1;
2397
2397
  type = N.UNSIGNED_BYTE;
2398
- internalFormat = sn.RGBA;
2399
- format = sn.RGBA;
2398
+ internalFormat = cn.RGBA;
2399
+ format = cn.RGBA;
2400
2400
  constructor(e) {
2401
2401
  this.native = e;
2402
2402
  }
2403
2403
  };
2404
2404
  //#endregion
2405
2405
  //#region src/core/renderers/gl/texture/mapFormatToGlFormat.ts
2406
- function un(e) {
2406
+ function dn(e) {
2407
2407
  return {
2408
2408
  r8unorm: e.RED,
2409
2409
  r8snorm: e.RED,
@@ -2451,7 +2451,7 @@ function un(e) {
2451
2451
  }
2452
2452
  //#endregion
2453
2453
  //#region src/core/renderers/gl/texture/mapFormatToGlInternalFormat.ts
2454
- function dn(e, t) {
2454
+ function fn(e, t) {
2455
2455
  let n = {}, r = e.RGBA;
2456
2456
  return e instanceof WebGLRenderingContext ? t.srgb && (n = {
2457
2457
  "rgba8unorm-srgb": t.srgb.SRGB8_ALPHA8_EXT,
@@ -2567,7 +2567,7 @@ function dn(e, t) {
2567
2567
  }
2568
2568
  //#endregion
2569
2569
  //#region src/core/renderers/gl/texture/mapFormatToGlType.ts
2570
- function fn(e) {
2570
+ function pn(e) {
2571
2571
  return {
2572
2572
  r8unorm: e.UNSIGNED_BYTE,
2573
2573
  r8snorm: e.BYTE,
@@ -2615,7 +2615,7 @@ function fn(e) {
2615
2615
  }
2616
2616
  //#endregion
2617
2617
  //#region src/core/renderers/gl/texture/updateTextureStyle.ts
2618
- var pn = {
2618
+ var mn = {
2619
2619
  linear: {
2620
2620
  linear: 9987,
2621
2621
  nearest: 9985
@@ -2624,10 +2624,10 @@ var pn = {
2624
2624
  linear: 9986,
2625
2625
  nearest: 9984
2626
2626
  }
2627
- }, mn = {
2627
+ }, hn = {
2628
2628
  linear: 9729,
2629
2629
  nearest: 9728
2630
- }, hn = {
2630
+ }, gn = {
2631
2631
  never: 512,
2632
2632
  less: 513,
2633
2633
  equal: 514,
@@ -2636,32 +2636,32 @@ var pn = {
2636
2636
  "not-equal": 517,
2637
2637
  "greater-equal": 518,
2638
2638
  always: 519
2639
- }, gn = {
2639
+ }, _n = {
2640
2640
  "clamp-to-edge": 33071,
2641
2641
  repeat: 10497,
2642
2642
  "mirror-repeat": 33648
2643
2643
  };
2644
- function _n(e, t, n, r, i, a, o, s) {
2644
+ function vn(e, t, n, r, i, a, o, s) {
2645
2645
  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;
2646
2646
  if (!s || c !== "repeat" || l !== "repeat" || u !== "repeat") {
2647
- let e = gn[o ? "clamp-to-edge" : c], n = gn[o ? "clamp-to-edge" : l], r = gn[o ? "clamp-to-edge" : u];
2647
+ let e = _n[o ? "clamp-to-edge" : c], n = _n[o ? "clamp-to-edge" : l], r = _n[o ? "clamp-to-edge" : u];
2648
2648
  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);
2649
2649
  }
2650
- if ((!s || d !== "linear") && t[i](g, t.TEXTURE_MAG_FILTER, mn[d]), n) {
2650
+ if ((!s || d !== "linear") && t[i](g, t.TEXTURE_MAG_FILTER, hn[d]), n) {
2651
2651
  if (!s || p !== "linear") {
2652
- let e = pn[f][p];
2652
+ let e = mn[f][p];
2653
2653
  t[i](g, t.TEXTURE_MIN_FILTER, e);
2654
2654
  }
2655
- } else t[i](g, t.TEXTURE_MIN_FILTER, mn[f]);
2655
+ } else t[i](g, t.TEXTURE_MIN_FILTER, hn[f]);
2656
2656
  if (r && m > 1) {
2657
2657
  let e = Math.min(m, t.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));
2658
2658
  t[i](g, r.TEXTURE_MAX_ANISOTROPY_EXT, e);
2659
2659
  }
2660
- h && t[i](g, t.TEXTURE_COMPARE_FUNC, hn[h]);
2660
+ h && t[i](g, t.TEXTURE_COMPARE_FUNC, gn[h]);
2661
2661
  }
2662
2662
  //#endregion
2663
2663
  //#region src/core/renderers/gl/texture/uploaders/index.ts
2664
- var vn = {
2664
+ var yn = {
2665
2665
  buffer: {
2666
2666
  id: "buffer",
2667
2667
  upload: (e, t, n) => {
@@ -2675,8 +2675,8 @@ var vn = {
2675
2675
  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;
2676
2676
  }
2677
2677
  }
2678
- }, yn = class extends j {
2679
- uploaders = { ...vn };
2678
+ }, bn = class extends j {
2679
+ uploaders = { ...yn };
2680
2680
  textures = /* @__PURE__ */ new Map();
2681
2681
  glTextures = /* @__PURE__ */ new Map();
2682
2682
  _mapFormatToInternalFormat = Object.create(null);
@@ -2691,14 +2691,14 @@ var vn = {
2691
2691
  super.install(e), e.texture = this;
2692
2692
  }
2693
2693
  _updateContext(e) {
2694
- super._updateContext(e), Object.keys(this._mapFormatToInternalFormat).length || (this._mapFormatToInternalFormat = dn(e, this._renderer.extensions), this._mapFormatToType = fn(e), this._mapFormatToFormat = un(e)), this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE), this.maxTextureImageUnits = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);
2694
+ super._updateContext(e), Object.keys(this._mapFormatToInternalFormat).length || (this._mapFormatToInternalFormat = fn(e, this._renderer.extensions), this._mapFormatToType = pn(e), this._mapFormatToFormat = dn(e)), this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE), this.maxTextureImageUnits = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);
2695
2695
  for (let e = 0; e < this.maxTextureImageUnits; e++) this.unbind(e);
2696
2696
  }
2697
2697
  getGlTexture(e) {
2698
2698
  return this.glTextures.get(e.instanceId) || this._createGlTexture(e);
2699
2699
  }
2700
2700
  _createGlTexture(e) {
2701
- let t = this._gl, n = new ln(t.createTexture());
2701
+ let t = this._gl, n = new un(t.createTexture());
2702
2702
  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)) {
2703
2703
  let t = Math.max(e.width, e.height);
2704
2704
  e.mipLevelCount = Math.floor(Math.log2(t)) + 1;
@@ -2758,7 +2758,7 @@ var vn = {
2758
2758
  }
2759
2759
  updateStyle(e, t = !1) {
2760
2760
  let n = this._gl;
2761
- _n(e, n, e.mipLevelCount > 1, this._renderer.extensions.anisotropicFiltering, "texParameteri", n.TEXTURE_2D, !this._renderer.supports.nonPowOf2wrapping && !e.isPowerOfTwo, t);
2761
+ vn(e, n, e.mipLevelCount > 1, this._renderer.extensions.anisotropicFiltering, "texParameteri", n.TEXTURE_2D, !this._renderer.supports.nonPowOf2wrapping && !e.isPowerOfTwo, t);
2762
2762
  }
2763
2763
  updateGpuTexture(e) {
2764
2764
  this.bind(e);
@@ -2773,7 +2773,7 @@ var vn = {
2773
2773
  let e = this._gl;
2774
2774
  this._premultiplyAlpha = !1, e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this._premultiplyAlpha);
2775
2775
  }
2776
- }, bn = {
2776
+ }, xn = {
2777
2777
  uint8x2: N.UNSIGNED_BYTE,
2778
2778
  uint8x4: N.UNSIGNED_BYTE,
2779
2779
  sint8x2: N.BYTE,
@@ -2805,18 +2805,18 @@ var vn = {
2805
2805
  sint32x3: N.INT,
2806
2806
  sint32x4: N.INT
2807
2807
  };
2808
- function xn(e) {
2809
- return bn[e] ?? bn.float32;
2808
+ function Sn(e) {
2809
+ return xn[e] ?? xn.float32;
2810
2810
  }
2811
2811
  //#endregion
2812
2812
  //#region src/core/renderers/gl/geometry/GlGeometrySystem.ts
2813
- var Sn = {
2813
+ var Cn = {
2814
2814
  "point-list": 0,
2815
2815
  "line-list": 1,
2816
2816
  "line-strip": 3,
2817
2817
  "triangle-list": 4,
2818
2818
  "triangle-strip": 5
2819
- }, Cn = class extends j {
2819
+ }, wn = class extends j {
2820
2820
  _geometryVaoHash = {};
2821
2821
  hasInstance = !1;
2822
2822
  current = null;
@@ -2855,11 +2855,11 @@ var Sn = {
2855
2855
  }
2856
2856
  for (let e in r) {
2857
2857
  let t = r[e];
2858
- i[t.buffer.instanceId] += It(t.format).stride;
2858
+ i[t.buffer.instanceId] += Lt(t.format).stride;
2859
2859
  }
2860
2860
  for (let e in r) {
2861
2861
  let t = r[e];
2862
- t.stride ??= i[t.buffer.instanceId], t.start ??= a[t.buffer.instanceId], a[t.buffer.instanceId] += It(t.format).stride;
2862
+ t.stride ??= i[t.buffer.instanceId], t.start ??= a[t.buffer.instanceId], a[t.buffer.instanceId] += Lt(t.format).stride;
2863
2863
  }
2864
2864
  }
2865
2865
  _createVao(e, t) {
@@ -2888,7 +2888,7 @@ var Sn = {
2888
2888
  a !== c && (r.bind(s), a = c);
2889
2889
  let e = l.location;
2890
2890
  n.enableVertexAttribArray(e);
2891
- let t = It(o.format), i = xn(o.format);
2891
+ let t = Lt(o.format), i = Sn(o.format);
2892
2892
  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) {
2893
2893
  let t = o.divisor ?? 1;
2894
2894
  n.vertexAttribDivisor(e, t);
@@ -2921,7 +2921,7 @@ var Sn = {
2921
2921
  let { topology: t, size: n, start: r = 0, instanceCount: i } = e, { gl: a } = this._renderer, o = this.current;
2922
2922
  if (!o) return this;
2923
2923
  t = t || o.topology || "triangle-list";
2924
- let s = Sn[t];
2924
+ let s = Cn[t];
2925
2925
  if (i = i || o.instanceCount || 1, o.indexBuffer) {
2926
2926
  n ||= o.indexBuffer.data.length;
2927
2927
  let e = o.indexBuffer.data.BYTES_PER_ELEMENT, t = e === 2 ? a.UNSIGNED_SHORT : a.UNSIGNED_INT;
@@ -2932,7 +2932,7 @@ var Sn = {
2932
2932
  reset() {
2933
2933
  super.reset(), this.current = null, this.currentVao = null;
2934
2934
  }
2935
- }, wn = class extends j {
2935
+ }, Tn = class extends j {
2936
2936
  install(e) {
2937
2937
  super.install(e), e.colorMask = this;
2938
2938
  }
@@ -2943,19 +2943,19 @@ var Sn = {
2943
2943
  };
2944
2944
  //#endregion
2945
2945
  //#region src/core/renderers/gl/GlScissorSystem.ts
2946
- function Tn(e, t, n) {
2946
+ function En(e, t, n) {
2947
2947
  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;
2948
2948
  return {
2949
2949
  x: f / m,
2950
2950
  y: p / m
2951
2951
  };
2952
2952
  }
2953
- function En(e, t) {
2953
+ function Dn(e, t) {
2954
2954
  let { x: n, y: r, width: i, height: a } = t, o = [
2955
- Tn(e, n, r),
2956
- Tn(e, n + i, r),
2957
- Tn(e, n + i, r + a),
2958
- Tn(e, n, r + a)
2955
+ En(e, n, r),
2956
+ En(e, n + i, r),
2957
+ En(e, n + i, r + a),
2958
+ En(e, n, r + a)
2959
2959
  ], 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);
2960
2960
  return {
2961
2961
  x: l,
@@ -2964,7 +2964,7 @@ function En(e, t) {
2964
2964
  height: f - d
2965
2965
  };
2966
2966
  }
2967
- var Dn = class extends j {
2967
+ var On = class extends j {
2968
2968
  install(e) {
2969
2969
  super.install(e), e.scissor = this;
2970
2970
  }
@@ -2991,28 +2991,28 @@ var Dn = class extends j {
2991
2991
  bind(e) {
2992
2992
  let t = this._gl;
2993
2993
  if (e) {
2994
- let { pixelRatio: n, viewport: r } = this._renderer, { viewMatrix: i } = this._renderer.shader.uniforms, { x: a, y: o, width: s, height: c } = En(i, e), l = r.current.height / n - (o + c);
2994
+ let { pixelRatio: n, viewport: r } = this._renderer, { viewMatrix: i } = this._renderer.shader.uniforms, { x: a, y: o, width: s, height: c } = Dn(i, e), l = r.current.height / n - (o + c);
2995
2995
  t.scissor(a * n, l * n, s * n, c * n);
2996
2996
  } else t.disable(t.SCISSOR_TEST);
2997
2997
  }
2998
2998
  destroy() {
2999
2999
  super.destroy(), this._renderer.renderTarget.off("updateRenderTarget", this._updateRenderTarget);
3000
3000
  }
3001
- }, On = class extends vt {
3001
+ }, kn = class extends yt {
3002
3002
  contextLost = !1;
3003
3003
  _systems = [
3004
- new yn(),
3005
- new St(),
3006
- new Gt(),
3007
- new Cn(),
3008
- new on(),
3009
- new Yt(),
3010
- new en(),
3004
+ new bn(),
3005
+ new Ct(),
3006
+ new Kt(),
3011
3007
  new wn(),
3012
- new nn(),
3013
- new Dn(),
3008
+ new sn(),
3014
3009
  new Xt(),
3015
- new rn()
3010
+ new tn(),
3011
+ new Tn(),
3012
+ new rn(),
3013
+ new On(),
3014
+ new Zt(),
3015
+ new an()
3016
3016
  ];
3017
3017
  bindPoints = /* @__PURE__ */ new Map();
3018
3018
  supports = {
@@ -3024,9 +3024,9 @@ var Dn = class extends j {
3024
3024
  msaa: !0,
3025
3025
  nonPowOf2mipmaps: !0
3026
3026
  };
3027
- constructor(e = Je(), t) {
3027
+ constructor(e = Xe(), t) {
3028
3028
  if (super(), !e) throw Error("Failed to createHTMLCanvas");
3029
- Ke(e) ? this._setupContext(e, t) : (this.gl = e, this.version = qe(this.gl) ? 2 : 1), this._setupBindPoints()._setupExtensions()._setupPolyfill()._setupSupports(), this._systems.forEach((e) => e.install(this)), this._systems.forEach((e) => e.emit("updateContext", this.gl)), this._systems.forEach((e) => e.emit("setup"));
3029
+ Je(e) ? this._setupContext(e, t) : (this.gl = e, this.version = Ye(this.gl) ? 2 : 1), this._setupBindPoints()._setupExtensions()._setupPolyfill()._setupSupports(), this._systems.forEach((e) => e.install(this)), this._systems.forEach((e) => e.emit("updateContext", this.gl)), this._systems.forEach((e) => e.emit("setup"));
3030
3030
  }
3031
3031
  _setupContext(e, t) {
3032
3032
  this.view = e;
@@ -3106,8 +3106,8 @@ var Dn = class extends j {
3106
3106
  height: this.screen.height * this.pixelRatio
3107
3107
  });
3108
3108
  }
3109
- clear(e = $t.all) {
3110
- typeof e == "boolean" && (e = e ? $t.all : $t.none), e && this.gl.clear(e);
3109
+ clear(e = en.all) {
3110
+ typeof e == "boolean" && (e = e ? en.all : en.none), e && this.gl.clear(e);
3111
3111
  }
3112
3112
  reset() {
3113
3113
  this._systems.forEach((e) => e.reset());
@@ -3124,7 +3124,7 @@ var Dn = class extends j {
3124
3124
  for (let e = 0; e < i; e += a) c.set(s.subarray(e, e + a), o - e);
3125
3125
  return c;
3126
3126
  }
3127
- }, kn = class {}, An = class extends kn {
3127
+ }, An = class {}, jn = class extends An {
3128
3128
  install(e) {
3129
3129
  let t = async (e) => {
3130
3130
  let { parseFont: t } = await import("modern-font");
@@ -3138,15 +3138,15 @@ var Dn = class extends j {
3138
3138
  e.register(n, t);
3139
3139
  }), e.font = this, this;
3140
3140
  }
3141
- }, jn, Mn = class extends T {
3141
+ }, Mn, Nn = class extends w {
3142
3142
  constructor(e) {
3143
3143
  super(), this.setProperties(e);
3144
3144
  }
3145
3145
  };
3146
- k([_({ fallback: A.index }), O("design:type", typeof (jn = A !== void 0 && A) == "function" ? jn : Object)], Mn.prototype, "usage", void 0), k([_({ default: () => new Uint32Array() }), O("design:type", Object)], Mn.prototype, "data", void 0);
3146
+ k([_({ fallback: A.index }), O("design:type", typeof (Mn = A !== void 0 && A) == "function" ? Mn : Object)], Nn.prototype, "usage", void 0), k([_({ default: () => new Uint32Array() }), O("design:type", Object)], Nn.prototype, "data", void 0);
3147
3147
  //#endregion
3148
3148
  //#region src/scene/resources/geometries/Geometry.ts
3149
- var Nn, Pn, Fn = class extends T {
3149
+ var Pn, Fn, In = class extends w {
3150
3150
  constructor(e = {}) {
3151
3151
  super(), this.setProperties(e);
3152
3152
  }
@@ -3154,26 +3154,26 @@ var Nn, Pn, Fn = class extends T {
3154
3154
  e.flush(), t.activate(e, n), e.geometry.bind(this, t.glProgram), e.geometry.draw(), e.geometry.unbind();
3155
3155
  }
3156
3156
  };
3157
- k([_({ fallback: "triangle-list" }), O("design:type", Object)], Fn.prototype, "topology", void 0), k([_({ default: () => ({}) }), O("design:type", typeof (Nn = typeof Record < "u" && Record) == "function" ? Nn : Object)], Fn.prototype, "attributes", void 0), k([_({ default: () => new Mn() }), O("design:type", typeof (Pn = Mn !== void 0 && Mn) == "function" ? Pn : Object)], Fn.prototype, "indexBuffer", void 0), k([_({ fallback: 1 }), O("design:type", Number)], Fn.prototype, "instanceCount", void 0);
3157
+ k([_({ fallback: "triangle-list" }), O("design:type", Object)], In.prototype, "topology", void 0), k([_({ default: () => ({}) }), O("design:type", typeof (Pn = typeof Record < "u" && Record) == "function" ? Pn : Object)], In.prototype, "attributes", void 0), k([_({ default: () => new Nn() }), O("design:type", typeof (Fn = Nn !== void 0 && Nn) == "function" ? Fn : Object)], In.prototype, "indexBuffer", void 0), k([_({ fallback: 1 }), O("design:type", Number)], In.prototype, "instanceCount", void 0);
3158
3158
  //#endregion
3159
3159
  //#region src/scene/resources/geometries/VertexBuffer.ts
3160
- var In, P = class extends T {
3160
+ var Ln, P = class extends w {
3161
3161
  constructor(e) {
3162
3162
  super(), this.setProperties(e);
3163
3163
  }
3164
3164
  };
3165
- k([_({ fallback: A.vertex }), O("design:type", typeof (In = A !== void 0 && A) == "function" ? In : Object)], P.prototype, "usage", void 0), k([_({ default: () => new Float32Array() }), O("design:type", Object)], P.prototype, "data", void 0);
3165
+ k([_({ fallback: A.vertex }), O("design:type", typeof (Ln = A !== void 0 && A) == "function" ? Ln : Object)], P.prototype, "usage", void 0), k([_({ default: () => new Float32Array() }), O("design:type", Object)], P.prototype, "data", void 0);
3166
3166
  //#endregion
3167
3167
  //#region src/scene/resources/geometries/VertexAttribute.ts
3168
- var Ln, F = class extends T {
3168
+ var Rn, F = class extends w {
3169
3169
  constructor(e) {
3170
3170
  super(), this.setProperties(e);
3171
3171
  }
3172
3172
  };
3173
- k([_({ default: () => new P() }), O("design:type", typeof (Ln = P !== void 0 && P) == "function" ? Ln : Object)], 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);
3173
+ k([_({ default: () => new P() }), O("design:type", typeof (Rn = P !== void 0 && P) == "function" ? Rn : Object)], 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);
3174
3174
  //#endregion
3175
3175
  //#region src/scene/resources/geometries/QuadGeometry.ts
3176
- var Rn = class extends Fn {
3176
+ var zn = class extends In {
3177
3177
  constructor() {
3178
3178
  super({
3179
3179
  topology: "triangle-strip",
@@ -3190,7 +3190,7 @@ var Rn = class extends Fn {
3190
3190
  1
3191
3191
  ]) })
3192
3192
  }) },
3193
- indexBuffer: new Mn({ data: new Uint32Array([
3193
+ indexBuffer: new Nn({ data: new Uint32Array([
3194
3194
  0,
3195
3195
  1,
3196
3196
  3,
@@ -3198,8 +3198,8 @@ var Rn = class extends Fn {
3198
3198
  ]) })
3199
3199
  });
3200
3200
  }
3201
- }, zn;
3202
- function Bn() {
3201
+ }, Bn;
3202
+ function Vn() {
3203
3203
  return {
3204
3204
  projectionMatrix: new Float32Array([
3205
3205
  1,
@@ -3231,13 +3231,13 @@ function Bn() {
3231
3231
  ])
3232
3232
  };
3233
3233
  }
3234
- var I = class extends T {
3234
+ var I = class extends w {
3235
3235
  static instance = new this();
3236
3236
  glProgram;
3237
3237
  constructor(e = {}) {
3238
3238
  super();
3239
3239
  let { uniforms: t, gl: n } = e;
3240
- t && (this.uniforms = t), this.glProgram = new Pt({
3240
+ t && (this.uniforms = t), this.glProgram = new Ft({
3241
3241
  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}",
3242
3242
  fragment: "uniform vec4 tint;\nvoid main(void) {\n gl_FragColor = tint;\n}",
3243
3243
  ...n
@@ -3250,13 +3250,13 @@ var I = class extends T {
3250
3250
  }, e.shader.updateUniforms(this);
3251
3251
  }
3252
3252
  };
3253
- k([_({ default: Bn }), O("design:type", typeof (zn = typeof Record < "u" && Record) == "function" ? zn : Object)], I.prototype, "uniforms", void 0);
3253
+ k([_({ default: Vn }), O("design:type", typeof (Bn = typeof Record < "u" && Record) == "function" ? Bn : Object)], I.prototype, "uniforms", void 0);
3254
3254
  //#endregion
3255
3255
  //#region src/scene/resources/materials/EffectMaterial.ts
3256
- var Vn = /^uniform \w+ (.+?);\s*\/\/\s*=\s*([^;]+?)[\s;]*$/gm, Hn = /vec(\d)\((.*)\)/;
3257
- function Un(e) {
3256
+ var Hn = /^uniform \w+ (.+?);\s*\/\/\s*=\s*([^;]+?)[\s;]*$/gm, Un = /vec(\d)\((.*)\)/;
3257
+ function Wn(e) {
3258
3258
  e = e.trim();
3259
- let t = e.match(Hn);
3259
+ let t = e.match(Un);
3260
3260
  if (t) {
3261
3261
  let e = Array.from({ length: Number(t[1]) }, () => 0);
3262
3262
  return t[2].split(",").forEach((t, n) => {
@@ -3265,7 +3265,7 @@ function Un(e) {
3265
3265
  }
3266
3266
  return Number(e);
3267
3267
  }
3268
- var Wn = class e extends I {
3268
+ var Gn = class e extends I {
3269
3269
  static RE = {
3270
3270
  getColor: /\sgetColor\s*\(/,
3271
3271
  getFromColor: /\sgetFromColor\s*\(/,
@@ -3301,12 +3301,12 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3301
3301
  progress: 0
3302
3302
  }
3303
3303
  }), this.has = n;
3304
- let r = t.matchAll(Vn);
3304
+ let r = t.matchAll(Hn);
3305
3305
  for (let e of r) e[1] && e[2] && e[1].split(",").forEach((t) => {
3306
- this.uniforms[t.trim()] = Un(e[2]);
3306
+ this.uniforms[t.trim()] = Wn(e[2]);
3307
3307
  });
3308
3308
  }
3309
- }, Gn = class extends I {
3309
+ }, Kn = class extends I {
3310
3310
  static _instance;
3311
3311
  static get instance() {
3312
3312
  return this._instance ??= new this();
@@ -3350,12 +3350,12 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3350
3350
  }
3351
3351
  });
3352
3352
  }
3353
- }, L = class extends Fn {
3353
+ }, L = class extends In {
3354
3354
  static _instance;
3355
3355
  static get instance() {
3356
3356
  return this._instance ??= new this();
3357
3357
  }
3358
- static draw(e, t = Gn.instance, n) {
3358
+ static draw(e, t = Kn.instance, n) {
3359
3359
  this.instance.draw(e, t, n);
3360
3360
  }
3361
3361
  constructor() {
@@ -3388,7 +3388,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3388
3388
  ]) })
3389
3389
  })
3390
3390
  },
3391
- indexBuffer: new Mn({ data: new Uint32Array([
3391
+ indexBuffer: new Nn({ data: new Uint32Array([
3392
3392
  0,
3393
3393
  1,
3394
3394
  2,
@@ -3398,7 +3398,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3398
3398
  ]) })
3399
3399
  });
3400
3400
  }
3401
- }, Kn = class extends Fn {
3401
+ }, qn = class extends In {
3402
3402
  positionBuffer;
3403
3403
  uvBuffer;
3404
3404
  constructor(e) {
@@ -3415,10 +3415,10 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3415
3415
  buffer: n
3416
3416
  })
3417
3417
  },
3418
- indexBuffer: new Mn({ data: new Uint32Array() })
3418
+ indexBuffer: new Nn({ data: new Uint32Array() })
3419
3419
  }), this.positionBuffer = t, this.uvBuffer = n;
3420
3420
  }
3421
- }, R = class extends T {
3421
+ }, R = class extends w {
3422
3422
  get valid() {
3423
3423
  return !!(this.width && this.height);
3424
3424
  }
@@ -3435,7 +3435,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
3435
3435
  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);
3436
3436
  //#endregion
3437
3437
  //#region src/scene/resources/textures/Texture2D.ts
3438
- var z = class extends T {
3438
+ var z = class extends w {
3439
3439
  static get EMPTY() {
3440
3440
  return new this({
3441
3441
  width: 1,
@@ -3526,7 +3526,7 @@ var z = class extends T {
3526
3526
  switch (super._updateProperty(e, t, n), e) {
3527
3527
  case "width":
3528
3528
  case "height":
3529
- this.isPowerOfTwo = ve(this.pixelWidth) && ve(this.pixelHeight);
3529
+ this.isPowerOfTwo = ye(this.pixelWidth) && ye(this.pixelHeight);
3530
3530
  break;
3531
3531
  case "source":
3532
3532
  this.updateSize();
@@ -3543,13 +3543,13 @@ var z = class extends T {
3543
3543
  e.texture.unbind(this);
3544
3544
  }
3545
3545
  _destroy() {
3546
- super._destroy(), Oe && this.source instanceof ImageBitmap && this.source.close();
3546
+ super._destroy(), ke && this.source instanceof ImageBitmap && this.source.close();
3547
3547
  }
3548
3548
  };
3549
3549
  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);
3550
3550
  //#endregion
3551
3551
  //#region src/scene/resources/textures/AnimatedTexture.ts
3552
- var qn = class extends T {
3552
+ var Jn = class extends w {
3553
3553
  frames;
3554
3554
  frameIndex = 0;
3555
3555
  get currentFrame() {
@@ -3574,7 +3574,7 @@ var qn = class extends T {
3574
3574
  e.texture.destroy();
3575
3575
  });
3576
3576
  }
3577
- }, Jn = class extends z {
3577
+ }, Yn = class extends z {
3578
3578
  constructor(e = {}) {
3579
3579
  super({
3580
3580
  pixelRatio: 2,
@@ -3594,14 +3594,14 @@ var qn = class extends T {
3594
3594
  }
3595
3595
  super._updateProperty(e, t, n);
3596
3596
  }
3597
- }, Yn = class e extends z {
3597
+ }, Xn = class e extends z {
3598
3598
  static _cached = /* @__PURE__ */ new Map();
3599
3599
  static get(t) {
3600
- let n = new E(t), r = n.toHex(), i = this._cached.get(r);
3600
+ let n = new T(t), r = n.toHex(), i = this._cached.get(r);
3601
3601
  return i || (i = new e(n), this._cached.set(r, i)), i;
3602
3602
  }
3603
3603
  constructor(e) {
3604
- let t = e instanceof E ? e : new E(e);
3604
+ let t = e instanceof T ? e : new T(e);
3605
3605
  super({
3606
3606
  width: 1,
3607
3607
  height: 1,
@@ -3615,7 +3615,7 @@ var qn = class extends T {
3615
3615
  mipmap: !0
3616
3616
  });
3617
3617
  }
3618
- }, Xn = class e extends z {
3618
+ }, Zn = class e extends z {
3619
3619
  static test(e) {
3620
3620
  return u(e);
3621
3621
  }
@@ -3639,7 +3639,7 @@ var qn = class extends T {
3639
3639
  constructor(t, n, r) {
3640
3640
  super(e.linearGradient(t, n, r));
3641
3641
  }
3642
- }, Zn = class extends z {
3642
+ }, Qn = class extends z {
3643
3643
  constructor(e = {}) {
3644
3644
  super({
3645
3645
  ...e,
@@ -3649,7 +3649,7 @@ var qn = class extends T {
3649
3649
  };
3650
3650
  //#endregion
3651
3651
  //#region src/scene/resources/textures/VideoTexture.ts
3652
- function Qn(e) {
3652
+ function $n(e) {
3653
3653
  return {
3654
3654
  autoLoad: !!(e?.autoLoad ?? !0),
3655
3655
  autoPlay: !!(e?.autoPlay ?? !1),
@@ -3660,7 +3660,7 @@ function Qn(e) {
3660
3660
  playsinline: !!(e?.playsinline ?? !0)
3661
3661
  };
3662
3662
  }
3663
- var $n = class e extends z {
3663
+ var er = class e extends z {
3664
3664
  static mimeTypes = new Map(Object.entries({
3665
3665
  ogv: "video/ogg",
3666
3666
  mov: "video/quicktime",
@@ -3693,11 +3693,11 @@ var $n = class e extends z {
3693
3693
  _resolve;
3694
3694
  _reject;
3695
3695
  constructor(t, n) {
3696
- let r = Qn(n);
3697
- if (!We(t)) {
3696
+ let r = $n(n);
3697
+ if (!Ke(t)) {
3698
3698
  typeof t == "string" && (t = [t]);
3699
3699
  let n = t[0].src || t[0], i = document.createElement("video");
3700
- r.autoLoad && i.setAttribute("preload", "auto"), r.playsinline && (i.setAttribute("webkit-playsinline", ""), i.setAttribute("playsinline", "")), r.muted && (i.setAttribute("muted", ""), i.muted = !0), r.loop && i.setAttribute("loop", ""), r.autoPlay && i.setAttribute("autoplay", ""), Xe(i, n, r.crossorigin);
3700
+ r.autoLoad && i.setAttribute("preload", "auto"), r.playsinline && (i.setAttribute("webkit-playsinline", ""), i.setAttribute("playsinline", "")), r.muted && (i.setAttribute("muted", ""), i.muted = !0), r.loop && i.setAttribute("loop", ""), r.autoPlay && i.setAttribute("autoplay", ""), Qe(i, n, r.crossorigin);
3701
3701
  for (let n = 0; n < t.length; ++n) {
3702
3702
  let { src: r, mime: a } = t[n];
3703
3703
  if (r ||= t[n], r.startsWith("data:")) a = r.slice(5, r.indexOf(";"));
@@ -3771,13 +3771,13 @@ var $n = class e extends z {
3771
3771
  k([_({
3772
3772
  internal: !0,
3773
3773
  fallback: !0
3774
- }), O("design:type", Boolean)], $n.prototype, "autoUpdate", void 0), k([_({
3774
+ }), O("design:type", Boolean)], er.prototype, "autoUpdate", void 0), k([_({
3775
3775
  internal: !0,
3776
3776
  fallback: 0
3777
- }), O("design:type", Number)], $n.prototype, "fps", void 0);
3777
+ }), O("design:type", Number)], er.prototype, "fps", void 0);
3778
3778
  //#endregion
3779
3779
  //#region src/scene/resources/textures/ViewportTexture.ts
3780
- var er = class extends z {}, tr = class extends ae {
3780
+ var tr = class extends z {}, nr = class extends oe {
3781
3781
  fillStyle;
3782
3782
  strokeStyle;
3783
3783
  strokeAlignment;
@@ -3789,7 +3789,7 @@ var er = class extends z {}, tr = class extends ae {
3789
3789
  transformVertex;
3790
3790
  _draws = [];
3791
3791
  _parseDrawStyle(e) {
3792
- return e ? e instanceof z ? { texture: e } : { texture: Yn.get(e) } : {};
3792
+ return e ? e instanceof z ? { texture: e } : { texture: Xn.get(e) } : {};
3793
3793
  }
3794
3794
  stroke(e) {
3795
3795
  if (!this.curves.length) return;
@@ -3806,7 +3806,7 @@ var er = class extends z {}, tr = class extends ae {
3806
3806
  ...e,
3807
3807
  ...this._parseDrawStyle(n),
3808
3808
  type: "stroke",
3809
- path: new ae(this),
3809
+ path: new oe(this),
3810
3810
  transformUv: this.transformUv,
3811
3811
  transformVertex: this.transformVertex,
3812
3812
  lineStyle: {
@@ -3841,7 +3841,7 @@ var er = class extends z {}, tr = class extends ae {
3841
3841
  ...e,
3842
3842
  ...this._parseDrawStyle(t),
3843
3843
  type: "fill",
3844
- path: new ae(this)
3844
+ path: new oe(this)
3845
3845
  }), this.resetStatus();
3846
3846
  }
3847
3847
  copyFrom(e) {
@@ -3877,7 +3877,7 @@ var er = class extends z {}, tr = class extends ae {
3877
3877
  destroy() {
3878
3878
  this.reset();
3879
3879
  }
3880
- }, nr = class {
3880
+ }, rr = class {
3881
3881
  front = [];
3882
3882
  default = [];
3883
3883
  back = [];
@@ -3920,7 +3920,7 @@ var er = class extends z {}, tr = class extends ae {
3920
3920
  toJSON() {
3921
3921
  return [...this.default];
3922
3922
  }
3923
- }, rr = class extends w {
3923
+ }, ir = class extends C {
3924
3924
  getPropertyDeclarations() {
3925
3925
  super.getPropertyDeclarations();
3926
3926
  let e = {};
@@ -3938,22 +3938,22 @@ var er = class extends z {}, tr = class extends ae {
3938
3938
  deleteProperty: (e, t) => Reflect.has(e, t) || String(t).startsWith("_") ? Reflect.deleteProperty(e, t) : (e.setProperty(String(t), void 0), !0)
3939
3939
  });
3940
3940
  }
3941
- }, ir, ar, or = {};
3942
- function sr(e) {
3943
- let t = or[e] ?? 0;
3944
- return t++, or[e] = t, t;
3941
+ }, ar, or, sr = {};
3942
+ function cr(e) {
3943
+ let t = sr[e] ?? 0;
3944
+ return t++, sr[e] = t, t;
3945
3945
  }
3946
- var B = ar = class extends w {
3946
+ var B = or = class extends C {
3947
3947
  static parse(e, t = "Node") {
3948
3948
  if (Array.isArray(e)) return e.map((e) => this.parse(e));
3949
- let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((pe.get(n ?? r.inCanvasIs ?? t)) ?? ar)({
3949
+ let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((me.get(n ?? r.inCanvasIs ?? t)) ?? or)({
3950
3950
  ...a,
3951
3951
  meta: r
3952
3952
  });
3953
3953
  return i?.forEach((e) => o.appendChild(this.parse(e))), o;
3954
3954
  }
3955
3955
  _mask;
3956
- _meta = new rr(this);
3956
+ _meta = new ir(this);
3957
3957
  get meta() {
3958
3958
  return this._meta;
3959
3959
  }
@@ -3976,7 +3976,7 @@ var B = ar = class extends w {
3976
3976
  }).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();
3977
3977
  }
3978
3978
  _defaultName() {
3979
- return `@${this.is}@${sr(this.is)}`;
3979
+ return `@${this.is}@${cr(this.is)}`;
3980
3980
  }
3981
3981
  setProperties(e) {
3982
3982
  if (e) {
@@ -4043,7 +4043,7 @@ var B = ar = class extends w {
4043
4043
  }
4044
4044
  return this;
4045
4045
  }
4046
- _children = new nr();
4046
+ _children = new rr();
4047
4047
  get children() {
4048
4048
  return this._children.default;
4049
4049
  }
@@ -4200,7 +4200,7 @@ var B = ar = class extends w {
4200
4200
  append(...e) {
4201
4201
  let t;
4202
4202
  t = Array.isArray(e[0]) ? e[0] : e, t.forEach((e) => {
4203
- e instanceof ar ? this.appendChild(e) : this.appendChild(ar.parse(e));
4203
+ e instanceof or ? this.appendChild(e) : this.appendChild(or.parse(e));
4204
4204
  });
4205
4205
  }
4206
4206
  before(...e) {
@@ -4306,10 +4306,10 @@ var B = ar = class extends w {
4306
4306
  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([_({
4307
4307
  internal: !0,
4308
4308
  default: !0
4309
- }), O("design:type", Boolean)], B.prototype, "needsRender", void 0), B = ar = k([x("Node"), O("design:paramtypes", [typeof (ir = typeof Partial < "u" && Partial) == "function" ? ir : Object, Array])], B);
4309
+ }), O("design:type", Boolean)], B.prototype, "needsRender", void 0), B = or = k([x("Node"), O("design:paramtypes", [typeof (ar = typeof Partial < "u" && Partial) == "function" ? ar : Object, Array])], B);
4310
4310
  //#endregion
4311
4311
  //#region src/scene/main/TimelineNode.ts
4312
- var cr, V = class extends B {
4312
+ var lr, V = class extends B {
4313
4313
  insideTimeRange = !1;
4314
4314
  get _timeline() {
4315
4315
  return this._tree?.timeline;
@@ -4340,7 +4340,7 @@ var cr, V = class extends B {
4340
4340
  return this._globalStartTime + this._globalDuration;
4341
4341
  }
4342
4342
  get currentTimeProgress() {
4343
- return this._duration ? ut(this._currentTime / this._duration, 0, 1) : 0;
4343
+ return this._duration ? E(this._currentTime / this._duration, 0, 1) : 0;
4344
4344
  }
4345
4345
  isInsideTimeRange() {
4346
4346
  let e = this._currentTime;
@@ -4380,10 +4380,10 @@ var cr, V = class extends B {
4380
4380
  super._process(e), this._updateCurrentTime();
4381
4381
  }
4382
4382
  };
4383
- 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([x("TimelineNode"), O("design:paramtypes", [typeof (cr = typeof Partial < "u" && Partial) == "function" ? cr : Object, Array])], V);
4383
+ 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([x("TimelineNode"), O("design:paramtypes", [typeof (lr = typeof Partial < "u" && Partial) == "function" ? lr : Object, Array])], V);
4384
4384
  //#endregion
4385
4385
  //#region src/scene/main/CanvasItem.ts
4386
- var lr, ur = class extends V {
4386
+ var ur, dr = class extends V {
4387
4387
  _blendMode;
4388
4388
  _parentGlobalVisible;
4389
4389
  _globalVisible;
@@ -4401,7 +4401,7 @@ var lr, ur = class extends V {
4401
4401
  255,
4402
4402
  255
4403
4403
  ];
4404
- context = new tr();
4404
+ context = new nr();
4405
4405
  _resetContext = !0;
4406
4406
  needsDraw = !0;
4407
4407
  needsLayout = !1;
@@ -4463,7 +4463,7 @@ var lr, ur = class extends V {
4463
4463
  }
4464
4464
  _updateGlobalOpacity() {
4465
4465
  this._parentGlobalOpacity = this.getParent()?.opacity;
4466
- let e = ut(this.opacity, 0, 1) * (this._parentGlobalOpacity ?? 1);
4466
+ let e = E(this.opacity, 0, 1) * (this._parentGlobalOpacity ?? 1);
4467
4467
  this._globalOpacity !== e && (this._globalOpacity = e, this._updateModulate(), this.requestPaint(), this.updateRenderable());
4468
4468
  }
4469
4469
  _draw() {
@@ -4528,7 +4528,7 @@ var lr, ur = class extends V {
4528
4528
  _render(e) {
4529
4529
  this._updateBatchables();
4530
4530
  let t = this._tree?.pixelate, n = this._tree?.roundPixels, r = this._batchables;
4531
- for (let i, a, o = r.length, s = 0; s < o; s++) i = r[s], a = i.texture, a instanceof er && (a = this._handleViewportTexture(i)), e.batch2D.render({
4531
+ for (let i, a, o = r.length, s = 0; s < o; s++) i = r[s], a = i.texture, a instanceof tr && (a = this._handleViewportTexture(i)), e.batch2D.render({
4532
4532
  ...i,
4533
4533
  roundPixels: n,
4534
4534
  size: t ? i.size : void 0,
@@ -4540,13 +4540,13 @@ var lr, ur = class extends V {
4540
4540
  super._destroy(), this.context.destroy(), this._drawBatchables = [], this._layoutBatchables = [], this._batchables = [];
4541
4541
  }
4542
4542
  };
4543
- k([_(), O("design:type", Object)], ur.prototype, "blendMode", void 0), k([_({
4543
+ k([_(), O("design:type", Object)], dr.prototype, "blendMode", void 0), k([_({
4544
4544
  internal: !0,
4545
4545
  fallback: !0
4546
- }), O("design:type", Boolean)], ur.prototype, "visible", void 0), k([_({
4546
+ }), O("design:type", Boolean)], dr.prototype, "visible", void 0), k([_({
4547
4547
  internal: !0,
4548
4548
  fallback: 1
4549
- }), O("design:type", Number)], ur.prototype, "opacity", void 0), ur = k([x("CanvasItem"), O("design:paramtypes", [typeof (lr = typeof Partial < "u" && Partial) == "function" ? lr : Object, Array])], ur);
4549
+ }), O("design:type", Number)], dr.prototype, "opacity", void 0), dr = k([x("CanvasItem"), O("design:paramtypes", [typeof (ur = typeof Partial < "u" && Partial) == "function" ? ur : Object, Array])], dr);
4550
4550
  //#endregion
4551
4551
  //#region src/scene/main/Viewport.ts
4552
4552
  var H = class extends B {
@@ -4599,7 +4599,7 @@ var H = class extends B {
4599
4599
  return !1;
4600
4600
  }
4601
4601
  activateWithCopy(e, t) {
4602
- this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0), L.draw(e, Gn.instance, { sampler: 0 }));
4602
+ this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0), L.draw(e, Kn.instance, { sampler: 0 }));
4603
4603
  }
4604
4604
  renderStart(e, t) {
4605
4605
  this.activate(e, t) && e.clear();
@@ -4612,7 +4612,7 @@ var H = class extends B {
4612
4612
  this.renderStart(e), super.render(e, t), this.renderEnd(e, n);
4613
4613
  }
4614
4614
  getRect() {
4615
- return new st(this.x, this.y, this.width, this.height);
4615
+ return new lt(this.x, this.y, this.width, this.height);
4616
4616
  }
4617
4617
  toCanvasGlobal(e, t) {
4618
4618
  return this.canvasTransform.applyAffineInverse(e, t);
@@ -4627,7 +4627,7 @@ var H = class extends B {
4627
4627
  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([x("Viewport")], H);
4628
4628
  //#endregion
4629
4629
  //#region src/scene/main/Effect.ts
4630
- var dr, U = class extends V {
4630
+ var fr, U = class extends V {
4631
4631
  material;
4632
4632
  get _effectMode() {
4633
4633
  return this.effectMode ?? "parent";
@@ -4650,7 +4650,7 @@ var dr, U = class extends V {
4650
4650
  _updateProperty(e, t, n) {
4651
4651
  switch (super._updateProperty(e, t, n), e) {
4652
4652
  case "glsl": {
4653
- let e = new Wn(t);
4653
+ let e = new Gn(t);
4654
4654
  !this.effectMode && e.has.transition && (this.effectMode = "transition"), this.material = e;
4655
4655
  break;
4656
4656
  }
@@ -4685,7 +4685,7 @@ var dr, U = class extends V {
4685
4685
  }
4686
4686
  }
4687
4687
  getRect() {
4688
- return new st(this._rect);
4688
+ return new lt(this._rect);
4689
4689
  }
4690
4690
  _processParent() {
4691
4691
  let e = this._tree?.renderStack;
@@ -4855,10 +4855,10 @@ var dr, U = class extends V {
4855
4855
  super._destroy(), this.viewport1.destroy(), this.viewport2.destroy();
4856
4856
  }
4857
4857
  };
4858
- 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([x("Effect"), O("design:paramtypes", [typeof (dr = typeof Partial < "u" && Partial) == "function" ? dr : Object, Array])], U);
4858
+ 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([x("Effect"), O("design:paramtypes", [typeof (fr = typeof Partial < "u" && Partial) == "function" ? fr : Object, Array])], U);
4859
4859
  //#endregion
4860
4860
  //#region src/scene/main/RenderStack.ts
4861
- var fr = class {
4861
+ var pr = class {
4862
4862
  currentCall;
4863
4863
  calls = [];
4864
4864
  createCall(e) {
@@ -4880,11 +4880,11 @@ var fr = class {
4880
4880
  });
4881
4881
  }), this.calls = [];
4882
4882
  }
4883
- }, pr, mr, hr = mr = class extends B {
4883
+ }, mr, hr, gr = hr = class extends B {
4884
4884
  currentTime = 0;
4885
4885
  static from(e, t = !1) {
4886
4886
  let [n, r] = e ? Array.isArray(e) ? e : [0, e] : [];
4887
- return new mr({
4887
+ return new hr({
4888
4888
  startTime: n,
4889
4889
  endTime: r,
4890
4890
  loop: t
@@ -4902,16 +4902,16 @@ var fr = class {
4902
4902
  }
4903
4903
  addTime(e) {
4904
4904
  let t = this.endTime, n = Math.min(this.startTime, this.endTime), r = this.currentTime;
4905
- return r += e, this.loop && r > t && (r = n + r % t), r = ut(r, n, t), this.currentTime = r, this.emit("updateCurrentTime", r, e), this;
4905
+ return r += e, this.loop && r > t && (r = n + r % t), r = E(r, n, t), this.currentTime = r, this.emit("updateCurrentTime", r, e), this;
4906
4906
  }
4907
4907
  _process(e) {
4908
4908
  super._process(e), this.paused || this.addTime(e);
4909
4909
  }
4910
4910
  };
4911
- k([_({ fallback: 0 }), O("design:type", Number)], hr.prototype, "startTime", void 0), k([_({ fallback: 2 ** 53 - 1 }), O("design:type", Number)], hr.prototype, "endTime", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], hr.prototype, "loop", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], hr.prototype, "paused", void 0), hr = mr = k([x("Timeline"), O("design:paramtypes", [typeof (pr = typeof Partial < "u" && Partial) == "function" ? pr : Object])], hr);
4911
+ k([_({ fallback: 0 }), O("design:type", Number)], gr.prototype, "startTime", void 0), k([_({ fallback: 2 ** 53 - 1 }), O("design:type", Number)], gr.prototype, "endTime", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], gr.prototype, "loop", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], gr.prototype, "paused", void 0), gr = hr = k([x("Timeline"), O("design:paramtypes", [typeof (mr = typeof Partial < "u" && Partial) == "function" ? mr : Object])], gr);
4912
4912
  //#endregion
4913
4913
  //#region src/scene/main/Window.ts
4914
- var gr = class extends H {
4914
+ var _r = class extends H {
4915
4915
  constructor() {
4916
4916
  super(), this.renderTargets.forEach((e) => e.isRoot = !0);
4917
4917
  }
@@ -4922,18 +4922,19 @@ var gr = class extends H {
4922
4922
  super.flush(e), this.finish(e);
4923
4923
  }
4924
4924
  };
4925
- gr = k([x("Window", {
4925
+ _r = k([x("Window", {
4926
4926
  processMode: "always",
4927
4927
  renderMode: "always"
4928
- }), O("design:paramtypes", [])], gr);
4928
+ }), O("design:paramtypes", [])], _r);
4929
4929
  //#endregion
4930
4930
  //#region src/scene/main/SceneTree.ts
4931
- var _r = class extends mt {
4932
- input = new at();
4933
- renderStack = new fr();
4934
- root = new gr().setTree(this);
4935
- timeline = new hr().setTree(this);
4936
- _backgroundColor = new E();
4931
+ var vr = class extends ht {
4932
+ input = new st();
4933
+ renderStack = new pr();
4934
+ root = new _r().setTree(this);
4935
+ timeline = new gr().setTree(this);
4936
+ nodeMap = /* @__PURE__ */ new Map();
4937
+ _backgroundColor = new T();
4937
4938
  _previousViewport;
4938
4939
  _currentViewport;
4939
4940
  getPreviousViewport() {
@@ -4945,8 +4946,11 @@ var _r = class extends mt {
4945
4946
  setCurrentViewport(e) {
4946
4947
  this._currentViewport && !this._currentViewport.equal(e) && (this._previousViewport = this._currentViewport), this._currentViewport = e;
4947
4948
  }
4949
+ getNodeById(e) {
4950
+ return this.nodeMap.get(e);
4951
+ }
4948
4952
  constructor(e) {
4949
- super(), this.setProperties(e);
4953
+ super(), this.on("nodeEnter", (e) => this.nodeMap.set(e.id, e)), this.on("nodeExit", (e) => this.nodeMap.delete(e.id)), this.setProperties(e);
4950
4954
  }
4951
4955
  _updateProperty(e, t, n) {
4952
4956
  switch (super._updateProperty(e, t, n), e) {
@@ -4977,33 +4981,33 @@ var _r = class extends mt {
4977
4981
  t.activate(e, 0), L.draw(e), t.inactivate(e);
4978
4982
  }
4979
4983
  _destroy() {
4980
- super._destroy(), this.root.destroy(), this.input.destroy();
4984
+ super._destroy(), this.root.destroy(), this.input.destroy(), this.nodeMap.clear();
4981
4985
  }
4982
4986
  };
4983
- k([_({ alias: "root.msaa" }), O("design:type", Boolean)], _r.prototype, "msaa", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], _r.prototype, "pixelate", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], _r.prototype, "roundPixels", void 0), k([_(), O("design:type", Object)], _r.prototype, "backgroundColor", void 0), k([_({
4987
+ k([_({ alias: "root.msaa" }), O("design:type", Boolean)], vr.prototype, "msaa", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], vr.prototype, "pixelate", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], vr.prototype, "roundPixels", void 0), k([_(), O("design:type", Object)], vr.prototype, "backgroundColor", void 0), k([_({
4984
4988
  internal: !0,
4985
4989
  fallback: !1
4986
- }), O("design:type", Boolean)], _r.prototype, "debug", void 0), k([_({
4990
+ }), O("design:type", Boolean)], vr.prototype, "debug", void 0), k([_({
4987
4991
  internal: !0,
4988
4992
  fallback: !1
4989
- }), O("design:type", Boolean)], _r.prototype, "processPaused", void 0), k([_({
4993
+ }), O("design:type", Boolean)], vr.prototype, "processPaused", void 0), k([_({
4990
4994
  internal: !0,
4991
- default: () => ue
4992
- }), O("design:type", Object)], _r.prototype, "fonts", void 0);
4995
+ default: () => de
4996
+ }), O("design:type", Object)], vr.prototype, "fonts", void 0);
4993
4997
  //#endregion
4994
4998
  //#region src/scene/main/Transition.ts
4995
- var vr, yr = class extends U {
4999
+ var yr, br = class extends U {
4996
5000
  constructor(e, t = []) {
4997
5001
  super(), this.setProperties(e).append(t);
4998
5002
  }
4999
5003
  };
5000
- yr = k([x("Transition", {
5004
+ br = k([x("Transition", {
5001
5005
  effectMode: "transition",
5002
5006
  duration: 2e3
5003
- }), O("design:paramtypes", [typeof (vr = typeof Partial < "u" && Partial) == "function" ? vr : Object, Array])], yr);
5007
+ }), O("design:paramtypes", [typeof (yr = typeof Partial < "u" && Partial) == "function" ? yr : Object, Array])], br);
5004
5008
  //#endregion
5005
5009
  //#region src/scene/2d/Node2D.ts
5006
- var br, xr = class extends ur {
5010
+ var xr, Sr = class extends dr {
5007
5011
  rotation = 0;
5008
5012
  position = new y(0, 0, () => this.updateGlobalTransform());
5009
5013
  scale = new y(1, 1, () => this.updateGlobalTransform());
@@ -5055,10 +5059,10 @@ var br, xr = class extends ur {
5055
5059
  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();
5056
5060
  }
5057
5061
  };
5058
- xr = k([x("Node2D"), O("design:paramtypes", [typeof (br = typeof Partial < "u" && Partial) == "function" ? br : Object, Array])], xr);
5062
+ Sr = k([x("Node2D"), O("design:paramtypes", [typeof (xr = typeof Partial < "u" && Partial) == "function" ? xr : Object, Array])], Sr);
5059
5063
  //#endregion
5060
5064
  //#region src/scene/2d/Camera2D.ts
5061
- var Sr, Cr = class extends xr {
5065
+ var Cr, wr = class extends Sr {
5062
5066
  canvasTransform = new v();
5063
5067
  _screenOffset = {
5064
5068
  x: 0,
@@ -5099,7 +5103,7 @@ var Sr, Cr = class extends xr {
5099
5103
  return this.setZoom(this._zoom.x + e, this._zoom.y + t);
5100
5104
  }
5101
5105
  setZoom(e, t = e) {
5102
- return this._zoom.set(ut(e, this._minZoom.x, this._maxZoom.x), ut(t, this._minZoom.y, this._maxZoom.y)), this;
5106
+ return this._zoom.set(E(e, this._minZoom.x, this._maxZoom.x), E(t, this._minZoom.y, this._maxZoom.y)), this;
5103
5107
  }
5104
5108
  setZoomAtOrigin(e, t, n) {
5105
5109
  let r;
@@ -5172,7 +5176,7 @@ var Sr, Cr = class extends xr {
5172
5176
  });
5173
5177
  }
5174
5178
  _getZoomByWheel(e, t) {
5175
- let n = e.ctrlKey && Ve ? 10 : 1, r = -e.deltaY * (e.deltaMode === 1 ? .05 : e.deltaMode ? 1 : .002) * n, i = Math.log(t) + r;
5179
+ let n = e.ctrlKey && Ue ? 10 : 1, r = -e.deltaY * (e.deltaMode === 1 ? .05 : e.deltaMode ? 1 : .002) * n, i = Math.log(t) + r;
5176
5180
  return Math.round(Math.exp(i) * 1e4) / 1e4;
5177
5181
  }
5178
5182
  _updateTransform() {
@@ -5205,16 +5209,16 @@ var Sr, Cr = class extends xr {
5205
5209
  k([_({
5206
5210
  internal: !0,
5207
5211
  fallback: !1
5208
- }), O("design:type", Boolean)], Cr.prototype, "spaceKey", void 0), k([_({
5212
+ }), O("design:type", Boolean)], wr.prototype, "spaceKey", void 0), k([_({
5209
5213
  internal: !0,
5210
5214
  fallback: !1
5211
- }), O("design:type", Boolean)], Cr.prototype, "grabbing", void 0), Cr = k([x("Camera2D", {
5215
+ }), O("design:type", Boolean)], wr.prototype, "grabbing", void 0), wr = k([x("Camera2D", {
5212
5216
  processMode: "disabled",
5213
5217
  renderMode: "disabled"
5214
- }), O("design:paramtypes", [typeof (Sr = typeof Partial < "u" && Partial) == "function" ? Sr : Object, Array])], Cr);
5218
+ }), O("design:paramtypes", [typeof (Cr = typeof Partial < "u" && Partial) == "function" ? Cr : Object, Array])], wr);
5215
5219
  //#endregion
5216
5220
  //#region src/css/parseCssFilter.ts
5217
- var wr = {
5221
+ var Tr = {
5218
5222
  brightness: 1,
5219
5223
  contrast: 1,
5220
5224
  grayscale: 0,
@@ -5224,18 +5228,18 @@ var wr = {
5224
5228
  saturate: 1,
5225
5229
  sepia: 0
5226
5230
  };
5227
- function Tr(e) {
5228
- let t = new dt();
5231
+ function Er(e) {
5232
+ let t = new ft();
5229
5233
  if (e === "none") return t;
5230
- let n = we(e).reduce((e, { name: t, args: n }) => (e[t] = n[0].normalizedIntValue, e), {});
5231
- Object.keys(wr).forEach((e) => {
5232
- n[e] = n[e] ?? wr[e];
5234
+ let n = Te(e).reduce((e, { name: t, args: n }) => (e[t] = n[0].normalizedIntValue, e), {});
5235
+ Object.keys(Tr).forEach((e) => {
5236
+ n[e] = n[e] ?? Tr[e];
5233
5237
  });
5234
5238
  for (let e in n) {
5235
5239
  let r = n[e];
5236
5240
  switch (e) {
5237
5241
  case "hue-rotate":
5238
- t.hueRotate(r * _e);
5242
+ t.hueRotate(r * ve);
5239
5243
  break;
5240
5244
  case "saturate":
5241
5245
  t.saturate(r);
@@ -5264,7 +5268,7 @@ function Tr(e) {
5264
5268
  }
5265
5269
  //#endregion
5266
5270
  //#region src/css/parseCssTransformOrigin.ts
5267
- function Er(e) {
5271
+ function Dr(e) {
5268
5272
  let [t, n = t] = e.split(" ");
5269
5273
  return [t, n].map((e) => {
5270
5274
  switch (e = e.trim(), e) {
@@ -5279,9 +5283,9 @@ function Er(e) {
5279
5283
  }
5280
5284
  //#endregion
5281
5285
  //#region src/scene/effects/ColorAdjustEffect.ts
5282
- var Dr, Or, W = class extends U {
5286
+ var Or, kr, W = class extends U {
5283
5287
  static {
5284
- Or = this;
5288
+ kr = this;
5285
5289
  }
5286
5290
  static material = new I({ gl: {
5287
5291
  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}",
@@ -5292,7 +5296,7 @@ var Dr, Or, W = class extends U {
5292
5296
  }
5293
5297
  apply(e, t) {
5294
5298
  t.redraw(e, () => {
5295
- L.draw(e, Or.material, {
5299
+ L.draw(e, kr.material, {
5296
5300
  sampler: 0,
5297
5301
  saturation: this.saturation,
5298
5302
  contrast: this.contrast,
@@ -5306,18 +5310,18 @@ var Dr, Or, W = class extends U {
5306
5310
  });
5307
5311
  }
5308
5312
  };
5309
- 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 = Or = k([x("ColorAdjustEffect"), O("design:paramtypes", [typeof (Dr = typeof Partial < "u" && Partial) == "function" ? Dr : Object, Array])], W);
5313
+ 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 = kr = k([x("ColorAdjustEffect"), O("design:paramtypes", [typeof (Or = typeof Partial < "u" && Partial) == "function" ? Or : Object, Array])], W);
5310
5314
  //#endregion
5311
5315
  //#region src/scene/effects/ColorFilterEffect.ts
5312
- var kr, Ar, jr = class extends U {
5316
+ var Ar, jr, Mr = class extends U {
5313
5317
  static {
5314
- Ar = this;
5318
+ jr = this;
5315
5319
  }
5316
5320
  static material = new I({ gl: {
5317
5321
  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}",
5318
5322
  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}"
5319
5323
  } });
5320
- _colorMatrix = new dt();
5324
+ _colorMatrix = new ft();
5321
5325
  constructor(e, t = []) {
5322
5326
  super(), this.setProperties(e).append(t);
5323
5327
  }
@@ -5330,13 +5334,13 @@ var kr, Ar, jr = class extends U {
5330
5334
  }
5331
5335
  apply(e, t) {
5332
5336
  if (!this.filter) return;
5333
- let n = we(this.filter), r = this._colorMatrix.identity();
5337
+ let n = Te(this.filter), r = this._colorMatrix.identity();
5334
5338
  n.forEach(({ name: e, args: t }) => {
5335
5339
  let n = t.map((e) => e.normalizedIntValue);
5336
5340
  switch (e) {
5337
5341
  case "hue-rotate":
5338
5342
  case "hueRotate":
5339
- r.hueRotate(n[0] * _e);
5343
+ r.hueRotate(n[0] * ve);
5340
5344
  break;
5341
5345
  case "saturate":
5342
5346
  r.saturate(n[0]);
@@ -5361,25 +5365,25 @@ var kr, Ar, jr = class extends U {
5361
5365
  break;
5362
5366
  }
5363
5367
  }), t.redraw(e, () => {
5364
- L.draw(e, Ar.material, {
5368
+ L.draw(e, jr.material, {
5365
5369
  sampler: 0,
5366
5370
  m: r.toArray()
5367
5371
  });
5368
5372
  });
5369
5373
  }
5370
5374
  };
5371
- k([_(), O("design:type", String)], jr.prototype, "filter", void 0), jr = Ar = k([x("ColorFilterEffect"), O("design:paramtypes", [typeof (kr = typeof Partial < "u" && Partial) == "function" ? kr : Object, Array])], jr);
5375
+ k([_(), O("design:type", String)], Mr.prototype, "filter", void 0), Mr = jr = k([x("ColorFilterEffect"), O("design:paramtypes", [typeof (Ar = typeof Partial < "u" && Partial) == "function" ? Ar : Object, Array])], Mr);
5372
5376
  //#endregion
5373
5377
  //#region src/scene/effects/ColorOverlayEffect.ts
5374
- var Mr, Nr, Pr = 50, Fr = class extends U {
5378
+ var Nr, Pr, Fr = 50, Ir = class extends U {
5375
5379
  static {
5376
- Nr = this;
5380
+ Pr = this;
5377
5381
  }
5378
5382
  static material = new I({ gl: {
5379
5383
  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}",
5380
5384
  fragment: `precision mediump float;
5381
5385
  uniform sampler2D sampler;
5382
- uniform vec4 colors[${Pr}];
5386
+ uniform vec4 colors[${Fr}];
5383
5387
  varying vec2 vUv;
5384
5388
 
5385
5389
  float calcWidth() {
@@ -5388,7 +5392,7 @@ float calcWidth() {
5388
5392
 
5389
5393
  int calcCount() {
5390
5394
  int count = 0;
5391
- for (int i = 0; i < ${Pr}; i++) {
5395
+ for (int i = 0; i < ${Fr}; i++) {
5392
5396
  if (colors[i] != vec4(0,0,0,0)){
5393
5397
  count++;
5394
5398
  }
@@ -5400,7 +5404,7 @@ vec4 calcColor(float x) {
5400
5404
  float perUnit = calcWidth() / float(calcCount());
5401
5405
  int index = int(x / perUnit);
5402
5406
 
5403
- for(int i=0; i<${Pr}; i++){
5407
+ for(int i=0; i<${Fr}; i++){
5404
5408
  if(i==index){
5405
5409
  return colors[i];
5406
5410
  }
@@ -5415,7 +5419,7 @@ void main(void) {
5415
5419
  gl_FragColor = vec4(mix(color.rgb, mask.rgb, color.a * mask.a), color.a);
5416
5420
  }`
5417
5421
  } });
5418
- _color = new E();
5422
+ _color = new T();
5419
5423
  constructor(e, t = []) {
5420
5424
  super(), this.setProperties(e).append(t);
5421
5425
  }
@@ -5426,31 +5430,31 @@ void main(void) {
5426
5430
  let t = this._color.toArray();
5427
5431
  return t[3] = this.alpha, t;
5428
5432
  });
5429
- for (; t.length < Pr;) t.push([
5433
+ for (; t.length < Fr;) t.push([
5430
5434
  0,
5431
5435
  0,
5432
5436
  0,
5433
5437
  0
5434
5438
  ]);
5435
- L.draw(e, Nr.material, {
5439
+ L.draw(e, Pr.material, {
5436
5440
  sampler: 0,
5437
- colors: t.slice(0, Pr).flatMap((e) => e)
5441
+ colors: t.slice(0, Fr).flatMap((e) => e)
5438
5442
  });
5439
5443
  });
5440
5444
  }
5441
5445
  };
5442
- k([_({ default: () => [] }), O("design:type", Array)], Fr.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Fr.prototype, "alpha", void 0), Fr = Nr = k([x("ColorOverlayEffect"), O("design:paramtypes", [typeof (Mr = typeof Partial < "u" && Partial) == "function" ? Mr : Object, Array])], Fr);
5446
+ k([_({ default: () => [] }), O("design:type", Array)], Ir.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Ir.prototype, "alpha", void 0), Ir = Pr = k([x("ColorOverlayEffect"), O("design:paramtypes", [typeof (Nr = typeof Partial < "u" && Partial) == "function" ? Nr : Object, Array])], Ir);
5443
5447
  //#endregion
5444
5448
  //#region src/scene/effects/ColorRemoveEffect.ts
5445
- var Ir, Lr, Rr = class extends U {
5449
+ var Lr, Rr, zr = class extends U {
5446
5450
  static {
5447
- Lr = this;
5451
+ Rr = this;
5448
5452
  }
5449
5453
  static material = new I({ gl: {
5450
5454
  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}",
5451
5455
  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}"
5452
5456
  } });
5453
- _color = new E();
5457
+ _color = new T();
5454
5458
  constructor(e, t = []) {
5455
5459
  super(), this.setProperties(e).append(t);
5456
5460
  }
@@ -5464,7 +5468,7 @@ var Ir, Lr, Rr = class extends U {
5464
5468
  r.slice(0, 50).forEach((e, t) => {
5465
5469
  n[t * 3] = e[0], n[t * 3 + 1] = e[1], n[t * 3 + 2] = e[2];
5466
5470
  }), t.redraw(e, () => {
5467
- L.draw(e, Lr.material, {
5471
+ L.draw(e, Rr.material, {
5468
5472
  sampler: 0,
5469
5473
  epsilon: this.epsilon,
5470
5474
  originalColors: n
@@ -5472,19 +5476,19 @@ var Ir, Lr, Rr = class extends U {
5472
5476
  });
5473
5477
  }
5474
5478
  };
5475
- k([_({ default: () => [] }), O("design:type", Array)], Rr.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Rr.prototype, "epsilon", void 0), Rr = Lr = k([x("ColorRemoveEffect"), O("design:paramtypes", [typeof (Ir = typeof Partial < "u" && Partial) == "function" ? Ir : Object, Array])], Rr);
5479
+ k([_({ default: () => [] }), O("design:type", Array)], zr.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], zr.prototype, "epsilon", void 0), zr = Rr = k([x("ColorRemoveEffect"), O("design:paramtypes", [typeof (Lr = typeof Partial < "u" && Partial) == "function" ? Lr : Object, Array])], zr);
5476
5480
  //#endregion
5477
5481
  //#region src/scene/effects/ColorReplaceEffect.ts
5478
- var zr, Br, Vr = 50, Hr = class extends U {
5482
+ var Br, Vr, Hr = 50, Ur = class extends U {
5479
5483
  static {
5480
- Br = this;
5484
+ Vr = this;
5481
5485
  }
5482
5486
  static material = new I({ gl: {
5483
5487
  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}",
5484
5488
  fragment: `varying vec2 vUv;
5485
5489
  uniform sampler2D sampler;
5486
5490
  uniform float epsilon;
5487
- const int MAX_COLORS = ${Vr};
5491
+ const int MAX_COLORS = ${Hr};
5488
5492
  uniform vec3 originalColors[MAX_COLORS];
5489
5493
  uniform vec3 targetColors[MAX_COLORS];
5490
5494
 
@@ -5512,7 +5516,7 @@ void main(void) {
5512
5516
  }
5513
5517
  }`
5514
5518
  } });
5515
- _color = new E();
5519
+ _color = new T();
5516
5520
  constructor(e, t = []) {
5517
5521
  super(), this.setProperties(e).append(t);
5518
5522
  }
@@ -5521,8 +5525,8 @@ void main(void) {
5521
5525
  this._color.value = e[0];
5522
5526
  let t = this._color.toArray().slice(0, 3);
5523
5527
  return this._color.value = e[1], [t, this._color.toArray().slice(0, 3)];
5524
- }), r = this.epsilon, i = new Float32Array(Vr * 3), a = new Float32Array(Vr * 3);
5525
- for (; n.length < Vr;) n.push([[
5528
+ }), r = this.epsilon, i = new Float32Array(Hr * 3), a = new Float32Array(Hr * 3);
5529
+ for (; n.length < Hr;) n.push([[
5526
5530
  -1,
5527
5531
  0,
5528
5532
  0
@@ -5532,10 +5536,10 @@ void main(void) {
5532
5536
  0,
5533
5537
  1
5534
5538
  ]]);
5535
- n.slice(0, Vr).forEach(([e, t], n) => {
5539
+ n.slice(0, Hr).forEach(([e, t], n) => {
5536
5540
  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];
5537
5541
  }), t.redraw(e, () => {
5538
- L.draw(e, Br.material, {
5542
+ L.draw(e, Vr.material, {
5539
5543
  sampler: 0,
5540
5544
  epsilon: r,
5541
5545
  originalColors: i,
@@ -5544,17 +5548,17 @@ void main(void) {
5544
5548
  });
5545
5549
  }
5546
5550
  };
5547
- k([_({ default: () => [] }), O("design:type", Array)], Hr.prototype, "colors", void 0), k([_({ fallback: .05 }), O("design:type", Number)], Hr.prototype, "epsilon", void 0), Hr = Br = k([x("ColorReplaceEffect"), O("design:paramtypes", [typeof (zr = typeof Partial < "u" && Partial) == "function" ? zr : Object, Array])], Hr);
5551
+ k([_({ default: () => [] }), O("design:type", Array)], Ur.prototype, "colors", void 0), k([_({ fallback: .05 }), O("design:type", Number)], Ur.prototype, "epsilon", void 0), Ur = Vr = k([x("ColorReplaceEffect"), O("design:paramtypes", [typeof (Br = typeof Partial < "u" && Partial) == "function" ? Br : Object, Array])], Ur);
5548
5552
  //#endregion
5549
5553
  //#region src/scene/effects/DrawboardEffect.frag?raw
5550
- var Ur = "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;\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) {\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", Wr, Gr, G = class extends U {
5554
+ var Wr = "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;\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) {\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", Gr, Kr, G = class extends U {
5551
5555
  static {
5552
- Gr = this;
5556
+ Kr = this;
5553
5557
  }
5554
5558
  _watermark;
5555
5559
  static material = new I({ gl: {
5556
5560
  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}",
5557
- fragment: Ur
5561
+ fragment: Wr
5558
5562
  } });
5559
5563
  constructor(e, t = []) {
5560
5564
  super(), this.setProperties(e).append(t);
@@ -5578,7 +5582,7 @@ var Ur = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
5578
5582
  t.redraw(e, () => {
5579
5583
  this._watermark ? this._watermark.activate(e, 1) : e.texture.unbind(1);
5580
5584
  let n = e.shader.uniforms.viewMatrix, r = this._watermark ? [this.watermarkWidth, this.watermarkWidth * this._watermark.height / this._watermark.width] : [0, 0], i = Math.max(r[0], r[1]);
5581
- L.draw(e, Gr.material, {
5585
+ L.draw(e, Kr.material, {
5582
5586
  uTexture: 0,
5583
5587
  inputSize: [t.width, t.height],
5584
5588
  zoom: [n[0], n[4]],
@@ -5602,20 +5606,20 @@ var Ur = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
5602
5606
  });
5603
5607
  }
5604
5608
  };
5605
- 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", 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 = Gr = k([x("DrawboardEffect"), O("design:paramtypes", [typeof (Wr = typeof Partial < "u" && Partial) == "function" ? Wr : Object, Array])], G);
5609
+ 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", 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 = Kr = k([x("DrawboardEffect"), O("design:paramtypes", [typeof (Gr = typeof Partial < "u" && Partial) == "function" ? Gr : Object, Array])], G);
5606
5610
  //#endregion
5607
5611
  //#region src/scene/effects/GaussianBlurEffect.ts
5608
- var Kr, qr, Jr = "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}", Yr = class extends U {
5612
+ var qr, Jr, Yr = "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}", Xr = class extends U {
5609
5613
  static {
5610
- qr = this;
5614
+ Jr = this;
5611
5615
  }
5612
5616
  static materialX = new I({ gl: {
5613
5617
  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}",
5614
- fragment: Jr
5618
+ fragment: Yr
5615
5619
  } });
5616
5620
  static materialY = new I({ gl: {
5617
5621
  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}",
5618
- fragment: Jr
5622
+ fragment: Yr
5619
5623
  } });
5620
5624
  constructor(e, t = []) {
5621
5625
  super(), this.setProperties(e).append(t);
@@ -5623,39 +5627,39 @@ var Kr, qr, Jr = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(
5623
5627
  apply(e, t) {
5624
5628
  let n = 1 / t.width, r = 1 / t.height, i = Math.max(this.quality, 1);
5625
5629
  for (let r = 0; r < i; r++) t.redraw(e, () => {
5626
- L.draw(e, qr.materialX, {
5630
+ L.draw(e, Jr.materialX, {
5627
5631
  sampler: 0,
5628
5632
  uStrength: n * (this.strength / i)
5629
5633
  });
5630
5634
  });
5631
5635
  for (let n = 0; n < i; n++) t.redraw(e, () => {
5632
- L.draw(e, qr.materialY, {
5636
+ L.draw(e, Jr.materialY, {
5633
5637
  sampler: 0,
5634
5638
  uStrength: r * (this.strength / i)
5635
5639
  });
5636
5640
  });
5637
5641
  }
5638
5642
  };
5639
- k([_({ fallback: 4 }), O("design:type", Number)], Yr.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], Yr.prototype, "quality", void 0), Yr = qr = k([x("GaussianBlurEffect"), O("design:paramtypes", [typeof (Kr = typeof Partial < "u" && Partial) == "function" ? Kr : Object, Array])], Yr);
5643
+ k([_({ fallback: 4 }), O("design:type", Number)], Xr.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], Xr.prototype, "quality", void 0), Xr = Jr = k([x("GaussianBlurEffect"), O("design:paramtypes", [typeof (qr = typeof Partial < "u" && Partial) == "function" ? qr : Object, Array])], Xr);
5640
5644
  //#endregion
5641
5645
  //#region src/scene/effects/DropShadowEffect.ts
5642
- var Xr, Zr, Qr = class extends U {
5646
+ var Zr, Qr, $r = class extends U {
5643
5647
  static {
5644
- Zr = this;
5648
+ Qr = this;
5645
5649
  }
5646
5650
  static material = new I({ gl: {
5647
5651
  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}",
5648
5652
  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}"
5649
5653
  } });
5650
- blurEffect = new Yr();
5654
+ blurEffect = new Xr();
5651
5655
  viewport3 = new H();
5652
- _color = new E();
5656
+ _color = new T();
5653
5657
  constructor(e, t = []) {
5654
5658
  super(), this.setProperties(e).append(t);
5655
5659
  }
5656
5660
  apply(e, t) {
5657
5661
  this.viewport3.activateWithCopy(e, t), this.viewport3.redraw(e, () => {
5658
- this._color.value = this.color, L.draw(e, Zr.material, {
5662
+ this._color.value = this.color, L.draw(e, Qr.material, {
5659
5663
  sampler: 0,
5660
5664
  uAlpha: this._color.a,
5661
5665
  uColor: this._color.toArray().slice(0, 3),
@@ -5668,16 +5672,16 @@ var Xr, Zr, Qr = class extends U {
5668
5672
  ]
5669
5673
  });
5670
5674
  }), this.blurEffect.strength = this.blur, this.blurEffect.apply(e, this.viewport3), t.redraw(e, () => {
5671
- this.viewport3.texture.activate(e, 1), L.draw(e, Gn.instance, { sampler: 1 }), this.shadowOnly || L.draw(e, Gn.instance, { sampler: 0 }), e.texture.unbind(1);
5675
+ this.viewport3.texture.activate(e, 1), L.draw(e, Kn.instance, { sampler: 1 }), this.shadowOnly || L.draw(e, Kn.instance, { sampler: 0 }), e.texture.unbind(1);
5672
5676
  });
5673
5677
  }
5674
5678
  };
5675
- k([_({ fallback: "#000000FF" }), O("design:type", Object)], Qr.prototype, "color", void 0), k([_({ fallback: 4 }), O("design:type", Number)], Qr.prototype, "blur", void 0), k([_({ fallback: 4 }), O("design:type", Number)], Qr.prototype, "offsetX", void 0), k([_({ fallback: 4 }), O("design:type", Number)], Qr.prototype, "offsetY", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Qr.prototype, "shadowOnly", void 0), Qr = Zr = k([x("DropShadowEffect"), O("design:paramtypes", [typeof (Xr = typeof Partial < "u" && Partial) == "function" ? Xr : Object, Array])], Qr);
5679
+ k([_({ fallback: "#000000FF" }), O("design:type", Object)], $r.prototype, "color", void 0), k([_({ fallback: 4 }), O("design:type", Number)], $r.prototype, "blur", void 0), k([_({ fallback: 4 }), O("design:type", Number)], $r.prototype, "offsetX", void 0), k([_({ fallback: 4 }), O("design:type", Number)], $r.prototype, "offsetY", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], $r.prototype, "shadowOnly", void 0), $r = Qr = k([x("DropShadowEffect"), O("design:paramtypes", [typeof (Zr = typeof Partial < "u" && Partial) == "function" ? Zr : Object, Array])], $r);
5676
5680
  //#endregion
5677
5681
  //#region src/scene/effects/EmbossEffect.ts
5678
- var $r, ei, ti = class extends U {
5682
+ var ei, ti, ni = class extends U {
5679
5683
  static {
5680
- ei = this;
5684
+ ti = this;
5681
5685
  }
5682
5686
  static material = new I({ gl: {
5683
5687
  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}",
@@ -5688,7 +5692,7 @@ var $r, ei, ti = class extends U {
5688
5692
  }
5689
5693
  apply(e, t) {
5690
5694
  t.redraw(e, () => {
5691
- L.draw(e, ei.material, {
5695
+ L.draw(e, ti.material, {
5692
5696
  sampler: 0,
5693
5697
  strength: this.strength,
5694
5698
  inputSize: [
@@ -5701,12 +5705,12 @@ var $r, ei, ti = class extends U {
5701
5705
  });
5702
5706
  }
5703
5707
  };
5704
- k([_({ fallback: 5 }), O("design:type", Number)], ti.prototype, "strength", void 0), ti = ei = k([x("EmbossEffect"), O("design:paramtypes", [typeof ($r = typeof Partial < "u" && Partial) == "function" ? $r : Object, Array])], ti);
5708
+ k([_({ fallback: 5 }), O("design:type", Number)], ni.prototype, "strength", void 0), ni = ti = k([x("EmbossEffect"), O("design:paramtypes", [typeof (ei = typeof Partial < "u" && Partial) == "function" ? ei : Object, Array])], ni);
5705
5709
  //#endregion
5706
5710
  //#region src/scene/effects/GlitchEffect.ts
5707
- var ni, ri, K = class extends U {
5711
+ var ri, ii, K = class extends U {
5708
5712
  static {
5709
- ri = this;
5713
+ ii = this;
5710
5714
  }
5711
5715
  static material = new I({ gl: {
5712
5716
  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}",
@@ -5735,7 +5739,7 @@ var ni, ri, K = class extends U {
5735
5739
  this._needsRedraw || (this._needsRedraw = !0, this.redraw());
5736
5740
  let n = t.width, r = t.height, i = this.direction * (Math.PI / 180), a = Math.sin(i), o = Math.cos(i);
5737
5741
  t.redraw(e, () => {
5738
- this._texture.activate(e, 1), L.draw(e, ri.material, {
5742
+ this._texture.activate(e, 1), L.draw(e, ii.material, {
5739
5743
  sampler: 0,
5740
5744
  filterClamp: [
5741
5745
  0,
@@ -5764,12 +5768,12 @@ var ni, ri, K = class extends U {
5764
5768
  });
5765
5769
  }
5766
5770
  };
5767
- 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([x("GlitchEffect"), O("design:paramtypes", [typeof (ni = typeof Partial < "u" && Partial) == "function" ? ni : Object, Array])], K);
5771
+ 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 = ii = k([x("GlitchEffect"), O("design:paramtypes", [typeof (ri = typeof Partial < "u" && Partial) == "function" ? ri : Object, Array])], K);
5768
5772
  //#endregion
5769
5773
  //#region src/scene/effects/GodrayEffect.ts
5770
- var ii, ai, oi = "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 {
5774
+ var ai, oi, si = "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 {
5771
5775
  static {
5772
- ai = this;
5776
+ oi = this;
5773
5777
  }
5774
5778
  static material = new I({ gl: {
5775
5779
  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}",
@@ -5784,7 +5788,7 @@ uniform float uTime;
5784
5788
  uniform vec3 uRay;
5785
5789
  uniform vec4 uInputSize;
5786
5790
 
5787
- ${oi}
5791
+ ${si}
5788
5792
 
5789
5793
  void main(void) {
5790
5794
  bool uParallel = uParallel > 0.5;
@@ -5823,7 +5827,7 @@ void main(void) {
5823
5827
  apply(e, t) {
5824
5828
  let n = this.angle * (Math.PI / 180), r = this.parallel ? [Math.cos(n), Math.sin(n)] : this.center;
5825
5829
  t.redraw(e, () => {
5826
- L.draw(e, ai.material, {
5830
+ L.draw(e, oi.material, {
5827
5831
  sampler: 0,
5828
5832
  uDimensions: [t.width, t.height],
5829
5833
  uParallel: +!!this.parallel,
@@ -5845,15 +5849,15 @@ void main(void) {
5845
5849
  });
5846
5850
  }
5847
5851
  };
5848
- 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 = ai = k([x("GodrayEffect"), O("design:paramtypes", [typeof (ii = typeof Partial < "u" && Partial) == "function" ? ii : Object, Array])], q);
5852
+ 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 = oi = k([x("GodrayEffect"), O("design:paramtypes", [typeof (ai = typeof Partial < "u" && Partial) == "function" ? ai : Object, Array])], q);
5849
5853
  //#endregion
5850
5854
  //#region src/scene/effects/KawaseBlurEffect.ts
5851
- var si, ci = "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}", li = "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}", ui = class extends U {
5855
+ var ci, li = "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}", ui = "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}", di = class extends U {
5852
5856
  _kernels = [0];
5853
5857
  constructor(e, t = []) {
5854
5858
  super(), this.material = new I({ gl: {
5855
5859
  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}",
5856
- fragment: e?.clamp ? li : ci
5860
+ fragment: e?.clamp ? ui : li
5857
5861
  } }), this.setProperties(e).append(t), this._generateKernels();
5858
5862
  }
5859
5863
  _updateProperty(e, t, n) {
@@ -5891,12 +5895,12 @@ var si, ci = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffse
5891
5895
  });
5892
5896
  }
5893
5897
  };
5894
- k([_({ fallback: 4 }), O("design:type", Number)], ui.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], ui.prototype, "quality", void 0), k([_({ default: () => [1, 1] }), O("design:type", Array)], ui.prototype, "pixelSize", void 0), ui = k([x("KawaseBlurEffect"), O("design:paramtypes", [typeof (si = typeof Partial < "u" && Partial) == "function" ? si : Object, Array])], ui);
5898
+ k([_({ fallback: 4 }), O("design:type", Number)], di.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], di.prototype, "quality", void 0), k([_({ default: () => [1, 1] }), O("design:type", Array)], di.prototype, "pixelSize", void 0), di = k([x("KawaseBlurEffect"), O("design:paramtypes", [typeof (ci = typeof Partial < "u" && Partial) == "function" ? ci : Object, Array])], di);
5895
5899
  //#endregion
5896
5900
  //#region src/scene/effects/MaskEffect.ts
5897
- var di, fi, pi = class extends U {
5901
+ var fi, pi, mi = class extends U {
5898
5902
  static {
5899
- fi = this;
5903
+ pi = this;
5900
5904
  }
5901
5905
  static material = new I({ gl: {
5902
5906
  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}",
@@ -5918,7 +5922,7 @@ var di, fi, pi = class extends U {
5918
5922
  }
5919
5923
  apply(e, t, n) {
5920
5924
  this.texture && t.redraw(e, () => {
5921
- this.texture.activate(e, 1), L.draw(e, fi.material, {
5925
+ this.texture.activate(e, 1), L.draw(e, pi.material, {
5922
5926
  sampler: 0,
5923
5927
  mask: 1,
5924
5928
  rotation: n.target?.globalRotation ?? 0
@@ -5926,23 +5930,23 @@ var di, fi, pi = class extends U {
5926
5930
  });
5927
5931
  }
5928
5932
  };
5929
- k([_({ fallback: "" }), O("design:type", String)], pi.prototype, "image", void 0), pi = fi = k([x("MaskEffect"), O("design:paramtypes", [typeof (di = typeof Partial < "u" && Partial) == "function" ? di : Object, Array])], pi);
5933
+ k([_({ fallback: "" }), O("design:type", String)], mi.prototype, "image", void 0), mi = pi = k([x("MaskEffect"), O("design:paramtypes", [typeof (fi = typeof Partial < "u" && Partial) == "function" ? fi : Object, Array])], mi);
5930
5934
  //#endregion
5931
5935
  //#region src/scene/effects/OutlineEffect.ts
5932
- var mi, hi, gi = "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 {
5936
+ var hi, gi, _i = "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 {
5933
5937
  static {
5934
- hi = this;
5938
+ gi = this;
5935
5939
  }
5936
5940
  static MIN_SAMPLES = 1;
5937
5941
  static MAX_SAMPLES = 100;
5938
5942
  static getAngleStep(e) {
5939
- return Number.parseFloat((Math.PI * 2 / Math.max(e * hi.MAX_SAMPLES, hi.MIN_SAMPLES)).toFixed(7));
5943
+ return Number.parseFloat((Math.PI * 2 / Math.max(e * gi.MAX_SAMPLES, gi.MIN_SAMPLES)).toFixed(7));
5940
5944
  }
5941
- _color = new E();
5945
+ _color = new T();
5942
5946
  constructor(e, t = []) {
5943
5947
  super(), this.setProperties(e).append(t), this.material = new I({ gl: {
5944
5948
  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}",
5945
- fragment: gi.replace(/\{ANGLE_STEP\}/, hi.getAngleStep(this.quality).toFixed(7))
5949
+ fragment: _i.replace(/\{ANGLE_STEP\}/, gi.getAngleStep(this.quality).toFixed(7))
5946
5950
  } });
5947
5951
  }
5948
5952
  apply(e, t) {
@@ -5952,7 +5956,7 @@ var mi, hi, gi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D s
5952
5956
  uThickness: [this.width / t.width, this.width / t.height],
5953
5957
  uColor: this._color.toArray().slice(0, 3),
5954
5958
  uAlpha: this.opacity === 1 ? this._color.a : this.opacity,
5955
- uAngleStep: hi.getAngleStep(this.quality),
5959
+ uAngleStep: gi.getAngleStep(this.quality),
5956
5960
  uKnockout: +!!this.knockout,
5957
5961
  uInputClamp: [
5958
5962
  0,
@@ -5964,12 +5968,12 @@ var mi, hi, gi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D s
5964
5968
  });
5965
5969
  }
5966
5970
  };
5967
- 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 = hi = k([x("OutlineEffect"), O("design:paramtypes", [typeof (mi = typeof Partial < "u" && Partial) == "function" ? mi : Object, Array])], J);
5971
+ 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 = gi = k([x("OutlineEffect"), O("design:paramtypes", [typeof (hi = typeof Partial < "u" && Partial) == "function" ? hi : Object, Array])], J);
5968
5972
  //#endregion
5969
5973
  //#region src/scene/effects/PixelateEffect.ts
5970
- var _i, vi, yi = class extends U {
5974
+ var vi, yi, bi = class extends U {
5971
5975
  static {
5972
- vi = this;
5976
+ yi = this;
5973
5977
  }
5974
5978
  static material = new I({ gl: {
5975
5979
  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}",
@@ -5985,16 +5989,16 @@ var _i, vi, yi = class extends U {
5985
5989
  offset: [(r[0] + i[0]) / t.width, 1 - (r[1] + i[1]) / t.height],
5986
5990
  step: [this.strength * r[0] / t.width, this.strength * r[1] / t.height]
5987
5991
  };
5988
- L.draw(e, vi.material, a);
5992
+ L.draw(e, yi.material, a);
5989
5993
  });
5990
5994
  }
5991
5995
  };
5992
- k([_({ fallback: 10 }), O("design:type", Number)], yi.prototype, "strength", void 0), yi = vi = k([x("PixelateEffect"), O("design:paramtypes", [typeof (_i = typeof Partial < "u" && Partial) == "function" ? _i : Object, Array])], yi);
5996
+ k([_({ fallback: 10 }), O("design:type", Number)], bi.prototype, "strength", void 0), bi = yi = k([x("PixelateEffect"), O("design:paramtypes", [typeof (vi = typeof Partial < "u" && Partial) == "function" ? vi : Object, Array])], bi);
5993
5997
  //#endregion
5994
5998
  //#region src/scene/effects/ZoomBlurEffect.ts
5995
- var bi, xi, Si = class extends U {
5999
+ var xi, Si, Ci = class extends U {
5996
6000
  static {
5997
- xi = this;
6001
+ Si = this;
5998
6002
  }
5999
6003
  static material = new I({ gl: {
6000
6004
  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}",
@@ -6005,7 +6009,7 @@ var bi, xi, Si = class extends U {
6005
6009
  }
6006
6010
  apply(e, t) {
6007
6011
  t.redraw(e, () => {
6008
- L.draw(e, xi.material, {
6012
+ L.draw(e, Si.material, {
6009
6013
  sampler: 0,
6010
6014
  uCenter: [t.width / 2, t.height / 2],
6011
6015
  uInnerRadius: this.innerRadius,
@@ -6021,10 +6025,10 @@ var bi, xi, Si = class extends U {
6021
6025
  });
6022
6026
  }
6023
6027
  };
6024
- k([_(), O("design:type", Array)], Si.prototype, "center", void 0), k([_({ fallback: 20 }), O("design:type", Number)], Si.prototype, "innerRadius", void 0), k([_({ fallback: -1 }), O("design:type", Number)], Si.prototype, "radius", void 0), k([_({ fallback: .1 }), O("design:type", Number)], Si.prototype, "strength", void 0), Si = xi = k([x("ZoomBlurEffect"), O("design:paramtypes", [typeof (bi = typeof Partial < "u" && Partial) == "function" ? bi : Object, Array])], Si);
6028
+ k([_(), O("design:type", Array)], Ci.prototype, "center", void 0), k([_({ fallback: 20 }), O("design:type", Number)], Ci.prototype, "innerRadius", void 0), k([_({ fallback: -1 }), O("design:type", Number)], Ci.prototype, "radius", void 0), k([_({ fallback: .1 }), O("design:type", Number)], Ci.prototype, "strength", void 0), Ci = Si = k([x("ZoomBlurEffect"), O("design:paramtypes", [typeof (xi = typeof Partial < "u" && Partial) == "function" ? xi : Object, Array])], Ci);
6025
6029
  //#endregion
6026
6030
  //#region src/scene/2d/element/utils.ts
6027
- function Ci(e, t) {
6031
+ function wi(e, t) {
6028
6032
  let { x: n, y: r, width: i, height: a } = t, o = !1, s = new v().translate(-n, -r).scale(1 / i, 1 / a);
6029
6033
  if (e.cropRect) {
6030
6034
  let { left: t = 0, top: n = 0, right: r = 0, bottom: i = 0 } = e.cropRect;
@@ -6046,7 +6050,7 @@ function Ci(e, t) {
6046
6050
  }
6047
6051
  //#endregion
6048
6052
  //#region src/scene/2d/element/Element2DFill.ts
6049
- var Y = class extends w {
6053
+ var Y = class extends C {
6050
6054
  texture;
6051
6055
  animatedTexture;
6052
6056
  constructor(e) {
@@ -6056,7 +6060,7 @@ var Y = class extends w {
6056
6060
  return super.setProperties(e);
6057
6061
  }
6058
6062
  setProperties(e) {
6059
- return this._setProperties(d(e) ? void 0 : p(e));
6063
+ return this._setProperties(d(e) ? void 0 : m(e));
6060
6064
  }
6061
6065
  _updateProperty(e, t, n) {
6062
6066
  switch (super._updateProperty(e, t, n), e) {
@@ -6078,7 +6082,7 @@ var Y = class extends w {
6078
6082
  }
6079
6083
  }
6080
6084
  async loadTexture() {
6081
- if (this.linearGradient || this.radialGradient) this.texture = new Xn(this.linearGradient ?? this.radialGradient, Math.floor(this._parent.size.width), Math.floor(this._parent.size.height));
6085
+ if (this.linearGradient || this.radialGradient) this.texture = new Zn(this.linearGradient ?? this.radialGradient, Math.floor(this._parent.size.width), Math.floor(this._parent.size.height));
6082
6086
  else if (d(this.image)) this.animatedTexture = void 0, this.texture = void 0;
6083
6087
  else if (this._parent.tree?.log(`load image ${this.image}`), this.image !== "viewport") {
6084
6088
  let e = this.image.split("?")[0].endsWith(".gif"), t = this.image, n = await $.loadBy(t, async () => {
@@ -6099,12 +6103,12 @@ var Y = class extends w {
6099
6103
  width: e,
6100
6104
  height: t
6101
6105
  } };
6102
- if (this.image === "viewport") n.fillStyle = new er();
6106
+ if (this.image === "viewport") n.fillStyle = new tr();
6103
6107
  else {
6104
6108
  let i = this.animatedTexture?.currentFrame.texture ?? this.texture;
6105
6109
  r = {
6106
6110
  ...r,
6107
- ...Ci(this, this.tile && i ? {
6111
+ ...wi(this, this.tile && i ? {
6108
6112
  x: 0,
6109
6113
  y: 0,
6110
6114
  width: i.sourceWidth,
@@ -6143,7 +6147,7 @@ var Y = class extends w {
6143
6147
  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);
6144
6148
  //#endregion
6145
6149
  //#region src/scene/2d/element/Element2DBackground.ts
6146
- var wi = class extends Y {
6150
+ var Ti = class extends Y {
6147
6151
  setProperties(e) {
6148
6152
  return super._setProperties(d(e) ? void 0 : f(e));
6149
6153
  }
@@ -6155,12 +6159,51 @@ var wi = class extends Y {
6155
6159
  }
6156
6160
  }
6157
6161
  };
6158
- k([_(), O("design:type", Object)], wi.prototype, "fillWithShape", void 0);
6162
+ k([_(), O("design:type", Object)], Ti.prototype, "fillWithShape", void 0);
6163
+ //#endregion
6164
+ //#region src/scene/2d/element/Element2DConnection.ts
6165
+ var Ei = class extends C {
6166
+ constructor(e) {
6167
+ super(), this._parent = e;
6168
+ }
6169
+ setProperties(e) {
6170
+ return super.setProperties(d(e) ? void 0 : p(e));
6171
+ }
6172
+ isValid() {
6173
+ return !!(this.start?.id || this.end?.id);
6174
+ }
6175
+ _updateProperty(e, t, n) {
6176
+ switch (super._updateProperty(e, t, n), e) {
6177
+ case "start":
6178
+ case "end":
6179
+ this._parent.requestDraw();
6180
+ break;
6181
+ }
6182
+ }
6183
+ resolveAnchor(e) {
6184
+ if (!e?.id) return;
6185
+ let t = this._parent.tree?.getNodeById(e.id);
6186
+ if (!t) return;
6187
+ if (e.idx !== void 0) {
6188
+ let n = t.shape.connectionPoints?.find((t) => t.idx === e.idx);
6189
+ if (n) {
6190
+ let e = {
6191
+ x: n.x * t.size.x,
6192
+ y: n.y * t.size.y
6193
+ };
6194
+ return t.globalTransform.apply(new y(e.x, e.y));
6195
+ }
6196
+ }
6197
+ let { min: n, size: r } = t.globalAabb;
6198
+ return new y(n.x + r.x / 2, n.y + r.y / 2);
6199
+ }
6200
+ };
6201
+ k([_(), O("design:type", Object)], Ei.prototype, "start", void 0), k([_(), O("design:type", Object)], Ei.prototype, "end", void 0);
6159
6202
  //#endregion
6160
6203
  //#region src/scene/2d/element/Element2DForeground.ts
6161
- var Ti = class extends Y {
6204
+ var Di = class extends Y {
6162
6205
  setProperties(e) {
6163
- return super._setProperties(d(e) ? void 0 : m(e));
6206
+ return super._setProperties(d(e) ? void 0 : h(e));
6164
6207
  }
6165
6208
  _updateProperty(e, t, n) {
6166
6209
  switch (super._updateProperty(e, t, n), e) {
@@ -6170,12 +6213,12 @@ var Ti = class extends Y {
6170
6213
  }
6171
6214
  }
6172
6215
  };
6173
- k([_(), O("design:type", Object)], Ti.prototype, "fillWithShape", void 0);
6216
+ k([_(), O("design:type", Object)], Di.prototype, "fillWithShape", void 0);
6174
6217
  //#endregion
6175
6218
  //#region src/scene/2d/element/Element2DOutline.ts
6176
- var Ei = class extends Y {
6219
+ var Oi = class extends Y {
6177
6220
  setProperties(e) {
6178
- return super._setProperties(d(e) ? void 0 : h(e));
6221
+ return super._setProperties(d(e) ? void 0 : g(e));
6179
6222
  }
6180
6223
  _updateProperty(e, t, n) {
6181
6224
  switch (super._updateProperty(e, t, n), e) {
@@ -6193,7 +6236,7 @@ var Ei = class extends Y {
6193
6236
  }
6194
6237
  draw() {
6195
6238
  let { width: e, height: t } = this._parent.size, n = this._parent.context;
6196
- this.image === "viewport" ? n.strokeStyle = new er() : n.strokeStyle = this.texture ?? this.color ?? "#000000FF", n.lineWidth = this.width || 1, n.lineCap = this.lineCap, n.lineJoin = this.lineJoin, n.stroke({ ...Ci(this, {
6239
+ this.image === "viewport" ? n.strokeStyle = new tr() : n.strokeStyle = this.texture ?? this.color ?? "#000000FF", n.lineWidth = this.width || 1, n.lineCap = this.lineCap, n.lineJoin = this.lineJoin, n.stroke({ ...wi(this, {
6197
6240
  x: 0,
6198
6241
  y: 0,
6199
6242
  width: e,
@@ -6201,15 +6244,15 @@ var Ei = class extends Y {
6201
6244
  }) });
6202
6245
  }
6203
6246
  };
6204
- k([_(), O("design:type", Object)], Ei.prototype, "color", void 0), k([_(), O("design:type", Object)], Ei.prototype, "width", void 0), k([_({ fallback: "solid" }), O("design:type", Object)], Ei.prototype, "style", void 0), k([_({ fallback: "butt" }), O("design:type", Object)], Ei.prototype, "lineCap", void 0), k([_({ fallback: "miter" }), O("design:type", Object)], Ei.prototype, "lineJoin", void 0);
6247
+ k([_(), O("design:type", Object)], Oi.prototype, "color", void 0), k([_(), O("design:type", Object)], Oi.prototype, "width", void 0), k([_({ fallback: "solid" }), O("design:type", Object)], Oi.prototype, "style", void 0), k([_({ fallback: "butt" }), O("design:type", Object)], Oi.prototype, "lineCap", void 0), k([_({ fallback: "miter" }), O("design:type", Object)], Oi.prototype, "lineJoin", void 0);
6205
6248
  //#endregion
6206
6249
  //#region src/scene/2d/element/Element2DShadow.ts
6207
- var Di = class extends w {
6250
+ var ki = class extends C {
6208
6251
  constructor(e) {
6209
6252
  super(), this._parent = e;
6210
6253
  }
6211
6254
  setProperties(e) {
6212
- return super.setProperties(d(e) ? void 0 : g(e));
6255
+ return super.setProperties(d(e) ? void 0 : ee(e));
6213
6256
  }
6214
6257
  _updateProperty(e, t, n) {
6215
6258
  switch (super._updateProperty(e, t, n), e) {
@@ -6224,19 +6267,19 @@ var Di = class extends w {
6224
6267
  }
6225
6268
  updateEffect() {
6226
6269
  let e = "__$shadow", t = this._parent.getNode(e);
6227
- this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new Qr({ name: e }), this._parent.appendChild(t, "back")), t.setProperties(this.getProperties())) : t && this._parent.removeChild(t);
6270
+ 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);
6228
6271
  }
6229
6272
  };
6230
- k([_({ fallback: !0 }), O("design:type", Boolean)], Di.prototype, "enabled", void 0), k([_({ fallback: "#000000FF" }), O("design:type", Object)], Di.prototype, "color", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Di.prototype, "blur", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Di.prototype, "offsetY", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Di.prototype, "offsetX", void 0);
6273
+ k([_({ fallback: !0 }), O("design:type", Boolean)], ki.prototype, "enabled", void 0), k([_({ fallback: "#000000FF" }), O("design:type", Object)], ki.prototype, "color", void 0), k([_({ fallback: 0 }), O("design:type", Object)], ki.prototype, "blur", void 0), k([_({ fallback: 0 }), O("design:type", Object)], ki.prototype, "offsetY", void 0), k([_({ fallback: 0 }), O("design:type", Object)], ki.prototype, "offsetX", void 0);
6231
6274
  //#endregion
6232
6275
  //#region src/scene/2d/element/Element2DShape.ts
6233
- var Oi = class extends w {
6234
- _path2DSet = new oe();
6276
+ var Ai = class extends C {
6277
+ _path2DSet = new se();
6235
6278
  constructor(e) {
6236
6279
  super(), this._parent = e, this._updatePath2DSet();
6237
6280
  }
6238
6281
  setProperties(e) {
6239
- return super.setProperties(d(e) ? void 0 : ee(e));
6282
+ return super.setProperties(d(e) ? void 0 : te(e));
6240
6283
  }
6241
6284
  _updateProperty(e, t, n) {
6242
6285
  switch (super._updateProperty(e, t, n), e) {
@@ -6254,10 +6297,10 @@ var Oi = class extends w {
6254
6297
  _updatePath2DSet() {
6255
6298
  let e;
6256
6299
  if (this.svg) {
6257
- let t = se(this.svg);
6258
- this._path2DSet = ce(t), e = this._path2DSet.viewBox;
6300
+ let t = ce(this.svg);
6301
+ this._path2DSet = le(t), e = this._path2DSet.viewBox;
6259
6302
  } else this._path2DSet.paths.length = 0, this.paths?.forEach((e, t) => {
6260
- let { data: n, ...r } = e, i = new ae();
6303
+ let { data: n, ...r } = e, i = new oe();
6261
6304
  i.style = r, i.addData(n), this._path2DSet.paths[t] = i;
6262
6305
  });
6263
6306
  if (!e) {
@@ -6292,24 +6335,24 @@ var Oi = class extends w {
6292
6335
  t && n && (r ? e.roundRect(0, 0, t, n, r) : e.rect(0, 0, t, n));
6293
6336
  }
6294
6337
  };
6295
- k([_({ fallback: !0 }), O("design:type", Boolean)], Oi.prototype, "enabled", void 0), k([_(), O("design:type", Object)], Oi.prototype, "preset", void 0), k([_(), O("design:type", Object)], Oi.prototype, "svg", void 0), k([_(), O("design:type", Object)], Oi.prototype, "viewBox", void 0), k([_(), O("design:type", Object)], Oi.prototype, "paths", void 0);
6338
+ k([_({ fallback: !0 }), O("design:type", Boolean)], Ai.prototype, "enabled", void 0), k([_(), O("design:type", Object)], Ai.prototype, "preset", void 0), k([_(), O("design:type", Object)], Ai.prototype, "svg", void 0), k([_(), O("design:type", Object)], Ai.prototype, "viewBox", void 0), k([_(), O("design:type", Object)], Ai.prototype, "paths", void 0), k([_(), O("design:type", Object)], Ai.prototype, "connectionPoints", void 0);
6296
6339
  //#endregion
6297
6340
  //#region src/scene/2d/element/Element2DStyle.ts
6298
- var ki = class extends T {
6341
+ var ji = class extends w {
6299
6342
  constructor(e) {
6300
6343
  super(), this.setProperties(e);
6301
6344
  }
6302
- }, Ai = {
6345
+ }, Mi = {
6303
6346
  ...o(),
6304
6347
  left: 0,
6305
6348
  top: 0,
6306
6349
  width: 0,
6307
6350
  height: 0
6308
6351
  };
6309
- for (let e in Ai) i(ki, e, { fallback: Ai[e] });
6352
+ for (let e in Mi) i(ji, e, { fallback: Mi[e] });
6310
6353
  //#endregion
6311
6354
  //#region src/scene/2d/element/Element2DText.ts
6312
- var ji, X = class extends w {
6355
+ var Ni, X = class extends C {
6313
6356
  base;
6314
6357
  get textContent() {
6315
6358
  return this._textContent;
@@ -6319,13 +6362,13 @@ var ji, X = class extends w {
6319
6362
  }
6320
6363
  _textContent = "";
6321
6364
  _autoDrawMode;
6322
- _texture = new Jn({ mipmap: !0 });
6365
+ _texture = new Yn({ mipmap: !0 });
6323
6366
  _textureMap = /* @__PURE__ */ new Map();
6324
6367
  constructor(e) {
6325
- super(), this._parent = e, this.base = new fe(), this.base.setPropertyAccessor(this);
6368
+ super(), this._parent = e, this.base = new pe(), this.base.setPropertyAccessor(this);
6326
6369
  }
6327
6370
  setProperties(e) {
6328
- return super.setProperties(d(e) ? void 0 : te(e));
6371
+ return super.setProperties(d(e) ? void 0 : ne(e));
6329
6372
  }
6330
6373
  _updateProperty(e, t, n) {
6331
6374
  switch (super._updateProperty(e, t, n), e) {
@@ -6371,29 +6414,29 @@ var ji, X = class extends w {
6371
6414
  let r = [];
6372
6415
  if (t.fragments.forEach((e, t) => {
6373
6416
  if (e.characters.length) {
6374
- let i = ie.from(...e.characters.map((e) => e.compatibleGlyphBox));
6417
+ let i = ae.from(...e.characters.map((e) => e.compatibleGlyphBox));
6375
6418
  this._updateTexture(`${n}.${t}.fill`, e.fill, i), this._updateTexture(`${n}.${t}.outline`, e.outline, i), r.push(i);
6376
6419
  }
6377
6420
  }), r.length) {
6378
- let i = ie.from(...r);
6421
+ let i = ae.from(...r);
6379
6422
  this._updateTexture(`${n}.fill`, t.fill, i), this._updateTexture(`${n}.outline`, t.outline, i), e.push(i);
6380
6423
  }
6381
6424
  }), e.length) {
6382
- let t = ie.from(...e);
6425
+ let t = ae.from(...e);
6383
6426
  this._updateTexture("fill", this.fill, t), this._updateTexture("outline", this.outline, t);
6384
6427
  }
6385
6428
  }
6386
6429
  async _updateTexture(e, t, n) {
6387
6430
  t && Object.keys(t).length > 0 && (this._textureMap.set(e, {
6388
- texture: await this._loadTexture(p(t), n),
6431
+ texture: await this._loadTexture(m(t), n),
6389
6432
  box: n
6390
6433
  }), this._parent.requestDraw());
6391
6434
  }
6392
6435
  async _loadTexture(e, t) {
6393
- return e.linearGradient || e.radialGradient ? new Xn(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));
6436
+ return e.linearGradient || e.radialGradient ? new Zn(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));
6394
6437
  }
6395
6438
  setContent(e) {
6396
- this.content = ne(e);
6439
+ this.content = re(e);
6397
6440
  }
6398
6441
  getStringContent() {
6399
6442
  return this.base.toString();
@@ -6414,12 +6457,12 @@ var ji, X = class extends w {
6414
6457
  this.base.pathSets.forEach((n) => {
6415
6458
  n.paths.forEach((n) => {
6416
6459
  let r = n.getMeta();
6417
- if (r instanceof de) {
6460
+ if (r instanceof fe) {
6418
6461
  let i = r.parent.index, a = r.parent.parent.index;
6419
6462
  if (n.style.fill && !d(n.style.fill)) if (typeof n.style.fill == "object") {
6420
6463
  let r = n.style.fill, o = this._textureMap.get(`${a}.${i}.fill`) ?? this._textureMap.get(`${a}.fill`) ?? this._textureMap.get("fill");
6421
6464
  r.enabled !== !1 && (o || r.color) && (e.addPath(n), e.style = { ...n.style }, e.fillStyle = o?.texture ?? r.color, e.fill({
6422
- ...Ci(r, o?.box ?? {
6465
+ ...wi(r, o?.box ?? {
6423
6466
  x: 0,
6424
6467
  y: 0,
6425
6468
  width: this._parent.size.width,
@@ -6431,7 +6474,7 @@ var ji, X = class extends w {
6431
6474
  if (n.style.stroke && !d(n.style.stroke)) if (typeof n.style.stroke == "object") {
6432
6475
  let r = n.style.stroke, o = this._textureMap.get(`${a}.${i}.outline`) ?? this._textureMap.get(`${a}.outline`) ?? this._textureMap.get("outline");
6433
6476
  r.enabled !== !1 && (o || r.color) && (r.width === void 0 || r.width) && (e.addPath(n), e.style = { ...n.style }, e.lineWidth = r.width || 1, e.strokeStyle = o?.texture ?? r.color, e.lineCap = r.lineCap, e.lineJoin = r.lineJoin, e.stroke({
6434
- ...Ci(r, o?.box ?? {
6477
+ ...wi(r, o?.box ?? {
6435
6478
  x: 0,
6436
6479
  y: 0,
6437
6480
  width: this._parent.size.width,
@@ -6461,7 +6504,7 @@ var ji, X = class extends w {
6461
6504
  }
6462
6505
  process(e) {}
6463
6506
  };
6464
- k([_({ fallback: !0 }), O("design:type", Object)], X.prototype, "enabled", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], X.prototype, "content", void 0), k([_({ alias: "_parent.style.json" }), O("design:type", Object)], X.prototype, "style", void 0), k([_(), O("design:type", Object)], X.prototype, "effects", void 0), k([_(), O("design:type", Object)], X.prototype, "fill", void 0), k([_(), O("design:type", Object)], X.prototype, "outline", void 0), k([_({ alias: "base.measureDom" }), O("design:type", typeof (ji = typeof HTMLElement < "u" && HTMLElement) == "function" ? ji : Object)], X.prototype, "measureDom", void 0), k([_({ alias: "base.fonts" }), O("design:type", Object)], X.prototype, "fonts", void 0), k([_({ fallback: "auto" }), O("design:type", Object)], X.prototype, "drawMode", void 0);
6507
+ k([_({ fallback: !0 }), O("design:type", Object)], X.prototype, "enabled", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], X.prototype, "content", void 0), k([_({ alias: "_parent.style.json" }), O("design:type", Object)], X.prototype, "style", void 0), k([_(), O("design:type", Object)], X.prototype, "effects", void 0), k([_(), O("design:type", Object)], X.prototype, "fill", void 0), k([_(), O("design:type", Object)], X.prototype, "outline", void 0), k([_({ alias: "base.measureDom" }), O("design:type", typeof (Ni = typeof HTMLElement < "u" && HTMLElement) == "function" ? Ni : Object)], X.prototype, "measureDom", void 0), k([_({ alias: "base.fonts" }), O("design:type", Object)], X.prototype, "fonts", void 0), k([_({ fallback: "auto" }), O("design:type", Object)], X.prototype, "drawMode", void 0);
6465
6508
  //#endregion
6466
6509
  //#region src/scene/2d/element/Flexbox.ts
6467
6510
  var Z = {
@@ -6474,7 +6517,7 @@ var Z = {
6474
6517
  horizontal: 6,
6475
6518
  vertical: 7,
6476
6519
  all: 8
6477
- }, Mi = {
6520
+ }, Pi = {
6478
6521
  column: 0,
6479
6522
  row: 1,
6480
6523
  all: 2
@@ -6488,42 +6531,42 @@ var Z = {
6488
6531
  "space-between": 6,
6489
6532
  "space-around": 7,
6490
6533
  "space-evenly": 8
6491
- }, Ni = {
6534
+ }, Fi = {
6492
6535
  flex: 0,
6493
6536
  none: 1,
6494
6537
  contents: 2
6495
- }, Pi = {
6538
+ }, Ii = {
6496
6539
  inherit: 0,
6497
6540
  ltr: 1,
6498
6541
  rtl: 2
6499
- }, Fi = {
6542
+ }, Li = {
6500
6543
  column: 0,
6501
6544
  "column-reverse": 1,
6502
6545
  row: 2,
6503
6546
  "row-reverse": 3
6504
- }, Ii = {
6547
+ }, Ri = {
6505
6548
  "no-wrap": 0,
6506
6549
  wrap: 1,
6507
6550
  "Wrap-reverse": 2
6508
- }, Li = {
6551
+ }, zi = {
6509
6552
  "flex-start": 0,
6510
6553
  center: 1,
6511
6554
  "flex-end": 2,
6512
6555
  "space-between": 3,
6513
6556
  "space-around": 4,
6514
6557
  "space-evenly": 5
6515
- }, Ri = {
6558
+ }, Bi = {
6516
6559
  visible: 0,
6517
6560
  hidden: 1,
6518
6561
  scroll: 2
6519
- }, zi = {
6562
+ }, Vi = {
6520
6563
  static: 0,
6521
6564
  relative: 1,
6522
6565
  absolute: 2
6523
- }, Bi = {
6566
+ }, Hi = {
6524
6567
  "border-box": 0,
6525
6568
  "content-box": 1
6526
- }, Vi = class e {
6569
+ }, Ui = class e {
6527
6570
  static _yoga;
6528
6571
  static async load() {
6529
6572
  let { loadYoga: e } = await import("yoga-layout/load");
@@ -6534,14 +6577,14 @@ var Z = {
6534
6577
  this._parent = e, this._addChild = this._addChild.bind(this), this._removeChild = this._removeChild.bind(this), this._parent.on("addChild", this._addChild), this._parent.on("removeChild", this._removeChild);
6535
6578
  }
6536
6579
  _addChild(e, t) {
6537
- if (e instanceof Gi && e.flexbox.node && this.node) {
6580
+ if (e instanceof qi && e.flexbox.node && this.node) {
6538
6581
  this.node.insertChild(e.flexbox.node, t);
6539
6582
  let n = e.style.getProperties();
6540
6583
  for (let t in n) e.flexbox.updateStyleProperty(t, n[t]);
6541
6584
  }
6542
6585
  }
6543
6586
  _removeChild(e, t) {
6544
- e instanceof Gi && e.flexbox.node && this.node && this.node.removeChild(e.flexbox.node);
6587
+ e instanceof qi && e.flexbox.node && this.node && this.node.removeChild(e.flexbox.node);
6545
6588
  }
6546
6589
  updateStyleProperty(e, t) {
6547
6590
  let n = this.node;
@@ -6575,10 +6618,10 @@ var Z = {
6575
6618
  n.setBorder(Z.all, this._parent.style.borderWidth);
6576
6619
  break;
6577
6620
  case "direction":
6578
- n.setDirection(t ? Pi[t] ?? Pi.inherit : Pi.inherit);
6621
+ n.setDirection(t ? Ii[t] ?? Ii.inherit : Ii.inherit);
6579
6622
  break;
6580
6623
  case "display":
6581
- n.setDisplay(t ? Ni[t] ?? Ni.flex : Ni.flex);
6624
+ n.setDisplay(t ? Fi[t] ?? Fi.flex : Fi.flex);
6582
6625
  break;
6583
6626
  case "flex":
6584
6627
  n.setFlex(t);
@@ -6587,7 +6630,7 @@ var Z = {
6587
6630
  n.setFlexBasis(t);
6588
6631
  break;
6589
6632
  case "flexDirection":
6590
- n.setFlexDirection(t ? Fi[t] ?? Fi.row : Fi.row);
6633
+ n.setFlexDirection(t ? Li[t] ?? Li.row : Li.row);
6591
6634
  break;
6592
6635
  case "flexGrow":
6593
6636
  n.setFlexGrow(t);
@@ -6596,16 +6639,16 @@ var Z = {
6596
6639
  n.setFlexShrink(t);
6597
6640
  break;
6598
6641
  case "flexWrap":
6599
- n.setFlexWrap(t ? Ii[t] ?? Ii.wrap : Ii.wrap);
6642
+ n.setFlexWrap(t ? Ri[t] ?? Ri.wrap : Ri.wrap);
6600
6643
  break;
6601
6644
  case "height":
6602
6645
  n.setHeight(t);
6603
6646
  break;
6604
6647
  case "justifyContent":
6605
- n.setJustifyContent(t ? Li[t] ?? Li["flex-start"] : Li["flex-start"]);
6648
+ n.setJustifyContent(t ? zi[t] ?? zi["flex-start"] : zi["flex-start"]);
6606
6649
  break;
6607
6650
  case "gap":
6608
- t !== void 0 && n.setGap(Mi.all, t);
6651
+ t !== void 0 && n.setGap(Pi.all, t);
6609
6652
  break;
6610
6653
  case "marginTop":
6611
6654
  n.setMargin(Z.top, t);
@@ -6635,7 +6678,7 @@ var Z = {
6635
6678
  n.setMinWidth(t);
6636
6679
  break;
6637
6680
  case "overflow":
6638
- n.setOverflow(t ? Ri[t] ?? Ri.visible : Ri.visible);
6681
+ n.setOverflow(t ? Bi[t] ?? Bi.visible : Bi.visible);
6639
6682
  break;
6640
6683
  case "paddingTop":
6641
6684
  n.setPadding(Z.top, t);
@@ -6665,10 +6708,10 @@ var Z = {
6665
6708
  n.setPosition(Z.right, t);
6666
6709
  break;
6667
6710
  case "position":
6668
- n.setPositionType(t ? zi[t] ?? zi.relative : zi.relative);
6711
+ n.setPositionType(t ? Vi[t] ?? Vi.relative : Vi.relative);
6669
6712
  break;
6670
6713
  case "boxSizing":
6671
- n.setBoxSizing(t ? Bi[t] ?? Bi["content-box"] : Bi["content-box"]);
6714
+ n.setBoxSizing(t ? Hi[t] ?? Hi["content-box"] : Hi["content-box"]);
6672
6715
  break;
6673
6716
  case "width":
6674
6717
  n.setWidth(t);
@@ -6679,7 +6722,7 @@ var Z = {
6679
6722
  }
6680
6723
  update() {
6681
6724
  let e = this._parent, t = this.node;
6682
- if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0, Pi.ltr), t.hasNewLayout())) {
6725
+ if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0, Ii.ltr), t.hasNewLayout())) {
6683
6726
  let { left: n, top: r, width: i, height: a } = t.getComputedLayout();
6684
6727
  (!Number.isNaN(n) && n !== e.position.x || !Number.isNaN(r) && r !== e.position.y) && e.position.set(n, r), (!Number.isNaN(i) && i !== e.size.x || !Number.isNaN(a) && a !== e.size.y) && e.size.set(i, a), t.markLayoutSeen();
6685
6728
  }
@@ -6687,10 +6730,10 @@ var Z = {
6687
6730
  destroy() {
6688
6731
  this.node?.free(), this.node = void 0;
6689
6732
  }
6690
- }, Hi, Ui = new Set(Object.keys(a())), Wi = new Set(Object.keys(s())), Gi = class extends xr {
6691
- flexbox = new Vi(this);
6692
- aabb = new st();
6693
- globalAabb = new st();
6733
+ }, Wi, Gi = new Set(Object.keys(a())), Ki = new Set(Object.keys(s())), qi = class extends Sr {
6734
+ flexbox = new Ui(this);
6735
+ aabb = new lt();
6736
+ globalAabb = new lt();
6694
6737
  _parentGlobalDisplay;
6695
6738
  _globalDisplay;
6696
6739
  get globalDisplay() {
@@ -6701,7 +6744,7 @@ var Z = {
6701
6744
  });
6702
6745
  _allowPointerEvents = !0;
6703
6746
  _overflowHidden = !1;
6704
- _style = new ki().on("updateProperty", (...e) => {
6747
+ _style = new ji().on("updateProperty", (...e) => {
6705
6748
  this.onUpdateStyleProperty(e[0], e[1], e[2]);
6706
6749
  });
6707
6750
  get style() {
@@ -6710,14 +6753,14 @@ var Z = {
6710
6753
  set style(e) {
6711
6754
  this._style.resetProperties().setProperties(e);
6712
6755
  }
6713
- _background = new wi(this);
6756
+ _background = new Ti(this);
6714
6757
  get background() {
6715
6758
  return this._background;
6716
6759
  }
6717
6760
  set background(e) {
6718
6761
  this._background.resetProperties().setProperties(e);
6719
6762
  }
6720
- _shape = new Oi(this);
6763
+ _shape = new Ai(this);
6721
6764
  get shape() {
6722
6765
  return this._shape;
6723
6766
  }
@@ -6731,14 +6774,14 @@ var Z = {
6731
6774
  set fill(e) {
6732
6775
  this._fill.resetProperties().setProperties(e);
6733
6776
  }
6734
- _outline = new Ei(this);
6777
+ _outline = new Oi(this);
6735
6778
  get outline() {
6736
6779
  return this._outline;
6737
6780
  }
6738
6781
  set outline(e) {
6739
6782
  this._outline.resetProperties().setProperties(e);
6740
6783
  }
6741
- _foreground = new Ti(this);
6784
+ _foreground = new Di(this);
6742
6785
  get foreground() {
6743
6786
  return this._foreground;
6744
6787
  }
@@ -6752,13 +6795,20 @@ var Z = {
6752
6795
  set text(e) {
6753
6796
  this._text.resetProperties().setProperties(e);
6754
6797
  }
6755
- _shadow = new Di(this);
6798
+ _shadow = new ki(this);
6756
6799
  get shadow() {
6757
6800
  return this._shadow;
6758
6801
  }
6759
6802
  set shadow(e) {
6760
6803
  this._shadow.resetProperties().setProperties(e);
6761
6804
  }
6805
+ _connection = new Ei(this);
6806
+ get connection() {
6807
+ return this._connection;
6808
+ }
6809
+ set connection(e) {
6810
+ this._connection.resetProperties().setProperties(e);
6811
+ }
6762
6812
  _colorFilterEffect;
6763
6813
  _maskEffect;
6764
6814
  constructor(e, t = []) {
@@ -6769,8 +6819,8 @@ var Z = {
6769
6819
  }
6770
6820
  setProperties(e) {
6771
6821
  if (e) {
6772
- let { style: t, text: n, shape: r, background: i, fill: a, outline: o, foreground: s, shadow: c, ...l } = e;
6773
- t && this.style.setProperties(t), i && this.background.setProperties(i), r && this.shape.setProperties(r), a && this.fill.setProperties(a), o && this.outline.setProperties(o), n && this.text.setProperties(n), s && this.foreground.setProperties(s), c && this.shadow.setProperties(c), super.setProperties(l);
6822
+ let { style: t, text: n, shape: r, background: i, fill: a, outline: o, foreground: s, shadow: c, connection: l, ...u } = e;
6823
+ t && this.style.setProperties(t), i && this.background.setProperties(i), r && this.shape.setProperties(r), a && this.fill.setProperties(a), o && this.outline.setProperties(o), n && this.text.setProperties(n), s && this.foreground.setProperties(s), c && this.shadow.setProperties(c), l && this.connection.setProperties(l), super.setProperties(u);
6774
6824
  }
6775
6825
  return this;
6776
6826
  }
@@ -6823,7 +6873,7 @@ var Z = {
6823
6873
  this._updateGlobalDisplay();
6824
6874
  break;
6825
6875
  case "rotate":
6826
- this.rotation = (t || 0) * ct, this.updateGlobalTransform();
6876
+ this.rotation = (t || 0) * ut, this.updateGlobalTransform();
6827
6877
  break;
6828
6878
  case "scaleX":
6829
6879
  this.scale.x = t, this.text.isValid() && (t ^ n) < 0 && this.requestDraw();
@@ -6844,7 +6894,7 @@ var Z = {
6844
6894
  }), this.extraTransform.translate(this.pivot.x, this.pivot.y), this.updateGlobalTransform();
6845
6895
  break;
6846
6896
  case "transformOrigin": {
6847
- let e = Er(t ?? "");
6897
+ let e = Dr(t ?? "");
6848
6898
  this.pivot.set(e[0] * this.size.width, e[1] * this.size.height);
6849
6899
  break;
6850
6900
  }
@@ -6888,7 +6938,7 @@ var Z = {
6888
6938
  this.requestDraw();
6889
6939
  break;
6890
6940
  }
6891
- if ((Wi.has(e) || Ui.has(e)) && this.text.isValid() && this.text.update(), this.globalDisplay === "flex") this.flexbox.updateStyleProperty(e, t);
6941
+ if ((Ki.has(e) || Gi.has(e)) && this.text.isValid() && this.text.update(), this.globalDisplay === "flex") this.flexbox.updateStyleProperty(e, t);
6892
6942
  else switch (e) {
6893
6943
  case "left":
6894
6944
  this.position.x = Number(t);
@@ -6908,18 +6958,24 @@ var Z = {
6908
6958
  super.requestLayout(), this.flexbox.update();
6909
6959
  }
6910
6960
  _process(e) {
6911
- this.foreground.process(e), this.fill.process(e), this.text.process(e), this.outline.process(e), this.background.process(e);
6961
+ this.foreground.process(e), this.fill.process(e), this.text.process(e), this.outline.process(e), this.background.process(e), this._connection.isValid() && this._updateConnectionTransform();
6912
6962
  let t = this.getParent();
6913
6963
  this._parentGlobalDisplay !== t?.globalDisplay && this._updateGlobalDisplay(), this.flexbox.update(), super._process(e);
6914
6964
  }
6965
+ _updateConnectionTransform() {
6966
+ let e = this._connection.resolveAnchor(this._connection.start), t = this._connection.resolveAnchor(this._connection.end);
6967
+ if (!e && !t) return;
6968
+ let n = e ?? t, r = t ?? e, i = Math.min(n.x, r.x), a = Math.min(n.y, r.y), o = Math.max(Math.abs(r.x - n.x), 1), s = Math.max(Math.abs(r.y - n.y), 1);
6969
+ this.position.x = i, this.position.y = a, this.size.width = o, this.size.height = s, this.updateGlobalTransform();
6970
+ }
6915
6971
  _updateStyleFilter(e) {
6916
- d(e) ? (this._colorFilterEffect?.remove(), this._colorFilterEffect = void 0, this.requestRender()) : (this._colorFilterEffect || (this._colorFilterEffect = new jr({
6972
+ d(e) ? (this._colorFilterEffect?.remove(), this._colorFilterEffect = void 0, this.requestRender()) : (this._colorFilterEffect || (this._colorFilterEffect = new Mr({
6917
6973
  name: "styleFilter",
6918
6974
  internalMode: "front"
6919
6975
  }), this.append(this._colorFilterEffect)), this._colorFilterEffect.filter = e);
6920
6976
  }
6921
6977
  _updateStyleMaskImage(e) {
6922
- d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new pi({
6978
+ d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new mi({
6923
6979
  name: "styleMaskImage",
6924
6980
  internalMode: "back"
6925
6981
  }), this.append(this._maskEffect)), this._maskEffect.image = e);
@@ -6950,11 +7006,11 @@ var Z = {
6950
7006
  }
6951
7007
  getObb() {
6952
7008
  let e = this.pivot, t = this.transform.apply(e).sub(e);
6953
- return new ft(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.rotation);
7009
+ return new pt(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.rotation);
6954
7010
  }
6955
7011
  getGlobalObb() {
6956
7012
  let e = this.pivot, t = this.globalTransform.apply(e).sub(e);
6957
- return new ft(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.globalRotation);
7013
+ return new pt(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.globalRotation);
6958
7014
  }
6959
7015
  _draw() {
6960
7016
  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._drawContent();
@@ -6998,17 +7054,18 @@ var Z = {
6998
7054
  outline: e(this.outline.toJSON()),
6999
7055
  text: e(this.text.toJSON()),
7000
7056
  foreground: e(this.foreground.toJSON()),
7001
- shadow: e(this.shadow.toJSON())
7057
+ shadow: e(this.shadow.toJSON()),
7058
+ connection: e(this.connection.toJSON())
7002
7059
  });
7003
7060
  }
7004
7061
  _destroy() {
7005
- 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._colorFilterEffect = void 0, this._maskEffect = void 0;
7062
+ 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._colorFilterEffect = void 0, this._maskEffect = void 0;
7006
7063
  }
7007
7064
  };
7008
- Gi = k([x("Element2D"), O("design:paramtypes", [typeof (Hi = typeof Partial < "u" && Partial) == "function" ? Hi : Object, Array])], Gi);
7065
+ qi = k([x("Element2D"), O("design:paramtypes", [typeof (Wi = typeof Partial < "u" && Partial) == "function" ? Wi : Object, Array])], qi);
7009
7066
  //#endregion
7010
7067
  //#region src/scene/2d/TextureRect2D.ts
7011
- var Ki = class extends Gi {
7068
+ var Ji = class extends qi {
7012
7069
  texture;
7013
7070
  constructor(e, t = []) {
7014
7071
  super(), this.setProperties(e).append(t);
@@ -7022,8 +7079,8 @@ var Ki = class extends Gi {
7022
7079
  } });
7023
7080
  }
7024
7081
  }
7025
- }, qi, Ji = class extends Ki {
7026
- texture = new Jn();
7082
+ }, Yi, Xi = class extends Ji {
7083
+ texture = new Yn();
7027
7084
  animation;
7028
7085
  constructor(e, t = []) {
7029
7086
  super(), this.setProperties(e), this.append(t);
@@ -7052,10 +7109,10 @@ var Ki = class extends Gi {
7052
7109
  this.animation?.goToAndStop(this.currentTime, !1), this.texture.requestUpdate("source"), this.requestDraw(), super._process(e);
7053
7110
  }
7054
7111
  };
7055
- k([_({ fallback: "" }), O("design:type", String)], Ji.prototype, "src", void 0), Ji = k([x("Lottie2D"), O("design:paramtypes", [typeof (qi = typeof Partial < "u" && Partial) == "function" ? qi : Object, Array])], Ji);
7112
+ k([_({ fallback: "" }), O("design:type", String)], Xi.prototype, "src", void 0), Xi = k([x("Lottie2D"), O("design:paramtypes", [typeof (Yi = typeof Partial < "u" && Partial) == "function" ? Yi : Object, Array])], Xi);
7056
7113
  //#endregion
7057
7114
  //#region src/scene/2d/TransformRect2D.ts
7058
- var Yi = class extends Gi {
7115
+ var Zi = class extends qi {
7059
7116
  constructor(e, t = []) {
7060
7117
  super(), this.setProperties(e).append(t);
7061
7118
  }
@@ -7078,10 +7135,10 @@ var Yi = class extends Gi {
7078
7135
  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);
7079
7136
  }
7080
7137
  };
7081
- k([_({ fallback: 6 }), O("design:type", Number)], Yi.prototype, "handleSize", void 0);
7138
+ k([_({ fallback: 6 }), O("design:type", Number)], Zi.prototype, "handleSize", void 0);
7082
7139
  //#endregion
7083
7140
  //#region src/scene/2d/Video2D.ts
7084
- var Xi, Zi = class extends Ki {
7141
+ var Qi, $i = class extends Ji {
7085
7142
  get videoDuration() {
7086
7143
  return (this.texture?.duration ?? 0) * 1e3;
7087
7144
  }
@@ -7113,11 +7170,11 @@ var Xi, Zi = class extends Ki {
7113
7170
  super._process(e), this._updateVideoCurrentTime();
7114
7171
  }
7115
7172
  };
7116
- k([_({ fallback: "" }), O("design:type", String)], Zi.prototype, "src", void 0), Zi = k([x("Video2D"), O("design:paramtypes", [typeof (Xi = typeof Partial < "u" && Partial) == "function" ? Xi : Object, Array])], Zi);
7173
+ k([_({ fallback: "" }), O("design:type", String)], $i.prototype, "src", void 0), $i = k([x("Video2D"), O("design:paramtypes", [typeof (Qi = typeof Partial < "u" && Partial) == "function" ? Qi : Object, Array])], $i);
7117
7174
  //#endregion
7118
7175
  //#region src/scene/animation/Animation.ts
7119
- var Qi, $i = (e) => e, ea = ia(.25, .1, .25, 1), ta = ia(.42, 0, 1, 1), na = ia(0, 0, .58, 1), ra = ia(.42, 0, .58, 1);
7120
- function ia(e, t, n, r) {
7176
+ var ea, ta = (e) => e, na = oa(.25, .1, .25, 1), ra = oa(.42, 0, 1, 1), ia = oa(0, 0, .58, 1), aa = oa(.42, 0, .58, 1);
7177
+ function oa(e, t, n, r) {
7121
7178
  let i = 1e-6, a = 3 * e - 3 * n + 1, o = 3 * n - 6 * e, s = 3 * e, c = 3 * t - 3 * r + 1, l = 3 * r - 6 * t, u = 3 * t, d = (e) => (3 * a * e + 2 * o) * e + s, f = (e) => ((a * e + o) * e + s) * e, p = (e) => ((c * e + l) * e + u) * e;
7122
7179
  function m(e) {
7123
7180
  let t = e, n, r;
@@ -7137,13 +7194,13 @@ function ia(e, t, n, r) {
7137
7194
  }
7138
7195
  return (e) => p(m(e));
7139
7196
  }
7140
- var aa = {
7141
- linear: $i,
7142
- ease: ea,
7143
- easeIn: ta,
7144
- easeOut: na,
7145
- easeInOut: ra
7146
- }, oa = class extends V {
7197
+ var sa = {
7198
+ linear: ta,
7199
+ ease: na,
7200
+ easeIn: ra,
7201
+ easeOut: ia,
7202
+ easeInOut: aa
7203
+ }, ca = class extends V {
7147
7204
  _keyframes = [];
7148
7205
  _isFirstUpdatePosition = !1;
7149
7206
  _cachedProps = new t();
@@ -7178,7 +7235,7 @@ var aa = {
7178
7235
  e = [this.getParent()].filter(Boolean);
7179
7236
  break;
7180
7237
  }
7181
- return e.filter((e) => e instanceof Gi);
7238
+ return e.filter((e) => e instanceof qi);
7182
7239
  }
7183
7240
  _updateKeyframes() {
7184
7241
  let e = [], t = this.keyframes;
@@ -7210,7 +7267,7 @@ var aa = {
7210
7267
  }
7211
7268
  let e = this._getTargets(), t = 1 / e.length, n = this.currentTimeProgress;
7212
7269
  e.forEach((e, r) => {
7213
- let i = t === 1 ? n : ut(Math.max(0, n - t * r) / t, 0, 1), a = this._cachedProps.get(e);
7270
+ let i = t === 1 ? n : E(Math.max(0, n - t * r) / t, 0, 1), a = this._cachedProps.get(e);
7214
7271
  if (!a) return;
7215
7272
  let o = this._parseKeyframes(i, a);
7216
7273
  o?.length && this._commitStyle(i, e, a, o[0], o[1]);
@@ -7226,10 +7283,10 @@ var aa = {
7226
7283
  });
7227
7284
  }
7228
7285
  _parseEasing(e) {
7229
- if (!e) return aa.linear;
7230
- if (e in aa) return aa[e];
7286
+ if (!e) return sa.linear;
7287
+ if (e in sa) return sa[e];
7231
7288
  let t = e.replace(/cubic-bezier\((.+)\)/, "$1").split(",").map((e) => Number(e));
7232
- return ia(t[0], t[1], t[2], t[3]);
7289
+ return oa(t[0], t[1], t[2], t[3]);
7233
7290
  }
7234
7291
  _parseKeyframes(e, t) {
7235
7292
  let n, r = this._keyframes;
@@ -7265,10 +7322,10 @@ var aa = {
7265
7322
  }
7266
7323
  _getDiffValue(e, t, n, r, i) {
7267
7324
  let a, o;
7268
- if (t === "none" && (t = void 0), n === "none" && (n = void 0), t === void 0 || n === void 0) if (t !== void 0) a = Ce(e, String(t), i), o = Se(a);
7269
- else if (n !== void 0) o = Ce(e, String(n), i), a = Se(o);
7325
+ if (t === "none" && (t = void 0), n === "none" && (n = void 0), t === void 0 || n === void 0) if (t !== void 0) a = we(e, String(t), i), o = Ce(a);
7326
+ else if (n !== void 0) o = we(e, String(n), i), a = Ce(o);
7270
7327
  else return;
7271
- else a = Ce(e, String(t), i), o = Ce(e, String(n), i);
7328
+ else a = we(e, String(t), i), o = we(e, String(n), i);
7272
7329
  if (Array.isArray(a) && Array.isArray(o)) {
7273
7330
  let e = /* @__PURE__ */ new Set(), t = {}, n = {};
7274
7331
  a.forEach(({ name: n, args: r }) => {
@@ -7307,14 +7364,14 @@ var aa = {
7307
7364
  });
7308
7365
  }
7309
7366
  };
7310
- k([_({ fallback: "parent" }), O("design:type", Object)], oa.prototype, "effectMode", void 0), k([_({ default: () => [] }), O("design:type", Array)], oa.prototype, "keyframes", void 0), k([_(), O("design:type", Object)], oa.prototype, "easing", void 0), oa = k([x("Animation", {
7367
+ k([_({ fallback: "parent" }), O("design:type", Object)], ca.prototype, "effectMode", void 0), k([_({ default: () => [] }), O("design:type", Array)], ca.prototype, "keyframes", void 0), k([_(), O("design:type", Object)], ca.prototype, "easing", void 0), ca = k([x("Animation", {
7311
7368
  renderMode: "disabled",
7312
7369
  processSortMode: "parent-before",
7313
7370
  duration: 2e3
7314
- }), O("design:paramtypes", [typeof (Qi = typeof Partial < "u" && Partial) == "function" ? Qi : Object, Array])], oa);
7371
+ }), O("design:paramtypes", [typeof (ea = typeof Partial < "u" && Partial) == "function" ? ea : Object, Array])], ca);
7315
7372
  //#endregion
7316
7373
  //#region src/scene/audio/html/HTMLAudioContext.ts
7317
- var sa = class t extends e {
7374
+ var la = class t extends e {
7318
7375
  static _instance;
7319
7376
  static get instance() {
7320
7377
  return this._instance ||= new t(), this._instance;
@@ -7344,7 +7401,7 @@ var sa = class t extends e {
7344
7401
  togglePause() {
7345
7402
  return this.paused = !this.paused, this.refreshPaused(), this.paused;
7346
7403
  }
7347
- }, ca = class t extends e {
7404
+ }, ua = class t extends e {
7348
7405
  static PADDING = .1;
7349
7406
  _source = null;
7350
7407
  _audio = null;
@@ -7471,7 +7528,7 @@ var sa = class t extends e {
7471
7528
  let e = this._source;
7472
7529
  e && (e.onended = null, e.onplay = null, e.onpause = null, this._stop()), this._source = null, this._playbackRate = 1, this._volume = 1, this._loop = !1, this._end = 0, this._start = 0, this._duration = 0, this._playing = !1, this._pausedReal = !1, this._paused = !1, this._muted = !1, this._audio &&= (this._audio.context.off("refresh", this.refresh), this._audio.context.off("refreshPaused", this.refreshPaused), null);
7473
7530
  }
7474
- }, la = class {
7531
+ }, da = class {
7475
7532
  source = new globalThis.Audio();
7476
7533
  _src = "";
7477
7534
  get src() {
@@ -7487,7 +7544,7 @@ var sa = class t extends e {
7487
7544
  return !!this.source && this.source.readyState === 4;
7488
7545
  }
7489
7546
  get context() {
7490
- return sa.instance;
7547
+ return la.instance;
7491
7548
  }
7492
7549
  constructor(e) {
7493
7550
  this.parent = e;
@@ -7498,9 +7555,9 @@ var sa = class t extends e {
7498
7555
  });
7499
7556
  }
7500
7557
  createSound() {
7501
- return new ca();
7558
+ return new ua();
7502
7559
  }
7503
- }, ua = class extends e {
7560
+ }, fa = class extends e {
7504
7561
  _processers = [];
7505
7562
  constructor(e, t) {
7506
7563
  super(), this._input = e, this._output = t;
@@ -7520,7 +7577,7 @@ var sa = class t extends e {
7520
7577
  get destination() {
7521
7578
  return this._input;
7522
7579
  }
7523
- }, da = class {
7580
+ }, pa = class {
7524
7581
  constructor(e, t = null) {
7525
7582
  this.destination = e, this.source = t;
7526
7583
  }
@@ -7533,21 +7590,21 @@ var sa = class t extends e {
7533
7590
  };
7534
7591
  //#endregion
7535
7592
  //#region src/scene/audio/web/WebAudioContext.ts
7536
- function fa() {
7537
- if (Fe) return new AudioContext();
7538
- if (Ie) {
7593
+ function ma() {
7594
+ if (Le) return new AudioContext();
7595
+ if (Re) {
7539
7596
  let e = globalThis.webkitAudioContext;
7540
7597
  return new e();
7541
7598
  } else throw Error("Failed to createAudioContext");
7542
7599
  }
7543
- function pa(e, t, n) {
7544
- if (Le) return new OfflineAudioContext(e, t, n);
7545
- if (Re) {
7600
+ function ha(e, t, n) {
7601
+ if (ze) return new OfflineAudioContext(e, t, n);
7602
+ if (Be) {
7546
7603
  let r = globalThis.webkitOfflineAudioContext;
7547
7604
  return new r(e, t, n);
7548
7605
  } else throw Error("Failed to createOfflineAudioContext");
7549
7606
  }
7550
- var ma = class e extends ua {
7607
+ var ga = class e extends fa {
7551
7608
  static _instance;
7552
7609
  static get instance() {
7553
7610
  return this._instance ||= new e(), this._instance;
@@ -7588,8 +7645,8 @@ var ma = class e extends ua {
7588
7645
  _compressor;
7589
7646
  _analyser;
7590
7647
  constructor() {
7591
- let e = fa(), t = pa(1, 2, Le ? Math.max(8e3, Math.min(96e3, e.sampleRate)) : 44100), n = e.createDynamicsCompressor(), r = e.createAnalyser();
7592
- r.connect(n), n.connect(e.destination), super(r, n), this._context = e, this._offlineContext = t, this._compressor = n, this._analyser = r, this._locked = e.state === "suspended" && (C || Ne), Be && (this._locked && (this._unlock(), document.addEventListener("mousedown", this._unlock, !0), document.addEventListener("touchstart", this._unlock, !0), document.addEventListener("touchend", this._unlock, !0)), globalThis.addEventListener("focus", this._onFocus), globalThis.addEventListener("blur", this._onBlur));
7648
+ let e = ma(), t = ha(1, 2, ze ? Math.max(8e3, Math.min(96e3, e.sampleRate)) : 44100), n = e.createDynamicsCompressor(), r = e.createAnalyser();
7649
+ r.connect(n), n.connect(e.destination), super(r, n), this._context = e, this._offlineContext = t, this._compressor = n, this._analyser = r, this._locked = e.state === "suspended" && (Pe || Fe), He && (this._locked && (this._unlock(), document.addEventListener("mousedown", this._unlock, !0), document.addEventListener("touchstart", this._unlock, !0), document.addEventListener("touchend", this._unlock, !0)), globalThis.addEventListener("focus", this._onFocus), globalThis.addEventListener("blur", this._onBlur));
7593
7650
  }
7594
7651
  _onFocus() {
7595
7652
  if (!this.autoPause) return;
@@ -7629,7 +7686,7 @@ var ma = class e extends ua {
7629
7686
  setParamValue(e, t) {
7630
7687
  e.setValueAtTime ? e.setValueAtTime(t, this._context.currentTime) : e.value = t;
7631
7688
  }
7632
- }, ha = class extends e {
7689
+ }, _a = class extends e {
7633
7690
  _audio = null;
7634
7691
  _sourceNode = null;
7635
7692
  _gain = null;
@@ -7762,14 +7819,14 @@ var ma = class e extends ua {
7762
7819
  destroy() {
7763
7820
  super.destroy(), this._stop(), this._gain?.disconnect(), this._gain = null, this._audio?.context.off("refresh", this.refresh), this._audio?.context.off("refreshPaused", this.refreshPaused), this._audio = null, this._processors.forEach((e) => e.disconnect()), this._processors.length = 0, this._end = 0, this._playbackRate = 1, this._volume = 1, this._loop = !1, this._elapsed = 0, this._duration = 0, this._paused = !1, this._muted = !1, this._pausedReal = !1;
7764
7821
  }
7765
- }, ga = class extends ua {
7822
+ }, va = class extends fa {
7766
7823
  _sourceBuffer;
7767
7824
  _sourceNode;
7768
7825
  _sourceLoad;
7769
7826
  gain;
7770
7827
  analyser;
7771
7828
  get context() {
7772
- return ma.instance;
7829
+ return ga.instance;
7773
7830
  }
7774
7831
  get isPlayable() {
7775
7832
  return !!this._sourceNode.buffer;
@@ -7784,8 +7841,8 @@ var ma = class e extends ua {
7784
7841
  this._sourceNode.buffer = e;
7785
7842
  }
7786
7843
  constructor(e) {
7787
- let t = ma.audioContext, n = t.createBufferSource(), r = t.createGain(), i = t.createAnalyser();
7788
- n.connect(i), i.connect(r), r.connect(ma.instance.destination), super(i, r), this.parent = e, this._sourceNode = n, this.gain = r, this.analyser = i;
7844
+ let t = ga.audioContext, n = t.createBufferSource(), r = t.createGain(), i = t.createAnalyser();
7845
+ n.connect(i), i.connect(r), r.connect(ga.instance.destination), super(i, r), this.parent = e, this._sourceNode = n, this.gain = r, this.analyser = i;
7789
7846
  }
7790
7847
  async load() {
7791
7848
  return this._sourceLoad ||= new Promise((e) => {
@@ -7798,7 +7855,7 @@ var ma = class e extends ua {
7798
7855
  });
7799
7856
  }
7800
7857
  _decode(e) {
7801
- return Promise.resolve(e instanceof AudioBuffer ? e : ma.decode(e)).then((e) => (this.parent.isLoaded = !0, this.buffer = e, e));
7858
+ return Promise.resolve(e instanceof AudioBuffer ? e : ga.decode(e)).then((e) => (this.parent.isLoaded = !0, this.buffer = e, e));
7802
7859
  }
7803
7860
  cloneSource() {
7804
7861
  let e = this.context, t = this._sourceNode, n = e.audioContext.createBufferSource(), r = e.audioContext.createGain();
@@ -7808,15 +7865,15 @@ var ma = class e extends ua {
7808
7865
  };
7809
7866
  }
7810
7867
  createSound() {
7811
- return new ha();
7868
+ return new _a();
7812
7869
  }
7813
- }, _a, va = class extends V {
7870
+ }, ya, ba = class extends V {
7814
7871
  static {
7815
- _a = this;
7872
+ ya = this;
7816
7873
  }
7817
7874
  static _soundPool = [];
7818
7875
  _sounds = [];
7819
- _platformAudio = ze ? new ga(this) : new la(this);
7876
+ _platformAudio = Ve ? new va(this) : new da(this);
7820
7877
  get platformAudio() {
7821
7878
  return this._platformAudio;
7822
7879
  }
@@ -7909,7 +7966,7 @@ var ma = class e extends ua {
7909
7966
  this._sounds.length = 0;
7910
7967
  }
7911
7968
  _createSound() {
7912
- return _a._soundPool.length > 0 ? _a._soundPool.pop().init(this._platformAudio) : this._platformAudio.createSound().init(this._platformAudio);
7969
+ return ya._soundPool.length > 0 ? ya._soundPool.pop().init(this._platformAudio) : this._platformAudio.createSound().init(this._platformAudio);
7913
7970
  }
7914
7971
  refresh() {
7915
7972
  for (let e = this._sounds.length, t = 0; t < e; t++) this._sounds[t].refresh();
@@ -7925,7 +7982,7 @@ var ma = class e extends ua {
7925
7982
  this._recycleSound(e);
7926
7983
  };
7927
7984
  _recycleSound(e) {
7928
- e.destroy(), _a._soundPool.includes(e) || _a._soundPool.push(e);
7985
+ e.destroy(), ya._soundPool.includes(e) || ya._soundPool.push(e);
7929
7986
  }
7930
7987
  _prevTime = 0;
7931
7988
  _timer = 0;
@@ -7941,12 +7998,12 @@ var ma = class e extends ua {
7941
7998
  }, 100);
7942
7999
  }
7943
8000
  };
7944
- va = _a = k([x("Audio"), O("design:paramtypes", [Object])], va);
8001
+ ba = ya = k([x("Audio"), O("design:paramtypes", [Object])], ba);
7945
8002
  //#endregion
7946
8003
  //#region src/scene/audio/AudioSpectrum.ts
7947
- var ya = class extends xr {}, ba, xa = class extends Gi {
8004
+ var xa = class extends Sr {}, Sa, Ca = class extends qi {
7948
8005
  _audioBuffer;
7949
- _src = Be ? new z({ source: document.createElement("canvas") }) : void 0;
8006
+ _src = He ? new z({ source: document.createElement("canvas") }) : void 0;
7950
8007
  _needsUpdateTexture = !1;
7951
8008
  constructor(e = {}) {
7952
8009
  super(), this.setProperties(e);
@@ -7965,7 +8022,7 @@ var ya = class extends xr {}, ba, xa = class extends Gi {
7965
8022
  }
7966
8023
  }
7967
8024
  async _loadSrc(e) {
7968
- await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) => ma.decode(e)).then((e) => {
8025
+ await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) => ga.decode(e)).then((e) => {
7969
8026
  this._audioBuffer = e, this.syncTexture(!0);
7970
8027
  });
7971
8028
  }
@@ -8000,12 +8057,12 @@ var ya = class extends xr {}, ba, xa = class extends Gi {
8000
8057
  this.syncTexture(), super._process(e);
8001
8058
  }
8002
8059
  };
8003
- k([_(), O("design:type", Object)], xa.prototype, "src", void 0), k([_({ fallback: 0 }), O("design:type", Number)], xa.prototype, "gap", void 0), k([_({ fallback: "#000000" }), O("design:type", String)], xa.prototype, "color", void 0), xa = k([x("AudioWaveform"), O("design:paramtypes", [typeof (ba = typeof Partial < "u" && Partial) == "function" ? ba : Object])], xa);
8060
+ k([_(), O("design:type", Object)], Ca.prototype, "src", void 0), k([_({ fallback: 0 }), O("design:type", Number)], Ca.prototype, "gap", void 0), k([_({ fallback: "#000000" }), O("design:type", String)], Ca.prototype, "color", void 0), Ca = k([x("AudioWaveform"), O("design:paramtypes", [typeof (Sa = typeof Partial < "u" && Partial) == "function" ? Sa : Object])], Ca);
8004
8061
  //#endregion
8005
8062
  //#region src/scene/transitions/KawaseTransition.ts
8006
- var Sa, Ca = class extends yr {
8063
+ var wa, Ta = class extends br {
8007
8064
  static {
8008
- Sa = this;
8065
+ wa = this;
8009
8066
  }
8010
8067
  blur = 10;
8011
8068
  quality = 10;
@@ -8024,7 +8081,7 @@ var Sa, Ca = class extends yr {
8024
8081
  let d = 1 / s, f = 1 / c, p = [], m, h = o - 1;
8025
8082
  for (let e = 0; e < h; e++) m = u[e] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p });
8026
8083
  m = u[h] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p }), l.forEach((t) => {
8027
- L.draw(e, Sa.material, {
8084
+ L.draw(e, wa.material, {
8028
8085
  sampler: r,
8029
8086
  progress: i,
8030
8087
  ...t
@@ -8032,31 +8089,31 @@ var Sa, Ca = class extends yr {
8032
8089
  });
8033
8090
  }
8034
8091
  };
8035
- Ca = Sa = k([x("KawaseTransition")], Ca);
8092
+ Ta = wa = k([x("KawaseTransition")], Ta);
8036
8093
  //#endregion
8037
8094
  //#region src/scene/transitions/LeftEraseTransition.ts
8038
- var wa, Ta = class extends yr {
8095
+ var Ea, Da = class extends br {
8039
8096
  static {
8040
- wa = this;
8097
+ Ea = this;
8041
8098
  }
8042
8099
  static material = new I({ gl: {
8043
8100
  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}",
8044
8101
  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}"
8045
8102
  } });
8046
8103
  apply(e) {
8047
- L.draw(e, wa.material, {
8104
+ L.draw(e, Ea.material, {
8048
8105
  previous: 0,
8049
8106
  next: 1,
8050
8107
  progress: this.currentTimeProgress
8051
8108
  });
8052
8109
  }
8053
8110
  };
8054
- Ta = wa = k([x("LeftEraseTransition")], Ta);
8111
+ Da = Ea = k([x("LeftEraseTransition")], Da);
8055
8112
  //#endregion
8056
8113
  //#region src/scene/transitions/TiltShiftTransition.ts
8057
- var Ea, Da = class extends yr {
8114
+ var Oa, ka = class extends br {
8058
8115
  static {
8059
- Ea = this;
8116
+ Oa = this;
8060
8117
  }
8061
8118
  blur = 100;
8062
8119
  gradientBlur = 600;
@@ -8068,7 +8125,7 @@ var Ea, Da = class extends yr {
8068
8125
  let n = this.currentTimeProgress, r, i;
8069
8126
  n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
8070
8127
  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);
8071
- L.draw(e, Ea.material, {
8128
+ L.draw(e, Oa.material, {
8072
8129
  sampler: r,
8073
8130
  progress: i,
8074
8131
  blur: this.blur,
@@ -8077,7 +8134,7 @@ var Ea, Da = class extends yr {
8077
8134
  end: c,
8078
8135
  delta: [u / f, d / f],
8079
8136
  texSize: l
8080
- }), L.draw(e, Ea.material, {
8137
+ }), L.draw(e, Oa.material, {
8081
8138
  sampler: r,
8082
8139
  progress: i,
8083
8140
  blur: this.blur,
@@ -8089,12 +8146,12 @@ var Ea, Da = class extends yr {
8089
8146
  });
8090
8147
  }
8091
8148
  };
8092
- Da = Ea = k([x("TiltShiftTransition")], Da);
8149
+ ka = Oa = k([x("TiltShiftTransition")], ka);
8093
8150
  //#endregion
8094
8151
  //#region src/scene/transitions/TwistTransition.ts
8095
- var Oa, ka = class extends yr {
8152
+ var Aa, ja = class extends br {
8096
8153
  static {
8097
- Oa = this;
8154
+ Aa = this;
8098
8155
  }
8099
8156
  radius;
8100
8157
  angle = 4;
@@ -8108,7 +8165,7 @@ var Oa, ka = class extends yr {
8108
8165
  let n = this.currentTimeProgress, r, i;
8109
8166
  n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
8110
8167
  let a = t.width, o = t.height;
8111
- L.draw(e, Oa.material, {
8168
+ L.draw(e, Aa.material, {
8112
8169
  sampler: r,
8113
8170
  progress: i,
8114
8171
  filterArea: [
@@ -8124,16 +8181,16 @@ var Oa, ka = class extends yr {
8124
8181
  });
8125
8182
  }
8126
8183
  };
8127
- ka = Oa = k([x("TwistTransition")], ka);
8184
+ ja = Aa = k([x("TwistTransition")], ja);
8128
8185
  //#endregion
8129
8186
  //#region src/asset/loaders/GifLoader.ts
8130
- var Aa = class extends kn {
8187
+ var Ma = class extends An {
8131
8188
  install(e) {
8132
8189
  let t = async (t) => {
8133
8190
  let { decodeFrames: n } = await import("modern-gif");
8134
- return await t.arrayBuffer().then((t) => n(t, e.gifWorkerUrl ? { workerUrl: e.gifWorkerUrl } : void 0)).then((e) => new qn(e.map((e) => ({
8191
+ return await t.arrayBuffer().then((t) => n(t, e.gifWorkerUrl ? { workerUrl: e.gifWorkerUrl } : void 0)).then((e) => new Jn(e.map((e) => ({
8135
8192
  duration: e.delay,
8136
- texture: new Zn({
8193
+ texture: new Qn({
8137
8194
  source: e.data,
8138
8195
  width: e.width,
8139
8196
  height: e.height
@@ -8144,14 +8201,14 @@ var Aa = class extends kn {
8144
8201
  e.register(n, t);
8145
8202
  }), e.gif = this, this;
8146
8203
  }
8147
- }, ja = class extends kn {
8204
+ }, Na = class extends An {
8148
8205
  install(e) {
8149
8206
  let t = async (e) => JSON.parse(await e.text());
8150
8207
  return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), ["application/json"].forEach((n) => {
8151
8208
  e.register(n, t);
8152
8209
  }), e.json = this, this;
8153
8210
  }
8154
- }, Ma = class extends kn {
8211
+ }, Pa = class extends An {
8155
8212
  install(e) {
8156
8213
  return this.load = async (t, n) => (await import("lottie-web").then((e) => e.default)).loadAnimation({
8157
8214
  container: null,
@@ -8162,12 +8219,12 @@ var Aa = class extends kn {
8162
8219
  animationData: await e.loadBy(t, () => e.fetch(t).then((e) => e.json()))
8163
8220
  }), e.lottie = this, this;
8164
8221
  }
8165
- }, Na = class extends kn {
8222
+ }, Fa = class extends An {
8166
8223
  install(e) {
8167
8224
  let t = async (e) => e.text();
8168
8225
  return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), e.text = this, this;
8169
8226
  }
8170
- }, Pa = class extends kn {
8227
+ }, Ia = class extends An {
8171
8228
  install(e) {
8172
8229
  let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new z({
8173
8230
  source: e,
@@ -8191,11 +8248,11 @@ var Aa = class extends kn {
8191
8248
  e.register(n, t);
8192
8249
  }), e.texture = this, this;
8193
8250
  }
8194
- }, Fa = class extends kn {
8251
+ }, La = class extends An {
8195
8252
  install(e) {
8196
- return this.load = (e) => new $n(e).load(), e.video = this, this;
8253
+ return this.load = (e) => new er(e).load(), e.video = this, this;
8197
8254
  }
8198
- }, Ia = Object.entries({
8255
+ }, Ra = Object.entries({
8199
8256
  "font/woff": ["woff"],
8200
8257
  "font/ttf": ["ttf"],
8201
8258
  "font/otf": ["otf"],
@@ -8211,31 +8268,31 @@ var Aa = class extends kn {
8211
8268
  "image/webp": ["webp"],
8212
8269
  "application/json": ["json"]
8213
8270
  });
8214
- function La(e) {
8215
- for (let [t, n] of Ia) if (n.includes(e)) return t;
8271
+ function za(e) {
8272
+ for (let [t, n] of Ra) if (n.includes(e)) return t;
8216
8273
  }
8217
- function Ra(e) {
8274
+ function Ba(e) {
8218
8275
  let t;
8219
8276
  if (e.startsWith("data:")) t = e.match(/^data:(.+?);/)?.[1];
8220
8277
  else if (e.startsWith("http")) {
8221
8278
  let n = e.split(/[#?]/)[0].split(".").pop()?.trim();
8222
- n && (t = La(n));
8279
+ n && (t = za(n));
8223
8280
  }
8224
8281
  return t;
8225
8282
  }
8226
8283
  //#endregion
8227
8284
  //#region src/asset/Assets.ts
8228
- var za = "WeakRef" in globalThis, Ba = class extends e {
8285
+ var Va = "WeakRef" in globalThis, Ha = class extends e {
8229
8286
  defaultHandler = (e) => e;
8230
8287
  _handlers = /* @__PURE__ */ new Map();
8231
8288
  _handleing = /* @__PURE__ */ new Map();
8232
8289
  _handled = /* @__PURE__ */ new Map();
8233
- _gc = za ? new FinalizationRegistry((e) => {
8290
+ _gc = Va ? new FinalizationRegistry((e) => {
8234
8291
  let t = this.get(e);
8235
8292
  t && "destroy" in t && t.destroy(), this._handled.delete(e);
8236
8293
  }) : void 0;
8237
8294
  constructor() {
8238
- super(), za || S.on(this.gc.bind(this), { sort: 2 });
8295
+ super(), Va || S.on(this.gc.bind(this), { sort: 2 });
8239
8296
  }
8240
8297
  use(e) {
8241
8298
  return e.install(this), this;
@@ -8279,11 +8336,11 @@ var za = "WeakRef" in globalThis, Ba = class extends e {
8279
8336
  }
8280
8337
  get(e) {
8281
8338
  let t = this._handled.get(e);
8282
- return za && t instanceof WeakRef && (t = t.deref(), t || this._handleing.delete(e)), t;
8339
+ return Va && t instanceof WeakRef && (t = t.deref(), t || this._handleing.delete(e)), t;
8283
8340
  }
8284
8341
  set(e, t) {
8285
8342
  let n = t;
8286
- za && typeof t == "object" && (this._gc.register(t, e), n = new WeakRef(t)), this._handled.set(e, n);
8343
+ Va && typeof t == "object" && (this._gc.register(t, e), n = new WeakRef(t)), this._handled.set(e, n);
8287
8344
  }
8288
8345
  async awaitBy(e) {
8289
8346
  let t = e(), n = c();
@@ -8298,7 +8355,7 @@ var za = "WeakRef" in globalThis, Ba = class extends e {
8298
8355
  return this._handleing.set(e, r), r;
8299
8356
  }
8300
8357
  async load(e, t) {
8301
- let n = await this.loadBy(e), r = Ra(e);
8358
+ let n = await this.loadBy(e), r = Ba(e);
8302
8359
  return r === void 0 && (r = n.type?.split(";")[0] ?? void 0), ((r ? this._handlers.get(r) : void 0) ?? this.defaultHandler)(n, t);
8303
8360
  }
8304
8361
  async waitUntilLoad() {
@@ -8312,14 +8369,14 @@ var za = "WeakRef" in globalThis, Ba = class extends e {
8312
8369
  n && "destroy" in n && n.destroy();
8313
8370
  }), this._handled.clear();
8314
8371
  }
8315
- }, $ = new Ba().use(new An()).use(new Aa()).use(new ja()).use(new Ma()).use(new Na()).use(new Pa()).use(new Fa()), Va = {
8372
+ }, $ = new Ha().use(new jn()).use(new Ma()).use(new Na()).use(new Pa()).use(new Fa()).use(new Ia()).use(new La()), Ua = {
8316
8373
  alpha: !0,
8317
8374
  stencil: !0,
8318
8375
  antialias: !1,
8319
8376
  premultipliedAlpha: !0,
8320
8377
  preserveDrawingBuffer: !1,
8321
8378
  powerPreference: "default"
8322
- }, Ha = class extends _r {
8379
+ }, Wa = class extends vr {
8323
8380
  renderer;
8324
8381
  get view() {
8325
8382
  return this.renderer.view;
@@ -8342,7 +8399,7 @@ var za = "WeakRef" in globalThis, Ba = class extends e {
8342
8399
  set pixelRatio(e) {
8343
8400
  this.renderer.pixelRatio = e, this.resize(this.width, this.height);
8344
8401
  }
8345
- _resizeObserver = ke ? new ResizeObserver((e) => {
8402
+ _resizeObserver = Ae ? new ResizeObserver((e) => {
8346
8403
  let t = e[0];
8347
8404
  if (t.target === this.view) {
8348
8405
  let { inlineSize: e, blockSize: n } = Array.isArray(t.contentBoxSize) ? t.contentBoxSize[0] : t.contentBoxSize;
@@ -8350,14 +8407,14 @@ var za = "WeakRef" in globalThis, Ba = class extends e {
8350
8407
  }
8351
8408
  }) : void 0;
8352
8409
  constructor(e = {}) {
8353
- let { view: t, width: n, height: r, pixelRatio: i = He, autoResize: a, data: o } = e;
8354
- super(), this.renderer = new On(t, {
8355
- alpha: Va.alpha ?? e.alpha,
8356
- stencil: Va.stencil ?? e.stencil,
8357
- antialias: Va.antialias ?? e.antialias,
8358
- premultipliedAlpha: Va.premultipliedAlpha ?? e.premultipliedAlpha,
8359
- preserveDrawingBuffer: Va.preserveDrawingBuffer ?? e.preserveDrawingBuffer,
8360
- powerPreference: Va.powerPreference ?? e.powerPreference
8410
+ let { view: t, width: n, height: r, pixelRatio: i = We, autoResize: a, data: o } = e;
8411
+ super(), this.renderer = new kn(t, {
8412
+ alpha: Ua.alpha ?? e.alpha,
8413
+ stencil: Ua.stencil ?? e.stencil,
8414
+ antialias: Ua.antialias ?? e.antialias,
8415
+ premultipliedAlpha: Ua.premultipliedAlpha ?? e.premultipliedAlpha,
8416
+ preserveDrawingBuffer: Ua.preserveDrawingBuffer ?? e.preserveDrawingBuffer,
8417
+ powerPreference: Ua.powerPreference ?? e.powerPreference
8361
8418
  }), this._setupInput(), this.pixelRatio = i, a ? !t && this.renderer.view && (this.renderer.view.style.width = "100%", this.renderer.view.style.height = "100%") : this.resize(n || this.gl.drawingBufferWidth || this.view?.clientWidth || 200, r || this.gl.drawingBufferHeight || this.view?.clientHeight || 200, !t), this.setProperties(e), o && this.root.append(o);
8362
8419
  }
8363
8420
  _updateProperty(e, t, n) {
@@ -8390,7 +8447,7 @@ var za = "WeakRef" in globalThis, Ba = class extends e {
8390
8447
  return this.renderer.resize(e, t, n), this.root.width = e, this.root.height = t, this.render(), this;
8391
8448
  }
8392
8449
  nextTick() {
8393
- return he();
8450
+ return ge();
8394
8451
  }
8395
8452
  async waitUntilLoad() {
8396
8453
  await $.waitUntilLoad(), await this.nextTick();
@@ -8441,22 +8498,22 @@ var za = "WeakRef" in globalThis, Ba = class extends e {
8441
8498
  super._destroy(), this._resizeObserver?.disconnect(), this.renderer.destroy();
8442
8499
  }
8443
8500
  };
8444
- k([_({ fallback: !1 }), O("design:type", Boolean)], Ha.prototype, "autoResize", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Ha.prototype, "autoStart", void 0);
8501
+ k([_({ fallback: !1 }), O("design:type", Boolean)], Wa.prototype, "autoResize", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Wa.prototype, "autoStart", void 0);
8445
8502
  //#endregion
8446
8503
  //#region src/render.ts
8447
- var Ua, Wa = [], Ga = !1;
8448
- function Ka() {
8449
- return Ua ??= new Ha({
8504
+ var Ga, Ka = [], qa = !1;
8505
+ function Ja() {
8506
+ return Ga ??= new Wa({
8450
8507
  pixelRatio: 1,
8451
8508
  width: 1,
8452
8509
  height: 1,
8453
8510
  preserveDrawingBuffer: !0
8454
8511
  });
8455
8512
  }
8456
- async function qa(e = 100) {
8457
- if (!Ga) {
8458
- for (Ga = !0; Wa.length;) {
8459
- let t = Wa.shift();
8513
+ async function Ya(e = 100) {
8514
+ if (!qa) {
8515
+ for (qa = !0; Ka.length;) {
8516
+ let t = Ka.shift();
8460
8517
  if (t) try {
8461
8518
  await t();
8462
8519
  } catch (e) {
@@ -8464,11 +8521,11 @@ async function qa(e = 100) {
8464
8521
  }
8465
8522
  else await new Promise((t) => setTimeout(t, e));
8466
8523
  }
8467
- Ga = !1;
8524
+ qa = !1;
8468
8525
  }
8469
8526
  }
8470
- async function Ja(e) {
8471
- let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], onBefore: s, onKeyframe: c, ...l } = e, u = Math.floor(r), d = Math.floor(i), f = Ka();
8527
+ async function Xa(e) {
8528
+ let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], onBefore: s, onKeyframe: c, ...l } = e, u = Math.floor(r), d = Math.floor(i), f = Ja();
8472
8529
  f.resetProperties(), f.setProperties(l), f.debug = t, f.fonts = n, f.timeline.currentTime = 0, f.resize(u, d, !0), f.root.removeChildren(!0), f.root.append(a), await s?.(f), await f.waitAndRender(), o.length && await new Promise((e) => {
8473
8530
  let t = 0, n = o.length, r = o[n - 1];
8474
8531
  async function i() {
@@ -8488,15 +8545,15 @@ async function Ja(e) {
8488
8545
  toCanvas2D: () => f.toCanvas2D(new ImageData(p, u, d))
8489
8546
  };
8490
8547
  }
8491
- async function Ya(e) {
8548
+ async function Za(e) {
8492
8549
  return new Promise((t) => {
8493
- Wa.push(async () => t(await Ja(e).then((e) => e.toCanvas2D()))), qa();
8550
+ Ka.push(async () => t(await Xa(e).then((e) => e.toCanvas2D()))), Ya();
8494
8551
  });
8495
8552
  }
8496
- async function Xa(e) {
8553
+ async function Qa(e) {
8497
8554
  return new Promise((t) => {
8498
- Wa.push(async () => t(await Ja(e).then((e) => e.pixels))), qa();
8555
+ Ka.push(async () => t(await Xa(e).then((e) => e.pixels))), Ya();
8499
8556
  });
8500
8557
  }
8501
8558
  //#endregion
8502
- export { st as Aabb2D, qn as AnimatedTexture, oa as Animation, Ba as Assets, va as Audio, ua as AudioPipeline, da as AudioProcessor, ya as AudioSpectrum, xa as AudioWaveform, A as BufferUsage, Cr as Camera2D, tr as CanvasContext, ur as CanvasItem, Jn as CanvasTexture, E as Color, W as ColorAdjustEffect, jr as ColorFilterEffect, dt as ColorMatrix, Fr as ColorOverlayEffect, Rr as ColorRemoveEffect, Hr as ColorReplaceEffect, Yn as ColorTexture, w as CoreObject, ct as DEG_TO_RAD, He as DEVICE_PIXEL_RATIO, G as DrawboardEffect, Qr as DropShadowEffect, U as Effect, Wn as EffectMaterial, Gi as Element2D, wi as Element2DBackground, Y as Element2DFill, Ti as Element2DForeground, Ei as Element2DOutline, Di as Element2DShadow, Oi as Element2DShape, ki as Element2DStyle, X as Element2DText, ti as EmbossEffect, Ha as Engine, Vi as Flexbox, An as FontLoader, Yr as GaussianBlurEffect, Fn as Geometry, Aa as GifLoader, Xt as GlBatch2DSystem, Kt as GlBlendMode, gt as GlBuffer, St as GlBufferSystem, ht as GlBufferTarget, en as GlMaskSystem, Pt as GlProgram, an as GlRenderTarget, on as GlRenderTargetSystem, Gt as GlShaderSystem, Jt as GlState, Yt as GlStateSystem, nn as GlStencilSystem, j as GlSystem, rn as GlViewportSystem, K as GlitchEffect, q as GodrayEffect, Xn as GradientTexture, la as HTMLAudio, sa as HTMLAudioContext, ca as HTMLSound, Be as IN_BROWSER, Ve as IN_MAC_OS, Mn as IndexBuffer, at as Input, $e as InputEvent, ja as JsonLoader, ui as KawaseBlurEffect, Ca as KawaseTransition, et as KeyboardInputEvent, Ta as LeftEraseTransition, kn as Loader, Ji as Lottie2D, Ma as LottieLoader, mt as MainLoop, pi as MaskEffect, I as Material, rr as Meta, tt as MouseInputEvent, B as Node, xr as Node2D, ft as Obb2D, J as OutlineEffect, ge as PI, _e as PI_2, yi as PixelateEffect, Zn as PixelsTexture, nt as PointerInputEvent, pt as Projection2D, Rn as QuadGeometry, L as QuadUvGeometry, lt as RAD_TO_DEG, ot as RefCounted, R as RenderTarget, vt as Renderer, T as Resource, Fe as SUPPORTS_AUDIO_CONTEXT, Ne as SUPPORTS_CLICK_EVENTS, Pe as SUPPORTS_CREATE_IMAGE_BITMAP, Oe as SUPPORTS_IMAGE_BITMAP, Me as SUPPORTS_MOUSE_EVENTS, Le as SUPPORTS_OFFLINE_AUDIO_CONTEXT, Ae as SUPPORTS_POINTER_EVENTS, ke as SUPPORTS_RESIZE_OBSERVER, C as SUPPORTS_TOUCH_EVENTS, De as SUPPORTS_WEBGL2, Ie as SUPPORTS_WEBKIT_AUDIO_CONTEXT, Re as SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, ze as SUPPORTS_WEB_AUDIO, je as SUPPORTS_WHEEL_EVENTS, _r as SceneTree, Na as TextLoader, z as Texture2D, Pa as TextureLoader, Ki as TextureRect2D, S as Ticker, Da as TiltShiftTransition, hr as Timeline, V as TimelineNode, Yi as TransformRect2D, yr as Transition, ka as TwistTransition, Kn as UvGeometry, Gn as UvMaterial, F as VertexAttribute, P as VertexBuffer, Zi as Video2D, Fa as VideoLoader, $n as VideoTexture, H as Viewport, er as ViewportTexture, ga as WebAudio, ma as WebAudioContext, On as WebGLRenderer, ha as WebSound, rt as WheelInputEvent, gr as Window, Si as ZoomBlurEffect, Q as alignMap, $ as assets, Bi as boxSizingMap, ut as clamp, li as clampFrag, Je as createHTMLCanvas, xt as createIdFromString, me as createNode, Xe as crossOrigin, ia as cubicBezier, x as customNode, pe as customNodes, Va as defaultOptions, Ye as determineCrossOrigin, Pi as directionMap, Ni as displayMap, ea as ease, ta as easeIn, ra as easeInOut, na as easeOut, Z as edgeMap, Fi as flexDirectionMap, Ii as flexWrapMap, ci as frag, Se as getDefaultCssPropertyValue, Ka as getRenderEngine, Mi as gutterMap, Qe as instanceId, Ke as isCanvasElement, Ue as isElementNode, Ge as isImageElement, ve as isPow2, We as isVideoElement, qe as isWebgl2, Li as justifyMap, D as lerp, $i as linear, Qt as log2, qt as mapGlBlendModes, Zt as nextPow2, he as nextTick, Ri as overflowMap, Tr as parseCssFilter, we as parseCssFunctions, Ce as parseCssProperty, Er as parseCssTransformOrigin, zi as positionTypeMap, Ya as render, Xa as renderPixels, tn as stencilModeMap, aa as timingFunctions };
8559
+ export { lt as Aabb2D, Jn as AnimatedTexture, ca as Animation, Ha as Assets, ba as Audio, fa as AudioPipeline, pa as AudioProcessor, xa as AudioSpectrum, Ca as AudioWaveform, A as BufferUsage, wr as Camera2D, nr as CanvasContext, dr as CanvasItem, Yn as CanvasTexture, T as Color, W as ColorAdjustEffect, Mr as ColorFilterEffect, ft as ColorMatrix, Ir as ColorOverlayEffect, zr as ColorRemoveEffect, Ur as ColorReplaceEffect, Xn as ColorTexture, C as CoreObject, ut as DEG_TO_RAD, We as DEVICE_PIXEL_RATIO, G as DrawboardEffect, $r as DropShadowEffect, U as Effect, Gn as EffectMaterial, qi as Element2D, Ti as Element2DBackground, Ei as Element2DConnection, Y as Element2DFill, Di as Element2DForeground, Oi as Element2DOutline, ki as Element2DShadow, Ai as Element2DShape, ji as Element2DStyle, X as Element2DText, ni as EmbossEffect, Wa as Engine, Ui as Flexbox, jn as FontLoader, Xr as GaussianBlurEffect, In as Geometry, Ma as GifLoader, Zt as GlBatch2DSystem, qt as GlBlendMode, _t as GlBuffer, Ct as GlBufferSystem, gt as GlBufferTarget, tn as GlMaskSystem, Ft as GlProgram, on as GlRenderTarget, sn as GlRenderTargetSystem, Kt as GlShaderSystem, Yt as GlState, Xt as GlStateSystem, rn as GlStencilSystem, j as GlSystem, an as GlViewportSystem, K as GlitchEffect, q as GodrayEffect, Zn as GradientTexture, da as HTMLAudio, la as HTMLAudioContext, ua as HTMLSound, He as IN_BROWSER, Ue as IN_MAC_OS, Nn as IndexBuffer, st as Input, tt as InputEvent, Na as JsonLoader, di as KawaseBlurEffect, Ta as KawaseTransition, nt as KeyboardInputEvent, Da as LeftEraseTransition, An as Loader, Xi as Lottie2D, Pa as LottieLoader, ht as MainLoop, mi as MaskEffect, I as Material, ir as Meta, rt as MouseInputEvent, B as Node, Sr as Node2D, pt as Obb2D, J as OutlineEffect, _e as PI, ve as PI_2, bi as PixelateEffect, Qn as PixelsTexture, it as PointerInputEvent, mt as Projection2D, zn as QuadGeometry, L as QuadUvGeometry, dt as RAD_TO_DEG, ct as RefCounted, R as RenderTarget, yt as Renderer, w as Resource, Le as SUPPORTS_AUDIO_CONTEXT, Fe as SUPPORTS_CLICK_EVENTS, Ie as SUPPORTS_CREATE_IMAGE_BITMAP, ke as SUPPORTS_IMAGE_BITMAP, Ne as SUPPORTS_MOUSE_EVENTS, ze as SUPPORTS_OFFLINE_AUDIO_CONTEXT, je as SUPPORTS_POINTER_EVENTS, Ae as SUPPORTS_RESIZE_OBSERVER, Pe as SUPPORTS_TOUCH_EVENTS, Oe as SUPPORTS_WEBGL2, Re as SUPPORTS_WEBKIT_AUDIO_CONTEXT, Be as SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, Ve as SUPPORTS_WEB_AUDIO, Me as SUPPORTS_WHEEL_EVENTS, vr as SceneTree, Fa as TextLoader, z as Texture2D, Ia as TextureLoader, Ji as TextureRect2D, S as Ticker, ka as TiltShiftTransition, gr as Timeline, V as TimelineNode, Zi as TransformRect2D, br as Transition, ja as TwistTransition, qn as UvGeometry, Kn as UvMaterial, F as VertexAttribute, P as VertexBuffer, $i as Video2D, La as VideoLoader, er as VideoTexture, H as Viewport, tr as ViewportTexture, va as WebAudio, ga as WebAudioContext, kn as WebGLRenderer, _a as WebSound, at as WheelInputEvent, _r as Window, Ci as ZoomBlurEffect, Q as alignMap, $ as assets, Hi as boxSizingMap, E as clamp, ui as clampFrag, Xe as createHTMLCanvas, St as createIdFromString, he as createNode, Qe as crossOrigin, oa as cubicBezier, x as customNode, me as customNodes, Ua as defaultOptions, Ze as determineCrossOrigin, Ii as directionMap, Fi as displayMap, na as ease, ra as easeIn, aa as easeInOut, ia as easeOut, Z as edgeMap, Li as flexDirectionMap, Ri as flexWrapMap, li as frag, Ce as getDefaultCssPropertyValue, Ja as getRenderEngine, Pi as gutterMap, et as instanceId, Je as isCanvasElement, Ge as isElementNode, qe as isImageElement, ye as isPow2, Ke as isVideoElement, Ye as isWebgl2, zi as justifyMap, D as lerp, ta as linear, $t as log2, Jt as mapGlBlendModes, Qt as nextPow2, ge as nextTick, Bi as overflowMap, Er as parseCssFilter, Te as parseCssFunctions, we as parseCssProperty, Dr as parseCssTransformOrigin, Vi as positionTypeMap, Za as render, Qa as renderPixels, nn as stencilModeMap, sa as timingFunctions };