aoi-comp 1.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.
@@ -0,0 +1,2572 @@
1
+ import { B as e, C as t, D as n, G as r, H as i, I as a, J as o, L as s, P as c, Q as l, R as u, T as d, V as f, W as p, Y as m, Z as h, _ as g, b as _, d as v, et as y, f as b, h as ee, i as te, it as x, j as ne, k as re, l as S, m as ie, n as ae, nt as oe, o as se, r as C, rt as w, s as ce, t as le, tt as ue, u as de, w as fe, x as pe, y as me, z as T } from "./Geometry-CN7W9DnD.js";
2
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/environment/autoDetectEnvironment.mjs
3
+ var E = [];
4
+ x.handleByNamedList(w.Environment, E);
5
+ async function he(e) {
6
+ if (!e) for (let e = 0; e < E.length; e++) {
7
+ let t = E[e];
8
+ if (t.value.test()) {
9
+ await t.value.load();
10
+ return;
11
+ }
12
+ }
13
+ }
14
+ //#endregion
15
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/utils/browser/unsafeEvalSupported.mjs
16
+ var D;
17
+ function ge() {
18
+ if (typeof D == "boolean") return D;
19
+ try {
20
+ D = Function("param1", "param2", "param3", "return param1[param2] === param3;")({ a: "b" }, "a", "b") === !0;
21
+ } catch {
22
+ D = !1;
23
+ }
24
+ return D;
25
+ }
26
+ //#endregion
27
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/const.mjs
28
+ var O = /* @__PURE__ */ ((e) => (e[e.NONE = 0] = "NONE", e[e.COLOR = 16384] = "COLOR", e[e.STENCIL = 1024] = "STENCIL", e[e.DEPTH = 256] = "DEPTH", e[e.COLOR_DEPTH = 16640] = "COLOR_DEPTH", e[e.COLOR_STENCIL = 17408] = "COLOR_STENCIL", e[e.DEPTH_STENCIL = 1280] = "DEPTH_STENCIL", e[e.ALL = 17664] = "ALL", e))(O || {}), _e = class {
29
+ constructor(e) {
30
+ this.items = [], this._name = e;
31
+ }
32
+ emit(e, t, n, r, i, a, o, s) {
33
+ let { name: c, items: l } = this;
34
+ for (let u = 0, d = l.length; u < d; u++) l[u][c](e, t, n, r, i, a, o, s);
35
+ return this;
36
+ }
37
+ add(e) {
38
+ return e[this._name] && (this.remove(e), this.items.push(e)), this;
39
+ }
40
+ remove(e) {
41
+ let t = this.items.indexOf(e);
42
+ return t !== -1 && this.items.splice(t, 1), this;
43
+ }
44
+ contains(e) {
45
+ return this.items.indexOf(e) !== -1;
46
+ }
47
+ removeAll() {
48
+ return this.items.length = 0, this;
49
+ }
50
+ destroy() {
51
+ this.removeAll(), this.items = null, this._name = null;
52
+ }
53
+ get empty() {
54
+ return this.items.length === 0;
55
+ }
56
+ get name() {
57
+ return this._name;
58
+ }
59
+ }, ve = [
60
+ "init",
61
+ "destroy",
62
+ "contextChange",
63
+ "resolutionChange",
64
+ "resetState",
65
+ "renderEnd",
66
+ "renderStart",
67
+ "render",
68
+ "update",
69
+ "postrender",
70
+ "prerender"
71
+ ], ye = class e extends oe {
72
+ constructor(e) {
73
+ super(), this.tick = 0, this.uid = h("renderer"), this.runners = /* @__PURE__ */ Object.create(null), this.renderPipes = /* @__PURE__ */ Object.create(null), this._initOptions = {}, this._systemsHash = /* @__PURE__ */ Object.create(null), this.type = e.type, this.name = e.name, this.config = e;
74
+ let t = [...ve, ...this.config.runners ?? []];
75
+ this._addRunners(...t), this._unsafeEvalCheck();
76
+ }
77
+ async init(t = {}) {
78
+ await he(t.skipExtensionImports === !0 || t.manageImports === !1), this._addSystems(this.config.systems), this._addPipes(this.config.renderPipes, this.config.renderPipeAdaptors);
79
+ for (let e in this._systemsHash) t = {
80
+ ...this._systemsHash[e].constructor.defaultOptions,
81
+ ...t
82
+ };
83
+ t = {
84
+ ...e.defaultOptions,
85
+ ...t
86
+ }, this._roundPixels = +!!t.roundPixels;
87
+ for (let e = 0; e < this.runners.init.items.length; e++) await this.runners.init.items[e].init(t);
88
+ this._initOptions = t;
89
+ }
90
+ render(e, n) {
91
+ this.tick++;
92
+ let r = e;
93
+ if (r instanceof t && (r = { container: r }, n && (o(m, "passing a second argument is deprecated, please use render options instead"), r.target = n.renderTexture)), r.target ||= this.view.renderTarget, r.target === this.view.renderTarget && (this._lastObjectRendered = r.container, r.clearColor ??= this.background.colorRgba, r.clear ??= this.background.clearBeforeRender), r.clearColor) {
94
+ let e = Array.isArray(r.clearColor) && r.clearColor.length === 4;
95
+ r.clearColor = e ? r.clearColor : T.shared.setValue(r.clearColor).toArray();
96
+ }
97
+ r.transform || (r.container.updateLocalTransform(), r.transform = r.container.localTransform), r.container.visible && (r.container.enableRenderGroup(), this.runners.prerender.emit(r), this.runners.renderStart.emit(r), this.runners.render.emit(r), this.runners.renderEnd.emit(r), this.runners.postrender.emit(r));
98
+ }
99
+ resize(e, t, n) {
100
+ let r = this.view.resolution;
101
+ this.view.resize(e, t, n), this.emit("resize", this.view.screen.width, this.view.screen.height, this.view.resolution), n !== void 0 && n !== r && this.runners.resolutionChange.emit(n);
102
+ }
103
+ clear(e = {}) {
104
+ let t = this;
105
+ e.target ||= t.renderTarget.renderTarget, e.clearColor ||= this.background.colorRgba, e.clear ??= O.ALL;
106
+ let { clear: n, clearColor: r, target: i, mipLevel: a, layer: o } = e;
107
+ T.shared.setValue(r ?? this.background.colorRgba), t.renderTarget.clear(i, n, T.shared.toArray(), a ?? 0, o ?? 0);
108
+ }
109
+ get resolution() {
110
+ return this.view.resolution;
111
+ }
112
+ set resolution(e) {
113
+ this.view.resolution = e, this.runners.resolutionChange.emit(e);
114
+ }
115
+ get width() {
116
+ return this.view.texture.frame.width;
117
+ }
118
+ get height() {
119
+ return this.view.texture.frame.height;
120
+ }
121
+ get canvas() {
122
+ return this.view.canvas;
123
+ }
124
+ get lastObjectRendered() {
125
+ return this._lastObjectRendered;
126
+ }
127
+ get renderingToScreen() {
128
+ return this.renderTarget.renderingToScreen;
129
+ }
130
+ get screen() {
131
+ return this.view.screen;
132
+ }
133
+ _addRunners(...e) {
134
+ e.forEach((e) => {
135
+ this.runners[e] = new _e(e);
136
+ });
137
+ }
138
+ _addSystems(e) {
139
+ let t;
140
+ for (t in e) {
141
+ let n = e[t];
142
+ this._addSystem(n.value, n.name);
143
+ }
144
+ }
145
+ _addSystem(e, t) {
146
+ let n = new e(this);
147
+ if (this[t]) throw Error(`Whoops! The name "${t}" is already in use`);
148
+ this[t] = n, this._systemsHash[t] = n;
149
+ for (let e in this.runners) this.runners[e].add(n);
150
+ return this;
151
+ }
152
+ _addPipes(e, t) {
153
+ let n = t.reduce((e, t) => (e[t.name] = t.value, e), {});
154
+ e.forEach((e) => {
155
+ let t = e.value, r = e.name, i = n[r];
156
+ this.renderPipes[r] = new t(this, i ? new i() : null), this.runners.destroy.add(this.renderPipes[r]);
157
+ });
158
+ }
159
+ destroy(e = !1) {
160
+ this.runners.destroy.items.reverse(), this.runners.destroy.emit(e), (e === !0 || typeof e == "object" && e.releaseGlobalResources) && s.release(), Object.values(this.runners).forEach((e) => {
161
+ e.destroy();
162
+ }), this._systemsHash = null, this.renderPipes = null, this.removeAllListeners();
163
+ }
164
+ generateTexture(e) {
165
+ return this.textureGenerator.generateTexture(e);
166
+ }
167
+ get roundPixels() {
168
+ return !!this._roundPixels;
169
+ }
170
+ _unsafeEvalCheck() {
171
+ if (!ge()) throw Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.");
172
+ }
173
+ resetState() {
174
+ this.runners.resetState.emit();
175
+ }
176
+ };
177
+ ye.defaultOptions = {
178
+ resolution: 1,
179
+ failIfMajorPerformanceCaveat: !1,
180
+ roundPixels: !1
181
+ };
182
+ var be = ye, k = "8.20.1", xe = class {
183
+ static init() {
184
+ globalThis.__PIXI_APP_INIT__?.(this, k);
185
+ }
186
+ static destroy() {}
187
+ };
188
+ xe.extension = w.Application;
189
+ var Se = class {
190
+ constructor(e) {
191
+ this._renderer = e;
192
+ }
193
+ init() {
194
+ globalThis.__PIXI_RENDERER_INIT__?.(this._renderer, k);
195
+ }
196
+ destroy() {
197
+ this._renderer = null;
198
+ }
199
+ };
200
+ Se.extension = {
201
+ type: [w.WebGLSystem, w.WebGPUSystem],
202
+ name: "initHook",
203
+ priority: -10
204
+ };
205
+ //#endregion
206
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/utils/data/ViewableBuffer.mjs
207
+ var Ce = class {
208
+ constructor(e) {
209
+ typeof e == "number" ? this.rawBinaryData = new ArrayBuffer(e) : e instanceof Uint8Array ? this.rawBinaryData = e.buffer : this.rawBinaryData = e, this.uint32View = new Uint32Array(this.rawBinaryData), this.float32View = new Float32Array(this.rawBinaryData), this.size = this.rawBinaryData.byteLength;
210
+ }
211
+ get int8View() {
212
+ return this._int8View ||= new Int8Array(this.rawBinaryData), this._int8View;
213
+ }
214
+ get uint8View() {
215
+ return this._uint8View ||= new Uint8Array(this.rawBinaryData), this._uint8View;
216
+ }
217
+ get int16View() {
218
+ return this._int16View ||= new Int16Array(this.rawBinaryData), this._int16View;
219
+ }
220
+ get int32View() {
221
+ return this._int32View ||= new Int32Array(this.rawBinaryData), this._int32View;
222
+ }
223
+ get float64View() {
224
+ return this._float64Array ||= new Float64Array(this.rawBinaryData), this._float64Array;
225
+ }
226
+ get bigUint64View() {
227
+ return this._bigUint64Array ||= new BigUint64Array(this.rawBinaryData), this._bigUint64Array;
228
+ }
229
+ view(e) {
230
+ return this[`${e}View`];
231
+ }
232
+ destroy() {
233
+ this.rawBinaryData = null, this.uint32View = null, this.float32View = null, this.uint16View = null, this._int8View = null, this._uint8View = null, this._int16View = null, this._int32View = null, this._float64Array = null, this._bigUint64Array = null;
234
+ }
235
+ static sizeOf(e) {
236
+ switch (e) {
237
+ case "int8":
238
+ case "uint8": return 1;
239
+ case "int16":
240
+ case "uint16": return 2;
241
+ case "int32":
242
+ case "uint32":
243
+ case "float32": return 4;
244
+ default: throw Error(`${e} isn't a valid view type`);
245
+ }
246
+ }
247
+ };
248
+ //#endregion
249
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/shared/buffer/utils/fastCopy.mjs
250
+ function A(e, t, n, r) {
251
+ if (n ??= 0, r ??= Math.min(e.byteLength - n, t.byteLength), !(n & 7) && !(r & 7)) {
252
+ let i = r / 8;
253
+ new Float64Array(t, 0, i).set(new Float64Array(e, n, i));
254
+ } else if (!(n & 3) && !(r & 3)) {
255
+ let i = r / 4;
256
+ new Float32Array(t, 0, i).set(new Float32Array(e, n, i));
257
+ } else new Uint8Array(t).set(new Uint8Array(e, n, r));
258
+ }
259
+ //#endregion
260
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/shared/state/const.mjs
261
+ var we = {
262
+ normal: "normal-npm",
263
+ add: "add-npm",
264
+ screen: "screen-npm"
265
+ }, j = /* @__PURE__ */ ((e) => (e[e.DISABLED = 0] = "DISABLED", e[e.RENDERING_MASK_ADD = 1] = "RENDERING_MASK_ADD", e[e.MASK_ACTIVE = 2] = "MASK_ACTIVE", e[e.INVERSE_MASK_ACTIVE = 3] = "INVERSE_MASK_ACTIVE", e[e.RENDERING_MASK_REMOVE = 4] = "RENDERING_MASK_REMOVE", e[e.NONE = 5] = "NONE", e))(j || {});
266
+ //#endregion
267
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/shared/state/getAdjustedBlendModeBlend.mjs
268
+ function Te(e, t) {
269
+ return t.alphaMode === "no-premultiply-alpha" && we[e] || e;
270
+ }
271
+ //#endregion
272
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/batcher/gl/utils/checkMaxIfStatementsInShader.mjs
273
+ var Ee = [
274
+ "precision mediump float;",
275
+ "void main(void){",
276
+ "float test = 0.1;",
277
+ "%forloop%",
278
+ "gl_FragColor = vec4(0.0);",
279
+ "}"
280
+ ].join("\n");
281
+ function De(e) {
282
+ let t = "";
283
+ for (let n = 0; n < e; ++n) n > 0 && (t += "\nelse "), n < e - 1 && (t += `if(test == ${n}.0){}`);
284
+ return t;
285
+ }
286
+ function Oe(e, t) {
287
+ if (e === 0) throw Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");
288
+ let n = t.createShader(t.FRAGMENT_SHADER);
289
+ try {
290
+ for (;;) {
291
+ let r = Ee.replace(/%forloop%/gi, De(e));
292
+ if (t.shaderSource(n, r), t.compileShader(n), !t.getShaderParameter(n, t.COMPILE_STATUS)) e = e / 2 | 0;
293
+ else break;
294
+ }
295
+ } finally {
296
+ t.deleteShader(n);
297
+ }
298
+ return e;
299
+ }
300
+ //#endregion
301
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/batcher/gl/utils/maxRecommendedTextures.mjs
302
+ var M = null;
303
+ function ke() {
304
+ if (M) return M;
305
+ let e = ee();
306
+ return M = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS), M = Oe(M, e), e.getExtension("WEBGL_lose_context")?.loseContext(), M;
307
+ }
308
+ //#endregion
309
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/batcher/shared/BatchTextureArray.mjs
310
+ var Ae = class {
311
+ constructor() {
312
+ this.ids = /* @__PURE__ */ Object.create(null), this.textures = [], this.count = 0;
313
+ }
314
+ clear() {
315
+ for (let e = 0; e < this.count; e++) {
316
+ let t = this.textures[e];
317
+ this.textures[e] = null, this.ids[t.uid] = null;
318
+ }
319
+ this.count = 0;
320
+ }
321
+ }, je = class {
322
+ constructor() {
323
+ this.renderPipeId = "batch", this.action = "startBatch", this.start = 0, this.size = 0, this.textures = new Ae(), this.blendMode = "normal", this.topology = "triangle-strip", this.canBundle = !0;
324
+ }
325
+ destroy() {
326
+ this.textures = null, this.gpuBindGroup = null, this.bindGroup = null, this.batcher = null, this.elements = null;
327
+ }
328
+ }, N = [], P = 0;
329
+ s.register({ clear: () => {
330
+ if (N.length > 0) for (let e of N) e && e.destroy();
331
+ N.length = 0, P = 0;
332
+ } });
333
+ function Me() {
334
+ return P > 0 ? N[--P] : new je();
335
+ }
336
+ function Ne(e) {
337
+ e.elements = null, N[P++] = e;
338
+ }
339
+ var F = 0, Pe = class e {
340
+ constructor(t) {
341
+ this.uid = h("batcher"), this.dirty = !0, this.batchIndex = 0, this.batches = [], this._elements = [], t = {
342
+ ...e.defaultOptions,
343
+ ...t
344
+ }, t.maxTextures || (o("v8.8.0", "maxTextures is a required option for Batcher now, please pass it in the options"), t.maxTextures = ke());
345
+ let { maxTextures: n, attributesInitialSize: r, indicesInitialSize: i } = t;
346
+ this.attributeBuffer = new Ce(r * 4), this.indexBuffer = new Uint16Array(i), this.maxTextures = n;
347
+ }
348
+ begin() {
349
+ this.elementSize = 0, this.elementStart = 0, this.indexSize = 0, this.attributeSize = 0;
350
+ for (let e = 0; e < this.batchIndex; e++) Ne(this.batches[e]);
351
+ this.batchIndex = 0, this._batchIndexStart = 0, this._batchIndexSize = 0, this.dirty = !0;
352
+ }
353
+ add(e) {
354
+ this._elements[this.elementSize++] = e, e._indexStart = this.indexSize, e._attributeStart = this.attributeSize, e._batcher = this, this.indexSize += e.indexSize, this.attributeSize += e.attributeSize * this.vertexSize;
355
+ }
356
+ checkAndUpdateTexture(e, t) {
357
+ let n = e._batch.textures.ids[t._source.uid];
358
+ return !n && n !== 0 ? !1 : (e._textureId = n, e.texture = t, !0);
359
+ }
360
+ updateElement(e) {
361
+ this.dirty = !0;
362
+ let t = this.attributeBuffer;
363
+ e.packAsQuad ? this.packQuadAttributes(e, t.float32View, t.uint32View, e._attributeStart, e._textureId) : this.packAttributes(e, t.float32View, t.uint32View, e._attributeStart, e._textureId);
364
+ }
365
+ break(e) {
366
+ let t = this._elements;
367
+ if (!t[this.elementStart]) return;
368
+ let n = Me(), r = n.textures;
369
+ r.clear();
370
+ let i = t[this.elementStart], a = Te(i.blendMode, i.texture._source), o = i.topology;
371
+ this.attributeSize * 4 > this.attributeBuffer.size && this._resizeAttributeBuffer(this.attributeSize * 4), this.indexSize > this.indexBuffer.length && this._resizeIndexBuffer(this.indexSize);
372
+ let s = this.attributeBuffer.float32View, c = this.attributeBuffer.uint32View, l = this.indexBuffer, u = this._batchIndexSize, d = this._batchIndexStart, f = "startBatch", p = [], m = this.maxTextures;
373
+ for (let i = this.elementStart; i < this.elementSize; ++i) {
374
+ let h = t[i];
375
+ t[i] = null;
376
+ let g = h.texture._source, _ = Te(h.blendMode, g), v = a !== _ || o !== h.topology;
377
+ if (g._batchTick === F && !v) {
378
+ h._textureId = g._textureBindLocation, u += h.indexSize, h.packAsQuad ? (this.packQuadAttributes(h, s, c, h._attributeStart, h._textureId), this.packQuadIndex(l, h._indexStart, h._attributeStart / this.vertexSize)) : (this.packAttributes(h, s, c, h._attributeStart, h._textureId), this.packIndex(h, l, h._indexStart, h._attributeStart / this.vertexSize)), h._batch = n, p.push(h);
379
+ continue;
380
+ }
381
+ g._batchTick = F, (r.count >= m || v) && (this._finishBatch(n, d, u - d, r, a, o, e, f, p), f = "renderBatch", d = u, a = _, o = h.topology, n = Me(), r = n.textures, r.clear(), p = [], ++F), h._textureId = g._textureBindLocation = r.count, r.ids[g.uid] = r.count, r.textures[r.count++] = g, h._batch = n, p.push(h), u += h.indexSize, h.packAsQuad ? (this.packQuadAttributes(h, s, c, h._attributeStart, h._textureId), this.packQuadIndex(l, h._indexStart, h._attributeStart / this.vertexSize)) : (this.packAttributes(h, s, c, h._attributeStart, h._textureId), this.packIndex(h, l, h._indexStart, h._attributeStart / this.vertexSize));
382
+ }
383
+ r.count > 0 && (this._finishBatch(n, d, u - d, r, a, o, e, f, p), d = u, ++F), this.elementStart = this.elementSize, this._batchIndexStart = d, this._batchIndexSize = u;
384
+ }
385
+ _finishBatch(e, t, n, r, i, a, o, s, c) {
386
+ e.gpuBindGroup = null, e.bindGroup = null, e.action = s, e.batcher = this, e.textures = r, e.blendMode = i, e.topology = a, e.start = t, e.size = n, e.elements = c, ++F, this.batches[this.batchIndex++] = e, o.add(e);
387
+ }
388
+ finish(e) {
389
+ this.break(e);
390
+ }
391
+ ensureAttributeBuffer(e) {
392
+ e * 4 <= this.attributeBuffer.size || this._resizeAttributeBuffer(e * 4);
393
+ }
394
+ ensureIndexBuffer(e) {
395
+ e <= this.indexBuffer.length || this._resizeIndexBuffer(e);
396
+ }
397
+ _resizeAttributeBuffer(e) {
398
+ let t = new Ce(Math.max(e, this.attributeBuffer.size * 2));
399
+ A(this.attributeBuffer.rawBinaryData, t.rawBinaryData), this.attributeBuffer = t;
400
+ }
401
+ _resizeIndexBuffer(e) {
402
+ let t = this.indexBuffer, n = Math.max(e, t.length * 1.5);
403
+ n += n % 2;
404
+ let r = n > 65535 ? new Uint32Array(n) : new Uint16Array(n);
405
+ if (r.BYTES_PER_ELEMENT !== t.BYTES_PER_ELEMENT) for (let e = 0; e < t.length; e++) r[e] = t[e];
406
+ else A(t.buffer, r.buffer);
407
+ this.indexBuffer = r;
408
+ }
409
+ packQuadIndex(e, t, n) {
410
+ e[t] = n + 0, e[t + 1] = n + 1, e[t + 2] = n + 2, e[t + 3] = n + 0, e[t + 4] = n + 2, e[t + 5] = n + 3;
411
+ }
412
+ packIndex(e, t, n, r) {
413
+ let i = e.indices, a = e.indexSize, o = e.indexOffset, s = e.attributeOffset;
414
+ for (let e = 0; e < a; e++) t[n++] = r + i[e + o] - s;
415
+ }
416
+ destroy(e = {}) {
417
+ if (this.batches !== null) {
418
+ for (let e = 0; e < this.batchIndex; e++) Ne(this.batches[e]);
419
+ this.batches = null, this.geometry.destroy(!0), this.geometry = null, e.shader && (this.shader?.destroy(), this.shader = null);
420
+ for (let e = 0; e < this._elements.length; e++) this._elements[e] && (this._elements[e]._batch = null);
421
+ this._elements = null, this.indexBuffer = null, this.attributeBuffer.destroy(), this.attributeBuffer = null;
422
+ }
423
+ }
424
+ };
425
+ Pe.defaultOptions = {
426
+ maxTextures: null,
427
+ attributesInitialSize: 4,
428
+ indicesInitialSize: 6
429
+ };
430
+ var Fe = Pe, Ie = /* @__PURE__ */ new Float32Array(1), Le = /* @__PURE__ */ new Uint32Array(1), Re = class extends le {
431
+ constructor() {
432
+ let e = new ae({
433
+ data: Ie,
434
+ label: "attribute-batch-buffer",
435
+ usage: C.VERTEX | C.COPY_DST,
436
+ shrinkToFit: !1
437
+ }), t = new ae({
438
+ data: Le,
439
+ label: "index-batch-buffer",
440
+ usage: C.INDEX | C.COPY_DST,
441
+ shrinkToFit: !1
442
+ });
443
+ super({
444
+ attributes: {
445
+ aPosition: {
446
+ buffer: e,
447
+ format: "float32x2",
448
+ stride: 24,
449
+ offset: 0
450
+ },
451
+ aUV: {
452
+ buffer: e,
453
+ format: "float32x2",
454
+ stride: 24,
455
+ offset: 8
456
+ },
457
+ aColor: {
458
+ buffer: e,
459
+ format: "unorm8x4",
460
+ stride: 24,
461
+ offset: 16
462
+ },
463
+ aTextureIdAndRound: {
464
+ buffer: e,
465
+ format: "uint16x2",
466
+ stride: 24,
467
+ offset: 20
468
+ }
469
+ },
470
+ indexBuffer: t
471
+ });
472
+ }
473
+ };
474
+ //#endregion
475
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/high-shader/compiler/utils/addBits.mjs
476
+ function ze(e, t, n) {
477
+ if (e) for (let r in e) {
478
+ let i = t[r.toLocaleLowerCase()];
479
+ if (i) {
480
+ let t = e[r];
481
+ r === "header" && (t = t.replace(/@in\s+[^;]+;\s*/g, "").replace(/@out\s+[^;]+;\s*/g, "")), n && i.push(`//----${n}----//`), i.push(t);
482
+ } else u(`${r} placement hook does not exist in shader`);
483
+ }
484
+ }
485
+ //#endregion
486
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/high-shader/compiler/utils/compileHooks.mjs
487
+ var Be = /\{\{(.*?)\}\}/g;
488
+ function Ve(e) {
489
+ let t = {};
490
+ return (e.match(Be)?.map((e) => e.replace(/[{()}]/g, "")) ?? []).forEach((e) => {
491
+ t[e] = [];
492
+ }), t;
493
+ }
494
+ //#endregion
495
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/high-shader/compiler/utils/compileInputs.mjs
496
+ function He(e, t) {
497
+ let n, r = /@in\s+([^;]+);/g;
498
+ for (; (n = r.exec(e)) !== null;) t.push(n[1]);
499
+ }
500
+ function Ue(e, t, n = !1) {
501
+ let r = [];
502
+ He(t, r), e.forEach((e) => {
503
+ e.header && He(e.header, r);
504
+ });
505
+ let i = r;
506
+ n && i.sort();
507
+ let a = i.map((e, t) => ` @location(${t}) ${e},`).join("\n"), o = t.replace(/@in\s+[^;]+;\s*/g, "");
508
+ return o = o.replace("{{in}}", `
509
+ ${a}
510
+ `), o;
511
+ }
512
+ //#endregion
513
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/high-shader/compiler/utils/compileOutputs.mjs
514
+ function We(e, t) {
515
+ let n, r = /@out\s+([^;]+);/g;
516
+ for (; (n = r.exec(e)) !== null;) t.push(n[1]);
517
+ }
518
+ function Ge(e) {
519
+ let t = /\b(\w+)\s*:/g.exec(e);
520
+ return t ? t[1] : "";
521
+ }
522
+ function Ke(e) {
523
+ return e.replace(/@.*?\s+/g, "");
524
+ }
525
+ function qe(e, t) {
526
+ let n = [];
527
+ We(t, n), e.forEach((e) => {
528
+ e.header && We(e.header, n);
529
+ });
530
+ let r = 0, i = n.sort().map((e) => e.indexOf("builtin") > -1 ? e : `@location(${r++}) ${e}`).join(",\n"), a = n.sort().map((e) => ` var ${Ke(e)};`).join("\n"), o = `return VSOutput(
531
+ ${n.sort().map((e) => ` ${Ge(e)}`).join(",\n")});`, s = t.replace(/@out\s+[^;]+;\s*/g, "");
532
+ return s = s.replace("{{struct}}", `
533
+ ${i}
534
+ `), s = s.replace("{{start}}", `
535
+ ${a}
536
+ `), s = s.replace("{{return}}", `
537
+ ${o}
538
+ `), s;
539
+ }
540
+ //#endregion
541
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/high-shader/compiler/utils/injectBits.mjs
542
+ function Je(e, t) {
543
+ let n = e;
544
+ for (let e in t) {
545
+ let r = t[e];
546
+ n = r.join("\n").length ? n.replace(`{{${e}}}`, `//-----${e} START-----//
547
+ ${r.join("\n")}
548
+ //----${e} FINISH----//`) : n.replace(`{{${e}}}`, "");
549
+ }
550
+ return n;
551
+ }
552
+ //#endregion
553
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/high-shader/compiler/compileHighShader.mjs
554
+ var I = /* @__PURE__ */ Object.create(null), Ye = /* @__PURE__ */ new Map(), Xe = 0;
555
+ function Ze({ template: e, bits: t }) {
556
+ let n = et(e, t);
557
+ if (I[n]) return I[n];
558
+ let { vertex: r, fragment: i } = $e(e, t);
559
+ return I[n] = tt(r, i, t), I[n];
560
+ }
561
+ function Qe({ template: e, bits: t }) {
562
+ let n = et(e, t);
563
+ return I[n] || (I[n] = tt(e.vertex, e.fragment, t)), I[n];
564
+ }
565
+ function $e(e, t) {
566
+ let n = t.map((e) => e.vertex).filter((e) => !!e), r = t.map((e) => e.fragment).filter((e) => !!e), i = Ue(n, e.vertex, !0);
567
+ i = qe(n, i);
568
+ let a = Ue(r, e.fragment, !0);
569
+ return {
570
+ vertex: i,
571
+ fragment: a
572
+ };
573
+ }
574
+ function et(e, t) {
575
+ return t.map((e) => (Ye.has(e) || Ye.set(e, Xe++), Ye.get(e))).sort((e, t) => e - t).join("-") + e.vertex + e.fragment;
576
+ }
577
+ function tt(e, t, n) {
578
+ let r = Ve(e), i = Ve(t);
579
+ return n.forEach((e) => {
580
+ ze(e.vertex, r, e.name), ze(e.fragment, i, e.name);
581
+ }), {
582
+ vertex: Je(e, r),
583
+ fragment: Je(t, i)
584
+ };
585
+ }
586
+ //#endregion
587
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/high-shader/defaultProgramTemplate.mjs
588
+ var nt = "\n @in aPosition: vec2<f32>;\n @in aUV: vec2<f32>;\n\n @out @builtin(position) vPosition: vec4<f32>;\n @out vUV : vec2<f32>;\n @out vColor : vec4<f32>;\n\n {{header}}\n\n struct VSOutput {\n {{struct}}\n };\n\n @vertex\n fn main( {{in}} ) -> VSOutput {\n\n var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;\n var modelMatrix = mat3x3<f32>(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n var position = aPosition;\n var uv = aUV;\n\n {{start}}\n\n vColor = vec4<f32>(1., 1., 1., 1.);\n\n {{main}}\n\n vUV = uv;\n\n var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;\n\n vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);\n\n vColor *= globalUniforms.uWorldColorAlpha;\n\n {{end}}\n\n {{return}}\n };\n", rt = "\n @in vUV : vec2<f32>;\n @in vColor : vec4<f32>;\n\n {{header}}\n\n @fragment\n fn main(\n {{in}}\n ) -> @location(0) vec4<f32> {\n\n {{start}}\n\n var outColor:vec4<f32>;\n\n {{main}}\n\n var finalColor:vec4<f32> = outColor * vColor;\n\n {{end}}\n\n return finalColor;\n };\n", it = "\n in vec2 aPosition;\n in vec2 aUV;\n\n out vec4 vColor;\n out vec2 vUV;\n\n {{header}}\n\n void main(void){\n\n mat3 worldTransformMatrix = uWorldTransformMatrix;\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 vec2 position = aPosition;\n vec2 uv = aUV;\n\n {{start}}\n\n vColor = vec4(1.);\n\n {{main}}\n\n vUV = uv;\n\n mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;\n\n gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n\n vColor *= uWorldColorAlpha;\n\n {{end}}\n }\n", at = "\n\n in vec4 vColor;\n in vec2 vUV;\n\n out vec4 finalColor;\n\n {{header}}\n\n void main(void) {\n\n {{start}}\n\n vec4 outColor;\n\n {{main}}\n\n finalColor = outColor * vColor;\n\n {{end}}\n }\n", ot = {
589
+ name: "global-uniforms-bit",
590
+ vertex: { header: "\n struct GlobalUniforms {\n uProjectionMatrix:mat3x3<f32>,\n uWorldTransformMatrix:mat3x3<f32>,\n uWorldColorAlpha: vec4<f32>,\n uResolution: vec2<f32>,\n }\n\n @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;\n " }
591
+ }, st = {
592
+ name: "global-uniforms-bit",
593
+ vertex: { header: "\n uniform mat3 uProjectionMatrix;\n uniform mat3 uWorldTransformMatrix;\n uniform vec4 uWorldColorAlpha;\n uniform vec2 uResolution;\n " }
594
+ };
595
+ //#endregion
596
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/high-shader/compileHighShaderToProgram.mjs
597
+ function ct({ bits: e, name: t }) {
598
+ let n = Ze({
599
+ template: {
600
+ fragment: rt,
601
+ vertex: nt
602
+ },
603
+ bits: [ot, ...e]
604
+ });
605
+ return b.from({
606
+ name: t,
607
+ vertex: {
608
+ source: n.vertex,
609
+ entryPoint: "main"
610
+ },
611
+ fragment: {
612
+ source: n.fragment,
613
+ entryPoint: "main"
614
+ }
615
+ });
616
+ }
617
+ function lt({ bits: e, name: t }) {
618
+ return new ie({
619
+ name: t,
620
+ ...Qe({
621
+ template: {
622
+ vertex: it,
623
+ fragment: at
624
+ },
625
+ bits: [st, ...e]
626
+ })
627
+ });
628
+ }
629
+ //#endregion
630
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/high-shader/shader-bits/colorBit.mjs
631
+ var ut = {
632
+ name: "color-bit",
633
+ vertex: {
634
+ header: "\n @in aColor: vec4<f32>;\n ",
635
+ main: "\n vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);\n "
636
+ }
637
+ }, dt = {
638
+ name: "color-bit",
639
+ vertex: {
640
+ header: "\n in vec4 aColor;\n ",
641
+ main: "\n vColor *= vec4(aColor.rgb * aColor.a, aColor.a);\n "
642
+ }
643
+ }, ft = {};
644
+ function pt(e) {
645
+ let t = [];
646
+ if (e === 1) t.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"), t.push("@group(1) @binding(1) var textureSampler1: sampler;");
647
+ else {
648
+ let n = 0;
649
+ for (let r = 0; r < e; r++) t.push(`@group(1) @binding(${n++}) var textureSource${r + 1}: texture_2d<f32>;`), t.push(`@group(1) @binding(${n++}) var textureSampler${r + 1}: sampler;`);
650
+ }
651
+ return t.join("\n");
652
+ }
653
+ function mt(e) {
654
+ let t = [];
655
+ if (e === 1) t.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");
656
+ else {
657
+ t.push("switch vTextureId {");
658
+ for (let n = 0; n < e; n++) n === e - 1 ? t.push(" default:{") : t.push(` case ${n}:{`), t.push(` outColor = textureSampleGrad(textureSource${n + 1}, textureSampler${n + 1}, vUV, uvDx, uvDy);`), t.push(" break;}");
659
+ t.push("}");
660
+ }
661
+ return t.join("\n");
662
+ }
663
+ function ht(e) {
664
+ return ft[e] || (ft[e] = {
665
+ name: "texture-batch-bit",
666
+ vertex: {
667
+ header: "\n @in aTextureIdAndRound: vec2<u32>;\n @out @interpolate(flat) vTextureId : u32;\n ",
668
+ main: "\n vTextureId = aTextureIdAndRound.y;\n ",
669
+ end: "\n if(aTextureIdAndRound.x == 1)\n {\n vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);\n }\n "
670
+ },
671
+ fragment: {
672
+ header: `
673
+ @in @interpolate(flat) vTextureId: u32;
674
+
675
+ ${pt(e)}
676
+ `,
677
+ main: `
678
+ var uvDx = dpdx(vUV);
679
+ var uvDy = dpdy(vUV);
680
+
681
+ ${mt(e)}
682
+ `
683
+ }
684
+ }), ft[e];
685
+ }
686
+ var L = {};
687
+ function gt(e) {
688
+ let t = [];
689
+ for (let n = 0; n < e; n++) n > 0 && t.push("else"), n < e - 1 && t.push(`if(vTextureId < ${n}.5)`), t.push("{"), t.push(` outColor = texture(uTextures[${n}], vUV);`), t.push("}");
690
+ return t.join("\n");
691
+ }
692
+ function _t(e) {
693
+ return L[e] || (L[e] = {
694
+ name: "texture-batch-bit",
695
+ vertex: {
696
+ header: "\n in vec2 aTextureIdAndRound;\n out float vTextureId;\n\n ",
697
+ main: "\n vTextureId = aTextureIdAndRound.y;\n ",
698
+ end: "\n if(aTextureIdAndRound.x == 1.)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n "
699
+ },
700
+ fragment: {
701
+ header: `
702
+ in float vTextureId;
703
+
704
+ uniform sampler2D uTextures[${e}];
705
+
706
+ `,
707
+ main: `
708
+
709
+ ${gt(e)}
710
+ `
711
+ }
712
+ }), L[e];
713
+ }
714
+ //#endregion
715
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/high-shader/shader-bits/roundPixelsBit.mjs
716
+ var vt = {
717
+ name: "round-pixels-bit",
718
+ vertex: { header: "\n fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>\n {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n }\n " }
719
+ }, yt = {
720
+ name: "round-pixels-bit",
721
+ vertex: { header: "\n vec2 roundPixels(vec2 position, vec2 targetSize)\n {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n }\n " }
722
+ }, bt = {};
723
+ function xt(e) {
724
+ let t = bt[e];
725
+ if (t) return t;
726
+ let n = new Int32Array(e);
727
+ for (let t = 0; t < e; t++) n[t] = t;
728
+ return t = bt[e] = new v({ uTextures: {
729
+ value: n,
730
+ type: "i32",
731
+ size: e
732
+ } }, { isStatic: !0 }), t;
733
+ }
734
+ //#endregion
735
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/batcher/shared/DefaultShader.mjs
736
+ var St = class extends ce {
737
+ constructor(e) {
738
+ let t = lt({
739
+ name: "batch",
740
+ bits: [
741
+ dt,
742
+ _t(e),
743
+ yt
744
+ ]
745
+ }), n = ct({
746
+ name: "batch",
747
+ bits: [
748
+ ut,
749
+ ht(e),
750
+ vt
751
+ ]
752
+ });
753
+ super({
754
+ glProgram: t,
755
+ gpuProgram: n,
756
+ resources: { batchSamplers: xt(e) }
757
+ }), this.maxTextures = e;
758
+ }
759
+ }, R = null, Ct = class e extends Fe {
760
+ constructor(t) {
761
+ super(t), this.geometry = new Re(), this.name = e.extension.name, this.vertexSize = 6, R ??= new St(t.maxTextures), this.shader = R;
762
+ }
763
+ packAttributes(e, t, n, r, i) {
764
+ let a = i << 16 | e.roundPixels & 65535, o = e.transform, s = o.a, c = o.b, l = o.c, u = o.d, d = o.tx, f = o.ty, { positions: p, uvs: m } = e, h = e.color, g = e.attributeOffset, _ = g + e.attributeSize;
765
+ for (let e = g; e < _; e++) {
766
+ let i = e * 2, o = p[i], g = p[i + 1];
767
+ t[r++] = s * o + l * g + d, t[r++] = u * g + c * o + f, t[r++] = m[i], t[r++] = m[i + 1], n[r++] = h, n[r++] = a;
768
+ }
769
+ }
770
+ packQuadAttributes(e, t, n, r, i) {
771
+ let a = e.texture, o = e.transform, s = o.a, c = o.b, l = o.c, u = o.d, d = o.tx, f = o.ty, p = e.bounds, m = p.maxX, h = p.minX, g = p.maxY, _ = p.minY, v = a.uvs, y = e.color, b = i << 16 | e.roundPixels & 65535;
772
+ t[r + 0] = s * h + l * _ + d, t[r + 1] = u * _ + c * h + f, t[r + 2] = v.x0, t[r + 3] = v.y0, n[r + 4] = y, n[r + 5] = b, t[r + 6] = s * m + l * _ + d, t[r + 7] = u * _ + c * m + f, t[r + 8] = v.x1, t[r + 9] = v.y1, n[r + 10] = y, n[r + 11] = b, t[r + 12] = s * m + l * g + d, t[r + 13] = u * g + c * m + f, t[r + 14] = v.x2, t[r + 15] = v.y2, n[r + 16] = y, n[r + 17] = b, t[r + 18] = s * h + l * g + d, t[r + 19] = u * g + c * h + f, t[r + 20] = v.x3, t[r + 21] = v.y3, n[r + 22] = y, n[r + 23] = b;
773
+ }
774
+ _updateMaxTextures(e) {
775
+ this.shader.maxTextures !== e && (R = new St(e), this.shader = R);
776
+ }
777
+ destroy() {
778
+ this.shader = null, super.destroy();
779
+ }
780
+ };
781
+ Ct.extension = {
782
+ type: [w.Batcher],
783
+ name: "default"
784
+ };
785
+ var z = Ct, wt = class {
786
+ constructor(e) {
787
+ this.items = /* @__PURE__ */ Object.create(null);
788
+ let { renderer: t, type: n, onUnload: r, priority: i, name: a } = e;
789
+ this._renderer = t, t.gc.addResourceHash(this, "items", n, i ?? 0), this._onUnload = r, this.name = a;
790
+ }
791
+ add(e) {
792
+ return this.items[e.uid] ? !1 : (this.items[e.uid] = e, e.once("unload", this.remove, this), e._gcLastUsed = this._renderer.gc.now, !0);
793
+ }
794
+ remove(e, ...t) {
795
+ if (!this.items[e.uid]) return;
796
+ let n = e._gpuData[this._renderer.uid];
797
+ n && (this._onUnload?.(e, ...t), n.destroy(), e._gpuData[this._renderer.uid] = null, this.items[e.uid] = null);
798
+ }
799
+ removeAll(...e) {
800
+ Object.values(this.items).forEach((t) => t && this.remove(t, ...e));
801
+ }
802
+ destroy(...e) {
803
+ this.removeAll(...e), this.items = /* @__PURE__ */ Object.create(null), this._renderer = null, this._onUnload = null;
804
+ }
805
+ }, Tt = "in vec2 vMaskCoord;\nin vec2 vTextureCoord;\n\nuniform sampler2D uTexture;\nuniform sampler2D uMaskTexture;\n\nuniform float uAlpha;\nuniform vec4 uMaskClamp;\nuniform float uInverse;\nuniform float uChannel;\n\nout vec4 finalColor;\n\nvoid main(void)\n{\n float clip = step(3.5,\n step(uMaskClamp.x, vMaskCoord.x) +\n step(uMaskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, uMaskClamp.z) +\n step(vMaskCoord.y, uMaskClamp.w));\n\n // TODO look into why this is needed\n float npmAlpha = uAlpha;\n vec4 original = texture(uTexture, vTextureCoord);\n vec4 masky = texture(uMaskTexture, vMaskCoord);\n\n float a;\n if (uChannel == 1.0) {\n a = masky.a * npmAlpha * clip;\n } else {\n float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n a = alphaMul * masky.r * npmAlpha * clip;\n }\n\n if (uInverse == 1.0) {\n a = 1.0 - a;\n }\n\n finalColor = original * a;\n}\n", Et = "in vec2 aPosition;\n\nout vec2 vTextureCoord;\nout vec2 vMaskCoord;\n\n\nuniform vec4 uInputSize;\nuniform vec4 uOutputFrame;\nuniform vec4 uOutputTexture;\nuniform mat3 uFilterMatrix;\n\nvec4 filterVertexPosition( vec2 aPosition )\n{\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\n \n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( vec2 aPosition )\n{\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\n}\n\nvec2 getFilterCoord( vec2 aPosition )\n{\n return ( uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;\n} \n\nvoid main(void)\n{\n gl_Position = filterVertexPosition(aPosition);\n vTextureCoord = filterTextureCoord(aPosition);\n vMaskCoord = getFilterCoord(aPosition);\n}\n", Dt = "struct GlobalFilterUniforms {\n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n};\n\nstruct MaskUniforms {\n uFilterMatrix:mat3x3<f32>,\n uMaskClamp:vec4<f32>,\n uAlpha:f32,\n uInverse:f32,\n uChannel:f32,\n};\n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;\n@group(0) @binding(1) var uTexture: texture_2d<f32>;\n@group(0) @binding(2) var uSampler : sampler;\n\n@group(1) @binding(0) var<uniform> filterUniforms : MaskUniforms;\n@group(1) @binding(1) var uMaskTexture: texture_2d<f32>;\n\nstruct VSOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>,\n @location(1) filterUv : vec2<f32>,\n};\n\nfn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>\n{\n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\n\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nfn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\n}\n\nfn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw);\n}\n\nfn getFilterCoord(aPosition:vec2<f32> ) -> vec2<f32>\n{\n return ( filterUniforms.uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;\n}\n\nfn getSize() -> vec2<f32>\n{\n return gfu.uGlobalFrame.zw;\n}\n\n@vertex\nfn mainVertex(\n @location(0) aPosition : vec2<f32>,\n) -> VSOutput {\n return VSOutput(\n filterVertexPosition(aPosition),\n filterTextureCoord(aPosition),\n getFilterCoord(aPosition)\n );\n}\n\n@fragment\nfn mainFragment(\n @location(0) uv: vec2<f32>,\n @location(1) filterUv: vec2<f32>,\n @builtin(position) position: vec4<f32>\n) -> @location(0) vec4<f32> {\n\n var maskClamp = filterUniforms.uMaskClamp;\n var uAlpha = filterUniforms.uAlpha;\n\n var clip = step(3.5,\n step(maskClamp.x, filterUv.x) +\n step(maskClamp.y, filterUv.y) +\n step(filterUv.x, maskClamp.z) +\n step(filterUv.y, maskClamp.w));\n\n var mask = textureSample(uMaskTexture, uSampler, filterUv);\n var source = textureSample(uTexture, uSampler, uv);\n\n var a: f32;\n if (filterUniforms.uChannel == 1.0) {\n a = mask.a * uAlpha * clip;\n } else {\n var alphaMul = 1.0 - uAlpha * (1.0 - mask.a);\n a = alphaMul * mask.r * uAlpha * clip;\n }\n\n if (filterUniforms.uInverse == 1.0) {\n a = 1.0 - a;\n }\n\n return source * a;\n}\n", Ot = class extends te {
806
+ constructor(e) {
807
+ let { sprite: t, ...n } = e, r = new i(t.texture), a = new v({
808
+ uFilterMatrix: {
809
+ value: new y(),
810
+ type: "mat3x3<f32>"
811
+ },
812
+ uMaskClamp: {
813
+ value: r.uClampFrame,
814
+ type: "vec4<f32>"
815
+ },
816
+ uAlpha: {
817
+ value: 1,
818
+ type: "f32"
819
+ },
820
+ uInverse: {
821
+ value: +!!e.inverse,
822
+ type: "f32"
823
+ },
824
+ uChannel: {
825
+ value: +(e.channel === "alpha"),
826
+ type: "f32"
827
+ }
828
+ }), o = b.from({
829
+ vertex: {
830
+ source: Dt,
831
+ entryPoint: "mainVertex"
832
+ },
833
+ fragment: {
834
+ source: Dt,
835
+ entryPoint: "mainFragment"
836
+ }
837
+ }), s = ie.from({
838
+ vertex: Et,
839
+ fragment: Tt,
840
+ name: "mask-filter"
841
+ });
842
+ super({
843
+ ...n,
844
+ gpuProgram: o,
845
+ glProgram: s,
846
+ clipToViewport: !1,
847
+ resources: {
848
+ filterUniforms: a,
849
+ uMaskTexture: t.texture.source
850
+ }
851
+ }), this.sprite = t, this._textureMatrix = r;
852
+ }
853
+ setSprite(e) {
854
+ this.sprite = e;
855
+ let t = this._getSafeTexture();
856
+ this._textureMatrix.texture = t, this.resources.uMaskTexture = t.source;
857
+ }
858
+ set inverse(e) {
859
+ this.resources.filterUniforms.uniforms.uInverse = +!!e;
860
+ }
861
+ get inverse() {
862
+ return this.resources.filterUniforms.uniforms.uInverse === 1;
863
+ }
864
+ set channel(e) {
865
+ this.resources.filterUniforms.uniforms.uChannel = +(e === "alpha");
866
+ }
867
+ get channel() {
868
+ return this.resources.filterUniforms.uniforms.uChannel === 1 ? "alpha" : "red";
869
+ }
870
+ apply(e, t, n, r) {
871
+ let i = this._getSafeTexture();
872
+ this._textureMatrix.texture = i, e.calculateSpriteMatrix(this.resources.filterUniforms.uniforms.uFilterMatrix, this.sprite).prepend(this._textureMatrix.mapCoord), this.resources.uMaskTexture = i.source, e.applyFilter(this, t, n, r);
873
+ }
874
+ _getSafeTexture() {
875
+ let e = this.sprite.texture;
876
+ return e.destroyed || !e.source || e.source.destroyed ? (u("[MaskFilter] The mask texture was destroyed while the mask is still in use. Remove the mask before destroying its texture."), f.EMPTY) : e;
877
+ }
878
+ destroy(e = !1) {
879
+ this._textureMatrix.destroy(), super.destroy(e);
880
+ }
881
+ };
882
+ //#endregion
883
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/scene/graphics/gpu/colorToUniform.mjs
884
+ function kt(e, t, n) {
885
+ let r = (e >> 24 & 255) / 255;
886
+ t[n++] = (e & 255) / 255 * r, t[n++] = (e >> 8 & 255) / 255 * r, t[n++] = (e >> 16 & 255) / 255 * r, t[n++] = r;
887
+ }
888
+ //#endregion
889
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/scene/sprite/BatchableSprite.mjs
890
+ var At = class {
891
+ constructor() {
892
+ this.batcherName = "default", this.topology = "triangle-list", this.attributeSize = 4, this.indexSize = 6, this.packAsQuad = !0, this.roundPixels = 0, this._attributeStart = 0, this._batcher = null, this._batch = null;
893
+ }
894
+ get blendMode() {
895
+ return this.renderable.groupBlendMode;
896
+ }
897
+ get color() {
898
+ return this.renderable.groupColorAlpha;
899
+ }
900
+ reset() {
901
+ this.renderable = null, this.texture = null, this._batcher = null, this._batch = null, this.bounds = null;
902
+ }
903
+ destroy() {
904
+ this.reset();
905
+ }
906
+ }, B = class e {
907
+ constructor(e, t) {
908
+ this.state = se.for2d(), this._batchersByInstructionSet = /* @__PURE__ */ Object.create(null), this._activeBatches = /* @__PURE__ */ Object.create(null), this.renderer = e, this._adaptor = t, this._adaptor.init?.(this);
909
+ }
910
+ static getBatcher(e, t) {
911
+ return new this._availableBatchers[e]({ maxTextures: t });
912
+ }
913
+ buildStart(e) {
914
+ let t = this._batchersByInstructionSet[e.uid];
915
+ t || (t = this._batchersByInstructionSet[e.uid] = /* @__PURE__ */ Object.create(null), t.default ||= new z({ maxTextures: this.renderer.limits.maxBatchableTextures })), this._activeBatches = t, this._activeBatch = this._activeBatches.default;
916
+ for (let e in this._activeBatches) this._activeBatches[e].begin();
917
+ }
918
+ addToBatch(t, n) {
919
+ if (this._activeBatch.name !== t.batcherName) {
920
+ this._activeBatch.break(n);
921
+ let r = this._activeBatches[t.batcherName];
922
+ r || (r = this._activeBatches[t.batcherName] = e.getBatcher(t.batcherName, this.renderer.limits.maxBatchableTextures), r.begin()), this._activeBatch = r;
923
+ }
924
+ this._activeBatch.add(t);
925
+ }
926
+ break(e) {
927
+ this._activeBatch.break(e);
928
+ }
929
+ buildEnd(e) {
930
+ this._activeBatch.break(e);
931
+ let t = this._activeBatches;
932
+ for (let e in t) {
933
+ let n = t[e], r = n.geometry;
934
+ r.indexBuffer.setDataWithSize(n.indexBuffer, n.indexSize, !0), r.buffers[0].setDataWithSize(n.attributeBuffer.float32View, n.attributeSize, !1);
935
+ }
936
+ }
937
+ upload(e) {
938
+ let t = this._batchersByInstructionSet[e.uid];
939
+ for (let e in t) {
940
+ let n = t[e], r = n.geometry;
941
+ n.dirty && (n.dirty = !1, r.buffers[0].update(n.attributeSize * 4));
942
+ }
943
+ }
944
+ execute(e) {
945
+ if (e.action === "startBatch") {
946
+ let t = e.batcher, n = t.geometry, r = t.shader;
947
+ this._adaptor.start(this, n, r);
948
+ }
949
+ this._adaptor.execute(this, e);
950
+ }
951
+ destroy() {
952
+ this.state = null, this.renderer = null, this._adaptor = null;
953
+ for (let e in this._activeBatches) this._activeBatches[e].destroy();
954
+ this._activeBatches = null;
955
+ }
956
+ };
957
+ B.extension = {
958
+ type: [
959
+ w.WebGLPipes,
960
+ w.WebGPUPipes,
961
+ w.CanvasPipes
962
+ ],
963
+ name: "batch"
964
+ }, B._availableBatchers = /* @__PURE__ */ Object.create(null);
965
+ var V = B;
966
+ x.handleByMap(w.Batcher, V._availableBatchers), x.add(z);
967
+ //#endregion
968
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMaskPipe.mjs
969
+ var jt = new e(), Mt = class extends c {
970
+ constructor() {
971
+ super(), this._placeholderSprite = new pe(f.EMPTY), this.filters = [new Ot({
972
+ sprite: this._placeholderSprite,
973
+ inverse: !1,
974
+ resolution: "inherit",
975
+ antialias: "inherit"
976
+ })];
977
+ }
978
+ get sprite() {
979
+ return this.filters[0].sprite;
980
+ }
981
+ set sprite(e) {
982
+ this.filters[0].setSprite(e);
983
+ }
984
+ get inverse() {
985
+ return this.filters[0].inverse;
986
+ }
987
+ set inverse(e) {
988
+ this.filters[0].inverse = e;
989
+ }
990
+ get channel() {
991
+ return this.filters[0].channel;
992
+ }
993
+ set channel(e) {
994
+ this.filters[0].channel = e;
995
+ }
996
+ reset() {
997
+ this._placeholderSprite.texture = f.EMPTY, this.sprite = this._placeholderSprite;
998
+ }
999
+ }, H = class {
1000
+ constructor(e) {
1001
+ this._activeMaskStage = [], this._usedEffects = [], this._renderer = e, e.runners.postrender.add(this);
1002
+ }
1003
+ push(e, t, n) {
1004
+ let r = this._renderer;
1005
+ if (r.renderPipes.batch.break(n), n.add({
1006
+ renderPipeId: "alphaMask",
1007
+ action: "pushMaskBegin",
1008
+ mask: e,
1009
+ inverse: t._maskOptions.inverse,
1010
+ canBundle: !1,
1011
+ maskedContainer: t
1012
+ }), e.inverse = t._maskOptions.inverse, e.channel = t._maskOptions.channel ?? "red", e.renderMaskToTexture) {
1013
+ let t = e.mask;
1014
+ t.includeInBuild = !0, t.collectRenderables(n, r, null), t.includeInBuild = !1;
1015
+ }
1016
+ r.renderPipes.batch.break(n), n.add({
1017
+ renderPipeId: "alphaMask",
1018
+ action: "pushMaskEnd",
1019
+ mask: e,
1020
+ maskedContainer: t,
1021
+ inverse: t._maskOptions.inverse,
1022
+ canBundle: !1
1023
+ });
1024
+ }
1025
+ pop(e, t, n) {
1026
+ this._renderer.renderPipes.batch.break(n), n.add({
1027
+ renderPipeId: "alphaMask",
1028
+ action: "popMaskEnd",
1029
+ mask: e,
1030
+ inverse: t._maskOptions.inverse,
1031
+ canBundle: !1
1032
+ });
1033
+ }
1034
+ execute(e) {
1035
+ let t = this._renderer, n = e.mask.renderMaskToTexture;
1036
+ if (e.action === "pushMaskBegin") {
1037
+ let r = a.get(Mt);
1038
+ if (r.inverse = e.inverse, r.channel = e.mask.channel, n) {
1039
+ e.mask.mask.measurable = !0;
1040
+ let n = ne(e.mask.mask, !0, jt);
1041
+ e.mask.mask.measurable = !1, n.ceil();
1042
+ let i = t.renderTarget.renderTarget.colorTexture.source, a = d.getOptimalTexture(n.width, n.height, i._resolution, i.antialias);
1043
+ t.renderTarget.push({
1044
+ target: a,
1045
+ clear: !0
1046
+ }), t.globalUniforms.push({
1047
+ offset: n,
1048
+ worldColor: 4294967295
1049
+ });
1050
+ let o = r.sprite;
1051
+ o.texture = a, o.worldTransform.tx = n.minX, o.worldTransform.ty = n.minY, this._activeMaskStage.push({
1052
+ filterEffect: r,
1053
+ maskedContainer: e.maskedContainer,
1054
+ filterTexture: a
1055
+ });
1056
+ } else r.sprite = e.mask.mask, this._activeMaskStage.push({
1057
+ filterEffect: r,
1058
+ maskedContainer: e.maskedContainer
1059
+ });
1060
+ } else if (e.action === "pushMaskEnd") {
1061
+ let e = this._activeMaskStage[this._activeMaskStage.length - 1];
1062
+ n && (t.type === S.WEBGL && t.renderTarget.finishRenderPass(), t.renderTarget.pop(), t.globalUniforms.pop()), t.filter.push({
1063
+ renderPipeId: "filter",
1064
+ action: "pushFilter",
1065
+ container: e.maskedContainer,
1066
+ filterEffect: e.filterEffect,
1067
+ canBundle: !1
1068
+ });
1069
+ } else if (e.action === "popMaskEnd") {
1070
+ t.filter.pop();
1071
+ let e = this._activeMaskStage.pop();
1072
+ n && d.returnTexture(e.filterTexture), this._usedEffects.push(e.filterEffect);
1073
+ }
1074
+ }
1075
+ postrender() {
1076
+ let e = this._usedEffects;
1077
+ for (let t = 0; t < e.length; t++) a.return(e[t]);
1078
+ e.length = 0;
1079
+ }
1080
+ destroy() {
1081
+ this.postrender(), this._renderer.runners.postrender.remove(this), this._renderer = null, this._activeMaskStage = null, this._usedEffects = null;
1082
+ }
1083
+ };
1084
+ H.extension = {
1085
+ type: [
1086
+ w.WebGLPipes,
1087
+ w.WebGPUPipes,
1088
+ w.CanvasPipes
1089
+ ],
1090
+ name: "alphaMask"
1091
+ };
1092
+ //#endregion
1093
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/mask/color/ColorMaskPipe.mjs
1094
+ var Nt = class {
1095
+ constructor(e) {
1096
+ this._colorStack = [], this._colorStackIndex = 0, this._currentColor = 0, this._renderer = e;
1097
+ }
1098
+ buildStart() {
1099
+ this._colorStack[0] = 15, this._colorStackIndex = 1, this._currentColor = 15;
1100
+ }
1101
+ push(e, t, n) {
1102
+ this._renderer.renderPipes.batch.break(n);
1103
+ let r = this._colorStack;
1104
+ r[this._colorStackIndex] = r[this._colorStackIndex - 1] & e.mask;
1105
+ let i = this._colorStack[this._colorStackIndex];
1106
+ i !== this._currentColor && (this._currentColor = i, n.add({
1107
+ renderPipeId: "colorMask",
1108
+ colorMask: i,
1109
+ canBundle: !1
1110
+ })), this._colorStackIndex++;
1111
+ }
1112
+ pop(e, t, n) {
1113
+ this._renderer.renderPipes.batch.break(n);
1114
+ let r = this._colorStack;
1115
+ this._colorStackIndex--;
1116
+ let i = r[this._colorStackIndex - 1];
1117
+ i !== this._currentColor && (this._currentColor = i, n.add({
1118
+ renderPipeId: "colorMask",
1119
+ colorMask: i,
1120
+ canBundle: !1
1121
+ }));
1122
+ }
1123
+ execute(e) {
1124
+ this._renderer.colorMask.setMask(e.colorMask);
1125
+ }
1126
+ destroy() {
1127
+ this._renderer = null, this._colorStack = null;
1128
+ }
1129
+ };
1130
+ Nt.extension = {
1131
+ type: [w.WebGLPipes, w.WebGPUPipes],
1132
+ name: "colorMask"
1133
+ };
1134
+ //#endregion
1135
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/mask/stencil/StencilMaskPipe.mjs
1136
+ var Pt = class {
1137
+ constructor(e) {
1138
+ this._maskStackHash = {}, this._maskHash = /* @__PURE__ */ new WeakMap(), this._renderer = e;
1139
+ }
1140
+ push(e, t, n) {
1141
+ var r;
1142
+ let i = e, a = this._renderer;
1143
+ a.renderPipes.batch.break(n), a.renderPipes.blendMode.setBlendMode(i.mask, "none", n), n.add({
1144
+ renderPipeId: "stencilMask",
1145
+ action: "pushMaskBegin",
1146
+ mask: e,
1147
+ inverse: t._maskOptions.inverse,
1148
+ canBundle: !1
1149
+ });
1150
+ let o = i.mask;
1151
+ o.includeInBuild = !0, this._maskHash.has(i) || this._maskHash.set(i, {
1152
+ instructionsStart: 0,
1153
+ instructionsLength: 0
1154
+ });
1155
+ let s = this._maskHash.get(i);
1156
+ s.instructionsStart = n.instructionSize, o.collectRenderables(n, a, null), o.includeInBuild = !1, a.renderPipes.batch.break(n), n.add({
1157
+ renderPipeId: "stencilMask",
1158
+ action: "pushMaskEnd",
1159
+ mask: e,
1160
+ inverse: t._maskOptions.inverse,
1161
+ canBundle: !1
1162
+ }), s.instructionsLength = n.instructionSize - s.instructionsStart - 1;
1163
+ let c = a.renderTarget.renderTarget.uid;
1164
+ (r = this._maskStackHash)[c] ?? (r[c] = 0);
1165
+ }
1166
+ pop(e, t, n) {
1167
+ let r = e, i = this._renderer;
1168
+ i.renderPipes.batch.break(n), i.renderPipes.blendMode.setBlendMode(r.mask, "none", n), n.add({
1169
+ renderPipeId: "stencilMask",
1170
+ action: "popMaskBegin",
1171
+ inverse: t._maskOptions.inverse,
1172
+ canBundle: !1
1173
+ });
1174
+ let a = this._maskHash.get(e);
1175
+ for (let e = 0; e < a.instructionsLength; e++) n.instructions[n.instructionSize++] = n.instructions[a.instructionsStart++];
1176
+ n.add({
1177
+ renderPipeId: "stencilMask",
1178
+ action: "popMaskEnd",
1179
+ canBundle: !1
1180
+ });
1181
+ }
1182
+ execute(e) {
1183
+ var t;
1184
+ let n = this._renderer, r = n, i = n.renderTarget.renderTarget.uid, a = (t = this._maskStackHash)[i] ?? (t[i] = 0);
1185
+ e.action === "pushMaskBegin" ? (r.renderTarget.ensureDepthStencil(), r.stencil.setStencilMode(j.RENDERING_MASK_ADD, a), a++, r.colorMask.setMask(0)) : e.action === "pushMaskEnd" ? (e.inverse ? r.stencil.setStencilMode(j.INVERSE_MASK_ACTIVE, a) : r.stencil.setStencilMode(j.MASK_ACTIVE, a), r.colorMask.setMask(15)) : e.action === "popMaskBegin" ? (r.colorMask.setMask(0), a === 0 ? (r.renderTarget.clear(null, O.STENCIL), r.stencil.setStencilMode(j.DISABLED, a)) : r.stencil.setStencilMode(j.RENDERING_MASK_REMOVE, a), a--) : e.action === "popMaskEnd" && (e.inverse ? r.stencil.setStencilMode(j.INVERSE_MASK_ACTIVE, a) : r.stencil.setStencilMode(j.MASK_ACTIVE, a), r.colorMask.setMask(15)), this._maskStackHash[i] = a;
1186
+ }
1187
+ destroy() {
1188
+ this._renderer = null, this._maskStackHash = null, this._maskHash = null;
1189
+ }
1190
+ };
1191
+ Pt.extension = {
1192
+ type: [w.WebGLPipes, w.WebGPUPipes],
1193
+ name: "stencilMask"
1194
+ };
1195
+ //#endregion
1196
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/scene/container/CustomRenderPipe.mjs
1197
+ var U = class {
1198
+ constructor(e) {
1199
+ this._renderer = e;
1200
+ }
1201
+ updateRenderable() {}
1202
+ destroyRenderable() {}
1203
+ validateRenderable() {
1204
+ return !1;
1205
+ }
1206
+ addRenderable(e, t) {
1207
+ this._renderer.renderPipes.batch.break(t), t.add(e);
1208
+ }
1209
+ execute(e) {
1210
+ e.isRenderable && e.render(this._renderer);
1211
+ }
1212
+ destroy() {
1213
+ this._renderer = null;
1214
+ }
1215
+ };
1216
+ U.extension = {
1217
+ type: [
1218
+ w.WebGLPipes,
1219
+ w.WebGPUPipes,
1220
+ w.CanvasPipes
1221
+ ],
1222
+ name: "customRender"
1223
+ };
1224
+ //#endregion
1225
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/scene/container/utils/executeInstructions.mjs
1226
+ function W(e, t) {
1227
+ let n = e.instructionSet, r = n.instructions;
1228
+ for (let e = 0; e < n.instructionSize; e++) {
1229
+ let n = r[e];
1230
+ t[n.renderPipeId].execute(n);
1231
+ }
1232
+ }
1233
+ //#endregion
1234
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/scene/container/RenderGroupPipe.mjs
1235
+ var G = class {
1236
+ constructor(e) {
1237
+ this._renderer = e;
1238
+ }
1239
+ addRenderGroup(e, t) {
1240
+ e.isCachedAsTexture ? this._addRenderableCacheAsTexture(e, t) : this._addRenderableDirect(e, t);
1241
+ }
1242
+ execute(e) {
1243
+ e.isRenderable && (e.isCachedAsTexture ? this._executeCacheAsTexture(e) : this._executeDirect(e));
1244
+ }
1245
+ destroy() {
1246
+ this._renderer = null;
1247
+ }
1248
+ _addRenderableDirect(e, t) {
1249
+ this._renderer.renderPipes.batch.break(t), e._batchableRenderGroup &&= (a.return(e._batchableRenderGroup), null), t.add(e);
1250
+ }
1251
+ _addRenderableCacheAsTexture(e, t) {
1252
+ let n = e._batchableRenderGroup ??= a.get(At);
1253
+ n.renderable = e.root, n.transform = e.root.relativeGroupTransform, n.texture = e.texture, n.bounds = e._textureBounds, t.add(e), this._renderer.renderPipes.blendMode.pushBlendMode(e, e.root.groupBlendMode, t), this._renderer.renderPipes.batch.addToBatch(n, t), this._renderer.renderPipes.blendMode.popBlendMode(t);
1254
+ }
1255
+ _executeCacheAsTexture(e) {
1256
+ if (e.textureNeedsUpdate) {
1257
+ e.textureNeedsUpdate = !1;
1258
+ let t = new y().translate(-e._textureBounds.x, -e._textureBounds.y);
1259
+ this._renderer.renderTarget.push({
1260
+ target: e.texture,
1261
+ clear: !0,
1262
+ frame: e.texture.frame
1263
+ }), this._renderer.globalUniforms.push({
1264
+ worldTransformMatrix: t,
1265
+ worldColor: 4294967295,
1266
+ offset: {
1267
+ x: 0,
1268
+ y: 0
1269
+ }
1270
+ }), W(e, this._renderer.renderPipes), this._renderer.renderTarget.finishRenderPass(), this._renderer.renderTarget.pop(), this._renderer.globalUniforms.pop();
1271
+ }
1272
+ e._batchableRenderGroup._batcher.updateElement(e._batchableRenderGroup), e._batchableRenderGroup._batcher.geometry.buffers[0].update();
1273
+ }
1274
+ _executeDirect(e) {
1275
+ this._renderer.globalUniforms.push({
1276
+ worldTransformMatrix: e.inverseParentTextureTransform,
1277
+ worldColor: e.worldColorAlpha
1278
+ }), W(e, this._renderer.renderPipes), this._renderer.globalUniforms.pop();
1279
+ }
1280
+ };
1281
+ G.extension = {
1282
+ type: [
1283
+ w.WebGLPipes,
1284
+ w.WebGPUPipes,
1285
+ w.CanvasPipes
1286
+ ],
1287
+ name: "renderGroup"
1288
+ };
1289
+ //#endregion
1290
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/scene/sprite/SpritePipe.mjs
1291
+ var K = class {
1292
+ constructor(e) {
1293
+ this._renderer = e;
1294
+ }
1295
+ addRenderable(e, t) {
1296
+ let n = this._getGpuSprite(e);
1297
+ e.didViewUpdate && this._updateBatchableSprite(e, n), this._renderer.renderPipes.batch.addToBatch(n, t);
1298
+ }
1299
+ updateRenderable(e) {
1300
+ let t = this._getGpuSprite(e);
1301
+ e.didViewUpdate && this._updateBatchableSprite(e, t), t._batcher.updateElement(t);
1302
+ }
1303
+ validateRenderable(e) {
1304
+ let t = this._getGpuSprite(e);
1305
+ return !t._batcher.checkAndUpdateTexture(t, e._texture);
1306
+ }
1307
+ _updateBatchableSprite(e, t) {
1308
+ t.bounds = e.visualBounds, t.texture = e._texture;
1309
+ }
1310
+ _getGpuSprite(e) {
1311
+ return e._gpuData[this._renderer.uid] || this._initGPUSprite(e);
1312
+ }
1313
+ _initGPUSprite(e) {
1314
+ let t = new At();
1315
+ return t.renderable = e, t.transform = e.groupTransform, t.texture = e._texture, t.bounds = e.visualBounds, t.roundPixels = this._renderer._roundPixels | e._roundPixels, e._gpuData[this._renderer.uid] = t, t;
1316
+ }
1317
+ destroy() {
1318
+ this._renderer = null;
1319
+ }
1320
+ };
1321
+ K.extension = {
1322
+ type: [
1323
+ w.WebGLPipes,
1324
+ w.WebGPUPipes,
1325
+ w.CanvasPipes
1326
+ ],
1327
+ name: "sprite"
1328
+ };
1329
+ //#endregion
1330
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/shared/blendModes/BlendModePipe.mjs
1331
+ var q = {};
1332
+ x.handle(w.BlendMode, (e) => {
1333
+ if (!e.name) throw Error("BlendMode extension must have a name property");
1334
+ q[e.name] = e.ref;
1335
+ }, (e) => {
1336
+ delete q[e.name];
1337
+ });
1338
+ var J = class {
1339
+ constructor(e) {
1340
+ this._blendModeStack = [], this._isAdvanced = !1, this._filterHash = /* @__PURE__ */ Object.create(null), this._renderer = e, this._renderer.runners.prerender.add(this);
1341
+ }
1342
+ prerender() {
1343
+ this._activeBlendMode = "normal", this._isAdvanced = !1;
1344
+ }
1345
+ pushBlendMode(e, t, n) {
1346
+ this._blendModeStack.push(t), this.setBlendMode(e, t, n);
1347
+ }
1348
+ popBlendMode(e) {
1349
+ this._blendModeStack.pop();
1350
+ let t = this._blendModeStack[this._activeBlendMode.length - 1] ?? "normal";
1351
+ this.setBlendMode(null, t, e);
1352
+ }
1353
+ setBlendMode(e, t, n) {
1354
+ let r = e instanceof fe;
1355
+ if (this._activeBlendMode === t) {
1356
+ this._isAdvanced && e && !r && this._renderableList?.push(e);
1357
+ return;
1358
+ }
1359
+ this._isAdvanced && this._endAdvancedBlendMode(n), this._activeBlendMode = t, e && (this._isAdvanced = !!q[t], this._isAdvanced && this._beginAdvancedBlendMode(e, n));
1360
+ }
1361
+ _beginAdvancedBlendMode(e, t) {
1362
+ this._renderer.renderPipes.batch.break(t);
1363
+ let n = this._activeBlendMode;
1364
+ if (!q[n]) {
1365
+ u(`Unable to assign BlendMode: '${n}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);
1366
+ return;
1367
+ }
1368
+ let r = this._ensureFilterEffect(n), i = e instanceof fe, a = {
1369
+ renderPipeId: "filter",
1370
+ action: "pushFilter",
1371
+ filterEffect: r,
1372
+ renderables: i ? null : [e],
1373
+ container: i ? e.root : null,
1374
+ canBundle: !1
1375
+ };
1376
+ this._renderableList = a.renderables, t.add(a);
1377
+ }
1378
+ _ensureFilterEffect(e) {
1379
+ let t = this._filterHash[e];
1380
+ return t || (t = this._filterHash[e] = new c(), t.filters = [new q[e]()]), t;
1381
+ }
1382
+ _endAdvancedBlendMode(e) {
1383
+ this._isAdvanced = !1, this._renderableList = null, this._renderer.renderPipes.batch.break(e), e.add({
1384
+ renderPipeId: "filter",
1385
+ action: "popFilter",
1386
+ canBundle: !1
1387
+ });
1388
+ }
1389
+ buildStart() {
1390
+ this._isAdvanced = !1;
1391
+ }
1392
+ buildEnd(e) {
1393
+ this._isAdvanced && this._endAdvancedBlendMode(e);
1394
+ }
1395
+ destroy() {
1396
+ this._renderer = null, this._renderableList = null;
1397
+ for (let e in this._filterHash) this._filterHash[e].destroy();
1398
+ this._filterHash = null;
1399
+ }
1400
+ };
1401
+ J.extension = {
1402
+ type: [
1403
+ w.WebGLPipes,
1404
+ w.WebGPUPipes,
1405
+ w.CanvasPipes
1406
+ ],
1407
+ name: "blendMode"
1408
+ };
1409
+ //#endregion
1410
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/scene/container/utils/clearList.mjs
1411
+ function Y(e, t) {
1412
+ t ||= 0;
1413
+ for (let n = t; n < e.length && e[n]; n++) e[n] = null;
1414
+ }
1415
+ //#endregion
1416
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/scene/container/utils/updateRenderGroupTransforms.mjs
1417
+ var Ft = new t(), It = 7;
1418
+ function Lt(e, t = !1) {
1419
+ Rt(e);
1420
+ let n = e.childrenToUpdate, r = e.updateTick++;
1421
+ for (let t in n) {
1422
+ let i = Number(t), a = n[t], o = a.list, s = a.index;
1423
+ for (let t = 0; t < s; t++) {
1424
+ let n = o[t];
1425
+ n.parentRenderGroup === e && n.relativeRenderGroupDepth === i && zt(n, r, 0);
1426
+ }
1427
+ Y(o, s), a.index = 0;
1428
+ }
1429
+ if (t) for (let n = 0; n < e.renderGroupChildren.length; n++) Lt(e.renderGroupChildren[n], t);
1430
+ }
1431
+ function Rt(e) {
1432
+ let t = e.root, n;
1433
+ if (e.renderGroupParent) {
1434
+ let r = e.renderGroupParent;
1435
+ e.worldTransform.appendFrom(t.relativeGroupTransform, r.worldTransform), e.worldColor = re(t.groupColor, r.worldColor), n = t.groupAlpha * r.worldAlpha;
1436
+ } else e.worldTransform.copyFrom(t.localTransform), e.worldColor = t.localColor, n = t.localAlpha;
1437
+ n = n < 0 ? 0 : n > 1 ? 1 : n, e.worldAlpha = n, e.worldColorAlpha = e.worldColor + ((n * 255 | 0) << 24);
1438
+ }
1439
+ function zt(e, t, n) {
1440
+ if (t === e.updateTick) return;
1441
+ e.updateTick = t, e.didChange = !1;
1442
+ let r = e.localTransform;
1443
+ e.updateLocalTransform();
1444
+ let i = e.parent;
1445
+ if (i && !i.renderGroup ? (n |= e._updateFlags, e.relativeGroupTransform.appendFrom(r, i.relativeGroupTransform), n & It && Bt(e, i, n)) : (n = e._updateFlags, e.relativeGroupTransform.copyFrom(r), n & It && Bt(e, Ft, n)), !e.renderGroup) {
1446
+ let r = e.children, i = r.length;
1447
+ for (let e = 0; e < i; e++) zt(r[e], t, n);
1448
+ let a = e.parentRenderGroup, o = e;
1449
+ o.renderPipeId && !a.structureDidChange && a.updateRenderable(o);
1450
+ }
1451
+ }
1452
+ function Bt(e, t, n) {
1453
+ if (n & 1) {
1454
+ e.groupColor = re(e.localColor, t.groupColor);
1455
+ let n = e.localAlpha * t.groupAlpha;
1456
+ n = n < 0 ? 0 : n > 1 ? 1 : n, e.groupAlpha = n, e.groupColorAlpha = e.groupColor + ((n * 255 | 0) << 24);
1457
+ }
1458
+ n & 2 && (e.groupBlendMode = e.localBlendMode === "inherit" ? t.groupBlendMode : e.localBlendMode), n & 4 && (e.globalDisplayStatus = e.localDisplayStatus & t.globalDisplayStatus), e._updateFlags = 0;
1459
+ }
1460
+ //#endregion
1461
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/scene/container/utils/validateRenderables.mjs
1462
+ function Vt(e, t) {
1463
+ let { list: n } = e.childrenRenderablesToUpdate, r = !1;
1464
+ for (let i = 0; i < e.childrenRenderablesToUpdate.index; i++) {
1465
+ let e = n[i];
1466
+ if (r = t[e.renderPipeId].validateRenderable(e), r) break;
1467
+ }
1468
+ return e.structureDidChange = r, r;
1469
+ }
1470
+ //#endregion
1471
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/scene/container/RenderGroupSystem.mjs
1472
+ var Ht = new y(), Ut = class {
1473
+ constructor(e) {
1474
+ this._renderer = e;
1475
+ }
1476
+ render({ container: e, transform: t }) {
1477
+ let n = e.parent, r = e.renderGroup.renderGroupParent;
1478
+ e.parent = null, e.renderGroup.renderGroupParent = null;
1479
+ let i = this._renderer, a = Ht;
1480
+ t && (a.copyFrom(e.renderGroup.localTransform), e.renderGroup.localTransform.copyFrom(t));
1481
+ let o = i.renderPipes;
1482
+ this._updateCachedRenderGroups(e.renderGroup, null), this._updateRenderGroups(e.renderGroup), i.globalUniforms.start({
1483
+ worldTransformMatrix: t ? e.renderGroup.localTransform : e.renderGroup.worldTransform,
1484
+ worldColor: e.renderGroup.worldColorAlpha
1485
+ }), W(e.renderGroup, o), o.uniformBatch && o.uniformBatch.renderEnd(), t && e.renderGroup.localTransform.copyFrom(a), e.parent = n, e.renderGroup.renderGroupParent = r;
1486
+ }
1487
+ destroy() {
1488
+ this._renderer = null;
1489
+ }
1490
+ _updateCachedRenderGroups(t, n) {
1491
+ if (t._parentCacheAsTextureRenderGroup = n, t.isCachedAsTexture) {
1492
+ if (!t.textureNeedsUpdate) return;
1493
+ n = t;
1494
+ }
1495
+ for (let e = t.renderGroupChildren.length - 1; e >= 0; e--) this._updateCachedRenderGroups(t.renderGroupChildren[e], n);
1496
+ if (t.invalidateMatrices(), t.isCachedAsTexture) {
1497
+ if (t.textureNeedsUpdate) {
1498
+ let n = t.root.getLocalBounds(), i = this._renderer, a = t.textureOptions.resolution || i.view.resolution, o = t.textureOptions.antialias ?? i.view.antialias, s = t.textureOptions.scaleMode ?? "linear", c = t.texture;
1499
+ n.ceil(), t.texture && d.returnTexture(t.texture, !0);
1500
+ let l = d.getOptimalTexture(n.width, n.height, a, o);
1501
+ l._source.style = new r({ scaleMode: s }), t.texture = l, t._textureBounds ||= new e(), t._textureBounds.copyFrom(n), c !== t.texture && t.renderGroupParent && (t.renderGroupParent.structureDidChange = !0);
1502
+ }
1503
+ } else t.texture &&= (d.returnTexture(t.texture, !0), null);
1504
+ }
1505
+ _updateRenderGroups(e) {
1506
+ let t = this._renderer, n = t.renderPipes;
1507
+ if (e.runOnRender(t), e.instructionSet.renderPipes = n, e.structureDidChange ? Y(e.childrenRenderablesToUpdate.list, 0) : Vt(e, n), Lt(e), e.structureDidChange ? (e.structureDidChange = !1, this._buildInstructions(e, t)) : this._updateRenderables(e), e.childrenRenderablesToUpdate.index = 0, t.renderPipes.batch.upload(e.instructionSet), !(e.isCachedAsTexture && !e.textureNeedsUpdate)) for (let t = 0; t < e.renderGroupChildren.length; t++) this._updateRenderGroups(e.renderGroupChildren[t]);
1508
+ }
1509
+ _updateRenderables(e) {
1510
+ let { list: t, index: n } = e.childrenRenderablesToUpdate;
1511
+ for (let r = 0; r < n; r++) {
1512
+ let n = t[r];
1513
+ n.didViewUpdate && e.updateRenderable(n);
1514
+ }
1515
+ Y(t, n);
1516
+ }
1517
+ _buildInstructions(e, t) {
1518
+ let n = e.root, r = e.instructionSet;
1519
+ r.reset();
1520
+ let i = t.renderPipes ? t : t.batch.renderer, a = i.renderPipes;
1521
+ a.batch.buildStart(r), a.blendMode.buildStart(), a.colorMask.buildStart(), n.sortableChildren && n.sortChildren(), n.collectRenderablesWithEffects(r, i, null), a.batch.buildEnd(r), a.blendMode.buildEnd(r);
1522
+ }
1523
+ };
1524
+ Ut.extension = {
1525
+ type: [
1526
+ w.WebGLSystem,
1527
+ w.WebGPUSystem,
1528
+ w.CanvasSystem
1529
+ ],
1530
+ name: "renderGroup"
1531
+ };
1532
+ //#endregion
1533
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/shared/background/BackgroundSystem.mjs
1534
+ var X = class e {
1535
+ constructor() {
1536
+ this.clearBeforeRender = !0, this._backgroundColor = new T(0), this.color = this._backgroundColor, this.alpha = 1;
1537
+ }
1538
+ init(t) {
1539
+ t = {
1540
+ ...e.defaultOptions,
1541
+ ...t
1542
+ }, this.clearBeforeRender = t.clearBeforeRender, this.color = t.background || t.backgroundColor || this._backgroundColor, this.alpha = t.backgroundAlpha, this._backgroundColor.setAlpha(t.backgroundAlpha);
1543
+ }
1544
+ get color() {
1545
+ return this._backgroundColor;
1546
+ }
1547
+ set color(e) {
1548
+ T.shared.setValue(e).alpha < 1 && this._backgroundColor.alpha === 1 && u("Cannot set a transparent background on an opaque canvas. To enable transparency, set backgroundAlpha < 1 when initializing your Application."), this._backgroundColor.setValue(e);
1549
+ }
1550
+ get alpha() {
1551
+ return this._backgroundColor.alpha;
1552
+ }
1553
+ set alpha(e) {
1554
+ this._backgroundColor.setAlpha(e);
1555
+ }
1556
+ get colorRgba() {
1557
+ return this._backgroundColor.toArray();
1558
+ }
1559
+ destroy() {}
1560
+ };
1561
+ X.extension = {
1562
+ type: [
1563
+ w.WebGLSystem,
1564
+ w.WebGPUSystem,
1565
+ w.CanvasSystem
1566
+ ],
1567
+ name: "background",
1568
+ priority: 0
1569
+ }, X.defaultOptions = {
1570
+ backgroundAlpha: 1,
1571
+ backgroundColor: 0,
1572
+ clearBeforeRender: !0
1573
+ };
1574
+ var Wt = X, Gt = {
1575
+ png: "image/png",
1576
+ jpg: "image/jpeg",
1577
+ webp: "image/webp"
1578
+ }, Kt = class e {
1579
+ constructor(e) {
1580
+ this._renderer = e;
1581
+ }
1582
+ _normalizeOptions(e, n = {}) {
1583
+ return e instanceof t || e instanceof f ? {
1584
+ target: e,
1585
+ ...n
1586
+ } : {
1587
+ ...n,
1588
+ ...e
1589
+ };
1590
+ }
1591
+ async image(e) {
1592
+ let t = _.get().createImage();
1593
+ return t.src = await this.base64(e), t;
1594
+ }
1595
+ async base64(t) {
1596
+ t = this._normalizeOptions(t, e.defaultImageOptions);
1597
+ let { format: n, quality: r } = t, i = this.canvas(t);
1598
+ if (i.toBlob !== void 0) return new Promise((e, t) => {
1599
+ i.toBlob((n) => {
1600
+ if (!n) {
1601
+ t(/* @__PURE__ */ Error("ICanvas.toBlob failed!"));
1602
+ return;
1603
+ }
1604
+ let r = new FileReader();
1605
+ r.onload = () => e(r.result), r.onerror = t, r.readAsDataURL(n);
1606
+ }, Gt[n], r);
1607
+ });
1608
+ if (i.toDataURL !== void 0) return i.toDataURL(Gt[n], r);
1609
+ if (i.convertToBlob !== void 0) {
1610
+ let e = await i.convertToBlob({
1611
+ type: Gt[n],
1612
+ quality: r
1613
+ });
1614
+ return new Promise((t, n) => {
1615
+ let r = new FileReader();
1616
+ r.onload = () => t(r.result), r.onerror = n, r.readAsDataURL(e);
1617
+ });
1618
+ }
1619
+ throw Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented");
1620
+ }
1621
+ canvas(e) {
1622
+ e = this._normalizeOptions(e);
1623
+ let t = e.target, n = this._renderer;
1624
+ if (t instanceof f) return n.texture.generateCanvas(t);
1625
+ let r = n.textureGenerator.generateTexture(e), i = n.texture.generateCanvas(r);
1626
+ return r.destroy(!0), i;
1627
+ }
1628
+ pixels(e) {
1629
+ e = this._normalizeOptions(e);
1630
+ let n = e.target, r = this._renderer, i = n instanceof f ? n : r.textureGenerator.generateTexture(e), a = r.texture.getPixels(i);
1631
+ return n instanceof t && i.destroy(!0), a;
1632
+ }
1633
+ texture(e) {
1634
+ return e = this._normalizeOptions(e), e.target instanceof f ? e.target : this._renderer.textureGenerator.generateTexture(e);
1635
+ }
1636
+ download(e) {
1637
+ e = this._normalizeOptions(e);
1638
+ let t = this.canvas(e), n = document.createElement("a");
1639
+ n.download = e.filename ?? "image.png", n.href = t.toDataURL("image/png"), document.body.appendChild(n), n.click(), document.body.removeChild(n);
1640
+ }
1641
+ log(e) {
1642
+ let t = e.width ?? 200;
1643
+ e = this._normalizeOptions(e);
1644
+ let n = this.canvas(e), r = n.toDataURL();
1645
+ console.log(`[Pixi Texture] ${n.width}px ${n.height}px`);
1646
+ let i = [
1647
+ "font-size: 1px;",
1648
+ `padding: ${t}px 300px;`,
1649
+ `background: url(${r}) no-repeat;`,
1650
+ "background-size: contain;"
1651
+ ].join(" ");
1652
+ console.log("%c ", i);
1653
+ }
1654
+ destroy() {
1655
+ this._renderer = null;
1656
+ }
1657
+ };
1658
+ Kt.extension = {
1659
+ type: [
1660
+ w.WebGLSystem,
1661
+ w.WebGPUSystem,
1662
+ w.CanvasSystem
1663
+ ],
1664
+ name: "extract"
1665
+ }, Kt.defaultImageOptions = {
1666
+ format: "png",
1667
+ quality: 1
1668
+ };
1669
+ var qt = Kt, Jt = class e extends f {
1670
+ static create(t) {
1671
+ let { dynamic: n, textureOptions: r, ...i } = t;
1672
+ return new e({
1673
+ ...r,
1674
+ source: new p(i),
1675
+ dynamic: n ?? !1
1676
+ });
1677
+ }
1678
+ resize(e, t, n) {
1679
+ return this.source.resize(e, t, n), this;
1680
+ }
1681
+ }, Yt = new l(), Xt = new e(), Zt = [
1682
+ 0,
1683
+ 0,
1684
+ 0,
1685
+ 0
1686
+ ], Qt = class {
1687
+ constructor(e) {
1688
+ this._renderer = e;
1689
+ }
1690
+ generateTexture(e) {
1691
+ e instanceof t && (e = {
1692
+ target: e,
1693
+ frame: void 0,
1694
+ textureSourceOptions: {},
1695
+ resolution: void 0
1696
+ });
1697
+ let r = e.resolution || this._renderer.resolution, i = e.antialias || this._renderer.view.antialias, a = e.target, o = e.clearColor;
1698
+ o = o ? Array.isArray(o) && o.length === 4 ? o : T.shared.setValue(o).toArray() : Zt;
1699
+ let s = e.frame?.copyTo(Yt) || n(a, Xt).rectangle, c = e.defaultAnchor && { defaultAnchor: e.defaultAnchor };
1700
+ s.width = Math.max(s.width, 1 / r) | 0, s.height = Math.max(s.height, 1 / r) | 0;
1701
+ let l = Jt.create({
1702
+ ...e.textureSourceOptions,
1703
+ width: s.width,
1704
+ height: s.height,
1705
+ resolution: r,
1706
+ antialias: i,
1707
+ textureOptions: c
1708
+ }), u = y.shared.translate(-s.x, -s.y);
1709
+ return this._renderer.render({
1710
+ container: a,
1711
+ transform: u,
1712
+ target: l,
1713
+ clearColor: o
1714
+ }), l.source.updateMipmaps(), l;
1715
+ }
1716
+ destroy() {
1717
+ this._renderer = null;
1718
+ }
1719
+ };
1720
+ Qt.extension = {
1721
+ type: [
1722
+ w.WebGLSystem,
1723
+ w.WebGPUSystem,
1724
+ w.CanvasSystem
1725
+ ],
1726
+ name: "textureGenerator"
1727
+ };
1728
+ //#endregion
1729
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/utils/data/clean.mjs
1730
+ function $t(e) {
1731
+ let t = !1;
1732
+ for (let n in e) if (e[n] == null) {
1733
+ t = !0;
1734
+ break;
1735
+ }
1736
+ if (!t) return e;
1737
+ let n = /* @__PURE__ */ Object.create(null);
1738
+ for (let t in e) {
1739
+ let r = e[t];
1740
+ r && (n[t] = r);
1741
+ }
1742
+ return n;
1743
+ }
1744
+ function en(e) {
1745
+ let t = 0;
1746
+ for (let n = 0; n < e.length; n++) e[n] == null ? t++ : e[n - t] = e[n];
1747
+ return e.length -= t, e;
1748
+ }
1749
+ //#endregion
1750
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/shared/GCSystem.mjs
1751
+ var tn = class e {
1752
+ constructor(e) {
1753
+ this._managedResources = [], this._managedResourceHashes = [], this._managedCollections = [], this._ready = !1, this._renderer = e;
1754
+ }
1755
+ init(t) {
1756
+ t = {
1757
+ ...e.defaultOptions,
1758
+ ...t
1759
+ }, this.maxUnusedTime = t.gcMaxUnusedTime, this._frequency = t.gcFrequency, this.enabled = t.gcActive, this.now = performance.now();
1760
+ }
1761
+ get enabled() {
1762
+ return !!this._handler;
1763
+ }
1764
+ set enabled(e) {
1765
+ this.enabled !== e && (e ? (this._handler = this._renderer.scheduler.repeat(() => {
1766
+ this._ready = !0;
1767
+ }, this._frequency, !1), this._collectionsHandler = this._renderer.scheduler.repeat(() => {
1768
+ for (let e of this._managedCollections) {
1769
+ let { context: t, collection: n, type: r } = e;
1770
+ r === "hash" ? t[n] = $t(t[n]) : t[n] = en(t[n]);
1771
+ }
1772
+ }, this._frequency)) : (this._renderer.scheduler.cancel(this._handler), this._renderer.scheduler.cancel(this._collectionsHandler), this._handler = 0, this._collectionsHandler = 0));
1773
+ }
1774
+ prerender({ container: e }) {
1775
+ this.now = performance.now(), e.renderGroup.gcTick = this._renderer.tick++, this._updateInstructionGCTick(e.renderGroup, e.renderGroup.gcTick);
1776
+ }
1777
+ postrender() {
1778
+ !this._ready || !this.enabled || (this.run(), this._ready = !1);
1779
+ }
1780
+ _updateInstructionGCTick(e, t) {
1781
+ e.instructionSet.gcTick = t, e.gcTick = t;
1782
+ for (let n of e.renderGroupChildren) this._updateInstructionGCTick(n, t);
1783
+ }
1784
+ addCollection(e, t, n) {
1785
+ this._managedCollections.push({
1786
+ context: e,
1787
+ collection: t,
1788
+ type: n
1789
+ });
1790
+ }
1791
+ addResource(e, t) {
1792
+ if (e._gcLastUsed !== -1) {
1793
+ e._gcLastUsed = this.now, e._onTouch?.(this.now);
1794
+ return;
1795
+ }
1796
+ e._gcData = {
1797
+ index: this._managedResources.length,
1798
+ type: t
1799
+ }, e._gcLastUsed = this.now, e._onTouch?.(this.now), e.once("unload", this.removeResource, this), this._managedResources.push(e);
1800
+ }
1801
+ removeResource(e) {
1802
+ let t = e._gcData;
1803
+ if (!t) return;
1804
+ let n = t.index, r = this._managedResources.length - 1;
1805
+ if (n !== r) {
1806
+ let e = this._managedResources[r];
1807
+ this._managedResources[n] = e, e._gcData.index = n;
1808
+ }
1809
+ this._managedResources.length--, e._gcData = null, e._gcLastUsed = -1;
1810
+ }
1811
+ addResourceHash(e, t, n, r = 0) {
1812
+ this._managedResourceHashes.push({
1813
+ context: e,
1814
+ hash: t,
1815
+ type: n,
1816
+ priority: r
1817
+ }), this._managedResourceHashes.sort((e, t) => e.priority - t.priority);
1818
+ }
1819
+ run() {
1820
+ let e = performance.now(), t = this._managedResourceHashes;
1821
+ for (let n of t) this.runOnHash(n, e);
1822
+ let n = 0;
1823
+ for (let t = 0; t < this._managedResources.length; t++) {
1824
+ let r = this._managedResources[t];
1825
+ n = this.runOnResource(r, e, n);
1826
+ }
1827
+ this._managedResources.length = n;
1828
+ }
1829
+ updateRenderableGCTick(e, t) {
1830
+ let n = e.renderGroup ?? e.parentRenderGroup, r = n?.instructionSet?.gcTick ?? -1;
1831
+ (n?.gcTick ?? 0) === r && (e._gcLastUsed = t, e._onTouch?.(t));
1832
+ }
1833
+ runOnResource(e, t, n) {
1834
+ let r = e._gcData;
1835
+ return r.type === "renderable" && this.updateRenderableGCTick(e, t), t - e._gcLastUsed < this.maxUnusedTime || !e.autoGarbageCollect ? (this._managedResources[n] = e, r.index = n, n++) : (e.unload(), e._gcData = null, e._gcLastUsed = -1, e.off("unload", this.removeResource, this)), n;
1836
+ }
1837
+ _createHashClone(e, t) {
1838
+ let n = /* @__PURE__ */ Object.create(null);
1839
+ for (let r in e) {
1840
+ if (r === t) break;
1841
+ e[r] !== null && (n[r] = e[r]);
1842
+ }
1843
+ return n;
1844
+ }
1845
+ runOnHash(e, t) {
1846
+ let { context: n, hash: r, type: i } = e, a = n[r], o = null, s = 0;
1847
+ for (let e in a) {
1848
+ let n = a[e];
1849
+ if (n === null) {
1850
+ s++, s === 1e4 && !o && (o = this._createHashClone(a, e));
1851
+ continue;
1852
+ }
1853
+ if (n._gcLastUsed === -1) {
1854
+ n._gcLastUsed = t, n._onTouch?.(t), o && (o[e] = n);
1855
+ continue;
1856
+ }
1857
+ if (i === "renderable" && this.updateRenderableGCTick(n, t), !(t - n._gcLastUsed < this.maxUnusedTime) && n.autoGarbageCollect) {
1858
+ if (i === "renderable") {
1859
+ let e = n, t = e.renderGroup ?? e.parentRenderGroup;
1860
+ t && (t.structureDidChange = !0);
1861
+ }
1862
+ n.unload(), n._gcData = null, n._gcLastUsed = -1, o || (s + 1 === 1e4 ? o = this._createHashClone(a, e) : (a[e] = null, s++));
1863
+ } else o && (o[e] = n);
1864
+ }
1865
+ o && (n[r] = o);
1866
+ }
1867
+ destroy() {
1868
+ this.enabled = !1, this._managedResources.forEach((e) => {
1869
+ e.off("unload", this.removeResource, this);
1870
+ }), this._managedResources.length = 0, this._managedResourceHashes.length = 0, this._managedCollections.length = 0, this._renderer = null;
1871
+ }
1872
+ };
1873
+ tn.extension = {
1874
+ type: [
1875
+ w.WebGLSystem,
1876
+ w.WebGPUSystem,
1877
+ w.CanvasSystem
1878
+ ],
1879
+ name: "gc",
1880
+ priority: 0
1881
+ }, tn.defaultOptions = {
1882
+ gcActive: !0,
1883
+ gcMaxUnusedTime: 6e4,
1884
+ gcFrequency: 3e4
1885
+ };
1886
+ var nn = tn, rn = class {
1887
+ constructor(e) {
1888
+ this._stackIndex = 0, this._globalUniformDataStack = [], this._uniformsPool = [], this._activeUniforms = [], this._bindGroupPool = [], this._activeBindGroups = [], this._renderer = e;
1889
+ }
1890
+ reset() {
1891
+ this._stackIndex = 0;
1892
+ for (let e = 0; e < this._activeUniforms.length; e++) this._uniformsPool.push(this._activeUniforms[e]);
1893
+ for (let e = 0; e < this._activeBindGroups.length; e++) this._bindGroupPool.push(this._activeBindGroups[e]);
1894
+ this._activeUniforms.length = 0, this._activeBindGroups.length = 0;
1895
+ }
1896
+ start(e) {
1897
+ this.reset(), this.push(e);
1898
+ }
1899
+ bind({ size: e, projectionMatrix: t, worldTransformMatrix: n, worldColor: r, offset: i }) {
1900
+ let a = this._renderer.renderTarget.renderTarget, o = this._stackIndex ? this._globalUniformDataStack[this._stackIndex - 1] : {
1901
+ projectionData: a,
1902
+ worldTransformMatrix: new y(),
1903
+ worldColor: 4294967295,
1904
+ offset: new ue()
1905
+ }, s = {
1906
+ projectionMatrix: t || this._renderer.renderTarget.projectionMatrix,
1907
+ resolution: e || a.size,
1908
+ worldTransformMatrix: n || o.worldTransformMatrix,
1909
+ worldColor: r || o.worldColor,
1910
+ offset: i || o.offset,
1911
+ bindGroup: null
1912
+ }, c = this._uniformsPool.pop() || this._createUniforms();
1913
+ this._activeUniforms.push(c);
1914
+ let l = c.uniforms;
1915
+ l.uProjectionMatrix = s.projectionMatrix, l.uResolution = s.resolution, l.uWorldTransformMatrix.copyFrom(s.worldTransformMatrix), l.uWorldTransformMatrix.tx -= s.offset.x, l.uWorldTransformMatrix.ty -= s.offset.y, kt(s.worldColor, l.uWorldColorAlpha, 0), c.update();
1916
+ let u;
1917
+ this._renderer.renderPipes.uniformBatch ? u = this._renderer.renderPipes.uniformBatch.getUniformBindGroup(c, !1) : (u = this._bindGroupPool.pop() || new de(), this._activeBindGroups.push(u), u.setResource(c, 0)), s.bindGroup = u, this._currentGlobalUniformData = s;
1918
+ }
1919
+ push(e) {
1920
+ this.bind(e), this._globalUniformDataStack[this._stackIndex++] = this._currentGlobalUniformData;
1921
+ }
1922
+ pop() {
1923
+ this._currentGlobalUniformData = this._globalUniformDataStack[--this._stackIndex - 1], this._renderer.type === S.WEBGL && this._currentGlobalUniformData.bindGroup.resources[0].update();
1924
+ }
1925
+ get bindGroup() {
1926
+ return this._currentGlobalUniformData.bindGroup;
1927
+ }
1928
+ get globalUniformData() {
1929
+ return this._currentGlobalUniformData;
1930
+ }
1931
+ get uniformGroup() {
1932
+ return this._currentGlobalUniformData.bindGroup.resources[0];
1933
+ }
1934
+ _createUniforms() {
1935
+ return new v({
1936
+ uProjectionMatrix: {
1937
+ value: new y(),
1938
+ type: "mat3x3<f32>"
1939
+ },
1940
+ uWorldTransformMatrix: {
1941
+ value: new y(),
1942
+ type: "mat3x3<f32>"
1943
+ },
1944
+ uWorldColorAlpha: {
1945
+ value: /* @__PURE__ */ new Float32Array(4),
1946
+ type: "vec4<f32>"
1947
+ },
1948
+ uResolution: {
1949
+ value: [0, 0],
1950
+ type: "vec2<f32>"
1951
+ }
1952
+ }, { isStatic: !0 });
1953
+ }
1954
+ destroy() {
1955
+ this._renderer = null, this._globalUniformDataStack.length = 0, this._uniformsPool.length = 0, this._activeUniforms.length = 0, this._bindGroupPool.length = 0, this._activeBindGroups.length = 0, this._currentGlobalUniformData = null;
1956
+ }
1957
+ };
1958
+ rn.extension = {
1959
+ type: [
1960
+ w.WebGLSystem,
1961
+ w.WebGPUSystem,
1962
+ w.CanvasSystem
1963
+ ],
1964
+ name: "globalUniforms"
1965
+ };
1966
+ //#endregion
1967
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/shared/SchedulerSystem.mjs
1968
+ var an = 1, on = class {
1969
+ constructor() {
1970
+ this._tasks = [], this._offset = 0;
1971
+ }
1972
+ init() {
1973
+ g.system.add(this._update, this);
1974
+ }
1975
+ repeat(e, t, n = !0) {
1976
+ let r = an++, i = 0;
1977
+ return n && (this._offset += 1e3, i = this._offset), this._tasks.push({
1978
+ func: e,
1979
+ duration: t,
1980
+ start: performance.now(),
1981
+ offset: i,
1982
+ last: performance.now(),
1983
+ repeat: !0,
1984
+ id: r
1985
+ }), r;
1986
+ }
1987
+ cancel(e) {
1988
+ for (let t = 0; t < this._tasks.length; t++) if (this._tasks[t].id === e) {
1989
+ this._tasks.splice(t, 1);
1990
+ return;
1991
+ }
1992
+ }
1993
+ _update() {
1994
+ let e = performance.now();
1995
+ for (let t = 0; t < this._tasks.length; t++) {
1996
+ let n = this._tasks[t];
1997
+ if (e - n.offset - n.last >= n.duration) {
1998
+ let t = e - n.start;
1999
+ n.func(t), n.last = e;
2000
+ }
2001
+ }
2002
+ }
2003
+ destroy() {
2004
+ g.system.remove(this._update, this), this._tasks.length = 0;
2005
+ }
2006
+ };
2007
+ on.extension = {
2008
+ type: [
2009
+ w.WebGLSystem,
2010
+ w.WebGPUSystem,
2011
+ w.CanvasSystem
2012
+ ],
2013
+ name: "scheduler",
2014
+ priority: 0
2015
+ };
2016
+ //#endregion
2017
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/utils/sayHello.mjs
2018
+ var sn = !1;
2019
+ function cn(e) {
2020
+ if (!sn) {
2021
+ if (_.get().getNavigator().userAgent.toLowerCase().indexOf("chrome") > -1) {
2022
+ let t = [
2023
+ `%c %c %c %c %c PixiJS %c v${k} (${e}) http://www.pixijs.com/
2024
+
2025
+ `,
2026
+ "background: #E72264; padding:5px 0;",
2027
+ "background: #6CA2EA; padding:5px 0;",
2028
+ "background: #B5D33D; padding:5px 0;",
2029
+ "background: #FED23F; padding:5px 0;",
2030
+ "color: #FFFFFF; background: #E72264; padding:5px 0;",
2031
+ "color: #E72264; background: #FFFFFF; padding:5px 0;"
2032
+ ];
2033
+ globalThis.console.log(...t);
2034
+ } else globalThis.console && globalThis.console.log(`PixiJS ${k} - ${e} - http://www.pixijs.com/`);
2035
+ sn = !0;
2036
+ }
2037
+ }
2038
+ //#endregion
2039
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/shared/startup/HelloSystem.mjs
2040
+ var ln = class {
2041
+ constructor(e) {
2042
+ this._renderer = e;
2043
+ }
2044
+ init(e) {
2045
+ if (e.hello) {
2046
+ let e = this._renderer.name;
2047
+ this._renderer.type === S.WEBGL && (e += ` ${this._renderer.context.webGLVersion}`), cn(e);
2048
+ }
2049
+ }
2050
+ };
2051
+ ln.extension = {
2052
+ type: [
2053
+ w.WebGLSystem,
2054
+ w.WebGPUSystem,
2055
+ w.CanvasSystem
2056
+ ],
2057
+ name: "hello",
2058
+ priority: -2
2059
+ }, ln.defaultOptions = { hello: !1 };
2060
+ //#endregion
2061
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/shared/texture/RenderableGCSystem.mjs
2062
+ var un = class e {
2063
+ constructor(e) {
2064
+ this._renderer = e;
2065
+ }
2066
+ init(t) {
2067
+ t = {
2068
+ ...e.defaultOptions,
2069
+ ...t
2070
+ }, this.maxUnusedTime = t.renderableGCMaxUnusedTime;
2071
+ }
2072
+ get enabled() {
2073
+ return o("8.15.0", "RenderableGCSystem.enabled is deprecated, please use the GCSystem.enabled instead."), this._renderer.gc.enabled;
2074
+ }
2075
+ set enabled(e) {
2076
+ o("8.15.0", "RenderableGCSystem.enabled is deprecated, please use the GCSystem.enabled instead."), this._renderer.gc.enabled = e;
2077
+ }
2078
+ addManagedHash(e, t) {
2079
+ o("8.15.0", "RenderableGCSystem.addManagedHash is deprecated, please use the GCSystem.addCollection instead."), this._renderer.gc.addCollection(e, t, "hash");
2080
+ }
2081
+ addManagedArray(e, t) {
2082
+ o("8.15.0", "RenderableGCSystem.addManagedArray is deprecated, please use the GCSystem.addCollection instead."), this._renderer.gc.addCollection(e, t, "array");
2083
+ }
2084
+ addRenderable(e) {
2085
+ o("8.15.0", "RenderableGCSystem.addRenderable is deprecated, please use the GCSystem instead."), this._renderer.gc.addResource(e, "renderable");
2086
+ }
2087
+ run() {
2088
+ o("8.15.0", "RenderableGCSystem.run is deprecated, please use the GCSystem instead."), this._renderer.gc.run();
2089
+ }
2090
+ destroy() {
2091
+ this._renderer = null;
2092
+ }
2093
+ };
2094
+ un.extension = {
2095
+ type: [
2096
+ w.WebGLSystem,
2097
+ w.WebGPUSystem,
2098
+ w.CanvasSystem
2099
+ ],
2100
+ name: "renderableGC",
2101
+ priority: 0
2102
+ }, un.defaultOptions = {
2103
+ renderableGCActive: !0,
2104
+ renderableGCMaxUnusedTime: 6e4,
2105
+ renderableGCFrequency: 3e4
2106
+ };
2107
+ var dn = un, Z = class e {
2108
+ get count() {
2109
+ return this._renderer.tick;
2110
+ }
2111
+ get checkCount() {
2112
+ return this._checkCount;
2113
+ }
2114
+ set checkCount(e) {
2115
+ o("8.15.0", "TextureGCSystem.run is deprecated, please use the GCSystem instead."), this._checkCount = e;
2116
+ }
2117
+ get maxIdle() {
2118
+ return this._renderer.gc.maxUnusedTime / 1e3 * 60;
2119
+ }
2120
+ set maxIdle(e) {
2121
+ o("8.15.0", "TextureGCSystem.run is deprecated, please use the GCSystem instead."), this._renderer.gc.maxUnusedTime = e / 60 * 1e3;
2122
+ }
2123
+ get checkCountMax() {
2124
+ return Math.floor(this._renderer.gc._frequency / 1e3);
2125
+ }
2126
+ set checkCountMax(e) {
2127
+ o("8.15.0", "TextureGCSystem.run is deprecated, please use the GCSystem instead.");
2128
+ }
2129
+ get active() {
2130
+ return this._renderer.gc.enabled;
2131
+ }
2132
+ set active(e) {
2133
+ o("8.15.0", "TextureGCSystem.run is deprecated, please use the GCSystem instead."), this._renderer.gc.enabled = e;
2134
+ }
2135
+ constructor(e) {
2136
+ this._renderer = e, this._checkCount = 0;
2137
+ }
2138
+ init(t) {
2139
+ t.textureGCActive !== e.defaultOptions.textureGCActive && (this.active = t.textureGCActive), t.textureGCMaxIdle !== e.defaultOptions.textureGCMaxIdle && (this.maxIdle = t.textureGCMaxIdle), t.textureGCCheckCountMax !== e.defaultOptions.textureGCCheckCountMax && (this.checkCountMax = t.textureGCCheckCountMax);
2140
+ }
2141
+ run() {
2142
+ o("8.15.0", "TextureGCSystem.run is deprecated, please use the GCSystem instead."), this._renderer.gc.run();
2143
+ }
2144
+ destroy() {
2145
+ this._renderer = null;
2146
+ }
2147
+ };
2148
+ Z.extension = {
2149
+ type: [w.WebGLSystem, w.WebGPUSystem],
2150
+ name: "textureGC"
2151
+ }, Z.defaultOptions = {
2152
+ textureGCActive: !0,
2153
+ textureGCAMaxIdle: null,
2154
+ textureGCMaxIdle: 3600,
2155
+ textureGCCheckCountMax: 600
2156
+ };
2157
+ var fn = Z, pn = class e {
2158
+ constructor(e = {}) {
2159
+ this.uid = h("renderTarget"), this.colorAttachments = [], this.dirtyId = 0, this.isRoot = !1, this._size = /* @__PURE__ */ new Float32Array(2), this._managedColorTextures = !1, this._depth = !1, this._stencil = !1, this._colorTextures = null;
2160
+ let t = "colorAttachments" in e ? e : this._normalizeOptions(e);
2161
+ if (this.isRoot = t.isRoot ?? !1, this.label = t.label, this.colorAttachments = t.colorAttachments, this.depthStencilAttachment = t.depthStencilAttachment, this.depthStencilAttachment) {
2162
+ let e = this.depthStencilAttachment.texture.format;
2163
+ this._depth ||= e.includes("depth"), this._stencil ||= e.includes("stencil");
2164
+ }
2165
+ if (this.colorAttachments.length === 0 && !this.depthStencilAttachment) throw Error("[RenderTarget] no color textures or depth textures were provided. Provide a depthStencilTexture or set depth/stencil to true when using colorTextures: 0.");
2166
+ if (this.colorAttachments.length > 0) {
2167
+ let e = this.colorTexture;
2168
+ this.resize(e.width, e.height, e._resolution);
2169
+ }
2170
+ this.sizeSource && this.sizeSource.on("resize", this.onSourceResize, this);
2171
+ }
2172
+ _normalizeOptions(t) {
2173
+ let n = {
2174
+ ...e.defaultOptions,
2175
+ ...t
2176
+ }, r = [], i;
2177
+ if (typeof n.colorTextures == "number") {
2178
+ if (n.colorTextures > 0) {
2179
+ this._managedColorTextures = !0;
2180
+ for (let e = 0; e < n.colorTextures; e++) r.push({
2181
+ texture: new p({
2182
+ width: n.width,
2183
+ height: n.height,
2184
+ resolution: n.resolution,
2185
+ antialias: n.antialias
2186
+ }),
2187
+ loadOp: "clear",
2188
+ storeOp: "store"
2189
+ });
2190
+ }
2191
+ } else n.colorTextures.forEach((e) => {
2192
+ r.push({
2193
+ texture: e.source,
2194
+ loadOp: "clear",
2195
+ storeOp: "store"
2196
+ });
2197
+ });
2198
+ let a = n.depthStencilTexture === !0;
2199
+ if (this._depth = !!(n.depth || a), this._stencil = !!(n.stencil || a), n.depthStencilTexture instanceof f || n.depthStencilTexture instanceof p) {
2200
+ if (n.isRoot) throw Error("[RenderTarget] cannot attach a depth-stencil texture to the screen — the canvas owns its own depth/stencil buffers. Render to a texture target instead.");
2201
+ i = { texture: n.depthStencilTexture.source };
2202
+ } else (a && !n.isRoot || (n.stencil || n.depth) && r.length === 0) && (i = this._createDepthStencilTexture(n.width, n.height, n.resolution));
2203
+ return {
2204
+ colorAttachments: r,
2205
+ depthStencilAttachment: i,
2206
+ isRoot: n.isRoot,
2207
+ label: n.label
2208
+ };
2209
+ }
2210
+ get size() {
2211
+ let e = this._size;
2212
+ return e[0] = this.pixelWidth, e[1] = this.pixelHeight, e;
2213
+ }
2214
+ get width() {
2215
+ return this.sizeSource.width;
2216
+ }
2217
+ get height() {
2218
+ return this.sizeSource.height;
2219
+ }
2220
+ get pixelWidth() {
2221
+ return this.sizeSource.pixelWidth;
2222
+ }
2223
+ get pixelHeight() {
2224
+ return this.sizeSource.pixelHeight;
2225
+ }
2226
+ get resolution() {
2227
+ return this.sizeSource._resolution;
2228
+ }
2229
+ get colorTextures() {
2230
+ return this._colorTextures ||= this.colorAttachments.map((e) => e.texture), this._colorTextures;
2231
+ }
2232
+ get depthStencilTexture() {
2233
+ return this.depthStencilAttachment?.texture ?? null;
2234
+ }
2235
+ get depth() {
2236
+ return this._depth;
2237
+ }
2238
+ get stencil() {
2239
+ return this._stencil;
2240
+ }
2241
+ get colorTexture() {
2242
+ return this.colorAttachments[0]?.texture;
2243
+ }
2244
+ get sizeSource() {
2245
+ return this.colorAttachments[0]?.texture ?? this.depthStencilAttachment?.texture;
2246
+ }
2247
+ onSourceResize(e) {
2248
+ this.resize(e.width, e.height, e._resolution, !0);
2249
+ }
2250
+ ensureDepthStencilTexture() {
2251
+ this._createDepthStencilTexture(this.sizeSource.width, this.sizeSource.height, this.sizeSource._resolution), this._depth = !0, this._stencil = !0;
2252
+ }
2253
+ resize(e, t, n = this.resolution, r = !1) {
2254
+ if (this.dirtyId++, this.colorAttachments.forEach((i, a) => {
2255
+ r && a === 0 || i.texture.resize(e, t, n);
2256
+ }), this.depthStencilAttachment) {
2257
+ if (r && this.colorAttachments.length === 0) return;
2258
+ this.depthStencilAttachment.texture.resize(e, t, n);
2259
+ }
2260
+ }
2261
+ destroy() {
2262
+ !this.colorAttachments && !this.depthStencilAttachment || (this.sizeSource.off("resize", this.onSourceResize, this), this._managedColorTextures && this.colorAttachments.forEach((e) => {
2263
+ e.texture.destroy();
2264
+ }), this.depthStencilAttachment && (this.depthStencilAttachment.texture.destroy(), delete this.depthStencilAttachment), this.colorAttachments = null, this._colorTextures = null);
2265
+ }
2266
+ _createDepthStencilTexture(e, t, n) {
2267
+ return this.depthStencilAttachment ??= { texture: new p({
2268
+ width: e,
2269
+ height: t,
2270
+ resolution: n,
2271
+ format: "depth24plus-stencil8",
2272
+ autoGenerateMipmaps: !1,
2273
+ antialias: !1,
2274
+ mipLevelCount: 1
2275
+ }) }, this.depthStencilAttachment;
2276
+ }
2277
+ };
2278
+ pn.defaultOptions = {
2279
+ width: 0,
2280
+ height: 0,
2281
+ resolution: 1,
2282
+ colorTextures: 1,
2283
+ stencil: !1,
2284
+ depth: !1,
2285
+ antialias: !1,
2286
+ isRoot: !1
2287
+ };
2288
+ var Q = pn, $ = /* @__PURE__ */ new Map();
2289
+ s.register($);
2290
+ function mn(e, t) {
2291
+ if (!$.has(e)) {
2292
+ let n = new f({ source: new me({
2293
+ resource: e,
2294
+ ...t
2295
+ }) }), r = () => {
2296
+ $.get(e) === n && $.delete(e);
2297
+ };
2298
+ n.once("destroy", r), n.source.once("destroy", r), $.set(e, n);
2299
+ }
2300
+ return $.get(e);
2301
+ }
2302
+ //#endregion
2303
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.mjs
2304
+ var hn = class e {
2305
+ get autoDensity() {
2306
+ return this.texture.source.autoDensity;
2307
+ }
2308
+ set autoDensity(e) {
2309
+ this.texture.source.autoDensity = e;
2310
+ }
2311
+ get resolution() {
2312
+ return this.texture.source._resolution;
2313
+ }
2314
+ set resolution(e) {
2315
+ this.texture.source.resize(this.texture.source.width, this.texture.source.height, e);
2316
+ }
2317
+ init(t) {
2318
+ t = {
2319
+ ...e.defaultOptions,
2320
+ ...t
2321
+ }, t.view && (o(m, "ViewSystem.view has been renamed to ViewSystem.canvas"), t.canvas = t.view), this.screen = new l(0, 0, t.width, t.height), this.canvas = t.canvas || _.get().createCanvas(), this.antialias = !!t.antialias, this.texture = mn(this.canvas, t), this.renderTarget = new Q({
2322
+ colorTextures: [this.texture],
2323
+ depth: !!t.depth,
2324
+ isRoot: !0
2325
+ }), this.texture.source.transparent = t.backgroundAlpha < 1, this.resolution = t.resolution;
2326
+ }
2327
+ resize(e, t, n) {
2328
+ this.texture.source.resize(e, t, n), this.screen.width = this.texture.frame.width, this.screen.height = this.texture.frame.height;
2329
+ }
2330
+ destroy(e = !1) {
2331
+ (typeof e == "boolean" ? e : e?.removeView) && this.canvas.parentNode && this.canvas.parentNode.removeChild(this.canvas), this.texture.destroy();
2332
+ }
2333
+ };
2334
+ hn.extension = {
2335
+ type: [
2336
+ w.WebGLSystem,
2337
+ w.WebGPUSystem,
2338
+ w.CanvasSystem
2339
+ ],
2340
+ name: "view",
2341
+ priority: 0
2342
+ }, hn.defaultOptions = {
2343
+ width: 800,
2344
+ height: 600,
2345
+ autoDensity: !1,
2346
+ antialias: !1
2347
+ };
2348
+ //#endregion
2349
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/shared/system/SharedSystems.mjs
2350
+ var gn = [
2351
+ Wt,
2352
+ rn,
2353
+ ln,
2354
+ hn,
2355
+ Ut,
2356
+ nn,
2357
+ fn,
2358
+ Qt,
2359
+ qt,
2360
+ Se,
2361
+ dn,
2362
+ on
2363
+ ], _n = [
2364
+ J,
2365
+ V,
2366
+ K,
2367
+ G,
2368
+ H,
2369
+ Pt,
2370
+ Nt,
2371
+ U
2372
+ ];
2373
+ //#endregion
2374
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gpu/renderTarget/calculateProjection.mjs
2375
+ function vn(e, t, n, r, i, a) {
2376
+ let o = a ? 1 : -1;
2377
+ return e.identity(), e.a = 1 / r * 2, e.d = o * (1 / i * 2), e.tx = -1 - t * e.a, e.ty = -o - n * e.d, e;
2378
+ }
2379
+ //#endregion
2380
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/shared/renderTarget/isRenderingToScreen.mjs
2381
+ function yn(e) {
2382
+ if (e.colorAttachments.length === 0) return !1;
2383
+ let t = e.colorTexture.resource;
2384
+ return globalThis.HTMLCanvasElement && t instanceof HTMLCanvasElement && document.body.contains(t);
2385
+ }
2386
+ //#endregion
2387
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/shared/renderTarget/RenderTargetSystem.mjs
2388
+ var bn = class {
2389
+ constructor(e) {
2390
+ this.rootViewPort = new l(), this.viewport = new l(), this.onRenderTargetChange = new _e("onRenderTargetChange"), this.projectionMatrix = new y(), this.defaultClearColor = [
2391
+ 0,
2392
+ 0,
2393
+ 0,
2394
+ 0
2395
+ ], this._renderSurfaceToRenderTargetHash = /* @__PURE__ */ new Map(), this._gpuRenderTargetHash = /* @__PURE__ */ Object.create(null), this._renderTargetStack = [], this._bindState = {
2396
+ target: null,
2397
+ frame: void 0,
2398
+ mipLevel: 0,
2399
+ layer: 0,
2400
+ flipY: !1
2401
+ }, this._bindFrame = new l(), this._renderer = e, e.gc.addCollection(this, "_gpuRenderTargetHash", "hash");
2402
+ }
2403
+ get renderSurface() {
2404
+ return this._bindState.target;
2405
+ }
2406
+ get mipLevel() {
2407
+ return this._bindState.mipLevel;
2408
+ }
2409
+ get layer() {
2410
+ return this._bindState.layer;
2411
+ }
2412
+ finishRenderPass() {
2413
+ this.adaptor.finishRenderPass(this.renderTarget);
2414
+ }
2415
+ renderStart(e) {
2416
+ this._renderTargetStack.length = 0, this.push(e), this.rootViewPort.copyFrom(this.viewport), this.rootRenderTarget = this.renderTarget, this.renderingToScreen = yn(this.rootRenderTarget), this.adaptor.prerender?.(this.rootRenderTarget);
2417
+ }
2418
+ postrender() {
2419
+ this.adaptor.postrender?.(this.rootRenderTarget);
2420
+ }
2421
+ bind(e, t = !0, n, r, i = 0, a = 0, s) {
2422
+ let c;
2423
+ "target" in e ? c = e : (o("8.20.0", "RenderTargetSystem.bind: positional arguments are deprecated, please use an options object instead: bind({ target, clear, clearColor, frame, mipLevel, layer, flipY })"), c = {
2424
+ target: e,
2425
+ clear: t,
2426
+ clearColor: n,
2427
+ frame: r,
2428
+ mipLevel: i,
2429
+ layer: a,
2430
+ flipY: s
2431
+ });
2432
+ let l = c.target;
2433
+ t = c.clear ?? !0, n = c.clearColor, i = (c.mipLevel ?? 0) | 0, a = (c.layer ?? 0) | 0, s = c.flipY, r = c.frame;
2434
+ let u = this.getRenderTarget(l), d = this.renderTarget !== u;
2435
+ this.renderTarget = u;
2436
+ let p = this.getGpuRenderTarget(u);
2437
+ (u.pixelWidth !== p.width || u.pixelHeight !== p.height) && (this.adaptor.resizeGpuRenderTarget(u), p.width = u.pixelWidth, p.height = u.pixelHeight);
2438
+ let m = u.colorAttachments[0]?.texture || u.depthStencilAttachment?.texture, h = this.viewport, g = m.arrayLayerCount || 1;
2439
+ if (a < 0 || a >= g) throw Error(`[RenderTargetSystem] layer ${a} is out of bounds (arrayLayerCount=${g}).`);
2440
+ let _ = this._bindState;
2441
+ _.target = l, _.frame = r ? this._bindFrame.copyFrom(r) : void 0, _.mipLevel = i, _.layer = a, _.flipY = s;
2442
+ let v = Math.max(m.pixelWidth >> i, 1), y = Math.max(m.pixelHeight >> i, 1);
2443
+ if (!r && l instanceof f && (r = l.frame), r) {
2444
+ let e = m._resolution, t = 1 << Math.max(i, 0), n = r.x * e + .5 | 0, a = r.y * e + .5 | 0, o = r.width * e + .5 | 0, s = r.height * e + .5 | 0, c = Math.floor(n / t), l = Math.floor(a / t), u = Math.ceil(o / t), d = Math.ceil(s / t);
2445
+ c < 0 && (u += c, c = 0), l < 0 && (d += l, l = 0), c = Math.min(c, v - 1), l = Math.min(l, y - 1), u = Math.min(u, v - c), d = Math.min(d, y - l), u = Math.max(u, 1), d = Math.max(d, 1), h.x = c, h.y = l, h.width = u, h.height = d;
2446
+ } else h.x = 0, h.y = 0, h.width = v, h.height = y;
2447
+ return u.flipY = s, vn(this.projectionMatrix, 0, 0, h.width / m.resolution, h.height / m.resolution, !u.isRoot != !!u.flipY), this.adaptor.startRenderPass(u, t, n, h, i, a), d && this.onRenderTargetChange.emit(u), u;
2448
+ }
2449
+ getBindState(e) {
2450
+ if (!this.renderTarget) throw Error("[RenderTargetSystem] getBindState is only valid while a render surface is bound");
2451
+ let t = this._bindState;
2452
+ return e ??= {}, e.target = t.target, e.clear = O.NONE, e.clearColor = void 0, t.frame ? e.frame ? e.frame.copyFrom(t.frame) : e.frame = t.frame.clone() : e.frame = void 0, e.mipLevel = t.mipLevel, e.layer = t.layer, e.flipY = !!t.flipY, e;
2453
+ }
2454
+ get frontFaceInverted() {
2455
+ let e = this.renderTarget;
2456
+ if (!e) return !1;
2457
+ let t = this._renderer.type === S.WEBGL && !e.isRoot;
2458
+ return !!e.flipY !== t;
2459
+ }
2460
+ clear(e, t = O.ALL, n, r = this.mipLevel, i = this.layer) {
2461
+ t && (e &&= this.getRenderTarget(e), this.adaptor.clear(e || this.renderTarget, t, n, this.viewport, r, i));
2462
+ }
2463
+ contextChange() {
2464
+ this._gpuRenderTargetHash = /* @__PURE__ */ Object.create(null);
2465
+ }
2466
+ push(e, t = O.ALL, n, r, i = 0, a = 0, s) {
2467
+ let c;
2468
+ "target" in e ? c = e : (o("8.20.0", "RenderTargetSystem.push: positional arguments are deprecated, please use an options object instead: push({ target, clear, clearColor, frame, mipLevel, layer, flipY })"), c = {
2469
+ target: e,
2470
+ clear: t,
2471
+ clearColor: n,
2472
+ frame: r,
2473
+ mipLevel: i,
2474
+ layer: a,
2475
+ flipY: s
2476
+ });
2477
+ let l = this.bind(c);
2478
+ return this._renderTargetStack.push({
2479
+ target: c.target,
2480
+ clear: !1,
2481
+ clearColor: void 0,
2482
+ frame: c.frame ? c.frame.clone() : void 0,
2483
+ mipLevel: c.mipLevel,
2484
+ layer: c.layer,
2485
+ flipY: c.flipY
2486
+ }), l;
2487
+ }
2488
+ pop() {
2489
+ this._renderTargetStack.pop();
2490
+ let e = this._renderTargetStack[this._renderTargetStack.length - 1];
2491
+ if (!e) throw Error("[RenderTargetSystem] pop: no previous binding to restore (unbalanced pop)");
2492
+ return this.bind(e);
2493
+ }
2494
+ getRenderTarget(e) {
2495
+ return e.isTexture && (e = e.source), this._renderSurfaceToRenderTargetHash.get(e) ?? this._initRenderTarget(e);
2496
+ }
2497
+ copyToTexture(e, t, n, r, i) {
2498
+ let a = this.getRenderTarget(e);
2499
+ n.x < 0 && (r.width += n.x, i.x -= n.x, n.x = 0), n.y < 0 && (r.height += n.y, i.y -= n.y, n.y = 0);
2500
+ let { pixelWidth: o, pixelHeight: s } = a;
2501
+ return r.width = Math.min(r.width, o - n.x), r.height = Math.min(r.height, s - n.y), this.adaptor.copyToTexture(a, t, n, r, i);
2502
+ }
2503
+ copyDepthTexture(e, t, n, r, i = {
2504
+ x: 0,
2505
+ y: 0
2506
+ }) {
2507
+ let a = this.getRenderTarget(e);
2508
+ if (!a.depthStencilAttachment) {
2509
+ u("[RenderTargetSystem] copyDepthTexture: the source render target has no depth attachment to copy from");
2510
+ return;
2511
+ }
2512
+ let o = t.source;
2513
+ if (!o.format.includes("depth") && !o.format.includes("stencil")) {
2514
+ u(`[RenderTargetSystem] copyDepthTexture: the destination texture must have a depth/stencil format (got '${o.format}')`);
2515
+ return;
2516
+ }
2517
+ let s = n.x, c = n.y, l = i.x, d = i.y, f = r.width, p = r.height;
2518
+ s < 0 && (f += s, l -= s, s = 0), c < 0 && (p += c, d -= c, c = 0), f = Math.min(f, a.pixelWidth - s), p = Math.min(p, a.pixelHeight - c), f = Math.min(f, o.pixelWidth - l), p = Math.min(p, o.pixelHeight - d), !(f <= 0 || p <= 0) && this.adaptor.copyDepthTexture(a, t, {
2519
+ x: s,
2520
+ y: c
2521
+ }, {
2522
+ width: f,
2523
+ height: p
2524
+ }, {
2525
+ x: l,
2526
+ y: d
2527
+ });
2528
+ }
2529
+ ensureDepthStencil() {
2530
+ if (!this.renderTarget.stencil) {
2531
+ if (this.renderTarget.depthStencilTexture) {
2532
+ u(`[RenderTargetSystem] a stencil mask is being used, but the render target's depthStencilTexture format '${this.renderTarget.depthStencilTexture.format}' has no stencil aspect, so masking cannot work here. Use a 'depth24plus-stencil8' texture instead.`);
2533
+ return;
2534
+ }
2535
+ this.renderTarget._depth = !0, this.renderTarget._stencil = !0, this.adaptor.startRenderPass(this.renderTarget, !1, null, this.viewport, 0, this.layer);
2536
+ }
2537
+ }
2538
+ destroy() {
2539
+ this._renderer = null, this._renderSurfaceToRenderTargetHash.forEach((e, t) => {
2540
+ e !== t && this._releaseRenderTarget(t, e);
2541
+ }), this._renderSurfaceToRenderTargetHash.clear(), this._gpuRenderTargetHash = /* @__PURE__ */ Object.create(null);
2542
+ }
2543
+ _initRenderTarget(e) {
2544
+ let t = null;
2545
+ if (me.test(e) && (e = mn(e).source), e instanceof Q) t = e;
2546
+ else if (e instanceof p) {
2547
+ let n = e.format;
2548
+ t = n.includes("depth") || n.includes("stencil") ? new Q({
2549
+ colorTextures: 0,
2550
+ depthStencilTexture: e
2551
+ }) : new Q({ colorTextures: [e] }), e.source instanceof me && (t.isRoot = !0), e.once("destroy", this._onRenderSurfaceDestroy, this);
2552
+ }
2553
+ return this._renderSurfaceToRenderTargetHash.set(e, t), t;
2554
+ }
2555
+ _onRenderSurfaceDestroy(e) {
2556
+ let t = this._renderSurfaceToRenderTargetHash.get(e);
2557
+ t && this._releaseRenderTarget(e, t);
2558
+ }
2559
+ _releaseRenderTarget(e, t) {
2560
+ t.destroy(), this._renderSurfaceToRenderTargetHash.delete(e), e.off("destroy", this._onRenderSurfaceDestroy, this);
2561
+ let n = this._gpuRenderTargetHash[t.uid];
2562
+ n && (this._gpuRenderTargetHash[t.uid] = null, this.adaptor.destroyGpuRenderTarget(n));
2563
+ }
2564
+ getGpuRenderTarget(e) {
2565
+ return this._gpuRenderTargetHash[e.uid] || (this._gpuRenderTargetHash[e.uid] = this.adaptor.initGpuRenderTarget(e));
2566
+ }
2567
+ resetState() {
2568
+ this.renderTarget = null, this._bindState.target = null;
2569
+ }
2570
+ };
2571
+ //#endregion
2572
+ export { Te as C, be as D, xe as E, O, Oe as S, A as T, _t as _, K as a, lt as b, H as c, wt as d, z as f, ht as g, yt as h, J as i, ge as k, V as l, vt as m, _n as n, G as o, xt as p, gn as r, U as s, bn as t, kt as u, ut as v, j as w, ct as x, dt as y };