@idetik/core 0.24.1 → 0.25.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/dist/assets/worker_kernel-CBlE4MBI.js.map +1 -1
- package/dist/index.d.ts +10 -11
- package/dist/index.js +490 -519
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +21 -21
- package/dist/index.umd.cjs.map +1 -1
- package/dist/types/src/core/layer.d.ts +1 -1
- package/dist/types/src/core/layer.d.ts.map +1 -1
- package/dist/types/src/data/chunk.d.ts +1 -1
- package/dist/types/src/data/chunk.d.ts.map +1 -1
- package/dist/types/src/data/chunk_manager.d.ts +1 -3
- package/dist/types/src/data/chunk_manager.d.ts.map +1 -1
- package/dist/types/src/data/chunk_store.d.ts +1 -1
- package/dist/types/src/data/chunk_store.d.ts.map +1 -1
- package/dist/types/src/data/ome_zarr/image_source.d.ts +3 -2
- package/dist/types/src/data/ome_zarr/image_source.d.ts.map +1 -1
- package/dist/types/src/layers/image_layer.d.ts +1 -1
- package/dist/types/src/layers/image_layer.d.ts.map +1 -1
- package/dist/types/src/layers/label_layer.d.ts +1 -1
- package/dist/types/src/layers/label_layer.d.ts.map +1 -1
- package/dist/types/src/layers/volume_layer.d.ts +1 -1
- package/dist/types/src/layers/volume_layer.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -173,7 +173,7 @@ uniform float u_opacity;
|
|
|
173
173
|
|
|
174
174
|
void main() {
|
|
175
175
|
fragColor = vec4(LineColor, u_opacity);
|
|
176
|
-
}`,
|
|
176
|
+
}`, _I = `#version 300 es
|
|
177
177
|
|
|
178
178
|
layout (location = 0) in vec3 inPosition;
|
|
179
179
|
layout (location = 1) in vec3 inNormal;
|
|
@@ -187,7 +187,7 @@ out vec2 TexCoords;
|
|
|
187
187
|
void main() {
|
|
188
188
|
TexCoords = inUV;
|
|
189
189
|
gl_Position = Projection * ModelView * vec4(inPosition, 1.0);
|
|
190
|
-
}`,
|
|
190
|
+
}`, Mg = `#version 300 es
|
|
191
191
|
#pragma inject_defines
|
|
192
192
|
|
|
193
193
|
precision mediump float;
|
|
@@ -274,7 +274,7 @@ uniform vec3 u_color;
|
|
|
274
274
|
|
|
275
275
|
void main() {
|
|
276
276
|
fragColor = vec4(u_color, u_opacity);
|
|
277
|
-
}`,
|
|
277
|
+
}`, fg = `#version 300 es
|
|
278
278
|
|
|
279
279
|
precision highp float;
|
|
280
280
|
|
|
@@ -287,7 +287,7 @@ out highp vec3 PositionModel;
|
|
|
287
287
|
void main() {
|
|
288
288
|
PositionModel = inPosition;
|
|
289
289
|
gl_Position = Projection * ModelView * vec4(inPosition, 1.0);
|
|
290
|
-
}`,
|
|
290
|
+
}`, ug = `#version 300 es
|
|
291
291
|
#pragma inject_defines
|
|
292
292
|
precision highp float;
|
|
293
293
|
|
|
@@ -533,35 +533,35 @@ const dE = {
|
|
|
533
533
|
fragment: kE
|
|
534
534
|
},
|
|
535
535
|
floatScalarImage: {
|
|
536
|
-
vertex:
|
|
537
|
-
fragment:
|
|
536
|
+
vertex: _I,
|
|
537
|
+
fragment: Mg
|
|
538
538
|
},
|
|
539
539
|
intScalarImage: {
|
|
540
|
-
vertex:
|
|
541
|
-
fragment:
|
|
540
|
+
vertex: _I,
|
|
541
|
+
fragment: Mg,
|
|
542
542
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
|
|
543
543
|
},
|
|
544
544
|
uintScalarImage: {
|
|
545
|
-
vertex:
|
|
546
|
-
fragment:
|
|
545
|
+
vertex: _I,
|
|
546
|
+
fragment: Mg,
|
|
547
547
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
|
|
548
548
|
},
|
|
549
549
|
labelImage: {
|
|
550
|
-
vertex:
|
|
550
|
+
vertex: _I,
|
|
551
551
|
fragment: UE
|
|
552
552
|
},
|
|
553
553
|
floatVolume: {
|
|
554
|
-
vertex:
|
|
555
|
-
fragment:
|
|
554
|
+
vertex: fg,
|
|
555
|
+
fragment: ug
|
|
556
556
|
},
|
|
557
557
|
intVolume: {
|
|
558
|
-
vertex:
|
|
559
|
-
fragment:
|
|
558
|
+
vertex: fg,
|
|
559
|
+
fragment: ug,
|
|
560
560
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
|
|
561
561
|
},
|
|
562
562
|
uintVolume: {
|
|
563
|
-
vertex:
|
|
564
|
-
fragment:
|
|
563
|
+
vertex: fg,
|
|
564
|
+
fragment: ug,
|
|
565
565
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
|
|
566
566
|
}
|
|
567
567
|
}, iC = {
|
|
@@ -590,25 +590,25 @@ function LE() {
|
|
|
590
590
|
}
|
|
591
591
|
return "development";
|
|
592
592
|
}
|
|
593
|
-
class
|
|
593
|
+
class H {
|
|
594
594
|
static logLevel_ = LE() === "production" ? "warn" : "debug";
|
|
595
595
|
static setLogLevel(A) {
|
|
596
|
-
|
|
596
|
+
H.logLevel_ = A;
|
|
597
597
|
}
|
|
598
598
|
static debug(A, I, ...g) {
|
|
599
|
-
|
|
599
|
+
H.log("debug", A, I, ...g);
|
|
600
600
|
}
|
|
601
601
|
static info(A, I, ...g) {
|
|
602
|
-
|
|
602
|
+
H.log("info", A, I, ...g);
|
|
603
603
|
}
|
|
604
604
|
static warn(A, I, ...g) {
|
|
605
|
-
|
|
605
|
+
H.log("warn", A, I, ...g);
|
|
606
606
|
}
|
|
607
607
|
static error(A, I, ...g) {
|
|
608
|
-
|
|
608
|
+
H.log("error", A, I, ...g);
|
|
609
609
|
}
|
|
610
610
|
static log(A, I, g, ...B) {
|
|
611
|
-
if (iC[A] < iC[
|
|
611
|
+
if (iC[A] < iC[H.logLevel_]) return;
|
|
612
612
|
const Q = (/* @__PURE__ */ new Date()).toISOString(), E = lE[A], i = `[${Q}][${A.toUpperCase()}][${I}]`, o = [`${E}${i}`, g, ...B];
|
|
613
613
|
switch (A) {
|
|
614
614
|
case "debug":
|
|
@@ -713,7 +713,7 @@ class JE {
|
|
|
713
713
|
`Unsupported uniform type "${g.type}" (GLenum) found in shader program for uniform "${g.name}"`
|
|
714
714
|
);
|
|
715
715
|
const B = this.gl_.getUniformLocation(this.program_, g.name);
|
|
716
|
-
B && (this.uniformInfo_.set(g.name, [B, g]),
|
|
716
|
+
B && (this.uniformInfo_.set(g.name, [B, g]), H.debug(
|
|
717
717
|
"WebGLShaderProgram",
|
|
718
718
|
"Uniform found:",
|
|
719
719
|
g.name,
|
|
@@ -776,7 +776,7 @@ const YE = typeof window < "u" ? [
|
|
|
776
776
|
WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_2D_ARRAY
|
|
777
777
|
] : [], ME = new Set(
|
|
778
778
|
YE
|
|
779
|
-
),
|
|
779
|
+
), Kg = "#pragma inject_defines";
|
|
780
780
|
class fE {
|
|
781
781
|
gl_;
|
|
782
782
|
programs_ = /* @__PURE__ */ new Map();
|
|
@@ -809,19 +809,19 @@ class fE {
|
|
|
809
809
|
}
|
|
810
810
|
function oC(C, A) {
|
|
811
811
|
if (A === void 0 || A.size == 0) return C;
|
|
812
|
-
if (!C.includes(
|
|
812
|
+
if (!C.includes(Kg))
|
|
813
813
|
throw new Error(
|
|
814
|
-
`Shader source does not contain "${
|
|
814
|
+
`Shader source does not contain "${Kg}" directive`
|
|
815
815
|
);
|
|
816
816
|
const I = Array(A.entries()).map(([E, i]) => `#define ${E} ${i}`).join(`
|
|
817
817
|
`), B = `#line __LINE__ + ${1 - A.size}`, Q = `${I}
|
|
818
818
|
${B}`;
|
|
819
|
-
return C.replace(
|
|
819
|
+
return C.replace(Kg, Q);
|
|
820
820
|
}
|
|
821
|
-
const
|
|
821
|
+
const XI = {};
|
|
822
822
|
function cQ(C) {
|
|
823
823
|
const A = C ?? "";
|
|
824
|
-
return
|
|
824
|
+
return XI[A] = (XI[A] ?? 0) + 1, C ? `${C}-${XI[A]}` : String(XI[A]);
|
|
825
825
|
}
|
|
826
826
|
class FB {
|
|
827
827
|
id = cQ();
|
|
@@ -845,20 +845,20 @@ function qE(C, A, I, g, B, Q, E, i, o, s, t, a, n, D, F, U) {
|
|
|
845
845
|
var S = new DA(16);
|
|
846
846
|
return S[0] = C, S[1] = A, S[2] = I, S[3] = g, S[4] = B, S[5] = Q, S[6] = E, S[7] = i, S[8] = o, S[9] = s, S[10] = t, S[11] = a, S[12] = n, S[13] = D, S[14] = F, S[15] = U, S;
|
|
847
847
|
}
|
|
848
|
-
function
|
|
849
|
-
var I = A[0], g = A[1], B = A[2], Q = A[3], E = A[4], i = A[5], o = A[6], s = A[7], t = A[8], a = A[9], n = A[10], D = A[11], F = A[12], U = A[13], S = A[14], d = A[15],
|
|
850
|
-
return oA ? (oA = 1 / oA, C[0] = (i * NA - o * SA + s * gA) * oA, C[1] = (B * SA - g * NA - Q * gA) * oA, C[2] = (U * W - S * M + d * L) * oA, C[3] = (n * M - a * W - D * L) * oA, C[4] = (o * $ - E * NA - s * CA) * oA, C[5] = (I * NA - B * $ + Q * CA) * oA, C[6] = (S * R - F * W - d * k) * oA, C[7] = (t * W - n * R + D * k) * oA, C[8] = (E * SA - i * $ + s * IA) * oA, C[9] = (g * $ - I * SA - Q * IA) * oA, C[10] = (F * M - U * R + d *
|
|
848
|
+
function Ug(C, A) {
|
|
849
|
+
var I = A[0], g = A[1], B = A[2], Q = A[3], E = A[4], i = A[5], o = A[6], s = A[7], t = A[8], a = A[9], n = A[10], D = A[11], F = A[12], U = A[13], S = A[14], d = A[15], K = I * i - g * E, k = I * o - B * E, R = I * s - Q * E, L = g * o - B * i, M = g * s - Q * i, W = B * s - Q * o, IA = t * U - a * F, CA = t * S - n * F, $ = t * d - D * F, gA = a * S - n * U, SA = a * d - D * U, NA = n * d - D * S, oA = K * NA - k * SA + R * gA + L * $ - M * CA + W * IA;
|
|
850
|
+
return oA ? (oA = 1 / oA, C[0] = (i * NA - o * SA + s * gA) * oA, C[1] = (B * SA - g * NA - Q * gA) * oA, C[2] = (U * W - S * M + d * L) * oA, C[3] = (n * M - a * W - D * L) * oA, C[4] = (o * $ - E * NA - s * CA) * oA, C[5] = (I * NA - B * $ + Q * CA) * oA, C[6] = (S * R - F * W - d * k) * oA, C[7] = (t * W - n * R + D * k) * oA, C[8] = (E * SA - i * $ + s * IA) * oA, C[9] = (g * $ - I * SA - Q * IA) * oA, C[10] = (F * M - U * R + d * K) * oA, C[11] = (a * R - t * M - D * K) * oA, C[12] = (i * CA - E * gA - o * IA) * oA, C[13] = (I * gA - g * CA + B * IA) * oA, C[14] = (U * k - F * L - S * K) * oA, C[15] = (t * L - a * k + n * K) * oA, C) : null;
|
|
851
851
|
}
|
|
852
852
|
function OA(C, A, I) {
|
|
853
|
-
var g = A[0], B = A[1], Q = A[2], E = A[3], i = A[4], o = A[5], s = A[6], t = A[7], a = A[8], n = A[9], D = A[10], F = A[11], U = A[12], S = A[13], d = A[14],
|
|
854
|
-
return C[0] = k * g + R * i + L * a + M * U, C[1] = k * B + R * o + L * n + M * S, C[2] = k * Q + R * s + L * D + M * d, C[3] = k * E + R * t + L * F + M *
|
|
853
|
+
var g = A[0], B = A[1], Q = A[2], E = A[3], i = A[4], o = A[5], s = A[6], t = A[7], a = A[8], n = A[9], D = A[10], F = A[11], U = A[12], S = A[13], d = A[14], K = A[15], k = I[0], R = I[1], L = I[2], M = I[3];
|
|
854
|
+
return C[0] = k * g + R * i + L * a + M * U, C[1] = k * B + R * o + L * n + M * S, C[2] = k * Q + R * s + L * D + M * d, C[3] = k * E + R * t + L * F + M * K, k = I[4], R = I[5], L = I[6], M = I[7], C[4] = k * g + R * i + L * a + M * U, C[5] = k * B + R * o + L * n + M * S, C[6] = k * Q + R * s + L * D + M * d, C[7] = k * E + R * t + L * F + M * K, k = I[8], R = I[9], L = I[10], M = I[11], C[8] = k * g + R * i + L * a + M * U, C[9] = k * B + R * o + L * n + M * S, C[10] = k * Q + R * s + L * D + M * d, C[11] = k * E + R * t + L * F + M * K, k = I[12], R = I[13], L = I[14], M = I[15], C[12] = k * g + R * i + L * a + M * U, C[13] = k * B + R * o + L * n + M * S, C[14] = k * Q + R * s + L * D + M * d, C[15] = k * E + R * t + L * F + M * K, C;
|
|
855
855
|
}
|
|
856
856
|
function pE(C, A) {
|
|
857
857
|
return C[0] = A[0], C[1] = 0, C[2] = 0, C[3] = 0, C[4] = 0, C[5] = A[1], C[6] = 0, C[7] = 0, C[8] = 0, C[9] = 0, C[10] = A[2], C[11] = 0, C[12] = 0, C[13] = 0, C[14] = 0, C[15] = 1, C;
|
|
858
858
|
}
|
|
859
859
|
function mE(C, A, I, g) {
|
|
860
|
-
var B = A[0], Q = A[1], E = A[2], i = A[3], o = B + B, s = Q + Q, t = E + E, a = B * o, n = B * s, D = B * t, F = Q * s, U = Q * t, S = E * t, d = i * o,
|
|
861
|
-
return C[0] = (1 - (F + S)) * R, C[1] = (n + k) * R, C[2] = (D -
|
|
860
|
+
var B = A[0], Q = A[1], E = A[2], i = A[3], o = B + B, s = Q + Q, t = E + E, a = B * o, n = B * s, D = B * t, F = Q * s, U = Q * t, S = E * t, d = i * o, K = i * s, k = i * t, R = g[0], L = g[1], M = g[2];
|
|
861
|
+
return C[0] = (1 - (F + S)) * R, C[1] = (n + k) * R, C[2] = (D - K) * R, C[3] = 0, C[4] = (n - k) * L, C[5] = (1 - (a + S)) * L, C[6] = (U + d) * L, C[7] = 0, C[8] = (D + K) * M, C[9] = (U - d) * M, C[10] = (1 - (a + F)) * M, C[11] = 0, C[12] = I[0], C[13] = I[1], C[14] = I[2], C[15] = 1, C;
|
|
862
862
|
}
|
|
863
863
|
function xE(C, A, I, g, B) {
|
|
864
864
|
var Q = 1 / Math.tan(A / 2);
|
|
@@ -882,8 +882,8 @@ function vE(C, A, I, g) {
|
|
|
882
882
|
return D = F * F + U * U + S * S, D > 0 && (D = 1 / Math.sqrt(D), F *= D, U *= D, S *= D), C[0] = F, C[1] = U, C[2] = S, C[3] = 0, C[4] = a * S - n * U, C[5] = n * F - t * S, C[6] = t * U - a * F, C[7] = 0, C[8] = t, C[9] = a, C[10] = n, C[11] = 0, C[12] = B, C[13] = Q, C[14] = E, C[15] = 1, C;
|
|
883
883
|
}
|
|
884
884
|
function ZE(C, A) {
|
|
885
|
-
var I = C[0], g = C[1], B = C[2], Q = C[3], E = C[4], i = C[5], o = C[6], s = C[7], t = C[8], a = C[9], n = C[10], D = C[11], F = C[12], U = C[13], S = C[14], d = C[15],
|
|
886
|
-
return Math.abs(I -
|
|
885
|
+
var I = C[0], g = C[1], B = C[2], Q = C[3], E = C[4], i = C[5], o = C[6], s = C[7], t = C[8], a = C[9], n = C[10], D = C[11], F = C[12], U = C[13], S = C[14], d = C[15], K = A[0], k = A[1], R = A[2], L = A[3], M = A[4], W = A[5], IA = A[6], CA = A[7], $ = A[8], gA = A[9], SA = A[10], NA = A[11], oA = A[12], CC = A[13], QC = A[14], EC = A[15];
|
|
886
|
+
return Math.abs(I - K) <= AA * Math.max(1, Math.abs(I), Math.abs(K)) && Math.abs(g - k) <= AA * Math.max(1, Math.abs(g), Math.abs(k)) && Math.abs(B - R) <= AA * Math.max(1, Math.abs(B), Math.abs(R)) && Math.abs(Q - L) <= AA * Math.max(1, Math.abs(Q), Math.abs(L)) && Math.abs(E - M) <= AA * Math.max(1, Math.abs(E), Math.abs(M)) && Math.abs(i - W) <= AA * Math.max(1, Math.abs(i), Math.abs(W)) && Math.abs(o - IA) <= AA * Math.max(1, Math.abs(o), Math.abs(IA)) && Math.abs(s - CA) <= AA * Math.max(1, Math.abs(s), Math.abs(CA)) && Math.abs(t - $) <= AA * Math.max(1, Math.abs(t), Math.abs($)) && Math.abs(a - gA) <= AA * Math.max(1, Math.abs(a), Math.abs(gA)) && Math.abs(n - SA) <= AA * Math.max(1, Math.abs(n), Math.abs(SA)) && Math.abs(D - NA) <= AA * Math.max(1, Math.abs(D), Math.abs(NA)) && Math.abs(F - oA) <= AA * Math.max(1, Math.abs(F), Math.abs(oA)) && Math.abs(U - CC) <= AA * Math.max(1, Math.abs(U), Math.abs(CC)) && Math.abs(S - QC) <= AA * Math.max(1, Math.abs(S), Math.abs(QC)) && Math.abs(d - EC) <= AA * Math.max(1, Math.abs(d), Math.abs(EC));
|
|
887
887
|
}
|
|
888
888
|
function EA() {
|
|
889
889
|
var C = new DA(3);
|
|
@@ -901,13 +901,13 @@ function P(C, A, I) {
|
|
|
901
901
|
var g = new DA(3);
|
|
902
902
|
return g[0] = C, g[1] = A, g[2] = I, g;
|
|
903
903
|
}
|
|
904
|
-
function
|
|
904
|
+
function AB(C, A) {
|
|
905
905
|
return C[0] = A[0], C[1] = A[1], C[2] = A[2], C;
|
|
906
906
|
}
|
|
907
907
|
function AI(C, A, I, g) {
|
|
908
908
|
return C[0] = A, C[1] = I, C[2] = g, C;
|
|
909
909
|
}
|
|
910
|
-
function
|
|
910
|
+
function qI(C, A, I) {
|
|
911
911
|
return C[0] = A[0] + I[0], C[1] = A[1] + I[1], C[2] = A[2] + I[2], C;
|
|
912
912
|
}
|
|
913
913
|
function PE(C, A, I) {
|
|
@@ -916,7 +916,7 @@ function PE(C, A, I) {
|
|
|
916
916
|
function VE(C, A, I) {
|
|
917
917
|
return C[0] = A[0] * I[0], C[1] = A[1] * I[1], C[2] = A[2] * I[2], C;
|
|
918
918
|
}
|
|
919
|
-
function
|
|
919
|
+
function pI(C, A, I) {
|
|
920
920
|
return C[0] = A[0] * I, C[1] = A[1] * I, C[2] = A[2] * I, C;
|
|
921
921
|
}
|
|
922
922
|
function sC(C, A, I, g) {
|
|
@@ -933,7 +933,7 @@ function OE(C, A) {
|
|
|
933
933
|
function GQ(C, A) {
|
|
934
934
|
return C[0] * A[0] + C[1] * A[1] + C[2] * A[2];
|
|
935
935
|
}
|
|
936
|
-
function
|
|
936
|
+
function Hg(C, A, I) {
|
|
937
937
|
var g = A[0], B = A[1], Q = A[2], E = I[0], i = I[1], o = I[2];
|
|
938
938
|
return C[0] = B * o - Q * i, C[1] = Q * E - g * o, C[2] = g * i - B * E, C;
|
|
939
939
|
}
|
|
@@ -948,7 +948,7 @@ function RB(C, A) {
|
|
|
948
948
|
var I = C[0], g = C[1], B = C[2], Q = A[0], E = A[1], i = A[2];
|
|
949
949
|
return Math.abs(I - Q) <= AA * Math.max(1, Math.abs(I), Math.abs(Q)) && Math.abs(g - E) <= AA * Math.max(1, Math.abs(g), Math.abs(E)) && Math.abs(B - i) <= AA * Math.max(1, Math.abs(B), Math.abs(i));
|
|
950
950
|
}
|
|
951
|
-
var
|
|
951
|
+
var IB = PE, XE = SB;
|
|
952
952
|
(function() {
|
|
953
953
|
var C = EA();
|
|
954
954
|
return function(A, I, g, B, Q, E) {
|
|
@@ -966,7 +966,7 @@ function jE(C) {
|
|
|
966
966
|
var A = new DA(4);
|
|
967
967
|
return A[0] = C[0], A[1] = C[1], A[2] = C[2], A[3] = C[3], A;
|
|
968
968
|
}
|
|
969
|
-
function
|
|
969
|
+
function Cg(C, A, I, g) {
|
|
970
970
|
var B = new DA(4);
|
|
971
971
|
return B[0] = C, B[1] = A, B[2] = I, B[3] = g, B;
|
|
972
972
|
}
|
|
@@ -980,7 +980,7 @@ function Ai(C, A) {
|
|
|
980
980
|
var I = A[0], g = A[1], B = A[2], Q = A[3], E = I * I + g * g + B * B + Q * Q;
|
|
981
981
|
return E > 0 && (E = 1 / Math.sqrt(E)), C[0] = I * E, C[1] = g * E, C[2] = B * E, C[3] = Q * E, C;
|
|
982
982
|
}
|
|
983
|
-
function
|
|
983
|
+
function mI(C, A, I) {
|
|
984
984
|
var g = A[0], B = A[1], Q = A[2], E = A[3];
|
|
985
985
|
return C[0] = I[0] * g + I[4] * B + I[8] * Q + I[12] * E, C[1] = I[1] * g + I[5] * B + I[9] * Q + I[13] * E, C[2] = I[2] * g + I[6] * B + I[10] * Q + I[14] * E, C[3] = I[3] * g + I[7] * B + I[11] * Q + I[15] * E, C;
|
|
986
986
|
}
|
|
@@ -993,7 +993,7 @@ function pI(C, A, I) {
|
|
|
993
993
|
return A;
|
|
994
994
|
};
|
|
995
995
|
})();
|
|
996
|
-
function
|
|
996
|
+
function gB() {
|
|
997
997
|
var C = new DA(4);
|
|
998
998
|
return DA != Float32Array && (C[0] = 0, C[1] = 0, C[2] = 0), C[3] = 1, C;
|
|
999
999
|
}
|
|
@@ -1006,7 +1006,7 @@ function gi(C, A, I) {
|
|
|
1006
1006
|
var g = A[0], B = A[1], Q = A[2], E = A[3], i = I[0], o = I[1], s = I[2], t = I[3];
|
|
1007
1007
|
return C[0] = g * t + E * i + B * s - Q * o, C[1] = B * t + E * o + Q * i - g * s, C[2] = Q * t + E * s + g * o - B * i, C[3] = E * t - g * i - B * o - Q * s, C;
|
|
1008
1008
|
}
|
|
1009
|
-
function
|
|
1009
|
+
function qg(C, A, I, g) {
|
|
1010
1010
|
var B = A[0], Q = A[1], E = A[2], i = A[3], o = I[0], s = I[1], t = I[2], a = I[3], n, D, F, U, S;
|
|
1011
1011
|
return D = B * o + Q * s + E * t + i * a, D < 0 && (D = -D, o = -o, s = -s, t = -t, a = -a), 1 - D > AA ? (n = Math.acos(D), F = Math.sin(n), U = Math.sin((1 - g) * n) / F, S = Math.sin(g * n) / F) : (U = 1 - g, S = g), C[0] = U * B + S * o, C[1] = U * Q + S * s, C[2] = U * E + S * t, C[3] = U * i + S * a, C;
|
|
1012
1012
|
}
|
|
@@ -1027,13 +1027,13 @@ var Bi = jE, Ci = zE, kB = Ai;
|
|
|
1027
1027
|
var C = EA(), A = P(1, 0, 0), I = P(0, 1, 0);
|
|
1028
1028
|
return function(g, B, Q) {
|
|
1029
1029
|
var E = GQ(B, Q);
|
|
1030
|
-
return E < -0.999999 ? (
|
|
1030
|
+
return E < -0.999999 ? (Hg(C, A, B), XE(C) < 1e-6 && Hg(C, I, B), OE(C, C), Ii(g, C, Math.PI), g) : E > 0.999999 ? (g[0] = 0, g[1] = 0, g[2] = 0, g[3] = 1, g) : (Hg(C, B, Q), g[0] = C[0], g[1] = C[1], g[2] = C[2], g[3] = 1 + E, kB(g, g));
|
|
1031
1031
|
};
|
|
1032
1032
|
})();
|
|
1033
1033
|
(function() {
|
|
1034
|
-
var C =
|
|
1034
|
+
var C = gB(), A = gB();
|
|
1035
1035
|
return function(I, g, B, Q, E, i) {
|
|
1036
|
-
return
|
|
1036
|
+
return qg(C, g, E, i), qg(A, B, Q, i), qg(I, C, A, 2 * i * (1 - i)), I;
|
|
1037
1037
|
};
|
|
1038
1038
|
})();
|
|
1039
1039
|
(function() {
|
|
@@ -1069,7 +1069,7 @@ function ii(C, A, I, g) {
|
|
|
1069
1069
|
function eC(C, A) {
|
|
1070
1070
|
return C[0] === A[0] && C[1] === A[1];
|
|
1071
1071
|
}
|
|
1072
|
-
function
|
|
1072
|
+
function pg(C, A) {
|
|
1073
1073
|
var I = C[0], g = C[1], B = A[0], Q = A[1];
|
|
1074
1074
|
return Math.abs(I - B) <= AA * Math.max(1, Math.abs(I), Math.abs(B)) && Math.abs(g - Q) <= AA * Math.max(1, Math.abs(g), Math.abs(Q));
|
|
1075
1075
|
}
|
|
@@ -1356,7 +1356,7 @@ class si {
|
|
|
1356
1356
|
getFilter(A, I) {
|
|
1357
1357
|
const { dataFormat: g, dataType: B } = I;
|
|
1358
1358
|
if (g === "scalar" && B !== "float" && A !== "nearest")
|
|
1359
|
-
return
|
|
1359
|
+
return H.warn(
|
|
1360
1360
|
"WebGLTexture",
|
|
1361
1361
|
"Integer values are not filterable. Using gl.NEAREST instead."
|
|
1362
1362
|
), this.gl_.NEAREST;
|
|
@@ -1640,7 +1640,7 @@ class nC extends yQ {
|
|
|
1640
1640
|
});
|
|
1641
1641
|
if (!I)
|
|
1642
1642
|
throw new Error("Failed to initialize WebGL2 context");
|
|
1643
|
-
this.gl_ = I,
|
|
1643
|
+
this.gl_ = I, H.info(
|
|
1644
1644
|
"WebGLRenderer",
|
|
1645
1645
|
`WebGL version ${I.getParameter(I.VERSION)}`
|
|
1646
1646
|
), this.programs_ = new fE(I), this.bindings_ = new oi(I), this.textures_ = new si(I), this.state_ = new ti(I), this.initStencil(), this.resize(this.canvas.width, this.canvas.height);
|
|
@@ -1668,7 +1668,7 @@ class nC extends yQ {
|
|
|
1668
1668
|
else if (i)
|
|
1669
1669
|
this.state_.setScissorTest(!0), this.state_.setScissor(B);
|
|
1670
1670
|
else {
|
|
1671
|
-
|
|
1671
|
+
H.warn(
|
|
1672
1672
|
"WebGLRenderer",
|
|
1673
1673
|
`Viewport ${A.id} is entirely outside canvas bounds, skipping render`
|
|
1674
1674
|
);
|
|
@@ -1749,7 +1749,7 @@ class nC extends yQ {
|
|
|
1749
1749
|
);
|
|
1750
1750
|
break;
|
|
1751
1751
|
case "CameraPositionModel": {
|
|
1752
|
-
const U =
|
|
1752
|
+
const U = Ug(FA(), E), S = Cg(0, 0, 0, 1), d = mI(
|
|
1753
1753
|
nI(),
|
|
1754
1754
|
S,
|
|
1755
1755
|
U
|
|
@@ -2272,7 +2272,7 @@ function Mi(C, A, I) {
|
|
|
2272
2272
|
};
|
|
2273
2273
|
return { views: Q(C, g), arrayBuffer: B };
|
|
2274
2274
|
}
|
|
2275
|
-
function
|
|
2275
|
+
function BB(C, A) {
|
|
2276
2276
|
if (C !== void 0)
|
|
2277
2277
|
if (rC(A)) {
|
|
2278
2278
|
const I = A;
|
|
@@ -2289,13 +2289,13 @@ function gB(C, A) {
|
|
|
2289
2289
|
} else if (Array.isArray(A)) {
|
|
2290
2290
|
const I = A;
|
|
2291
2291
|
C.forEach((g, B) => {
|
|
2292
|
-
|
|
2292
|
+
BB(g, I[B]);
|
|
2293
2293
|
});
|
|
2294
2294
|
} else {
|
|
2295
2295
|
const I = A;
|
|
2296
2296
|
for (const [g, B] of Object.entries(C)) {
|
|
2297
2297
|
const Q = I[g];
|
|
2298
|
-
Q &&
|
|
2298
|
+
Q && BB(B, Q);
|
|
2299
2299
|
}
|
|
2300
2300
|
}
|
|
2301
2301
|
}
|
|
@@ -2304,24 +2304,24 @@ function fi(C, A, I = 0) {
|
|
|
2304
2304
|
return {
|
|
2305
2305
|
...Q,
|
|
2306
2306
|
set(E) {
|
|
2307
|
-
|
|
2307
|
+
BB(E, Q.views);
|
|
2308
2308
|
}
|
|
2309
2309
|
};
|
|
2310
2310
|
}
|
|
2311
|
-
function
|
|
2311
|
+
function CB(C) {
|
|
2312
2312
|
const I = C.elementType;
|
|
2313
2313
|
if (I)
|
|
2314
|
-
return
|
|
2314
|
+
return CB(I);
|
|
2315
2315
|
const B = C.fields;
|
|
2316
2316
|
if (B)
|
|
2317
|
-
return Object.values(B).reduce((i, { type: o }) => Math.max(i,
|
|
2317
|
+
return Object.values(B).reduce((i, { type: o }) => Math.max(i, CB(o)), 0);
|
|
2318
2318
|
const { type: Q } = C, { align: E } = RI[Q];
|
|
2319
2319
|
return E;
|
|
2320
2320
|
}
|
|
2321
2321
|
function kQ(C) {
|
|
2322
2322
|
const I = C.elementType;
|
|
2323
2323
|
if (I) {
|
|
2324
|
-
const Q = I.size, E =
|
|
2324
|
+
const Q = I.size, E = CB(I);
|
|
2325
2325
|
return {
|
|
2326
2326
|
unalignedSize: Q,
|
|
2327
2327
|
align: E,
|
|
@@ -2408,7 +2408,7 @@ class _A extends dA {
|
|
|
2408
2408
|
return `array<${this.format.getTypeName()}, ${this.count}>`;
|
|
2409
2409
|
}
|
|
2410
2410
|
}
|
|
2411
|
-
class
|
|
2411
|
+
class QB extends dA {
|
|
2412
2412
|
constructor(A, I, g) {
|
|
2413
2413
|
super(A, g), this.format = I;
|
|
2414
2414
|
}
|
|
@@ -2729,7 +2729,7 @@ function _(C, A, I, g, B) {
|
|
|
2729
2729
|
}
|
|
2730
2730
|
return B;
|
|
2731
2731
|
}
|
|
2732
|
-
const pg = { r8unorm: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8snorm: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8uint: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8sint: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg8unorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8snorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8uint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8sint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba8unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "rgba8unorm-srgb": { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8snorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, bgra8unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "bgra8unorm-srgb": { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, r16uint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r16sint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r16float: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg16uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg16sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg16float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba16uint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba16sint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba16float: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, r32uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r32sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r32float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg32uint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg32sint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg32float: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba32uint: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba32sint: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba32float: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgb10a2uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgb10a2unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rg11b10ufloat: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, stencil8: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !1, hasStencil: !0, channels: 1 }, depth16unorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, channels: 1 }, depth24plus: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, depthOnlyFormat: "depth32float", channels: 1 }, "depth24plus-stencil8": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !0, depthOnlyFormat: "depth32float", channels: 1 }, depth32float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, channels: 1 }, "depth32float-stencil8": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !0, stencilOnlyFormat: "depth32float", channels: 1 }, rgb9e5ufloat: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "bc1-rgba-unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc1-rgba-unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc2-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc2-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc3-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc3-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc4-r-unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 1 }, "bc4-r-snorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 1 }, "bc5-rg-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 2 }, "bc5-rg-snorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 2 }, "bc6h-rgb-ufloat": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc6h-rgb-float": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc7-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc7-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8a1unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8a1unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgba8unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgba8unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "eac-r11unorm": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 1 }, "eac-r11snorm": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 1 }, "eac-rg11unorm": { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 2 }, "eac-rg11snorm": { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 2 }, "astc-4x4-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-4x4-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x4-unorm": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x4-unorm-srgb": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x5-unorm": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-5x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x5-unorm": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x6-unorm": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-6x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x5-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-8x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-8x6-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x8-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-8x8-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x5-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-10x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-10x6-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-10x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-10x8-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x8-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x10-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-10x10-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x10-unorm": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x10-unorm-srgb": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x12-unorm": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 12, isCompressed: !0, channels: 4 }, "astc-12x12-unorm-srgb": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 12, isCompressed: !0, channels: 4 } };
|
|
2732
|
+
const mg = { r8unorm: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8snorm: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8uint: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8sint: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg8unorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8snorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8uint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8sint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba8unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "rgba8unorm-srgb": { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8snorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, bgra8unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "bgra8unorm-srgb": { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, r16uint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r16sint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r16float: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg16uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg16sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg16float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba16uint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba16sint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba16float: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, r32uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r32sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r32float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg32uint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg32sint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg32float: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba32uint: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba32sint: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba32float: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgb10a2uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgb10a2unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rg11b10ufloat: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, stencil8: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !1, hasStencil: !0, channels: 1 }, depth16unorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, channels: 1 }, depth24plus: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, depthOnlyFormat: "depth32float", channels: 1 }, "depth24plus-stencil8": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !0, depthOnlyFormat: "depth32float", channels: 1 }, depth32float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, channels: 1 }, "depth32float-stencil8": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !0, stencilOnlyFormat: "depth32float", channels: 1 }, rgb9e5ufloat: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "bc1-rgba-unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc1-rgba-unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc2-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc2-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc3-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc3-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc4-r-unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 1 }, "bc4-r-snorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 1 }, "bc5-rg-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 2 }, "bc5-rg-snorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 2 }, "bc6h-rgb-ufloat": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc6h-rgb-float": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc7-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc7-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8a1unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8a1unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgba8unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgba8unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "eac-r11unorm": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 1 }, "eac-r11snorm": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 1 }, "eac-rg11unorm": { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 2 }, "eac-rg11snorm": { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 2 }, "astc-4x4-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-4x4-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x4-unorm": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x4-unorm-srgb": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x5-unorm": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-5x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x5-unorm": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x6-unorm": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-6x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x5-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-8x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-8x6-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x8-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-8x8-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x5-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-10x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-10x6-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-10x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-10x8-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x8-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x10-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-10x10-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x10-unorm": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x10-unorm-srgb": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x12-unorm": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 12, isCompressed: !0, channels: 4 }, "astc-12x12-unorm-srgb": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 12, isCompressed: !0, channels: 4 } };
|
|
2733
2733
|
class LA {
|
|
2734
2734
|
constructor() {
|
|
2735
2735
|
this.id = LA._id++, this.line = 0;
|
|
@@ -2745,9 +2745,9 @@ class LA {
|
|
|
2745
2745
|
}
|
|
2746
2746
|
searchBlock(A, I) {
|
|
2747
2747
|
if (A) {
|
|
2748
|
-
I(Cg.instance);
|
|
2749
|
-
for (const g of A) g instanceof Array ? this.searchBlock(g, I) : g.search(I);
|
|
2750
2748
|
I(Qg.instance);
|
|
2749
|
+
for (const g of A) g instanceof Array ? this.searchBlock(g, I) : g.search(I);
|
|
2750
|
+
I(Eg.instance);
|
|
2751
2751
|
}
|
|
2752
2752
|
}
|
|
2753
2753
|
constEvaluate(A, I) {
|
|
@@ -2759,16 +2759,16 @@ class LA {
|
|
|
2759
2759
|
}
|
|
2760
2760
|
}
|
|
2761
2761
|
LA._id = 0;
|
|
2762
|
-
class Cg extends LA {
|
|
2763
|
-
}
|
|
2764
|
-
Cg.instance = new Cg();
|
|
2765
2762
|
class Qg extends LA {
|
|
2766
2763
|
}
|
|
2767
2764
|
Qg.instance = new Qg();
|
|
2765
|
+
class Eg extends LA {
|
|
2766
|
+
}
|
|
2767
|
+
Eg.instance = new Eg();
|
|
2768
2768
|
const lQ = /* @__PURE__ */ new Set(["all", "any", "select", "arrayLength", "abs", "acos", "acosh", "asin", "asinh", "atan", "atanh", "atan2", "ceil", "clamp", "cos", "cosh", "countLeadingZeros", "countOneBits", "countTrailingZeros", "cross", "degrees", "determinant", "distance", "dot", "dot4U8Packed", "dot4I8Packed", "exp", "exp2", "extractBits", "faceForward", "firstLeadingBit", "firstTrailingBit", "floor", "fma", "fract", "frexp", "insertBits", "inverseSqrt", "ldexp", "length", "log", "log2", "max", "min", "mix", "modf", "normalize", "pow", "quantizeToF16", "radians", "reflect", "refract", "reverseBits", "round", "saturate", "sign", "sin", "sinh", "smoothstep", "sqrt", "step", "tan", "tanh", "transpose", "trunc", "dpdx", "dpdxCoarse", "dpdxFine", "dpdy", "dpdyCoarse", "dpdyFine", "fwidth", "fwidthCoarse", "fwidthFine", "textureDimensions", "textureGather", "textureGatherCompare", "textureLoad", "textureNumLayers", "textureNumLevels", "textureNumSamples", "textureSample", "textureSampleBias", "textureSampleCompare", "textureSampleCompareLevel", "textureSampleGrad", "textureSampleLevel", "textureSampleBaseClampToEdge", "textureStore", "atomicLoad", "atomicStore", "atomicAdd", "atomicSub", "atomicMax", "atomicMin", "atomicAnd", "atomicOr", "atomicXor", "atomicExchange", "atomicCompareExchangeWeak", "pack4x8snorm", "pack4x8unorm", "pack4xI8", "pack4xU8", "pack4x8Clamp", "pack4xU8Clamp", "pack2x16snorm", "pack2x16unorm", "pack2x16float", "unpack4x8snorm", "unpack4x8unorm", "unpack4xI8", "unpack4xU8", "unpack2x16snorm", "unpack2x16unorm", "unpack2x16float", "storageBarrier", "textureBarrier", "workgroupBarrier", "workgroupUniformLoad", "subgroupAdd", "subgroupExclusiveAdd", "subgroupInclusiveAdd", "subgroupAll", "subgroupAnd", "subgroupAny", "subgroupBallot", "subgroupBroadcast", "subgroupBroadcastFirst", "subgroupElect", "subgroupMax", "subgroupMin", "subgroupMul", "subgroupExclusiveMul", "subgroupInclusiveMul", "subgroupOr", "subgroupShuffle", "subgroupShuffleDown", "subgroupShuffleUp", "subgroupShuffleXor", "subgroupXor", "quadBroadcast", "quadSwapDiagonal", "quadSwapX", "quadSwapY"]);
|
|
2769
2769
|
class iA extends LA {
|
|
2770
2770
|
}
|
|
2771
|
-
class
|
|
2771
|
+
class xI extends iA {
|
|
2772
2772
|
constructor(A, I, g, B, Q, E) {
|
|
2773
2773
|
super(), this.calls = /* @__PURE__ */ new Set(), this.name = A, this.args = I, this.returnType = g, this.body = B, this.startLine = Q, this.endLine = E;
|
|
2774
2774
|
}
|
|
@@ -2804,7 +2804,7 @@ class LQ extends iA {
|
|
|
2804
2804
|
this.condition.search(A), this.searchBlock(this.body, A);
|
|
2805
2805
|
}
|
|
2806
2806
|
}
|
|
2807
|
-
class
|
|
2807
|
+
class EB extends iA {
|
|
2808
2808
|
constructor(A, I) {
|
|
2809
2809
|
super(), this.body = A, this.loopId = I;
|
|
2810
2810
|
}
|
|
@@ -2851,7 +2851,7 @@ class LB extends iA {
|
|
|
2851
2851
|
(I = this.value) === null || I === void 0 || I.search(A);
|
|
2852
2852
|
}
|
|
2853
2853
|
}
|
|
2854
|
-
class
|
|
2854
|
+
class fI extends iA {
|
|
2855
2855
|
constructor(A, I, g, B, Q) {
|
|
2856
2856
|
super(), this.attributes = null, this.name = A, this.type = I, this.storage = g, this.access = B, this.value = Q;
|
|
2857
2857
|
}
|
|
@@ -2863,7 +2863,7 @@ class MI extends iA {
|
|
|
2863
2863
|
A(this), (I = this.value) === null || I === void 0 || I.search(A);
|
|
2864
2864
|
}
|
|
2865
2865
|
}
|
|
2866
|
-
class
|
|
2866
|
+
class $I extends iA {
|
|
2867
2867
|
constructor(A, I, g, B, Q) {
|
|
2868
2868
|
super(), this.attributes = null, this.name = A, this.type = I, this.storage = g, this.access = B, this.value = Q;
|
|
2869
2869
|
}
|
|
@@ -3107,7 +3107,7 @@ class w extends N {
|
|
|
3107
3107
|
}
|
|
3108
3108
|
}
|
|
3109
3109
|
w.vec2f = new w("vec2", N.f32, null), w.vec3f = new w("vec3", N.f32, null), w.vec4f = new w("vec4", N.f32, null), w.vec2i = new w("vec2", N.i32, null), w.vec3i = new w("vec3", N.i32, null), w.vec4i = new w("vec4", N.i32, null), w.vec2u = new w("vec2", N.u32, null), w.vec3u = new w("vec3", N.u32, null), w.vec4u = new w("vec4", N.u32, null), w.vec2h = new w("vec2", N.f16, null), w.vec3h = new w("vec3", N.f16, null), w.vec4h = new w("vec4", N.f16, null), w.vec2b = new w("vec2", N.bool, null), w.vec3b = new w("vec3", N.bool, null), w.vec4b = new w("vec4", N.bool, null), w.mat2x2f = new w("mat2x2", N.f32, null), w.mat2x3f = new w("mat2x3", N.f32, null), w.mat2x4f = new w("mat2x4", N.f32, null), w.mat3x2f = new w("mat3x2", N.f32, null), w.mat3x3f = new w("mat3x3", N.f32, null), w.mat3x4f = new w("mat3x4", N.f32, null), w.mat4x2f = new w("mat4x2", N.f32, null), w.mat4x3f = new w("mat4x3", N.f32, null), w.mat4x4f = new w("mat4x4", N.f32, null), w.mat2x2h = new w("mat2x2", N.f16, null), w.mat2x3h = new w("mat2x3", N.f16, null), w.mat2x4h = new w("mat2x4", N.f16, null), w.mat3x2h = new w("mat3x2", N.f16, null), w.mat3x3h = new w("mat3x3", N.f16, null), w.mat3x4h = new w("mat3x4", N.f16, null), w.mat4x2h = new w("mat4x2", N.f16, null), w.mat4x3h = new w("mat4x3", N.f16, null), w.mat4x4h = new w("mat4x4", N.f16, null), w.mat2x2i = new w("mat2x2", N.i32, null), w.mat2x3i = new w("mat2x3", N.i32, null), w.mat2x4i = new w("mat2x4", N.i32, null), w.mat3x2i = new w("mat3x2", N.i32, null), w.mat3x3i = new w("mat3x3", N.i32, null), w.mat3x4i = new w("mat3x4", N.i32, null), w.mat4x2i = new w("mat4x2", N.i32, null), w.mat4x3i = new w("mat4x3", N.i32, null), w.mat4x4i = new w("mat4x4", N.i32, null), w.mat2x2u = new w("mat2x2", N.u32, null), w.mat2x3u = new w("mat2x3", N.u32, null), w.mat2x4u = new w("mat2x4", N.u32, null), w.mat3x2u = new w("mat3x2", N.u32, null), w.mat3x3u = new w("mat3x3", N.u32, null), w.mat3x4u = new w("mat3x4", N.u32, null), w.mat4x2u = new w("mat4x2", N.u32, null), w.mat4x3u = new w("mat4x3", N.u32, null), w.mat4x4u = new w("mat4x4", N.u32, null);
|
|
3110
|
-
class
|
|
3110
|
+
class Ag extends N {
|
|
3111
3111
|
constructor(A, I, g, B) {
|
|
3112
3112
|
super(A), this.storage = I, this.type = g, this.access = B;
|
|
3113
3113
|
}
|
|
@@ -3115,7 +3115,7 @@ class $I extends N {
|
|
|
3115
3115
|
return "pointer";
|
|
3116
3116
|
}
|
|
3117
3117
|
}
|
|
3118
|
-
class
|
|
3118
|
+
class uI extends N {
|
|
3119
3119
|
constructor(A, I, g, B) {
|
|
3120
3120
|
super(A), this.attributes = I, this.format = g, this.count = B;
|
|
3121
3121
|
}
|
|
@@ -3303,7 +3303,7 @@ class WQ extends LA {
|
|
|
3303
3303
|
A(this), this.searchBlock(this.body, A);
|
|
3304
3304
|
}
|
|
3305
3305
|
}
|
|
3306
|
-
class
|
|
3306
|
+
class Ig extends fA {
|
|
3307
3307
|
get astNodeType() {
|
|
3308
3308
|
return "default";
|
|
3309
3309
|
}
|
|
@@ -3391,7 +3391,7 @@ class NC extends uA {
|
|
|
3391
3391
|
return this.typeInfo.name;
|
|
3392
3392
|
}
|
|
3393
3393
|
}
|
|
3394
|
-
class
|
|
3394
|
+
class iB extends uA {
|
|
3395
3395
|
constructor() {
|
|
3396
3396
|
super(new dA("void", null), null);
|
|
3397
3397
|
}
|
|
@@ -3402,10 +3402,10 @@ class EB extends uA {
|
|
|
3402
3402
|
return "void";
|
|
3403
3403
|
}
|
|
3404
3404
|
}
|
|
3405
|
-
|
|
3405
|
+
iB.void = new iB();
|
|
3406
3406
|
class oI extends uA {
|
|
3407
3407
|
constructor(A) {
|
|
3408
|
-
super(new
|
|
3408
|
+
super(new QB("pointer", A.typeInfo, null), null), this.reference = A;
|
|
3409
3409
|
}
|
|
3410
3410
|
clone() {
|
|
3411
3411
|
return this;
|
|
@@ -3903,18 +3903,18 @@ class xA extends uA {
|
|
|
3903
3903
|
return I;
|
|
3904
3904
|
}
|
|
3905
3905
|
get texelByteSize() {
|
|
3906
|
-
const A = this.format, I =
|
|
3906
|
+
const A = this.format, I = mg[A];
|
|
3907
3907
|
return I ? I.isDepthStencil ? 4 : I.bytesPerBlock : 0;
|
|
3908
3908
|
}
|
|
3909
3909
|
get bytesPerRow() {
|
|
3910
3910
|
return this.width * this.texelByteSize;
|
|
3911
3911
|
}
|
|
3912
3912
|
get isDepthStencil() {
|
|
3913
|
-
const A = this.format, I =
|
|
3913
|
+
const A = this.format, I = mg[A];
|
|
3914
3914
|
return !!I && I.isDepthStencil;
|
|
3915
3915
|
}
|
|
3916
3916
|
getGpuSize() {
|
|
3917
|
-
const A = this.format, I =
|
|
3917
|
+
const A = this.format, I = mg[A], g = this.width;
|
|
3918
3918
|
if (!A || g <= 0 || !I) return -1;
|
|
3919
3919
|
const B = this.height, Q = this.depthOrArrayLayers, E = this.dimension;
|
|
3920
3920
|
return g / I.blockWidth * (E === "1d" ? 1 : B / I.blockHeight) * I.bytesPerBlock * Q;
|
|
@@ -3925,9 +3925,9 @@ class xA extends uA {
|
|
|
3925
3925
|
}
|
|
3926
3926
|
setPixel(A, I, g, B, Q) {
|
|
3927
3927
|
const E = this.texelByteSize, i = this.bytesPerRow, o = this.height, s = this.data[B];
|
|
3928
|
-
(function(t, a, n, D, F, U, S, d,
|
|
3928
|
+
(function(t, a, n, D, F, U, S, d, K, k) {
|
|
3929
3929
|
const R = D * (S >>= F) * (U >>= F) + n * S + a * d;
|
|
3930
|
-
switch (
|
|
3930
|
+
switch (K) {
|
|
3931
3931
|
case "r8unorm":
|
|
3932
3932
|
return void _(t, R, "8unorm", 1, k);
|
|
3933
3933
|
case "r8snorm":
|
|
@@ -4033,7 +4033,7 @@ class RC {
|
|
|
4033
4033
|
return this.isArrayType() || this.isTemplateType();
|
|
4034
4034
|
}
|
|
4035
4035
|
}
|
|
4036
|
-
class
|
|
4036
|
+
class dg {
|
|
4037
4037
|
constructor(A) {
|
|
4038
4038
|
this._tokens = [], this._start = 0, this._current = 0, this._line = 1, this._source = A ?? "";
|
|
4039
4039
|
}
|
|
@@ -4129,7 +4129,7 @@ class Ug {
|
|
|
4129
4129
|
return this._current >= this._source.length;
|
|
4130
4130
|
}
|
|
4131
4131
|
_isAlpha(A) {
|
|
4132
|
-
return !this._isNumeric(A) && !this._isWhitespace(A) && A !== "_" && !
|
|
4132
|
+
return !this._isNumeric(A) && !this._isWhitespace(A) && A !== "_" && !dg._operators.has(A);
|
|
4133
4133
|
}
|
|
4134
4134
|
_isNumeric(A) {
|
|
4135
4135
|
return A >= "0" && A <= "9";
|
|
@@ -4155,20 +4155,20 @@ class Ug {
|
|
|
4155
4155
|
function J(C) {
|
|
4156
4156
|
return Array.isArray(C) || C?.buffer instanceof ArrayBuffer;
|
|
4157
4157
|
}
|
|
4158
|
-
|
|
4158
|
+
dg._operators = /* @__PURE__ */ new Set([".", "(", ")", "[", "]", "{", "}", ",", ";", ":", "=", "!", "<", ">", "+", "-", "*", "/", "%", "&", "|", "^", "~", "@", "#", "?", "'", "`", '"', "\\", `
|
|
4159
4159
|
`, "\r", " ", "\0"]);
|
|
4160
|
-
const
|
|
4160
|
+
const ig = new Float32Array(1), _i = new Uint32Array(ig.buffer), Xi = new Uint32Array(ig.buffer), og = new Int32Array(1), ji = new Float32Array(og.buffer), zi = new Uint32Array(og.buffer), sg = new Uint32Array(1), $i = new Float32Array(sg.buffer), Ao = new Int32Array(sg.buffer);
|
|
4161
4161
|
function kC(C, A, I) {
|
|
4162
4162
|
if (A === I) return C;
|
|
4163
4163
|
if (A === "f32") {
|
|
4164
|
-
if (I === "i32" || I === "x32") return
|
|
4165
|
-
if (I === "u32") return
|
|
4164
|
+
if (I === "i32" || I === "x32") return ig[0] = C, _i[0];
|
|
4165
|
+
if (I === "u32") return ig[0] = C, Xi[0];
|
|
4166
4166
|
} else if (A === "i32" || A === "x32") {
|
|
4167
|
-
if (I === "f32") return
|
|
4168
|
-
if (I === "u32") return
|
|
4167
|
+
if (I === "f32") return og[0] = C, ji[0];
|
|
4168
|
+
if (I === "u32") return og[0] = C, zi[0];
|
|
4169
4169
|
} else if (A === "u32") {
|
|
4170
|
-
if (I === "f32") return
|
|
4171
|
-
if (I === "i32" || I === "x32") return
|
|
4170
|
+
if (I === "f32") return sg[0] = C, $i[0];
|
|
4171
|
+
if (I === "i32" || I === "x32") return sg[0] = C, Ao[0];
|
|
4172
4172
|
}
|
|
4173
4173
|
return console.error(`Unsupported cast from ${A} to ${I}`), C;
|
|
4174
4174
|
}
|
|
@@ -4177,7 +4177,7 @@ class Io {
|
|
|
4177
4177
|
this.resources = null, this.inUse = !1, this.info = null, this.node = A;
|
|
4178
4178
|
}
|
|
4179
4179
|
}
|
|
4180
|
-
class
|
|
4180
|
+
class jI {
|
|
4181
4181
|
constructor(A, I) {
|
|
4182
4182
|
this.align = A, this.size = I;
|
|
4183
4183
|
}
|
|
@@ -4190,7 +4190,7 @@ class qA {
|
|
|
4190
4190
|
return A.name == "texture_storage_1d" || A.name == "texture_storage_2d" || A.name == "texture_storage_2d_array" || A.name == "texture_storage_3d";
|
|
4191
4191
|
}
|
|
4192
4192
|
updateAST(A) {
|
|
4193
|
-
for (const I of A) I instanceof
|
|
4193
|
+
for (const I of A) I instanceof xI && this._functions.set(I.name, new Io(I));
|
|
4194
4194
|
for (const I of A) if (I instanceof mA) {
|
|
4195
4195
|
const g = this.getTypeInfo(I, null);
|
|
4196
4196
|
g instanceof ZA && this.structs.push(g);
|
|
@@ -4228,7 +4228,7 @@ class qA {
|
|
|
4228
4228
|
continue;
|
|
4229
4229
|
}
|
|
4230
4230
|
}
|
|
4231
|
-
for (const I of A) if (I instanceof
|
|
4231
|
+
for (const I of A) if (I instanceof xI) {
|
|
4232
4232
|
const g = this._getAttribute(I, "vertex"), B = this._getAttribute(I, "fragment"), Q = this._getAttribute(I, "compute"), E = g || B || Q, i = new pi(I.name, E?.name, I.attributes);
|
|
4233
4233
|
i.attributes = I.attributes, i.startLine = I.startLine, i.endLine = I.endLine, this.functions.push(i), this._functions.get(I.name).info = i, E && (this._functions.get(I.name).inUse = !0, i.inUse = !0, i.inputs = this._getInputs(I.args), i.outputs = this._getOutputs(I.returnType), this.entry[E.name].push(i)), i.resources = this._findResources(I, !!E), i.arguments = I.args.map((o) => new qi(o.name, this.getTypeInfo(o.type, o.attributes), o.attributes)), i.returnType = I.returnType ? this.getTypeInfo(I.returnType, I.attributes) : null;
|
|
4234
4234
|
continue;
|
|
@@ -4305,15 +4305,15 @@ class qA {
|
|
|
4305
4305
|
_findResources(A, I) {
|
|
4306
4306
|
const g = [], B = this, Q = [];
|
|
4307
4307
|
return A.search((E) => {
|
|
4308
|
-
if (E instanceof
|
|
4309
|
-
else if (E instanceof
|
|
4308
|
+
if (E instanceof Qg) Q.push({});
|
|
4309
|
+
else if (E instanceof Eg) Q.pop();
|
|
4310
4310
|
else if (E instanceof HA) {
|
|
4311
4311
|
const i = E;
|
|
4312
4312
|
I && i.type !== null && this._markStructsFromAST(i.type), Q.length > 0 && (Q[Q.length - 1][i.name] = i);
|
|
4313
4313
|
} else if (E instanceof KA) {
|
|
4314
4314
|
const i = E;
|
|
4315
4315
|
I && i.type !== null && this._markStructsFromAST(i.type);
|
|
4316
|
-
} else if (E instanceof
|
|
4316
|
+
} else if (E instanceof fI) {
|
|
4317
4317
|
const i = E;
|
|
4318
4318
|
I && i.type !== null && this._markStructsFromAST(i.type), Q.length > 0 && (Q[Q.length - 1][i.name] = i);
|
|
4319
4319
|
} else if (E instanceof wA) {
|
|
@@ -4432,11 +4432,11 @@ class qA {
|
|
|
4432
4432
|
}
|
|
4433
4433
|
getTypeInfo(A, I = null) {
|
|
4434
4434
|
if (this._types.has(A)) return this._types.get(A);
|
|
4435
|
-
if (A instanceof
|
|
4436
|
-
const B = A.type ? this.getTypeInfo(A.type, A.attributes) : null, Q = new
|
|
4435
|
+
if (A instanceof Ag) {
|
|
4436
|
+
const B = A.type ? this.getTypeInfo(A.type, A.attributes) : null, Q = new QB(A.name, B, I);
|
|
4437
4437
|
return this._types.set(A, Q), this._updateTypeInfo(Q), Q;
|
|
4438
4438
|
}
|
|
4439
|
-
if (A instanceof
|
|
4439
|
+
if (A instanceof uI) {
|
|
4440
4440
|
const B = A, Q = B.format ? this.getTypeInfo(B.format, B.attributes) : null, E = new _A(B.name, I);
|
|
4441
4441
|
return E.format = Q, E.count = B.count, this._types.set(A, E), this._updateTypeInfo(E), E;
|
|
4442
4442
|
}
|
|
@@ -4467,7 +4467,7 @@ class qA {
|
|
|
4467
4467
|
const E = this._getTypeSize(A.format);
|
|
4468
4468
|
A.stride = Math.max((g = E?.size) !== null && g !== void 0 ? g : 0, (B = E?.align) !== null && B !== void 0 ? B : 0), this._updateTypeInfo(A.format);
|
|
4469
4469
|
}
|
|
4470
|
-
A instanceof
|
|
4470
|
+
A instanceof QB && this._updateTypeInfo(A.format), A instanceof ZA && this._updateStructInfo(A);
|
|
4471
4471
|
}
|
|
4472
4472
|
_updateStructInfo(A) {
|
|
4473
4473
|
var I;
|
|
@@ -4493,20 +4493,20 @@ class qA {
|
|
|
4493
4493
|
const E = qA._typeInfo[A.name];
|
|
4494
4494
|
if (E !== void 0) {
|
|
4495
4495
|
const i = ((I = A.format) === null || I === void 0 ? void 0 : I.name) === "f16" ? 2 : 1;
|
|
4496
|
-
return new
|
|
4496
|
+
return new jI(Math.max(Q, E.align / i), Math.max(B, E.size / i));
|
|
4497
4497
|
}
|
|
4498
4498
|
}
|
|
4499
4499
|
{
|
|
4500
4500
|
const E = qA._typeInfo[A.name.substring(0, A.name.length - 1)];
|
|
4501
4501
|
if (E) {
|
|
4502
4502
|
const i = A.name[A.name.length - 1] === "h" ? 2 : 1;
|
|
4503
|
-
return new
|
|
4503
|
+
return new jI(Math.max(Q, E.align / i), Math.max(B, E.size / i));
|
|
4504
4504
|
}
|
|
4505
4505
|
}
|
|
4506
4506
|
if (A instanceof _A) {
|
|
4507
4507
|
let E = A, i = 8, o = 8;
|
|
4508
4508
|
const s = this._getTypeSize(E.format);
|
|
4509
|
-
return s !== null && (o = s.size, i = s.align), o = E.count * this._getAttributeNum((g = A?.attributes) !== null && g !== void 0 ? g : null, "stride", this._roundUp(i, o)), B && (o = B), new
|
|
4509
|
+
return s !== null && (o = s.size, i = s.align), o = E.count * this._getAttributeNum((g = A?.attributes) !== null && g !== void 0 ? g : null, "stride", this._roundUp(i, o)), B && (o = B), new jI(Math.max(Q, i), Math.max(B, o));
|
|
4510
4510
|
}
|
|
4511
4511
|
if (A instanceof ZA) {
|
|
4512
4512
|
let E = 0, i = 0, o = 0, s = 0, t = 0;
|
|
@@ -4514,7 +4514,7 @@ class qA {
|
|
|
4514
4514
|
const n = this._getTypeSize(a.type);
|
|
4515
4515
|
n !== null && (E = Math.max(n.align, E), o = this._roundUp(n.align, o + s), s = n.size, t = o);
|
|
4516
4516
|
}
|
|
4517
|
-
return i = this._roundUp(E, t + s), new
|
|
4517
|
+
return i = this._roundUp(E, t + s), new jI(Math.max(Q, E), Math.max(B, i));
|
|
4518
4518
|
}
|
|
4519
4519
|
return null;
|
|
4520
4520
|
}
|
|
@@ -5438,7 +5438,7 @@ class Bo {
|
|
|
5438
5438
|
return console.error("TODO: quadSwapY"), null;
|
|
5439
5439
|
}
|
|
5440
5440
|
}
|
|
5441
|
-
const
|
|
5441
|
+
const xg = { vec2: 2, vec2f: 2, vec2i: 2, vec2u: 2, vec2b: 2, vec2h: 2, vec3: 3, vec3f: 3, vec3i: 3, vec3u: 3, vec3b: 3, vec3h: 3, vec4: 4, vec4f: 4, vec4i: 4, vec4u: 4, vec4b: 4, vec4h: 4 }, cA = { mat2x2: [2, 2, 4], mat2x2f: [2, 2, 4], mat2x2h: [2, 2, 4], mat2x3: [2, 3, 6], mat2x3f: [2, 3, 6], mat2x3h: [2, 3, 6], mat2x4: [2, 4, 8], mat2x4f: [2, 4, 8], mat2x4h: [2, 4, 8], mat3x2: [3, 2, 6], mat3x2f: [3, 2, 6], mat3x2h: [3, 2, 6], mat3x3: [3, 3, 9], mat3x3f: [3, 3, 9], mat3x3h: [3, 3, 9], mat3x4: [3, 4, 12], mat3x4f: [3, 4, 12], mat3x4h: [3, 4, 12], mat4x2: [4, 2, 8], mat4x2f: [4, 2, 8], mat4x2h: [4, 2, 8], mat4x3: [4, 3, 12], mat4x3f: [4, 3, 12], mat4x3h: [4, 3, 12], mat4x4: [4, 4, 16], mat4x4f: [4, 4, 16], mat4x4h: [4, 4, 16] };
|
|
5442
5442
|
class BA extends go {
|
|
5443
5443
|
constructor(A, I) {
|
|
5444
5444
|
var g;
|
|
@@ -5480,9 +5480,9 @@ class BA extends go {
|
|
|
5480
5480
|
var S;
|
|
5481
5481
|
const d = U.node;
|
|
5482
5482
|
if (d?.attributes) {
|
|
5483
|
-
let
|
|
5484
|
-
for (const R of d.attributes) R.name === "binding" ?
|
|
5485
|
-
if (D ===
|
|
5483
|
+
let K = null, k = null;
|
|
5484
|
+
for (const R of d.attributes) R.name === "binding" ? K = R.value : R.name === "group" && (k = R.value);
|
|
5485
|
+
if (D === K && n === k) {
|
|
5486
5486
|
let R = !1;
|
|
5487
5487
|
for (const L of a.resources) if (L.name === U.name && L.group === parseInt(n) && L.binding === parseInt(D)) {
|
|
5488
5488
|
R = !0;
|
|
@@ -5509,18 +5509,18 @@ class BA extends go {
|
|
|
5509
5509
|
return BA._breakObj;
|
|
5510
5510
|
}
|
|
5511
5511
|
if (A instanceof mQ) return BA._continueObj;
|
|
5512
|
-
if (A instanceof
|
|
5512
|
+
if (A instanceof fI) this._let(A, I);
|
|
5513
5513
|
else if (A instanceof HA) this._var(A, I);
|
|
5514
|
-
else if (A instanceof
|
|
5514
|
+
else if (A instanceof $I) this._const(A, I);
|
|
5515
5515
|
else if (A instanceof LB) this._override(A, I);
|
|
5516
|
-
else if (A instanceof
|
|
5516
|
+
else if (A instanceof xI) this._function(A, I);
|
|
5517
5517
|
else {
|
|
5518
5518
|
if (A instanceof KQ) return this._if(A, I);
|
|
5519
5519
|
if (A instanceof uQ) return this._switch(A, I);
|
|
5520
5520
|
if (A instanceof JQ) return this._for(A, I);
|
|
5521
5521
|
if (A instanceof LQ) return this._while(A, I);
|
|
5522
5522
|
if (A instanceof fQ) return this._loop(A, I);
|
|
5523
|
-
if (A instanceof
|
|
5523
|
+
if (A instanceof EB) {
|
|
5524
5524
|
const g = I.clone();
|
|
5525
5525
|
return g.currentFunctionName = I.currentFunctionName, this._execStatements(A.body, g);
|
|
5526
5526
|
}
|
|
@@ -5834,7 +5834,7 @@ class BA extends go {
|
|
|
5834
5834
|
} else {
|
|
5835
5835
|
if (A.type === null) return void console.error(`Variable ${A.name} has no type. Line ${A.line}`);
|
|
5836
5836
|
const B = A.type.name;
|
|
5837
|
-
if (BA._defaultableTypes.has(B) || A.type instanceof
|
|
5837
|
+
if (BA._defaultableTypes.has(B) || A.type instanceof uI || A.type instanceof mA || A.type instanceof w) {
|
|
5838
5838
|
const Q = new KA(A.type, []);
|
|
5839
5839
|
g = this._evalCreate(Q, I);
|
|
5840
5840
|
}
|
|
@@ -5847,7 +5847,7 @@ class BA extends go {
|
|
|
5847
5847
|
if (!(g instanceof c)) return console.error(`Invalid if condition. Line ${A.line}`), null;
|
|
5848
5848
|
let B = null;
|
|
5849
5849
|
for (const Q of A.cases) if (Q instanceof vQ) for (const E of Q.selectors) {
|
|
5850
|
-
if (E instanceof
|
|
5850
|
+
if (E instanceof Ig) {
|
|
5851
5851
|
B = Q;
|
|
5852
5852
|
continue;
|
|
5853
5853
|
}
|
|
@@ -5944,7 +5944,7 @@ class BA extends go {
|
|
|
5944
5944
|
_evalCreate(A, I) {
|
|
5945
5945
|
var g;
|
|
5946
5946
|
if (A instanceof KA) {
|
|
5947
|
-
if (A.type === null) return
|
|
5947
|
+
if (A.type === null) return iB.void;
|
|
5948
5948
|
switch (A.type.getTypeName()) {
|
|
5949
5949
|
case "bool":
|
|
5950
5950
|
case "i32":
|
|
@@ -6126,14 +6126,14 @@ class BA extends go {
|
|
|
6126
6126
|
if (J(Q) && J(E)) {
|
|
6127
6127
|
const t = Q, a = E;
|
|
6128
6128
|
if (this._isMatrixType(g) && this._isMatrixType(B)) {
|
|
6129
|
-
const n = (function(S, d,
|
|
6129
|
+
const n = (function(S, d, K, k) {
|
|
6130
6130
|
if (cA[d.name] === void 0 || cA[k.name] === void 0) return null;
|
|
6131
6131
|
const R = cA[d.name][0], L = cA[d.name][1], M = cA[k.name][0];
|
|
6132
6132
|
if (R !== cA[k.name][1]) return null;
|
|
6133
6133
|
const W = new Array(M * L);
|
|
6134
6134
|
for (let IA = 0; IA < L; IA++) for (let CA = 0; CA < M; CA++) {
|
|
6135
6135
|
let $ = 0;
|
|
6136
|
-
for (let gA = 0; gA < R; gA++) $ += S[gA * L + IA] *
|
|
6136
|
+
for (let gA = 0; gA < R; gA++) $ += S[gA * L + IA] * K[CA * R + gA];
|
|
6137
6137
|
W[IA * M + CA] = $;
|
|
6138
6138
|
}
|
|
6139
6139
|
return W;
|
|
@@ -6144,13 +6144,13 @@ class BA extends go {
|
|
|
6144
6144
|
}
|
|
6145
6145
|
if (this._isMatrixType(g) && this._isVectorType(B)) {
|
|
6146
6146
|
const n = (function(D, F, U, S) {
|
|
6147
|
-
if (cA[F.name] === void 0 ||
|
|
6148
|
-
const d = cA[F.name][0],
|
|
6147
|
+
if (cA[F.name] === void 0 || xg[S.name] === void 0) return null;
|
|
6148
|
+
const d = cA[F.name][0], K = cA[F.name][1];
|
|
6149
6149
|
if (d !== U.length) return null;
|
|
6150
|
-
const k = new Array(
|
|
6151
|
-
for (let R = 0; R <
|
|
6150
|
+
const k = new Array(K);
|
|
6151
|
+
for (let R = 0; R < K; R++) {
|
|
6152
6152
|
let L = 0;
|
|
6153
|
-
for (let M = 0; M < d; M++) L += D[M *
|
|
6153
|
+
for (let M = 0; M < d; M++) L += D[M * K + R] * U[M];
|
|
6154
6154
|
k[R] = L;
|
|
6155
6155
|
}
|
|
6156
6156
|
return k;
|
|
@@ -6159,13 +6159,13 @@ class BA extends go {
|
|
|
6159
6159
|
}
|
|
6160
6160
|
if (this._isVectorType(g) && this._isMatrixType(B)) {
|
|
6161
6161
|
const n = (function(D, F, U, S) {
|
|
6162
|
-
if (
|
|
6163
|
-
const d = cA[S.name][0],
|
|
6164
|
-
if (
|
|
6162
|
+
if (xg[F.name] === void 0 || cA[S.name] === void 0) return null;
|
|
6163
|
+
const d = cA[S.name][0], K = cA[S.name][1];
|
|
6164
|
+
if (K !== D.length) return null;
|
|
6165
6165
|
const k = [];
|
|
6166
6166
|
for (let R = 0; R < d; R++) {
|
|
6167
6167
|
let L = 0;
|
|
6168
|
-
for (let M = 0; M <
|
|
6168
|
+
for (let M = 0; M < K; M++) L += D[M] * U[M * d + R];
|
|
6169
6169
|
k[R] = L;
|
|
6170
6170
|
}
|
|
6171
6171
|
return k;
|
|
@@ -6769,7 +6769,7 @@ class BA extends go {
|
|
|
6769
6769
|
return g.typeInfo = this.getTypeInfo(A.type), g.getSubData(this, A.postfix, I).clone();
|
|
6770
6770
|
}
|
|
6771
6771
|
_callConstructorVec(A, I) {
|
|
6772
|
-
const g = this.getTypeInfo(A.type), B = A.type.getTypeName(), Q =
|
|
6772
|
+
const g = this.getTypeInfo(A.type), B = A.type.getTypeName(), Q = xg[B];
|
|
6773
6773
|
if (Q === void 0) return console.error(`Invalid vec constructor ${B}. Line ${A.line}`), null;
|
|
6774
6774
|
const E = [];
|
|
6775
6775
|
if (A instanceof rA) if (A.isVector) {
|
|
@@ -6848,7 +6848,7 @@ class Qo {
|
|
|
6848
6848
|
this._deferArrayCountEval.length = 0;
|
|
6849
6849
|
}
|
|
6850
6850
|
if (this._forwardTypeCount > 0) for (const g of I) g.search((B) => {
|
|
6851
|
-
B instanceof SC || B instanceof
|
|
6851
|
+
B instanceof SC || B instanceof Ag ? B.type = this._forwardType(B.type) : B instanceof uI ? B.format = this._forwardType(B.format) : B instanceof HA || B instanceof fI || B instanceof $I ? B.type = this._forwardType(B.type) : B instanceof xI ? B.returnType = this._forwardType(B.returnType) : B instanceof FC && (B.type = this._forwardType(B.type));
|
|
6852
6852
|
});
|
|
6853
6853
|
return I;
|
|
6854
6854
|
}
|
|
@@ -6856,12 +6856,12 @@ class Qo {
|
|
|
6856
6856
|
if (A instanceof GC) {
|
|
6857
6857
|
const I = this._getType(A.name);
|
|
6858
6858
|
if (I) return I;
|
|
6859
|
-
} else A instanceof
|
|
6859
|
+
} else A instanceof Ag ? A.type = this._forwardType(A.type) : A instanceof uI && (A.format = this._forwardType(A.format));
|
|
6860
6860
|
return A;
|
|
6861
6861
|
}
|
|
6862
6862
|
_initialize(A) {
|
|
6863
6863
|
if (A) if (typeof A == "string") {
|
|
6864
|
-
const I = new
|
|
6864
|
+
const I = new dg(A);
|
|
6865
6865
|
this._tokens = I.scanTokens();
|
|
6866
6866
|
} else this._tokens = A;
|
|
6867
6867
|
else this._tokens = [];
|
|
@@ -6989,7 +6989,7 @@ class Qo {
|
|
|
6989
6989
|
B = this._type_decl(), B != null && (B.attributes = i);
|
|
6990
6990
|
}
|
|
6991
6991
|
const Q = this._compound_statement(), E = this._currentLine;
|
|
6992
|
-
return this._updateNode(new
|
|
6992
|
+
return this._updateNode(new xI(I, g, B, Q, A, E), A);
|
|
6993
6993
|
}
|
|
6994
6994
|
_compound_statement() {
|
|
6995
6995
|
const A = [];
|
|
@@ -7049,7 +7049,7 @@ class Qo {
|
|
|
7049
7049
|
const A = this._currentLoop.length > 0 ? this._currentLoop[this._currentLoop.length - 1].id : -1;
|
|
7050
7050
|
if (!this._match(e.keywords.continuing)) return null;
|
|
7051
7051
|
const I = this._currentLine, g = this._compound_statement();
|
|
7052
|
-
return this._updateNode(new
|
|
7052
|
+
return this._updateNode(new EB(g, A), I);
|
|
7053
7053
|
}
|
|
7054
7054
|
_for_statement() {
|
|
7055
7055
|
if (!this._match(e.keywords.for)) return null;
|
|
@@ -7079,7 +7079,7 @@ class Qo {
|
|
|
7079
7079
|
}
|
|
7080
7080
|
this._consume(e.tokens.equal, "Expected '=' for let.");
|
|
7081
7081
|
const B = this._short_circuit_or_expression();
|
|
7082
|
-
return this._updateNode(new
|
|
7082
|
+
return this._updateNode(new fI(I, g, null, null, B), A);
|
|
7083
7083
|
}
|
|
7084
7084
|
if (this._match(e.keywords.const)) {
|
|
7085
7085
|
const A = this._currentLine, I = this._consume(e.tokens.name, "Expected name for const.").toString();
|
|
@@ -7090,7 +7090,7 @@ class Qo {
|
|
|
7090
7090
|
}
|
|
7091
7091
|
this._consume(e.tokens.equal, "Expected '=' for const.");
|
|
7092
7092
|
const B = this._short_circuit_or_expression();
|
|
7093
|
-
return g === null && B instanceof rA && (g = B.type), this._updateNode(new
|
|
7093
|
+
return g === null && B instanceof rA && (g = B.type), this._updateNode(new $I(I, g, null, null, B), A);
|
|
7094
7094
|
}
|
|
7095
7095
|
return null;
|
|
7096
7096
|
}
|
|
@@ -7124,7 +7124,7 @@ class Qo {
|
|
|
7124
7124
|
for (; I !== null; ) {
|
|
7125
7125
|
if (Array.isArray(I)) for (let g of I) A.body.push(g);
|
|
7126
7126
|
else A.body.push(I);
|
|
7127
|
-
if (I instanceof
|
|
7127
|
+
if (I instanceof EB) {
|
|
7128
7128
|
A.continuing = I;
|
|
7129
7129
|
break;
|
|
7130
7130
|
}
|
|
@@ -7144,7 +7144,7 @@ class Qo {
|
|
|
7144
7144
|
for (; this._check([e.keywords.default, e.keywords.case]); ) {
|
|
7145
7145
|
if (this._match(e.keywords.case)) {
|
|
7146
7146
|
const g = this._case_selectors();
|
|
7147
|
-
for (const Q of g) if (Q instanceof
|
|
7147
|
+
for (const Q of g) if (Q instanceof Ig) {
|
|
7148
7148
|
if (I) throw this._error(this._previous(), "Multiple default cases in switch statement.");
|
|
7149
7149
|
I = !0;
|
|
7150
7150
|
break;
|
|
@@ -7164,7 +7164,7 @@ class Qo {
|
|
|
7164
7164
|
}
|
|
7165
7165
|
_case_selectors() {
|
|
7166
7166
|
const A = [];
|
|
7167
|
-
for (this._match(e.keywords.default) ? A.push(this._updateNode(new
|
|
7167
|
+
for (this._match(e.keywords.default) ? A.push(this._updateNode(new Ig())) : A.push(this._shift_expression()); this._match(e.tokens.comma); ) this._match(e.keywords.default) ? A.push(this._updateNode(new Ig())) : A.push(this._shift_expression());
|
|
7168
7168
|
return A;
|
|
7169
7169
|
}
|
|
7170
7170
|
_case_body() {
|
|
@@ -7520,7 +7520,7 @@ class Qo {
|
|
|
7520
7520
|
throw this._error(this._peek(), `Invalid cast from ${Q.type.name} to ${B.name}`);
|
|
7521
7521
|
Q.type = B, Q.isScalar && this._validateTypeRange(Q.scalarValue, Q.type);
|
|
7522
7522
|
} else B === null && Q instanceof rA && (B = (A = Q?.type) !== null && A !== void 0 ? A : N.f32, B === N.x32 && (B = N.i32));
|
|
7523
|
-
const i = this._updateNode(new
|
|
7523
|
+
const i = this._updateNode(new $I(I.toString(), B, "", "", Q), g);
|
|
7524
7524
|
return this._context.constants.set(i.name, i), i;
|
|
7525
7525
|
}
|
|
7526
7526
|
_global_let_decl() {
|
|
@@ -7537,7 +7537,7 @@ class Qo {
|
|
|
7537
7537
|
throw this._error(this._peek(), `Invalid cast from ${B.type.name} to ${g.name}`);
|
|
7538
7538
|
B.type = g;
|
|
7539
7539
|
} else g === null && B instanceof rA && (g = B.type.name === "x32" ? N.i32 : B.type);
|
|
7540
|
-
return B instanceof rA && B.isScalar && this._validateTypeRange(B.scalarValue, g), this._updateNode(new
|
|
7540
|
+
return B instanceof rA && B.isScalar && this._validateTypeRange(B.scalarValue, g), this._updateNode(new fI(I.toString(), g, "", "", B), A);
|
|
7541
7541
|
}
|
|
7542
7542
|
_const_expression() {
|
|
7543
7543
|
return this._short_circuit_or_expression();
|
|
@@ -7618,7 +7618,7 @@ class Qo {
|
|
|
7618
7618
|
this._consume(e.tokens.comma, "Expected ',' for pointer.");
|
|
7619
7619
|
const o = this._type_decl();
|
|
7620
7620
|
let s = null;
|
|
7621
|
-
return this._match(e.tokens.comma) && (s = this._consume(e.access_mode, "Expected access_mode for pointer").toString()), this._consume(e.tokens.greater_than, "Expected '>' for pointer."), this._updateNode(new
|
|
7621
|
+
return this._match(e.tokens.comma) && (s = this._consume(e.access_mode, "Expected access_mode for pointer").toString()), this._consume(e.tokens.greater_than, "Expected '>' for pointer."), this._updateNode(new Ag(E, i.toString(), o, s));
|
|
7622
7622
|
}
|
|
7623
7623
|
const Q = this._attribute();
|
|
7624
7624
|
if (this._match(e.keywords.array)) {
|
|
@@ -7638,7 +7638,7 @@ class Qo {
|
|
|
7638
7638
|
}
|
|
7639
7639
|
this._consume(e.tokens.greater_than, "Expected '>' for array."), i = a ? parseInt(a) : 0;
|
|
7640
7640
|
}
|
|
7641
|
-
const t = this._updateNode(new
|
|
7641
|
+
const t = this._updateNode(new uI(o.toString(), Q, E, i));
|
|
7642
7642
|
return s && this._deferArrayCountEval.push({ arrayType: t, countNode: s }), t;
|
|
7643
7643
|
}
|
|
7644
7644
|
return null;
|
|
@@ -7698,16 +7698,16 @@ function io(C, A, I) {
|
|
|
7698
7698
|
}
|
|
7699
7699
|
return Object.values(C.entryPoints).filter((B) => B.stage === I)[0];
|
|
7700
7700
|
}
|
|
7701
|
-
function
|
|
7701
|
+
function bg(C, A, I) {
|
|
7702
7702
|
return A ? io(C, A, I)?.resources || [] : [];
|
|
7703
7703
|
}
|
|
7704
7704
|
const oo = (C, A) => Math.sign(C.binding - A.binding);
|
|
7705
7705
|
function so(C, A) {
|
|
7706
7706
|
C = Array.isArray(C) ? C : [C];
|
|
7707
7707
|
const I = [
|
|
7708
|
-
...
|
|
7709
|
-
...
|
|
7710
|
-
...
|
|
7708
|
+
...bg(C[0], A.vertex, GPUShaderStage.VERTEX),
|
|
7709
|
+
...bg(C[C.length - 1], A.fragment, GPUShaderStage.FRAGMENT),
|
|
7710
|
+
...bg(C[0], A.compute, GPUShaderStage.COMPUTE)
|
|
7711
7711
|
], g = [];
|
|
7712
7712
|
for (const Q of I) {
|
|
7713
7713
|
const E = g[Q.group] || /* @__PURE__ */ new Map();
|
|
@@ -7839,7 +7839,7 @@ function no(C, A) {
|
|
|
7839
7839
|
throw new Error("unknown resource type");
|
|
7840
7840
|
}
|
|
7841
7841
|
}
|
|
7842
|
-
function
|
|
7842
|
+
function Tg(C, A) {
|
|
7843
7843
|
const I = {};
|
|
7844
7844
|
for (const g of C)
|
|
7845
7845
|
I[g.name] = {
|
|
@@ -7857,9 +7857,9 @@ function bg(C, A) {
|
|
|
7857
7857
|
}
|
|
7858
7858
|
function ro(C) {
|
|
7859
7859
|
const A = new Eo(C), I = Object.fromEntries(A.structs.map((a) => [a.name, VQ(A, a, 0)])), g = $A(A, A.uniforms), B = $A(A, A.immediates), Q = $A(A, A.storage.filter((a) => a.resourceType === sA.Storage)), E = $A(A, A.storage.filter((a) => a.resourceType === sA.StorageTexture)), i = $A(A, A.textures.filter((a) => a.type.name !== "texture_external")), o = $A(A, A.textures.filter((a) => a.type.name === "texture_external")), s = $A(A, A.samplers), t = {
|
|
7860
|
-
...
|
|
7861
|
-
...
|
|
7862
|
-
...
|
|
7860
|
+
...Tg(A.entry.vertex, GPUShaderStage.VERTEX),
|
|
7861
|
+
...Tg(A.entry.fragment, GPUShaderStage.FRAGMENT),
|
|
7862
|
+
...Tg(A.entry.compute, GPUShaderStage.COMPUTE)
|
|
7863
7863
|
};
|
|
7864
7864
|
return {
|
|
7865
7865
|
externalTextures: o,
|
|
@@ -7873,7 +7873,7 @@ function ro(C) {
|
|
|
7873
7873
|
entryPoints: t
|
|
7874
7874
|
};
|
|
7875
7875
|
}
|
|
7876
|
-
function
|
|
7876
|
+
function Wg(C, A = "") {
|
|
7877
7877
|
if (!C)
|
|
7878
7878
|
throw new Error(A);
|
|
7879
7879
|
}
|
|
@@ -7893,7 +7893,7 @@ function Do(C, A, I) {
|
|
|
7893
7893
|
}
|
|
7894
7894
|
function qB(C, A, I) {
|
|
7895
7895
|
if (A.isArray) {
|
|
7896
|
-
|
|
7896
|
+
Wg(!A.isStruct, "struct array is invalid"), Wg(!A.isStruct, "template array is invalid");
|
|
7897
7897
|
const g = A;
|
|
7898
7898
|
return {
|
|
7899
7899
|
size: g.size,
|
|
@@ -7902,7 +7902,7 @@ function qB(C, A, I) {
|
|
|
7902
7902
|
};
|
|
7903
7903
|
} else {
|
|
7904
7904
|
if (A.isStruct)
|
|
7905
|
-
return
|
|
7905
|
+
return Wg(!A.isTemplate, "template struct is invalid"), VQ(C, A, I);
|
|
7906
7906
|
{
|
|
7907
7907
|
const g = A, B = A.isTemplate ? `${g.name}<${g.format.name}>` : A.name;
|
|
7908
7908
|
return {
|
|
@@ -8154,7 +8154,7 @@ async function So(C, A) {
|
|
|
8154
8154
|
const I = await A.getCompilationInfo();
|
|
8155
8155
|
if (I.messages.some((g) => g.type === "error")) {
|
|
8156
8156
|
for (const g of I.messages)
|
|
8157
|
-
|
|
8157
|
+
H.error("WebGPUPipelines", `${g.type}: ${g.message}`);
|
|
8158
8158
|
throw new Error(`Failed to compile WGSL shader ${C}.wgsl`);
|
|
8159
8159
|
}
|
|
8160
8160
|
}
|
|
@@ -8275,7 +8275,7 @@ class Jo extends yQ {
|
|
|
8275
8275
|
I,
|
|
8276
8276
|
this.colorFormat_,
|
|
8277
8277
|
this.depthFormat_
|
|
8278
|
-
),
|
|
8278
|
+
), H.info("WebGPURenderer", "WebGPU Initialized"), this.resize(this.width, this.height);
|
|
8279
8279
|
}
|
|
8280
8280
|
async compileShaders() {
|
|
8281
8281
|
await Promise.all([
|
|
@@ -8300,7 +8300,7 @@ class Jo extends yQ {
|
|
|
8300
8300
|
eA(this.width, this.height)
|
|
8301
8301
|
);
|
|
8302
8302
|
if (!GA.intersects(B, Q)) {
|
|
8303
|
-
|
|
8303
|
+
H.warn(
|
|
8304
8304
|
"WebGPURenderer",
|
|
8305
8305
|
`Viewport ${A.id} is entirely outside canvas bounds`
|
|
8306
8306
|
);
|
|
@@ -8507,11 +8507,11 @@ class fo {
|
|
|
8507
8507
|
cancel(A) {
|
|
8508
8508
|
const I = this.pending_.findIndex((B) => B.chunk === A);
|
|
8509
8509
|
if (I >= 0) {
|
|
8510
|
-
this.pending_.splice(I, 1),
|
|
8510
|
+
this.pending_.splice(I, 1), H.debug("ChunkQueue", "Cancelled pending request");
|
|
8511
8511
|
return;
|
|
8512
8512
|
}
|
|
8513
8513
|
const g = this.running_.get(A);
|
|
8514
|
-
g && (g.controller.abort(),
|
|
8514
|
+
g && (g.controller.abort(), H.debug("ChunkQueue", "Cancelled fetch request"));
|
|
8515
8515
|
}
|
|
8516
8516
|
get pendingCount() {
|
|
8517
8517
|
return this.pending_.length;
|
|
@@ -8535,7 +8535,7 @@ class fo {
|
|
|
8535
8535
|
I.state === "loading" && (I.state = "loaded");
|
|
8536
8536
|
},
|
|
8537
8537
|
(E) => {
|
|
8538
|
-
I.state === "loading" && (I.state = "unloaded"), E.name !== "AbortError" &&
|
|
8538
|
+
I.state === "loading" && (I.state = "unloaded"), E.name !== "AbortError" && H.error("ChunkQueue", String(E));
|
|
8539
8539
|
}
|
|
8540
8540
|
).finally(() => {
|
|
8541
8541
|
this.running_.delete(I), this.pump();
|
|
@@ -8543,17 +8543,17 @@ class fo {
|
|
|
8543
8543
|
this.running_.set(I, { controller: B, promise: Q });
|
|
8544
8544
|
}
|
|
8545
8545
|
}
|
|
8546
|
-
let
|
|
8546
|
+
let tg = 0, ag = 0;
|
|
8547
8547
|
function uo(C, A) {
|
|
8548
|
-
C.data && (
|
|
8548
|
+
C.data && (tg -= C.data.byteLength, ag -= 1), C.data = A, tg += A.byteLength, ag += 1;
|
|
8549
8549
|
}
|
|
8550
8550
|
function Ko(C) {
|
|
8551
|
-
C.data && (
|
|
8551
|
+
C.data && (tg -= C.data.byteLength, ag -= 1), C.data = void 0;
|
|
8552
8552
|
}
|
|
8553
8553
|
function Ho() {
|
|
8554
|
-
return { cpuChunkBytes:
|
|
8554
|
+
return { cpuChunkBytes: tg, cpuChunkCount: ag };
|
|
8555
8555
|
}
|
|
8556
|
-
function
|
|
8556
|
+
function eg(C, A, I = 1e-6) {
|
|
8557
8557
|
return Math.abs(C - A) <= I;
|
|
8558
8558
|
}
|
|
8559
8559
|
const dC = [
|
|
@@ -8569,7 +8569,7 @@ function qo(C) {
|
|
|
8569
8569
|
if (dC.some((I) => C instanceof I))
|
|
8570
8570
|
return !0;
|
|
8571
8571
|
const A = dC.map((I) => I.name);
|
|
8572
|
-
return
|
|
8572
|
+
return H.debug(
|
|
8573
8573
|
"Chunk",
|
|
8574
8574
|
`Unsupported chunk data type: ${C}. Supported data types: ${A}`
|
|
8575
8575
|
), !1;
|
|
@@ -8580,7 +8580,7 @@ function po(C, A) {
|
|
|
8580
8580
|
function TA(C, A, I) {
|
|
8581
8581
|
return Math.max(A, Math.min(I, C));
|
|
8582
8582
|
}
|
|
8583
|
-
const
|
|
8583
|
+
const lg = Symbol("INTERNAL_POLICY_KEY");
|
|
8584
8584
|
class mo {
|
|
8585
8585
|
store_;
|
|
8586
8586
|
policy_;
|
|
@@ -8595,7 +8595,7 @@ class mo {
|
|
|
8595
8595
|
chunkViewStates_ = /* @__PURE__ */ new Map();
|
|
8596
8596
|
isDisposed_ = !1;
|
|
8597
8597
|
constructor(A, I) {
|
|
8598
|
-
this.store_ = A, this.policy_ = I,
|
|
8598
|
+
this.store_ = A, this.policy_ = I, H.info(
|
|
8599
8599
|
"ChunkStoreView",
|
|
8600
8600
|
"Using image source policy:",
|
|
8601
8601
|
this.policy_.profile
|
|
@@ -8635,7 +8635,7 @@ class mo {
|
|
|
8635
8635
|
if (!(this.policyChanged_ || this.viewBounds2DChanged(Q) || this.zBoundsChanged(a) || this.lastTCoord_ !== A.t || this.cCoordsChanged(A.c))) return;
|
|
8636
8636
|
const D = this.timeIndex(A);
|
|
8637
8637
|
if (!this.store_.hasChunksAtTime(D)) {
|
|
8638
|
-
|
|
8638
|
+
H.warn(
|
|
8639
8639
|
"ChunkStoreView",
|
|
8640
8640
|
"updateChunkViewStates called with no chunks initialized"
|
|
8641
8641
|
), this.chunkViewStates_.clear();
|
|
@@ -8647,14 +8647,14 @@ class mo {
|
|
|
8647
8647
|
P(Q.min[0], Q.min[1], U),
|
|
8648
8648
|
P(Q.max[0], Q.max[1], S)
|
|
8649
8649
|
);
|
|
8650
|
-
this.chunkViewStates_.forEach(
|
|
8651
|
-
const
|
|
8650
|
+
this.chunkViewStates_.forEach(vg);
|
|
8651
|
+
const K = this.channelsOfInterest(A), k = this.fallbackLOD(), R = this.getPaddedBounds(d), L = this.currentLOD_ === k ? [this.currentLOD_] : [this.currentLOD_, k];
|
|
8652
8652
|
for (const M of L) {
|
|
8653
8653
|
const W = M === this.currentLOD_, IA = M === k;
|
|
8654
8654
|
this.iterateChunksInBox(
|
|
8655
8655
|
D,
|
|
8656
8656
|
M,
|
|
8657
|
-
|
|
8657
|
+
K,
|
|
8658
8658
|
R,
|
|
8659
8659
|
(CA, $) => {
|
|
8660
8660
|
const gA = II.intersects($, d), SA = W && !gA, NA = this.computePriority(
|
|
@@ -8689,13 +8689,13 @@ class mo {
|
|
|
8689
8689
|
if (!(this.policyChanged_ || this.hasViewProjectionChanged(g) || this.lastTCoord_ !== A.t || this.cCoordsChanged(A.c))) return;
|
|
8690
8690
|
const Q = this.timeIndex(A);
|
|
8691
8691
|
if (!this.store_.hasChunksAtTime(Q)) {
|
|
8692
|
-
|
|
8692
|
+
H.warn(
|
|
8693
8693
|
"ChunkStoreView",
|
|
8694
8694
|
"updateChunksForVolume called with no chunks initialized"
|
|
8695
8695
|
), this.chunkViewStates_.clear();
|
|
8696
8696
|
return;
|
|
8697
8697
|
}
|
|
8698
|
-
this.currentLOD_ = this.policy_.lod.min, this.chunkViewStates_.forEach(
|
|
8698
|
+
this.currentLOD_ = this.policy_.lod.min, this.chunkViewStates_.forEach(vg);
|
|
8699
8699
|
const E = this.channelsOfInterest(A), i = this.fallbackLOD(), o = (s) => {
|
|
8700
8700
|
const t = s.lod === i, a = s.lod === this.currentLOD_, n = this.computePriority(
|
|
8701
8701
|
t,
|
|
@@ -8739,12 +8739,12 @@ class mo {
|
|
|
8739
8739
|
I && (I.visible || I.prefetch || I.priority !== null) || this.chunkViewStates_.delete(A);
|
|
8740
8740
|
}
|
|
8741
8741
|
dispose() {
|
|
8742
|
-
this.isDisposed_ = !0, this.chunkViewStates_.forEach(
|
|
8742
|
+
this.isDisposed_ = !0, this.chunkViewStates_.forEach(vg);
|
|
8743
8743
|
}
|
|
8744
8744
|
setImageSourcePolicy(A, I) {
|
|
8745
|
-
if (I !==
|
|
8745
|
+
if (I !== lg)
|
|
8746
8746
|
throw new Error("Unauthorized policy mutation");
|
|
8747
|
-
this.policy_ !== A && (this.policy_ = A, this.policyChanged_ = !0,
|
|
8747
|
+
this.policy_ !== A && (this.policy_ = A, this.policyChanged_ = !0, H.info(
|
|
8748
8748
|
"ChunkStoreView",
|
|
8749
8749
|
"Using image source policy:",
|
|
8750
8750
|
this.policy_.profile
|
|
@@ -8816,8 +8816,8 @@ class mo {
|
|
|
8816
8816
|
// Half-open chunk-index range [min, max) at a given LOD that covers `bounds`.
|
|
8817
8817
|
// Returns null if the bounds don't overlap the data grid.
|
|
8818
8818
|
chunkIndexRange(A, I) {
|
|
8819
|
-
const g = this.store_.dimensions, B = g.x.lods[I], Q = g.y.lods[I], E = g.z?.lods[I], i = Math.ceil(B.size / B.chunkSize), o = Math.ceil(Q.size / Q.chunkSize), s = E ? Math.ceil(E.size / E.chunkSize) : 1, t = B.chunkSize * B.scale, a = Q.chunkSize * Q.scale, n = E ? E.chunkSize * E.scale : 1, D = B.translation, F = Q.translation, U = E?.translation ?? 0, S = Math.max(0, Math.floor((A.min[0] - D) / t)), d = Math.min(i, Math.ceil((A.max[0] - D) / t)),
|
|
8820
|
-
return S >= d ||
|
|
8819
|
+
const g = this.store_.dimensions, B = g.x.lods[I], Q = g.y.lods[I], E = g.z?.lods[I], i = Math.ceil(B.size / B.chunkSize), o = Math.ceil(Q.size / Q.chunkSize), s = E ? Math.ceil(E.size / E.chunkSize) : 1, t = B.chunkSize * B.scale, a = Q.chunkSize * Q.scale, n = E ? E.chunkSize * E.scale : 1, D = B.translation, F = Q.translation, U = E?.translation ?? 0, S = Math.max(0, Math.floor((A.min[0] - D) / t)), d = Math.min(i, Math.ceil((A.max[0] - D) / t)), K = Math.max(0, Math.floor((A.min[1] - F) / a)), k = Math.min(o, Math.ceil((A.max[1] - F) / a)), R = E ? Math.max(0, Math.floor((A.min[2] - U) / n)) : 0, L = E ? Math.min(s, Math.ceil((A.max[2] - U) / n)) : 1;
|
|
8820
|
+
return S >= d || K >= k || R >= L ? null : { xMin: S, xMax: d, yMin: K, yMax: k, zMin: R, zMax: L };
|
|
8821
8821
|
}
|
|
8822
8822
|
iterateChunksInBox(A, I, g, B, Q) {
|
|
8823
8823
|
const E = this.chunkIndexRange(B, I);
|
|
@@ -8884,13 +8884,13 @@ class mo {
|
|
|
8884
8884
|
];
|
|
8885
8885
|
}
|
|
8886
8886
|
viewBounds2DChanged(A) {
|
|
8887
|
-
return this.lastViewBounds2D_ === null || !
|
|
8887
|
+
return this.lastViewBounds2D_ === null || !pg(this.lastViewBounds2D_.min, A.min) || !pg(this.lastViewBounds2D_.max, A.max);
|
|
8888
8888
|
}
|
|
8889
8889
|
hasViewProjectionChanged(A) {
|
|
8890
8890
|
return this.lastViewProjection_ === null || !ZE(this.lastViewProjection_, A);
|
|
8891
8891
|
}
|
|
8892
8892
|
zBoundsChanged(A) {
|
|
8893
|
-
return !this.lastZBounds_ || !
|
|
8893
|
+
return !this.lastZBounds_ || !pg(this.lastZBounds_, A);
|
|
8894
8894
|
}
|
|
8895
8895
|
cCoordsChanged(A) {
|
|
8896
8896
|
return !this.lastCCoords_ && !A ? !1 : !this.lastCCoords_ || !A || this.lastCCoords_.length !== A.length ? !0 : !this.lastCCoords_.every((I, g) => I === A[g]);
|
|
@@ -8919,7 +8919,7 @@ class mo {
|
|
|
8919
8919
|
return B * B + Q * Q;
|
|
8920
8920
|
}
|
|
8921
8921
|
}
|
|
8922
|
-
function
|
|
8922
|
+
function vg(C) {
|
|
8923
8923
|
C.visible = !1, C.prefetch = !1, C.priority = null, C.orderKey = null;
|
|
8924
8924
|
}
|
|
8925
8925
|
class xo {
|
|
@@ -8940,9 +8940,9 @@ class xo {
|
|
|
8940
8940
|
for (let S = 0; S < I; ++S) {
|
|
8941
8941
|
const d = new Array(g);
|
|
8942
8942
|
U[S] = d;
|
|
8943
|
-
for (let
|
|
8943
|
+
for (let K = 0; K < g; ++K) {
|
|
8944
8944
|
const k = new Array(F);
|
|
8945
|
-
d[
|
|
8945
|
+
d[K] = k;
|
|
8946
8946
|
for (let R = 0; R < F; ++R) {
|
|
8947
8947
|
const L = o !== void 0 ? o.translation + R * a * o.scale : 0, M = new Array(D);
|
|
8948
8948
|
k[R] = M;
|
|
@@ -8965,7 +8965,7 @@ class xo {
|
|
|
8965
8965
|
c: 1
|
|
8966
8966
|
},
|
|
8967
8967
|
rowAlignmentBytes: 1,
|
|
8968
|
-
chunkIndex: { x: $, y: W, z: R, c:
|
|
8968
|
+
chunkIndex: { x: $, y: W, z: R, c: K, t: S },
|
|
8969
8969
|
scale: {
|
|
8970
8970
|
x: E.scale,
|
|
8971
8971
|
y: i.scale,
|
|
@@ -9005,7 +9005,7 @@ class xo {
|
|
|
9005
9005
|
loadChunkData(A, I) {
|
|
9006
9006
|
return this.loader_.loadChunkData(A, I);
|
|
9007
9007
|
}
|
|
9008
|
-
|
|
9008
|
+
addView(A) {
|
|
9009
9009
|
const I = new mo(this, A);
|
|
9010
9010
|
return this.views_.push(I), this.hasHadViews_ = !0, I;
|
|
9011
9011
|
}
|
|
@@ -9047,7 +9047,7 @@ class xo {
|
|
|
9047
9047
|
throw new Error(
|
|
9048
9048
|
`Chunk state inconsistency detected: priority is null but visible=${A.visible} or prefetch=${A.prefetch} for chunk ${JSON.stringify(A.chunkIndex)} in LOD ${A.lod}`
|
|
9049
9049
|
);
|
|
9050
|
-
Ko(A), A.state = "unloaded", A.orderKey = null,
|
|
9050
|
+
Ko(A), A.state = "unloaded", A.orderKey = null, H.debug(
|
|
9051
9051
|
"ChunkStore",
|
|
9052
9052
|
`Disposing chunk ${JSON.stringify(A.chunkIndex)} in LOD ${A.lod}`
|
|
9053
9053
|
);
|
|
@@ -9057,7 +9057,7 @@ class xo {
|
|
|
9057
9057
|
const A = this.dimensions_.x, I = this.dimensions_.y;
|
|
9058
9058
|
for (let g = 1; g < this.dimensions_.numLods; g++) {
|
|
9059
9059
|
const B = A.lods[g].scale / A.lods[g - 1].scale, Q = I.lods[g].scale / I.lods[g - 1].scale;
|
|
9060
|
-
if (!
|
|
9060
|
+
if (!eg(B, 2, 0.02) || !eg(Q, 2, 0.02))
|
|
9061
9061
|
throw new Error(
|
|
9062
9062
|
`Invalid downsampling factor between levels ${g - 1} → ${g}: expected (2× in X and Y), but got (${B.toFixed(2)}×, ${Q.toFixed(2)}×) from scale [${A.lods[g - 1].scale}, ${I.lods[g - 1].scale}] → [${A.lods[g].scale}, ${I.lods[g].scale}]`
|
|
9063
9063
|
);
|
|
@@ -9081,7 +9081,7 @@ class xo {
|
|
|
9081
9081
|
for (let A = 0; A < this.dimensions_.numLods; ++A) {
|
|
9082
9082
|
const I = this.dimensions_.c?.lods[A];
|
|
9083
9083
|
if (!I) continue;
|
|
9084
|
-
if (I.scale !== 1 &&
|
|
9084
|
+
if (I.scale !== 1 && H.warn(
|
|
9085
9085
|
"ChunkStore",
|
|
9086
9086
|
`Idetik does not make use of non-unity scale in c. Found ${I.scale} at LOD ${A}`
|
|
9087
9087
|
), I.translation !== 0)
|
|
@@ -9101,7 +9101,6 @@ class xo {
|
|
|
9101
9101
|
}
|
|
9102
9102
|
class bo {
|
|
9103
9103
|
stores_ = /* @__PURE__ */ new Map();
|
|
9104
|
-
pendingStores_ = /* @__PURE__ */ new Map();
|
|
9105
9104
|
queue_ = new fo();
|
|
9106
9105
|
get queueStats() {
|
|
9107
9106
|
return {
|
|
@@ -9112,32 +9111,9 @@ class bo {
|
|
|
9112
9111
|
get memoryStats() {
|
|
9113
9112
|
return Ho();
|
|
9114
9113
|
}
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
async getOrCreateStore(A) {
|
|
9119
|
-
const I = this.stores_.get(A);
|
|
9120
|
-
if (I)
|
|
9121
|
-
return I;
|
|
9122
|
-
const g = this.pendingStores_.get(A);
|
|
9123
|
-
if (g)
|
|
9124
|
-
return g;
|
|
9125
|
-
const Q = (async () => {
|
|
9126
|
-
const E = await A.open();
|
|
9127
|
-
return new xo(E);
|
|
9128
|
-
})();
|
|
9129
|
-
this.pendingStores_.set(A, Q);
|
|
9130
|
-
try {
|
|
9131
|
-
const E = await Q;
|
|
9132
|
-
return this.stores_.set(A, E), E;
|
|
9133
|
-
} catch (E) {
|
|
9134
|
-
throw K.error(
|
|
9135
|
-
"ChunkManager",
|
|
9136
|
-
`Failed to open chunk source: ${String(E)}`
|
|
9137
|
-
), E;
|
|
9138
|
-
} finally {
|
|
9139
|
-
this.pendingStores_.delete(A);
|
|
9140
|
-
}
|
|
9114
|
+
addView(A, I) {
|
|
9115
|
+
let g = this.stores_.get(A);
|
|
9116
|
+
return g || (g = new xo(A.getLoader()), this.stores_.set(A, g)), g.addView(I);
|
|
9141
9117
|
}
|
|
9142
9118
|
update() {
|
|
9143
9119
|
for (const [A, I] of this.stores_) {
|
|
@@ -9153,7 +9129,7 @@ class bo {
|
|
|
9153
9129
|
I.canDispose() && this.stores_.delete(A);
|
|
9154
9130
|
}
|
|
9155
9131
|
}
|
|
9156
|
-
var
|
|
9132
|
+
var KI = function(C = 1) {
|
|
9157
9133
|
var A = 0, I = document.createElement("div");
|
|
9158
9134
|
I.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", I.addEventListener("click", function(a) {
|
|
9159
9135
|
a.preventDefault(), B(++A % I.children.length);
|
|
@@ -9166,9 +9142,9 @@ var uI = function(C = 1) {
|
|
|
9166
9142
|
I.children[n].style.display = n === a ? "block" : "none";
|
|
9167
9143
|
A = a;
|
|
9168
9144
|
}
|
|
9169
|
-
var Q = (performance || Date).now(), E = Q, i = 0, o = g(new
|
|
9145
|
+
var Q = (performance || Date).now(), E = Q, i = 0, o = g(new KI.Panel("FPS", "#0ff", "#002", C)), s = g(new KI.Panel("MS", "#0f0", "#020", C));
|
|
9170
9146
|
if (self.performance && self.performance.memory)
|
|
9171
|
-
var t = g(new
|
|
9147
|
+
var t = g(new KI.Panel("MB", "#f08", "#201", C));
|
|
9172
9148
|
return B(0), {
|
|
9173
9149
|
REVISION: 16,
|
|
9174
9150
|
dom: I,
|
|
@@ -9194,25 +9170,25 @@ var uI = function(C = 1) {
|
|
|
9194
9170
|
setMode: B
|
|
9195
9171
|
};
|
|
9196
9172
|
};
|
|
9197
|
-
|
|
9173
|
+
KI.Panel = function(C, A, I, g) {
|
|
9198
9174
|
var B = 1 / 0, Q = 0, E = Math.round, i = E(window.devicePixelRatio || 1), o = E(80 * i * g), s = E(48 * i * g), t = E(3 * i * g), a = E(2 * i * g), n = E(3 * i * g), D = E(15 * i * g), F = E(74 * i * g), U = E(30 * i * g), S = document.createElement("canvas");
|
|
9199
9175
|
S.width = o, S.height = s, S.style.cssText = `width:${E(g * 80)}px;height:${E(g * 48)}px`;
|
|
9200
9176
|
var d = S.getContext("2d");
|
|
9201
9177
|
return d.font = "bold " + E(9 * i * g) + "px Helvetica,Arial,sans-serif", d.textBaseline = "top", d.fillStyle = I, d.fillRect(0, 0, o, s), d.fillStyle = A, d.fillText(C, t, a), d.fillRect(n, D, F, U), d.fillStyle = I, d.globalAlpha = 0.9, d.fillRect(n, D, F, U), {
|
|
9202
9178
|
dom: S,
|
|
9203
|
-
update: function(
|
|
9204
|
-
B = Math.min(B,
|
|
9179
|
+
update: function(K, k) {
|
|
9180
|
+
B = Math.min(B, K), Q = Math.max(Q, K), d.fillStyle = I, d.globalAlpha = 1, d.fillRect(0, 0, o, D), d.fillStyle = A, d.fillText(E(K) + " " + C + " (" + E(B) + "-" + E(Q) + ")", t, a), d.drawImage(S, n + i, D, F - i, U, n, D, F - i, U), d.fillRect(n + F - i, D, i, U), d.fillStyle = I, d.globalAlpha = 0.9, d.fillRect(n + F - i, D, i, E((1 - K / k) * U));
|
|
9205
9181
|
}
|
|
9206
9182
|
};
|
|
9207
9183
|
};
|
|
9208
9184
|
function To({ scale: C } = { scale: 1.5 }) {
|
|
9209
|
-
const A = new
|
|
9185
|
+
const A = new KI(C);
|
|
9210
9186
|
return A.showPanel(
|
|
9211
9187
|
0
|
|
9212
9188
|
/* 0 = fps, 1 = ms, 2 = mb */
|
|
9213
9189
|
), document.body.appendChild(A.dom), A;
|
|
9214
9190
|
}
|
|
9215
|
-
const
|
|
9191
|
+
const oB = [
|
|
9216
9192
|
"pointerdown",
|
|
9217
9193
|
"pointermove",
|
|
9218
9194
|
"pointerup",
|
|
@@ -9220,7 +9196,7 @@ const iB = [
|
|
|
9220
9196
|
"wheel"
|
|
9221
9197
|
];
|
|
9222
9198
|
function Wo(C) {
|
|
9223
|
-
return
|
|
9199
|
+
return oB.includes(C);
|
|
9224
9200
|
}
|
|
9225
9201
|
class vo {
|
|
9226
9202
|
propagationStopped_ = !1;
|
|
@@ -9250,14 +9226,14 @@ class Zo {
|
|
|
9250
9226
|
}
|
|
9251
9227
|
connect() {
|
|
9252
9228
|
if (this.isConnected_) {
|
|
9253
|
-
|
|
9229
|
+
H.warn(
|
|
9254
9230
|
"EventDispatcher",
|
|
9255
9231
|
"Attempted to connect already connected event dispatcher",
|
|
9256
9232
|
`element id: ${this.element_.id}`
|
|
9257
9233
|
);
|
|
9258
9234
|
return;
|
|
9259
9235
|
}
|
|
9260
|
-
this.isConnected_ = !0,
|
|
9236
|
+
this.isConnected_ = !0, oB.forEach((A) => {
|
|
9261
9237
|
this.element_.addEventListener(A, this.handleEvent, {
|
|
9262
9238
|
passive: !1
|
|
9263
9239
|
});
|
|
@@ -9265,20 +9241,20 @@ class Zo {
|
|
|
9265
9241
|
}
|
|
9266
9242
|
disconnect() {
|
|
9267
9243
|
if (!this.isConnected_) {
|
|
9268
|
-
|
|
9244
|
+
H.debug(
|
|
9269
9245
|
"EventDispatcher",
|
|
9270
9246
|
"Attempted to disconnect already disconnected event dispatcher",
|
|
9271
9247
|
`element id: ${this.element_.id}`
|
|
9272
9248
|
);
|
|
9273
9249
|
return;
|
|
9274
9250
|
}
|
|
9275
|
-
this.isConnected_ = !1,
|
|
9251
|
+
this.isConnected_ = !1, oB.forEach((A) => {
|
|
9276
9252
|
this.element_.removeEventListener(A, this.handleEvent);
|
|
9277
9253
|
});
|
|
9278
9254
|
}
|
|
9279
9255
|
handleEvent = (A) => {
|
|
9280
9256
|
if (!Wo(A.type)) {
|
|
9281
|
-
|
|
9257
|
+
H.error("EventDispatcher", `Unsupported event type ${A.type}`);
|
|
9282
9258
|
return;
|
|
9283
9259
|
}
|
|
9284
9260
|
const I = new vo(A.type, A);
|
|
@@ -9359,7 +9335,7 @@ class Po {
|
|
|
9359
9335
|
updateAspectRatio() {
|
|
9360
9336
|
const { width: A, height: I } = this.getBox().toRect();
|
|
9361
9337
|
if (A <= 0 || I <= 0) {
|
|
9362
|
-
|
|
9338
|
+
H.debug(
|
|
9363
9339
|
"Viewport",
|
|
9364
9340
|
`Skipping aspect ratio update for viewport ${this.id}: invalid dimensions ${A}x${I}`
|
|
9365
9341
|
);
|
|
@@ -9410,7 +9386,7 @@ class Oo {
|
|
|
9410
9386
|
}
|
|
9411
9387
|
connect() {
|
|
9412
9388
|
if (this.resizeObserver_) {
|
|
9413
|
-
|
|
9389
|
+
H.warn(
|
|
9414
9390
|
"PixelSizeObserver",
|
|
9415
9391
|
"Attempted to connect already connected observer"
|
|
9416
9392
|
);
|
|
@@ -9434,7 +9410,7 @@ class Oo {
|
|
|
9434
9410
|
}
|
|
9435
9411
|
disconnect() {
|
|
9436
9412
|
if (!this.resizeObserver_) {
|
|
9437
|
-
|
|
9413
|
+
H.warn(
|
|
9438
9414
|
"PixelSizeObserver",
|
|
9439
9415
|
"Attempted to disconnect already disconnected observer"
|
|
9440
9416
|
);
|
|
@@ -9444,7 +9420,7 @@ class Oo {
|
|
|
9444
9420
|
}
|
|
9445
9421
|
observe(A) {
|
|
9446
9422
|
if (this.elements_.includes(A)) {
|
|
9447
|
-
|
|
9423
|
+
H.warn("PixelSizeObserver", "Element already being observed");
|
|
9448
9424
|
return;
|
|
9449
9425
|
}
|
|
9450
9426
|
this.elements_.push(A), this.resizeObserver_ && this.resizeObserver_.observe(A);
|
|
@@ -9452,7 +9428,7 @@ class Oo {
|
|
|
9452
9428
|
unobserve(A) {
|
|
9453
9429
|
const I = this.elements_.indexOf(A);
|
|
9454
9430
|
if (I === -1) {
|
|
9455
|
-
|
|
9431
|
+
H.warn("PixelSizeObserver", "Element not being observed");
|
|
9456
9432
|
return;
|
|
9457
9433
|
}
|
|
9458
9434
|
this.elements_.splice(I, 1), this.resizeObserver_ && this.resizeObserver_.unobserve(A);
|
|
@@ -9575,18 +9551,18 @@ class _Q {
|
|
|
9575
9551
|
this.canvas,
|
|
9576
9552
|
this.context_
|
|
9577
9553
|
);
|
|
9578
|
-
return OQ(I, this.viewports_), this.viewports_.push(I), this.running && (I.events.connect(), I.element !== this.canvas && this.sizeObserver_.observe(I.element)),
|
|
9554
|
+
return OQ(I, this.viewports_), this.viewports_.push(I), this.running && (I.events.connect(), I.element !== this.canvas && this.sizeObserver_.observe(I.element)), H.info("Idetik", `Added viewport "${I.id}"`), I;
|
|
9579
9555
|
}
|
|
9580
9556
|
removeViewport(A) {
|
|
9581
9557
|
const I = this.viewports_.indexOf(A);
|
|
9582
|
-
return I === -1 ? (
|
|
9558
|
+
return I === -1 ? (H.warn(
|
|
9583
9559
|
"Idetik",
|
|
9584
9560
|
`Viewport "${A.id}" not found, nothing to remove`
|
|
9585
|
-
), !1) : (this.running && (A.events.disconnect(), A.element !== this.canvas && this.sizeObserver_.unobserve(A.element)), this.viewports_.splice(I, 1),
|
|
9561
|
+
), !1) : (this.running && (A.events.disconnect(), A.element !== this.canvas && this.sizeObserver_.unobserve(A.element)), this.viewports_.splice(I, 1), H.info("Idetik", `Removed viewport "${A.id}"`), !0);
|
|
9586
9562
|
}
|
|
9587
9563
|
start() {
|
|
9588
|
-
if (
|
|
9589
|
-
|
|
9564
|
+
if (H.info("Idetik", "Idetik runtime starting"), this.running)
|
|
9565
|
+
H.warn("Idetik", "Idetik runtime already started");
|
|
9590
9566
|
else {
|
|
9591
9567
|
for (const A of this.viewports_)
|
|
9592
9568
|
A.events.connect();
|
|
@@ -9610,8 +9586,8 @@ class _Q {
|
|
|
9610
9586
|
);
|
|
9611
9587
|
}
|
|
9612
9588
|
stop() {
|
|
9613
|
-
if (
|
|
9614
|
-
|
|
9589
|
+
if (H.info("Idetik", "Idetik runtime stopping"), !this.running)
|
|
9590
|
+
H.warn("Idetik", "Idetik runtime not started");
|
|
9615
9591
|
else {
|
|
9616
9592
|
this.sizeObserver_.disconnect();
|
|
9617
9593
|
for (const A of this.viewports_)
|
|
@@ -9643,7 +9619,7 @@ async function JC(C) {
|
|
|
9643
9619
|
throw new Error(`Unexpected response status ${C.status} ${C.statusText}`);
|
|
9644
9620
|
}
|
|
9645
9621
|
}
|
|
9646
|
-
class
|
|
9622
|
+
class vI {
|
|
9647
9623
|
url;
|
|
9648
9624
|
#A;
|
|
9649
9625
|
#I;
|
|
@@ -9698,9 +9674,9 @@ class WI {
|
|
|
9698
9674
|
return this.#A(this.#B(A, s));
|
|
9699
9675
|
}
|
|
9700
9676
|
}
|
|
9701
|
-
class
|
|
9677
|
+
class ZI extends Error {
|
|
9702
9678
|
}
|
|
9703
|
-
class kI extends
|
|
9679
|
+
class kI extends ZI {
|
|
9704
9680
|
_tag = "NotFoundError";
|
|
9705
9681
|
name = "NotFoundError";
|
|
9706
9682
|
path;
|
|
@@ -9709,7 +9685,7 @@ class kI extends vI {
|
|
|
9709
9685
|
super(`Not found: ${A}`, { cause: I.cause }), this.path = I.path, this.found = I.found;
|
|
9710
9686
|
}
|
|
9711
9687
|
}
|
|
9712
|
-
class nA extends
|
|
9688
|
+
class nA extends ZI {
|
|
9713
9689
|
_tag = "InvalidMetadataError";
|
|
9714
9690
|
name = "InvalidMetadataError";
|
|
9715
9691
|
path;
|
|
@@ -9717,7 +9693,7 @@ class nA extends vI {
|
|
|
9717
9693
|
super(A, { cause: I.cause }), this.path = I.path;
|
|
9718
9694
|
}
|
|
9719
9695
|
}
|
|
9720
|
-
class Xo extends
|
|
9696
|
+
class Xo extends ZI {
|
|
9721
9697
|
_tag = "UnknownCodecError";
|
|
9722
9698
|
name = "UnknownCodecError";
|
|
9723
9699
|
codec;
|
|
@@ -9725,7 +9701,7 @@ class Xo extends vI {
|
|
|
9725
9701
|
super(`Unknown codec: ${A}`), this.codec = A;
|
|
9726
9702
|
}
|
|
9727
9703
|
}
|
|
9728
|
-
class jo extends
|
|
9704
|
+
class jo extends ZI {
|
|
9729
9705
|
_tag = "CodecPipelineError";
|
|
9730
9706
|
name = "CodecPipelineError";
|
|
9731
9707
|
direction;
|
|
@@ -9740,7 +9716,7 @@ class jo extends vI {
|
|
|
9740
9716
|
super(I.join(" "), { cause: A.cause }), this.direction = A.direction, this.codec = A.codec, this.chunkPath = A.chunkPath;
|
|
9741
9717
|
}
|
|
9742
9718
|
}
|
|
9743
|
-
class pB extends
|
|
9719
|
+
class pB extends ZI {
|
|
9744
9720
|
_tag = "UnsupportedError";
|
|
9745
9721
|
name = "UnsupportedError";
|
|
9746
9722
|
feature;
|
|
@@ -9753,14 +9729,14 @@ function iI(C) {
|
|
|
9753
9729
|
throw new pB(`${C} encode`);
|
|
9754
9730
|
};
|
|
9755
9731
|
}
|
|
9756
|
-
class
|
|
9732
|
+
class ng {
|
|
9757
9733
|
kind = "array_to_array";
|
|
9758
9734
|
constructor(A, I) {
|
|
9759
9735
|
if (A.keepbits < 0)
|
|
9760
9736
|
throw new nA("keepbits must be zero or positive");
|
|
9761
9737
|
}
|
|
9762
9738
|
static fromConfig(A, I) {
|
|
9763
|
-
return new
|
|
9739
|
+
return new ng(A, I);
|
|
9764
9740
|
}
|
|
9765
9741
|
encode = iI("bitround");
|
|
9766
9742
|
/**
|
|
@@ -9859,7 +9835,7 @@ class xB {
|
|
|
9859
9835
|
yield this.get(A);
|
|
9860
9836
|
}
|
|
9861
9837
|
}
|
|
9862
|
-
class
|
|
9838
|
+
class PI {
|
|
9863
9839
|
#A;
|
|
9864
9840
|
chars;
|
|
9865
9841
|
constructor(A, I, g, B) {
|
|
@@ -9868,7 +9844,7 @@ class ZI {
|
|
|
9868
9844
|
else if (mB(I))
|
|
9869
9845
|
B && (B *= A), this.#A = new Int32Array(I, g, B);
|
|
9870
9846
|
else {
|
|
9871
|
-
const Q = I, E = new
|
|
9847
|
+
const Q = I, E = new PI(A, 1);
|
|
9872
9848
|
this.#A = new Int32Array((function* () {
|
|
9873
9849
|
for (let i of Q)
|
|
9874
9850
|
E.set(0, i), yield* E.#A;
|
|
@@ -9921,7 +9897,7 @@ function zo() {
|
|
|
9921
9897
|
function $o(C, A) {
|
|
9922
9898
|
return new SharedArrayBuffer(C);
|
|
9923
9899
|
}
|
|
9924
|
-
function
|
|
9900
|
+
function VI(C) {
|
|
9925
9901
|
const A = new TextDecoder().decode(C);
|
|
9926
9902
|
try {
|
|
9927
9903
|
return JSON.parse(A);
|
|
@@ -9942,7 +9918,7 @@ function UI(C) {
|
|
|
9942
9918
|
let A = C.match(/v2:([US])(\d+)/);
|
|
9943
9919
|
if (A) {
|
|
9944
9920
|
let [, g, B] = A;
|
|
9945
|
-
return (g === "U" ?
|
|
9921
|
+
return (g === "U" ? PI : xB).bind(null, Number(B));
|
|
9946
9922
|
}
|
|
9947
9923
|
if (C === "string")
|
|
9948
9924
|
return globalThis.Array;
|
|
@@ -10027,7 +10003,7 @@ function gs(C, A = {}) {
|
|
|
10027
10003
|
let o = Q.astype ?? Q.dtype;
|
|
10028
10004
|
if (o !== void 0 && o !== C.dtype) {
|
|
10029
10005
|
let s = MC(o).dataType;
|
|
10030
|
-
if (!
|
|
10006
|
+
if (!sB(s, "number") && !sB(s, "bigint"))
|
|
10031
10007
|
throw new nA(`fixedscaleoffset astype must be a numeric data type, got ${o}`);
|
|
10032
10008
|
I.push({
|
|
10033
10009
|
name: "cast_value",
|
|
@@ -10080,7 +10056,7 @@ function Bs(C, A = {}) {
|
|
|
10080
10056
|
attributes: A
|
|
10081
10057
|
};
|
|
10082
10058
|
}
|
|
10083
|
-
function
|
|
10059
|
+
function sB(C, A) {
|
|
10084
10060
|
if (A !== "number" && A !== "bigint" && A !== "boolean" && A !== "object" && A !== "string")
|
|
10085
10061
|
return C === A;
|
|
10086
10062
|
let I = C === "bool";
|
|
@@ -10144,7 +10120,7 @@ function Qs() {
|
|
|
10144
10120
|
function uC(C) {
|
|
10145
10121
|
return "BYTES_PER_ELEMENT" in C ? C.BYTES_PER_ELEMENT : 4;
|
|
10146
10122
|
}
|
|
10147
|
-
class
|
|
10123
|
+
class Lg {
|
|
10148
10124
|
kind = "array_to_bytes";
|
|
10149
10125
|
#A;
|
|
10150
10126
|
#I;
|
|
@@ -10157,7 +10133,7 @@ class lg {
|
|
|
10157
10133
|
this.#g = g.BYTES_PER_ELEMENT;
|
|
10158
10134
|
}
|
|
10159
10135
|
static fromConfig(A, I) {
|
|
10160
|
-
return new
|
|
10136
|
+
return new Lg(A, I);
|
|
10161
10137
|
}
|
|
10162
10138
|
encode(A) {
|
|
10163
10139
|
let I = new Uint8Array(A.data.buffer);
|
|
@@ -10183,10 +10159,10 @@ const KC = {
|
|
|
10183
10159
|
float32: 4,
|
|
10184
10160
|
float64: 8
|
|
10185
10161
|
};
|
|
10186
|
-
function
|
|
10162
|
+
function rg(C) {
|
|
10187
10163
|
return C in AE;
|
|
10188
10164
|
}
|
|
10189
|
-
function
|
|
10165
|
+
function tB(C) {
|
|
10190
10166
|
return C === "int64" || C === "uint64";
|
|
10191
10167
|
}
|
|
10192
10168
|
function Es(C, A) {
|
|
@@ -10198,18 +10174,18 @@ function Es(C, A) {
|
|
|
10198
10174
|
}
|
|
10199
10175
|
return A === 4 ? (B.setUint32(0, Number(I)), B.getFloat32(0)) : (B.setBigUint64(0, I), B.getFloat64(0));
|
|
10200
10176
|
}
|
|
10201
|
-
function
|
|
10202
|
-
if (
|
|
10177
|
+
function Dg(C, A) {
|
|
10178
|
+
if (tB(C)) {
|
|
10203
10179
|
if (typeof A != "number" || !Number.isInteger(A))
|
|
10204
10180
|
throw new nA(`Expected an integer value for data type "${C}", got ${JSON.stringify(A)}`);
|
|
10205
10181
|
return BigInt(A);
|
|
10206
10182
|
}
|
|
10207
10183
|
if (typeof A == "number") {
|
|
10208
|
-
if (!
|
|
10184
|
+
if (!rg(C) && !Number.isInteger(A))
|
|
10209
10185
|
throw new nA(`Expected an integer value for data type "${C}", got ${A}`);
|
|
10210
10186
|
return A;
|
|
10211
10187
|
}
|
|
10212
|
-
if (!
|
|
10188
|
+
if (!rg(C))
|
|
10213
10189
|
throw new nA(`String-encoded scalar "${A}" is not valid for non-float data type "${C}"`);
|
|
10214
10190
|
return A in KC ? KC[A] : Es(A, AE[C]);
|
|
10215
10191
|
}
|
|
@@ -10225,21 +10201,21 @@ const HC = /* @__PURE__ */ new Set([
|
|
|
10225
10201
|
"float16",
|
|
10226
10202
|
"float32",
|
|
10227
10203
|
"float64"
|
|
10228
|
-
]),
|
|
10204
|
+
]), Zg = {
|
|
10229
10205
|
int8: [-128, 2 ** 7 - 1],
|
|
10230
10206
|
uint8: [0, 2 ** 8 - 1],
|
|
10231
10207
|
int16: [-32768, 2 ** 15 - 1],
|
|
10232
10208
|
uint16: [0, 2 ** 16 - 1],
|
|
10233
10209
|
int32: [-2147483648, 2 ** 31 - 1],
|
|
10234
10210
|
uint32: [0, 2 ** 32 - 1]
|
|
10235
|
-
},
|
|
10211
|
+
}, Pg = {
|
|
10236
10212
|
int64: [-(2n ** 63n), 2n ** 63n - 1n],
|
|
10237
10213
|
uint64: [0n, 2n ** 64n - 1n]
|
|
10238
10214
|
};
|
|
10239
10215
|
function qC(C, A, I) {
|
|
10240
10216
|
return C.map(([g, B]) => ({
|
|
10241
|
-
src:
|
|
10242
|
-
tgt:
|
|
10217
|
+
src: Dg(A, g),
|
|
10218
|
+
tgt: Dg(I, B)
|
|
10243
10219
|
}));
|
|
10244
10220
|
}
|
|
10245
10221
|
function is(C, A) {
|
|
@@ -10276,7 +10252,7 @@ function pC(C) {
|
|
|
10276
10252
|
return ss;
|
|
10277
10253
|
}
|
|
10278
10254
|
}
|
|
10279
|
-
function
|
|
10255
|
+
function Vg(C, A, I) {
|
|
10280
10256
|
const g = A - C + 1;
|
|
10281
10257
|
switch (I) {
|
|
10282
10258
|
case "clamp":
|
|
@@ -10291,7 +10267,7 @@ function Pg(C, A, I) {
|
|
|
10291
10267
|
};
|
|
10292
10268
|
}
|
|
10293
10269
|
}
|
|
10294
|
-
function
|
|
10270
|
+
function Og(C, A, I) {
|
|
10295
10271
|
const g = A - C + 1n;
|
|
10296
10272
|
switch (I) {
|
|
10297
10273
|
case "clamp":
|
|
@@ -10338,21 +10314,21 @@ class bB {
|
|
|
10338
10314
|
}
|
|
10339
10315
|
}
|
|
10340
10316
|
function mC(C, A, I, g, B) {
|
|
10341
|
-
const Q =
|
|
10317
|
+
const Q = rg(C), E = tB(C), i = rg(A), o = tB(A);
|
|
10342
10318
|
let s;
|
|
10343
10319
|
if (Q && i) {
|
|
10344
10320
|
if (I !== "nearest-even")
|
|
10345
10321
|
throw new nA(`cast_value float -> float only supports "nearest-even" rounding, got "${I}"`);
|
|
10346
10322
|
s = (a) => a;
|
|
10347
10323
|
} else if (Q && !i && !o) {
|
|
10348
|
-
const a = pC(I), n =
|
|
10324
|
+
const a = pC(I), n = Vg(...Zg[A], g);
|
|
10349
10325
|
s = (D) => {
|
|
10350
10326
|
if (!Number.isFinite(D))
|
|
10351
10327
|
throw new Error(`Cannot cast ${D} to integer type without scalar_map`);
|
|
10352
10328
|
return n(a(D));
|
|
10353
10329
|
};
|
|
10354
10330
|
} else if (Q && o) {
|
|
10355
|
-
const a = pC(I), n =
|
|
10331
|
+
const a = pC(I), n = Og(...Pg[A], g);
|
|
10356
10332
|
s = (D) => {
|
|
10357
10333
|
if (!Number.isFinite(D))
|
|
10358
10334
|
throw new Error(`Cannot cast ${D} to integer type without scalar_map`);
|
|
@@ -10363,15 +10339,15 @@ function mC(C, A, I, g, B) {
|
|
|
10363
10339
|
else if (E && i)
|
|
10364
10340
|
s = (a) => Number(a);
|
|
10365
10341
|
else if (!Q && !E && !i && !o)
|
|
10366
|
-
s =
|
|
10342
|
+
s = Vg(...Zg[A], g);
|
|
10367
10343
|
else if (!Q && !E && o) {
|
|
10368
|
-
const a =
|
|
10344
|
+
const a = Og(...Pg[A], g);
|
|
10369
10345
|
s = (n) => a(BigInt(n));
|
|
10370
10346
|
} else if (E && !i && !o) {
|
|
10371
|
-
const a =
|
|
10347
|
+
const a = Vg(...Zg[A], g);
|
|
10372
10348
|
s = (n) => a(Number(n));
|
|
10373
10349
|
} else if (E && o)
|
|
10374
|
-
s =
|
|
10350
|
+
s = Og(...Pg[A], g);
|
|
10375
10351
|
else
|
|
10376
10352
|
throw new Error(`Unhandled type combination: ${C} -> ${A}`);
|
|
10377
10353
|
return B.length === 0 ? s : (a) => {
|
|
@@ -10463,7 +10439,7 @@ function as(C, A) {
|
|
|
10463
10439
|
function es(C, A) {
|
|
10464
10440
|
return A instanceof Object && !Array.isArray(A) ? Object.keys(A).sort().reduce((I, g) => (I[g] = A[g], I), {}) : A;
|
|
10465
10441
|
}
|
|
10466
|
-
class
|
|
10442
|
+
class hg {
|
|
10467
10443
|
configuration;
|
|
10468
10444
|
kind = "array_to_bytes";
|
|
10469
10445
|
#A;
|
|
@@ -10484,7 +10460,7 @@ class Dg {
|
|
|
10484
10460
|
}, this.#I = { strict: s };
|
|
10485
10461
|
}
|
|
10486
10462
|
static fromConfig(A) {
|
|
10487
|
-
return new
|
|
10463
|
+
return new hg(A);
|
|
10488
10464
|
}
|
|
10489
10465
|
encode(A) {
|
|
10490
10466
|
const { indent: I, encoding: g, ensure_ascii: B, check_circular: Q, allow_nan: E, sort_keys: i } = this.#A;
|
|
@@ -10509,7 +10485,7 @@ class Dg {
|
|
|
10509
10485
|
decode(A) {
|
|
10510
10486
|
const { strict: I } = this.#I;
|
|
10511
10487
|
RA(I, "JsonCodec does not yet support non-strict decoding.");
|
|
10512
|
-
const g =
|
|
10488
|
+
const g = VI(A), B = g.pop();
|
|
10513
10489
|
g.pop(), RA(B, "0D not implemented for JsonCodec.");
|
|
10514
10490
|
const Q = CI(B, "C");
|
|
10515
10491
|
return { data: g, shape: B, stride: Q };
|
|
@@ -10539,7 +10515,7 @@ class ZB {
|
|
|
10539
10515
|
static fromConfig(A, I) {
|
|
10540
10516
|
if (!ns.has(I.dataType))
|
|
10541
10517
|
throw new nA(`scale_offset codec does not support data type: ${I.dataType}`);
|
|
10542
|
-
return new ZB(
|
|
10518
|
+
return new ZB(Dg(I.dataType, A.scale ?? 1), Dg(I.dataType, A.offset ?? 0), UI(I.dataType));
|
|
10543
10519
|
}
|
|
10544
10520
|
encode = iI("scale_offset");
|
|
10545
10521
|
decode(A) {
|
|
@@ -10584,7 +10560,7 @@ function Ds(C, A) {
|
|
|
10584
10560
|
return B;
|
|
10585
10561
|
}
|
|
10586
10562
|
function bC(C) {
|
|
10587
|
-
return C instanceof XQ || C instanceof xB || C instanceof
|
|
10563
|
+
return C instanceof XQ || C instanceof xB || C instanceof PI ? new Proxy(C, {
|
|
10588
10564
|
get(I, g) {
|
|
10589
10565
|
return I.get(Number(g));
|
|
10590
10566
|
},
|
|
@@ -10595,7 +10571,7 @@ function bC(C) {
|
|
|
10595
10571
|
}
|
|
10596
10572
|
function hs(C, A) {
|
|
10597
10573
|
let I;
|
|
10598
|
-
return C.data instanceof xB || C.data instanceof
|
|
10574
|
+
return C.data instanceof xB || C.data instanceof PI ? I = new C.constructor(
|
|
10599
10575
|
// @ts-expect-error
|
|
10600
10576
|
C.data.length,
|
|
10601
10577
|
C.data.chars
|
|
@@ -10661,7 +10637,7 @@ class VB {
|
|
|
10661
10637
|
};
|
|
10662
10638
|
}
|
|
10663
10639
|
}
|
|
10664
|
-
class
|
|
10640
|
+
class yg {
|
|
10665
10641
|
kind = "array_to_bytes";
|
|
10666
10642
|
#A;
|
|
10667
10643
|
#I;
|
|
@@ -10669,7 +10645,7 @@ class hg {
|
|
|
10669
10645
|
this.#A = A, this.#I = CI(A, "C");
|
|
10670
10646
|
}
|
|
10671
10647
|
static fromConfig(A, I) {
|
|
10672
|
-
return new
|
|
10648
|
+
return new yg(I.shape);
|
|
10673
10649
|
}
|
|
10674
10650
|
encode = iI("vlen-utf8");
|
|
10675
10651
|
decode(A) {
|
|
@@ -10694,10 +10670,10 @@ class OB {
|
|
|
10694
10670
|
}
|
|
10695
10671
|
function Gs() {
|
|
10696
10672
|
let C = () => import("./blosc-D1xNXZJs.js").then((Q) => Q.default), A = () => import("./lz4-1Ws5oVWR.js").then((Q) => Q.default), I = () => import("./zstd-C4EcZnjq.js").then((Q) => Q.default), g = () => vB, B = () => OB;
|
|
10697
|
-
return (/* @__PURE__ */ new Map()).set("blosc", C).set("lz4", A).set("zstd", I).set("gzip", g).set("zlib", B).set("transpose", () => VB).set("bytes", () =>
|
|
10673
|
+
return (/* @__PURE__ */ new Map()).set("blosc", C).set("lz4", A).set("zstd", I).set("gzip", g).set("zlib", B).set("transpose", () => VB).set("bytes", () => Lg).set("crc32c", () => TB).set("vlen-utf8", () => yg).set("json2", () => hg).set("bitround", () => ng).set("cast_value", () => bB).set("scale_offset", () => ZB).set("numcodecs.blosc", C).set("numcodecs.lz4", A).set("numcodecs.zstd", I).set("numcodecs.gzip", g).set("numcodecs.zlib", B).set("numcodecs.vlen-utf8", () => yg).set("numcodecs.shuffle", () => PB).set("numcodecs.delta", () => WB).set("numcodecs.bitround", () => ng).set("numcodecs.json2", () => hg);
|
|
10698
10674
|
}
|
|
10699
10675
|
const Fs = Gs();
|
|
10700
|
-
function
|
|
10676
|
+
function aB(C) {
|
|
10701
10677
|
let A;
|
|
10702
10678
|
function I() {
|
|
10703
10679
|
return A || (A = Ss(C)), A;
|
|
@@ -10779,7 +10755,7 @@ async function Ss(C) {
|
|
|
10779
10755
|
throw new nA(`Cannot encode ${Q.dataType} to bytes without a codec`);
|
|
10780
10756
|
g = {
|
|
10781
10757
|
name: "bytes",
|
|
10782
|
-
codec:
|
|
10758
|
+
codec: Lg.fromConfig({ endian: "little" }, Q)
|
|
10783
10759
|
};
|
|
10784
10760
|
}
|
|
10785
10761
|
return {
|
|
@@ -10795,7 +10771,7 @@ const WC = 18446744073709551615n;
|
|
|
10795
10771
|
function Rs(C, A, I, g) {
|
|
10796
10772
|
if (!C.store.getRange)
|
|
10797
10773
|
throw new pB("sharding requires a store with getRange");
|
|
10798
|
-
let B = C.store.getRange.bind(C.store), Q = A.map((s, t) => s / g.chunk_shape[t]), E =
|
|
10774
|
+
let B = C.store.getRange.bind(C.store), Q = A.map((s, t) => s / g.chunk_shape[t]), E = aB({
|
|
10799
10775
|
dataType: "uint64",
|
|
10800
10776
|
shape: [...Q, 2],
|
|
10801
10777
|
codecs: g.index_codecs,
|
|
@@ -10812,10 +10788,10 @@ function Rs(C, A, I, g) {
|
|
|
10812
10788
|
let D = await o[n];
|
|
10813
10789
|
if (D === null)
|
|
10814
10790
|
return;
|
|
10815
|
-
let { data: F, shape: U, stride: S } = D, d = s.map((R, L) => R % U[L]).reduce((R, L, M) => R + L * S[M], 0),
|
|
10816
|
-
if (!(
|
|
10791
|
+
let { data: F, shape: U, stride: S } = D, d = s.map((R, L) => R % U[L]).reduce((R, L, M) => R + L * S[M], 0), K = F[d], k = F[d + 1];
|
|
10792
|
+
if (!(K === WC && k === WC))
|
|
10817
10793
|
return B(n, {
|
|
10818
|
-
offset: Number(
|
|
10794
|
+
offset: Number(K),
|
|
10819
10795
|
length: Number(k)
|
|
10820
10796
|
}, t);
|
|
10821
10797
|
};
|
|
@@ -10844,7 +10820,7 @@ class _B extends lA {
|
|
|
10844
10820
|
function vC(C) {
|
|
10845
10821
|
return C.find((I) => I.name === "transpose")?.configuration?.order ?? "C";
|
|
10846
10822
|
}
|
|
10847
|
-
const
|
|
10823
|
+
const zI = Symbol("zarrita.context");
|
|
10848
10824
|
function ks(C, A) {
|
|
10849
10825
|
let { configuration: I } = A.codecs.find(Cs) ?? {}, g = {
|
|
10850
10826
|
encodeChunkKey: As(A.chunk_key_encoding),
|
|
@@ -10857,7 +10833,7 @@ function ks(C, A) {
|
|
|
10857
10833
|
...g,
|
|
10858
10834
|
kind: "sharded",
|
|
10859
10835
|
chunkShape: I.chunk_shape,
|
|
10860
|
-
codec:
|
|
10836
|
+
codec: aB({
|
|
10861
10837
|
dataType: A.data_type,
|
|
10862
10838
|
shape: I.chunk_shape,
|
|
10863
10839
|
codecs: I.codecs,
|
|
@@ -10874,7 +10850,7 @@ function ks(C, A) {
|
|
|
10874
10850
|
...g,
|
|
10875
10851
|
kind: "regular",
|
|
10876
10852
|
chunkShape: A.chunk_grid.configuration.chunk_shape,
|
|
10877
|
-
codec:
|
|
10853
|
+
codec: aB({
|
|
10878
10854
|
dataType: A.data_type,
|
|
10879
10855
|
shape: A.chunk_grid.configuration.chunk_shape,
|
|
10880
10856
|
codecs: A.codecs,
|
|
@@ -10889,15 +10865,15 @@ function ks(C, A) {
|
|
|
10889
10865
|
}
|
|
10890
10866
|
};
|
|
10891
10867
|
}
|
|
10892
|
-
let
|
|
10868
|
+
let cg = class extends lA {
|
|
10893
10869
|
kind = "array";
|
|
10894
10870
|
#A;
|
|
10895
|
-
[
|
|
10871
|
+
[zI];
|
|
10896
10872
|
constructor(A, I, g) {
|
|
10897
10873
|
super(A, I), this.#A = {
|
|
10898
10874
|
...g,
|
|
10899
10875
|
fill_value: jQ(g)
|
|
10900
|
-
}, this[
|
|
10876
|
+
}, this[zI] = ks(this, this.#A);
|
|
10901
10877
|
}
|
|
10902
10878
|
get attrs() {
|
|
10903
10879
|
return this.#A.attributes;
|
|
@@ -10912,14 +10888,14 @@ let yg = class extends lA {
|
|
|
10912
10888
|
return this.#A.shape;
|
|
10913
10889
|
}
|
|
10914
10890
|
get chunks() {
|
|
10915
|
-
return this[
|
|
10891
|
+
return this[zI].chunkShape;
|
|
10916
10892
|
}
|
|
10917
10893
|
get dtype() {
|
|
10918
10894
|
return this.#A.data_type;
|
|
10919
10895
|
}
|
|
10920
10896
|
async getChunk(A, I, g) {
|
|
10921
10897
|
g?.useSharedArrayBuffer && zo();
|
|
10922
|
-
let B = this[
|
|
10898
|
+
let B = this[zI], Q = await B.getChunkBytes(A, I);
|
|
10923
10899
|
if (!Q) {
|
|
10924
10900
|
let E = B.chunkShape.reduce((o, s) => o * s, 1), i;
|
|
10925
10901
|
if (g?.useSharedArrayBuffer) {
|
|
@@ -10958,7 +10934,7 @@ let yg = class extends lA {
|
|
|
10958
10934
|
* ```
|
|
10959
10935
|
*/
|
|
10960
10936
|
is(A) {
|
|
10961
|
-
return
|
|
10937
|
+
return sB(this.dtype, A);
|
|
10962
10938
|
}
|
|
10963
10939
|
};
|
|
10964
10940
|
function Us(C, A) {
|
|
@@ -10974,7 +10950,7 @@ async function IE(C) {
|
|
|
10974
10950
|
let A = C.store.arrayExtensions;
|
|
10975
10951
|
return A?.length ? await ds(C, ...A) : C;
|
|
10976
10952
|
}
|
|
10977
|
-
let
|
|
10953
|
+
let Jg = ls();
|
|
10978
10954
|
function ls() {
|
|
10979
10955
|
let C = /* @__PURE__ */ new WeakMap();
|
|
10980
10956
|
function A(I) {
|
|
@@ -10995,7 +10971,7 @@ async function Ls(C, A) {
|
|
|
10995
10971
|
let I = await C.store.get(C.resolve(".zattrs").path, {
|
|
10996
10972
|
signal: A
|
|
10997
10973
|
});
|
|
10998
|
-
return I ?
|
|
10974
|
+
return I ? VI(I) : {};
|
|
10999
10975
|
}
|
|
11000
10976
|
async function Js(C, A = {}) {
|
|
11001
10977
|
let I = "store" in C ? C : new lA(C), { signal: g } = A, B = {};
|
|
@@ -11005,33 +10981,33 @@ async function ZC(C, A, I) {
|
|
|
11005
10981
|
let { path: g } = C.resolve(".zarray"), B = await C.store.get(g, { signal: I });
|
|
11006
10982
|
if (!B)
|
|
11007
10983
|
throw new kI("v2 array", { path: g });
|
|
11008
|
-
return
|
|
10984
|
+
return Jg.increment(C.store, "v2"), IE(new cg(C.store, C.path, gs(VI(B), A)));
|
|
11009
10985
|
}
|
|
11010
10986
|
async function PC(C, A, I) {
|
|
11011
10987
|
let { path: g } = C.resolve(".zgroup"), B = await C.store.get(g, { signal: I });
|
|
11012
10988
|
if (!B)
|
|
11013
10989
|
throw new kI("v2 group", { path: g });
|
|
11014
|
-
return
|
|
10990
|
+
return Jg.increment(C.store, "v2"), new _B(C.store, C.path, Bs(VI(B), A));
|
|
11015
10991
|
}
|
|
11016
10992
|
async function Ys(C, A) {
|
|
11017
10993
|
let { store: I, path: g } = C.resolve("zarr.json"), B = await C.store.get(g, { signal: A });
|
|
11018
10994
|
if (!B)
|
|
11019
10995
|
throw new kI("v3 array or group", { path: g });
|
|
11020
|
-
let Q =
|
|
11021
|
-
return Q.node_type === "array" && (Q.fill_value = jQ(Q)), Q.node_type === "array" ? IE(new
|
|
10996
|
+
let Q = VI(B);
|
|
10997
|
+
return Q.node_type === "array" && (Q.fill_value = jQ(Q)), Q.node_type === "array" ? IE(new cg(I, C.path, Q)) : new _B(I, C.path, Q);
|
|
11022
10998
|
}
|
|
11023
10999
|
async function Ms(C, A = {}) {
|
|
11024
11000
|
let I = "store" in C ? C : new lA(C), g = await Ys(I, A.signal);
|
|
11025
|
-
if (
|
|
11001
|
+
if (Jg.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && g instanceof cg || A.kind === "group" && g instanceof _B)
|
|
11026
11002
|
return g;
|
|
11027
|
-
let B = g instanceof
|
|
11003
|
+
let B = g instanceof cg ? "array" : "group";
|
|
11028
11004
|
throw new kI(`${A.kind} at ${I.path}`, {
|
|
11029
11005
|
path: I.path,
|
|
11030
11006
|
found: B
|
|
11031
11007
|
});
|
|
11032
11008
|
}
|
|
11033
11009
|
async function UA(C, A = {}) {
|
|
11034
|
-
let I = "store" in C ? C.store : C, g =
|
|
11010
|
+
let I = "store" in C ? C.store : C, g = Jg.versionMax(I), B = g === "v2" ? UA.v2 : UA.v3, Q = g === "v2" ? UA.v3 : UA.v2;
|
|
11035
11011
|
return B(C, A).catch((E) => (zQ(E, kI, nA), Q(C, A)));
|
|
11036
11012
|
}
|
|
11037
11013
|
UA.v2 = Js;
|
|
@@ -11063,7 +11039,7 @@ class XB {
|
|
|
11063
11039
|
return new Uint8Array(B);
|
|
11064
11040
|
}
|
|
11065
11041
|
}
|
|
11066
|
-
async function
|
|
11042
|
+
async function OI(C, A) {
|
|
11067
11043
|
if (A === "v2")
|
|
11068
11044
|
try {
|
|
11069
11045
|
return UA.v2(C, { kind: "group", attrs: !0 });
|
|
@@ -11105,7 +11081,7 @@ async function Ks(C) {
|
|
|
11105
11081
|
let A;
|
|
11106
11082
|
switch (C.type) {
|
|
11107
11083
|
case "fetch": {
|
|
11108
|
-
const g = new
|
|
11084
|
+
const g = new vI(C.url);
|
|
11109
11085
|
A = new lA(g);
|
|
11110
11086
|
break;
|
|
11111
11087
|
}
|
|
@@ -11125,7 +11101,7 @@ async function Ks(C) {
|
|
|
11125
11101
|
return us(I, C.zarrVersion);
|
|
11126
11102
|
}
|
|
11127
11103
|
function Hs(C, A, I) {
|
|
11128
|
-
if (C.store instanceof
|
|
11104
|
+
if (C.store instanceof vI)
|
|
11129
11105
|
return {
|
|
11130
11106
|
type: "fetch",
|
|
11131
11107
|
arrayPath: A,
|
|
@@ -11171,10 +11147,10 @@ function ps(C, A, I, g) {
|
|
|
11171
11147
|
return C;
|
|
11172
11148
|
const d = new C.constructor(
|
|
11173
11149
|
a
|
|
11174
|
-
),
|
|
11150
|
+
), K = E.z !== void 0 ? I[E.z] : 0, k = I[E.y];
|
|
11175
11151
|
let R = 0;
|
|
11176
11152
|
for (let L = 0; L < B.z; L++) {
|
|
11177
|
-
const M = F + L *
|
|
11153
|
+
const M = F + L * K;
|
|
11178
11154
|
for (let W = 0; W < B.y; W++) {
|
|
11179
11155
|
const IA = M + W * k, CA = IA + B.x;
|
|
11180
11156
|
d.set(C.subarray(IA, CA), R), R += B.x;
|
|
@@ -14860,10 +14836,10 @@ function ms(C) {
|
|
|
14860
14836
|
}
|
|
14861
14837
|
const xs = Math.max(1, navigator.hardwareConcurrency - 2);
|
|
14862
14838
|
let MA = [], bs = 0, BE = 0;
|
|
14863
|
-
const QI = /* @__PURE__ */ new Map(),
|
|
14839
|
+
const QI = /* @__PURE__ */ new Map(), wg = /* @__PURE__ */ new Set();
|
|
14864
14840
|
function CE(C) {
|
|
14865
14841
|
const A = MA.find((I) => I.worker === C);
|
|
14866
|
-
return A ||
|
|
14842
|
+
return A || H.error(
|
|
14867
14843
|
"ZarrWorker",
|
|
14868
14844
|
"Worker not found in pool - this should not happen"
|
|
14869
14845
|
), A;
|
|
@@ -14871,7 +14847,7 @@ function CE(C) {
|
|
|
14871
14847
|
function Ts(C, A) {
|
|
14872
14848
|
const { id: I, success: g } = C.data, B = QI.get(I);
|
|
14873
14849
|
if (!B) {
|
|
14874
|
-
|
|
14850
|
+
wg.has(I) ? wg.delete(I) : H.warn(
|
|
14875
14851
|
"ZarrWorker",
|
|
14876
14852
|
`Received response for unknown message ID ${I}:`,
|
|
14877
14853
|
C.data
|
|
@@ -14880,20 +14856,20 @@ function Ts(C, A) {
|
|
|
14880
14856
|
}
|
|
14881
14857
|
QI.delete(I), B.abortListener && B.abortSignal && B.abortSignal.removeEventListener("abort", B.abortListener);
|
|
14882
14858
|
const Q = CE(A);
|
|
14883
|
-
Q && Q.pendingCount > 0 ? Q.pendingCount-- : Q &&
|
|
14859
|
+
Q && Q.pendingCount > 0 ? Q.pendingCount-- : Q && H.error(
|
|
14884
14860
|
"ZarrWorker",
|
|
14885
14861
|
"Received message but no pending tasks - this should not happen"
|
|
14886
14862
|
), g && C.data.type === "getChunk" ? B.resolve(C.data.data) : g || B.reject(new Error(C.data.error || "Unknown worker error"));
|
|
14887
14863
|
}
|
|
14888
14864
|
function OC(C, A) {
|
|
14889
14865
|
if (C instanceof MessageEvent) {
|
|
14890
|
-
|
|
14866
|
+
H.error(
|
|
14891
14867
|
"ZarrWorker",
|
|
14892
14868
|
"Message serialization error occurred - worker remains active"
|
|
14893
14869
|
);
|
|
14894
14870
|
return;
|
|
14895
14871
|
}
|
|
14896
|
-
|
|
14872
|
+
H.error(
|
|
14897
14873
|
"ZarrWorker",
|
|
14898
14874
|
"Worker failed - replacing worker and canceling its in-flight messages",
|
|
14899
14875
|
C.message
|
|
@@ -14913,9 +14889,9 @@ function OC(C, A) {
|
|
|
14913
14889
|
worker: B,
|
|
14914
14890
|
pendingCount: 0,
|
|
14915
14891
|
workerId: BE++
|
|
14916
|
-
}),
|
|
14892
|
+
}), H.debug("ZarrWorker", "Replacement worker created successfully");
|
|
14917
14893
|
} catch (B) {
|
|
14918
|
-
|
|
14894
|
+
H.error("ZarrWorker", "Failed to create replacement worker", B);
|
|
14919
14895
|
}
|
|
14920
14896
|
}
|
|
14921
14897
|
function QE() {
|
|
@@ -14942,10 +14918,10 @@ async function vs(C, A, I, g) {
|
|
|
14942
14918
|
E.worker.postMessage({
|
|
14943
14919
|
id: i,
|
|
14944
14920
|
type: "cancel"
|
|
14945
|
-
}), QI.delete(i),
|
|
14921
|
+
}), QI.delete(i), wg.add(i), E.pendingCount--, Q(new DOMException("Operation was aborted", "AbortError"));
|
|
14946
14922
|
};
|
|
14947
14923
|
if (g.signal.aborted) {
|
|
14948
|
-
s(),
|
|
14924
|
+
s(), wg.delete(i);
|
|
14949
14925
|
return;
|
|
14950
14926
|
}
|
|
14951
14927
|
g.signal.addEventListener("abort", s, { once: !0 }), o.abortListener = s, o.abortSignal = g.signal;
|
|
@@ -14970,12 +14946,12 @@ function Zs() {
|
|
|
14970
14946
|
workerId: BE++
|
|
14971
14947
|
});
|
|
14972
14948
|
}
|
|
14973
|
-
|
|
14949
|
+
H.debug(
|
|
14974
14950
|
"ZarrWorker",
|
|
14975
14951
|
`Initialized worker pool with ${MA.length} workers`
|
|
14976
14952
|
);
|
|
14977
14953
|
} catch {
|
|
14978
|
-
|
|
14954
|
+
H.warn("ZarrWorker", "Failed to create workers - clearing pool"), Vs();
|
|
14979
14955
|
return;
|
|
14980
14956
|
}
|
|
14981
14957
|
}
|
|
@@ -14991,7 +14967,7 @@ async function Ps(C, A, I, g, B) {
|
|
|
14991
14967
|
} catch (Q) {
|
|
14992
14968
|
if (Q instanceof DOMException && Q.name === "AbortError")
|
|
14993
14969
|
throw Q;
|
|
14994
|
-
|
|
14970
|
+
H.warn("ZarrWorker", "Falling back to main thread", Q);
|
|
14995
14971
|
const E = await C.getChunk(I, B);
|
|
14996
14972
|
if (!qo(E.data))
|
|
14997
14973
|
throw new Error(
|
|
@@ -15065,12 +15041,12 @@ function _s(C, A) {
|
|
|
15065
15041
|
const I = C.axes.map((a) => a.name), g = C.axes.length, B = _C(I, "x"), Q = _C(I, "y"), E = (a, n) => {
|
|
15066
15042
|
const D = [];
|
|
15067
15043
|
for (let F = 0; F < C.datasets.length; F++) {
|
|
15068
|
-
const U = C.datasets[F], S = A[F], d = U.coordinateTransformations[0].scale,
|
|
15044
|
+
const U = C.datasets[F], S = A[F], d = U.coordinateTransformations[0].scale, K = U.coordinateTransformations.length === 2 ? U.coordinateTransformations[1].translation : new Array(g).fill(0);
|
|
15069
15045
|
D.push({
|
|
15070
15046
|
size: S.shape[n],
|
|
15071
15047
|
chunkSize: S.chunks[n],
|
|
15072
15048
|
scale: d[n],
|
|
15073
|
-
translation:
|
|
15049
|
+
translation: K[n]
|
|
15074
15050
|
});
|
|
15075
15051
|
}
|
|
15076
15052
|
if (C.axes[n].type === "space" && js(D))
|
|
@@ -15085,25 +15061,25 @@ function _s(C, A) {
|
|
|
15085
15061
|
x: E(I[B], B),
|
|
15086
15062
|
y: E(I[Q], Q),
|
|
15087
15063
|
numLods: A.length
|
|
15088
|
-
}, o =
|
|
15064
|
+
}, o = gg(I, "z");
|
|
15089
15065
|
o !== -1 && (i.z = E(I[o], o));
|
|
15090
|
-
const s =
|
|
15066
|
+
const s = gg(I, "c");
|
|
15091
15067
|
s !== -1 && (i.c = E(I[s], s));
|
|
15092
|
-
const t =
|
|
15068
|
+
const t = gg(I, "t");
|
|
15093
15069
|
return t !== -1 && (i.t = E(I[t], t)), i;
|
|
15094
15070
|
}
|
|
15095
15071
|
function Xs(C, A) {
|
|
15096
15072
|
return C.toLowerCase() === A.toLowerCase();
|
|
15097
15073
|
}
|
|
15098
15074
|
function _C(C, A) {
|
|
15099
|
-
const I =
|
|
15075
|
+
const I = gg(C, A);
|
|
15100
15076
|
if (I === -1)
|
|
15101
15077
|
throw new Error(
|
|
15102
15078
|
`Could not find "${A}" dimension in [${C.join(", ")}]`
|
|
15103
15079
|
);
|
|
15104
15080
|
return I;
|
|
15105
15081
|
}
|
|
15106
|
-
function
|
|
15082
|
+
function gg(C, A) {
|
|
15107
15083
|
return C.findIndex((I) => Xs(I, A));
|
|
15108
15084
|
}
|
|
15109
15085
|
function js(C) {
|
|
@@ -15283,7 +15259,7 @@ class WA extends Error {
|
|
|
15283
15259
|
}
|
|
15284
15260
|
}
|
|
15285
15261
|
WA.create = (C) => new WA(C);
|
|
15286
|
-
const
|
|
15262
|
+
const eB = (C, A) => {
|
|
15287
15263
|
let I;
|
|
15288
15264
|
switch (C.code) {
|
|
15289
15265
|
case l.invalid_type:
|
|
@@ -15339,7 +15315,7 @@ const aB = (C, A) => {
|
|
|
15339
15315
|
}
|
|
15340
15316
|
return { message: I };
|
|
15341
15317
|
};
|
|
15342
|
-
let zs =
|
|
15318
|
+
let zs = eB;
|
|
15343
15319
|
function $s() {
|
|
15344
15320
|
return zs;
|
|
15345
15321
|
}
|
|
@@ -15376,7 +15352,7 @@ function Y(C, A) {
|
|
|
15376
15352
|
// then schema-bound map if available
|
|
15377
15353
|
I,
|
|
15378
15354
|
// then global override map
|
|
15379
|
-
I ===
|
|
15355
|
+
I === eB ? void 0 : eB
|
|
15380
15356
|
// then global default map
|
|
15381
15357
|
].filter((B) => !!B)
|
|
15382
15358
|
});
|
|
@@ -15425,7 +15401,7 @@ class kA {
|
|
|
15425
15401
|
}
|
|
15426
15402
|
const m = Object.freeze({
|
|
15427
15403
|
status: "aborted"
|
|
15428
|
-
}), YI = (C) => ({ status: "dirty", value: C }), JA = (C) => ({ status: "valid", value: C }), jC = (C) => C.status === "aborted", zC = (C) => C.status === "dirty", hI = (C) => C.status === "valid",
|
|
15404
|
+
}), YI = (C) => ({ status: "dirty", value: C }), JA = (C) => ({ status: "valid", value: C }), jC = (C) => C.status === "aborted", zC = (C) => C.status === "dirty", hI = (C) => C.status === "valid", Gg = (C) => typeof Promise < "u" && C instanceof Promise;
|
|
15429
15405
|
var u;
|
|
15430
15406
|
(function(C) {
|
|
15431
15407
|
C.errToObj = (A) => typeof A == "string" ? { message: A } : A || {}, C.toString = (A) => typeof A == "string" ? A : A?.message;
|
|
@@ -15496,7 +15472,7 @@ class Z {
|
|
|
15496
15472
|
}
|
|
15497
15473
|
_parseSync(A) {
|
|
15498
15474
|
const I = this._parse(A);
|
|
15499
|
-
if (
|
|
15475
|
+
if (Gg(I))
|
|
15500
15476
|
throw new Error("Synchronous parse encountered promise.");
|
|
15501
15477
|
return I;
|
|
15502
15478
|
}
|
|
@@ -15575,7 +15551,7 @@ class Z {
|
|
|
15575
15551
|
parent: null,
|
|
15576
15552
|
data: A,
|
|
15577
15553
|
parsedType: vA(A)
|
|
15578
|
-
}, B = this._parse({ data: A, path: g.path, parent: g }), Q = await (
|
|
15554
|
+
}, B = this._parse({ data: A, path: g.path, parent: g }), Q = await (Gg(B) ? B : Promise.resolve(B));
|
|
15579
15555
|
return $C(g, Q);
|
|
15580
15556
|
}
|
|
15581
15557
|
refine(A, I) {
|
|
@@ -15621,13 +15597,13 @@ class Z {
|
|
|
15621
15597
|
return pA.create(this);
|
|
15622
15598
|
}
|
|
15623
15599
|
promise() {
|
|
15624
|
-
return
|
|
15600
|
+
return Rg.create(this, this._def);
|
|
15625
15601
|
}
|
|
15626
15602
|
or(A) {
|
|
15627
|
-
return
|
|
15603
|
+
return Sg.create([this, A], this._def);
|
|
15628
15604
|
}
|
|
15629
15605
|
and(A) {
|
|
15630
|
-
return
|
|
15606
|
+
return Ng.create(this, A, this._def);
|
|
15631
15607
|
}
|
|
15632
15608
|
transform(A) {
|
|
15633
15609
|
return new wI({
|
|
@@ -15639,7 +15615,7 @@ class Z {
|
|
|
15639
15615
|
}
|
|
15640
15616
|
default(A) {
|
|
15641
15617
|
const I = typeof A == "function" ? A : () => A;
|
|
15642
|
-
return new
|
|
15618
|
+
return new yB({
|
|
15643
15619
|
...b(this._def),
|
|
15644
15620
|
innerType: this,
|
|
15645
15621
|
defaultValue: I,
|
|
@@ -15655,7 +15631,7 @@ class Z {
|
|
|
15655
15631
|
}
|
|
15656
15632
|
catch(A) {
|
|
15657
15633
|
const I = typeof A == "function" ? A : () => A;
|
|
15658
|
-
return new
|
|
15634
|
+
return new cB({
|
|
15659
15635
|
...b(this._def),
|
|
15660
15636
|
innerType: this,
|
|
15661
15637
|
catchValue: I,
|
|
@@ -15673,7 +15649,7 @@ class Z {
|
|
|
15673
15649
|
return jB.create(this, A);
|
|
15674
15650
|
}
|
|
15675
15651
|
readonly() {
|
|
15676
|
-
return
|
|
15652
|
+
return wB.create(this);
|
|
15677
15653
|
}
|
|
15678
15654
|
isOptional() {
|
|
15679
15655
|
return this.safeParse(void 0).success;
|
|
@@ -15683,7 +15659,7 @@ class Z {
|
|
|
15683
15659
|
}
|
|
15684
15660
|
}
|
|
15685
15661
|
const It = /^c[^\s-]{8,}$/i, gt = /^[0-9a-z]+$/, Bt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Ct = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Qt = /^[a-z0-9_-]{21}$/i, Et = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, it = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, ot = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, st = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
15686
|
-
let
|
|
15662
|
+
let _g;
|
|
15687
15663
|
const tt = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, at = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, et = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, nt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, rt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Dt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, EE = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", ht = new RegExp(`^${EE}$`);
|
|
15688
15664
|
function iE(C) {
|
|
15689
15665
|
let A = "[0-5]\\d";
|
|
@@ -15773,7 +15749,7 @@ class PA extends Z {
|
|
|
15773
15749
|
message: Q.message
|
|
15774
15750
|
}), g.dirty());
|
|
15775
15751
|
else if (Q.kind === "emoji")
|
|
15776
|
-
|
|
15752
|
+
_g || (_g = new RegExp(st, "u")), _g.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
15777
15753
|
validation: "emoji",
|
|
15778
15754
|
code: l.invalid_string,
|
|
15779
15755
|
message: Q.message
|
|
@@ -16277,7 +16253,7 @@ yI.create = (C) => new yI({
|
|
|
16277
16253
|
coerce: C?.coerce || !1,
|
|
16278
16254
|
...b(C)
|
|
16279
16255
|
});
|
|
16280
|
-
class
|
|
16256
|
+
class bI extends Z {
|
|
16281
16257
|
constructor() {
|
|
16282
16258
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
16283
16259
|
}
|
|
@@ -16333,7 +16309,7 @@ class xI extends Z {
|
|
|
16333
16309
|
return this.setLimit("max", A, !1, u.toString(I));
|
|
16334
16310
|
}
|
|
16335
16311
|
setLimit(A, I, g, B) {
|
|
16336
|
-
return new
|
|
16312
|
+
return new bI({
|
|
16337
16313
|
...this._def,
|
|
16338
16314
|
checks: [
|
|
16339
16315
|
...this._def.checks,
|
|
@@ -16347,7 +16323,7 @@ class xI extends Z {
|
|
|
16347
16323
|
});
|
|
16348
16324
|
}
|
|
16349
16325
|
_addCheck(A) {
|
|
16350
|
-
return new
|
|
16326
|
+
return new bI({
|
|
16351
16327
|
...this._def,
|
|
16352
16328
|
checks: [...this._def.checks, A]
|
|
16353
16329
|
});
|
|
@@ -16404,13 +16380,13 @@ class xI extends Z {
|
|
|
16404
16380
|
return A;
|
|
16405
16381
|
}
|
|
16406
16382
|
}
|
|
16407
|
-
|
|
16383
|
+
bI.create = (C) => new bI({
|
|
16408
16384
|
checks: [],
|
|
16409
16385
|
typeName: x.ZodBigInt,
|
|
16410
16386
|
coerce: C?.coerce ?? !1,
|
|
16411
16387
|
...b(C)
|
|
16412
16388
|
});
|
|
16413
|
-
class
|
|
16389
|
+
class nB extends Z {
|
|
16414
16390
|
_parse(A) {
|
|
16415
16391
|
if (this._def.coerce && (A.data = !!A.data), this._getType(A) !== f.boolean) {
|
|
16416
16392
|
const g = this._getOrReturnCtx(A);
|
|
@@ -16423,12 +16399,12 @@ class eB extends Z {
|
|
|
16423
16399
|
return JA(A.data);
|
|
16424
16400
|
}
|
|
16425
16401
|
}
|
|
16426
|
-
|
|
16402
|
+
nB.create = (C) => new nB({
|
|
16427
16403
|
typeName: x.ZodBoolean,
|
|
16428
16404
|
coerce: C?.coerce || !1,
|
|
16429
16405
|
...b(C)
|
|
16430
16406
|
});
|
|
16431
|
-
class
|
|
16407
|
+
class Fg extends Z {
|
|
16432
16408
|
_parse(A) {
|
|
16433
16409
|
if (this._def.coerce && (A.data = new Date(A.data)), this._getType(A) !== f.date) {
|
|
16434
16410
|
const Q = this._getOrReturnCtx(A);
|
|
@@ -16468,7 +16444,7 @@ class Gg extends Z {
|
|
|
16468
16444
|
};
|
|
16469
16445
|
}
|
|
16470
16446
|
_addCheck(A) {
|
|
16471
|
-
return new
|
|
16447
|
+
return new Fg({
|
|
16472
16448
|
...this._def,
|
|
16473
16449
|
checks: [...this._def.checks, A]
|
|
16474
16450
|
});
|
|
@@ -16500,7 +16476,7 @@ class Gg extends Z {
|
|
|
16500
16476
|
return A != null ? new Date(A) : null;
|
|
16501
16477
|
}
|
|
16502
16478
|
}
|
|
16503
|
-
|
|
16479
|
+
Fg.create = (C) => new Fg({
|
|
16504
16480
|
checks: [],
|
|
16505
16481
|
coerce: C?.coerce || !1,
|
|
16506
16482
|
typeName: x.ZodDate,
|
|
@@ -16557,7 +16533,7 @@ gQ.create = (C) => new gQ({
|
|
|
16557
16533
|
typeName: x.ZodNull,
|
|
16558
16534
|
...b(C)
|
|
16559
16535
|
});
|
|
16560
|
-
class
|
|
16536
|
+
class rB extends Z {
|
|
16561
16537
|
constructor() {
|
|
16562
16538
|
super(...arguments), this._any = !0;
|
|
16563
16539
|
}
|
|
@@ -16565,7 +16541,7 @@ class nB extends Z {
|
|
|
16565
16541
|
return JA(A.data);
|
|
16566
16542
|
}
|
|
16567
16543
|
}
|
|
16568
|
-
|
|
16544
|
+
rB.create = (C) => new rB({
|
|
16569
16545
|
typeName: x.ZodAny,
|
|
16570
16546
|
...b(C)
|
|
16571
16547
|
});
|
|
@@ -16988,7 +16964,7 @@ aA.lazycreate = (C, A) => new aA({
|
|
|
16988
16964
|
typeName: x.ZodObject,
|
|
16989
16965
|
...b(A)
|
|
16990
16966
|
});
|
|
16991
|
-
class
|
|
16967
|
+
class Sg extends Z {
|
|
16992
16968
|
_parse(A) {
|
|
16993
16969
|
const { ctx: I } = this._processInputParams(A), g = this._def.options;
|
|
16994
16970
|
function B(Q) {
|
|
@@ -17056,19 +17032,19 @@ class Fg extends Z {
|
|
|
17056
17032
|
return this._def.options;
|
|
17057
17033
|
}
|
|
17058
17034
|
}
|
|
17059
|
-
|
|
17035
|
+
Sg.create = (C, A) => new Sg({
|
|
17060
17036
|
options: C,
|
|
17061
17037
|
typeName: x.ZodUnion,
|
|
17062
17038
|
...b(A)
|
|
17063
17039
|
});
|
|
17064
|
-
function
|
|
17040
|
+
function DB(C, A) {
|
|
17065
17041
|
const I = vA(C), g = vA(A);
|
|
17066
17042
|
if (C === A)
|
|
17067
17043
|
return { valid: !0, data: C };
|
|
17068
17044
|
if (I === f.object && g === f.object) {
|
|
17069
17045
|
const B = V.objectKeys(A), Q = V.objectKeys(C).filter((i) => B.indexOf(i) !== -1), E = { ...C, ...A };
|
|
17070
17046
|
for (const i of Q) {
|
|
17071
|
-
const o =
|
|
17047
|
+
const o = DB(C[i], A[i]);
|
|
17072
17048
|
if (!o.valid)
|
|
17073
17049
|
return { valid: !1 };
|
|
17074
17050
|
E[i] = o.data;
|
|
@@ -17079,7 +17055,7 @@ function rB(C, A) {
|
|
|
17079
17055
|
return { valid: !1 };
|
|
17080
17056
|
const B = [];
|
|
17081
17057
|
for (let Q = 0; Q < C.length; Q++) {
|
|
17082
|
-
const E = C[Q], i = A[Q], o =
|
|
17058
|
+
const E = C[Q], i = A[Q], o = DB(E, i);
|
|
17083
17059
|
if (!o.valid)
|
|
17084
17060
|
return { valid: !1 };
|
|
17085
17061
|
B.push(o.data);
|
|
@@ -17087,12 +17063,12 @@ function rB(C, A) {
|
|
|
17087
17063
|
return { valid: !0, data: B };
|
|
17088
17064
|
} else return I === f.date && g === f.date && +C == +A ? { valid: !0, data: C } : { valid: !1 };
|
|
17089
17065
|
}
|
|
17090
|
-
class
|
|
17066
|
+
class Ng extends Z {
|
|
17091
17067
|
_parse(A) {
|
|
17092
17068
|
const { status: I, ctx: g } = this._processInputParams(A), B = (Q, E) => {
|
|
17093
17069
|
if (jC(Q) || jC(E))
|
|
17094
17070
|
return m;
|
|
17095
|
-
const i =
|
|
17071
|
+
const i = DB(Q.value, E.value);
|
|
17096
17072
|
return i.valid ? ((zC(Q) || zC(E)) && I.dirty(), { status: I.value, value: i.data }) : (Y(g, {
|
|
17097
17073
|
code: l.invalid_intersection_types
|
|
17098
17074
|
}), m);
|
|
@@ -17119,7 +17095,7 @@ class Sg extends Z {
|
|
|
17119
17095
|
}));
|
|
17120
17096
|
}
|
|
17121
17097
|
}
|
|
17122
|
-
|
|
17098
|
+
Ng.create = (C, A, I) => new Ng({
|
|
17123
17099
|
left: C,
|
|
17124
17100
|
right: A,
|
|
17125
17101
|
typeName: x.ZodIntersection,
|
|
@@ -17223,7 +17199,7 @@ QQ.create = (C, A, I) => new QQ({
|
|
|
17223
17199
|
typeName: x.ZodMap,
|
|
17224
17200
|
...b(I)
|
|
17225
17201
|
});
|
|
17226
|
-
class
|
|
17202
|
+
class TI extends Z {
|
|
17227
17203
|
_parse(A) {
|
|
17228
17204
|
const { status: I, ctx: g } = this._processInputParams(A);
|
|
17229
17205
|
if (g.parsedType !== f.set)
|
|
@@ -17262,13 +17238,13 @@ class bI extends Z {
|
|
|
17262
17238
|
return g.common.async ? Promise.all(i).then((o) => E(o)) : E(i);
|
|
17263
17239
|
}
|
|
17264
17240
|
min(A, I) {
|
|
17265
|
-
return new
|
|
17241
|
+
return new TI({
|
|
17266
17242
|
...this._def,
|
|
17267
17243
|
minSize: { value: A, message: u.toString(I) }
|
|
17268
17244
|
});
|
|
17269
17245
|
}
|
|
17270
17246
|
max(A, I) {
|
|
17271
|
-
return new
|
|
17247
|
+
return new TI({
|
|
17272
17248
|
...this._def,
|
|
17273
17249
|
maxSize: { value: A, message: u.toString(I) }
|
|
17274
17250
|
});
|
|
@@ -17280,7 +17256,7 @@ class bI extends Z {
|
|
|
17280
17256
|
return this.min(1, A);
|
|
17281
17257
|
}
|
|
17282
17258
|
}
|
|
17283
|
-
|
|
17259
|
+
TI.create = (C, A) => new TI({
|
|
17284
17260
|
valueType: C,
|
|
17285
17261
|
minSize: null,
|
|
17286
17262
|
maxSize: null,
|
|
@@ -17301,7 +17277,7 @@ EQ.create = (C, A) => new EQ({
|
|
|
17301
17277
|
typeName: x.ZodLazy,
|
|
17302
17278
|
...b(A)
|
|
17303
17279
|
});
|
|
17304
|
-
class
|
|
17280
|
+
class hB extends Z {
|
|
17305
17281
|
_parse(A) {
|
|
17306
17282
|
if (A.data !== this._def.value) {
|
|
17307
17283
|
const I = this._getOrReturnCtx(A);
|
|
@@ -17317,7 +17293,7 @@ class DB extends Z {
|
|
|
17317
17293
|
return this._def.value;
|
|
17318
17294
|
}
|
|
17319
17295
|
}
|
|
17320
|
-
|
|
17296
|
+
hB.create = (C, A) => new hB({
|
|
17321
17297
|
value: C,
|
|
17322
17298
|
typeName: x.ZodLiteral,
|
|
17323
17299
|
...b(A)
|
|
@@ -17414,7 +17390,7 @@ iQ.create = (C, A) => new iQ({
|
|
|
17414
17390
|
typeName: x.ZodNativeEnum,
|
|
17415
17391
|
...b(A)
|
|
17416
17392
|
});
|
|
17417
|
-
class
|
|
17393
|
+
class Rg extends Z {
|
|
17418
17394
|
unwrap() {
|
|
17419
17395
|
return this._def.type;
|
|
17420
17396
|
}
|
|
@@ -17433,7 +17409,7 @@ class Ng extends Z {
|
|
|
17433
17409
|
})));
|
|
17434
17410
|
}
|
|
17435
17411
|
}
|
|
17436
|
-
|
|
17412
|
+
Rg.create = (C, A) => new Rg({
|
|
17437
17413
|
type: C,
|
|
17438
17414
|
typeName: x.ZodPromise,
|
|
17439
17415
|
...b(A)
|
|
@@ -17556,7 +17532,7 @@ GI.create = (C, A) => new GI({
|
|
|
17556
17532
|
typeName: x.ZodNullable,
|
|
17557
17533
|
...b(A)
|
|
17558
17534
|
});
|
|
17559
|
-
class
|
|
17535
|
+
class yB extends Z {
|
|
17560
17536
|
_parse(A) {
|
|
17561
17537
|
const { ctx: I } = this._processInputParams(A);
|
|
17562
17538
|
let g = I.data;
|
|
@@ -17570,13 +17546,13 @@ class hB extends Z {
|
|
|
17570
17546
|
return this._def.innerType;
|
|
17571
17547
|
}
|
|
17572
17548
|
}
|
|
17573
|
-
|
|
17549
|
+
yB.create = (C, A) => new yB({
|
|
17574
17550
|
innerType: C,
|
|
17575
17551
|
typeName: x.ZodDefault,
|
|
17576
17552
|
defaultValue: typeof A.default == "function" ? A.default : () => A.default,
|
|
17577
17553
|
...b(A)
|
|
17578
17554
|
});
|
|
17579
|
-
class
|
|
17555
|
+
class cB extends Z {
|
|
17580
17556
|
_parse(A) {
|
|
17581
17557
|
const { ctx: I } = this._processInputParams(A), g = {
|
|
17582
17558
|
...I,
|
|
@@ -17591,7 +17567,7 @@ class yB extends Z {
|
|
|
17591
17567
|
...g
|
|
17592
17568
|
}
|
|
17593
17569
|
});
|
|
17594
|
-
return
|
|
17570
|
+
return Gg(B) ? B.then((Q) => ({
|
|
17595
17571
|
status: "valid",
|
|
17596
17572
|
value: Q.status === "valid" ? Q.value : this._def.catchValue({
|
|
17597
17573
|
get error() {
|
|
@@ -17613,7 +17589,7 @@ class yB extends Z {
|
|
|
17613
17589
|
return this._def.innerType;
|
|
17614
17590
|
}
|
|
17615
17591
|
}
|
|
17616
|
-
|
|
17592
|
+
cB.create = (C, A) => new cB({
|
|
17617
17593
|
innerType: C,
|
|
17618
17594
|
typeName: x.ZodCatch,
|
|
17619
17595
|
catchValue: typeof A.catch == "function" ? A.catch : () => A.catch,
|
|
@@ -17689,16 +17665,16 @@ class jB extends Z {
|
|
|
17689
17665
|
});
|
|
17690
17666
|
}
|
|
17691
17667
|
}
|
|
17692
|
-
class
|
|
17668
|
+
class wB extends Z {
|
|
17693
17669
|
_parse(A) {
|
|
17694
17670
|
const I = this._def.innerType._parse(A), g = (B) => (hI(B) && (B.value = Object.freeze(B.value)), B);
|
|
17695
|
-
return
|
|
17671
|
+
return Gg(I) ? I.then((B) => g(B)) : g(I);
|
|
17696
17672
|
}
|
|
17697
17673
|
unwrap() {
|
|
17698
17674
|
return this._def.innerType;
|
|
17699
17675
|
}
|
|
17700
17676
|
}
|
|
17701
|
-
|
|
17677
|
+
wB.create = (C, A) => new wB({
|
|
17702
17678
|
innerType: C,
|
|
17703
17679
|
typeName: x.ZodReadonly,
|
|
17704
17680
|
...b(A)
|
|
@@ -17707,14 +17683,14 @@ var x;
|
|
|
17707
17683
|
(function(C) {
|
|
17708
17684
|
C.ZodString = "ZodString", C.ZodNumber = "ZodNumber", C.ZodNaN = "ZodNaN", C.ZodBigInt = "ZodBigInt", C.ZodBoolean = "ZodBoolean", C.ZodDate = "ZodDate", C.ZodSymbol = "ZodSymbol", C.ZodUndefined = "ZodUndefined", C.ZodNull = "ZodNull", C.ZodAny = "ZodAny", C.ZodUnknown = "ZodUnknown", C.ZodNever = "ZodNever", C.ZodVoid = "ZodVoid", C.ZodArray = "ZodArray", C.ZodObject = "ZodObject", C.ZodUnion = "ZodUnion", C.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", C.ZodIntersection = "ZodIntersection", C.ZodTuple = "ZodTuple", C.ZodRecord = "ZodRecord", C.ZodMap = "ZodMap", C.ZodSet = "ZodSet", C.ZodFunction = "ZodFunction", C.ZodLazy = "ZodLazy", C.ZodLiteral = "ZodLiteral", C.ZodEnum = "ZodEnum", C.ZodEffects = "ZodEffects", C.ZodNativeEnum = "ZodNativeEnum", C.ZodOptional = "ZodOptional", C.ZodNullable = "ZodNullable", C.ZodDefault = "ZodDefault", C.ZodCatch = "ZodCatch", C.ZodPromise = "ZodPromise", C.ZodBranded = "ZodBranded", C.ZodPipeline = "ZodPipeline", C.ZodReadonly = "ZodReadonly";
|
|
17709
17685
|
})(x || (x = {}));
|
|
17710
|
-
const z = PA.create, T = yI.create, sE =
|
|
17686
|
+
const z = PA.create, T = yI.create, sE = nB.create, VA = rB.create;
|
|
17711
17687
|
zA.create;
|
|
17712
17688
|
const j = pA.create, q = aA.create;
|
|
17713
|
-
Fg.create;
|
|
17714
17689
|
Sg.create;
|
|
17715
|
-
EI.create;
|
|
17716
|
-
const yA = DB.create, eI = cI.create;
|
|
17717
17690
|
Ng.create;
|
|
17691
|
+
EI.create;
|
|
17692
|
+
const yA = hB.create, eI = cI.create;
|
|
17693
|
+
Rg.create;
|
|
17718
17694
|
XA.create;
|
|
17719
17695
|
GI.create;
|
|
17720
17696
|
const Rt = q({
|
|
@@ -18154,7 +18130,7 @@ function tE(C, A) {
|
|
|
18154
18130
|
return delete I[A], I;
|
|
18155
18131
|
}
|
|
18156
18132
|
async function wa(C, A) {
|
|
18157
|
-
const I = new
|
|
18133
|
+
const I = new vI(C), g = new lA(I), B = FI(A), Q = await OI(g, B);
|
|
18158
18134
|
try {
|
|
18159
18135
|
return ft(Q.attrs);
|
|
18160
18136
|
} catch {
|
|
@@ -18213,7 +18189,7 @@ function Ht(C) {
|
|
|
18213
18189
|
}
|
|
18214
18190
|
}
|
|
18215
18191
|
async function Ga(C, A, I) {
|
|
18216
|
-
const g = C + "/" + A, B = new
|
|
18192
|
+
const g = C + "/" + A, B = new vI(g), Q = new lA(B), E = FI(I), i = await OI(Q, E);
|
|
18217
18193
|
try {
|
|
18218
18194
|
return Ht(i.attrs);
|
|
18219
18195
|
} catch {
|
|
@@ -18224,11 +18200,11 @@ ${JSON.stringify(i.attrs)}`
|
|
|
18224
18200
|
}
|
|
18225
18201
|
}
|
|
18226
18202
|
async function Fa(C) {
|
|
18227
|
-
const A = FI(C.version), I = await
|
|
18203
|
+
const A = FI(C.version), I = await OI(C.location, A);
|
|
18228
18204
|
return $B(I.attrs).omero?.channels ?? [];
|
|
18229
18205
|
}
|
|
18230
18206
|
async function Sa(C) {
|
|
18231
|
-
const A = FI(C.version), I = await
|
|
18207
|
+
const A = FI(C.version), I = await OI(C.location, A);
|
|
18232
18208
|
return $B(I.attrs).omero?.rdefs;
|
|
18233
18209
|
}
|
|
18234
18210
|
function qt(C) {
|
|
@@ -18262,46 +18238,44 @@ function $B(C) {
|
|
|
18262
18238
|
${JSON.stringify(C)}`);
|
|
18263
18239
|
}
|
|
18264
18240
|
}
|
|
18265
|
-
class
|
|
18241
|
+
class MI {
|
|
18266
18242
|
location;
|
|
18267
18243
|
version;
|
|
18268
18244
|
loader_;
|
|
18269
18245
|
constructor(A) {
|
|
18270
|
-
this.location = A.location, this.version = A.version;
|
|
18246
|
+
this.location = A.location, this.version = A.version, this.loader_ = A.loader;
|
|
18271
18247
|
}
|
|
18272
|
-
async
|
|
18273
|
-
|
|
18274
|
-
|
|
18275
|
-
|
|
18276
|
-
if (B.length !== 1)
|
|
18248
|
+
static async openLoader(A, I) {
|
|
18249
|
+
let g = FI(I);
|
|
18250
|
+
const B = await OI(A, g), Q = $B(B.attrs), E = Q.multiscales;
|
|
18251
|
+
if (E.length !== 1)
|
|
18277
18252
|
throw new Error(
|
|
18278
|
-
`Exactly one multiscale image is supported. Found ${
|
|
18253
|
+
`Exactly one multiscale image is supported. Found ${E.length} images.`
|
|
18279
18254
|
);
|
|
18280
|
-
const
|
|
18281
|
-
if (
|
|
18255
|
+
const i = E[0];
|
|
18256
|
+
if (i.datasets.length === 0)
|
|
18282
18257
|
throw new Error("No datasets found in the multiscale image.");
|
|
18283
|
-
|
|
18284
|
-
const
|
|
18285
|
-
(
|
|
18286
|
-
),
|
|
18287
|
-
|
|
18288
|
-
),
|
|
18289
|
-
if (
|
|
18258
|
+
g || (g = FI(Q.originalVersion));
|
|
18259
|
+
const o = i.datasets.map(
|
|
18260
|
+
(n) => Hs(A, n.path, g)
|
|
18261
|
+
), s = await Promise.all(
|
|
18262
|
+
o.map((n) => Ks(n))
|
|
18263
|
+
), t = s[0].shape, a = i.axes;
|
|
18264
|
+
if (a.length !== t.length)
|
|
18290
18265
|
throw new Error(
|
|
18291
|
-
`Mismatch between number of axes (${
|
|
18266
|
+
`Mismatch between number of axes (${a.length}) and array shape (${t.length})`
|
|
18292
18267
|
);
|
|
18293
|
-
return
|
|
18268
|
+
return new Os({ metadata: i, arrays: s, arrayParams: o });
|
|
18294
18269
|
}
|
|
18295
18270
|
getDimensions() {
|
|
18296
|
-
if (!this.loader_)
|
|
18297
|
-
throw new Error(
|
|
18298
|
-
"OmeZarrImageSource.getDimensions() requires the source to be opened first; use `await OmeZarrImageSource.fromHttp({ url })` or `await source.open()`."
|
|
18299
|
-
);
|
|
18300
18271
|
return this.loader_.getSourceDimensionMap();
|
|
18301
18272
|
}
|
|
18302
18273
|
getChannelCount() {
|
|
18303
18274
|
return this.getDimensions().c?.lods[0].size ?? 1;
|
|
18304
18275
|
}
|
|
18276
|
+
getLoader() {
|
|
18277
|
+
return this.loader_;
|
|
18278
|
+
}
|
|
18305
18279
|
/**
|
|
18306
18280
|
* Creates and opens an OmeZarrImageSource from an HTTP(S) URL.
|
|
18307
18281
|
*
|
|
@@ -18309,11 +18283,8 @@ class wB {
|
|
|
18309
18283
|
* @param props.version OME-Zarr version
|
|
18310
18284
|
*/
|
|
18311
18285
|
static async fromHttp(A) {
|
|
18312
|
-
const I = new
|
|
18313
|
-
|
|
18314
|
-
version: A.version
|
|
18315
|
-
});
|
|
18316
|
-
return await g.open(), g;
|
|
18286
|
+
const I = new lA(new vI(A.url)), g = await MI.openLoader(I, A.version);
|
|
18287
|
+
return new MI({ location: I, version: A.version, loader: g });
|
|
18317
18288
|
}
|
|
18318
18289
|
/**
|
|
18319
18290
|
* Creates and opens an OmeZarrImageSource from a local filesystem directory.
|
|
@@ -18325,14 +18296,14 @@ class wB {
|
|
|
18325
18296
|
* ask the user once for permission to the root directory
|
|
18326
18297
|
*/
|
|
18327
18298
|
static async fromFileSystem(A) {
|
|
18328
|
-
const I = new
|
|
18329
|
-
|
|
18330
|
-
|
|
18331
|
-
|
|
18332
|
-
return
|
|
18299
|
+
const I = new lA(
|
|
18300
|
+
new XB(A.directory),
|
|
18301
|
+
A.path
|
|
18302
|
+
), g = await MI.openLoader(I, A.version);
|
|
18303
|
+
return new MI({ location: I, version: A.version, loader: g });
|
|
18333
18304
|
}
|
|
18334
18305
|
}
|
|
18335
|
-
class
|
|
18306
|
+
class Yg {
|
|
18336
18307
|
objects_ = [];
|
|
18337
18308
|
state_ = "initialized";
|
|
18338
18309
|
callbacks_ = [];
|
|
@@ -18345,18 +18316,14 @@ class Jg {
|
|
|
18345
18316
|
return this.opacity_;
|
|
18346
18317
|
}
|
|
18347
18318
|
set opacity(A) {
|
|
18348
|
-
(A < 0 || A > 1) &&
|
|
18319
|
+
(A < 0 || A > 1) && H.warn(
|
|
18349
18320
|
"Layer",
|
|
18350
18321
|
`Opacity out of bounds: ${A} — clamping to [0.0, 1.0]`
|
|
18351
18322
|
), this.opacity_ = TA(A, 0, 1);
|
|
18352
18323
|
}
|
|
18353
18324
|
onEvent(A) {
|
|
18354
18325
|
}
|
|
18355
|
-
|
|
18356
|
-
// integration is finalized. Most layers will likely need access to the chunk
|
|
18357
|
-
// manager, but for now, we allow optional overrides to avoid requiring
|
|
18358
|
-
// placeholder implementations.
|
|
18359
|
-
async onAttached(A) {
|
|
18326
|
+
onAttached(A) {
|
|
18360
18327
|
}
|
|
18361
18328
|
onDetached(A) {
|
|
18362
18329
|
}
|
|
@@ -18452,11 +18419,11 @@ class mt extends NI {
|
|
|
18452
18419
|
class xt extends NI {
|
|
18453
18420
|
constructor(A) {
|
|
18454
18421
|
if (super(), A.primitive != "triangles") {
|
|
18455
|
-
|
|
18422
|
+
H.warn("WireframeGeometry", "Only indexed geometries are supported");
|
|
18456
18423
|
return;
|
|
18457
18424
|
}
|
|
18458
18425
|
if (A.indexData.length == 0) {
|
|
18459
|
-
|
|
18426
|
+
H.warn(
|
|
18460
18427
|
"WireframeGeometry",
|
|
18461
18428
|
"Only triangulated geometries are supported"
|
|
18462
18429
|
);
|
|
@@ -18478,7 +18445,7 @@ const bt = P(0, 1, 0);
|
|
|
18478
18445
|
class Tt {
|
|
18479
18446
|
dirty_ = !0;
|
|
18480
18447
|
matrix_ = FA();
|
|
18481
|
-
rotation_ =
|
|
18448
|
+
rotation_ = gB();
|
|
18482
18449
|
translation_ = EA();
|
|
18483
18450
|
scale_ = P(1, 1, 1);
|
|
18484
18451
|
addRotation(A) {
|
|
@@ -18491,10 +18458,10 @@ class Tt {
|
|
|
18491
18458
|
return Bi(this.rotation_);
|
|
18492
18459
|
}
|
|
18493
18460
|
addTranslation(A) {
|
|
18494
|
-
|
|
18461
|
+
qI(this.translation_, this.translation_, A), this.dirty_ = !0;
|
|
18495
18462
|
}
|
|
18496
18463
|
setTranslation(A) {
|
|
18497
|
-
|
|
18464
|
+
AB(this.translation_, A), this.dirty_ = !0;
|
|
18498
18465
|
}
|
|
18499
18466
|
get translation() {
|
|
18500
18467
|
return bA(this.translation_);
|
|
@@ -18503,7 +18470,7 @@ class Tt {
|
|
|
18503
18470
|
VE(this.scale_, this.scale_, A), this.dirty_ = !0;
|
|
18504
18471
|
}
|
|
18505
18472
|
setScale(A) {
|
|
18506
|
-
|
|
18473
|
+
AB(this.scale_, A), this.dirty_ = !0;
|
|
18507
18474
|
}
|
|
18508
18475
|
targetTo(A) {
|
|
18509
18476
|
RB(this.translation_, A) && (A = bA(A), A[2] += AA);
|
|
@@ -18517,7 +18484,7 @@ class Tt {
|
|
|
18517
18484
|
return this.dirty_ && (this.computeMatrix(), this.dirty_ = !1), this.matrix_;
|
|
18518
18485
|
}
|
|
18519
18486
|
get inverse() {
|
|
18520
|
-
return
|
|
18487
|
+
return Ug(FA(), this.matrix);
|
|
18521
18488
|
}
|
|
18522
18489
|
computeMatrix() {
|
|
18523
18490
|
mE(
|
|
@@ -18614,25 +18581,25 @@ class Wt extends dI {
|
|
|
18614
18581
|
};
|
|
18615
18582
|
}
|
|
18616
18583
|
}
|
|
18617
|
-
class Na extends
|
|
18584
|
+
class Na extends Yg {
|
|
18618
18585
|
type = "AxesLayer";
|
|
18619
18586
|
constructor(A) {
|
|
18620
18587
|
super();
|
|
18621
18588
|
const { length: I, width: g } = A;
|
|
18622
18589
|
this.addObject(
|
|
18623
|
-
|
|
18590
|
+
Xg({
|
|
18624
18591
|
end: [I, 0, 0],
|
|
18625
18592
|
width: g,
|
|
18626
18593
|
color: [1, 0, 0]
|
|
18627
18594
|
})
|
|
18628
18595
|
), this.addObject(
|
|
18629
|
-
|
|
18596
|
+
Xg({
|
|
18630
18597
|
end: [0, I, 0],
|
|
18631
18598
|
width: g,
|
|
18632
18599
|
color: [0, 1, 0]
|
|
18633
18600
|
})
|
|
18634
18601
|
), this.addObject(
|
|
18635
|
-
|
|
18602
|
+
Xg({
|
|
18636
18603
|
end: [0, 0, I],
|
|
18637
18604
|
width: g,
|
|
18638
18605
|
color: [0, 0, 1]
|
|
@@ -18642,7 +18609,7 @@ class Na extends Jg {
|
|
|
18642
18609
|
update() {
|
|
18643
18610
|
}
|
|
18644
18611
|
}
|
|
18645
|
-
function
|
|
18612
|
+
function Xg(C) {
|
|
18646
18613
|
const { end: A, width: I, color: g } = C, B = new mt([[0, 0, 0], A]);
|
|
18647
18614
|
return new Wt({
|
|
18648
18615
|
geometry: B,
|
|
@@ -18651,8 +18618,8 @@ function _g(C) {
|
|
|
18651
18618
|
});
|
|
18652
18619
|
}
|
|
18653
18620
|
const sQ = 32;
|
|
18654
|
-
function
|
|
18655
|
-
return A ??= !0, I = I === void 0 ? X.WHITE : X.from(I), B = B === void 0 ? 1 : TA(B, 0, 1), C !== null ? g = vt(g, C) : g === void 0 && (
|
|
18621
|
+
function WI(C, { visible: A, color: I, contrastLimits: g, opacity: B }) {
|
|
18622
|
+
return A ??= !0, I = I === void 0 ? X.WHITE : X.from(I), B = B === void 0 ? 1 : TA(B, 0, 1), C !== null ? g = vt(g, C) : g === void 0 && (H.debug(
|
|
18656
18623
|
"Channel",
|
|
18657
18624
|
"No texture provided, defaulting channel contrast limits to [0, 1]."
|
|
18658
18625
|
), g = [0, 1]), {
|
|
@@ -18665,7 +18632,7 @@ function TI(C, { visible: A, color: I, contrastLimits: g, opacity: B }) {
|
|
|
18665
18632
|
function GB(C, A) {
|
|
18666
18633
|
if (A.length > sQ)
|
|
18667
18634
|
throw new Error(`Maximum number of channels is ${sQ}`);
|
|
18668
|
-
return A.map((I) =>
|
|
18635
|
+
return A.map((I) => WI(C, I));
|
|
18669
18636
|
}
|
|
18670
18637
|
function aE(C, A) {
|
|
18671
18638
|
if (C && C.length !== A)
|
|
@@ -18689,14 +18656,14 @@ class eE extends NI {
|
|
|
18689
18656
|
for (let D = 0; D < t; ++D) {
|
|
18690
18657
|
const F = D * n;
|
|
18691
18658
|
for (let U = 0; U < s; ++U) {
|
|
18692
|
-
const S = U * a, d = U / i,
|
|
18659
|
+
const S = U * a, d = U / i, K = D / o, k = [S, F, 0], R = [0, 0, 1], L = [d, K];
|
|
18693
18660
|
Q.push(...k, ...R, ...L);
|
|
18694
18661
|
}
|
|
18695
18662
|
}
|
|
18696
18663
|
for (let D = 0; D < o; ++D)
|
|
18697
18664
|
for (let F = 0; F < i; ++F) {
|
|
18698
|
-
const U = F + s * D, S = F + s * (D + 1), d = F + 1 + s * (D + 1),
|
|
18699
|
-
E.push(U, S,
|
|
18665
|
+
const U = F + s * D, S = F + s * (D + 1), d = F + 1 + s * (D + 1), K = F + 1 + s * D;
|
|
18666
|
+
E.push(U, S, K), E.push(S, d, K);
|
|
18700
18667
|
}
|
|
18701
18668
|
this.vertexData_ = new Float32Array(Q), this.indexData_ = new Uint32Array(E), this.addAttribute({
|
|
18702
18669
|
type: "position",
|
|
@@ -18725,7 +18692,7 @@ class Zt extends dI {
|
|
|
18725
18692
|
this.channels_ = GB(this.textures[0], A);
|
|
18726
18693
|
}
|
|
18727
18694
|
setChannelProperty(A, I, g) {
|
|
18728
|
-
const B =
|
|
18695
|
+
const B = WI(this.textures[0], {
|
|
18729
18696
|
...this.channels_[A],
|
|
18730
18697
|
[I]: g
|
|
18731
18698
|
});
|
|
@@ -18735,7 +18702,7 @@ class Zt extends dI {
|
|
|
18735
18702
|
const A = this.textures[0];
|
|
18736
18703
|
if (!A)
|
|
18737
18704
|
throw new Error("No texture set");
|
|
18738
|
-
const { color: I, contrastLimits: g, opacity: B } = this.channels_[0] ??
|
|
18705
|
+
const { color: I, contrastLimits: g, opacity: B } = this.channels_[0] ?? WI(A, {});
|
|
18739
18706
|
return {
|
|
18740
18707
|
ImageSampler: 0,
|
|
18741
18708
|
Color: I.rgb,
|
|
@@ -18833,18 +18800,18 @@ class AC {
|
|
|
18833
18800
|
bins_ = /* @__PURE__ */ new Map();
|
|
18834
18801
|
acquire(A) {
|
|
18835
18802
|
const g = this.bins_.get(A)?.pop();
|
|
18836
|
-
return g &&
|
|
18803
|
+
return g && H.debug("RenderablePool", "Renderable object acquired"), g;
|
|
18837
18804
|
}
|
|
18838
18805
|
release(A, I) {
|
|
18839
18806
|
let g = this.bins_.get(A);
|
|
18840
|
-
g || (g = [], this.bins_.set(A, g)), g.push(I),
|
|
18807
|
+
g || (g = [], this.bins_.set(A, g)), g.push(I), H.debug("RenderablePool", "Renderable object released");
|
|
18841
18808
|
}
|
|
18842
18809
|
clearAll(A) {
|
|
18843
18810
|
if (A) for (const I of this.bins_.values()) I.forEach(A);
|
|
18844
18811
|
this.bins_.clear();
|
|
18845
18812
|
}
|
|
18846
18813
|
}
|
|
18847
|
-
class rE extends
|
|
18814
|
+
class rE extends Yg {
|
|
18848
18815
|
type = "ImageLayer";
|
|
18849
18816
|
source_;
|
|
18850
18817
|
sliceCoords_;
|
|
@@ -18878,12 +18845,12 @@ class rE extends Jg {
|
|
|
18878
18845
|
}) {
|
|
18879
18846
|
super(E), this.setState("initialized"), this.source_ = A, this.policy_ = g, this.sliceCoords_ = I, this.channelProps_ = B, this.initialChannelProps_ = B, this.onPickValue_ = Q;
|
|
18880
18847
|
}
|
|
18881
|
-
|
|
18848
|
+
onAttached(A) {
|
|
18882
18849
|
if (this.chunkStoreView_)
|
|
18883
18850
|
throw new Error(
|
|
18884
|
-
"ImageLayer cannot be attached to multiple
|
|
18851
|
+
"ImageLayer cannot be attached to multiple viewports simultaneously."
|
|
18885
18852
|
);
|
|
18886
|
-
this.chunkStoreView_ =
|
|
18853
|
+
this.chunkStoreView_ = A.chunkManager.addView(
|
|
18887
18854
|
this.source_,
|
|
18888
18855
|
this.policy_
|
|
18889
18856
|
);
|
|
@@ -18960,20 +18927,20 @@ class rE extends Jg {
|
|
|
18960
18927
|
set imageSourcePolicy(A) {
|
|
18961
18928
|
this.policy_ !== A && (this.policy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
|
|
18962
18929
|
A,
|
|
18963
|
-
|
|
18930
|
+
lg
|
|
18964
18931
|
));
|
|
18965
18932
|
}
|
|
18966
18933
|
slicePlane(A, I) {
|
|
18967
18934
|
if (!A.data) return;
|
|
18968
18935
|
const g = (I - A.offset.z) / A.scale.z, B = Math.round(g), Q = TA(B, 0, A.shape.z - 1);
|
|
18969
|
-
|
|
18936
|
+
eg(g, Q, 1 + 1e-6) || H.error("ImageLayer", "slicePlane zValue outside extent");
|
|
18970
18937
|
const E = A.shape.x * A.shape.y, i = E * Q;
|
|
18971
18938
|
return A.data.slice(i, i + E);
|
|
18972
18939
|
}
|
|
18973
18940
|
getImageForChunk(A) {
|
|
18974
18941
|
const I = this.visibleChunks_.get(A);
|
|
18975
18942
|
if (I) return I;
|
|
18976
|
-
const g = this.pool_.acquire(
|
|
18943
|
+
const g = this.pool_.acquire(kg(A));
|
|
18977
18944
|
return g ? (g.textures[0].updateWithChunk(A, this.getDataForImage(A)), this.updateImageChunk(g, A), g.setChannelProps(this.getChannelPropsForChunk(A)), g) : this.createImage(A);
|
|
18978
18945
|
}
|
|
18979
18946
|
getChannelPropsForChunk(A) {
|
|
@@ -18991,7 +18958,7 @@ class rE extends Jg {
|
|
|
18991
18958
|
getDataForImage(A) {
|
|
18992
18959
|
const I = this.sliceCoords_?.z !== void 0 ? this.slicePlane(A, this.sliceCoords_.z) : A.data;
|
|
18993
18960
|
if (!I) {
|
|
18994
|
-
|
|
18961
|
+
H.warn("ImageLayer", "No data for image");
|
|
18995
18962
|
return;
|
|
18996
18963
|
}
|
|
18997
18964
|
return I;
|
|
@@ -19059,11 +19026,11 @@ class rE extends Jg {
|
|
|
19059
19026
|
releaseAndRemoveChunks(A) {
|
|
19060
19027
|
for (const I of A) {
|
|
19061
19028
|
const g = this.visibleChunks_.get(I);
|
|
19062
|
-
g && (this.pool_.release(
|
|
19029
|
+
g && (this.pool_.release(kg(I), g), this.visibleChunks_.delete(I));
|
|
19063
19030
|
}
|
|
19064
19031
|
}
|
|
19065
19032
|
}
|
|
19066
|
-
function
|
|
19033
|
+
function kg(C) {
|
|
19067
19034
|
return [
|
|
19068
19035
|
`lod${C.lod}`,
|
|
19069
19036
|
`shape${C.shape.x}x${C.shape.y}`,
|
|
@@ -19089,12 +19056,12 @@ class Vt extends NI {
|
|
|
19089
19056
|
});
|
|
19090
19057
|
}
|
|
19091
19058
|
buildFace(A, I, g, B, Q, E, i, o, s, t, a, n, D) {
|
|
19092
|
-
const F = E / s, U = i / t, S = E / 2, d = i / 2,
|
|
19059
|
+
const F = E / s, U = i / t, S = E / 2, d = i / 2, K = o / 2 * a, k = s + 1, R = t + 1, L = n.length / 8;
|
|
19093
19060
|
for (let M = 0; M < R; M++) {
|
|
19094
19061
|
const W = -d + M * U;
|
|
19095
19062
|
for (let IA = 0; IA < k; IA++) {
|
|
19096
19063
|
const CA = -S + IA * F, $ = { x: 0, y: 0, z: 0 };
|
|
19097
|
-
$[A] = CA * B, $[I] = W * Q, $[g] =
|
|
19064
|
+
$[A] = CA * B, $[I] = W * Q, $[g] = K;
|
|
19098
19065
|
const gA = { x: 0, y: 0, z: 0 };
|
|
19099
19066
|
gA[g] = a;
|
|
19100
19067
|
const SA = IA / s, NA = 1 - M / t;
|
|
@@ -19117,7 +19084,7 @@ class Vt extends NI {
|
|
|
19117
19084
|
}
|
|
19118
19085
|
}
|
|
19119
19086
|
}
|
|
19120
|
-
class
|
|
19087
|
+
class HI extends UB {
|
|
19121
19088
|
data_;
|
|
19122
19089
|
width_;
|
|
19123
19090
|
height_;
|
|
@@ -19161,7 +19128,7 @@ class KI extends UB {
|
|
|
19161
19128
|
throw new Error(
|
|
19162
19129
|
"Unable to create texture, chunk data is not initialized."
|
|
19163
19130
|
);
|
|
19164
|
-
const g = new
|
|
19131
|
+
const g = new HI(
|
|
19165
19132
|
I,
|
|
19166
19133
|
A.shape.x,
|
|
19167
19134
|
A.shape.y,
|
|
@@ -19186,7 +19153,7 @@ class Ot extends dI {
|
|
|
19186
19153
|
g !== void 0 ? this.updateChannelTexture(g, A) : this.addChannelTexture(I, A), this.loadedChannels_.add(I);
|
|
19187
19154
|
}
|
|
19188
19155
|
addChannelTexture(A, I) {
|
|
19189
|
-
const g =
|
|
19156
|
+
const g = HI.createWithChunk(I), B = this.textures.length;
|
|
19190
19157
|
this.setTexture(B, g), this.channelToTextureIndex_.set(A, B);
|
|
19191
19158
|
const Q = _t(g.dataType);
|
|
19192
19159
|
if (this.programName && this.programName !== Q)
|
|
@@ -19197,8 +19164,8 @@ class Ot extends dI {
|
|
|
19197
19164
|
}
|
|
19198
19165
|
updateChannelTexture(A, I) {
|
|
19199
19166
|
const g = this.textures[A];
|
|
19200
|
-
if (!(g instanceof
|
|
19201
|
-
const B =
|
|
19167
|
+
if (!(g instanceof HI)) {
|
|
19168
|
+
const B = HI.createWithChunk(I);
|
|
19202
19169
|
this.setTexture(A, B);
|
|
19203
19170
|
return;
|
|
19204
19171
|
}
|
|
@@ -19228,7 +19195,7 @@ class Ot extends dI {
|
|
|
19228
19195
|
for (let o = 0; o < i && E.length < 4; o++) {
|
|
19229
19196
|
const s = this.channelToTextureIndex_.get(o);
|
|
19230
19197
|
if (s === void 0 || !this.loadedChannels_.has(o)) continue;
|
|
19231
|
-
const t = this.textures[s], a =
|
|
19198
|
+
const t = this.textures[s], a = WI(t, this.channels_[o] || {});
|
|
19232
19199
|
if (!a.visible) continue;
|
|
19233
19200
|
const n = E.length;
|
|
19234
19201
|
I[n * 3] = a.color.rgb[0], I[n * 3 + 1] = a.color.rgb[1], I[n * 3 + 2] = a.color.rgb[2], E.push(s), g[n] = -a.contrastLimits[0], B[n] = 1 / (a.contrastLimits[1] - a.contrastLimits[0]), A[n] = 1, Q[n] = a.opacity;
|
|
@@ -19267,7 +19234,7 @@ class Ot extends dI {
|
|
|
19267
19234
|
);
|
|
19268
19235
|
}
|
|
19269
19236
|
setChannelProperty(A, I, g) {
|
|
19270
|
-
const B =
|
|
19237
|
+
const B = WI(
|
|
19271
19238
|
this.getAvailableChannelTexture(A),
|
|
19272
19239
|
{
|
|
19273
19240
|
...this.channels_[A],
|
|
@@ -19294,13 +19261,13 @@ function _t(C) {
|
|
|
19294
19261
|
function Xt(C, A) {
|
|
19295
19262
|
const I = A.position, g = EA(), B = EA();
|
|
19296
19263
|
return C.sort((Q, E) => {
|
|
19297
|
-
|
|
19264
|
+
qI(g, Q.boundingBox.max, Q.boundingBox.min), pI(g, g, 0.5), qI(B, E.boundingBox.max, E.boundingBox.min), pI(B, B, 0.5);
|
|
19298
19265
|
const i = tC(I, g), o = tC(I, B);
|
|
19299
19266
|
return i - o;
|
|
19300
19267
|
}), C;
|
|
19301
19268
|
}
|
|
19302
19269
|
const jt = 2;
|
|
19303
|
-
class Ra extends
|
|
19270
|
+
class Ra extends Yg {
|
|
19304
19271
|
type = "VolumeLayer";
|
|
19305
19272
|
source_;
|
|
19306
19273
|
sliceCoords_;
|
|
@@ -19334,7 +19301,7 @@ class Ra extends Jg {
|
|
|
19334
19301
|
set sourcePolicy(A) {
|
|
19335
19302
|
this.sourcePolicy_ !== A && (this.sourcePolicy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
|
|
19336
19303
|
A,
|
|
19337
|
-
|
|
19304
|
+
lg
|
|
19338
19305
|
));
|
|
19339
19306
|
}
|
|
19340
19307
|
setChannelProps(A) {
|
|
@@ -19374,8 +19341,12 @@ class Ra extends Jg {
|
|
|
19374
19341
|
for (const E of I) Q.updateVolumeWithChunk(E);
|
|
19375
19342
|
return this.updateVolumeTransform(Q, I[0]), Q;
|
|
19376
19343
|
}
|
|
19377
|
-
|
|
19378
|
-
this.chunkStoreView_
|
|
19344
|
+
onAttached(A) {
|
|
19345
|
+
if (this.chunkStoreView_)
|
|
19346
|
+
throw new Error(
|
|
19347
|
+
"VolumeLayer cannot be attached to multiple viewports simultaneously."
|
|
19348
|
+
);
|
|
19349
|
+
this.chunkStoreView_ = A.chunkManager.addView(
|
|
19379
19350
|
this.source_,
|
|
19380
19351
|
this.sourcePolicy_
|
|
19381
19352
|
), aE(
|
|
@@ -19551,7 +19522,7 @@ class tQ {
|
|
|
19551
19522
|
this.lookupTable = Qa(A.lookupTable), this.cycle = Ea(A.cycle);
|
|
19552
19523
|
}
|
|
19553
19524
|
}
|
|
19554
|
-
class DE extends
|
|
19525
|
+
class DE extends Yg {
|
|
19555
19526
|
type = "LabelLayer";
|
|
19556
19527
|
source_;
|
|
19557
19528
|
sliceCoords_;
|
|
@@ -19579,12 +19550,12 @@ class DE extends Jg {
|
|
|
19579
19550
|
}) {
|
|
19580
19551
|
super(i), this.setState("initialized"), this.source_ = A, this.policy_ = g, this.sliceCoords_ = I, this.colorMap_ = new tQ(B), this.onPickValue_ = Q, this.outlineSelected_ = E;
|
|
19581
19552
|
}
|
|
19582
|
-
|
|
19553
|
+
onAttached(A) {
|
|
19583
19554
|
if (this.chunkStoreView_)
|
|
19584
19555
|
throw new Error(
|
|
19585
|
-
"LabelLayer cannot be attached to multiple
|
|
19556
|
+
"LabelLayer cannot be attached to multiple viewports simultaneously."
|
|
19586
19557
|
);
|
|
19587
|
-
if (this.chunkStoreView_ =
|
|
19558
|
+
if (this.chunkStoreView_ = A.chunkManager.addView(
|
|
19588
19559
|
this.source_,
|
|
19589
19560
|
this.policy_
|
|
19590
19561
|
), this.chunkStoreView_.channelCount > 1)
|
|
@@ -19664,7 +19635,7 @@ class DE extends Jg {
|
|
|
19664
19635
|
set imageSourcePolicy(A) {
|
|
19665
19636
|
this.policy_ !== A && (this.policy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
|
|
19666
19637
|
A,
|
|
19667
|
-
|
|
19638
|
+
lg
|
|
19668
19639
|
));
|
|
19669
19640
|
}
|
|
19670
19641
|
// exposed for use in chunk info overlay
|
|
@@ -19704,14 +19675,14 @@ class DE extends Jg {
|
|
|
19704
19675
|
slicePlane(A, I) {
|
|
19705
19676
|
if (!A.data) return;
|
|
19706
19677
|
const g = (I - A.offset.z) / A.scale.z, B = Math.round(g), Q = TA(B, 0, A.shape.z - 1);
|
|
19707
|
-
|
|
19678
|
+
eg(g, Q, 1 + 1e-6) || H.error("LabelLayer", "slicePlane zValue outside extent");
|
|
19708
19679
|
const E = A.shape.x * A.shape.y, i = E * Q;
|
|
19709
19680
|
return A.data.slice(i, i + E);
|
|
19710
19681
|
}
|
|
19711
19682
|
getLabelForChunk(A) {
|
|
19712
19683
|
const I = this.visibleChunks_.get(A);
|
|
19713
19684
|
if (I) return I;
|
|
19714
|
-
const g = this.pool_.acquire(
|
|
19685
|
+
const g = this.pool_.acquire(kg(A));
|
|
19715
19686
|
return g ? (g.textures[0].updateWithChunk(A, this.getDataForLabel(A)), this.updateLabelChunk(g, A), g.setColorMap(this.colorMap_), g.setSelectedValue(this.selectedValue_), g) : this.createLabel(A);
|
|
19716
19687
|
}
|
|
19717
19688
|
createLabel(A) {
|
|
@@ -19728,7 +19699,7 @@ class DE extends Jg {
|
|
|
19728
19699
|
getDataForLabel(A) {
|
|
19729
19700
|
const I = this.sliceCoords_?.z !== void 0 ? this.slicePlane(A, this.sliceCoords_.z) : A.data;
|
|
19730
19701
|
if (!I) {
|
|
19731
|
-
|
|
19702
|
+
H.warn("LabelLayer", "No data for label");
|
|
19732
19703
|
return;
|
|
19733
19704
|
}
|
|
19734
19705
|
return I;
|
|
@@ -19739,7 +19710,7 @@ class DE extends Jg {
|
|
|
19739
19710
|
releaseAndRemoveChunks(A) {
|
|
19740
19711
|
for (const I of A) {
|
|
19741
19712
|
const g = this.visibleChunks_.get(I);
|
|
19742
|
-
g && (this.pool_.release(
|
|
19713
|
+
g && (this.pool_.release(kg(I), g), this.visibleChunks_.delete(I));
|
|
19743
19714
|
}
|
|
19744
19715
|
}
|
|
19745
19716
|
}
|
|
@@ -19835,9 +19806,9 @@ class ka extends dI {
|
|
|
19835
19806
|
return "Points";
|
|
19836
19807
|
}
|
|
19837
19808
|
}
|
|
19838
|
-
let
|
|
19809
|
+
let jg;
|
|
19839
19810
|
function ia() {
|
|
19840
|
-
return
|
|
19811
|
+
return jg || (jg = oa()), jg;
|
|
19841
19812
|
}
|
|
19842
19813
|
function oa() {
|
|
19843
19814
|
const C = (s) => {
|
|
@@ -19881,7 +19852,7 @@ class aQ {
|
|
|
19881
19852
|
);
|
|
19882
19853
|
}
|
|
19883
19854
|
}
|
|
19884
|
-
const
|
|
19855
|
+
const zg = -1, eQ = 0, sa = 1, nQ = 9e-3, ta = 1e-3, aa = 9e-4, ea = 0.5, na = 60;
|
|
19885
19856
|
class Ua {
|
|
19886
19857
|
camera_;
|
|
19887
19858
|
orbitVelocity_ = new aQ(0, 0, 0);
|
|
@@ -19889,13 +19860,13 @@ class Ua {
|
|
|
19889
19860
|
currPos_;
|
|
19890
19861
|
currCenter_ = EA();
|
|
19891
19862
|
dampingFactor_;
|
|
19892
|
-
currMouseButton_ =
|
|
19863
|
+
currMouseButton_ = zg;
|
|
19893
19864
|
constructor(A, I) {
|
|
19894
19865
|
this.camera_ = A, this.currPos_ = new aQ(
|
|
19895
19866
|
I?.radius ?? 1,
|
|
19896
19867
|
I?.yaw ?? 0,
|
|
19897
19868
|
I?.pitch ?? 0
|
|
19898
|
-
), I?.target &&
|
|
19869
|
+
), I?.target && AB(this.currCenter_, I.target), this.dampingFactor_ = TA(
|
|
19899
19870
|
I?.dampingFactor ?? ea,
|
|
19900
19871
|
0,
|
|
19901
19872
|
1
|
|
@@ -19924,18 +19895,18 @@ class Ua {
|
|
|
19924
19895
|
onUpdate(A) {
|
|
19925
19896
|
if (this.orbitVelocity_.phi === 0 && this.orbitVelocity_.theta === 0 && this.orbitVelocity_.radius === 0 && RB(this.panVelocity_, P(0, 0, 0)))
|
|
19926
19897
|
return;
|
|
19927
|
-
this.currPos_.phi += this.orbitVelocity_.phi, this.currPos_.theta += this.orbitVelocity_.theta, this.currPos_.radius += this.orbitVelocity_.radius * this.currPos_.radius,
|
|
19898
|
+
this.currPos_.phi += this.orbitVelocity_.phi, this.currPos_.theta += this.orbitVelocity_.theta, this.currPos_.radius += this.orbitVelocity_.radius * this.currPos_.radius, qI(this.currCenter_, this.currCenter_, this.panVelocity_);
|
|
19928
19899
|
const I = Math.PI / 2 - AA;
|
|
19929
19900
|
this.currPos_.theta = TA(this.currPos_.theta, -I, I), this.currPos_.radius = Math.max(0.01, this.currPos_.radius), this.updateCamera();
|
|
19930
19901
|
const g = Math.pow(1 - this.dampingFactor_, A * na);
|
|
19931
|
-
this.orbitVelocity_.phi *= g, this.orbitVelocity_.theta *= g, this.orbitVelocity_.radius *= g,
|
|
19902
|
+
this.orbitVelocity_.phi *= g, this.orbitVelocity_.theta *= g, this.orbitVelocity_.radius *= g, pI(this.panVelocity_, this.panVelocity_, g), this.cutoffLowVelocity();
|
|
19932
19903
|
}
|
|
19933
19904
|
onPointerDown(A) {
|
|
19934
19905
|
const I = A.event;
|
|
19935
19906
|
this.currMouseButton_ = I.button, I.target?.setPointerCapture?.(I.pointerId);
|
|
19936
19907
|
}
|
|
19937
19908
|
onPointerMove(A) {
|
|
19938
|
-
if (this.currMouseButton_ ==
|
|
19909
|
+
if (this.currMouseButton_ == zg) return;
|
|
19939
19910
|
const I = A.event, g = I.movementX ?? 0, B = I.movementY ?? 0, Q = this.currMouseButton_ === eQ && !I.shiftKey, E = this.currMouseButton_ === eQ && I.shiftKey || this.currMouseButton_ === sa;
|
|
19940
19911
|
Q && this.orbit(g, B), E && this.pan(g, B);
|
|
19941
19912
|
}
|
|
@@ -19946,7 +19917,7 @@ class Ua {
|
|
|
19946
19917
|
this.zoom(g);
|
|
19947
19918
|
}
|
|
19948
19919
|
onPointerEnd(A) {
|
|
19949
|
-
this.currMouseButton_ =
|
|
19920
|
+
this.currMouseButton_ = zg;
|
|
19950
19921
|
const I = A.event;
|
|
19951
19922
|
I.target?.releasePointerCapture?.(I.pointerId);
|
|
19952
19923
|
}
|
|
@@ -19955,13 +19926,13 @@ class Ua {
|
|
|
19955
19926
|
}
|
|
19956
19927
|
pan(A, I) {
|
|
19957
19928
|
const g = this.currPos_.radius * ta, B = EA();
|
|
19958
|
-
sC(B, B, this.camera_.right, A), sC(B, B, this.camera_.up, I),
|
|
19929
|
+
sC(B, B, this.camera_.right, A), sC(B, B, this.camera_.up, I), pI(B, B, g), IB(this.panVelocity_, this.panVelocity_, B);
|
|
19959
19930
|
}
|
|
19960
19931
|
zoom(A) {
|
|
19961
19932
|
this.orbitVelocity_.radius += A * aa;
|
|
19962
19933
|
}
|
|
19963
19934
|
updateCamera() {
|
|
19964
|
-
const A =
|
|
19935
|
+
const A = qI(EA(), this.currCenter_, this.currPos_.toVec3());
|
|
19965
19936
|
this.camera_.transform.setTranslation(A), this.camera_.transform.targetTo(this.currCenter_);
|
|
19966
19937
|
}
|
|
19967
19938
|
cutoffLowVelocity() {
|
|
@@ -19984,7 +19955,7 @@ class sI {
|
|
|
19984
19955
|
const A = SB(this.normal);
|
|
19985
19956
|
if (A > 0) {
|
|
19986
19957
|
const I = 1 / A;
|
|
19987
|
-
|
|
19958
|
+
pI(this.normal, this.normal, I), this.signedDistance *= I;
|
|
19988
19959
|
}
|
|
19989
19960
|
}
|
|
19990
19961
|
}
|
|
@@ -20067,16 +20038,16 @@ class yE extends dI {
|
|
|
20067
20038
|
return this.transform.translation;
|
|
20068
20039
|
}
|
|
20069
20040
|
clipToWorld(A) {
|
|
20070
|
-
const I =
|
|
20041
|
+
const I = Cg(A[0], A[1], A[2], 1), g = Ug(
|
|
20071
20042
|
FA(),
|
|
20072
20043
|
this.projectionMatrix_
|
|
20073
|
-
), B =
|
|
20044
|
+
), B = mI(
|
|
20074
20045
|
nI(),
|
|
20075
20046
|
I,
|
|
20076
20047
|
g
|
|
20077
20048
|
);
|
|
20078
20049
|
$E(B, B, 1 / B[3]);
|
|
20079
|
-
const Q =
|
|
20050
|
+
const Q = mI(
|
|
20080
20051
|
nI(),
|
|
20081
20052
|
B,
|
|
20082
20053
|
this.transform.matrix
|
|
@@ -20115,13 +20086,13 @@ class da extends yE {
|
|
|
20115
20086
|
this.transform.addScale([I, I, 1]);
|
|
20116
20087
|
}
|
|
20117
20088
|
getWorldViewRect() {
|
|
20118
|
-
let A =
|
|
20089
|
+
let A = Cg(-1, -1, 0, 1), I = Cg(1, 1, 0, 1);
|
|
20119
20090
|
const g = OA(
|
|
20120
20091
|
FA(),
|
|
20121
20092
|
this.projectionMatrix,
|
|
20122
20093
|
this.viewMatrix
|
|
20123
|
-
), B =
|
|
20124
|
-
return A =
|
|
20094
|
+
), B = Ug(FA(), g);
|
|
20095
|
+
return A = mI(nI(), A, B), I = mI(nI(), I, B), new GA(
|
|
20125
20096
|
eA(A[0], A[1]),
|
|
20126
20097
|
eA(I[0], I[1])
|
|
20127
20098
|
);
|
|
@@ -20176,7 +20147,7 @@ class la {
|
|
|
20176
20147
|
I.preventDefault();
|
|
20177
20148
|
const g = bA(A.worldPos), B = I.deltaY < 0 ? 1.05 : 0.95;
|
|
20178
20149
|
this.camera_.zoom(B);
|
|
20179
|
-
const Q = this.camera_.clipToWorld(A.clipPos), E =
|
|
20150
|
+
const Q = this.camera_.clipToWorld(A.clipPos), E = IB(EA(), g, Q);
|
|
20180
20151
|
this.camera_.pan(E);
|
|
20181
20152
|
}
|
|
20182
20153
|
onPointerDown(A) {
|
|
@@ -20185,7 +20156,7 @@ class la {
|
|
|
20185
20156
|
}
|
|
20186
20157
|
onPointerMove(A) {
|
|
20187
20158
|
if (!this.dragActive_ || !A.worldPos) return;
|
|
20188
|
-
const I =
|
|
20159
|
+
const I = IB(EA(), this.dragStart_, A.worldPos);
|
|
20189
20160
|
this.camera_.pan(I);
|
|
20190
20161
|
}
|
|
20191
20162
|
onPointerEnd(A) {
|
|
@@ -20193,7 +20164,7 @@ class la {
|
|
|
20193
20164
|
!this.dragActive_ || I.button !== hQ || (this.dragActive_ = !1, I.target?.releasePointerCapture?.(I.pointerId));
|
|
20194
20165
|
}
|
|
20195
20166
|
}
|
|
20196
|
-
const Da = 60, ha = 1.77,
|
|
20167
|
+
const Da = 60, ha = 1.77, Bg = 0.1, $g = 180 - Bg;
|
|
20197
20168
|
class La extends yE {
|
|
20198
20169
|
fov_;
|
|
20199
20170
|
aspectRatio_;
|
|
@@ -20205,9 +20176,9 @@ class La extends yE {
|
|
|
20205
20176
|
far: Q = 1e4,
|
|
20206
20177
|
position: E = P(0, 0, 0)
|
|
20207
20178
|
} = A;
|
|
20208
|
-
if (I <
|
|
20179
|
+
if (I < Bg || I > $g)
|
|
20209
20180
|
throw new Error(
|
|
20210
|
-
`Invalid field of view: ${I}, must be in [${
|
|
20181
|
+
`Invalid field of view: ${I}, must be in [${Bg}, ${$g}] degrees`
|
|
20211
20182
|
);
|
|
20212
20183
|
super(), this.fov_ = I, this.aspectRatio_ = g, this.near_ = B, this.far_ = Q, this.transform.setTranslation(E), this.updateProjectionMatrix();
|
|
20213
20184
|
}
|
|
@@ -20223,7 +20194,7 @@ class La extends yE {
|
|
|
20223
20194
|
zoom(A) {
|
|
20224
20195
|
if (A <= 0)
|
|
20225
20196
|
throw new Error(`Invalid zoom factor: ${A}`);
|
|
20226
|
-
this.fov_ = Math.max(
|
|
20197
|
+
this.fov_ = Math.max(Bg, Math.min($g, this.fov_ / A)), this.updateProjectionMatrix();
|
|
20227
20198
|
}
|
|
20228
20199
|
updateProjectionMatrix() {
|
|
20229
20200
|
bE(
|
|
@@ -20337,8 +20308,8 @@ export {
|
|
|
20337
20308
|
tQ as LabelColorMap,
|
|
20338
20309
|
Ba as LabelImageRenderable,
|
|
20339
20310
|
DE as LabelLayer,
|
|
20340
|
-
|
|
20341
|
-
|
|
20311
|
+
Yg as Layer,
|
|
20312
|
+
MI as OmeZarrImageSource,
|
|
20342
20313
|
Ua as OrbitControls,
|
|
20343
20314
|
da as OrthographicCamera,
|
|
20344
20315
|
la as PanZoomControls,
|