wuepgg3-track 3.0.3 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/dist/{SharedSystems-Czb8QUFv.mjs → SharedSystems-CQUTbUIx.mjs} +675 -433
  2. package/dist/{WebGLRenderer-Bd4vvqtJ.mjs → WebGLRenderer-zlVosyby.mjs} +417 -382
  3. package/dist/{WebGPURenderer-CVU5sf4P.mjs → WebGPURenderer-OAybUJeH.mjs} +277 -258
  4. package/dist/{browserAll-CZ03TD2_.mjs → browserAll-Byje74wY.mjs} +2 -2
  5. package/dist/{colorToUniform-BwrjBKZW.mjs → colorToUniform-COOzkdM9.mjs} +9 -8
  6. package/dist/components/GenomeView/TrackComponents/BamComponents/BamAnnotation.d.ts +1 -1
  7. package/dist/components/GenomeView/TrackComponents/CategoricalComponents/CategoricalAnnotation.d.ts +1 -1
  8. package/dist/components/GenomeView/TrackComponents/DynseqComponents/DynseqTrackComponents.d.ts +2 -3
  9. package/dist/components/GenomeView/TrackComponents/GenomeAlignComponents/GenomeAlignComponents.d.ts +3 -1
  10. package/dist/components/GenomeView/TrackComponents/GenomeAlignComponents/HorizontalFragment.d.ts +1 -0
  11. package/dist/components/GenomeView/TrackComponents/GenomeAlignComponents/MultiAlignmentViewCalculator.d.ts +1 -0
  12. package/dist/components/GenomeView/TrackComponents/GroupedTrackManager.d.ts +3 -0
  13. package/dist/components/GenomeView/TrackComponents/InteractionComponents/InteractionTrackComponent.d.ts +4 -15
  14. package/dist/components/GenomeView/TrackComponents/MethylcComponents/MethylCTrackComputation.d.ts +5 -13
  15. package/dist/components/GenomeView/TrackComponents/QBedComponents/QBedTrackComponents.d.ts +9 -26
  16. package/dist/components/GenomeView/TrackComponents/RulerComponents/Ruler.d.ts +1 -1
  17. package/dist/components/GenomeView/TrackComponents/VcfComponents/Vcf.d.ts +1 -0
  18. package/dist/components/GenomeView/TrackComponents/VcfComponents/VcfTrack.d.ts +5 -24
  19. package/dist/components/GenomeView/TrackComponents/bedComponents/FiberTrackComponent.d.ts +5 -39
  20. package/dist/components/GenomeView/TrackComponents/commonComponents/HoverToolTips/HoverToolTip.d.ts +5 -0
  21. package/dist/components/GenomeView/TrackComponents/commonComponents/OutsideClickDetector.d.ts +1 -1
  22. package/dist/components/GenomeView/TrackComponents/commonComponents/TrackLegend.d.ts +1 -1
  23. package/dist/components/GenomeView/TrackComponents/commonComponents/annotation/AnnotationArrows.d.ts +1 -1
  24. package/dist/components/GenomeView/TrackComponents/commonComponents/numerical/NumericalAggregator.d.ts +2 -1
  25. package/dist/components/GenomeView/TrackComponents/commonComponents/numerical/NumericalTrack.d.ts +3 -1
  26. package/dist/components/GenomeView/TrackComponents/commonComponents/stats/BoxplotTrackComponents.d.ts +3 -37
  27. package/dist/components/GenomeView/TrackComponents/displayModeComponentMap.d.ts +1 -1
  28. package/dist/components/GenomeView/TrackComponents/geneAnnotationTrackComponents/BackgroundedText.d.ts +1 -1
  29. package/dist/components/GenomeView/TrackComponents/geneAnnotationTrackComponents/GeneDetail.d.ts +2 -2
  30. package/dist/components/GenomeView/genomeNavigator/Ruler.d.ts +1 -1
  31. package/dist/components/GenomeView/genomeNavigator/SelectableGenomeArea.d.ts +1 -1
  32. package/dist/components/GenomeView/genomeNavigator/SelectedRegionBox.d.ts +1 -1
  33. package/dist/genome-hub/GenomeSerializer.d.ts +1 -1
  34. package/dist/genome-hub/genome-schema.d.ts +1 -2
  35. package/dist/getLocalData/LocalBigSource.d.ts +47 -0
  36. package/dist/getRemoteData/BigSourceWorker.d.ts +47 -0
  37. package/dist/getRemoteData/BigSourceWorkerGmod.d.ts +14 -5
  38. package/dist/getRemoteData/VcfSource.d.ts +9 -0
  39. package/dist/getRemoteData/hicSource.d.ts +1 -1
  40. package/dist/getRemoteData/io/remoteFile.d.ts +1 -1
  41. package/dist/getRemoteData/tabixSource.d.ts +18 -0
  42. package/dist/getRemoteData/vendor/bbi-js/main/bigwig.d.ts +1 -0
  43. package/dist/getRemoteData/vendor/bbi-js/utils/bin.d.ts +20 -0
  44. package/dist/getRemoteData/vendor/bbi-js/utils/das.d.ts +6 -0
  45. package/dist/getRemoteData/vendor/bbi-js/utils/jszlib.d.ts +1 -0
  46. package/dist/getRemoteData/vendor/bbi-js/utils/sha1.d.ts +1 -0
  47. package/dist/getRemoteData/vendor/bbi-js/utils/spans.d.ts +13 -0
  48. package/dist/{index-lRQCOP9E.mjs → index-BRD1ij9p.mjs} +64989 -66773
  49. package/dist/index.es.js +11 -11
  50. package/dist/index.umd.js +239 -228
  51. package/dist/{init-Bk9eSswv.mjs → init-DVJ9vOmS.mjs} +370 -355
  52. package/dist/models/AlignmentSegment.d.ts +1 -1
  53. package/dist/models/AlignmentStringUtils.d.ts +1 -1
  54. package/dist/models/BamAlignment.d.ts +1 -1
  55. package/dist/models/BedRecord.d.ts +1 -1
  56. package/dist/models/Chromosome.d.ts +1 -1
  57. package/dist/models/ChromosomeInterval.d.ts +1 -1
  58. package/dist/models/DisplayedRegionModel.d.ts +1 -1
  59. package/dist/models/Feature.d.ts +2 -2
  60. package/dist/models/FeatureAggregator.d.ts +4 -5
  61. package/dist/models/FeatureArranger.d.ts +7 -1
  62. package/dist/models/NavigationContext.d.ts +2 -1
  63. package/dist/models/OpenInterval.d.ts +1 -1
  64. package/dist/models/Snp.d.ts +1 -1
  65. package/dist/models/TrackModel.d.ts +3 -1
  66. package/dist/models/genomes/allGenomes.d.ts +20 -0
  67. package/dist/models/genomes/mCalJa1.2.pat.X/mCalJa1.2.pat.X.d.ts +17 -0
  68. package/dist/models/getXSpan/FeaturePlacer.d.ts +2 -9
  69. package/dist/models/trackModels/trackProps.d.ts +1 -0
  70. package/dist/style.css +1 -1
  71. package/dist/trackConfigs/config-menu-components.tsx/ColorConfig.d.ts +2 -1
  72. package/dist/trackConfigs/config-menu-components.tsx/DownsamplingConfig.d.ts +8 -0
  73. package/dist/trackConfigs/config-menu-components.tsx/NumberConfig.d.ts +1 -1
  74. package/dist/types/track-container.d.ts +1 -0
  75. package/dist/webworkerAll-I0QzCLqb.mjs +2 -0
  76. package/package.json +2 -4
  77. package/dist/components/GenomeView/TrackComponents/CommonTrackStateChangeFunctions.tsx/createNewTrackState.d.ts +0 -18
  78. package/dist/components/GenomeView/TrackComponents/CommonTrackStateChangeFunctions.tsx/getDataAfterConfigChange.d.ts +0 -11
  79. package/dist/components/GenomeView/TrackComponents/bedComponents/BedcolorTrack.d.ts +0 -6
  80. package/dist/components/GenomeView/TrackComponents/commonComponents/annotation/AnnotationTrack.d.ts +0 -25
  81. package/dist/components/GenomeView/TrackComponents/commonComponents/annotation/FullDisplayMode.d.ts +0 -45
  82. package/dist/components/testCustomGenome.d.ts +0 -505
  83. package/dist/getRemoteData/JasparSource.d.ts +0 -8
  84. package/dist/webworkerAll-D7VsNxkY.mjs +0 -2
@@ -1,6 +1,6 @@
1
- import { E as m, U as ct, T as de, b as dt, a2 as w, a3 as U, t as C, ac as he, Z as I, ad as D, O as ht, n as Y, ae as ft, af as fe, _ as Se, ag as W, ah as pt, ai as P, w as X, G as Pe, a as Fe, M as R, m as A, h as Be, F, a5 as ie, R as se, z as Re, d as O, B, D as ne, x as K, aj as gt, ak as ae, J as te, al as V, S as oe, o as Me, s as Ue, a7 as Ge, aa as ze, p as mt, q as xt, a8 as _t, a9 as yt, ab as bt, am as vt, an as Tt, ao as N, e as T, ap as wt } from "./index-lRQCOP9E.mjs";
2
- import { F as Ct, S as j, c as $, a as St, b as Pt, B as Ae } from "./colorToUniform-BwrjBKZW.mjs";
3
- class ke {
1
+ import { E as m, U as dt, T as he, b as ht, a3 as w, a4 as M, v as C, ad as fe, _ as W, ae as O, Q as ft, o as X, af as pt, ag as pe, $ as Pe, ah as E, ai as gt, aj as P, w as K, G as Fe, a as Be, M as R, n as k, i as Re, I as F, a6 as se, R as ne, H as Ue, h as I, B, D as ae, c as G, z as $, ak as mt, al as oe, L as re, am as L, S as ue, p as Me, t as Ge, a8 as ze, ab as Ae, q as xt, s as _t, a9 as yt, aa as bt, ac as vt, an as Tt, ao as wt, ap as q, e as T, aq as Ct } from "./index-BRD1ij9p.mjs";
2
+ import { F as St, S as j, c as N, a as Pt, b as Ft, B as ke } from "./colorToUniform-COOzkdM9.mjs";
3
+ class De {
4
4
  /**
5
5
  * Initialize the plugin with scope of application instance
6
6
  * @private
@@ -45,8 +45,8 @@ class ke {
45
45
  globalThis.removeEventListener("resize", this.queueResize), this._cancelResize(), this._cancelResize = null, this.queueResize = null, this.resizeTo = null, this.resize = null;
46
46
  }
47
47
  }
48
- ke.extension = m.Application;
49
- class De {
48
+ De.extension = m.Application;
49
+ class Oe {
50
50
  /**
51
51
  * Initialize the plugin with scope of application instance
52
52
  * @private
@@ -62,7 +62,7 @@ class De {
62
62
  {
63
63
  configurable: !0,
64
64
  set(t) {
65
- this._ticker && this._ticker.remove(this.render, this), this._ticker = t, t && t.add(this.render, this, ct.LOW);
65
+ this._ticker && this._ticker.remove(this.render, this), this._ticker = t, t && t.add(this.render, this, dt.LOW);
66
66
  },
67
67
  get() {
68
68
  return this._ticker;
@@ -72,7 +72,7 @@ class De {
72
72
  this._ticker.stop();
73
73
  }, this.start = () => {
74
74
  this._ticker.start();
75
- }, this._ticker = null, this.ticker = e.sharedTicker ? de.shared : new de(), e.autoStart && this.start();
75
+ }, this._ticker = null, this.ticker = e.sharedTicker ? he.shared : new he(), e.autoStart && this.start();
76
76
  }
77
77
  /**
78
78
  * Clean up the ticker, scoped to application.
@@ -85,8 +85,8 @@ class De {
85
85
  }
86
86
  }
87
87
  }
88
- De.extension = m.Application;
89
- class Ft extends dt {
88
+ Oe.extension = m.Application;
89
+ class Bt extends ht {
90
90
  constructor() {
91
91
  super(...arguments), this.chars = /* @__PURE__ */ Object.create(null), this.lineHeight = 0, this.fontFamily = "", this.fontMetrics = { fontSize: 0, ascent: 0, descent: 0 }, this.baseLineOffset = 0, this.distanceField = { type: "none", range: 0 }, this.pages = [], this.applyFillAsTint = !0, this.baseMeasurementFontSize = 100, this.baseRenderedFontSize = 100;
92
92
  }
@@ -95,35 +95,35 @@ class Ft extends dt {
95
95
  * @deprecated since 8.0.0 Use `fontFamily` instead.
96
96
  */
97
97
  get font() {
98
- return w(U, "BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."), this.fontFamily;
98
+ return w(M, "BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."), this.fontFamily;
99
99
  }
100
100
  /**
101
101
  * The map of base page textures (i.e., sheets of glyphs).
102
102
  * @deprecated since 8.0.0 Use `pages` instead.
103
103
  */
104
104
  get pageTextures() {
105
- return w(U, "BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."), this.pages;
105
+ return w(M, "BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."), this.pages;
106
106
  }
107
107
  /**
108
108
  * The size of the font face in pixels.
109
109
  * @deprecated since 8.0.0 Use `fontMetrics.fontSize` instead.
110
110
  */
111
111
  get size() {
112
- return w(U, "BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."), this.fontMetrics.fontSize;
112
+ return w(M, "BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."), this.fontMetrics.fontSize;
113
113
  }
114
114
  /**
115
115
  * The kind of distance field for this font or "none".
116
116
  * @deprecated since 8.0.0 Use `distanceField.type` instead.
117
117
  */
118
118
  get distanceFieldRange() {
119
- return w(U, "BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."), this.distanceField.range;
119
+ return w(M, "BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."), this.distanceField.range;
120
120
  }
121
121
  /**
122
122
  * The range of the distance field in pixels.
123
123
  * @deprecated since 8.0.0 Use `distanceField.range` instead.
124
124
  */
125
125
  get distanceFieldType() {
126
- return w(U, "BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."), this.distanceField.type;
126
+ return w(M, "BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."), this.distanceField.type;
127
127
  }
128
128
  destroy(e = !1) {
129
129
  var t;
@@ -133,24 +133,24 @@ class Ft extends dt {
133
133
  this.chars = null, e && (this.pages.forEach((r) => r.texture.destroy(!0)), this.pages = null);
134
134
  }
135
135
  }
136
- const Oe = class Ie extends Ft {
136
+ const Ie = class We extends Bt {
137
137
  /**
138
138
  * @param options - The options for the dynamic bitmap font.
139
139
  */
140
140
  constructor(e) {
141
141
  super(), this.resolution = 1, this.pages = [], this._padding = 0, this._measureCache = /* @__PURE__ */ Object.create(null), this._currentChars = [], this._currentX = 0, this._currentY = 0, this._currentMaxCharHeight = 0, this._currentPageIndex = -1, this._skipKerning = !1;
142
- const t = { ...Ie.defaultOptions, ...e };
142
+ const t = { ...We.defaultOptions, ...e };
143
143
  this._textureSize = t.textureSize, this._mipmap = t.mipmap;
144
144
  const r = t.style.clone();
145
145
  t.overrideFill && (r._fill.color = 16777215, r._fill.alpha = 1, r._fill.texture = C.WHITE, r._fill.fill = null), this.applyFillAsTint = t.overrideFill;
146
146
  const i = r.fontSize;
147
147
  r.fontSize = this.baseMeasurementFontSize;
148
- const s = he(r);
149
- t.overrideSize ? r._stroke && (r._stroke.width *= this.baseRenderedFontSize / i) : r.fontSize = this.baseRenderedFontSize = i, this._style = r, this._skipKerning = t.skipKerning ?? !1, this.resolution = t.resolution ?? 1, this._padding = t.padding ?? 4, t.textureStyle && (this._textureStyle = t.textureStyle instanceof I ? t.textureStyle : new I(t.textureStyle)), this.fontMetrics = D.measureFont(s), this.lineHeight = r.lineHeight || this.fontMetrics.fontSize || r.fontSize;
148
+ const s = fe(r);
149
+ t.overrideSize ? r._stroke && (r._stroke.width *= this.baseRenderedFontSize / i) : r.fontSize = this.baseRenderedFontSize = i, this._style = r, this._skipKerning = t.skipKerning ?? !1, this.resolution = t.resolution ?? 1, this._padding = t.padding ?? 4, t.textureStyle && (this._textureStyle = t.textureStyle instanceof W ? t.textureStyle : new W(t.textureStyle)), this.fontMetrics = O.measureFont(s), this.lineHeight = r.lineHeight || this.fontMetrics.fontSize || r.fontSize;
150
150
  }
151
151
  ensureCharacters(e) {
152
152
  var b, x;
153
- const t = D.graphemeSegmenter(e).filter((g) => !this._currentChars.includes(g)).filter((g, p, v) => v.indexOf(g) === p);
153
+ const t = O.graphemeSegmenter(e).filter((g) => !this._currentChars.includes(g)).filter((g, p, v) => v.indexOf(g) === p);
154
154
  if (!t.length)
155
155
  return;
156
156
  this._currentChars = [...this._currentChars, ...t];
@@ -163,21 +163,21 @@ const Oe = class Ie extends Ft {
163
163
  let f = !1;
164
164
  const y = i.width / this.resolution, _ = i.height / this.resolution;
165
165
  for (let g = 0; g < t.length; g++) {
166
- const p = t[g], v = D.measureText(p, a, i, !1);
166
+ const p = t[g], v = O.measureText(p, a, i, !1);
167
167
  v.lineHeight = v.height;
168
- const S = v.width * c, G = Math.ceil((a.fontStyle === "italic" ? 2 : 1) * S), k = v.height * c, M = G + h * 2, E = k + h * 2;
168
+ const S = v.width * c, z = Math.ceil((a.fontStyle === "italic" ? 2 : 1) * S), D = v.height * c, U = z + h * 2, V = D + h * 2;
169
169
  if (f = !1, p !== `
170
- ` && p !== "\r" && p !== " " && p !== " " && (f = !0, d = Math.ceil(Math.max(E, d))), u + M > y && (l += d, d = E, u = 0, l + d > _)) {
170
+ ` && p !== "\r" && p !== " " && p !== " " && (f = !0, d = Math.ceil(Math.max(V, d))), u + U > y && (l += d, d = V, u = 0, l + d > _)) {
171
171
  n.update();
172
- const z = this._nextPage();
173
- i = z.canvasAndContext.canvas, s = z.canvasAndContext.context, n = z.texture.source, u = 0, l = 0, d = 0;
172
+ const A = this._nextPage();
173
+ i = A.canvasAndContext.canvas, s = A.canvasAndContext.context, n = A.texture.source, u = 0, l = 0, d = 0;
174
174
  }
175
- const ut = S / c - (((b = a.dropShadow) == null ? void 0 : b.distance) ?? 0) - (((x = a._stroke) == null ? void 0 : x.width) ?? 0);
175
+ const lt = S / c - (((b = a.dropShadow) == null ? void 0 : b.distance) ?? 0) - (((x = a._stroke) == null ? void 0 : x.width) ?? 0);
176
176
  if (this.chars[p] = {
177
177
  id: p.codePointAt(0),
178
178
  xOffset: -this._padding,
179
179
  yOffset: -this._padding,
180
- xAdvance: ut,
180
+ xAdvance: lt,
181
181
  kerning: {}
182
182
  }, f) {
183
183
  this._drawGlyph(
@@ -188,16 +188,16 @@ const Oe = class Ie extends Ft {
188
188
  c,
189
189
  a
190
190
  );
191
- const z = n.width * c, ce = n.height * c, lt = new ht(
192
- u / z * n.width,
193
- l / ce * n.height,
194
- M / z * n.width,
195
- E / ce * n.height
191
+ const A = n.width * c, de = n.height * c, ct = new ft(
192
+ u / A * n.width,
193
+ l / de * n.height,
194
+ U / A * n.width,
195
+ V / de * n.height
196
196
  );
197
197
  this.chars[p].texture = new C({
198
198
  source: n,
199
- frame: lt
200
- }), u += Math.ceil(M);
199
+ frame: ct
200
+ }), u += Math.ceil(U);
201
201
  }
202
202
  }
203
203
  n.update(), this._currentX = u, this._currentY = l, this._currentMaxCharHeight = d, this._skipKerning && this._applyKerning(t, s);
@@ -207,7 +207,7 @@ const Oe = class Ie extends Ft {
207
207
  * The map of base page textures (i.e., sheets of glyphs).
208
208
  */
209
209
  get pageTextures() {
210
- return w(U, "BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."), this.pages;
210
+ return w(M, "BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."), this.pages;
211
211
  }
212
212
  _applyKerning(e, t) {
213
213
  const r = this._measureCache;
@@ -226,14 +226,14 @@ const Oe = class Ie extends Ft {
226
226
  }
227
227
  _nextPage() {
228
228
  this._currentPageIndex++;
229
- const e = this.resolution, t = Y.getOptimalCanvasAndContext(
229
+ const e = this.resolution, t = X.getOptimalCanvasAndContext(
230
230
  this._textureSize,
231
231
  this._textureSize,
232
232
  e
233
233
  );
234
234
  this._setupContext(t.context, this._style, e);
235
235
  const r = e * (this.baseRenderedFontSize / this.baseMeasurementFontSize), i = new C({
236
- source: new ft({
236
+ source: new pt({
237
237
  resource: t.canvas,
238
238
  resolution: r,
239
239
  alphaMode: "premultiply-alpha-on-upload",
@@ -249,10 +249,10 @@ const Oe = class Ie extends Ft {
249
249
  }
250
250
  // canvas style!
251
251
  _setupContext(e, t, r) {
252
- t.fontSize = this.baseRenderedFontSize, e.scale(r, r), e.font = he(t), t.fontSize = this.baseMeasurementFontSize, e.textBaseline = t.textBaseline;
252
+ t.fontSize = this.baseRenderedFontSize, e.scale(r, r), e.font = fe(t), t.fontSize = this.baseMeasurementFontSize, e.textBaseline = t.textBaseline;
253
253
  const i = t._stroke, s = (i == null ? void 0 : i.width) ?? 0;
254
- if (i && (e.lineWidth = s, e.lineJoin = i.join, e.miterLimit = i.miterLimit, e.strokeStyle = fe(i, e)), t._fill && (e.fillStyle = fe(t._fill, e)), t.dropShadow) {
255
- const n = t.dropShadow, a = Se.shared.setValue(n.color).toArray(), u = n.blur * r, l = n.distance * r;
254
+ if (i && (e.lineWidth = s, e.lineJoin = i.join, e.miterLimit = i.miterLimit, e.strokeStyle = pe(i, e)), t._fill && (e.fillStyle = pe(t._fill, e)), t.dropShadow) {
255
+ const n = t.dropShadow, a = Pe.shared.setValue(n.color).toArray(), u = n.blur * r, l = n.distance * r;
256
256
  e.shadowColor = `rgba(${a[0] * 255},${a[1] * 255},${a[2] * 255},${n.alpha})`, e.shadowBlur = u, e.shadowOffsetX = Math.cos(n.angle) * l, e.shadowOffsetY = Math.sin(n.angle) * l;
257
257
  } else
258
258
  e.shadowColor = "black", e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0;
@@ -268,18 +268,18 @@ const Oe = class Ie extends Ft {
268
268
  super.destroy();
269
269
  for (let e = 0; e < this.pages.length; e++) {
270
270
  const { canvasAndContext: t, texture: r } = this.pages[e];
271
- Y.returnCanvasAndContext(t), r.destroy(!0);
271
+ X.returnCanvasAndContext(t), r.destroy(!0);
272
272
  }
273
273
  this.pages = null;
274
274
  }
275
275
  };
276
- Oe.defaultOptions = {
276
+ Ie.defaultOptions = {
277
277
  textureSize: 512,
278
- style: new W(),
278
+ style: new E(),
279
279
  mipmap: !0
280
280
  };
281
- let pe = Oe;
282
- function We(o, e, t, r) {
281
+ let ge = Ie;
282
+ function Ee(o, e, t, r) {
283
283
  const i = {
284
284
  width: 0,
285
285
  height: 0,
@@ -335,25 +335,25 @@ function We(o, e, t, r) {
335
335
  `)
336
336
  _();
337
337
  else if (!p) {
338
- const M = v.xAdvance + (v.kerning[n] || 0) + d;
339
- s.width += M, s.spaceWidth = M, s.spacesIndex.push(s.charPositions.length), s.chars.push(g);
338
+ const U = v.xAdvance + (v.kerning[n] || 0) + d;
339
+ s.width += U, s.spaceWidth = U, s.spacesIndex.push(s.charPositions.length), s.chars.push(g);
340
340
  }
341
341
  } else {
342
- const k = v.kerning[n] || 0, M = v.xAdvance + k + d;
343
- f && b(s.width + u.width + M) && (y(u), _()), u.positions[u.index++] = u.width + k, u.chars.push(g), u.width += M;
342
+ const D = v.kerning[n] || 0, U = v.xAdvance + D + d;
343
+ f && b(s.width + u.width + U) && (y(u), _()), u.positions[u.index++] = u.width + D, u.chars.push(g), u.width += U;
344
344
  }
345
345
  n = g;
346
346
  }
347
- return _(), e.align === "center" ? Bt(i) : e.align === "right" ? Rt(i) : e.align === "justify" && Mt(i), i;
347
+ return _(), e.align === "center" ? Rt(i) : e.align === "right" ? Ut(i) : e.align === "justify" && Mt(i), i;
348
348
  }
349
- function Bt(o) {
349
+ function Rt(o) {
350
350
  for (let e = 0; e < o.lines.length; e++) {
351
351
  const t = o.lines[e], r = o.width / 2 - t.width / 2;
352
352
  for (let i = 0; i < t.charPositions.length; i++)
353
353
  t.charPositions[i] += r;
354
354
  }
355
355
  }
356
- function Rt(o) {
356
+ function Ut(o) {
357
357
  for (let e = 0; e < o.lines.length; e++) {
358
358
  const t = o.lines[e], r = o.width - t.width;
359
359
  for (let i = 0; i < t.charPositions.length; i++)
@@ -370,7 +370,7 @@ function Mt(o) {
370
370
  d === s && (s = r.spacesIndex[i++], n += l), r.charPositions[d] += n;
371
371
  }
372
372
  }
373
- function Ut(o) {
373
+ function Gt(o) {
374
374
  if (o === "")
375
375
  return [];
376
376
  typeof o == "string" && (o = [o]);
@@ -394,8 +394,8 @@ function Ut(o) {
394
394
  throw new Error("[BitmapFont]: Empty set when resolving characters.");
395
395
  return e;
396
396
  }
397
- let L = 0;
398
- class Gt {
397
+ let H = 0;
398
+ class zt {
399
399
  constructor() {
400
400
  this.ALPHA = [["a", "z"], ["A", "Z"], " "], this.NUMERIC = [["0", "9"]], this.ALPHANUMERIC = [["a", "z"], ["A", "Z"], ["0", "9"], " "], this.ASCII = [[" ", "~"]], this.defaultOptions = {
401
401
  chars: this.ALPHANUMERIC,
@@ -403,7 +403,7 @@ class Gt {
403
403
  padding: 4,
404
404
  skipKerning: !1,
405
405
  textureStyle: null
406
- }, this.measureCache = pt(1e3);
406
+ }, this.measureCache = gt(1e3);
407
407
  }
408
408
  /**
409
409
  * Get a font for the specified text and style.
@@ -416,14 +416,14 @@ class Gt {
416
416
  if (t._fill.fill && !t._stroke ? (r += t._fill.fill.styleKey, i = !1) : (t._stroke || t.dropShadow) && (r = `${t.styleKey}-bitmap`, i = !1), !P.has(r)) {
417
417
  const a = Object.create(t);
418
418
  a.lineHeight = 0;
419
- const u = new pe({
419
+ const u = new ge({
420
420
  style: a,
421
421
  overrideFill: i,
422
422
  overrideSize: !0,
423
423
  ...this.defaultOptions
424
424
  });
425
- L++, L > 50 && X("BitmapText", `You have dynamically created ${L} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``), u.once("destroy", () => {
426
- L--, P.remove(r);
425
+ H++, H > 50 && K("BitmapText", `You have dynamically created ${H} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``), u.once("destroy", () => {
426
+ H--, P.remove(r);
427
427
  }), P.set(
428
428
  r,
429
429
  u
@@ -442,7 +442,7 @@ class Gt {
442
442
  const i = this.getFont(e, t), s = `${e}-${t.styleKey}-${r}`;
443
443
  if (this.measureCache.has(s))
444
444
  return this.measureCache.get(s);
445
- const n = D.graphemeSegmenter(e), a = We(n, t, i, r);
445
+ const n = O.graphemeSegmenter(e), a = Ee(n, t, i, r);
446
446
  return this.measureCache.set(s, a), a;
447
447
  }
448
448
  /**
@@ -465,12 +465,12 @@ class Gt {
465
465
  resolution: (d = e[2]) == null ? void 0 : d.resolution,
466
466
  padding: (c = e[2]) == null ? void 0 : c.padding,
467
467
  skipKerning: (h = e[2]) == null ? void 0 : h.skipKerning
468
- }, w(U, "BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"));
468
+ }, w(M, "BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"));
469
469
  const r = t == null ? void 0 : t.name;
470
470
  if (!r)
471
471
  throw new Error("[BitmapFontManager] Property `name` is required.");
472
472
  t = { ...this.defaultOptions, ...t };
473
- const i = t.style, s = i instanceof W ? i : new W(i), n = t.dynamicFill ?? this._canUseTintForStyle(s), a = new pe({
473
+ const i = t.style, s = i instanceof E ? i : new E(i), n = t.dynamicFill ?? this._canUseTintForStyle(s), a = new ge({
474
474
  style: s,
475
475
  overrideFill: n,
476
476
  skipKerning: t.skipKerning,
@@ -478,7 +478,7 @@ class Gt {
478
478
  resolution: t.resolution,
479
479
  overrideSize: !1,
480
480
  textureStyle: t.textureStyle
481
- }), u = Ut(t.chars);
481
+ }), u = Gt(t.chars);
482
482
  return a.ensureCharacters(u.join("")), P.set(`${r}-bitmap`, a), a.once("destroy", () => P.remove(`${r}-bitmap`)), a;
483
483
  }
484
484
  /**
@@ -500,8 +500,8 @@ class Gt {
500
500
  return !e._stroke && (!e.dropShadow || e.dropShadow.color === 0) && !e._fill.fill && e._fill.color === 16777215;
501
501
  }
502
502
  }
503
- const zt = new Gt();
504
- var At = `in vec2 aPosition;
503
+ const At = new zt();
504
+ var kt = `in vec2 aPosition;
505
505
  out vec2 vTextureCoord;
506
506
 
507
507
  uniform vec4 uInputSize;
@@ -528,13 +528,13 @@ void main(void)
528
528
  gl_Position = filterVertexPosition();
529
529
  vTextureCoord = filterTextureCoord();
530
530
  }
531
- `, kt = `in vec2 vTextureCoord;
531
+ `, Dt = `in vec2 vTextureCoord;
532
532
  out vec4 finalColor;
533
533
  uniform sampler2D uTexture;
534
534
  void main() {
535
535
  finalColor = texture(uTexture, vTextureCoord);
536
536
  }
537
- `, ge = `struct GlobalFilterUniforms {
537
+ `, me = `struct GlobalFilterUniforms {
538
538
  uInputSize: vec4<f32>,
539
539
  uInputPixel: vec4<f32>,
540
540
  uInputClamp: vec4<f32>,
@@ -584,15 +584,15 @@ fn mainFragment(
584
584
  return textureSample(uTexture, uSampler, uv);
585
585
  }
586
586
  `;
587
- class Dt extends Ct {
587
+ class Ot extends St {
588
588
  constructor() {
589
- const e = Pe.from({
590
- vertex: { source: ge, entryPoint: "mainVertex" },
591
- fragment: { source: ge, entryPoint: "mainFragment" },
589
+ const e = Fe.from({
590
+ vertex: { source: me, entryPoint: "mainVertex" },
591
+ fragment: { source: me, entryPoint: "mainFragment" },
592
592
  name: "passthrough-filter"
593
- }), t = Fe.from({
594
- vertex: At,
595
- fragment: kt,
593
+ }), t = Be.from({
594
+ vertex: kt,
595
+ fragment: Dt,
596
596
  name: "passthrough-filter"
597
597
  });
598
598
  super({
@@ -601,7 +601,7 @@ class Dt extends Ct {
601
601
  });
602
602
  }
603
603
  }
604
- class Ee {
604
+ class Ve {
605
605
  constructor(e) {
606
606
  this._renderer = e;
607
607
  }
@@ -628,7 +628,7 @@ class Ee {
628
628
  this._renderer = null;
629
629
  }
630
630
  }
631
- Ee.extension = {
631
+ Ve.extension = {
632
632
  type: [
633
633
  m.WebGLPipes,
634
634
  m.WebGPUPipes,
@@ -636,8 +636,8 @@ Ee.extension = {
636
636
  ],
637
637
  name: "filter"
638
638
  };
639
- const me = new R();
640
- function Ot(o, e) {
639
+ const xe = new R();
640
+ function It(o, e) {
641
641
  e.clear();
642
642
  const t = e.matrix;
643
643
  for (let r = 0; r < o.length; r++) {
@@ -645,11 +645,11 @@ function Ot(o, e) {
645
645
  if (i.globalDisplayStatus < 7)
646
646
  continue;
647
647
  const s = i.renderGroup ?? i.parentRenderGroup;
648
- s != null && s.isCachedAsTexture ? e.matrix = me.copyFrom(s.textureOffsetInverseTransform).append(i.worldTransform) : s != null && s._parentCacheAsTextureRenderGroup ? e.matrix = me.copyFrom(s._parentCacheAsTextureRenderGroup.inverseWorldTransform).append(i.groupTransform) : e.matrix = i.worldTransform, e.addBounds(i.bounds);
648
+ s != null && s.isCachedAsTexture ? e.matrix = xe.copyFrom(s.textureOffsetInverseTransform).append(i.worldTransform) : s != null && s._parentCacheAsTextureRenderGroup ? e.matrix = xe.copyFrom(s._parentCacheAsTextureRenderGroup.inverseWorldTransform).append(i.groupTransform) : e.matrix = i.worldTransform, e.addBounds(i.bounds);
649
649
  }
650
650
  return e.matrix = t, e;
651
651
  }
652
- const It = new ie({
652
+ const Wt = new se({
653
653
  attributes: {
654
654
  aPosition: {
655
655
  buffer: new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
@@ -660,21 +660,21 @@ const It = new ie({
660
660
  },
661
661
  indexBuffer: new Uint32Array([0, 1, 2, 0, 2, 3])
662
662
  });
663
- class Wt {
663
+ class Et {
664
664
  constructor() {
665
- this.skip = !1, this.inputTexture = null, this.backTexture = null, this.filters = null, this.bounds = new Re(), this.container = null, this.blendRequired = !1, this.outputRenderSurface = null, this.globalFrame = { x: 0, y: 0, width: 0, height: 0 }, this.firstEnabledIndex = -1, this.lastEnabledIndex = -1;
665
+ this.skip = !1, this.inputTexture = null, this.backTexture = null, this.filters = null, this.bounds = new Ue(), this.container = null, this.blendRequired = !1, this.outputRenderSurface = null, this.globalFrame = { x: 0, y: 0, width: 0, height: 0 }, this.firstEnabledIndex = -1, this.lastEnabledIndex = -1;
666
666
  }
667
667
  }
668
- class Ve {
668
+ class Le {
669
669
  constructor(e) {
670
- this._filterStackIndex = 0, this._filterStack = [], this._filterGlobalUniforms = new A({
670
+ this._filterStackIndex = 0, this._filterStack = [], this._filterGlobalUniforms = new k({
671
671
  uInputSize: { value: new Float32Array(4), type: "vec4<f32>" },
672
672
  uInputPixel: { value: new Float32Array(4), type: "vec4<f32>" },
673
673
  uInputClamp: { value: new Float32Array(4), type: "vec4<f32>" },
674
674
  uOutputFrame: { value: new Float32Array(4), type: "vec4<f32>" },
675
675
  uGlobalFrame: { value: new Float32Array(4), type: "vec4<f32>" },
676
676
  uOutputTexture: { value: new Float32Array(4), type: "vec4<f32>" }
677
- }), this._globalFilterBindGroup = new Be({}), this.renderer = e;
677
+ }), this._globalFilterBindGroup = new Re({}), this.renderer = e;
678
678
  }
679
679
  /**
680
680
  * The back texture of the currently active filter. Requires the filter to have `blendRequired` set to true.
@@ -838,7 +838,7 @@ class Ve {
838
838
  (e = this._passthroughFilter) == null || e.destroy(!0), this._passthroughFilter = null;
839
839
  }
840
840
  _getPassthroughFilter() {
841
- return this._passthroughFilter ?? (this._passthroughFilter = new Dt()), this._passthroughFilter;
841
+ return this._passthroughFilter ?? (this._passthroughFilter = new Ot()), this._passthroughFilter;
842
842
  }
843
843
  /**
844
844
  * Sets up the bind groups and renders the filter.
@@ -853,11 +853,11 @@ class Ve {
853
853
  } else
854
854
  this._globalFilterBindGroup.setResource(this._filterGlobalUniforms, 0);
855
855
  this._globalFilterBindGroup.setResource(t.source, 1), this._globalFilterBindGroup.setResource(t.source.style, 2), e.groups[0] = this._globalFilterBindGroup, r.encoder.draw({
856
- geometry: It,
856
+ geometry: Wt,
857
857
  shader: e,
858
858
  state: e._state,
859
859
  topology: "triangle-list"
860
- }), r.type === se.WEBGL && r.renderTarget.finishRenderPass();
860
+ }), r.type === ne.WEBGL && r.renderTarget.finishRenderPass();
861
861
  }
862
862
  /**
863
863
  * Sets up the filter textures including input texture and back texture if needed.
@@ -946,7 +946,7 @@ class Ve {
946
946
  * @param bounds - The bounds object to populate
947
947
  */
948
948
  _calculateFilterArea(e, t) {
949
- if (e.renderables ? Ot(e.renderables, t) : e.filterEffect.filterArea ? (t.clear(), t.addRect(e.filterEffect.filterArea), t.applyMatrix(e.container.worldTransform)) : e.container.getFastGlobalBounds(!0, t), e.container) {
949
+ if (e.renderables ? It(e.renderables, t) : e.filterEffect.filterArea ? (t.clear(), t.addRect(e.filterEffect.filterArea), t.applyMatrix(e.container.worldTransform)) : e.container.getFastGlobalBounds(!0, t), e.container) {
950
950
  const i = (e.container.renderGroup || e.container.parentRenderGroup).cacheToLocalTransform;
951
951
  i && t.applyMatrix(i);
952
952
  }
@@ -988,7 +988,7 @@ class Ve {
988
988
  break;
989
989
  }
990
990
  if (p.blendRequired && !(((x = n.backBuffer) == null ? void 0 : x.useBackBuffer) ?? !0)) {
991
- X("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."), f = !1;
991
+ K("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."), f = !1;
992
992
  break;
993
993
  }
994
994
  f = !0, h || (h = p.blendRequired);
@@ -1014,38 +1014,38 @@ class Ve {
1014
1014
  }
1015
1015
  _pushFilterData() {
1016
1016
  let e = this._filterStack[this._filterStackIndex];
1017
- return e || (e = this._filterStack[this._filterStackIndex] = new Wt()), this._filterStackIndex++, e;
1017
+ return e || (e = this._filterStack[this._filterStackIndex] = new Et()), this._filterStackIndex++, e;
1018
1018
  }
1019
1019
  }
1020
- Ve.extension = {
1020
+ Le.extension = {
1021
1021
  type: [
1022
1022
  m.WebGLSystem,
1023
1023
  m.WebGPUSystem
1024
1024
  ],
1025
1025
  name: "filter"
1026
1026
  };
1027
- const Le = class He extends ie {
1027
+ const He = class Ye extends se {
1028
1028
  constructor(...e) {
1029
1029
  let t = e[0] ?? {};
1030
- t instanceof Float32Array && (w(U, "use new MeshGeometry({ positions, uvs, indices }) instead"), t = {
1030
+ t instanceof Float32Array && (w(M, "use new MeshGeometry({ positions, uvs, indices }) instead"), t = {
1031
1031
  positions: t,
1032
1032
  uvs: e[1],
1033
1033
  indices: e[2]
1034
- }), t = { ...He.defaultOptions, ...t };
1034
+ }), t = { ...Ye.defaultOptions, ...t };
1035
1035
  const r = t.positions || new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]);
1036
1036
  let i = t.uvs;
1037
1037
  i || (t.positions ? i = new Float32Array(r.length) : i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]));
1038
- const s = t.indices || new Uint32Array([0, 1, 2, 0, 2, 3]), n = t.shrinkBuffersToFit, a = new O({
1038
+ const s = t.indices || new Uint32Array([0, 1, 2, 0, 2, 3]), n = t.shrinkBuffersToFit, a = new I({
1039
1039
  data: r,
1040
1040
  label: "attribute-mesh-positions",
1041
1041
  shrinkToFit: n,
1042
1042
  usage: B.VERTEX | B.COPY_DST
1043
- }), u = new O({
1043
+ }), u = new I({
1044
1044
  data: i,
1045
1045
  label: "attribute-mesh-uvs",
1046
1046
  shrinkToFit: n,
1047
1047
  usage: B.VERTEX | B.COPY_DST
1048
- }), l = new O({
1048
+ }), l = new I({
1049
1049
  data: s,
1050
1050
  label: "index-mesh-buffer",
1051
1051
  shrinkToFit: n,
@@ -1104,25 +1104,25 @@ const Le = class He extends ie {
1104
1104
  this.indexBuffer.data = e;
1105
1105
  }
1106
1106
  };
1107
- Le.defaultOptions = {
1107
+ He.defaultOptions = {
1108
1108
  topology: "triangle-list",
1109
1109
  shrinkBuffersToFit: !1
1110
1110
  };
1111
- let ue = Le;
1112
- const xe = "http://www.w3.org/2000/svg", _e = "http://www.w3.org/1999/xhtml";
1113
- class Ye {
1111
+ let le = He;
1112
+ const _e = "http://www.w3.org/2000/svg", ye = "http://www.w3.org/1999/xhtml";
1113
+ class Xe {
1114
1114
  constructor() {
1115
- this.svgRoot = document.createElementNS(xe, "svg"), this.foreignObject = document.createElementNS(xe, "foreignObject"), this.domElement = document.createElementNS(_e, "div"), this.styleElement = document.createElementNS(_e, "style");
1115
+ this.svgRoot = document.createElementNS(_e, "svg"), this.foreignObject = document.createElementNS(_e, "foreignObject"), this.domElement = document.createElementNS(ye, "div"), this.styleElement = document.createElementNS(ye, "style");
1116
1116
  const { foreignObject: e, svgRoot: t, styleElement: r, domElement: i } = this;
1117
- e.setAttribute("width", "10000"), e.setAttribute("height", "10000"), e.style.overflow = "hidden", t.appendChild(e), e.appendChild(r), e.appendChild(i), this.image = ne.get().createImage();
1117
+ e.setAttribute("width", "10000"), e.setAttribute("height", "10000"), e.style.overflow = "hidden", t.appendChild(e), e.appendChild(r), e.appendChild(i), this.image = ae.get().createImage();
1118
1118
  }
1119
1119
  destroy() {
1120
1120
  this.svgRoot.remove(), this.foreignObject.remove(), this.styleElement.remove(), this.domElement.remove(), this.image.src = "", this.image.remove(), this.svgRoot = null, this.foreignObject = null, this.styleElement = null, this.domElement = null, this.image = null, this.canvasAndContext = null;
1121
1121
  }
1122
1122
  }
1123
- let ye;
1124
- function Et(o, e, t, r) {
1125
- r || (r = ye || (ye = new Ye()));
1123
+ let be;
1124
+ function Vt(o, e, t, r) {
1125
+ r || (r = be || (be = new Xe()));
1126
1126
  const { domElement: i, styleElement: s, svgRoot: n } = r;
1127
1127
  i.innerHTML = `<style>${e.cssStyle};</style><div style='padding:0'>${o}</div>`, i.setAttribute("style", "transform-origin: top left; display: inline-block"), t && (s.textContent = t), document.body.appendChild(n);
1128
1128
  const a = i.getBoundingClientRect();
@@ -1133,19 +1133,19 @@ function Et(o, e, t, r) {
1133
1133
  height: a.height - u
1134
1134
  };
1135
1135
  }
1136
- class Vt {
1136
+ class Lt {
1137
1137
  constructor() {
1138
1138
  this.batches = [], this.batched = !1;
1139
1139
  }
1140
1140
  destroy() {
1141
1141
  this.batches.forEach((e) => {
1142
- K.return(e);
1142
+ $.return(e);
1143
1143
  }), this.batches.length = 0;
1144
1144
  }
1145
1145
  }
1146
- class Xe {
1146
+ class Ke {
1147
1147
  constructor(e, t) {
1148
- this.state = j.for2d(), this.renderer = e, this._adaptor = t, this.renderer.runners.contextChange.add(this);
1148
+ this.state = j.for2d(), this.renderer = e, this._adaptor = t, this.renderer.runners.contextChange.add(this), this._managedGraphics = new G({ renderer: e, type: "renderable", priority: -1, name: "graphics" });
1149
1149
  }
1150
1150
  contextChange() {
1151
1151
  this._adaptor.contextChange(this.renderer);
@@ -1174,7 +1174,7 @@ class Xe {
1174
1174
  const s = r.customShader || this._adaptor.shader;
1175
1175
  this.state.blendMode = e.groupBlendMode;
1176
1176
  const n = s.resources.localUniforms.uniforms;
1177
- n.uTransformMatrix = e.groupTransform, n.uRound = t._roundPixels | e._roundPixels, $(
1177
+ n.uTransformMatrix = e.groupTransform, n.uRound = t._roundPixels | e._roundPixels, N(
1178
1178
  e.groupColorAlpha,
1179
1179
  n.uColor,
1180
1180
  0
@@ -1195,21 +1195,21 @@ class Xe {
1195
1195
  return e._gpuData[this.renderer.uid] || this._initGpuDataForRenderable(e);
1196
1196
  }
1197
1197
  _initGpuDataForRenderable(e) {
1198
- const t = new Vt();
1199
- return e._gpuData[this.renderer.uid] = t, t;
1198
+ const t = new Lt();
1199
+ return e._gpuData[this.renderer.uid] = t, this._managedGraphics.add(e), t;
1200
1200
  }
1201
1201
  _updateBatchesForRenderable(e, t) {
1202
1202
  const r = e.context, i = this.renderer.graphicsContext.getGpuContext(r), s = this.renderer._roundPixels | e._roundPixels;
1203
1203
  t.batches = i.batches.map((n) => {
1204
- const a = K.get(gt);
1204
+ const a = $.get(mt);
1205
1205
  return n.copyTo(a), a.renderable = e, a.roundPixels = s, a;
1206
1206
  });
1207
1207
  }
1208
1208
  destroy() {
1209
- this.renderer = null, this._adaptor.destroy(), this._adaptor = null, this.state = null;
1209
+ this._managedGraphics.destroy(), this.renderer = null, this._adaptor.destroy(), this._adaptor = null, this.state = null;
1210
1210
  }
1211
1211
  }
1212
- Xe.extension = {
1212
+ Ke.extension = {
1213
1213
  type: [
1214
1214
  m.WebGLPipes,
1215
1215
  m.WebGPUPipes,
@@ -1217,11 +1217,11 @@ Xe.extension = {
1217
1217
  ],
1218
1218
  name: "graphics"
1219
1219
  };
1220
- const Ke = class je extends ue {
1220
+ const $e = class je extends le {
1221
1221
  constructor(...e) {
1222
1222
  super({});
1223
1223
  let t = e[0] ?? {};
1224
- typeof t == "number" && (w(U, "PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"), t = {
1224
+ typeof t == "number" && (w(M, "PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"), t = {
1225
1225
  width: t,
1226
1226
  height: e[1],
1227
1227
  verticesX: e[2],
@@ -1254,14 +1254,14 @@ const Ke = class je extends ue {
1254
1254
  this.buffers[0].data = new Float32Array(r), this.buffers[1].data = new Float32Array(i), this.indexBuffer.data = new Uint32Array(s), this.buffers[0].update(), this.buffers[1].update(), this.indexBuffer.update();
1255
1255
  }
1256
1256
  };
1257
- Ke.defaultOptions = {
1257
+ $e.defaultOptions = {
1258
1258
  width: 100,
1259
1259
  height: 100,
1260
1260
  verticesX: 10,
1261
1261
  verticesY: 10
1262
1262
  };
1263
- let Lt = Ke;
1264
- class le {
1263
+ let Ht = $e;
1264
+ class ce {
1265
1265
  constructor() {
1266
1266
  this.batcherName = "default", this.packAsQuad = !1, this.indexOffset = 0, this.attributeOffset = 0, this.roundPixels = 0, this._batcher = null, this._batch = null, this._textureMatrixUpdateId = -1, this._uvUpdateId = -1;
1267
1267
  }
@@ -1311,17 +1311,17 @@ class le {
1311
1311
  return this.geometry.indices.length;
1312
1312
  }
1313
1313
  }
1314
- class be {
1314
+ class ve {
1315
1315
  destroy() {
1316
1316
  }
1317
1317
  }
1318
- class $e {
1318
+ class Ne {
1319
1319
  constructor(e, t) {
1320
- this.localUniforms = new A({
1320
+ this.localUniforms = new k({
1321
1321
  uTransformMatrix: { value: new R(), type: "mat3x3<f32>" },
1322
1322
  uColor: { value: new Float32Array([1, 1, 1, 1]), type: "vec4<f32>" },
1323
1323
  uRound: { value: 0, type: "f32" }
1324
- }), this.localUniformsBindGroup = new Be({
1324
+ }), this.localUniformsBindGroup = new Re({
1325
1325
  0: this.localUniforms
1326
1326
  }), this.renderer = e, this._adaptor = t, this._adaptor.init();
1327
1327
  }
@@ -1359,9 +1359,9 @@ class $e {
1359
1359
  execute(e) {
1360
1360
  if (!e.isRenderable)
1361
1361
  return;
1362
- e.state.blendMode = ae(e.groupBlendMode, e.texture._source);
1362
+ e.state.blendMode = oe(e.groupBlendMode, e.texture._source);
1363
1363
  const t = this.localUniforms;
1364
- t.uniforms.uTransformMatrix = e.groupTransform, t.uniforms.uRound = this.renderer._roundPixels | e._roundPixels, t.update(), $(
1364
+ t.uniforms.uTransformMatrix = e.groupTransform, t.uniforms.uRound = this.renderer._roundPixels | e._roundPixels, t.update(), N(
1365
1365
  e.groupColorAlpha,
1366
1366
  t.uniforms.uColor,
1367
1367
  0
@@ -1369,7 +1369,7 @@ class $e {
1369
1369
  }
1370
1370
  _getMeshData(e) {
1371
1371
  var t, r;
1372
- return (t = e._gpuData)[r = this.renderer.uid] || (t[r] = new be()), e._gpuData[this.renderer.uid].meshData || this._initMeshData(e);
1372
+ return (t = e._gpuData)[r = this.renderer.uid] || (t[r] = new ve()), e._gpuData[this.renderer.uid].meshData || this._initMeshData(e);
1373
1373
  }
1374
1374
  _initMeshData(e) {
1375
1375
  return e._gpuData[this.renderer.uid].meshData = {
@@ -1380,17 +1380,17 @@ class $e {
1380
1380
  }
1381
1381
  _getBatchableMesh(e) {
1382
1382
  var t, r;
1383
- return (t = e._gpuData)[r = this.renderer.uid] || (t[r] = new be()), e._gpuData[this.renderer.uid].batchableMesh || this._initBatchableMesh(e);
1383
+ return (t = e._gpuData)[r = this.renderer.uid] || (t[r] = new ve()), e._gpuData[this.renderer.uid].batchableMesh || this._initBatchableMesh(e);
1384
1384
  }
1385
1385
  _initBatchableMesh(e) {
1386
- const t = new le();
1386
+ const t = new ce();
1387
1387
  return t.renderable = e, t.setTexture(e._texture), t.transform = e.groupTransform, t.roundPixels = this.renderer._roundPixels | e._roundPixels, e._gpuData[this.renderer.uid].batchableMesh = t, t;
1388
1388
  }
1389
1389
  destroy() {
1390
1390
  this.localUniforms = null, this.localUniformsBindGroup = null, this._adaptor.destroy(), this._adaptor = null, this.renderer = null;
1391
1391
  }
1392
1392
  }
1393
- $e.extension = {
1393
+ Ne.extension = {
1394
1394
  type: [
1395
1395
  m.WebGLPipes,
1396
1396
  m.WebGPUPipes,
@@ -1398,7 +1398,7 @@ $e.extension = {
1398
1398
  ],
1399
1399
  name: "mesh"
1400
1400
  };
1401
- class Ht {
1401
+ class Yt {
1402
1402
  execute(e, t) {
1403
1403
  const r = e.state, i = e.renderer, s = t.shader || e.defaultShader;
1404
1404
  s.resources.uTexture = t.texture._source, s.resources.uniforms = e.localUniforms;
@@ -1408,7 +1408,7 @@ class Ht {
1408
1408
  n.drawElements(n.TRIANGLES, t.particleChildren.length * 6, l, 0);
1409
1409
  }
1410
1410
  }
1411
- class Yt {
1411
+ class Xt {
1412
1412
  execute(e, t) {
1413
1413
  const r = e.renderer, i = t.shader || e.defaultShader;
1414
1414
  i.groups[0] = r.renderPipes.uniformBatch.getUniformBindGroup(e.localUniforms, !0), i.groups[1] = r.texture.getTextureBindGroup(t.texture);
@@ -1421,7 +1421,7 @@ class Yt {
1421
1421
  });
1422
1422
  }
1423
1423
  }
1424
- function ve(o, e = null) {
1424
+ function Te(o, e = null) {
1425
1425
  const t = o * 6;
1426
1426
  if (t > 65535 ? e || (e = new Uint32Array(t)) : e || (e = new Uint16Array(t)), e.length !== t)
1427
1427
  throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${t}`);
@@ -1429,13 +1429,13 @@ function ve(o, e = null) {
1429
1429
  e[r + 0] = i + 0, e[r + 1] = i + 1, e[r + 2] = i + 2, e[r + 3] = i + 0, e[r + 4] = i + 2, e[r + 5] = i + 3;
1430
1430
  return e;
1431
1431
  }
1432
- function Xt(o) {
1432
+ function Kt(o) {
1433
1433
  return {
1434
- dynamicUpdate: Te(o, !0),
1435
- staticUpdate: Te(o, !1)
1434
+ dynamicUpdate: we(o, !0),
1435
+ staticUpdate: we(o, !1)
1436
1436
  };
1437
1437
  }
1438
- function Te(o, e) {
1438
+ function we(o, e) {
1439
1439
  const t = [];
1440
1440
  t.push(`
1441
1441
 
@@ -1452,7 +1452,7 @@ function Te(o, e) {
1452
1452
  if (e !== n.dynamic)
1453
1453
  continue;
1454
1454
  t.push(`offset = index + ${r}`), t.push(n.code);
1455
- const a = te(n.format);
1455
+ const a = re(n.format);
1456
1456
  r += a.stride / 4;
1457
1457
  }
1458
1458
  t.push(`
@@ -1465,31 +1465,31 @@ function Te(o, e) {
1465
1465
  `);
1466
1466
  return new Function("ps", "f32v", "u32v", i);
1467
1467
  }
1468
- class Kt {
1468
+ class $t {
1469
1469
  constructor(e) {
1470
1470
  this._size = 0, this._generateParticleUpdateCache = {};
1471
1471
  const t = this._size = e.size ?? 1e3, r = e.properties;
1472
1472
  let i = 0, s = 0;
1473
1473
  for (const d in r) {
1474
- const c = r[d], h = te(c.format);
1474
+ const c = r[d], h = re(c.format);
1475
1475
  c.dynamic ? s += h.stride : i += h.stride;
1476
1476
  }
1477
- this._dynamicStride = s / 4, this._staticStride = i / 4, this.staticAttributeBuffer = new V(t * 4 * i), this.dynamicAttributeBuffer = new V(t * 4 * s), this.indexBuffer = ve(t);
1478
- const n = new ie();
1477
+ this._dynamicStride = s / 4, this._staticStride = i / 4, this.staticAttributeBuffer = new L(t * 4 * i), this.dynamicAttributeBuffer = new L(t * 4 * s), this.indexBuffer = Te(t);
1478
+ const n = new se();
1479
1479
  let a = 0, u = 0;
1480
- this._staticBuffer = new O({
1480
+ this._staticBuffer = new I({
1481
1481
  data: new Float32Array(1),
1482
1482
  label: "static-particle-buffer",
1483
1483
  shrinkToFit: !1,
1484
1484
  usage: B.VERTEX | B.COPY_DST
1485
- }), this._dynamicBuffer = new O({
1485
+ }), this._dynamicBuffer = new I({
1486
1486
  data: new Float32Array(1),
1487
1487
  label: "dynamic-particle-buffer",
1488
1488
  shrinkToFit: !1,
1489
1489
  usage: B.VERTEX | B.COPY_DST
1490
1490
  });
1491
1491
  for (const d in r) {
1492
- const c = r[d], h = te(c.format);
1492
+ const c = r[d], h = re(c.format);
1493
1493
  c.dynamic ? (n.addAttribute(c.attributeName, {
1494
1494
  buffer: this._dynamicBuffer,
1495
1495
  stride: this._dynamicStride * 4,
@@ -1511,10 +1511,10 @@ class Kt {
1511
1511
  return this._generateParticleUpdateCache[t] ? this._generateParticleUpdateCache[t] : (this._generateParticleUpdateCache[t] = this.generateParticleUpdate(e), this._generateParticleUpdateCache[t]);
1512
1512
  }
1513
1513
  generateParticleUpdate(e) {
1514
- return Xt(e);
1514
+ return Kt(e);
1515
1515
  }
1516
1516
  update(e, t) {
1517
- e.length > this._size && (t = !0, this._size = Math.max(e.length, this._size * 1.5 | 0), this.staticAttributeBuffer = new V(this._size * this._staticStride * 4 * 4), this.dynamicAttributeBuffer = new V(this._size * this._dynamicStride * 4 * 4), this.indexBuffer = ve(this._size), this.geometry.indexBuffer.setDataWithSize(
1517
+ e.length > this._size && (t = !0, this._size = Math.max(e.length, this._size * 1.5 | 0), this.staticAttributeBuffer = new L(this._size * this._staticStride * 4 * 4), this.dynamicAttributeBuffer = new L(this._size * this._dynamicStride * 4 * 4), this.indexBuffer = Te(this._size), this.geometry.indexBuffer.setDataWithSize(
1518
1518
  this.indexBuffer,
1519
1519
  this.indexBuffer.byteLength,
1520
1520
  !0
@@ -1545,7 +1545,7 @@ function jt(o) {
1545
1545
  }
1546
1546
  return e.join("_");
1547
1547
  }
1548
- var $t = `varying vec2 vUV;
1548
+ var Nt = `varying vec2 vUV;
1549
1549
  varying vec4 vColor;
1550
1550
 
1551
1551
  uniform sampler2D uTexture;
@@ -1553,7 +1553,7 @@ uniform sampler2D uTexture;
1553
1553
  void main(void){
1554
1554
  vec4 color = texture2D(uTexture, vUV) * vColor;
1555
1555
  gl_FragColor = color;
1556
- }`, Nt = `attribute vec2 aVertex;
1556
+ }`, qt = `attribute vec2 aVertex;
1557
1557
  attribute vec2 aUV;
1558
1558
  attribute vec4 aColor;
1559
1559
 
@@ -1592,7 +1592,7 @@ void main(void){
1592
1592
  vUV = aUV;
1593
1593
  vColor = vec4(aColor.rgb * aColor.a, aColor.a) * uColor;
1594
1594
  }
1595
- `, we = `
1595
+ `, Ce = `
1596
1596
  struct ParticleUniforms {
1597
1597
  uTranslationMatrix:mat3x3<f32>,
1598
1598
  uColor:vec4<f32>,
@@ -1655,18 +1655,18 @@ fn mainFragment(
1655
1655
 
1656
1656
  return sample;
1657
1657
  }`;
1658
- class qt extends oe {
1658
+ class Qt extends ue {
1659
1659
  constructor() {
1660
- const e = Fe.from({
1661
- vertex: Nt,
1662
- fragment: $t
1663
- }), t = Pe.from({
1660
+ const e = Be.from({
1661
+ vertex: qt,
1662
+ fragment: Nt
1663
+ }), t = Fe.from({
1664
1664
  fragment: {
1665
- source: we,
1665
+ source: Ce,
1666
1666
  entryPoint: "mainFragment"
1667
1667
  },
1668
1668
  vertex: {
1669
- source: we,
1669
+ source: Ce,
1670
1670
  entryPoint: "mainVertex"
1671
1671
  }
1672
1672
  });
@@ -1677,11 +1677,11 @@ class qt extends oe {
1677
1677
  // this will be replaced with the texture from the particle container
1678
1678
  uTexture: C.WHITE.source,
1679
1679
  // this will be replaced with the texture style from the particle container
1680
- uSampler: new I({}),
1680
+ uSampler: new W({}),
1681
1681
  // this will be replaced with the local uniforms from the particle container
1682
1682
  uniforms: {
1683
1683
  uTranslationMatrix: { value: new R(), type: "mat3x3<f32>" },
1684
- uColor: { value: new Se(16777215), type: "vec4<f32>" },
1684
+ uColor: { value: new Pe(16777215), type: "vec4<f32>" },
1685
1685
  uRound: { value: 1, type: "f32" },
1686
1686
  uResolution: { value: [0, 0], type: "vec2<f32>" }
1687
1687
  }
@@ -1689,18 +1689,18 @@ class qt extends oe {
1689
1689
  });
1690
1690
  }
1691
1691
  }
1692
- class Ne {
1692
+ class qe {
1693
1693
  /**
1694
1694
  * @param renderer - The renderer this sprite batch works for.
1695
1695
  * @param adaptor
1696
1696
  */
1697
1697
  constructor(e, t) {
1698
- this.state = j.for2d(), this.localUniforms = new A({
1698
+ this.state = j.for2d(), this.localUniforms = new k({
1699
1699
  uTranslationMatrix: { value: new R(), type: "mat3x3<f32>" },
1700
1700
  uColor: { value: new Float32Array(4), type: "vec4<f32>" },
1701
1701
  uRound: { value: 1, type: "f32" },
1702
1702
  uResolution: { value: [0, 0], type: "vec2<f32>" }
1703
- }), this.renderer = e, this.adaptor = t, this.defaultShader = new qt(), this.state = j.for2d();
1703
+ }), this.renderer = e, this.adaptor = t, this.defaultShader = new Qt(), this.state = j.for2d(), this._managedContainers = new G({ renderer: e, type: "renderable", name: "particleContainer" });
1704
1704
  }
1705
1705
  validateRenderable(e) {
1706
1706
  return !1;
@@ -1712,10 +1712,10 @@ class Ne {
1712
1712
  return e._gpuData[this.renderer.uid] || this._initBuffer(e);
1713
1713
  }
1714
1714
  _initBuffer(e) {
1715
- return e._gpuData[this.renderer.uid] = new Kt({
1715
+ return e._gpuData[this.renderer.uid] = new $t({
1716
1716
  size: e.particleChildren.length,
1717
1717
  properties: e._properties
1718
- }), e._gpuData[this.renderer.uid];
1718
+ }), this._managedContainers.add(e), e._gpuData[this.renderer.uid];
1719
1719
  }
1720
1720
  updateRenderable(e) {
1721
1721
  }
@@ -1726,9 +1726,9 @@ class Ne {
1726
1726
  const r = this.renderer, i = this.getBuffers(e);
1727
1727
  e.texture || (e.texture = t[0].texture);
1728
1728
  const s = this.state;
1729
- i.update(t, e._childrenDirty), e._childrenDirty = !1, s.blendMode = ae(e.blendMode, e.texture._source);
1729
+ i.update(t, e._childrenDirty), e._childrenDirty = !1, s.blendMode = oe(e.blendMode, e.texture._source);
1730
1730
  const n = this.localUniforms.uniforms, a = n.uTranslationMatrix;
1731
- e.worldTransform.copyTo(a), a.prepend(r.globalUniforms.globalUniformData.projectionMatrix), n.uResolution = r.globalUniforms.globalUniformData.resolution, n.uRound = r._roundPixels | e._roundPixels, $(
1731
+ e.worldTransform.copyTo(a), a.prepend(r.globalUniforms.globalUniformData.projectionMatrix), n.uResolution = r.globalUniforms.globalUniformData.resolution, n.uRound = r._roundPixels | e._roundPixels, N(
1732
1732
  e.groupColorAlpha,
1733
1733
  n.uColor,
1734
1734
  0
@@ -1736,34 +1736,34 @@ class Ne {
1736
1736
  }
1737
1737
  /** Destroys the ParticleRenderer. */
1738
1738
  destroy() {
1739
- this.renderer = null, this.defaultShader && (this.defaultShader.destroy(), this.defaultShader = null);
1739
+ this._managedContainers.destroy(), this.renderer = null, this.defaultShader && (this.defaultShader.destroy(), this.defaultShader = null);
1740
1740
  }
1741
1741
  }
1742
- class qe extends Ne {
1742
+ class Qe extends qe {
1743
1743
  constructor(e) {
1744
- super(e, new Ht());
1744
+ super(e, new Yt());
1745
1745
  }
1746
1746
  }
1747
- qe.extension = {
1747
+ Qe.extension = {
1748
1748
  type: [
1749
1749
  m.WebGLPipes
1750
1750
  ],
1751
1751
  name: "particle"
1752
1752
  };
1753
- class Qe extends Ne {
1753
+ class Je extends qe {
1754
1754
  constructor(e) {
1755
- super(e, new Yt());
1755
+ super(e, new Xt());
1756
1756
  }
1757
1757
  }
1758
- Qe.extension = {
1758
+ Je.extension = {
1759
1759
  type: [
1760
1760
  m.WebGPUPipes
1761
1761
  ],
1762
1762
  name: "particle"
1763
1763
  };
1764
- const Je = class Ze extends Lt {
1764
+ const Ze = class et extends Ht {
1765
1765
  constructor(e = {}) {
1766
- e = { ...Ze.defaultOptions, ...e }, super({
1766
+ e = { ...et.defaultOptions, ...e }, super({
1767
1767
  width: e.width,
1768
1768
  height: e.height,
1769
1769
  verticesX: 4,
@@ -1800,7 +1800,7 @@ const Je = class Ze extends Lt {
1800
1800
  e[2] = e[10] = e[18] = e[26] = t * this._leftWidth, e[9] = e[11] = e[13] = e[15] = r * this._topHeight, e[4] = e[12] = e[20] = e[28] = 1 - t * this._rightWidth, e[17] = e[19] = e[21] = e[23] = 1 - r * this._bottomHeight, this.getBuffer("aUV").update();
1801
1801
  }
1802
1802
  };
1803
- Je.defaultOptions = {
1803
+ Ze.defaultOptions = {
1804
1804
  /** The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane. */
1805
1805
  width: 100,
1806
1806
  /** The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane. */
@@ -1818,18 +1818,18 @@ Je.defaultOptions = {
1818
1818
  /** The original height of the texture */
1819
1819
  originalHeight: 100
1820
1820
  };
1821
- let Qt = Je;
1822
- class Jt extends le {
1821
+ let Jt = Ze;
1822
+ class Zt extends ce {
1823
1823
  constructor() {
1824
- super(), this.geometry = new Qt();
1824
+ super(), this.geometry = new Jt();
1825
1825
  }
1826
1826
  destroy() {
1827
1827
  this.geometry.destroy();
1828
1828
  }
1829
1829
  }
1830
- class et {
1830
+ class tt {
1831
1831
  constructor(e) {
1832
- this._renderer = e;
1832
+ this._renderer = e, this._managedSprites = new G({ renderer: e, type: "renderable", name: "nineSliceSprite" });
1833
1833
  }
1834
1834
  addRenderable(e, t) {
1835
1835
  const r = this._getGpuSprite(e);
@@ -1853,14 +1853,14 @@ class et {
1853
1853
  return e._gpuData[this._renderer.uid] || this._initGPUSprite(e);
1854
1854
  }
1855
1855
  _initGPUSprite(e) {
1856
- const t = e._gpuData[this._renderer.uid] = new Jt(), r = t;
1857
- return r.renderable = e, r.transform = e.groupTransform, r.texture = e._texture, r.roundPixels = this._renderer._roundPixels | e._roundPixels, e.didViewUpdate || this._updateBatchableSprite(e, r), t;
1856
+ const t = e._gpuData[this._renderer.uid] = new Zt(), r = t;
1857
+ return r.renderable = e, r.transform = e.groupTransform, r.texture = e._texture, r.roundPixels = this._renderer._roundPixels | e._roundPixels, this._managedSprites.add(e), e.didViewUpdate || this._updateBatchableSprite(e, r), t;
1858
1858
  }
1859
1859
  destroy() {
1860
- this._renderer = null;
1860
+ this._managedSprites.destroy(), this._renderer = null;
1861
1861
  }
1862
1862
  }
1863
- et.extension = {
1863
+ tt.extension = {
1864
1864
  type: [
1865
1865
  m.WebGLPipes,
1866
1866
  m.WebGPUPipes,
@@ -1868,7 +1868,7 @@ et.extension = {
1868
1868
  ],
1869
1869
  name: "nineSliceSprite"
1870
1870
  };
1871
- const Zt = {
1871
+ const er = {
1872
1872
  name: "tiling-bit",
1873
1873
  vertex: {
1874
1874
  header: (
@@ -1933,7 +1933,7 @@ const Zt = {
1933
1933
  `
1934
1934
  )
1935
1935
  }
1936
- }, er = {
1936
+ }, tr = {
1937
1937
  name: "tiling-bit",
1938
1938
  vertex: {
1939
1939
  header: (
@@ -1978,25 +1978,25 @@ const Zt = {
1978
1978
  )
1979
1979
  }
1980
1980
  };
1981
- let q, Q;
1982
- class tr extends oe {
1981
+ let Q, J;
1982
+ class rr extends ue {
1983
1983
  constructor() {
1984
- q ?? (q = Me({
1984
+ Q ?? (Q = Me({
1985
1985
  name: "tiling-sprite-shader",
1986
1986
  bits: [
1987
- St,
1988
- Zt,
1989
- Ue
1987
+ Pt,
1988
+ er,
1989
+ Ge
1990
1990
  ]
1991
- })), Q ?? (Q = Ge({
1991
+ })), J ?? (J = ze({
1992
1992
  name: "tiling-sprite-shader",
1993
1993
  bits: [
1994
- Pt,
1995
- er,
1996
- ze
1994
+ Ft,
1995
+ tr,
1996
+ Ae
1997
1997
  ]
1998
1998
  }));
1999
- const e = new A({
1999
+ const e = new k({
2000
2000
  uMapCoord: { value: new R(), type: "mat3x3<f32>" },
2001
2001
  uClampFrame: { value: new Float32Array([0, 0, 1, 1]), type: "vec4<f32>" },
2002
2002
  uClampOffset: { value: new Float32Array([0, 0]), type: "vec2<f32>" },
@@ -2004,10 +2004,10 @@ class tr extends oe {
2004
2004
  uSizeAnchor: { value: new Float32Array([100, 100, 0.5, 0.5]), type: "vec4<f32>" }
2005
2005
  });
2006
2006
  super({
2007
- glProgram: Q,
2008
- gpuProgram: q,
2007
+ glProgram: J,
2008
+ gpuProgram: Q,
2009
2009
  resources: {
2010
- localUniforms: new A({
2010
+ localUniforms: new k({
2011
2011
  uTransformMatrix: { value: new R(), type: "mat3x3<f32>" },
2012
2012
  uColor: { value: new Float32Array([1, 1, 1, 1]), type: "vec4<f32>" },
2013
2013
  uRound: { value: 0, type: "f32" }
@@ -2030,7 +2030,7 @@ class tr extends oe {
2030
2030
  ), c.invert(), a.uniforms.uMapCoord = d.mapCoord, a.uniforms.uClampFrame = d.uClampFrame, a.uniforms.uClampOffset = d.uClampOffset, a.uniforms.uTextureTransform = c, a.uniforms.uSizeAnchor[0] = e, a.uniforms.uSizeAnchor[1] = t, a.uniforms.uSizeAnchor[2] = i, a.uniforms.uSizeAnchor[3] = s, n && (this.resources.uTexture = n.source, this.resources.uSampler = n.source.style);
2031
2031
  }
2032
2032
  }
2033
- class rr extends ue {
2033
+ class ir extends le {
2034
2034
  constructor() {
2035
2035
  super({
2036
2036
  positions: new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
@@ -2039,11 +2039,11 @@ class rr extends ue {
2039
2039
  });
2040
2040
  }
2041
2041
  }
2042
- function ir(o, e) {
2042
+ function sr(o, e) {
2043
2043
  const t = o.anchor.x, r = o.anchor.y;
2044
2044
  e[0] = -t * o.width, e[1] = -r * o.height, e[2] = (1 - t) * o.width, e[3] = -r * o.height, e[4] = (1 - t) * o.width, e[5] = (1 - r) * o.height, e[6] = -t * o.width, e[7] = (1 - r) * o.height;
2045
2045
  }
2046
- function sr(o, e, t, r) {
2046
+ function nr(o, e, t, r) {
2047
2047
  let i = 0;
2048
2048
  const s = o.length / e, n = r.a, a = r.b, u = r.c, l = r.d, d = r.tx, c = r.ty;
2049
2049
  for (t *= e; i < s; ) {
@@ -2051,20 +2051,20 @@ function sr(o, e, t, r) {
2051
2051
  o[t] = n * h + u * f + d, o[t + 1] = a * h + l * f + c, t += e, i++;
2052
2052
  }
2053
2053
  }
2054
- function nr(o, e) {
2054
+ function ar(o, e) {
2055
2055
  const t = o.texture, r = t.frame.width, i = t.frame.height;
2056
2056
  let s = 0, n = 0;
2057
2057
  o.applyAnchorToTexture && (s = o.anchor.x, n = o.anchor.y), e[0] = e[6] = -s, e[2] = e[4] = 1 - s, e[1] = e[3] = -n, e[5] = e[7] = 1 - n;
2058
2058
  const a = R.shared;
2059
- a.copyFrom(o._tileTransform.matrix), a.tx /= o.width, a.ty /= o.height, a.invert(), a.scale(o.width / r, o.height / i), sr(e, 2, 0, a);
2059
+ a.copyFrom(o._tileTransform.matrix), a.tx /= o.width, a.ty /= o.height, a.invert(), a.scale(o.width / r, o.height / i), nr(e, 2, 0, a);
2060
2060
  }
2061
- const H = new rr();
2062
- class ar {
2061
+ const Y = new ir();
2062
+ class or {
2063
2063
  constructor() {
2064
- this.canBatch = !0, this.geometry = new ue({
2065
- indices: H.indices.slice(),
2066
- positions: H.positions.slice(),
2067
- uvs: H.uvs.slice()
2064
+ this.canBatch = !0, this.geometry = new le({
2065
+ indices: Y.indices.slice(),
2066
+ positions: Y.positions.slice(),
2067
+ uvs: Y.uvs.slice()
2068
2068
  });
2069
2069
  }
2070
2070
  destroy() {
@@ -2072,9 +2072,9 @@ class ar {
2072
2072
  this.geometry.destroy(), (e = this.shader) == null || e.destroy();
2073
2073
  }
2074
2074
  }
2075
- class tt {
2075
+ class rt {
2076
2076
  constructor(e) {
2077
- this._state = j.default2d, this._renderer = e;
2077
+ this._state = j.default2d, this._renderer = e, this._managedTilingSprites = new G({ renderer: e, type: "renderable", name: "tilingSprite" });
2078
2078
  }
2079
2079
  validateRenderable(e) {
2080
2080
  const t = this._getTilingSpriteData(e), r = t.canBatch;
@@ -2094,22 +2094,22 @@ class tt {
2094
2094
  this._updateCanBatch(e);
2095
2095
  const i = this._getTilingSpriteData(e), { geometry: s, canBatch: n } = i;
2096
2096
  if (n) {
2097
- i.batchableMesh || (i.batchableMesh = new le());
2097
+ i.batchableMesh || (i.batchableMesh = new ce());
2098
2098
  const a = i.batchableMesh;
2099
2099
  e.didViewUpdate && (this._updateBatchableMesh(e), a.geometry = s, a.renderable = e, a.transform = e.groupTransform, a.setTexture(e._texture)), a.roundPixels = this._renderer._roundPixels | e._roundPixels, r.addToBatch(a, t);
2100
2100
  } else
2101
- r.break(t), i.shader || (i.shader = new tr()), this.updateRenderable(e), t.add(e);
2101
+ r.break(t), i.shader || (i.shader = new rr()), this.updateRenderable(e), t.add(e);
2102
2102
  }
2103
2103
  execute(e) {
2104
2104
  const { shader: t } = this._getTilingSpriteData(e);
2105
2105
  t.groups[0] = this._renderer.globalUniforms.bindGroup;
2106
2106
  const r = t.resources.localUniforms.uniforms;
2107
- r.uTransformMatrix = e.groupTransform, r.uRound = this._renderer._roundPixels | e._roundPixels, $(
2107
+ r.uTransformMatrix = e.groupTransform, r.uRound = this._renderer._roundPixels | e._roundPixels, N(
2108
2108
  e.groupColorAlpha,
2109
2109
  r.uColor,
2110
2110
  0
2111
- ), this._state.blendMode = ae(e.groupBlendMode, e.texture._source), this._renderer.encoder.draw({
2112
- geometry: H,
2111
+ ), this._state.blendMode = oe(e.groupBlendMode, e.texture._source), this._renderer.encoder.draw({
2112
+ geometry: Y,
2113
2113
  shader: t,
2114
2114
  state: this._state
2115
2115
  });
@@ -2135,23 +2135,23 @@ class tt {
2135
2135
  return e._gpuData[this._renderer.uid] || this._initTilingSpriteData(e);
2136
2136
  }
2137
2137
  _initTilingSpriteData(e) {
2138
- const t = new ar();
2139
- return t.renderable = e, e._gpuData[this._renderer.uid] = t, t;
2138
+ const t = new or();
2139
+ return t.renderable = e, e._gpuData[this._renderer.uid] = t, this._managedTilingSprites.add(e), t;
2140
2140
  }
2141
2141
  _updateBatchableMesh(e) {
2142
2142
  const t = this._getTilingSpriteData(e), { geometry: r } = t, i = e.texture.source.style;
2143
- i.addressMode !== "repeat" && (i.addressMode = "repeat", i.update()), nr(e, r.uvs), ir(e, r.positions);
2143
+ i.addressMode !== "repeat" && (i.addressMode = "repeat", i.update()), ar(e, r.uvs), sr(e, r.positions);
2144
2144
  }
2145
2145
  destroy() {
2146
- this._renderer = null;
2146
+ this._managedTilingSprites.destroy(), this._renderer = null;
2147
2147
  }
2148
2148
  _updateCanBatch(e) {
2149
2149
  const t = this._getTilingSpriteData(e), r = e.texture;
2150
2150
  let i = !0;
2151
- return this._renderer.type === se.WEBGL && (i = this._renderer.context.supports.nonPowOf2wrapping), t.canBatch = r.textureMatrix.isSimple && (i || r.source.isPowerOfTwo), t.canBatch;
2151
+ return this._renderer.type === ne.WEBGL && (i = this._renderer.context.supports.nonPowOf2wrapping), t.canBatch = r.textureMatrix.isSimple && (i || r.source.isPowerOfTwo), t.canBatch;
2152
2152
  }
2153
2153
  }
2154
- tt.extension = {
2154
+ rt.extension = {
2155
2155
  type: [
2156
2156
  m.WebGLPipes,
2157
2157
  m.WebGPUPipes,
@@ -2159,7 +2159,7 @@ tt.extension = {
2159
2159
  ],
2160
2160
  name: "tilingSprite"
2161
2161
  };
2162
- const or = {
2162
+ const ur = {
2163
2163
  name: "local-uniform-msdf-bit",
2164
2164
  vertex: {
2165
2165
  header: (
@@ -2212,7 +2212,7 @@ const or = {
2212
2212
  `
2213
2213
  )
2214
2214
  }
2215
- }, ur = {
2215
+ }, lr = {
2216
2216
  name: "local-uniform-msdf-bit",
2217
2217
  vertex: {
2218
2218
  header: (
@@ -2254,7 +2254,7 @@ const or = {
2254
2254
  `
2255
2255
  )
2256
2256
  }
2257
- }, lr = {
2257
+ }, cr = {
2258
2258
  name: "msdf-bit",
2259
2259
  fragment: {
2260
2260
  header: (
@@ -2289,7 +2289,7 @@ const or = {
2289
2289
  `
2290
2290
  )
2291
2291
  }
2292
- }, cr = {
2292
+ }, dr = {
2293
2293
  name: "msdf-bit",
2294
2294
  fragment: {
2295
2295
  header: (
@@ -2325,51 +2325,51 @@ const or = {
2325
2325
  )
2326
2326
  }
2327
2327
  };
2328
- let J, Z;
2329
- class dr extends oe {
2328
+ let Z, ee;
2329
+ class hr extends ue {
2330
2330
  constructor(e) {
2331
- const t = new A({
2331
+ const t = new k({
2332
2332
  uColor: { value: new Float32Array([1, 1, 1, 1]), type: "vec4<f32>" },
2333
2333
  uTransformMatrix: { value: new R(), type: "mat3x3<f32>" },
2334
2334
  uDistance: { value: 4, type: "f32" },
2335
2335
  uRound: { value: 0, type: "f32" }
2336
2336
  });
2337
- J ?? (J = Me({
2337
+ Z ?? (Z = Me({
2338
2338
  name: "sdf-shader",
2339
2339
  bits: [
2340
- mt,
2341
- xt(e),
2342
- or,
2343
- lr,
2344
- Ue
2340
+ xt,
2341
+ _t(e),
2342
+ ur,
2343
+ cr,
2344
+ Ge
2345
2345
  ]
2346
- })), Z ?? (Z = Ge({
2346
+ })), ee ?? (ee = ze({
2347
2347
  name: "sdf-shader",
2348
2348
  bits: [
2349
- _t,
2350
- yt(e),
2351
- ur,
2352
- cr,
2353
- ze
2349
+ yt,
2350
+ bt(e),
2351
+ lr,
2352
+ dr,
2353
+ Ae
2354
2354
  ]
2355
2355
  })), super({
2356
- glProgram: Z,
2357
- gpuProgram: J,
2356
+ glProgram: ee,
2357
+ gpuProgram: Z,
2358
2358
  resources: {
2359
2359
  localUniforms: t,
2360
- batchSamplers: bt(e)
2360
+ batchSamplers: vt(e)
2361
2361
  }
2362
2362
  });
2363
2363
  }
2364
2364
  }
2365
- class hr extends vt {
2365
+ class fr extends Tt {
2366
2366
  destroy() {
2367
2367
  this.context.customShader && this.context.customShader.destroy(), super.destroy();
2368
2368
  }
2369
2369
  }
2370
- class rt {
2370
+ class it {
2371
2371
  constructor(e) {
2372
- this._renderer = e;
2372
+ this._renderer = e, this._managedBitmapTexts = new G({ renderer: e, type: "renderable", priority: -2, name: "bitmapText" });
2373
2373
  }
2374
2374
  validateRenderable(e) {
2375
2375
  const t = this._getGpuBitmapText(e);
@@ -2377,18 +2377,18 @@ class rt {
2377
2377
  }
2378
2378
  addRenderable(e, t) {
2379
2379
  const r = this._getGpuBitmapText(e);
2380
- Ce(e, r), e._didTextUpdate && (e._didTextUpdate = !1, this._updateContext(e, r)), this._renderer.renderPipes.graphics.addRenderable(r, t), r.context.customShader && this._updateDistanceField(e);
2380
+ Se(e, r), e._didTextUpdate && (e._didTextUpdate = !1, this._updateContext(e, r)), this._renderer.renderPipes.graphics.addRenderable(r, t), r.context.customShader && this._updateDistanceField(e);
2381
2381
  }
2382
2382
  updateRenderable(e) {
2383
2383
  const t = this._getGpuBitmapText(e);
2384
- Ce(e, t), this._renderer.renderPipes.graphics.updateRenderable(t), t.context.customShader && this._updateDistanceField(e);
2384
+ Se(e, t), this._renderer.renderPipes.graphics.updateRenderable(t), t.context.customShader && this._updateDistanceField(e);
2385
2385
  }
2386
2386
  _updateContext(e, t) {
2387
- const { context: r } = t, i = zt.getFont(e.text, e._style);
2388
- r.clear(), i.distanceField.type !== "none" && (r.customShader || (r.customShader = new dr(this._renderer.limits.maxBatchableTextures)));
2389
- const s = D.graphemeSegmenter(e.text), n = e._style;
2387
+ const { context: r } = t, i = At.getFont(e.text, e._style);
2388
+ r.clear(), i.distanceField.type !== "none" && (r.customShader || (r.customShader = new hr(this._renderer.limits.maxBatchableTextures)));
2389
+ const s = O.graphemeSegmenter(e.text), n = e._style;
2390
2390
  let a = i.baseLineOffset;
2391
- const u = We(s, n, i, !0), l = n.padding, d = u.scale;
2391
+ const u = Ee(s, n, i, !0), l = n.padding, d = u.scale;
2392
2392
  let c = u.width, h = u.height + u.offsetY;
2393
2393
  n._stroke && (c += n._stroke.width / d, h += n._stroke.width / d), r.translate(-e._anchor._x * c - l, -e._anchor._y * h - l).scale(d, d);
2394
2394
  const f = i.applyFillAsTint ? n._fill.color : 16777215;
@@ -2401,14 +2401,14 @@ class rt {
2401
2401
  for (let p = 0; p < g.charPositions.length; p++) {
2402
2402
  const v = g.chars[p], S = i.chars[v];
2403
2403
  if (S != null && S.texture) {
2404
- const G = S.texture;
2404
+ const z = S.texture;
2405
2405
  r.texture(
2406
- G,
2406
+ z,
2407
2407
  f || "black",
2408
2408
  Math.round(g.charPositions[p] + S.xOffset),
2409
2409
  Math.round(a + S.yOffset + b),
2410
- G.orig.width,
2411
- G.orig.height
2410
+ z.orig.width,
2411
+ z.orig.height
2412
2412
  );
2413
2413
  }
2414
2414
  }
@@ -2419,18 +2419,18 @@ class rt {
2419
2419
  return e._gpuData[this._renderer.uid] || this.initGpuText(e);
2420
2420
  }
2421
2421
  initGpuText(e) {
2422
- const t = new hr();
2423
- return e._gpuData[this._renderer.uid] = t, this._updateContext(e, t), t;
2422
+ const t = new fr();
2423
+ return e._gpuData[this._renderer.uid] = t, this._updateContext(e, t), this._managedBitmapTexts.add(e), t;
2424
2424
  }
2425
2425
  _updateDistanceField(e) {
2426
2426
  const t = this._getGpuBitmapText(e).context, r = e._style.fontFamily, i = P.get(`${r}-bitmap`), { a: s, b: n, c: a, d: u } = e.groupTransform, l = Math.sqrt(s * s + n * n), d = Math.sqrt(a * a + u * u), c = (Math.abs(l) + Math.abs(d)) / 2, h = i.baseRenderedFontSize / e._style.fontSize, f = c * i.distanceField.range * (1 / h);
2427
2427
  t.customShader.resources.localUniforms.uniforms.uDistance = f;
2428
2428
  }
2429
2429
  destroy() {
2430
- this._renderer = null;
2430
+ this._managedBitmapTexts.destroy(), this._renderer = null, this._managedBitmapTexts = null;
2431
2431
  }
2432
2432
  }
2433
- rt.extension = {
2433
+ it.extension = {
2434
2434
  type: [
2435
2435
  m.WebGLPipes,
2436
2436
  m.WebGPUPipes,
@@ -2438,37 +2438,38 @@ rt.extension = {
2438
2438
  ],
2439
2439
  name: "bitmapText"
2440
2440
  };
2441
- function Ce(o, e) {
2441
+ function Se(o, e) {
2442
2442
  e.groupTransform = o.groupTransform, e.groupColorAlpha = o.groupColorAlpha, e.groupColor = o.groupColor, e.groupBlendMode = o.groupBlendMode, e.globalDisplayStatus = o.globalDisplayStatus, e.groupTransform = o.groupTransform, e.localDisplayStatus = o.localDisplayStatus, e.groupAlpha = o.groupAlpha, e._roundPixels = o._roundPixels;
2443
2443
  }
2444
- class fr extends Ae {
2445
- /**
2446
- * Creates an instance of BatchableHTMLText.
2447
- * @param renderer - The renderer instance to be used.
2448
- */
2449
- constructor(e) {
2450
- super(), this.generatingTexture = !1, this.currentKey = "--", this._renderer = e, e.runners.resolutionChange.add(this);
2451
- }
2452
- /** Handles resolution changes for the HTML text. If the text has auto resolution enabled, it triggers a view update. */
2453
- resolutionChange() {
2454
- const e = this.renderable;
2455
- e._autoResolution && e.onViewUpdate();
2444
+ class pr extends ke {
2445
+ constructor() {
2446
+ super(...arguments), this.generatingTexture = !1, this.currentKey = "--";
2456
2447
  }
2457
2448
  /** Destroys the BatchableHTMLText instance. Returns the texture promise to the renderer and cleans up references. */
2458
2449
  destroy() {
2459
- const { htmlText: e } = this._renderer;
2460
- e.getReferenceCount(this.currentKey) === null ? e.returnTexturePromise(this.texturePromise) : e.decreaseReferenceCount(this.currentKey), this._renderer.runners.resolutionChange.remove(this), this.texturePromise = null, this._renderer = null;
2450
+ this.texturePromise = null, this.generatingTexture = !1, this.currentKey = "--", super.destroy();
2461
2451
  }
2462
2452
  }
2463
- function re(o, e) {
2453
+ function ie(o, e) {
2464
2454
  const { texture: t, bounds: r } = o, i = e._style._getFinalPadding();
2465
- Tt(r, e._anchor, t);
2455
+ wt(r, e._anchor, t);
2466
2456
  const s = e._anchor._x * i * 2, n = e._anchor._y * i * 2;
2467
2457
  r.minX -= i - s, r.minY -= i - n, r.maxX -= i - s, r.maxY -= i - n;
2468
2458
  }
2469
- class it {
2459
+ class st {
2470
2460
  constructor(e) {
2471
- this._renderer = e;
2461
+ this._renderer = e, e.runners.resolutionChange.add(this), this._managedTexts = new G({
2462
+ renderer: e,
2463
+ type: "renderable",
2464
+ onUnload: this.onTextUnload.bind(this),
2465
+ name: "htmlText"
2466
+ });
2467
+ }
2468
+ resolutionChange() {
2469
+ for (const e in this._managedTexts.items) {
2470
+ const t = this._managedTexts.items[e];
2471
+ t != null && t._autoResolution && t.onViewUpdate();
2472
+ }
2472
2473
  }
2473
2474
  validateRenderable(e) {
2474
2475
  const t = this._getGpuText(e), r = e.styleKey;
@@ -2480,7 +2481,7 @@ class it {
2480
2481
  const i = e._autoResolution ? this._renderer.resolution : e.resolution;
2481
2482
  (r.currentKey !== e.styleKey || e.resolution !== i) && this._updateGpuText(e).catch((s) => {
2482
2483
  console.error(s);
2483
- }), e._didTextUpdate = !1, re(r, e);
2484
+ }), e._didTextUpdate = !1, ie(r, e);
2484
2485
  }
2485
2486
  this._renderer.renderPipes.batch.addToBatch(r, t);
2486
2487
  }
@@ -2500,20 +2501,27 @@ class it {
2500
2501
  this._renderer.htmlText.decreaseReferenceCount(t.currentKey), this._renderer.htmlText.returnTexturePromise(r);
2501
2502
  })), t.texturePromise = i, t.currentKey = e.styleKey, t.texture = await i;
2502
2503
  const s = e.renderGroup || e.parentRenderGroup;
2503
- s && (s.structureDidChange = !0), t.generatingTexture = !1, re(t, e);
2504
+ s && (s.structureDidChange = !0), t.generatingTexture = !1, ie(t, e);
2504
2505
  }
2505
2506
  _getGpuText(e) {
2506
2507
  return e._gpuData[this._renderer.uid] || this.initGpuText(e);
2507
2508
  }
2508
2509
  initGpuText(e) {
2509
- const t = new fr(this._renderer);
2510
- return t.renderable = e, t.transform = e.groupTransform, t.texture = C.EMPTY, t.bounds = { minX: 0, maxX: 1, minY: 0, maxY: 0 }, t.roundPixels = this._renderer._roundPixels | e._roundPixels, e._resolution = e._autoResolution ? this._renderer.resolution : e.resolution, e._gpuData[this._renderer.uid] = t, t;
2510
+ const t = new pr();
2511
+ return t.renderable = e, t.transform = e.groupTransform, t.texture = C.EMPTY, t.bounds = { minX: 0, maxX: 1, minY: 0, maxY: 0 }, t.roundPixels = this._renderer._roundPixels | e._roundPixels, e._resolution = e._autoResolution ? this._renderer.resolution : e.resolution, e._gpuData[this._renderer.uid] = t, this._managedTexts.add(e), t;
2512
+ }
2513
+ onTextUnload(e) {
2514
+ const t = e._gpuData[this._renderer.uid];
2515
+ if (!t)
2516
+ return;
2517
+ const { htmlText: r } = this._renderer;
2518
+ r.getReferenceCount(t.currentKey) === null ? r.returnTexturePromise(t.texturePromise) : r.decreaseReferenceCount(t.currentKey);
2511
2519
  }
2512
2520
  destroy() {
2513
- this._renderer = null;
2521
+ this._managedTexts.destroy(), this._renderer = null;
2514
2522
  }
2515
2523
  }
2516
- it.extension = {
2524
+ st.extension = {
2517
2525
  type: [
2518
2526
  m.WebGLPipes,
2519
2527
  m.WebGPUPipes,
@@ -2521,13 +2529,13 @@ it.extension = {
2521
2529
  ],
2522
2530
  name: "htmlText"
2523
2531
  };
2524
- function pr() {
2525
- const { userAgent: o } = ne.get().getNavigator();
2532
+ function gr() {
2533
+ const { userAgent: o } = ae.get().getNavigator();
2526
2534
  return /^((?!chrome|android).)*safari/i.test(o);
2527
2535
  }
2528
- const gr = new Re();
2529
- function st(o, e, t, r) {
2530
- const i = gr;
2536
+ const mr = new Ue();
2537
+ function nt(o, e, t, r) {
2538
+ const i = mr;
2531
2539
  i.minX = 0, i.minY = 0, i.maxX = o.width / r | 0, i.maxY = o.height / r | 0;
2532
2540
  const s = F.getOptimalTexture(
2533
2541
  i.width,
@@ -2537,7 +2545,7 @@ function st(o, e, t, r) {
2537
2545
  );
2538
2546
  return s.source.uploadMethodId = "image", s.source.resource = o, s.source.alphaMode = "premultiply-alpha-on-upload", s.frame.width = e / r, s.frame.height = t / r, s.source.emit("update", s.source), s.updateUvs(), s;
2539
2547
  }
2540
- function mr(o, e) {
2548
+ function xr(o, e) {
2541
2549
  const t = e.fontFamily, r = [], i = {}, s = /font-family:([^;"\s]+)/g, n = o.match(s);
2542
2550
  function a(u) {
2543
2551
  i[u] || (r.push(u), i[u] = !0);
@@ -2557,14 +2565,14 @@ function mr(o, e) {
2557
2565
  }
2558
2566
  return r;
2559
2567
  }
2560
- async function xr(o) {
2561
- const t = await (await ne.get().fetch(o)).blob(), r = new FileReader();
2568
+ async function _r(o) {
2569
+ const t = await (await ae.get().fetch(o)).blob(), r = new FileReader();
2562
2570
  return await new Promise((s, n) => {
2563
2571
  r.onloadend = () => s(r.result), r.onerror = n, r.readAsDataURL(t);
2564
2572
  });
2565
2573
  }
2566
- async function _r(o, e) {
2567
- const t = await xr(e);
2574
+ async function yr(o, e) {
2575
+ const t = await _r(e);
2568
2576
  return `@font-face {
2569
2577
  font-family: "${o.fontFamily}";
2570
2578
  font-weight: ${o.fontWeight};
@@ -2572,16 +2580,16 @@ async function _r(o, e) {
2572
2580
  src: url('${t}');
2573
2581
  }`;
2574
2582
  }
2575
- const ee = /* @__PURE__ */ new Map();
2576
- async function yr(o) {
2583
+ const te = /* @__PURE__ */ new Map();
2584
+ async function br(o) {
2577
2585
  const e = o.filter((t) => P.has(`${t}-and-url`)).map((t) => {
2578
- if (!ee.has(t)) {
2586
+ if (!te.has(t)) {
2579
2587
  const { entries: r } = P.get(`${t}-and-url`), i = [];
2580
2588
  r.forEach((s) => {
2581
2589
  const n = s.url, u = s.faces.map((l) => ({ weight: l.weight, style: l.style }));
2582
2590
  i.push(
2583
2591
  ...u.map(
2584
- (l) => _r(
2592
+ (l) => yr(
2585
2593
  {
2586
2594
  fontWeight: l.weight,
2587
2595
  fontStyle: l.style,
@@ -2591,41 +2599,41 @@ async function yr(o) {
2591
2599
  )
2592
2600
  )
2593
2601
  );
2594
- }), ee.set(
2602
+ }), te.set(
2595
2603
  t,
2596
2604
  Promise.all(i).then((s) => s.join(`
2597
2605
  `))
2598
2606
  );
2599
2607
  }
2600
- return ee.get(t);
2608
+ return te.get(t);
2601
2609
  });
2602
2610
  return (await Promise.all(e)).join(`
2603
2611
  `);
2604
2612
  }
2605
- function br(o, e, t, r, i) {
2613
+ function vr(o, e, t, r, i) {
2606
2614
  const { domElement: s, styleElement: n, svgRoot: a } = i;
2607
2615
  s.innerHTML = `<style>${e.cssStyle}</style><div style='padding:0;'>${o}</div>`, s.setAttribute("style", `transform: scale(${t});transform-origin: top left; display: inline-block`), n.textContent = r;
2608
2616
  const { width: u, height: l } = i.image;
2609
2617
  return a.setAttribute("width", u.toString()), a.setAttribute("height", l.toString()), new XMLSerializer().serializeToString(a);
2610
2618
  }
2611
- function vr(o, e) {
2612
- const t = Y.getOptimalCanvasAndContext(
2619
+ function Tr(o, e) {
2620
+ const t = X.getOptimalCanvasAndContext(
2613
2621
  o.width,
2614
2622
  o.height,
2615
2623
  e
2616
2624
  ), { context: r } = t;
2617
2625
  return r.clearRect(0, 0, o.width, o.height), r.drawImage(o, 0, 0), t;
2618
2626
  }
2619
- function Tr(o, e, t) {
2627
+ function wr(o, e, t) {
2620
2628
  return new Promise(async (r) => {
2621
2629
  t && await new Promise((i) => setTimeout(i, 100)), o.onload = () => {
2622
2630
  r();
2623
2631
  }, o.src = `data:image/svg+xml;charset=utf8,${encodeURIComponent(e)}`, o.crossOrigin = "anonymous";
2624
2632
  });
2625
2633
  }
2626
- class nt {
2634
+ class at {
2627
2635
  constructor(e) {
2628
- this._activeTextures = {}, this._renderer = e, this._createCanvas = e.type === se.WEBGPU;
2636
+ this._activeTextures = {}, this._renderer = e, this._createCanvas = e.type === ne.WEBGPU;
2629
2637
  }
2630
2638
  /**
2631
2639
  * @param options
@@ -2671,7 +2679,7 @@ class nt {
2671
2679
  t && (t.usageCount--, t.usageCount === 0 && (t.texture ? this._cleanUp(t.texture) : t.promise.then((r) => {
2672
2680
  t.texture = r, this._cleanUp(t.texture);
2673
2681
  }).catch(() => {
2674
- X("HTMLTextSystem: Failed to clean texture");
2682
+ K("HTMLTextSystem: Failed to clean texture");
2675
2683
  }), this._activeTextures[e] = null));
2676
2684
  }
2677
2685
  /**
@@ -2683,26 +2691,26 @@ class nt {
2683
2691
  return this._buildTexturePromise(e);
2684
2692
  }
2685
2693
  async _buildTexturePromise(e) {
2686
- const { text: t, style: r, resolution: i, textureStyle: s } = e, n = K.get(Ye), a = mr(t, r), u = await yr(a), l = Et(t, r, u, n), d = Math.ceil(Math.ceil(Math.max(1, l.width) + r.padding * 2) * i), c = Math.ceil(Math.ceil(Math.max(1, l.height) + r.padding * 2) * i), h = n.image, f = 2;
2694
+ const { text: t, style: r, resolution: i, textureStyle: s } = e, n = $.get(Xe), a = xr(t, r), u = await br(a), l = Vt(t, r, u, n), d = Math.ceil(Math.ceil(Math.max(1, l.width) + r.padding * 2) * i), c = Math.ceil(Math.ceil(Math.max(1, l.height) + r.padding * 2) * i), h = n.image, f = 2;
2687
2695
  h.width = (d | 0) + f, h.height = (c | 0) + f;
2688
- const y = br(t, r, i, u, n);
2689
- await Tr(h, y, pr() && a.length > 0);
2696
+ const y = vr(t, r, i, u, n);
2697
+ await wr(h, y, gr() && a.length > 0);
2690
2698
  const _ = h;
2691
2699
  let b;
2692
- this._createCanvas && (b = vr(h, i));
2693
- const x = st(
2700
+ this._createCanvas && (b = Tr(h, i));
2701
+ const x = nt(
2694
2702
  b ? b.canvas : _,
2695
2703
  h.width - f,
2696
2704
  h.height - f,
2697
2705
  i
2698
2706
  );
2699
- return s && (x.source.style = s), this._createCanvas && (this._renderer.texture.initSource(x.source), Y.returnCanvasAndContext(b)), K.return(n), x;
2707
+ return s && (x.source.style = s), this._createCanvas && (this._renderer.texture.initSource(x.source), X.returnCanvasAndContext(b)), $.return(n), x;
2700
2708
  }
2701
2709
  returnTexturePromise(e) {
2702
2710
  e.then((t) => {
2703
2711
  this._cleanUp(t);
2704
2712
  }).catch(() => {
2705
- X("HTMLTextSystem: Failed to clean texture");
2713
+ K("HTMLTextSystem: Failed to clean texture");
2706
2714
  });
2707
2715
  }
2708
2716
  _cleanUp(e) {
@@ -2715,7 +2723,7 @@ class nt {
2715
2723
  this._activeTextures = null;
2716
2724
  }
2717
2725
  }
2718
- nt.extension = {
2726
+ at.extension = {
2719
2727
  type: [
2720
2728
  m.WebGLSystem,
2721
2729
  m.WebGPUSystem,
@@ -2723,22 +2731,22 @@ nt.extension = {
2723
2731
  ],
2724
2732
  name: "htmlText"
2725
2733
  };
2726
- class wr extends Ae {
2734
+ class Cr extends ke {
2735
+ }
2736
+ class ot {
2727
2737
  constructor(e) {
2728
- super(), this._renderer = e, e.runners.resolutionChange.add(this);
2738
+ this._renderer = e, e.runners.resolutionChange.add(this), this._managedTexts = new G({
2739
+ renderer: e,
2740
+ type: "renderable",
2741
+ onUnload: this.onTextUnload.bind(this),
2742
+ name: "canvasText"
2743
+ });
2729
2744
  }
2730
2745
  resolutionChange() {
2731
- const e = this.renderable;
2732
- e._autoResolution && e.onViewUpdate();
2733
- }
2734
- destroy() {
2735
- const { canvasText: e } = this._renderer;
2736
- e.getReferenceCount(this.currentKey) > 0 ? e.decreaseReferenceCount(this.currentKey) : this.texture && e.returnTexture(this.texture), this._renderer.runners.resolutionChange.remove(this), this._renderer = null;
2737
- }
2738
- }
2739
- class at {
2740
- constructor(e) {
2741
- this._renderer = e;
2746
+ for (const e in this._managedTexts.items) {
2747
+ const t = this._managedTexts.items[e];
2748
+ t != null && t._autoResolution && t.onViewUpdate();
2749
+ }
2742
2750
  }
2743
2751
  validateRenderable(e) {
2744
2752
  const t = this._getGpuText(e), r = e.styleKey;
@@ -2748,7 +2756,7 @@ class at {
2748
2756
  const r = this._getGpuText(e);
2749
2757
  if (e._didTextUpdate) {
2750
2758
  const i = e._autoResolution ? this._renderer.resolution : e.resolution;
2751
- (r.currentKey !== e.styleKey || e.resolution !== i) && this._updateGpuText(e), e._didTextUpdate = !1, re(r, e);
2759
+ (r.currentKey !== e.styleKey || e.resolution !== i) && this._updateGpuText(e), e._didTextUpdate = !1, ie(r, e);
2752
2760
  }
2753
2761
  this._renderer.renderPipes.batch.addToBatch(r, t);
2754
2762
  }
@@ -2764,14 +2772,21 @@ class at {
2764
2772
  return e._gpuData[this._renderer.uid] || this.initGpuText(e);
2765
2773
  }
2766
2774
  initGpuText(e) {
2767
- const t = new wr(this._renderer);
2768
- return t.currentKey = "--", t.renderable = e, t.transform = e.groupTransform, t.bounds = { minX: 0, maxX: 1, minY: 0, maxY: 0 }, t.roundPixels = this._renderer._roundPixels | e._roundPixels, e._gpuData[this._renderer.uid] = t, t;
2775
+ const t = new Cr();
2776
+ return t.currentKey = "--", t.renderable = e, t.transform = e.groupTransform, t.bounds = { minX: 0, maxX: 1, minY: 0, maxY: 0 }, t.roundPixels = this._renderer._roundPixels | e._roundPixels, e._gpuData[this._renderer.uid] = t, this._managedTexts.add(e), t;
2777
+ }
2778
+ onTextUnload(e) {
2779
+ const t = e._gpuData[this._renderer.uid];
2780
+ if (!t)
2781
+ return;
2782
+ const { canvasText: r } = this._renderer;
2783
+ r.getReferenceCount(t.currentKey) > 0 ? r.decreaseReferenceCount(t.currentKey) : t.texture && r.returnTexture(t.texture);
2769
2784
  }
2770
2785
  destroy() {
2771
- this._renderer = null;
2786
+ this._managedTexts.destroy(), this._renderer = null;
2772
2787
  }
2773
2788
  }
2774
- at.extension = {
2789
+ ot.extension = {
2775
2790
  type: [
2776
2791
  m.WebGLPipes,
2777
2792
  m.WebGPUPipes,
@@ -2779,7 +2794,7 @@ at.extension = {
2779
2794
  ],
2780
2795
  name: "text"
2781
2796
  };
2782
- class ot {
2797
+ class ut {
2783
2798
  constructor(e) {
2784
2799
  this._activeTextures = {}, this._renderer = e;
2785
2800
  }
@@ -2788,17 +2803,17 @@ class ot {
2788
2803
  text: e,
2789
2804
  style: r,
2790
2805
  resolution: t
2791
- }), e.style instanceof W || (e.style = new W(e.style)), e.textureStyle instanceof I || (e.textureStyle = new I(e.textureStyle)), typeof e.text != "string" && (e.text = e.text.toString());
2792
- const { text: s, style: n, textureStyle: a } = e, u = e.resolution ?? this._renderer.resolution, { frame: l, canvasAndContext: d } = N.getCanvasAndContext({
2806
+ }), e.style instanceof E || (e.style = new E(e.style)), e.textureStyle instanceof W || (e.textureStyle = new W(e.textureStyle)), typeof e.text != "string" && (e.text = e.text.toString());
2807
+ const { text: s, style: n, textureStyle: a } = e, u = e.resolution ?? this._renderer.resolution, { frame: l, canvasAndContext: d } = q.getCanvasAndContext({
2793
2808
  text: s,
2794
2809
  style: n,
2795
2810
  resolution: u
2796
- }), c = st(d.canvas, l.width, l.height, u);
2811
+ }), c = nt(d.canvas, l.width, l.height, u);
2797
2812
  if (a && (c.source.style = a), n.trim && (l.pad(n.padding), c.frame.copyFrom(l), c.frame.scale(1 / u), c.updateUvs()), n.filters) {
2798
2813
  const h = this._applyFilters(c, n.filters);
2799
- return this.returnTexture(c), N.returnCanvasAndContext(d), h;
2814
+ return this.returnTexture(c), q.returnCanvasAndContext(d), h;
2800
2815
  }
2801
- return this._renderer.texture.initSource(c._source), N.returnCanvasAndContext(d), c;
2816
+ return this._renderer.texture.initSource(c._source), q.returnCanvasAndContext(d), c;
2802
2817
  }
2803
2818
  /**
2804
2819
  * Returns a texture that was created wit the above `getTexture` function.
@@ -2894,7 +2909,7 @@ class ot {
2894
2909
  this._activeTextures = null;
2895
2910
  }
2896
2911
  }
2897
- ot.extension = {
2912
+ ut.extension = {
2898
2913
  type: [
2899
2914
  m.WebGLSystem,
2900
2915
  m.WebGPUSystem,
@@ -2902,19 +2917,19 @@ ot.extension = {
2902
2917
  ],
2903
2918
  name: "canvasText"
2904
2919
  };
2905
- T.add(ke);
2906
2920
  T.add(De);
2907
- T.add(Xe);
2908
- T.add(wt);
2909
- T.add($e);
2910
- T.add(qe);
2921
+ T.add(Oe);
2922
+ T.add(Ke);
2923
+ T.add(Ct);
2924
+ T.add(Ne);
2911
2925
  T.add(Qe);
2926
+ T.add(Je);
2927
+ T.add(ut);
2912
2928
  T.add(ot);
2929
+ T.add(it);
2913
2930
  T.add(at);
2931
+ T.add(st);
2914
2932
  T.add(rt);
2915
- T.add(nt);
2916
- T.add(it);
2917
2933
  T.add(tt);
2918
- T.add(et);
2934
+ T.add(Le);
2919
2935
  T.add(Ve);
2920
- T.add(Ee);