@idetik/core 0.34.0 → 0.35.1
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/index.d.ts +30 -6
- package/dist/index.js +663 -614
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +24 -24
- package/dist/index.umd.cjs.map +1 -1
- package/dist/types/src/layers/image_layer.d.ts +10 -2
- package/dist/types/src/layers/image_layer.d.ts.map +1 -1
- package/dist/types/src/layers/label_layer.d.ts +10 -2
- package/dist/types/src/layers/label_layer.d.ts.map +1 -1
- package/dist/types/src/objects/cameras/orthographic_camera.d.ts +10 -2
- package/dist/types/src/objects/cameras/orthographic_camera.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(u_lineColor, u_opacity);
|
|
176
|
-
}`,
|
|
176
|
+
}`, JI = `#version 300 es
|
|
177
177
|
|
|
178
178
|
layout (location = 0) in vec3 a_position;
|
|
179
179
|
layout (location = 1) in vec3 a_normal;
|
|
@@ -188,7 +188,7 @@ out vec3 v_texCoords;
|
|
|
188
188
|
void main() {
|
|
189
189
|
v_texCoords = (u_worldToTexCoord * u_model * vec4(a_position, 1.0)).xyz;
|
|
190
190
|
gl_Position = u_projection * u_modelView * vec4(a_position, 1.0);
|
|
191
|
-
}`,
|
|
191
|
+
}`, mg = `#version 300 es
|
|
192
192
|
#pragma inject_defines
|
|
193
193
|
|
|
194
194
|
precision highp float;
|
|
@@ -275,7 +275,7 @@ uniform vec3 u_color;
|
|
|
275
275
|
|
|
276
276
|
void main() {
|
|
277
277
|
fragColor = vec4(u_color, u_opacity);
|
|
278
|
-
}`,
|
|
278
|
+
}`, xg = `#version 300 es
|
|
279
279
|
|
|
280
280
|
precision highp float;
|
|
281
281
|
|
|
@@ -288,7 +288,7 @@ out highp vec3 v_positionModel;
|
|
|
288
288
|
void main() {
|
|
289
289
|
v_positionModel = a_position;
|
|
290
290
|
gl_Position = u_projection * u_modelView * vec4(a_position, 1.0);
|
|
291
|
-
}`,
|
|
291
|
+
}`, Tg = `#version 300 es
|
|
292
292
|
#pragma inject_defines
|
|
293
293
|
precision highp float;
|
|
294
294
|
|
|
@@ -543,40 +543,40 @@ const bE = {
|
|
|
543
543
|
fragment: TE
|
|
544
544
|
},
|
|
545
545
|
floatScalarImage: {
|
|
546
|
-
vertex:
|
|
547
|
-
fragment:
|
|
546
|
+
vertex: JI,
|
|
547
|
+
fragment: mg
|
|
548
548
|
},
|
|
549
549
|
intScalarImage: {
|
|
550
|
-
vertex:
|
|
551
|
-
fragment:
|
|
550
|
+
vertex: JI,
|
|
551
|
+
fragment: mg,
|
|
552
552
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
|
|
553
553
|
},
|
|
554
554
|
uintScalarImage: {
|
|
555
|
-
vertex:
|
|
556
|
-
fragment:
|
|
555
|
+
vertex: JI,
|
|
556
|
+
fragment: mg,
|
|
557
557
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
|
|
558
558
|
},
|
|
559
559
|
labelImage: {
|
|
560
|
-
vertex:
|
|
560
|
+
vertex: JI,
|
|
561
561
|
fragment: nC
|
|
562
562
|
},
|
|
563
563
|
intLabelImage: {
|
|
564
|
-
vertex:
|
|
564
|
+
vertex: JI,
|
|
565
565
|
fragment: nC,
|
|
566
566
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
|
|
567
567
|
},
|
|
568
568
|
floatVolume: {
|
|
569
|
-
vertex:
|
|
570
|
-
fragment:
|
|
569
|
+
vertex: xg,
|
|
570
|
+
fragment: Tg
|
|
571
571
|
},
|
|
572
572
|
intVolume: {
|
|
573
|
-
vertex:
|
|
574
|
-
fragment:
|
|
573
|
+
vertex: xg,
|
|
574
|
+
fragment: Tg,
|
|
575
575
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
|
|
576
576
|
},
|
|
577
577
|
uintVolume: {
|
|
578
|
-
vertex:
|
|
579
|
-
fragment:
|
|
578
|
+
vertex: xg,
|
|
579
|
+
fragment: Tg,
|
|
580
580
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
|
|
581
581
|
}
|
|
582
582
|
}, rC = {
|
|
@@ -791,7 +791,7 @@ const PE = typeof window < "u" ? [
|
|
|
791
791
|
WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_2D_ARRAY
|
|
792
792
|
] : [], OE = new Set(
|
|
793
793
|
PE
|
|
794
|
-
),
|
|
794
|
+
), bg = "#pragma inject_defines";
|
|
795
795
|
class VE {
|
|
796
796
|
gl_;
|
|
797
797
|
programs_ = /* @__PURE__ */ new Map();
|
|
@@ -824,21 +824,21 @@ class VE {
|
|
|
824
824
|
}
|
|
825
825
|
function DC(C, A) {
|
|
826
826
|
if (A === void 0 || A.size == 0) return C;
|
|
827
|
-
if (!C.includes(
|
|
827
|
+
if (!C.includes(bg))
|
|
828
828
|
throw new Error(
|
|
829
|
-
`Shader source does not contain "${
|
|
829
|
+
`Shader source does not contain "${bg}" directive`
|
|
830
830
|
);
|
|
831
831
|
const I = Array.from(A.entries()).map(([E, i]) => `#define ${E} ${i}`).join(`
|
|
832
832
|
`), B = `#line __LINE__ + ${1 - A.size}`, Q = `${I}
|
|
833
833
|
${B}`;
|
|
834
|
-
return C.replace(
|
|
834
|
+
return C.replace(bg, Q);
|
|
835
835
|
}
|
|
836
|
-
const
|
|
836
|
+
const Ag = {};
|
|
837
837
|
function LQ(C) {
|
|
838
838
|
const A = C ?? "";
|
|
839
|
-
return
|
|
839
|
+
return Ag[A] = (Ag[A] ?? 0) + 1, C ? `${C}-${Ag[A]}` : String(Ag[A]);
|
|
840
840
|
}
|
|
841
|
-
class
|
|
841
|
+
class dB {
|
|
842
842
|
id = LQ();
|
|
843
843
|
}
|
|
844
844
|
var IA = 1e-6, DA = typeof Float32Array < "u" ? Float32Array : Array, _E = Math.PI / 180;
|
|
@@ -864,9 +864,9 @@ function $E(C, A, I, g, B, Q, E, i, o, s, t, e, n, D, F, k) {
|
|
|
864
864
|
var S = new DA(16);
|
|
865
865
|
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] = e, S[12] = n, S[13] = D, S[14] = F, S[15] = k, S;
|
|
866
866
|
}
|
|
867
|
-
function
|
|
868
|
-
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], e = A[9], n = A[10], D = A[11], F = A[12], k = A[13], S = A[14], U = A[15], f = I * i - g * E, d = I * o - B * E, R = I * s - Q * E, L = g * o - B * i, M = g * s - Q * i, v = B * s - Q * o, AA = t * k - e * F,
|
|
869
|
-
return
|
|
867
|
+
function Mg(C, A) {
|
|
868
|
+
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], e = A[9], n = A[10], D = A[11], F = A[12], k = A[13], S = A[14], U = A[15], f = I * i - g * E, d = I * o - B * E, R = I * s - Q * E, L = g * o - B * i, M = g * s - Q * i, v = B * s - Q * o, AA = t * k - e * F, iA = t * S - n * F, gA = t * U - D * F, oA = e * S - n * k, fA = e * U - D * k, KA = n * U - D * S, sA = f * KA - d * fA + R * oA + L * gA - M * iA + v * AA;
|
|
869
|
+
return sA ? (sA = 1 / sA, C[0] = (i * KA - o * fA + s * oA) * sA, C[1] = (B * fA - g * KA - Q * oA) * sA, C[2] = (k * v - S * M + U * L) * sA, C[3] = (n * M - e * v - D * L) * sA, C[4] = (o * gA - E * KA - s * iA) * sA, C[5] = (I * KA - B * gA + Q * iA) * sA, C[6] = (S * R - F * v - U * d) * sA, C[7] = (t * v - n * R + D * d) * sA, C[8] = (E * fA - i * gA + s * AA) * sA, C[9] = (g * gA - I * fA - Q * AA) * sA, C[10] = (F * M - k * R + U * f) * sA, C[11] = (e * R - t * M - D * f) * sA, C[12] = (i * iA - E * oA - o * AA) * sA, C[13] = (I * oA - g * iA + B * AA) * sA, C[14] = (k * d - F * L - S * f) * sA, C[15] = (t * L - e * d + n * f) * sA, C) : null;
|
|
870
870
|
}
|
|
871
871
|
function aI(C, A, I) {
|
|
872
872
|
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], e = A[8], n = A[9], D = A[10], F = A[11], k = A[12], S = A[13], U = A[14], f = A[15], d = I[0], R = I[1], L = I[2], M = I[3];
|
|
@@ -905,8 +905,8 @@ function Ei(C, A, I, g) {
|
|
|
905
905
|
return D = F * F + k * k + S * S, D > 0 && (D = 1 / Math.sqrt(D), F *= D, k *= D, S *= D), C[0] = F, C[1] = k, C[2] = S, C[3] = 0, C[4] = e * S - n * k, C[5] = n * F - t * S, C[6] = t * k - e * F, C[7] = 0, C[8] = t, C[9] = e, C[10] = n, C[11] = 0, C[12] = B, C[13] = Q, C[14] = E, C[15] = 1, C;
|
|
906
906
|
}
|
|
907
907
|
function ii(C, A) {
|
|
908
|
-
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], e = C[9], n = C[10], D = C[11], F = C[12], k = C[13], S = C[14], U = C[15], f = A[0], d = A[1], R = A[2], L = A[3], M = A[4], v = A[5], AA = A[6],
|
|
909
|
-
return Math.abs(I - f) <= IA * Math.max(1, Math.abs(I), Math.abs(f)) && Math.abs(g - d) <= IA * Math.max(1, Math.abs(g), Math.abs(d)) && Math.abs(B - R) <= IA * Math.max(1, Math.abs(B), Math.abs(R)) && Math.abs(Q - L) <= IA * Math.max(1, Math.abs(Q), Math.abs(L)) && Math.abs(E - M) <= IA * Math.max(1, Math.abs(E), Math.abs(M)) && Math.abs(i - v) <= IA * Math.max(1, Math.abs(i), Math.abs(v)) && Math.abs(o - AA) <= IA * Math.max(1, Math.abs(o), Math.abs(AA)) && Math.abs(s -
|
|
908
|
+
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], e = C[9], n = C[10], D = C[11], F = C[12], k = C[13], S = C[14], U = C[15], f = A[0], d = A[1], R = A[2], L = A[3], M = A[4], v = A[5], AA = A[6], iA = A[7], gA = A[8], oA = A[9], fA = A[10], KA = A[11], sA = A[12], tC = A[13], eC = A[14], aC = A[15];
|
|
909
|
+
return Math.abs(I - f) <= IA * Math.max(1, Math.abs(I), Math.abs(f)) && Math.abs(g - d) <= IA * Math.max(1, Math.abs(g), Math.abs(d)) && Math.abs(B - R) <= IA * Math.max(1, Math.abs(B), Math.abs(R)) && Math.abs(Q - L) <= IA * Math.max(1, Math.abs(Q), Math.abs(L)) && Math.abs(E - M) <= IA * Math.max(1, Math.abs(E), Math.abs(M)) && Math.abs(i - v) <= IA * Math.max(1, Math.abs(i), Math.abs(v)) && Math.abs(o - AA) <= IA * Math.max(1, Math.abs(o), Math.abs(AA)) && Math.abs(s - iA) <= IA * Math.max(1, Math.abs(s), Math.abs(iA)) && Math.abs(t - gA) <= IA * Math.max(1, Math.abs(t), Math.abs(gA)) && Math.abs(e - oA) <= IA * Math.max(1, Math.abs(e), Math.abs(oA)) && Math.abs(n - fA) <= IA * Math.max(1, Math.abs(n), Math.abs(fA)) && Math.abs(D - KA) <= IA * Math.max(1, Math.abs(D), Math.abs(KA)) && Math.abs(F - sA) <= IA * Math.max(1, Math.abs(F), Math.abs(sA)) && Math.abs(k - tC) <= IA * Math.max(1, Math.abs(k), Math.abs(tC)) && Math.abs(S - eC) <= IA * Math.max(1, Math.abs(S), Math.abs(eC)) && Math.abs(U - aC) <= IA * Math.max(1, Math.abs(U), Math.abs(aC));
|
|
910
910
|
}
|
|
911
911
|
function T() {
|
|
912
912
|
var C = new DA(3);
|
|
@@ -916,7 +916,7 @@ function xA(C) {
|
|
|
916
916
|
var A = new DA(3);
|
|
917
917
|
return A[0] = C[0], A[1] = C[1], A[2] = C[2], A;
|
|
918
918
|
}
|
|
919
|
-
function
|
|
919
|
+
function UB(C) {
|
|
920
920
|
var A = C[0], I = C[1], g = C[2];
|
|
921
921
|
return Math.sqrt(A * A + I * I + g * g);
|
|
922
922
|
}
|
|
@@ -924,7 +924,7 @@ function j(C, A, I) {
|
|
|
924
924
|
var g = new DA(3);
|
|
925
925
|
return g[0] = C, g[1] = A, g[2] = I, g;
|
|
926
926
|
}
|
|
927
|
-
function
|
|
927
|
+
function QB(C, A) {
|
|
928
928
|
return C[0] = A[0], C[1] = A[1], C[2] = A[2], C;
|
|
929
929
|
}
|
|
930
930
|
function II(C, A, I, g) {
|
|
@@ -933,16 +933,16 @@ function II(C, A, I, g) {
|
|
|
933
933
|
function rI(C, A, I) {
|
|
934
934
|
return C[0] = A[0] + I[0], C[1] = A[1] + I[1], C[2] = A[2] + I[2], C;
|
|
935
935
|
}
|
|
936
|
-
function
|
|
936
|
+
function lB(C, A, I) {
|
|
937
937
|
return C[0] = A[0] - I[0], C[1] = A[1] - I[1], C[2] = A[2] - I[2], C;
|
|
938
938
|
}
|
|
939
939
|
function oi(C, A, I) {
|
|
940
940
|
return C[0] = A[0] * I[0], C[1] = A[1] * I[1], C[2] = A[2] * I[2], C;
|
|
941
941
|
}
|
|
942
|
-
function
|
|
942
|
+
function TI(C, A, I) {
|
|
943
943
|
return C[0] = A[0] * I, C[1] = A[1] * I, C[2] = A[2] * I, C;
|
|
944
944
|
}
|
|
945
|
-
function
|
|
945
|
+
function EB(C, A, I, g) {
|
|
946
946
|
return C[0] = A[0] + I[0] * g, C[1] = A[1] + I[1] * g, C[2] = A[2] + I[2] * g, C;
|
|
947
947
|
}
|
|
948
948
|
function hC(C, A) {
|
|
@@ -953,14 +953,14 @@ function MQ(C, A) {
|
|
|
953
953
|
var I = A[0], g = A[1], B = A[2], Q = I * I + g * g + B * B;
|
|
954
954
|
return Q > 0 && (Q = 1 / Math.sqrt(Q)), C[0] = A[0] * Q, C[1] = A[1] * Q, C[2] = A[2] * Q, C;
|
|
955
955
|
}
|
|
956
|
-
function
|
|
956
|
+
function sg(C, A) {
|
|
957
957
|
return C[0] * A[0] + C[1] * A[1] + C[2] * A[2];
|
|
958
958
|
}
|
|
959
|
-
function
|
|
959
|
+
function Bg(C, A, I) {
|
|
960
960
|
var g = A[0], B = A[1], Q = A[2], E = I[0], i = I[1], o = I[2];
|
|
961
961
|
return C[0] = B * o - Q * i, C[1] = Q * E - g * o, C[2] = g * i - B * E, C;
|
|
962
962
|
}
|
|
963
|
-
function
|
|
963
|
+
function LB(C, A, I) {
|
|
964
964
|
var g = A[0], B = A[1], Q = A[2], E = I[3] * g + I[7] * B + I[11] * Q + I[15];
|
|
965
965
|
return E = E || 1, 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;
|
|
966
966
|
}
|
|
@@ -971,11 +971,11 @@ function uQ(C, A, I) {
|
|
|
971
971
|
function si(C) {
|
|
972
972
|
return C[0] = 0, C[1] = 0, C[2] = 0, C;
|
|
973
973
|
}
|
|
974
|
-
function
|
|
974
|
+
function JB(C, A) {
|
|
975
975
|
var I = C[0], g = C[1], B = C[2], Q = A[0], E = A[1], i = A[2];
|
|
976
976
|
return Math.abs(I - Q) <= IA * Math.max(1, Math.abs(I), Math.abs(Q)) && Math.abs(g - E) <= IA * Math.max(1, Math.abs(g), Math.abs(E)) && Math.abs(B - i) <= IA * Math.max(1, Math.abs(B), Math.abs(i));
|
|
977
977
|
}
|
|
978
|
-
var
|
|
978
|
+
var iB = lB, ti = UB;
|
|
979
979
|
(function() {
|
|
980
980
|
var C = T();
|
|
981
981
|
return function(A, I, g, B, Q, E) {
|
|
@@ -993,7 +993,7 @@ function ei(C) {
|
|
|
993
993
|
var A = new DA(4);
|
|
994
994
|
return A[0] = C[0], A[1] = C[1], A[2] = C[2], A[3] = C[3], A;
|
|
995
995
|
}
|
|
996
|
-
function
|
|
996
|
+
function tg(C, A, I, g) {
|
|
997
997
|
var B = new DA(4);
|
|
998
998
|
return B[0] = C, B[1] = A, B[2] = I, B[3] = g, B;
|
|
999
999
|
}
|
|
@@ -1007,7 +1007,7 @@ function ri(C, A) {
|
|
|
1007
1007
|
var I = A[0], g = A[1], B = A[2], Q = A[3], E = I * I + g * g + B * B + Q * Q;
|
|
1008
1008
|
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;
|
|
1009
1009
|
}
|
|
1010
|
-
function
|
|
1010
|
+
function bI(C, A, I) {
|
|
1011
1011
|
var g = A[0], B = A[1], Q = A[2], E = A[3];
|
|
1012
1012
|
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;
|
|
1013
1013
|
}
|
|
@@ -1020,7 +1020,7 @@ function xI(C, A, I) {
|
|
|
1020
1020
|
return A;
|
|
1021
1021
|
};
|
|
1022
1022
|
})();
|
|
1023
|
-
function
|
|
1023
|
+
function eg() {
|
|
1024
1024
|
var C = new DA(4);
|
|
1025
1025
|
return DA != Float32Array && (C[0] = 0, C[1] = 0, C[2] = 0), C[3] = 1, C;
|
|
1026
1026
|
}
|
|
@@ -1033,11 +1033,11 @@ function hi(C, A, I) {
|
|
|
1033
1033
|
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];
|
|
1034
1034
|
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;
|
|
1035
1035
|
}
|
|
1036
|
-
function
|
|
1036
|
+
function Wg(C, A, I, g) {
|
|
1037
1037
|
var B = A[0], Q = A[1], E = A[2], i = A[3], o = I[0], s = I[1], t = I[2], e = I[3], n, D, F, k, S;
|
|
1038
1038
|
return D = B * o + Q * s + E * t + i * e, D < 0 && (D = -D, o = -o, s = -s, t = -t, e = -e), 1 - D > IA ? (n = Math.acos(D), F = Math.sin(n), k = Math.sin((1 - g) * n) / F, S = Math.sin(g * n) / F) : (k = 1 - g, S = g), C[0] = k * B + S * o, C[1] = k * Q + S * s, C[2] = k * E + S * t, C[3] = k * i + S * e, C;
|
|
1039
1039
|
}
|
|
1040
|
-
function
|
|
1040
|
+
function YB(C, A) {
|
|
1041
1041
|
var I = A[0] + A[4] + A[8], g;
|
|
1042
1042
|
if (I > 0)
|
|
1043
1043
|
g = Math.sqrt(I + 1), C[3] = 0.5 * g, g = 0.5 / g, C[0] = (A[5] - A[7]) * g, C[1] = (A[6] - A[2]) * g, C[2] = (A[1] - A[3]) * g;
|
|
@@ -1049,24 +1049,24 @@ function LB(C, A) {
|
|
|
1049
1049
|
}
|
|
1050
1050
|
return C;
|
|
1051
1051
|
}
|
|
1052
|
-
var yi = ei, ci = ai,
|
|
1052
|
+
var yi = ei, ci = ai, ug = ri;
|
|
1053
1053
|
(function() {
|
|
1054
1054
|
var C = T(), A = j(1, 0, 0), I = j(0, 1, 0);
|
|
1055
1055
|
return function(g, B, Q) {
|
|
1056
|
-
var E =
|
|
1057
|
-
return E < -0.999999 ? (
|
|
1056
|
+
var E = sg(B, Q);
|
|
1057
|
+
return E < -0.999999 ? (Bg(C, A, B), ti(C) < 1e-6 && Bg(C, I, B), MQ(C, C), Di(g, C, Math.PI), g) : E > 0.999999 ? (g[0] = 0, g[1] = 0, g[2] = 0, g[3] = 1, g) : (Bg(C, B, Q), g[0] = C[0], g[1] = C[1], g[2] = C[2], g[3] = 1 + E, ug(g, g));
|
|
1058
1058
|
};
|
|
1059
1059
|
})();
|
|
1060
1060
|
(function() {
|
|
1061
|
-
var C =
|
|
1061
|
+
var C = eg(), A = eg();
|
|
1062
1062
|
return function(I, g, B, Q, E, i) {
|
|
1063
|
-
return
|
|
1063
|
+
return Wg(C, g, E, i), Wg(A, B, Q, i), Wg(I, C, A, 2 * i * (1 - i)), I;
|
|
1064
1064
|
};
|
|
1065
1065
|
})();
|
|
1066
1066
|
(function() {
|
|
1067
1067
|
var C = JQ();
|
|
1068
1068
|
return function(A, I, g, B) {
|
|
1069
|
-
return C[0] = g[0], C[3] = g[1], C[6] = g[2], C[1] = B[0], C[4] = B[1], C[7] = B[2], C[2] = -I[0], C[5] = -I[1], C[8] = -I[2],
|
|
1069
|
+
return C[0] = g[0], C[3] = g[1], C[6] = g[2], C[1] = B[0], C[4] = B[1], C[7] = B[2], C[2] = -I[0], C[5] = -I[1], C[8] = -I[2], ug(A, YB(A, C));
|
|
1070
1070
|
};
|
|
1071
1071
|
})();
|
|
1072
1072
|
function fQ() {
|
|
@@ -1096,7 +1096,7 @@ function Fi(C, A, I, g) {
|
|
|
1096
1096
|
function cC(C, A) {
|
|
1097
1097
|
return C[0] === A[0] && C[1] === A[1];
|
|
1098
1098
|
}
|
|
1099
|
-
function
|
|
1099
|
+
function vg(C, A) {
|
|
1100
1100
|
var I = C[0], g = C[1], B = A[0], Q = A[1];
|
|
1101
1101
|
return Math.abs(I - B) <= IA * Math.max(1, Math.abs(I), Math.abs(B)) && Math.abs(g - Q) <= IA * Math.max(1, Math.abs(g), Math.abs(Q));
|
|
1102
1102
|
}
|
|
@@ -1148,7 +1148,7 @@ class gI {
|
|
|
1148
1148
|
this.min = j(1 / 0, 1 / 0, 1 / 0), this.max = j(-1 / 0, -1 / 0, -1 / 0);
|
|
1149
1149
|
const Q = T();
|
|
1150
1150
|
for (const E of B)
|
|
1151
|
-
|
|
1151
|
+
LB(Q, E, A), this.expandWithPoint(Q);
|
|
1152
1152
|
}
|
|
1153
1153
|
}
|
|
1154
1154
|
const KQ = {
|
|
@@ -1162,7 +1162,7 @@ const KQ = {
|
|
|
1162
1162
|
size: 7,
|
|
1163
1163
|
marker: 8
|
|
1164
1164
|
};
|
|
1165
|
-
class
|
|
1165
|
+
class kI extends dB {
|
|
1166
1166
|
boundingBox_ = null;
|
|
1167
1167
|
primitive_;
|
|
1168
1168
|
attributes_;
|
|
@@ -1272,7 +1272,7 @@ class Si {
|
|
|
1272
1272
|
function Ni(C) {
|
|
1273
1273
|
return C === 1 || C === 2 || C === 4 || C === 8;
|
|
1274
1274
|
}
|
|
1275
|
-
function
|
|
1275
|
+
function MB(C) {
|
|
1276
1276
|
if (C instanceof Int8Array)
|
|
1277
1277
|
return "byte";
|
|
1278
1278
|
if (C instanceof Int16Array)
|
|
@@ -1313,7 +1313,7 @@ function qQ(C) {
|
|
|
1313
1313
|
return 4;
|
|
1314
1314
|
}
|
|
1315
1315
|
}
|
|
1316
|
-
function
|
|
1316
|
+
function WI(C) {
|
|
1317
1317
|
const A = HQ(C) * qQ(C), I = Math.max(1, C.mipmapLevels);
|
|
1318
1318
|
let g = Math.max(1, C.width), B = Math.max(1, C.height), Q = Math.max(1, C.depth), E = 0;
|
|
1319
1319
|
for (let i = 0; i < I; ++i)
|
|
@@ -1340,7 +1340,7 @@ function Ri(C) {
|
|
|
1340
1340
|
return [0, 1];
|
|
1341
1341
|
}
|
|
1342
1342
|
}
|
|
1343
|
-
class
|
|
1343
|
+
class uB extends dB {
|
|
1344
1344
|
dataFormat = "rgba";
|
|
1345
1345
|
dataType = "unsigned_byte";
|
|
1346
1346
|
maxFilter = "nearest";
|
|
@@ -1449,7 +1449,7 @@ class ki {
|
|
|
1449
1449
|
const I = this.textures_.get(A);
|
|
1450
1450
|
if (I) {
|
|
1451
1451
|
this.gl_.deleteTexture(I), this.textures_.delete(A), A.readTexel = void 0, this.currentTexture_ === A && (this.currentTexture_ = null);
|
|
1452
|
-
const g =
|
|
1452
|
+
const g = WI(A);
|
|
1453
1453
|
this.gpuTextureBytes_ = Math.max(0, this.gpuTextureBytes_ - g), this.textureCount_ = Math.max(0, this.textureCount_ - 1);
|
|
1454
1454
|
}
|
|
1455
1455
|
}
|
|
@@ -1483,7 +1483,7 @@ class ki {
|
|
|
1483
1483
|
);
|
|
1484
1484
|
else
|
|
1485
1485
|
throw new Error(`Unknown texture type ${A.type}`);
|
|
1486
|
-
this.gpuTextureBytes_ +=
|
|
1486
|
+
this.gpuTextureBytes_ += WI(A), this.textureCount_ += 1, this.textures_.set(A, B), this.gl_.bindTexture(g, null), A.readTexel = (Q, E, i) => Promise.resolve(this.readTexel(A, Q, E, i));
|
|
1487
1487
|
}
|
|
1488
1488
|
configureTextureParameters(A, I) {
|
|
1489
1489
|
const g = this.gl_, B = this.getFilter(A.minFilter, A), Q = this.getFilter(A.maxFilter, A);
|
|
@@ -1899,7 +1899,7 @@ class wC extends lQ {
|
|
|
1899
1899
|
);
|
|
1900
1900
|
break;
|
|
1901
1901
|
case "u_cameraPositionModel": {
|
|
1902
|
-
const k =
|
|
1902
|
+
const k = Mg(GA(), E), S = tg(0, 0, 0, 1), U = bI(
|
|
1903
1903
|
DI(),
|
|
1904
1904
|
S,
|
|
1905
1905
|
k
|
|
@@ -2134,12 +2134,12 @@ function Ki(C) {
|
|
|
2134
2134
|
}), I += `${g.type},${g.offset},${g.itemSize}|`;
|
|
2135
2135
|
return { attributes: A, attributesKey: I };
|
|
2136
2136
|
}
|
|
2137
|
-
class
|
|
2137
|
+
class VI extends uB {
|
|
2138
2138
|
width_;
|
|
2139
2139
|
height_;
|
|
2140
2140
|
depth_;
|
|
2141
2141
|
constructor(A, I, g, B) {
|
|
2142
|
-
super(), this.dataFormat = "scalar", this.dataType =
|
|
2142
|
+
super(), this.dataFormat = "scalar", this.dataType = MB(A), this.data_ = A, this.width_ = I, this.height_ = g, this.depth_ = B;
|
|
2143
2143
|
}
|
|
2144
2144
|
get type() {
|
|
2145
2145
|
return "Texture3D";
|
|
@@ -2159,7 +2159,7 @@ class PI extends YB {
|
|
|
2159
2159
|
throw new Error(
|
|
2160
2160
|
"Unable to create texture, chunk data is not initialized."
|
|
2161
2161
|
);
|
|
2162
|
-
const g = new
|
|
2162
|
+
const g = new VI(
|
|
2163
2163
|
I,
|
|
2164
2164
|
A.shape.x,
|
|
2165
2165
|
A.shape.y,
|
|
@@ -2184,11 +2184,11 @@ class Hi {
|
|
|
2184
2184
|
if (!I) {
|
|
2185
2185
|
const g = this.device_.createTexture({
|
|
2186
2186
|
size: GC(A),
|
|
2187
|
-
dimension: A instanceof
|
|
2187
|
+
dimension: A instanceof VI ? "3d" : "2d",
|
|
2188
2188
|
format: pi(A),
|
|
2189
2189
|
usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST | GPUTextureUsage.COPY_SRC
|
|
2190
2190
|
}), B = { entry: A, texture: g };
|
|
2191
|
-
I = B, this.textures_.push(B), this.textureCount_ += 1, this.gpuTextureBytes_ +=
|
|
2191
|
+
I = B, this.textures_.push(B), this.textureCount_ += 1, this.gpuTextureBytes_ += WI(A);
|
|
2192
2192
|
}
|
|
2193
2193
|
return this.upload(A, I.texture), A.readTexel = (g, B, Q) => this.readTexel(I.texture, A.dataType, g, B, Q), I.texture;
|
|
2194
2194
|
}
|
|
@@ -2228,7 +2228,7 @@ class Hi {
|
|
|
2228
2228
|
const I = this.textures_.findIndex((B) => B.entry === A);
|
|
2229
2229
|
if (I === -1) return;
|
|
2230
2230
|
this.textures_[I].texture.destroy(), this.textures_.splice(I, 1), A.readTexel = void 0;
|
|
2231
|
-
const g =
|
|
2231
|
+
const g = WI(A);
|
|
2232
2232
|
this.gpuTextureBytes_ = Math.max(0, this.gpuTextureBytes_ - g), this.textureCount_ = Math.max(0, this.textureCount_ - 1);
|
|
2233
2233
|
}
|
|
2234
2234
|
disposeAll() {
|
|
@@ -2240,7 +2240,7 @@ function GC(C) {
|
|
|
2240
2240
|
return {
|
|
2241
2241
|
width: C.width,
|
|
2242
2242
|
height: C.height,
|
|
2243
|
-
depthOrArrayLayers: C instanceof
|
|
2243
|
+
depthOrArrayLayers: C instanceof VI ? C.depth : 1
|
|
2244
2244
|
};
|
|
2245
2245
|
}
|
|
2246
2246
|
function qi(C, A) {
|
|
@@ -2298,7 +2298,7 @@ function pi(C) {
|
|
|
2298
2298
|
return "rgba32float";
|
|
2299
2299
|
}
|
|
2300
2300
|
}
|
|
2301
|
-
const
|
|
2301
|
+
const fB = (C, A) => ((C + A - 1) / A | 0) * A;
|
|
2302
2302
|
function mi(C) {
|
|
2303
2303
|
return Object.keys(C);
|
|
2304
2304
|
}
|
|
@@ -2345,7 +2345,7 @@ const FC = (C) => ArrayBuffer.isView(C) && !(C instanceof DataView), pQ = (C) =>
|
|
|
2345
2345
|
// You can only create one in an internal struct. But, this code generates
|
|
2346
2346
|
// views of structs and it needs to not fail if the struct has a bool
|
|
2347
2347
|
bool: { numElements: 0, align: 1, size: 0, type: "bool", View: Uint32Array }
|
|
2348
|
-
}),
|
|
2348
|
+
}), dI = pQ({
|
|
2349
2349
|
...Z,
|
|
2350
2350
|
"atomic<i32>": Z.i32,
|
|
2351
2351
|
"atomic<u32>": Z.u32,
|
|
@@ -2379,11 +2379,11 @@ const FC = (C) => ArrayBuffer.isView(C) && !(C instanceof DataView), pQ = (C) =>
|
|
|
2379
2379
|
"mat3x4<f16>": Z.mat3x4h,
|
|
2380
2380
|
"mat4x4<f32>": Z.mat4x4f,
|
|
2381
2381
|
"mat4x4<f16>": Z.mat4x4h
|
|
2382
|
-
}), Ti = mi(
|
|
2382
|
+
}), Ti = mi(dI);
|
|
2383
2383
|
function bi(C = [], A) {
|
|
2384
2384
|
const I = /* @__PURE__ */ new Set();
|
|
2385
2385
|
for (const g of Ti) {
|
|
2386
|
-
const B =
|
|
2386
|
+
const B = dI[g];
|
|
2387
2387
|
I.has(B) || (I.add(B), B.flatten = C.includes(g) ? A : !A);
|
|
2388
2388
|
}
|
|
2389
2389
|
}
|
|
@@ -2397,15 +2397,15 @@ function Wi(C) {
|
|
|
2397
2397
|
if (g.fields)
|
|
2398
2398
|
return C.size * B;
|
|
2399
2399
|
{
|
|
2400
|
-
const Q = C, { align: E } =
|
|
2401
|
-
return B > 1 ?
|
|
2400
|
+
const Q = C, { align: E } = dI[Q.type];
|
|
2401
|
+
return B > 1 ? fB(C.size, E) * B : C.size;
|
|
2402
2402
|
}
|
|
2403
2403
|
}
|
|
2404
2404
|
}
|
|
2405
2405
|
function SC(C, A, I, g) {
|
|
2406
2406
|
const { size: B, type: Q } = C;
|
|
2407
2407
|
try {
|
|
2408
|
-
const { View: E, align: i, size: o } =
|
|
2408
|
+
const { View: E, align: i, size: o } = dI[Q], s = g !== void 0, t = s ? fB(B, i) : o, e = t / E.BYTES_PER_ELEMENT, n = s ? g === 0 ? (A.byteLength - I) / t : g : 1;
|
|
2409
2409
|
return new E(A, I, e * n);
|
|
2410
2410
|
} catch {
|
|
2411
2411
|
throw new Error(`unknown type: ${Q}`);
|
|
@@ -2418,7 +2418,7 @@ function Zi(C, A, I) {
|
|
|
2418
2418
|
const g = I || 0, B = new ArrayBuffer(Wi(C)), Q = (E, i) => {
|
|
2419
2419
|
const o = E, s = o.elementType;
|
|
2420
2420
|
if (s) {
|
|
2421
|
-
if (vi(s) &&
|
|
2421
|
+
if (vi(s) && dI[s.type].flatten)
|
|
2422
2422
|
return SC(s, B, i, o.numElements);
|
|
2423
2423
|
{
|
|
2424
2424
|
const { size: t } = mQ(E), e = o.numElements === 0 ? (B.byteLength - i) / t : o.numElements;
|
|
@@ -2441,7 +2441,7 @@ function Zi(C, A, I) {
|
|
|
2441
2441
|
};
|
|
2442
2442
|
return { views: Q(C, g), arrayBuffer: B };
|
|
2443
2443
|
}
|
|
2444
|
-
function
|
|
2444
|
+
function oB(C, A) {
|
|
2445
2445
|
if (C !== void 0)
|
|
2446
2446
|
if (FC(A)) {
|
|
2447
2447
|
const I = A;
|
|
@@ -2458,13 +2458,13 @@ function EB(C, A) {
|
|
|
2458
2458
|
} else if (Array.isArray(A)) {
|
|
2459
2459
|
const I = A;
|
|
2460
2460
|
C.forEach((g, B) => {
|
|
2461
|
-
|
|
2461
|
+
oB(g, I[B]);
|
|
2462
2462
|
});
|
|
2463
2463
|
} else {
|
|
2464
2464
|
const I = A;
|
|
2465
2465
|
for (const [g, B] of Object.entries(C)) {
|
|
2466
2466
|
const Q = I[g];
|
|
2467
|
-
Q &&
|
|
2467
|
+
Q && oB(B, Q);
|
|
2468
2468
|
}
|
|
2469
2469
|
}
|
|
2470
2470
|
}
|
|
@@ -2473,28 +2473,28 @@ function Pi(C, A, I = 0) {
|
|
|
2473
2473
|
return {
|
|
2474
2474
|
...Q,
|
|
2475
2475
|
set(E) {
|
|
2476
|
-
|
|
2476
|
+
oB(E, Q.views);
|
|
2477
2477
|
}
|
|
2478
2478
|
};
|
|
2479
2479
|
}
|
|
2480
|
-
function
|
|
2480
|
+
function sB(C) {
|
|
2481
2481
|
const I = C.elementType;
|
|
2482
2482
|
if (I)
|
|
2483
|
-
return
|
|
2483
|
+
return sB(I);
|
|
2484
2484
|
const B = C.fields;
|
|
2485
2485
|
if (B)
|
|
2486
|
-
return Object.values(B).reduce((i, { type: o }) => Math.max(i,
|
|
2487
|
-
const { type: Q } = C, { align: E } =
|
|
2486
|
+
return Object.values(B).reduce((i, { type: o }) => Math.max(i, sB(o)), 0);
|
|
2487
|
+
const { type: Q } = C, { align: E } = dI[Q];
|
|
2488
2488
|
return E;
|
|
2489
2489
|
}
|
|
2490
2490
|
function mQ(C) {
|
|
2491
2491
|
const I = C.elementType;
|
|
2492
2492
|
if (I) {
|
|
2493
|
-
const Q = I.size, E =
|
|
2493
|
+
const Q = I.size, E = sB(I);
|
|
2494
2494
|
return {
|
|
2495
2495
|
unalignedSize: Q,
|
|
2496
2496
|
align: E,
|
|
2497
|
-
size:
|
|
2497
|
+
size: fB(Q, E)
|
|
2498
2498
|
};
|
|
2499
2499
|
}
|
|
2500
2500
|
const B = C.fields;
|
|
@@ -2577,7 +2577,7 @@ class XA extends dA {
|
|
|
2577
2577
|
return `array<${this.format.getTypeName()}, ${this.count}>`;
|
|
2578
2578
|
}
|
|
2579
2579
|
}
|
|
2580
|
-
class
|
|
2580
|
+
class tB extends dA {
|
|
2581
2581
|
constructor(A, I, g) {
|
|
2582
2582
|
super(A, g), this.format = I;
|
|
2583
2583
|
}
|
|
@@ -2610,11 +2610,11 @@ class BI extends dA {
|
|
|
2610
2610
|
return A;
|
|
2611
2611
|
}
|
|
2612
2612
|
}
|
|
2613
|
-
var
|
|
2613
|
+
var tA;
|
|
2614
2614
|
((C) => {
|
|
2615
2615
|
C[C.Uniform = 0] = "Uniform", C[C.Storage = 1] = "Storage", C[C.Immediate = 2] = "Immediate", C[C.Texture = 3] = "Texture", C[C.Sampler = 4] = "Sampler", C[C.StorageTexture = 5] = "StorageTexture";
|
|
2616
|
-
})(
|
|
2617
|
-
class
|
|
2616
|
+
})(tA || (tA = {}));
|
|
2617
|
+
class YI {
|
|
2618
2618
|
constructor(A, I, g, B, Q, E, i) {
|
|
2619
2619
|
this.relations = null, this.name = A, this.type = I, this.group = g, this.binding = B, this.attributes = Q, this.resourceType = E, this.access = i;
|
|
2620
2620
|
}
|
|
@@ -2700,10 +2700,10 @@ function Io(C) {
|
|
|
2700
2700
|
}
|
|
2701
2701
|
return g = g - 127 + 15, g >= 31 ? (yA[0] = I << 15 | 31744, yA[0]) : g <= 0 ? g < -10 ? (yA[0] = I << 15, yA[0]) : (B = (8388608 | B) >> 1 - g, yA[0] = I << 15 | B >> 13, yA[0]) : (B >>= 13, yA[0] = I << 15 | g << 10 | B, yA[0]);
|
|
2702
2702
|
}
|
|
2703
|
-
const
|
|
2703
|
+
const KB = new Uint32Array(1), TQ = new Float32Array(KB.buffer, 0, 1);
|
|
2704
2704
|
function kC(C) {
|
|
2705
2705
|
const A = 112 + (C >> 6 & 31) << 23 | (63 & C) << 17;
|
|
2706
|
-
return
|
|
2706
|
+
return KB[0] = A, TQ[0];
|
|
2707
2707
|
}
|
|
2708
2708
|
function go(C, A, I, g, B, Q, E, i, o) {
|
|
2709
2709
|
const s = g * (E >>= B) * (Q >>= B) + I * E + A * i;
|
|
@@ -2823,7 +2823,7 @@ function go(C, A, I, g, B, Q, E, i, o) {
|
|
|
2823
2823
|
const t = new Uint32Array(C.buffer, s, 1)[0], e = (4192256 & t) >> 11, n = (4290772992 & t) >> 22;
|
|
2824
2824
|
return [kC(2047 & t), kC(e), (function(D) {
|
|
2825
2825
|
const F = 112 + (D >> 5 & 31) << 23 | (31 & D) << 18;
|
|
2826
|
-
return
|
|
2826
|
+
return KB[0] = F, TQ[0];
|
|
2827
2827
|
})(n), 1];
|
|
2828
2828
|
}
|
|
2829
2829
|
}
|
|
@@ -2898,7 +2898,7 @@ function _(C, A, I, g, B) {
|
|
|
2898
2898
|
}
|
|
2899
2899
|
return B;
|
|
2900
2900
|
}
|
|
2901
|
-
const Wg = { 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 } };
|
|
2901
|
+
const Zg = { 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 } };
|
|
2902
2902
|
class lA {
|
|
2903
2903
|
constructor() {
|
|
2904
2904
|
this.id = lA._id++, this.line = 0;
|
|
@@ -2914,9 +2914,9 @@ class lA {
|
|
|
2914
2914
|
}
|
|
2915
2915
|
searchBlock(A, I) {
|
|
2916
2916
|
if (A) {
|
|
2917
|
-
I(
|
|
2917
|
+
I(ag.instance);
|
|
2918
2918
|
for (const g of A) g instanceof Array ? this.searchBlock(g, I) : g.search(I);
|
|
2919
|
-
I(
|
|
2919
|
+
I(ng.instance);
|
|
2920
2920
|
}
|
|
2921
2921
|
}
|
|
2922
2922
|
constEvaluate(A, I) {
|
|
@@ -2928,16 +2928,16 @@ class lA {
|
|
|
2928
2928
|
}
|
|
2929
2929
|
}
|
|
2930
2930
|
lA._id = 0;
|
|
2931
|
-
class
|
|
2931
|
+
class ag extends lA {
|
|
2932
2932
|
}
|
|
2933
|
-
|
|
2934
|
-
class
|
|
2933
|
+
ag.instance = new ag();
|
|
2934
|
+
class ng extends lA {
|
|
2935
2935
|
}
|
|
2936
|
-
|
|
2936
|
+
ng.instance = new ng();
|
|
2937
2937
|
const bQ = /* @__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"]);
|
|
2938
|
-
class
|
|
2938
|
+
class EA extends lA {
|
|
2939
2939
|
}
|
|
2940
|
-
class
|
|
2940
|
+
class vI extends EA {
|
|
2941
2941
|
constructor(A, I, g, B, Q, E) {
|
|
2942
2942
|
super(), this.calls = /* @__PURE__ */ new Set(), this.name = A, this.args = I, this.returnType = g, this.body = B, this.startLine = Q, this.endLine = E;
|
|
2943
2943
|
}
|
|
@@ -2951,7 +2951,7 @@ class bI extends QA {
|
|
|
2951
2951
|
this.searchBlock(this.body, A);
|
|
2952
2952
|
}
|
|
2953
2953
|
}
|
|
2954
|
-
class dC extends
|
|
2954
|
+
class dC extends EA {
|
|
2955
2955
|
constructor(A) {
|
|
2956
2956
|
super(), this.expression = A;
|
|
2957
2957
|
}
|
|
@@ -2962,7 +2962,7 @@ class dC extends QA {
|
|
|
2962
2962
|
this.expression.search(A);
|
|
2963
2963
|
}
|
|
2964
2964
|
}
|
|
2965
|
-
class WQ extends
|
|
2965
|
+
class WQ extends EA {
|
|
2966
2966
|
constructor(A, I) {
|
|
2967
2967
|
super(), this.condition = A, this.body = I;
|
|
2968
2968
|
}
|
|
@@ -2973,7 +2973,7 @@ class WQ extends QA {
|
|
|
2973
2973
|
this.condition.search(A), this.searchBlock(this.body, A);
|
|
2974
2974
|
}
|
|
2975
2975
|
}
|
|
2976
|
-
class
|
|
2976
|
+
class eB extends EA {
|
|
2977
2977
|
constructor(A, I) {
|
|
2978
2978
|
super(), this.body = A, this.loopId = I;
|
|
2979
2979
|
}
|
|
@@ -2984,7 +2984,7 @@ class sB extends QA {
|
|
|
2984
2984
|
this.searchBlock(this.body, A);
|
|
2985
2985
|
}
|
|
2986
2986
|
}
|
|
2987
|
-
class vQ extends
|
|
2987
|
+
class vQ extends EA {
|
|
2988
2988
|
constructor(A, I, g, B) {
|
|
2989
2989
|
super(), this.init = A, this.condition = I, this.increment = g, this.body = B;
|
|
2990
2990
|
}
|
|
@@ -2996,7 +2996,7 @@ class vQ extends QA {
|
|
|
2996
2996
|
(I = this.init) === null || I === void 0 || I.search(A), (g = this.condition) === null || g === void 0 || g.search(A), (B = this.increment) === null || B === void 0 || B.search(A), this.searchBlock(this.body, A);
|
|
2997
2997
|
}
|
|
2998
2998
|
}
|
|
2999
|
-
class qA extends
|
|
2999
|
+
class qA extends EA {
|
|
3000
3000
|
constructor(A, I, g, B, Q) {
|
|
3001
3001
|
super(), this.attributes = null, this.name = A, this.type = I, this.storage = g, this.access = B, this.value = Q;
|
|
3002
3002
|
}
|
|
@@ -3008,7 +3008,7 @@ class qA extends QA {
|
|
|
3008
3008
|
A(this), (I = this.value) === null || I === void 0 || I.search(A);
|
|
3009
3009
|
}
|
|
3010
3010
|
}
|
|
3011
|
-
class
|
|
3011
|
+
class HB extends EA {
|
|
3012
3012
|
constructor(A, I, g) {
|
|
3013
3013
|
super(), this.attributes = null, this.name = A, this.type = I, this.value = g;
|
|
3014
3014
|
}
|
|
@@ -3020,7 +3020,7 @@ class fB extends QA {
|
|
|
3020
3020
|
(I = this.value) === null || I === void 0 || I.search(A);
|
|
3021
3021
|
}
|
|
3022
3022
|
}
|
|
3023
|
-
class
|
|
3023
|
+
class pI extends EA {
|
|
3024
3024
|
constructor(A, I, g, B, Q) {
|
|
3025
3025
|
super(), this.attributes = null, this.name = A, this.type = I, this.storage = g, this.access = B, this.value = Q;
|
|
3026
3026
|
}
|
|
@@ -3032,7 +3032,7 @@ class HI extends QA {
|
|
|
3032
3032
|
A(this), (I = this.value) === null || I === void 0 || I.search(A);
|
|
3033
3033
|
}
|
|
3034
3034
|
}
|
|
3035
|
-
class
|
|
3035
|
+
class Cg extends EA {
|
|
3036
3036
|
constructor(A, I, g, B, Q) {
|
|
3037
3037
|
super(), this.attributes = null, this.name = A, this.type = I, this.storage = g, this.access = B, this.value = Q;
|
|
3038
3038
|
}
|
|
@@ -3047,7 +3047,7 @@ class gg extends QA {
|
|
|
3047
3047
|
A(this), (I = this.value) === null || I === void 0 || I.search(A);
|
|
3048
3048
|
}
|
|
3049
3049
|
}
|
|
3050
|
-
var eI,
|
|
3050
|
+
var eI, uI, G, h;
|
|
3051
3051
|
((C) => {
|
|
3052
3052
|
C.increment = "++", C.decrement = "--";
|
|
3053
3053
|
})(eI || (eI = {})), ((C) => {
|
|
@@ -3057,7 +3057,7 @@ var eI, YI, G, h;
|
|
|
3057
3057
|
return C[I];
|
|
3058
3058
|
};
|
|
3059
3059
|
})(eI || (eI = {}));
|
|
3060
|
-
class ZQ extends
|
|
3060
|
+
class ZQ extends EA {
|
|
3061
3061
|
constructor(A, I) {
|
|
3062
3062
|
super(), this.operator = A, this.variable = I;
|
|
3063
3063
|
}
|
|
@@ -3070,14 +3070,14 @@ class ZQ extends QA {
|
|
|
3070
3070
|
}
|
|
3071
3071
|
((C) => {
|
|
3072
3072
|
C.assign = "=", C.addAssign = "+=", C.subtractAssign = "-=", C.multiplyAssign = "*=", C.divideAssign = "/=", C.moduloAssign = "%=", C.andAssign = "&=", C.orAssign = "|=", C.xorAssign = "^=", C.shiftLeftAssign = "<<=", C.shiftRightAssign = ">>=";
|
|
3073
|
-
})(
|
|
3073
|
+
})(uI || (uI = {})), ((C) => {
|
|
3074
3074
|
C.parse = function(A) {
|
|
3075
3075
|
const I = A;
|
|
3076
3076
|
if (I === "parse") throw new Error("Invalid value for AssignOperator");
|
|
3077
3077
|
return I;
|
|
3078
3078
|
};
|
|
3079
|
-
})(
|
|
3080
|
-
class PQ extends
|
|
3079
|
+
})(uI || (uI = {}));
|
|
3080
|
+
class PQ extends EA {
|
|
3081
3081
|
constructor(A, I, g) {
|
|
3082
3082
|
super(), this.operator = A, this.variable = I, this.value = g;
|
|
3083
3083
|
}
|
|
@@ -3088,7 +3088,7 @@ class PQ extends QA {
|
|
|
3088
3088
|
this.variable.search(A), this.value.search(A);
|
|
3089
3089
|
}
|
|
3090
3090
|
}
|
|
3091
|
-
class
|
|
3091
|
+
class qB extends EA {
|
|
3092
3092
|
constructor(A, I) {
|
|
3093
3093
|
super(), this.name = A, this.args = I;
|
|
3094
3094
|
}
|
|
@@ -3103,7 +3103,7 @@ class KB extends QA {
|
|
|
3103
3103
|
A(this);
|
|
3104
3104
|
}
|
|
3105
3105
|
}
|
|
3106
|
-
class OQ extends
|
|
3106
|
+
class OQ extends EA {
|
|
3107
3107
|
constructor(A, I) {
|
|
3108
3108
|
super(), this.body = A, this.continuing = I;
|
|
3109
3109
|
}
|
|
@@ -3115,7 +3115,7 @@ class OQ extends QA {
|
|
|
3115
3115
|
this.searchBlock(this.body, A), (I = this.continuing) === null || I === void 0 || I.search(A);
|
|
3116
3116
|
}
|
|
3117
3117
|
}
|
|
3118
|
-
class VQ extends
|
|
3118
|
+
class VQ extends EA {
|
|
3119
3119
|
constructor(A, I) {
|
|
3120
3120
|
super(), this.condition = A, this.cases = I;
|
|
3121
3121
|
}
|
|
@@ -3127,7 +3127,7 @@ class VQ extends QA {
|
|
|
3127
3127
|
for (const I of this.cases) I.search(A);
|
|
3128
3128
|
}
|
|
3129
3129
|
}
|
|
3130
|
-
class _Q extends
|
|
3130
|
+
class _Q extends EA {
|
|
3131
3131
|
constructor(A, I, g, B) {
|
|
3132
3132
|
super(), this.condition = A, this.body = I, this.elseif = g, this.else = B;
|
|
3133
3133
|
}
|
|
@@ -3138,7 +3138,7 @@ class _Q extends QA {
|
|
|
3138
3138
|
this.condition.search(A), this.searchBlock(this.body, A), this.searchBlock(this.elseif, A), this.searchBlock(this.else, A);
|
|
3139
3139
|
}
|
|
3140
3140
|
}
|
|
3141
|
-
class XQ extends
|
|
3141
|
+
class XQ extends EA {
|
|
3142
3142
|
constructor(A) {
|
|
3143
3143
|
super(), this.value = A;
|
|
3144
3144
|
}
|
|
@@ -3150,7 +3150,7 @@ class XQ extends QA {
|
|
|
3150
3150
|
(I = this.value) === null || I === void 0 || I.search(A);
|
|
3151
3151
|
}
|
|
3152
3152
|
}
|
|
3153
|
-
class Bo extends
|
|
3153
|
+
class Bo extends EA {
|
|
3154
3154
|
constructor(A) {
|
|
3155
3155
|
super(), this.name = A;
|
|
3156
3156
|
}
|
|
@@ -3158,7 +3158,7 @@ class Bo extends QA {
|
|
|
3158
3158
|
return "enable";
|
|
3159
3159
|
}
|
|
3160
3160
|
}
|
|
3161
|
-
class Co extends
|
|
3161
|
+
class Co extends EA {
|
|
3162
3162
|
constructor(A) {
|
|
3163
3163
|
super(), this.extensions = A;
|
|
3164
3164
|
}
|
|
@@ -3166,7 +3166,7 @@ class Co extends QA {
|
|
|
3166
3166
|
return "requires";
|
|
3167
3167
|
}
|
|
3168
3168
|
}
|
|
3169
|
-
class jQ extends
|
|
3169
|
+
class jQ extends EA {
|
|
3170
3170
|
constructor(A, I) {
|
|
3171
3171
|
super(), this.severity = A, this.rule = I;
|
|
3172
3172
|
}
|
|
@@ -3174,7 +3174,7 @@ class jQ extends QA {
|
|
|
3174
3174
|
return "diagnostic";
|
|
3175
3175
|
}
|
|
3176
3176
|
}
|
|
3177
|
-
class
|
|
3177
|
+
class pB extends EA {
|
|
3178
3178
|
constructor(A, I) {
|
|
3179
3179
|
super(), this.name = A, this.type = I;
|
|
3180
3180
|
}
|
|
@@ -3182,12 +3182,12 @@ class HB extends QA {
|
|
|
3182
3182
|
return "alias";
|
|
3183
3183
|
}
|
|
3184
3184
|
}
|
|
3185
|
-
class Qo extends
|
|
3185
|
+
class Qo extends EA {
|
|
3186
3186
|
get astNodeType() {
|
|
3187
3187
|
return "discard";
|
|
3188
3188
|
}
|
|
3189
3189
|
}
|
|
3190
|
-
class zQ extends
|
|
3190
|
+
class zQ extends EA {
|
|
3191
3191
|
constructor() {
|
|
3192
3192
|
super(...arguments), this.condition = null, this.loopId = -1;
|
|
3193
3193
|
}
|
|
@@ -3195,7 +3195,7 @@ class zQ extends QA {
|
|
|
3195
3195
|
return "break";
|
|
3196
3196
|
}
|
|
3197
3197
|
}
|
|
3198
|
-
class $Q extends
|
|
3198
|
+
class $Q extends EA {
|
|
3199
3199
|
constructor() {
|
|
3200
3200
|
super(...arguments), this.loopId = -1;
|
|
3201
3201
|
}
|
|
@@ -3203,7 +3203,7 @@ class $Q extends QA {
|
|
|
3203
3203
|
return "continue";
|
|
3204
3204
|
}
|
|
3205
3205
|
}
|
|
3206
|
-
class N extends
|
|
3206
|
+
class N extends EA {
|
|
3207
3207
|
constructor(A) {
|
|
3208
3208
|
super(), this.attributes = null, this.name = A;
|
|
3209
3209
|
}
|
|
@@ -3276,7 +3276,7 @@ class w extends N {
|
|
|
3276
3276
|
}
|
|
3277
3277
|
}
|
|
3278
3278
|
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);
|
|
3279
|
-
class
|
|
3279
|
+
class Qg extends N {
|
|
3280
3280
|
constructor(A, I, g, B) {
|
|
3281
3281
|
super(A), this.storage = I, this.type = g, this.access = B;
|
|
3282
3282
|
}
|
|
@@ -3284,7 +3284,7 @@ class Bg extends N {
|
|
|
3284
3284
|
return "pointer";
|
|
3285
3285
|
}
|
|
3286
3286
|
}
|
|
3287
|
-
class
|
|
3287
|
+
class mI extends N {
|
|
3288
3288
|
constructor(A, I, g, B) {
|
|
3289
3289
|
super(A), this.attributes = I, this.format = g, this.count = B;
|
|
3290
3290
|
}
|
|
@@ -3295,7 +3295,7 @@ class qI extends N {
|
|
|
3295
3295
|
return !0;
|
|
3296
3296
|
}
|
|
3297
3297
|
}
|
|
3298
|
-
class
|
|
3298
|
+
class fI extends N {
|
|
3299
3299
|
constructor(A, I, g) {
|
|
3300
3300
|
super(A), this.format = I, this.access = g;
|
|
3301
3301
|
}
|
|
@@ -3336,7 +3336,7 @@ class HA extends MA {
|
|
|
3336
3336
|
return I && (I[0] = this.type), A.evalExpression(this, A.context);
|
|
3337
3337
|
}
|
|
3338
3338
|
}
|
|
3339
|
-
class
|
|
3339
|
+
class mB extends MA {
|
|
3340
3340
|
constructor(A, I) {
|
|
3341
3341
|
super(), this.cachedReturnValue = null, this.name = A, this.args = I;
|
|
3342
3342
|
}
|
|
@@ -3472,7 +3472,7 @@ class BE extends lA {
|
|
|
3472
3472
|
A(this), this.searchBlock(this.body, A);
|
|
3473
3473
|
}
|
|
3474
3474
|
}
|
|
3475
|
-
class
|
|
3475
|
+
class Eg extends MA {
|
|
3476
3476
|
get astNodeType() {
|
|
3477
3477
|
return "default";
|
|
3478
3478
|
}
|
|
@@ -3560,7 +3560,7 @@ class JC extends uA {
|
|
|
3560
3560
|
return this.typeInfo.name;
|
|
3561
3561
|
}
|
|
3562
3562
|
}
|
|
3563
|
-
class
|
|
3563
|
+
class aB extends uA {
|
|
3564
3564
|
constructor() {
|
|
3565
3565
|
super(new dA("void", null), null);
|
|
3566
3566
|
}
|
|
@@ -3571,10 +3571,10 @@ class tB extends uA {
|
|
|
3571
3571
|
return "void";
|
|
3572
3572
|
}
|
|
3573
3573
|
}
|
|
3574
|
-
|
|
3574
|
+
aB.void = new aB();
|
|
3575
3575
|
class sI extends uA {
|
|
3576
3576
|
constructor(A) {
|
|
3577
|
-
super(new
|
|
3577
|
+
super(new tB("pointer", A.typeInfo, null), null), this.reference = A;
|
|
3578
3578
|
}
|
|
3579
3579
|
clone() {
|
|
3580
3580
|
return this;
|
|
@@ -3765,13 +3765,13 @@ class p extends uA {
|
|
|
3765
3765
|
return A;
|
|
3766
3766
|
}
|
|
3767
3767
|
}
|
|
3768
|
-
class
|
|
3768
|
+
class QA extends uA {
|
|
3769
3769
|
constructor(A, I, g = 0, B = null) {
|
|
3770
3770
|
super(I, B), this.buffer = A instanceof ArrayBuffer ? A : A.buffer, this.offset = g;
|
|
3771
3771
|
}
|
|
3772
3772
|
clone() {
|
|
3773
3773
|
const A = new Uint8Array(new Uint8Array(this.buffer, this.offset, this.typeInfo.size));
|
|
3774
|
-
return new
|
|
3774
|
+
return new QA(A.buffer, this.typeInfo, 0, null);
|
|
3775
3775
|
}
|
|
3776
3776
|
setDataValue(A, I, g, B) {
|
|
3777
3777
|
if (I === null) return void console.log("setDataValue: NULL data.");
|
|
@@ -3907,7 +3907,7 @@ class CA extends uA {
|
|
|
3907
3907
|
const i = new Float32Array(this.buffer, B, 16);
|
|
3908
3908
|
return void (I instanceof p ? (i[0] = I.data[0], i[1] = I.data[1], i[2] = I.data[2], i[3] = I.data[3], i[4] = I.data[4], i[5] = I.data[5], i[6] = I.data[6], i[7] = I.data[7], i[8] = I.data[8], i[9] = I.data[9], i[10] = I.data[10], i[11] = I.data[11], i[12] = I.data[12], i[13] = I.data[13], i[14] = I.data[14], i[15] = I.data[15]) : (i[0] = I[0], i[1] = I[1], i[2] = I[2], i[3] = I[3], i[4] = I[4], i[5] = I[5], i[6] = I[6], i[7] = I[7], i[8] = I[8], i[9] = I[9], i[10] = I[10], i[11] = I[11], i[12] = I[12], i[13] = I[13], i[14] = I[14], i[15] = I[15]));
|
|
3909
3909
|
}
|
|
3910
|
-
if (I instanceof
|
|
3910
|
+
if (I instanceof QA) {
|
|
3911
3911
|
if (g === I.typeInfo)
|
|
3912
3912
|
return void new Uint8Array(this.buffer, B, I.buffer.byteLength).set(new Uint8Array(I.buffer));
|
|
3913
3913
|
console.error("SetDataValue: Type mismatch", E, I.typeInfo.getTypeName());
|
|
@@ -3990,7 +3990,7 @@ class CA extends uA {
|
|
|
3990
3990
|
I = I.postfix;
|
|
3991
3991
|
}
|
|
3992
3992
|
const s = o.getTypeName();
|
|
3993
|
-
return s === "f32" ? new c(new Float32Array(this.buffer, i, 1), o, this) : s === "i32" ? new c(new Int32Array(this.buffer, i, 1), o, this) : s === "u32" ? new c(new Uint32Array(this.buffer, i, 1), o, this) : s === "vec2f" ? new r(new Float32Array(this.buffer, i, 2), o, this) : s === "vec3f" ? new r(new Float32Array(this.buffer, i, 3), o, this) : s === "vec4f" ? new r(new Float32Array(this.buffer, i, 4), o, this) : s === "vec2i" ? new r(new Int32Array(this.buffer, i, 2), o, this) : s === "vec3i" ? new r(new Int32Array(this.buffer, i, 3), o, this) : s === "vec4i" ? new r(new Int32Array(this.buffer, i, 4), o, this) : s === "vec2u" ? new r(new Uint32Array(this.buffer, i, 2), o, this) : s === "vec3u" ? new r(new Uint32Array(this.buffer, i, 3), o, this) : s === "vec4u" ? new r(new Uint32Array(this.buffer, i, 4), o, this) : o instanceof BI && o.name === "atomic" ? ((B = o.format) === null || B === void 0 ? void 0 : B.name) === "u32" ? new c(new Uint32Array(this.buffer, i, 1)[0], o.format, this) : ((Q = o.format) === null || Q === void 0 ? void 0 : Q.name) === "i32" ? new c(new Int32Array(this.buffer, i, 1)[0], o.format, this) : (console.error(`GetDataValue: Invalid atomic format ${(E = o.format) === null || E === void 0 ? void 0 : E.name}`), null) : new
|
|
3993
|
+
return s === "f32" ? new c(new Float32Array(this.buffer, i, 1), o, this) : s === "i32" ? new c(new Int32Array(this.buffer, i, 1), o, this) : s === "u32" ? new c(new Uint32Array(this.buffer, i, 1), o, this) : s === "vec2f" ? new r(new Float32Array(this.buffer, i, 2), o, this) : s === "vec3f" ? new r(new Float32Array(this.buffer, i, 3), o, this) : s === "vec4f" ? new r(new Float32Array(this.buffer, i, 4), o, this) : s === "vec2i" ? new r(new Int32Array(this.buffer, i, 2), o, this) : s === "vec3i" ? new r(new Int32Array(this.buffer, i, 3), o, this) : s === "vec4i" ? new r(new Int32Array(this.buffer, i, 4), o, this) : s === "vec2u" ? new r(new Uint32Array(this.buffer, i, 2), o, this) : s === "vec3u" ? new r(new Uint32Array(this.buffer, i, 3), o, this) : s === "vec4u" ? new r(new Uint32Array(this.buffer, i, 4), o, this) : o instanceof BI && o.name === "atomic" ? ((B = o.format) === null || B === void 0 ? void 0 : B.name) === "u32" ? new c(new Uint32Array(this.buffer, i, 1)[0], o.format, this) : ((Q = o.format) === null || Q === void 0 ? void 0 : Q.name) === "i32" ? new c(new Int32Array(this.buffer, i, 1)[0], o.format, this) : (console.error(`GetDataValue: Invalid atomic format ${(E = o.format) === null || E === void 0 ? void 0 : E.name}`), null) : new QA(this.buffer, o, i, this);
|
|
3994
3994
|
}
|
|
3995
3995
|
toArray() {
|
|
3996
3996
|
const A = this.typeInfo.getTypeName();
|
|
@@ -4072,18 +4072,18 @@ class WA extends uA {
|
|
|
4072
4072
|
return I;
|
|
4073
4073
|
}
|
|
4074
4074
|
get texelByteSize() {
|
|
4075
|
-
const A = this.format, I =
|
|
4075
|
+
const A = this.format, I = Zg[A];
|
|
4076
4076
|
return I ? I.isDepthStencil ? 4 : I.bytesPerBlock : 0;
|
|
4077
4077
|
}
|
|
4078
4078
|
get bytesPerRow() {
|
|
4079
4079
|
return this.width * this.texelByteSize;
|
|
4080
4080
|
}
|
|
4081
4081
|
get isDepthStencil() {
|
|
4082
|
-
const A = this.format, I =
|
|
4082
|
+
const A = this.format, I = Zg[A];
|
|
4083
4083
|
return !!I && I.isDepthStencil;
|
|
4084
4084
|
}
|
|
4085
4085
|
getGpuSize() {
|
|
4086
|
-
const A = this.format, I =
|
|
4086
|
+
const A = this.format, I = Zg[A], g = this.width;
|
|
4087
4087
|
if (!A || g <= 0 || !I) return -1;
|
|
4088
4088
|
const B = this.height, Q = this.depthOrArrayLayers, E = this.dimension;
|
|
4089
4089
|
return g / I.blockWidth * (E === "1d" ? 1 : B / I.blockHeight) * I.bytesPerBlock * Q;
|
|
@@ -4202,7 +4202,7 @@ class YC {
|
|
|
4202
4202
|
return this.isArrayType() || this.isTemplateType();
|
|
4203
4203
|
}
|
|
4204
4204
|
}
|
|
4205
|
-
class
|
|
4205
|
+
class fg {
|
|
4206
4206
|
constructor(A) {
|
|
4207
4207
|
this._tokens = [], this._start = 0, this._current = 0, this._line = 1, this._source = A ?? "";
|
|
4208
4208
|
}
|
|
@@ -4298,7 +4298,7 @@ class Mg {
|
|
|
4298
4298
|
return this._current >= this._source.length;
|
|
4299
4299
|
}
|
|
4300
4300
|
_isAlpha(A) {
|
|
4301
|
-
return !this._isNumeric(A) && !this._isWhitespace(A) && A !== "_" && !
|
|
4301
|
+
return !this._isNumeric(A) && !this._isWhitespace(A) && A !== "_" && !fg._operators.has(A);
|
|
4302
4302
|
}
|
|
4303
4303
|
_isNumeric(A) {
|
|
4304
4304
|
return A >= "0" && A <= "9";
|
|
@@ -4324,20 +4324,20 @@ class Mg {
|
|
|
4324
4324
|
function J(C) {
|
|
4325
4325
|
return Array.isArray(C) || C?.buffer instanceof ArrayBuffer;
|
|
4326
4326
|
}
|
|
4327
|
-
|
|
4327
|
+
fg._operators = /* @__PURE__ */ new Set([".", "(", ")", "[", "]", "{", "}", ",", ";", ":", "=", "!", "<", ">", "+", "-", "*", "/", "%", "&", "|", "^", "~", "@", "#", "?", "'", "`", '"', "\\", `
|
|
4328
4328
|
`, "\r", " ", "\0"]);
|
|
4329
|
-
const
|
|
4329
|
+
const rg = new Float32Array(1), oo = new Uint32Array(rg.buffer), so = new Uint32Array(rg.buffer), Dg = new Int32Array(1), to = new Float32Array(Dg.buffer), eo = new Uint32Array(Dg.buffer), hg = new Uint32Array(1), ao = new Float32Array(hg.buffer), no = new Int32Array(hg.buffer);
|
|
4330
4330
|
function MC(C, A, I) {
|
|
4331
4331
|
if (A === I) return C;
|
|
4332
4332
|
if (A === "f32") {
|
|
4333
|
-
if (I === "i32" || I === "x32") return
|
|
4334
|
-
if (I === "u32") return
|
|
4333
|
+
if (I === "i32" || I === "x32") return rg[0] = C, oo[0];
|
|
4334
|
+
if (I === "u32") return rg[0] = C, so[0];
|
|
4335
4335
|
} else if (A === "i32" || A === "x32") {
|
|
4336
|
-
if (I === "f32") return
|
|
4337
|
-
if (I === "u32") return
|
|
4336
|
+
if (I === "f32") return Dg[0] = C, to[0];
|
|
4337
|
+
if (I === "u32") return Dg[0] = C, eo[0];
|
|
4338
4338
|
} else if (A === "u32") {
|
|
4339
|
-
if (I === "f32") return
|
|
4340
|
-
if (I === "i32" || I === "x32") return
|
|
4339
|
+
if (I === "f32") return hg[0] = C, ao[0];
|
|
4340
|
+
if (I === "i32" || I === "x32") return hg[0] = C, no[0];
|
|
4341
4341
|
}
|
|
4342
4342
|
return console.error(`Unsupported cast from ${A} to ${I}`), C;
|
|
4343
4343
|
}
|
|
@@ -4346,7 +4346,7 @@ class ro {
|
|
|
4346
4346
|
this.resources = null, this.inUse = !1, this.info = null, this.node = A;
|
|
4347
4347
|
}
|
|
4348
4348
|
}
|
|
4349
|
-
class
|
|
4349
|
+
class Ig {
|
|
4350
4350
|
constructor(A, I) {
|
|
4351
4351
|
this.align = A, this.size = I;
|
|
4352
4352
|
}
|
|
@@ -4359,45 +4359,45 @@ class mA {
|
|
|
4359
4359
|
return A.name == "texture_storage_1d" || A.name == "texture_storage_2d" || A.name == "texture_storage_2d_array" || A.name == "texture_storage_3d";
|
|
4360
4360
|
}
|
|
4361
4361
|
updateAST(A) {
|
|
4362
|
-
for (const I of A) I instanceof
|
|
4362
|
+
for (const I of A) I instanceof vI && this._functions.set(I.name, new ro(I));
|
|
4363
4363
|
for (const I of A) if (I instanceof bA) {
|
|
4364
4364
|
const g = this.getTypeInfo(I, null);
|
|
4365
4365
|
g instanceof OA && this.structs.push(g);
|
|
4366
4366
|
}
|
|
4367
|
-
for (const I of A) if (I instanceof
|
|
4367
|
+
for (const I of A) if (I instanceof pB) this.aliases.push(this._getAliasInfo(I));
|
|
4368
4368
|
else {
|
|
4369
|
-
if (I instanceof
|
|
4369
|
+
if (I instanceof HB) {
|
|
4370
4370
|
const g = I, B = this._getAttributeNum(g.attributes, "id", 0), Q = g.type != null ? this.getTypeInfo(g.type, g.attributes) : null;
|
|
4371
4371
|
this.overrides.push(new _i(g.name, Q, g.attributes, B));
|
|
4372
4372
|
continue;
|
|
4373
4373
|
}
|
|
4374
4374
|
if (this._isUniformVar(I)) {
|
|
4375
|
-
const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = new
|
|
4375
|
+
const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = new YI(g.name, E, B, Q, g.attributes, tA.Uniform, g.access);
|
|
4376
4376
|
i.access || (i.access = "read"), this.uniforms.push(i);
|
|
4377
4377
|
continue;
|
|
4378
4378
|
}
|
|
4379
4379
|
if (this._isImmediateVar(I)) {
|
|
4380
|
-
const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = new
|
|
4380
|
+
const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = new YI(g.name, E, B, Q, g.attributes, tA.Immediate, g.access);
|
|
4381
4381
|
i.access || (i.access = "read"), this.immediates.push(i);
|
|
4382
4382
|
continue;
|
|
4383
4383
|
}
|
|
4384
4384
|
if (this._isStorageVar(I)) {
|
|
4385
|
-
const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = this._isStorageTexture(E), o = new
|
|
4385
|
+
const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = this._isStorageTexture(E), o = new YI(g.name, E, B, Q, g.attributes, i ? tA.StorageTexture : tA.Storage, g.access);
|
|
4386
4386
|
o.access || (o.access = "read"), this.storage.push(o);
|
|
4387
4387
|
continue;
|
|
4388
4388
|
}
|
|
4389
4389
|
if (this._isTextureVar(I)) {
|
|
4390
|
-
const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = this._isStorageTexture(E), o = i ? E.access : g.access, s = new
|
|
4390
|
+
const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = this._isStorageTexture(E), o = i ? E.access : g.access, s = new YI(g.name, E, B, Q, g.attributes, i ? tA.StorageTexture : tA.Texture, o || g.access);
|
|
4391
4391
|
s.access || (s.access = "read"), i ? this.storage.push(s) : this.textures.push(s);
|
|
4392
4392
|
continue;
|
|
4393
4393
|
}
|
|
4394
4394
|
if (this._isSamplerVar(I)) {
|
|
4395
|
-
const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = new
|
|
4395
|
+
const g = I, B = this._getAttributeNum(g.attributes, "group", 0), Q = this._getAttributeNum(g.attributes, "binding", 0), E = this.getTypeInfo(g.type, g.attributes), i = new YI(g.name, E, B, Q, g.attributes, tA.Sampler, g.access);
|
|
4396
4396
|
this.samplers.push(i);
|
|
4397
4397
|
continue;
|
|
4398
4398
|
}
|
|
4399
4399
|
}
|
|
4400
|
-
for (const I of A) if (I instanceof
|
|
4400
|
+
for (const I of A) if (I instanceof vI) {
|
|
4401
4401
|
const g = this._getAttribute(I, "vertex"), B = this._getAttribute(I, "fragment"), Q = this._getAttribute(I, "compute"), E = g || B || Q, i = new ji(I.name, E?.name, I.attributes);
|
|
4402
4402
|
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 Xi(o.name, this.getTypeInfo(o.type, o.attributes), o.attributes)), i.returnType = I.returnType ? this.getTypeInfo(I.returnType, I.attributes) : null;
|
|
4403
4403
|
continue;
|
|
@@ -4474,15 +4474,15 @@ class mA {
|
|
|
4474
4474
|
_findResources(A, I) {
|
|
4475
4475
|
const g = [], B = this, Q = [];
|
|
4476
4476
|
return A.search((E) => {
|
|
4477
|
-
if (E instanceof
|
|
4478
|
-
else if (E instanceof
|
|
4477
|
+
if (E instanceof ag) Q.push({});
|
|
4478
|
+
else if (E instanceof ng) Q.pop();
|
|
4479
4479
|
else if (E instanceof qA) {
|
|
4480
4480
|
const i = E;
|
|
4481
4481
|
I && i.type !== null && this._markStructsFromAST(i.type), Q.length > 0 && (Q[Q.length - 1][i.name] = i);
|
|
4482
4482
|
} else if (E instanceof HA) {
|
|
4483
4483
|
const i = E;
|
|
4484
4484
|
I && i.type !== null && this._markStructsFromAST(i.type);
|
|
4485
|
-
} else if (E instanceof
|
|
4485
|
+
} else if (E instanceof pI) {
|
|
4486
4486
|
const i = E;
|
|
4487
4487
|
I && i.type !== null && this._markStructsFromAST(i.type), Q.length > 0 && (Q[Q.length - 1][i.name] = i);
|
|
4488
4488
|
} else if (E instanceof SA) {
|
|
@@ -4491,24 +4491,24 @@ class mA {
|
|
|
4491
4491
|
return;
|
|
4492
4492
|
const o = B._findResource(i.name);
|
|
4493
4493
|
o && g.push(o);
|
|
4494
|
-
} else if (E instanceof
|
|
4494
|
+
} else if (E instanceof mB) {
|
|
4495
4495
|
const i = E, o = B._functions.get(i.name);
|
|
4496
4496
|
if (o && (I && (o.inUse = !0), A.calls.add(o.node), o.resources = B._findResources(o.node, I), g.push(...o.resources)), i.name === "textureSample" && i.args.length >= 2) {
|
|
4497
4497
|
const s = i.args[0];
|
|
4498
4498
|
let t = null;
|
|
4499
4499
|
if (s instanceof SA) {
|
|
4500
4500
|
const D = B._findResource(s.name);
|
|
4501
|
-
D && D.resourceType ===
|
|
4501
|
+
D && D.resourceType === tA.Texture && (t = D);
|
|
4502
4502
|
}
|
|
4503
4503
|
const e = i.args[1];
|
|
4504
4504
|
let n = null;
|
|
4505
4505
|
if (e instanceof SA) {
|
|
4506
4506
|
const D = B._findResource(e.name);
|
|
4507
|
-
D && D.resourceType ===
|
|
4507
|
+
D && D.resourceType === tA.Sampler && (n = D);
|
|
4508
4508
|
}
|
|
4509
4509
|
t && n && (t.relations === null && (t.relations = []), t.relations.push(n), n.relations === null && (n.relations = []), n.relations.push(t));
|
|
4510
4510
|
}
|
|
4511
|
-
} else if (E instanceof
|
|
4511
|
+
} else if (E instanceof qB) {
|
|
4512
4512
|
const i = E, o = B._functions.get(i.name);
|
|
4513
4513
|
o && (I && (o.inUse = !0), A.calls.add(o.node), o.resources = B._findResources(o.node, I), g.push(...o.resources));
|
|
4514
4514
|
}
|
|
@@ -4601,11 +4601,11 @@ class mA {
|
|
|
4601
4601
|
}
|
|
4602
4602
|
getTypeInfo(A, I = null) {
|
|
4603
4603
|
if (this._types.has(A)) return this._types.get(A);
|
|
4604
|
-
if (A instanceof
|
|
4605
|
-
const B = A.type ? this.getTypeInfo(A.type, A.attributes) : null, Q = new
|
|
4604
|
+
if (A instanceof Qg) {
|
|
4605
|
+
const B = A.type ? this.getTypeInfo(A.type, A.attributes) : null, Q = new tB(A.name, B, I);
|
|
4606
4606
|
return this._types.set(A, Q), this._updateTypeInfo(Q), Q;
|
|
4607
4607
|
}
|
|
4608
|
-
if (A instanceof
|
|
4608
|
+
if (A instanceof mI) {
|
|
4609
4609
|
const B = A, Q = B.format ? this.getTypeInfo(B.format, B.attributes) : null, E = new XA(B.name, I);
|
|
4610
4610
|
return E.format = Q, E.count = B.count, this._types.set(A, E), this._updateTypeInfo(E), E;
|
|
4611
4611
|
}
|
|
@@ -4618,7 +4618,7 @@ class mA {
|
|
|
4618
4618
|
}
|
|
4619
4619
|
return this._types.set(A, Q), this._updateTypeInfo(Q), Q;
|
|
4620
4620
|
}
|
|
4621
|
-
if (A instanceof
|
|
4621
|
+
if (A instanceof fI) {
|
|
4622
4622
|
const B = A, Q = B.format instanceof N, E = B.format ? Q ? this.getTypeInfo(B.format, null) : new dA(B.format, null) : null, i = new BI(B.name, E, I, B.access);
|
|
4623
4623
|
return this._types.set(A, i), this._updateTypeInfo(i), i;
|
|
4624
4624
|
}
|
|
@@ -4636,7 +4636,7 @@ class mA {
|
|
|
4636
4636
|
const E = this._getTypeSize(A.format);
|
|
4637
4637
|
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);
|
|
4638
4638
|
}
|
|
4639
|
-
A instanceof
|
|
4639
|
+
A instanceof tB && this._updateTypeInfo(A.format), A instanceof OA && this._updateStructInfo(A);
|
|
4640
4640
|
}
|
|
4641
4641
|
_updateStructInfo(A) {
|
|
4642
4642
|
var I;
|
|
@@ -4662,20 +4662,20 @@ class mA {
|
|
|
4662
4662
|
const E = mA._typeInfo[A.name];
|
|
4663
4663
|
if (E !== void 0) {
|
|
4664
4664
|
const i = ((I = A.format) === null || I === void 0 ? void 0 : I.name) === "f16" ? 2 : 1;
|
|
4665
|
-
return new
|
|
4665
|
+
return new Ig(Math.max(Q, E.align / i), Math.max(B, E.size / i));
|
|
4666
4666
|
}
|
|
4667
4667
|
}
|
|
4668
4668
|
{
|
|
4669
4669
|
const E = mA._typeInfo[A.name.substring(0, A.name.length - 1)];
|
|
4670
4670
|
if (E) {
|
|
4671
4671
|
const i = A.name[A.name.length - 1] === "h" ? 2 : 1;
|
|
4672
|
-
return new
|
|
4672
|
+
return new Ig(Math.max(Q, E.align / i), Math.max(B, E.size / i));
|
|
4673
4673
|
}
|
|
4674
4674
|
}
|
|
4675
4675
|
if (A instanceof XA) {
|
|
4676
4676
|
let E = A, i = 8, o = 8;
|
|
4677
4677
|
const s = this._getTypeSize(E.format);
|
|
4678
|
-
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
|
|
4678
|
+
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 Ig(Math.max(Q, i), Math.max(B, o));
|
|
4679
4679
|
}
|
|
4680
4680
|
if (A instanceof OA) {
|
|
4681
4681
|
let E = 0, i = 0, o = 0, s = 0, t = 0;
|
|
@@ -4683,7 +4683,7 @@ class mA {
|
|
|
4683
4683
|
const n = this._getTypeSize(e.type);
|
|
4684
4684
|
n !== null && (E = Math.max(n.align, E), o = this._roundUp(n.align, o + s), s = n.size, t = o);
|
|
4685
4685
|
}
|
|
4686
|
-
return i = this._roundUp(E, t + s), new
|
|
4686
|
+
return i = this._roundUp(E, t + s), new Ig(Math.max(Q, E), Math.max(B, i));
|
|
4687
4687
|
}
|
|
4688
4688
|
return null;
|
|
4689
4689
|
}
|
|
@@ -4722,26 +4722,26 @@ class mA {
|
|
|
4722
4722
|
}
|
|
4723
4723
|
}
|
|
4724
4724
|
mA._typeInfo = { f16: { align: 2, size: 2 }, i32: { align: 4, size: 4 }, u32: { align: 4, size: 4 }, f32: { align: 4, size: 4 }, atomic: { align: 4, size: 4 }, vec2: { align: 8, size: 8 }, vec3: { align: 16, size: 12 }, vec4: { align: 16, size: 16 }, mat2x2: { align: 8, size: 16 }, mat3x2: { align: 8, size: 24 }, mat4x2: { align: 8, size: 32 }, mat2x3: { align: 16, size: 32 }, mat3x3: { align: 16, size: 48 }, mat4x3: { align: 16, size: 64 }, mat2x4: { align: 16, size: 32 }, mat3x4: { align: 16, size: 48 }, mat4x4: { align: 16, size: 64 } }, mA._textureTypes = a.any_texture_type.map((C) => C.name), mA._samplerTypes = a.sampler_type.map((C) => C.name);
|
|
4725
|
-
let
|
|
4726
|
-
class
|
|
4725
|
+
let xB = 0;
|
|
4726
|
+
class TB {
|
|
4727
4727
|
constructor(A, I, g) {
|
|
4728
|
-
this.id =
|
|
4728
|
+
this.id = xB++, this.name = A, this.value = I, this.node = g;
|
|
4729
4729
|
}
|
|
4730
4730
|
clone() {
|
|
4731
|
-
return new
|
|
4731
|
+
return new TB(this.name, this.value, this.node);
|
|
4732
4732
|
}
|
|
4733
4733
|
}
|
|
4734
|
-
class
|
|
4734
|
+
class bB {
|
|
4735
4735
|
constructor(A) {
|
|
4736
|
-
this.id =
|
|
4736
|
+
this.id = xB++, this.name = A.name, this.node = A;
|
|
4737
4737
|
}
|
|
4738
4738
|
clone() {
|
|
4739
|
-
return new
|
|
4739
|
+
return new bB(this.node);
|
|
4740
4740
|
}
|
|
4741
4741
|
}
|
|
4742
|
-
class
|
|
4742
|
+
class WB {
|
|
4743
4743
|
constructor(A) {
|
|
4744
|
-
this.parent = null, this.variables = /* @__PURE__ */ new Map(), this.functions = /* @__PURE__ */ new Map(), this.currentFunctionName = "", this.id =
|
|
4744
|
+
this.parent = null, this.variables = /* @__PURE__ */ new Map(), this.functions = /* @__PURE__ */ new Map(), this.currentFunctionName = "", this.id = xB++, A && (this.parent = A, this.currentFunctionName = A.currentFunctionName);
|
|
4745
4745
|
}
|
|
4746
4746
|
getVariable(A) {
|
|
4747
4747
|
var I;
|
|
@@ -4752,7 +4752,7 @@ class TB {
|
|
|
4752
4752
|
return this.functions.has(A) ? (I = this.functions.get(A)) !== null && I !== void 0 ? I : null : this.parent ? this.parent.getFunction(A) : null;
|
|
4753
4753
|
}
|
|
4754
4754
|
createVariable(A, I, g) {
|
|
4755
|
-
this.variables.set(A, new
|
|
4755
|
+
this.variables.set(A, new TB(A, I, g ?? null));
|
|
4756
4756
|
}
|
|
4757
4757
|
setVariable(A, I, g) {
|
|
4758
4758
|
const B = this.getVariable(A);
|
|
@@ -4764,7 +4764,7 @@ class TB {
|
|
|
4764
4764
|
return (I = g?.value) !== null && I !== void 0 ? I : null;
|
|
4765
4765
|
}
|
|
4766
4766
|
clone() {
|
|
4767
|
-
return new
|
|
4767
|
+
return new WB(this);
|
|
4768
4768
|
}
|
|
4769
4769
|
}
|
|
4770
4770
|
class Do {
|
|
@@ -4810,7 +4810,7 @@ class ho {
|
|
|
4810
4810
|
let g = A.args[0];
|
|
4811
4811
|
g instanceof aA && (g = g.right);
|
|
4812
4812
|
const B = this.exec.evalExpression(g, I);
|
|
4813
|
-
if (B instanceof
|
|
4813
|
+
if (B instanceof QA && B.typeInfo.size === 0) {
|
|
4814
4814
|
const Q = B.typeInfo, E = B.buffer.byteLength / Q.stride;
|
|
4815
4815
|
return new c(E, this.getTypeInfo("u32"));
|
|
4816
4816
|
}
|
|
@@ -5402,7 +5402,7 @@ class ho {
|
|
|
5402
5402
|
const B = this.exec.getVariableName(g, I), Q = I.getVariable(B);
|
|
5403
5403
|
let E = A.args[1];
|
|
5404
5404
|
const i = this.exec.evalExpression(E, I), o = Q.value.getSubData(this.exec, g.postfix, I);
|
|
5405
|
-
return o instanceof c && i instanceof c && (o.value = i.value), Q.value instanceof
|
|
5405
|
+
return o instanceof c && i instanceof c && (o.value = i.value), Q.value instanceof QA && Q.value.setDataValue(this.exec, o, g.postfix, I), null;
|
|
5406
5406
|
}
|
|
5407
5407
|
AtomicAdd(A, I) {
|
|
5408
5408
|
let g = A.args[0];
|
|
@@ -5410,7 +5410,7 @@ class ho {
|
|
|
5410
5410
|
const B = this.exec.getVariableName(g, I), Q = I.getVariable(B);
|
|
5411
5411
|
let E = A.args[1];
|
|
5412
5412
|
const i = this.exec.evalExpression(E, I), o = Q.value.getSubData(this.exec, g.postfix, I), s = new c(o.value, o.typeInfo);
|
|
5413
|
-
return o instanceof c && i instanceof c && (o.value += i.value), Q.value instanceof
|
|
5413
|
+
return o instanceof c && i instanceof c && (o.value += i.value), Q.value instanceof QA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
|
|
5414
5414
|
}
|
|
5415
5415
|
AtomicSub(A, I) {
|
|
5416
5416
|
let g = A.args[0];
|
|
@@ -5418,7 +5418,7 @@ class ho {
|
|
|
5418
5418
|
const B = this.exec.getVariableName(g, I), Q = I.getVariable(B);
|
|
5419
5419
|
let E = A.args[1];
|
|
5420
5420
|
const i = this.exec.evalExpression(E, I), o = Q.value.getSubData(this.exec, g.postfix, I), s = new c(o.value, o.typeInfo);
|
|
5421
|
-
return o instanceof c && i instanceof c && (o.value -= i.value), Q.value instanceof
|
|
5421
|
+
return o instanceof c && i instanceof c && (o.value -= i.value), Q.value instanceof QA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
|
|
5422
5422
|
}
|
|
5423
5423
|
AtomicMax(A, I) {
|
|
5424
5424
|
let g = A.args[0];
|
|
@@ -5426,7 +5426,7 @@ class ho {
|
|
|
5426
5426
|
const B = this.exec.getVariableName(g, I), Q = I.getVariable(B);
|
|
5427
5427
|
let E = A.args[1];
|
|
5428
5428
|
const i = this.exec.evalExpression(E, I), o = Q.value.getSubData(this.exec, g.postfix, I), s = new c(o.value, o.typeInfo);
|
|
5429
|
-
return o instanceof c && i instanceof c && (o.value = Math.max(o.value, i.value)), Q.value instanceof
|
|
5429
|
+
return o instanceof c && i instanceof c && (o.value = Math.max(o.value, i.value)), Q.value instanceof QA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
|
|
5430
5430
|
}
|
|
5431
5431
|
AtomicMin(A, I) {
|
|
5432
5432
|
let g = A.args[0];
|
|
@@ -5434,7 +5434,7 @@ class ho {
|
|
|
5434
5434
|
const B = this.exec.getVariableName(g, I), Q = I.getVariable(B);
|
|
5435
5435
|
let E = A.args[1];
|
|
5436
5436
|
const i = this.exec.evalExpression(E, I), o = Q.value.getSubData(this.exec, g.postfix, I), s = new c(o.value, o.typeInfo);
|
|
5437
|
-
return o instanceof c && i instanceof c && (o.value = Math.min(o.value, i.value)), Q.value instanceof
|
|
5437
|
+
return o instanceof c && i instanceof c && (o.value = Math.min(o.value, i.value)), Q.value instanceof QA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
|
|
5438
5438
|
}
|
|
5439
5439
|
AtomicAnd(A, I) {
|
|
5440
5440
|
let g = A.args[0];
|
|
@@ -5442,7 +5442,7 @@ class ho {
|
|
|
5442
5442
|
const B = this.exec.getVariableName(g, I), Q = I.getVariable(B);
|
|
5443
5443
|
let E = A.args[1];
|
|
5444
5444
|
const i = this.exec.evalExpression(E, I), o = Q.value.getSubData(this.exec, g.postfix, I), s = new c(o.value, o.typeInfo);
|
|
5445
|
-
return o instanceof c && i instanceof c && (o.value = o.value & i.value), Q.value instanceof
|
|
5445
|
+
return o instanceof c && i instanceof c && (o.value = o.value & i.value), Q.value instanceof QA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
|
|
5446
5446
|
}
|
|
5447
5447
|
AtomicOr(A, I) {
|
|
5448
5448
|
let g = A.args[0];
|
|
@@ -5450,7 +5450,7 @@ class ho {
|
|
|
5450
5450
|
const B = this.exec.getVariableName(g, I), Q = I.getVariable(B);
|
|
5451
5451
|
let E = A.args[1];
|
|
5452
5452
|
const i = this.exec.evalExpression(E, I), o = Q.value.getSubData(this.exec, g.postfix, I), s = new c(o.value, o.typeInfo);
|
|
5453
|
-
return o instanceof c && i instanceof c && (o.value = o.value | i.value), Q.value instanceof
|
|
5453
|
+
return o instanceof c && i instanceof c && (o.value = o.value | i.value), Q.value instanceof QA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
|
|
5454
5454
|
}
|
|
5455
5455
|
AtomicXor(A, I) {
|
|
5456
5456
|
let g = A.args[0];
|
|
@@ -5458,7 +5458,7 @@ class ho {
|
|
|
5458
5458
|
const B = this.exec.getVariableName(g, I), Q = I.getVariable(B);
|
|
5459
5459
|
let E = A.args[1];
|
|
5460
5460
|
const i = this.exec.evalExpression(E, I), o = Q.value.getSubData(this.exec, g.postfix, I), s = new c(o.value, o.typeInfo);
|
|
5461
|
-
return o instanceof c && i instanceof c && (o.value = o.value ^ i.value), Q.value instanceof
|
|
5461
|
+
return o instanceof c && i instanceof c && (o.value = o.value ^ i.value), Q.value instanceof QA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
|
|
5462
5462
|
}
|
|
5463
5463
|
AtomicExchange(A, I) {
|
|
5464
5464
|
let g = A.args[0];
|
|
@@ -5466,7 +5466,7 @@ class ho {
|
|
|
5466
5466
|
const B = this.exec.getVariableName(g, I), Q = I.getVariable(B);
|
|
5467
5467
|
let E = A.args[1];
|
|
5468
5468
|
const i = this.exec.evalExpression(E, I), o = Q.value.getSubData(this.exec, g.postfix, I), s = new c(o.value, o.typeInfo);
|
|
5469
|
-
return o instanceof c && i instanceof c && (o.value = i.value), Q.value instanceof
|
|
5469
|
+
return o instanceof c && i instanceof c && (o.value = i.value), Q.value instanceof QA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
|
|
5470
5470
|
}
|
|
5471
5471
|
AtomicCompareExchangeWeak(A, I) {
|
|
5472
5472
|
return console.error("TODO: atomicCompareExchangeWeak"), null;
|
|
@@ -5607,11 +5607,11 @@ class ho {
|
|
|
5607
5607
|
return console.error("TODO: quadSwapY"), null;
|
|
5608
5608
|
}
|
|
5609
5609
|
}
|
|
5610
|
-
const
|
|
5610
|
+
const Pg = { 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 }, FA = { 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] };
|
|
5611
5611
|
class BA extends Do {
|
|
5612
5612
|
constructor(A, I) {
|
|
5613
5613
|
var g;
|
|
5614
|
-
super(), this.ast = A ?? [], this.reflection = new mA(), this.reflection.updateAST(this.ast), this.context = (g = I?.clone()) !== null && g !== void 0 ? g : new
|
|
5614
|
+
super(), this.ast = A ?? [], this.reflection = new mA(), this.reflection.updateAST(this.ast), this.context = (g = I?.clone()) !== null && g !== void 0 ? g : new WB(), this.builtins = new ho(this), this.typeInfo = { bool: this.getTypeInfo(N.bool), i32: this.getTypeInfo(N.i32), u32: this.getTypeInfo(N.u32), f32: this.getTypeInfo(N.f32), f16: this.getTypeInfo(N.f16), vec2f: this.getTypeInfo(w.vec2f), vec2u: this.getTypeInfo(w.vec2u), vec2i: this.getTypeInfo(w.vec2i), vec2h: this.getTypeInfo(w.vec2h), vec3f: this.getTypeInfo(w.vec3f), vec3u: this.getTypeInfo(w.vec3u), vec3i: this.getTypeInfo(w.vec3i), vec3h: this.getTypeInfo(w.vec3h), vec4f: this.getTypeInfo(w.vec4f), vec4u: this.getTypeInfo(w.vec4u), vec4i: this.getTypeInfo(w.vec4i), vec4h: this.getTypeInfo(w.vec4h), mat2x2f: this.getTypeInfo(w.mat2x2f), mat2x3f: this.getTypeInfo(w.mat2x3f), mat2x4f: this.getTypeInfo(w.mat2x4f), mat3x2f: this.getTypeInfo(w.mat3x2f), mat3x3f: this.getTypeInfo(w.mat3x3f), mat3x4f: this.getTypeInfo(w.mat3x4f), mat4x2f: this.getTypeInfo(w.mat4x2f), mat4x3f: this.getTypeInfo(w.mat4x3f), mat4x4f: this.getTypeInfo(w.mat4x4f) };
|
|
5615
5615
|
}
|
|
5616
5616
|
getVariableValue(A) {
|
|
5617
5617
|
var I, g;
|
|
@@ -5619,7 +5619,7 @@ class BA extends Do {
|
|
|
5619
5619
|
if (B === null) return null;
|
|
5620
5620
|
if (B instanceof c) return B.value;
|
|
5621
5621
|
if (B instanceof r || B instanceof p) return Array.from(B.data);
|
|
5622
|
-
if (B instanceof
|
|
5622
|
+
if (B instanceof QA && B.typeInfo instanceof XA) {
|
|
5623
5623
|
if (B.typeInfo.format.name === "u32") return Array.from(new Uint32Array(B.buffer, B.offset, B.typeInfo.count));
|
|
5624
5624
|
if (B.typeInfo.format.name === "i32") return Array.from(new Int32Array(B.buffer, B.offset, B.typeInfo.count));
|
|
5625
5625
|
if (B.typeInfo.format.name === "f32") return Array.from(new Float32Array(B.buffer, B.offset, B.typeInfo.count));
|
|
@@ -5660,7 +5660,7 @@ class BA extends Do {
|
|
|
5660
5660
|
if (R) if (F.texture !== void 0 && F.descriptor !== void 0) {
|
|
5661
5661
|
const L = new WA(F.texture, this.getTypeInfo(U.type), F.descriptor, (S = F.texture.view) !== null && S !== void 0 ? S : null);
|
|
5662
5662
|
k.value = L;
|
|
5663
|
-
} else F.uniform !== void 0 ? k.value = new
|
|
5663
|
+
} else F.uniform !== void 0 ? k.value = new QA(F.uniform, this.getTypeInfo(U.type)) : k.value = new QA(F, this.getTypeInfo(U.type));
|
|
5664
5664
|
}
|
|
5665
5665
|
}
|
|
5666
5666
|
});
|
|
@@ -5678,18 +5678,18 @@ class BA extends Do {
|
|
|
5678
5678
|
return BA._breakObj;
|
|
5679
5679
|
}
|
|
5680
5680
|
if (A instanceof $Q) return BA._continueObj;
|
|
5681
|
-
if (A instanceof
|
|
5681
|
+
if (A instanceof pI) this._let(A, I);
|
|
5682
5682
|
else if (A instanceof qA) this._var(A, I);
|
|
5683
|
-
else if (A instanceof
|
|
5684
|
-
else if (A instanceof
|
|
5685
|
-
else if (A instanceof
|
|
5683
|
+
else if (A instanceof Cg) this._const(A, I);
|
|
5684
|
+
else if (A instanceof HB) this._override(A, I);
|
|
5685
|
+
else if (A instanceof vI) this._function(A, I);
|
|
5686
5686
|
else {
|
|
5687
5687
|
if (A instanceof _Q) return this._if(A, I);
|
|
5688
5688
|
if (A instanceof VQ) return this._switch(A, I);
|
|
5689
5689
|
if (A instanceof vQ) return this._for(A, I);
|
|
5690
5690
|
if (A instanceof WQ) return this._while(A, I);
|
|
5691
5691
|
if (A instanceof OQ) return this._loop(A, I);
|
|
5692
|
-
if (A instanceof
|
|
5692
|
+
if (A instanceof eB) {
|
|
5693
5693
|
const g = I.clone();
|
|
5694
5694
|
return g.currentFunctionName = I.currentFunctionName, this._execStatements(A.body, g);
|
|
5695
5695
|
}
|
|
@@ -5697,9 +5697,9 @@ class BA extends Do {
|
|
|
5697
5697
|
else if (A instanceof ZQ) this._increment(A, I);
|
|
5698
5698
|
else {
|
|
5699
5699
|
if (A instanceof bA) return null;
|
|
5700
|
-
if (A instanceof
|
|
5700
|
+
if (A instanceof qB) this._call(A, I);
|
|
5701
5701
|
else {
|
|
5702
|
-
if (A instanceof jQ || A instanceof
|
|
5702
|
+
if (A instanceof jQ || A instanceof pB) return null;
|
|
5703
5703
|
console.error("Invalid statement type.", A, `Line ${A.line}`);
|
|
5704
5704
|
}
|
|
5705
5705
|
}
|
|
@@ -5707,7 +5707,7 @@ class BA extends Do {
|
|
|
5707
5707
|
return null;
|
|
5708
5708
|
}
|
|
5709
5709
|
evalExpression(A, I) {
|
|
5710
|
-
return A instanceof JA ? this._evalBinaryOp(A, I) : A instanceof hA ? this._evalLiteral(A, I) : A instanceof SA ? this._evalVariable(A, I) : A instanceof
|
|
5710
|
+
return A instanceof JA ? this._evalBinaryOp(A, I) : A instanceof hA ? this._evalLiteral(A, I) : A instanceof SA ? this._evalVariable(A, I) : A instanceof mB ? this._evalCall(A, I) : A instanceof HA ? this._evalCreate(A, I) : A instanceof AE ? this._evalConst(A, I) : A instanceof IE ? this._evalBitcast(A, I) : A instanceof aA ? this._evalUnaryOp(A, I) : (console.error("Invalid expression type", A, `Line ${A.line}`), null);
|
|
5711
5711
|
}
|
|
5712
5712
|
getTypeInfo(A) {
|
|
5713
5713
|
var I;
|
|
@@ -5812,7 +5812,7 @@ class BA extends Do {
|
|
|
5812
5812
|
if (o instanceof c || o instanceof r || o instanceof p) {
|
|
5813
5813
|
if (s instanceof c || s instanceof r || s instanceof p && o.data.length === s.data.length) return void o.data.set(s.data);
|
|
5814
5814
|
console.error(`Invalid assignment. Line ${A.line}`);
|
|
5815
|
-
} else if (o instanceof
|
|
5815
|
+
} else if (o instanceof QA && s instanceof QA && o.buffer.byteLength - o.offset >= s.buffer.byteLength - s.offset) return void (o.buffer.byteLength % 4 == 0 ? new Uint32Array(o.buffer, o.offset, o.typeInfo.size / 4).set(new Uint32Array(s.buffer, s.offset, s.typeInfo.size / 4)) : new Uint8Array(o.buffer, o.offset, o.typeInfo.size).set(new Uint8Array(s.buffer, s.offset, s.typeInfo.size)));
|
|
5816
5816
|
return console.error(`Invalid assignment. Line ${A.line}`), null;
|
|
5817
5817
|
}
|
|
5818
5818
|
if (t === "+=") return o instanceof c || o instanceof r || o instanceof p ? s instanceof c || s instanceof r || s instanceof p ? void o.data.set(s.data.map((e, n) => o.data[n] + e)) : void console.error(`Invalid assignment . Line ${A.line}`) : void console.error(`Invalid assignment. Line ${A.line}`);
|
|
@@ -5878,9 +5878,9 @@ class BA extends Do {
|
|
|
5878
5878
|
if (!(o instanceof c && E instanceof c)) return void console.error(`Invalid type for ${A.operator} operator. Line ${A.line}`);
|
|
5879
5879
|
i === "+=" ? o.value += E.value : i === "-=" ? o.value -= E.value : i === "*=" ? o.value *= E.value : i === "/=" ? o.value /= E.value : i === "%=" ? o.value %= E.value : i === "&=" ? o.value &= E.value : i === "|=" ? o.value |= E.value : i === "^=" ? o.value ^= E.value : i === "<<=" ? o.value <<= E.value : i === ">>=" ? o.value >>= E.value : console.error(`Invalid operator ${i}. Line ${A.line}`);
|
|
5880
5880
|
}
|
|
5881
|
-
return void (g instanceof
|
|
5881
|
+
return void (g instanceof QA && g.setDataValue(this, o, Q, I));
|
|
5882
5882
|
}
|
|
5883
|
-
if (g instanceof
|
|
5883
|
+
if (g instanceof QA) g.setDataValue(this, E, Q, I);
|
|
5884
5884
|
else if (Q) {
|
|
5885
5885
|
if (!(g instanceof r || g instanceof p)) return void console.error(`Variable ${B} is not a vector or matrix. Line ${A.line}`);
|
|
5886
5886
|
if (Q instanceof hI) {
|
|
@@ -5967,7 +5967,7 @@ class BA extends Do {
|
|
|
5967
5967
|
} else g instanceof c && E instanceof c ? g.value = E.value : g instanceof r && E instanceof r || g instanceof p && E instanceof p ? g.data.set(E.data) : console.error(`Invalid assignment to ${B}. Line ${A.line}`);
|
|
5968
5968
|
}
|
|
5969
5969
|
_function(A, I) {
|
|
5970
|
-
const g = new
|
|
5970
|
+
const g = new bB(A);
|
|
5971
5971
|
I.functions.set(A.name, g);
|
|
5972
5972
|
}
|
|
5973
5973
|
_const(A, I) {
|
|
@@ -6003,7 +6003,7 @@ class BA extends Do {
|
|
|
6003
6003
|
} else {
|
|
6004
6004
|
if (A.type === null) return void console.error(`Variable ${A.name} has no type. Line ${A.line}`);
|
|
6005
6005
|
const B = A.type.name;
|
|
6006
|
-
if (BA._defaultableTypes.has(B) || A.type instanceof
|
|
6006
|
+
if (BA._defaultableTypes.has(B) || A.type instanceof mI || A.type instanceof bA || A.type instanceof w) {
|
|
6007
6007
|
const Q = new HA(A.type, []);
|
|
6008
6008
|
g = this._evalCreate(Q, I);
|
|
6009
6009
|
}
|
|
@@ -6016,7 +6016,7 @@ class BA extends Do {
|
|
|
6016
6016
|
if (!(g instanceof c)) return console.error(`Invalid if condition. Line ${A.line}`), null;
|
|
6017
6017
|
let B = null;
|
|
6018
6018
|
for (const Q of A.cases) if (Q instanceof CE) for (const E of Q.selectors) {
|
|
6019
|
-
if (E instanceof
|
|
6019
|
+
if (E instanceof Eg) {
|
|
6020
6020
|
B = Q;
|
|
6021
6021
|
continue;
|
|
6022
6022
|
}
|
|
@@ -6113,7 +6113,7 @@ class BA extends Do {
|
|
|
6113
6113
|
_evalCreate(A, I) {
|
|
6114
6114
|
var g;
|
|
6115
6115
|
if (A instanceof HA) {
|
|
6116
|
-
if (A.type === null) return
|
|
6116
|
+
if (A.type === null) return aB.void;
|
|
6117
6117
|
switch (A.type.getTypeName()) {
|
|
6118
6118
|
case "bool":
|
|
6119
6119
|
case "i32":
|
|
@@ -6173,7 +6173,7 @@ class BA extends Do {
|
|
|
6173
6173
|
const B = A instanceof HA ? A.type.name : A.name, Q = A instanceof HA ? this.getTypeInfo(A.type) : this.getTypeInfo(A.name);
|
|
6174
6174
|
if (Q === null) return console.error(`Unknown type ${B}. Line ${A.line}`), null;
|
|
6175
6175
|
if (Q.size === 0) return null;
|
|
6176
|
-
const E = new
|
|
6176
|
+
const E = new QA(new ArrayBuffer(Q.size), Q, 0);
|
|
6177
6177
|
if (Q instanceof OA) {
|
|
6178
6178
|
if (A.args) for (let i = 0; i < A.args.length; ++i) {
|
|
6179
6179
|
const o = Q.members[i], s = A.args[i], t = this.evalExpression(s, I);
|
|
@@ -6253,7 +6253,7 @@ class BA extends Do {
|
|
|
6253
6253
|
return A.typeInfo.getTypeName().startsWith("vec");
|
|
6254
6254
|
}
|
|
6255
6255
|
_evalBinaryOp(A, I) {
|
|
6256
|
-
const g = this.evalExpression(A.left, I), B = this.evalExpression(A.right, I), Q = g instanceof c ? g.value : g instanceof r || g instanceof p ? Array.from(g.data) : g instanceof
|
|
6256
|
+
const g = this.evalExpression(A.left, I), B = this.evalExpression(A.right, I), Q = g instanceof c ? g.value : g instanceof r || g instanceof p ? Array.from(g.data) : g instanceof QA ? g.toArray() : null, E = B instanceof c ? B.value : B instanceof r || B instanceof p ? Array.from(B.data) : B instanceof QA ? B.toArray() : null;
|
|
6257
6257
|
switch (A.operator) {
|
|
6258
6258
|
case "+": {
|
|
6259
6259
|
if (J(Q) && J(E)) {
|
|
@@ -6300,10 +6300,10 @@ class BA extends Do {
|
|
|
6300
6300
|
const R = FA[U.name][0], L = FA[U.name][1], M = FA[d.name][0];
|
|
6301
6301
|
if (R !== FA[d.name][1]) return null;
|
|
6302
6302
|
const v = new Array(M * L);
|
|
6303
|
-
for (let AA = 0; AA < L; AA++) for (let
|
|
6303
|
+
for (let AA = 0; AA < L; AA++) for (let iA = 0; iA < M; iA++) {
|
|
6304
6304
|
let gA = 0;
|
|
6305
|
-
for (let
|
|
6306
|
-
v[AA * M +
|
|
6305
|
+
for (let oA = 0; oA < R; oA++) gA += S[oA * L + AA] * f[iA * R + oA];
|
|
6306
|
+
v[AA * M + iA] = gA;
|
|
6307
6307
|
}
|
|
6308
6308
|
return v;
|
|
6309
6309
|
})(t, g.typeInfo, e, B.typeInfo);
|
|
@@ -6313,7 +6313,7 @@ class BA extends Do {
|
|
|
6313
6313
|
}
|
|
6314
6314
|
if (this._isMatrixType(g) && this._isVectorType(B)) {
|
|
6315
6315
|
const n = (function(D, F, k, S) {
|
|
6316
|
-
if (FA[F.name] === void 0 ||
|
|
6316
|
+
if (FA[F.name] === void 0 || Pg[S.name] === void 0) return null;
|
|
6317
6317
|
const U = FA[F.name][0], f = FA[F.name][1];
|
|
6318
6318
|
if (U !== k.length) return null;
|
|
6319
6319
|
const d = new Array(f);
|
|
@@ -6328,7 +6328,7 @@ class BA extends Do {
|
|
|
6328
6328
|
}
|
|
6329
6329
|
if (this._isVectorType(g) && this._isMatrixType(B)) {
|
|
6330
6330
|
const n = (function(D, F, k, S) {
|
|
6331
|
-
if (
|
|
6331
|
+
if (Pg[F.name] === void 0 || FA[S.name] === void 0) return null;
|
|
6332
6332
|
const U = FA[S.name][0], f = FA[S.name][1];
|
|
6333
6333
|
if (f !== D.length) return null;
|
|
6334
6334
|
const d = [];
|
|
@@ -6938,7 +6938,7 @@ class BA extends Do {
|
|
|
6938
6938
|
return g.typeInfo = this.getTypeInfo(A.type), g.getSubData(this, A.postfix, I).clone();
|
|
6939
6939
|
}
|
|
6940
6940
|
_callConstructorVec(A, I) {
|
|
6941
|
-
const g = this.getTypeInfo(A.type), B = A.type.getTypeName(), Q =
|
|
6941
|
+
const g = this.getTypeInfo(A.type), B = A.type.getTypeName(), Q = Pg[B];
|
|
6942
6942
|
if (Q === void 0) return console.error(`Invalid vec constructor ${B}. Line ${A.line}`), null;
|
|
6943
6943
|
const E = [];
|
|
6944
6944
|
if (A instanceof hA) if (A.isVector) {
|
|
@@ -7017,7 +7017,7 @@ class co {
|
|
|
7017
7017
|
this._deferArrayCountEval.length = 0;
|
|
7018
7018
|
}
|
|
7019
7019
|
if (this._forwardTypeCount > 0) for (const g of I) g.search((B) => {
|
|
7020
|
-
B instanceof LC || B instanceof
|
|
7020
|
+
B instanceof LC || B instanceof Qg ? B.type = this._forwardType(B.type) : B instanceof mI ? B.format = this._forwardType(B.format) : B instanceof qA || B instanceof pI || B instanceof Cg ? B.type = this._forwardType(B.type) : B instanceof vI ? B.returnType = this._forwardType(B.returnType) : B instanceof lC && (B.type = this._forwardType(B.type));
|
|
7021
7021
|
});
|
|
7022
7022
|
return I;
|
|
7023
7023
|
}
|
|
@@ -7025,12 +7025,12 @@ class co {
|
|
|
7025
7025
|
if (A instanceof UC) {
|
|
7026
7026
|
const I = this._getType(A.name);
|
|
7027
7027
|
if (I) return I;
|
|
7028
|
-
} else A instanceof
|
|
7028
|
+
} else A instanceof Qg ? A.type = this._forwardType(A.type) : A instanceof mI && (A.format = this._forwardType(A.format));
|
|
7029
7029
|
return A;
|
|
7030
7030
|
}
|
|
7031
7031
|
_initialize(A) {
|
|
7032
7032
|
if (A) if (typeof A == "string") {
|
|
7033
|
-
const I = new
|
|
7033
|
+
const I = new fg(A);
|
|
7034
7034
|
this._tokens = I.scanTokens();
|
|
7035
7035
|
} else this._tokens = A;
|
|
7036
7036
|
else this._tokens = [];
|
|
@@ -7158,7 +7158,7 @@ class co {
|
|
|
7158
7158
|
B = this._type_decl(), B != null && (B.attributes = i);
|
|
7159
7159
|
}
|
|
7160
7160
|
const Q = this._compound_statement(), E = this._currentLine;
|
|
7161
|
-
return this._updateNode(new
|
|
7161
|
+
return this._updateNode(new vI(I, g, B, Q, A, E), A);
|
|
7162
7162
|
}
|
|
7163
7163
|
_compound_statement() {
|
|
7164
7164
|
const A = [];
|
|
@@ -7218,7 +7218,7 @@ class co {
|
|
|
7218
7218
|
const A = this._currentLoop.length > 0 ? this._currentLoop[this._currentLoop.length - 1].id : -1;
|
|
7219
7219
|
if (!this._match(a.keywords.continuing)) return null;
|
|
7220
7220
|
const I = this._currentLine, g = this._compound_statement();
|
|
7221
|
-
return this._updateNode(new
|
|
7221
|
+
return this._updateNode(new eB(g, A), I);
|
|
7222
7222
|
}
|
|
7223
7223
|
_for_statement() {
|
|
7224
7224
|
if (!this._match(a.keywords.for)) return null;
|
|
@@ -7248,7 +7248,7 @@ class co {
|
|
|
7248
7248
|
}
|
|
7249
7249
|
this._consume(a.tokens.equal, "Expected '=' for let.");
|
|
7250
7250
|
const B = this._short_circuit_or_expression();
|
|
7251
|
-
return this._updateNode(new
|
|
7251
|
+
return this._updateNode(new pI(I, g, null, null, B), A);
|
|
7252
7252
|
}
|
|
7253
7253
|
if (this._match(a.keywords.const)) {
|
|
7254
7254
|
const A = this._currentLine, I = this._consume(a.tokens.name, "Expected name for const.").toString();
|
|
@@ -7259,7 +7259,7 @@ class co {
|
|
|
7259
7259
|
}
|
|
7260
7260
|
this._consume(a.tokens.equal, "Expected '=' for const.");
|
|
7261
7261
|
const B = this._short_circuit_or_expression();
|
|
7262
|
-
return g === null && B instanceof hA && (g = B.type), this._updateNode(new
|
|
7262
|
+
return g === null && B instanceof hA && (g = B.type), this._updateNode(new Cg(I, g, null, null, B), A);
|
|
7263
7263
|
}
|
|
7264
7264
|
return null;
|
|
7265
7265
|
}
|
|
@@ -7277,12 +7277,12 @@ class co {
|
|
|
7277
7277
|
let g = this._match(a.tokens.underscore);
|
|
7278
7278
|
if (g || (A = this._unary_expression()), !g && A === null) return null;
|
|
7279
7279
|
const B = this._consume(a.assignment_operators, "Expected assignment operator."), Q = this._short_circuit_or_expression();
|
|
7280
|
-
return this._updateNode(new PQ(
|
|
7280
|
+
return this._updateNode(new PQ(uI.parse(B.lexeme), A, Q), I);
|
|
7281
7281
|
}
|
|
7282
7282
|
_func_call_statement() {
|
|
7283
7283
|
if (!this._check(a.tokens.ident)) return null;
|
|
7284
7284
|
const A = this._currentLine, I = this._current, g = this._consume(a.tokens.ident, "Expected function name."), B = this._argument_expression_list();
|
|
7285
|
-
return B === null ? (this._current = I, null) : this._updateNode(new
|
|
7285
|
+
return B === null ? (this._current = I, null) : this._updateNode(new qB(g.lexeme, B), A);
|
|
7286
7286
|
}
|
|
7287
7287
|
_loop_statement() {
|
|
7288
7288
|
if (!this._match(a.keywords.loop)) return null;
|
|
@@ -7293,7 +7293,7 @@ class co {
|
|
|
7293
7293
|
for (; I !== null; ) {
|
|
7294
7294
|
if (Array.isArray(I)) for (let g of I) A.body.push(g);
|
|
7295
7295
|
else A.body.push(I);
|
|
7296
|
-
if (I instanceof
|
|
7296
|
+
if (I instanceof eB) {
|
|
7297
7297
|
A.continuing = I;
|
|
7298
7298
|
break;
|
|
7299
7299
|
}
|
|
@@ -7313,7 +7313,7 @@ class co {
|
|
|
7313
7313
|
for (; this._check([a.keywords.default, a.keywords.case]); ) {
|
|
7314
7314
|
if (this._match(a.keywords.case)) {
|
|
7315
7315
|
const g = this._case_selectors();
|
|
7316
|
-
for (const Q of g) if (Q instanceof
|
|
7316
|
+
for (const Q of g) if (Q instanceof Eg) {
|
|
7317
7317
|
if (I) throw this._error(this._previous(), "Multiple default cases in switch statement.");
|
|
7318
7318
|
I = !0;
|
|
7319
7319
|
break;
|
|
@@ -7333,7 +7333,7 @@ class co {
|
|
|
7333
7333
|
}
|
|
7334
7334
|
_case_selectors() {
|
|
7335
7335
|
const A = [];
|
|
7336
|
-
for (this._match(a.keywords.default) ? A.push(this._updateNode(new
|
|
7336
|
+
for (this._match(a.keywords.default) ? A.push(this._updateNode(new Eg())) : A.push(this._shift_expression()); this._match(a.tokens.comma); ) this._match(a.keywords.default) ? A.push(this._updateNode(new Eg())) : A.push(this._shift_expression());
|
|
7337
7337
|
return A;
|
|
7338
7338
|
}
|
|
7339
7339
|
_case_body() {
|
|
@@ -7572,7 +7572,7 @@ class co {
|
|
|
7572
7572
|
const g = this._previous().toString();
|
|
7573
7573
|
if (this._check(a.tokens.paren_left)) {
|
|
7574
7574
|
const B = this._argument_expression_list(), Q = this._getType(g);
|
|
7575
|
-
return Q !== null ? this._updateNode(new HA(Q, B)) : this._updateNode(new
|
|
7575
|
+
return Q !== null ? this._updateNode(new HA(Q, B)) : this._updateNode(new mB(g, B));
|
|
7576
7576
|
}
|
|
7577
7577
|
if (this._context.constants.has(g)) {
|
|
7578
7578
|
const B = this._context.constants.get(g);
|
|
@@ -7689,7 +7689,7 @@ class co {
|
|
|
7689
7689
|
throw this._error(this._peek(), `Invalid cast from ${Q.type.name} to ${B.name}`);
|
|
7690
7690
|
Q.type = B, Q.isScalar && this._validateTypeRange(Q.scalarValue, Q.type);
|
|
7691
7691
|
} else B === null && Q instanceof hA && (B = (A = Q?.type) !== null && A !== void 0 ? A : N.f32, B === N.x32 && (B = N.i32));
|
|
7692
|
-
const i = this._updateNode(new
|
|
7692
|
+
const i = this._updateNode(new Cg(I.toString(), B, "", "", Q), g);
|
|
7693
7693
|
return this._context.constants.set(i.name, i), i;
|
|
7694
7694
|
}
|
|
7695
7695
|
_global_let_decl() {
|
|
@@ -7706,7 +7706,7 @@ class co {
|
|
|
7706
7706
|
throw this._error(this._peek(), `Invalid cast from ${B.type.name} to ${g.name}`);
|
|
7707
7707
|
B.type = g;
|
|
7708
7708
|
} else g === null && B instanceof hA && (g = B.type.name === "x32" ? N.i32 : B.type);
|
|
7709
|
-
return B instanceof hA && B.isScalar && this._validateTypeRange(B.scalarValue, g), this._updateNode(new
|
|
7709
|
+
return B instanceof hA && B.isScalar && this._validateTypeRange(B.scalarValue, g), this._updateNode(new pI(I.toString(), g, "", "", B), A);
|
|
7710
7710
|
}
|
|
7711
7711
|
_const_expression() {
|
|
7712
7712
|
return this._short_circuit_or_expression();
|
|
@@ -7732,7 +7732,7 @@ class co {
|
|
|
7732
7732
|
const g = this._attribute();
|
|
7733
7733
|
I = this._type_decl(), I != null && (I.attributes = g);
|
|
7734
7734
|
}
|
|
7735
|
-
return this._updateNode(new
|
|
7735
|
+
return this._updateNode(new HB(A.toString(), I, null));
|
|
7736
7736
|
}
|
|
7737
7737
|
_diagnostic() {
|
|
7738
7738
|
this._consume(a.tokens.paren_left, "Expected '('");
|
|
@@ -7759,7 +7759,7 @@ class co {
|
|
|
7759
7759
|
let I = this._type_decl();
|
|
7760
7760
|
if (I === null) throw this._error(this._peek(), "Expected Type for Alias.");
|
|
7761
7761
|
this._context.aliases.has(I.name) && (I = this._context.aliases.get(I.name).type);
|
|
7762
|
-
const g = this._updateNode(new
|
|
7762
|
+
const g = this._updateNode(new pB(A.toString(), I));
|
|
7763
7763
|
return this._context.aliases.set(g.name, g), g;
|
|
7764
7764
|
}
|
|
7765
7765
|
_type_decl() {
|
|
@@ -7787,7 +7787,7 @@ class co {
|
|
|
7787
7787
|
this._consume(a.tokens.comma, "Expected ',' for pointer.");
|
|
7788
7788
|
const o = this._type_decl();
|
|
7789
7789
|
let s = null;
|
|
7790
|
-
return this._match(a.tokens.comma) && (s = this._consume(a.access_mode, "Expected access_mode for pointer").toString()), this._consume(a.tokens.greater_than, "Expected '>' for pointer."), this._updateNode(new
|
|
7790
|
+
return this._match(a.tokens.comma) && (s = this._consume(a.access_mode, "Expected access_mode for pointer").toString()), this._consume(a.tokens.greater_than, "Expected '>' for pointer."), this._updateNode(new Qg(E, i.toString(), o, s));
|
|
7791
7791
|
}
|
|
7792
7792
|
const Q = this._attribute();
|
|
7793
7793
|
if (this._match(a.keywords.array)) {
|
|
@@ -7807,19 +7807,19 @@ class co {
|
|
|
7807
7807
|
}
|
|
7808
7808
|
this._consume(a.tokens.greater_than, "Expected '>' for array."), i = e ? parseInt(e) : 0;
|
|
7809
7809
|
}
|
|
7810
|
-
const t = this._updateNode(new
|
|
7810
|
+
const t = this._updateNode(new mI(o.toString(), Q, E, i));
|
|
7811
7811
|
return s && this._deferArrayCountEval.push({ arrayType: t, countNode: s }), t;
|
|
7812
7812
|
}
|
|
7813
7813
|
return null;
|
|
7814
7814
|
}
|
|
7815
7815
|
_texture_sampler_types() {
|
|
7816
|
-
if (this._match(a.sampler_type)) return this._updateNode(new
|
|
7817
|
-
if (this._match(a.depth_texture_type)) return this._updateNode(new
|
|
7816
|
+
if (this._match(a.sampler_type)) return this._updateNode(new fI(this._previous().toString(), null, null));
|
|
7817
|
+
if (this._match(a.depth_texture_type)) return this._updateNode(new fI(this._previous().toString(), null, null));
|
|
7818
7818
|
if (this._match(a.sampled_texture_type) || this._match(a.multisampled_texture_type)) {
|
|
7819
7819
|
const A = this._previous();
|
|
7820
7820
|
this._consume(a.tokens.less_than, "Expected '<' for sampler type.");
|
|
7821
7821
|
const I = this._type_decl();
|
|
7822
|
-
return this._consume(a.tokens.greater_than, "Expected '>' for sampler type."), this._updateNode(new
|
|
7822
|
+
return this._consume(a.tokens.greater_than, "Expected '>' for sampler type."), this._updateNode(new fI(A.toString(), I, null));
|
|
7823
7823
|
}
|
|
7824
7824
|
if (this._match(a.storage_texture_type)) {
|
|
7825
7825
|
const A = this._previous();
|
|
@@ -7827,7 +7827,7 @@ class co {
|
|
|
7827
7827
|
const I = this._consume(a.texel_format, "Invalid texel format.").toString();
|
|
7828
7828
|
this._consume(a.tokens.comma, "Expected ',' after texel format.");
|
|
7829
7829
|
const g = this._consume(a.access_mode, "Expected access mode for storage texture type.").toString();
|
|
7830
|
-
return this._consume(a.tokens.greater_than, "Expected '>' for sampler type."), this._updateNode(new
|
|
7830
|
+
return this._consume(a.tokens.greater_than, "Expected '>' for sampler type."), this._updateNode(new fI(A.toString(), I, g));
|
|
7831
7831
|
}
|
|
7832
7832
|
return null;
|
|
7833
7833
|
}
|
|
@@ -7867,16 +7867,16 @@ function Go(C, A, I) {
|
|
|
7867
7867
|
}
|
|
7868
7868
|
return Object.values(C.entryPoints).filter((B) => B.stage === I)[0];
|
|
7869
7869
|
}
|
|
7870
|
-
function
|
|
7870
|
+
function Og(C, A, I) {
|
|
7871
7871
|
return A ? Go(C, A, I)?.resources || [] : [];
|
|
7872
7872
|
}
|
|
7873
7873
|
const Fo = (C, A) => Math.sign(C.binding - A.binding);
|
|
7874
7874
|
function So(C, A) {
|
|
7875
7875
|
C = Array.isArray(C) ? C : [C];
|
|
7876
7876
|
const I = [
|
|
7877
|
-
...
|
|
7878
|
-
...
|
|
7879
|
-
...
|
|
7877
|
+
...Og(C[0], A.vertex, GPUShaderStage.VERTEX),
|
|
7878
|
+
...Og(C[C.length - 1], A.fragment, GPUShaderStage.FRAGMENT),
|
|
7879
|
+
...Og(C[0], A.compute, GPUShaderStage.COMPUTE)
|
|
7880
7880
|
], g = [];
|
|
7881
7881
|
for (const Q of I) {
|
|
7882
7882
|
const E = g[Q.group] || /* @__PURE__ */ new Map();
|
|
@@ -7909,7 +7909,7 @@ function iE(C, A, I) {
|
|
|
7909
7909
|
B.name,
|
|
7910
7910
|
{
|
|
7911
7911
|
offset: B.offset,
|
|
7912
|
-
type:
|
|
7912
|
+
type: vB(C, B.type, 0)
|
|
7913
7913
|
}
|
|
7914
7914
|
])),
|
|
7915
7915
|
size: A.size,
|
|
@@ -7951,7 +7951,7 @@ function ko(C) {
|
|
|
7951
7951
|
function Uo(C, A) {
|
|
7952
7952
|
const { binding: I, access: g, type: B } = C;
|
|
7953
7953
|
switch (C.resourceType) {
|
|
7954
|
-
case
|
|
7954
|
+
case tA.Uniform:
|
|
7955
7955
|
return {
|
|
7956
7956
|
binding: I,
|
|
7957
7957
|
visibility: A,
|
|
@@ -7959,7 +7959,7 @@ function Uo(C, A) {
|
|
|
7959
7959
|
...C.size && { minBindingSize: C.size }
|
|
7960
7960
|
}
|
|
7961
7961
|
};
|
|
7962
|
-
case
|
|
7962
|
+
case tA.Storage:
|
|
7963
7963
|
return {
|
|
7964
7964
|
binding: I,
|
|
7965
7965
|
visibility: A,
|
|
@@ -7968,7 +7968,7 @@ function Uo(C, A) {
|
|
|
7968
7968
|
...C.size && { minBindingSize: C.size }
|
|
7969
7969
|
}
|
|
7970
7970
|
};
|
|
7971
|
-
case
|
|
7971
|
+
case tA.Texture: {
|
|
7972
7972
|
if (B.name === "texture_external")
|
|
7973
7973
|
return {
|
|
7974
7974
|
binding: I,
|
|
@@ -7986,7 +7986,7 @@ function Uo(C, A) {
|
|
|
7986
7986
|
}
|
|
7987
7987
|
};
|
|
7988
7988
|
}
|
|
7989
|
-
case
|
|
7989
|
+
case tA.Sampler:
|
|
7990
7990
|
return {
|
|
7991
7991
|
binding: I,
|
|
7992
7992
|
visibility: A,
|
|
@@ -7994,7 +7994,7 @@ function Uo(C, A) {
|
|
|
7994
7994
|
type: ko(B)
|
|
7995
7995
|
}
|
|
7996
7996
|
};
|
|
7997
|
-
case
|
|
7997
|
+
case tA.StorageTexture:
|
|
7998
7998
|
return {
|
|
7999
7999
|
binding: I,
|
|
8000
8000
|
visibility: A,
|
|
@@ -8008,7 +8008,7 @@ function Uo(C, A) {
|
|
|
8008
8008
|
throw new Error("unknown resource type");
|
|
8009
8009
|
}
|
|
8010
8010
|
}
|
|
8011
|
-
function
|
|
8011
|
+
function Vg(C, A) {
|
|
8012
8012
|
const I = {};
|
|
8013
8013
|
for (const g of C)
|
|
8014
8014
|
I[g.name] = {
|
|
@@ -8025,10 +8025,10 @@ function Pg(C, A) {
|
|
|
8025
8025
|
return I;
|
|
8026
8026
|
}
|
|
8027
8027
|
function lo(C) {
|
|
8028
|
-
const A = new wo(C), I = Object.fromEntries(A.structs.map((e) => [e.name, iE(A, e, 0)])), g = AI(A, A.uniforms), B = AI(A, A.immediates), Q = AI(A, A.storage.filter((e) => e.resourceType ===
|
|
8029
|
-
...
|
|
8030
|
-
...
|
|
8031
|
-
...
|
|
8028
|
+
const A = new wo(C), I = Object.fromEntries(A.structs.map((e) => [e.name, iE(A, e, 0)])), g = AI(A, A.uniforms), B = AI(A, A.immediates), Q = AI(A, A.storage.filter((e) => e.resourceType === tA.Storage)), E = AI(A, A.storage.filter((e) => e.resourceType === tA.StorageTexture)), i = AI(A, A.textures.filter((e) => e.type.name !== "texture_external")), o = AI(A, A.textures.filter((e) => e.type.name === "texture_external")), s = AI(A, A.samplers), t = {
|
|
8029
|
+
...Vg(A.entry.vertex, GPUShaderStage.VERTEX),
|
|
8030
|
+
...Vg(A.entry.fragment, GPUShaderStage.FRAGMENT),
|
|
8031
|
+
...Vg(A.entry.compute, GPUShaderStage.COMPUTE)
|
|
8032
8032
|
};
|
|
8033
8033
|
return {
|
|
8034
8034
|
externalTextures: o,
|
|
@@ -8042,17 +8042,17 @@ function lo(C) {
|
|
|
8042
8042
|
entryPoints: t
|
|
8043
8043
|
};
|
|
8044
8044
|
}
|
|
8045
|
-
function
|
|
8045
|
+
function _g(C, A = "") {
|
|
8046
8046
|
if (!C)
|
|
8047
8047
|
throw new Error(A);
|
|
8048
8048
|
}
|
|
8049
8049
|
function Lo(C, A, I) {
|
|
8050
8050
|
switch (A.resourceType) {
|
|
8051
|
-
case
|
|
8052
|
-
case
|
|
8053
|
-
case
|
|
8054
|
-
case
|
|
8055
|
-
return
|
|
8051
|
+
case tA.Immediate:
|
|
8052
|
+
case tA.Uniform:
|
|
8053
|
+
case tA.Storage:
|
|
8054
|
+
case tA.StorageTexture:
|
|
8055
|
+
return vB(C, A.type, I);
|
|
8056
8056
|
default:
|
|
8057
8057
|
return {
|
|
8058
8058
|
size: 0,
|
|
@@ -8060,18 +8060,18 @@ function Lo(C, A, I) {
|
|
|
8060
8060
|
};
|
|
8061
8061
|
}
|
|
8062
8062
|
}
|
|
8063
|
-
function
|
|
8063
|
+
function vB(C, A, I) {
|
|
8064
8064
|
if (A.isArray) {
|
|
8065
|
-
|
|
8065
|
+
_g(!A.isStruct, "struct array is invalid"), _g(!A.isStruct, "template array is invalid");
|
|
8066
8066
|
const g = A;
|
|
8067
8067
|
return {
|
|
8068
8068
|
size: g.size,
|
|
8069
|
-
elementType:
|
|
8069
|
+
elementType: vB(C, g.format, I),
|
|
8070
8070
|
numElements: g.count
|
|
8071
8071
|
};
|
|
8072
8072
|
} else {
|
|
8073
8073
|
if (A.isStruct)
|
|
8074
|
-
return
|
|
8074
|
+
return _g(!A.isTemplate, "template struct is invalid"), iE(C, A, I);
|
|
8075
8075
|
{
|
|
8076
8076
|
const g = A, B = A.isTemplate ? `${g.name}<${g.format.name}>` : A.name;
|
|
8077
8077
|
return {
|
|
@@ -8675,7 +8675,7 @@ function vo(C) {
|
|
|
8675
8675
|
return "image_scalar_u32";
|
|
8676
8676
|
}
|
|
8677
8677
|
}
|
|
8678
|
-
function
|
|
8678
|
+
function KI(C, A) {
|
|
8679
8679
|
const I = C.priority ?? Number.MAX_SAFE_INTEGER, g = A.priority ?? Number.MAX_SAFE_INTEGER;
|
|
8680
8680
|
return I === g ? (C.orderKey ?? Number.MAX_SAFE_INTEGER) - (A.orderKey ?? Number.MAX_SAFE_INTEGER) : I - g;
|
|
8681
8681
|
}
|
|
@@ -8709,7 +8709,7 @@ class Zo {
|
|
|
8709
8709
|
}
|
|
8710
8710
|
pump() {
|
|
8711
8711
|
if (!(this.running_.size >= this.maxConcurrent_ || this.pending_.length === 0))
|
|
8712
|
-
for (this.pending_.sort((A, I) =>
|
|
8712
|
+
for (this.pending_.sort((A, I) => KI(A.chunk, I.chunk)); this.running_.size < this.maxConcurrent_ && this.pending_.length > 0; )
|
|
8713
8713
|
this.start(this.pending_.shift());
|
|
8714
8714
|
}
|
|
8715
8715
|
start(A) {
|
|
@@ -8728,25 +8728,25 @@ class Zo {
|
|
|
8728
8728
|
this.running_.set(I, { controller: B, promise: Q });
|
|
8729
8729
|
}
|
|
8730
8730
|
}
|
|
8731
|
-
let
|
|
8731
|
+
let yg = 0, cg = 0;
|
|
8732
8732
|
function Po(C, A) {
|
|
8733
|
-
C.data && (
|
|
8733
|
+
C.data && (yg -= C.data.byteLength, cg -= 1), C.data = A, yg += A.byteLength, cg += 1;
|
|
8734
8734
|
}
|
|
8735
8735
|
function fC(C) {
|
|
8736
|
-
C.data && (
|
|
8736
|
+
C.data && (yg -= C.data.byteLength, cg -= 1), C.data = void 0, C.texture?.releaseCpuData();
|
|
8737
8737
|
}
|
|
8738
8738
|
function Oo() {
|
|
8739
|
-
return { cpuChunkBytes:
|
|
8739
|
+
return { cpuChunkBytes: yg, cpuChunkCount: cg };
|
|
8740
8740
|
}
|
|
8741
8741
|
function KC(C, A, I = 1e-6) {
|
|
8742
8742
|
return Math.abs(C - A) <= I;
|
|
8743
8743
|
}
|
|
8744
|
-
const
|
|
8744
|
+
const CA = {
|
|
8745
8745
|
x: 0,
|
|
8746
8746
|
y: 1,
|
|
8747
8747
|
z: 2
|
|
8748
8748
|
};
|
|
8749
|
-
function
|
|
8749
|
+
function yI(C) {
|
|
8750
8750
|
switch (C) {
|
|
8751
8751
|
case "XY":
|
|
8752
8752
|
return { u: "x", v: "y", w: "z" };
|
|
@@ -8756,10 +8756,10 @@ function WB(C) {
|
|
|
8756
8756
|
return { u: "y", v: "z", w: "x" };
|
|
8757
8757
|
}
|
|
8758
8758
|
}
|
|
8759
|
-
function
|
|
8759
|
+
function cI(C) {
|
|
8760
8760
|
const A = T(), I = T();
|
|
8761
|
-
A[
|
|
8762
|
-
const g =
|
|
8761
|
+
A[CA[C.u]] = 1, I[CA[C.v]] = 1;
|
|
8762
|
+
const g = Bg(T(), A, I), B = zE(
|
|
8763
8763
|
A[0],
|
|
8764
8764
|
A[1],
|
|
8765
8765
|
A[2],
|
|
@@ -8769,8 +8769,8 @@ function vB(C) {
|
|
|
8769
8769
|
g[0],
|
|
8770
8770
|
g[1],
|
|
8771
8771
|
g[2]
|
|
8772
|
-
), Q =
|
|
8773
|
-
return
|
|
8772
|
+
), Q = YB(eg(), B);
|
|
8773
|
+
return ug(Q, Q);
|
|
8774
8774
|
}
|
|
8775
8775
|
const HC = [
|
|
8776
8776
|
Int8Array,
|
|
@@ -8796,7 +8796,7 @@ function _o(C, A) {
|
|
|
8796
8796
|
function oE(C, A) {
|
|
8797
8797
|
const I = T(), g = T();
|
|
8798
8798
|
for (const Q of ["x", "y", "z"]) {
|
|
8799
|
-
const E = Q === A.w ? 0.5 * C.scale[Q] : 0, i =
|
|
8799
|
+
const E = Q === A.w ? 0.5 * C.scale[Q] : 0, i = CA[Q];
|
|
8800
8800
|
I[i] = 1 / (C.scale[Q] * C.shape[Q]), g[i] = E - C.offset[Q];
|
|
8801
8801
|
}
|
|
8802
8802
|
const B = YQ(GA(), I);
|
|
@@ -8805,7 +8805,7 @@ function oE(C, A) {
|
|
|
8805
8805
|
function vA(C, A, I) {
|
|
8806
8806
|
return Math.max(A, Math.min(I, C));
|
|
8807
8807
|
}
|
|
8808
|
-
const
|
|
8808
|
+
const Kg = Symbol("INTERNAL_POLICY_KEY");
|
|
8809
8809
|
class Xo {
|
|
8810
8810
|
store_;
|
|
8811
8811
|
policy_;
|
|
@@ -8873,13 +8873,13 @@ class Xo {
|
|
|
8873
8873
|
H.warn(
|
|
8874
8874
|
"ChunkStoreView",
|
|
8875
8875
|
"updateChunkViewStates called with no chunks initialized"
|
|
8876
|
-
), this.chunkViewStates_.forEach(
|
|
8876
|
+
), this.chunkViewStates_.forEach(MI);
|
|
8877
8877
|
return;
|
|
8878
8878
|
}
|
|
8879
8879
|
const e = fQ();
|
|
8880
8880
|
Fi(e, g.min, g.max, 0.5);
|
|
8881
8881
|
const n = this.makeViewBounds3D(g, o);
|
|
8882
|
-
this.chunkViewStates_.forEach(
|
|
8882
|
+
this.chunkViewStates_.forEach(MI);
|
|
8883
8883
|
const D = this.channelsOfInterest(A), F = this.fallbackLOD(), k = this.getPaddedBounds(n), S = this.currentLOD_ === F ? [this.currentLOD_] : [this.currentLOD_, F];
|
|
8884
8884
|
for (const U of S) {
|
|
8885
8885
|
const f = U === this.currentLOD_, d = U === F;
|
|
@@ -8919,10 +8919,10 @@ class Xo {
|
|
|
8919
8919
|
H.warn(
|
|
8920
8920
|
"ChunkStoreView",
|
|
8921
8921
|
"updateChunksForVolume called with no chunks initialized"
|
|
8922
|
-
), this.chunkViewStates_.forEach(
|
|
8922
|
+
), this.chunkViewStates_.forEach(MI);
|
|
8923
8923
|
return;
|
|
8924
8924
|
}
|
|
8925
|
-
this.currentLOD_ = this.policy_.lod.min, this.chunkViewStates_.forEach(
|
|
8925
|
+
this.currentLOD_ = this.policy_.lod.min, this.chunkViewStates_.forEach(MI);
|
|
8926
8926
|
const Q = this.channelsOfInterest(A), E = this.fallbackLOD(), i = (o) => {
|
|
8927
8927
|
const s = o.lod === E, t = o.lod === this.currentLOD_, e = this.computePriority(
|
|
8928
8928
|
s,
|
|
@@ -8966,10 +8966,10 @@ class Xo {
|
|
|
8966
8966
|
I && (I.visible || I.prefetch || I.priority !== null) || this.chunkViewStates_.delete(A);
|
|
8967
8967
|
}
|
|
8968
8968
|
dispose() {
|
|
8969
|
-
this.isDisposed_ = !0, this.chunkViewStates_.forEach(
|
|
8969
|
+
this.isDisposed_ = !0, this.chunkViewStates_.forEach(MI);
|
|
8970
8970
|
}
|
|
8971
8971
|
setImageSourcePolicy(A, I) {
|
|
8972
|
-
if (I !==
|
|
8972
|
+
if (I !== Kg)
|
|
8973
8973
|
throw new Error("Unauthorized policy mutation");
|
|
8974
8974
|
this.policy_ !== A && (this.policy_ = A, this.policyChanged_ = !0, H.info(
|
|
8975
8975
|
"ChunkStoreView",
|
|
@@ -9109,24 +9109,24 @@ class Xo {
|
|
|
9109
9109
|
}
|
|
9110
9110
|
makeViewBounds3D(A, I) {
|
|
9111
9111
|
const g = T(), B = T();
|
|
9112
|
-
return g[
|
|
9112
|
+
return g[CA[this.axes_.u]] = A.min[0], B[CA[this.axes_.u]] = A.max[0], g[CA[this.axes_.v]] = A.min[1], B[CA[this.axes_.v]] = A.max[1], g[CA[this.axes_.w]] = I[0], B[CA[this.axes_.w]] = I[1], new gI(g, B);
|
|
9113
9113
|
}
|
|
9114
9114
|
viewBounds2DChanged(A) {
|
|
9115
|
-
return this.lastViewBounds2D_ === null || !
|
|
9115
|
+
return this.lastViewBounds2D_ === null || !vg(this.lastViewBounds2D_.min, A.min) || !vg(this.lastViewBounds2D_.max, A.max);
|
|
9116
9116
|
}
|
|
9117
9117
|
hasViewProjectionChanged(A) {
|
|
9118
9118
|
return this.lastViewProjection_ === null || !ii(this.lastViewProjection_, A);
|
|
9119
9119
|
}
|
|
9120
9120
|
sliceBoundsChanged(A) {
|
|
9121
|
-
return !this.lastSliceBounds_ || !
|
|
9121
|
+
return !this.lastSliceBounds_ || !vg(this.lastSliceBounds_, A);
|
|
9122
9122
|
}
|
|
9123
9123
|
cCoordsChanged(A) {
|
|
9124
9124
|
return !this.lastCCoords_ && !A ? !1 : !this.lastCCoords_ || !A || this.lastCCoords_.length !== A.length ? !0 : !this.lastCCoords_.every((I, g) => I === A[g]);
|
|
9125
9125
|
}
|
|
9126
9126
|
getPaddedBounds(A) {
|
|
9127
9127
|
const { u: I, v: g, w: B } = this.axes_, Q = this.store_.dimensions, E = Q[I].lods[this.currentLOD_], i = Q[g].lods[this.currentLOD_], o = Q[B]?.lods[this.currentLOD_], s = T();
|
|
9128
|
-
return s[
|
|
9129
|
-
|
|
9128
|
+
return s[CA[I]] = E.chunkSize * E.scale * this.policy_.prefetch.x, s[CA[g]] = i.chunkSize * i.scale * this.policy_.prefetch.y, o && (s[CA[B]] = o.chunkSize * o.scale * this.policy_.prefetch.z), new gI(
|
|
9129
|
+
lB(T(), A.min, s),
|
|
9130
9130
|
rI(T(), A.max, s)
|
|
9131
9131
|
);
|
|
9132
9132
|
}
|
|
@@ -9138,7 +9138,7 @@ class Xo {
|
|
|
9138
9138
|
return E * E + i * i;
|
|
9139
9139
|
}
|
|
9140
9140
|
}
|
|
9141
|
-
function
|
|
9141
|
+
function MI(C) {
|
|
9142
9142
|
C.visible = !1, C.prefetch = !1, C.priority = null, C.orderKey = null;
|
|
9143
9143
|
}
|
|
9144
9144
|
class jo {
|
|
@@ -9165,11 +9165,11 @@ class jo {
|
|
|
9165
9165
|
const L = o !== void 0 ? o.translation + R * e * o.scale : 0, M = new Array(D);
|
|
9166
9166
|
d[R] = M;
|
|
9167
9167
|
for (let v = 0; v < D; ++v) {
|
|
9168
|
-
const AA = i.translation + v * t * i.scale,
|
|
9169
|
-
M[v] =
|
|
9168
|
+
const AA = i.translation + v * t * i.scale, iA = new Array(n);
|
|
9169
|
+
M[v] = iA;
|
|
9170
9170
|
for (let gA = 0; gA < n; ++gA) {
|
|
9171
|
-
const
|
|
9172
|
-
|
|
9171
|
+
const oA = E.translation + gA * s * E.scale;
|
|
9172
|
+
iA[gA] = {
|
|
9173
9173
|
state: "unloaded",
|
|
9174
9174
|
lod: Q,
|
|
9175
9175
|
visible: !1,
|
|
@@ -9190,7 +9190,7 @@ class jo {
|
|
|
9190
9190
|
z: o?.scale ?? 1
|
|
9191
9191
|
},
|
|
9192
9192
|
offset: {
|
|
9193
|
-
x:
|
|
9193
|
+
x: oA,
|
|
9194
9194
|
y: AA,
|
|
9195
9195
|
z: L
|
|
9196
9196
|
}
|
|
@@ -9354,7 +9354,7 @@ class As {
|
|
|
9354
9354
|
}
|
|
9355
9355
|
enqueueWithinBudget(A) {
|
|
9356
9356
|
if (A.length === 0) return;
|
|
9357
|
-
A.sort((B, Q) =>
|
|
9357
|
+
A.sort((B, Q) => KI(B.chunk, Q.chunk));
|
|
9358
9358
|
let I = this.getGpuResidentBytes_(), g = null;
|
|
9359
9359
|
for (const { source: B, chunk: Q } of A) {
|
|
9360
9360
|
const E = this.chunkBytes(B, Q);
|
|
@@ -9374,14 +9374,14 @@ class As {
|
|
|
9374
9374
|
for (const I of this.resident_)
|
|
9375
9375
|
I.visible || A.push(I);
|
|
9376
9376
|
return A.sort((I, g) => {
|
|
9377
|
-
const B = -
|
|
9377
|
+
const B = -KI(I, g);
|
|
9378
9378
|
return B !== 0 ? B : (I.releasedAt ?? 0) - (g.releasedAt ?? 0);
|
|
9379
9379
|
});
|
|
9380
9380
|
}
|
|
9381
9381
|
evictWorseChunks(A, I, g, B) {
|
|
9382
|
-
for (; A + I > this.memoryLimitBytes_ && B.length > 0 &&
|
|
9382
|
+
for (; A + I > this.memoryLimitBytes_ && B.length > 0 && KI(B[0], g) > 0; ) {
|
|
9383
9383
|
const Q = B.shift();
|
|
9384
|
-
Q.texture !== void 0 && (A -=
|
|
9384
|
+
Q.texture !== void 0 && (A -= WI(Q.texture), this.disposeChunkTexture(Q), Q.state = "unloaded", Q.releasedAt = void 0);
|
|
9385
9385
|
}
|
|
9386
9386
|
return A;
|
|
9387
9387
|
}
|
|
@@ -9395,10 +9395,10 @@ class As {
|
|
|
9395
9395
|
for (const B of A)
|
|
9396
9396
|
B.state === "loaded" && B.texture === void 0 && I.push(B);
|
|
9397
9397
|
if (I.length === 0) return;
|
|
9398
|
-
I.sort(
|
|
9398
|
+
I.sort(KI);
|
|
9399
9399
|
const g = Math.min(I.length, this.maxGpuUploadsPerUpdate_);
|
|
9400
9400
|
for (let B = 0; B < g; B++) {
|
|
9401
|
-
const Q = I[B], E =
|
|
9401
|
+
const Q = I[B], E = VI.createWithChunk(Q);
|
|
9402
9402
|
this.uploadTexture_(E), Q.texture = E, this.resident_.add(Q), fC(Q);
|
|
9403
9403
|
}
|
|
9404
9404
|
}
|
|
@@ -9406,7 +9406,7 @@ class As {
|
|
|
9406
9406
|
this.disposeTexture_ && A.texture !== void 0 && (this.disposeTexture_(A.texture), A.texture = void 0, this.resident_.delete(A));
|
|
9407
9407
|
}
|
|
9408
9408
|
}
|
|
9409
|
-
var
|
|
9409
|
+
var xI = function(C = 1) {
|
|
9410
9410
|
var A = 0, I = document.createElement("div");
|
|
9411
9411
|
I.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", I.addEventListener("click", function(e) {
|
|
9412
9412
|
e.preventDefault(), B(++A % I.children.length);
|
|
@@ -9419,9 +9419,9 @@ var pI = function(C = 1) {
|
|
|
9419
9419
|
I.children[n].style.display = n === e ? "block" : "none";
|
|
9420
9420
|
A = e;
|
|
9421
9421
|
}
|
|
9422
|
-
var Q = (performance || Date).now(), E = Q, i = 0, o = g(new
|
|
9422
|
+
var Q = (performance || Date).now(), E = Q, i = 0, o = g(new xI.Panel("FPS", "#0ff", "#002", C)), s = g(new xI.Panel("MS", "#0f0", "#020", C));
|
|
9423
9423
|
if (self.performance && self.performance.memory)
|
|
9424
|
-
var t = g(new
|
|
9424
|
+
var t = g(new xI.Panel("MB", "#f08", "#201", C));
|
|
9425
9425
|
return B(0), {
|
|
9426
9426
|
REVISION: 16,
|
|
9427
9427
|
dom: I,
|
|
@@ -9447,7 +9447,7 @@ var pI = function(C = 1) {
|
|
|
9447
9447
|
setMode: B
|
|
9448
9448
|
};
|
|
9449
9449
|
};
|
|
9450
|
-
|
|
9450
|
+
xI.Panel = function(C, A, I, g) {
|
|
9451
9451
|
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), e = E(2 * i * g), n = E(3 * i * g), D = E(15 * i * g), F = E(74 * i * g), k = E(30 * i * g), S = document.createElement("canvas");
|
|
9452
9452
|
S.width = o, S.height = s, S.style.cssText = `width:${E(g * 80)}px;height:${E(g * 48)}px`;
|
|
9453
9453
|
var U = S.getContext("2d");
|
|
@@ -9459,13 +9459,13 @@ pI.Panel = function(C, A, I, g) {
|
|
|
9459
9459
|
};
|
|
9460
9460
|
};
|
|
9461
9461
|
function Is({ scale: C } = { scale: 1.5 }) {
|
|
9462
|
-
const A = new
|
|
9462
|
+
const A = new xI(C);
|
|
9463
9463
|
return A.showPanel(
|
|
9464
9464
|
0
|
|
9465
9465
|
/* 0 = fps, 1 = ms, 2 = mb */
|
|
9466
9466
|
), document.body.appendChild(A.dom), A;
|
|
9467
9467
|
}
|
|
9468
|
-
const
|
|
9468
|
+
const nB = [
|
|
9469
9469
|
"pointerdown",
|
|
9470
9470
|
"pointermove",
|
|
9471
9471
|
"pointerup",
|
|
@@ -9473,7 +9473,7 @@ const eB = [
|
|
|
9473
9473
|
"wheel"
|
|
9474
9474
|
];
|
|
9475
9475
|
function gs(C) {
|
|
9476
|
-
return
|
|
9476
|
+
return nB.includes(C);
|
|
9477
9477
|
}
|
|
9478
9478
|
class Bs {
|
|
9479
9479
|
propagationStopped_ = !1;
|
|
@@ -9511,7 +9511,7 @@ class Cs {
|
|
|
9511
9511
|
);
|
|
9512
9512
|
return;
|
|
9513
9513
|
}
|
|
9514
|
-
this.isConnected_ = !0,
|
|
9514
|
+
this.isConnected_ = !0, nB.forEach((A) => {
|
|
9515
9515
|
this.element_.addEventListener(A, this.handleEvent, {
|
|
9516
9516
|
passive: !1
|
|
9517
9517
|
});
|
|
@@ -9526,7 +9526,7 @@ class Cs {
|
|
|
9526
9526
|
);
|
|
9527
9527
|
return;
|
|
9528
9528
|
}
|
|
9529
|
-
this.isConnected_ = !1,
|
|
9529
|
+
this.isConnected_ = !1, nB.forEach((A) => {
|
|
9530
9530
|
this.element_.removeEventListener(A, this.handleEvent);
|
|
9531
9531
|
});
|
|
9532
9532
|
}
|
|
@@ -9548,11 +9548,11 @@ class Es {
|
|
|
9548
9548
|
this.origin = xA(A), this.direction = MQ(T(), I);
|
|
9549
9549
|
}
|
|
9550
9550
|
intersectWithPlane(A) {
|
|
9551
|
-
const I =
|
|
9551
|
+
const I = sg(this.direction, A.normal);
|
|
9552
9552
|
if (Math.abs(I) < Qs)
|
|
9553
9553
|
return null;
|
|
9554
9554
|
const g = -A.signedDistanceToPoint(this.origin) / I;
|
|
9555
|
-
return
|
|
9555
|
+
return EB(T(), this.origin, this.direction, g);
|
|
9556
9556
|
}
|
|
9557
9557
|
}
|
|
9558
9558
|
class is {
|
|
@@ -9572,7 +9572,7 @@ class is {
|
|
|
9572
9572
|
const { clientX: g, clientY: B } = I.event, Q = eA(g, B);
|
|
9573
9573
|
I.clipPos = this.clientToClip(Q, 0), I.worldPos = this.camera.clipToWorld(I.clipPos);
|
|
9574
9574
|
const E = this.camera.clipToWorld(this.clientToClip(Q, -1)), i = this.camera.clipToWorld(this.clientToClip(Q, 1));
|
|
9575
|
-
I.worldRay = new Es(E,
|
|
9575
|
+
I.worldRay = new Es(E, lB(T(), i, E));
|
|
9576
9576
|
}
|
|
9577
9577
|
for (const g of this.layers_)
|
|
9578
9578
|
if (g.onEvent(I), I.propagationStopped) return;
|
|
@@ -9937,7 +9937,7 @@ async function mC(C) {
|
|
|
9937
9937
|
throw new Error(`Unexpected response status ${C.status} ${C.statusText}`);
|
|
9938
9938
|
}
|
|
9939
9939
|
}
|
|
9940
|
-
class
|
|
9940
|
+
class _I {
|
|
9941
9941
|
url;
|
|
9942
9942
|
#A;
|
|
9943
9943
|
#I;
|
|
@@ -9992,9 +9992,9 @@ class OI {
|
|
|
9992
9992
|
return this.#A(this.#B(A, s));
|
|
9993
9993
|
}
|
|
9994
9994
|
}
|
|
9995
|
-
class
|
|
9995
|
+
class XI extends Error {
|
|
9996
9996
|
}
|
|
9997
|
-
class
|
|
9997
|
+
class UI extends XI {
|
|
9998
9998
|
_tag = "NotFoundError";
|
|
9999
9999
|
name = "NotFoundError";
|
|
10000
10000
|
path;
|
|
@@ -10003,7 +10003,7 @@ class kI extends VI {
|
|
|
10003
10003
|
super(`Not found: ${A}`, { cause: I.cause }), this.path = I.path, this.found = I.found;
|
|
10004
10004
|
}
|
|
10005
10005
|
}
|
|
10006
|
-
class rA extends
|
|
10006
|
+
class rA extends XI {
|
|
10007
10007
|
_tag = "InvalidMetadataError";
|
|
10008
10008
|
name = "InvalidMetadataError";
|
|
10009
10009
|
path;
|
|
@@ -10011,7 +10011,7 @@ class rA extends VI {
|
|
|
10011
10011
|
super(A, { cause: I.cause }), this.path = I.path;
|
|
10012
10012
|
}
|
|
10013
10013
|
}
|
|
10014
|
-
class as extends
|
|
10014
|
+
class as extends XI {
|
|
10015
10015
|
_tag = "UnknownCodecError";
|
|
10016
10016
|
name = "UnknownCodecError";
|
|
10017
10017
|
codec;
|
|
@@ -10019,7 +10019,7 @@ class as extends VI {
|
|
|
10019
10019
|
super(`Unknown codec: ${A}`), this.codec = A;
|
|
10020
10020
|
}
|
|
10021
10021
|
}
|
|
10022
|
-
class ns extends
|
|
10022
|
+
class ns extends XI {
|
|
10023
10023
|
_tag = "CodecPipelineError";
|
|
10024
10024
|
name = "CodecPipelineError";
|
|
10025
10025
|
direction;
|
|
@@ -10034,7 +10034,7 @@ class ns extends VI {
|
|
|
10034
10034
|
super(I.join(" "), { cause: A.cause }), this.direction = A.direction, this.codec = A.codec, this.chunkPath = A.chunkPath;
|
|
10035
10035
|
}
|
|
10036
10036
|
}
|
|
10037
|
-
class ZB extends
|
|
10037
|
+
class ZB extends XI {
|
|
10038
10038
|
_tag = "UnsupportedError";
|
|
10039
10039
|
name = "UnsupportedError";
|
|
10040
10040
|
feature;
|
|
@@ -10047,14 +10047,14 @@ function oI(C) {
|
|
|
10047
10047
|
throw new ZB(`${C} encode`);
|
|
10048
10048
|
};
|
|
10049
10049
|
}
|
|
10050
|
-
class
|
|
10050
|
+
class wg {
|
|
10051
10051
|
kind = "array_to_array";
|
|
10052
10052
|
constructor(A, I) {
|
|
10053
10053
|
if (A.keepbits < 0)
|
|
10054
10054
|
throw new rA("keepbits must be zero or positive");
|
|
10055
10055
|
}
|
|
10056
10056
|
static fromConfig(A, I) {
|
|
10057
|
-
return new
|
|
10057
|
+
return new wg(A, I);
|
|
10058
10058
|
}
|
|
10059
10059
|
encode = oI("bitround");
|
|
10060
10060
|
/**
|
|
@@ -10153,7 +10153,7 @@ class OB {
|
|
|
10153
10153
|
yield this.get(A);
|
|
10154
10154
|
}
|
|
10155
10155
|
}
|
|
10156
|
-
class
|
|
10156
|
+
class jI {
|
|
10157
10157
|
#A;
|
|
10158
10158
|
chars;
|
|
10159
10159
|
constructor(A, I, g, B) {
|
|
@@ -10162,7 +10162,7 @@ class _I {
|
|
|
10162
10162
|
else if (PB(I))
|
|
10163
10163
|
B && (B *= A), this.#A = new Int32Array(I, g, B);
|
|
10164
10164
|
else {
|
|
10165
|
-
const Q = I, E = new
|
|
10165
|
+
const Q = I, E = new jI(A, 1);
|
|
10166
10166
|
this.#A = new Int32Array((function* () {
|
|
10167
10167
|
for (let i of Q)
|
|
10168
10168
|
E.set(0, i), yield* E.#A;
|
|
@@ -10215,7 +10215,7 @@ function rs() {
|
|
|
10215
10215
|
function Ds(C, A) {
|
|
10216
10216
|
return new SharedArrayBuffer(C);
|
|
10217
10217
|
}
|
|
10218
|
-
function
|
|
10218
|
+
function zI(C) {
|
|
10219
10219
|
const A = new TextDecoder().decode(C);
|
|
10220
10220
|
try {
|
|
10221
10221
|
return JSON.parse(A);
|
|
@@ -10230,13 +10230,13 @@ function xC(C, A) {
|
|
|
10230
10230
|
for (let E = 0; E < I; E += 1)
|
|
10231
10231
|
B = C[Q + E], C[Q + E] = C[Q + g - E], C[Q + g - E] = B;
|
|
10232
10232
|
}
|
|
10233
|
-
function
|
|
10233
|
+
function lI(C) {
|
|
10234
10234
|
if (C === "v2:object")
|
|
10235
10235
|
return globalThis.Array;
|
|
10236
10236
|
let A = C.match(/v2:([US])(\d+)/);
|
|
10237
10237
|
if (A) {
|
|
10238
10238
|
let [, g, B] = A;
|
|
10239
|
-
return (g === "U" ?
|
|
10239
|
+
return (g === "U" ? jI : OB).bind(null, Number(B));
|
|
10240
10240
|
}
|
|
10241
10241
|
if (C === "string")
|
|
10242
10242
|
return globalThis.Array;
|
|
@@ -10321,7 +10321,7 @@ function cs(C, A = {}) {
|
|
|
10321
10321
|
let o = Q.astype ?? Q.dtype;
|
|
10322
10322
|
if (o !== void 0 && o !== C.dtype) {
|
|
10323
10323
|
let s = TC(o).dataType;
|
|
10324
|
-
if (!
|
|
10324
|
+
if (!rB(s, "number") && !rB(s, "bigint"))
|
|
10325
10325
|
throw new rA(`fixedscaleoffset astype must be a numeric data type, got ${o}`);
|
|
10326
10326
|
I.push({
|
|
10327
10327
|
name: "cast_value",
|
|
@@ -10374,7 +10374,7 @@ function ws(C, A = {}) {
|
|
|
10374
10374
|
attributes: A
|
|
10375
10375
|
};
|
|
10376
10376
|
}
|
|
10377
|
-
function
|
|
10377
|
+
function rB(C, A) {
|
|
10378
10378
|
if (A !== "number" && A !== "bigint" && A !== "boolean" && A !== "object" && A !== "string")
|
|
10379
10379
|
return C === A;
|
|
10380
10380
|
let I = C === "bool";
|
|
@@ -10438,7 +10438,7 @@ function Fs() {
|
|
|
10438
10438
|
function WC(C) {
|
|
10439
10439
|
return "BYTES_PER_ELEMENT" in C ? C.BYTES_PER_ELEMENT : 4;
|
|
10440
10440
|
}
|
|
10441
|
-
class
|
|
10441
|
+
class Hg {
|
|
10442
10442
|
kind = "array_to_bytes";
|
|
10443
10443
|
#A;
|
|
10444
10444
|
#I;
|
|
@@ -10446,12 +10446,12 @@ class fg {
|
|
|
10446
10446
|
#B;
|
|
10447
10447
|
#C;
|
|
10448
10448
|
constructor(A, I) {
|
|
10449
|
-
this.#C = A?.endian, this.#I =
|
|
10449
|
+
this.#C = A?.endian, this.#I = lI(I.dataType), this.#B = I.shape, this.#A = QI(I.shape, "C");
|
|
10450
10450
|
const g = new this.#I(0);
|
|
10451
10451
|
this.#g = g.BYTES_PER_ELEMENT;
|
|
10452
10452
|
}
|
|
10453
10453
|
static fromConfig(A, I) {
|
|
10454
|
-
return new
|
|
10454
|
+
return new Hg(A, I);
|
|
10455
10455
|
}
|
|
10456
10456
|
encode(A) {
|
|
10457
10457
|
let I = new Uint8Array(A.data.buffer);
|
|
@@ -10477,10 +10477,10 @@ const vC = {
|
|
|
10477
10477
|
float32: 4,
|
|
10478
10478
|
float64: 8
|
|
10479
10479
|
};
|
|
10480
|
-
function
|
|
10480
|
+
function Gg(C) {
|
|
10481
10481
|
return C in DE;
|
|
10482
10482
|
}
|
|
10483
|
-
function
|
|
10483
|
+
function DB(C) {
|
|
10484
10484
|
return C === "int64" || C === "uint64";
|
|
10485
10485
|
}
|
|
10486
10486
|
function Ss(C, A) {
|
|
@@ -10492,18 +10492,18 @@ function Ss(C, A) {
|
|
|
10492
10492
|
}
|
|
10493
10493
|
return A === 4 ? (B.setUint32(0, Number(I)), B.getFloat32(0)) : (B.setBigUint64(0, I), B.getFloat64(0));
|
|
10494
10494
|
}
|
|
10495
|
-
function
|
|
10496
|
-
if (
|
|
10495
|
+
function Fg(C, A) {
|
|
10496
|
+
if (DB(C)) {
|
|
10497
10497
|
if (typeof A != "number" || !Number.isInteger(A))
|
|
10498
10498
|
throw new rA(`Expected an integer value for data type "${C}", got ${JSON.stringify(A)}`);
|
|
10499
10499
|
return BigInt(A);
|
|
10500
10500
|
}
|
|
10501
10501
|
if (typeof A == "number") {
|
|
10502
|
-
if (!
|
|
10502
|
+
if (!Gg(C) && !Number.isInteger(A))
|
|
10503
10503
|
throw new rA(`Expected an integer value for data type "${C}", got ${A}`);
|
|
10504
10504
|
return A;
|
|
10505
10505
|
}
|
|
10506
|
-
if (!
|
|
10506
|
+
if (!Gg(C))
|
|
10507
10507
|
throw new rA(`String-encoded scalar "${A}" is not valid for non-float data type "${C}"`);
|
|
10508
10508
|
return A in vC ? vC[A] : Ss(A, DE[C]);
|
|
10509
10509
|
}
|
|
@@ -10519,21 +10519,21 @@ const ZC = /* @__PURE__ */ new Set([
|
|
|
10519
10519
|
"float16",
|
|
10520
10520
|
"float32",
|
|
10521
10521
|
"float64"
|
|
10522
|
-
]),
|
|
10522
|
+
]), Xg = {
|
|
10523
10523
|
int8: [-128, 2 ** 7 - 1],
|
|
10524
10524
|
uint8: [0, 2 ** 8 - 1],
|
|
10525
10525
|
int16: [-32768, 2 ** 15 - 1],
|
|
10526
10526
|
uint16: [0, 2 ** 16 - 1],
|
|
10527
10527
|
int32: [-2147483648, 2 ** 31 - 1],
|
|
10528
10528
|
uint32: [0, 2 ** 32 - 1]
|
|
10529
|
-
},
|
|
10529
|
+
}, jg = {
|
|
10530
10530
|
int64: [-(2n ** 63n), 2n ** 63n - 1n],
|
|
10531
10531
|
uint64: [0n, 2n ** 64n - 1n]
|
|
10532
10532
|
};
|
|
10533
10533
|
function PC(C, A, I) {
|
|
10534
10534
|
return C.map(([g, B]) => ({
|
|
10535
|
-
src:
|
|
10536
|
-
tgt:
|
|
10535
|
+
src: Fg(A, g),
|
|
10536
|
+
tgt: Fg(I, B)
|
|
10537
10537
|
}));
|
|
10538
10538
|
}
|
|
10539
10539
|
function Ns(C, A) {
|
|
@@ -10570,7 +10570,7 @@ function OC(C) {
|
|
|
10570
10570
|
return ks;
|
|
10571
10571
|
}
|
|
10572
10572
|
}
|
|
10573
|
-
function
|
|
10573
|
+
function zg(C, A, I) {
|
|
10574
10574
|
const g = A - C + 1;
|
|
10575
10575
|
switch (I) {
|
|
10576
10576
|
case "clamp":
|
|
@@ -10585,7 +10585,7 @@ function Xg(C, A, I) {
|
|
|
10585
10585
|
};
|
|
10586
10586
|
}
|
|
10587
10587
|
}
|
|
10588
|
-
function
|
|
10588
|
+
function $g(C, A, I) {
|
|
10589
10589
|
const g = A - C + 1n;
|
|
10590
10590
|
switch (I) {
|
|
10591
10591
|
case "clamp":
|
|
@@ -10607,7 +10607,7 @@ class VB {
|
|
|
10607
10607
|
#g;
|
|
10608
10608
|
#B;
|
|
10609
10609
|
constructor(A, I, g, B, Q, E) {
|
|
10610
|
-
this.#A = I, this.#I =
|
|
10610
|
+
this.#A = I, this.#I = lI(A), this.#g = VC(I, A, g, B, Q), this.#B = VC(A, I, g, B, E);
|
|
10611
10611
|
}
|
|
10612
10612
|
/** Return updated metadata reflecting the type and fill value after encoding. */
|
|
10613
10613
|
getEncodedMeta(A) {
|
|
@@ -10632,21 +10632,21 @@ class VB {
|
|
|
10632
10632
|
}
|
|
10633
10633
|
}
|
|
10634
10634
|
function VC(C, A, I, g, B) {
|
|
10635
|
-
const Q =
|
|
10635
|
+
const Q = Gg(C), E = DB(C), i = Gg(A), o = DB(A);
|
|
10636
10636
|
let s;
|
|
10637
10637
|
if (Q && i) {
|
|
10638
10638
|
if (I !== "nearest-even")
|
|
10639
10639
|
throw new rA(`cast_value float -> float only supports "nearest-even" rounding, got "${I}"`);
|
|
10640
10640
|
s = (e) => e;
|
|
10641
10641
|
} else if (Q && !i && !o) {
|
|
10642
|
-
const e = OC(I), n =
|
|
10642
|
+
const e = OC(I), n = zg(...Xg[A], g);
|
|
10643
10643
|
s = (D) => {
|
|
10644
10644
|
if (!Number.isFinite(D))
|
|
10645
10645
|
throw new Error(`Cannot cast ${D} to integer type without scalar_map`);
|
|
10646
10646
|
return n(e(D));
|
|
10647
10647
|
};
|
|
10648
10648
|
} else if (Q && o) {
|
|
10649
|
-
const e = OC(I), n =
|
|
10649
|
+
const e = OC(I), n = $g(...jg[A], g);
|
|
10650
10650
|
s = (D) => {
|
|
10651
10651
|
if (!Number.isFinite(D))
|
|
10652
10652
|
throw new Error(`Cannot cast ${D} to integer type without scalar_map`);
|
|
@@ -10657,15 +10657,15 @@ function VC(C, A, I, g, B) {
|
|
|
10657
10657
|
else if (E && i)
|
|
10658
10658
|
s = (e) => Number(e);
|
|
10659
10659
|
else if (!Q && !E && !i && !o)
|
|
10660
|
-
s =
|
|
10660
|
+
s = zg(...Xg[A], g);
|
|
10661
10661
|
else if (!Q && !E && o) {
|
|
10662
|
-
const e =
|
|
10662
|
+
const e = $g(...jg[A], g);
|
|
10663
10663
|
s = (n) => e(BigInt(n));
|
|
10664
10664
|
} else if (E && !i && !o) {
|
|
10665
|
-
const e =
|
|
10665
|
+
const e = zg(...Xg[A], g);
|
|
10666
10666
|
s = (n) => e(Number(n));
|
|
10667
10667
|
} else if (E && o)
|
|
10668
|
-
s =
|
|
10668
|
+
s = $g(...jg[A], g);
|
|
10669
10669
|
else
|
|
10670
10670
|
throw new Error(`Unhandled type combination: ${C} -> ${A}`);
|
|
10671
10671
|
return B.length === 0 ? s : (e) => {
|
|
@@ -10721,7 +10721,7 @@ class XB {
|
|
|
10721
10721
|
static fromConfig(A, I) {
|
|
10722
10722
|
if (!ds.has(I.dataType))
|
|
10723
10723
|
throw new rA(`Delta codec does not support data type: ${I.dataType}`);
|
|
10724
|
-
return new XB(
|
|
10724
|
+
return new XB(lI(I.dataType));
|
|
10725
10725
|
}
|
|
10726
10726
|
encode(A) {
|
|
10727
10727
|
_C(A.shape, A.stride);
|
|
@@ -10757,7 +10757,7 @@ function Us(C, A) {
|
|
|
10757
10757
|
function ls(C, A) {
|
|
10758
10758
|
return A instanceof Object && !Array.isArray(A) ? Object.keys(A).sort().reduce((I, g) => (I[g] = A[g], I), {}) : A;
|
|
10759
10759
|
}
|
|
10760
|
-
class
|
|
10760
|
+
class Sg {
|
|
10761
10761
|
configuration;
|
|
10762
10762
|
kind = "array_to_bytes";
|
|
10763
10763
|
#A;
|
|
@@ -10778,7 +10778,7 @@ class Gg {
|
|
|
10778
10778
|
}, this.#I = { strict: s };
|
|
10779
10779
|
}
|
|
10780
10780
|
static fromConfig(A) {
|
|
10781
|
-
return new
|
|
10781
|
+
return new Sg(A);
|
|
10782
10782
|
}
|
|
10783
10783
|
encode(A) {
|
|
10784
10784
|
const { indent: I, encoding: g, ensure_ascii: B, check_circular: Q, allow_nan: E, sort_keys: i } = this.#A;
|
|
@@ -10803,7 +10803,7 @@ class Gg {
|
|
|
10803
10803
|
decode(A) {
|
|
10804
10804
|
const { strict: I } = this.#I;
|
|
10805
10805
|
NA(I, "JsonCodec does not yet support non-strict decoding.");
|
|
10806
|
-
const g =
|
|
10806
|
+
const g = zI(A), B = g.pop();
|
|
10807
10807
|
g.pop(), NA(B, "0D not implemented for JsonCodec.");
|
|
10808
10808
|
const Q = QI(B, "C");
|
|
10809
10809
|
return { data: g, shape: B, stride: Q };
|
|
@@ -10833,7 +10833,7 @@ class zB {
|
|
|
10833
10833
|
static fromConfig(A, I) {
|
|
10834
10834
|
if (!Ls.has(I.dataType))
|
|
10835
10835
|
throw new rA(`scale_offset codec does not support data type: ${I.dataType}`);
|
|
10836
|
-
return new zB(
|
|
10836
|
+
return new zB(Fg(I.dataType, A.scale ?? 1), Fg(I.dataType, A.offset ?? 0), lI(I.dataType));
|
|
10837
10837
|
}
|
|
10838
10838
|
encode = oI("scale_offset");
|
|
10839
10839
|
decode(A) {
|
|
@@ -10848,7 +10848,7 @@ class $B {
|
|
|
10848
10848
|
#A;
|
|
10849
10849
|
constructor(A, I) {
|
|
10850
10850
|
if (I) {
|
|
10851
|
-
let g = new (
|
|
10851
|
+
let g = new (lI(I.dataType))(0);
|
|
10852
10852
|
NA("BYTES_PER_ELEMENT" in g, `Shuffle codec requires a fixed-size dtype, got "${I.dataType}"`), this.#A = g.BYTES_PER_ELEMENT;
|
|
10853
10853
|
} else
|
|
10854
10854
|
this.#A = A.elementsize ?? 4;
|
|
@@ -10878,7 +10878,7 @@ function Ys(C, A) {
|
|
|
10878
10878
|
return B;
|
|
10879
10879
|
}
|
|
10880
10880
|
function XC(C) {
|
|
10881
|
-
return C instanceof eE || C instanceof OB || C instanceof
|
|
10881
|
+
return C instanceof eE || C instanceof OB || C instanceof jI ? new Proxy(C, {
|
|
10882
10882
|
get(I, g) {
|
|
10883
10883
|
return I.get(Number(g));
|
|
10884
10884
|
},
|
|
@@ -10889,7 +10889,7 @@ function XC(C) {
|
|
|
10889
10889
|
}
|
|
10890
10890
|
function Ms(C, A) {
|
|
10891
10891
|
let I;
|
|
10892
|
-
return C.data instanceof OB || C.data instanceof
|
|
10892
|
+
return C.data instanceof OB || C.data instanceof jI ? I = new C.constructor(
|
|
10893
10893
|
// @ts-expect-error
|
|
10894
10894
|
C.data.length,
|
|
10895
10895
|
C.data.chars
|
|
@@ -10955,7 +10955,7 @@ class AC {
|
|
|
10955
10955
|
};
|
|
10956
10956
|
}
|
|
10957
10957
|
}
|
|
10958
|
-
class
|
|
10958
|
+
class Ng {
|
|
10959
10959
|
kind = "array_to_bytes";
|
|
10960
10960
|
#A;
|
|
10961
10961
|
#I;
|
|
@@ -10963,7 +10963,7 @@ class Fg {
|
|
|
10963
10963
|
this.#A = A, this.#I = QI(A, "C");
|
|
10964
10964
|
}
|
|
10965
10965
|
static fromConfig(A, I) {
|
|
10966
|
-
return new
|
|
10966
|
+
return new Ng(I.shape);
|
|
10967
10967
|
}
|
|
10968
10968
|
encode = oI("vlen-utf8");
|
|
10969
10969
|
decode(A) {
|
|
@@ -10988,10 +10988,10 @@ class IC {
|
|
|
10988
10988
|
}
|
|
10989
10989
|
function Hs() {
|
|
10990
10990
|
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 = () => jB, B = () => IC;
|
|
10991
|
-
return (/* @__PURE__ */ new Map()).set("blosc", C).set("lz4", A).set("zstd", I).set("gzip", g).set("zlib", B).set("transpose", () => AC).set("bytes", () =>
|
|
10991
|
+
return (/* @__PURE__ */ new Map()).set("blosc", C).set("lz4", A).set("zstd", I).set("gzip", g).set("zlib", B).set("transpose", () => AC).set("bytes", () => Hg).set("crc32c", () => _B).set("vlen-utf8", () => Ng).set("json2", () => Sg).set("bitround", () => wg).set("cast_value", () => VB).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", () => Ng).set("numcodecs.shuffle", () => $B).set("numcodecs.delta", () => XB).set("numcodecs.bitround", () => wg).set("numcodecs.json2", () => Sg);
|
|
10992
10992
|
}
|
|
10993
10993
|
const qs = Hs();
|
|
10994
|
-
function
|
|
10994
|
+
function hB(C) {
|
|
10995
10995
|
let A;
|
|
10996
10996
|
function I() {
|
|
10997
10997
|
return A || (A = ps(C)), A;
|
|
@@ -11073,7 +11073,7 @@ async function ps(C) {
|
|
|
11073
11073
|
throw new rA(`Cannot encode ${Q.dataType} to bytes without a codec`);
|
|
11074
11074
|
g = {
|
|
11075
11075
|
name: "bytes",
|
|
11076
|
-
codec:
|
|
11076
|
+
codec: Hg.fromConfig({ endian: "little" }, Q)
|
|
11077
11077
|
};
|
|
11078
11078
|
}
|
|
11079
11079
|
return {
|
|
@@ -11089,7 +11089,7 @@ const zC = 18446744073709551615n;
|
|
|
11089
11089
|
function xs(C, A, I, g) {
|
|
11090
11090
|
if (!C.store.getRange)
|
|
11091
11091
|
throw new ZB("sharding requires a store with getRange");
|
|
11092
|
-
let B = C.store.getRange.bind(C.store), Q = A.map((s, t) => s / g.chunk_shape[t]), E =
|
|
11092
|
+
let B = C.store.getRange.bind(C.store), Q = A.map((s, t) => s / g.chunk_shape[t]), E = hB({
|
|
11093
11093
|
dataType: "uint64",
|
|
11094
11094
|
shape: [...Q, 2],
|
|
11095
11095
|
codecs: g.index_codecs,
|
|
@@ -11138,11 +11138,11 @@ class gC extends UA {
|
|
|
11138
11138
|
function $C(C) {
|
|
11139
11139
|
return C.find((I) => I.name === "transpose")?.configuration?.order ?? "C";
|
|
11140
11140
|
}
|
|
11141
|
-
const
|
|
11141
|
+
const gg = Symbol("zarrita.context");
|
|
11142
11142
|
function Ts(C, A) {
|
|
11143
11143
|
let { configuration: I } = A.codecs.find(Gs) ?? {}, g = {
|
|
11144
11144
|
encodeChunkKey: hs(A.chunk_key_encoding),
|
|
11145
|
-
TypedArray:
|
|
11145
|
+
TypedArray: lI(A.data_type),
|
|
11146
11146
|
fillValue: A.fill_value
|
|
11147
11147
|
};
|
|
11148
11148
|
if (I) {
|
|
@@ -11151,7 +11151,7 @@ function Ts(C, A) {
|
|
|
11151
11151
|
...g,
|
|
11152
11152
|
kind: "sharded",
|
|
11153
11153
|
chunkShape: I.chunk_shape,
|
|
11154
|
-
codec:
|
|
11154
|
+
codec: hB({
|
|
11155
11155
|
dataType: A.data_type,
|
|
11156
11156
|
shape: I.chunk_shape,
|
|
11157
11157
|
codecs: I.codecs,
|
|
@@ -11168,7 +11168,7 @@ function Ts(C, A) {
|
|
|
11168
11168
|
...g,
|
|
11169
11169
|
kind: "regular",
|
|
11170
11170
|
chunkShape: A.chunk_grid.configuration.chunk_shape,
|
|
11171
|
-
codec:
|
|
11171
|
+
codec: hB({
|
|
11172
11172
|
dataType: A.data_type,
|
|
11173
11173
|
shape: A.chunk_grid.configuration.chunk_shape,
|
|
11174
11174
|
codecs: A.codecs,
|
|
@@ -11183,15 +11183,15 @@ function Ts(C, A) {
|
|
|
11183
11183
|
}
|
|
11184
11184
|
};
|
|
11185
11185
|
}
|
|
11186
|
-
let
|
|
11186
|
+
let Rg = class extends UA {
|
|
11187
11187
|
kind = "array";
|
|
11188
11188
|
#A;
|
|
11189
|
-
[
|
|
11189
|
+
[gg];
|
|
11190
11190
|
constructor(A, I, g) {
|
|
11191
11191
|
super(A, I), this.#A = {
|
|
11192
11192
|
...g,
|
|
11193
11193
|
fill_value: aE(g)
|
|
11194
|
-
}, this[
|
|
11194
|
+
}, this[gg] = Ts(this, this.#A);
|
|
11195
11195
|
}
|
|
11196
11196
|
get attrs() {
|
|
11197
11197
|
return this.#A.attributes;
|
|
@@ -11206,14 +11206,14 @@ let Sg = class extends UA {
|
|
|
11206
11206
|
return this.#A.shape;
|
|
11207
11207
|
}
|
|
11208
11208
|
get chunks() {
|
|
11209
|
-
return this[
|
|
11209
|
+
return this[gg].chunkShape;
|
|
11210
11210
|
}
|
|
11211
11211
|
get dtype() {
|
|
11212
11212
|
return this.#A.data_type;
|
|
11213
11213
|
}
|
|
11214
11214
|
async getChunk(A, I, g) {
|
|
11215
11215
|
g?.useSharedArrayBuffer && rs();
|
|
11216
|
-
let B = this[
|
|
11216
|
+
let B = this[gg], Q = await B.getChunkBytes(A, I);
|
|
11217
11217
|
if (!Q) {
|
|
11218
11218
|
let E = B.chunkShape.reduce((o, s) => o * s, 1), i;
|
|
11219
11219
|
if (g?.useSharedArrayBuffer) {
|
|
@@ -11252,7 +11252,7 @@ let Sg = class extends UA {
|
|
|
11252
11252
|
* ```
|
|
11253
11253
|
*/
|
|
11254
11254
|
is(A) {
|
|
11255
|
-
return
|
|
11255
|
+
return rB(this.dtype, A);
|
|
11256
11256
|
}
|
|
11257
11257
|
};
|
|
11258
11258
|
function bs(C, A) {
|
|
@@ -11268,7 +11268,7 @@ async function hE(C) {
|
|
|
11268
11268
|
let A = C.store.arrayExtensions;
|
|
11269
11269
|
return A?.length ? await Ws(C, ...A) : C;
|
|
11270
11270
|
}
|
|
11271
|
-
let
|
|
11271
|
+
let qg = vs();
|
|
11272
11272
|
function vs() {
|
|
11273
11273
|
let C = /* @__PURE__ */ new WeakMap();
|
|
11274
11274
|
function A(I) {
|
|
@@ -11289,44 +11289,44 @@ async function Zs(C, A) {
|
|
|
11289
11289
|
let I = await C.store.get(C.resolve(".zattrs").path, {
|
|
11290
11290
|
signal: A
|
|
11291
11291
|
});
|
|
11292
|
-
return I ?
|
|
11292
|
+
return I ? zI(I) : {};
|
|
11293
11293
|
}
|
|
11294
11294
|
async function Ps(C, A = {}) {
|
|
11295
11295
|
let I = "store" in C ? C : new UA(C), { signal: g } = A, B = {};
|
|
11296
|
-
return (A.attrs ?? !0) && (B = await Zs(I, g)), g?.throwIfAborted(), A.kind === "array" ? AQ(I, B, g) : A.kind === "group" ? IQ(I, B, g) : AQ(I, B, g).catch((Q) => (nE(Q,
|
|
11296
|
+
return (A.attrs ?? !0) && (B = await Zs(I, g)), g?.throwIfAborted(), A.kind === "array" ? AQ(I, B, g) : A.kind === "group" ? IQ(I, B, g) : AQ(I, B, g).catch((Q) => (nE(Q, UI, rA), IQ(I, B, g)));
|
|
11297
11297
|
}
|
|
11298
11298
|
async function AQ(C, A, I) {
|
|
11299
11299
|
let { path: g } = C.resolve(".zarray"), B = await C.store.get(g, { signal: I });
|
|
11300
11300
|
if (!B)
|
|
11301
|
-
throw new
|
|
11302
|
-
return
|
|
11301
|
+
throw new UI("v2 array", { path: g });
|
|
11302
|
+
return qg.increment(C.store, "v2"), hE(new Rg(C.store, C.path, cs(zI(B), A)));
|
|
11303
11303
|
}
|
|
11304
11304
|
async function IQ(C, A, I) {
|
|
11305
11305
|
let { path: g } = C.resolve(".zgroup"), B = await C.store.get(g, { signal: I });
|
|
11306
11306
|
if (!B)
|
|
11307
|
-
throw new
|
|
11308
|
-
return
|
|
11307
|
+
throw new UI("v2 group", { path: g });
|
|
11308
|
+
return qg.increment(C.store, "v2"), new gC(C.store, C.path, ws(zI(B), A));
|
|
11309
11309
|
}
|
|
11310
11310
|
async function Os(C, A) {
|
|
11311
11311
|
let { store: I, path: g } = C.resolve("zarr.json"), B = await C.store.get(g, { signal: A });
|
|
11312
11312
|
if (!B)
|
|
11313
|
-
throw new
|
|
11314
|
-
let Q =
|
|
11315
|
-
return Q.node_type === "array" && (Q.fill_value = aE(Q)), Q.node_type === "array" ? hE(new
|
|
11313
|
+
throw new UI("v3 array or group", { path: g });
|
|
11314
|
+
let Q = zI(B);
|
|
11315
|
+
return Q.node_type === "array" && (Q.fill_value = aE(Q)), Q.node_type === "array" ? hE(new Rg(I, C.path, Q)) : new gC(I, C.path, Q);
|
|
11316
11316
|
}
|
|
11317
11317
|
async function Vs(C, A = {}) {
|
|
11318
11318
|
let I = "store" in C ? C : new UA(C), g = await Os(I, A.signal);
|
|
11319
|
-
if (
|
|
11319
|
+
if (qg.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && g instanceof Rg || A.kind === "group" && g instanceof gC)
|
|
11320
11320
|
return g;
|
|
11321
|
-
let B = g instanceof
|
|
11322
|
-
throw new
|
|
11321
|
+
let B = g instanceof Rg ? "array" : "group";
|
|
11322
|
+
throw new UI(`${A.kind} at ${I.path}`, {
|
|
11323
11323
|
path: I.path,
|
|
11324
11324
|
found: B
|
|
11325
11325
|
});
|
|
11326
11326
|
}
|
|
11327
11327
|
async function kA(C, A = {}) {
|
|
11328
|
-
let I = "store" in C ? C.store : C, g =
|
|
11329
|
-
return B(C, A).catch((E) => (nE(E,
|
|
11328
|
+
let I = "store" in C ? C.store : C, g = qg.versionMax(I), B = g === "v2" ? kA.v2 : kA.v3, Q = g === "v2" ? kA.v3 : kA.v2;
|
|
11329
|
+
return B(C, A).catch((E) => (nE(E, UI, rA), Q(C, A)));
|
|
11330
11330
|
}
|
|
11331
11331
|
kA.v2 = Ps;
|
|
11332
11332
|
kA.v3 = Vs;
|
|
@@ -11357,7 +11357,7 @@ class BC {
|
|
|
11357
11357
|
return new Uint8Array(B);
|
|
11358
11358
|
}
|
|
11359
11359
|
}
|
|
11360
|
-
async function
|
|
11360
|
+
async function $I(C, A) {
|
|
11361
11361
|
if (A === "v2")
|
|
11362
11362
|
try {
|
|
11363
11363
|
return kA.v2(C, { kind: "group", attrs: !0 });
|
|
@@ -11399,7 +11399,7 @@ async function js(C) {
|
|
|
11399
11399
|
let A;
|
|
11400
11400
|
switch (C.type) {
|
|
11401
11401
|
case "fetch": {
|
|
11402
|
-
const g = new
|
|
11402
|
+
const g = new _I(C.url);
|
|
11403
11403
|
A = new UA(g);
|
|
11404
11404
|
break;
|
|
11405
11405
|
}
|
|
@@ -11419,7 +11419,7 @@ async function js(C) {
|
|
|
11419
11419
|
return Xs(I, C.zarrVersion);
|
|
11420
11420
|
}
|
|
11421
11421
|
function zs(C, A, I) {
|
|
11422
|
-
if (C.store instanceof
|
|
11422
|
+
if (C.store instanceof _I)
|
|
11423
11423
|
return {
|
|
11424
11424
|
type: "fetch",
|
|
11425
11425
|
arrayPath: A,
|
|
@@ -11470,8 +11470,8 @@ function At(C, A, I, g) {
|
|
|
11470
11470
|
for (let L = 0; L < B.z; L++) {
|
|
11471
11471
|
const M = F + L * f;
|
|
11472
11472
|
for (let v = 0; v < B.y; v++) {
|
|
11473
|
-
const AA = M + v * d,
|
|
11474
|
-
U.set(C.subarray(AA,
|
|
11473
|
+
const AA = M + v * d, iA = AA + B.x;
|
|
11474
|
+
U.set(C.subarray(AA, iA), R), R += B.x;
|
|
11475
11475
|
}
|
|
11476
11476
|
}
|
|
11477
11477
|
return U;
|
|
@@ -15154,7 +15154,7 @@ function It(C) {
|
|
|
15154
15154
|
}
|
|
15155
15155
|
const gt = Math.max(1, navigator.hardwareConcurrency - 2);
|
|
15156
15156
|
let YA = [], Bt = 0, cE = 0;
|
|
15157
|
-
const EI = /* @__PURE__ */ new Map(),
|
|
15157
|
+
const EI = /* @__PURE__ */ new Map(), kg = /* @__PURE__ */ new Set();
|
|
15158
15158
|
function wE(C) {
|
|
15159
15159
|
const A = YA.find((I) => I.worker === C);
|
|
15160
15160
|
return A || H.error(
|
|
@@ -15165,7 +15165,7 @@ function wE(C) {
|
|
|
15165
15165
|
function Ct(C, A) {
|
|
15166
15166
|
const { id: I, success: g } = C.data, B = EI.get(I);
|
|
15167
15167
|
if (!B) {
|
|
15168
|
-
|
|
15168
|
+
kg.has(I) ? kg.delete(I) : H.warn(
|
|
15169
15169
|
"ZarrWorker",
|
|
15170
15170
|
`Received response for unknown message ID ${I}:`,
|
|
15171
15171
|
C.data
|
|
@@ -15236,10 +15236,10 @@ async function Et(C, A, I, g) {
|
|
|
15236
15236
|
E.worker.postMessage({
|
|
15237
15237
|
id: i,
|
|
15238
15238
|
type: "cancel"
|
|
15239
|
-
}), EI.delete(i),
|
|
15239
|
+
}), EI.delete(i), kg.add(i), E.pendingCount--, Q(new DOMException("Operation was aborted", "AbortError"));
|
|
15240
15240
|
};
|
|
15241
15241
|
if (g.signal.aborted) {
|
|
15242
|
-
s(),
|
|
15242
|
+
s(), kg.delete(i);
|
|
15243
15243
|
return;
|
|
15244
15244
|
}
|
|
15245
15245
|
g.signal.addEventListener("abort", s, { once: !0 }), o.abortListener = s, o.abortSignal = g.signal;
|
|
@@ -15400,25 +15400,25 @@ function at(C, A) {
|
|
|
15400
15400
|
x: E(I[B], B),
|
|
15401
15401
|
y: E(I[Q], Q),
|
|
15402
15402
|
numLods: A.length
|
|
15403
|
-
}, o =
|
|
15403
|
+
}, o = ig(I, "z");
|
|
15404
15404
|
o !== -1 && (i.z = E(I[o], o));
|
|
15405
|
-
const s =
|
|
15405
|
+
const s = ig(I, "c");
|
|
15406
15406
|
s !== -1 && (i.c = E(I[s], s));
|
|
15407
|
-
const t =
|
|
15407
|
+
const t = ig(I, "t");
|
|
15408
15408
|
return t !== -1 && (i.t = E(I[t], t)), i;
|
|
15409
15409
|
}
|
|
15410
15410
|
function nt(C, A) {
|
|
15411
15411
|
return C.toLowerCase() === A.toLowerCase();
|
|
15412
15412
|
}
|
|
15413
15413
|
function QQ(C, A) {
|
|
15414
|
-
const I =
|
|
15414
|
+
const I = ig(C, A);
|
|
15415
15415
|
if (I === -1)
|
|
15416
15416
|
throw new Error(
|
|
15417
15417
|
`Could not find "${A}" dimension in [${C.join(", ")}]`
|
|
15418
15418
|
);
|
|
15419
15419
|
return I;
|
|
15420
15420
|
}
|
|
15421
|
-
function
|
|
15421
|
+
function ig(C, A) {
|
|
15422
15422
|
return C.findIndex((I) => nt(I, A));
|
|
15423
15423
|
}
|
|
15424
15424
|
function rt(C) {
|
|
@@ -15598,7 +15598,7 @@ class ZA extends Error {
|
|
|
15598
15598
|
}
|
|
15599
15599
|
}
|
|
15600
15600
|
ZA.create = (C) => new ZA(C);
|
|
15601
|
-
const
|
|
15601
|
+
const yB = (C, A) => {
|
|
15602
15602
|
let I;
|
|
15603
15603
|
switch (C.code) {
|
|
15604
15604
|
case l.invalid_type:
|
|
@@ -15654,7 +15654,7 @@ const DB = (C, A) => {
|
|
|
15654
15654
|
}
|
|
15655
15655
|
return { message: I };
|
|
15656
15656
|
};
|
|
15657
|
-
let Dt =
|
|
15657
|
+
let Dt = yB;
|
|
15658
15658
|
function ht() {
|
|
15659
15659
|
return Dt;
|
|
15660
15660
|
}
|
|
@@ -15691,7 +15691,7 @@ function Y(C, A) {
|
|
|
15691
15691
|
// then schema-bound map if available
|
|
15692
15692
|
I,
|
|
15693
15693
|
// then global override map
|
|
15694
|
-
I ===
|
|
15694
|
+
I === yB ? void 0 : yB
|
|
15695
15695
|
// then global default map
|
|
15696
15696
|
].filter((B) => !!B)
|
|
15697
15697
|
});
|
|
@@ -15740,7 +15740,7 @@ class RA {
|
|
|
15740
15740
|
}
|
|
15741
15741
|
const m = Object.freeze({
|
|
15742
15742
|
status: "aborted"
|
|
15743
|
-
}),
|
|
15743
|
+
}), HI = (C) => ({ status: "dirty", value: C }), LA = (C) => ({ status: "valid", value: C }), iQ = (C) => C.status === "aborted", oQ = (C) => C.status === "dirty", wI = (C) => C.status === "valid", dg = (C) => typeof Promise < "u" && C instanceof Promise;
|
|
15744
15744
|
var K;
|
|
15745
15745
|
(function(C) {
|
|
15746
15746
|
C.errToObj = (A) => typeof A == "string" ? { message: A } : A || {}, C.toString = (A) => typeof A == "string" ? A : A?.message;
|
|
@@ -15754,7 +15754,7 @@ class zA {
|
|
|
15754
15754
|
}
|
|
15755
15755
|
}
|
|
15756
15756
|
const sQ = (C, A) => {
|
|
15757
|
-
if (
|
|
15757
|
+
if (wI(A))
|
|
15758
15758
|
return { success: !0, data: A.value };
|
|
15759
15759
|
if (!C.common.issues.length)
|
|
15760
15760
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -15811,7 +15811,7 @@ class P {
|
|
|
15811
15811
|
}
|
|
15812
15812
|
_parseSync(A) {
|
|
15813
15813
|
const I = this._parse(A);
|
|
15814
|
-
if (
|
|
15814
|
+
if (dg(I))
|
|
15815
15815
|
throw new Error("Synchronous parse encountered promise.");
|
|
15816
15816
|
return I;
|
|
15817
15817
|
}
|
|
@@ -15855,7 +15855,7 @@ class P {
|
|
|
15855
15855
|
if (!this["~standard"].async)
|
|
15856
15856
|
try {
|
|
15857
15857
|
const g = this._parseSync({ data: A, path: [], parent: I });
|
|
15858
|
-
return
|
|
15858
|
+
return wI(g) ? {
|
|
15859
15859
|
value: g.value
|
|
15860
15860
|
} : {
|
|
15861
15861
|
issues: I.common.issues
|
|
@@ -15866,7 +15866,7 @@ class P {
|
|
|
15866
15866
|
async: !0
|
|
15867
15867
|
};
|
|
15868
15868
|
}
|
|
15869
|
-
return this._parseAsync({ data: A, path: [], parent: I }).then((g) =>
|
|
15869
|
+
return this._parseAsync({ data: A, path: [], parent: I }).then((g) => wI(g) ? {
|
|
15870
15870
|
value: g.value
|
|
15871
15871
|
} : {
|
|
15872
15872
|
issues: I.common.issues
|
|
@@ -15890,7 +15890,7 @@ class P {
|
|
|
15890
15890
|
parent: null,
|
|
15891
15891
|
data: A,
|
|
15892
15892
|
parsedType: PA(A)
|
|
15893
|
-
}, B = this._parse({ data: A, path: g.path, parent: g }), Q = await (
|
|
15893
|
+
}, B = this._parse({ data: A, path: g.path, parent: g }), Q = await (dg(B) ? B : Promise.resolve(B));
|
|
15894
15894
|
return sQ(g, Q);
|
|
15895
15895
|
}
|
|
15896
15896
|
refine(A, I) {
|
|
@@ -15907,7 +15907,7 @@ class P {
|
|
|
15907
15907
|
return this._refinement((g, B) => A(g) ? !0 : (B.addIssue(typeof I == "function" ? I(g, B) : I), !1));
|
|
15908
15908
|
}
|
|
15909
15909
|
_refinement(A) {
|
|
15910
|
-
return new
|
|
15910
|
+
return new SI({
|
|
15911
15911
|
schema: this,
|
|
15912
15912
|
typeName: x.ZodEffects,
|
|
15913
15913
|
effect: { type: "refinement", refinement: A }
|
|
@@ -15927,7 +15927,7 @@ class P {
|
|
|
15927
15927
|
return jA.create(this, this._def);
|
|
15928
15928
|
}
|
|
15929
15929
|
nullable() {
|
|
15930
|
-
return
|
|
15930
|
+
return NI.create(this, this._def);
|
|
15931
15931
|
}
|
|
15932
15932
|
nullish() {
|
|
15933
15933
|
return this.nullable().optional();
|
|
@@ -15936,16 +15936,16 @@ class P {
|
|
|
15936
15936
|
return TA.create(this);
|
|
15937
15937
|
}
|
|
15938
15938
|
promise() {
|
|
15939
|
-
return
|
|
15939
|
+
return Jg.create(this, this._def);
|
|
15940
15940
|
}
|
|
15941
15941
|
or(A) {
|
|
15942
|
-
return
|
|
15942
|
+
return lg.create([this, A], this._def);
|
|
15943
15943
|
}
|
|
15944
15944
|
and(A) {
|
|
15945
|
-
return
|
|
15945
|
+
return Lg.create(this, A, this._def);
|
|
15946
15946
|
}
|
|
15947
15947
|
transform(A) {
|
|
15948
|
-
return new
|
|
15948
|
+
return new SI({
|
|
15949
15949
|
...b(this._def),
|
|
15950
15950
|
schema: this,
|
|
15951
15951
|
typeName: x.ZodEffects,
|
|
@@ -15954,7 +15954,7 @@ class P {
|
|
|
15954
15954
|
}
|
|
15955
15955
|
default(A) {
|
|
15956
15956
|
const I = typeof A == "function" ? A : () => A;
|
|
15957
|
-
return new
|
|
15957
|
+
return new SB({
|
|
15958
15958
|
...b(this._def),
|
|
15959
15959
|
innerType: this,
|
|
15960
15960
|
defaultValue: I,
|
|
@@ -15970,7 +15970,7 @@ class P {
|
|
|
15970
15970
|
}
|
|
15971
15971
|
catch(A) {
|
|
15972
15972
|
const I = typeof A == "function" ? A : () => A;
|
|
15973
|
-
return new
|
|
15973
|
+
return new NB({
|
|
15974
15974
|
...b(this._def),
|
|
15975
15975
|
innerType: this,
|
|
15976
15976
|
catchValue: I,
|
|
@@ -15988,7 +15988,7 @@ class P {
|
|
|
15988
15988
|
return CC.create(this, A);
|
|
15989
15989
|
}
|
|
15990
15990
|
readonly() {
|
|
15991
|
-
return
|
|
15991
|
+
return RB.create(this);
|
|
15992
15992
|
}
|
|
15993
15993
|
isOptional() {
|
|
15994
15994
|
return this.safeParse(void 0).success;
|
|
@@ -15998,7 +15998,7 @@ class P {
|
|
|
15998
15998
|
}
|
|
15999
15999
|
}
|
|
16000
16000
|
const ct = /^c[^\s-]{8,}$/i, wt = /^[0-9a-z]+$/, Gt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Ft = /^[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, St = /^[a-z0-9_-]{21}$/i, Nt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Rt = /^[-+]?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)?)??$/, kt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, dt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
16001
|
-
let
|
|
16001
|
+
let AB;
|
|
16002
16002
|
const Ut = /^(?:(?: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])$/, lt = /^(?:(?: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])$/, Lt = /^(([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]))$/, Jt = /^(([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])$/, Yt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Mt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, FE = "((\\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])))", ut = new RegExp(`^${FE}$`);
|
|
16003
16003
|
function SE(C) {
|
|
16004
16004
|
let A = "[0-5]\\d";
|
|
@@ -16088,7 +16088,7 @@ class VA extends P {
|
|
|
16088
16088
|
message: Q.message
|
|
16089
16089
|
}), g.dirty());
|
|
16090
16090
|
else if (Q.kind === "emoji")
|
|
16091
|
-
|
|
16091
|
+
AB || (AB = new RegExp(dt, "u")), AB.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
16092
16092
|
validation: "emoji",
|
|
16093
16093
|
code: l.invalid_string,
|
|
16094
16094
|
message: Q.message
|
|
@@ -16420,7 +16420,7 @@ function mt(C, A) {
|
|
|
16420
16420
|
const I = (C.toString().split(".")[1] || "").length, g = (A.toString().split(".")[1] || "").length, B = I > g ? I : g, Q = Number.parseInt(C.toFixed(B).replace(".", "")), E = Number.parseInt(A.toFixed(B).replace(".", ""));
|
|
16421
16421
|
return Q % E / 10 ** B;
|
|
16422
16422
|
}
|
|
16423
|
-
class
|
|
16423
|
+
class GI extends P {
|
|
16424
16424
|
constructor() {
|
|
16425
16425
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
16426
16426
|
}
|
|
@@ -16478,7 +16478,7 @@ class cI extends P {
|
|
|
16478
16478
|
return this.setLimit("max", A, !1, K.toString(I));
|
|
16479
16479
|
}
|
|
16480
16480
|
setLimit(A, I, g, B) {
|
|
16481
|
-
return new
|
|
16481
|
+
return new GI({
|
|
16482
16482
|
...this._def,
|
|
16483
16483
|
checks: [
|
|
16484
16484
|
...this._def.checks,
|
|
@@ -16492,7 +16492,7 @@ class cI extends P {
|
|
|
16492
16492
|
});
|
|
16493
16493
|
}
|
|
16494
16494
|
_addCheck(A) {
|
|
16495
|
-
return new
|
|
16495
|
+
return new GI({
|
|
16496
16496
|
...this._def,
|
|
16497
16497
|
checks: [...this._def.checks, A]
|
|
16498
16498
|
});
|
|
@@ -16586,13 +16586,13 @@ class cI extends P {
|
|
|
16586
16586
|
return Number.isFinite(I) && Number.isFinite(A);
|
|
16587
16587
|
}
|
|
16588
16588
|
}
|
|
16589
|
-
|
|
16589
|
+
GI.create = (C) => new GI({
|
|
16590
16590
|
checks: [],
|
|
16591
16591
|
typeName: x.ZodNumber,
|
|
16592
16592
|
coerce: C?.coerce || !1,
|
|
16593
16593
|
...b(C)
|
|
16594
16594
|
});
|
|
16595
|
-
class
|
|
16595
|
+
class ZI extends P {
|
|
16596
16596
|
constructor() {
|
|
16597
16597
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
16598
16598
|
}
|
|
@@ -16648,7 +16648,7 @@ class WI extends P {
|
|
|
16648
16648
|
return this.setLimit("max", A, !1, K.toString(I));
|
|
16649
16649
|
}
|
|
16650
16650
|
setLimit(A, I, g, B) {
|
|
16651
|
-
return new
|
|
16651
|
+
return new ZI({
|
|
16652
16652
|
...this._def,
|
|
16653
16653
|
checks: [
|
|
16654
16654
|
...this._def.checks,
|
|
@@ -16662,7 +16662,7 @@ class WI extends P {
|
|
|
16662
16662
|
});
|
|
16663
16663
|
}
|
|
16664
16664
|
_addCheck(A) {
|
|
16665
|
-
return new
|
|
16665
|
+
return new ZI({
|
|
16666
16666
|
...this._def,
|
|
16667
16667
|
checks: [...this._def.checks, A]
|
|
16668
16668
|
});
|
|
@@ -16719,13 +16719,13 @@ class WI extends P {
|
|
|
16719
16719
|
return A;
|
|
16720
16720
|
}
|
|
16721
16721
|
}
|
|
16722
|
-
|
|
16722
|
+
ZI.create = (C) => new ZI({
|
|
16723
16723
|
checks: [],
|
|
16724
16724
|
typeName: x.ZodBigInt,
|
|
16725
16725
|
coerce: C?.coerce ?? !1,
|
|
16726
16726
|
...b(C)
|
|
16727
16727
|
});
|
|
16728
|
-
class
|
|
16728
|
+
class cB extends P {
|
|
16729
16729
|
_parse(A) {
|
|
16730
16730
|
if (this._def.coerce && (A.data = !!A.data), this._getType(A) !== u.boolean) {
|
|
16731
16731
|
const g = this._getOrReturnCtx(A);
|
|
@@ -16738,12 +16738,12 @@ class hB extends P {
|
|
|
16738
16738
|
return LA(A.data);
|
|
16739
16739
|
}
|
|
16740
16740
|
}
|
|
16741
|
-
|
|
16741
|
+
cB.create = (C) => new cB({
|
|
16742
16742
|
typeName: x.ZodBoolean,
|
|
16743
16743
|
coerce: C?.coerce || !1,
|
|
16744
16744
|
...b(C)
|
|
16745
16745
|
});
|
|
16746
|
-
class
|
|
16746
|
+
class Ug extends P {
|
|
16747
16747
|
_parse(A) {
|
|
16748
16748
|
if (this._def.coerce && (A.data = new Date(A.data)), this._getType(A) !== u.date) {
|
|
16749
16749
|
const Q = this._getOrReturnCtx(A);
|
|
@@ -16783,7 +16783,7 @@ class kg extends P {
|
|
|
16783
16783
|
};
|
|
16784
16784
|
}
|
|
16785
16785
|
_addCheck(A) {
|
|
16786
|
-
return new
|
|
16786
|
+
return new Ug({
|
|
16787
16787
|
...this._def,
|
|
16788
16788
|
checks: [...this._def.checks, A]
|
|
16789
16789
|
});
|
|
@@ -16815,7 +16815,7 @@ class kg extends P {
|
|
|
16815
16815
|
return A != null ? new Date(A) : null;
|
|
16816
16816
|
}
|
|
16817
16817
|
}
|
|
16818
|
-
|
|
16818
|
+
Ug.create = (C) => new Ug({
|
|
16819
16819
|
checks: [],
|
|
16820
16820
|
coerce: C?.coerce || !1,
|
|
16821
16821
|
typeName: x.ZodDate,
|
|
@@ -16872,7 +16872,7 @@ aQ.create = (C) => new aQ({
|
|
|
16872
16872
|
typeName: x.ZodNull,
|
|
16873
16873
|
...b(C)
|
|
16874
16874
|
});
|
|
16875
|
-
class
|
|
16875
|
+
class wB extends P {
|
|
16876
16876
|
constructor() {
|
|
16877
16877
|
super(...arguments), this._any = !0;
|
|
16878
16878
|
}
|
|
@@ -16880,7 +16880,7 @@ class yB extends P {
|
|
|
16880
16880
|
return LA(A.data);
|
|
16881
16881
|
}
|
|
16882
16882
|
}
|
|
16883
|
-
|
|
16883
|
+
wB.create = (C) => new wB({
|
|
16884
16884
|
typeName: x.ZodAny,
|
|
16885
16885
|
...b(C)
|
|
16886
16886
|
});
|
|
@@ -17014,7 +17014,7 @@ function tI(C) {
|
|
|
17014
17014
|
} else return C instanceof TA ? new TA({
|
|
17015
17015
|
...C._def,
|
|
17016
17016
|
type: tI(C.element)
|
|
17017
|
-
}) : C instanceof jA ? jA.create(tI(C.unwrap())) : C instanceof
|
|
17017
|
+
}) : C instanceof jA ? jA.create(tI(C.unwrap())) : C instanceof NI ? NI.create(tI(C.unwrap())) : C instanceof iI ? iI.create(C.items.map((A) => tI(A))) : C;
|
|
17018
17018
|
}
|
|
17019
17019
|
class nA extends P {
|
|
17020
17020
|
constructor() {
|
|
@@ -17303,7 +17303,7 @@ nA.lazycreate = (C, A) => new nA({
|
|
|
17303
17303
|
typeName: x.ZodObject,
|
|
17304
17304
|
...b(A)
|
|
17305
17305
|
});
|
|
17306
|
-
class
|
|
17306
|
+
class lg extends P {
|
|
17307
17307
|
_parse(A) {
|
|
17308
17308
|
const { ctx: I } = this._processInputParams(A), g = this._def.options;
|
|
17309
17309
|
function B(Q) {
|
|
@@ -17371,19 +17371,19 @@ class dg extends P {
|
|
|
17371
17371
|
return this._def.options;
|
|
17372
17372
|
}
|
|
17373
17373
|
}
|
|
17374
|
-
|
|
17374
|
+
lg.create = (C, A) => new lg({
|
|
17375
17375
|
options: C,
|
|
17376
17376
|
typeName: x.ZodUnion,
|
|
17377
17377
|
...b(A)
|
|
17378
17378
|
});
|
|
17379
|
-
function
|
|
17379
|
+
function GB(C, A) {
|
|
17380
17380
|
const I = PA(C), g = PA(A);
|
|
17381
17381
|
if (C === A)
|
|
17382
17382
|
return { valid: !0, data: C };
|
|
17383
17383
|
if (I === u.object && g === u.object) {
|
|
17384
17384
|
const B = O.objectKeys(A), Q = O.objectKeys(C).filter((i) => B.indexOf(i) !== -1), E = { ...C, ...A };
|
|
17385
17385
|
for (const i of Q) {
|
|
17386
|
-
const o =
|
|
17386
|
+
const o = GB(C[i], A[i]);
|
|
17387
17387
|
if (!o.valid)
|
|
17388
17388
|
return { valid: !1 };
|
|
17389
17389
|
E[i] = o.data;
|
|
@@ -17394,7 +17394,7 @@ function cB(C, A) {
|
|
|
17394
17394
|
return { valid: !1 };
|
|
17395
17395
|
const B = [];
|
|
17396
17396
|
for (let Q = 0; Q < C.length; Q++) {
|
|
17397
|
-
const E = C[Q], i = A[Q], o =
|
|
17397
|
+
const E = C[Q], i = A[Q], o = GB(E, i);
|
|
17398
17398
|
if (!o.valid)
|
|
17399
17399
|
return { valid: !1 };
|
|
17400
17400
|
B.push(o.data);
|
|
@@ -17402,12 +17402,12 @@ function cB(C, A) {
|
|
|
17402
17402
|
return { valid: !0, data: B };
|
|
17403
17403
|
} else return I === u.date && g === u.date && +C == +A ? { valid: !0, data: C } : { valid: !1 };
|
|
17404
17404
|
}
|
|
17405
|
-
class
|
|
17405
|
+
class Lg extends P {
|
|
17406
17406
|
_parse(A) {
|
|
17407
17407
|
const { status: I, ctx: g } = this._processInputParams(A), B = (Q, E) => {
|
|
17408
17408
|
if (iQ(Q) || iQ(E))
|
|
17409
17409
|
return m;
|
|
17410
|
-
const i =
|
|
17410
|
+
const i = GB(Q.value, E.value);
|
|
17411
17411
|
return i.valid ? ((oQ(Q) || oQ(E)) && I.dirty(), { status: I.value, value: i.data }) : (Y(g, {
|
|
17412
17412
|
code: l.invalid_intersection_types
|
|
17413
17413
|
}), m);
|
|
@@ -17434,7 +17434,7 @@ class Ug extends P {
|
|
|
17434
17434
|
}));
|
|
17435
17435
|
}
|
|
17436
17436
|
}
|
|
17437
|
-
|
|
17437
|
+
Lg.create = (C, A, I) => new Lg({
|
|
17438
17438
|
left: C,
|
|
17439
17439
|
right: A,
|
|
17440
17440
|
typeName: x.ZodIntersection,
|
|
@@ -17538,7 +17538,7 @@ DQ.create = (C, A, I) => new DQ({
|
|
|
17538
17538
|
typeName: x.ZodMap,
|
|
17539
17539
|
...b(I)
|
|
17540
17540
|
});
|
|
17541
|
-
class
|
|
17541
|
+
class PI extends P {
|
|
17542
17542
|
_parse(A) {
|
|
17543
17543
|
const { status: I, ctx: g } = this._processInputParams(A);
|
|
17544
17544
|
if (g.parsedType !== u.set)
|
|
@@ -17577,13 +17577,13 @@ class vI extends P {
|
|
|
17577
17577
|
return g.common.async ? Promise.all(i).then((o) => E(o)) : E(i);
|
|
17578
17578
|
}
|
|
17579
17579
|
min(A, I) {
|
|
17580
|
-
return new
|
|
17580
|
+
return new PI({
|
|
17581
17581
|
...this._def,
|
|
17582
17582
|
minSize: { value: A, message: K.toString(I) }
|
|
17583
17583
|
});
|
|
17584
17584
|
}
|
|
17585
17585
|
max(A, I) {
|
|
17586
|
-
return new
|
|
17586
|
+
return new PI({
|
|
17587
17587
|
...this._def,
|
|
17588
17588
|
maxSize: { value: A, message: K.toString(I) }
|
|
17589
17589
|
});
|
|
@@ -17595,7 +17595,7 @@ class vI extends P {
|
|
|
17595
17595
|
return this.min(1, A);
|
|
17596
17596
|
}
|
|
17597
17597
|
}
|
|
17598
|
-
|
|
17598
|
+
PI.create = (C, A) => new PI({
|
|
17599
17599
|
valueType: C,
|
|
17600
17600
|
minSize: null,
|
|
17601
17601
|
maxSize: null,
|
|
@@ -17616,7 +17616,7 @@ hQ.create = (C, A) => new hQ({
|
|
|
17616
17616
|
typeName: x.ZodLazy,
|
|
17617
17617
|
...b(A)
|
|
17618
17618
|
});
|
|
17619
|
-
class
|
|
17619
|
+
class FB extends P {
|
|
17620
17620
|
_parse(A) {
|
|
17621
17621
|
if (A.data !== this._def.value) {
|
|
17622
17622
|
const I = this._getOrReturnCtx(A);
|
|
@@ -17632,19 +17632,19 @@ class wB extends P {
|
|
|
17632
17632
|
return this._def.value;
|
|
17633
17633
|
}
|
|
17634
17634
|
}
|
|
17635
|
-
|
|
17635
|
+
FB.create = (C, A) => new FB({
|
|
17636
17636
|
value: C,
|
|
17637
17637
|
typeName: x.ZodLiteral,
|
|
17638
17638
|
...b(A)
|
|
17639
17639
|
});
|
|
17640
17640
|
function NE(C, A) {
|
|
17641
|
-
return new
|
|
17641
|
+
return new FI({
|
|
17642
17642
|
values: C,
|
|
17643
17643
|
typeName: x.ZodEnum,
|
|
17644
17644
|
...b(A)
|
|
17645
17645
|
});
|
|
17646
17646
|
}
|
|
17647
|
-
class
|
|
17647
|
+
class FI extends P {
|
|
17648
17648
|
_parse(A) {
|
|
17649
17649
|
if (typeof A.data != "string") {
|
|
17650
17650
|
const I = this._getOrReturnCtx(A), g = this._def.values;
|
|
@@ -17686,19 +17686,19 @@ class wI extends P {
|
|
|
17686
17686
|
return A;
|
|
17687
17687
|
}
|
|
17688
17688
|
extract(A, I = this._def) {
|
|
17689
|
-
return
|
|
17689
|
+
return FI.create(A, {
|
|
17690
17690
|
...this._def,
|
|
17691
17691
|
...I
|
|
17692
17692
|
});
|
|
17693
17693
|
}
|
|
17694
17694
|
exclude(A, I = this._def) {
|
|
17695
|
-
return
|
|
17695
|
+
return FI.create(this.options.filter((g) => !A.includes(g)), {
|
|
17696
17696
|
...this._def,
|
|
17697
17697
|
...I
|
|
17698
17698
|
});
|
|
17699
17699
|
}
|
|
17700
17700
|
}
|
|
17701
|
-
|
|
17701
|
+
FI.create = NE;
|
|
17702
17702
|
class yQ extends P {
|
|
17703
17703
|
_parse(A) {
|
|
17704
17704
|
const I = O.getValidEnumValues(this._def.values), g = this._getOrReturnCtx(A);
|
|
@@ -17729,7 +17729,7 @@ yQ.create = (C, A) => new yQ({
|
|
|
17729
17729
|
typeName: x.ZodNativeEnum,
|
|
17730
17730
|
...b(A)
|
|
17731
17731
|
});
|
|
17732
|
-
class
|
|
17732
|
+
class Jg extends P {
|
|
17733
17733
|
unwrap() {
|
|
17734
17734
|
return this._def.type;
|
|
17735
17735
|
}
|
|
@@ -17748,12 +17748,12 @@ class lg extends P {
|
|
|
17748
17748
|
})));
|
|
17749
17749
|
}
|
|
17750
17750
|
}
|
|
17751
|
-
|
|
17751
|
+
Jg.create = (C, A) => new Jg({
|
|
17752
17752
|
type: C,
|
|
17753
17753
|
typeName: x.ZodPromise,
|
|
17754
17754
|
...b(A)
|
|
17755
17755
|
});
|
|
17756
|
-
class
|
|
17756
|
+
class SI extends P {
|
|
17757
17757
|
innerType() {
|
|
17758
17758
|
return this._def.schema;
|
|
17759
17759
|
}
|
|
@@ -17780,7 +17780,7 @@ class GI extends P {
|
|
|
17780
17780
|
path: g.path,
|
|
17781
17781
|
parent: g
|
|
17782
17782
|
});
|
|
17783
|
-
return o.status === "aborted" ? m : o.status === "dirty" || I.value === "dirty" ?
|
|
17783
|
+
return o.status === "aborted" ? m : o.status === "dirty" || I.value === "dirty" ? HI(o.value) : o;
|
|
17784
17784
|
});
|
|
17785
17785
|
{
|
|
17786
17786
|
if (I.value === "aborted")
|
|
@@ -17790,7 +17790,7 @@ class GI extends P {
|
|
|
17790
17790
|
path: g.path,
|
|
17791
17791
|
parent: g
|
|
17792
17792
|
});
|
|
17793
|
-
return i.status === "aborted" ? m : i.status === "dirty" || I.value === "dirty" ?
|
|
17793
|
+
return i.status === "aborted" ? m : i.status === "dirty" || I.value === "dirty" ? HI(i.value) : i;
|
|
17794
17794
|
}
|
|
17795
17795
|
}
|
|
17796
17796
|
if (B.type === "refinement") {
|
|
@@ -17819,27 +17819,27 @@ class GI extends P {
|
|
|
17819
17819
|
path: g.path,
|
|
17820
17820
|
parent: g
|
|
17821
17821
|
});
|
|
17822
|
-
if (!
|
|
17822
|
+
if (!wI(E))
|
|
17823
17823
|
return m;
|
|
17824
17824
|
const i = B.transform(E.value, Q);
|
|
17825
17825
|
if (i instanceof Promise)
|
|
17826
17826
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
17827
17827
|
return { status: I.value, value: i };
|
|
17828
17828
|
} else
|
|
17829
|
-
return this._def.schema._parseAsync({ data: g.data, path: g.path, parent: g }).then((E) =>
|
|
17829
|
+
return this._def.schema._parseAsync({ data: g.data, path: g.path, parent: g }).then((E) => wI(E) ? Promise.resolve(B.transform(E.value, Q)).then((i) => ({
|
|
17830
17830
|
status: I.value,
|
|
17831
17831
|
value: i
|
|
17832
17832
|
})) : m);
|
|
17833
17833
|
O.assertNever(B);
|
|
17834
17834
|
}
|
|
17835
17835
|
}
|
|
17836
|
-
|
|
17836
|
+
SI.create = (C, A, I) => new SI({
|
|
17837
17837
|
schema: C,
|
|
17838
17838
|
typeName: x.ZodEffects,
|
|
17839
17839
|
effect: A,
|
|
17840
17840
|
...b(I)
|
|
17841
17841
|
});
|
|
17842
|
-
|
|
17842
|
+
SI.createWithPreprocess = (C, A, I) => new SI({
|
|
17843
17843
|
schema: A,
|
|
17844
17844
|
effect: { type: "preprocess", transform: C },
|
|
17845
17845
|
typeName: x.ZodEffects,
|
|
@@ -17858,7 +17858,7 @@ jA.create = (C, A) => new jA({
|
|
|
17858
17858
|
typeName: x.ZodOptional,
|
|
17859
17859
|
...b(A)
|
|
17860
17860
|
});
|
|
17861
|
-
class
|
|
17861
|
+
class NI extends P {
|
|
17862
17862
|
_parse(A) {
|
|
17863
17863
|
return this._getType(A) === u.null ? LA(null) : this._def.innerType._parse(A);
|
|
17864
17864
|
}
|
|
@@ -17866,12 +17866,12 @@ class FI extends P {
|
|
|
17866
17866
|
return this._def.innerType;
|
|
17867
17867
|
}
|
|
17868
17868
|
}
|
|
17869
|
-
|
|
17869
|
+
NI.create = (C, A) => new NI({
|
|
17870
17870
|
innerType: C,
|
|
17871
17871
|
typeName: x.ZodNullable,
|
|
17872
17872
|
...b(A)
|
|
17873
17873
|
});
|
|
17874
|
-
class
|
|
17874
|
+
class SB extends P {
|
|
17875
17875
|
_parse(A) {
|
|
17876
17876
|
const { ctx: I } = this._processInputParams(A);
|
|
17877
17877
|
let g = I.data;
|
|
@@ -17885,13 +17885,13 @@ class GB extends P {
|
|
|
17885
17885
|
return this._def.innerType;
|
|
17886
17886
|
}
|
|
17887
17887
|
}
|
|
17888
|
-
|
|
17888
|
+
SB.create = (C, A) => new SB({
|
|
17889
17889
|
innerType: C,
|
|
17890
17890
|
typeName: x.ZodDefault,
|
|
17891
17891
|
defaultValue: typeof A.default == "function" ? A.default : () => A.default,
|
|
17892
17892
|
...b(A)
|
|
17893
17893
|
});
|
|
17894
|
-
class
|
|
17894
|
+
class NB extends P {
|
|
17895
17895
|
_parse(A) {
|
|
17896
17896
|
const { ctx: I } = this._processInputParams(A), g = {
|
|
17897
17897
|
...I,
|
|
@@ -17906,7 +17906,7 @@ class FB extends P {
|
|
|
17906
17906
|
...g
|
|
17907
17907
|
}
|
|
17908
17908
|
});
|
|
17909
|
-
return
|
|
17909
|
+
return dg(B) ? B.then((Q) => ({
|
|
17910
17910
|
status: "valid",
|
|
17911
17911
|
value: Q.status === "valid" ? Q.value : this._def.catchValue({
|
|
17912
17912
|
get error() {
|
|
@@ -17928,7 +17928,7 @@ class FB extends P {
|
|
|
17928
17928
|
return this._def.innerType;
|
|
17929
17929
|
}
|
|
17930
17930
|
}
|
|
17931
|
-
|
|
17931
|
+
NB.create = (C, A) => new NB({
|
|
17932
17932
|
innerType: C,
|
|
17933
17933
|
typeName: x.ZodCatch,
|
|
17934
17934
|
catchValue: typeof A.catch == "function" ? A.catch : () => A.catch,
|
|
@@ -17974,7 +17974,7 @@ class CC extends P {
|
|
|
17974
17974
|
path: g.path,
|
|
17975
17975
|
parent: g
|
|
17976
17976
|
});
|
|
17977
|
-
return Q.status === "aborted" ? m : Q.status === "dirty" ? (I.dirty(),
|
|
17977
|
+
return Q.status === "aborted" ? m : Q.status === "dirty" ? (I.dirty(), HI(Q.value)) : this._def.out._parseAsync({
|
|
17978
17978
|
data: Q.value,
|
|
17979
17979
|
path: g.path,
|
|
17980
17980
|
parent: g
|
|
@@ -18004,16 +18004,16 @@ class CC extends P {
|
|
|
18004
18004
|
});
|
|
18005
18005
|
}
|
|
18006
18006
|
}
|
|
18007
|
-
class
|
|
18007
|
+
class RB extends P {
|
|
18008
18008
|
_parse(A) {
|
|
18009
|
-
const I = this._def.innerType._parse(A), g = (B) => (
|
|
18010
|
-
return
|
|
18009
|
+
const I = this._def.innerType._parse(A), g = (B) => (wI(B) && (B.value = Object.freeze(B.value)), B);
|
|
18010
|
+
return dg(I) ? I.then((B) => g(B)) : g(I);
|
|
18011
18011
|
}
|
|
18012
18012
|
unwrap() {
|
|
18013
18013
|
return this._def.innerType;
|
|
18014
18014
|
}
|
|
18015
18015
|
}
|
|
18016
|
-
|
|
18016
|
+
RB.create = (C, A) => new RB({
|
|
18017
18017
|
innerType: C,
|
|
18018
18018
|
typeName: x.ZodReadonly,
|
|
18019
18019
|
...b(A)
|
|
@@ -18022,16 +18022,16 @@ var x;
|
|
|
18022
18022
|
(function(C) {
|
|
18023
18023
|
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";
|
|
18024
18024
|
})(x || (x = {}));
|
|
18025
|
-
const $ = VA.create, W =
|
|
18025
|
+
const $ = VA.create, W = GI.create, RE = cB.create, _A = wB.create;
|
|
18026
18026
|
$A.create;
|
|
18027
18027
|
const z = TA.create, q = nA.create;
|
|
18028
|
-
dg.create;
|
|
18029
|
-
Ug.create;
|
|
18030
|
-
iI.create;
|
|
18031
|
-
const cA = wB.create, nI = wI.create;
|
|
18032
18028
|
lg.create;
|
|
18029
|
+
Lg.create;
|
|
18030
|
+
iI.create;
|
|
18031
|
+
const cA = FB.create, nI = FI.create;
|
|
18032
|
+
Jg.create;
|
|
18033
18033
|
jA.create;
|
|
18034
|
-
|
|
18034
|
+
NI.create;
|
|
18035
18035
|
const Tt = q({
|
|
18036
18036
|
/**The multiscale datasets for this image*/
|
|
18037
18037
|
multiscales: z(
|
|
@@ -18455,7 +18455,7 @@ function QC(C) {
|
|
|
18455
18455
|
const A = _t(C);
|
|
18456
18456
|
return A === void 0 ? "0.4" : A;
|
|
18457
18457
|
}
|
|
18458
|
-
function
|
|
18458
|
+
function RI(C) {
|
|
18459
18459
|
if (C !== void 0)
|
|
18460
18460
|
switch (C) {
|
|
18461
18461
|
case "0.4":
|
|
@@ -18469,7 +18469,7 @@ function kE(C, A) {
|
|
|
18469
18469
|
return delete I[A], I;
|
|
18470
18470
|
}
|
|
18471
18471
|
async function xe(C, A) {
|
|
18472
|
-
const I = new
|
|
18472
|
+
const I = new _I(C), g = new UA(I), B = RI(A), Q = await $I(g, B);
|
|
18473
18473
|
try {
|
|
18474
18474
|
return Xt(Q.attrs);
|
|
18475
18475
|
} catch {
|
|
@@ -18528,7 +18528,7 @@ function $t(C) {
|
|
|
18528
18528
|
}
|
|
18529
18529
|
}
|
|
18530
18530
|
async function Te(C, A, I) {
|
|
18531
|
-
const g = C + "/" + A, B = new
|
|
18531
|
+
const g = C + "/" + A, B = new _I(g), Q = new UA(B), E = RI(I), i = await $I(Q, E);
|
|
18532
18532
|
try {
|
|
18533
18533
|
return $t(i.attrs);
|
|
18534
18534
|
} catch {
|
|
@@ -18539,11 +18539,11 @@ ${JSON.stringify(i.attrs)}`
|
|
|
18539
18539
|
}
|
|
18540
18540
|
}
|
|
18541
18541
|
async function be(C) {
|
|
18542
|
-
const A =
|
|
18542
|
+
const A = RI(C.version), I = await $I(C.location, A);
|
|
18543
18543
|
return EC(I.attrs).omero?.channels ?? [];
|
|
18544
18544
|
}
|
|
18545
18545
|
async function We(C) {
|
|
18546
|
-
const A =
|
|
18546
|
+
const A = RI(C.version), I = await $I(C.location, A);
|
|
18547
18547
|
return EC(I.attrs).omero?.rdefs;
|
|
18548
18548
|
}
|
|
18549
18549
|
function Ae(C) {
|
|
@@ -18577,7 +18577,7 @@ function EC(C) {
|
|
|
18577
18577
|
${JSON.stringify(C)}`);
|
|
18578
18578
|
}
|
|
18579
18579
|
}
|
|
18580
|
-
class
|
|
18580
|
+
class qI {
|
|
18581
18581
|
location;
|
|
18582
18582
|
version;
|
|
18583
18583
|
loader_;
|
|
@@ -18585,8 +18585,8 @@ class KI {
|
|
|
18585
18585
|
this.location = A.location, this.version = A.version, this.loader_ = A.loader;
|
|
18586
18586
|
}
|
|
18587
18587
|
static async openLoader(A, I) {
|
|
18588
|
-
let g =
|
|
18589
|
-
const B = await
|
|
18588
|
+
let g = RI(I);
|
|
18589
|
+
const B = await $I(A, g), Q = EC(B.attrs), E = Q.multiscales;
|
|
18590
18590
|
if (E.length !== 1)
|
|
18591
18591
|
throw new Error(
|
|
18592
18592
|
`Exactly one multiscale image is supported. Found ${E.length} images.`
|
|
@@ -18594,7 +18594,7 @@ class KI {
|
|
|
18594
18594
|
const i = E[0];
|
|
18595
18595
|
if (i.datasets.length === 0)
|
|
18596
18596
|
throw new Error("No datasets found in the multiscale image.");
|
|
18597
|
-
g || (g =
|
|
18597
|
+
g || (g = RI(Q.originalVersion));
|
|
18598
18598
|
const o = i.datasets.map(
|
|
18599
18599
|
(n) => zs(A, n.path, g)
|
|
18600
18600
|
), s = await Promise.all(
|
|
@@ -18622,8 +18622,8 @@ class KI {
|
|
|
18622
18622
|
* @param props.version OME-Zarr version
|
|
18623
18623
|
*/
|
|
18624
18624
|
static async fromHttp(A) {
|
|
18625
|
-
const I = new UA(new
|
|
18626
|
-
return new
|
|
18625
|
+
const I = new UA(new _I(A.url)), g = await qI.openLoader(I, A.version);
|
|
18626
|
+
return new qI({ location: I, version: A.version, loader: g });
|
|
18627
18627
|
}
|
|
18628
18628
|
/**
|
|
18629
18629
|
* Creates and opens an OmeZarrImageSource from a local filesystem directory.
|
|
@@ -18638,11 +18638,11 @@ class KI {
|
|
|
18638
18638
|
const I = new UA(
|
|
18639
18639
|
new BC(A.directory),
|
|
18640
18640
|
A.path
|
|
18641
|
-
), g = await
|
|
18642
|
-
return new
|
|
18641
|
+
), g = await qI.openLoader(I, A.version);
|
|
18642
|
+
return new qI({ location: I, version: A.version, loader: g });
|
|
18643
18643
|
}
|
|
18644
18644
|
}
|
|
18645
|
-
class
|
|
18645
|
+
class pg {
|
|
18646
18646
|
objects_ = [];
|
|
18647
18647
|
state_ = "initialized";
|
|
18648
18648
|
attached_ = !1;
|
|
@@ -18717,7 +18717,7 @@ class Hg {
|
|
|
18717
18717
|
return {};
|
|
18718
18718
|
}
|
|
18719
18719
|
}
|
|
18720
|
-
class ge extends
|
|
18720
|
+
class ge extends kI {
|
|
18721
18721
|
// this creates the geometry for a screen-space projected line
|
|
18722
18722
|
// each point on the input path is split into two vertices
|
|
18723
18723
|
// these are pushed in opposite directions in screen-space to create width
|
|
@@ -18745,7 +18745,7 @@ class ge extends NI {
|
|
|
18745
18745
|
});
|
|
18746
18746
|
}
|
|
18747
18747
|
createVertices(A) {
|
|
18748
|
-
const I = new Float32Array(2 * A.length * 10), g = A.length >= 3 &&
|
|
18748
|
+
const I = new Float32Array(2 * A.length * 10), g = A.length >= 3 && JB(A[0], A[A.length - 1]);
|
|
18749
18749
|
let B = 0;
|
|
18750
18750
|
for (const Q of [...Array(A.length).keys()])
|
|
18751
18751
|
for (const E of [-1, 1]) {
|
|
@@ -18766,7 +18766,7 @@ class ge extends NI {
|
|
|
18766
18766
|
return I;
|
|
18767
18767
|
}
|
|
18768
18768
|
}
|
|
18769
|
-
class Be extends
|
|
18769
|
+
class Be extends kI {
|
|
18770
18770
|
constructor(A) {
|
|
18771
18771
|
if (super(), A.primitive != "triangles") {
|
|
18772
18772
|
H.warn("WireframeGeometry", "Only indexed geometries are supported");
|
|
@@ -18795,7 +18795,7 @@ const Ce = j(0, 1, 0);
|
|
|
18795
18795
|
class Qe {
|
|
18796
18796
|
dirty_ = !0;
|
|
18797
18797
|
matrix_ = GA();
|
|
18798
|
-
rotation_ =
|
|
18798
|
+
rotation_ = eg();
|
|
18799
18799
|
translation_ = T();
|
|
18800
18800
|
scale_ = j(1, 1, 1);
|
|
18801
18801
|
addRotation(A) {
|
|
@@ -18811,7 +18811,7 @@ class Qe {
|
|
|
18811
18811
|
rI(this.translation_, this.translation_, A), this.dirty_ = !0;
|
|
18812
18812
|
}
|
|
18813
18813
|
setTranslation(A) {
|
|
18814
|
-
|
|
18814
|
+
QB(this.translation_, A), this.dirty_ = !0;
|
|
18815
18815
|
}
|
|
18816
18816
|
get translation() {
|
|
18817
18817
|
return xA(this.translation_);
|
|
@@ -18820,12 +18820,12 @@ class Qe {
|
|
|
18820
18820
|
oi(this.scale_, this.scale_, A), this.dirty_ = !0;
|
|
18821
18821
|
}
|
|
18822
18822
|
setScale(A) {
|
|
18823
|
-
|
|
18823
|
+
QB(this.scale_, A), this.dirty_ = !0;
|
|
18824
18824
|
}
|
|
18825
18825
|
targetTo(A) {
|
|
18826
|
-
|
|
18826
|
+
JB(this.translation_, A) && (A = xA(A), A[2] += IA);
|
|
18827
18827
|
const I = Ei(GA(), this.translation_, A, Ce), g = jE(JQ(), I);
|
|
18828
|
-
|
|
18828
|
+
YB(this.rotation_, g), ug(this.rotation_, this.rotation_), this.dirty_ = !0;
|
|
18829
18829
|
}
|
|
18830
18830
|
get scale() {
|
|
18831
18831
|
return xA(this.scale_);
|
|
@@ -18834,7 +18834,7 @@ class Qe {
|
|
|
18834
18834
|
return this.dirty_ && (this.computeMatrix(), this.dirty_ = !1), this.matrix_;
|
|
18835
18835
|
}
|
|
18836
18836
|
get inverse() {
|
|
18837
|
-
return
|
|
18837
|
+
return Mg(GA(), this.matrix);
|
|
18838
18838
|
}
|
|
18839
18839
|
computeMatrix() {
|
|
18840
18840
|
Ii(
|
|
@@ -18845,14 +18845,14 @@ class Qe {
|
|
|
18845
18845
|
);
|
|
18846
18846
|
}
|
|
18847
18847
|
}
|
|
18848
|
-
class
|
|
18848
|
+
class LI extends dB {
|
|
18849
18849
|
wireframeEnabled = !1;
|
|
18850
18850
|
wireframeColor = X.WHITE;
|
|
18851
18851
|
depthTest = !0;
|
|
18852
18852
|
textures_ = [];
|
|
18853
18853
|
staleTextures_ = [];
|
|
18854
18854
|
transform_ = new Qe();
|
|
18855
|
-
geometry_ = new
|
|
18855
|
+
geometry_ = new kI();
|
|
18856
18856
|
wireframeGeometry_ = null;
|
|
18857
18857
|
programName_ = null;
|
|
18858
18858
|
cullFaceMode_ = "none";
|
|
@@ -18908,7 +18908,7 @@ class UI extends RB {
|
|
|
18908
18908
|
return {};
|
|
18909
18909
|
}
|
|
18910
18910
|
}
|
|
18911
|
-
class Ee extends
|
|
18911
|
+
class Ee extends LI {
|
|
18912
18912
|
color_;
|
|
18913
18913
|
width_;
|
|
18914
18914
|
constructor({ geometry: A, color: I, width: g }) {
|
|
@@ -18936,25 +18936,25 @@ class Ee extends UI {
|
|
|
18936
18936
|
};
|
|
18937
18937
|
}
|
|
18938
18938
|
}
|
|
18939
|
-
class ve extends
|
|
18939
|
+
class ve extends pg {
|
|
18940
18940
|
type = "AxesLayer";
|
|
18941
18941
|
constructor(A) {
|
|
18942
18942
|
super();
|
|
18943
18943
|
const { length: I, width: g } = A;
|
|
18944
18944
|
this.addObject(
|
|
18945
|
-
|
|
18945
|
+
IB({
|
|
18946
18946
|
end: [I, 0, 0],
|
|
18947
18947
|
width: g,
|
|
18948
18948
|
color: [1, 0, 0]
|
|
18949
18949
|
})
|
|
18950
18950
|
), this.addObject(
|
|
18951
|
-
|
|
18951
|
+
IB({
|
|
18952
18952
|
end: [0, I, 0],
|
|
18953
18953
|
width: g,
|
|
18954
18954
|
color: [0, 1, 0]
|
|
18955
18955
|
})
|
|
18956
18956
|
), this.addObject(
|
|
18957
|
-
|
|
18957
|
+
IB({
|
|
18958
18958
|
end: [0, 0, I],
|
|
18959
18959
|
width: g,
|
|
18960
18960
|
color: [0, 0, 1]
|
|
@@ -18964,7 +18964,7 @@ class ve extends Hg {
|
|
|
18964
18964
|
update() {
|
|
18965
18965
|
}
|
|
18966
18966
|
}
|
|
18967
|
-
function
|
|
18967
|
+
function IB(C) {
|
|
18968
18968
|
const { end: A, width: I, color: g } = C, B = new ge([[0, 0, 0], A]);
|
|
18969
18969
|
return new Ee({
|
|
18970
18970
|
geometry: B,
|
|
@@ -18973,7 +18973,7 @@ function $g(C) {
|
|
|
18973
18973
|
});
|
|
18974
18974
|
}
|
|
18975
18975
|
const wQ = 32;
|
|
18976
|
-
function
|
|
18976
|
+
function OI(C, { visible: A, color: I, contrastLimits: g, opacity: B }) {
|
|
18977
18977
|
return A ??= !0, I = I === void 0 ? X.WHITE : X.from(I), B = B === void 0 ? 1 : vA(B, 0, 1), C !== null ? g = ie(g, C) : g === void 0 && (H.debug(
|
|
18978
18978
|
"Channel",
|
|
18979
18979
|
"No texture provided, defaulting channel contrast limits to [0, 1]."
|
|
@@ -18984,10 +18984,10 @@ function ZI(C, { visible: A, color: I, contrastLimits: g, opacity: B }) {
|
|
|
18984
18984
|
opacity: B
|
|
18985
18985
|
};
|
|
18986
18986
|
}
|
|
18987
|
-
function
|
|
18987
|
+
function kB(C, A) {
|
|
18988
18988
|
if (A.length > wQ)
|
|
18989
18989
|
throw new Error(`Maximum number of channels is ${wQ}`);
|
|
18990
|
-
return A.map((I) =>
|
|
18990
|
+
return A.map((I) => OI(C, I));
|
|
18991
18991
|
}
|
|
18992
18992
|
function dE(C, A) {
|
|
18993
18993
|
if (C && C.length !== A)
|
|
@@ -19004,7 +19004,7 @@ function ie(C, A) {
|
|
|
19004
19004
|
);
|
|
19005
19005
|
return C;
|
|
19006
19006
|
}
|
|
19007
|
-
class UE extends
|
|
19007
|
+
class UE extends kI {
|
|
19008
19008
|
constructor(A, I, g, B) {
|
|
19009
19009
|
super();
|
|
19010
19010
|
const Q = [], E = [], i = g, o = B, s = i + 1, t = o + 1, e = A / i, n = I / o;
|
|
@@ -19035,20 +19035,20 @@ class UE extends NI {
|
|
|
19035
19035
|
});
|
|
19036
19036
|
}
|
|
19037
19037
|
}
|
|
19038
|
-
class oe extends
|
|
19038
|
+
class oe extends LI {
|
|
19039
19039
|
channels_;
|
|
19040
19040
|
worldToTexCoord = GA();
|
|
19041
19041
|
constructor(A, I, g, B = []) {
|
|
19042
|
-
super(), this.geometry = new UE(A, I, 1, 1), this.setTexture(0, g), this.channels_ =
|
|
19042
|
+
super(), this.geometry = new UE(A, I, 1, 1), this.setTexture(0, g), this.channels_ = kB(g, B), this.programName = se(g);
|
|
19043
19043
|
}
|
|
19044
19044
|
get type() {
|
|
19045
19045
|
return "ImageRenderable";
|
|
19046
19046
|
}
|
|
19047
19047
|
setChannelProps(A) {
|
|
19048
|
-
this.channels_ =
|
|
19048
|
+
this.channels_ = kB(this.textures[0], A);
|
|
19049
19049
|
}
|
|
19050
19050
|
setChannelProperty(A, I, g) {
|
|
19051
|
-
const B =
|
|
19051
|
+
const B = OI(this.textures[0], {
|
|
19052
19052
|
...this.channels_[A],
|
|
19053
19053
|
[I]: g
|
|
19054
19054
|
});
|
|
@@ -19058,7 +19058,7 @@ class oe extends UI {
|
|
|
19058
19058
|
const A = this.textures[0];
|
|
19059
19059
|
if (!A)
|
|
19060
19060
|
throw new Error("No texture set");
|
|
19061
|
-
const { color: I, contrastLimits: g, opacity: B } = this.channels_[0] ??
|
|
19061
|
+
const { color: I, contrastLimits: g, opacity: B } = this.channels_[0] ?? OI(A, {});
|
|
19062
19062
|
return {
|
|
19063
19063
|
u_imageSampler: 0,
|
|
19064
19064
|
u_color: I.rgb,
|
|
@@ -19090,19 +19090,19 @@ class pA {
|
|
|
19090
19090
|
this.normal = xA(A), this.signedDistance = I;
|
|
19091
19091
|
}
|
|
19092
19092
|
static fromPointAndNormal(A, I) {
|
|
19093
|
-
return new pA(I, -
|
|
19093
|
+
return new pA(I, -sg(I, A));
|
|
19094
19094
|
}
|
|
19095
19095
|
set(A, I) {
|
|
19096
19096
|
this.normal = xA(A), this.signedDistance = I;
|
|
19097
19097
|
}
|
|
19098
19098
|
signedDistanceToPoint(A) {
|
|
19099
|
-
return
|
|
19099
|
+
return sg(this.normal, A) + this.signedDistance;
|
|
19100
19100
|
}
|
|
19101
19101
|
normalize() {
|
|
19102
|
-
const A =
|
|
19102
|
+
const A = UB(this.normal);
|
|
19103
19103
|
if (A > 0) {
|
|
19104
19104
|
const I = 1 / A;
|
|
19105
|
-
|
|
19105
|
+
TI(this.normal, this.normal, I), this.signedDistance *= I;
|
|
19106
19106
|
}
|
|
19107
19107
|
}
|
|
19108
19108
|
}
|
|
@@ -19147,12 +19147,13 @@ class iC {
|
|
|
19147
19147
|
this.bins_.clear();
|
|
19148
19148
|
}
|
|
19149
19149
|
}
|
|
19150
|
-
class LE extends
|
|
19150
|
+
class LE extends pg {
|
|
19151
19151
|
type = "ImageLayer";
|
|
19152
19152
|
source_;
|
|
19153
19153
|
sliceCoords_;
|
|
19154
19154
|
axes_;
|
|
19155
19155
|
planeRotation_;
|
|
19156
|
+
orientation_;
|
|
19156
19157
|
onPickValue_;
|
|
19157
19158
|
visibleChunks_ = /* @__PURE__ */ new Map();
|
|
19158
19159
|
pool_ = new iC();
|
|
@@ -19161,6 +19162,7 @@ class LE extends Hg {
|
|
|
19161
19162
|
policy_;
|
|
19162
19163
|
channelProps_;
|
|
19163
19164
|
chunkStoreView_;
|
|
19165
|
+
context_;
|
|
19164
19166
|
pointerDownPos_ = null;
|
|
19165
19167
|
debugMode_ = !1;
|
|
19166
19168
|
static STALE_PRESENTATION_MS_ = 1e3;
|
|
@@ -19181,10 +19183,10 @@ class LE extends Hg {
|
|
|
19181
19183
|
onPickValue: E,
|
|
19182
19184
|
...i
|
|
19183
19185
|
}) {
|
|
19184
|
-
super(i), this.setState("initialized"), this.source_ = A, this.policy_ = g, this.sliceCoords_ = I, this.
|
|
19186
|
+
super(i), this.setState("initialized"), this.source_ = A, this.policy_ = g, this.sliceCoords_ = I, this.orientation_ = B ?? "XY", this.axes_ = yI(this.orientation_), this.planeRotation_ = cI(this.axes_), this.channelProps_ = Q, this.initialChannelProps_ = Q, this.onPickValue_ = E;
|
|
19185
19187
|
}
|
|
19186
19188
|
attach(A) {
|
|
19187
|
-
this.chunkStoreView_ = A.chunkManager.addView(
|
|
19189
|
+
this.context_ = A, this.chunkStoreView_ = A.chunkManager.addView(
|
|
19188
19190
|
this.source_,
|
|
19189
19191
|
this.policy_,
|
|
19190
19192
|
this.axes_
|
|
@@ -19196,7 +19198,7 @@ class LE extends Hg {
|
|
|
19196
19198
|
);
|
|
19197
19199
|
}
|
|
19198
19200
|
detach(A) {
|
|
19199
|
-
this.releaseAndRemoveChunks(this.visibleChunks_.keys()), this.clearObjects(), this.chunkStoreView_?.dispose(), this.chunkStoreView_ = void 0;
|
|
19201
|
+
this.releaseAndRemoveChunks(this.visibleChunks_.keys()), this.clearObjects(), this.chunkStoreView_?.dispose(), this.chunkStoreView_ = void 0, this.context_ = void 0;
|
|
19200
19202
|
}
|
|
19201
19203
|
update(A) {
|
|
19202
19204
|
if (!A || !this.chunkStoreView_) return;
|
|
@@ -19208,6 +19210,20 @@ class LE extends Hg {
|
|
|
19208
19210
|
for (const [B, Q] of this.visibleChunks_)
|
|
19209
19211
|
this.updateSlicePosition(Q, B);
|
|
19210
19212
|
}
|
|
19213
|
+
get orientation() {
|
|
19214
|
+
return this.orientation_;
|
|
19215
|
+
}
|
|
19216
|
+
/**
|
|
19217
|
+
* Changes the slice orientation at runtime. Visible renderables are rebuilt
|
|
19218
|
+
* for the new plane, chunks already resident in the shared cache are reused.
|
|
19219
|
+
*/
|
|
19220
|
+
setOrientation(A) {
|
|
19221
|
+
A !== this.orientation_ && (this.releaseAndRemoveChunks(this.visibleChunks_.keys()), this.clearObjects(), this.chunkStoreView_?.dispose(), this.lastPresentationTimeStamp_ = void 0, this.lastPresentationTimeCoord_ = void 0, this.orientation_ = A, this.axes_ = yI(A), this.planeRotation_ = cI(this.axes_), this.context_ && (this.chunkStoreView_ = this.context_.chunkManager.addView(
|
|
19222
|
+
this.source_,
|
|
19223
|
+
this.policy_,
|
|
19224
|
+
this.axes_
|
|
19225
|
+
)));
|
|
19226
|
+
}
|
|
19211
19227
|
updateChunks() {
|
|
19212
19228
|
if (!this.chunkStoreView_) return;
|
|
19213
19229
|
this.state !== "ready" && this.setState("ready");
|
|
@@ -19271,14 +19287,14 @@ class LE extends Hg {
|
|
|
19271
19287
|
set imageSourcePolicy(A) {
|
|
19272
19288
|
this.policy_ !== A && (this.policy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
|
|
19273
19289
|
A,
|
|
19274
|
-
|
|
19290
|
+
Kg
|
|
19275
19291
|
));
|
|
19276
19292
|
}
|
|
19277
19293
|
getImageForChunk(A, I) {
|
|
19278
19294
|
const g = this.visibleChunks_.get(A);
|
|
19279
19295
|
if (g) return g;
|
|
19280
19296
|
const B = this.pool_.acquire(
|
|
19281
|
-
|
|
19297
|
+
Yg(A, this.axes_)
|
|
19282
19298
|
);
|
|
19283
19299
|
return B ? (B.setTexture(0, I), B.setChannelProps(this.getChannelPropsForChunk(A)), this.updateImageChunk(B, A), B) : this.createImage(A, I);
|
|
19284
19300
|
}
|
|
@@ -19296,7 +19312,7 @@ class LE extends Hg {
|
|
|
19296
19312
|
}
|
|
19297
19313
|
updateSlicePosition(A, I) {
|
|
19298
19314
|
const { u: g, v: B, w: Q } = this.axes_, E = T();
|
|
19299
|
-
E[
|
|
19315
|
+
E[CA[g]] = I.offset[g], E[CA[B]] = I.offset[B], E[CA[Q]] = this.sliceCoords_[Q] ?? I.offset[Q], A.transform.setTranslation(E);
|
|
19300
19316
|
}
|
|
19301
19317
|
sliceIndexForChunk(A) {
|
|
19302
19318
|
const I = this.axes_.w, g = this.sliceCoords_[I];
|
|
@@ -19321,7 +19337,7 @@ class LE extends Hg {
|
|
|
19321
19337
|
return null;
|
|
19322
19338
|
}
|
|
19323
19339
|
async readValueFromChunk(A, I, g) {
|
|
19324
|
-
const B =
|
|
19340
|
+
const B = LB(
|
|
19325
19341
|
T(),
|
|
19326
19342
|
g,
|
|
19327
19343
|
I.transform.inverse
|
|
@@ -19364,11 +19380,11 @@ class LE extends Hg {
|
|
|
19364
19380
|
releaseAndRemoveChunks(A) {
|
|
19365
19381
|
for (const I of A) {
|
|
19366
19382
|
const g = this.visibleChunks_.get(I);
|
|
19367
|
-
g && (this.pool_.release(
|
|
19383
|
+
g && (this.pool_.release(Yg(I, this.axes_), g), this.visibleChunks_.delete(I));
|
|
19368
19384
|
}
|
|
19369
19385
|
}
|
|
19370
19386
|
}
|
|
19371
|
-
function
|
|
19387
|
+
function Yg(C, A) {
|
|
19372
19388
|
return [
|
|
19373
19389
|
`plane${A.u}${A.v}`,
|
|
19374
19390
|
`lod${C.lod}`,
|
|
@@ -19376,7 +19392,7 @@ function Lg(C, A) {
|
|
|
19376
19392
|
`align${C.rowAlignmentBytes}`
|
|
19377
19393
|
].join(":");
|
|
19378
19394
|
}
|
|
19379
|
-
class te extends
|
|
19395
|
+
class te extends kI {
|
|
19380
19396
|
constructor(A, I, g, B, Q, E) {
|
|
19381
19397
|
super();
|
|
19382
19398
|
const i = [], o = [], s = Math.floor(B), t = Math.floor(Q), e = Math.floor(E);
|
|
@@ -19399,18 +19415,18 @@ class te extends NI {
|
|
|
19399
19415
|
for (let M = 0; M < R; M++) {
|
|
19400
19416
|
const v = -U + M * k;
|
|
19401
19417
|
for (let AA = 0; AA < d; AA++) {
|
|
19402
|
-
const
|
|
19403
|
-
gA[A] =
|
|
19404
|
-
const
|
|
19405
|
-
|
|
19418
|
+
const iA = -S + AA * F, gA = { x: 0, y: 0, z: 0 };
|
|
19419
|
+
gA[A] = iA * B, gA[I] = v * Q, gA[g] = f;
|
|
19420
|
+
const oA = { x: 0, y: 0, z: 0 };
|
|
19421
|
+
oA[g] = e;
|
|
19406
19422
|
const fA = AA / s, KA = 1 - M / t;
|
|
19407
19423
|
n.push(
|
|
19408
19424
|
gA.x,
|
|
19409
19425
|
gA.y,
|
|
19410
19426
|
gA.z,
|
|
19411
|
-
|
|
19412
|
-
|
|
19413
|
-
|
|
19427
|
+
oA.x,
|
|
19428
|
+
oA.y,
|
|
19429
|
+
oA.z,
|
|
19414
19430
|
fA,
|
|
19415
19431
|
KA
|
|
19416
19432
|
);
|
|
@@ -19418,12 +19434,12 @@ class te extends NI {
|
|
|
19418
19434
|
}
|
|
19419
19435
|
for (let M = 0; M < t; M++)
|
|
19420
19436
|
for (let v = 0; v < s; v++) {
|
|
19421
|
-
const AA = L + v + d * M,
|
|
19422
|
-
D.push(AA,
|
|
19437
|
+
const AA = L + v + d * M, iA = L + v + d * (M + 1), gA = L + (v + 1) + d * (M + 1), oA = L + (v + 1) + d * M;
|
|
19438
|
+
D.push(AA, iA, oA, iA, gA, oA);
|
|
19423
19439
|
}
|
|
19424
19440
|
}
|
|
19425
19441
|
}
|
|
19426
|
-
class ee extends
|
|
19442
|
+
class ee extends LI {
|
|
19427
19443
|
voxelScale = j(1, 1, 1);
|
|
19428
19444
|
channels_;
|
|
19429
19445
|
loadedChannels_ = /* @__PURE__ */ new Set();
|
|
@@ -19479,7 +19495,7 @@ class ee extends UI {
|
|
|
19479
19495
|
for (let o = 0; o < i && E.length < 4; o++) {
|
|
19480
19496
|
const s = this.channelToTextureIndex_.get(o);
|
|
19481
19497
|
if (s === void 0 || !this.loadedChannels_.has(o)) continue;
|
|
19482
|
-
const t = this.textures[s], e =
|
|
19498
|
+
const t = this.textures[s], e = OI(t, this.channels_[o] || {});
|
|
19483
19499
|
if (!e.visible) continue;
|
|
19484
19500
|
const n = E.length;
|
|
19485
19501
|
I[n * 3] = e.color.rgb[0], I[n * 3 + 1] = e.color.rgb[1], I[n * 3 + 2] = e.color.rgb[2], E.push(s), g[n] = -e.contrastLimits[0], B[n] = 1 / (e.contrastLimits[1] - e.contrastLimits[0]), A[n] = 1, Q[n] = e.opacity;
|
|
@@ -19512,13 +19528,13 @@ class ee extends UI {
|
|
|
19512
19528
|
return I !== void 0 ? this.textures[I] : null;
|
|
19513
19529
|
}
|
|
19514
19530
|
setChannelProps(A) {
|
|
19515
|
-
this.channels_ =
|
|
19531
|
+
this.channels_ = kB(
|
|
19516
19532
|
this.getAvailableChannelTexture(),
|
|
19517
19533
|
A
|
|
19518
19534
|
);
|
|
19519
19535
|
}
|
|
19520
19536
|
setChannelProperty(A, I, g) {
|
|
19521
|
-
const B =
|
|
19537
|
+
const B = OI(
|
|
19522
19538
|
this.getAvailableChannelTexture(A),
|
|
19523
19539
|
{
|
|
19524
19540
|
...this.channels_[A],
|
|
@@ -19545,13 +19561,13 @@ function ae(C) {
|
|
|
19545
19561
|
function ne(C, A) {
|
|
19546
19562
|
const I = A.position, g = T(), B = T();
|
|
19547
19563
|
return C.sort((Q, E) => {
|
|
19548
|
-
rI(g, Q.boundingBox.max, Q.boundingBox.min),
|
|
19564
|
+
rI(g, Q.boundingBox.max, Q.boundingBox.min), TI(g, g, 0.5), rI(B, E.boundingBox.max, E.boundingBox.min), TI(B, B, 0.5);
|
|
19549
19565
|
const i = hC(I, g), o = hC(I, B);
|
|
19550
19566
|
return i - o;
|
|
19551
19567
|
}), C;
|
|
19552
19568
|
}
|
|
19553
19569
|
const re = 2;
|
|
19554
|
-
class Ze extends
|
|
19570
|
+
class Ze extends pg {
|
|
19555
19571
|
type = "VolumeLayer";
|
|
19556
19572
|
source_;
|
|
19557
19573
|
sliceCoords_;
|
|
@@ -19585,7 +19601,7 @@ class Ze extends Hg {
|
|
|
19585
19601
|
set sourcePolicy(A) {
|
|
19586
19602
|
this.sourcePolicy_ !== A && (this.sourcePolicy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
|
|
19587
19603
|
A,
|
|
19588
|
-
|
|
19604
|
+
Kg
|
|
19589
19605
|
));
|
|
19590
19606
|
}
|
|
19591
19607
|
setChannelProps(A) {
|
|
@@ -19713,11 +19729,11 @@ function ye(C) {
|
|
|
19713
19729
|
`align${C.rowAlignmentBytes}`
|
|
19714
19730
|
].join(":");
|
|
19715
19731
|
}
|
|
19716
|
-
class GQ extends
|
|
19732
|
+
class GQ extends uB {
|
|
19717
19733
|
width_;
|
|
19718
19734
|
height_;
|
|
19719
19735
|
constructor(A, I, g) {
|
|
19720
|
-
super(), this.dataFormat = "scalar", this.dataType =
|
|
19736
|
+
super(), this.dataFormat = "scalar", this.dataType = MB(A), this.data_ = A, this.width_ = I, this.height_ = g;
|
|
19721
19737
|
}
|
|
19722
19738
|
get type() {
|
|
19723
19739
|
return "Texture2D";
|
|
@@ -19748,7 +19764,7 @@ function we(C) {
|
|
|
19748
19764
|
function Ge(C) {
|
|
19749
19765
|
return JE.has(C.dataType) ? "intLabelImage" : "labelImage";
|
|
19750
19766
|
}
|
|
19751
|
-
class Fe extends
|
|
19767
|
+
class Fe extends LI {
|
|
19752
19768
|
outlineSelected_;
|
|
19753
19769
|
selectedValue_;
|
|
19754
19770
|
worldToTexCoord = GA();
|
|
@@ -19818,12 +19834,13 @@ class FQ {
|
|
|
19818
19834
|
this.lookupTable = Ne(A.lookupTable), this.cycle = Re(A.cycle);
|
|
19819
19835
|
}
|
|
19820
19836
|
}
|
|
19821
|
-
class YE extends
|
|
19837
|
+
class YE extends pg {
|
|
19822
19838
|
type = "LabelLayer";
|
|
19823
19839
|
source_;
|
|
19824
19840
|
sliceCoords_;
|
|
19825
19841
|
axes_;
|
|
19826
19842
|
planeRotation_;
|
|
19843
|
+
orientation_;
|
|
19827
19844
|
onPickValue_;
|
|
19828
19845
|
outlineSelected_;
|
|
19829
19846
|
visibleChunks_ = /* @__PURE__ */ new Map();
|
|
@@ -19832,6 +19849,7 @@ class YE extends Hg {
|
|
|
19832
19849
|
selectedValue_ = null;
|
|
19833
19850
|
policy_;
|
|
19834
19851
|
chunkStoreView_;
|
|
19852
|
+
context_;
|
|
19835
19853
|
pointerDownPos_ = null;
|
|
19836
19854
|
static STALE_PRESENTATION_MS_ = 1e3;
|
|
19837
19855
|
lastPresentationTimeStamp_;
|
|
@@ -19846,10 +19864,10 @@ class YE extends Hg {
|
|
|
19846
19864
|
outlineSelected: i = !1,
|
|
19847
19865
|
...o
|
|
19848
19866
|
}) {
|
|
19849
|
-
super(o), this.setState("initialized"), this.source_ = A, this.policy_ = g, this.sliceCoords_ = I, this.
|
|
19867
|
+
super(o), this.setState("initialized"), this.source_ = A, this.policy_ = g, this.sliceCoords_ = I, this.orientation_ = B ?? "XY", this.axes_ = yI(this.orientation_), this.planeRotation_ = cI(this.axes_), this.colorMap_ = new FQ(Q), this.onPickValue_ = E, this.outlineSelected_ = i;
|
|
19850
19868
|
}
|
|
19851
19869
|
attach(A) {
|
|
19852
|
-
if (this.chunkStoreView_ = A.chunkManager.addView(
|
|
19870
|
+
if (this.context_ = A, this.chunkStoreView_ = A.chunkManager.addView(
|
|
19853
19871
|
this.source_,
|
|
19854
19872
|
this.policy_,
|
|
19855
19873
|
this.axes_
|
|
@@ -19859,7 +19877,7 @@ class YE extends Hg {
|
|
|
19859
19877
|
);
|
|
19860
19878
|
}
|
|
19861
19879
|
detach(A) {
|
|
19862
|
-
this.releaseAndRemoveChunks(this.visibleChunks_.keys()), this.clearObjects(), this.chunkStoreView_?.dispose(), this.chunkStoreView_ = void 0;
|
|
19880
|
+
this.releaseAndRemoveChunks(this.visibleChunks_.keys()), this.clearObjects(), this.chunkStoreView_?.dispose(), this.chunkStoreView_ = void 0, this.context_ = void 0;
|
|
19863
19881
|
}
|
|
19864
19882
|
update(A) {
|
|
19865
19883
|
if (!A || !this.chunkStoreView_) return;
|
|
@@ -19871,6 +19889,20 @@ class YE extends Hg {
|
|
|
19871
19889
|
for (const [B, Q] of this.visibleChunks_)
|
|
19872
19890
|
this.updateSlicePosition(Q, B);
|
|
19873
19891
|
}
|
|
19892
|
+
get orientation() {
|
|
19893
|
+
return this.orientation_;
|
|
19894
|
+
}
|
|
19895
|
+
/**
|
|
19896
|
+
* Changes the slice orientation at runtime. Visible renderables are rebuilt
|
|
19897
|
+
* for the new plane, chunks already resident in the shared cache are reused.
|
|
19898
|
+
*/
|
|
19899
|
+
setOrientation(A) {
|
|
19900
|
+
A !== this.orientation_ && (this.releaseAndRemoveChunks(this.visibleChunks_.keys()), this.clearObjects(), this.chunkStoreView_?.dispose(), this.lastPresentationTimeStamp_ = void 0, this.lastPresentationTimeCoord_ = void 0, this.orientation_ = A, this.axes_ = yI(A), this.planeRotation_ = cI(this.axes_), this.context_ && (this.chunkStoreView_ = this.context_.chunkManager.addView(
|
|
19901
|
+
this.source_,
|
|
19902
|
+
this.policy_,
|
|
19903
|
+
this.axes_
|
|
19904
|
+
)));
|
|
19905
|
+
}
|
|
19874
19906
|
updateChunks() {
|
|
19875
19907
|
if (!this.chunkStoreView_) return;
|
|
19876
19908
|
this.state !== "ready" && this.setState("ready");
|
|
@@ -19942,7 +19974,7 @@ class YE extends Hg {
|
|
|
19942
19974
|
set imageSourcePolicy(A) {
|
|
19943
19975
|
this.policy_ !== A && (this.policy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
|
|
19944
19976
|
A,
|
|
19945
|
-
|
|
19977
|
+
Kg
|
|
19946
19978
|
));
|
|
19947
19979
|
}
|
|
19948
19980
|
// exposed for use in chunk info overlay
|
|
@@ -19963,7 +19995,7 @@ class YE extends Hg {
|
|
|
19963
19995
|
return null;
|
|
19964
19996
|
}
|
|
19965
19997
|
async readValueFromChunk(A, I, g) {
|
|
19966
|
-
const B =
|
|
19998
|
+
const B = LB(
|
|
19967
19999
|
T(),
|
|
19968
20000
|
g,
|
|
19969
20001
|
I.transform.inverse
|
|
@@ -19977,7 +20009,7 @@ class YE extends Hg {
|
|
|
19977
20009
|
const g = this.visibleChunks_.get(A);
|
|
19978
20010
|
if (g) return g;
|
|
19979
20011
|
const B = this.pool_.acquire(
|
|
19980
|
-
|
|
20012
|
+
Yg(A, this.axes_)
|
|
19981
20013
|
);
|
|
19982
20014
|
return B ? (B.setTexture(0, I), B.setColorMap(this.colorMap_), B.setSelectedValue(this.selectedValue_), this.updateLabelChunk(B, A), B) : this.createLabel(A, I);
|
|
19983
20015
|
}
|
|
@@ -19994,7 +20026,7 @@ class YE extends Hg {
|
|
|
19994
20026
|
}
|
|
19995
20027
|
updateSlicePosition(A, I) {
|
|
19996
20028
|
const { u: g, v: B, w: Q } = this.axes_, E = T();
|
|
19997
|
-
E[
|
|
20029
|
+
E[CA[g]] = I.offset[g], E[CA[B]] = I.offset[B], E[CA[Q]] = this.sliceCoords_[Q] ?? I.offset[Q], A.transform.setTranslation(E);
|
|
19998
20030
|
}
|
|
19999
20031
|
sliceIndexForChunk(A) {
|
|
20000
20032
|
const I = this.axes_.w, g = this.sliceCoords_[I];
|
|
@@ -20010,16 +20042,16 @@ class YE extends Hg {
|
|
|
20010
20042
|
releaseAndRemoveChunks(A) {
|
|
20011
20043
|
for (const I of A) {
|
|
20012
20044
|
const g = this.visibleChunks_.get(I);
|
|
20013
|
-
g && (this.pool_.release(
|
|
20045
|
+
g && (this.pool_.release(Yg(I, this.axes_), g), this.visibleChunks_.delete(I));
|
|
20014
20046
|
}
|
|
20015
20047
|
}
|
|
20016
20048
|
}
|
|
20017
|
-
class ke extends
|
|
20049
|
+
class ke extends uB {
|
|
20018
20050
|
width_;
|
|
20019
20051
|
height_;
|
|
20020
20052
|
depth_;
|
|
20021
20053
|
constructor(A, I, g) {
|
|
20022
|
-
super(), this.dataFormat = "scalar", this.dataType =
|
|
20054
|
+
super(), this.dataFormat = "scalar", this.dataType = MB(A), this.data_ = A, this.width_ = I, this.height_ = g, this.depth_ = A.length / (I * g);
|
|
20023
20055
|
}
|
|
20024
20056
|
get type() {
|
|
20025
20057
|
return "Texture2DArray";
|
|
@@ -20039,7 +20071,7 @@ const ME = {
|
|
|
20039
20071
|
square: 1,
|
|
20040
20072
|
triangle: 2
|
|
20041
20073
|
};
|
|
20042
|
-
class Pe extends
|
|
20074
|
+
class Pe extends LI {
|
|
20043
20075
|
constructor(A) {
|
|
20044
20076
|
super(), this.programName = "points";
|
|
20045
20077
|
const I = A.flatMap((B) => {
|
|
@@ -20055,7 +20087,7 @@ class Pe extends UI {
|
|
|
20055
20087
|
B.size,
|
|
20056
20088
|
ME[B.marker]
|
|
20057
20089
|
];
|
|
20058
|
-
}), g = new
|
|
20090
|
+
}), g = new kI(I, [], "points");
|
|
20059
20091
|
g.addAttribute({
|
|
20060
20092
|
type: "position",
|
|
20061
20093
|
itemSize: 3,
|
|
@@ -20078,9 +20110,9 @@ class Pe extends UI {
|
|
|
20078
20110
|
return "Points";
|
|
20079
20111
|
}
|
|
20080
20112
|
}
|
|
20081
|
-
let
|
|
20113
|
+
let gB;
|
|
20082
20114
|
function de() {
|
|
20083
|
-
return
|
|
20115
|
+
return gB || (gB = Ue()), gB;
|
|
20084
20116
|
}
|
|
20085
20117
|
function Ue() {
|
|
20086
20118
|
const C = (s) => {
|
|
@@ -20124,7 +20156,7 @@ class SQ {
|
|
|
20124
20156
|
);
|
|
20125
20157
|
}
|
|
20126
20158
|
}
|
|
20127
|
-
const
|
|
20159
|
+
const BB = -1, NQ = 0, le = 1, RQ = 9e-3, Le = 1e-3, Je = 9e-4, Ye = 0.5, Me = 60;
|
|
20128
20160
|
class Oe {
|
|
20129
20161
|
camera_;
|
|
20130
20162
|
orbitVelocity_ = new SQ(0, 0, 0);
|
|
@@ -20132,13 +20164,13 @@ class Oe {
|
|
|
20132
20164
|
currPos_;
|
|
20133
20165
|
currCenter_ = T();
|
|
20134
20166
|
dampingFactor_;
|
|
20135
|
-
currMouseButton_ =
|
|
20167
|
+
currMouseButton_ = BB;
|
|
20136
20168
|
constructor(A, I) {
|
|
20137
20169
|
this.camera_ = A, this.currPos_ = new SQ(
|
|
20138
20170
|
I?.radius ?? 1,
|
|
20139
20171
|
I?.yaw ?? 0,
|
|
20140
20172
|
I?.pitch ?? 0
|
|
20141
|
-
), I?.target &&
|
|
20173
|
+
), I?.target && QB(this.currCenter_, I.target), this.dampingFactor_ = vA(
|
|
20142
20174
|
I?.dampingFactor ?? Ye,
|
|
20143
20175
|
0,
|
|
20144
20176
|
1
|
|
@@ -20165,20 +20197,20 @@ class Oe {
|
|
|
20165
20197
|
}
|
|
20166
20198
|
}
|
|
20167
20199
|
onUpdate(A) {
|
|
20168
|
-
if (this.orbitVelocity_.phi === 0 && this.orbitVelocity_.theta === 0 && this.orbitVelocity_.radius === 0 &&
|
|
20200
|
+
if (this.orbitVelocity_.phi === 0 && this.orbitVelocity_.theta === 0 && this.orbitVelocity_.radius === 0 && JB(this.panVelocity_, j(0, 0, 0)))
|
|
20169
20201
|
return;
|
|
20170
20202
|
this.currPos_.phi += this.orbitVelocity_.phi, this.currPos_.theta += this.orbitVelocity_.theta, this.currPos_.radius += this.orbitVelocity_.radius * this.currPos_.radius, rI(this.currCenter_, this.currCenter_, this.panVelocity_);
|
|
20171
20203
|
const I = Math.PI / 2 - IA;
|
|
20172
20204
|
this.currPos_.theta = vA(this.currPos_.theta, -I, I), this.currPos_.radius = Math.max(0.01, this.currPos_.radius), this.updateCamera();
|
|
20173
20205
|
const g = Math.pow(1 - this.dampingFactor_, A * Me);
|
|
20174
|
-
this.orbitVelocity_.phi *= g, this.orbitVelocity_.theta *= g, this.orbitVelocity_.radius *= g,
|
|
20206
|
+
this.orbitVelocity_.phi *= g, this.orbitVelocity_.theta *= g, this.orbitVelocity_.radius *= g, TI(this.panVelocity_, this.panVelocity_, g), this.cutoffLowVelocity();
|
|
20175
20207
|
}
|
|
20176
20208
|
onPointerDown(A) {
|
|
20177
20209
|
const I = A.event;
|
|
20178
20210
|
this.currMouseButton_ = I.button, I.target?.setPointerCapture?.(I.pointerId);
|
|
20179
20211
|
}
|
|
20180
20212
|
onPointerMove(A) {
|
|
20181
|
-
if (this.currMouseButton_ ==
|
|
20213
|
+
if (this.currMouseButton_ == BB) return;
|
|
20182
20214
|
const I = A.event, g = I.movementX ?? 0, B = I.movementY ?? 0, Q = this.currMouseButton_ === NQ && !I.shiftKey, E = this.currMouseButton_ === NQ && I.shiftKey || this.currMouseButton_ === le;
|
|
20183
20215
|
Q && this.orbit(g, B), E && this.pan(g, B);
|
|
20184
20216
|
}
|
|
@@ -20189,7 +20221,7 @@ class Oe {
|
|
|
20189
20221
|
this.zoom(g);
|
|
20190
20222
|
}
|
|
20191
20223
|
onPointerEnd(A) {
|
|
20192
|
-
this.currMouseButton_ =
|
|
20224
|
+
this.currMouseButton_ = BB;
|
|
20193
20225
|
const I = A.event;
|
|
20194
20226
|
I.target?.releasePointerCapture?.(I.pointerId);
|
|
20195
20227
|
}
|
|
@@ -20198,7 +20230,7 @@ class Oe {
|
|
|
20198
20230
|
}
|
|
20199
20231
|
pan(A, I) {
|
|
20200
20232
|
const g = this.currPos_.radius * Le, B = T();
|
|
20201
|
-
|
|
20233
|
+
EB(B, B, this.camera_.right, A), EB(B, B, this.camera_.up, I), TI(B, B, g), iB(this.panVelocity_, this.panVelocity_, B);
|
|
20202
20234
|
}
|
|
20203
20235
|
zoom(A) {
|
|
20204
20236
|
this.orbitVelocity_.radius += A * Je;
|
|
@@ -20208,7 +20240,7 @@ class Oe {
|
|
|
20208
20240
|
this.camera_.transform.setTranslation(A), this.camera_.transform.targetTo(this.currCenter_);
|
|
20209
20241
|
}
|
|
20210
20242
|
cutoffLowVelocity() {
|
|
20211
|
-
Math.abs(this.orbitVelocity_.phi) < IA && (this.orbitVelocity_.phi = 0), Math.abs(this.orbitVelocity_.theta) < IA && (this.orbitVelocity_.theta = 0), Math.abs(this.orbitVelocity_.radius) < IA && (this.orbitVelocity_.radius = 0),
|
|
20243
|
+
Math.abs(this.orbitVelocity_.phi) < IA && (this.orbitVelocity_.phi = 0), Math.abs(this.orbitVelocity_.theta) < IA && (this.orbitVelocity_.theta = 0), Math.abs(this.orbitVelocity_.radius) < IA && (this.orbitVelocity_.radius = 0), UB(this.panVelocity_) < IA && si(this.panVelocity_);
|
|
20212
20244
|
}
|
|
20213
20245
|
}
|
|
20214
20246
|
class ue {
|
|
@@ -20257,7 +20289,7 @@ class ue {
|
|
|
20257
20289
|
return !0;
|
|
20258
20290
|
}
|
|
20259
20291
|
}
|
|
20260
|
-
class uE extends
|
|
20292
|
+
class uE extends LI {
|
|
20261
20293
|
projectionMatrix_ = GA();
|
|
20262
20294
|
near_ = 0;
|
|
20263
20295
|
far_ = 0;
|
|
@@ -20291,16 +20323,16 @@ class uE extends UI {
|
|
|
20291
20323
|
return this.transform.translation;
|
|
20292
20324
|
}
|
|
20293
20325
|
clipToWorld(A) {
|
|
20294
|
-
const I =
|
|
20326
|
+
const I = tg(A[0], A[1], A[2], 1), g = Mg(
|
|
20295
20327
|
GA(),
|
|
20296
20328
|
this.projectionMatrix_
|
|
20297
|
-
), B =
|
|
20329
|
+
), B = bI(
|
|
20298
20330
|
DI(),
|
|
20299
20331
|
I,
|
|
20300
20332
|
g
|
|
20301
20333
|
);
|
|
20302
20334
|
ni(B, B, 1 / B[3]);
|
|
20303
|
-
const Q =
|
|
20335
|
+
const Q = bI(
|
|
20304
20336
|
DI(),
|
|
20305
20337
|
B,
|
|
20306
20338
|
this.transform.matrix
|
|
@@ -20317,6 +20349,7 @@ class Ve extends uE {
|
|
|
20317
20349
|
viewportSize_ = [kQ, dQ];
|
|
20318
20350
|
axes_;
|
|
20319
20351
|
rotation_;
|
|
20352
|
+
orientation_;
|
|
20320
20353
|
/**
|
|
20321
20354
|
* Creates an orthographic camera framing the given world-space rectangle.
|
|
20322
20355
|
*
|
|
@@ -20328,7 +20361,7 @@ class Ve extends uE {
|
|
|
20328
20361
|
* `1e6`) and the slice orientation the camera faces (default `"XY"`).
|
|
20329
20362
|
*/
|
|
20330
20363
|
constructor(A, I, g, B, Q = {}) {
|
|
20331
|
-
super(), this.near_ = Q.near ?? fe, this.far_ = Q.far ?? Ke, this.
|
|
20364
|
+
super(), this.near_ = Q.near ?? fe, this.far_ = Q.far ?? Ke, this.orientation_ = Q.orientation ?? "XY", this.axes_ = yI(this.orientation_), this.rotation_ = cI(this.axes_), this.setFrame(A, I, B, g), this.updateProjectionMatrix();
|
|
20332
20365
|
}
|
|
20333
20366
|
get viewportSize() {
|
|
20334
20367
|
return this.viewportSize_;
|
|
@@ -20339,11 +20372,27 @@ class Ve extends uE {
|
|
|
20339
20372
|
setFrame(A, I, g, B) {
|
|
20340
20373
|
this.width_ = Math.abs(I - A), this.height_ = Math.abs(B - g), this.updateProjectionMatrix();
|
|
20341
20374
|
const Q = T();
|
|
20342
|
-
Q[
|
|
20375
|
+
Q[CA[this.axes_.u]] = 0.5 * (A + I), Q[CA[this.axes_.v]] = 0.5 * (g + B), this.transform.setTranslation(Q), this.transform.setScale([1, 1, 1]), this.transform.setRotation(this.rotation_);
|
|
20343
20376
|
}
|
|
20344
20377
|
get type() {
|
|
20345
20378
|
return "OrthographicCamera";
|
|
20346
20379
|
}
|
|
20380
|
+
get orientation() {
|
|
20381
|
+
return this.orientation_;
|
|
20382
|
+
}
|
|
20383
|
+
/**
|
|
20384
|
+
* Changes the slice orientation the camera faces. The current frame and
|
|
20385
|
+
* zoom carry over numerically to the new plane axes. Call {@link setFrame}
|
|
20386
|
+
* to reframe the view for the new plane.
|
|
20387
|
+
*/
|
|
20388
|
+
setOrientation(A) {
|
|
20389
|
+
if (A === this.orientation_)
|
|
20390
|
+
return;
|
|
20391
|
+
const I = this.transform.translation[CA[this.axes_.u]], g = this.transform.translation[CA[this.axes_.v]];
|
|
20392
|
+
this.orientation_ = A, this.axes_ = yI(A), this.rotation_ = cI(this.axes_);
|
|
20393
|
+
const B = T();
|
|
20394
|
+
B[CA[this.axes_.u]] = I, B[CA[this.axes_.v]] = g, this.transform.setTranslation(B), this.transform.setRotation(this.rotation_);
|
|
20395
|
+
}
|
|
20347
20396
|
zoom(A) {
|
|
20348
20397
|
if (A <= 0)
|
|
20349
20398
|
throw new Error(`Invalid zoom factor: ${A}`);
|
|
@@ -20351,10 +20400,10 @@ class Ve extends uE {
|
|
|
20351
20400
|
this.transform.addScale([I, I, 1]);
|
|
20352
20401
|
}
|
|
20353
20402
|
getWorldViewRect() {
|
|
20354
|
-
let A =
|
|
20355
|
-
const g =
|
|
20356
|
-
A =
|
|
20357
|
-
const B =
|
|
20403
|
+
let A = tg(-1, -1, 0, 1), I = tg(1, 1, 0, 1);
|
|
20404
|
+
const g = Mg(GA(), this.getViewProjection());
|
|
20405
|
+
A = bI(DI(), A, g), I = bI(DI(), I, g);
|
|
20406
|
+
const B = CA[this.axes_.u], Q = CA[this.axes_.v];
|
|
20358
20407
|
return new wA(
|
|
20359
20408
|
eA(A[B], A[Q]),
|
|
20360
20409
|
eA(I[B], I[Q])
|
|
@@ -20410,7 +20459,7 @@ class _e {
|
|
|
20410
20459
|
I.preventDefault();
|
|
20411
20460
|
const g = xA(A.worldPos), B = I.deltaY < 0 ? 1.05 : 0.95;
|
|
20412
20461
|
this.camera_.zoom(B);
|
|
20413
|
-
const Q = this.camera_.clipToWorld(A.clipPos), E =
|
|
20462
|
+
const Q = this.camera_.clipToWorld(A.clipPos), E = iB(T(), g, Q);
|
|
20414
20463
|
this.camera_.pan(E);
|
|
20415
20464
|
}
|
|
20416
20465
|
onPointerDown(A) {
|
|
@@ -20419,7 +20468,7 @@ class _e {
|
|
|
20419
20468
|
}
|
|
20420
20469
|
onPointerMove(A) {
|
|
20421
20470
|
if (!this.dragActive_ || !A.worldPos) return;
|
|
20422
|
-
const I =
|
|
20471
|
+
const I = iB(T(), this.dragStart_, A.worldPos);
|
|
20423
20472
|
this.camera_.pan(I);
|
|
20424
20473
|
}
|
|
20425
20474
|
onPointerEnd(A) {
|
|
@@ -20427,7 +20476,7 @@ class _e {
|
|
|
20427
20476
|
!this.dragActive_ || I.button !== UQ || (this.dragActive_ = !1, I.target?.releasePointerCapture?.(I.pointerId));
|
|
20428
20477
|
}
|
|
20429
20478
|
}
|
|
20430
|
-
const He = 60, qe = 1.77,
|
|
20479
|
+
const He = 60, qe = 1.77, og = 0.1, CB = 180 - og;
|
|
20431
20480
|
class Xe extends uE {
|
|
20432
20481
|
fov_;
|
|
20433
20482
|
aspectRatio_;
|
|
@@ -20439,9 +20488,9 @@ class Xe extends uE {
|
|
|
20439
20488
|
far: Q = 1e4,
|
|
20440
20489
|
position: E = j(0, 0, 0)
|
|
20441
20490
|
} = A;
|
|
20442
|
-
if (I <
|
|
20491
|
+
if (I < og || I > CB)
|
|
20443
20492
|
throw new Error(
|
|
20444
|
-
`Invalid field of view: ${I}, must be in [${
|
|
20493
|
+
`Invalid field of view: ${I}, must be in [${og}, ${CB}] degrees`
|
|
20445
20494
|
);
|
|
20446
20495
|
super(), this.fov_ = I, this.aspectRatio_ = g, this.near_ = B, this.far_ = Q, this.transform.setTranslation(E), this.updateProjectionMatrix();
|
|
20447
20496
|
}
|
|
@@ -20457,7 +20506,7 @@ class Xe extends uE {
|
|
|
20457
20506
|
zoom(A) {
|
|
20458
20507
|
if (A <= 0)
|
|
20459
20508
|
throw new Error(`Invalid zoom factor: ${A}`);
|
|
20460
|
-
this.fov_ = Math.max(
|
|
20509
|
+
this.fov_ = Math.max(og, Math.min(CB, this.fov_ / A)), this.updateProjectionMatrix();
|
|
20461
20510
|
}
|
|
20462
20511
|
updateProjectionMatrix() {
|
|
20463
20512
|
Bi(
|
|
@@ -20571,8 +20620,8 @@ export {
|
|
|
20571
20620
|
FQ as LabelColorMap,
|
|
20572
20621
|
Fe as LabelImageRenderable,
|
|
20573
20622
|
YE as LabelLayer,
|
|
20574
|
-
|
|
20575
|
-
|
|
20623
|
+
pg as Layer,
|
|
20624
|
+
qI as OmeZarrImageSource,
|
|
20576
20625
|
Oe as OrbitControls,
|
|
20577
20626
|
Ve as OrthographicCamera,
|
|
20578
20627
|
_e as PanZoomControls,
|