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.
- package/README.md +187 -0
- package/dist/BufferResource-CVU-ZRRz.js +273 -0
- package/dist/CanvasPool-C3aVgvEX.js +30 -0
- package/dist/CanvasRenderer-CVj7HTkL.js +3460 -0
- package/dist/Geometry-CN7W9DnD.js +3802 -0
- package/dist/RenderTargetSystem-D_FiZPnb.js +2572 -0
- package/dist/WebGLRenderer-CurPxJtF.js +2210 -0
- package/dist/WebGPURenderer-CfiYFIN2.js +1840 -0
- package/dist/browserAll-DqFkNC6q.js +977 -0
- package/dist/canvasUtils-D0KM_fKp.js +168 -0
- package/dist/comps.js +4459 -0
- package/dist/getTextureBatchBindGroup-CLFTP_Vc.js +19 -0
- package/dist/hooks-DByotZq7.js +452 -0
- package/dist/hooks.js +2 -0
- package/dist/index.js +2 -0
- package/dist/init-CIaGzij5.js +446 -0
- package/dist/init-DVXFVLyx.js +878 -0
- package/dist/packages-BbFWPD88.js +4002 -0
- package/dist/rolldown-runtime-CWhphoD1.js +23 -0
- package/dist/style.css +2 -0
- package/dist/utils.js +2 -0
- package/dist/webworkerAll-XSXRmCFC.js +2 -0
- package/package.json +65 -0
|
@@ -0,0 +1,878 @@
|
|
|
1
|
+
import { B as e, C as t, D as n, M as r, N as i, Q as a, R as o, U as s, V as c, W as l, _ as u, b as d, it as f, j as p, rt as m, x as h, y as g } from "./Geometry-CN7W9DnD.js";
|
|
2
|
+
import { r as _ } from "./canvasUtils-D0KM_fKp.js";
|
|
3
|
+
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/mask/utils/addMaskBounds.mjs
|
|
4
|
+
var v = new e();
|
|
5
|
+
function y(e, t, n) {
|
|
6
|
+
let r = v;
|
|
7
|
+
e.measurable = !0, p(e, n, r), t.addBoundsMask(r), e.measurable = !1;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/mask/utils/addMaskLocalBounds.mjs
|
|
11
|
+
function b(e, t, a) {
|
|
12
|
+
let o = r.get();
|
|
13
|
+
e.measurable = !0;
|
|
14
|
+
let s = i.get().identity();
|
|
15
|
+
n(e, o, x(e, a, s)), e.measurable = !1, t.addBoundsMask(o), i.return(s), r.return(o);
|
|
16
|
+
}
|
|
17
|
+
function x(e, t, n) {
|
|
18
|
+
return e ? (e !== t && (x(e.parent, t, n), e.updateLocalTransform(), n.append(e.localTransform)), n) : (o("Mask bounds, renderable is not inside the root container"), n);
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/mask/alpha/AlphaMask.mjs
|
|
22
|
+
var S = class {
|
|
23
|
+
constructor(e) {
|
|
24
|
+
this.priority = 0, this.inverse = !1, this.channel = "red", this.pipe = "alphaMask", e?.mask && this.init(e.mask);
|
|
25
|
+
}
|
|
26
|
+
init(e) {
|
|
27
|
+
this.mask = e, this.renderMaskToTexture = !(e instanceof h), this.mask.renderable = this.renderMaskToTexture, this.mask.includeInBuild = !this.renderMaskToTexture, this.mask.measurable = !1;
|
|
28
|
+
}
|
|
29
|
+
reset() {
|
|
30
|
+
this.mask !== null && (this.mask.measurable = !0, this.mask = null);
|
|
31
|
+
}
|
|
32
|
+
addBounds(e, t) {
|
|
33
|
+
this.inverse || y(this.mask, e, t);
|
|
34
|
+
}
|
|
35
|
+
addLocalBounds(e, t) {
|
|
36
|
+
b(this.mask, e, t);
|
|
37
|
+
}
|
|
38
|
+
containsPoint(e, t) {
|
|
39
|
+
let n = this.mask;
|
|
40
|
+
return t(n, e);
|
|
41
|
+
}
|
|
42
|
+
destroy() {
|
|
43
|
+
this.reset();
|
|
44
|
+
}
|
|
45
|
+
static test(e) {
|
|
46
|
+
return e instanceof h;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
S.extension = m.MaskEffect;
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/mask/color/ColorMask.mjs
|
|
52
|
+
var C = class {
|
|
53
|
+
constructor(e) {
|
|
54
|
+
this.priority = 0, this.pipe = "colorMask", e?.mask && this.init(e.mask);
|
|
55
|
+
}
|
|
56
|
+
init(e) {
|
|
57
|
+
this.mask = e;
|
|
58
|
+
}
|
|
59
|
+
destroy() {}
|
|
60
|
+
static test(e) {
|
|
61
|
+
return typeof e == "number";
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
C.extension = m.MaskEffect;
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/mask/stencil/StencilMask.mjs
|
|
67
|
+
var w = class {
|
|
68
|
+
constructor(e) {
|
|
69
|
+
this.priority = 0, this.pipe = "stencilMask", e?.mask && this.init(e.mask);
|
|
70
|
+
}
|
|
71
|
+
init(e) {
|
|
72
|
+
this.mask = e, this.mask.includeInBuild = !1, this.mask.measurable = !1;
|
|
73
|
+
}
|
|
74
|
+
reset() {
|
|
75
|
+
this.mask !== null && (this.mask.measurable = !0, this.mask.includeInBuild = !0, this.mask = null);
|
|
76
|
+
}
|
|
77
|
+
addBounds(e, t) {
|
|
78
|
+
y(this.mask, e, t);
|
|
79
|
+
}
|
|
80
|
+
addLocalBounds(e, t) {
|
|
81
|
+
b(this.mask, e, t);
|
|
82
|
+
}
|
|
83
|
+
containsPoint(e, t) {
|
|
84
|
+
let n = this.mask;
|
|
85
|
+
return t(n, e);
|
|
86
|
+
}
|
|
87
|
+
destroy() {
|
|
88
|
+
this.reset();
|
|
89
|
+
}
|
|
90
|
+
static test(e) {
|
|
91
|
+
return e instanceof t;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
w.extension = m.MaskEffect;
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/utils/browser/detectVideoAlphaMode.mjs
|
|
97
|
+
var T;
|
|
98
|
+
async function E() {
|
|
99
|
+
return T ??= (async () => {
|
|
100
|
+
let e = d.get().createCanvas(1, 1).getContext("webgl");
|
|
101
|
+
if (!e) return "premultiply-alpha-on-upload";
|
|
102
|
+
let t = await new Promise((e) => {
|
|
103
|
+
let t = document.createElement("video");
|
|
104
|
+
t.onloadeddata = () => e(t), t.onerror = () => e(null), t.autoplay = !1, t.crossOrigin = "anonymous", t.preload = "auto", t.src = "data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=", t.load();
|
|
105
|
+
});
|
|
106
|
+
if (!t) return "premultiply-alpha-on-upload";
|
|
107
|
+
let n = e.createTexture();
|
|
108
|
+
e.bindTexture(e.TEXTURE_2D, n);
|
|
109
|
+
let r = e.createFramebuffer();
|
|
110
|
+
e.bindFramebuffer(e.FRAMEBUFFER, r), e.framebufferTexture2D(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, n, 0), e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1), e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL, e.NONE), e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, e.RGBA, e.UNSIGNED_BYTE, t);
|
|
111
|
+
let i = /* @__PURE__ */ new Uint8Array(4);
|
|
112
|
+
return e.readPixels(0, 0, 1, 1, e.RGBA, e.UNSIGNED_BYTE, i), e.deleteFramebuffer(r), e.deleteTexture(n), e.getExtension("WEBGL_lose_context")?.loseContext(), i[0] <= i[3] ? "premultiplied-alpha" : "premultiply-alpha-on-upload";
|
|
113
|
+
})(), T;
|
|
114
|
+
}
|
|
115
|
+
//#endregion
|
|
116
|
+
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/renderers/shared/texture/sources/VideoSource.mjs
|
|
117
|
+
var D = class e extends l {
|
|
118
|
+
constructor(t) {
|
|
119
|
+
super(t), this.isReady = !1, this.uploadMethodId = "video", t = {
|
|
120
|
+
...e.defaultOptions,
|
|
121
|
+
...t
|
|
122
|
+
}, this._autoUpdate = !0, this._isConnectedToTicker = !1, this._updateFPS = t.updateFPS || 0, this._msToNextUpdate = 0, this.autoPlay = t.autoPlay !== !1, this.alphaMode = t.alphaMode ?? "premultiply-alpha-on-upload", this._videoFrameRequestCallback = this._videoFrameRequestCallback.bind(this), this._videoFrameRequestCallbackHandle = null, this._load = null, this._resolve = null, this._reject = null, this._onCanPlay = this._onCanPlay.bind(this), this._onCanPlayThrough = this._onCanPlayThrough.bind(this), this._onError = this._onError.bind(this), this._onPlayStart = this._onPlayStart.bind(this), this._onPlayStop = this._onPlayStop.bind(this), this._onSeeked = this._onSeeked.bind(this), this._onLoadedMetadata = this._onLoadedMetadata.bind(this), t.autoLoad !== !1 && this.load();
|
|
123
|
+
}
|
|
124
|
+
updateFrame() {
|
|
125
|
+
if (!this.destroyed) {
|
|
126
|
+
if (this._updateFPS) {
|
|
127
|
+
let e = u.shared.elapsedMS * this.resource.playbackRate;
|
|
128
|
+
this._msToNextUpdate = Math.floor(this._msToNextUpdate - e);
|
|
129
|
+
}
|
|
130
|
+
(!this._updateFPS || this._msToNextUpdate <= 0) && (this._msToNextUpdate = this._updateFPS ? Math.floor(1e3 / this._updateFPS) : 0), this.isValid && this.update();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
_videoFrameRequestCallback() {
|
|
134
|
+
this.updateFrame(), this.destroyed ? this._videoFrameRequestCallbackHandle = null : this._videoFrameRequestCallbackHandle = this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback);
|
|
135
|
+
}
|
|
136
|
+
get isValid() {
|
|
137
|
+
return !!this.resource.videoWidth && !!this.resource.videoHeight;
|
|
138
|
+
}
|
|
139
|
+
async load() {
|
|
140
|
+
if (this._load) return this._load;
|
|
141
|
+
let e = this.resource, t = this.options;
|
|
142
|
+
return (e.readyState === e.HAVE_ENOUGH_DATA || e.readyState === e.HAVE_FUTURE_DATA) && e.width && e.height && (e.complete = !0), e.addEventListener("play", this._onPlayStart), e.addEventListener("pause", this._onPlayStop), e.addEventListener("seeked", this._onSeeked), this._isSourceReady() ? this._mediaReady() : (t.preload || e.addEventListener("canplay", this._onCanPlay), e.addEventListener("canplaythrough", this._onCanPlayThrough), e.addEventListener("error", this._onError, !0)), this.isValid || e.addEventListener("loadedmetadata", this._onLoadedMetadata), this.alphaMode = await E(), this._load = new Promise((n, r) => {
|
|
143
|
+
this.isValid ? n(this) : (this._resolve = n, this._reject = r, t.preloadTimeoutMs !== void 0 && (this._preloadTimeout = setTimeout(() => {
|
|
144
|
+
this._onError(new ErrorEvent(`Preload exceeded timeout of ${t.preloadTimeoutMs}ms`));
|
|
145
|
+
})), e.load());
|
|
146
|
+
}), this._load;
|
|
147
|
+
}
|
|
148
|
+
_onError(e) {
|
|
149
|
+
this.resource.removeEventListener("error", this._onError, !0), this.emit("error", e), this._reject && (this._reject(e), this._reject = null, this._resolve = null);
|
|
150
|
+
}
|
|
151
|
+
_isSourcePlaying() {
|
|
152
|
+
let e = this.resource;
|
|
153
|
+
return !e.paused && !e.ended;
|
|
154
|
+
}
|
|
155
|
+
_isSourceReady() {
|
|
156
|
+
return this.resource.readyState > 2;
|
|
157
|
+
}
|
|
158
|
+
_onPlayStart() {
|
|
159
|
+
this._configureAutoUpdate();
|
|
160
|
+
}
|
|
161
|
+
_onPlayStop() {
|
|
162
|
+
this._configureAutoUpdate();
|
|
163
|
+
}
|
|
164
|
+
_onSeeked() {
|
|
165
|
+
this._autoUpdate && !this._isSourcePlaying() && (this._msToNextUpdate = 0, this.updateFrame(), this._msToNextUpdate = 0);
|
|
166
|
+
}
|
|
167
|
+
_onLoadedMetadata() {
|
|
168
|
+
this.isValid && this._mediaReady();
|
|
169
|
+
}
|
|
170
|
+
_onCanPlay() {
|
|
171
|
+
this.resource.removeEventListener("canplay", this._onCanPlay), this._mediaReady();
|
|
172
|
+
}
|
|
173
|
+
_onCanPlayThrough() {
|
|
174
|
+
this.resource.removeEventListener("canplaythrough", this._onCanPlayThrough), this._preloadTimeout &&= (clearTimeout(this._preloadTimeout), void 0), this._mediaReady();
|
|
175
|
+
}
|
|
176
|
+
_mediaReady() {
|
|
177
|
+
let e = this.resource;
|
|
178
|
+
this.isValid && (this.isReady = !0, this.resize(e.videoWidth, e.videoHeight)), this._msToNextUpdate = 0, this.updateFrame(), this._msToNextUpdate = 0, this._resolve && this.isValid && (this._resolve(this), this._resolve = null, this._reject = null), this._isSourcePlaying() ? this._onPlayStart() : this.autoPlay && this.resource.play();
|
|
179
|
+
}
|
|
180
|
+
destroy() {
|
|
181
|
+
this._configureAutoUpdate();
|
|
182
|
+
let e = this.resource;
|
|
183
|
+
e && (e.removeEventListener("play", this._onPlayStart), e.removeEventListener("pause", this._onPlayStop), e.removeEventListener("seeked", this._onSeeked), e.removeEventListener("canplay", this._onCanPlay), e.removeEventListener("canplaythrough", this._onCanPlayThrough), e.removeEventListener("loadedmetadata", this._onLoadedMetadata), e.removeEventListener("error", this._onError, !0), e.pause(), e.src = "", e.load()), super.destroy();
|
|
184
|
+
}
|
|
185
|
+
get autoUpdate() {
|
|
186
|
+
return this._autoUpdate;
|
|
187
|
+
}
|
|
188
|
+
set autoUpdate(e) {
|
|
189
|
+
e !== this._autoUpdate && (this._autoUpdate = e, this._configureAutoUpdate());
|
|
190
|
+
}
|
|
191
|
+
get updateFPS() {
|
|
192
|
+
return this._updateFPS;
|
|
193
|
+
}
|
|
194
|
+
set updateFPS(e) {
|
|
195
|
+
e !== this._updateFPS && (this._updateFPS = e, this._configureAutoUpdate());
|
|
196
|
+
}
|
|
197
|
+
_configureAutoUpdate() {
|
|
198
|
+
this._autoUpdate && this._isSourcePlaying() ? !this._updateFPS && this.resource.requestVideoFrameCallback ? (this._isConnectedToTicker && (u.shared.remove(this.updateFrame, this), this._isConnectedToTicker = !1, this._msToNextUpdate = 0), this._videoFrameRequestCallbackHandle === null && (this._videoFrameRequestCallbackHandle = this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))) : (this._videoFrameRequestCallbackHandle !== null && (this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle), this._videoFrameRequestCallbackHandle = null), this._isConnectedToTicker || (u.shared.add(this.updateFrame, this), this._isConnectedToTicker = !0, this._msToNextUpdate = 0)) : (this._videoFrameRequestCallbackHandle !== null && (this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle), this._videoFrameRequestCallbackHandle = null), this._isConnectedToTicker && (u.shared.remove(this.updateFrame, this), this._isConnectedToTicker = !1, this._msToNextUpdate = 0));
|
|
199
|
+
}
|
|
200
|
+
static test(e) {
|
|
201
|
+
return globalThis.HTMLVideoElement && e instanceof HTMLVideoElement;
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
D.extension = m.TextureSource, D.defaultOptions = {
|
|
205
|
+
...l.defaultOptions,
|
|
206
|
+
autoLoad: !0,
|
|
207
|
+
autoPlay: !0,
|
|
208
|
+
updateFPS: 0,
|
|
209
|
+
crossorigin: !0,
|
|
210
|
+
loop: !1,
|
|
211
|
+
muted: !0,
|
|
212
|
+
playsinline: !0,
|
|
213
|
+
preload: !1
|
|
214
|
+
}, D.MIME_TYPES = {
|
|
215
|
+
ogv: "video/ogg",
|
|
216
|
+
mov: "video/quicktime",
|
|
217
|
+
m4v: "video/mp4"
|
|
218
|
+
};
|
|
219
|
+
var O = D, k = (e, t, n = !1) => (Array.isArray(e) || (e = [e]), t ? e.map((e) => typeof e == "string" || n ? t(e) : e) : e), A = new class {
|
|
220
|
+
constructor() {
|
|
221
|
+
this._parsers = [], this._cache = /* @__PURE__ */ new Map(), this._cacheMap = /* @__PURE__ */ new Map();
|
|
222
|
+
}
|
|
223
|
+
reset() {
|
|
224
|
+
this._cacheMap.clear(), this._cache.clear();
|
|
225
|
+
}
|
|
226
|
+
has(e) {
|
|
227
|
+
return this._cache.has(e);
|
|
228
|
+
}
|
|
229
|
+
get(e) {
|
|
230
|
+
let t = this._cache.get(e);
|
|
231
|
+
return t || o(`[Assets] Asset id ${e} was not found in the Cache`), t;
|
|
232
|
+
}
|
|
233
|
+
set(e, t) {
|
|
234
|
+
let n = k(e), r;
|
|
235
|
+
for (let e = 0; e < this.parsers.length; e++) {
|
|
236
|
+
let i = this.parsers[e];
|
|
237
|
+
if (i.test(t)) {
|
|
238
|
+
r = i.getCacheableAssets(n, t);
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
let i = new Map(Object.entries(r || {}));
|
|
243
|
+
r || n.forEach((e) => {
|
|
244
|
+
i.set(e, t);
|
|
245
|
+
});
|
|
246
|
+
let a = [...i.keys()], s = {
|
|
247
|
+
cacheKeys: a,
|
|
248
|
+
keys: n
|
|
249
|
+
};
|
|
250
|
+
n.forEach((e) => {
|
|
251
|
+
this._cacheMap.set(e, s);
|
|
252
|
+
}), a.forEach((e) => {
|
|
253
|
+
let n = r ? r[e] : t;
|
|
254
|
+
this._cache.has(e) && this._cache.get(e) !== n && o("[Cache] already has key:", e), this._cache.set(e, i.get(e));
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
remove(e) {
|
|
258
|
+
if (!this._cacheMap.has(e)) {
|
|
259
|
+
o(`[Assets] Asset id ${e} was not found in the Cache`);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
let t = this._cacheMap.get(e);
|
|
263
|
+
t.cacheKeys.forEach((e) => {
|
|
264
|
+
this._cache.delete(e);
|
|
265
|
+
}), t.keys.forEach((e) => {
|
|
266
|
+
this._cacheMap.delete(e);
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
get parsers() {
|
|
270
|
+
return this._parsers;
|
|
271
|
+
}
|
|
272
|
+
}(), j = [];
|
|
273
|
+
f.handleByList(m.TextureSource, j);
|
|
274
|
+
function M(e = {}) {
|
|
275
|
+
let t = e && e.resource, n = t ? e.resource : e, r = t ? e : { resource: e };
|
|
276
|
+
for (let e = 0; e < j.length; e++) {
|
|
277
|
+
let t = j[e];
|
|
278
|
+
if (t.test(n)) return new t(r);
|
|
279
|
+
}
|
|
280
|
+
throw Error(`Could not find a source type for resource: ${r.resource}`);
|
|
281
|
+
}
|
|
282
|
+
function N(e = {}, t = !1) {
|
|
283
|
+
let n = e && e.resource, r = n ? e.resource : e, i = n ? e : { resource: e };
|
|
284
|
+
if (!t && A.has(r)) return A.get(r);
|
|
285
|
+
let a = new c({ source: M(i) });
|
|
286
|
+
return a.on("destroy", () => {
|
|
287
|
+
A.has(r) && A.remove(r);
|
|
288
|
+
}), t || A.set(r, a), a;
|
|
289
|
+
}
|
|
290
|
+
function P(e, t = !1) {
|
|
291
|
+
return typeof e == "string" ? A.get(e) : e instanceof l ? new c({ source: e }) : N(e, t);
|
|
292
|
+
}
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/rendering/init.mjs
|
|
295
|
+
c.from = P, l.from = M, f.add(S, C, w, O, _, g, s);
|
|
296
|
+
//#endregion
|
|
297
|
+
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/assets/loader/parsers/LoaderParser.mjs
|
|
298
|
+
var F = /* @__PURE__ */ ((e) => (e[e.Low = 0] = "Low", e[e.Normal = 1] = "Normal", e[e.High = 2] = "High", e))(F || {});
|
|
299
|
+
//#endregion
|
|
300
|
+
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/utils/path.mjs
|
|
301
|
+
function I(e) {
|
|
302
|
+
if (typeof e != "string") throw TypeError(`Path must be a string. Received ${JSON.stringify(e)}`);
|
|
303
|
+
}
|
|
304
|
+
function L(e) {
|
|
305
|
+
return e.split("?")[0].split("#")[0];
|
|
306
|
+
}
|
|
307
|
+
function R(e) {
|
|
308
|
+
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
309
|
+
}
|
|
310
|
+
function z(e, t, n) {
|
|
311
|
+
return e.replace(new RegExp(R(t), "g"), n);
|
|
312
|
+
}
|
|
313
|
+
function B(e, t) {
|
|
314
|
+
let n = "", r = 0, i = -1, a = 0, o = -1;
|
|
315
|
+
for (let s = 0; s <= e.length; ++s) {
|
|
316
|
+
if (s < e.length) o = e.charCodeAt(s);
|
|
317
|
+
else if (o === 47) break;
|
|
318
|
+
else o = 47;
|
|
319
|
+
if (o === 47) {
|
|
320
|
+
if (!(i === s - 1 || a === 1)) if (i !== s - 1 && a === 2) {
|
|
321
|
+
if (n.length < 2 || r !== 2 || n.charCodeAt(n.length - 1) !== 46 || n.charCodeAt(n.length - 2) !== 46) {
|
|
322
|
+
if (n.length > 2) {
|
|
323
|
+
let e = n.lastIndexOf("/");
|
|
324
|
+
if (e !== n.length - 1) {
|
|
325
|
+
e === -1 ? (n = "", r = 0) : (n = n.slice(0, e), r = n.length - 1 - n.lastIndexOf("/")), i = s, a = 0;
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
328
|
+
} else if (n.length === 2 || n.length === 1) {
|
|
329
|
+
n = "", r = 0, i = s, a = 0;
|
|
330
|
+
continue;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
t && (n.length > 0 ? n += "/.." : n = "..", r = 2);
|
|
334
|
+
} else n.length > 0 ? n += `/${e.slice(i + 1, s)}` : n = e.slice(i + 1, s), r = s - i - 1;
|
|
335
|
+
i = s, a = 0;
|
|
336
|
+
} else o === 46 && a !== -1 ? ++a : a = -1;
|
|
337
|
+
}
|
|
338
|
+
return n;
|
|
339
|
+
}
|
|
340
|
+
var V = {
|
|
341
|
+
toPosix(e) {
|
|
342
|
+
return z(e, "\\", "/");
|
|
343
|
+
},
|
|
344
|
+
isUrl(e) {
|
|
345
|
+
return /^https?:/.test(this.toPosix(e));
|
|
346
|
+
},
|
|
347
|
+
isDataUrl(e) {
|
|
348
|
+
return /^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(e);
|
|
349
|
+
},
|
|
350
|
+
isBlobUrl(e) {
|
|
351
|
+
return e.startsWith("blob:");
|
|
352
|
+
},
|
|
353
|
+
hasProtocol(e) {
|
|
354
|
+
return /^[^/:]+:/.test(this.toPosix(e));
|
|
355
|
+
},
|
|
356
|
+
getProtocol(e) {
|
|
357
|
+
I(e), e = this.toPosix(e);
|
|
358
|
+
let t = /^file:\/\/\//.exec(e);
|
|
359
|
+
if (t) return t[0];
|
|
360
|
+
let n = /^[^/:]+:\/{0,2}/.exec(e);
|
|
361
|
+
return n ? n[0] : "";
|
|
362
|
+
},
|
|
363
|
+
toAbsolute(e, t, n) {
|
|
364
|
+
if (I(e), this.isDataUrl(e) || this.isBlobUrl(e)) return e;
|
|
365
|
+
let r = L(this.toPosix(t ?? d.get().getBaseUrl())), i = L(this.toPosix(n ?? this.rootname(r)));
|
|
366
|
+
return e = this.toPosix(e), e.startsWith("/") ? V.join(i, e.slice(1)) : this.isAbsolute(e) ? e : this.join(r, e);
|
|
367
|
+
},
|
|
368
|
+
normalize(e) {
|
|
369
|
+
if (I(e), e.length === 0) return ".";
|
|
370
|
+
if (this.isDataUrl(e) || this.isBlobUrl(e)) return e;
|
|
371
|
+
e = this.toPosix(e);
|
|
372
|
+
let t = "", n = e.startsWith("/");
|
|
373
|
+
this.hasProtocol(e) && (t = this.rootname(e), e = e.slice(t.length));
|
|
374
|
+
let r = e.endsWith("/");
|
|
375
|
+
return e = B(e, !1), e.length > 0 && r && (e += "/"), n ? `/${e}` : t + e;
|
|
376
|
+
},
|
|
377
|
+
isAbsolute(e) {
|
|
378
|
+
return I(e), e = this.toPosix(e), this.hasProtocol(e) ? !0 : e.startsWith("/");
|
|
379
|
+
},
|
|
380
|
+
join(...e) {
|
|
381
|
+
if (e.length === 0) return ".";
|
|
382
|
+
let t;
|
|
383
|
+
for (let n = 0; n < e.length; ++n) {
|
|
384
|
+
let r = e[n];
|
|
385
|
+
if (I(r), r.length > 0) if (t === void 0) t = r;
|
|
386
|
+
else {
|
|
387
|
+
let i = e[n - 1] ?? "";
|
|
388
|
+
this.joinExtensions.includes(this.extname(i).toLowerCase()) ? t += `/../${r}` : t += `/${r}`;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
return t === void 0 ? "." : this.normalize(t);
|
|
392
|
+
},
|
|
393
|
+
dirname(e) {
|
|
394
|
+
if (I(e), e.length === 0) return ".";
|
|
395
|
+
e = this.toPosix(e);
|
|
396
|
+
let t = e.charCodeAt(0), n = t === 47, r = -1, i = !0, a = this.getProtocol(e), o = e;
|
|
397
|
+
e = e.slice(a.length);
|
|
398
|
+
for (let n = e.length - 1; n >= 1; --n) if (t = e.charCodeAt(n), t === 47) {
|
|
399
|
+
if (!i) {
|
|
400
|
+
r = n;
|
|
401
|
+
break;
|
|
402
|
+
}
|
|
403
|
+
} else i = !1;
|
|
404
|
+
return r === -1 ? n ? "/" : this.isUrl(o) ? a + e : a : n && r === 1 ? "//" : a + e.slice(0, r);
|
|
405
|
+
},
|
|
406
|
+
rootname(e) {
|
|
407
|
+
I(e), e = this.toPosix(e);
|
|
408
|
+
let t = "";
|
|
409
|
+
if (t = e.startsWith("/") ? "/" : this.getProtocol(e), this.isUrl(e)) {
|
|
410
|
+
let n = e.indexOf("/", t.length);
|
|
411
|
+
t = n === -1 ? e : e.slice(0, n), t.endsWith("/") || (t += "/");
|
|
412
|
+
}
|
|
413
|
+
return t;
|
|
414
|
+
},
|
|
415
|
+
basename(e, t) {
|
|
416
|
+
I(e), t && I(t), e = L(this.toPosix(e));
|
|
417
|
+
let n = 0, r = -1, i = !0, a;
|
|
418
|
+
if (t !== void 0 && t.length > 0 && t.length <= e.length) {
|
|
419
|
+
if (t.length === e.length && t === e) return "";
|
|
420
|
+
let o = t.length - 1, s = -1;
|
|
421
|
+
for (a = e.length - 1; a >= 0; --a) {
|
|
422
|
+
let c = e.charCodeAt(a);
|
|
423
|
+
if (c === 47) {
|
|
424
|
+
if (!i) {
|
|
425
|
+
n = a + 1;
|
|
426
|
+
break;
|
|
427
|
+
}
|
|
428
|
+
} else s === -1 && (i = !1, s = a + 1), o >= 0 && (c === t.charCodeAt(o) ? --o === -1 && (r = a) : (o = -1, r = s));
|
|
429
|
+
}
|
|
430
|
+
return n === r ? r = s : r === -1 && (r = e.length), e.slice(n, r);
|
|
431
|
+
}
|
|
432
|
+
for (a = e.length - 1; a >= 0; --a) if (e.charCodeAt(a) === 47) {
|
|
433
|
+
if (!i) {
|
|
434
|
+
n = a + 1;
|
|
435
|
+
break;
|
|
436
|
+
}
|
|
437
|
+
} else r === -1 && (i = !1, r = a + 1);
|
|
438
|
+
return r === -1 ? "" : e.slice(n, r);
|
|
439
|
+
},
|
|
440
|
+
extname(e) {
|
|
441
|
+
I(e), e = L(this.toPosix(e));
|
|
442
|
+
let t = -1, n = 0, r = -1, i = !0, a = 0;
|
|
443
|
+
for (let o = e.length - 1; o >= 0; --o) {
|
|
444
|
+
let s = e.charCodeAt(o);
|
|
445
|
+
if (s === 47) {
|
|
446
|
+
if (!i) {
|
|
447
|
+
n = o + 1;
|
|
448
|
+
break;
|
|
449
|
+
}
|
|
450
|
+
continue;
|
|
451
|
+
}
|
|
452
|
+
r === -1 && (i = !1, r = o + 1), s === 46 ? t === -1 ? t = o : a !== 1 && (a = 1) : t !== -1 && (a = -1);
|
|
453
|
+
}
|
|
454
|
+
return t === -1 || r === -1 || a === 0 || a === 1 && t === r - 1 && t === n + 1 ? "" : e.slice(t, r);
|
|
455
|
+
},
|
|
456
|
+
parse(e) {
|
|
457
|
+
I(e);
|
|
458
|
+
let t = {
|
|
459
|
+
root: "",
|
|
460
|
+
dir: "",
|
|
461
|
+
base: "",
|
|
462
|
+
ext: "",
|
|
463
|
+
name: ""
|
|
464
|
+
};
|
|
465
|
+
if (e.length === 0) return t;
|
|
466
|
+
e = L(this.toPosix(e));
|
|
467
|
+
let n = e.charCodeAt(0), r = this.isAbsolute(e), i;
|
|
468
|
+
t.root = this.rootname(e), i = r || this.hasProtocol(e) ? 1 : 0;
|
|
469
|
+
let a = -1, o = 0, s = -1, c = !0, l = e.length - 1, u = 0;
|
|
470
|
+
for (; l >= i; --l) {
|
|
471
|
+
if (n = e.charCodeAt(l), n === 47) {
|
|
472
|
+
if (!c) {
|
|
473
|
+
o = l + 1;
|
|
474
|
+
break;
|
|
475
|
+
}
|
|
476
|
+
continue;
|
|
477
|
+
}
|
|
478
|
+
s === -1 && (c = !1, s = l + 1), n === 46 ? a === -1 ? a = l : u !== 1 && (u = 1) : a !== -1 && (u = -1);
|
|
479
|
+
}
|
|
480
|
+
return a === -1 || s === -1 || u === 0 || u === 1 && a === s - 1 && a === o + 1 ? s !== -1 && (o === 0 && r ? t.base = t.name = e.slice(1, s) : t.base = t.name = e.slice(o, s)) : (o === 0 && r ? (t.name = e.slice(1, a), t.base = e.slice(1, s)) : (t.name = e.slice(o, a), t.base = e.slice(o, s)), t.ext = e.slice(a, s)), t.dir = this.dirname(e), t;
|
|
481
|
+
},
|
|
482
|
+
sep: "/",
|
|
483
|
+
delimiter: ":",
|
|
484
|
+
joinExtensions: [".html"]
|
|
485
|
+
};
|
|
486
|
+
//#endregion
|
|
487
|
+
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/assets/utils/createStringVariations.mjs
|
|
488
|
+
function H(e, t, n, r, i) {
|
|
489
|
+
let a = t[n];
|
|
490
|
+
for (let o = 0; o < a.length; o++) {
|
|
491
|
+
let s = a[o];
|
|
492
|
+
n < t.length - 1 ? H(e.replace(r[n], s), t, n + 1, r, i) : i.push(e.replace(r[n], s));
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
function U(e) {
|
|
496
|
+
let t = e.match(/\{(.*?)\}/g), n = [];
|
|
497
|
+
if (t) {
|
|
498
|
+
let r = [];
|
|
499
|
+
t.forEach((e) => {
|
|
500
|
+
let t = e.substring(1, e.length - 1).split(",");
|
|
501
|
+
r.push(t);
|
|
502
|
+
}), H(e, r, 0, t, n);
|
|
503
|
+
} else n.push(e);
|
|
504
|
+
return n;
|
|
505
|
+
}
|
|
506
|
+
//#endregion
|
|
507
|
+
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/assets/utils/isSingleItem.mjs
|
|
508
|
+
var W = (e) => !Array.isArray(e), G = class {
|
|
509
|
+
constructor() {
|
|
510
|
+
this._defaultBundleIdentifierOptions = {
|
|
511
|
+
connector: "-",
|
|
512
|
+
createBundleAssetId: (e, t) => `${e}${this._bundleIdConnector}${t}`,
|
|
513
|
+
extractAssetIdFromBundle: (e, t) => t.replace(`${e}${this._bundleIdConnector}`, "")
|
|
514
|
+
}, this._bundleIdConnector = this._defaultBundleIdentifierOptions.connector, this._createBundleAssetId = this._defaultBundleIdentifierOptions.createBundleAssetId, this._extractAssetIdFromBundle = this._defaultBundleIdentifierOptions.extractAssetIdFromBundle, this._assetMap = {}, this._preferredOrder = [], this._parsers = [], this._resolverHash = {}, this._bundles = {};
|
|
515
|
+
}
|
|
516
|
+
setBundleIdentifier(e) {
|
|
517
|
+
if (this._bundleIdConnector = e.connector ?? this._bundleIdConnector, this._createBundleAssetId = e.createBundleAssetId ?? this._createBundleAssetId, this._extractAssetIdFromBundle = e.extractAssetIdFromBundle ?? this._extractAssetIdFromBundle, this._extractAssetIdFromBundle("foo", this._createBundleAssetId("foo", "bar")) !== "bar") throw Error("[Resolver] GenerateBundleAssetId are not working correctly");
|
|
518
|
+
}
|
|
519
|
+
prefer(...e) {
|
|
520
|
+
e.forEach((e) => {
|
|
521
|
+
this._preferredOrder.push(e), e.priority ||= Object.keys(e.params);
|
|
522
|
+
}), this._resolverHash = {};
|
|
523
|
+
}
|
|
524
|
+
set basePath(e) {
|
|
525
|
+
this._basePath = e;
|
|
526
|
+
}
|
|
527
|
+
get basePath() {
|
|
528
|
+
return this._basePath;
|
|
529
|
+
}
|
|
530
|
+
set rootPath(e) {
|
|
531
|
+
this._rootPath = e;
|
|
532
|
+
}
|
|
533
|
+
get rootPath() {
|
|
534
|
+
return this._rootPath;
|
|
535
|
+
}
|
|
536
|
+
get parsers() {
|
|
537
|
+
return this._parsers;
|
|
538
|
+
}
|
|
539
|
+
reset() {
|
|
540
|
+
this.setBundleIdentifier(this._defaultBundleIdentifierOptions), this._assetMap = {}, this._preferredOrder = [], this._resolverHash = {}, this._rootPath = null, this._basePath = null, this._manifest = null, this._bundles = {}, this._defaultSearchParams = null;
|
|
541
|
+
}
|
|
542
|
+
setDefaultSearchParams(e) {
|
|
543
|
+
if (typeof e == "string") this._defaultSearchParams = e;
|
|
544
|
+
else {
|
|
545
|
+
let t = e;
|
|
546
|
+
this._defaultSearchParams = Object.keys(t).map((e) => `${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&");
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
getAlias(e) {
|
|
550
|
+
let { alias: t, src: n } = e;
|
|
551
|
+
return k(t || n, (e) => typeof e == "string" ? e : Array.isArray(e) ? e.map((e) => e?.src ?? e) : e?.src ? e.src : e, !0);
|
|
552
|
+
}
|
|
553
|
+
removeAlias(e, t) {
|
|
554
|
+
this._assetMap[e] && (t && t !== this._resolverHash[e] || (delete this._resolverHash[e], delete this._assetMap[e]));
|
|
555
|
+
}
|
|
556
|
+
addManifest(e) {
|
|
557
|
+
this._manifest && o("[Resolver] Manifest already exists, this will be overwritten"), this._manifest = e, e.bundles.forEach((e) => {
|
|
558
|
+
this.addBundle(e.name, e.assets);
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
addBundle(e, t) {
|
|
562
|
+
let n = [], r = t;
|
|
563
|
+
Array.isArray(t) || (r = Object.entries(t).map(([e, t]) => typeof t == "string" || Array.isArray(t) ? {
|
|
564
|
+
alias: e,
|
|
565
|
+
src: t
|
|
566
|
+
} : {
|
|
567
|
+
alias: e,
|
|
568
|
+
...t
|
|
569
|
+
})), r.forEach((t) => {
|
|
570
|
+
let r = t.src, i = t.alias, a;
|
|
571
|
+
if (typeof i == "string") {
|
|
572
|
+
let t = this._createBundleAssetId(e, i);
|
|
573
|
+
n.push(t), a = [i, t];
|
|
574
|
+
} else {
|
|
575
|
+
let t = i.map((t) => this._createBundleAssetId(e, t));
|
|
576
|
+
n.push(...t), a = [...i, ...t];
|
|
577
|
+
}
|
|
578
|
+
this.add({
|
|
579
|
+
...t,
|
|
580
|
+
alias: a,
|
|
581
|
+
src: r
|
|
582
|
+
});
|
|
583
|
+
}), this._bundles[e] = n;
|
|
584
|
+
}
|
|
585
|
+
add(e) {
|
|
586
|
+
let t = [];
|
|
587
|
+
Array.isArray(e) ? t.push(...e) : t.push(e);
|
|
588
|
+
let n = (e) => {
|
|
589
|
+
this.hasKey(e) && o(`[Resolver] already has key: ${e} overwriting`);
|
|
590
|
+
};
|
|
591
|
+
k(t).forEach((e) => {
|
|
592
|
+
let { src: t } = e, { data: r, format: i, loadParser: a, parser: o } = e, s = k(t).map((e) => typeof e == "string" ? U(e) : Array.isArray(e) ? e : [e]), c = this.getAlias(e);
|
|
593
|
+
Array.isArray(c) ? c.forEach(n) : n(c);
|
|
594
|
+
let l = [], u = (e) => ({
|
|
595
|
+
src: e,
|
|
596
|
+
...this._parsers.find((t) => t.test(e))?.parse(e)
|
|
597
|
+
});
|
|
598
|
+
s.forEach((t) => {
|
|
599
|
+
t.forEach((t) => {
|
|
600
|
+
let n = {};
|
|
601
|
+
if (typeof t == "object" ? (r = t.data ?? r, i = t.format ?? i, (t.loadParser || t.parser) && (a = t.loadParser ?? a, o = t.parser ?? o), n = {
|
|
602
|
+
...u(t.src),
|
|
603
|
+
...t
|
|
604
|
+
}) : n = u(t), !c) throw Error(`[Resolver] alias is undefined for this asset: ${n.src}`);
|
|
605
|
+
n = this._buildResolvedAsset(n, {
|
|
606
|
+
aliases: c,
|
|
607
|
+
data: r,
|
|
608
|
+
format: i,
|
|
609
|
+
loadParser: a,
|
|
610
|
+
parser: o,
|
|
611
|
+
progressSize: e.progressSize
|
|
612
|
+
}), l.push(n);
|
|
613
|
+
});
|
|
614
|
+
}), c.forEach((e) => {
|
|
615
|
+
this._assetMap[e] = l;
|
|
616
|
+
});
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
resolveBundle(e) {
|
|
620
|
+
let t = W(e);
|
|
621
|
+
e = k(e);
|
|
622
|
+
let n = {};
|
|
623
|
+
return e.forEach((e) => {
|
|
624
|
+
let t = this._bundles[e];
|
|
625
|
+
if (t) {
|
|
626
|
+
let r = this.resolve(t), i = {};
|
|
627
|
+
for (let t in r) {
|
|
628
|
+
let n = r[t];
|
|
629
|
+
i[this._extractAssetIdFromBundle(e, t)] = n;
|
|
630
|
+
}
|
|
631
|
+
n[e] = i;
|
|
632
|
+
}
|
|
633
|
+
}), t ? n[e[0]] : n;
|
|
634
|
+
}
|
|
635
|
+
resolveUrl(e) {
|
|
636
|
+
let t = this.resolve(e);
|
|
637
|
+
if (typeof e != "string") {
|
|
638
|
+
let e = {};
|
|
639
|
+
for (let n in t) e[n] = t[n].src;
|
|
640
|
+
return e;
|
|
641
|
+
}
|
|
642
|
+
return t.src;
|
|
643
|
+
}
|
|
644
|
+
resolve(e) {
|
|
645
|
+
let t = W(e);
|
|
646
|
+
e = k(e);
|
|
647
|
+
let n = {};
|
|
648
|
+
return e.forEach((e) => {
|
|
649
|
+
if (!this._resolverHash[e]) if (this._assetMap[e]) {
|
|
650
|
+
let t = this._assetMap[e], n = this._getPreferredOrder(t);
|
|
651
|
+
n?.priority.forEach((e) => {
|
|
652
|
+
n.params[e].forEach((n) => {
|
|
653
|
+
let r = t.filter((t) => t[e] ? t[e] === n : !1);
|
|
654
|
+
r.length && (t = r);
|
|
655
|
+
});
|
|
656
|
+
}), this._resolverHash[e] = t[0];
|
|
657
|
+
} else this._resolverHash[e] = this._buildResolvedAsset({
|
|
658
|
+
alias: [e],
|
|
659
|
+
src: e
|
|
660
|
+
}, {});
|
|
661
|
+
n[e] = this._resolverHash[e];
|
|
662
|
+
}), t ? n[e[0]] : n;
|
|
663
|
+
}
|
|
664
|
+
hasKey(e) {
|
|
665
|
+
return !!this._assetMap[e];
|
|
666
|
+
}
|
|
667
|
+
hasBundle(e) {
|
|
668
|
+
return !!this._bundles[e];
|
|
669
|
+
}
|
|
670
|
+
_getPreferredOrder(e) {
|
|
671
|
+
for (let t = 0; t < e.length; t++) {
|
|
672
|
+
let n = e[t], r = this._preferredOrder.find((e) => e.params.format.includes(n.format));
|
|
673
|
+
if (r) return r;
|
|
674
|
+
}
|
|
675
|
+
return this._preferredOrder[0];
|
|
676
|
+
}
|
|
677
|
+
_appendDefaultSearchParams(e) {
|
|
678
|
+
return this._defaultSearchParams ? `${e}${/\?/.test(e) ? "&" : "?"}${this._defaultSearchParams}` : e;
|
|
679
|
+
}
|
|
680
|
+
_buildResolvedAsset(e, t) {
|
|
681
|
+
let { aliases: n, data: r, loadParser: i, parser: a, format: o, progressSize: s } = t;
|
|
682
|
+
return (this._basePath || this._rootPath) && (e.src = V.toAbsolute(e.src, this._basePath, this._rootPath)), e.alias = n ?? e.alias ?? [e.src], e.src = this._appendDefaultSearchParams(e.src), e.data = {
|
|
683
|
+
...r || {},
|
|
684
|
+
...e.data
|
|
685
|
+
}, e.loadParser = i ?? e.loadParser, e.parser = a ?? e.parser, e.format = o ?? e.format ?? K(e.src), s !== void 0 && (e.progressSize = s), e;
|
|
686
|
+
}
|
|
687
|
+
};
|
|
688
|
+
G.RETINA_PREFIX = /@([0-9\.]+)x/;
|
|
689
|
+
function K(e) {
|
|
690
|
+
return e.split(".").pop().split("?").shift().split("#").shift();
|
|
691
|
+
}
|
|
692
|
+
//#endregion
|
|
693
|
+
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/assets/utils/copySearchParams.mjs
|
|
694
|
+
var q = (e, t) => {
|
|
695
|
+
let n = t.split("?")[1];
|
|
696
|
+
return n && (e += `?${n}`), e;
|
|
697
|
+
}, J = class e {
|
|
698
|
+
constructor(e, t) {
|
|
699
|
+
this.linkedSheets = [];
|
|
700
|
+
let n = e;
|
|
701
|
+
e?.source instanceof l && (n = {
|
|
702
|
+
texture: e,
|
|
703
|
+
data: t
|
|
704
|
+
});
|
|
705
|
+
let { texture: r, data: i, cachePrefix: a = "" } = n;
|
|
706
|
+
this.cachePrefix = a, this._texture = r instanceof c ? r : null, this.textureSource = r.source, this.textures = {}, this.animations = {}, this.data = i;
|
|
707
|
+
let o = parseFloat(i.meta.scale);
|
|
708
|
+
o ? (this.resolution = o, r.source.resolution = this.resolution) : this.resolution = r.source._resolution, this._frames = this.data.frames, this._frameKeys = Object.keys(this._frames), this._batchIndex = 0, this._callback = null;
|
|
709
|
+
}
|
|
710
|
+
parse() {
|
|
711
|
+
return new Promise((t) => {
|
|
712
|
+
this._callback = t, this._batchIndex = 0, this._frameKeys.length <= e.BATCH_SIZE ? (this._processFrames(0), this._processAnimations(), this._parseComplete()) : this._nextBatch();
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
parseSync() {
|
|
716
|
+
return this._processFrames(0, !0), this._processAnimations(), this.textures;
|
|
717
|
+
}
|
|
718
|
+
_processFrames(t, n = !1) {
|
|
719
|
+
let r = t, i = n ? Infinity : e.BATCH_SIZE;
|
|
720
|
+
for (; r - t < i && r < this._frameKeys.length;) {
|
|
721
|
+
let e = this._frameKeys[r], t = this._frames[e], n = t.frame;
|
|
722
|
+
if (n) {
|
|
723
|
+
let r = null, i = null, o = t.trimmed !== !1 && t.sourceSize ? t.sourceSize : t.frame, s = new a(0, 0, Math.floor(o.w) / this.resolution, Math.floor(o.h) / this.resolution);
|
|
724
|
+
r = t.rotated ? new a(Math.floor(n.x) / this.resolution, Math.floor(n.y) / this.resolution, Math.floor(n.h) / this.resolution, Math.floor(n.w) / this.resolution) : new a(Math.floor(n.x) / this.resolution, Math.floor(n.y) / this.resolution, Math.floor(n.w) / this.resolution, Math.floor(n.h) / this.resolution), t.trimmed !== !1 && t.spriteSourceSize && (i = new a(Math.floor(t.spriteSourceSize.x) / this.resolution, Math.floor(t.spriteSourceSize.y) / this.resolution, Math.floor(n.w) / this.resolution, Math.floor(n.h) / this.resolution)), this.textures[e] = new c({
|
|
725
|
+
source: this.textureSource,
|
|
726
|
+
frame: r,
|
|
727
|
+
orig: s,
|
|
728
|
+
trim: i,
|
|
729
|
+
rotate: t.rotated ? 2 : 0,
|
|
730
|
+
defaultAnchor: t.anchor,
|
|
731
|
+
defaultBorders: t.borders,
|
|
732
|
+
label: e.toString()
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
r++;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
_processAnimations() {
|
|
739
|
+
let e = this.data.animations || {};
|
|
740
|
+
for (let t in e) {
|
|
741
|
+
this.animations[t] = [];
|
|
742
|
+
for (let n = 0; n < e[t].length; n++) {
|
|
743
|
+
let r = e[t][n];
|
|
744
|
+
this.animations[t].push(this.textures[r]);
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
_parseComplete() {
|
|
749
|
+
let e = this._callback;
|
|
750
|
+
this._callback = null, this._batchIndex = 0, e.call(this, this.textures);
|
|
751
|
+
}
|
|
752
|
+
_nextBatch() {
|
|
753
|
+
this._processFrames(this._batchIndex * e.BATCH_SIZE), this._batchIndex++, setTimeout(() => {
|
|
754
|
+
this._batchIndex * e.BATCH_SIZE < this._frameKeys.length ? this._nextBatch() : (this._processAnimations(), this._parseComplete());
|
|
755
|
+
}, 0);
|
|
756
|
+
}
|
|
757
|
+
destroy(e = !1) {
|
|
758
|
+
for (let e in this.textures) this.textures[e].destroy();
|
|
759
|
+
this._frames = null, this._frameKeys = null, this.data = null, this.textures = null, e && (this._texture?.destroy(), this.textureSource.destroy()), this._texture = null, this.textureSource = null, this.linkedSheets = [];
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
J.BATCH_SIZE = 1e3;
|
|
763
|
+
var Y = J, X = [
|
|
764
|
+
"jpg",
|
|
765
|
+
"png",
|
|
766
|
+
"jpeg",
|
|
767
|
+
"avif",
|
|
768
|
+
"webp",
|
|
769
|
+
"basis",
|
|
770
|
+
"etc2",
|
|
771
|
+
"bc7",
|
|
772
|
+
"bc6h",
|
|
773
|
+
"bc5",
|
|
774
|
+
"bc4",
|
|
775
|
+
"bc3",
|
|
776
|
+
"bc2",
|
|
777
|
+
"bc1",
|
|
778
|
+
"eac",
|
|
779
|
+
"astc"
|
|
780
|
+
];
|
|
781
|
+
function Z(e, t, n) {
|
|
782
|
+
let r = {};
|
|
783
|
+
if (e.forEach((e) => {
|
|
784
|
+
r[e] = t;
|
|
785
|
+
}), Object.keys(t.textures).forEach((e) => {
|
|
786
|
+
r[`${t.cachePrefix}${e}`] = t.textures[e];
|
|
787
|
+
}), !n) {
|
|
788
|
+
let n = V.dirname(e[0]);
|
|
789
|
+
t.linkedSheets.forEach((e, i) => {
|
|
790
|
+
let a = Z([`${n}/${t.data.meta.related_multi_packs[i]}`], e, !0);
|
|
791
|
+
Object.assign(r, a);
|
|
792
|
+
});
|
|
793
|
+
}
|
|
794
|
+
return r;
|
|
795
|
+
}
|
|
796
|
+
var Q = {
|
|
797
|
+
extension: m.Asset,
|
|
798
|
+
cache: {
|
|
799
|
+
test: (e) => e instanceof Y,
|
|
800
|
+
getCacheableAssets: (e, t) => Z(e, t, !1)
|
|
801
|
+
},
|
|
802
|
+
resolver: {
|
|
803
|
+
extension: {
|
|
804
|
+
type: m.ResolveParser,
|
|
805
|
+
name: "resolveSpritesheet"
|
|
806
|
+
},
|
|
807
|
+
test: (e) => {
|
|
808
|
+
let t = e.split("?")[0].split("."), n = t.pop(), r = t.pop();
|
|
809
|
+
return n === "json" && X.includes(r);
|
|
810
|
+
},
|
|
811
|
+
parse: (e) => {
|
|
812
|
+
let t = e.split(".");
|
|
813
|
+
return {
|
|
814
|
+
resolution: parseFloat(G.RETINA_PREFIX.exec(e)?.[1] ?? "1"),
|
|
815
|
+
format: t[t.length - 2],
|
|
816
|
+
src: e
|
|
817
|
+
};
|
|
818
|
+
}
|
|
819
|
+
},
|
|
820
|
+
loader: {
|
|
821
|
+
name: "spritesheetLoader",
|
|
822
|
+
id: "spritesheet",
|
|
823
|
+
extension: {
|
|
824
|
+
type: m.LoadParser,
|
|
825
|
+
priority: F.Normal,
|
|
826
|
+
name: "spritesheetLoader"
|
|
827
|
+
},
|
|
828
|
+
async testParse(e, t) {
|
|
829
|
+
return V.extname(t.src).toLowerCase() === ".json" && !!e.frames;
|
|
830
|
+
},
|
|
831
|
+
async parse(e, t, n) {
|
|
832
|
+
let { texture: r, imageFilename: i, textureOptions: a, cachePrefix: o } = t?.data ?? {}, s = V.dirname(t.src);
|
|
833
|
+
s && s.lastIndexOf("/") !== s.length - 1 && (s += "/");
|
|
834
|
+
let l;
|
|
835
|
+
if (r instanceof c) l = r;
|
|
836
|
+
else {
|
|
837
|
+
let r = q(s + (i ?? e.meta.image), t.src);
|
|
838
|
+
l = (await n.load([{
|
|
839
|
+
src: r,
|
|
840
|
+
data: a
|
|
841
|
+
}]))[r];
|
|
842
|
+
}
|
|
843
|
+
let u = new Y({
|
|
844
|
+
texture: l.source,
|
|
845
|
+
data: e,
|
|
846
|
+
cachePrefix: o
|
|
847
|
+
});
|
|
848
|
+
await u.parse();
|
|
849
|
+
let d = e?.meta?.related_multi_packs;
|
|
850
|
+
if (Array.isArray(d)) {
|
|
851
|
+
let e = [];
|
|
852
|
+
for (let r of d) {
|
|
853
|
+
if (typeof r != "string") continue;
|
|
854
|
+
let i = s + r;
|
|
855
|
+
t.data?.ignoreMultiPack || (i = q(i, t.src), e.push(n.load({
|
|
856
|
+
src: i,
|
|
857
|
+
data: {
|
|
858
|
+
textureOptions: a,
|
|
859
|
+
ignoreMultiPack: !0
|
|
860
|
+
}
|
|
861
|
+
})));
|
|
862
|
+
}
|
|
863
|
+
let r = await Promise.all(e);
|
|
864
|
+
u.linkedSheets = r, r.forEach((e) => {
|
|
865
|
+
e.linkedSheets = [u].concat(u.linkedSheets.filter((t) => t !== e));
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
return u;
|
|
869
|
+
},
|
|
870
|
+
async unload(e, t, n) {
|
|
871
|
+
await n.unload(e.textureSource._sourceOrigin), e.destroy(!1);
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
};
|
|
875
|
+
//#endregion
|
|
876
|
+
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/spritesheet/init.mjs
|
|
877
|
+
f.add(Q);
|
|
878
|
+
//#endregion
|