@idetik/core 0.29.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/worker_kernel-CBlE4MBI.js.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +386 -368
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +25 -25
- package/dist/index.umd.cjs.map +1 -1
- package/dist/types/src/data/chunk.d.ts +1 -0
- package/dist/types/src/data/chunk.d.ts.map +1 -1
- package/dist/types/src/data/chunk_manager.d.ts +6 -1
- package/dist/types/src/data/chunk_manager.d.ts.map +1 -1
- package/dist/types/src/data/chunk_queue.d.ts +1 -1
- package/dist/types/src/data/chunk_queue.d.ts.map +1 -1
- package/dist/types/src/data/chunk_store.d.ts.map +1 -1
- package/dist/types/src/idetik.d.ts +2 -0
- package/dist/types/src/idetik.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
|
+
}`, XI = `#version 300 es
|
|
177
177
|
|
|
178
178
|
layout (location = 0) in vec3 a_position;
|
|
179
179
|
layout (location = 1) in vec3 a_normal;
|
|
@@ -187,7 +187,7 @@ out vec2 v_texCoords;
|
|
|
187
187
|
void main() {
|
|
188
188
|
v_texCoords = a_uv;
|
|
189
189
|
gl_Position = u_projection * u_modelView * vec4(a_position, 1.0);
|
|
190
|
-
}`,
|
|
190
|
+
}`, Mg = `#version 300 es
|
|
191
191
|
#pragma inject_defines
|
|
192
192
|
|
|
193
193
|
precision mediump 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
|
+
}`, ug = `#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
|
+
}`, fg = `#version 300 es
|
|
292
292
|
#pragma inject_defines
|
|
293
293
|
precision highp float;
|
|
294
294
|
|
|
@@ -535,35 +535,35 @@ const uE = {
|
|
|
535
535
|
fragment: YE
|
|
536
536
|
},
|
|
537
537
|
floatScalarImage: {
|
|
538
|
-
vertex:
|
|
539
|
-
fragment:
|
|
538
|
+
vertex: XI,
|
|
539
|
+
fragment: Mg
|
|
540
540
|
},
|
|
541
541
|
intScalarImage: {
|
|
542
|
-
vertex:
|
|
543
|
-
fragment:
|
|
542
|
+
vertex: XI,
|
|
543
|
+
fragment: Mg,
|
|
544
544
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
|
|
545
545
|
},
|
|
546
546
|
uintScalarImage: {
|
|
547
|
-
vertex:
|
|
548
|
-
fragment:
|
|
547
|
+
vertex: XI,
|
|
548
|
+
fragment: Mg,
|
|
549
549
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
|
|
550
550
|
},
|
|
551
551
|
labelImage: {
|
|
552
|
-
vertex:
|
|
552
|
+
vertex: XI,
|
|
553
553
|
fragment: ME
|
|
554
554
|
},
|
|
555
555
|
floatVolume: {
|
|
556
|
-
vertex:
|
|
557
|
-
fragment:
|
|
556
|
+
vertex: ug,
|
|
557
|
+
fragment: fg
|
|
558
558
|
},
|
|
559
559
|
intVolume: {
|
|
560
|
-
vertex:
|
|
561
|
-
fragment:
|
|
560
|
+
vertex: ug,
|
|
561
|
+
fragment: fg,
|
|
562
562
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
|
|
563
563
|
},
|
|
564
564
|
uintVolume: {
|
|
565
|
-
vertex:
|
|
566
|
-
fragment:
|
|
565
|
+
vertex: ug,
|
|
566
|
+
fragment: fg,
|
|
567
567
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
|
|
568
568
|
}
|
|
569
569
|
}, EC = {
|
|
@@ -778,7 +778,7 @@ const qE = typeof window < "u" ? [
|
|
|
778
778
|
WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_2D_ARRAY
|
|
779
779
|
] : [], pE = new Set(
|
|
780
780
|
qE
|
|
781
|
-
),
|
|
781
|
+
), Kg = "#pragma inject_defines";
|
|
782
782
|
class mE {
|
|
783
783
|
gl_;
|
|
784
784
|
programs_ = /* @__PURE__ */ new Map();
|
|
@@ -811,19 +811,19 @@ class mE {
|
|
|
811
811
|
}
|
|
812
812
|
function iC(C, A) {
|
|
813
813
|
if (A === void 0 || A.size == 0) return C;
|
|
814
|
-
if (!C.includes(
|
|
814
|
+
if (!C.includes(Kg))
|
|
815
815
|
throw new Error(
|
|
816
|
-
`Shader source does not contain "${
|
|
816
|
+
`Shader source does not contain "${Kg}" directive`
|
|
817
817
|
);
|
|
818
818
|
const I = Array.from(A.entries()).map(([E, i]) => `#define ${E} ${i}`).join(`
|
|
819
819
|
`), B = `#line __LINE__ + ${1 - A.size}`, Q = `${I}
|
|
820
820
|
${B}`;
|
|
821
|
-
return C.replace(
|
|
821
|
+
return C.replace(Kg, Q);
|
|
822
822
|
}
|
|
823
|
-
const
|
|
823
|
+
const jI = {};
|
|
824
824
|
function SQ(C) {
|
|
825
825
|
const A = C ?? "";
|
|
826
|
-
return
|
|
826
|
+
return jI[A] = (jI[A] ?? 0) + 1, C ? `${C}-${jI[A]}` : String(jI[A]);
|
|
827
827
|
}
|
|
828
828
|
class GB {
|
|
829
829
|
id = SQ();
|
|
@@ -847,7 +847,7 @@ function WE(C, A, I, g, B, Q, E, i, o, s, t, e, n, D, F, U) {
|
|
|
847
847
|
var S = new DA(16);
|
|
848
848
|
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] = U, S;
|
|
849
849
|
}
|
|
850
|
-
function
|
|
850
|
+
function Ug(C, A) {
|
|
851
851
|
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], U = A[13], S = A[14], l = A[15], f = I * i - g * E, k = I * o - B * E, R = I * s - Q * E, L = g * o - B * i, M = g * s - Q * i, W = B * s - Q * o, $ = t * U - e * F, BA = t * S - n * F, IA = t * l - D * F, iA = e * S - n * U, uA = e * l - D * U, fA = n * l - D * S, oA = f * fA - k * uA + R * iA + L * IA - M * BA + W * $;
|
|
852
852
|
return oA ? (oA = 1 / oA, C[0] = (i * fA - o * uA + s * iA) * oA, C[1] = (B * uA - g * fA - Q * iA) * oA, C[2] = (U * W - S * M + l * L) * oA, C[3] = (n * M - e * W - D * L) * oA, C[4] = (o * IA - E * fA - s * BA) * oA, C[5] = (I * fA - B * IA + Q * BA) * oA, C[6] = (S * R - F * W - l * k) * oA, C[7] = (t * W - n * R + D * k) * oA, C[8] = (E * uA - i * IA + s * $) * oA, C[9] = (g * IA - I * uA - Q * $) * oA, C[10] = (F * M - U * R + l * f) * oA, C[11] = (e * R - t * M - D * f) * oA, C[12] = (i * BA - E * iA - o * $) * oA, C[13] = (I * iA - g * BA + B * $) * oA, C[14] = (U * k - F * L - S * f) * oA, C[15] = (t * L - e * k + n * f) * oA, C) : null;
|
|
853
853
|
}
|
|
@@ -903,13 +903,13 @@ function P(C, A, I) {
|
|
|
903
903
|
var g = new DA(3);
|
|
904
904
|
return g[0] = C, g[1] = A, g[2] = I, g;
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function $g(C, A) {
|
|
907
907
|
return C[0] = A[0], C[1] = A[1], C[2] = A[2], C;
|
|
908
908
|
}
|
|
909
909
|
function $A(C, A, I, g) {
|
|
910
910
|
return C[0] = A, C[1] = I, C[2] = g, C;
|
|
911
911
|
}
|
|
912
|
-
function
|
|
912
|
+
function HI(C, A, I) {
|
|
913
913
|
return C[0] = A[0] + I[0], C[1] = A[1] + I[1], C[2] = A[2] + I[2], C;
|
|
914
914
|
}
|
|
915
915
|
function zE(C, A, I) {
|
|
@@ -918,7 +918,7 @@ function zE(C, A, I) {
|
|
|
918
918
|
function $E(C, A, I) {
|
|
919
919
|
return C[0] = A[0] * I[0], C[1] = A[1] * I[1], C[2] = A[2] * I[2], C;
|
|
920
920
|
}
|
|
921
|
-
function
|
|
921
|
+
function qI(C, A, I) {
|
|
922
922
|
return C[0] = A[0] * I, C[1] = A[1] * I, C[2] = A[2] * I, C;
|
|
923
923
|
}
|
|
924
924
|
function oC(C, A, I, g) {
|
|
@@ -935,7 +935,7 @@ function Ai(C, A) {
|
|
|
935
935
|
function RQ(C, A) {
|
|
936
936
|
return C[0] * A[0] + C[1] * A[1] + C[2] * A[2];
|
|
937
937
|
}
|
|
938
|
-
function
|
|
938
|
+
function Hg(C, A, I) {
|
|
939
939
|
var g = A[0], B = A[1], Q = A[2], E = I[0], i = I[1], o = I[2];
|
|
940
940
|
return C[0] = B * o - Q * i, C[1] = Q * E - g * o, C[2] = g * i - B * E, C;
|
|
941
941
|
}
|
|
@@ -950,7 +950,7 @@ function NB(C, A) {
|
|
|
950
950
|
var I = C[0], g = C[1], B = C[2], Q = A[0], E = A[1], i = A[2];
|
|
951
951
|
return Math.abs(I - Q) <= AA * Math.max(1, Math.abs(I), Math.abs(Q)) && Math.abs(g - E) <= AA * Math.max(1, Math.abs(g), Math.abs(E)) && Math.abs(B - i) <= AA * Math.max(1, Math.abs(B), Math.abs(i));
|
|
952
952
|
}
|
|
953
|
-
var
|
|
953
|
+
var AB = zE, gi = FB;
|
|
954
954
|
(function() {
|
|
955
955
|
var C = QA();
|
|
956
956
|
return function(A, I, g, B, Q, E) {
|
|
@@ -968,7 +968,7 @@ function Bi(C) {
|
|
|
968
968
|
var A = new DA(4);
|
|
969
969
|
return A[0] = C[0], A[1] = C[1], A[2] = C[2], A[3] = C[3], A;
|
|
970
970
|
}
|
|
971
|
-
function
|
|
971
|
+
function Qg(C, A, I, g) {
|
|
972
972
|
var B = new DA(4);
|
|
973
973
|
return B[0] = C, B[1] = A, B[2] = I, B[3] = g, B;
|
|
974
974
|
}
|
|
@@ -982,7 +982,7 @@ function Ei(C, A) {
|
|
|
982
982
|
var I = A[0], g = A[1], B = A[2], Q = A[3], E = I * I + g * g + B * B + Q * Q;
|
|
983
983
|
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;
|
|
984
984
|
}
|
|
985
|
-
function
|
|
985
|
+
function pI(C, A, I) {
|
|
986
986
|
var g = A[0], B = A[1], Q = A[2], E = A[3];
|
|
987
987
|
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;
|
|
988
988
|
}
|
|
@@ -995,7 +995,7 @@ function qI(C, A, I) {
|
|
|
995
995
|
return A;
|
|
996
996
|
};
|
|
997
997
|
})();
|
|
998
|
-
function
|
|
998
|
+
function IB() {
|
|
999
999
|
var C = new DA(4);
|
|
1000
1000
|
return DA != Float32Array && (C[0] = 0, C[1] = 0, C[2] = 0), C[3] = 1, C;
|
|
1001
1001
|
}
|
|
@@ -1008,7 +1008,7 @@ function oi(C, A, I) {
|
|
|
1008
1008
|
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];
|
|
1009
1009
|
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;
|
|
1010
1010
|
}
|
|
1011
|
-
function
|
|
1011
|
+
function qg(C, A, I, g) {
|
|
1012
1012
|
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, U, S;
|
|
1013
1013
|
return D = B * o + Q * s + E * t + i * e, D < 0 && (D = -D, o = -o, s = -s, t = -t, e = -e), 1 - D > AA ? (n = Math.acos(D), F = Math.sin(n), U = Math.sin((1 - g) * n) / F, S = Math.sin(g * n) / F) : (U = 1 - g, S = g), C[0] = U * B + S * o, C[1] = U * Q + S * s, C[2] = U * E + S * t, C[3] = U * i + S * e, C;
|
|
1014
1014
|
}
|
|
@@ -1029,13 +1029,13 @@ var si = Bi, ti = Ci, RB = Ei;
|
|
|
1029
1029
|
var C = QA(), A = P(1, 0, 0), I = P(0, 1, 0);
|
|
1030
1030
|
return function(g, B, Q) {
|
|
1031
1031
|
var E = RQ(B, Q);
|
|
1032
|
-
return E < -0.999999 ? (
|
|
1032
|
+
return E < -0.999999 ? (Hg(C, A, B), gi(C) < 1e-6 && Hg(C, I, B), Ai(C, C), ii(g, C, Math.PI), g) : E > 0.999999 ? (g[0] = 0, g[1] = 0, g[2] = 0, g[3] = 1, g) : (Hg(C, B, Q), g[0] = C[0], g[1] = C[1], g[2] = C[2], g[3] = 1 + E, RB(g, g));
|
|
1033
1033
|
};
|
|
1034
1034
|
})();
|
|
1035
1035
|
(function() {
|
|
1036
|
-
var C =
|
|
1036
|
+
var C = IB(), A = IB();
|
|
1037
1037
|
return function(I, g, B, Q, E, i) {
|
|
1038
|
-
return
|
|
1038
|
+
return qg(C, g, E, i), qg(A, B, Q, i), qg(I, C, A, 2 * i * (1 - i)), I;
|
|
1039
1039
|
};
|
|
1040
1040
|
})();
|
|
1041
1041
|
(function() {
|
|
@@ -1071,7 +1071,7 @@ function ni(C, A, I, g) {
|
|
|
1071
1071
|
function eC(C, A) {
|
|
1072
1072
|
return C[0] === A[0] && C[1] === A[1];
|
|
1073
1073
|
}
|
|
1074
|
-
function
|
|
1074
|
+
function pg(C, A) {
|
|
1075
1075
|
var I = C[0], g = C[1], B = A[0], Q = A[1];
|
|
1076
1076
|
return Math.abs(I - B) <= AA * Math.max(1, Math.abs(I), Math.abs(B)) && Math.abs(g - Q) <= AA * Math.max(1, Math.abs(g), Math.abs(Q));
|
|
1077
1077
|
}
|
|
@@ -1288,7 +1288,7 @@ function LQ(C) {
|
|
|
1288
1288
|
return 4;
|
|
1289
1289
|
}
|
|
1290
1290
|
}
|
|
1291
|
-
function
|
|
1291
|
+
function mI(C) {
|
|
1292
1292
|
const A = lQ(C) * LQ(C), I = Math.max(1, C.mipmapLevels);
|
|
1293
1293
|
let g = Math.max(1, C.width), B = Math.max(1, C.height), Q = Math.max(1, C.depth), E = 0;
|
|
1294
1294
|
for (let i = 0; i < I; ++i)
|
|
@@ -1424,7 +1424,7 @@ class yi {
|
|
|
1424
1424
|
const I = this.textures_.get(A);
|
|
1425
1425
|
if (I) {
|
|
1426
1426
|
this.gl_.deleteTexture(I), this.textures_.delete(A), A.readTexel = void 0, this.currentTexture_ === A && (this.currentTexture_ = null);
|
|
1427
|
-
const g =
|
|
1427
|
+
const g = mI(A);
|
|
1428
1428
|
this.gpuTextureBytes_ = Math.max(0, this.gpuTextureBytes_ - g), this.textureCount_ = Math.max(0, this.textureCount_ - 1);
|
|
1429
1429
|
}
|
|
1430
1430
|
}
|
|
@@ -1458,7 +1458,7 @@ class yi {
|
|
|
1458
1458
|
);
|
|
1459
1459
|
else
|
|
1460
1460
|
throw new Error(`Unknown texture type ${A.type}`);
|
|
1461
|
-
this.gpuTextureBytes_ +=
|
|
1461
|
+
this.gpuTextureBytes_ += mI(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));
|
|
1462
1462
|
}
|
|
1463
1463
|
configureTextureParameters(A, I) {
|
|
1464
1464
|
const g = this.gl_, B = this.getFilter(A.minFilter, A), Q = this.getFilter(A.maxFilter, A);
|
|
@@ -1871,7 +1871,7 @@ class aC extends FQ {
|
|
|
1871
1871
|
);
|
|
1872
1872
|
break;
|
|
1873
1873
|
case "u_cameraPositionModel": {
|
|
1874
|
-
const U =
|
|
1874
|
+
const U = Ug(SA(), E), S = Qg(0, 0, 0, 1), l = pI(
|
|
1875
1875
|
nI(),
|
|
1876
1876
|
S,
|
|
1877
1877
|
U
|
|
@@ -2106,7 +2106,7 @@ function di(C) {
|
|
|
2106
2106
|
}), I += `${g.type},${g.offset},${g.itemSize}|`;
|
|
2107
2107
|
return { attributes: A, attributesKey: I };
|
|
2108
2108
|
}
|
|
2109
|
-
class
|
|
2109
|
+
class vI extends UB {
|
|
2110
2110
|
width_;
|
|
2111
2111
|
height_;
|
|
2112
2112
|
depth_;
|
|
@@ -2131,7 +2131,7 @@ class TI extends UB {
|
|
|
2131
2131
|
throw new Error(
|
|
2132
2132
|
"Unable to create texture, chunk data is not initialized."
|
|
2133
2133
|
);
|
|
2134
|
-
const g = new
|
|
2134
|
+
const g = new vI(
|
|
2135
2135
|
I,
|
|
2136
2136
|
A.shape.x,
|
|
2137
2137
|
A.shape.y,
|
|
@@ -2156,11 +2156,11 @@ class li {
|
|
|
2156
2156
|
if (!I) {
|
|
2157
2157
|
const g = this.device_.createTexture({
|
|
2158
2158
|
size: nC(A),
|
|
2159
|
-
dimension: A instanceof
|
|
2159
|
+
dimension: A instanceof vI ? "3d" : "2d",
|
|
2160
2160
|
format: Ji(A),
|
|
2161
2161
|
usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST | GPUTextureUsage.COPY_SRC
|
|
2162
2162
|
}), B = { entry: A, texture: g };
|
|
2163
|
-
I = B, this.textures_.push(B), this.textureCount_ += 1, this.gpuTextureBytes_ +=
|
|
2163
|
+
I = B, this.textures_.push(B), this.textureCount_ += 1, this.gpuTextureBytes_ += mI(A);
|
|
2164
2164
|
}
|
|
2165
2165
|
return this.upload(A, I.texture), A.readTexel = (g, B, Q) => this.readTexel(I.texture, A.dataType, g, B, Q), I.texture;
|
|
2166
2166
|
}
|
|
@@ -2200,7 +2200,7 @@ class li {
|
|
|
2200
2200
|
const I = this.textures_.findIndex((B) => B.entry === A);
|
|
2201
2201
|
if (I === -1) return;
|
|
2202
2202
|
this.textures_[I].texture.destroy(), this.textures_.splice(I, 1), A.readTexel = void 0;
|
|
2203
|
-
const g =
|
|
2203
|
+
const g = mI(A);
|
|
2204
2204
|
this.gpuTextureBytes_ = Math.max(0, this.gpuTextureBytes_ - g), this.textureCount_ = Math.max(0, this.textureCount_ - 1);
|
|
2205
2205
|
}
|
|
2206
2206
|
disposeAll() {
|
|
@@ -2212,7 +2212,7 @@ function nC(C) {
|
|
|
2212
2212
|
return {
|
|
2213
2213
|
width: C.width,
|
|
2214
2214
|
height: C.height,
|
|
2215
|
-
depthOrArrayLayers: C instanceof
|
|
2215
|
+
depthOrArrayLayers: C instanceof vI ? C.depth : 1
|
|
2216
2216
|
};
|
|
2217
2217
|
}
|
|
2218
2218
|
function Li(C, A) {
|
|
@@ -2413,7 +2413,7 @@ function qi(C, A, I) {
|
|
|
2413
2413
|
};
|
|
2414
2414
|
return { views: Q(C, g), arrayBuffer: B };
|
|
2415
2415
|
}
|
|
2416
|
-
function
|
|
2416
|
+
function gB(C, A) {
|
|
2417
2417
|
if (C !== void 0)
|
|
2418
2418
|
if (rC(A)) {
|
|
2419
2419
|
const I = A;
|
|
@@ -2430,13 +2430,13 @@ function IB(C, A) {
|
|
|
2430
2430
|
} else if (Array.isArray(A)) {
|
|
2431
2431
|
const I = A;
|
|
2432
2432
|
C.forEach((g, B) => {
|
|
2433
|
-
|
|
2433
|
+
gB(g, I[B]);
|
|
2434
2434
|
});
|
|
2435
2435
|
} else {
|
|
2436
2436
|
const I = A;
|
|
2437
2437
|
for (const [g, B] of Object.entries(C)) {
|
|
2438
2438
|
const Q = I[g];
|
|
2439
|
-
Q &&
|
|
2439
|
+
Q && gB(B, Q);
|
|
2440
2440
|
}
|
|
2441
2441
|
}
|
|
2442
2442
|
}
|
|
@@ -2445,24 +2445,24 @@ function pi(C, A, I = 0) {
|
|
|
2445
2445
|
return {
|
|
2446
2446
|
...Q,
|
|
2447
2447
|
set(E) {
|
|
2448
|
-
|
|
2448
|
+
gB(E, Q.views);
|
|
2449
2449
|
}
|
|
2450
2450
|
};
|
|
2451
2451
|
}
|
|
2452
|
-
function
|
|
2452
|
+
function BB(C) {
|
|
2453
2453
|
const I = C.elementType;
|
|
2454
2454
|
if (I)
|
|
2455
|
-
return
|
|
2455
|
+
return BB(I);
|
|
2456
2456
|
const B = C.fields;
|
|
2457
2457
|
if (B)
|
|
2458
|
-
return Object.values(B).reduce((i, { type: o }) => Math.max(i,
|
|
2458
|
+
return Object.values(B).reduce((i, { type: o }) => Math.max(i, BB(o)), 0);
|
|
2459
2459
|
const { type: Q } = C, { align: E } = SI[Q];
|
|
2460
2460
|
return E;
|
|
2461
2461
|
}
|
|
2462
2462
|
function YQ(C) {
|
|
2463
2463
|
const I = C.elementType;
|
|
2464
2464
|
if (I) {
|
|
2465
|
-
const Q = I.size, E =
|
|
2465
|
+
const Q = I.size, E = BB(I);
|
|
2466
2466
|
return {
|
|
2467
2467
|
unalignedSize: Q,
|
|
2468
2468
|
align: E,
|
|
@@ -2549,7 +2549,7 @@ class VA extends kA {
|
|
|
2549
2549
|
return `array<${this.format.getTypeName()}, ${this.count}>`;
|
|
2550
2550
|
}
|
|
2551
2551
|
}
|
|
2552
|
-
class
|
|
2552
|
+
class CB extends kA {
|
|
2553
2553
|
constructor(A, I, g) {
|
|
2554
2554
|
super(A, g), this.format = I;
|
|
2555
2555
|
}
|
|
@@ -2870,7 +2870,7 @@ function _(C, A, I, g, B) {
|
|
|
2870
2870
|
}
|
|
2871
2871
|
return B;
|
|
2872
2872
|
}
|
|
2873
|
-
const pg = { r8unorm: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8snorm: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8uint: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8sint: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg8unorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8snorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8uint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8sint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba8unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "rgba8unorm-srgb": { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8snorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, bgra8unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "bgra8unorm-srgb": { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, r16uint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r16sint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r16float: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg16uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg16sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg16float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba16uint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba16sint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba16float: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, r32uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r32sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r32float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg32uint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg32sint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg32float: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba32uint: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba32sint: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba32float: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgb10a2uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgb10a2unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rg11b10ufloat: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, stencil8: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !1, hasStencil: !0, channels: 1 }, depth16unorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, channels: 1 }, depth24plus: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, depthOnlyFormat: "depth32float", channels: 1 }, "depth24plus-stencil8": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !0, depthOnlyFormat: "depth32float", channels: 1 }, depth32float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, channels: 1 }, "depth32float-stencil8": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !0, stencilOnlyFormat: "depth32float", channels: 1 }, rgb9e5ufloat: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "bc1-rgba-unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc1-rgba-unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc2-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc2-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc3-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc3-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc4-r-unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 1 }, "bc4-r-snorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 1 }, "bc5-rg-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 2 }, "bc5-rg-snorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 2 }, "bc6h-rgb-ufloat": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc6h-rgb-float": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc7-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc7-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8a1unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8a1unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgba8unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgba8unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "eac-r11unorm": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 1 }, "eac-r11snorm": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 1 }, "eac-rg11unorm": { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 2 }, "eac-rg11snorm": { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 2 }, "astc-4x4-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-4x4-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x4-unorm": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x4-unorm-srgb": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x5-unorm": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-5x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x5-unorm": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x6-unorm": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-6x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x5-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-8x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-8x6-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x8-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-8x8-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x5-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-10x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-10x6-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-10x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-10x8-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x8-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x10-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-10x10-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x10-unorm": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x10-unorm-srgb": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x12-unorm": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 12, isCompressed: !0, channels: 4 }, "astc-12x12-unorm-srgb": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 12, isCompressed: !0, channels: 4 } };
|
|
2873
|
+
const mg = { r8unorm: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8snorm: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8uint: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8sint: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg8unorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8snorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8uint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8sint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba8unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "rgba8unorm-srgb": { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8snorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, bgra8unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "bgra8unorm-srgb": { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, r16uint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r16sint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r16float: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg16uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg16sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg16float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba16uint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba16sint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba16float: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, r32uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r32sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r32float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg32uint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg32sint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg32float: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba32uint: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba32sint: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba32float: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgb10a2uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgb10a2unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rg11b10ufloat: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, stencil8: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !1, hasStencil: !0, channels: 1 }, depth16unorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, channels: 1 }, depth24plus: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, depthOnlyFormat: "depth32float", channels: 1 }, "depth24plus-stencil8": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !0, depthOnlyFormat: "depth32float", channels: 1 }, depth32float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, channels: 1 }, "depth32float-stencil8": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !0, stencilOnlyFormat: "depth32float", channels: 1 }, rgb9e5ufloat: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "bc1-rgba-unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc1-rgba-unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc2-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc2-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc3-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc3-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc4-r-unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 1 }, "bc4-r-snorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 1 }, "bc5-rg-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 2 }, "bc5-rg-snorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 2 }, "bc6h-rgb-ufloat": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc6h-rgb-float": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc7-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc7-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8a1unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8a1unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgba8unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgba8unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "eac-r11unorm": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 1 }, "eac-r11snorm": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 1 }, "eac-rg11unorm": { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 2 }, "eac-rg11snorm": { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 2 }, "astc-4x4-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-4x4-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x4-unorm": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x4-unorm-srgb": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x5-unorm": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-5x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x5-unorm": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x6-unorm": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-6x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x5-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-8x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-8x6-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x8-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-8x8-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x5-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-10x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-10x6-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-10x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-10x8-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x8-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x10-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-10x10-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x10-unorm": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x10-unorm-srgb": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x12-unorm": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 12, isCompressed: !0, channels: 4 }, "astc-12x12-unorm-srgb": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 12, isCompressed: !0, channels: 4 } };
|
|
2874
2874
|
class dA {
|
|
2875
2875
|
constructor() {
|
|
2876
2876
|
this.id = dA._id++, this.line = 0;
|
|
@@ -2886,9 +2886,9 @@ class dA {
|
|
|
2886
2886
|
}
|
|
2887
2887
|
searchBlock(A, I) {
|
|
2888
2888
|
if (A) {
|
|
2889
|
-
I(Qg.instance);
|
|
2890
|
-
for (const g of A) g instanceof Array ? this.searchBlock(g, I) : g.search(I);
|
|
2891
2889
|
I(Eg.instance);
|
|
2890
|
+
for (const g of A) g instanceof Array ? this.searchBlock(g, I) : g.search(I);
|
|
2891
|
+
I(ig.instance);
|
|
2892
2892
|
}
|
|
2893
2893
|
}
|
|
2894
2894
|
constEvaluate(A, I) {
|
|
@@ -2900,16 +2900,16 @@ class dA {
|
|
|
2900
2900
|
}
|
|
2901
2901
|
}
|
|
2902
2902
|
dA._id = 0;
|
|
2903
|
-
class Qg extends dA {
|
|
2904
|
-
}
|
|
2905
|
-
Qg.instance = new Qg();
|
|
2906
2903
|
class Eg extends dA {
|
|
2907
2904
|
}
|
|
2908
2905
|
Eg.instance = new Eg();
|
|
2906
|
+
class ig extends dA {
|
|
2907
|
+
}
|
|
2908
|
+
ig.instance = new ig();
|
|
2909
2909
|
const fQ = /* @__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"]);
|
|
2910
2910
|
class EA extends dA {
|
|
2911
2911
|
}
|
|
2912
|
-
class
|
|
2912
|
+
class xI extends EA {
|
|
2913
2913
|
constructor(A, I, g, B, Q, E) {
|
|
2914
2914
|
super(), this.calls = /* @__PURE__ */ new Set(), this.name = A, this.args = I, this.returnType = g, this.body = B, this.startLine = Q, this.endLine = E;
|
|
2915
2915
|
}
|
|
@@ -2945,7 +2945,7 @@ class KQ extends EA {
|
|
|
2945
2945
|
this.condition.search(A), this.searchBlock(this.body, A);
|
|
2946
2946
|
}
|
|
2947
2947
|
}
|
|
2948
|
-
class
|
|
2948
|
+
class QB extends EA {
|
|
2949
2949
|
constructor(A, I) {
|
|
2950
2950
|
super(), this.body = A, this.loopId = I;
|
|
2951
2951
|
}
|
|
@@ -2992,7 +2992,7 @@ class LB extends EA {
|
|
|
2992
2992
|
(I = this.value) === null || I === void 0 || I.search(A);
|
|
2993
2993
|
}
|
|
2994
2994
|
}
|
|
2995
|
-
class
|
|
2995
|
+
class uI extends EA {
|
|
2996
2996
|
constructor(A, I, g, B, Q) {
|
|
2997
2997
|
super(), this.attributes = null, this.name = A, this.type = I, this.storage = g, this.access = B, this.value = Q;
|
|
2998
2998
|
}
|
|
@@ -3004,7 +3004,7 @@ class MI extends EA {
|
|
|
3004
3004
|
A(this), (I = this.value) === null || I === void 0 || I.search(A);
|
|
3005
3005
|
}
|
|
3006
3006
|
}
|
|
3007
|
-
class
|
|
3007
|
+
class Ag extends EA {
|
|
3008
3008
|
constructor(A, I, g, B, Q) {
|
|
3009
3009
|
super(), this.attributes = null, this.name = A, this.type = I, this.storage = g, this.access = B, this.value = Q;
|
|
3010
3010
|
}
|
|
@@ -3248,7 +3248,7 @@ class w extends N {
|
|
|
3248
3248
|
}
|
|
3249
3249
|
}
|
|
3250
3250
|
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);
|
|
3251
|
-
class
|
|
3251
|
+
class Ig extends N {
|
|
3252
3252
|
constructor(A, I, g, B) {
|
|
3253
3253
|
super(A), this.storage = I, this.type = g, this.access = B;
|
|
3254
3254
|
}
|
|
@@ -3256,7 +3256,7 @@ class $I extends N {
|
|
|
3256
3256
|
return "pointer";
|
|
3257
3257
|
}
|
|
3258
3258
|
}
|
|
3259
|
-
class
|
|
3259
|
+
class fI extends N {
|
|
3260
3260
|
constructor(A, I, g, B) {
|
|
3261
3261
|
super(A), this.attributes = I, this.format = g, this.count = B;
|
|
3262
3262
|
}
|
|
@@ -3444,7 +3444,7 @@ class _Q extends dA {
|
|
|
3444
3444
|
A(this), this.searchBlock(this.body, A);
|
|
3445
3445
|
}
|
|
3446
3446
|
}
|
|
3447
|
-
class
|
|
3447
|
+
class gg extends YA {
|
|
3448
3448
|
get astNodeType() {
|
|
3449
3449
|
return "default";
|
|
3450
3450
|
}
|
|
@@ -3532,7 +3532,7 @@ class NC extends MA {
|
|
|
3532
3532
|
return this.typeInfo.name;
|
|
3533
3533
|
}
|
|
3534
3534
|
}
|
|
3535
|
-
class
|
|
3535
|
+
class EB extends MA {
|
|
3536
3536
|
constructor() {
|
|
3537
3537
|
super(new kA("void", null), null);
|
|
3538
3538
|
}
|
|
@@ -3543,10 +3543,10 @@ class QB extends MA {
|
|
|
3543
3543
|
return "void";
|
|
3544
3544
|
}
|
|
3545
3545
|
}
|
|
3546
|
-
|
|
3546
|
+
EB.void = new EB();
|
|
3547
3547
|
class iI extends MA {
|
|
3548
3548
|
constructor(A) {
|
|
3549
|
-
super(new
|
|
3549
|
+
super(new CB("pointer", A.typeInfo, null), null), this.reference = A;
|
|
3550
3550
|
}
|
|
3551
3551
|
clone() {
|
|
3552
3552
|
return this;
|
|
@@ -4044,18 +4044,18 @@ class xA extends MA {
|
|
|
4044
4044
|
return I;
|
|
4045
4045
|
}
|
|
4046
4046
|
get texelByteSize() {
|
|
4047
|
-
const A = this.format, I =
|
|
4047
|
+
const A = this.format, I = mg[A];
|
|
4048
4048
|
return I ? I.isDepthStencil ? 4 : I.bytesPerBlock : 0;
|
|
4049
4049
|
}
|
|
4050
4050
|
get bytesPerRow() {
|
|
4051
4051
|
return this.width * this.texelByteSize;
|
|
4052
4052
|
}
|
|
4053
4053
|
get isDepthStencil() {
|
|
4054
|
-
const A = this.format, I =
|
|
4054
|
+
const A = this.format, I = mg[A];
|
|
4055
4055
|
return !!I && I.isDepthStencil;
|
|
4056
4056
|
}
|
|
4057
4057
|
getGpuSize() {
|
|
4058
|
-
const A = this.format, I =
|
|
4058
|
+
const A = this.format, I = mg[A], g = this.width;
|
|
4059
4059
|
if (!A || g <= 0 || !I) return -1;
|
|
4060
4060
|
const B = this.height, Q = this.depthOrArrayLayers, E = this.dimension;
|
|
4061
4061
|
return g / I.blockWidth * (E === "1d" ? 1 : B / I.blockHeight) * I.bytesPerBlock * Q;
|
|
@@ -4174,7 +4174,7 @@ class RC {
|
|
|
4174
4174
|
return this.isArrayType() || this.isTemplateType();
|
|
4175
4175
|
}
|
|
4176
4176
|
}
|
|
4177
|
-
class
|
|
4177
|
+
class dg {
|
|
4178
4178
|
constructor(A) {
|
|
4179
4179
|
this._tokens = [], this._start = 0, this._current = 0, this._line = 1, this._source = A ?? "";
|
|
4180
4180
|
}
|
|
@@ -4270,7 +4270,7 @@ class Ug {
|
|
|
4270
4270
|
return this._current >= this._source.length;
|
|
4271
4271
|
}
|
|
4272
4272
|
_isAlpha(A) {
|
|
4273
|
-
return !this._isNumeric(A) && !this._isWhitespace(A) && A !== "_" && !
|
|
4273
|
+
return !this._isNumeric(A) && !this._isWhitespace(A) && A !== "_" && !dg._operators.has(A);
|
|
4274
4274
|
}
|
|
4275
4275
|
_isNumeric(A) {
|
|
4276
4276
|
return A >= "0" && A <= "9";
|
|
@@ -4296,20 +4296,20 @@ class Ug {
|
|
|
4296
4296
|
function J(C) {
|
|
4297
4297
|
return Array.isArray(C) || C?.buffer instanceof ArrayBuffer;
|
|
4298
4298
|
}
|
|
4299
|
-
|
|
4299
|
+
dg._operators = /* @__PURE__ */ new Set([".", "(", ")", "[", "]", "{", "}", ",", ";", ":", "=", "!", "<", ">", "+", "-", "*", "/", "%", "&", "|", "^", "~", "@", "#", "?", "'", "`", '"', "\\", `
|
|
4300
4300
|
`, "\r", " ", "\0"]);
|
|
4301
|
-
const
|
|
4301
|
+
const og = new Float32Array(1), Ao = new Uint32Array(og.buffer), Io = new Uint32Array(og.buffer), sg = new Int32Array(1), go = new Float32Array(sg.buffer), Bo = new Uint32Array(sg.buffer), tg = new Uint32Array(1), Co = new Float32Array(tg.buffer), Qo = new Int32Array(tg.buffer);
|
|
4302
4302
|
function kC(C, A, I) {
|
|
4303
4303
|
if (A === I) return C;
|
|
4304
4304
|
if (A === "f32") {
|
|
4305
|
-
if (I === "i32" || I === "x32") return
|
|
4306
|
-
if (I === "u32") return
|
|
4305
|
+
if (I === "i32" || I === "x32") return og[0] = C, Ao[0];
|
|
4306
|
+
if (I === "u32") return og[0] = C, Io[0];
|
|
4307
4307
|
} else if (A === "i32" || A === "x32") {
|
|
4308
|
-
if (I === "f32") return
|
|
4309
|
-
if (I === "u32") return
|
|
4308
|
+
if (I === "f32") return sg[0] = C, go[0];
|
|
4309
|
+
if (I === "u32") return sg[0] = C, Bo[0];
|
|
4310
4310
|
} else if (A === "u32") {
|
|
4311
|
-
if (I === "f32") return
|
|
4312
|
-
if (I === "i32" || I === "x32") return
|
|
4311
|
+
if (I === "f32") return tg[0] = C, Co[0];
|
|
4312
|
+
if (I === "i32" || I === "x32") return tg[0] = C, Qo[0];
|
|
4313
4313
|
}
|
|
4314
4314
|
return console.error(`Unsupported cast from ${A} to ${I}`), C;
|
|
4315
4315
|
}
|
|
@@ -4318,7 +4318,7 @@ class Eo {
|
|
|
4318
4318
|
this.resources = null, this.inUse = !1, this.info = null, this.node = A;
|
|
4319
4319
|
}
|
|
4320
4320
|
}
|
|
4321
|
-
class
|
|
4321
|
+
class zI {
|
|
4322
4322
|
constructor(A, I) {
|
|
4323
4323
|
this.align = A, this.size = I;
|
|
4324
4324
|
}
|
|
@@ -4331,7 +4331,7 @@ class qA {
|
|
|
4331
4331
|
return A.name == "texture_storage_1d" || A.name == "texture_storage_2d" || A.name == "texture_storage_2d_array" || A.name == "texture_storage_3d";
|
|
4332
4332
|
}
|
|
4333
4333
|
updateAST(A) {
|
|
4334
|
-
for (const I of A) I instanceof
|
|
4334
|
+
for (const I of A) I instanceof xI && this._functions.set(I.name, new Eo(I));
|
|
4335
4335
|
for (const I of A) if (I instanceof mA) {
|
|
4336
4336
|
const g = this.getTypeInfo(I, null);
|
|
4337
4337
|
g instanceof ZA && this.structs.push(g);
|
|
@@ -4369,7 +4369,7 @@ class qA {
|
|
|
4369
4369
|
continue;
|
|
4370
4370
|
}
|
|
4371
4371
|
}
|
|
4372
|
-
for (const I of A) if (I instanceof
|
|
4372
|
+
for (const I of A) if (I instanceof xI) {
|
|
4373
4373
|
const g = this._getAttribute(I, "vertex"), B = this._getAttribute(I, "fragment"), Q = this._getAttribute(I, "compute"), E = g || B || Q, i = new Wi(I.name, E?.name, I.attributes);
|
|
4374
4374
|
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 Ti(o.name, this.getTypeInfo(o.type, o.attributes), o.attributes)), i.returnType = I.returnType ? this.getTypeInfo(I.returnType, I.attributes) : null;
|
|
4375
4375
|
continue;
|
|
@@ -4446,15 +4446,15 @@ class qA {
|
|
|
4446
4446
|
_findResources(A, I) {
|
|
4447
4447
|
const g = [], B = this, Q = [];
|
|
4448
4448
|
return A.search((E) => {
|
|
4449
|
-
if (E instanceof
|
|
4450
|
-
else if (E instanceof
|
|
4449
|
+
if (E instanceof Eg) Q.push({});
|
|
4450
|
+
else if (E instanceof ig) Q.pop();
|
|
4451
4451
|
else if (E instanceof HA) {
|
|
4452
4452
|
const i = E;
|
|
4453
4453
|
I && i.type !== null && this._markStructsFromAST(i.type), Q.length > 0 && (Q[Q.length - 1][i.name] = i);
|
|
4454
4454
|
} else if (E instanceof KA) {
|
|
4455
4455
|
const i = E;
|
|
4456
4456
|
I && i.type !== null && this._markStructsFromAST(i.type);
|
|
4457
|
-
} else if (E instanceof
|
|
4457
|
+
} else if (E instanceof uI) {
|
|
4458
4458
|
const i = E;
|
|
4459
4459
|
I && i.type !== null && this._markStructsFromAST(i.type), Q.length > 0 && (Q[Q.length - 1][i.name] = i);
|
|
4460
4460
|
} else if (E instanceof wA) {
|
|
@@ -4573,11 +4573,11 @@ class qA {
|
|
|
4573
4573
|
}
|
|
4574
4574
|
getTypeInfo(A, I = null) {
|
|
4575
4575
|
if (this._types.has(A)) return this._types.get(A);
|
|
4576
|
-
if (A instanceof
|
|
4577
|
-
const B = A.type ? this.getTypeInfo(A.type, A.attributes) : null, Q = new
|
|
4576
|
+
if (A instanceof Ig) {
|
|
4577
|
+
const B = A.type ? this.getTypeInfo(A.type, A.attributes) : null, Q = new CB(A.name, B, I);
|
|
4578
4578
|
return this._types.set(A, Q), this._updateTypeInfo(Q), Q;
|
|
4579
4579
|
}
|
|
4580
|
-
if (A instanceof
|
|
4580
|
+
if (A instanceof fI) {
|
|
4581
4581
|
const B = A, Q = B.format ? this.getTypeInfo(B.format, B.attributes) : null, E = new VA(B.name, I);
|
|
4582
4582
|
return E.format = Q, E.count = B.count, this._types.set(A, E), this._updateTypeInfo(E), E;
|
|
4583
4583
|
}
|
|
@@ -4608,7 +4608,7 @@ class qA {
|
|
|
4608
4608
|
const E = this._getTypeSize(A.format);
|
|
4609
4609
|
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);
|
|
4610
4610
|
}
|
|
4611
|
-
A instanceof
|
|
4611
|
+
A instanceof CB && this._updateTypeInfo(A.format), A instanceof ZA && this._updateStructInfo(A);
|
|
4612
4612
|
}
|
|
4613
4613
|
_updateStructInfo(A) {
|
|
4614
4614
|
var I;
|
|
@@ -4634,20 +4634,20 @@ class qA {
|
|
|
4634
4634
|
const E = qA._typeInfo[A.name];
|
|
4635
4635
|
if (E !== void 0) {
|
|
4636
4636
|
const i = ((I = A.format) === null || I === void 0 ? void 0 : I.name) === "f16" ? 2 : 1;
|
|
4637
|
-
return new
|
|
4637
|
+
return new zI(Math.max(Q, E.align / i), Math.max(B, E.size / i));
|
|
4638
4638
|
}
|
|
4639
4639
|
}
|
|
4640
4640
|
{
|
|
4641
4641
|
const E = qA._typeInfo[A.name.substring(0, A.name.length - 1)];
|
|
4642
4642
|
if (E) {
|
|
4643
4643
|
const i = A.name[A.name.length - 1] === "h" ? 2 : 1;
|
|
4644
|
-
return new
|
|
4644
|
+
return new zI(Math.max(Q, E.align / i), Math.max(B, E.size / i));
|
|
4645
4645
|
}
|
|
4646
4646
|
}
|
|
4647
4647
|
if (A instanceof VA) {
|
|
4648
4648
|
let E = A, i = 8, o = 8;
|
|
4649
4649
|
const s = this._getTypeSize(E.format);
|
|
4650
|
-
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
|
|
4650
|
+
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 zI(Math.max(Q, i), Math.max(B, o));
|
|
4651
4651
|
}
|
|
4652
4652
|
if (A instanceof ZA) {
|
|
4653
4653
|
let E = 0, i = 0, o = 0, s = 0, t = 0;
|
|
@@ -4655,7 +4655,7 @@ class qA {
|
|
|
4655
4655
|
const n = this._getTypeSize(e.type);
|
|
4656
4656
|
n !== null && (E = Math.max(n.align, E), o = this._roundUp(n.align, o + s), s = n.size, t = o);
|
|
4657
4657
|
}
|
|
4658
|
-
return i = this._roundUp(E, t + s), new
|
|
4658
|
+
return i = this._roundUp(E, t + s), new zI(Math.max(Q, E), Math.max(B, i));
|
|
4659
4659
|
}
|
|
4660
4660
|
return null;
|
|
4661
4661
|
}
|
|
@@ -5579,7 +5579,7 @@ class oo {
|
|
|
5579
5579
|
return console.error("TODO: quadSwapY"), null;
|
|
5580
5580
|
}
|
|
5581
5581
|
}
|
|
5582
|
-
const
|
|
5582
|
+
const xg = { vec2: 2, vec2f: 2, vec2i: 2, vec2u: 2, vec2b: 2, vec2h: 2, vec3: 3, vec3f: 3, vec3i: 3, vec3u: 3, vec3b: 3, vec3h: 3, vec4: 4, vec4f: 4, vec4i: 4, vec4u: 4, vec4b: 4, vec4h: 4 }, cA = { mat2x2: [2, 2, 4], mat2x2f: [2, 2, 4], mat2x2h: [2, 2, 4], mat2x3: [2, 3, 6], mat2x3f: [2, 3, 6], mat2x3h: [2, 3, 6], mat2x4: [2, 4, 8], mat2x4f: [2, 4, 8], mat2x4h: [2, 4, 8], mat3x2: [3, 2, 6], mat3x2f: [3, 2, 6], mat3x2h: [3, 2, 6], mat3x3: [3, 3, 9], mat3x3f: [3, 3, 9], mat3x3h: [3, 3, 9], mat3x4: [3, 4, 12], mat3x4f: [3, 4, 12], mat3x4h: [3, 4, 12], mat4x2: [4, 2, 8], mat4x2f: [4, 2, 8], mat4x2h: [4, 2, 8], mat4x3: [4, 3, 12], mat4x3f: [4, 3, 12], mat4x3h: [4, 3, 12], mat4x4: [4, 4, 16], mat4x4f: [4, 4, 16], mat4x4h: [4, 4, 16] };
|
|
5583
5583
|
class gA extends io {
|
|
5584
5584
|
constructor(A, I) {
|
|
5585
5585
|
var g;
|
|
@@ -5650,18 +5650,18 @@ class gA extends io {
|
|
|
5650
5650
|
return gA._breakObj;
|
|
5651
5651
|
}
|
|
5652
5652
|
if (A instanceof ZQ) return gA._continueObj;
|
|
5653
|
-
if (A instanceof
|
|
5653
|
+
if (A instanceof uI) this._let(A, I);
|
|
5654
5654
|
else if (A instanceof HA) this._var(A, I);
|
|
5655
|
-
else if (A instanceof
|
|
5655
|
+
else if (A instanceof Ag) this._const(A, I);
|
|
5656
5656
|
else if (A instanceof LB) this._override(A, I);
|
|
5657
|
-
else if (A instanceof
|
|
5657
|
+
else if (A instanceof xI) this._function(A, I);
|
|
5658
5658
|
else {
|
|
5659
5659
|
if (A instanceof bQ) return this._if(A, I);
|
|
5660
5660
|
if (A instanceof xQ) return this._switch(A, I);
|
|
5661
5661
|
if (A instanceof HQ) return this._for(A, I);
|
|
5662
5662
|
if (A instanceof KQ) return this._while(A, I);
|
|
5663
5663
|
if (A instanceof mQ) return this._loop(A, I);
|
|
5664
|
-
if (A instanceof
|
|
5664
|
+
if (A instanceof QB) {
|
|
5665
5665
|
const g = I.clone();
|
|
5666
5666
|
return g.currentFunctionName = I.currentFunctionName, this._execStatements(A.body, g);
|
|
5667
5667
|
}
|
|
@@ -5975,7 +5975,7 @@ class gA extends io {
|
|
|
5975
5975
|
} else {
|
|
5976
5976
|
if (A.type === null) return void console.error(`Variable ${A.name} has no type. Line ${A.line}`);
|
|
5977
5977
|
const B = A.type.name;
|
|
5978
|
-
if (gA._defaultableTypes.has(B) || A.type instanceof
|
|
5978
|
+
if (gA._defaultableTypes.has(B) || A.type instanceof fI || A.type instanceof mA || A.type instanceof w) {
|
|
5979
5979
|
const Q = new KA(A.type, []);
|
|
5980
5980
|
g = this._evalCreate(Q, I);
|
|
5981
5981
|
}
|
|
@@ -5988,7 +5988,7 @@ class gA extends io {
|
|
|
5988
5988
|
if (!(g instanceof c)) return console.error(`Invalid if condition. Line ${A.line}`), null;
|
|
5989
5989
|
let B = null;
|
|
5990
5990
|
for (const Q of A.cases) if (Q instanceof XQ) for (const E of Q.selectors) {
|
|
5991
|
-
if (E instanceof
|
|
5991
|
+
if (E instanceof gg) {
|
|
5992
5992
|
B = Q;
|
|
5993
5993
|
continue;
|
|
5994
5994
|
}
|
|
@@ -6085,7 +6085,7 @@ class gA extends io {
|
|
|
6085
6085
|
_evalCreate(A, I) {
|
|
6086
6086
|
var g;
|
|
6087
6087
|
if (A instanceof KA) {
|
|
6088
|
-
if (A.type === null) return
|
|
6088
|
+
if (A.type === null) return EB.void;
|
|
6089
6089
|
switch (A.type.getTypeName()) {
|
|
6090
6090
|
case "bool":
|
|
6091
6091
|
case "i32":
|
|
@@ -6285,7 +6285,7 @@ class gA extends io {
|
|
|
6285
6285
|
}
|
|
6286
6286
|
if (this._isMatrixType(g) && this._isVectorType(B)) {
|
|
6287
6287
|
const n = (function(D, F, U, S) {
|
|
6288
|
-
if (cA[F.name] === void 0 ||
|
|
6288
|
+
if (cA[F.name] === void 0 || xg[S.name] === void 0) return null;
|
|
6289
6289
|
const l = cA[F.name][0], f = cA[F.name][1];
|
|
6290
6290
|
if (l !== U.length) return null;
|
|
6291
6291
|
const k = new Array(f);
|
|
@@ -6300,7 +6300,7 @@ class gA extends io {
|
|
|
6300
6300
|
}
|
|
6301
6301
|
if (this._isVectorType(g) && this._isMatrixType(B)) {
|
|
6302
6302
|
const n = (function(D, F, U, S) {
|
|
6303
|
-
if (
|
|
6303
|
+
if (xg[F.name] === void 0 || cA[S.name] === void 0) return null;
|
|
6304
6304
|
const l = cA[S.name][0], f = cA[S.name][1];
|
|
6305
6305
|
if (f !== D.length) return null;
|
|
6306
6306
|
const k = [];
|
|
@@ -6910,7 +6910,7 @@ class gA extends io {
|
|
|
6910
6910
|
return g.typeInfo = this.getTypeInfo(A.type), g.getSubData(this, A.postfix, I).clone();
|
|
6911
6911
|
}
|
|
6912
6912
|
_callConstructorVec(A, I) {
|
|
6913
|
-
const g = this.getTypeInfo(A.type), B = A.type.getTypeName(), Q =
|
|
6913
|
+
const g = this.getTypeInfo(A.type), B = A.type.getTypeName(), Q = xg[B];
|
|
6914
6914
|
if (Q === void 0) return console.error(`Invalid vec constructor ${B}. Line ${A.line}`), null;
|
|
6915
6915
|
const E = [];
|
|
6916
6916
|
if (A instanceof rA) if (A.isVector) {
|
|
@@ -6989,7 +6989,7 @@ class to {
|
|
|
6989
6989
|
this._deferArrayCountEval.length = 0;
|
|
6990
6990
|
}
|
|
6991
6991
|
if (this._forwardTypeCount > 0) for (const g of I) g.search((B) => {
|
|
6992
|
-
B instanceof SC || B instanceof
|
|
6992
|
+
B instanceof SC || B instanceof Ig ? B.type = this._forwardType(B.type) : B instanceof fI ? B.format = this._forwardType(B.format) : B instanceof HA || B instanceof uI || B instanceof Ag ? B.type = this._forwardType(B.type) : B instanceof xI ? B.returnType = this._forwardType(B.returnType) : B instanceof FC && (B.type = this._forwardType(B.type));
|
|
6993
6993
|
});
|
|
6994
6994
|
return I;
|
|
6995
6995
|
}
|
|
@@ -6997,12 +6997,12 @@ class to {
|
|
|
6997
6997
|
if (A instanceof GC) {
|
|
6998
6998
|
const I = this._getType(A.name);
|
|
6999
6999
|
if (I) return I;
|
|
7000
|
-
} else A instanceof
|
|
7000
|
+
} else A instanceof Ig ? A.type = this._forwardType(A.type) : A instanceof fI && (A.format = this._forwardType(A.format));
|
|
7001
7001
|
return A;
|
|
7002
7002
|
}
|
|
7003
7003
|
_initialize(A) {
|
|
7004
7004
|
if (A) if (typeof A == "string") {
|
|
7005
|
-
const I = new
|
|
7005
|
+
const I = new dg(A);
|
|
7006
7006
|
this._tokens = I.scanTokens();
|
|
7007
7007
|
} else this._tokens = A;
|
|
7008
7008
|
else this._tokens = [];
|
|
@@ -7130,7 +7130,7 @@ class to {
|
|
|
7130
7130
|
B = this._type_decl(), B != null && (B.attributes = i);
|
|
7131
7131
|
}
|
|
7132
7132
|
const Q = this._compound_statement(), E = this._currentLine;
|
|
7133
|
-
return this._updateNode(new
|
|
7133
|
+
return this._updateNode(new xI(I, g, B, Q, A, E), A);
|
|
7134
7134
|
}
|
|
7135
7135
|
_compound_statement() {
|
|
7136
7136
|
const A = [];
|
|
@@ -7190,7 +7190,7 @@ class to {
|
|
|
7190
7190
|
const A = this._currentLoop.length > 0 ? this._currentLoop[this._currentLoop.length - 1].id : -1;
|
|
7191
7191
|
if (!this._match(a.keywords.continuing)) return null;
|
|
7192
7192
|
const I = this._currentLine, g = this._compound_statement();
|
|
7193
|
-
return this._updateNode(new
|
|
7193
|
+
return this._updateNode(new QB(g, A), I);
|
|
7194
7194
|
}
|
|
7195
7195
|
_for_statement() {
|
|
7196
7196
|
if (!this._match(a.keywords.for)) return null;
|
|
@@ -7220,7 +7220,7 @@ class to {
|
|
|
7220
7220
|
}
|
|
7221
7221
|
this._consume(a.tokens.equal, "Expected '=' for let.");
|
|
7222
7222
|
const B = this._short_circuit_or_expression();
|
|
7223
|
-
return this._updateNode(new
|
|
7223
|
+
return this._updateNode(new uI(I, g, null, null, B), A);
|
|
7224
7224
|
}
|
|
7225
7225
|
if (this._match(a.keywords.const)) {
|
|
7226
7226
|
const A = this._currentLine, I = this._consume(a.tokens.name, "Expected name for const.").toString();
|
|
@@ -7231,7 +7231,7 @@ class to {
|
|
|
7231
7231
|
}
|
|
7232
7232
|
this._consume(a.tokens.equal, "Expected '=' for const.");
|
|
7233
7233
|
const B = this._short_circuit_or_expression();
|
|
7234
|
-
return g === null && B instanceof rA && (g = B.type), this._updateNode(new
|
|
7234
|
+
return g === null && B instanceof rA && (g = B.type), this._updateNode(new Ag(I, g, null, null, B), A);
|
|
7235
7235
|
}
|
|
7236
7236
|
return null;
|
|
7237
7237
|
}
|
|
@@ -7265,7 +7265,7 @@ class to {
|
|
|
7265
7265
|
for (; I !== null; ) {
|
|
7266
7266
|
if (Array.isArray(I)) for (let g of I) A.body.push(g);
|
|
7267
7267
|
else A.body.push(I);
|
|
7268
|
-
if (I instanceof
|
|
7268
|
+
if (I instanceof QB) {
|
|
7269
7269
|
A.continuing = I;
|
|
7270
7270
|
break;
|
|
7271
7271
|
}
|
|
@@ -7285,7 +7285,7 @@ class to {
|
|
|
7285
7285
|
for (; this._check([a.keywords.default, a.keywords.case]); ) {
|
|
7286
7286
|
if (this._match(a.keywords.case)) {
|
|
7287
7287
|
const g = this._case_selectors();
|
|
7288
|
-
for (const Q of g) if (Q instanceof
|
|
7288
|
+
for (const Q of g) if (Q instanceof gg) {
|
|
7289
7289
|
if (I) throw this._error(this._previous(), "Multiple default cases in switch statement.");
|
|
7290
7290
|
I = !0;
|
|
7291
7291
|
break;
|
|
@@ -7305,7 +7305,7 @@ class to {
|
|
|
7305
7305
|
}
|
|
7306
7306
|
_case_selectors() {
|
|
7307
7307
|
const A = [];
|
|
7308
|
-
for (this._match(a.keywords.default) ? A.push(this._updateNode(new
|
|
7308
|
+
for (this._match(a.keywords.default) ? A.push(this._updateNode(new gg())) : A.push(this._shift_expression()); this._match(a.tokens.comma); ) this._match(a.keywords.default) ? A.push(this._updateNode(new gg())) : A.push(this._shift_expression());
|
|
7309
7309
|
return A;
|
|
7310
7310
|
}
|
|
7311
7311
|
_case_body() {
|
|
@@ -7661,7 +7661,7 @@ class to {
|
|
|
7661
7661
|
throw this._error(this._peek(), `Invalid cast from ${Q.type.name} to ${B.name}`);
|
|
7662
7662
|
Q.type = B, Q.isScalar && this._validateTypeRange(Q.scalarValue, Q.type);
|
|
7663
7663
|
} else B === null && Q instanceof rA && (B = (A = Q?.type) !== null && A !== void 0 ? A : N.f32, B === N.x32 && (B = N.i32));
|
|
7664
|
-
const i = this._updateNode(new
|
|
7664
|
+
const i = this._updateNode(new Ag(I.toString(), B, "", "", Q), g);
|
|
7665
7665
|
return this._context.constants.set(i.name, i), i;
|
|
7666
7666
|
}
|
|
7667
7667
|
_global_let_decl() {
|
|
@@ -7678,7 +7678,7 @@ class to {
|
|
|
7678
7678
|
throw this._error(this._peek(), `Invalid cast from ${B.type.name} to ${g.name}`);
|
|
7679
7679
|
B.type = g;
|
|
7680
7680
|
} else g === null && B instanceof rA && (g = B.type.name === "x32" ? N.i32 : B.type);
|
|
7681
|
-
return B instanceof rA && B.isScalar && this._validateTypeRange(B.scalarValue, g), this._updateNode(new
|
|
7681
|
+
return B instanceof rA && B.isScalar && this._validateTypeRange(B.scalarValue, g), this._updateNode(new uI(I.toString(), g, "", "", B), A);
|
|
7682
7682
|
}
|
|
7683
7683
|
_const_expression() {
|
|
7684
7684
|
return this._short_circuit_or_expression();
|
|
@@ -7759,7 +7759,7 @@ class to {
|
|
|
7759
7759
|
this._consume(a.tokens.comma, "Expected ',' for pointer.");
|
|
7760
7760
|
const o = this._type_decl();
|
|
7761
7761
|
let s = null;
|
|
7762
|
-
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
|
|
7762
|
+
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 Ig(E, i.toString(), o, s));
|
|
7763
7763
|
}
|
|
7764
7764
|
const Q = this._attribute();
|
|
7765
7765
|
if (this._match(a.keywords.array)) {
|
|
@@ -7779,7 +7779,7 @@ class to {
|
|
|
7779
7779
|
}
|
|
7780
7780
|
this._consume(a.tokens.greater_than, "Expected '>' for array."), i = e ? parseInt(e) : 0;
|
|
7781
7781
|
}
|
|
7782
|
-
const t = this._updateNode(new
|
|
7782
|
+
const t = this._updateNode(new fI(o.toString(), Q, E, i));
|
|
7783
7783
|
return s && this._deferArrayCountEval.push({ arrayType: t, countNode: s }), t;
|
|
7784
7784
|
}
|
|
7785
7785
|
return null;
|
|
@@ -7839,16 +7839,16 @@ function ao(C, A, I) {
|
|
|
7839
7839
|
}
|
|
7840
7840
|
return Object.values(C.entryPoints).filter((B) => B.stage === I)[0];
|
|
7841
7841
|
}
|
|
7842
|
-
function
|
|
7842
|
+
function bg(C, A, I) {
|
|
7843
7843
|
return A ? ao(C, A, I)?.resources || [] : [];
|
|
7844
7844
|
}
|
|
7845
7845
|
const no = (C, A) => Math.sign(C.binding - A.binding);
|
|
7846
7846
|
function ro(C, A) {
|
|
7847
7847
|
C = Array.isArray(C) ? C : [C];
|
|
7848
7848
|
const I = [
|
|
7849
|
-
...
|
|
7850
|
-
...
|
|
7851
|
-
...
|
|
7849
|
+
...bg(C[0], A.vertex, GPUShaderStage.VERTEX),
|
|
7850
|
+
...bg(C[C.length - 1], A.fragment, GPUShaderStage.FRAGMENT),
|
|
7851
|
+
...bg(C[0], A.compute, GPUShaderStage.COMPUTE)
|
|
7852
7852
|
], g = [];
|
|
7853
7853
|
for (const Q of I) {
|
|
7854
7854
|
const E = g[Q.group] || /* @__PURE__ */ new Map();
|
|
@@ -7980,7 +7980,7 @@ function co(C, A) {
|
|
|
7980
7980
|
throw new Error("unknown resource type");
|
|
7981
7981
|
}
|
|
7982
7982
|
}
|
|
7983
|
-
function
|
|
7983
|
+
function Tg(C, A) {
|
|
7984
7984
|
const I = {};
|
|
7985
7985
|
for (const g of C)
|
|
7986
7986
|
I[g.name] = {
|
|
@@ -7998,9 +7998,9 @@ function bg(C, A) {
|
|
|
7998
7998
|
}
|
|
7999
7999
|
function wo(C) {
|
|
8000
8000
|
const A = new eo(C), I = Object.fromEntries(A.structs.map((e) => [e.name, $Q(A, e, 0)])), g = zA(A, A.uniforms), B = zA(A, A.immediates), Q = zA(A, A.storage.filter((e) => e.resourceType === sA.Storage)), E = zA(A, A.storage.filter((e) => e.resourceType === sA.StorageTexture)), i = zA(A, A.textures.filter((e) => e.type.name !== "texture_external")), o = zA(A, A.textures.filter((e) => e.type.name === "texture_external")), s = zA(A, A.samplers), t = {
|
|
8001
|
-
...
|
|
8002
|
-
...
|
|
8003
|
-
...
|
|
8001
|
+
...Tg(A.entry.vertex, GPUShaderStage.VERTEX),
|
|
8002
|
+
...Tg(A.entry.fragment, GPUShaderStage.FRAGMENT),
|
|
8003
|
+
...Tg(A.entry.compute, GPUShaderStage.COMPUTE)
|
|
8004
8004
|
};
|
|
8005
8005
|
return {
|
|
8006
8006
|
externalTextures: o,
|
|
@@ -8014,7 +8014,7 @@ function wo(C) {
|
|
|
8014
8014
|
entryPoints: t
|
|
8015
8015
|
};
|
|
8016
8016
|
}
|
|
8017
|
-
function
|
|
8017
|
+
function Wg(C, A = "") {
|
|
8018
8018
|
if (!C)
|
|
8019
8019
|
throw new Error(A);
|
|
8020
8020
|
}
|
|
@@ -8034,7 +8034,7 @@ function Go(C, A, I) {
|
|
|
8034
8034
|
}
|
|
8035
8035
|
function qB(C, A, I) {
|
|
8036
8036
|
if (A.isArray) {
|
|
8037
|
-
|
|
8037
|
+
Wg(!A.isStruct, "struct array is invalid"), Wg(!A.isStruct, "template array is invalid");
|
|
8038
8038
|
const g = A;
|
|
8039
8039
|
return {
|
|
8040
8040
|
size: g.size,
|
|
@@ -8043,7 +8043,7 @@ function qB(C, A, I) {
|
|
|
8043
8043
|
};
|
|
8044
8044
|
} else {
|
|
8045
8045
|
if (A.isStruct)
|
|
8046
|
-
return
|
|
8046
|
+
return Wg(!A.isTemplate, "template struct is invalid"), $Q(C, A, I);
|
|
8047
8047
|
{
|
|
8048
8048
|
const g = A, B = A.isTemplate ? `${g.name}<${g.format.name}>` : A.name;
|
|
8049
8049
|
return {
|
|
@@ -8646,16 +8646,15 @@ function Ho(C) {
|
|
|
8646
8646
|
return "image_scalar_u32";
|
|
8647
8647
|
}
|
|
8648
8648
|
}
|
|
8649
|
-
|
|
8650
|
-
function EB(C, A) {
|
|
8649
|
+
function JI(C, A) {
|
|
8651
8650
|
const I = C.priority ?? Number.MAX_SAFE_INTEGER, g = A.priority ?? Number.MAX_SAFE_INTEGER;
|
|
8652
8651
|
return I === g ? (C.orderKey ?? Number.MAX_SAFE_INTEGER) - (A.orderKey ?? Number.MAX_SAFE_INTEGER) : I - g;
|
|
8653
8652
|
}
|
|
8654
|
-
class
|
|
8653
|
+
class qo {
|
|
8655
8654
|
maxConcurrent_;
|
|
8656
8655
|
pending_ = [];
|
|
8657
8656
|
running_ = /* @__PURE__ */ new Map();
|
|
8658
|
-
constructor(A
|
|
8657
|
+
constructor(A) {
|
|
8659
8658
|
this.maxConcurrent_ = Math.max(1, A);
|
|
8660
8659
|
}
|
|
8661
8660
|
enqueue(A, I) {
|
|
@@ -8681,7 +8680,7 @@ class po {
|
|
|
8681
8680
|
}
|
|
8682
8681
|
pump() {
|
|
8683
8682
|
if (!(this.running_.size >= this.maxConcurrent_ || this.pending_.length === 0))
|
|
8684
|
-
for (this.pending_.sort((A, I) =>
|
|
8683
|
+
for (this.pending_.sort((A, I) => JI(A.chunk, I.chunk)); this.running_.size < this.maxConcurrent_ && this.pending_.length > 0; )
|
|
8685
8684
|
this.start(this.pending_.shift());
|
|
8686
8685
|
}
|
|
8687
8686
|
start(A) {
|
|
@@ -8700,15 +8699,15 @@ class po {
|
|
|
8700
8699
|
this.running_.set(I, { controller: B, promise: Q });
|
|
8701
8700
|
}
|
|
8702
8701
|
}
|
|
8703
|
-
let
|
|
8704
|
-
function
|
|
8705
|
-
C.data && (
|
|
8702
|
+
let eg = 0, ag = 0;
|
|
8703
|
+
function po(C, A) {
|
|
8704
|
+
C.data && (eg -= C.data.byteLength, ag -= 1), C.data = A, eg += A.byteLength, ag += 1;
|
|
8706
8705
|
}
|
|
8707
8706
|
function dC(C) {
|
|
8708
|
-
C.data && (
|
|
8707
|
+
C.data && (eg -= C.data.byteLength, ag -= 1), C.data = void 0, C.texture?.releaseCpuData();
|
|
8709
8708
|
}
|
|
8710
|
-
function
|
|
8711
|
-
return { cpuChunkBytes:
|
|
8709
|
+
function mo() {
|
|
8710
|
+
return { cpuChunkBytes: eg, cpuChunkCount: ag };
|
|
8712
8711
|
}
|
|
8713
8712
|
function lC(C, A, I = 1e-6) {
|
|
8714
8713
|
return Math.abs(C - A) <= I;
|
|
@@ -8722,7 +8721,7 @@ const LC = [
|
|
|
8722
8721
|
Uint32Array,
|
|
8723
8722
|
Float32Array
|
|
8724
8723
|
];
|
|
8725
|
-
function
|
|
8724
|
+
function xo(C) {
|
|
8726
8725
|
if (LC.some((I) => C instanceof I))
|
|
8727
8726
|
return !0;
|
|
8728
8727
|
const A = LC.map((I) => I.name);
|
|
@@ -8731,14 +8730,14 @@ function bo(C) {
|
|
|
8731
8730
|
`Unsupported chunk data type: ${C}. Supported data types: ${A}`
|
|
8732
8731
|
), !1;
|
|
8733
8732
|
}
|
|
8734
|
-
function
|
|
8733
|
+
function bo(C, A) {
|
|
8735
8734
|
return Math.round((A - C.translation) / C.scale);
|
|
8736
8735
|
}
|
|
8737
8736
|
function TA(C, A, I) {
|
|
8738
8737
|
return Math.max(A, Math.min(I, C));
|
|
8739
8738
|
}
|
|
8740
|
-
const
|
|
8741
|
-
class
|
|
8739
|
+
const lg = Symbol("INTERNAL_POLICY_KEY");
|
|
8740
|
+
class To {
|
|
8742
8741
|
store_;
|
|
8743
8742
|
policy_;
|
|
8744
8743
|
policyChanged_ = !1;
|
|
@@ -8874,7 +8873,7 @@ class Wo {
|
|
|
8874
8873
|
const A = this.fallbackLOD();
|
|
8875
8874
|
let I = !1;
|
|
8876
8875
|
for (const [g, B] of this.chunkViewStates_)
|
|
8877
|
-
if (!(!B.visible || g.lod !== A) && (I = !0, g.
|
|
8876
|
+
if (!(!B.visible || g.lod !== A) && (I = !0, g.texture === void 0))
|
|
8878
8877
|
return !1;
|
|
8879
8878
|
return I;
|
|
8880
8879
|
}
|
|
@@ -8889,7 +8888,7 @@ class Wo {
|
|
|
8889
8888
|
this.isDisposed_ = !0, this.chunkViewStates_.forEach(dI);
|
|
8890
8889
|
}
|
|
8891
8890
|
setImageSourcePolicy(A, I) {
|
|
8892
|
-
if (I !==
|
|
8891
|
+
if (I !== lg)
|
|
8893
8892
|
throw new Error("Unauthorized policy mutation");
|
|
8894
8893
|
this.policy_ !== A && (this.policy_ = A, this.policyChanged_ = !0, H.info(
|
|
8895
8894
|
"ChunkStoreView",
|
|
@@ -9009,7 +9008,7 @@ class Wo {
|
|
|
9009
9008
|
}
|
|
9010
9009
|
timeIndex(A) {
|
|
9011
9010
|
const I = this.store_.dimensions.t;
|
|
9012
|
-
return A.t === void 0 || I === void 0 ? 0 :
|
|
9011
|
+
return A.t === void 0 || I === void 0 ? 0 : bo(I.lods[0], A.t);
|
|
9013
9012
|
}
|
|
9014
9013
|
getZBounds(A) {
|
|
9015
9014
|
const I = this.store_.dimensions.z;
|
|
@@ -9031,13 +9030,13 @@ class Wo {
|
|
|
9031
9030
|
];
|
|
9032
9031
|
}
|
|
9033
9032
|
viewBounds2DChanged(A) {
|
|
9034
|
-
return this.lastViewBounds2D_ === null || !
|
|
9033
|
+
return this.lastViewBounds2D_ === null || !pg(this.lastViewBounds2D_.min, A.min) || !pg(this.lastViewBounds2D_.max, A.max);
|
|
9035
9034
|
}
|
|
9036
9035
|
hasViewProjectionChanged(A) {
|
|
9037
9036
|
return this.lastViewProjection_ === null || !jE(this.lastViewProjection_, A);
|
|
9038
9037
|
}
|
|
9039
9038
|
zBoundsChanged(A) {
|
|
9040
|
-
return !this.lastZBounds_ || !
|
|
9039
|
+
return !this.lastZBounds_ || !pg(this.lastZBounds_, A);
|
|
9041
9040
|
}
|
|
9042
9041
|
cCoordsChanged(A) {
|
|
9043
9042
|
return !this.lastCCoords_ && !A ? !1 : !this.lastCCoords_ || !A || this.lastCCoords_.length !== A.length ? !0 : !this.lastCCoords_.every((I, g) => I === A[g]);
|
|
@@ -9069,7 +9068,7 @@ class Wo {
|
|
|
9069
9068
|
function dI(C) {
|
|
9070
9069
|
C.visible = !1, C.prefetch = !1, C.priority = null, C.orderKey = null;
|
|
9071
9070
|
}
|
|
9072
|
-
class
|
|
9071
|
+
class Wo {
|
|
9073
9072
|
// Chunks indexed as chunks_[lod][t][c][z][y][x].
|
|
9074
9073
|
chunks_;
|
|
9075
9074
|
lowestResLOD_;
|
|
@@ -9149,7 +9148,7 @@ class vo {
|
|
|
9149
9148
|
return this.lowestResLOD_;
|
|
9150
9149
|
}
|
|
9151
9150
|
addView(A) {
|
|
9152
|
-
const I = new
|
|
9151
|
+
const I = new To(this, A);
|
|
9153
9152
|
return this.views_.push(I), this.hasHadViews_ = !0, I;
|
|
9154
9153
|
}
|
|
9155
9154
|
get views() {
|
|
@@ -9173,28 +9172,15 @@ class vo {
|
|
|
9173
9172
|
}
|
|
9174
9173
|
aggregateChunkViewStates(A) {
|
|
9175
9174
|
let I = !1, g = !1, B = null, Q = null;
|
|
9176
|
-
for (const
|
|
9177
|
-
const
|
|
9178
|
-
|
|
9175
|
+
for (const o of this.views_) {
|
|
9176
|
+
const s = o.chunkViewStates.get(A);
|
|
9177
|
+
s && (s.visible && (I = !0), s.prefetch && (g = !0), s.priority !== null && (B === null || s.priority < B) && (B = s.priority, Q = s.orderKey), !s.visible && !s.prefetch && s.priority === null && o.maybeForgetChunk(A));
|
|
9179
9178
|
}
|
|
9180
9179
|
if (A.visible = I, A.prefetch = g, A.priority = B, A.orderKey = Q, A.priority !== null && A.state === "unloaded") {
|
|
9181
9180
|
A.state = "queued";
|
|
9182
9181
|
return;
|
|
9183
9182
|
}
|
|
9184
|
-
|
|
9185
|
-
A.state = "unloaded";
|
|
9186
|
-
return;
|
|
9187
|
-
}
|
|
9188
|
-
if (A.state === "loaded" && A.priority === null) {
|
|
9189
|
-
if (A.visible || A.prefetch)
|
|
9190
|
-
throw new Error(
|
|
9191
|
-
`Chunk state inconsistency detected: priority is null but visible=${A.visible} or prefetch=${A.prefetch} for chunk ${JSON.stringify(A.chunkIndex)} in LOD ${A.lod}`
|
|
9192
|
-
);
|
|
9193
|
-
A.state = "unloaded", A.orderKey = null, H.debug(
|
|
9194
|
-
"ChunkStore",
|
|
9195
|
-
`Disposing chunk ${JSON.stringify(A.chunkIndex)} in LOD ${A.lod}`
|
|
9196
|
-
);
|
|
9197
|
-
}
|
|
9183
|
+
A.priority === null && A.state === "queued" && (A.state = "unloaded");
|
|
9198
9184
|
}
|
|
9199
9185
|
validateXYScaleRatios() {
|
|
9200
9186
|
const A = this.dimensions_.x, I = this.dimensions_.y;
|
|
@@ -9242,16 +9228,18 @@ class vo {
|
|
|
9242
9228
|
};
|
|
9243
9229
|
}
|
|
9244
9230
|
}
|
|
9245
|
-
const Zo = 4;
|
|
9231
|
+
const vo = 8, Zo = 4;
|
|
9246
9232
|
class Po {
|
|
9247
9233
|
stores_ = [];
|
|
9248
|
-
queue_
|
|
9234
|
+
queue_;
|
|
9249
9235
|
uploadTexture_;
|
|
9250
9236
|
disposeTexture_;
|
|
9251
9237
|
getGpuResidentBytes_;
|
|
9252
9238
|
memoryLimitBytes_;
|
|
9253
|
-
|
|
9254
|
-
|
|
9239
|
+
maxGpuUploadsPerUpdate_;
|
|
9240
|
+
resident_ = /* @__PURE__ */ new Set();
|
|
9241
|
+
constructor(A, I, g = () => 0, B = 1 / 0, Q = vo, E = Zo) {
|
|
9242
|
+
this.uploadTexture_ = A, this.disposeTexture_ = I, this.getGpuResidentBytes_ = g, this.memoryLimitBytes_ = B, this.maxGpuUploadsPerUpdate_ = Math.max(1, E), this.queue_ = new qo(Q);
|
|
9255
9243
|
}
|
|
9256
9244
|
get memoryLimitBytes() {
|
|
9257
9245
|
return this.memoryLimitBytes_;
|
|
@@ -9263,35 +9251,63 @@ class Po {
|
|
|
9263
9251
|
};
|
|
9264
9252
|
}
|
|
9265
9253
|
get memoryStats() {
|
|
9266
|
-
return
|
|
9254
|
+
return mo();
|
|
9267
9255
|
}
|
|
9268
9256
|
addView(A, I) {
|
|
9269
9257
|
let g = this.stores_.find((B) => B.source === A)?.store;
|
|
9270
|
-
return g || (g = new
|
|
9258
|
+
return g || (g = new Wo(A.loader.getSourceDimensionMap()), this.stores_.push({ source: A, store: g })), g.addView(I);
|
|
9271
9259
|
}
|
|
9272
9260
|
update() {
|
|
9273
9261
|
const A = [];
|
|
9274
9262
|
for (const { source: I, store: g } of this.stores_) {
|
|
9275
9263
|
const B = g.updateAndCollectChunkChanges();
|
|
9276
9264
|
for (const Q of B)
|
|
9277
|
-
Q.priority === null ?
|
|
9265
|
+
Q.priority === null ? this.releaseChunk(Q) : (Q.releasedAt = void 0, Q.state === "queued" && A.push({ source: I, chunk: Q }));
|
|
9278
9266
|
this.uploadLoadedChunks(B);
|
|
9279
9267
|
}
|
|
9280
9268
|
this.enqueueWithinBudget(A), this.queue_.flush();
|
|
9281
9269
|
for (let I = this.stores_.length - 1; I >= 0; I--)
|
|
9282
9270
|
this.stores_[I].store.canDispose() && this.stores_.splice(I, 1);
|
|
9283
9271
|
}
|
|
9272
|
+
releaseChunk(A) {
|
|
9273
|
+
if (this.queue_.cancel(A), A.texture !== void 0) {
|
|
9274
|
+
A.releasedAt ??= performance.now();
|
|
9275
|
+
return;
|
|
9276
|
+
}
|
|
9277
|
+
dC(A), A.state === "loaded" && (A.state = "unloaded");
|
|
9278
|
+
}
|
|
9284
9279
|
enqueueWithinBudget(A) {
|
|
9285
9280
|
if (A.length === 0) return;
|
|
9286
|
-
A.sort((
|
|
9287
|
-
let I = this.getGpuResidentBytes_();
|
|
9288
|
-
for (const { source:
|
|
9289
|
-
const
|
|
9290
|
-
I +
|
|
9291
|
-
|
|
9292
|
-
|
|
9293
|
-
|
|
9281
|
+
A.sort((B, Q) => JI(B.chunk, Q.chunk));
|
|
9282
|
+
let I = this.getGpuResidentBytes_(), g = null;
|
|
9283
|
+
for (const { source: B, chunk: Q } of A) {
|
|
9284
|
+
const E = this.chunkBytes(B, Q);
|
|
9285
|
+
E > this.memoryLimitBytes_ || (I + E > this.memoryLimitBytes_ && (g ??= this.evictionCandidates(), I = this.evictWorseChunks(
|
|
9286
|
+
I,
|
|
9287
|
+
E,
|
|
9288
|
+
Q,
|
|
9289
|
+
g
|
|
9290
|
+
)), !(I + E > this.memoryLimitBytes_) && (I += E, this.queue_.enqueue(
|
|
9291
|
+
Q,
|
|
9292
|
+
(i) => B.loader.loadChunkData(Q, i)
|
|
9293
|
+
)));
|
|
9294
|
+
}
|
|
9295
|
+
}
|
|
9296
|
+
evictionCandidates() {
|
|
9297
|
+
const A = [];
|
|
9298
|
+
for (const I of this.resident_)
|
|
9299
|
+
I.visible || A.push(I);
|
|
9300
|
+
return A.sort((I, g) => {
|
|
9301
|
+
const B = -JI(I, g);
|
|
9302
|
+
return B !== 0 ? B : (I.releasedAt ?? 0) - (g.releasedAt ?? 0);
|
|
9303
|
+
});
|
|
9304
|
+
}
|
|
9305
|
+
evictWorseChunks(A, I, g, B) {
|
|
9306
|
+
for (; A + I > this.memoryLimitBytes_ && B.length > 0 && JI(B[0], g) > 0; ) {
|
|
9307
|
+
const Q = B.shift();
|
|
9308
|
+
Q.texture !== void 0 && (A -= mI(Q.texture), this.disposeChunkTexture(Q), Q.state = "unloaded", Q.releasedAt = void 0);
|
|
9294
9309
|
}
|
|
9310
|
+
return A;
|
|
9295
9311
|
}
|
|
9296
9312
|
chunkBytes(A, I) {
|
|
9297
9313
|
const g = A.loader.getBytesPerElement();
|
|
@@ -9303,18 +9319,18 @@ class Po {
|
|
|
9303
9319
|
for (const B of A)
|
|
9304
9320
|
B.state === "loaded" && B.texture === void 0 && I.push(B);
|
|
9305
9321
|
if (I.length === 0) return;
|
|
9306
|
-
I.sort(
|
|
9307
|
-
const g = Math.min(I.length,
|
|
9322
|
+
I.sort(JI);
|
|
9323
|
+
const g = Math.min(I.length, this.maxGpuUploadsPerUpdate_);
|
|
9308
9324
|
for (let B = 0; B < g; B++) {
|
|
9309
|
-
const Q = I[B], E =
|
|
9310
|
-
this.uploadTexture_(E), Q.texture = E, dC(Q);
|
|
9325
|
+
const Q = I[B], E = vI.createWithChunk(Q);
|
|
9326
|
+
this.uploadTexture_(E), Q.texture = E, this.resident_.add(Q), dC(Q);
|
|
9311
9327
|
}
|
|
9312
9328
|
}
|
|
9313
9329
|
disposeChunkTexture(A) {
|
|
9314
|
-
this.disposeTexture_ && A.texture !== void 0 && (this.disposeTexture_(A.texture), A.texture = void 0);
|
|
9330
|
+
this.disposeTexture_ && A.texture !== void 0 && (this.disposeTexture_(A.texture), A.texture = void 0, this.resident_.delete(A));
|
|
9315
9331
|
}
|
|
9316
9332
|
}
|
|
9317
|
-
var
|
|
9333
|
+
var KI = function(C = 1) {
|
|
9318
9334
|
var A = 0, I = document.createElement("div");
|
|
9319
9335
|
I.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", I.addEventListener("click", function(e) {
|
|
9320
9336
|
e.preventDefault(), B(++A % I.children.length);
|
|
@@ -9327,9 +9343,9 @@ var fI = function(C = 1) {
|
|
|
9327
9343
|
I.children[n].style.display = n === e ? "block" : "none";
|
|
9328
9344
|
A = e;
|
|
9329
9345
|
}
|
|
9330
|
-
var Q = (performance || Date).now(), E = Q, i = 0, o = g(new
|
|
9346
|
+
var Q = (performance || Date).now(), E = Q, i = 0, o = g(new KI.Panel("FPS", "#0ff", "#002", C)), s = g(new KI.Panel("MS", "#0f0", "#020", C));
|
|
9331
9347
|
if (self.performance && self.performance.memory)
|
|
9332
|
-
var t = g(new
|
|
9348
|
+
var t = g(new KI.Panel("MB", "#f08", "#201", C));
|
|
9333
9349
|
return B(0), {
|
|
9334
9350
|
REVISION: 16,
|
|
9335
9351
|
dom: I,
|
|
@@ -9355,7 +9371,7 @@ var fI = function(C = 1) {
|
|
|
9355
9371
|
setMode: B
|
|
9356
9372
|
};
|
|
9357
9373
|
};
|
|
9358
|
-
|
|
9374
|
+
KI.Panel = function(C, A, I, g) {
|
|
9359
9375
|
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), U = E(30 * i * g), S = document.createElement("canvas");
|
|
9360
9376
|
S.width = o, S.height = s, S.style.cssText = `width:${E(g * 80)}px;height:${E(g * 48)}px`;
|
|
9361
9377
|
var l = S.getContext("2d");
|
|
@@ -9367,7 +9383,7 @@ fI.Panel = function(C, A, I, g) {
|
|
|
9367
9383
|
};
|
|
9368
9384
|
};
|
|
9369
9385
|
function Oo({ scale: C } = { scale: 1.5 }) {
|
|
9370
|
-
const A = new
|
|
9386
|
+
const A = new KI(C);
|
|
9371
9387
|
return A.showPanel(
|
|
9372
9388
|
0
|
|
9373
9389
|
/* 0 = fps, 1 = ms, 2 = mb */
|
|
@@ -9693,7 +9709,9 @@ class IE {
|
|
|
9693
9709
|
(E) => this.renderer_.uploadTexture(E),
|
|
9694
9710
|
(E) => this.renderer_.disposeTexture(E),
|
|
9695
9711
|
() => this.renderer_.gpuTextureBytes,
|
|
9696
|
-
B
|
|
9712
|
+
B,
|
|
9713
|
+
A.maxConcurrentRequests,
|
|
9714
|
+
A.maxGpuUploadsPerUpdate
|
|
9697
9715
|
), this.context_ = {
|
|
9698
9716
|
chunkManager: this.chunkManager_
|
|
9699
9717
|
}, this.viewports_ = JC(
|
|
@@ -9815,7 +9833,7 @@ async function MC(C) {
|
|
|
9815
9833
|
throw new Error(`Unexpected response status ${C.status} ${C.statusText}`);
|
|
9816
9834
|
}
|
|
9817
9835
|
}
|
|
9818
|
-
class
|
|
9836
|
+
class ZI {
|
|
9819
9837
|
url;
|
|
9820
9838
|
#A;
|
|
9821
9839
|
#I;
|
|
@@ -9870,9 +9888,9 @@ class WI {
|
|
|
9870
9888
|
return this.#A(this.#B(A, s));
|
|
9871
9889
|
}
|
|
9872
9890
|
}
|
|
9873
|
-
class
|
|
9891
|
+
class PI extends Error {
|
|
9874
9892
|
}
|
|
9875
|
-
class NI extends
|
|
9893
|
+
class NI extends PI {
|
|
9876
9894
|
_tag = "NotFoundError";
|
|
9877
9895
|
name = "NotFoundError";
|
|
9878
9896
|
path;
|
|
@@ -9881,7 +9899,7 @@ class NI extends vI {
|
|
|
9881
9899
|
super(`Not found: ${A}`, { cause: I.cause }), this.path = I.path, this.found = I.found;
|
|
9882
9900
|
}
|
|
9883
9901
|
}
|
|
9884
|
-
class nA extends
|
|
9902
|
+
class nA extends PI {
|
|
9885
9903
|
_tag = "InvalidMetadataError";
|
|
9886
9904
|
name = "InvalidMetadataError";
|
|
9887
9905
|
path;
|
|
@@ -9889,7 +9907,7 @@ class nA extends vI {
|
|
|
9889
9907
|
super(A, { cause: I.cause }), this.path = I.path;
|
|
9890
9908
|
}
|
|
9891
9909
|
}
|
|
9892
|
-
class gs extends
|
|
9910
|
+
class gs extends PI {
|
|
9893
9911
|
_tag = "UnknownCodecError";
|
|
9894
9912
|
name = "UnknownCodecError";
|
|
9895
9913
|
codec;
|
|
@@ -9897,7 +9915,7 @@ class gs extends vI {
|
|
|
9897
9915
|
super(`Unknown codec: ${A}`), this.codec = A;
|
|
9898
9916
|
}
|
|
9899
9917
|
}
|
|
9900
|
-
class Bs extends
|
|
9918
|
+
class Bs extends PI {
|
|
9901
9919
|
_tag = "CodecPipelineError";
|
|
9902
9920
|
name = "CodecPipelineError";
|
|
9903
9921
|
direction;
|
|
@@ -9912,7 +9930,7 @@ class Bs extends vI {
|
|
|
9912
9930
|
super(I.join(" "), { cause: A.cause }), this.direction = A.direction, this.codec = A.codec, this.chunkPath = A.chunkPath;
|
|
9913
9931
|
}
|
|
9914
9932
|
}
|
|
9915
|
-
class pB extends
|
|
9933
|
+
class pB extends PI {
|
|
9916
9934
|
_tag = "UnsupportedError";
|
|
9917
9935
|
name = "UnsupportedError";
|
|
9918
9936
|
feature;
|
|
@@ -9925,14 +9943,14 @@ function EI(C) {
|
|
|
9925
9943
|
throw new pB(`${C} encode`);
|
|
9926
9944
|
};
|
|
9927
9945
|
}
|
|
9928
|
-
class
|
|
9946
|
+
class ng {
|
|
9929
9947
|
kind = "array_to_array";
|
|
9930
9948
|
constructor(A, I) {
|
|
9931
9949
|
if (A.keepbits < 0)
|
|
9932
9950
|
throw new nA("keepbits must be zero or positive");
|
|
9933
9951
|
}
|
|
9934
9952
|
static fromConfig(A, I) {
|
|
9935
|
-
return new
|
|
9953
|
+
return new ng(A, I);
|
|
9936
9954
|
}
|
|
9937
9955
|
encode = EI("bitround");
|
|
9938
9956
|
/**
|
|
@@ -10031,7 +10049,7 @@ class xB {
|
|
|
10031
10049
|
yield this.get(A);
|
|
10032
10050
|
}
|
|
10033
10051
|
}
|
|
10034
|
-
class
|
|
10052
|
+
class OI {
|
|
10035
10053
|
#A;
|
|
10036
10054
|
chars;
|
|
10037
10055
|
constructor(A, I, g, B) {
|
|
@@ -10040,7 +10058,7 @@ class ZI {
|
|
|
10040
10058
|
else if (mB(I))
|
|
10041
10059
|
B && (B *= A), this.#A = new Int32Array(I, g, B);
|
|
10042
10060
|
else {
|
|
10043
|
-
const Q = I, E = new
|
|
10061
|
+
const Q = I, E = new OI(A, 1);
|
|
10044
10062
|
this.#A = new Int32Array((function* () {
|
|
10045
10063
|
for (let i of Q)
|
|
10046
10064
|
E.set(0, i), yield* E.#A;
|
|
@@ -10093,7 +10111,7 @@ function Cs() {
|
|
|
10093
10111
|
function Qs(C, A) {
|
|
10094
10112
|
return new SharedArrayBuffer(C);
|
|
10095
10113
|
}
|
|
10096
|
-
function
|
|
10114
|
+
function VI(C) {
|
|
10097
10115
|
const A = new TextDecoder().decode(C);
|
|
10098
10116
|
try {
|
|
10099
10117
|
return JSON.parse(A);
|
|
@@ -10114,7 +10132,7 @@ function RI(C) {
|
|
|
10114
10132
|
let A = C.match(/v2:([US])(\d+)/);
|
|
10115
10133
|
if (A) {
|
|
10116
10134
|
let [, g, B] = A;
|
|
10117
|
-
return (g === "U" ?
|
|
10135
|
+
return (g === "U" ? OI : xB).bind(null, Number(B));
|
|
10118
10136
|
}
|
|
10119
10137
|
if (C === "string")
|
|
10120
10138
|
return globalThis.Array;
|
|
@@ -10316,7 +10334,7 @@ function es() {
|
|
|
10316
10334
|
function HC(C) {
|
|
10317
10335
|
return "BYTES_PER_ELEMENT" in C ? C.BYTES_PER_ELEMENT : 4;
|
|
10318
10336
|
}
|
|
10319
|
-
class
|
|
10337
|
+
class Lg {
|
|
10320
10338
|
kind = "array_to_bytes";
|
|
10321
10339
|
#A;
|
|
10322
10340
|
#I;
|
|
@@ -10329,7 +10347,7 @@ class lg {
|
|
|
10329
10347
|
this.#g = g.BYTES_PER_ELEMENT;
|
|
10330
10348
|
}
|
|
10331
10349
|
static fromConfig(A, I) {
|
|
10332
|
-
return new
|
|
10350
|
+
return new Lg(A, I);
|
|
10333
10351
|
}
|
|
10334
10352
|
encode(A) {
|
|
10335
10353
|
let I = new Uint8Array(A.data.buffer);
|
|
@@ -10355,7 +10373,7 @@ const qC = {
|
|
|
10355
10373
|
float32: 4,
|
|
10356
10374
|
float64: 8
|
|
10357
10375
|
};
|
|
10358
|
-
function
|
|
10376
|
+
function rg(C) {
|
|
10359
10377
|
return C in EE;
|
|
10360
10378
|
}
|
|
10361
10379
|
function sB(C) {
|
|
@@ -10370,18 +10388,18 @@ function as(C, A) {
|
|
|
10370
10388
|
}
|
|
10371
10389
|
return A === 4 ? (B.setUint32(0, Number(I)), B.getFloat32(0)) : (B.setBigUint64(0, I), B.getFloat64(0));
|
|
10372
10390
|
}
|
|
10373
|
-
function
|
|
10391
|
+
function Dg(C, A) {
|
|
10374
10392
|
if (sB(C)) {
|
|
10375
10393
|
if (typeof A != "number" || !Number.isInteger(A))
|
|
10376
10394
|
throw new nA(`Expected an integer value for data type "${C}", got ${JSON.stringify(A)}`);
|
|
10377
10395
|
return BigInt(A);
|
|
10378
10396
|
}
|
|
10379
10397
|
if (typeof A == "number") {
|
|
10380
|
-
if (!
|
|
10398
|
+
if (!rg(C) && !Number.isInteger(A))
|
|
10381
10399
|
throw new nA(`Expected an integer value for data type "${C}", got ${A}`);
|
|
10382
10400
|
return A;
|
|
10383
10401
|
}
|
|
10384
|
-
if (!
|
|
10402
|
+
if (!rg(C))
|
|
10385
10403
|
throw new nA(`String-encoded scalar "${A}" is not valid for non-float data type "${C}"`);
|
|
10386
10404
|
return A in qC ? qC[A] : as(A, EE[C]);
|
|
10387
10405
|
}
|
|
@@ -10397,21 +10415,21 @@ const pC = /* @__PURE__ */ new Set([
|
|
|
10397
10415
|
"float16",
|
|
10398
10416
|
"float32",
|
|
10399
10417
|
"float64"
|
|
10400
|
-
]),
|
|
10418
|
+
]), vg = {
|
|
10401
10419
|
int8: [-128, 2 ** 7 - 1],
|
|
10402
10420
|
uint8: [0, 2 ** 8 - 1],
|
|
10403
10421
|
int16: [-32768, 2 ** 15 - 1],
|
|
10404
10422
|
uint16: [0, 2 ** 16 - 1],
|
|
10405
10423
|
int32: [-2147483648, 2 ** 31 - 1],
|
|
10406
10424
|
uint32: [0, 2 ** 32 - 1]
|
|
10407
|
-
},
|
|
10425
|
+
}, Zg = {
|
|
10408
10426
|
int64: [-(2n ** 63n), 2n ** 63n - 1n],
|
|
10409
10427
|
uint64: [0n, 2n ** 64n - 1n]
|
|
10410
10428
|
};
|
|
10411
10429
|
function mC(C, A, I) {
|
|
10412
10430
|
return C.map(([g, B]) => ({
|
|
10413
|
-
src:
|
|
10414
|
-
tgt:
|
|
10431
|
+
src: Dg(A, g),
|
|
10432
|
+
tgt: Dg(I, B)
|
|
10415
10433
|
}));
|
|
10416
10434
|
}
|
|
10417
10435
|
function ns(C, A) {
|
|
@@ -10448,7 +10466,7 @@ function xC(C) {
|
|
|
10448
10466
|
return Ds;
|
|
10449
10467
|
}
|
|
10450
10468
|
}
|
|
10451
|
-
function
|
|
10469
|
+
function Pg(C, A, I) {
|
|
10452
10470
|
const g = A - C + 1;
|
|
10453
10471
|
switch (I) {
|
|
10454
10472
|
case "clamp":
|
|
@@ -10463,7 +10481,7 @@ function Zg(C, A, I) {
|
|
|
10463
10481
|
};
|
|
10464
10482
|
}
|
|
10465
10483
|
}
|
|
10466
|
-
function
|
|
10484
|
+
function Og(C, A, I) {
|
|
10467
10485
|
const g = A - C + 1n;
|
|
10468
10486
|
switch (I) {
|
|
10469
10487
|
case "clamp":
|
|
@@ -10510,21 +10528,21 @@ class bB {
|
|
|
10510
10528
|
}
|
|
10511
10529
|
}
|
|
10512
10530
|
function bC(C, A, I, g, B) {
|
|
10513
|
-
const Q =
|
|
10531
|
+
const Q = rg(C), E = sB(C), i = rg(A), o = sB(A);
|
|
10514
10532
|
let s;
|
|
10515
10533
|
if (Q && i) {
|
|
10516
10534
|
if (I !== "nearest-even")
|
|
10517
10535
|
throw new nA(`cast_value float -> float only supports "nearest-even" rounding, got "${I}"`);
|
|
10518
10536
|
s = (e) => e;
|
|
10519
10537
|
} else if (Q && !i && !o) {
|
|
10520
|
-
const e = xC(I), n =
|
|
10538
|
+
const e = xC(I), n = Pg(...vg[A], g);
|
|
10521
10539
|
s = (D) => {
|
|
10522
10540
|
if (!Number.isFinite(D))
|
|
10523
10541
|
throw new Error(`Cannot cast ${D} to integer type without scalar_map`);
|
|
10524
10542
|
return n(e(D));
|
|
10525
10543
|
};
|
|
10526
10544
|
} else if (Q && o) {
|
|
10527
|
-
const e = xC(I), n =
|
|
10545
|
+
const e = xC(I), n = Og(...Zg[A], g);
|
|
10528
10546
|
s = (D) => {
|
|
10529
10547
|
if (!Number.isFinite(D))
|
|
10530
10548
|
throw new Error(`Cannot cast ${D} to integer type without scalar_map`);
|
|
@@ -10535,15 +10553,15 @@ function bC(C, A, I, g, B) {
|
|
|
10535
10553
|
else if (E && i)
|
|
10536
10554
|
s = (e) => Number(e);
|
|
10537
10555
|
else if (!Q && !E && !i && !o)
|
|
10538
|
-
s =
|
|
10556
|
+
s = Pg(...vg[A], g);
|
|
10539
10557
|
else if (!Q && !E && o) {
|
|
10540
|
-
const e =
|
|
10558
|
+
const e = Og(...Zg[A], g);
|
|
10541
10559
|
s = (n) => e(BigInt(n));
|
|
10542
10560
|
} else if (E && !i && !o) {
|
|
10543
|
-
const e =
|
|
10561
|
+
const e = Pg(...vg[A], g);
|
|
10544
10562
|
s = (n) => e(Number(n));
|
|
10545
10563
|
} else if (E && o)
|
|
10546
|
-
s =
|
|
10564
|
+
s = Og(...Zg[A], g);
|
|
10547
10565
|
else
|
|
10548
10566
|
throw new Error(`Unhandled type combination: ${C} -> ${A}`);
|
|
10549
10567
|
return B.length === 0 ? s : (e) => {
|
|
@@ -10635,7 +10653,7 @@ function ys(C, A) {
|
|
|
10635
10653
|
function cs(C, A) {
|
|
10636
10654
|
return A instanceof Object && !Array.isArray(A) ? Object.keys(A).sort().reduce((I, g) => (I[g] = A[g], I), {}) : A;
|
|
10637
10655
|
}
|
|
10638
|
-
class
|
|
10656
|
+
class hg {
|
|
10639
10657
|
configuration;
|
|
10640
10658
|
kind = "array_to_bytes";
|
|
10641
10659
|
#A;
|
|
@@ -10656,7 +10674,7 @@ class Dg {
|
|
|
10656
10674
|
}, this.#I = { strict: s };
|
|
10657
10675
|
}
|
|
10658
10676
|
static fromConfig(A) {
|
|
10659
|
-
return new
|
|
10677
|
+
return new hg(A);
|
|
10660
10678
|
}
|
|
10661
10679
|
encode(A) {
|
|
10662
10680
|
const { indent: I, encoding: g, ensure_ascii: B, check_circular: Q, allow_nan: E, sort_keys: i } = this.#A;
|
|
@@ -10681,7 +10699,7 @@ class Dg {
|
|
|
10681
10699
|
decode(A) {
|
|
10682
10700
|
const { strict: I } = this.#I;
|
|
10683
10701
|
FA(I, "JsonCodec does not yet support non-strict decoding.");
|
|
10684
|
-
const g =
|
|
10702
|
+
const g = VI(A), B = g.pop();
|
|
10685
10703
|
g.pop(), FA(B, "0D not implemented for JsonCodec.");
|
|
10686
10704
|
const Q = BI(B, "C");
|
|
10687
10705
|
return { data: g, shape: B, stride: Q };
|
|
@@ -10711,7 +10729,7 @@ class ZB {
|
|
|
10711
10729
|
static fromConfig(A, I) {
|
|
10712
10730
|
if (!ws.has(I.dataType))
|
|
10713
10731
|
throw new nA(`scale_offset codec does not support data type: ${I.dataType}`);
|
|
10714
|
-
return new ZB(
|
|
10732
|
+
return new ZB(Dg(I.dataType, A.scale ?? 1), Dg(I.dataType, A.offset ?? 0), RI(I.dataType));
|
|
10715
10733
|
}
|
|
10716
10734
|
encode = EI("scale_offset");
|
|
10717
10735
|
decode(A) {
|
|
@@ -10756,7 +10774,7 @@ function Fs(C, A) {
|
|
|
10756
10774
|
return B;
|
|
10757
10775
|
}
|
|
10758
10776
|
function WC(C) {
|
|
10759
|
-
return C instanceof gE || C instanceof xB || C instanceof
|
|
10777
|
+
return C instanceof gE || C instanceof xB || C instanceof OI ? new Proxy(C, {
|
|
10760
10778
|
get(I, g) {
|
|
10761
10779
|
return I.get(Number(g));
|
|
10762
10780
|
},
|
|
@@ -10767,7 +10785,7 @@ function WC(C) {
|
|
|
10767
10785
|
}
|
|
10768
10786
|
function Ss(C, A) {
|
|
10769
10787
|
let I;
|
|
10770
|
-
return C.data instanceof xB || C.data instanceof
|
|
10788
|
+
return C.data instanceof xB || C.data instanceof OI ? I = new C.constructor(
|
|
10771
10789
|
// @ts-expect-error
|
|
10772
10790
|
C.data.length,
|
|
10773
10791
|
C.data.chars
|
|
@@ -10833,7 +10851,7 @@ class OB {
|
|
|
10833
10851
|
};
|
|
10834
10852
|
}
|
|
10835
10853
|
}
|
|
10836
|
-
class
|
|
10854
|
+
class yg {
|
|
10837
10855
|
kind = "array_to_bytes";
|
|
10838
10856
|
#A;
|
|
10839
10857
|
#I;
|
|
@@ -10841,7 +10859,7 @@ class hg {
|
|
|
10841
10859
|
this.#A = A, this.#I = BI(A, "C");
|
|
10842
10860
|
}
|
|
10843
10861
|
static fromConfig(A, I) {
|
|
10844
|
-
return new
|
|
10862
|
+
return new yg(I.shape);
|
|
10845
10863
|
}
|
|
10846
10864
|
encode = EI("vlen-utf8");
|
|
10847
10865
|
decode(A) {
|
|
@@ -10866,7 +10884,7 @@ class VB {
|
|
|
10866
10884
|
}
|
|
10867
10885
|
function Us() {
|
|
10868
10886
|
let C = () => import("./blosc-D1xNXZJs.js").then((Q) => Q.default), A = () => import("./lz4-1Ws5oVWR.js").then((Q) => Q.default), I = () => import("./zstd-C4EcZnjq.js").then((Q) => Q.default), g = () => vB, B = () => VB;
|
|
10869
|
-
return (/* @__PURE__ */ new Map()).set("blosc", C).set("lz4", A).set("zstd", I).set("gzip", g).set("zlib", B).set("transpose", () => OB).set("bytes", () =>
|
|
10887
|
+
return (/* @__PURE__ */ new Map()).set("blosc", C).set("lz4", A).set("zstd", I).set("gzip", g).set("zlib", B).set("transpose", () => OB).set("bytes", () => Lg).set("crc32c", () => TB).set("vlen-utf8", () => yg).set("json2", () => hg).set("bitround", () => ng).set("cast_value", () => bB).set("scale_offset", () => ZB).set("numcodecs.blosc", C).set("numcodecs.lz4", A).set("numcodecs.zstd", I).set("numcodecs.gzip", g).set("numcodecs.zlib", B).set("numcodecs.vlen-utf8", () => yg).set("numcodecs.shuffle", () => PB).set("numcodecs.delta", () => WB).set("numcodecs.bitround", () => ng).set("numcodecs.json2", () => hg);
|
|
10870
10888
|
}
|
|
10871
10889
|
const ds = Us();
|
|
10872
10890
|
function tB(C) {
|
|
@@ -10951,7 +10969,7 @@ async function ls(C) {
|
|
|
10951
10969
|
throw new nA(`Cannot encode ${Q.dataType} to bytes without a codec`);
|
|
10952
10970
|
g = {
|
|
10953
10971
|
name: "bytes",
|
|
10954
|
-
codec:
|
|
10972
|
+
codec: Lg.fromConfig({ endian: "little" }, Q)
|
|
10955
10973
|
};
|
|
10956
10974
|
}
|
|
10957
10975
|
return {
|
|
@@ -11016,7 +11034,7 @@ class _B extends UA {
|
|
|
11016
11034
|
function PC(C) {
|
|
11017
11035
|
return C.find((I) => I.name === "transpose")?.configuration?.order ?? "C";
|
|
11018
11036
|
}
|
|
11019
|
-
const
|
|
11037
|
+
const $I = Symbol("zarrita.context");
|
|
11020
11038
|
function Ys(C, A) {
|
|
11021
11039
|
let { configuration: I } = A.codecs.find(ts) ?? {}, g = {
|
|
11022
11040
|
encodeChunkKey: Es(A.chunk_key_encoding),
|
|
@@ -11061,15 +11079,15 @@ function Ys(C, A) {
|
|
|
11061
11079
|
}
|
|
11062
11080
|
};
|
|
11063
11081
|
}
|
|
11064
|
-
let
|
|
11082
|
+
let cg = class extends UA {
|
|
11065
11083
|
kind = "array";
|
|
11066
11084
|
#A;
|
|
11067
|
-
[
|
|
11085
|
+
[$I];
|
|
11068
11086
|
constructor(A, I, g) {
|
|
11069
11087
|
super(A, I), this.#A = {
|
|
11070
11088
|
...g,
|
|
11071
11089
|
fill_value: BE(g)
|
|
11072
|
-
}, this[
|
|
11090
|
+
}, this[$I] = Ys(this, this.#A);
|
|
11073
11091
|
}
|
|
11074
11092
|
get attrs() {
|
|
11075
11093
|
return this.#A.attributes;
|
|
@@ -11084,14 +11102,14 @@ let yg = class extends UA {
|
|
|
11084
11102
|
return this.#A.shape;
|
|
11085
11103
|
}
|
|
11086
11104
|
get chunks() {
|
|
11087
|
-
return this[
|
|
11105
|
+
return this[$I].chunkShape;
|
|
11088
11106
|
}
|
|
11089
11107
|
get dtype() {
|
|
11090
11108
|
return this.#A.data_type;
|
|
11091
11109
|
}
|
|
11092
11110
|
async getChunk(A, I, g) {
|
|
11093
11111
|
g?.useSharedArrayBuffer && Cs();
|
|
11094
|
-
let B = this[
|
|
11112
|
+
let B = this[$I], Q = await B.getChunkBytes(A, I);
|
|
11095
11113
|
if (!Q) {
|
|
11096
11114
|
let E = B.chunkShape.reduce((o, s) => o * s, 1), i;
|
|
11097
11115
|
if (g?.useSharedArrayBuffer) {
|
|
@@ -11146,7 +11164,7 @@ async function iE(C) {
|
|
|
11146
11164
|
let A = C.store.arrayExtensions;
|
|
11147
11165
|
return A?.length ? await us(C, ...A) : C;
|
|
11148
11166
|
}
|
|
11149
|
-
let
|
|
11167
|
+
let Jg = fs();
|
|
11150
11168
|
function fs() {
|
|
11151
11169
|
let C = /* @__PURE__ */ new WeakMap();
|
|
11152
11170
|
function A(I) {
|
|
@@ -11167,7 +11185,7 @@ async function Ks(C, A) {
|
|
|
11167
11185
|
let I = await C.store.get(C.resolve(".zattrs").path, {
|
|
11168
11186
|
signal: A
|
|
11169
11187
|
});
|
|
11170
|
-
return I ?
|
|
11188
|
+
return I ? VI(I) : {};
|
|
11171
11189
|
}
|
|
11172
11190
|
async function Hs(C, A = {}) {
|
|
11173
11191
|
let I = "store" in C ? C : new UA(C), { signal: g } = A, B = {};
|
|
@@ -11177,33 +11195,33 @@ async function OC(C, A, I) {
|
|
|
11177
11195
|
let { path: g } = C.resolve(".zarray"), B = await C.store.get(g, { signal: I });
|
|
11178
11196
|
if (!B)
|
|
11179
11197
|
throw new NI("v2 array", { path: g });
|
|
11180
|
-
return
|
|
11198
|
+
return Jg.increment(C.store, "v2"), iE(new cg(C.store, C.path, os(VI(B), A)));
|
|
11181
11199
|
}
|
|
11182
11200
|
async function VC(C, A, I) {
|
|
11183
11201
|
let { path: g } = C.resolve(".zgroup"), B = await C.store.get(g, { signal: I });
|
|
11184
11202
|
if (!B)
|
|
11185
11203
|
throw new NI("v2 group", { path: g });
|
|
11186
|
-
return
|
|
11204
|
+
return Jg.increment(C.store, "v2"), new _B(C.store, C.path, ss(VI(B), A));
|
|
11187
11205
|
}
|
|
11188
11206
|
async function qs(C, A) {
|
|
11189
11207
|
let { store: I, path: g } = C.resolve("zarr.json"), B = await C.store.get(g, { signal: A });
|
|
11190
11208
|
if (!B)
|
|
11191
11209
|
throw new NI("v3 array or group", { path: g });
|
|
11192
|
-
let Q =
|
|
11193
|
-
return Q.node_type === "array" && (Q.fill_value = BE(Q)), Q.node_type === "array" ? iE(new
|
|
11210
|
+
let Q = VI(B);
|
|
11211
|
+
return Q.node_type === "array" && (Q.fill_value = BE(Q)), Q.node_type === "array" ? iE(new cg(I, C.path, Q)) : new _B(I, C.path, Q);
|
|
11194
11212
|
}
|
|
11195
11213
|
async function ps(C, A = {}) {
|
|
11196
11214
|
let I = "store" in C ? C : new UA(C), g = await qs(I, A.signal);
|
|
11197
|
-
if (
|
|
11215
|
+
if (Jg.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && g instanceof cg || A.kind === "group" && g instanceof _B)
|
|
11198
11216
|
return g;
|
|
11199
|
-
let B = g instanceof
|
|
11217
|
+
let B = g instanceof cg ? "array" : "group";
|
|
11200
11218
|
throw new NI(`${A.kind} at ${I.path}`, {
|
|
11201
11219
|
path: I.path,
|
|
11202
11220
|
found: B
|
|
11203
11221
|
});
|
|
11204
11222
|
}
|
|
11205
11223
|
async function RA(C, A = {}) {
|
|
11206
|
-
let I = "store" in C ? C.store : C, g =
|
|
11224
|
+
let I = "store" in C ? C.store : C, g = Jg.versionMax(I), B = g === "v2" ? RA.v2 : RA.v3, Q = g === "v2" ? RA.v3 : RA.v2;
|
|
11207
11225
|
return B(C, A).catch((E) => (CE(E, NI, nA), Q(C, A)));
|
|
11208
11226
|
}
|
|
11209
11227
|
RA.v2 = Hs;
|
|
@@ -11235,7 +11253,7 @@ class XB {
|
|
|
11235
11253
|
return new Uint8Array(B);
|
|
11236
11254
|
}
|
|
11237
11255
|
}
|
|
11238
|
-
async function
|
|
11256
|
+
async function _I(C, A) {
|
|
11239
11257
|
if (A === "v2")
|
|
11240
11258
|
try {
|
|
11241
11259
|
return RA.v2(C, { kind: "group", attrs: !0 });
|
|
@@ -11277,7 +11295,7 @@ async function bs(C) {
|
|
|
11277
11295
|
let A;
|
|
11278
11296
|
switch (C.type) {
|
|
11279
11297
|
case "fetch": {
|
|
11280
|
-
const g = new
|
|
11298
|
+
const g = new ZI(C.url);
|
|
11281
11299
|
A = new UA(g);
|
|
11282
11300
|
break;
|
|
11283
11301
|
}
|
|
@@ -11297,7 +11315,7 @@ async function bs(C) {
|
|
|
11297
11315
|
return xs(I, C.zarrVersion);
|
|
11298
11316
|
}
|
|
11299
11317
|
function Ts(C, A, I) {
|
|
11300
|
-
if (C.store instanceof
|
|
11318
|
+
if (C.store instanceof ZI)
|
|
11301
11319
|
return {
|
|
11302
11320
|
type: "fetch",
|
|
11303
11321
|
arrayPath: A,
|
|
@@ -15032,7 +15050,7 @@ function Zs(C) {
|
|
|
15032
15050
|
}
|
|
15033
15051
|
const Ps = Math.max(1, navigator.hardwareConcurrency - 2);
|
|
15034
15052
|
let JA = [], Os = 0, sE = 0;
|
|
15035
|
-
const CI = /* @__PURE__ */ new Map(),
|
|
15053
|
+
const CI = /* @__PURE__ */ new Map(), wg = /* @__PURE__ */ new Set();
|
|
15036
15054
|
function tE(C) {
|
|
15037
15055
|
const A = JA.find((I) => I.worker === C);
|
|
15038
15056
|
return A || H.error(
|
|
@@ -15043,7 +15061,7 @@ function tE(C) {
|
|
|
15043
15061
|
function Vs(C, A) {
|
|
15044
15062
|
const { id: I, success: g } = C.data, B = CI.get(I);
|
|
15045
15063
|
if (!B) {
|
|
15046
|
-
|
|
15064
|
+
wg.has(I) ? wg.delete(I) : H.warn(
|
|
15047
15065
|
"ZarrWorker",
|
|
15048
15066
|
`Received response for unknown message ID ${I}:`,
|
|
15049
15067
|
C.data
|
|
@@ -15114,10 +15132,10 @@ async function Xs(C, A, I, g) {
|
|
|
15114
15132
|
E.worker.postMessage({
|
|
15115
15133
|
id: i,
|
|
15116
15134
|
type: "cancel"
|
|
15117
|
-
}), CI.delete(i),
|
|
15135
|
+
}), CI.delete(i), wg.add(i), E.pendingCount--, Q(new DOMException("Operation was aborted", "AbortError"));
|
|
15118
15136
|
};
|
|
15119
15137
|
if (g.signal.aborted) {
|
|
15120
|
-
s(),
|
|
15138
|
+
s(), wg.delete(i);
|
|
15121
15139
|
return;
|
|
15122
15140
|
}
|
|
15123
15141
|
g.signal.addEventListener("abort", s, { once: !0 }), o.abortListener = s, o.abortSignal = g.signal;
|
|
@@ -15165,7 +15183,7 @@ async function zs(C, A, I, g, B) {
|
|
|
15165
15183
|
throw Q;
|
|
15166
15184
|
H.warn("ZarrWorker", "Falling back to main thread", Q);
|
|
15167
15185
|
const E = await C.getChunk(I, B);
|
|
15168
|
-
if (!
|
|
15186
|
+
if (!xo(E.data))
|
|
15169
15187
|
throw new Error(
|
|
15170
15188
|
`Unsupported chunk data type: ${E.data.constructor.name}`
|
|
15171
15189
|
);
|
|
@@ -15234,7 +15252,7 @@ class At {
|
|
|
15234
15252
|
throw new Error(
|
|
15235
15253
|
"Invalid row alignment value. Possible values are 1, 2, 4, or 8"
|
|
15236
15254
|
);
|
|
15237
|
-
A.rowAlignmentBytes = t,
|
|
15255
|
+
A.rowAlignmentBytes = t, po(A, s);
|
|
15238
15256
|
}
|
|
15239
15257
|
}
|
|
15240
15258
|
const jC = {
|
|
@@ -15278,25 +15296,25 @@ function gt(C, A) {
|
|
|
15278
15296
|
x: E(I[B], B),
|
|
15279
15297
|
y: E(I[Q], Q),
|
|
15280
15298
|
numLods: A.length
|
|
15281
|
-
}, o =
|
|
15299
|
+
}, o = Bg(I, "z");
|
|
15282
15300
|
o !== -1 && (i.z = E(I[o], o));
|
|
15283
|
-
const s =
|
|
15301
|
+
const s = Bg(I, "c");
|
|
15284
15302
|
s !== -1 && (i.c = E(I[s], s));
|
|
15285
|
-
const t =
|
|
15303
|
+
const t = Bg(I, "t");
|
|
15286
15304
|
return t !== -1 && (i.t = E(I[t], t)), i;
|
|
15287
15305
|
}
|
|
15288
15306
|
function Bt(C, A) {
|
|
15289
15307
|
return C.toLowerCase() === A.toLowerCase();
|
|
15290
15308
|
}
|
|
15291
15309
|
function zC(C, A) {
|
|
15292
|
-
const I =
|
|
15310
|
+
const I = Bg(C, A);
|
|
15293
15311
|
if (I === -1)
|
|
15294
15312
|
throw new Error(
|
|
15295
15313
|
`Could not find "${A}" dimension in [${C.join(", ")}]`
|
|
15296
15314
|
);
|
|
15297
15315
|
return I;
|
|
15298
15316
|
}
|
|
15299
|
-
function
|
|
15317
|
+
function Bg(C, A) {
|
|
15300
15318
|
return C.findIndex((I) => Bt(I, A));
|
|
15301
15319
|
}
|
|
15302
15320
|
function Ct(C) {
|
|
@@ -15618,7 +15636,7 @@ class NA {
|
|
|
15618
15636
|
}
|
|
15619
15637
|
const m = Object.freeze({
|
|
15620
15638
|
status: "aborted"
|
|
15621
|
-
}),
|
|
15639
|
+
}), YI = (C) => ({ status: "dirty", value: C }), lA = (C) => ({ status: "valid", value: C }), AQ = (C) => C.status === "aborted", IQ = (C) => C.status === "dirty", DI = (C) => C.status === "valid", Gg = (C) => typeof Promise < "u" && C instanceof Promise;
|
|
15622
15640
|
var K;
|
|
15623
15641
|
(function(C) {
|
|
15624
15642
|
C.errToObj = (A) => typeof A == "string" ? { message: A } : A || {}, C.toString = (A) => typeof A == "string" ? A : A?.message;
|
|
@@ -15689,7 +15707,7 @@ class Z {
|
|
|
15689
15707
|
}
|
|
15690
15708
|
_parseSync(A) {
|
|
15691
15709
|
const I = this._parse(A);
|
|
15692
|
-
if (
|
|
15710
|
+
if (Gg(I))
|
|
15693
15711
|
throw new Error("Synchronous parse encountered promise.");
|
|
15694
15712
|
return I;
|
|
15695
15713
|
}
|
|
@@ -15768,7 +15786,7 @@ class Z {
|
|
|
15768
15786
|
parent: null,
|
|
15769
15787
|
data: A,
|
|
15770
15788
|
parsedType: vA(A)
|
|
15771
|
-
}, B = this._parse({ data: A, path: g.path, parent: g }), Q = await (
|
|
15789
|
+
}, B = this._parse({ data: A, path: g.path, parent: g }), Q = await (Gg(B) ? B : Promise.resolve(B));
|
|
15772
15790
|
return gQ(g, Q);
|
|
15773
15791
|
}
|
|
15774
15792
|
refine(A, I) {
|
|
@@ -15814,13 +15832,13 @@ class Z {
|
|
|
15814
15832
|
return pA.create(this);
|
|
15815
15833
|
}
|
|
15816
15834
|
promise() {
|
|
15817
|
-
return
|
|
15835
|
+
return Rg.create(this, this._def);
|
|
15818
15836
|
}
|
|
15819
15837
|
or(A) {
|
|
15820
|
-
return
|
|
15838
|
+
return Sg.create([this, A], this._def);
|
|
15821
15839
|
}
|
|
15822
15840
|
and(A) {
|
|
15823
|
-
return
|
|
15841
|
+
return Ng.create(this, A, this._def);
|
|
15824
15842
|
}
|
|
15825
15843
|
transform(A) {
|
|
15826
15844
|
return new cI({
|
|
@@ -15876,7 +15894,7 @@ class Z {
|
|
|
15876
15894
|
}
|
|
15877
15895
|
}
|
|
15878
15896
|
const ot = /^c[^\s-]{8,}$/i, st = /^[0-9a-z]+$/, tt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, et = /^[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, at = /^[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)?)??$/, Dt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ht = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
15879
|
-
let
|
|
15897
|
+
let Vg;
|
|
15880
15898
|
const yt = /^(?:(?: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])$/, ct = /^(?:(?: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])$/, wt = /^(([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]))$/, Gt = /^(([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])$/, Ft = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, St = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, aE = "((\\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])))", Nt = new RegExp(`^${aE}$`);
|
|
15881
15899
|
function nE(C) {
|
|
15882
15900
|
let A = "[0-5]\\d";
|
|
@@ -15966,7 +15984,7 @@ class PA extends Z {
|
|
|
15966
15984
|
message: Q.message
|
|
15967
15985
|
}), g.dirty());
|
|
15968
15986
|
else if (Q.kind === "emoji")
|
|
15969
|
-
|
|
15987
|
+
Vg || (Vg = new RegExp(ht, "u")), Vg.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
|
|
15970
15988
|
validation: "emoji",
|
|
15971
15989
|
code: d.invalid_string,
|
|
15972
15990
|
message: Q.message
|
|
@@ -16470,7 +16488,7 @@ hI.create = (C) => new hI({
|
|
|
16470
16488
|
coerce: C?.coerce || !1,
|
|
16471
16489
|
...b(C)
|
|
16472
16490
|
});
|
|
16473
|
-
class
|
|
16491
|
+
class bI extends Z {
|
|
16474
16492
|
constructor() {
|
|
16475
16493
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
16476
16494
|
}
|
|
@@ -16526,7 +16544,7 @@ class mI extends Z {
|
|
|
16526
16544
|
return this.setLimit("max", A, !1, K.toString(I));
|
|
16527
16545
|
}
|
|
16528
16546
|
setLimit(A, I, g, B) {
|
|
16529
|
-
return new
|
|
16547
|
+
return new bI({
|
|
16530
16548
|
...this._def,
|
|
16531
16549
|
checks: [
|
|
16532
16550
|
...this._def.checks,
|
|
@@ -16540,7 +16558,7 @@ class mI extends Z {
|
|
|
16540
16558
|
});
|
|
16541
16559
|
}
|
|
16542
16560
|
_addCheck(A) {
|
|
16543
|
-
return new
|
|
16561
|
+
return new bI({
|
|
16544
16562
|
...this._def,
|
|
16545
16563
|
checks: [...this._def.checks, A]
|
|
16546
16564
|
});
|
|
@@ -16597,7 +16615,7 @@ class mI extends Z {
|
|
|
16597
16615
|
return A;
|
|
16598
16616
|
}
|
|
16599
16617
|
}
|
|
16600
|
-
|
|
16618
|
+
bI.create = (C) => new bI({
|
|
16601
16619
|
checks: [],
|
|
16602
16620
|
typeName: x.ZodBigInt,
|
|
16603
16621
|
coerce: C?.coerce ?? !1,
|
|
@@ -16621,7 +16639,7 @@ aB.create = (C) => new aB({
|
|
|
16621
16639
|
coerce: C?.coerce || !1,
|
|
16622
16640
|
...b(C)
|
|
16623
16641
|
});
|
|
16624
|
-
class
|
|
16642
|
+
class Fg extends Z {
|
|
16625
16643
|
_parse(A) {
|
|
16626
16644
|
if (this._def.coerce && (A.data = new Date(A.data)), this._getType(A) !== u.date) {
|
|
16627
16645
|
const Q = this._getOrReturnCtx(A);
|
|
@@ -16661,7 +16679,7 @@ class Gg extends Z {
|
|
|
16661
16679
|
};
|
|
16662
16680
|
}
|
|
16663
16681
|
_addCheck(A) {
|
|
16664
|
-
return new
|
|
16682
|
+
return new Fg({
|
|
16665
16683
|
...this._def,
|
|
16666
16684
|
checks: [...this._def.checks, A]
|
|
16667
16685
|
});
|
|
@@ -16693,7 +16711,7 @@ class Gg extends Z {
|
|
|
16693
16711
|
return A != null ? new Date(A) : null;
|
|
16694
16712
|
}
|
|
16695
16713
|
}
|
|
16696
|
-
|
|
16714
|
+
Fg.create = (C) => new Fg({
|
|
16697
16715
|
checks: [],
|
|
16698
16716
|
coerce: C?.coerce || !1,
|
|
16699
16717
|
typeName: x.ZodDate,
|
|
@@ -17181,7 +17199,7 @@ eA.lazycreate = (C, A) => new eA({
|
|
|
17181
17199
|
typeName: x.ZodObject,
|
|
17182
17200
|
...b(A)
|
|
17183
17201
|
});
|
|
17184
|
-
class
|
|
17202
|
+
class Sg extends Z {
|
|
17185
17203
|
_parse(A) {
|
|
17186
17204
|
const { ctx: I } = this._processInputParams(A), g = this._def.options;
|
|
17187
17205
|
function B(Q) {
|
|
@@ -17249,7 +17267,7 @@ class Fg extends Z {
|
|
|
17249
17267
|
return this._def.options;
|
|
17250
17268
|
}
|
|
17251
17269
|
}
|
|
17252
|
-
|
|
17270
|
+
Sg.create = (C, A) => new Sg({
|
|
17253
17271
|
options: C,
|
|
17254
17272
|
typeName: x.ZodUnion,
|
|
17255
17273
|
...b(A)
|
|
@@ -17280,7 +17298,7 @@ function rB(C, A) {
|
|
|
17280
17298
|
return { valid: !0, data: B };
|
|
17281
17299
|
} else return I === u.date && g === u.date && +C == +A ? { valid: !0, data: C } : { valid: !1 };
|
|
17282
17300
|
}
|
|
17283
|
-
class
|
|
17301
|
+
class Ng extends Z {
|
|
17284
17302
|
_parse(A) {
|
|
17285
17303
|
const { status: I, ctx: g } = this._processInputParams(A), B = (Q, E) => {
|
|
17286
17304
|
if (AQ(Q) || AQ(E))
|
|
@@ -17312,7 +17330,7 @@ class Sg extends Z {
|
|
|
17312
17330
|
}));
|
|
17313
17331
|
}
|
|
17314
17332
|
}
|
|
17315
|
-
|
|
17333
|
+
Ng.create = (C, A, I) => new Ng({
|
|
17316
17334
|
left: C,
|
|
17317
17335
|
right: A,
|
|
17318
17336
|
typeName: x.ZodIntersection,
|
|
@@ -17416,7 +17434,7 @@ oQ.create = (C, A, I) => new oQ({
|
|
|
17416
17434
|
typeName: x.ZodMap,
|
|
17417
17435
|
...b(I)
|
|
17418
17436
|
});
|
|
17419
|
-
class
|
|
17437
|
+
class TI extends Z {
|
|
17420
17438
|
_parse(A) {
|
|
17421
17439
|
const { status: I, ctx: g } = this._processInputParams(A);
|
|
17422
17440
|
if (g.parsedType !== u.set)
|
|
@@ -17455,13 +17473,13 @@ class xI extends Z {
|
|
|
17455
17473
|
return g.common.async ? Promise.all(i).then((o) => E(o)) : E(i);
|
|
17456
17474
|
}
|
|
17457
17475
|
min(A, I) {
|
|
17458
|
-
return new
|
|
17476
|
+
return new TI({
|
|
17459
17477
|
...this._def,
|
|
17460
17478
|
minSize: { value: A, message: K.toString(I) }
|
|
17461
17479
|
});
|
|
17462
17480
|
}
|
|
17463
17481
|
max(A, I) {
|
|
17464
|
-
return new
|
|
17482
|
+
return new TI({
|
|
17465
17483
|
...this._def,
|
|
17466
17484
|
maxSize: { value: A, message: K.toString(I) }
|
|
17467
17485
|
});
|
|
@@ -17473,7 +17491,7 @@ class xI extends Z {
|
|
|
17473
17491
|
return this.min(1, A);
|
|
17474
17492
|
}
|
|
17475
17493
|
}
|
|
17476
|
-
|
|
17494
|
+
TI.create = (C, A) => new TI({
|
|
17477
17495
|
valueType: C,
|
|
17478
17496
|
minSize: null,
|
|
17479
17497
|
maxSize: null,
|
|
@@ -17607,7 +17625,7 @@ tQ.create = (C, A) => new tQ({
|
|
|
17607
17625
|
typeName: x.ZodNativeEnum,
|
|
17608
17626
|
...b(A)
|
|
17609
17627
|
});
|
|
17610
|
-
class
|
|
17628
|
+
class Rg extends Z {
|
|
17611
17629
|
unwrap() {
|
|
17612
17630
|
return this._def.type;
|
|
17613
17631
|
}
|
|
@@ -17626,7 +17644,7 @@ class Ng extends Z {
|
|
|
17626
17644
|
})));
|
|
17627
17645
|
}
|
|
17628
17646
|
}
|
|
17629
|
-
|
|
17647
|
+
Rg.create = (C, A) => new Rg({
|
|
17630
17648
|
type: C,
|
|
17631
17649
|
typeName: x.ZodPromise,
|
|
17632
17650
|
...b(A)
|
|
@@ -17658,7 +17676,7 @@ class cI extends Z {
|
|
|
17658
17676
|
path: g.path,
|
|
17659
17677
|
parent: g
|
|
17660
17678
|
});
|
|
17661
|
-
return o.status === "aborted" ? m : o.status === "dirty" || I.value === "dirty" ?
|
|
17679
|
+
return o.status === "aborted" ? m : o.status === "dirty" || I.value === "dirty" ? YI(o.value) : o;
|
|
17662
17680
|
});
|
|
17663
17681
|
{
|
|
17664
17682
|
if (I.value === "aborted")
|
|
@@ -17668,7 +17686,7 @@ class cI extends Z {
|
|
|
17668
17686
|
path: g.path,
|
|
17669
17687
|
parent: g
|
|
17670
17688
|
});
|
|
17671
|
-
return i.status === "aborted" ? m : i.status === "dirty" || I.value === "dirty" ?
|
|
17689
|
+
return i.status === "aborted" ? m : i.status === "dirty" || I.value === "dirty" ? YI(i.value) : i;
|
|
17672
17690
|
}
|
|
17673
17691
|
}
|
|
17674
17692
|
if (B.type === "refinement") {
|
|
@@ -17784,7 +17802,7 @@ class yB extends Z {
|
|
|
17784
17802
|
...g
|
|
17785
17803
|
}
|
|
17786
17804
|
});
|
|
17787
|
-
return
|
|
17805
|
+
return Gg(B) ? B.then((Q) => ({
|
|
17788
17806
|
status: "valid",
|
|
17789
17807
|
value: Q.status === "valid" ? Q.value : this._def.catchValue({
|
|
17790
17808
|
get error() {
|
|
@@ -17852,7 +17870,7 @@ class jB extends Z {
|
|
|
17852
17870
|
path: g.path,
|
|
17853
17871
|
parent: g
|
|
17854
17872
|
});
|
|
17855
|
-
return Q.status === "aborted" ? m : Q.status === "dirty" ? (I.dirty(),
|
|
17873
|
+
return Q.status === "aborted" ? m : Q.status === "dirty" ? (I.dirty(), YI(Q.value)) : this._def.out._parseAsync({
|
|
17856
17874
|
data: Q.value,
|
|
17857
17875
|
path: g.path,
|
|
17858
17876
|
parent: g
|
|
@@ -17885,7 +17903,7 @@ class jB extends Z {
|
|
|
17885
17903
|
class cB extends Z {
|
|
17886
17904
|
_parse(A) {
|
|
17887
17905
|
const I = this._def.innerType._parse(A), g = (B) => (DI(B) && (B.value = Object.freeze(B.value)), B);
|
|
17888
|
-
return
|
|
17906
|
+
return Gg(I) ? I.then((B) => g(B)) : g(I);
|
|
17889
17907
|
}
|
|
17890
17908
|
unwrap() {
|
|
17891
17909
|
return this._def.innerType;
|
|
@@ -17903,11 +17921,11 @@ var x;
|
|
|
17903
17921
|
const z = PA.create, T = hI.create, DE = aB.create, OA = nB.create;
|
|
17904
17922
|
jA.create;
|
|
17905
17923
|
const j = pA.create, q = eA.create;
|
|
17906
|
-
Fg.create;
|
|
17907
17924
|
Sg.create;
|
|
17925
|
+
Ng.create;
|
|
17908
17926
|
QI.create;
|
|
17909
17927
|
const yA = DB.create, aI = yI.create;
|
|
17910
|
-
|
|
17928
|
+
Rg.create;
|
|
17911
17929
|
_A.create;
|
|
17912
17930
|
wI.create;
|
|
17913
17931
|
const Yt = q({
|
|
@@ -18347,7 +18365,7 @@ function hE(C, A) {
|
|
|
18347
18365
|
return delete I[A], I;
|
|
18348
18366
|
}
|
|
18349
18367
|
async function de(C, A) {
|
|
18350
|
-
const I = new
|
|
18368
|
+
const I = new ZI(C), g = new UA(I), B = GI(A), Q = await _I(g, B);
|
|
18351
18369
|
try {
|
|
18352
18370
|
return xt(Q.attrs);
|
|
18353
18371
|
} catch {
|
|
@@ -18406,7 +18424,7 @@ function Wt(C) {
|
|
|
18406
18424
|
}
|
|
18407
18425
|
}
|
|
18408
18426
|
async function le(C, A, I) {
|
|
18409
|
-
const g = C + "/" + A, B = new
|
|
18427
|
+
const g = C + "/" + A, B = new ZI(g), Q = new UA(B), E = GI(I), i = await _I(Q, E);
|
|
18410
18428
|
try {
|
|
18411
18429
|
return Wt(i.attrs);
|
|
18412
18430
|
} catch {
|
|
@@ -18417,11 +18435,11 @@ ${JSON.stringify(i.attrs)}`
|
|
|
18417
18435
|
}
|
|
18418
18436
|
}
|
|
18419
18437
|
async function Le(C) {
|
|
18420
|
-
const A = GI(C.version), I = await
|
|
18438
|
+
const A = GI(C.version), I = await _I(C.location, A);
|
|
18421
18439
|
return $B(I.attrs).omero?.channels ?? [];
|
|
18422
18440
|
}
|
|
18423
18441
|
async function Je(C) {
|
|
18424
|
-
const A = GI(C.version), I = await
|
|
18442
|
+
const A = GI(C.version), I = await _I(C.location, A);
|
|
18425
18443
|
return $B(I.attrs).omero?.rdefs;
|
|
18426
18444
|
}
|
|
18427
18445
|
function vt(C) {
|
|
@@ -18455,7 +18473,7 @@ function $B(C) {
|
|
|
18455
18473
|
${JSON.stringify(C)}`);
|
|
18456
18474
|
}
|
|
18457
18475
|
}
|
|
18458
|
-
class
|
|
18476
|
+
class MI {
|
|
18459
18477
|
location;
|
|
18460
18478
|
version;
|
|
18461
18479
|
loader_;
|
|
@@ -18464,7 +18482,7 @@ class YI {
|
|
|
18464
18482
|
}
|
|
18465
18483
|
static async openLoader(A, I) {
|
|
18466
18484
|
let g = GI(I);
|
|
18467
|
-
const B = await
|
|
18485
|
+
const B = await _I(A, g), Q = $B(B.attrs), E = Q.multiscales;
|
|
18468
18486
|
if (E.length !== 1)
|
|
18469
18487
|
throw new Error(
|
|
18470
18488
|
`Exactly one multiscale image is supported. Found ${E.length} images.`
|
|
@@ -18500,8 +18518,8 @@ class YI {
|
|
|
18500
18518
|
* @param props.version OME-Zarr version
|
|
18501
18519
|
*/
|
|
18502
18520
|
static async fromHttp(A) {
|
|
18503
|
-
const I = new UA(new
|
|
18504
|
-
return new
|
|
18521
|
+
const I = new UA(new ZI(A.url)), g = await MI.openLoader(I, A.version);
|
|
18522
|
+
return new MI({ location: I, version: A.version, loader: g });
|
|
18505
18523
|
}
|
|
18506
18524
|
/**
|
|
18507
18525
|
* Creates and opens an OmeZarrImageSource from a local filesystem directory.
|
|
@@ -18516,11 +18534,11 @@ class YI {
|
|
|
18516
18534
|
const I = new UA(
|
|
18517
18535
|
new XB(A.directory),
|
|
18518
18536
|
A.path
|
|
18519
|
-
), g = await
|
|
18520
|
-
return new
|
|
18537
|
+
), g = await MI.openLoader(I, A.version);
|
|
18538
|
+
return new MI({ location: I, version: A.version, loader: g });
|
|
18521
18539
|
}
|
|
18522
18540
|
}
|
|
18523
|
-
class
|
|
18541
|
+
class Yg {
|
|
18524
18542
|
objects_ = [];
|
|
18525
18543
|
state_ = "initialized";
|
|
18526
18544
|
attached_ = !1;
|
|
@@ -18673,7 +18691,7 @@ const Vt = P(0, 1, 0);
|
|
|
18673
18691
|
class _t {
|
|
18674
18692
|
dirty_ = !0;
|
|
18675
18693
|
matrix_ = SA();
|
|
18676
|
-
rotation_ =
|
|
18694
|
+
rotation_ = IB();
|
|
18677
18695
|
translation_ = QA();
|
|
18678
18696
|
scale_ = P(1, 1, 1);
|
|
18679
18697
|
addRotation(A) {
|
|
@@ -18686,10 +18704,10 @@ class _t {
|
|
|
18686
18704
|
return si(this.rotation_);
|
|
18687
18705
|
}
|
|
18688
18706
|
addTranslation(A) {
|
|
18689
|
-
|
|
18707
|
+
HI(this.translation_, this.translation_, A), this.dirty_ = !0;
|
|
18690
18708
|
}
|
|
18691
18709
|
setTranslation(A) {
|
|
18692
|
-
|
|
18710
|
+
$g(this.translation_, A), this.dirty_ = !0;
|
|
18693
18711
|
}
|
|
18694
18712
|
get translation() {
|
|
18695
18713
|
return bA(this.translation_);
|
|
@@ -18698,7 +18716,7 @@ class _t {
|
|
|
18698
18716
|
$E(this.scale_, this.scale_, A), this.dirty_ = !0;
|
|
18699
18717
|
}
|
|
18700
18718
|
setScale(A) {
|
|
18701
|
-
|
|
18719
|
+
$g(this.scale_, A), this.dirty_ = !0;
|
|
18702
18720
|
}
|
|
18703
18721
|
targetTo(A) {
|
|
18704
18722
|
NB(this.translation_, A) && (A = bA(A), A[2] += AA);
|
|
@@ -18712,7 +18730,7 @@ class _t {
|
|
|
18712
18730
|
return this.dirty_ && (this.computeMatrix(), this.dirty_ = !1), this.matrix_;
|
|
18713
18731
|
}
|
|
18714
18732
|
get inverse() {
|
|
18715
|
-
return
|
|
18733
|
+
return Ug(SA(), this.matrix);
|
|
18716
18734
|
}
|
|
18717
18735
|
computeMatrix() {
|
|
18718
18736
|
ZE(
|
|
@@ -18814,25 +18832,25 @@ class Xt extends kI {
|
|
|
18814
18832
|
};
|
|
18815
18833
|
}
|
|
18816
18834
|
}
|
|
18817
|
-
class Ye extends
|
|
18835
|
+
class Ye extends Yg {
|
|
18818
18836
|
type = "AxesLayer";
|
|
18819
18837
|
constructor(A) {
|
|
18820
18838
|
super();
|
|
18821
18839
|
const { length: I, width: g } = A;
|
|
18822
18840
|
this.addObject(
|
|
18823
|
-
|
|
18841
|
+
_g({
|
|
18824
18842
|
end: [I, 0, 0],
|
|
18825
18843
|
width: g,
|
|
18826
18844
|
color: [1, 0, 0]
|
|
18827
18845
|
})
|
|
18828
18846
|
), this.addObject(
|
|
18829
|
-
|
|
18847
|
+
_g({
|
|
18830
18848
|
end: [0, I, 0],
|
|
18831
18849
|
width: g,
|
|
18832
18850
|
color: [0, 1, 0]
|
|
18833
18851
|
})
|
|
18834
18852
|
), this.addObject(
|
|
18835
|
-
|
|
18853
|
+
_g({
|
|
18836
18854
|
end: [0, 0, I],
|
|
18837
18855
|
width: g,
|
|
18838
18856
|
color: [0, 0, 1]
|
|
@@ -18842,7 +18860,7 @@ class Ye extends Jg {
|
|
|
18842
18860
|
update() {
|
|
18843
18861
|
}
|
|
18844
18862
|
}
|
|
18845
|
-
function
|
|
18863
|
+
function _g(C) {
|
|
18846
18864
|
const { end: A, width: I, color: g } = C, B = new Pt([[0, 0, 0], A]);
|
|
18847
18865
|
return new Xt({
|
|
18848
18866
|
geometry: B,
|
|
@@ -18851,7 +18869,7 @@ function Vg(C) {
|
|
|
18851
18869
|
});
|
|
18852
18870
|
}
|
|
18853
18871
|
const aQ = 32;
|
|
18854
|
-
function
|
|
18872
|
+
function WI(C, { visible: A, color: I, contrastLimits: g, opacity: B }) {
|
|
18855
18873
|
return A ??= !0, I = I === void 0 ? X.WHITE : X.from(I), B = B === void 0 ? 1 : TA(B, 0, 1), C !== null ? g = jt(g, C) : g === void 0 && (H.debug(
|
|
18856
18874
|
"Channel",
|
|
18857
18875
|
"No texture provided, defaulting channel contrast limits to [0, 1]."
|
|
@@ -18865,7 +18883,7 @@ function bI(C, { visible: A, color: I, contrastLimits: g, opacity: B }) {
|
|
|
18865
18883
|
function wB(C, A) {
|
|
18866
18884
|
if (A.length > aQ)
|
|
18867
18885
|
throw new Error(`Maximum number of channels is ${aQ}`);
|
|
18868
|
-
return A.map((I) =>
|
|
18886
|
+
return A.map((I) => WI(C, I));
|
|
18869
18887
|
}
|
|
18870
18888
|
function yE(C, A) {
|
|
18871
18889
|
if (C && C.length !== A)
|
|
@@ -18928,7 +18946,7 @@ class zt extends kI {
|
|
|
18928
18946
|
this.channels_ = wB(this.textures[0], A);
|
|
18929
18947
|
}
|
|
18930
18948
|
setChannelProperty(A, I, g) {
|
|
18931
|
-
const B =
|
|
18949
|
+
const B = WI(this.textures[0], {
|
|
18932
18950
|
...this.channels_[A],
|
|
18933
18951
|
[I]: g
|
|
18934
18952
|
});
|
|
@@ -18938,7 +18956,7 @@ class zt extends kI {
|
|
|
18938
18956
|
const A = this.textures[0];
|
|
18939
18957
|
if (!A)
|
|
18940
18958
|
throw new Error("No texture set");
|
|
18941
|
-
const { color: I, contrastLimits: g, opacity: B } = this.channels_[0] ??
|
|
18959
|
+
const { color: I, contrastLimits: g, opacity: B } = this.channels_[0] ?? WI(A, {});
|
|
18942
18960
|
return {
|
|
18943
18961
|
u_imageSampler: 0,
|
|
18944
18962
|
u_color: I.rgb,
|
|
@@ -19004,7 +19022,7 @@ class AC {
|
|
|
19004
19022
|
this.bins_.clear();
|
|
19005
19023
|
}
|
|
19006
19024
|
}
|
|
19007
|
-
class GE extends
|
|
19025
|
+
class GE extends Yg {
|
|
19008
19026
|
type = "ImageLayer";
|
|
19009
19027
|
source_;
|
|
19010
19028
|
sliceCoords_;
|
|
@@ -19116,13 +19134,13 @@ class GE extends Jg {
|
|
|
19116
19134
|
set imageSourcePolicy(A) {
|
|
19117
19135
|
this.policy_ !== A && (this.policy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
|
|
19118
19136
|
A,
|
|
19119
|
-
|
|
19137
|
+
lg
|
|
19120
19138
|
));
|
|
19121
19139
|
}
|
|
19122
19140
|
getImageForChunk(A, I) {
|
|
19123
19141
|
const g = this.visibleChunks_.get(A);
|
|
19124
19142
|
if (g) return g;
|
|
19125
|
-
const B = this.pool_.acquire(
|
|
19143
|
+
const B = this.pool_.acquire(kg(A));
|
|
19126
19144
|
return B ? (B.setTexture(0, I), B.zTexCoord = this.zTexCoordForChunk(A), B.setChannelProps(this.getChannelPropsForChunk(A)), this.updateImageChunk(B, A), B) : this.createImage(A, I);
|
|
19127
19145
|
}
|
|
19128
19146
|
getChannelPropsForChunk(A) {
|
|
@@ -19203,11 +19221,11 @@ class GE extends Jg {
|
|
|
19203
19221
|
releaseAndRemoveChunks(A) {
|
|
19204
19222
|
for (const I of A) {
|
|
19205
19223
|
const g = this.visibleChunks_.get(I);
|
|
19206
|
-
g && (this.pool_.release(
|
|
19224
|
+
g && (this.pool_.release(kg(I), g), this.visibleChunks_.delete(I));
|
|
19207
19225
|
}
|
|
19208
19226
|
}
|
|
19209
19227
|
}
|
|
19210
|
-
function
|
|
19228
|
+
function kg(C) {
|
|
19211
19229
|
return [
|
|
19212
19230
|
`lod${C.lod}`,
|
|
19213
19231
|
`shape${C.shape.x}x${C.shape.y}x${C.shape.z}`,
|
|
@@ -19317,7 +19335,7 @@ class Ie extends kI {
|
|
|
19317
19335
|
for (let o = 0; o < i && E.length < 4; o++) {
|
|
19318
19336
|
const s = this.channelToTextureIndex_.get(o);
|
|
19319
19337
|
if (s === void 0 || !this.loadedChannels_.has(o)) continue;
|
|
19320
|
-
const t = this.textures[s], e =
|
|
19338
|
+
const t = this.textures[s], e = WI(t, this.channels_[o] || {});
|
|
19321
19339
|
if (!e.visible) continue;
|
|
19322
19340
|
const n = E.length;
|
|
19323
19341
|
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;
|
|
@@ -19356,7 +19374,7 @@ class Ie extends kI {
|
|
|
19356
19374
|
);
|
|
19357
19375
|
}
|
|
19358
19376
|
setChannelProperty(A, I, g) {
|
|
19359
|
-
const B =
|
|
19377
|
+
const B = WI(
|
|
19360
19378
|
this.getAvailableChannelTexture(A),
|
|
19361
19379
|
{
|
|
19362
19380
|
...this.channels_[A],
|
|
@@ -19383,13 +19401,13 @@ function ge(C) {
|
|
|
19383
19401
|
function Be(C, A) {
|
|
19384
19402
|
const I = A.position, g = QA(), B = QA();
|
|
19385
19403
|
return C.sort((Q, E) => {
|
|
19386
|
-
|
|
19404
|
+
HI(g, Q.boundingBox.max, Q.boundingBox.min), qI(g, g, 0.5), HI(B, E.boundingBox.max, E.boundingBox.min), qI(B, B, 0.5);
|
|
19387
19405
|
const i = sC(I, g), o = sC(I, B);
|
|
19388
19406
|
return i - o;
|
|
19389
19407
|
}), C;
|
|
19390
19408
|
}
|
|
19391
19409
|
const Ce = 2;
|
|
19392
|
-
class Me extends
|
|
19410
|
+
class Me extends Yg {
|
|
19393
19411
|
type = "VolumeLayer";
|
|
19394
19412
|
source_;
|
|
19395
19413
|
sliceCoords_;
|
|
@@ -19423,7 +19441,7 @@ class Me extends Jg {
|
|
|
19423
19441
|
set sourcePolicy(A) {
|
|
19424
19442
|
this.sourcePolicy_ !== A && (this.sourcePolicy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
|
|
19425
19443
|
A,
|
|
19426
|
-
|
|
19444
|
+
lg
|
|
19427
19445
|
));
|
|
19428
19446
|
}
|
|
19429
19447
|
setChannelProps(A) {
|
|
@@ -19655,7 +19673,7 @@ class rQ {
|
|
|
19655
19673
|
this.lookupTable = ae(A.lookupTable), this.cycle = ne(A.cycle);
|
|
19656
19674
|
}
|
|
19657
19675
|
}
|
|
19658
|
-
class FE extends
|
|
19676
|
+
class FE extends Yg {
|
|
19659
19677
|
type = "LabelLayer";
|
|
19660
19678
|
source_;
|
|
19661
19679
|
sliceCoords_;
|
|
@@ -19764,7 +19782,7 @@ class FE extends Jg {
|
|
|
19764
19782
|
set imageSourcePolicy(A) {
|
|
19765
19783
|
this.policy_ !== A && (this.policy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
|
|
19766
19784
|
A,
|
|
19767
|
-
|
|
19785
|
+
lg
|
|
19768
19786
|
));
|
|
19769
19787
|
}
|
|
19770
19788
|
// exposed for use in chunk info overlay
|
|
@@ -19798,7 +19816,7 @@ class FE extends Jg {
|
|
|
19798
19816
|
getLabelForChunk(A, I) {
|
|
19799
19817
|
const g = this.visibleChunks_.get(A);
|
|
19800
19818
|
if (g) return g;
|
|
19801
|
-
const B = this.pool_.acquire(
|
|
19819
|
+
const B = this.pool_.acquire(kg(A));
|
|
19802
19820
|
return B ? (B.setTexture(0, I), B.zTexCoord = this.zTexCoordForChunk(A), B.setColorMap(this.colorMap_), B.setSelectedValue(this.selectedValue_), this.updateLabelChunk(B, A), B) : this.createLabel(A, I);
|
|
19803
19821
|
}
|
|
19804
19822
|
createLabel(A, I) {
|
|
@@ -19827,7 +19845,7 @@ class FE extends Jg {
|
|
|
19827
19845
|
releaseAndRemoveChunks(A) {
|
|
19828
19846
|
for (const I of A) {
|
|
19829
19847
|
const g = this.visibleChunks_.get(I);
|
|
19830
|
-
g && (this.pool_.release(
|
|
19848
|
+
g && (this.pool_.release(kg(I), g), this.visibleChunks_.delete(I));
|
|
19831
19849
|
}
|
|
19832
19850
|
}
|
|
19833
19851
|
}
|
|
@@ -19895,9 +19913,9 @@ class ue extends kI {
|
|
|
19895
19913
|
return "Points";
|
|
19896
19914
|
}
|
|
19897
19915
|
}
|
|
19898
|
-
let
|
|
19916
|
+
let Xg;
|
|
19899
19917
|
function De() {
|
|
19900
|
-
return
|
|
19918
|
+
return Xg || (Xg = he()), Xg;
|
|
19901
19919
|
}
|
|
19902
19920
|
function he() {
|
|
19903
19921
|
const C = (s) => {
|
|
@@ -19941,7 +19959,7 @@ class DQ {
|
|
|
19941
19959
|
);
|
|
19942
19960
|
}
|
|
19943
19961
|
}
|
|
19944
|
-
const
|
|
19962
|
+
const jg = -1, hQ = 0, ye = 1, yQ = 9e-3, ce = 1e-3, we = 9e-4, Ge = 0.5, Fe = 60;
|
|
19945
19963
|
class fe {
|
|
19946
19964
|
camera_;
|
|
19947
19965
|
orbitVelocity_ = new DQ(0, 0, 0);
|
|
@@ -19949,13 +19967,13 @@ class fe {
|
|
|
19949
19967
|
currPos_;
|
|
19950
19968
|
currCenter_ = QA();
|
|
19951
19969
|
dampingFactor_;
|
|
19952
|
-
currMouseButton_ =
|
|
19970
|
+
currMouseButton_ = jg;
|
|
19953
19971
|
constructor(A, I) {
|
|
19954
19972
|
this.camera_ = A, this.currPos_ = new DQ(
|
|
19955
19973
|
I?.radius ?? 1,
|
|
19956
19974
|
I?.yaw ?? 0,
|
|
19957
19975
|
I?.pitch ?? 0
|
|
19958
|
-
), I?.target &&
|
|
19976
|
+
), I?.target && $g(this.currCenter_, I.target), this.dampingFactor_ = TA(
|
|
19959
19977
|
I?.dampingFactor ?? Ge,
|
|
19960
19978
|
0,
|
|
19961
19979
|
1
|
|
@@ -19984,18 +20002,18 @@ class fe {
|
|
|
19984
20002
|
onUpdate(A) {
|
|
19985
20003
|
if (this.orbitVelocity_.phi === 0 && this.orbitVelocity_.theta === 0 && this.orbitVelocity_.radius === 0 && NB(this.panVelocity_, P(0, 0, 0)))
|
|
19986
20004
|
return;
|
|
19987
|
-
this.currPos_.phi += this.orbitVelocity_.phi, this.currPos_.theta += this.orbitVelocity_.theta, this.currPos_.radius += this.orbitVelocity_.radius * this.currPos_.radius,
|
|
20005
|
+
this.currPos_.phi += this.orbitVelocity_.phi, this.currPos_.theta += this.orbitVelocity_.theta, this.currPos_.radius += this.orbitVelocity_.radius * this.currPos_.radius, HI(this.currCenter_, this.currCenter_, this.panVelocity_);
|
|
19988
20006
|
const I = Math.PI / 2 - AA;
|
|
19989
20007
|
this.currPos_.theta = TA(this.currPos_.theta, -I, I), this.currPos_.radius = Math.max(0.01, this.currPos_.radius), this.updateCamera();
|
|
19990
20008
|
const g = Math.pow(1 - this.dampingFactor_, A * Fe);
|
|
19991
|
-
this.orbitVelocity_.phi *= g, this.orbitVelocity_.theta *= g, this.orbitVelocity_.radius *= g,
|
|
20009
|
+
this.orbitVelocity_.phi *= g, this.orbitVelocity_.theta *= g, this.orbitVelocity_.radius *= g, qI(this.panVelocity_, this.panVelocity_, g), this.cutoffLowVelocity();
|
|
19992
20010
|
}
|
|
19993
20011
|
onPointerDown(A) {
|
|
19994
20012
|
const I = A.event;
|
|
19995
20013
|
this.currMouseButton_ = I.button, I.target?.setPointerCapture?.(I.pointerId);
|
|
19996
20014
|
}
|
|
19997
20015
|
onPointerMove(A) {
|
|
19998
|
-
if (this.currMouseButton_ ==
|
|
20016
|
+
if (this.currMouseButton_ == jg) return;
|
|
19999
20017
|
const I = A.event, g = I.movementX ?? 0, B = I.movementY ?? 0, Q = this.currMouseButton_ === hQ && !I.shiftKey, E = this.currMouseButton_ === hQ && I.shiftKey || this.currMouseButton_ === ye;
|
|
20000
20018
|
Q && this.orbit(g, B), E && this.pan(g, B);
|
|
20001
20019
|
}
|
|
@@ -20006,7 +20024,7 @@ class fe {
|
|
|
20006
20024
|
this.zoom(g);
|
|
20007
20025
|
}
|
|
20008
20026
|
onPointerEnd(A) {
|
|
20009
|
-
this.currMouseButton_ =
|
|
20027
|
+
this.currMouseButton_ = jg;
|
|
20010
20028
|
const I = A.event;
|
|
20011
20029
|
I.target?.releasePointerCapture?.(I.pointerId);
|
|
20012
20030
|
}
|
|
@@ -20015,13 +20033,13 @@ class fe {
|
|
|
20015
20033
|
}
|
|
20016
20034
|
pan(A, I) {
|
|
20017
20035
|
const g = this.currPos_.radius * ce, B = QA();
|
|
20018
|
-
oC(B, B, this.camera_.right, A), oC(B, B, this.camera_.up, I),
|
|
20036
|
+
oC(B, B, this.camera_.right, A), oC(B, B, this.camera_.up, I), qI(B, B, g), AB(this.panVelocity_, this.panVelocity_, B);
|
|
20019
20037
|
}
|
|
20020
20038
|
zoom(A) {
|
|
20021
20039
|
this.orbitVelocity_.radius += A * we;
|
|
20022
20040
|
}
|
|
20023
20041
|
updateCamera() {
|
|
20024
|
-
const A =
|
|
20042
|
+
const A = HI(QA(), this.currCenter_, this.currPos_.toVec3());
|
|
20025
20043
|
this.camera_.transform.setTranslation(A), this.camera_.transform.targetTo(this.currCenter_);
|
|
20026
20044
|
}
|
|
20027
20045
|
cutoffLowVelocity() {
|
|
@@ -20044,7 +20062,7 @@ class oI {
|
|
|
20044
20062
|
const A = FB(this.normal);
|
|
20045
20063
|
if (A > 0) {
|
|
20046
20064
|
const I = 1 / A;
|
|
20047
|
-
|
|
20065
|
+
qI(this.normal, this.normal, I), this.signedDistance *= I;
|
|
20048
20066
|
}
|
|
20049
20067
|
}
|
|
20050
20068
|
}
|
|
@@ -20128,16 +20146,16 @@ class NE extends kI {
|
|
|
20128
20146
|
return this.transform.translation;
|
|
20129
20147
|
}
|
|
20130
20148
|
clipToWorld(A) {
|
|
20131
|
-
const I =
|
|
20149
|
+
const I = Qg(A[0], A[1], A[2], 1), g = Ug(
|
|
20132
20150
|
SA(),
|
|
20133
20151
|
this.projectionMatrix_
|
|
20134
|
-
), B =
|
|
20152
|
+
), B = pI(
|
|
20135
20153
|
nI(),
|
|
20136
20154
|
I,
|
|
20137
20155
|
g
|
|
20138
20156
|
);
|
|
20139
20157
|
Qi(B, B, 1 / B[3]);
|
|
20140
|
-
const Q =
|
|
20158
|
+
const Q = pI(
|
|
20141
20159
|
nI(),
|
|
20142
20160
|
B,
|
|
20143
20161
|
this.transform.matrix
|
|
@@ -20186,9 +20204,9 @@ class Ke extends NE {
|
|
|
20186
20204
|
this.transform.addScale([I, I, 1]);
|
|
20187
20205
|
}
|
|
20188
20206
|
getWorldViewRect() {
|
|
20189
|
-
let A =
|
|
20190
|
-
const g =
|
|
20191
|
-
return A =
|
|
20207
|
+
let A = Qg(-1, -1, 0, 1), I = Qg(1, 1, 0, 1);
|
|
20208
|
+
const g = Ug(SA(), this.getViewProjection());
|
|
20209
|
+
return A = pI(nI(), A, g), I = pI(nI(), I, g), new GA(
|
|
20192
20210
|
aA(A[0], A[1]),
|
|
20193
20211
|
aA(I[0], I[1])
|
|
20194
20212
|
);
|
|
@@ -20243,7 +20261,7 @@ class He {
|
|
|
20243
20261
|
I.preventDefault();
|
|
20244
20262
|
const g = bA(A.worldPos), B = I.deltaY < 0 ? 1.05 : 0.95;
|
|
20245
20263
|
this.camera_.zoom(B);
|
|
20246
|
-
const Q = this.camera_.clipToWorld(A.clipPos), E =
|
|
20264
|
+
const Q = this.camera_.clipToWorld(A.clipPos), E = AB(QA(), g, Q);
|
|
20247
20265
|
this.camera_.pan(E);
|
|
20248
20266
|
}
|
|
20249
20267
|
onPointerDown(A) {
|
|
@@ -20252,7 +20270,7 @@ class He {
|
|
|
20252
20270
|
}
|
|
20253
20271
|
onPointerMove(A) {
|
|
20254
20272
|
if (!this.dragActive_ || !A.worldPos) return;
|
|
20255
|
-
const I =
|
|
20273
|
+
const I = AB(QA(), this.dragStart_, A.worldPos);
|
|
20256
20274
|
this.camera_.pan(I);
|
|
20257
20275
|
}
|
|
20258
20276
|
onPointerEnd(A) {
|
|
@@ -20260,7 +20278,7 @@ class He {
|
|
|
20260
20278
|
!this.dragActive_ || I.button !== GQ || (this.dragActive_ = !1, I.target?.releasePointerCapture?.(I.pointerId));
|
|
20261
20279
|
}
|
|
20262
20280
|
}
|
|
20263
|
-
const Ne = 60, Re = 1.77,
|
|
20281
|
+
const Ne = 60, Re = 1.77, Cg = 0.1, zg = 180 - Cg;
|
|
20264
20282
|
class qe extends NE {
|
|
20265
20283
|
fov_;
|
|
20266
20284
|
aspectRatio_;
|
|
@@ -20272,9 +20290,9 @@ class qe extends NE {
|
|
|
20272
20290
|
far: Q = 1e4,
|
|
20273
20291
|
position: E = P(0, 0, 0)
|
|
20274
20292
|
} = A;
|
|
20275
|
-
if (I <
|
|
20293
|
+
if (I < Cg || I > zg)
|
|
20276
20294
|
throw new Error(
|
|
20277
|
-
`Invalid field of view: ${I}, must be in [${
|
|
20295
|
+
`Invalid field of view: ${I}, must be in [${Cg}, ${zg}] degrees`
|
|
20278
20296
|
);
|
|
20279
20297
|
super(), this.fov_ = I, this.aspectRatio_ = g, this.near_ = B, this.far_ = Q, this.transform.setTranslation(E), this.updateProjectionMatrix();
|
|
20280
20298
|
}
|
|
@@ -20290,7 +20308,7 @@ class qe extends NE {
|
|
|
20290
20308
|
zoom(A) {
|
|
20291
20309
|
if (A <= 0)
|
|
20292
20310
|
throw new Error(`Invalid zoom factor: ${A}`);
|
|
20293
|
-
this.fov_ = Math.max(
|
|
20311
|
+
this.fov_ = Math.max(Cg, Math.min(zg, this.fov_ / A)), this.updateProjectionMatrix();
|
|
20294
20312
|
}
|
|
20295
20313
|
updateProjectionMatrix() {
|
|
20296
20314
|
OE(
|
|
@@ -20404,8 +20422,8 @@ export {
|
|
|
20404
20422
|
rQ as LabelColorMap,
|
|
20405
20423
|
te as LabelImageRenderable,
|
|
20406
20424
|
FE as LabelLayer,
|
|
20407
|
-
|
|
20408
|
-
|
|
20425
|
+
Yg as Layer,
|
|
20426
|
+
MI as OmeZarrImageSource,
|
|
20409
20427
|
fe as OrbitControls,
|
|
20410
20428
|
Ke as OrthographicCamera,
|
|
20411
20429
|
He as PanZoomControls,
|