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,2210 @@
1
+ import { n as e } from "./rolldown-runtime-CWhphoD1.js";
2
+ import { Q as t, R as n, V as r, W as i, Z as a, a as o, b as s, d as c, et as l, it as u, l as d, m as f, nt as p, o as m, p as ee, r as h, rt as g, s as _, t as te, y as v } from "./Geometry-CN7W9DnD.js";
3
+ import { D as ne, O as y, S as re, _ as ie, b, d as x, h as S, n as ae, p as oe, r as se, t as ce, w as C, y as le } from "./RenderTargetSystem-D_FiZPnb.js";
4
+ import { a as w, c as ue, f as T, i as de, n as fe, o as pe, s as me, t as E, u as he } from "./BufferResource-CVU-ZRRz.js";
5
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/utils/browser/isSafari.mjs
6
+ function ge() {
7
+ let { userAgent: e } = s.get().getNavigator();
8
+ return /^((?!chrome|android).)*safari/i.test(e);
9
+ }
10
+ //#endregion
11
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/batcher/gl/GlBatchAdaptor.mjs
12
+ var D = class {
13
+ constructor() {
14
+ this._tempState = m.for2d(), this._didUploadHash = {};
15
+ }
16
+ init(e) {
17
+ e.renderer.runners.contextChange.add(this);
18
+ }
19
+ contextChange() {
20
+ this._didUploadHash = {};
21
+ }
22
+ start(e, t, n) {
23
+ let r = e.renderer, i = this._didUploadHash[n.uid];
24
+ r.shader.bind(n, i), i || (this._didUploadHash[n.uid] = !0), r.shader.updateUniformGroup(r.globalUniforms.uniformGroup), r.geometry.bind(t, n.glProgram);
25
+ }
26
+ execute(e, t) {
27
+ let n = e.renderer;
28
+ this._tempState.blendMode = t.blendMode, n.state.set(this._tempState);
29
+ let r = t.textures.textures;
30
+ for (let e = 0; e < t.textures.count; e++) n.texture.bind(r[e], e);
31
+ n.geometry.draw(t.topology, t.size, t.start);
32
+ }
33
+ };
34
+ D.extension = {
35
+ type: [g.WebGLPipesAdaptor],
36
+ name: "batch"
37
+ };
38
+ //#endregion
39
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/buffer/const.mjs
40
+ var O = /* @__PURE__ */ ((e) => (e[e.ELEMENT_ARRAY_BUFFER = 34963] = "ELEMENT_ARRAY_BUFFER", e[e.ARRAY_BUFFER = 34962] = "ARRAY_BUFFER", e[e.UNIFORM_BUFFER = 35345] = "UNIFORM_BUFFER", e))(O || {}), _e = class {
41
+ constructor(e, t) {
42
+ this._lastBindBaseLocation = -1, this._lastBindCallId = -1, this.buffer = e || null, this.updateID = -1, this.byteLength = -1, this.type = t;
43
+ }
44
+ destroy() {
45
+ this.buffer = null, this.updateID = -1, this.byteLength = -1, this.type = -1, this._lastBindBaseLocation = -1, this._lastBindCallId = -1;
46
+ }
47
+ }, k = class {
48
+ constructor(e) {
49
+ this._boundBufferBases = /* @__PURE__ */ Object.create(null), this._minBaseLocation = 0, this._nextBindBaseIndex = this._minBaseLocation, this._bindCallId = 0, this._renderer = e, this._managedBuffers = new x({
50
+ renderer: e,
51
+ type: "resource",
52
+ onUnload: this.onBufferUnload.bind(this),
53
+ name: "glBuffer"
54
+ });
55
+ }
56
+ destroy() {
57
+ this._managedBuffers.destroy(), this._renderer = null, this._gl = null, this._boundBufferBases = {};
58
+ }
59
+ contextChange() {
60
+ this._gl = this._renderer.gl, this.destroyAll(!0), this._maxBindings = this._renderer.limits.maxUniformBindings;
61
+ }
62
+ getGlBuffer(e) {
63
+ return e._gcLastUsed = this._renderer.gc.now, e._gpuData[this._renderer.uid] || this.createGLBuffer(e);
64
+ }
65
+ bind(e) {
66
+ let { _gl: t } = this, n = this.getGlBuffer(e);
67
+ t.bindBuffer(n.type, n.buffer);
68
+ }
69
+ bindBufferBase(e, t) {
70
+ let { _gl: n } = this;
71
+ this._boundBufferBases[t] !== e && (this._boundBufferBases[t] = e, e._lastBindBaseLocation = t, n.bindBufferBase(n.UNIFORM_BUFFER, t, e.buffer));
72
+ }
73
+ nextBindBase(e) {
74
+ this._bindCallId++, this._minBaseLocation = 0, e && (this._boundBufferBases[0] = null, this._minBaseLocation = 1, this._nextBindBaseIndex < 1 && (this._nextBindBaseIndex = 1));
75
+ }
76
+ freeLocationForBufferBase(e) {
77
+ let t = this.getLastBindBaseLocation(e);
78
+ if (t >= this._minBaseLocation) return e._lastBindCallId = this._bindCallId, t;
79
+ let n = 0, r = this._nextBindBaseIndex;
80
+ for (; n < 2;) {
81
+ r >= this._maxBindings && (r = this._minBaseLocation, n++);
82
+ let e = this._boundBufferBases[r];
83
+ if (e && e._lastBindCallId === this._bindCallId) {
84
+ r++;
85
+ continue;
86
+ }
87
+ break;
88
+ }
89
+ return t = r, this._nextBindBaseIndex = r + 1, n >= 2 ? -1 : (e._lastBindCallId = this._bindCallId, this._boundBufferBases[t] = null, t);
90
+ }
91
+ getLastBindBaseLocation(e) {
92
+ let t = e._lastBindBaseLocation;
93
+ return this._boundBufferBases[t] === e ? t : -1;
94
+ }
95
+ bindBufferRange(e, t, n, r) {
96
+ let { _gl: i } = this;
97
+ n ||= 0, t ||= 0, this._boundBufferBases[t] = null, i.bindBufferRange(i.UNIFORM_BUFFER, t || 0, e.buffer, n * 256, r || 256);
98
+ }
99
+ updateBuffer(e) {
100
+ let { _gl: t } = this, n = this.getGlBuffer(e);
101
+ if (e._updateID === n.updateID) return n;
102
+ n.updateID = e._updateID, t.bindBuffer(n.type, n.buffer);
103
+ let r = e.data, i = e.descriptor.usage & h.STATIC ? t.STATIC_DRAW : t.DYNAMIC_DRAW;
104
+ return r ? n.byteLength >= r.byteLength ? t.bufferSubData(n.type, e._updateOffset, r, e._updateOffset / r.BYTES_PER_ELEMENT, (e._updateSize || r.byteLength) / r.BYTES_PER_ELEMENT) : (n.byteLength = r.byteLength, t.bufferData(n.type, r, i)) : (n.byteLength = e.descriptor.size, t.bufferData(n.type, n.byteLength, i)), n;
105
+ }
106
+ destroyAll(e = !1) {
107
+ this._managedBuffers.removeAll(e);
108
+ }
109
+ onBufferUnload(e, t = !1) {
110
+ let n = e._gpuData[this._renderer.uid];
111
+ n && (t || this._gl.deleteBuffer(n.buffer));
112
+ }
113
+ createGLBuffer(e) {
114
+ let { _gl: t } = this, n = O.ARRAY_BUFFER;
115
+ e.descriptor.usage & h.INDEX ? n = O.ELEMENT_ARRAY_BUFFER : e.descriptor.usage & h.UNIFORM && (n = O.UNIFORM_BUFFER);
116
+ let r = new _e(t.createBuffer(), n);
117
+ return e._gpuData[this._renderer.uid] = r, this._managedBuffers.add(e), r;
118
+ }
119
+ resetState() {
120
+ this._boundBufferBases = /* @__PURE__ */ Object.create(null);
121
+ }
122
+ };
123
+ k.extension = {
124
+ type: [g.WebGLSystem],
125
+ name: "buffer"
126
+ };
127
+ //#endregion
128
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/context/GlContextSystem.mjs
129
+ var A = class e {
130
+ constructor(e) {
131
+ this.supports = {
132
+ uint32Indices: !0,
133
+ uniformBufferObject: !0,
134
+ vertexArrayObject: !0,
135
+ srgbTextures: !0,
136
+ nonPowOf2wrapping: !0,
137
+ msaa: !0,
138
+ nonPowOf2mipmaps: !0
139
+ }, this._renderer = e, this.extensions = /* @__PURE__ */ Object.create(null), this.handleContextLost = this.handleContextLost.bind(this), this.handleContextRestored = this.handleContextRestored.bind(this);
140
+ }
141
+ get isLost() {
142
+ return !this.gl || this.gl.isContextLost();
143
+ }
144
+ contextChange(e) {
145
+ this.gl = e, this._renderer.gl = e;
146
+ }
147
+ init(t) {
148
+ t = {
149
+ ...e.defaultOptions,
150
+ ...t
151
+ };
152
+ let r = this.multiView = t.multiView;
153
+ if (t.context && r && (n("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."), r = !1), r ? this.canvas = s.get().createCanvas(this._renderer.canvas.width, this._renderer.canvas.height) : this.canvas = this._renderer.view.canvas, t.context) this.initFromContext(t.context);
154
+ else {
155
+ let e = this._renderer.background.alpha < 1, n = t.premultipliedAlpha ?? !0, r = t.antialias && !this._renderer.backBuffer.useBackBuffer;
156
+ this.createContext(t.preferWebGLVersion, {
157
+ alpha: e,
158
+ premultipliedAlpha: n,
159
+ antialias: r,
160
+ stencil: !0,
161
+ preserveDrawingBuffer: t.preserveDrawingBuffer,
162
+ powerPreference: t.powerPreference ?? "default"
163
+ });
164
+ }
165
+ }
166
+ ensureCanvasSize(e) {
167
+ if (!this.multiView) {
168
+ e !== this.canvas && n("multiView is disabled, but targetCanvas is not the main canvas");
169
+ return;
170
+ }
171
+ let { canvas: t } = this;
172
+ (t.width < e.width || t.height < e.height) && (t.width = Math.max(e.width, e.width), t.height = Math.max(e.height, e.height));
173
+ }
174
+ initFromContext(e) {
175
+ this.gl = e, this.webGLVersion = e instanceof s.get().getWebGLRenderingContext() ? 1 : 2, this.getExtensions(), this.validateContext(e), this._renderer.runners.contextChange.emit(e);
176
+ let t = this._renderer.view.canvas;
177
+ t.addEventListener("webglcontextlost", this.handleContextLost, !1), t.addEventListener("webglcontextrestored", this.handleContextRestored, !1);
178
+ }
179
+ createContext(e, t) {
180
+ let n, r = this.canvas;
181
+ if (e === 2 && (n = r.getContext("webgl2", t)), !n && (n = r.getContext("webgl", t), !n)) throw Error("This browser does not support WebGL. Try using the canvas renderer");
182
+ this.gl = n, this.initFromContext(this.gl);
183
+ }
184
+ getExtensions() {
185
+ let { gl: e } = this, t = {
186
+ anisotropicFiltering: e.getExtension("EXT_texture_filter_anisotropic"),
187
+ floatTextureLinear: e.getExtension("OES_texture_float_linear"),
188
+ s3tc: e.getExtension("WEBGL_compressed_texture_s3tc"),
189
+ s3tc_sRGB: e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),
190
+ etc: e.getExtension("WEBGL_compressed_texture_etc"),
191
+ etc1: e.getExtension("WEBGL_compressed_texture_etc1"),
192
+ pvrtc: e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),
193
+ atc: e.getExtension("WEBGL_compressed_texture_atc"),
194
+ astc: e.getExtension("WEBGL_compressed_texture_astc"),
195
+ bptc: e.getExtension("EXT_texture_compression_bptc"),
196
+ rgtc: e.getExtension("EXT_texture_compression_rgtc"),
197
+ loseContext: e.getExtension("WEBGL_lose_context")
198
+ };
199
+ if (this.webGLVersion === 1) this.extensions = {
200
+ ...t,
201
+ drawBuffers: e.getExtension("WEBGL_draw_buffers"),
202
+ depthTexture: e.getExtension("WEBGL_depth_texture"),
203
+ vertexArrayObject: e.getExtension("OES_vertex_array_object") || e.getExtension("MOZ_OES_vertex_array_object") || e.getExtension("WEBKIT_OES_vertex_array_object"),
204
+ uint32ElementIndex: e.getExtension("OES_element_index_uint"),
205
+ floatTexture: e.getExtension("OES_texture_float"),
206
+ floatTextureLinear: e.getExtension("OES_texture_float_linear"),
207
+ textureHalfFloat: e.getExtension("OES_texture_half_float"),
208
+ textureHalfFloatLinear: e.getExtension("OES_texture_half_float_linear"),
209
+ vertexAttribDivisorANGLE: e.getExtension("ANGLE_instanced_arrays"),
210
+ srgb: e.getExtension("EXT_sRGB")
211
+ };
212
+ else {
213
+ this.extensions = {
214
+ ...t,
215
+ colorBufferFloat: e.getExtension("EXT_color_buffer_float")
216
+ };
217
+ let n = e.getExtension("WEBGL_provoking_vertex");
218
+ n && n.provokingVertexWEBGL(n.FIRST_VERTEX_CONVENTION_WEBGL);
219
+ }
220
+ }
221
+ handleContextLost(e) {
222
+ e.preventDefault(), this._contextLossForced && (this._contextLossForced = !1, setTimeout(() => {
223
+ this.gl.isContextLost() && this.extensions.loseContext?.restoreContext();
224
+ }, 0));
225
+ }
226
+ handleContextRestored() {
227
+ this.getExtensions(), this._renderer.runners.contextChange.emit(this.gl);
228
+ }
229
+ destroy() {
230
+ let e = this._renderer.view.canvas;
231
+ this._renderer = null, e.removeEventListener("webglcontextlost", this.handleContextLost), e.removeEventListener("webglcontextrestored", this.handleContextRestored), this.gl.useProgram(null), this.extensions.loseContext?.loseContext();
232
+ }
233
+ forceContextLoss() {
234
+ this.extensions.loseContext?.loseContext(), this._contextLossForced = !0;
235
+ }
236
+ validateContext(e) {
237
+ let t = e.getContextAttributes();
238
+ t && !t.stencil && n("Provided WebGL context does not have a stencil buffer, masks may not render correctly");
239
+ let r = this.supports, i = this.webGLVersion === 2, a = this.extensions;
240
+ r.uint32Indices = i || !!a.uint32ElementIndex, r.uniformBufferObject = i, r.vertexArrayObject = i || !!a.vertexArrayObject, r.srgbTextures = i || !!a.srgb, r.nonPowOf2wrapping = i, r.nonPowOf2mipmaps = i, r.msaa = i, r.uint32Indices || n("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly");
241
+ }
242
+ };
243
+ A.extension = {
244
+ type: [g.WebGLSystem],
245
+ name: "context"
246
+ }, A.defaultOptions = {
247
+ context: null,
248
+ premultipliedAlpha: !0,
249
+ preserveDrawingBuffer: !1,
250
+ powerPreference: void 0,
251
+ preferWebGLVersion: 2,
252
+ multiView: !1
253
+ };
254
+ var ve = A, j = /* @__PURE__ */ ((e) => (e[e.RGBA = 6408] = "RGBA", e[e.RGB = 6407] = "RGB", e[e.RG = 33319] = "RG", e[e.RED = 6403] = "RED", e[e.RGBA_INTEGER = 36249] = "RGBA_INTEGER", e[e.RGB_INTEGER = 36248] = "RGB_INTEGER", e[e.RG_INTEGER = 33320] = "RG_INTEGER", e[e.RED_INTEGER = 36244] = "RED_INTEGER", e[e.ALPHA = 6406] = "ALPHA", e[e.LUMINANCE = 6409] = "LUMINANCE", e[e.LUMINANCE_ALPHA = 6410] = "LUMINANCE_ALPHA", e[e.DEPTH_COMPONENT = 6402] = "DEPTH_COMPONENT", e[e.DEPTH_STENCIL = 34041] = "DEPTH_STENCIL", e))(j || {}), M = /* @__PURE__ */ ((e) => (e[e.TEXTURE_2D = 3553] = "TEXTURE_2D", e[e.TEXTURE_CUBE_MAP = 34067] = "TEXTURE_CUBE_MAP", e[e.TEXTURE_2D_ARRAY = 35866] = "TEXTURE_2D_ARRAY", e[e.TEXTURE_CUBE_MAP_POSITIVE_X = 34069] = "TEXTURE_CUBE_MAP_POSITIVE_X", e[e.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070] = "TEXTURE_CUBE_MAP_NEGATIVE_X", e[e.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071] = "TEXTURE_CUBE_MAP_POSITIVE_Y", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072] = "TEXTURE_CUBE_MAP_NEGATIVE_Y", e[e.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073] = "TEXTURE_CUBE_MAP_POSITIVE_Z", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074] = "TEXTURE_CUBE_MAP_NEGATIVE_Z", e))(M || {}), N = /* @__PURE__ */ ((e) => (e[e.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE", e[e.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT", e[e.UNSIGNED_SHORT_5_6_5 = 33635] = "UNSIGNED_SHORT_5_6_5", e[e.UNSIGNED_SHORT_4_4_4_4 = 32819] = "UNSIGNED_SHORT_4_4_4_4", e[e.UNSIGNED_SHORT_5_5_5_1 = 32820] = "UNSIGNED_SHORT_5_5_5_1", e[e.UNSIGNED_INT = 5125] = "UNSIGNED_INT", e[e.UNSIGNED_INT_10F_11F_11F_REV = 35899] = "UNSIGNED_INT_10F_11F_11F_REV", e[e.UNSIGNED_INT_2_10_10_10_REV = 33640] = "UNSIGNED_INT_2_10_10_10_REV", e[e.UNSIGNED_INT_24_8 = 34042] = "UNSIGNED_INT_24_8", e[e.UNSIGNED_INT_5_9_9_9_REV = 35902] = "UNSIGNED_INT_5_9_9_9_REV", e[e.BYTE = 5120] = "BYTE", e[e.SHORT = 5122] = "SHORT", e[e.INT = 5124] = "INT", e[e.FLOAT = 5126] = "FLOAT", e[e.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269] = "FLOAT_32_UNSIGNED_INT_24_8_REV", e[e.HALF_FLOAT = 36193] = "HALF_FLOAT", e))(N || {}), P = {
255
+ uint8x2: N.UNSIGNED_BYTE,
256
+ uint8x4: N.UNSIGNED_BYTE,
257
+ sint8x2: N.BYTE,
258
+ sint8x4: N.BYTE,
259
+ unorm8x2: N.UNSIGNED_BYTE,
260
+ unorm8x4: N.UNSIGNED_BYTE,
261
+ snorm8x2: N.BYTE,
262
+ snorm8x4: N.BYTE,
263
+ uint16x2: N.UNSIGNED_SHORT,
264
+ uint16x4: N.UNSIGNED_SHORT,
265
+ sint16x2: N.SHORT,
266
+ sint16x4: N.SHORT,
267
+ unorm16x2: N.UNSIGNED_SHORT,
268
+ unorm16x4: N.UNSIGNED_SHORT,
269
+ snorm16x2: N.SHORT,
270
+ snorm16x4: N.SHORT,
271
+ float16x2: N.HALF_FLOAT,
272
+ float16x4: N.HALF_FLOAT,
273
+ float32: N.FLOAT,
274
+ float32x2: N.FLOAT,
275
+ float32x3: N.FLOAT,
276
+ float32x4: N.FLOAT,
277
+ uint32: N.UNSIGNED_INT,
278
+ uint32x2: N.UNSIGNED_INT,
279
+ uint32x3: N.UNSIGNED_INT,
280
+ uint32x4: N.UNSIGNED_INT,
281
+ sint32: N.INT,
282
+ sint32x2: N.INT,
283
+ sint32x3: N.INT,
284
+ sint32x4: N.INT
285
+ };
286
+ function ye(e) {
287
+ return P[e] ?? P.float32;
288
+ }
289
+ //#endregion
290
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/geometry/GlGeometrySystem.mjs
291
+ var be = {
292
+ "point-list": 0,
293
+ "line-list": 1,
294
+ "line-strip": 3,
295
+ "triangle-list": 4,
296
+ "triangle-strip": 5
297
+ }, xe = class {
298
+ constructor() {
299
+ this.vaoCache = /* @__PURE__ */ Object.create(null);
300
+ }
301
+ destroy() {
302
+ this.vaoCache = /* @__PURE__ */ Object.create(null);
303
+ }
304
+ }, F = class {
305
+ constructor(e) {
306
+ this._renderer = e, this._activeGeometry = null, this._activeVao = null, this.hasVao = !0, this.hasInstance = !0, this._managedGeometries = new x({
307
+ renderer: e,
308
+ type: "resource",
309
+ onUnload: this.onGeometryUnload.bind(this),
310
+ name: "glGeometry"
311
+ });
312
+ }
313
+ contextChange() {
314
+ let e = this.gl = this._renderer.gl;
315
+ if (!this._renderer.context.supports.vertexArrayObject) throw Error("[PixiJS] Vertex Array Objects are not supported on this device");
316
+ this.destroyAll(!0);
317
+ let t = this._renderer.context.extensions.vertexArrayObject;
318
+ t && (e.createVertexArray = () => t.createVertexArrayOES(), e.bindVertexArray = (e) => t.bindVertexArrayOES(e), e.deleteVertexArray = (e) => t.deleteVertexArrayOES(e));
319
+ let n = this._renderer.context.extensions.vertexAttribDivisorANGLE;
320
+ n && (e.drawArraysInstanced = (e, t, r, i) => {
321
+ n.drawArraysInstancedANGLE(e, t, r, i);
322
+ }, e.drawElementsInstanced = (e, t, r, i, a) => {
323
+ n.drawElementsInstancedANGLE(e, t, r, i, a);
324
+ }, e.vertexAttribDivisor = (e, t) => n.vertexAttribDivisorANGLE(e, t)), this._activeGeometry = null, this._activeVao = null;
325
+ }
326
+ bind(e, t) {
327
+ let n = this.gl;
328
+ this._activeGeometry = e;
329
+ let r = this.getVao(e, t);
330
+ this._activeVao !== r && (this._activeVao = r, n.bindVertexArray(r)), this.updateBuffers();
331
+ }
332
+ resetState() {
333
+ this.unbind();
334
+ }
335
+ updateBuffers() {
336
+ let e = this._activeGeometry, t = this._renderer.buffer;
337
+ for (let n = 0; n < e.buffers.length; n++) {
338
+ let r = e.buffers[n];
339
+ t.updateBuffer(r);
340
+ }
341
+ e._gcLastUsed = this._renderer.gc.now;
342
+ }
343
+ checkCompatibility(e, t) {
344
+ let n = e.attributes, r = t._attributeData;
345
+ for (let e in r) if (!n[e]) throw Error(`shader and geometry incompatible, geometry missing the "${e}" attribute`);
346
+ }
347
+ getSignature(e, t) {
348
+ let n = e.attributes, r = t._attributeData, i = ["g", e.uid];
349
+ for (let e in n) r[e] && i.push(e, r[e].location);
350
+ return i.join("-");
351
+ }
352
+ getVao(e, t) {
353
+ return e._gpuData[this._renderer.uid]?.vaoCache[t._key] || this.initGeometryVao(e, t);
354
+ }
355
+ initGeometryVao(e, t, n = !0) {
356
+ let r = this._renderer.gl, i = this._renderer.buffer;
357
+ this._renderer.shader._getProgramData(t), this.checkCompatibility(e, t);
358
+ let a = this.getSignature(e, t), o = e._gpuData[this._renderer.uid];
359
+ o || (o = new xe(), e._gpuData[this._renderer.uid] = o, this._managedGeometries.add(e));
360
+ let s = o.vaoCache, c = s[a];
361
+ if (c) return s[t._key] = c, c;
362
+ ue(e, t._attributeData);
363
+ let l = e.buffers;
364
+ c = r.createVertexArray(), r.bindVertexArray(c);
365
+ for (let e = 0; e < l.length; e++) {
366
+ let t = l[e];
367
+ i.bind(t);
368
+ }
369
+ return this.activateVao(e, t), s[t._key] = c, s[a] = c, r.bindVertexArray(null), c;
370
+ }
371
+ onGeometryUnload(e, t = !1) {
372
+ let n = e._gpuData[this._renderer.uid];
373
+ if (!n) return;
374
+ let r = n.vaoCache;
375
+ if (!t) for (let e in r) this._activeVao !== r[e] && this.resetState(), this.gl.deleteVertexArray(r[e]);
376
+ }
377
+ destroyAll(e = !1) {
378
+ this._managedGeometries.removeAll(e);
379
+ }
380
+ activateVao(e, t) {
381
+ let n = this._renderer.gl, r = this._renderer.buffer, i = e.attributes;
382
+ e.indexBuffer && r.bind(e.indexBuffer);
383
+ let a = null;
384
+ for (let e in i) {
385
+ let o = i[e], s = o.buffer, c = r.getGlBuffer(s), l = t._attributeData[e];
386
+ if (l) {
387
+ a !== c && (r.bind(s), a = c);
388
+ let e = l.location;
389
+ n.enableVertexAttribArray(e);
390
+ let t = ee(o.format), i = ye(o.format);
391
+ if (l.format?.substring(1, 4) === "int" ? n.vertexAttribIPointer(e, t.size, i, o.stride, o.offset) : n.vertexAttribPointer(e, t.size, i, t.normalised, o.stride, o.offset), o.instance) if (this.hasInstance) {
392
+ let t = o.divisor ?? 1;
393
+ n.vertexAttribDivisor(e, t);
394
+ } else throw Error("geometry error, GPU Instancing is not supported on this device");
395
+ }
396
+ }
397
+ }
398
+ draw(e, t, n, r) {
399
+ let { gl: i } = this._renderer, a = this._activeGeometry, o = be[e || a.topology];
400
+ if (r ??= a.instanceCount, a.indexBuffer) {
401
+ let e = a.indexBuffer.data.BYTES_PER_ELEMENT, s = e === 2 ? i.UNSIGNED_SHORT : i.UNSIGNED_INT;
402
+ r === 1 ? i.drawElements(o, t || a.indexBuffer.data.length, s, (n || 0) * e) : i.drawElementsInstanced(o, t || a.indexBuffer.data.length, s, (n || 0) * e, r);
403
+ } else r === 1 ? i.drawArrays(o, n || 0, t || a.vertexCount) : i.drawArraysInstanced(o, n || 0, t || a.vertexCount, r);
404
+ return this;
405
+ }
406
+ unbind() {
407
+ this.gl.bindVertexArray(null), this._activeVao = null, this._activeGeometry = null;
408
+ }
409
+ destroy() {
410
+ this._managedGeometries.destroy(), this._renderer = null, this.gl = null, this._activeVao = null, this._activeGeometry = null;
411
+ }
412
+ };
413
+ F.extension = {
414
+ type: [g.WebGLSystem],
415
+ name: "geometry"
416
+ };
417
+ //#endregion
418
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/GlBackBufferSystem.mjs
419
+ var Se = new te({ attributes: { aPosition: [
420
+ -1,
421
+ -1,
422
+ 3,
423
+ -1,
424
+ -1,
425
+ 3
426
+ ] } }), I = class e {
427
+ constructor(e) {
428
+ this.useBackBuffer = !1, this._useBackBufferThisRender = !1, this._renderer = e;
429
+ }
430
+ init(t = {}) {
431
+ let { useBackBuffer: i, antialias: a } = {
432
+ ...e.defaultOptions,
433
+ ...t
434
+ };
435
+ this.useBackBuffer = i, this._antialias = a, this._renderer.context.supports.msaa || (n("antialiasing, is not supported on when using the back buffer"), this._antialias = !1), this._state = m.for2d();
436
+ let o = new f({
437
+ vertex: "\n attribute vec2 aPosition;\n out vec2 vUv;\n\n void main() {\n gl_Position = vec4(aPosition, 0.0, 1.0);\n\n vUv = (aPosition + 1.0) / 2.0;\n\n // flip dem UVs\n vUv.y = 1.0 - vUv.y;\n }",
438
+ fragment: "\n in vec2 vUv;\n out vec4 finalColor;\n\n uniform sampler2D uTexture;\n\n void main() {\n finalColor = texture(uTexture, vUv);\n }",
439
+ name: "big-triangle"
440
+ });
441
+ this._bigTriangleShader = new _({
442
+ glProgram: o,
443
+ resources: { uTexture: r.WHITE.source }
444
+ });
445
+ }
446
+ renderStart(e) {
447
+ let t = this._renderer.renderTarget.getRenderTarget(e.target);
448
+ if (this._useBackBufferThisRender = this.useBackBuffer && !!t.isRoot, this._useBackBufferThisRender) {
449
+ let t = this._renderer.renderTarget.getRenderTarget(e.target);
450
+ this._targetTexture = t.colorTexture, e.target = this._getBackBufferTexture(t.colorTexture);
451
+ }
452
+ }
453
+ renderEnd() {
454
+ this._presentBackBuffer();
455
+ }
456
+ _presentBackBuffer() {
457
+ let e = this._renderer;
458
+ e.renderTarget.finishRenderPass(), this._useBackBufferThisRender && (e.renderTarget.bind({
459
+ target: this._targetTexture,
460
+ clear: !1
461
+ }), this._bigTriangleShader.resources.uTexture = this._backBufferTexture.source, e.encoder.draw({
462
+ geometry: Se,
463
+ shader: this._bigTriangleShader,
464
+ state: this._state
465
+ }));
466
+ }
467
+ _getBackBufferTexture(e) {
468
+ return this._backBufferTexture = this._backBufferTexture || new r({ source: new i({
469
+ width: e.width,
470
+ height: e.height,
471
+ resolution: e._resolution,
472
+ antialias: this._antialias
473
+ }) }), this._backBufferTexture.source.resize(e.width, e.height, e._resolution), this._backBufferTexture;
474
+ }
475
+ destroy() {
476
+ this._backBufferTexture &&= (this._backBufferTexture.destroy(), null);
477
+ }
478
+ };
479
+ I.extension = {
480
+ type: [g.WebGLSystem],
481
+ name: "backBuffer",
482
+ priority: 1
483
+ }, I.defaultOptions = { useBackBuffer: !1 };
484
+ var Ce = I, L = class {
485
+ constructor(e) {
486
+ this._colorMaskCache = 15, this._renderer = e;
487
+ }
488
+ setMask(e) {
489
+ this._colorMaskCache !== e && (this._colorMaskCache = e, this._renderer.gl.colorMask(!!(e & 8), !!(e & 4), !!(e & 2), !!(e & 1)));
490
+ }
491
+ };
492
+ L.extension = {
493
+ type: [g.WebGLSystem],
494
+ name: "colorMask"
495
+ };
496
+ //#endregion
497
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/GlEncoderSystem.mjs
498
+ var R = class {
499
+ constructor(e) {
500
+ this.commandFinished = Promise.resolve(), this._renderer = e;
501
+ }
502
+ setGeometry(e, t) {
503
+ this._renderer.geometry.bind(e, t.glProgram);
504
+ }
505
+ finishRenderPass() {}
506
+ draw(e) {
507
+ let t = this._renderer, { geometry: n, shader: r, state: i, skipSync: a, topology: o, size: s, start: c, instanceCount: l } = e;
508
+ t.shader.bind(r, a), t.geometry.bind(n, t.shader._activeProgram), i && t.state.set(i), t.geometry.draw(o, s, c, l ?? n.instanceCount);
509
+ }
510
+ destroy() {
511
+ this._renderer = null;
512
+ }
513
+ };
514
+ R.extension = {
515
+ type: [g.WebGLSystem],
516
+ name: "encoder"
517
+ };
518
+ //#endregion
519
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/GlLimitsSystem.mjs
520
+ var z = class {
521
+ constructor(e) {
522
+ this._renderer = e;
523
+ }
524
+ contextChange() {
525
+ let e = this._renderer.gl;
526
+ this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS), this.maxBatchableTextures = re(this.maxTextures, e);
527
+ let t = this._renderer.context.webGLVersion === 2;
528
+ this.maxUniformBindings = t ? e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS) : 0;
529
+ }
530
+ destroy() {}
531
+ };
532
+ z.extension = {
533
+ type: [g.WebGLSystem],
534
+ name: "limits"
535
+ };
536
+ //#endregion
537
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/GlRenderTarget.mjs
538
+ var we = class {
539
+ constructor() {
540
+ this.width = -1, this.height = -1, this.msaa = !1, this._attachedMipLevel = 0, this._attachedLayer = 0, this.msaaRenderBuffer = [];
541
+ }
542
+ }, B = class {
543
+ constructor(e) {
544
+ this._stencilCache = {
545
+ enabled: !1,
546
+ stencilReference: 0,
547
+ stencilMode: C.NONE
548
+ }, this._renderTargetStencilState = /* @__PURE__ */ Object.create(null), e.renderTarget.onRenderTargetChange.add(this);
549
+ }
550
+ contextChange(e) {
551
+ this._gl = e, this._comparisonFuncMapping = {
552
+ always: e.ALWAYS,
553
+ never: e.NEVER,
554
+ equal: e.EQUAL,
555
+ "not-equal": e.NOTEQUAL,
556
+ less: e.LESS,
557
+ "less-equal": e.LEQUAL,
558
+ greater: e.GREATER,
559
+ "greater-equal": e.GEQUAL
560
+ }, this._stencilOpsMapping = {
561
+ keep: e.KEEP,
562
+ zero: e.ZERO,
563
+ replace: e.REPLACE,
564
+ invert: e.INVERT,
565
+ "increment-clamp": e.INCR,
566
+ "decrement-clamp": e.DECR,
567
+ "increment-wrap": e.INCR_WRAP,
568
+ "decrement-wrap": e.DECR_WRAP
569
+ }, this.resetState();
570
+ }
571
+ onRenderTargetChange(e) {
572
+ if (this._activeRenderTarget === e) return;
573
+ this._activeRenderTarget = e;
574
+ let t = this._renderTargetStencilState[e.uid];
575
+ t ||= this._renderTargetStencilState[e.uid] = {
576
+ stencilMode: C.DISABLED,
577
+ stencilReference: 0
578
+ }, this.setStencilMode(t.stencilMode, t.stencilReference);
579
+ }
580
+ resetState() {
581
+ this._stencilCache.enabled = !1, this._stencilCache.stencilMode = C.NONE, this._stencilCache.stencilReference = 0;
582
+ }
583
+ setStencilMode(e, t) {
584
+ let n = this._renderTargetStencilState[this._activeRenderTarget.uid], r = this._gl, i = me[e], a = this._stencilCache;
585
+ if (n.stencilMode = e, n.stencilReference = t, e === C.DISABLED) {
586
+ this._stencilCache.enabled && (this._stencilCache.enabled = !1, r.disable(r.STENCIL_TEST));
587
+ return;
588
+ }
589
+ this._stencilCache.enabled || (this._stencilCache.enabled = !0, r.enable(r.STENCIL_TEST)), (e !== a.stencilMode || a.stencilReference !== t) && (a.stencilMode = e, a.stencilReference = t, r.stencilFunc(this._comparisonFuncMapping[i.stencilBack.compare], t, 255), r.stencilOp(r.KEEP, r.KEEP, this._stencilOpsMapping[i.stencilBack.passOp]));
590
+ }
591
+ };
592
+ B.extension = {
593
+ type: [g.WebGLSystem],
594
+ name: "stencil"
595
+ };
596
+ //#endregion
597
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/shader/utils/createUboElementsSTD40.mjs
598
+ var V = {
599
+ f32: 4,
600
+ i32: 4,
601
+ "vec2<f32>": 8,
602
+ "vec3<f32>": 12,
603
+ "vec4<f32>": 16,
604
+ "vec2<i32>": 8,
605
+ "vec3<i32>": 12,
606
+ "vec4<i32>": 16,
607
+ u32: 4,
608
+ "vec2<u32>": 8,
609
+ "vec3<u32>": 12,
610
+ "vec4<u32>": 16,
611
+ "mat2x2<f32>": 32,
612
+ "mat3x3<f32>": 48,
613
+ "mat4x4<f32>": 64
614
+ };
615
+ function Te(e) {
616
+ let t = e.map((e) => ({
617
+ data: e,
618
+ offset: 0,
619
+ size: 0
620
+ })), n = 0, r = 0;
621
+ for (let e = 0; e < t.length; e++) {
622
+ let i = t[e];
623
+ if (n = V[i.data.type], !n) throw Error(`Unknown type ${i.data.type}`);
624
+ i.data.size > 1 && (n = Math.max(n, 16) * i.data.size);
625
+ let a = n === 12 ? 16 : n;
626
+ i.size = n;
627
+ let o = r % 16;
628
+ o > 0 && 16 - o < a ? r += (16 - o) % 16 : r += (n - o % n) % n, i.offset = r, r += n;
629
+ }
630
+ return r = Math.ceil(r / 16) * 16, {
631
+ uboElements: t,
632
+ size: r
633
+ };
634
+ }
635
+ //#endregion
636
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/shader/utils/generateArraySyncSTD40.mjs
637
+ function Ee(e, t) {
638
+ let n = Math.max(V[e.data.type] / 16, 1), r = e.data.value.length / e.data.size, i = (4 - r % 4) % 4, a = e.data.type.indexOf("i32") >= 0 ? "dataInt32" : "data";
639
+ return `
640
+ v = uv.${e.data.name};
641
+ offset += ${t};
642
+
643
+ arrayOffset = offset;
644
+
645
+ t = 0;
646
+
647
+ for(var i=0; i < ${e.data.size * n}; i++)
648
+ {
649
+ for(var j = 0; j < ${r}; j++)
650
+ {
651
+ ${a}[arrayOffset++] = v[t++];
652
+ }
653
+ ${i === 0 ? "" : `arrayOffset += ${i};`}
654
+ }
655
+ `;
656
+ }
657
+ //#endregion
658
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/shader/utils/createUboSyncSTD40.mjs
659
+ function De(e) {
660
+ return de(e, fe, Ee);
661
+ }
662
+ //#endregion
663
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/GlUboSystem.mjs
664
+ var H = class extends pe {
665
+ constructor() {
666
+ super({
667
+ createUboElements: Te,
668
+ generateUboSync: De
669
+ });
670
+ }
671
+ };
672
+ H.extension = {
673
+ type: [g.WebGLSystem],
674
+ name: "ubo"
675
+ };
676
+ //#endregion
677
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/renderTarget/GlRenderTargetAdaptor.mjs
678
+ var Oe = class {
679
+ constructor() {
680
+ this._clearColorCache = [
681
+ 0,
682
+ 0,
683
+ 0,
684
+ 0
685
+ ], this._viewPortCache = new t(), this._boundFramebuffer = void 0;
686
+ }
687
+ init(e, t) {
688
+ this._renderer = e, this._renderTargetSystem = t, e.runners.contextChange.add(this);
689
+ }
690
+ contextChange() {
691
+ this._clearColorCache = [
692
+ 0,
693
+ 0,
694
+ 0,
695
+ 0
696
+ ], this._viewPortCache = new t(), this._boundFramebuffer = void 0;
697
+ let e = this._renderer.gl;
698
+ this._drawBuffersCache = [];
699
+ for (let t = 1; t <= 16; t++) this._drawBuffersCache[t] = Array.from({ length: t }, (t, n) => e.COLOR_ATTACHMENT0 + n);
700
+ }
701
+ copyToTexture(e, t, n, r, i) {
702
+ let a = this._renderTargetSystem, o = this._renderer, s = a.getGpuRenderTarget(e), c = o.gl;
703
+ return this.finishRenderPass(e), c.bindFramebuffer(c.FRAMEBUFFER, s.resolveTargetFramebuffer), this._boundFramebuffer = s.resolveTargetFramebuffer, o.texture.bind(t, 0), c.copyTexSubImage2D(c.TEXTURE_2D, 0, i.x, i.y, n.x, n.y, r.width, r.height), t;
704
+ }
705
+ copyDepthTexture(e, t, n, r, i) {
706
+ let a = this._renderTargetSystem, o = this._renderer.gl;
707
+ this.finishRenderPass(e);
708
+ let s = a.getRenderTarget(t), c = a.getGpuRenderTarget(e), l = a.getGpuRenderTarget(s);
709
+ o.bindFramebuffer(o.READ_FRAMEBUFFER, c.framebuffer), o.bindFramebuffer(o.DRAW_FRAMEBUFFER, l.framebuffer), this._boundFramebuffer = void 0, o.blitFramebuffer(n.x, n.y, n.x + r.width, n.y + r.height, i.x, i.y, i.x + r.width, i.y + r.height, o.DEPTH_BUFFER_BIT, o.NEAREST);
710
+ }
711
+ startRenderPass(e, t = !0, n, r, i = 0, a = 0) {
712
+ let o = this._renderTargetSystem.getGpuRenderTarget(e);
713
+ if (a !== 0 && this._renderer.context.webGLVersion < 2) throw Error("[RenderTargetSystem] Rendering to array layers requires WebGL2.");
714
+ if (i > 0) {
715
+ if (o.msaa) throw Error("[RenderTargetSystem] Rendering to mip levels is not supported with MSAA render targets.");
716
+ if (this._renderer.context.webGLVersion < 2) throw Error("[RenderTargetSystem] Rendering to mip levels requires WebGL2.");
717
+ }
718
+ e.colorAttachments.forEach((e) => {
719
+ this._renderer.texture.unbind(e.texture);
720
+ });
721
+ let s = this._renderer.gl;
722
+ this.bindFramebuffer(o.framebuffer), !e.isRoot && e.colorAttachments.length > 0 && (o._attachedMipLevel !== i || o._attachedLayer !== a) && (e.colorAttachments.forEach((e, t) => {
723
+ let n = e.texture, r = this._renderer.texture.getGlSource(n);
724
+ if (r.target === s.TEXTURE_2D) {
725
+ if (a !== 0) throw Error("[RenderTargetSystem] layer must be 0 when rendering to 2D textures in WebGL.");
726
+ s.framebufferTexture2D(s.FRAMEBUFFER, s.COLOR_ATTACHMENT0 + t, s.TEXTURE_2D, r.texture, i);
727
+ } else if (r.target === s.TEXTURE_2D_ARRAY) {
728
+ if (this._renderer.context.webGLVersion < 2) throw Error("[RenderTargetSystem] Rendering to 2D array textures requires WebGL2.");
729
+ s.framebufferTextureLayer(s.FRAMEBUFFER, s.COLOR_ATTACHMENT0 + t, r.texture, i, a);
730
+ } else if (r.target === s.TEXTURE_CUBE_MAP) {
731
+ if (a < 0 || a > 5) throw Error("[RenderTargetSystem] Cube map layer must be between 0 and 5.");
732
+ s.framebufferTexture2D(s.FRAMEBUFFER, s.COLOR_ATTACHMENT0 + t, s.TEXTURE_CUBE_MAP_POSITIVE_X + a, r.texture, i);
733
+ } else throw Error("[RenderTargetSystem] Unsupported texture target for render-to-layer in WebGL.");
734
+ }), o._attachedMipLevel = i, o._attachedLayer = a), o.framebuffer && (e.depthStencilAttachment ? this._attachDepthStencilTexture(e, i, a) : !o.depthStencilRenderBuffer && (e.stencil || e.depth) && this._initStencil(o)), e.colorAttachments.length > 1 && this._setDrawBuffers(e, s);
735
+ let c = r.y;
736
+ e.isRoot && (c = e.pixelHeight - r.height - r.y);
737
+ let l = this._viewPortCache;
738
+ (l.x !== r.x || l.y !== c || l.width !== r.width || l.height !== r.height) && (l.x = r.x, l.y = c, l.width = r.width, l.height = r.height, s.viewport(r.x, c, r.width, r.height)), this.clear(e, t, n);
739
+ }
740
+ finishRenderPass(e) {
741
+ let t = this._renderTargetSystem.getGpuRenderTarget(e);
742
+ if (!t.msaa || e.colorAttachments.length === 0) return;
743
+ let n = this._renderer.gl;
744
+ n.bindFramebuffer(n.FRAMEBUFFER, t.resolveTargetFramebuffer), n.bindFramebuffer(n.READ_FRAMEBUFFER, t.framebuffer), n.blitFramebuffer(0, 0, t.width, t.height, 0, 0, t.width, t.height, n.COLOR_BUFFER_BIT, n.NEAREST), n.bindFramebuffer(n.FRAMEBUFFER, t.framebuffer), this._boundFramebuffer = t.framebuffer;
745
+ }
746
+ initGpuRenderTarget(e) {
747
+ let t = this._renderer.gl, n = new we();
748
+ n._attachedMipLevel = 0, n._attachedLayer = 0;
749
+ let r = e.colorTexture;
750
+ return r instanceof v ? (this._renderer.context.ensureCanvasSize(r.resource), n.framebuffer = null, n) : (n.width = e.pixelWidth, n.height = e.pixelHeight, e.colorAttachments.length === 0 ? this._initDepth(e, n) : this._initColor(e, n), e.depthStencilAttachment && this._attachDepthStencilTexture(e, 0, 0), t.bindFramebuffer(t.FRAMEBUFFER, null), this._boundFramebuffer = null, n);
751
+ }
752
+ destroyGpuRenderTarget(e) {
753
+ let t = this._renderer.gl;
754
+ e.framebuffer &&= (t.deleteFramebuffer(e.framebuffer), null), e.resolveTargetFramebuffer &&= (t.deleteFramebuffer(e.resolveTargetFramebuffer), null), e.depthStencilRenderBuffer &&= (t.deleteRenderbuffer(e.depthStencilRenderBuffer), null), e.msaaRenderBuffer.forEach((e) => {
755
+ t.deleteRenderbuffer(e);
756
+ }), e.msaaRenderBuffer = null;
757
+ }
758
+ clear(e, t, n, r, i = 0, a = 0) {
759
+ if (!t) return;
760
+ if (a !== 0) throw Error("[RenderTargetSystem] Clearing array layers is not supported in WebGL renderer.");
761
+ let o = this._renderTargetSystem;
762
+ if (typeof t == "boolean" && (t = t ? y.ALL : y.NONE), e.colorAttachments.length === 0 && (t &= ~y.COLOR, !t)) return;
763
+ let s = this._renderer.gl, c = !!(t & y.DEPTH) && !this._renderer.state.depthMaskEnabled;
764
+ if (t & y.COLOR) {
765
+ n ??= o.defaultClearColor;
766
+ let e = this._clearColorCache, t = n;
767
+ (e[0] !== t[0] || e[1] !== t[1] || e[2] !== t[2] || e[3] !== t[3]) && (e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], s.clearColor(t[0], t[1], t[2], t[3]));
768
+ }
769
+ c && s.depthMask(!0), s.clear(t), c && s.depthMask(!1);
770
+ }
771
+ resizeGpuRenderTarget(e) {
772
+ if (e.isRoot) return;
773
+ let t = this._renderTargetSystem.getGpuRenderTarget(e);
774
+ t.width = e.pixelWidth, t.height = e.pixelHeight, e.colorAttachments.length > 0 && this._resizeColor(e, t), t.depthStencilRenderBuffer && this._resizeStencil(t), this._boundFramebuffer = void 0;
775
+ }
776
+ _initColor(e, t) {
777
+ let r = this._renderer, i = r.gl, a = i.createFramebuffer();
778
+ if (t.resolveTargetFramebuffer = a, i.bindFramebuffer(i.FRAMEBUFFER, a), e.colorAttachments.forEach((e, a) => {
779
+ let o = e.texture;
780
+ o.antialias && (r.context.supports.msaa ? t.msaa = !0 : n("[RenderTexture] Antialiasing on textures is not supported in WebGL1")), r.texture.bindSource(o, 0);
781
+ let s = r.texture.getGlSource(o), c = s.texture;
782
+ if (s.target === i.TEXTURE_2D) i.framebufferTexture2D(i.FRAMEBUFFER, i.COLOR_ATTACHMENT0 + a, i.TEXTURE_2D, c, 0);
783
+ else if (s.target === i.TEXTURE_2D_ARRAY) {
784
+ if (r.context.webGLVersion < 2) throw Error("[RenderTargetSystem] TEXTURE_2D_ARRAY requires WebGL2.");
785
+ i.framebufferTextureLayer(i.FRAMEBUFFER, i.COLOR_ATTACHMENT0 + a, c, 0, 0);
786
+ } else if (s.target === i.TEXTURE_CUBE_MAP) i.framebufferTexture2D(i.FRAMEBUFFER, i.COLOR_ATTACHMENT0 + a, i.TEXTURE_CUBE_MAP_POSITIVE_X, c, 0);
787
+ else throw Error("[RenderTargetSystem] Unsupported texture target for framebuffer attachment.");
788
+ }), t.msaa) {
789
+ let n = i.createFramebuffer();
790
+ t.framebuffer = n, i.bindFramebuffer(i.FRAMEBUFFER, n), e.colorAttachments.forEach((e, n) => {
791
+ let r = i.createRenderbuffer();
792
+ t.msaaRenderBuffer[n] = r;
793
+ });
794
+ } else t.framebuffer = a;
795
+ this._resizeColor(e, t);
796
+ }
797
+ _initDepth(e, t) {
798
+ let n = this._renderer;
799
+ if (n.context.webGLVersion < 2) throw Error("[RenderTargetSystem] Depth-only render targets require WebGL2.");
800
+ let r = n.gl, i = r.createFramebuffer();
801
+ t.resolveTargetFramebuffer = i, t.framebuffer = i, r.bindFramebuffer(r.FRAMEBUFFER, i), r.drawBuffers([r.NONE]), r.readBuffer(r.NONE);
802
+ }
803
+ _resizeColor(e, t) {
804
+ let n = e.colorAttachments[0].texture;
805
+ if (t._attachedMipLevel = 0, t._attachedLayer = 0, e.colorAttachments.forEach((e, t) => {
806
+ t !== 0 && e.texture.resize(n.width, n.height, n._resolution);
807
+ }), t.msaa) {
808
+ let n = this._renderer, r = n.gl, i = t.framebuffer;
809
+ r.bindFramebuffer(r.FRAMEBUFFER, i), e.colorAttachments.forEach((e, i) => {
810
+ let a = e.texture;
811
+ n.texture.bindSource(a, 0);
812
+ let o = n.texture.getGlSource(a).internalFormat, s = t.msaaRenderBuffer[i];
813
+ r.bindRenderbuffer(r.RENDERBUFFER, s), r.renderbufferStorageMultisample(r.RENDERBUFFER, 4, o, a.pixelWidth, a.pixelHeight), r.framebufferRenderbuffer(r.FRAMEBUFFER, r.COLOR_ATTACHMENT0 + i, r.RENDERBUFFER, s);
814
+ });
815
+ }
816
+ }
817
+ _attachDepthStencilTexture(e, t, n) {
818
+ let r = this._renderer, i = r.gl, a = e.depthStencilAttachment.texture, o = r.texture.getGlSource(a), s = o.texture, c = a.format, l;
819
+ l = c === "depth24plus-stencil8" || c === "depth32float-stencil8" ? i.DEPTH_STENCIL_ATTACHMENT : c === "stencil8" ? i.STENCIL_ATTACHMENT : i.DEPTH_ATTACHMENT, o.target === i.TEXTURE_2D ? i.framebufferTexture2D(i.FRAMEBUFFER, l, i.TEXTURE_2D, s, t) : o.target === i.TEXTURE_2D_ARRAY ? i.framebufferTextureLayer(i.FRAMEBUFFER, l, s, t, n) : o.target === i.TEXTURE_CUBE_MAP && i.framebufferTexture2D(i.FRAMEBUFFER, l, i.TEXTURE_CUBE_MAP_POSITIVE_X + n, s, t);
820
+ }
821
+ _initStencil(e) {
822
+ if (e.framebuffer === null) return;
823
+ let t = this._renderer.gl, n = t.createRenderbuffer();
824
+ e.depthStencilRenderBuffer = n, t.bindRenderbuffer(t.RENDERBUFFER, n), t.framebufferRenderbuffer(t.FRAMEBUFFER, t.DEPTH_STENCIL_ATTACHMENT, t.RENDERBUFFER, n), this._resizeStencil(e);
825
+ }
826
+ _resizeStencil(e) {
827
+ let t = this._renderer.gl;
828
+ t.bindRenderbuffer(t.RENDERBUFFER, e.depthStencilRenderBuffer), e.msaa ? t.renderbufferStorageMultisample(t.RENDERBUFFER, 4, t.DEPTH24_STENCIL8, e.width, e.height) : t.renderbufferStorage(t.RENDERBUFFER, this._renderer.context.webGLVersion === 2 ? t.DEPTH24_STENCIL8 : t.DEPTH_STENCIL, e.width, e.height);
829
+ }
830
+ prerender(e) {
831
+ if (e.colorAttachments.length === 0) return;
832
+ let t = e.colorAttachments[0].texture.resource;
833
+ this._renderer.context.multiView && v.test(t) && this._renderer.context.ensureCanvasSize(t);
834
+ }
835
+ postrender(e) {
836
+ if (!this._renderer.context.multiView || e.colorAttachments.length === 0) return;
837
+ let t = e.colorAttachments[0].texture;
838
+ if (v.test(t.resource)) {
839
+ let e = this._renderer.context.canvas, n = t;
840
+ n.context2D.drawImage(e, 0, n.pixelHeight - e.height);
841
+ }
842
+ }
843
+ _setDrawBuffers(e, t) {
844
+ let r = e.colorAttachments.length, i = this._drawBuffersCache[r];
845
+ if (this._renderer.context.webGLVersion === 1) {
846
+ let e = this._renderer.context.extensions.drawBuffers;
847
+ e ? e.drawBuffersWEBGL(i) : n("[RenderTexture] This WebGL1 context does not support rendering to multiple targets");
848
+ } else t.drawBuffers(i);
849
+ }
850
+ resetState() {
851
+ this._boundFramebuffer = void 0, this._viewPortCache = new t(), this._clearColorCache = [
852
+ 0,
853
+ 0,
854
+ 0,
855
+ 0
856
+ ];
857
+ }
858
+ bindFramebuffer(e) {
859
+ this._boundFramebuffer !== e && (this._boundFramebuffer = e, this._renderer.gl.bindFramebuffer(this._renderer.gl.FRAMEBUFFER, e));
860
+ }
861
+ }, ke = class extends ce {
862
+ constructor(e) {
863
+ super(e), this.adaptor = new Oe(), this.adaptor.init(e, this);
864
+ }
865
+ resetState() {
866
+ this.adaptor.resetState();
867
+ }
868
+ };
869
+ ke.extension = {
870
+ type: [g.WebGLSystem],
871
+ name: "renderTarget"
872
+ };
873
+ //#endregion
874
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/shared/texture/TextureView.mjs
875
+ var Ae = class extends p {
876
+ constructor(e, t) {
877
+ super(), this._resourceType = "textureView", this._resourceId = a("resource"), this._touched = 0, this.source = e, this.viewDescriptor = t, this._onChange = this._onChange.bind(this), this._onDestroy = this._onDestroy.bind(this), this.source.on("change", this._onChange), this.source.on("destroy", this._onDestroy);
878
+ }
879
+ _onChange() {
880
+ this.emit("change", this);
881
+ }
882
+ _onDestroy() {
883
+ this.destroy();
884
+ }
885
+ get destroyed() {
886
+ return this.source.destroyed;
887
+ }
888
+ destroy() {
889
+ this.source && (this.source.off("change", this._onChange), this.source.off("destroy", this._onDestroy)), this.emit("destroy", this), this.removeAllListeners();
890
+ }
891
+ };
892
+ //#endregion
893
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/shader/GenerateShaderSyncCode.mjs
894
+ function je(e, t) {
895
+ let n = [], r = ["\n var g = s.groups;\n var sS = r.shader;\n var p = s.glProgram;\n var ugS = r.uniformGroup;\n var resources;\n "], a = !1, o = 0, s = t._getProgramData(e.glProgram);
896
+ for (let l in e.groups) {
897
+ let u = e.groups[l];
898
+ n.push(`
899
+ resources = g[${l}].resources;
900
+ `);
901
+ for (let d in u.resources) {
902
+ let f = u.resources[d];
903
+ if (f instanceof c) if (f.ubo) {
904
+ let t = e._uniformBindMap[l][Number(d)];
905
+ n.push(`
906
+ sS.bindUniformBlock(
907
+ resources[${d}],
908
+ '${t}',
909
+ ${e.glProgram._uniformBlockData[t].index}
910
+ );
911
+ `);
912
+ } else n.push(`
913
+ ugS.updateUniformGroup(resources[${d}], p, sD);
914
+ `);
915
+ else if (f instanceof E) {
916
+ let t = e._uniformBindMap[l][Number(d)];
917
+ n.push(`
918
+ sS.bindUniformBlock(
919
+ resources[${d}],
920
+ '${t}',
921
+ ${e.glProgram._uniformBlockData[t].index}
922
+ );
923
+ `);
924
+ } else if (f instanceof i || f instanceof Ae) {
925
+ let i = e._uniformBindMap[l][d], c = s.uniformData[i];
926
+ c && (a || (a = !0, r.push("\n var tS = r.texture;\n ")), t._gl.uniform1i(c.location, o), n.push(`
927
+ tS.bind(resources[${d}], ${o});
928
+ `), o++);
929
+ }
930
+ }
931
+ }
932
+ let l = [...r, ...n].join("\n");
933
+ return Function("r", "s", "sD", l);
934
+ }
935
+ //#endregion
936
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/shader/GlProgramData.mjs
937
+ var Me = class {
938
+ constructor(e, t) {
939
+ this.program = e, this.uniformData = t, this.uniformGroups = {}, this.uniformDirtyGroups = {}, this.uniformBlockBindings = {};
940
+ }
941
+ destroy() {
942
+ this.uniformData = null, this.uniformGroups = null, this.uniformDirtyGroups = null, this.uniformBlockBindings = null, this.program = null;
943
+ }
944
+ };
945
+ //#endregion
946
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/compileShader.mjs
947
+ function U(e, t, n) {
948
+ let r = e.createShader(t);
949
+ return e.shaderSource(r, n), e.compileShader(r), r;
950
+ }
951
+ //#endregion
952
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/defaultValue.mjs
953
+ function W(e) {
954
+ let t = Array(e);
955
+ for (let e = 0; e < t.length; e++) t[e] = !1;
956
+ return t;
957
+ }
958
+ function G(e, t) {
959
+ switch (e) {
960
+ case "float": return 0;
961
+ case "vec2": return new Float32Array(2 * t);
962
+ case "vec3": return new Float32Array(3 * t);
963
+ case "vec4": return new Float32Array(4 * t);
964
+ case "int":
965
+ case "uint":
966
+ case "sampler2D":
967
+ case "sampler2DArray": return 0;
968
+ case "ivec2": return new Int32Array(2 * t);
969
+ case "ivec3": return new Int32Array(3 * t);
970
+ case "ivec4": return new Int32Array(4 * t);
971
+ case "uvec2": return new Uint32Array(2 * t);
972
+ case "uvec3": return new Uint32Array(3 * t);
973
+ case "uvec4": return new Uint32Array(4 * t);
974
+ case "bool": return !1;
975
+ case "bvec2": return W(2 * t);
976
+ case "bvec3": return W(3 * t);
977
+ case "bvec4": return W(4 * t);
978
+ case "mat2": return new Float32Array([
979
+ 1,
980
+ 0,
981
+ 0,
982
+ 1
983
+ ]);
984
+ case "mat3": return new Float32Array([
985
+ 1,
986
+ 0,
987
+ 0,
988
+ 0,
989
+ 1,
990
+ 0,
991
+ 0,
992
+ 0,
993
+ 1
994
+ ]);
995
+ case "mat4": return new Float32Array([
996
+ 1,
997
+ 0,
998
+ 0,
999
+ 0,
1000
+ 0,
1001
+ 1,
1002
+ 0,
1003
+ 0,
1004
+ 0,
1005
+ 0,
1006
+ 1,
1007
+ 0,
1008
+ 0,
1009
+ 0,
1010
+ 0,
1011
+ 1
1012
+ ]);
1013
+ }
1014
+ return null;
1015
+ }
1016
+ //#endregion
1017
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/mapType.mjs
1018
+ var K = null, q = {
1019
+ FLOAT: "float",
1020
+ FLOAT_VEC2: "vec2",
1021
+ FLOAT_VEC3: "vec3",
1022
+ FLOAT_VEC4: "vec4",
1023
+ INT: "int",
1024
+ INT_VEC2: "ivec2",
1025
+ INT_VEC3: "ivec3",
1026
+ INT_VEC4: "ivec4",
1027
+ UNSIGNED_INT: "uint",
1028
+ UNSIGNED_INT_VEC2: "uvec2",
1029
+ UNSIGNED_INT_VEC3: "uvec3",
1030
+ UNSIGNED_INT_VEC4: "uvec4",
1031
+ BOOL: "bool",
1032
+ BOOL_VEC2: "bvec2",
1033
+ BOOL_VEC3: "bvec3",
1034
+ BOOL_VEC4: "bvec4",
1035
+ FLOAT_MAT2: "mat2",
1036
+ FLOAT_MAT3: "mat3",
1037
+ FLOAT_MAT4: "mat4",
1038
+ SAMPLER_2D: "sampler2D",
1039
+ INT_SAMPLER_2D: "sampler2D",
1040
+ UNSIGNED_INT_SAMPLER_2D: "sampler2D",
1041
+ SAMPLER_2D_SHADOW: "sampler2DShadow",
1042
+ SAMPLER_CUBE: "samplerCube",
1043
+ INT_SAMPLER_CUBE: "samplerCube",
1044
+ UNSIGNED_INT_SAMPLER_CUBE: "samplerCube",
1045
+ SAMPLER_CUBE_SHADOW: "samplerCubeShadow",
1046
+ SAMPLER_2D_ARRAY: "sampler2DArray",
1047
+ INT_SAMPLER_2D_ARRAY: "sampler2DArray",
1048
+ UNSIGNED_INT_SAMPLER_2D_ARRAY: "sampler2DArray",
1049
+ SAMPLER_2D_ARRAY_SHADOW: "sampler2DArrayShadow"
1050
+ }, Ne = {
1051
+ float: "float32",
1052
+ vec2: "float32x2",
1053
+ vec3: "float32x3",
1054
+ vec4: "float32x4",
1055
+ int: "sint32",
1056
+ ivec2: "sint32x2",
1057
+ ivec3: "sint32x3",
1058
+ ivec4: "sint32x4",
1059
+ uint: "uint32",
1060
+ uvec2: "uint32x2",
1061
+ uvec3: "uint32x3",
1062
+ uvec4: "uint32x4",
1063
+ bool: "uint32",
1064
+ bvec2: "uint32x2",
1065
+ bvec3: "uint32x3",
1066
+ bvec4: "uint32x4"
1067
+ };
1068
+ function J(e, t) {
1069
+ if (!K) {
1070
+ let t = Object.keys(q);
1071
+ K = {};
1072
+ for (let n = 0; n < t.length; ++n) {
1073
+ let r = t[n];
1074
+ K[e[r]] = q[r];
1075
+ }
1076
+ }
1077
+ return K[t];
1078
+ }
1079
+ function Pe(e, t) {
1080
+ return Ne[J(e, t)] || "float32";
1081
+ }
1082
+ //#endregion
1083
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/extractAttributesFromGlProgram.mjs
1084
+ function Fe(e, t, n = !1) {
1085
+ let r = {}, i = t.getProgramParameter(e, t.ACTIVE_ATTRIBUTES);
1086
+ for (let n = 0; n < i; n++) {
1087
+ let i = t.getActiveAttrib(e, n);
1088
+ if (i.name.startsWith("gl_")) continue;
1089
+ let a = Pe(t, i.type);
1090
+ r[i.name] = {
1091
+ location: 0,
1092
+ format: a,
1093
+ stride: ee(a).stride,
1094
+ offset: 0,
1095
+ instance: !1,
1096
+ start: 0
1097
+ };
1098
+ }
1099
+ let a = Object.keys(r);
1100
+ if (n) {
1101
+ a.sort((e, t) => e > t ? 1 : -1);
1102
+ for (let n = 0; n < a.length; n++) r[a[n]].location = n, t.bindAttribLocation(e, n, a[n]);
1103
+ t.linkProgram(e);
1104
+ } else for (let n = 0; n < a.length; n++) r[a[n]].location = t.getAttribLocation(e, a[n]);
1105
+ return r;
1106
+ }
1107
+ //#endregion
1108
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/getUboData.mjs
1109
+ function Ie(e, t) {
1110
+ if (!t.ACTIVE_UNIFORM_BLOCKS) return {};
1111
+ let n = {}, r = t.getProgramParameter(e, t.ACTIVE_UNIFORM_BLOCKS);
1112
+ for (let i = 0; i < r; i++) {
1113
+ let r = t.getActiveUniformBlockName(e, i);
1114
+ n[r] = {
1115
+ name: r,
1116
+ index: t.getUniformBlockIndex(e, r),
1117
+ size: t.getActiveUniformBlockParameter(e, i, t.UNIFORM_BLOCK_DATA_SIZE)
1118
+ };
1119
+ }
1120
+ return n;
1121
+ }
1122
+ //#endregion
1123
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/getUniformData.mjs
1124
+ function Le(e, t) {
1125
+ let n = {}, r = t.getProgramParameter(e, t.ACTIVE_UNIFORMS);
1126
+ for (let i = 0; i < r; i++) {
1127
+ let r = t.getActiveUniform(e, i), a = r.name.replace(/\[.*?\]$/, ""), o = !!r.name.match(/\[.*?\]$/), s = J(t, r.type);
1128
+ n[a] = {
1129
+ name: a,
1130
+ index: i,
1131
+ type: s,
1132
+ size: r.size,
1133
+ isArray: o,
1134
+ value: G(s, r.size)
1135
+ };
1136
+ }
1137
+ return n;
1138
+ }
1139
+ //#endregion
1140
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/logProgramError.mjs
1141
+ function Y(e, t) {
1142
+ let n = e.getShaderSource(t);
1143
+ if (n === null) {
1144
+ console.error("PixiJS Error: Could not retrieve shader source (WebGL context may be lost).");
1145
+ return;
1146
+ }
1147
+ let r = n.split("\n").map((e, t) => `${t}: ${e}`), i = e.getShaderInfoLog(t) ?? "", a = i.split("\n"), o = {}, s = a.map((e) => parseFloat(e.replace(/^ERROR\: 0\:([\d]+)\:.*$/, "$1"))).filter((e) => e && !o[e] ? (o[e] = !0, !0) : !1), c = [""];
1148
+ s.forEach((e) => {
1149
+ r[e - 1] = `%c${r[e - 1]}%c`, c.push("background: #FF0000; color:#FFFFFF; font-size: 10px", "font-size: 10px");
1150
+ }), c[0] = r.join("\n"), console.error(i), console.groupCollapsed("click to view full shader code"), console.warn(...c), console.groupEnd();
1151
+ }
1152
+ function Re(e, t, n, r) {
1153
+ e.getProgramParameter(t, e.LINK_STATUS) || (e.getShaderParameter(n, e.COMPILE_STATUS) || Y(e, n), e.getShaderParameter(r, e.COMPILE_STATUS) || Y(e, r), console.error("PixiJS Error: Could not initialize shader."), e.getProgramInfoLog(t) !== "" && console.warn("PixiJS Warning: gl.getProgramInfoLog()", e.getProgramInfoLog(t)));
1154
+ }
1155
+ //#endregion
1156
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/generateProgram.mjs
1157
+ function ze(e, t) {
1158
+ let r = U(e, e.VERTEX_SHADER, t.vertex), i = U(e, e.FRAGMENT_SHADER, t.fragment), a = e.createProgram();
1159
+ e.attachShader(a, r), e.attachShader(a, i);
1160
+ let o = t.transformFeedbackVaryings;
1161
+ o && (typeof e.transformFeedbackVaryings == "function" ? e.transformFeedbackVaryings(a, o.names, o.bufferMode === "separate" ? e.SEPARATE_ATTRIBS : e.INTERLEAVED_ATTRIBS) : n("TransformFeedback is not supported but TransformFeedbackVaryings are given.")), e.linkProgram(a), e.getProgramParameter(a, e.LINK_STATUS) || Re(e, a, r, i), t._attributeData = Fe(a, e, !/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(t.vertex)), t._uniformData = Le(a, e), t._uniformBlockData = Ie(a, e), e.deleteShader(r), e.deleteShader(i);
1162
+ let s = {};
1163
+ for (let n in t._uniformData) {
1164
+ let r = t._uniformData[n];
1165
+ s[n] = {
1166
+ location: e.getUniformLocation(a, n),
1167
+ value: G(r.type, r.size)
1168
+ };
1169
+ }
1170
+ return new Me(a, s);
1171
+ }
1172
+ //#endregion
1173
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/shader/GlShaderSystem.mjs
1174
+ var X = {
1175
+ textureCount: 0,
1176
+ blockIndex: 0
1177
+ }, Be = class {
1178
+ constructor(e) {
1179
+ this._activeProgram = null, this._programDataHash = /* @__PURE__ */ Object.create(null), this._shaderSyncFunctions = /* @__PURE__ */ Object.create(null), this._renderer = e;
1180
+ }
1181
+ contextChange(e) {
1182
+ this._gl = e, this._programDataHash = /* @__PURE__ */ Object.create(null), this._shaderSyncFunctions = /* @__PURE__ */ Object.create(null), this._activeProgram = null;
1183
+ }
1184
+ bind(e, t) {
1185
+ if (this._setProgram(e.glProgram), t) return;
1186
+ X.textureCount = 0, X.blockIndex = 0;
1187
+ let n = this._shaderSyncFunctions[e.glProgram._key];
1188
+ n ||= this._shaderSyncFunctions[e.glProgram._key] = this._generateShaderSync(e, this), this._renderer.buffer.nextBindBase(!!e.glProgram.transformFeedbackVaryings), n(this._renderer, e, X);
1189
+ }
1190
+ updateUniformGroup(e) {
1191
+ this._renderer.uniformGroup.updateUniformGroup(e, this._activeProgram, X);
1192
+ }
1193
+ bindUniformBlock(e, t, n = 0) {
1194
+ let r = this._renderer.buffer, i = this._getProgramData(this._activeProgram), a = e._bufferResource;
1195
+ a || this._renderer.ubo.updateUniformGroup(e);
1196
+ let o = e.buffer, s = r.updateBuffer(o), c = r.freeLocationForBufferBase(s);
1197
+ if (a) {
1198
+ let { offset: t, size: n } = e;
1199
+ t === 0 && n === o.data.byteLength ? r.bindBufferBase(s, c) : r.bindBufferRange(s, c, t);
1200
+ } else r.getLastBindBaseLocation(s) !== c && r.bindBufferBase(s, c);
1201
+ let l = this._activeProgram._uniformBlockData[t].index;
1202
+ i.uniformBlockBindings[n] !== c && (i.uniformBlockBindings[n] = c, this._renderer.gl.uniformBlockBinding(i.program, l, c));
1203
+ }
1204
+ _setProgram(e) {
1205
+ if (this._activeProgram === e) return;
1206
+ this._activeProgram = e;
1207
+ let t = this._getProgramData(e);
1208
+ this._gl.useProgram(t.program);
1209
+ }
1210
+ _getProgramData(e) {
1211
+ return this._programDataHash[e._key] || this._createProgramData(e);
1212
+ }
1213
+ _createProgramData(e) {
1214
+ let t = e._key;
1215
+ return this._programDataHash[t] = ze(this._gl, e), this._programDataHash[t];
1216
+ }
1217
+ destroy() {
1218
+ for (let e of Object.keys(this._programDataHash)) this._programDataHash[e].destroy();
1219
+ this._programDataHash = null, this._shaderSyncFunctions = null, this._activeProgram = null, this._renderer = null, this._gl = null;
1220
+ }
1221
+ _generateShaderSync(e, t) {
1222
+ return je(e, t);
1223
+ }
1224
+ resetState() {
1225
+ this._activeProgram = null;
1226
+ }
1227
+ };
1228
+ Be.extension = {
1229
+ type: [g.WebGLSystem],
1230
+ name: "shader"
1231
+ };
1232
+ //#endregion
1233
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/shader/utils/generateUniformsSyncTypes.mjs
1234
+ var Ve = {
1235
+ f32: "if (cv !== v) {\n cu.value = v;\n gl.uniform1f(location, v);\n }",
1236
+ "vec2<f32>": "if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(location, v[0], v[1]);\n }",
1237
+ "vec3<f32>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3f(location, v[0], v[1], v[2]);\n }",
1238
+ "vec4<f32>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4f(location, v[0], v[1], v[2], v[3]);\n }",
1239
+ i32: "if (cv !== v) {\n cu.value = v;\n gl.uniform1i(location, v);\n }",
1240
+ "vec2<i32>": "if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2i(location, v[0], v[1]);\n }",
1241
+ "vec3<i32>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3i(location, v[0], v[1], v[2]);\n }",
1242
+ "vec4<i32>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }",
1243
+ u32: "if (cv !== v) {\n cu.value = v;\n gl.uniform1ui(location, v);\n }",
1244
+ "vec2<u32>": "if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2ui(location, v[0], v[1]);\n }",
1245
+ "vec3<u32>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3ui(location, v[0], v[1], v[2]);\n }",
1246
+ "vec4<u32>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\n }",
1247
+ bool: "if (cv !== v) {\n cu.value = v;\n gl.uniform1i(location, v);\n }",
1248
+ "vec2<bool>": "if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2i(location, v[0], v[1]);\n }",
1249
+ "vec3<bool>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3i(location, v[0], v[1], v[2]);\n }",
1250
+ "vec4<bool>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }",
1251
+ "mat2x2<f32>": "gl.uniformMatrix2fv(location, false, v);",
1252
+ "mat3x3<f32>": "gl.uniformMatrix3fv(location, false, v);",
1253
+ "mat4x4<f32>": "gl.uniformMatrix4fv(location, false, v);"
1254
+ }, He = {
1255
+ f32: "gl.uniform1fv(location, v);",
1256
+ "vec2<f32>": "gl.uniform2fv(location, v);",
1257
+ "vec3<f32>": "gl.uniform3fv(location, v);",
1258
+ "vec4<f32>": "gl.uniform4fv(location, v);",
1259
+ "mat2x2<f32>": "gl.uniformMatrix2fv(location, false, v);",
1260
+ "mat3x3<f32>": "gl.uniformMatrix3fv(location, false, v);",
1261
+ "mat4x4<f32>": "gl.uniformMatrix4fv(location, false, v);",
1262
+ i32: "gl.uniform1iv(location, v);",
1263
+ "vec2<i32>": "gl.uniform2iv(location, v);",
1264
+ "vec3<i32>": "gl.uniform3iv(location, v);",
1265
+ "vec4<i32>": "gl.uniform4iv(location, v);",
1266
+ u32: "gl.uniform1iv(location, v);",
1267
+ "vec2<u32>": "gl.uniform2iv(location, v);",
1268
+ "vec3<u32>": "gl.uniform3iv(location, v);",
1269
+ "vec4<u32>": "gl.uniform4iv(location, v);",
1270
+ bool: "gl.uniform1iv(location, v);",
1271
+ "vec2<bool>": "gl.uniform2iv(location, v);",
1272
+ "vec3<bool>": "gl.uniform3iv(location, v);",
1273
+ "vec4<bool>": "gl.uniform4iv(location, v);"
1274
+ };
1275
+ //#endregion
1276
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/shader/utils/generateUniformsSync.mjs
1277
+ function Ue(e, t) {
1278
+ let n = ["\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n var name = null;\n "];
1279
+ for (let r in e.uniforms) {
1280
+ if (!t[r]) {
1281
+ e.uniforms[r] instanceof c ? e.uniforms[r].ubo ? n.push(`
1282
+ renderer.shader.bindUniformBlock(uv.${r}, "${r}");
1283
+ `) : n.push(`
1284
+ renderer.shader.updateUniformGroup(uv.${r});
1285
+ `) : e.uniforms[r] instanceof E && n.push(`
1286
+ renderer.shader.bindBufferResource(uv.${r}, "${r}");
1287
+ `);
1288
+ continue;
1289
+ }
1290
+ let i = e.uniformStructures[r], a = !1;
1291
+ for (let e = 0; e < w.length; e++) {
1292
+ let t = w[e];
1293
+ if (i.type === t.type && t.test(i)) {
1294
+ n.push(`name = "${r}";`, w[e].uniform), a = !0;
1295
+ break;
1296
+ }
1297
+ }
1298
+ if (!a) {
1299
+ let e = (i.size === 1 ? Ve : He)[i.type].replace("location", `ud["${r}"].location`);
1300
+ n.push(`
1301
+ cu = ud["${r}"];
1302
+ cv = cu.value;
1303
+ v = uv["${r}"];
1304
+ ${e};`);
1305
+ }
1306
+ }
1307
+ return Function("ud", "uv", "renderer", "syncData", n.join("\n"));
1308
+ }
1309
+ //#endregion
1310
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/shader/GlUniformGroupSystem.mjs
1311
+ var We = class {
1312
+ constructor(e) {
1313
+ this._cache = {}, this._uniformGroupSyncHash = {}, this._renderer = e, this.gl = null, this._cache = {};
1314
+ }
1315
+ contextChange(e) {
1316
+ this.gl = e;
1317
+ }
1318
+ updateUniformGroup(e, t, n) {
1319
+ let r = this._renderer.shader._getProgramData(t);
1320
+ (!e.isStatic || e._dirtyId !== r.uniformDirtyGroups[e.uid]) && (r.uniformDirtyGroups[e.uid] = e._dirtyId, this._getUniformSyncFunction(e, t)(r.uniformData, e.uniforms, this._renderer, n));
1321
+ }
1322
+ _getUniformSyncFunction(e, t) {
1323
+ return this._uniformGroupSyncHash[e._signature]?.[t._key] || this._createUniformSyncFunction(e, t);
1324
+ }
1325
+ _createUniformSyncFunction(e, t) {
1326
+ let n = this._uniformGroupSyncHash[e._signature] || (this._uniformGroupSyncHash[e._signature] = {}), r = this._getSignature(e, t._uniformData, "u");
1327
+ return this._cache[r] || (this._cache[r] = this._generateUniformsSync(e, t._uniformData)), n[t._key] = this._cache[r], n[t._key];
1328
+ }
1329
+ _generateUniformsSync(e, t) {
1330
+ return Ue(e, t);
1331
+ }
1332
+ _getSignature(e, t, n) {
1333
+ let r = e.uniforms, i = [`${n}-`];
1334
+ for (let e in r) i.push(e), t[e] && i.push(t[e].type);
1335
+ return i.join("-");
1336
+ }
1337
+ destroy() {
1338
+ this._renderer = null, this._cache = null;
1339
+ }
1340
+ };
1341
+ We.extension = {
1342
+ type: [g.WebGLSystem],
1343
+ name: "uniformGroup"
1344
+ };
1345
+ //#endregion
1346
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/state/mapWebGLBlendModesToPixi.mjs
1347
+ function Ge(e) {
1348
+ let t = {};
1349
+ if (t.normal = [e.ONE, e.ONE_MINUS_SRC_ALPHA], t.add = [e.ONE, e.ONE], t.multiply = [
1350
+ e.DST_COLOR,
1351
+ e.ONE_MINUS_SRC_ALPHA,
1352
+ e.ONE,
1353
+ e.ONE_MINUS_SRC_ALPHA
1354
+ ], t.screen = [
1355
+ e.ONE,
1356
+ e.ONE_MINUS_SRC_COLOR,
1357
+ e.ONE,
1358
+ e.ONE_MINUS_SRC_ALPHA
1359
+ ], t.none = [0, 0], t["normal-npm"] = [
1360
+ e.SRC_ALPHA,
1361
+ e.ONE_MINUS_SRC_ALPHA,
1362
+ e.ONE,
1363
+ e.ONE_MINUS_SRC_ALPHA
1364
+ ], t["add-npm"] = [
1365
+ e.SRC_ALPHA,
1366
+ e.ONE,
1367
+ e.ONE,
1368
+ e.ONE
1369
+ ], t["screen-npm"] = [
1370
+ e.SRC_ALPHA,
1371
+ e.ONE_MINUS_SRC_COLOR,
1372
+ e.ONE,
1373
+ e.ONE_MINUS_SRC_ALPHA
1374
+ ], t.erase = [e.ZERO, e.ONE_MINUS_SRC_ALPHA], !(e instanceof s.get().getWebGLRenderingContext())) t.min = [
1375
+ e.ONE,
1376
+ e.ONE,
1377
+ e.ONE,
1378
+ e.ONE,
1379
+ e.MIN,
1380
+ e.MIN
1381
+ ], t.max = [
1382
+ e.ONE,
1383
+ e.ONE,
1384
+ e.ONE,
1385
+ e.ONE,
1386
+ e.MAX,
1387
+ e.MAX
1388
+ ];
1389
+ else {
1390
+ let n = e.getExtension("EXT_blend_minmax");
1391
+ n && (t.min = [
1392
+ e.ONE,
1393
+ e.ONE,
1394
+ e.ONE,
1395
+ e.ONE,
1396
+ n.MIN_EXT,
1397
+ n.MIN_EXT
1398
+ ], t.max = [
1399
+ e.ONE,
1400
+ e.ONE,
1401
+ e.ONE,
1402
+ e.ONE,
1403
+ n.MAX_EXT,
1404
+ n.MAX_EXT
1405
+ ]);
1406
+ }
1407
+ return t;
1408
+ }
1409
+ //#endregion
1410
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/state/GlStateSystem.mjs
1411
+ var { BLEND: Ke, OFFSET: qe, CULLING: Je, DEPTH_TEST: Ye, WINDING: Xe, DEPTH_MASK: Ze } = o, Qe = class e {
1412
+ constructor(e) {
1413
+ this._invertFrontFace = !1, this.gl = null, this.stateId = 0, this.polygonOffset = 0, this.blendMode = "none", this._blendEq = !1, this.map = [], this.map[Ke] = this.setBlend, this.map[qe] = this.setOffset, this.map[Je] = this.setCullFace, this.map[Ye] = this.setDepthTest, this.map[Xe] = this.setFrontFace, this.map[Ze] = this.setDepthMask, this.checks = [], this.defaultState = m.for2d(), e.renderTarget.onRenderTargetChange.add(this);
1414
+ }
1415
+ onRenderTargetChange(e) {
1416
+ this._invertFrontFace = !e.isRoot != !!e.flipY, this._cullFace ? this.setFrontFace(this._frontFace) : this._frontFaceDirty = !0;
1417
+ }
1418
+ contextChange(e) {
1419
+ this.gl = e, this.blendModesMap = Ge(e), this.resetState();
1420
+ }
1421
+ set(e) {
1422
+ if (e ||= this.defaultState, this.stateId !== e.data) {
1423
+ let t = this.stateId ^ e.data, n = 0;
1424
+ for (; t;) t & 1 && this.map[n].call(this, !!(e.data & 1 << n)), t >>= 1, n++;
1425
+ this.stateId = e.data;
1426
+ }
1427
+ for (let t = 0; t < this.checks.length; t++) this.checks[t](this, e);
1428
+ }
1429
+ forceState(e) {
1430
+ e ||= this.defaultState;
1431
+ for (let t = 0; t < this.map.length; t++) this.map[t].call(this, !!(e.data & 1 << t));
1432
+ for (let t = 0; t < this.checks.length; t++) this.checks[t](this, e);
1433
+ this.stateId = e.data;
1434
+ }
1435
+ setBlend(t) {
1436
+ this._updateCheck(e._checkBlendMode, t), this.gl[t ? "enable" : "disable"](this.gl.BLEND);
1437
+ }
1438
+ setOffset(t) {
1439
+ this._updateCheck(e._checkPolygonOffset, t), this.gl[t ? "enable" : "disable"](this.gl.POLYGON_OFFSET_FILL);
1440
+ }
1441
+ setDepthTest(e) {
1442
+ this.gl[e ? "enable" : "disable"](this.gl.DEPTH_TEST);
1443
+ }
1444
+ setDepthMask(e) {
1445
+ this.gl.depthMask(e);
1446
+ }
1447
+ get depthMaskEnabled() {
1448
+ return !!(this.stateId & 1 << Ze);
1449
+ }
1450
+ setCullFace(e) {
1451
+ this._cullFace = e, this.gl[e ? "enable" : "disable"](this.gl.CULL_FACE), this._cullFace && this._frontFaceDirty && this.setFrontFace(this._frontFace);
1452
+ }
1453
+ setFrontFace(e) {
1454
+ this._frontFace = e, this._frontFaceDirty = !1;
1455
+ let t = this._invertFrontFace ? !e : e;
1456
+ this._glFrontFace !== t && (this._glFrontFace = t, this.gl.frontFace(this.gl[t ? "CW" : "CCW"]));
1457
+ }
1458
+ setBlendMode(e) {
1459
+ if (this.blendModesMap[e] || (e = "normal"), e === this.blendMode) return;
1460
+ this.blendMode = e;
1461
+ let t = this.blendModesMap[e], n = this.gl;
1462
+ t.length === 2 ? n.blendFunc(t[0], t[1]) : n.blendFuncSeparate(t[0], t[1], t[2], t[3]), t.length === 6 ? (this._blendEq = !0, n.blendEquationSeparate(t[4], t[5])) : this._blendEq && (this._blendEq = !1, n.blendEquationSeparate(n.FUNC_ADD, n.FUNC_ADD));
1463
+ }
1464
+ setPolygonOffset(e, t) {
1465
+ this.gl.polygonOffset(e, t);
1466
+ }
1467
+ resetState() {
1468
+ this._glFrontFace = !1, this._frontFace = !1, this._cullFace = !1, this._frontFaceDirty = !1, this._invertFrontFace = !1, this.gl.frontFace(this.gl.CCW), this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, !1), this.forceState(this.defaultState), this._blendEq = !0, this.blendMode = "", this.setBlendMode("normal");
1469
+ }
1470
+ _updateCheck(e, t) {
1471
+ let n = this.checks.indexOf(e);
1472
+ t && n === -1 ? this.checks.push(e) : !t && n !== -1 && this.checks.splice(n, 1);
1473
+ }
1474
+ static _checkBlendMode(e, t) {
1475
+ e.setBlendMode(t.blendMode);
1476
+ }
1477
+ static _checkPolygonOffset(e, t) {
1478
+ e.setPolygonOffset(1, t.polygonOffset);
1479
+ }
1480
+ destroy() {
1481
+ this.gl = null, this.checks.length = 0;
1482
+ }
1483
+ };
1484
+ Qe.extension = {
1485
+ type: [g.WebGLSystem],
1486
+ name: "state"
1487
+ };
1488
+ var $e = Qe, et = class {
1489
+ constructor(e) {
1490
+ this.target = M.TEXTURE_2D, this._layerInitMask = 0, this.texture = e, this.width = -1, this.height = -1, this.type = N.UNSIGNED_BYTE, this.internalFormat = j.RGBA, this.format = j.RGBA, this.samplerType = 0;
1491
+ }
1492
+ destroy() {}
1493
+ }, tt = {
1494
+ id: "buffer",
1495
+ upload(e, t, n, r, i, a = !1) {
1496
+ let o = i || t.target;
1497
+ !a && t.width === e.width && t.height === e.height ? n.texSubImage2D(o, 0, 0, 0, e.width, e.height, t.format, t.type, e.resource) : n.texImage2D(o, 0, t.internalFormat, e.width, e.height, 0, t.format, t.type, e.resource), t.width = e.width, t.height = e.height;
1498
+ }
1499
+ }, nt = {
1500
+ "bc1-rgba-unorm": !0,
1501
+ "bc1-rgba-unorm-srgb": !0,
1502
+ "bc2-rgba-unorm": !0,
1503
+ "bc2-rgba-unorm-srgb": !0,
1504
+ "bc3-rgba-unorm": !0,
1505
+ "bc3-rgba-unorm-srgb": !0,
1506
+ "bc4-r-unorm": !0,
1507
+ "bc4-r-snorm": !0,
1508
+ "bc5-rg-unorm": !0,
1509
+ "bc5-rg-snorm": !0,
1510
+ "bc6h-rgb-ufloat": !0,
1511
+ "bc6h-rgb-float": !0,
1512
+ "bc7-rgba-unorm": !0,
1513
+ "bc7-rgba-unorm-srgb": !0,
1514
+ "etc2-rgb8unorm": !0,
1515
+ "etc2-rgb8unorm-srgb": !0,
1516
+ "etc2-rgb8a1unorm": !0,
1517
+ "etc2-rgb8a1unorm-srgb": !0,
1518
+ "etc2-rgba8unorm": !0,
1519
+ "etc2-rgba8unorm-srgb": !0,
1520
+ "eac-r11unorm": !0,
1521
+ "eac-r11snorm": !0,
1522
+ "eac-rg11unorm": !0,
1523
+ "eac-rg11snorm": !0,
1524
+ "astc-4x4-unorm": !0,
1525
+ "astc-4x4-unorm-srgb": !0,
1526
+ "astc-5x4-unorm": !0,
1527
+ "astc-5x4-unorm-srgb": !0,
1528
+ "astc-5x5-unorm": !0,
1529
+ "astc-5x5-unorm-srgb": !0,
1530
+ "astc-6x5-unorm": !0,
1531
+ "astc-6x5-unorm-srgb": !0,
1532
+ "astc-6x6-unorm": !0,
1533
+ "astc-6x6-unorm-srgb": !0,
1534
+ "astc-8x5-unorm": !0,
1535
+ "astc-8x5-unorm-srgb": !0,
1536
+ "astc-8x6-unorm": !0,
1537
+ "astc-8x6-unorm-srgb": !0,
1538
+ "astc-8x8-unorm": !0,
1539
+ "astc-8x8-unorm-srgb": !0,
1540
+ "astc-10x5-unorm": !0,
1541
+ "astc-10x5-unorm-srgb": !0,
1542
+ "astc-10x6-unorm": !0,
1543
+ "astc-10x6-unorm-srgb": !0,
1544
+ "astc-10x8-unorm": !0,
1545
+ "astc-10x8-unorm-srgb": !0,
1546
+ "astc-10x10-unorm": !0,
1547
+ "astc-10x10-unorm-srgb": !0,
1548
+ "astc-12x10-unorm": !0,
1549
+ "astc-12x10-unorm-srgb": !0,
1550
+ "astc-12x12-unorm": !0,
1551
+ "astc-12x12-unorm-srgb": !0
1552
+ }, rt = {
1553
+ id: "compressed",
1554
+ upload(e, t, n, r, i, a) {
1555
+ let o = i ?? t.target;
1556
+ n.pixelStorei(n.UNPACK_ALIGNMENT, 4);
1557
+ let s = e.pixelWidth, c = e.pixelHeight, l = !!nt[e.format];
1558
+ for (let r = 0; r < e.resource.length; r++) {
1559
+ let i = e.resource[r];
1560
+ l ? n.compressedTexImage2D(o, r, t.internalFormat, s, c, 0, i) : n.texImage2D(o, r, t.internalFormat, s, c, 0, t.format, t.type, i), s = Math.max(s >> 1, 1), c = Math.max(c >> 1, 1);
1561
+ }
1562
+ }
1563
+ }, it = [
1564
+ "right",
1565
+ "left",
1566
+ "top",
1567
+ "bottom",
1568
+ "front",
1569
+ "back"
1570
+ ];
1571
+ function at(e) {
1572
+ return {
1573
+ id: "cube",
1574
+ upload(t, n, r, i) {
1575
+ let a = t.faces;
1576
+ for (let t = 0; t < it.length; t++) {
1577
+ let o = a[it[t]];
1578
+ o.resource && ((e[o.uploadMethodId] || e.image).upload(o, n, r, i, M.TEXTURE_CUBE_MAP_POSITIVE_X + t, (n._layerInitMask & 1 << t) == 0), n._layerInitMask |= 1 << t);
1579
+ }
1580
+ n.width = t.pixelWidth, n.height = t.pixelHeight;
1581
+ }
1582
+ };
1583
+ }
1584
+ //#endregion
1585
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/texture/uploaders/glUploadImageResource.mjs
1586
+ var ot = {
1587
+ id: "image",
1588
+ upload(e, t, n, r, i, a = !1) {
1589
+ let o = i || t.target, s = e.pixelWidth, c = e.pixelHeight, l = e.resourceWidth, u = e.resourceHeight, d = r === 2, f = a || t.width !== s || t.height !== c, p = l >= s && u >= c, m = e.resource;
1590
+ (d ? st : ct)(n, o, t, s, c, l, u, m, f, p), t.width = s, t.height = c;
1591
+ }
1592
+ };
1593
+ function st(e, t, n, r, i, a, o, s, c, l) {
1594
+ if (!l) {
1595
+ c && e.texImage2D(t, 0, n.internalFormat, r, i, 0, n.format, n.type, null), e.texSubImage2D(t, 0, 0, 0, a, o, n.format, n.type, s);
1596
+ return;
1597
+ }
1598
+ if (!c) {
1599
+ e.texSubImage2D(t, 0, 0, 0, n.format, n.type, s);
1600
+ return;
1601
+ }
1602
+ e.texImage2D(t, 0, n.internalFormat, r, i, 0, n.format, n.type, s);
1603
+ }
1604
+ function ct(e, t, n, r, i, a, o, s, c, l) {
1605
+ if (!l) {
1606
+ c && e.texImage2D(t, 0, n.internalFormat, r, i, 0, n.format, n.type, null), e.texSubImage2D(t, 0, 0, 0, n.format, n.type, s);
1607
+ return;
1608
+ }
1609
+ if (!c) {
1610
+ e.texSubImage2D(t, 0, 0, 0, n.format, n.type, s);
1611
+ return;
1612
+ }
1613
+ e.texImage2D(t, 0, n.internalFormat, n.format, n.type, s);
1614
+ }
1615
+ //#endregion
1616
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/texture/uploaders/glUploadVideoResource.mjs
1617
+ var lt = ge(), ut = {
1618
+ id: "video",
1619
+ upload(e, t, n, r, i, a = lt) {
1620
+ if (!e.isValid) {
1621
+ let e = i ?? t.target;
1622
+ n.texImage2D(e, 0, t.internalFormat, 1, 1, 0, t.format, t.type, null);
1623
+ return;
1624
+ }
1625
+ ot.upload(e, t, n, r, i, a);
1626
+ }
1627
+ }, dt = {
1628
+ linear: 9729,
1629
+ nearest: 9728
1630
+ }, ft = {
1631
+ linear: {
1632
+ linear: 9987,
1633
+ nearest: 9985
1634
+ },
1635
+ nearest: {
1636
+ linear: 9986,
1637
+ nearest: 9984
1638
+ }
1639
+ }, Z = {
1640
+ "clamp-to-edge": 33071,
1641
+ repeat: 10497,
1642
+ "mirror-repeat": 33648
1643
+ }, pt = {
1644
+ never: 512,
1645
+ less: 513,
1646
+ equal: 514,
1647
+ "less-equal": 515,
1648
+ greater: 516,
1649
+ "not-equal": 517,
1650
+ "greater-equal": 518,
1651
+ always: 519
1652
+ };
1653
+ //#endregion
1654
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/texture/utils/applyStyleParams.mjs
1655
+ function mt(e, t, n, r, i, a, o, s) {
1656
+ let c = a;
1657
+ if (!s || e.addressModeU !== "repeat" || e.addressModeV !== "repeat" || e.addressModeW !== "repeat") {
1658
+ let n = Z[o ? "clamp-to-edge" : e.addressModeU], r = Z[o ? "clamp-to-edge" : e.addressModeV], a = Z[o ? "clamp-to-edge" : e.addressModeW];
1659
+ t[i](c, t.TEXTURE_WRAP_S, n), t[i](c, t.TEXTURE_WRAP_T, r), t.TEXTURE_WRAP_R && t[i](c, t.TEXTURE_WRAP_R, a);
1660
+ }
1661
+ if ((!s || e.magFilter !== "linear") && t[i](c, t.TEXTURE_MAG_FILTER, dt[e.magFilter]), n) {
1662
+ if (!s || e.mipmapFilter !== "linear") {
1663
+ let n = ft[e.minFilter][e.mipmapFilter];
1664
+ t[i](c, t.TEXTURE_MIN_FILTER, n);
1665
+ }
1666
+ } else t[i](c, t.TEXTURE_MIN_FILTER, dt[e.minFilter]);
1667
+ if (r && e.maxAnisotropy > 1) {
1668
+ let n = Math.min(e.maxAnisotropy, t.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));
1669
+ t[i](c, r.TEXTURE_MAX_ANISOTROPY_EXT, n);
1670
+ }
1671
+ e.compare ? (t[i](c, t.TEXTURE_COMPARE_FUNC, pt[e.compare]), t[i](c, t.TEXTURE_COMPARE_MODE, t.COMPARE_REF_TO_TEXTURE)) : s || t[i](c, t.TEXTURE_COMPARE_MODE, t.NONE);
1672
+ }
1673
+ //#endregion
1674
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/texture/utils/mapFormatToGlFormat.mjs
1675
+ function ht(e) {
1676
+ return {
1677
+ r8unorm: e.RED,
1678
+ r8snorm: e.RED,
1679
+ r8uint: e.RED,
1680
+ r8sint: e.RED,
1681
+ r16uint: e.RED,
1682
+ r16sint: e.RED,
1683
+ r16float: e.RED,
1684
+ rg8unorm: e.RG,
1685
+ rg8snorm: e.RG,
1686
+ rg8uint: e.RG,
1687
+ rg8sint: e.RG,
1688
+ r32uint: e.RED,
1689
+ r32sint: e.RED,
1690
+ r32float: e.RED,
1691
+ rg16uint: e.RG,
1692
+ rg16sint: e.RG,
1693
+ rg16float: e.RG,
1694
+ rgba8unorm: e.RGBA,
1695
+ "rgba8unorm-srgb": e.RGBA,
1696
+ rgba8snorm: e.RGBA,
1697
+ rgba8uint: e.RGBA,
1698
+ rgba8sint: e.RGBA,
1699
+ bgra8unorm: e.RGBA,
1700
+ "bgra8unorm-srgb": e.RGBA,
1701
+ rgb9e5ufloat: e.RGB,
1702
+ rgb10a2unorm: e.RGBA,
1703
+ rg11b10ufloat: e.RGB,
1704
+ rg32uint: e.RG,
1705
+ rg32sint: e.RG,
1706
+ rg32float: e.RG,
1707
+ rgba16uint: e.RGBA,
1708
+ rgba16sint: e.RGBA,
1709
+ rgba16float: e.RGBA,
1710
+ rgba32uint: e.RGBA,
1711
+ rgba32sint: e.RGBA,
1712
+ rgba32float: e.RGBA,
1713
+ stencil8: e.STENCIL_INDEX8,
1714
+ depth16unorm: e.DEPTH_COMPONENT,
1715
+ depth24plus: e.DEPTH_COMPONENT,
1716
+ "depth24plus-stencil8": e.DEPTH_STENCIL,
1717
+ depth32float: e.DEPTH_COMPONENT,
1718
+ "depth32float-stencil8": e.DEPTH_STENCIL
1719
+ };
1720
+ }
1721
+ //#endregion
1722
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/texture/utils/mapFormatToGlInternalFormat.mjs
1723
+ function gt(e, t) {
1724
+ let n = {}, r = e.RGBA;
1725
+ return e instanceof s.get().getWebGLRenderingContext() ? t.srgb && (n = {
1726
+ "rgba8unorm-srgb": t.srgb.SRGB8_ALPHA8_EXT,
1727
+ "bgra8unorm-srgb": t.srgb.SRGB8_ALPHA8_EXT
1728
+ }) : (n = {
1729
+ "rgba8unorm-srgb": e.SRGB8_ALPHA8,
1730
+ "bgra8unorm-srgb": e.SRGB8_ALPHA8
1731
+ }, r = e.RGBA8), {
1732
+ r8unorm: e.R8,
1733
+ r8snorm: e.R8_SNORM,
1734
+ r8uint: e.R8UI,
1735
+ r8sint: e.R8I,
1736
+ r16uint: e.R16UI,
1737
+ r16sint: e.R16I,
1738
+ r16float: e.R16F,
1739
+ rg8unorm: e.RG8,
1740
+ rg8snorm: e.RG8_SNORM,
1741
+ rg8uint: e.RG8UI,
1742
+ rg8sint: e.RG8I,
1743
+ r32uint: e.R32UI,
1744
+ r32sint: e.R32I,
1745
+ r32float: e.R32F,
1746
+ rg16uint: e.RG16UI,
1747
+ rg16sint: e.RG16I,
1748
+ rg16float: e.RG16F,
1749
+ rgba8unorm: e.RGBA,
1750
+ ...n,
1751
+ rgba8snorm: e.RGBA8_SNORM,
1752
+ rgba8uint: e.RGBA8UI,
1753
+ rgba8sint: e.RGBA8I,
1754
+ bgra8unorm: r,
1755
+ rgb9e5ufloat: e.RGB9_E5,
1756
+ rgb10a2unorm: e.RGB10_A2,
1757
+ rg11b10ufloat: e.R11F_G11F_B10F,
1758
+ rg32uint: e.RG32UI,
1759
+ rg32sint: e.RG32I,
1760
+ rg32float: e.RG32F,
1761
+ rgba16uint: e.RGBA16UI,
1762
+ rgba16sint: e.RGBA16I,
1763
+ rgba16float: e.RGBA16F,
1764
+ rgba32uint: e.RGBA32UI,
1765
+ rgba32sint: e.RGBA32I,
1766
+ rgba32float: e.RGBA32F,
1767
+ stencil8: e.STENCIL_INDEX8,
1768
+ depth16unorm: e.DEPTH_COMPONENT16,
1769
+ depth24plus: e.DEPTH_COMPONENT24,
1770
+ "depth24plus-stencil8": e.DEPTH24_STENCIL8,
1771
+ depth32float: e.DEPTH_COMPONENT32F,
1772
+ "depth32float-stencil8": e.DEPTH32F_STENCIL8,
1773
+ ...t.s3tc ? {
1774
+ "bc1-rgba-unorm": t.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,
1775
+ "bc2-rgba-unorm": t.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,
1776
+ "bc3-rgba-unorm": t.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT
1777
+ } : {},
1778
+ ...t.s3tc_sRGB ? {
1779
+ "bc1-rgba-unorm-srgb": t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,
1780
+ "bc2-rgba-unorm-srgb": t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,
1781
+ "bc3-rgba-unorm-srgb": t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
1782
+ } : {},
1783
+ ...t.rgtc ? {
1784
+ "bc4-r-unorm": t.rgtc.COMPRESSED_RED_RGTC1_EXT,
1785
+ "bc4-r-snorm": t.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,
1786
+ "bc5-rg-unorm": t.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,
1787
+ "bc5-rg-snorm": t.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT
1788
+ } : {},
1789
+ ...t.bptc ? {
1790
+ "bc6h-rgb-float": t.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,
1791
+ "bc6h-rgb-ufloat": t.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,
1792
+ "bc7-rgba-unorm": t.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,
1793
+ "bc7-rgba-unorm-srgb": t.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT
1794
+ } : {},
1795
+ ...t.etc ? {
1796
+ "etc2-rgb8unorm": t.etc.COMPRESSED_RGB8_ETC2,
1797
+ "etc2-rgb8unorm-srgb": t.etc.COMPRESSED_SRGB8_ETC2,
1798
+ "etc2-rgb8a1unorm": t.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
1799
+ "etc2-rgb8a1unorm-srgb": t.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
1800
+ "etc2-rgba8unorm": t.etc.COMPRESSED_RGBA8_ETC2_EAC,
1801
+ "etc2-rgba8unorm-srgb": t.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
1802
+ "eac-r11unorm": t.etc.COMPRESSED_R11_EAC,
1803
+ "eac-rg11unorm": t.etc.COMPRESSED_SIGNED_RG11_EAC
1804
+ } : {},
1805
+ ...t.astc ? {
1806
+ "astc-4x4-unorm": t.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,
1807
+ "astc-4x4-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,
1808
+ "astc-5x4-unorm": t.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,
1809
+ "astc-5x4-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,
1810
+ "astc-5x5-unorm": t.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,
1811
+ "astc-5x5-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,
1812
+ "astc-6x5-unorm": t.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,
1813
+ "astc-6x5-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,
1814
+ "astc-6x6-unorm": t.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,
1815
+ "astc-6x6-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,
1816
+ "astc-8x5-unorm": t.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,
1817
+ "astc-8x5-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,
1818
+ "astc-8x6-unorm": t.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,
1819
+ "astc-8x6-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,
1820
+ "astc-8x8-unorm": t.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,
1821
+ "astc-8x8-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,
1822
+ "astc-10x5-unorm": t.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,
1823
+ "astc-10x5-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,
1824
+ "astc-10x6-unorm": t.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,
1825
+ "astc-10x6-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,
1826
+ "astc-10x8-unorm": t.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,
1827
+ "astc-10x8-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,
1828
+ "astc-10x10-unorm": t.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,
1829
+ "astc-10x10-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,
1830
+ "astc-12x10-unorm": t.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,
1831
+ "astc-12x10-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,
1832
+ "astc-12x12-unorm": t.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,
1833
+ "astc-12x12-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR
1834
+ } : {}
1835
+ };
1836
+ }
1837
+ //#endregion
1838
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/texture/utils/mapFormatToGlType.mjs
1839
+ function _t(e) {
1840
+ return {
1841
+ r8unorm: e.UNSIGNED_BYTE,
1842
+ r8snorm: e.BYTE,
1843
+ r8uint: e.UNSIGNED_BYTE,
1844
+ r8sint: e.BYTE,
1845
+ r16uint: e.UNSIGNED_SHORT,
1846
+ r16sint: e.SHORT,
1847
+ r16float: e.HALF_FLOAT,
1848
+ rg8unorm: e.UNSIGNED_BYTE,
1849
+ rg8snorm: e.BYTE,
1850
+ rg8uint: e.UNSIGNED_BYTE,
1851
+ rg8sint: e.BYTE,
1852
+ r32uint: e.UNSIGNED_INT,
1853
+ r32sint: e.INT,
1854
+ r32float: e.FLOAT,
1855
+ rg16uint: e.UNSIGNED_SHORT,
1856
+ rg16sint: e.SHORT,
1857
+ rg16float: e.HALF_FLOAT,
1858
+ rgba8unorm: e.UNSIGNED_BYTE,
1859
+ "rgba8unorm-srgb": e.UNSIGNED_BYTE,
1860
+ rgba8snorm: e.BYTE,
1861
+ rgba8uint: e.UNSIGNED_BYTE,
1862
+ rgba8sint: e.BYTE,
1863
+ bgra8unorm: e.UNSIGNED_BYTE,
1864
+ "bgra8unorm-srgb": e.UNSIGNED_BYTE,
1865
+ rgb9e5ufloat: e.UNSIGNED_INT_5_9_9_9_REV,
1866
+ rgb10a2unorm: e.UNSIGNED_INT_2_10_10_10_REV,
1867
+ rg11b10ufloat: e.UNSIGNED_INT_10F_11F_11F_REV,
1868
+ rg32uint: e.UNSIGNED_INT,
1869
+ rg32sint: e.INT,
1870
+ rg32float: e.FLOAT,
1871
+ rgba16uint: e.UNSIGNED_SHORT,
1872
+ rgba16sint: e.SHORT,
1873
+ rgba16float: e.HALF_FLOAT,
1874
+ rgba32uint: e.UNSIGNED_INT,
1875
+ rgba32sint: e.INT,
1876
+ rgba32float: e.FLOAT,
1877
+ stencil8: e.UNSIGNED_BYTE,
1878
+ depth16unorm: e.UNSIGNED_SHORT,
1879
+ depth24plus: e.UNSIGNED_INT,
1880
+ "depth24plus-stencil8": e.UNSIGNED_INT_24_8,
1881
+ depth32float: e.FLOAT,
1882
+ "depth32float-stencil8": e.FLOAT_32_UNSIGNED_INT_24_8_REV
1883
+ };
1884
+ }
1885
+ //#endregion
1886
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/texture/utils/mapViewDimensionToGlTarget.mjs
1887
+ function vt(e) {
1888
+ return {
1889
+ "2d": e.TEXTURE_2D,
1890
+ cube: e.TEXTURE_CUBE_MAP,
1891
+ "1d": null,
1892
+ "3d": e?.TEXTURE_3D || null,
1893
+ "2d-array": e?.TEXTURE_2D_ARRAY || null,
1894
+ "cube-array": e?.TEXTURE_CUBE_MAP_ARRAY || null
1895
+ };
1896
+ }
1897
+ //#endregion
1898
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/texture/GlTextureSystem.mjs
1899
+ var yt = 4, Q = class e {
1900
+ constructor(t) {
1901
+ this._glSamplers = /* @__PURE__ */ Object.create(null), this._boundTextures = [], this._activeTextureLocation = -1, this._boundSamplers = /* @__PURE__ */ Object.create(null), this._premultiplyAlpha = !1, this._useSeparateSamplers = !1, this._renderer = t, this._managedTextures = new x({
1902
+ renderer: t,
1903
+ type: "resource",
1904
+ onUnload: this.onSourceUnload.bind(this),
1905
+ name: "glTexture"
1906
+ });
1907
+ let n = {
1908
+ image: ot,
1909
+ buffer: tt,
1910
+ video: ut,
1911
+ compressed: rt,
1912
+ ...e.uploadExtensions
1913
+ };
1914
+ this._uploads = {
1915
+ ...n,
1916
+ cube: at(n)
1917
+ };
1918
+ }
1919
+ get managedTextures() {
1920
+ return Object.values(this._managedTextures.items);
1921
+ }
1922
+ contextChange(e) {
1923
+ this._gl = e, this._mapFormatToInternalFormat || (this._mapFormatToInternalFormat = gt(e, this._renderer.context.extensions), this._mapFormatToType = _t(e), this._mapFormatToFormat = ht(e), this._mapViewDimensionToGlTarget = vt(e)), this._managedTextures.removeAll(!0), this._glSamplers = /* @__PURE__ */ Object.create(null), this._boundSamplers = /* @__PURE__ */ Object.create(null), this._premultiplyAlpha = !1;
1924
+ for (let e = 0; e < 16; e++) this.bind(r.EMPTY, e);
1925
+ }
1926
+ initSource(e) {
1927
+ this.bind(e);
1928
+ }
1929
+ bind(e, t = 0) {
1930
+ let n = e.source;
1931
+ e ? (this.bindSource(n, t), this._useSeparateSamplers && this._bindSampler(n.style, t)) : (this.bindSource(null, t), this._useSeparateSamplers && this._bindSampler(null, t));
1932
+ }
1933
+ bindSource(e, t = 0) {
1934
+ let n = this._gl;
1935
+ if (e._gcLastUsed = this._renderer.gc.now, this._boundTextures[t] !== e) {
1936
+ this._boundTextures[t] = e, this._activateLocation(t), e ||= r.EMPTY.source;
1937
+ let i = this.getGlSource(e);
1938
+ n.bindTexture(i.target, i.texture);
1939
+ }
1940
+ }
1941
+ _bindSampler(e, t = 0) {
1942
+ let n = this._gl;
1943
+ if (!e) {
1944
+ this._boundSamplers[t] = null, n.bindSampler(t, null);
1945
+ return;
1946
+ }
1947
+ let r = this._getGlSampler(e);
1948
+ this._boundSamplers[t] !== r && (this._boundSamplers[t] = r, n.bindSampler(t, r));
1949
+ }
1950
+ unbind(e) {
1951
+ let t = e.source, n = this._boundTextures, r = this._gl;
1952
+ for (let e = 0; e < n.length; e++) if (n[e] === t) {
1953
+ this._activateLocation(e);
1954
+ let i = this.getGlSource(t);
1955
+ r.bindTexture(i.target, null), n[e] = null;
1956
+ }
1957
+ }
1958
+ _activateLocation(e) {
1959
+ this._activeTextureLocation !== e && (this._activeTextureLocation = e, this._gl.activeTexture(this._gl.TEXTURE0 + e));
1960
+ }
1961
+ _initSource(e) {
1962
+ let t = this._gl, n = new et(t.createTexture());
1963
+ if (n.type = this._mapFormatToType[e.format], n.internalFormat = this._mapFormatToInternalFormat[e.format], n.format = this._mapFormatToFormat[e.format], n.target = this._mapViewDimensionToGlTarget[e.viewDimension], n.target === null) throw Error(`Unsupported view dimension: ${e.viewDimension} with this webgl version: ${this._renderer.context.webGLVersion}`);
1964
+ if (e.autoGenerateMipmaps && (this._renderer.context.supports.nonPowOf2mipmaps || e.isPowerOfTwo)) {
1965
+ let t = Math.max(e.width, e.height);
1966
+ e.mipLevelCount = Math.floor(Math.log2(t)) + 1;
1967
+ }
1968
+ return e._gpuData[this._renderer.uid] = n, this._managedTextures.add(e) && (e.on("update", this.onSourceUpdate, this), e.on("resize", this.onSourceUpdate, this), e.on("styleChange", this.onStyleChange, this), e.on("updateMipmaps", this.onUpdateMipmaps, this)), this.onSourceUpdate(e), this.updateStyle(e, !1), n;
1969
+ }
1970
+ onStyleChange(e) {
1971
+ this.updateStyle(e, !1);
1972
+ }
1973
+ updateStyle(e, t) {
1974
+ let n = this._gl, r = this.getGlSource(e);
1975
+ n.bindTexture(r.target, r.texture), this._boundTextures[this._activeTextureLocation] = e, mt(e.style, n, e.mipLevelCount > 1, this._renderer.context.extensions.anisotropicFiltering, "texParameteri", r.target, !this._renderer.context.supports.nonPowOf2wrapping && !e.isPowerOfTwo, t);
1976
+ }
1977
+ onSourceUnload(e, t = !1) {
1978
+ let n = e._gpuData[this._renderer.uid];
1979
+ n && (t || (this.unbind(e), this._gl.deleteTexture(n.texture)), e.off("update", this.onSourceUpdate, this), e.off("resize", this.onSourceUpdate, this), e.off("styleChange", this.onStyleChange, this), e.off("updateMipmaps", this.onUpdateMipmaps, this));
1980
+ }
1981
+ onSourceUpdate(e) {
1982
+ let t = this._gl, n = this.getGlSource(e);
1983
+ t.bindTexture(n.target, n.texture), this._boundTextures[this._activeTextureLocation] = e;
1984
+ let r = e.alphaMode === "premultiply-alpha-on-upload";
1985
+ if (this._premultiplyAlpha !== r && (this._premultiplyAlpha = r, t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL, r)), this._uploads[e.uploadMethodId]) this._uploads[e.uploadMethodId].upload(e, n, t, this._renderer.context.webGLVersion);
1986
+ else if (n.target === t.TEXTURE_2D) this._initEmptyTexture2D(n, e);
1987
+ else if (n.target === t.TEXTURE_2D_ARRAY) this._initEmptyTexture2DArray(n, e);
1988
+ else if (n.target === t.TEXTURE_CUBE_MAP) this._initEmptyTextureCube(n, e);
1989
+ else throw Error("[GlTextureSystem] Unsupported texture target for empty allocation.");
1990
+ this._applyMipRange(n, e), e.autoGenerateMipmaps && e.mipLevelCount > 1 && this.onUpdateMipmaps(e, !1);
1991
+ }
1992
+ onUpdateMipmaps(e, t = !0) {
1993
+ t && this.bindSource(e, 0);
1994
+ let n = this.getGlSource(e);
1995
+ this._gl.generateMipmap(n.target);
1996
+ }
1997
+ _initEmptyTexture2D(e, t) {
1998
+ let n = this._gl;
1999
+ n.texImage2D(n.TEXTURE_2D, 0, e.internalFormat, t.pixelWidth, t.pixelHeight, 0, e.format, e.type, null);
2000
+ let r = Math.max(t.pixelWidth >> 1, 1), i = Math.max(t.pixelHeight >> 1, 1);
2001
+ for (let a = 1; a < t.mipLevelCount; a++) n.texImage2D(n.TEXTURE_2D, a, e.internalFormat, r, i, 0, e.format, e.type, null), r = Math.max(r >> 1, 1), i = Math.max(i >> 1, 1);
2002
+ }
2003
+ _initEmptyTexture2DArray(e, t) {
2004
+ if (this._renderer.context.webGLVersion !== 2) throw Error("[GlTextureSystem] TEXTURE_2D_ARRAY requires WebGL2.");
2005
+ let n = this._gl, r = Math.max(t.arrayLayerCount | 0, 1);
2006
+ n.texImage3D(n.TEXTURE_2D_ARRAY, 0, e.internalFormat, t.pixelWidth, t.pixelHeight, r, 0, e.format, e.type, null);
2007
+ let i = Math.max(t.pixelWidth >> 1, 1), a = Math.max(t.pixelHeight >> 1, 1);
2008
+ for (let o = 1; o < t.mipLevelCount; o++) n.texImage3D(n.TEXTURE_2D_ARRAY, o, e.internalFormat, i, a, r, 0, e.format, e.type, null), i = Math.max(i >> 1, 1), a = Math.max(a >> 1, 1);
2009
+ }
2010
+ _initEmptyTextureCube(e, t) {
2011
+ let n = this._gl;
2012
+ for (let r = 0; r < 6; r++) n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + r, 0, e.internalFormat, t.pixelWidth, t.pixelHeight, 0, e.format, e.type, null);
2013
+ let r = Math.max(t.pixelWidth >> 1, 1), i = Math.max(t.pixelHeight >> 1, 1);
2014
+ for (let a = 1; a < t.mipLevelCount; a++) {
2015
+ for (let t = 0; t < 6; t++) n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + t, a, e.internalFormat, r, i, 0, e.format, e.type, null);
2016
+ r = Math.max(r >> 1, 1), i = Math.max(i >> 1, 1);
2017
+ }
2018
+ }
2019
+ _applyMipRange(e, t) {
2020
+ if (this._renderer.context.webGLVersion !== 2 || t.mipLevelCount <= 1) return;
2021
+ let n = this._gl, r = Math.max((t.mipLevelCount | 0) - 1, 0);
2022
+ n.texParameteri(e.target, n.TEXTURE_BASE_LEVEL, 0), n.texParameteri(e.target, n.TEXTURE_MAX_LEVEL, r);
2023
+ }
2024
+ _initSampler(e) {
2025
+ let t = this._gl, n = this._gl.createSampler();
2026
+ return this._glSamplers[e._resourceId] = n, mt(e, t, this._boundTextures[this._activeTextureLocation].mipLevelCount > 1, this._renderer.context.extensions.anisotropicFiltering, "samplerParameteri", n, !1, !0), this._glSamplers[e._resourceId];
2027
+ }
2028
+ _getGlSampler(e) {
2029
+ return this._glSamplers[e._resourceId] || this._initSampler(e);
2030
+ }
2031
+ getGlSource(e) {
2032
+ return e._gcLastUsed = this._renderer.gc.now, e._gpuData[this._renderer.uid] || this._initSource(e);
2033
+ }
2034
+ generateCanvas(e) {
2035
+ let { pixels: t, width: n, height: r } = this.getPixels(e), i = s.get().createCanvas();
2036
+ i.width = n, i.height = r;
2037
+ let a = i.getContext("2d");
2038
+ if (a) {
2039
+ let e = a.createImageData(n, r);
2040
+ e.data.set(t), a.putImageData(e, 0, 0);
2041
+ }
2042
+ return i;
2043
+ }
2044
+ getPixels(e) {
2045
+ let t = e.source.resolution, n = e.frame, r = Math.max(Math.round(n.width * t), 1), i = Math.max(Math.round(n.height * t), 1), a = new Uint8Array(yt * r * i), o = this._renderer, s = o.renderTarget.getRenderTarget(e), c = o.renderTarget.getGpuRenderTarget(s), l = o.gl;
2046
+ return o.renderTarget.adaptor.bindFramebuffer(c.resolveTargetFramebuffer), l.readPixels(Math.round(n.x * t), Math.round(n.y * t), r, i, l.RGBA, l.UNSIGNED_BYTE, a), {
2047
+ pixels: new Uint8ClampedArray(a.buffer),
2048
+ width: r,
2049
+ height: i
2050
+ };
2051
+ }
2052
+ destroy() {
2053
+ this._managedTextures.destroy(), this._glSamplers = null, this._boundTextures = null, this._boundSamplers = null, this._mapFormatToInternalFormat = null, this._mapFormatToType = null, this._mapFormatToFormat = null, this._uploads = null, this._renderer = null;
2054
+ }
2055
+ resetState() {
2056
+ this._activeTextureLocation = -1, this._boundTextures.fill(r.EMPTY.source), this._boundSamplers = /* @__PURE__ */ Object.create(null);
2057
+ let e = this._gl;
2058
+ this._premultiplyAlpha = !1, e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this._premultiplyAlpha);
2059
+ }
2060
+ };
2061
+ Q.extension = {
2062
+ type: [g.WebGLSystem],
2063
+ name: "texture"
2064
+ }, Q.uploadExtensions = /* @__PURE__ */ Object.create(null);
2065
+ var bt = Q;
2066
+ u.handleByMap(g.TextureUploaderWebGL, bt.uploadExtensions);
2067
+ //#endregion
2068
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/scene/graphics/gl/GlGraphicsAdaptor.mjs
2069
+ var xt = class {
2070
+ contextChange(e) {
2071
+ let t = new c({
2072
+ uColor: {
2073
+ value: new Float32Array([
2074
+ 1,
2075
+ 1,
2076
+ 1,
2077
+ 1
2078
+ ]),
2079
+ type: "vec4<f32>"
2080
+ },
2081
+ uTransformMatrix: {
2082
+ value: new l(),
2083
+ type: "mat3x3<f32>"
2084
+ },
2085
+ uRound: {
2086
+ value: 0,
2087
+ type: "f32"
2088
+ }
2089
+ }), n = e.limits.maxBatchableTextures, r = b({
2090
+ name: "graphics",
2091
+ bits: [
2092
+ le,
2093
+ ie(n),
2094
+ T,
2095
+ S
2096
+ ]
2097
+ });
2098
+ this.shader = new _({
2099
+ glProgram: r,
2100
+ resources: {
2101
+ localUniforms: t,
2102
+ batchSamplers: oe(n)
2103
+ }
2104
+ });
2105
+ }
2106
+ execute(e, t) {
2107
+ let n = t.context, r = n.customShader || this.shader, i = e.renderer, { batcher: a, instructions: o } = i.graphicsContext.getContextRenderData(n);
2108
+ r.groups[0] = i.globalUniforms.bindGroup, i.state.set(e.state), i.shader.bind(r), i.geometry.bind(a.geometry, r.glProgram);
2109
+ let s = o.instructions;
2110
+ for (let e = 0; e < o.instructionSize; e++) {
2111
+ let t = s[e];
2112
+ if (t.size) {
2113
+ for (let e = 0; e < t.textures.count; e++) i.texture.bind(t.textures.textures[e], e);
2114
+ i.geometry.draw(t.topology, t.size, t.start);
2115
+ }
2116
+ }
2117
+ }
2118
+ destroy() {
2119
+ this.shader.destroy(!0), this.shader = null;
2120
+ }
2121
+ };
2122
+ xt.extension = {
2123
+ type: [g.WebGLPipesAdaptor],
2124
+ name: "graphics"
2125
+ };
2126
+ //#endregion
2127
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/scene/mesh/gl/GlMeshAdaptor.mjs
2128
+ var St = class {
2129
+ init() {
2130
+ let e = b({
2131
+ name: "mesh",
2132
+ bits: [
2133
+ T,
2134
+ he,
2135
+ S
2136
+ ]
2137
+ });
2138
+ this._shader = new _({
2139
+ glProgram: e,
2140
+ resources: {
2141
+ uTexture: r.EMPTY.source,
2142
+ textureUniforms: { uTextureMatrix: {
2143
+ type: "mat3x3<f32>",
2144
+ value: new l()
2145
+ } }
2146
+ }
2147
+ });
2148
+ }
2149
+ execute(e, t) {
2150
+ let r = e.renderer, i = t._shader;
2151
+ if (!i) {
2152
+ i = this._shader;
2153
+ let e = t.texture, n = e.source;
2154
+ i.resources.uTexture = n, i.resources.uSampler = n.style, i.resources.textureUniforms.uniforms.uTextureMatrix = e.textureMatrix.mapCoord;
2155
+ } else if (!i.glProgram) {
2156
+ n("Mesh shader has no glProgram", t.shader);
2157
+ return;
2158
+ }
2159
+ i.groups[100] = r.globalUniforms.bindGroup, i.groups[101] = e.localUniformsBindGroup, r.encoder.draw({
2160
+ geometry: t._geometry,
2161
+ shader: i,
2162
+ state: t.state
2163
+ });
2164
+ }
2165
+ destroy() {
2166
+ this._shader.destroy(!0), this._shader = null;
2167
+ }
2168
+ };
2169
+ St.extension = {
2170
+ type: [g.WebGLPipesAdaptor],
2171
+ name: "mesh"
2172
+ };
2173
+ //#endregion
2174
+ //#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/gl/WebGLRenderer.mjs
2175
+ var Ct = /* @__PURE__ */ e({ WebGLRenderer: () => kt }), wt = [
2176
+ ...se,
2177
+ H,
2178
+ Ce,
2179
+ ve,
2180
+ z,
2181
+ k,
2182
+ bt,
2183
+ ke,
2184
+ F,
2185
+ We,
2186
+ Be,
2187
+ R,
2188
+ $e,
2189
+ B,
2190
+ L
2191
+ ], Tt = [...ae], Et = [
2192
+ D,
2193
+ St,
2194
+ xt
2195
+ ], Dt = [], Ot = [], $ = [];
2196
+ u.handleByNamedList(g.WebGLSystem, Dt), u.handleByNamedList(g.WebGLPipes, Ot), u.handleByNamedList(g.WebGLPipesAdaptor, $), u.add(...wt, ...Tt, ...Et);
2197
+ var kt = class extends ne {
2198
+ constructor() {
2199
+ let e = {
2200
+ name: "webgl",
2201
+ type: d.WEBGL,
2202
+ systems: Dt,
2203
+ renderPipes: Ot,
2204
+ renderPipeAdaptors: $
2205
+ };
2206
+ super(e);
2207
+ }
2208
+ };
2209
+ //#endregion
2210
+ export { j as n, Ct as t };