@idetik/core 0.15.4 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +9 -2
- package/dist/index.js +511 -759
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +28 -28
- package/dist/index.umd.cjs.map +1 -1
- package/dist/types/src/core/chunk_manager.d.ts +5 -0
- package/dist/types/src/core/chunk_manager.d.ts.map +1 -1
- package/dist/types/src/core/node.d.ts +1 -1
- package/dist/types/src/core/node.d.ts.map +1 -1
- package/dist/types/src/idetik.d.ts +2 -1
- package/dist/types/src/idetik.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/utilities/id_generator.d.ts +2 -0
- package/dist/types/src/utilities/id_generator.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/types/src/utilities/uuid_generator.d.ts +0 -2
- package/dist/types/src/utilities/uuid_generator.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -176,7 +176,7 @@ uniform vec3 LineColor;
|
|
|
176
176
|
|
|
177
177
|
void main() {
|
|
178
178
|
fragColor = vec4(LineColor, 1.0);
|
|
179
|
-
}`,
|
|
179
|
+
}`, FA = `#version 300 es
|
|
180
180
|
|
|
181
181
|
layout (location = 0) in vec3 inPosition;
|
|
182
182
|
layout (location = 1) in vec3 inNormal;
|
|
@@ -572,35 +572,35 @@ const wC = {
|
|
|
572
572
|
fragment: GC
|
|
573
573
|
},
|
|
574
574
|
floatScalarImage: {
|
|
575
|
-
vertex:
|
|
575
|
+
vertex: FA,
|
|
576
576
|
fragment: ZI
|
|
577
577
|
},
|
|
578
578
|
floatScalarImageArray: {
|
|
579
|
-
vertex:
|
|
579
|
+
vertex: FA,
|
|
580
580
|
fragment: PI
|
|
581
581
|
},
|
|
582
582
|
intScalarImage: {
|
|
583
|
-
vertex:
|
|
583
|
+
vertex: FA,
|
|
584
584
|
fragment: ZI,
|
|
585
585
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
|
|
586
586
|
},
|
|
587
587
|
intScalarImageArray: {
|
|
588
|
-
vertex:
|
|
588
|
+
vertex: FA,
|
|
589
589
|
fragment: PI,
|
|
590
590
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
|
|
591
591
|
},
|
|
592
592
|
uintScalarImage: {
|
|
593
|
-
vertex:
|
|
593
|
+
vertex: FA,
|
|
594
594
|
fragment: ZI,
|
|
595
595
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
|
|
596
596
|
},
|
|
597
597
|
uintScalarImageArray: {
|
|
598
|
-
vertex:
|
|
598
|
+
vertex: FA,
|
|
599
599
|
fragment: PI,
|
|
600
600
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
|
|
601
601
|
},
|
|
602
602
|
labelImage: {
|
|
603
|
-
vertex:
|
|
603
|
+
vertex: FA,
|
|
604
604
|
fragment: nC
|
|
605
605
|
},
|
|
606
606
|
floatVolume: {
|
|
@@ -871,270 +871,13 @@ function Pg(g, A) {
|
|
|
871
871
|
${C}`;
|
|
872
872
|
return g.replace(vI, Q);
|
|
873
873
|
}
|
|
874
|
-
const
|
|
875
|
-
|
|
876
|
-
"
|
|
877
|
-
|
|
878
|
-
"03",
|
|
879
|
-
"04",
|
|
880
|
-
"05",
|
|
881
|
-
"06",
|
|
882
|
-
"07",
|
|
883
|
-
"08",
|
|
884
|
-
"09",
|
|
885
|
-
"0a",
|
|
886
|
-
"0b",
|
|
887
|
-
"0c",
|
|
888
|
-
"0d",
|
|
889
|
-
"0e",
|
|
890
|
-
"0f",
|
|
891
|
-
"10",
|
|
892
|
-
"11",
|
|
893
|
-
"12",
|
|
894
|
-
"13",
|
|
895
|
-
"14",
|
|
896
|
-
"15",
|
|
897
|
-
"16",
|
|
898
|
-
"17",
|
|
899
|
-
"18",
|
|
900
|
-
"19",
|
|
901
|
-
"1a",
|
|
902
|
-
"1b",
|
|
903
|
-
"1c",
|
|
904
|
-
"1d",
|
|
905
|
-
"1e",
|
|
906
|
-
"1f",
|
|
907
|
-
"20",
|
|
908
|
-
"21",
|
|
909
|
-
"22",
|
|
910
|
-
"23",
|
|
911
|
-
"24",
|
|
912
|
-
"25",
|
|
913
|
-
"26",
|
|
914
|
-
"27",
|
|
915
|
-
"28",
|
|
916
|
-
"29",
|
|
917
|
-
"2a",
|
|
918
|
-
"2b",
|
|
919
|
-
"2c",
|
|
920
|
-
"2d",
|
|
921
|
-
"2e",
|
|
922
|
-
"2f",
|
|
923
|
-
"30",
|
|
924
|
-
"31",
|
|
925
|
-
"32",
|
|
926
|
-
"33",
|
|
927
|
-
"34",
|
|
928
|
-
"35",
|
|
929
|
-
"36",
|
|
930
|
-
"37",
|
|
931
|
-
"38",
|
|
932
|
-
"39",
|
|
933
|
-
"3a",
|
|
934
|
-
"3b",
|
|
935
|
-
"3c",
|
|
936
|
-
"3d",
|
|
937
|
-
"3e",
|
|
938
|
-
"3f",
|
|
939
|
-
"40",
|
|
940
|
-
"41",
|
|
941
|
-
"42",
|
|
942
|
-
"43",
|
|
943
|
-
"44",
|
|
944
|
-
"45",
|
|
945
|
-
"46",
|
|
946
|
-
"47",
|
|
947
|
-
"48",
|
|
948
|
-
"49",
|
|
949
|
-
"4a",
|
|
950
|
-
"4b",
|
|
951
|
-
"4c",
|
|
952
|
-
"4d",
|
|
953
|
-
"4e",
|
|
954
|
-
"4f",
|
|
955
|
-
"50",
|
|
956
|
-
"51",
|
|
957
|
-
"52",
|
|
958
|
-
"53",
|
|
959
|
-
"54",
|
|
960
|
-
"55",
|
|
961
|
-
"56",
|
|
962
|
-
"57",
|
|
963
|
-
"58",
|
|
964
|
-
"59",
|
|
965
|
-
"5a",
|
|
966
|
-
"5b",
|
|
967
|
-
"5c",
|
|
968
|
-
"5d",
|
|
969
|
-
"5e",
|
|
970
|
-
"5f",
|
|
971
|
-
"60",
|
|
972
|
-
"61",
|
|
973
|
-
"62",
|
|
974
|
-
"63",
|
|
975
|
-
"64",
|
|
976
|
-
"65",
|
|
977
|
-
"66",
|
|
978
|
-
"67",
|
|
979
|
-
"68",
|
|
980
|
-
"69",
|
|
981
|
-
"6a",
|
|
982
|
-
"6b",
|
|
983
|
-
"6c",
|
|
984
|
-
"6d",
|
|
985
|
-
"6e",
|
|
986
|
-
"6f",
|
|
987
|
-
"70",
|
|
988
|
-
"71",
|
|
989
|
-
"72",
|
|
990
|
-
"73",
|
|
991
|
-
"74",
|
|
992
|
-
"75",
|
|
993
|
-
"76",
|
|
994
|
-
"77",
|
|
995
|
-
"78",
|
|
996
|
-
"79",
|
|
997
|
-
"7a",
|
|
998
|
-
"7b",
|
|
999
|
-
"7c",
|
|
1000
|
-
"7d",
|
|
1001
|
-
"7e",
|
|
1002
|
-
"7f",
|
|
1003
|
-
"80",
|
|
1004
|
-
"81",
|
|
1005
|
-
"82",
|
|
1006
|
-
"83",
|
|
1007
|
-
"84",
|
|
1008
|
-
"85",
|
|
1009
|
-
"86",
|
|
1010
|
-
"87",
|
|
1011
|
-
"88",
|
|
1012
|
-
"89",
|
|
1013
|
-
"8a",
|
|
1014
|
-
"8b",
|
|
1015
|
-
"8c",
|
|
1016
|
-
"8d",
|
|
1017
|
-
"8e",
|
|
1018
|
-
"8f",
|
|
1019
|
-
"90",
|
|
1020
|
-
"91",
|
|
1021
|
-
"92",
|
|
1022
|
-
"93",
|
|
1023
|
-
"94",
|
|
1024
|
-
"95",
|
|
1025
|
-
"96",
|
|
1026
|
-
"97",
|
|
1027
|
-
"98",
|
|
1028
|
-
"99",
|
|
1029
|
-
"9a",
|
|
1030
|
-
"9b",
|
|
1031
|
-
"9c",
|
|
1032
|
-
"9d",
|
|
1033
|
-
"9e",
|
|
1034
|
-
"9f",
|
|
1035
|
-
"a0",
|
|
1036
|
-
"a1",
|
|
1037
|
-
"a2",
|
|
1038
|
-
"a3",
|
|
1039
|
-
"a4",
|
|
1040
|
-
"a5",
|
|
1041
|
-
"a6",
|
|
1042
|
-
"a7",
|
|
1043
|
-
"a8",
|
|
1044
|
-
"a9",
|
|
1045
|
-
"aa",
|
|
1046
|
-
"ab",
|
|
1047
|
-
"ac",
|
|
1048
|
-
"ad",
|
|
1049
|
-
"ae",
|
|
1050
|
-
"af",
|
|
1051
|
-
"b0",
|
|
1052
|
-
"b1",
|
|
1053
|
-
"b2",
|
|
1054
|
-
"b3",
|
|
1055
|
-
"b4",
|
|
1056
|
-
"b5",
|
|
1057
|
-
"b6",
|
|
1058
|
-
"b7",
|
|
1059
|
-
"b8",
|
|
1060
|
-
"b9",
|
|
1061
|
-
"ba",
|
|
1062
|
-
"bb",
|
|
1063
|
-
"bc",
|
|
1064
|
-
"bd",
|
|
1065
|
-
"be",
|
|
1066
|
-
"bf",
|
|
1067
|
-
"c0",
|
|
1068
|
-
"c1",
|
|
1069
|
-
"c2",
|
|
1070
|
-
"c3",
|
|
1071
|
-
"c4",
|
|
1072
|
-
"c5",
|
|
1073
|
-
"c6",
|
|
1074
|
-
"c7",
|
|
1075
|
-
"c8",
|
|
1076
|
-
"c9",
|
|
1077
|
-
"ca",
|
|
1078
|
-
"cb",
|
|
1079
|
-
"cc",
|
|
1080
|
-
"cd",
|
|
1081
|
-
"ce",
|
|
1082
|
-
"cf",
|
|
1083
|
-
"d0",
|
|
1084
|
-
"d1",
|
|
1085
|
-
"d2",
|
|
1086
|
-
"d3",
|
|
1087
|
-
"d4",
|
|
1088
|
-
"d5",
|
|
1089
|
-
"d6",
|
|
1090
|
-
"d7",
|
|
1091
|
-
"d8",
|
|
1092
|
-
"d9",
|
|
1093
|
-
"da",
|
|
1094
|
-
"db",
|
|
1095
|
-
"dc",
|
|
1096
|
-
"dd",
|
|
1097
|
-
"de",
|
|
1098
|
-
"df",
|
|
1099
|
-
"e0",
|
|
1100
|
-
"e1",
|
|
1101
|
-
"e2",
|
|
1102
|
-
"e3",
|
|
1103
|
-
"e4",
|
|
1104
|
-
"e5",
|
|
1105
|
-
"e6",
|
|
1106
|
-
"e7",
|
|
1107
|
-
"e8",
|
|
1108
|
-
"e9",
|
|
1109
|
-
"ea",
|
|
1110
|
-
"eb",
|
|
1111
|
-
"ec",
|
|
1112
|
-
"ed",
|
|
1113
|
-
"ee",
|
|
1114
|
-
"ef",
|
|
1115
|
-
"f0",
|
|
1116
|
-
"f1",
|
|
1117
|
-
"f2",
|
|
1118
|
-
"f3",
|
|
1119
|
-
"f4",
|
|
1120
|
-
"f5",
|
|
1121
|
-
"f6",
|
|
1122
|
-
"f7",
|
|
1123
|
-
"f8",
|
|
1124
|
-
"f9",
|
|
1125
|
-
"fa",
|
|
1126
|
-
"fb",
|
|
1127
|
-
"fc",
|
|
1128
|
-
"fd",
|
|
1129
|
-
"fe",
|
|
1130
|
-
"ff"
|
|
1131
|
-
];
|
|
1132
|
-
function JB() {
|
|
1133
|
-
const g = Math.random() * 4294967295 | 0, A = Math.random() * 4294967295 | 0, I = Math.random() * 4294967295 | 0, B = Math.random() * 4294967295 | 0;
|
|
1134
|
-
return (v[g & 255] + v[g >> 8 & 255] + v[g >> 16 & 255] + v[g >> 24 & 255] + "-" + v[A & 255] + v[A >> 8 & 255] + "-" + v[A >> 16 & 15 | 64] + v[A >> 24 & 255] + "-" + v[I & 63 | 128] + v[I >> 8 & 255] + "-" + v[I >> 16 & 255] + v[I >> 24 & 255] + v[B & 255] + v[B >> 8 & 255] + v[B >> 16 & 255] + v[B >> 24 & 255]).toLowerCase();
|
|
874
|
+
const FI = {};
|
|
875
|
+
function JB(g) {
|
|
876
|
+
const A = g ?? "";
|
|
877
|
+
return FI[A] = (FI[A] ?? 0) + 1, g ? `${g}-${FI[A]}` : String(FI[A]);
|
|
1135
878
|
}
|
|
1136
879
|
class yg {
|
|
1137
|
-
|
|
880
|
+
id = JB();
|
|
1138
881
|
}
|
|
1139
882
|
var p = 1e-6, P = typeof Float32Array < "u" ? Float32Array : Array, UC = Math.PI / 180;
|
|
1140
883
|
function kC(g) {
|
|
@@ -1152,15 +895,15 @@ function YB() {
|
|
|
1152
895
|
function LC(g, A) {
|
|
1153
896
|
return g[0] = A[0], g[1] = A[1], g[2] = A[2], g[3] = A[4], g[4] = A[5], g[5] = A[6], g[6] = A[8], g[7] = A[9], g[8] = A[10], g;
|
|
1154
897
|
}
|
|
1155
|
-
function
|
|
898
|
+
function z() {
|
|
1156
899
|
var g = new P(16);
|
|
1157
900
|
return P != Float32Array && (g[1] = 0, g[2] = 0, g[3] = 0, g[4] = 0, g[6] = 0, g[7] = 0, g[8] = 0, g[9] = 0, g[11] = 0, g[12] = 0, g[13] = 0, g[14] = 0), g[0] = 1, g[5] = 1, g[10] = 1, g[15] = 1, g;
|
|
1158
901
|
}
|
|
1159
902
|
function mI(g, A) {
|
|
1160
|
-
var I = A[0], B = A[1], C = A[2], Q = A[3], E = A[4], i = A[5], o = A[6], a = A[7], s = A[8], h = A[9], t = A[10], y = A[11], n = A[12], w = A[13], r = A[14], G = A[15], c = I * i - B * E, R = I * o - C * E, Y = I * a - Q * E, k = B * o - C * i, L = B * a - Q * i, m = C * a - Q * o, x = s * w - h * n, b = s * r - t * n, O = s * G - y * n, V = h * r - t * w,
|
|
1161
|
-
return T ? (T = 1 / T, g[0] = (i *
|
|
903
|
+
var I = A[0], B = A[1], C = A[2], Q = A[3], E = A[4], i = A[5], o = A[6], a = A[7], s = A[8], h = A[9], t = A[10], y = A[11], n = A[12], w = A[13], r = A[14], G = A[15], c = I * i - B * E, R = I * o - C * E, Y = I * a - Q * E, k = B * o - C * i, L = B * a - Q * i, m = C * a - Q * o, x = s * w - h * n, b = s * r - t * n, O = s * G - y * n, V = h * r - t * w, EA = h * G - y * w, iA = t * G - y * r, T = c * iA - R * EA + Y * V + k * O - L * b + m * x;
|
|
904
|
+
return T ? (T = 1 / T, g[0] = (i * iA - o * EA + a * V) * T, g[1] = (C * EA - B * iA - Q * V) * T, g[2] = (w * m - r * L + G * k) * T, g[3] = (t * L - h * m - y * k) * T, g[4] = (o * O - E * iA - a * b) * T, g[5] = (I * iA - C * O + Q * b) * T, g[6] = (r * Y - n * m - G * R) * T, g[7] = (s * m - t * Y + y * R) * T, g[8] = (E * EA - i * O + a * x) * T, g[9] = (B * O - I * EA - Q * x) * T, g[10] = (n * L - w * Y + G * c) * T, g[11] = (h * Y - s * L - y * c) * T, g[12] = (i * b - E * V - o * x) * T, g[13] = (I * V - B * b + C * x) * T, g[14] = (w * R - n * k - r * c) * T, g[15] = (s * k - h * R + t * c) * T, g) : null;
|
|
1162
905
|
}
|
|
1163
|
-
function
|
|
906
|
+
function jA(g, A, I) {
|
|
1164
907
|
var B = A[0], C = A[1], Q = A[2], E = A[3], i = A[4], o = A[5], a = A[6], s = A[7], h = A[8], t = A[9], y = A[10], n = A[11], w = A[12], r = A[13], G = A[14], c = A[15], R = I[0], Y = I[1], k = I[2], L = I[3];
|
|
1165
908
|
return g[0] = R * B + Y * i + k * h + L * w, g[1] = R * C + Y * o + k * t + L * r, g[2] = R * Q + Y * a + k * y + L * G, g[3] = R * E + Y * s + k * n + L * c, R = I[4], Y = I[5], k = I[6], L = I[7], g[4] = R * B + Y * i + k * h + L * w, g[5] = R * C + Y * o + k * t + L * r, g[6] = R * Q + Y * a + k * y + L * G, g[7] = R * E + Y * s + k * n + L * c, R = I[8], Y = I[9], k = I[10], L = I[11], g[8] = R * B + Y * i + k * h + L * w, g[9] = R * C + Y * o + k * t + L * r, g[10] = R * Q + Y * a + k * y + L * G, g[11] = R * E + Y * s + k * n + L * c, R = I[12], Y = I[13], k = I[14], L = I[15], g[12] = R * B + Y * i + k * h + L * w, g[13] = R * C + Y * o + k * t + L * r, g[14] = R * Q + Y * a + k * y + L * G, g[15] = R * E + Y * s + k * n + L * c, g;
|
|
1166
909
|
}
|
|
@@ -1188,14 +931,14 @@ function qC(g, A, I, B) {
|
|
|
1188
931
|
return y = n * n + w * w + r * r, y > 0 && (y = 1 / Math.sqrt(y), n *= y, w *= y, r *= y), g[0] = n, g[1] = w, g[2] = r, g[3] = 0, g[4] = h * r - t * w, g[5] = t * n - s * r, g[6] = s * w - h * n, g[7] = 0, g[8] = s, g[9] = h, g[10] = t, g[11] = 0, g[12] = C, g[13] = Q, g[14] = E, g[15] = 1, g;
|
|
1189
932
|
}
|
|
1190
933
|
function lC(g, A) {
|
|
1191
|
-
var I = g[0], B = g[1], C = g[2], Q = g[3], E = g[4], i = g[5], o = g[6], a = g[7], s = g[8], h = g[9], t = g[10], y = g[11], n = g[12], w = g[13], r = g[14], G = g[15], c = A[0], R = A[1], Y = A[2], k = A[3], L = A[4], m = A[5], x = A[6], b = A[7], O = A[8], V = A[9],
|
|
1192
|
-
return Math.abs(I - c) <= p * Math.max(1, Math.abs(I), Math.abs(c)) && Math.abs(B - R) <= p * Math.max(1, Math.abs(B), Math.abs(R)) && Math.abs(C - Y) <= p * Math.max(1, Math.abs(C), Math.abs(Y)) && Math.abs(Q - k) <= p * Math.max(1, Math.abs(Q), Math.abs(k)) && Math.abs(E - L) <= p * Math.max(1, Math.abs(E), Math.abs(L)) && Math.abs(i - m) <= p * Math.max(1, Math.abs(i), Math.abs(m)) && Math.abs(o - x) <= p * Math.max(1, Math.abs(o), Math.abs(x)) && Math.abs(a - b) <= p * Math.max(1, Math.abs(a), Math.abs(b)) && Math.abs(s - O) <= p * Math.max(1, Math.abs(s), Math.abs(O)) && Math.abs(h - V) <= p * Math.max(1, Math.abs(h), Math.abs(V)) && Math.abs(t -
|
|
934
|
+
var I = g[0], B = g[1], C = g[2], Q = g[3], E = g[4], i = g[5], o = g[6], a = g[7], s = g[8], h = g[9], t = g[10], y = g[11], n = g[12], w = g[13], r = g[14], G = g[15], c = A[0], R = A[1], Y = A[2], k = A[3], L = A[4], m = A[5], x = A[6], b = A[7], O = A[8], V = A[9], EA = A[10], iA = A[11], T = A[12], xg = A[13], Wg = A[14], bg = A[15];
|
|
935
|
+
return Math.abs(I - c) <= p * Math.max(1, Math.abs(I), Math.abs(c)) && Math.abs(B - R) <= p * Math.max(1, Math.abs(B), Math.abs(R)) && Math.abs(C - Y) <= p * Math.max(1, Math.abs(C), Math.abs(Y)) && Math.abs(Q - k) <= p * Math.max(1, Math.abs(Q), Math.abs(k)) && Math.abs(E - L) <= p * Math.max(1, Math.abs(E), Math.abs(L)) && Math.abs(i - m) <= p * Math.max(1, Math.abs(i), Math.abs(m)) && Math.abs(o - x) <= p * Math.max(1, Math.abs(o), Math.abs(x)) && Math.abs(a - b) <= p * Math.max(1, Math.abs(a), Math.abs(b)) && Math.abs(s - O) <= p * Math.max(1, Math.abs(s), Math.abs(O)) && Math.abs(h - V) <= p * Math.max(1, Math.abs(h), Math.abs(V)) && Math.abs(t - EA) <= p * Math.max(1, Math.abs(t), Math.abs(EA)) && Math.abs(y - iA) <= p * Math.max(1, Math.abs(y), Math.abs(iA)) && Math.abs(n - T) <= p * Math.max(1, Math.abs(n), Math.abs(T)) && Math.abs(w - xg) <= p * Math.max(1, Math.abs(w), Math.abs(xg)) && Math.abs(r - Wg) <= p * Math.max(1, Math.abs(r), Math.abs(Wg)) && Math.abs(G - bg) <= p * Math.max(1, Math.abs(G), Math.abs(bg));
|
|
1193
936
|
}
|
|
1194
937
|
function f() {
|
|
1195
938
|
var g = new P(3);
|
|
1196
939
|
return P != Float32Array && (g[0] = 0, g[1] = 0, g[2] = 0), g;
|
|
1197
940
|
}
|
|
1198
|
-
function
|
|
941
|
+
function gA(g) {
|
|
1199
942
|
var A = new P(3);
|
|
1200
943
|
return A[0] = g[0], A[1] = g[1], A[2] = g[2], A;
|
|
1201
944
|
}
|
|
@@ -1207,13 +950,13 @@ function q(g, A, I) {
|
|
|
1207
950
|
var B = new P(3);
|
|
1208
951
|
return B[0] = g, B[1] = A, B[2] = I, B;
|
|
1209
952
|
}
|
|
1210
|
-
function
|
|
953
|
+
function KA(g, A) {
|
|
1211
954
|
return g[0] = A[0], g[1] = A[1], g[2] = A[2], g;
|
|
1212
955
|
}
|
|
1213
|
-
function
|
|
956
|
+
function rA(g, A, I, B) {
|
|
1214
957
|
return g[0] = A, g[1] = I, g[2] = B, g;
|
|
1215
958
|
}
|
|
1216
|
-
function
|
|
959
|
+
function qA(g, A, I) {
|
|
1217
960
|
return g[0] = A[0] + I[0], g[1] = A[1] + I[1], g[2] = A[2] + I[2], g;
|
|
1218
961
|
}
|
|
1219
962
|
function fC(g, A, I) {
|
|
@@ -1222,7 +965,7 @@ function fC(g, A, I) {
|
|
|
1222
965
|
function pC(g, A, I) {
|
|
1223
966
|
return g[0] = A[0] * I[0], g[1] = A[1] * I[1], g[2] = A[2] * I[2], g;
|
|
1224
967
|
}
|
|
1225
|
-
function
|
|
968
|
+
function lA(g, A, I) {
|
|
1226
969
|
return g[0] = A[0] * I, g[1] = A[1] * I, g[2] = A[2] * I, g;
|
|
1227
970
|
}
|
|
1228
971
|
function cI(g, A, I, B) {
|
|
@@ -1272,7 +1015,7 @@ var UI = fC, xC = eg;
|
|
|
1272
1015
|
return A;
|
|
1273
1016
|
};
|
|
1274
1017
|
})();
|
|
1275
|
-
function
|
|
1018
|
+
function fA() {
|
|
1276
1019
|
var g = new P(4);
|
|
1277
1020
|
return P != Float32Array && (g[0] = 0, g[1] = 0, g[2] = 0, g[3] = 0), g;
|
|
1278
1021
|
}
|
|
@@ -1294,12 +1037,12 @@ function PC(g, A) {
|
|
|
1294
1037
|
var I = A[0], B = A[1], C = A[2], Q = A[3], E = I * I + B * B + C * C + Q * Q;
|
|
1295
1038
|
return E > 0 && (E = 1 / Math.sqrt(E)), g[0] = I * E, g[1] = B * E, g[2] = C * E, g[3] = Q * E, g;
|
|
1296
1039
|
}
|
|
1297
|
-
function
|
|
1040
|
+
function zA(g, A, I) {
|
|
1298
1041
|
var B = A[0], C = A[1], Q = A[2], E = A[3];
|
|
1299
1042
|
return g[0] = I[0] * B + I[4] * C + I[8] * Q + I[12] * E, g[1] = I[1] * B + I[5] * C + I[9] * Q + I[13] * E, g[2] = I[2] * B + I[6] * C + I[10] * Q + I[14] * E, g[3] = I[3] * B + I[7] * C + I[11] * Q + I[15] * E, g;
|
|
1300
1043
|
}
|
|
1301
1044
|
(function() {
|
|
1302
|
-
var g =
|
|
1045
|
+
var g = fA();
|
|
1303
1046
|
return function(A, I, B, C, Q, E) {
|
|
1304
1047
|
var i, o;
|
|
1305
1048
|
for (I || (I = 4), B || (B = 0), C ? o = Math.min(C * I + B, A.length) : o = A.length, i = B; i < o; i += I)
|
|
@@ -1396,7 +1139,7 @@ function zI(g, A) {
|
|
|
1396
1139
|
return A;
|
|
1397
1140
|
};
|
|
1398
1141
|
})();
|
|
1399
|
-
class
|
|
1142
|
+
class SA {
|
|
1400
1143
|
min;
|
|
1401
1144
|
max;
|
|
1402
1145
|
/**
|
|
@@ -1406,10 +1149,10 @@ class RA {
|
|
|
1406
1149
|
* the first element, and avoids biasing toward (0,0,0).
|
|
1407
1150
|
*/
|
|
1408
1151
|
constructor(A, I) {
|
|
1409
|
-
this.min = A ?
|
|
1152
|
+
this.min = A ? gA(A) : q(1 / 0, 1 / 0, 1 / 0), this.max = I ? gA(I) : q(-1 / 0, -1 / 0, -1 / 0);
|
|
1410
1153
|
}
|
|
1411
1154
|
clone() {
|
|
1412
|
-
return new
|
|
1155
|
+
return new SA(this.min, this.max);
|
|
1413
1156
|
}
|
|
1414
1157
|
isEmpty() {
|
|
1415
1158
|
return this.max[0] <= this.min[0] || this.max[1] <= this.min[1] || this.max[2] <= this.min[2];
|
|
@@ -1450,7 +1193,7 @@ const $C = {
|
|
|
1450
1193
|
size: 8,
|
|
1451
1194
|
marker: 9
|
|
1452
1195
|
};
|
|
1453
|
-
class
|
|
1196
|
+
class WA extends yg {
|
|
1454
1197
|
boundingBox_ = null;
|
|
1455
1198
|
primitive_;
|
|
1456
1199
|
attributes_;
|
|
@@ -1488,7 +1231,7 @@ class bA extends yg {
|
|
|
1488
1231
|
const A = this.getAttribute("position");
|
|
1489
1232
|
if (!A || this.vertexCount === 0)
|
|
1490
1233
|
throw new Error("Failed to generate bounding box");
|
|
1491
|
-
const I = (A.offset ?? 0) / Float32Array.BYTES_PER_ELEMENT, B = new
|
|
1234
|
+
const I = (A.offset ?? 0) / Float32Array.BYTES_PER_ELEMENT, B = new SA(), C = f();
|
|
1492
1235
|
for (let Q = 0; Q < this.vertexData_.length; Q += this.stride)
|
|
1493
1236
|
C[0] = this.vertexData_[Q + I + 0], C[1] = this.vertexData_[Q + I + 1], C[2] = this.vertexData_[Q + I + 2], B.expandWithPoint(C);
|
|
1494
1237
|
this.boundingBox_ = B;
|
|
@@ -1801,7 +1544,7 @@ class IQ {
|
|
|
1801
1544
|
return A.type === "Texture3D";
|
|
1802
1545
|
}
|
|
1803
1546
|
}
|
|
1804
|
-
class
|
|
1547
|
+
class $ {
|
|
1805
1548
|
min;
|
|
1806
1549
|
max;
|
|
1807
1550
|
/**
|
|
@@ -1814,7 +1557,7 @@ class AA {
|
|
|
1814
1557
|
this.min = A ? vg(A) : Z(1 / 0, 1 / 0), this.max = I ? vg(I) : Z(-1 / 0, -1 / 0);
|
|
1815
1558
|
}
|
|
1816
1559
|
clone() {
|
|
1817
|
-
return new
|
|
1560
|
+
return new $(this.min, this.max);
|
|
1818
1561
|
}
|
|
1819
1562
|
isEmpty() {
|
|
1820
1563
|
return this.max[0] <= this.min[0] || this.max[1] <= this.min[1];
|
|
@@ -1827,7 +1570,7 @@ class AA {
|
|
|
1827
1570
|
return Xg(A.min, I.min) && Xg(A.max, I.max);
|
|
1828
1571
|
}
|
|
1829
1572
|
floor() {
|
|
1830
|
-
return new
|
|
1573
|
+
return new $(
|
|
1831
1574
|
Z(Math.floor(this.min[0]), Math.floor(this.min[1])),
|
|
1832
1575
|
Z(Math.floor(this.max[0]), Math.floor(this.max[1]))
|
|
1833
1576
|
);
|
|
@@ -1896,7 +1639,7 @@ class gQ {
|
|
|
1896
1639
|
}
|
|
1897
1640
|
setViewport(A) {
|
|
1898
1641
|
const I = A.floor();
|
|
1899
|
-
if (this.currentViewport_ &&
|
|
1642
|
+
if (this.currentViewport_ && $.equals(I, this.currentViewport_))
|
|
1900
1643
|
return;
|
|
1901
1644
|
const { x: B, y: C, width: Q, height: E } = I.toRect();
|
|
1902
1645
|
this.gl_.viewport(B, C, Q, E), this.currentViewport_ = I;
|
|
@@ -1906,7 +1649,7 @@ class gQ {
|
|
|
1906
1649
|
}
|
|
1907
1650
|
setScissor(A) {
|
|
1908
1651
|
const I = A.floor();
|
|
1909
|
-
if (this.currentScissor_ &&
|
|
1652
|
+
if (this.currentScissor_ && $.equals(I, this.currentScissor_))
|
|
1910
1653
|
return;
|
|
1911
1654
|
const { x: B, y: C, width: Q, height: E } = I.toRect();
|
|
1912
1655
|
this.gl_.scissor(B, C, Q, E), this.currentScissor_ = I;
|
|
@@ -1937,7 +1680,7 @@ class gQ {
|
|
|
1937
1680
|
A ? this.enable(this.gl_.STENCIL_TEST) : this.disable(this.gl_.STENCIL_TEST);
|
|
1938
1681
|
}
|
|
1939
1682
|
}
|
|
1940
|
-
const BQ = JC(
|
|
1683
|
+
const BQ = JC(z(), [1, -1, 1]);
|
|
1941
1684
|
class CQ extends sC {
|
|
1942
1685
|
gl_;
|
|
1943
1686
|
programs_;
|
|
@@ -1961,11 +1704,11 @@ class CQ extends sC {
|
|
|
1961
1704
|
}
|
|
1962
1705
|
render(A) {
|
|
1963
1706
|
let I = getComputedStyle(A.element).visibility !== "hidden";
|
|
1964
|
-
const B = A.getBoxRelativeTo(this.canvas), C = new
|
|
1707
|
+
const B = A.getBoxRelativeTo(this.canvas), C = new $(
|
|
1965
1708
|
Z(0, 0),
|
|
1966
1709
|
Z(this.width, this.height)
|
|
1967
1710
|
);
|
|
1968
|
-
|
|
1711
|
+
$.equals(B.floor(), C.floor()) ? this.state_.setScissorTest(!1) : $.intersects(B, C) ? (this.state_.setScissor(B), this.state_.setScissorTest(!0)) : (U.warn(
|
|
1969
1712
|
"WebGLRenderer",
|
|
1970
1713
|
`Viewport ${A.id} is entirely outside canvas bounds, skipping render`
|
|
1971
1714
|
), I = !1), this.state_.setViewport(B), this.renderedObjectsPerFrame_ = 0, I && this.clear();
|
|
@@ -2015,12 +1758,12 @@ class CQ extends sC {
|
|
|
2015
1758
|
}
|
|
2016
1759
|
}
|
|
2017
1760
|
drawGeometry(A, I, B, C, Q) {
|
|
2018
|
-
const E =
|
|
2019
|
-
|
|
1761
|
+
const E = jA(
|
|
1762
|
+
z(),
|
|
2020
1763
|
Q.viewMatrix,
|
|
2021
1764
|
I.transform.matrix
|
|
2022
|
-
), i =
|
|
2023
|
-
|
|
1765
|
+
), i = jA(
|
|
1766
|
+
z(),
|
|
2024
1767
|
BQ,
|
|
2025
1768
|
Q.projectionMatrix
|
|
2026
1769
|
), o = [this.canvas.width, this.canvas.height], a = I.getUniforms(), h = {
|
|
@@ -2042,8 +1785,8 @@ class CQ extends sC {
|
|
|
2042
1785
|
C.setUniform(n, B.opacity);
|
|
2043
1786
|
break;
|
|
2044
1787
|
case "CameraPositionModel": {
|
|
2045
|
-
const w = mI(
|
|
2046
|
-
|
|
1788
|
+
const w = mI(z(), E), r = kI(0, 0, 0, 1), G = zA(
|
|
1789
|
+
fA(),
|
|
2047
1790
|
r,
|
|
2048
1791
|
w
|
|
2049
1792
|
);
|
|
@@ -2078,7 +1821,7 @@ class CQ extends sC {
|
|
|
2078
1821
|
}
|
|
2079
1822
|
}
|
|
2080
1823
|
resize(A, I) {
|
|
2081
|
-
const B = new
|
|
1824
|
+
const B = new $(
|
|
2082
1825
|
Z(0, 0),
|
|
2083
1826
|
Z(A, I)
|
|
2084
1827
|
);
|
|
@@ -2165,7 +1908,7 @@ function iQ(g, A) {
|
|
|
2165
1908
|
function Qg(g, A, I = 1e-6) {
|
|
2166
1909
|
return Math.abs(g - A) <= I;
|
|
2167
1910
|
}
|
|
2168
|
-
function
|
|
1911
|
+
function NA(g, A, I) {
|
|
2169
1912
|
return Math.max(A, Math.min(I, g));
|
|
2170
1913
|
}
|
|
2171
1914
|
const ng = Symbol("INTERNAL_POLICY_KEY");
|
|
@@ -2239,7 +1982,7 @@ class oQ {
|
|
|
2239
1982
|
}
|
|
2240
1983
|
const w = HB();
|
|
2241
1984
|
_C(w, Q.min, Q.max, 0.5);
|
|
2242
|
-
const [r, G] = this.getZBounds(A), c = new
|
|
1985
|
+
const [r, G] = this.getZBounds(A), c = new SA(
|
|
2243
1986
|
q(Q.min[0], Q.min[1], r),
|
|
2244
1987
|
q(Q.max[0], Q.max[1], G)
|
|
2245
1988
|
);
|
|
@@ -2256,8 +1999,8 @@ class oQ {
|
|
|
2256
1999
|
), this.policyChanged_ = !1, this.lastViewBounds2D_ = Q.clone(), this.lastZBounds_ = h, this.lastTCoord_ = A.t;
|
|
2257
2000
|
}
|
|
2258
2001
|
updateChunksForVolume(A, I) {
|
|
2259
|
-
const B =
|
|
2260
|
-
|
|
2002
|
+
const B = jA(
|
|
2003
|
+
z(),
|
|
2261
2004
|
I.camera.projectionMatrix,
|
|
2262
2005
|
I.camera.viewMatrix
|
|
2263
2006
|
);
|
|
@@ -2325,7 +2068,7 @@ class oQ {
|
|
|
2325
2068
|
), a = Math.max(
|
|
2326
2069
|
o,
|
|
2327
2070
|
Math.min(i, this.policy_.lod.max)
|
|
2328
|
-
), s =
|
|
2071
|
+
), s = NA(E, o, a);
|
|
2329
2072
|
s !== this.currentLOD_ && (this.currentLOD_ = s);
|
|
2330
2073
|
}
|
|
2331
2074
|
isChunkChannelInSlice(A, I) {
|
|
@@ -2364,7 +2107,7 @@ class oQ {
|
|
|
2364
2107
|
for (let a = A + 1; a <= E; ++a)
|
|
2365
2108
|
for (const s of this.store_.getChunksAtTime(a)) {
|
|
2366
2109
|
if (s.lod !== i || !this.isChunkChannelInSlice(s, I) || !this.isChunkWithinBounds(s, B)) continue;
|
|
2367
|
-
const h = this.squareDistance2D(s, C), t =
|
|
2110
|
+
const h = this.squareDistance2D(s, C), t = NA(
|
|
2368
2111
|
h / this.sourceMaxSquareDistance2D_,
|
|
2369
2112
|
0,
|
|
2370
2113
|
1 - Number.EPSILON
|
|
@@ -2400,7 +2143,7 @@ class oQ {
|
|
|
2400
2143
|
return A && B ? E.fallbackVisible : I && B ? E.visibleCurrent : A ? E.fallbackBackground : I && C ? E.prefetchSpace : null;
|
|
2401
2144
|
}
|
|
2402
2145
|
isChunkWithinBounds(A, I) {
|
|
2403
|
-
const B = new
|
|
2146
|
+
const B = new SA(
|
|
2404
2147
|
q(A.offset.x, A.offset.y, A.offset.z),
|
|
2405
2148
|
q(
|
|
2406
2149
|
A.offset.x + A.shape.x * A.scale.x,
|
|
@@ -2408,7 +2151,7 @@ class oQ {
|
|
|
2408
2151
|
A.offset.z + A.shape.z * A.scale.z
|
|
2409
2152
|
)
|
|
2410
2153
|
);
|
|
2411
|
-
return
|
|
2154
|
+
return SA.intersects(B, I);
|
|
2412
2155
|
}
|
|
2413
2156
|
fallbackLOD() {
|
|
2414
2157
|
return Math.min(this.policy_.lod.max, this.store_.getLowestResLOD());
|
|
@@ -2444,7 +2187,7 @@ class oQ {
|
|
|
2444
2187
|
getPaddedBounds(A) {
|
|
2445
2188
|
const I = this.store_.dimensions, B = I.x.lods[this.currentLOD_], C = I.y.lods[this.currentLOD_], Q = I.z?.lods[this.currentLOD_], E = B.chunkSize * B.scale * this.policy_.prefetch.x, i = C.chunkSize * C.scale * this.policy_.prefetch.y;
|
|
2446
2189
|
let o = 0;
|
|
2447
|
-
return Q && (o = Q.chunkSize * Q.scale * this.policy_.prefetch.z), new
|
|
2190
|
+
return Q && (o = Q.chunkSize * Q.scale * this.policy_.prefetch.z), new SA(
|
|
2448
2191
|
q(
|
|
2449
2192
|
A.min[0] - E,
|
|
2450
2193
|
A.min[1] - i,
|
|
@@ -2638,6 +2381,12 @@ class sQ {
|
|
|
2638
2381
|
stores_ = /* @__PURE__ */ new Map();
|
|
2639
2382
|
pendingStores_ = /* @__PURE__ */ new Map();
|
|
2640
2383
|
queue_ = new EQ();
|
|
2384
|
+
get queueStats() {
|
|
2385
|
+
return {
|
|
2386
|
+
pending: this.queue_.pendingCount,
|
|
2387
|
+
running: this.queue_.runningCount
|
|
2388
|
+
};
|
|
2389
|
+
}
|
|
2641
2390
|
async addView(A, I) {
|
|
2642
2391
|
return (await this.getOrCreateStore(A)).createView(I);
|
|
2643
2392
|
}
|
|
@@ -2670,7 +2419,7 @@ class sQ {
|
|
|
2670
2419
|
I.canDispose() && this.stores_.delete(A);
|
|
2671
2420
|
}
|
|
2672
2421
|
}
|
|
2673
|
-
var
|
|
2422
|
+
var vA = function(g = 1) {
|
|
2674
2423
|
var A = 0, I = document.createElement("div");
|
|
2675
2424
|
I.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", I.addEventListener("click", function(h) {
|
|
2676
2425
|
h.preventDefault(), C(++A % I.children.length);
|
|
@@ -2683,9 +2432,9 @@ var XA = function(g = 1) {
|
|
|
2683
2432
|
I.children[t].style.display = t === h ? "block" : "none";
|
|
2684
2433
|
A = h;
|
|
2685
2434
|
}
|
|
2686
|
-
var Q = (performance || Date).now(), E = Q, i = 0, o = B(new
|
|
2435
|
+
var Q = (performance || Date).now(), E = Q, i = 0, o = B(new vA.Panel("FPS", "#0ff", "#002", g)), a = B(new vA.Panel("MS", "#0f0", "#020", g));
|
|
2687
2436
|
if (self.performance && self.performance.memory)
|
|
2688
|
-
var s = B(new
|
|
2437
|
+
var s = B(new vA.Panel("MB", "#f08", "#201", g));
|
|
2689
2438
|
return C(0), {
|
|
2690
2439
|
REVISION: 16,
|
|
2691
2440
|
dom: I,
|
|
@@ -2711,7 +2460,7 @@ var XA = function(g = 1) {
|
|
|
2711
2460
|
setMode: C
|
|
2712
2461
|
};
|
|
2713
2462
|
};
|
|
2714
|
-
|
|
2463
|
+
vA.Panel = function(g, A, I, B) {
|
|
2715
2464
|
var C = 1 / 0, Q = 0, E = Math.round, i = E(window.devicePixelRatio || 1), o = E(80 * i * B), a = E(48 * i * B), s = E(3 * i * B), h = E(2 * i * B), t = E(3 * i * B), y = E(15 * i * B), n = E(74 * i * B), w = E(30 * i * B), r = document.createElement("canvas");
|
|
2716
2465
|
r.width = o, r.height = a, r.style.cssText = `width:${E(B * 80)}px;height:${E(B * 48)}px`;
|
|
2717
2466
|
var G = r.getContext("2d");
|
|
@@ -2723,7 +2472,7 @@ XA.Panel = function(g, A, I, B) {
|
|
|
2723
2472
|
};
|
|
2724
2473
|
};
|
|
2725
2474
|
function DQ({ scale: g } = { scale: 1.5 }) {
|
|
2726
|
-
const A = new
|
|
2475
|
+
const A = new vA(g);
|
|
2727
2476
|
return A.showPanel(
|
|
2728
2477
|
0
|
|
2729
2478
|
/* 0 = fps, 1 = ms, 2 = mb */
|
|
@@ -2878,7 +2627,7 @@ class GQ {
|
|
|
2878
2627
|
}
|
|
2879
2628
|
getBoxRelativeTo(A) {
|
|
2880
2629
|
const I = this.getBox().toRect(), B = A.getBoundingClientRect(), C = window.devicePixelRatio || 1, Q = B.left * C, E = B.top * C, i = B.height * C, o = I.x - Q, a = I.y - E, s = Math.floor(o), h = Math.floor(i - a - I.height), t = Math.floor(I.width), y = Math.floor(I.height);
|
|
2881
|
-
return new
|
|
2630
|
+
return new $(
|
|
2882
2631
|
Z(s, h),
|
|
2883
2632
|
Z(s + t, h + y)
|
|
2884
2633
|
);
|
|
@@ -2897,7 +2646,7 @@ class GQ {
|
|
|
2897
2646
|
}
|
|
2898
2647
|
getBox() {
|
|
2899
2648
|
const A = this.element.getBoundingClientRect(), I = window.devicePixelRatio || 1, B = A.left * I, C = A.top * I, Q = A.width * I, E = A.height * I;
|
|
2900
|
-
return new
|
|
2649
|
+
return new $(
|
|
2901
2650
|
Z(B, C),
|
|
2902
2651
|
Z(B + Q, C + E)
|
|
2903
2652
|
);
|
|
@@ -2939,7 +2688,7 @@ function _g(g, A, I) {
|
|
|
2939
2688
|
return {
|
|
2940
2689
|
...C,
|
|
2941
2690
|
element: Q,
|
|
2942
|
-
id: C.id ?? Q.id ?? JB(),
|
|
2691
|
+
id: C.id ?? Q.id ?? JB("viewport"),
|
|
2943
2692
|
layerManager: new hQ(I)
|
|
2944
2693
|
};
|
|
2945
2694
|
});
|
|
@@ -3080,6 +2829,9 @@ class Ho {
|
|
|
3080
2829
|
B.updateSize(), this.renderer_.render(B);
|
|
3081
2830
|
});
|
|
3082
2831
|
}
|
|
2832
|
+
get chunkQueueStats() {
|
|
2833
|
+
return this.chunkManager_.queueStats;
|
|
2834
|
+
}
|
|
3083
2835
|
get renderedObjects() {
|
|
3084
2836
|
return this.renderer_.renderedObjects;
|
|
3085
2837
|
}
|
|
@@ -3152,7 +2904,7 @@ class Ho {
|
|
|
3152
2904
|
}
|
|
3153
2905
|
}
|
|
3154
2906
|
}
|
|
3155
|
-
class FQ extends
|
|
2907
|
+
class FQ extends WA {
|
|
3156
2908
|
constructor(A) {
|
|
3157
2909
|
if (super(), A.primitive != "triangles") {
|
|
3158
2910
|
U.warn("WireframeGeometry", "Only indexed geometries are supported");
|
|
@@ -3180,7 +2932,7 @@ class FQ extends bA {
|
|
|
3180
2932
|
const rQ = q(0, 1, 0);
|
|
3181
2933
|
class SQ {
|
|
3182
2934
|
dirty_ = !0;
|
|
3183
|
-
matrix_ =
|
|
2935
|
+
matrix_ = z();
|
|
3184
2936
|
rotation_ = Cg();
|
|
3185
2937
|
translation_ = f();
|
|
3186
2938
|
scale_ = q(1, 1, 1);
|
|
@@ -3194,33 +2946,33 @@ class SQ {
|
|
|
3194
2946
|
return vC(this.rotation_);
|
|
3195
2947
|
}
|
|
3196
2948
|
addTranslation(A) {
|
|
3197
|
-
|
|
2949
|
+
qA(this.translation_, this.translation_, A), this.dirty_ = !0;
|
|
3198
2950
|
}
|
|
3199
2951
|
setTranslation(A) {
|
|
3200
|
-
|
|
2952
|
+
KA(this.translation_, A), this.dirty_ = !0;
|
|
3201
2953
|
}
|
|
3202
2954
|
get translation() {
|
|
3203
|
-
return
|
|
2955
|
+
return gA(this.translation_);
|
|
3204
2956
|
}
|
|
3205
2957
|
addScale(A) {
|
|
3206
2958
|
pC(this.scale_, this.scale_, A), this.dirty_ = !0;
|
|
3207
2959
|
}
|
|
3208
2960
|
setScale(A) {
|
|
3209
|
-
|
|
2961
|
+
KA(this.scale_, A), this.dirty_ = !0;
|
|
3210
2962
|
}
|
|
3211
2963
|
targetTo(A) {
|
|
3212
|
-
MB(this.translation_, A) && (A =
|
|
3213
|
-
const I = qC(
|
|
2964
|
+
MB(this.translation_, A) && (A = gA(A), A[2] += p);
|
|
2965
|
+
const I = qC(z(), this.translation_, A, rQ), B = LC(YB(), I);
|
|
3214
2966
|
KB(this.rotation_, B), Gg(this.rotation_, this.rotation_), this.dirty_ = !0;
|
|
3215
2967
|
}
|
|
3216
2968
|
get scale() {
|
|
3217
|
-
return
|
|
2969
|
+
return gA(this.scale_);
|
|
3218
2970
|
}
|
|
3219
2971
|
get matrix() {
|
|
3220
2972
|
return this.dirty_ && (this.computeMatrix(), this.dirty_ = !1), this.matrix_;
|
|
3221
2973
|
}
|
|
3222
2974
|
get inverse() {
|
|
3223
|
-
return mI(
|
|
2975
|
+
return mI(z(), this.matrix);
|
|
3224
2976
|
}
|
|
3225
2977
|
computeMatrix() {
|
|
3226
2978
|
YC(
|
|
@@ -3231,14 +2983,14 @@ class SQ {
|
|
|
3231
2983
|
);
|
|
3232
2984
|
}
|
|
3233
2985
|
}
|
|
3234
|
-
class
|
|
2986
|
+
class bA extends yg {
|
|
3235
2987
|
wireframeEnabled = !1;
|
|
3236
2988
|
wireframeColor = l.WHITE;
|
|
3237
2989
|
depthTest = !0;
|
|
3238
2990
|
textures_ = [];
|
|
3239
2991
|
staleTextures_ = [];
|
|
3240
2992
|
transform_ = new SQ();
|
|
3241
|
-
geometry_ = new
|
|
2993
|
+
geometry_ = new WA();
|
|
3242
2994
|
wireframeGeometry_ = null;
|
|
3243
2995
|
programName_ = null;
|
|
3244
2996
|
cullFaceMode_ = "none";
|
|
@@ -3289,14 +3041,14 @@ class ZA extends yg {
|
|
|
3289
3041
|
return {};
|
|
3290
3042
|
}
|
|
3291
3043
|
}
|
|
3292
|
-
class
|
|
3044
|
+
class YA {
|
|
3293
3045
|
normal;
|
|
3294
3046
|
signedDistance;
|
|
3295
3047
|
constructor(A = q(0, 1, 0), I = 0) {
|
|
3296
|
-
this.normal =
|
|
3048
|
+
this.normal = gA(A), this.signedDistance = I;
|
|
3297
3049
|
}
|
|
3298
3050
|
set(A, I) {
|
|
3299
|
-
this.normal =
|
|
3051
|
+
this.normal = gA(A), this.signedDistance = I;
|
|
3300
3052
|
}
|
|
3301
3053
|
signedDistanceToPoint(A) {
|
|
3302
3054
|
return dB(this.normal, A) + this.signedDistance;
|
|
@@ -3305,7 +3057,7 @@ class dA {
|
|
|
3305
3057
|
const A = eg(this.normal);
|
|
3306
3058
|
if (A > 0) {
|
|
3307
3059
|
const I = 1 / A;
|
|
3308
|
-
|
|
3060
|
+
lA(this.normal, this.normal, I), this.signedDistance *= I;
|
|
3309
3061
|
}
|
|
3310
3062
|
}
|
|
3311
3063
|
}
|
|
@@ -3313,12 +3065,12 @@ class RQ {
|
|
|
3313
3065
|
planes_;
|
|
3314
3066
|
constructor(A) {
|
|
3315
3067
|
this.planes_ = [
|
|
3316
|
-
new
|
|
3317
|
-
new
|
|
3318
|
-
new
|
|
3319
|
-
new
|
|
3320
|
-
new
|
|
3321
|
-
new
|
|
3068
|
+
new YA(f(), 0),
|
|
3069
|
+
new YA(f(), 0),
|
|
3070
|
+
new YA(f(), 0),
|
|
3071
|
+
new YA(f(), 0),
|
|
3072
|
+
new YA(f(), 0),
|
|
3073
|
+
new YA(f(), 0)
|
|
3322
3074
|
], this.setWithViewProjection(A);
|
|
3323
3075
|
}
|
|
3324
3076
|
// Uses the fast plane-extraction algorithm described in
|
|
@@ -3326,22 +3078,22 @@ class RQ {
|
|
|
3326
3078
|
setWithViewProjection(A) {
|
|
3327
3079
|
const I = f();
|
|
3328
3080
|
this.planes_[0].set(
|
|
3329
|
-
|
|
3081
|
+
rA(I, A[3] + A[0], A[7] + A[4], A[11] + A[8]),
|
|
3330
3082
|
A[15] + A[12]
|
|
3331
3083
|
), this.planes_[1].set(
|
|
3332
|
-
|
|
3084
|
+
rA(I, A[3] - A[0], A[7] - A[4], A[11] - A[8]),
|
|
3333
3085
|
A[15] - A[12]
|
|
3334
3086
|
), this.planes_[2].set(
|
|
3335
|
-
|
|
3087
|
+
rA(I, A[3] - A[1], A[7] - A[5], A[11] - A[9]),
|
|
3336
3088
|
A[15] - A[13]
|
|
3337
3089
|
), this.planes_[3].set(
|
|
3338
|
-
|
|
3090
|
+
rA(I, A[3] + A[1], A[7] + A[5], A[11] + A[9]),
|
|
3339
3091
|
A[15] + A[13]
|
|
3340
3092
|
), this.planes_[4].set(
|
|
3341
|
-
|
|
3093
|
+
rA(I, A[3] + A[2], A[7] + A[6], A[11] + A[10]),
|
|
3342
3094
|
A[15] + A[14]
|
|
3343
3095
|
), this.planes_[5].set(
|
|
3344
|
-
|
|
3096
|
+
rA(I, A[3] - A[2], A[7] - A[6], A[11] - A[10]),
|
|
3345
3097
|
A[15] - A[14]
|
|
3346
3098
|
);
|
|
3347
3099
|
for (const B of this.planes_) B.normalize();
|
|
@@ -3355,8 +3107,8 @@ class RQ {
|
|
|
3355
3107
|
return !0;
|
|
3356
3108
|
}
|
|
3357
3109
|
}
|
|
3358
|
-
class lB extends
|
|
3359
|
-
projectionMatrix_ =
|
|
3110
|
+
class lB extends bA {
|
|
3111
|
+
projectionMatrix_ = z();
|
|
3360
3112
|
near_ = 0;
|
|
3361
3113
|
far_ = 0;
|
|
3362
3114
|
update() {
|
|
@@ -3378,7 +3130,7 @@ class lB extends ZA {
|
|
|
3378
3130
|
}
|
|
3379
3131
|
get frustum() {
|
|
3380
3132
|
return new RQ(
|
|
3381
|
-
|
|
3133
|
+
jA(z(), this.projectionMatrix, this.viewMatrix)
|
|
3382
3134
|
);
|
|
3383
3135
|
}
|
|
3384
3136
|
pan(A) {
|
|
@@ -3389,16 +3141,16 @@ class lB extends ZA {
|
|
|
3389
3141
|
}
|
|
3390
3142
|
clipToWorld(A) {
|
|
3391
3143
|
const I = kI(A[0], A[1], A[2], 1), B = mI(
|
|
3392
|
-
|
|
3144
|
+
z(),
|
|
3393
3145
|
this.projectionMatrix_
|
|
3394
|
-
), C =
|
|
3395
|
-
|
|
3146
|
+
), C = zA(
|
|
3147
|
+
fA(),
|
|
3396
3148
|
I,
|
|
3397
3149
|
B
|
|
3398
3150
|
);
|
|
3399
3151
|
ZC(C, C, 1 / C[3]);
|
|
3400
|
-
const Q =
|
|
3401
|
-
|
|
3152
|
+
const Q = zA(
|
|
3153
|
+
fA(),
|
|
3402
3154
|
C,
|
|
3403
3155
|
this.transform.matrix
|
|
3404
3156
|
);
|
|
@@ -3437,12 +3189,12 @@ class qo extends lB {
|
|
|
3437
3189
|
}
|
|
3438
3190
|
getWorldViewRect() {
|
|
3439
3191
|
let A = kI(-1, -1, 0, 1), I = kI(1, 1, 0, 1);
|
|
3440
|
-
const B =
|
|
3441
|
-
|
|
3192
|
+
const B = jA(
|
|
3193
|
+
z(),
|
|
3442
3194
|
this.projectionMatrix,
|
|
3443
3195
|
this.viewMatrix
|
|
3444
|
-
), C = mI(
|
|
3445
|
-
return A =
|
|
3196
|
+
), C = mI(z(), B);
|
|
3197
|
+
return A = zA(fA(), A, C), I = zA(fA(), I, C), new $(
|
|
3446
3198
|
Z(A[0], A[1]),
|
|
3447
3199
|
Z(I[0], I[1])
|
|
3448
3200
|
);
|
|
@@ -3537,14 +3289,14 @@ class fo {
|
|
|
3537
3289
|
if (!A.worldPos || !A.clipPos) return;
|
|
3538
3290
|
const I = A.event;
|
|
3539
3291
|
I.preventDefault();
|
|
3540
|
-
const B =
|
|
3292
|
+
const B = gA(A.worldPos), C = I.deltaY < 0 ? 1.05 : 0.95;
|
|
3541
3293
|
this.camera_.zoom(C);
|
|
3542
3294
|
const Q = this.camera_.clipToWorld(A.clipPos), E = UI(f(), B, Q);
|
|
3543
3295
|
this.camera_.pan(E);
|
|
3544
3296
|
}
|
|
3545
3297
|
onPointerDown(A) {
|
|
3546
3298
|
const I = A.event;
|
|
3547
|
-
!A.worldPos || I.button !== IB || (this.dragStart_ =
|
|
3299
|
+
!A.worldPos || I.button !== IB || (this.dragStart_ = gA(A.worldPos), this.dragActive_ = !0, I.target?.setPointerCapture?.(I.pointerId));
|
|
3548
3300
|
}
|
|
3549
3301
|
onPointerMove(A) {
|
|
3550
3302
|
if (!this.dragActive_ || !A.worldPos) return;
|
|
@@ -3586,7 +3338,7 @@ class po {
|
|
|
3586
3338
|
I?.radius ?? 1,
|
|
3587
3339
|
I?.yaw ?? 0,
|
|
3588
3340
|
I?.pitch ?? 0
|
|
3589
|
-
), I?.target &&
|
|
3341
|
+
), I?.target && KA(this.currCenter_, I.target), this.dampingFactor_ = NA(
|
|
3590
3342
|
I?.dampingFactor ?? JQ,
|
|
3591
3343
|
0,
|
|
3592
3344
|
1
|
|
@@ -3615,11 +3367,11 @@ class po {
|
|
|
3615
3367
|
onUpdate(A) {
|
|
3616
3368
|
if (this.orbitVelocity_.phi === 0 && this.orbitVelocity_.theta === 0 && this.orbitVelocity_.radius === 0 && MB(this.panVelocity_, q(0, 0, 0)))
|
|
3617
3369
|
return;
|
|
3618
|
-
this.currPos_.phi += this.orbitVelocity_.phi, this.currPos_.theta += this.orbitVelocity_.theta, this.currPos_.radius += this.orbitVelocity_.radius * this.currPos_.radius,
|
|
3370
|
+
this.currPos_.phi += this.orbitVelocity_.phi, this.currPos_.theta += this.orbitVelocity_.theta, this.currPos_.radius += this.orbitVelocity_.radius * this.currPos_.radius, qA(this.currCenter_, this.currCenter_, this.panVelocity_);
|
|
3619
3371
|
const I = Math.PI / 2 - p;
|
|
3620
|
-
this.currPos_.theta =
|
|
3372
|
+
this.currPos_.theta = NA(this.currPos_.theta, -I, I), this.currPos_.radius = Math.max(0.01, this.currPos_.radius), this.updateCamera();
|
|
3621
3373
|
const B = Math.pow(1 - this.dampingFactor_, A * YQ);
|
|
3622
|
-
this.orbitVelocity_.phi *= B, this.orbitVelocity_.theta *= B, this.orbitVelocity_.radius *= B,
|
|
3374
|
+
this.orbitVelocity_.phi *= B, this.orbitVelocity_.theta *= B, this.orbitVelocity_.radius *= B, lA(this.panVelocity_, this.panVelocity_, B), this.cutoffLowVelocity();
|
|
3623
3375
|
}
|
|
3624
3376
|
onPointerDown(A) {
|
|
3625
3377
|
const I = A.event;
|
|
@@ -3646,20 +3398,20 @@ class po {
|
|
|
3646
3398
|
}
|
|
3647
3399
|
pan(A, I) {
|
|
3648
3400
|
const B = this.currPos_.radius * kQ, C = f();
|
|
3649
|
-
cI(C, C, this.camera_.right, A), cI(C, C, this.camera_.up, I),
|
|
3401
|
+
cI(C, C, this.camera_.right, A), cI(C, C, this.camera_.up, I), lA(C, C, B), UI(this.panVelocity_, this.panVelocity_, C);
|
|
3650
3402
|
}
|
|
3651
3403
|
zoom(A) {
|
|
3652
3404
|
this.orbitVelocity_.radius += A * LQ;
|
|
3653
3405
|
}
|
|
3654
3406
|
updateCamera() {
|
|
3655
|
-
const A =
|
|
3407
|
+
const A = qA(f(), this.currCenter_, this.currPos_.toVec3());
|
|
3656
3408
|
this.camera_.transform.setTranslation(A), this.camera_.transform.targetTo(this.currCenter_);
|
|
3657
3409
|
}
|
|
3658
3410
|
cutoffLowVelocity() {
|
|
3659
3411
|
Math.abs(this.orbitVelocity_.phi) < p && (this.orbitVelocity_.phi = 0), Math.abs(this.orbitVelocity_.theta) < p && (this.orbitVelocity_.theta = 0), Math.abs(this.orbitVelocity_.radius) < p && (this.orbitVelocity_.radius = 0), eg(this.panVelocity_) < p && TC(this.panVelocity_);
|
|
3660
3412
|
}
|
|
3661
3413
|
}
|
|
3662
|
-
class
|
|
3414
|
+
class wA {
|
|
3663
3415
|
objects_ = [];
|
|
3664
3416
|
state_ = "initialized";
|
|
3665
3417
|
callbacks_ = [];
|
|
@@ -3674,7 +3426,7 @@ class FA {
|
|
|
3674
3426
|
(I < 0 || I > 1) && U.warn(
|
|
3675
3427
|
"Layer",
|
|
3676
3428
|
`Layer opacity out of bounds: ${I} — clamping to [0.0, 1.0]`
|
|
3677
|
-
), this.transparent = A, this.opacity_ =
|
|
3429
|
+
), this.transparent = A, this.opacity_ = NA(I, 0, 1), this.blendMode = B;
|
|
3678
3430
|
}
|
|
3679
3431
|
get opacity() {
|
|
3680
3432
|
return this.opacity_;
|
|
@@ -3683,7 +3435,7 @@ class FA {
|
|
|
3683
3435
|
(A < 0 || A > 1) && U.warn(
|
|
3684
3436
|
"Layer",
|
|
3685
3437
|
`Opacity out of bounds: ${A} — clamping to [0.0, 1.0]`
|
|
3686
|
-
), this.opacity_ =
|
|
3438
|
+
), this.opacity_ = NA(A, 0, 1);
|
|
3687
3439
|
}
|
|
3688
3440
|
onEvent(A) {
|
|
3689
3441
|
}
|
|
@@ -3735,7 +3487,7 @@ class FA {
|
|
|
3735
3487
|
return {};
|
|
3736
3488
|
}
|
|
3737
3489
|
}
|
|
3738
|
-
class LI extends
|
|
3490
|
+
class LI extends WA {
|
|
3739
3491
|
// this creates the geometry for a screen-space projected line
|
|
3740
3492
|
// each point on the input path is split into two vertices
|
|
3741
3493
|
// these are pushed in opposite directions in screen-space to create width
|
|
@@ -3791,7 +3543,7 @@ class LI extends bA {
|
|
|
3791
3543
|
return I;
|
|
3792
3544
|
}
|
|
3793
3545
|
}
|
|
3794
|
-
class wg extends
|
|
3546
|
+
class wg extends bA {
|
|
3795
3547
|
color_;
|
|
3796
3548
|
width_;
|
|
3797
3549
|
taperOffset_ = 0.5;
|
|
@@ -3841,7 +3593,7 @@ class wg extends ZA {
|
|
|
3841
3593
|
};
|
|
3842
3594
|
}
|
|
3843
3595
|
}
|
|
3844
|
-
class mo extends
|
|
3596
|
+
class mo extends wA {
|
|
3845
3597
|
type = "AxesLayer";
|
|
3846
3598
|
constructor(A) {
|
|
3847
3599
|
super();
|
|
@@ -3877,7 +3629,7 @@ function Ig(g) {
|
|
|
3877
3629
|
width: I
|
|
3878
3630
|
});
|
|
3879
3631
|
}
|
|
3880
|
-
class uo extends
|
|
3632
|
+
class uo extends wA {
|
|
3881
3633
|
type = "ProjectedLineLayer";
|
|
3882
3634
|
paths_ = [];
|
|
3883
3635
|
constructor(A = []) {
|
|
@@ -3905,7 +3657,7 @@ function dQ(g) {
|
|
|
3905
3657
|
const [I, B] = A(0), [C, Q] = A(1), [E, i] = A(2);
|
|
3906
3658
|
return { xMin: I, xMax: B, yMin: C, yMax: Q, zMin: E, zMax: i };
|
|
3907
3659
|
}
|
|
3908
|
-
class To extends
|
|
3660
|
+
class To extends wA {
|
|
3909
3661
|
type = "TracksLayer";
|
|
3910
3662
|
tracks_ = [];
|
|
3911
3663
|
constructor(A = []) {
|
|
@@ -3964,9 +3716,9 @@ function KQ({
|
|
|
3964
3716
|
}) {
|
|
3965
3717
|
const B = HQ(g), C = Array((g.length - 1) * A);
|
|
3966
3718
|
for (let Q = 0; Q < g.length - 1; Q++) {
|
|
3967
|
-
const E = g[Q], i = g[Q + 1], o =
|
|
3719
|
+
const E = g[Q], i = g[Q + 1], o = gA(B[Q]);
|
|
3968
3720
|
cI(o, E, o, I);
|
|
3969
|
-
const a =
|
|
3721
|
+
const a = gA(B[Q + 1]);
|
|
3970
3722
|
cI(a, i, a, -I);
|
|
3971
3723
|
for (let s = 0; s < A; s++) {
|
|
3972
3724
|
const h = s / A, t = C[Q * A + s] = f();
|
|
@@ -3981,11 +3733,11 @@ function HQ(g) {
|
|
|
3981
3733
|
const A = Array(g.length), I = f(), B = f();
|
|
3982
3734
|
for (let C = 0; C < g.length; C++) {
|
|
3983
3735
|
const Q = g[C], E = g[C + 1] ?? g[C];
|
|
3984
|
-
A[C] = f(), C !== 0 &&
|
|
3736
|
+
A[C] = f(), C !== 0 && KA(I, B), C !== g.length - 1 && UI(B, E, Q), C === 0 ? KA(A[C], B) : C == g.length - 1 ? KA(A[C], I) : (qA(A[C], I, B), lA(A[C], A[C], 0.5));
|
|
3985
3737
|
}
|
|
3986
3738
|
return A;
|
|
3987
3739
|
}
|
|
3988
|
-
class pB extends
|
|
3740
|
+
class pB extends WA {
|
|
3989
3741
|
constructor(A, I, B, C) {
|
|
3990
3742
|
super();
|
|
3991
3743
|
const Q = [], E = [], i = B, o = C, a = i + 1, s = o + 1, h = A / i, t = I / o;
|
|
@@ -4019,7 +3771,7 @@ class pB extends bA {
|
|
|
4019
3771
|
function QB(g) {
|
|
4020
3772
|
return g === 1 || g === 2 || g === 4 || g === 8;
|
|
4021
3773
|
}
|
|
4022
|
-
function
|
|
3774
|
+
function pA(g) {
|
|
4023
3775
|
if (g instanceof Int8Array)
|
|
4024
3776
|
return "byte";
|
|
4025
3777
|
if (g instanceof Int16Array)
|
|
@@ -4072,7 +3824,7 @@ class Fg extends yg {
|
|
|
4072
3824
|
}
|
|
4073
3825
|
}
|
|
4074
3826
|
const EB = 32;
|
|
4075
|
-
function
|
|
3827
|
+
function _A(g, { visible: A, color: I, contrastLimits: B }) {
|
|
4076
3828
|
return A === void 0 && (A = !0), I === void 0 ? I = l.WHITE : I = l.from(I), g !== null ? B = lQ(B, g) : B === void 0 && (U.debug(
|
|
4077
3829
|
"Channel",
|
|
4078
3830
|
"No texture provided, defaulting channel contrast limits to [0, 1]."
|
|
@@ -4092,7 +3844,7 @@ function ig(g, A) {
|
|
|
4092
3844
|
`Number of channels (${A.length}) must match depth of texture (${I}).`
|
|
4093
3845
|
);
|
|
4094
3846
|
}
|
|
4095
|
-
return A.map((I) =>
|
|
3847
|
+
return A.map((I) => _A(g, I));
|
|
4096
3848
|
}
|
|
4097
3849
|
function lQ(g, A) {
|
|
4098
3850
|
if (g === void 0)
|
|
@@ -4103,7 +3855,7 @@ function lQ(g, A) {
|
|
|
4103
3855
|
);
|
|
4104
3856
|
return g;
|
|
4105
3857
|
}
|
|
4106
|
-
class rg extends
|
|
3858
|
+
class rg extends bA {
|
|
4107
3859
|
channels_;
|
|
4108
3860
|
constructor(A, I, B, C = []) {
|
|
4109
3861
|
super(), this.geometry = new pB(A, I, 1, 1), this.setTexture(0, B), this.channels_ = ig(B, C), this.programName = fQ(B);
|
|
@@ -4115,7 +3867,7 @@ class rg extends ZA {
|
|
|
4115
3867
|
this.channels_ = ig(this.textures[0], A);
|
|
4116
3868
|
}
|
|
4117
3869
|
setChannelProperty(A, I, B) {
|
|
4118
|
-
const C =
|
|
3870
|
+
const C = _A(this.textures[0], {
|
|
4119
3871
|
...this.channels_[A],
|
|
4120
3872
|
[I]: B
|
|
4121
3873
|
});
|
|
@@ -4126,7 +3878,7 @@ class rg extends ZA {
|
|
|
4126
3878
|
if (!A)
|
|
4127
3879
|
throw new Error("No texture set");
|
|
4128
3880
|
if (A.type === "Texture2D") {
|
|
4129
|
-
const { color: I, contrastLimits: B } = this.channels_[0] ??
|
|
3881
|
+
const { color: I, contrastLimits: B } = this.channels_[0] ?? _A(A, {});
|
|
4130
3882
|
return {
|
|
4131
3883
|
ImageSampler: 0,
|
|
4132
3884
|
Color: I.rgb,
|
|
@@ -4186,13 +3938,13 @@ function mQ(g) {
|
|
|
4186
3938
|
return "floatScalarImageArray";
|
|
4187
3939
|
}
|
|
4188
3940
|
}
|
|
4189
|
-
class
|
|
3941
|
+
class tI extends Fg {
|
|
4190
3942
|
data_;
|
|
4191
3943
|
width_;
|
|
4192
3944
|
height_;
|
|
4193
3945
|
depth_;
|
|
4194
3946
|
constructor(A, I, B) {
|
|
4195
|
-
super(), this.dataFormat = "scalar", this.dataType =
|
|
3947
|
+
super(), this.dataFormat = "scalar", this.dataType = pA(A), this.data_ = A, this.width_ = I, this.height_ = B, this.depth_ = A.length / (I * B);
|
|
4196
3948
|
}
|
|
4197
3949
|
get type() {
|
|
4198
3950
|
return "Texture2DArray";
|
|
@@ -4220,7 +3972,7 @@ class yI extends Fg {
|
|
|
4220
3972
|
);
|
|
4221
3973
|
if (this.data === B) return;
|
|
4222
3974
|
const C = A.shape.x, Q = A.shape.y, E = B.length / (C * Q);
|
|
4223
|
-
if (this.width != C || this.height != Q || this.depth_ != E || this.dataType !=
|
|
3975
|
+
if (this.width != C || this.height != Q || this.depth_ != E || this.dataType != pA(B))
|
|
4224
3976
|
throw new Error("Unable to update texture, texture buffer mismatch.");
|
|
4225
3977
|
this.data = B;
|
|
4226
3978
|
}
|
|
@@ -4230,7 +3982,7 @@ class yI extends Fg {
|
|
|
4230
3982
|
throw new Error(
|
|
4231
3983
|
"Unable to create texture, chunk data is not initialized."
|
|
4232
3984
|
);
|
|
4233
|
-
const C = new
|
|
3985
|
+
const C = new tI(B, A.shape.x, A.shape.y);
|
|
4234
3986
|
return C.unpackAlignment = A.rowAlignmentBytes, C;
|
|
4235
3987
|
}
|
|
4236
3988
|
}
|
|
@@ -4275,7 +4027,7 @@ class mB {
|
|
|
4275
4027
|
this.bins_.clear();
|
|
4276
4028
|
}
|
|
4277
4029
|
}
|
|
4278
|
-
class uB extends
|
|
4030
|
+
class uB extends wA {
|
|
4279
4031
|
type = "ChunkedImageLayer";
|
|
4280
4032
|
source_;
|
|
4281
4033
|
sliceCoords_;
|
|
@@ -4393,7 +4145,7 @@ class uB extends FA {
|
|
|
4393
4145
|
}
|
|
4394
4146
|
slicePlane(A, I) {
|
|
4395
4147
|
if (!A.data) return;
|
|
4396
|
-
const B = (I - A.offset.z) / A.scale.z, C = Math.round(B), Q =
|
|
4148
|
+
const B = (I - A.offset.z) / A.scale.z, C = Math.round(B), Q = NA(C, 0, A.shape.z - 1);
|
|
4397
4149
|
Qg(B, Q, 1 + 1e-6) || U.error("ImageLayer", "slicePlane zValue outside extent");
|
|
4398
4150
|
const E = A.shape.x * A.shape.y, i = E * Q;
|
|
4399
4151
|
return A.data.slice(i, i + E);
|
|
@@ -4408,7 +4160,7 @@ class uB extends FA {
|
|
|
4408
4160
|
const I = new rg(
|
|
4409
4161
|
A.shape.x,
|
|
4410
4162
|
A.shape.y,
|
|
4411
|
-
|
|
4163
|
+
tI.createWithChunk(A, this.getDataForImage(A)),
|
|
4412
4164
|
this.channelProps_ ?? [{}]
|
|
4413
4165
|
);
|
|
4414
4166
|
return this.updateImageChunk(I, A), I;
|
|
@@ -4495,7 +4247,7 @@ function iB(g) {
|
|
|
4495
4247
|
`align${g.rowAlignmentBytes}`
|
|
4496
4248
|
].join(":");
|
|
4497
4249
|
}
|
|
4498
|
-
class uQ extends
|
|
4250
|
+
class uQ extends WA {
|
|
4499
4251
|
constructor(A, I, B, C, Q, E) {
|
|
4500
4252
|
super();
|
|
4501
4253
|
const i = [], o = [], a = Math.floor(C), s = Math.floor(Q), h = Math.floor(E);
|
|
@@ -4522,7 +4274,7 @@ class uQ extends bA {
|
|
|
4522
4274
|
O[A] = b * C, O[I] = m * Q, O[B] = c;
|
|
4523
4275
|
const V = { x: 0, y: 0, z: 0 };
|
|
4524
4276
|
V[B] = h;
|
|
4525
|
-
const
|
|
4277
|
+
const EA = x / a, iA = 1 - L / s;
|
|
4526
4278
|
t.push(
|
|
4527
4279
|
O.x,
|
|
4528
4280
|
O.y,
|
|
@@ -4530,8 +4282,8 @@ class uQ extends bA {
|
|
|
4530
4282
|
V.x,
|
|
4531
4283
|
V.y,
|
|
4532
4284
|
V.z,
|
|
4533
|
-
|
|
4534
|
-
|
|
4285
|
+
EA,
|
|
4286
|
+
iA
|
|
4535
4287
|
);
|
|
4536
4288
|
}
|
|
4537
4289
|
}
|
|
@@ -4542,13 +4294,13 @@ class uQ extends bA {
|
|
|
4542
4294
|
}
|
|
4543
4295
|
}
|
|
4544
4296
|
}
|
|
4545
|
-
class
|
|
4297
|
+
class XA extends Fg {
|
|
4546
4298
|
data_;
|
|
4547
4299
|
width_;
|
|
4548
4300
|
height_;
|
|
4549
4301
|
depth_;
|
|
4550
4302
|
constructor(A, I, B, C) {
|
|
4551
|
-
super(), this.dataFormat = "scalar", this.dataType =
|
|
4303
|
+
super(), this.dataFormat = "scalar", this.dataType = pA(A), this.data_ = A, this.width_ = I, this.height_ = B, this.depth_ = C;
|
|
4552
4304
|
}
|
|
4553
4305
|
set data(A) {
|
|
4554
4306
|
this.data_ = A, this.needsUpdate = !0;
|
|
@@ -4575,7 +4327,7 @@ class jA extends Fg {
|
|
|
4575
4327
|
"Unable to update texture, chunk data is not initialized."
|
|
4576
4328
|
);
|
|
4577
4329
|
if (this.data !== I) {
|
|
4578
|
-
if (this.width != A.shape.x || this.height != A.shape.y || this.depth != A.shape.z || this.dataType !=
|
|
4330
|
+
if (this.width != A.shape.x || this.height != A.shape.y || this.depth != A.shape.z || this.dataType != pA(I))
|
|
4579
4331
|
throw new Error("Unable to update texture, texture buffer mismatch.");
|
|
4580
4332
|
this.data = I;
|
|
4581
4333
|
}
|
|
@@ -4586,7 +4338,7 @@ class jA extends Fg {
|
|
|
4586
4338
|
throw new Error(
|
|
4587
4339
|
"Unable to create texture, chunk data is not initialized."
|
|
4588
4340
|
);
|
|
4589
|
-
const B = new
|
|
4341
|
+
const B = new XA(
|
|
4590
4342
|
I,
|
|
4591
4343
|
A.shape.x,
|
|
4592
4344
|
A.shape.y,
|
|
@@ -4595,7 +4347,7 @@ class jA extends Fg {
|
|
|
4595
4347
|
return B.unpackAlignment = A.rowAlignmentBytes, B;
|
|
4596
4348
|
}
|
|
4597
4349
|
}
|
|
4598
|
-
class TQ extends
|
|
4350
|
+
class TQ extends bA {
|
|
4599
4351
|
voxelScale = q(1, 1, 1);
|
|
4600
4352
|
channels_;
|
|
4601
4353
|
channelToTextureIndex_ = /* @__PURE__ */ new Map();
|
|
@@ -4611,7 +4363,7 @@ class TQ extends ZA {
|
|
|
4611
4363
|
B !== void 0 ? this.updateChannelTexture(B, A) : this.addChannelTexture(I, A), this.loadedChannels_.add(I);
|
|
4612
4364
|
}
|
|
4613
4365
|
addChannelTexture(A, I) {
|
|
4614
|
-
const B =
|
|
4366
|
+
const B = XA.createWithChunk(I), C = this.textures.length;
|
|
4615
4367
|
this.setTexture(C, B), this.channelToTextureIndex_.set(A, C);
|
|
4616
4368
|
const Q = xQ(B.dataType);
|
|
4617
4369
|
if (this.programName && this.programName !== Q)
|
|
@@ -4622,8 +4374,8 @@ class TQ extends ZA {
|
|
|
4622
4374
|
}
|
|
4623
4375
|
updateChannelTexture(A, I) {
|
|
4624
4376
|
const B = this.textures[A];
|
|
4625
|
-
if (!(B instanceof
|
|
4626
|
-
const C =
|
|
4377
|
+
if (!(B instanceof XA)) {
|
|
4378
|
+
const C = XA.createWithChunk(I);
|
|
4627
4379
|
this.setTexture(A, C);
|
|
4628
4380
|
return;
|
|
4629
4381
|
}
|
|
@@ -4653,7 +4405,7 @@ class TQ extends ZA {
|
|
|
4653
4405
|
for (let i = 0; i < E && Q.length < 4; i++) {
|
|
4654
4406
|
const o = this.channelToTextureIndex_.get(i);
|
|
4655
4407
|
if (o === void 0 || !this.loadedChannels_.has(i)) continue;
|
|
4656
|
-
const a = this.textures[o], s =
|
|
4408
|
+
const a = this.textures[o], s = _A(a, this.channels_[i] || {});
|
|
4657
4409
|
if (!s.visible) continue;
|
|
4658
4410
|
const h = Q.length;
|
|
4659
4411
|
I[h * 3] = s.color.rgb[0], I[h * 3 + 1] = s.color.rgb[1], I[h * 3 + 2] = s.color.rgb[2], Q.push(o), B[h] = -s.contrastLimits[0], C[h] = 1 / (s.contrastLimits[1] - s.contrastLimits[0]), A[h] = 1;
|
|
@@ -4691,7 +4443,7 @@ class TQ extends ZA {
|
|
|
4691
4443
|
);
|
|
4692
4444
|
}
|
|
4693
4445
|
setChannelProperty(A, I, B) {
|
|
4694
|
-
const C =
|
|
4446
|
+
const C = _A(
|
|
4695
4447
|
this.getAvailableChannelTexture(A),
|
|
4696
4448
|
{
|
|
4697
4449
|
...this.channels_[A],
|
|
@@ -4718,13 +4470,13 @@ function xQ(g) {
|
|
|
4718
4470
|
function WQ(g, A) {
|
|
4719
4471
|
const I = A.position, B = f(), C = f();
|
|
4720
4472
|
return g.sort((Q, E) => {
|
|
4721
|
-
|
|
4473
|
+
qA(B, Q.boundingBox.max, Q.boundingBox.min), lA(B, B, 0.5), qA(C, E.boundingBox.max, E.boundingBox.min), lA(C, C, 0.5);
|
|
4722
4474
|
const i = Vg(I, B), o = Vg(I, C);
|
|
4723
4475
|
return i - o;
|
|
4724
4476
|
}), g;
|
|
4725
4477
|
}
|
|
4726
4478
|
const bQ = 2;
|
|
4727
|
-
class xo extends
|
|
4479
|
+
class xo extends wA {
|
|
4728
4480
|
type = "VolumeLayer";
|
|
4729
4481
|
source_;
|
|
4730
4482
|
sliceCoords_;
|
|
@@ -4827,7 +4579,7 @@ class xo extends FA {
|
|
|
4827
4579
|
y: I.shape.y * I.scale.y,
|
|
4828
4580
|
z: I.shape.z * I.scale.z
|
|
4829
4581
|
};
|
|
4830
|
-
A.transform.setScale([B.x, B.y, B.z]),
|
|
4582
|
+
A.transform.setScale([B.x, B.y, B.z]), rA(A.voxelScale, I.scale.x, I.scale.y, I.scale.z);
|
|
4831
4583
|
const C = {
|
|
4832
4584
|
x: I.shape.x * I.scale.x / 2,
|
|
4833
4585
|
y: I.shape.y * I.scale.y / 2,
|
|
@@ -4885,7 +4637,7 @@ function OQ(g) {
|
|
|
4885
4637
|
`align${g.rowAlignmentBytes}`
|
|
4886
4638
|
].join(":");
|
|
4887
4639
|
}
|
|
4888
|
-
class Wo extends
|
|
4640
|
+
class Wo extends wA {
|
|
4889
4641
|
type = "ImageLayer";
|
|
4890
4642
|
source_;
|
|
4891
4643
|
region_;
|
|
@@ -4969,7 +4721,7 @@ class Wo extends FA {
|
|
|
4969
4721
|
const I = new rg(
|
|
4970
4722
|
A.shape.x,
|
|
4971
4723
|
A.shape.y,
|
|
4972
|
-
|
|
4724
|
+
tI.createWithChunk(A),
|
|
4973
4725
|
this.channelProps
|
|
4974
4726
|
);
|
|
4975
4727
|
return I.transform.setScale([A.scale.x, A.scale.y, 1]), I.transform.setTranslation([A.offset.x, A.offset.y, 0]), I;
|
|
@@ -4988,12 +4740,12 @@ class Wo extends FA {
|
|
|
4988
4740
|
return null;
|
|
4989
4741
|
}
|
|
4990
4742
|
}
|
|
4991
|
-
class
|
|
4743
|
+
class $A extends Fg {
|
|
4992
4744
|
data_;
|
|
4993
4745
|
width_;
|
|
4994
4746
|
height_;
|
|
4995
4747
|
constructor(A, I, B) {
|
|
4996
|
-
super(), this.dataFormat = "scalar", this.dataType =
|
|
4748
|
+
super(), this.dataFormat = "scalar", this.dataType = pA(A), this.data_ = A, this.width_ = I, this.height_ = B;
|
|
4997
4749
|
}
|
|
4998
4750
|
set data(A) {
|
|
4999
4751
|
this.data_ = A, this.needsUpdate = !0;
|
|
@@ -5017,7 +4769,7 @@ class AI extends Fg {
|
|
|
5017
4769
|
"Unable to update texture, chunk data is not initialized."
|
|
5018
4770
|
);
|
|
5019
4771
|
if (this.data !== B) {
|
|
5020
|
-
if (this.width != A.shape.x || this.height != A.shape.y || this.dataType !=
|
|
4772
|
+
if (this.width != A.shape.x || this.height != A.shape.y || this.dataType != pA(B))
|
|
5021
4773
|
throw new Error("Unable to update texture, texture buffer mismatch.");
|
|
5022
4774
|
this.data = B;
|
|
5023
4775
|
}
|
|
@@ -5028,7 +4780,7 @@ class AI extends Fg {
|
|
|
5028
4780
|
throw new Error(
|
|
5029
4781
|
"Unable to create texture, chunk data is not initialized."
|
|
5030
4782
|
);
|
|
5031
|
-
const C = new
|
|
4783
|
+
const C = new $A(B, A.shape.x, A.shape.y);
|
|
5032
4784
|
return C.unpackAlignment = A.rowAlignmentBytes, C;
|
|
5033
4785
|
}
|
|
5034
4786
|
}
|
|
@@ -5074,7 +4826,7 @@ function zQ(g) {
|
|
|
5074
4826
|
);
|
|
5075
4827
|
return g;
|
|
5076
4828
|
}
|
|
5077
|
-
class _Q extends
|
|
4829
|
+
class _Q extends bA {
|
|
5078
4830
|
outlineSelected_;
|
|
5079
4831
|
selectedValue_;
|
|
5080
4832
|
constructor(A) {
|
|
@@ -5107,16 +4859,16 @@ class _Q extends ZA {
|
|
|
5107
4859
|
makeColorCycleTexture(A) {
|
|
5108
4860
|
const I = new Uint8Array(
|
|
5109
4861
|
A.flatMap((C) => C.rgba).map((C) => Math.round(C * 255))
|
|
5110
|
-
), B = new
|
|
4862
|
+
), B = new $A(I, A.length, 1);
|
|
5111
4863
|
return B.dataFormat = "rgba", B;
|
|
5112
4864
|
}
|
|
5113
4865
|
makeColorLookupTableTexture(A) {
|
|
5114
4866
|
A === void 0 ? A = /* @__PURE__ */ new Map([[0, l.TRANSPARENT]]) : A.has(0) || (A = new Map([[0, l.TRANSPARENT], ...A]));
|
|
5115
4867
|
const I = Array.from(A.keys()), B = Array.from(A.values()).map((E) => E.packed), C = A.size, Q = new Uint32Array(C * 2);
|
|
5116
|
-
return Q.set(I, 0), Q.set(B, C), new
|
|
4868
|
+
return Q.set(I, 0), Q.set(B, C), new $A(Q, C, 2);
|
|
5117
4869
|
}
|
|
5118
4870
|
}
|
|
5119
|
-
class bo extends
|
|
4871
|
+
class bo extends wA {
|
|
5120
4872
|
type = "LabelImageLayer";
|
|
5121
4873
|
source_;
|
|
5122
4874
|
region_;
|
|
@@ -5184,7 +4936,7 @@ class bo extends FA {
|
|
|
5184
4936
|
const I = new _Q({
|
|
5185
4937
|
width: A.shape.x,
|
|
5186
4938
|
height: A.shape.y,
|
|
5187
|
-
imageData:
|
|
4939
|
+
imageData: $A.createWithChunk(A),
|
|
5188
4940
|
colorMap: this.colorMap_,
|
|
5189
4941
|
outlineSelected: this.outlineSelected_,
|
|
5190
4942
|
selectedValue: this.selectedValue_
|
|
@@ -5372,7 +5124,7 @@ class AE {
|
|
|
5372
5124
|
return this.loader_ ??= await this.source_.open(), this.loader_;
|
|
5373
5125
|
}
|
|
5374
5126
|
}
|
|
5375
|
-
class Zo extends
|
|
5127
|
+
class Zo extends wA {
|
|
5376
5128
|
type = "ImageSeriesLayer";
|
|
5377
5129
|
seriesLoader_;
|
|
5378
5130
|
initialChannelProps_;
|
|
@@ -5440,7 +5192,7 @@ class Zo extends FA {
|
|
|
5440
5192
|
return A.chunk && (this.setData(A.chunk), this.setState("ready")), A;
|
|
5441
5193
|
}
|
|
5442
5194
|
setData(A) {
|
|
5443
|
-
!this.texture_ || !this.image_ ? (this.texture_ =
|
|
5195
|
+
!this.texture_ || !this.image_ ? (this.texture_ = tI.createWithChunk(A), this.image_ = this.createImage(A, this.texture_, this.channelProps_), this.addObject(this.image_), this.extent_ = {
|
|
5444
5196
|
x: A.shape.x * A.scale.x,
|
|
5445
5197
|
y: A.shape.y * A.scale.y
|
|
5446
5198
|
}) : A.data && this.texture_.updateWithChunk(A);
|
|
@@ -5499,7 +5251,7 @@ async function gE(g, A, I, B) {
|
|
|
5499
5251
|
let Q = C.headers.get("Content-Length"), E = Number(Q);
|
|
5500
5252
|
return TB(g, E - A, E, I);
|
|
5501
5253
|
}
|
|
5502
|
-
class
|
|
5254
|
+
class ZA {
|
|
5503
5255
|
url;
|
|
5504
5256
|
#A;
|
|
5505
5257
|
#I;
|
|
@@ -5602,7 +5354,7 @@ class Rg {
|
|
|
5602
5354
|
yield this.get(A);
|
|
5603
5355
|
}
|
|
5604
5356
|
}
|
|
5605
|
-
class
|
|
5357
|
+
class yI {
|
|
5606
5358
|
#A;
|
|
5607
5359
|
chars;
|
|
5608
5360
|
constructor(A, I, B, C) {
|
|
@@ -5611,7 +5363,7 @@ class eI {
|
|
|
5611
5363
|
else if (I instanceof ArrayBuffer)
|
|
5612
5364
|
C && (C *= A), this.#A = new Int32Array(I, B, C);
|
|
5613
5365
|
else {
|
|
5614
|
-
const Q = I, E = new
|
|
5366
|
+
const Q = I, E = new yI(A, 1);
|
|
5615
5367
|
this.#A = new Int32Array(function* () {
|
|
5616
5368
|
for (let i of Q)
|
|
5617
5369
|
E.set(0, i), yield* E.#A;
|
|
@@ -5657,7 +5409,7 @@ class eI {
|
|
|
5657
5409
|
yield this.get(A);
|
|
5658
5410
|
}
|
|
5659
5411
|
}
|
|
5660
|
-
function
|
|
5412
|
+
function eI(g) {
|
|
5661
5413
|
const A = new TextDecoder().decode(g);
|
|
5662
5414
|
return JSON.parse(A);
|
|
5663
5415
|
}
|
|
@@ -5674,7 +5426,7 @@ function WB(g) {
|
|
|
5674
5426
|
let A = g.match(/v2:([US])(\d+)/);
|
|
5675
5427
|
if (A) {
|
|
5676
5428
|
let [, B, C] = A;
|
|
5677
|
-
return (B === "U" ?
|
|
5429
|
+
return (B === "U" ? yI : Rg).bind(null, Number(C));
|
|
5678
5430
|
}
|
|
5679
5431
|
let I = {
|
|
5680
5432
|
int8: Int8Array,
|
|
@@ -5692,7 +5444,7 @@ function WB(g) {
|
|
|
5692
5444
|
}[g];
|
|
5693
5445
|
return W(I, `Unknown or unsupported data_type: ${g}`), I;
|
|
5694
5446
|
}
|
|
5695
|
-
function
|
|
5447
|
+
function cA(g, A) {
|
|
5696
5448
|
const I = g.length;
|
|
5697
5449
|
typeof A == "string" && (A = A === "C" ? Array.from({ length: I }, (Q, E) => E) : Array.from({ length: I }, (Q, E) => I - 1 - E)), W(I === A.length, "Order length must match the number of dimensions.");
|
|
5698
5450
|
let B = 1, C = new Array(I);
|
|
@@ -5848,7 +5600,7 @@ class xI {
|
|
|
5848
5600
|
#C;
|
|
5849
5601
|
#B;
|
|
5850
5602
|
constructor(A, I) {
|
|
5851
|
-
this.#B = A?.endian, this.#I = WB(I.data_type), this.#C = I.shape, this.#A =
|
|
5603
|
+
this.#B = A?.endian, this.#I = WB(I.data_type), this.#C = I.shape, this.#A = cA(I.shape, "C");
|
|
5852
5604
|
const B = new this.#I(0);
|
|
5853
5605
|
this.#g = B.BYTES_PER_ELEMENT;
|
|
5854
5606
|
}
|
|
@@ -5944,14 +5696,14 @@ class kg {
|
|
|
5944
5696
|
decode(A) {
|
|
5945
5697
|
const { strict: I } = this.#I;
|
|
5946
5698
|
W(I, "JsonCodec does not yet support non-strict decoding.");
|
|
5947
|
-
const B =
|
|
5699
|
+
const B = eI(A), C = B.pop();
|
|
5948
5700
|
B.pop(), W(C, "0D not implemented for JsonCodec.");
|
|
5949
|
-
const Q =
|
|
5701
|
+
const Q = cA(C, "C");
|
|
5950
5702
|
return { data: B, shape: C, stride: Q };
|
|
5951
5703
|
}
|
|
5952
5704
|
}
|
|
5953
5705
|
function yB(g) {
|
|
5954
|
-
return g instanceof xB || g instanceof Rg || g instanceof
|
|
5706
|
+
return g instanceof xB || g instanceof Rg || g instanceof yI ? new Proxy(g, {
|
|
5955
5707
|
get(I, B) {
|
|
5956
5708
|
return I.get(Number(B));
|
|
5957
5709
|
},
|
|
@@ -5962,14 +5714,14 @@ function yB(g) {
|
|
|
5962
5714
|
}
|
|
5963
5715
|
function hE(g, A) {
|
|
5964
5716
|
let I;
|
|
5965
|
-
return g.data instanceof Rg || g.data instanceof
|
|
5717
|
+
return g.data instanceof Rg || g.data instanceof yI ? I = new g.constructor(
|
|
5966
5718
|
// @ts-expect-error
|
|
5967
5719
|
g.data.length,
|
|
5968
5720
|
g.data.chars
|
|
5969
5721
|
) : I = new g.constructor(g.data.length), {
|
|
5970
5722
|
data: I,
|
|
5971
5723
|
shape: g.shape,
|
|
5972
|
-
stride:
|
|
5724
|
+
stride: cA(g.shape, A)
|
|
5973
5725
|
};
|
|
5974
5726
|
}
|
|
5975
5727
|
function tE(g, A) {
|
|
@@ -6024,7 +5776,7 @@ class Lg {
|
|
|
6024
5776
|
return {
|
|
6025
5777
|
data: A.data,
|
|
6026
5778
|
shape: A.shape,
|
|
6027
|
-
stride:
|
|
5779
|
+
stride: cA(A.shape, this.#A)
|
|
6028
5780
|
};
|
|
6029
5781
|
}
|
|
6030
5782
|
}
|
|
@@ -6033,7 +5785,7 @@ class Jg {
|
|
|
6033
5785
|
#A;
|
|
6034
5786
|
#I;
|
|
6035
5787
|
constructor(A) {
|
|
6036
|
-
this.#A = A, this.#I =
|
|
5788
|
+
this.#A = A, this.#I = cA(A, "C");
|
|
6037
5789
|
}
|
|
6038
5790
|
static fromConfig(A, I) {
|
|
6039
5791
|
return new Jg(I.shape);
|
|
@@ -6113,7 +5865,7 @@ async function eB(g) {
|
|
|
6113
5865
|
function wE(g) {
|
|
6114
5866
|
return g.data_type !== "v2:object";
|
|
6115
5867
|
}
|
|
6116
|
-
class
|
|
5868
|
+
class GI extends Error {
|
|
6117
5869
|
constructor(A, I = {}) {
|
|
6118
5870
|
super(`Node not found: ${A}`, I), this.name = "NodeNotFoundError";
|
|
6119
5871
|
}
|
|
@@ -6151,7 +5903,7 @@ function FE(g, A, I, B) {
|
|
|
6151
5903
|
});
|
|
6152
5904
|
};
|
|
6153
5905
|
}
|
|
6154
|
-
class
|
|
5906
|
+
class j {
|
|
6155
5907
|
store;
|
|
6156
5908
|
path;
|
|
6157
5909
|
constructor(A, I = "/") {
|
|
@@ -6159,10 +5911,10 @@ class z {
|
|
|
6159
5911
|
}
|
|
6160
5912
|
resolve(A) {
|
|
6161
5913
|
let I = new URL(`file://${this.path.endsWith("/") ? this.path : `${this.path}/`}`);
|
|
6162
|
-
return new
|
|
5914
|
+
return new j(this.store, decodeURIComponent(new URL(A, I).pathname));
|
|
6163
5915
|
}
|
|
6164
5916
|
}
|
|
6165
|
-
class Mg extends
|
|
5917
|
+
class Mg extends j {
|
|
6166
5918
|
kind = "group";
|
|
6167
5919
|
#A;
|
|
6168
5920
|
constructor(A, I, B) {
|
|
@@ -6175,9 +5927,9 @@ class Mg extends z {
|
|
|
6175
5927
|
function nB(g) {
|
|
6176
5928
|
return g.find((I) => I.name === "transpose")?.configuration?.order ?? "C";
|
|
6177
5929
|
}
|
|
6178
|
-
const
|
|
5930
|
+
const PA = Symbol("zarrita.context");
|
|
6179
5931
|
function rE(g) {
|
|
6180
|
-
return g[
|
|
5932
|
+
return g[PA];
|
|
6181
5933
|
}
|
|
6182
5934
|
function SE(g, A) {
|
|
6183
5935
|
let { configuration: I } = A.codecs.find(oE) ?? {}, B = {
|
|
@@ -6197,7 +5949,7 @@ function SE(g, A) {
|
|
|
6197
5949
|
codecs: I.codecs
|
|
6198
5950
|
}),
|
|
6199
5951
|
get_strides(E) {
|
|
6200
|
-
return
|
|
5952
|
+
return cA(E, Q);
|
|
6201
5953
|
},
|
|
6202
5954
|
get_chunk_bytes: FE(g, A.chunk_grid.configuration.chunk_shape, B.encode_chunk_key, I)
|
|
6203
5955
|
};
|
|
@@ -6213,7 +5965,7 @@ function SE(g, A) {
|
|
|
6213
5965
|
codecs: A.codecs
|
|
6214
5966
|
}),
|
|
6215
5967
|
get_strides(Q) {
|
|
6216
|
-
return
|
|
5968
|
+
return cA(Q, C);
|
|
6217
5969
|
},
|
|
6218
5970
|
async get_chunk_bytes(Q, E) {
|
|
6219
5971
|
let i = B.encode_chunk_key(Q), o = g.resolve(i).path;
|
|
@@ -6221,15 +5973,15 @@ function SE(g, A) {
|
|
|
6221
5973
|
}
|
|
6222
5974
|
};
|
|
6223
5975
|
}
|
|
6224
|
-
let JI = class extends
|
|
5976
|
+
let JI = class extends j {
|
|
6225
5977
|
kind = "array";
|
|
6226
5978
|
#A;
|
|
6227
|
-
[
|
|
5979
|
+
[PA];
|
|
6228
5980
|
constructor(A, I, B) {
|
|
6229
5981
|
super(A, I), this.#A = {
|
|
6230
5982
|
...B,
|
|
6231
5983
|
fill_value: bB(B)
|
|
6232
|
-
}, this[
|
|
5984
|
+
}, this[PA] = SE(this, B);
|
|
6233
5985
|
}
|
|
6234
5986
|
get attrs() {
|
|
6235
5987
|
return this.#A.attributes;
|
|
@@ -6238,13 +5990,13 @@ let JI = class extends z {
|
|
|
6238
5990
|
return this.#A.shape;
|
|
6239
5991
|
}
|
|
6240
5992
|
get chunks() {
|
|
6241
|
-
return this[
|
|
5993
|
+
return this[PA].chunk_shape;
|
|
6242
5994
|
}
|
|
6243
5995
|
get dtype() {
|
|
6244
5996
|
return this.#A.data_type;
|
|
6245
5997
|
}
|
|
6246
5998
|
async getChunk(A, I) {
|
|
6247
|
-
let B = this[
|
|
5999
|
+
let B = this[PA], C = await B.get_chunk_bytes(A, I);
|
|
6248
6000
|
if (!C) {
|
|
6249
6001
|
let Q = B.chunk_shape.reduce((i, o) => i * o, 1), E = new B.TypedArray(Q);
|
|
6250
6002
|
return E.fill(B.fill_value), {
|
|
@@ -6567,50 +6319,50 @@ function TE() {
|
|
|
6567
6319
|
}
|
|
6568
6320
|
async function xE(g) {
|
|
6569
6321
|
let A = await g.store.get(g.resolve(".zattrs").path);
|
|
6570
|
-
return A ?
|
|
6322
|
+
return A ? eI(A) : {};
|
|
6571
6323
|
}
|
|
6572
6324
|
async function WE(g, A = {}) {
|
|
6573
|
-
let I = "store" in g ? g : new
|
|
6574
|
-
return (A.attrs ?? !0) && (B = await xE(I)), A.kind === "array" ? FB(I, B) : A.kind === "group" ? rB(I, B) : FB(I, B).catch((C) => (ZB(C,
|
|
6325
|
+
let I = "store" in g ? g : new j(g), B = {};
|
|
6326
|
+
return (A.attrs ?? !0) && (B = await xE(I)), A.kind === "array" ? FB(I, B) : A.kind === "group" ? rB(I, B) : FB(I, B).catch((C) => (ZB(C, GI), rB(I, B)));
|
|
6575
6327
|
}
|
|
6576
6328
|
async function FB(g, A) {
|
|
6577
6329
|
let { path: I } = g.resolve(".zarray"), B = await g.store.get(I);
|
|
6578
6330
|
if (!B)
|
|
6579
|
-
throw new
|
|
6331
|
+
throw new GI("v2 array", {
|
|
6580
6332
|
cause: new dg(I)
|
|
6581
6333
|
});
|
|
6582
|
-
return WI.increment(g.store, "v2"), new JI(g.store, g.path, QE(
|
|
6334
|
+
return WI.increment(g.store, "v2"), new JI(g.store, g.path, QE(eI(B), A));
|
|
6583
6335
|
}
|
|
6584
6336
|
async function rB(g, A) {
|
|
6585
6337
|
let { path: I } = g.resolve(".zgroup"), B = await g.store.get(I);
|
|
6586
6338
|
if (!B)
|
|
6587
|
-
throw new
|
|
6339
|
+
throw new GI("v2 group", {
|
|
6588
6340
|
cause: new dg(I)
|
|
6589
6341
|
});
|
|
6590
|
-
return WI.increment(g.store, "v2"), new Mg(g.store, g.path, EE(
|
|
6342
|
+
return WI.increment(g.store, "v2"), new Mg(g.store, g.path, EE(eI(B), A));
|
|
6591
6343
|
}
|
|
6592
6344
|
async function bE(g) {
|
|
6593
6345
|
let { store: A, path: I } = g.resolve("zarr.json"), B = await g.store.get(I);
|
|
6594
6346
|
if (!B)
|
|
6595
|
-
throw new
|
|
6347
|
+
throw new GI("v3 array or group", {
|
|
6596
6348
|
cause: new dg(I)
|
|
6597
6349
|
});
|
|
6598
|
-
let C =
|
|
6350
|
+
let C = eI(B);
|
|
6599
6351
|
return C.node_type === "array" && (C.fill_value = bB(C)), C.node_type === "array" ? new JI(A, g.path, C) : new Mg(A, g.path, C);
|
|
6600
6352
|
}
|
|
6601
6353
|
async function ZE(g, A = {}) {
|
|
6602
|
-
let I = "store" in g ? g : new
|
|
6354
|
+
let I = "store" in g ? g : new j(g), B = await bE(I);
|
|
6603
6355
|
if (WI.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && B instanceof JI || A.kind === "group" && B instanceof Mg)
|
|
6604
6356
|
return B;
|
|
6605
6357
|
let C = B instanceof JI ? "array" : "group";
|
|
6606
6358
|
throw new Error(`Expected node of kind ${A.kind}, found ${C}.`);
|
|
6607
6359
|
}
|
|
6608
|
-
async function
|
|
6609
|
-
let I = "store" in g ? g.store : g, B = WI.version_max(I), C = B === "v2" ?
|
|
6610
|
-
return C(g, A).catch((E) => (ZB(E,
|
|
6360
|
+
async function AA(g, A = {}) {
|
|
6361
|
+
let I = "store" in g ? g.store : g, B = WI.version_max(I), C = B === "v2" ? AA.v2 : AA.v3, Q = B === "v2" ? AA.v3 : AA.v2;
|
|
6362
|
+
return C(g, A).catch((E) => (ZB(E, GI), Q(g, A)));
|
|
6611
6363
|
}
|
|
6612
|
-
|
|
6613
|
-
|
|
6364
|
+
AA.v2 = WE;
|
|
6365
|
+
AA.v3 = ZE;
|
|
6614
6366
|
async function PE(g, A) {
|
|
6615
6367
|
const I = A.split("/"), B = I.pop();
|
|
6616
6368
|
if (!B)
|
|
@@ -6647,7 +6399,7 @@ function OE() {
|
|
|
6647
6399
|
throw new Error(I);
|
|
6648
6400
|
}
|
|
6649
6401
|
}
|
|
6650
|
-
class lg extends
|
|
6402
|
+
class lg extends ZA {
|
|
6651
6403
|
credentials;
|
|
6652
6404
|
region;
|
|
6653
6405
|
// Cache signing keys per date/region combination (valid for 24 hours)
|
|
@@ -6774,21 +6526,21 @@ ${Y}`, L = await this.getSignatureKey(
|
|
|
6774
6526
|
return Array.from(A).map((I) => I.toString(16).padStart(2, "0")).join("");
|
|
6775
6527
|
}
|
|
6776
6528
|
}
|
|
6777
|
-
async function
|
|
6529
|
+
async function nI(g, A) {
|
|
6778
6530
|
if (A === "v2")
|
|
6779
6531
|
try {
|
|
6780
|
-
return
|
|
6532
|
+
return AA.v2(g, { kind: "group", attrs: !0 });
|
|
6781
6533
|
} catch {
|
|
6782
6534
|
throw new Error(`Failed to open Zarr v2 group at ${g}`);
|
|
6783
6535
|
}
|
|
6784
6536
|
if (A === "v3")
|
|
6785
6537
|
try {
|
|
6786
|
-
return
|
|
6538
|
+
return AA.v3(g, { kind: "group" });
|
|
6787
6539
|
} catch {
|
|
6788
6540
|
throw new Error(`Failed to open Zarr v3 group at ${g}`);
|
|
6789
6541
|
}
|
|
6790
6542
|
try {
|
|
6791
|
-
return
|
|
6543
|
+
return AA(g, { kind: "group" });
|
|
6792
6544
|
} catch {
|
|
6793
6545
|
throw new Error(`Failed to open Zarr group at ${g}`);
|
|
6794
6546
|
}
|
|
@@ -6796,18 +6548,18 @@ async function wI(g, A) {
|
|
|
6796
6548
|
async function VE(g, A) {
|
|
6797
6549
|
if (A === "v2")
|
|
6798
6550
|
try {
|
|
6799
|
-
return
|
|
6551
|
+
return AA.v2(g, { kind: "array", attrs: !1 });
|
|
6800
6552
|
} catch {
|
|
6801
6553
|
throw new Error(`Failed to open Zarr v2 array at ${g}`);
|
|
6802
6554
|
}
|
|
6803
6555
|
if (A === "v3")
|
|
6804
6556
|
try {
|
|
6805
|
-
return
|
|
6557
|
+
return AA.v3(g, { kind: "array" });
|
|
6806
6558
|
} catch {
|
|
6807
6559
|
throw new Error(`Failed to open Zarr v3 array at ${g}`);
|
|
6808
6560
|
}
|
|
6809
6561
|
try {
|
|
6810
|
-
return
|
|
6562
|
+
return AA(g, { kind: "array" });
|
|
6811
6563
|
} catch {
|
|
6812
6564
|
throw new Error(`Failed to open Zarr array at ${g}`);
|
|
6813
6565
|
}
|
|
@@ -6816,17 +6568,17 @@ async function vE(g) {
|
|
|
6816
6568
|
let A;
|
|
6817
6569
|
switch (g.type) {
|
|
6818
6570
|
case "fetch": {
|
|
6819
|
-
const B = new
|
|
6820
|
-
A = new
|
|
6571
|
+
const B = new ZA(g.url);
|
|
6572
|
+
A = new j(B);
|
|
6821
6573
|
break;
|
|
6822
6574
|
}
|
|
6823
6575
|
case "s3": {
|
|
6824
6576
|
const B = new lg(g);
|
|
6825
|
-
A = new
|
|
6577
|
+
A = new j(B);
|
|
6826
6578
|
break;
|
|
6827
6579
|
}
|
|
6828
6580
|
case "filesystem": {
|
|
6829
|
-
A = new
|
|
6581
|
+
A = new j(
|
|
6830
6582
|
new qg(g.directoryHandle),
|
|
6831
6583
|
g.path
|
|
6832
6584
|
);
|
|
@@ -6852,7 +6604,7 @@ function XE(g, A, I) {
|
|
|
6852
6604
|
overrides: g.store.overrides,
|
|
6853
6605
|
useSuffixRequest: g.store.useSuffixRequest
|
|
6854
6606
|
};
|
|
6855
|
-
if (g.store instanceof
|
|
6607
|
+
if (g.store instanceof ZA)
|
|
6856
6608
|
return {
|
|
6857
6609
|
type: "fetch",
|
|
6858
6610
|
arrayPath: A,
|
|
@@ -10037,17 +9789,17 @@ function jE(g) {
|
|
|
10037
9789
|
}
|
|
10038
9790
|
}
|
|
10039
9791
|
const zE = Math.min(navigator.hardwareConcurrency, 8);
|
|
10040
|
-
let
|
|
10041
|
-
const
|
|
9792
|
+
let BA = [], _E = 0, vB = 0;
|
|
9793
|
+
const UA = /* @__PURE__ */ new Map(), dI = /* @__PURE__ */ new Set();
|
|
10042
9794
|
function XB(g) {
|
|
10043
|
-
const A =
|
|
9795
|
+
const A = BA.find((I) => I.worker === g);
|
|
10044
9796
|
return A || U.error(
|
|
10045
9797
|
"ZarrWorker",
|
|
10046
9798
|
"Worker not found in pool - this should not happen"
|
|
10047
9799
|
), A;
|
|
10048
9800
|
}
|
|
10049
9801
|
function $E(g, A) {
|
|
10050
|
-
const { id: I, success: B } = g.data, C =
|
|
9802
|
+
const { id: I, success: B } = g.data, C = UA.get(I);
|
|
10051
9803
|
if (!C) {
|
|
10052
9804
|
dI.has(I) ? dI.delete(I) : U.warn(
|
|
10053
9805
|
"ZarrWorker",
|
|
@@ -10056,7 +9808,7 @@ function $E(g, A) {
|
|
|
10056
9808
|
);
|
|
10057
9809
|
return;
|
|
10058
9810
|
}
|
|
10059
|
-
|
|
9811
|
+
UA.delete(I), C.abortListener && C.abortSignal && C.abortSignal.removeEventListener("abort", C.abortListener);
|
|
10060
9812
|
const Q = XB(A);
|
|
10061
9813
|
Q && Q.pendingCount > 0 ? Q.pendingCount-- : Q && U.error(
|
|
10062
9814
|
"ZarrWorker",
|
|
@@ -10078,16 +9830,16 @@ function RB(g, A) {
|
|
|
10078
9830
|
);
|
|
10079
9831
|
const I = XB(A);
|
|
10080
9832
|
if (I) {
|
|
10081
|
-
const C =
|
|
10082
|
-
|
|
9833
|
+
const C = BA.indexOf(I);
|
|
9834
|
+
BA.splice(C, 1);
|
|
10083
9835
|
}
|
|
10084
9836
|
const B = I?.workerId;
|
|
10085
9837
|
if (B !== void 0)
|
|
10086
|
-
for (const [C, Q] of
|
|
10087
|
-
Q.workerId === B && (Q.reject(new Error(`Worker error: ${g.message}`)),
|
|
9838
|
+
for (const [C, Q] of UA.entries())
|
|
9839
|
+
Q.workerId === B && (Q.reject(new Error(`Worker error: ${g.message}`)), UA.delete(C));
|
|
10088
9840
|
try {
|
|
10089
9841
|
const C = jB();
|
|
10090
|
-
|
|
9842
|
+
BA.push({
|
|
10091
9843
|
worker: C,
|
|
10092
9844
|
pendingCount: 0,
|
|
10093
9845
|
workerId: vB++
|
|
@@ -10104,9 +9856,9 @@ function jB() {
|
|
|
10104
9856
|
), g;
|
|
10105
9857
|
}
|
|
10106
9858
|
function Ai() {
|
|
10107
|
-
if (
|
|
9859
|
+
if (BA.length === 0)
|
|
10108
9860
|
throw new Error("Worker pool is not initialized");
|
|
10109
|
-
return
|
|
9861
|
+
return BA.sort((g, A) => g.pendingCount - A.pendingCount)[0];
|
|
10110
9862
|
}
|
|
10111
9863
|
async function Ii(g, A, I) {
|
|
10112
9864
|
return new Promise((B, C) => {
|
|
@@ -10115,12 +9867,12 @@ async function Ii(g, A, I) {
|
|
|
10115
9867
|
reject: C,
|
|
10116
9868
|
workerId: Q.workerId
|
|
10117
9869
|
};
|
|
10118
|
-
if (
|
|
9870
|
+
if (UA.set(E, i), I?.signal) {
|
|
10119
9871
|
const o = () => {
|
|
10120
9872
|
Q.worker.postMessage({
|
|
10121
9873
|
id: E,
|
|
10122
9874
|
type: "cancel"
|
|
10123
|
-
}),
|
|
9875
|
+
}), UA.delete(E), dI.add(E), Q.pendingCount--, C(new DOMException("Operation was aborted", "AbortError"));
|
|
10124
9876
|
};
|
|
10125
9877
|
if (I.signal.aborted) {
|
|
10126
9878
|
o(), dI.delete(E);
|
|
@@ -10137,11 +9889,11 @@ async function Ii(g, A, I) {
|
|
|
10137
9889
|
});
|
|
10138
9890
|
}
|
|
10139
9891
|
function gi() {
|
|
10140
|
-
if (!(
|
|
9892
|
+
if (!(BA.length > 0))
|
|
10141
9893
|
try {
|
|
10142
9894
|
for (let g = 0; g < zE; g++) {
|
|
10143
9895
|
const A = jB();
|
|
10144
|
-
|
|
9896
|
+
BA.push({
|
|
10145
9897
|
worker: A,
|
|
10146
9898
|
pendingCount: 0,
|
|
10147
9899
|
workerId: vB++
|
|
@@ -10149,7 +9901,7 @@ function gi() {
|
|
|
10149
9901
|
}
|
|
10150
9902
|
U.debug(
|
|
10151
9903
|
"ZarrWorker",
|
|
10152
|
-
`Initialized worker pool with ${
|
|
9904
|
+
`Initialized worker pool with ${BA.length} workers`
|
|
10153
9905
|
);
|
|
10154
9906
|
} catch {
|
|
10155
9907
|
U.warn("ZarrWorker", "Failed to create workers - clearing pool"), Ci();
|
|
@@ -10167,9 +9919,9 @@ async function Bi(g, A, I, B) {
|
|
|
10167
9919
|
}
|
|
10168
9920
|
}
|
|
10169
9921
|
function Ci() {
|
|
10170
|
-
for (const g of
|
|
9922
|
+
for (const g of BA)
|
|
10171
9923
|
g.worker.terminate();
|
|
10172
|
-
|
|
9924
|
+
BA = [], UA.clear();
|
|
10173
9925
|
}
|
|
10174
9926
|
class Qi {
|
|
10175
9927
|
promises_ = [];
|
|
@@ -10446,7 +10198,7 @@ const S = H.arrayToEnum([
|
|
|
10446
10198
|
"never",
|
|
10447
10199
|
"map",
|
|
10448
10200
|
"set"
|
|
10449
|
-
]),
|
|
10201
|
+
]), hA = (g) => {
|
|
10450
10202
|
switch (typeof g) {
|
|
10451
10203
|
case "undefined":
|
|
10452
10204
|
return S.undefined;
|
|
@@ -10485,7 +10237,7 @@ const S = H.arrayToEnum([
|
|
|
10485
10237
|
"not_multiple_of",
|
|
10486
10238
|
"not_finite"
|
|
10487
10239
|
]), oi = (g) => JSON.stringify(g, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
10488
|
-
class
|
|
10240
|
+
class _ extends Error {
|
|
10489
10241
|
get errors() {
|
|
10490
10242
|
return this.issues;
|
|
10491
10243
|
}
|
|
@@ -10522,7 +10274,7 @@ class $ extends Error {
|
|
|
10522
10274
|
return C(this), B;
|
|
10523
10275
|
}
|
|
10524
10276
|
static assert(A) {
|
|
10525
|
-
if (!(A instanceof
|
|
10277
|
+
if (!(A instanceof _))
|
|
10526
10278
|
throw new Error(`Not a ZodError: ${A}`);
|
|
10527
10279
|
}
|
|
10528
10280
|
toString() {
|
|
@@ -10544,8 +10296,8 @@ class $ extends Error {
|
|
|
10544
10296
|
return this.flatten();
|
|
10545
10297
|
}
|
|
10546
10298
|
}
|
|
10547
|
-
|
|
10548
|
-
const
|
|
10299
|
+
_.create = (g) => new _(g);
|
|
10300
|
+
const mA = (g, A) => {
|
|
10549
10301
|
let I;
|
|
10550
10302
|
switch (g.code) {
|
|
10551
10303
|
case e.invalid_type:
|
|
@@ -10601,7 +10353,7 @@ const uA = (g, A) => {
|
|
|
10601
10353
|
}
|
|
10602
10354
|
return { message: I };
|
|
10603
10355
|
};
|
|
10604
|
-
let _B =
|
|
10356
|
+
let _B = mA;
|
|
10605
10357
|
function ai(g) {
|
|
10606
10358
|
_B = g;
|
|
10607
10359
|
}
|
|
@@ -10641,13 +10393,13 @@ function F(g, A) {
|
|
|
10641
10393
|
// then schema-bound map if available
|
|
10642
10394
|
I,
|
|
10643
10395
|
// then global override map
|
|
10644
|
-
I ===
|
|
10396
|
+
I === mA ? void 0 : mA
|
|
10645
10397
|
// then global default map
|
|
10646
10398
|
].filter((C) => !!C)
|
|
10647
10399
|
});
|
|
10648
10400
|
g.common.issues.push(B);
|
|
10649
10401
|
}
|
|
10650
|
-
class
|
|
10402
|
+
class v {
|
|
10651
10403
|
constructor() {
|
|
10652
10404
|
this.value = "valid";
|
|
10653
10405
|
}
|
|
@@ -10675,7 +10427,7 @@ class X {
|
|
|
10675
10427
|
value: E
|
|
10676
10428
|
});
|
|
10677
10429
|
}
|
|
10678
|
-
return
|
|
10430
|
+
return v.mergeObjectSync(A, B);
|
|
10679
10431
|
}
|
|
10680
10432
|
static mergeObjectSync(A, I) {
|
|
10681
10433
|
const B = {};
|
|
@@ -10690,7 +10442,7 @@ class X {
|
|
|
10690
10442
|
}
|
|
10691
10443
|
const d = Object.freeze({
|
|
10692
10444
|
status: "aborted"
|
|
10693
|
-
}),
|
|
10445
|
+
}), MA = (g) => ({ status: "dirty", value: g }), X = (g) => ({ status: "valid", value: g }), Dg = (g) => g.status === "aborted", hg = (g) => g.status === "dirty", kA = (g) => g.status === "valid", AI = (g) => typeof Promise < "u" && g instanceof Promise;
|
|
10694
10446
|
function HI(g, A, I, B) {
|
|
10695
10447
|
if (typeof A == "function" ? g !== A || !0 : !A.has(g)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10696
10448
|
return A.get(g);
|
|
@@ -10703,8 +10455,8 @@ var N;
|
|
|
10703
10455
|
(function(g) {
|
|
10704
10456
|
g.errToObj = (A) => typeof A == "string" ? { message: A } : A || {}, g.toString = (A) => typeof A == "string" ? A : A?.message;
|
|
10705
10457
|
})(N || (N = {}));
|
|
10706
|
-
var
|
|
10707
|
-
class
|
|
10458
|
+
var OA, VA;
|
|
10459
|
+
class aA {
|
|
10708
10460
|
constructor(A, I, B, C) {
|
|
10709
10461
|
this._cachedPath = [], this.parent = A, this.data = I, this._path = B, this._key = C;
|
|
10710
10462
|
}
|
|
@@ -10713,7 +10465,7 @@ class sA {
|
|
|
10713
10465
|
}
|
|
10714
10466
|
}
|
|
10715
10467
|
const UB = (g, A) => {
|
|
10716
|
-
if (
|
|
10468
|
+
if (kA(A))
|
|
10717
10469
|
return { success: !0, data: A.value };
|
|
10718
10470
|
if (!g.common.issues.length)
|
|
10719
10471
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -10722,7 +10474,7 @@ const UB = (g, A) => {
|
|
|
10722
10474
|
get error() {
|
|
10723
10475
|
if (this._error)
|
|
10724
10476
|
return this._error;
|
|
10725
|
-
const I = new
|
|
10477
|
+
const I = new _(g.common.issues);
|
|
10726
10478
|
return this._error = I, this._error;
|
|
10727
10479
|
}
|
|
10728
10480
|
};
|
|
@@ -10744,13 +10496,13 @@ class K {
|
|
|
10744
10496
|
return this._def.description;
|
|
10745
10497
|
}
|
|
10746
10498
|
_getType(A) {
|
|
10747
|
-
return
|
|
10499
|
+
return hA(A.data);
|
|
10748
10500
|
}
|
|
10749
10501
|
_getOrReturnCtx(A, I) {
|
|
10750
10502
|
return I || {
|
|
10751
10503
|
common: A.parent.common,
|
|
10752
10504
|
data: A.data,
|
|
10753
|
-
parsedType:
|
|
10505
|
+
parsedType: hA(A.data),
|
|
10754
10506
|
schemaErrorMap: this._def.errorMap,
|
|
10755
10507
|
path: A.path,
|
|
10756
10508
|
parent: A.parent
|
|
@@ -10758,11 +10510,11 @@ class K {
|
|
|
10758
10510
|
}
|
|
10759
10511
|
_processInputParams(A) {
|
|
10760
10512
|
return {
|
|
10761
|
-
status: new
|
|
10513
|
+
status: new v(),
|
|
10762
10514
|
ctx: {
|
|
10763
10515
|
common: A.parent.common,
|
|
10764
10516
|
data: A.data,
|
|
10765
|
-
parsedType:
|
|
10517
|
+
parsedType: hA(A.data),
|
|
10766
10518
|
schemaErrorMap: this._def.errorMap,
|
|
10767
10519
|
path: A.path,
|
|
10768
10520
|
parent: A.parent
|
|
@@ -10771,7 +10523,7 @@ class K {
|
|
|
10771
10523
|
}
|
|
10772
10524
|
_parseSync(A) {
|
|
10773
10525
|
const I = this._parse(A);
|
|
10774
|
-
if (
|
|
10526
|
+
if (AI(I))
|
|
10775
10527
|
throw new Error("Synchronous parse encountered promise.");
|
|
10776
10528
|
return I;
|
|
10777
10529
|
}
|
|
@@ -10797,7 +10549,7 @@ class K {
|
|
|
10797
10549
|
schemaErrorMap: this._def.errorMap,
|
|
10798
10550
|
parent: null,
|
|
10799
10551
|
data: A,
|
|
10800
|
-
parsedType:
|
|
10552
|
+
parsedType: hA(A)
|
|
10801
10553
|
}, Q = this._parseSync({ data: A, path: C.path, parent: C });
|
|
10802
10554
|
return UB(C, Q);
|
|
10803
10555
|
}
|
|
@@ -10812,12 +10564,12 @@ class K {
|
|
|
10812
10564
|
schemaErrorMap: this._def.errorMap,
|
|
10813
10565
|
parent: null,
|
|
10814
10566
|
data: A,
|
|
10815
|
-
parsedType:
|
|
10567
|
+
parsedType: hA(A)
|
|
10816
10568
|
};
|
|
10817
10569
|
if (!this["~standard"].async)
|
|
10818
10570
|
try {
|
|
10819
10571
|
const Q = this._parseSync({ data: A, path: [], parent: C });
|
|
10820
|
-
return
|
|
10572
|
+
return kA(Q) ? {
|
|
10821
10573
|
value: Q.value
|
|
10822
10574
|
} : {
|
|
10823
10575
|
issues: C.common.issues
|
|
@@ -10828,7 +10580,7 @@ class K {
|
|
|
10828
10580
|
async: !0
|
|
10829
10581
|
};
|
|
10830
10582
|
}
|
|
10831
|
-
return this._parseAsync({ data: A, path: [], parent: C }).then((Q) =>
|
|
10583
|
+
return this._parseAsync({ data: A, path: [], parent: C }).then((Q) => kA(Q) ? {
|
|
10832
10584
|
value: Q.value
|
|
10833
10585
|
} : {
|
|
10834
10586
|
issues: C.common.issues
|
|
@@ -10851,8 +10603,8 @@ class K {
|
|
|
10851
10603
|
schemaErrorMap: this._def.errorMap,
|
|
10852
10604
|
parent: null,
|
|
10853
10605
|
data: A,
|
|
10854
|
-
parsedType:
|
|
10855
|
-
}, C = this._parse({ data: A, path: B.path, parent: B }), Q = await (
|
|
10606
|
+
parsedType: hA(A)
|
|
10607
|
+
}, C = this._parse({ data: A, path: B.path, parent: B }), Q = await (AI(C) ? C : Promise.resolve(C));
|
|
10856
10608
|
return UB(B, Q);
|
|
10857
10609
|
}
|
|
10858
10610
|
refine(A, I) {
|
|
@@ -10869,7 +10621,7 @@ class K {
|
|
|
10869
10621
|
return this._refinement((B, C) => A(B) ? !0 : (C.addIssue(typeof I == "function" ? I(B, C) : I), !1));
|
|
10870
10622
|
}
|
|
10871
10623
|
_refinement(A) {
|
|
10872
|
-
return new
|
|
10624
|
+
return new QA({
|
|
10873
10625
|
schema: this,
|
|
10874
10626
|
typeName: J.ZodEffects,
|
|
10875
10627
|
effect: { type: "refinement", refinement: A }
|
|
@@ -10886,28 +10638,28 @@ class K {
|
|
|
10886
10638
|
};
|
|
10887
10639
|
}
|
|
10888
10640
|
optional() {
|
|
10889
|
-
return
|
|
10641
|
+
return oA.create(this, this._def);
|
|
10890
10642
|
}
|
|
10891
10643
|
nullable() {
|
|
10892
|
-
return
|
|
10644
|
+
return nA.create(this, this._def);
|
|
10893
10645
|
}
|
|
10894
10646
|
nullish() {
|
|
10895
10647
|
return this.nullable().optional();
|
|
10896
10648
|
}
|
|
10897
10649
|
array() {
|
|
10898
|
-
return
|
|
10650
|
+
return CA.create(this);
|
|
10899
10651
|
}
|
|
10900
10652
|
promise() {
|
|
10901
|
-
return
|
|
10653
|
+
return TA.create(this, this._def);
|
|
10902
10654
|
}
|
|
10903
10655
|
or(A) {
|
|
10904
|
-
return
|
|
10656
|
+
return CI.create([this, A], this._def);
|
|
10905
10657
|
}
|
|
10906
10658
|
and(A) {
|
|
10907
|
-
return
|
|
10659
|
+
return QI.create(this, A, this._def);
|
|
10908
10660
|
}
|
|
10909
10661
|
transform(A) {
|
|
10910
|
-
return new
|
|
10662
|
+
return new QA({
|
|
10911
10663
|
...M(this._def),
|
|
10912
10664
|
schema: this,
|
|
10913
10665
|
typeName: J.ZodEffects,
|
|
@@ -10916,7 +10668,7 @@ class K {
|
|
|
10916
10668
|
}
|
|
10917
10669
|
default(A) {
|
|
10918
10670
|
const I = typeof A == "function" ? A : () => A;
|
|
10919
|
-
return new
|
|
10671
|
+
return new sI({
|
|
10920
10672
|
...M(this._def),
|
|
10921
10673
|
innerType: this,
|
|
10922
10674
|
defaultValue: I,
|
|
@@ -10932,7 +10684,7 @@ class K {
|
|
|
10932
10684
|
}
|
|
10933
10685
|
catch(A) {
|
|
10934
10686
|
const I = typeof A == "function" ? A : () => A;
|
|
10935
|
-
return new
|
|
10687
|
+
return new DI({
|
|
10936
10688
|
...M(this._def),
|
|
10937
10689
|
innerType: this,
|
|
10938
10690
|
catchValue: I,
|
|
@@ -10947,10 +10699,10 @@ class K {
|
|
|
10947
10699
|
});
|
|
10948
10700
|
}
|
|
10949
10701
|
pipe(A) {
|
|
10950
|
-
return
|
|
10702
|
+
return wI.create(this, A);
|
|
10951
10703
|
}
|
|
10952
10704
|
readonly() {
|
|
10953
|
-
return
|
|
10705
|
+
return hI.create(this);
|
|
10954
10706
|
}
|
|
10955
10707
|
isOptional() {
|
|
10956
10708
|
return this.safeParse(void 0).success;
|
|
@@ -10990,7 +10742,7 @@ function Yi(g, A) {
|
|
|
10990
10742
|
function di(g, A) {
|
|
10991
10743
|
return !!((A === "v4" || !A) && Si.test(g) || (A === "v6" || !A) && Ni.test(g));
|
|
10992
10744
|
}
|
|
10993
|
-
class
|
|
10745
|
+
class IA extends K {
|
|
10994
10746
|
_parse(A) {
|
|
10995
10747
|
if (this._def.coerce && (A.data = String(A.data)), this._getType(A) !== S.string) {
|
|
10996
10748
|
const Q = this._getOrReturnCtx(A);
|
|
@@ -11000,7 +10752,7 @@ class gA extends K {
|
|
|
11000
10752
|
received: Q.parsedType
|
|
11001
10753
|
}), d;
|
|
11002
10754
|
}
|
|
11003
|
-
const B = new
|
|
10755
|
+
const B = new v();
|
|
11004
10756
|
let C;
|
|
11005
10757
|
for (const Q of this._def.checks)
|
|
11006
10758
|
if (Q.kind === "min")
|
|
@@ -11153,7 +10905,7 @@ class gA extends K {
|
|
|
11153
10905
|
});
|
|
11154
10906
|
}
|
|
11155
10907
|
_addCheck(A) {
|
|
11156
|
-
return new
|
|
10908
|
+
return new IA({
|
|
11157
10909
|
...this._def,
|
|
11158
10910
|
checks: [...this._def.checks, A]
|
|
11159
10911
|
});
|
|
@@ -11290,19 +11042,19 @@ class gA extends K {
|
|
|
11290
11042
|
return this.min(1, N.errToObj(A));
|
|
11291
11043
|
}
|
|
11292
11044
|
trim() {
|
|
11293
|
-
return new
|
|
11045
|
+
return new IA({
|
|
11294
11046
|
...this._def,
|
|
11295
11047
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
11296
11048
|
});
|
|
11297
11049
|
}
|
|
11298
11050
|
toLowerCase() {
|
|
11299
|
-
return new
|
|
11051
|
+
return new IA({
|
|
11300
11052
|
...this._def,
|
|
11301
11053
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
11302
11054
|
});
|
|
11303
11055
|
}
|
|
11304
11056
|
toUpperCase() {
|
|
11305
|
-
return new
|
|
11057
|
+
return new IA({
|
|
11306
11058
|
...this._def,
|
|
11307
11059
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
11308
11060
|
});
|
|
@@ -11368,9 +11120,9 @@ class gA extends K {
|
|
|
11368
11120
|
return A;
|
|
11369
11121
|
}
|
|
11370
11122
|
}
|
|
11371
|
-
|
|
11123
|
+
IA.create = (g) => {
|
|
11372
11124
|
var A;
|
|
11373
|
-
return new
|
|
11125
|
+
return new IA({
|
|
11374
11126
|
checks: [],
|
|
11375
11127
|
typeName: J.ZodString,
|
|
11376
11128
|
coerce: (A = g?.coerce) !== null && A !== void 0 ? A : !1,
|
|
@@ -11381,7 +11133,7 @@ function Mi(g, A) {
|
|
|
11381
11133
|
const I = (g.toString().split(".")[1] || "").length, B = (A.toString().split(".")[1] || "").length, C = I > B ? I : B, Q = parseInt(g.toFixed(C).replace(".", "")), E = parseInt(A.toFixed(C).replace(".", ""));
|
|
11382
11134
|
return Q % E / Math.pow(10, C);
|
|
11383
11135
|
}
|
|
11384
|
-
class
|
|
11136
|
+
class yA extends K {
|
|
11385
11137
|
constructor() {
|
|
11386
11138
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
11387
11139
|
}
|
|
@@ -11395,7 +11147,7 @@ class eA extends K {
|
|
|
11395
11147
|
}), d;
|
|
11396
11148
|
}
|
|
11397
11149
|
let B;
|
|
11398
|
-
const C = new
|
|
11150
|
+
const C = new v();
|
|
11399
11151
|
for (const Q of this._def.checks)
|
|
11400
11152
|
Q.kind === "int" ? H.isInteger(A.data) || (B = this._getOrReturnCtx(A, B), F(B, {
|
|
11401
11153
|
code: e.invalid_type,
|
|
@@ -11439,7 +11191,7 @@ class eA extends K {
|
|
|
11439
11191
|
return this.setLimit("max", A, !1, N.toString(I));
|
|
11440
11192
|
}
|
|
11441
11193
|
setLimit(A, I, B, C) {
|
|
11442
|
-
return new
|
|
11194
|
+
return new yA({
|
|
11443
11195
|
...this._def,
|
|
11444
11196
|
checks: [
|
|
11445
11197
|
...this._def.checks,
|
|
@@ -11453,7 +11205,7 @@ class eA extends K {
|
|
|
11453
11205
|
});
|
|
11454
11206
|
}
|
|
11455
11207
|
_addCheck(A) {
|
|
11456
|
-
return new
|
|
11208
|
+
return new yA({
|
|
11457
11209
|
...this._def,
|
|
11458
11210
|
checks: [...this._def.checks, A]
|
|
11459
11211
|
});
|
|
@@ -11547,13 +11299,13 @@ class eA extends K {
|
|
|
11547
11299
|
return Number.isFinite(I) && Number.isFinite(A);
|
|
11548
11300
|
}
|
|
11549
11301
|
}
|
|
11550
|
-
|
|
11302
|
+
yA.create = (g) => new yA({
|
|
11551
11303
|
checks: [],
|
|
11552
11304
|
typeName: J.ZodNumber,
|
|
11553
11305
|
coerce: g?.coerce || !1,
|
|
11554
11306
|
...M(g)
|
|
11555
11307
|
});
|
|
11556
|
-
class
|
|
11308
|
+
class eA extends K {
|
|
11557
11309
|
constructor() {
|
|
11558
11310
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
11559
11311
|
}
|
|
@@ -11567,7 +11319,7 @@ class GA extends K {
|
|
|
11567
11319
|
if (this._getType(A) !== S.bigint)
|
|
11568
11320
|
return this._getInvalidInput(A);
|
|
11569
11321
|
let B;
|
|
11570
|
-
const C = new
|
|
11322
|
+
const C = new v();
|
|
11571
11323
|
for (const Q of this._def.checks)
|
|
11572
11324
|
Q.kind === "min" ? (Q.inclusive ? A.data < Q.value : A.data <= Q.value) && (B = this._getOrReturnCtx(A, B), F(B, {
|
|
11573
11325
|
code: e.too_small,
|
|
@@ -11609,7 +11361,7 @@ class GA extends K {
|
|
|
11609
11361
|
return this.setLimit("max", A, !1, N.toString(I));
|
|
11610
11362
|
}
|
|
11611
11363
|
setLimit(A, I, B, C) {
|
|
11612
|
-
return new
|
|
11364
|
+
return new eA({
|
|
11613
11365
|
...this._def,
|
|
11614
11366
|
checks: [
|
|
11615
11367
|
...this._def.checks,
|
|
@@ -11623,7 +11375,7 @@ class GA extends K {
|
|
|
11623
11375
|
});
|
|
11624
11376
|
}
|
|
11625
11377
|
_addCheck(A) {
|
|
11626
|
-
return new
|
|
11378
|
+
return new eA({
|
|
11627
11379
|
...this._def,
|
|
11628
11380
|
checks: [...this._def.checks, A]
|
|
11629
11381
|
});
|
|
@@ -11680,16 +11432,16 @@ class GA extends K {
|
|
|
11680
11432
|
return A;
|
|
11681
11433
|
}
|
|
11682
11434
|
}
|
|
11683
|
-
|
|
11435
|
+
eA.create = (g) => {
|
|
11684
11436
|
var A;
|
|
11685
|
-
return new
|
|
11437
|
+
return new eA({
|
|
11686
11438
|
checks: [],
|
|
11687
11439
|
typeName: J.ZodBigInt,
|
|
11688
11440
|
coerce: (A = g?.coerce) !== null && A !== void 0 ? A : !1,
|
|
11689
11441
|
...M(g)
|
|
11690
11442
|
});
|
|
11691
11443
|
};
|
|
11692
|
-
class
|
|
11444
|
+
class II extends K {
|
|
11693
11445
|
_parse(A) {
|
|
11694
11446
|
if (this._def.coerce && (A.data = !!A.data), this._getType(A) !== S.boolean) {
|
|
11695
11447
|
const B = this._getOrReturnCtx(A);
|
|
@@ -11699,15 +11451,15 @@ class gI extends K {
|
|
|
11699
11451
|
received: B.parsedType
|
|
11700
11452
|
}), d;
|
|
11701
11453
|
}
|
|
11702
|
-
return
|
|
11454
|
+
return X(A.data);
|
|
11703
11455
|
}
|
|
11704
11456
|
}
|
|
11705
|
-
|
|
11457
|
+
II.create = (g) => new II({
|
|
11706
11458
|
typeName: J.ZodBoolean,
|
|
11707
11459
|
coerce: g?.coerce || !1,
|
|
11708
11460
|
...M(g)
|
|
11709
11461
|
});
|
|
11710
|
-
class
|
|
11462
|
+
class LA extends K {
|
|
11711
11463
|
_parse(A) {
|
|
11712
11464
|
if (this._def.coerce && (A.data = new Date(A.data)), this._getType(A) !== S.date) {
|
|
11713
11465
|
const Q = this._getOrReturnCtx(A);
|
|
@@ -11723,7 +11475,7 @@ class JA extends K {
|
|
|
11723
11475
|
code: e.invalid_date
|
|
11724
11476
|
}), d;
|
|
11725
11477
|
}
|
|
11726
|
-
const B = new
|
|
11478
|
+
const B = new v();
|
|
11727
11479
|
let C;
|
|
11728
11480
|
for (const Q of this._def.checks)
|
|
11729
11481
|
Q.kind === "min" ? A.data.getTime() < Q.value && (C = this._getOrReturnCtx(A, C), F(C, {
|
|
@@ -11747,7 +11499,7 @@ class JA extends K {
|
|
|
11747
11499
|
};
|
|
11748
11500
|
}
|
|
11749
11501
|
_addCheck(A) {
|
|
11750
|
-
return new
|
|
11502
|
+
return new LA({
|
|
11751
11503
|
...this._def,
|
|
11752
11504
|
checks: [...this._def.checks, A]
|
|
11753
11505
|
});
|
|
@@ -11779,7 +11531,7 @@ class JA extends K {
|
|
|
11779
11531
|
return A != null ? new Date(A) : null;
|
|
11780
11532
|
}
|
|
11781
11533
|
}
|
|
11782
|
-
|
|
11534
|
+
LA.create = (g) => new LA({
|
|
11783
11535
|
checks: [],
|
|
11784
11536
|
coerce: g?.coerce || !1,
|
|
11785
11537
|
typeName: J.ZodDate,
|
|
@@ -11795,14 +11547,14 @@ class qI extends K {
|
|
|
11795
11547
|
received: B.parsedType
|
|
11796
11548
|
}), d;
|
|
11797
11549
|
}
|
|
11798
|
-
return
|
|
11550
|
+
return X(A.data);
|
|
11799
11551
|
}
|
|
11800
11552
|
}
|
|
11801
11553
|
qI.create = (g) => new qI({
|
|
11802
11554
|
typeName: J.ZodSymbol,
|
|
11803
11555
|
...M(g)
|
|
11804
11556
|
});
|
|
11805
|
-
class
|
|
11557
|
+
class gI extends K {
|
|
11806
11558
|
_parse(A) {
|
|
11807
11559
|
if (this._getType(A) !== S.undefined) {
|
|
11808
11560
|
const B = this._getOrReturnCtx(A);
|
|
@@ -11812,14 +11564,14 @@ class BI extends K {
|
|
|
11812
11564
|
received: B.parsedType
|
|
11813
11565
|
}), d;
|
|
11814
11566
|
}
|
|
11815
|
-
return
|
|
11567
|
+
return X(A.data);
|
|
11816
11568
|
}
|
|
11817
11569
|
}
|
|
11818
|
-
|
|
11570
|
+
gI.create = (g) => new gI({
|
|
11819
11571
|
typeName: J.ZodUndefined,
|
|
11820
11572
|
...M(g)
|
|
11821
11573
|
});
|
|
11822
|
-
class
|
|
11574
|
+
class BI extends K {
|
|
11823
11575
|
_parse(A) {
|
|
11824
11576
|
if (this._getType(A) !== S.null) {
|
|
11825
11577
|
const B = this._getOrReturnCtx(A);
|
|
@@ -11829,38 +11581,38 @@ class CI extends K {
|
|
|
11829
11581
|
received: B.parsedType
|
|
11830
11582
|
}), d;
|
|
11831
11583
|
}
|
|
11832
|
-
return
|
|
11584
|
+
return X(A.data);
|
|
11833
11585
|
}
|
|
11834
11586
|
}
|
|
11835
|
-
|
|
11587
|
+
BI.create = (g) => new BI({
|
|
11836
11588
|
typeName: J.ZodNull,
|
|
11837
11589
|
...M(g)
|
|
11838
11590
|
});
|
|
11839
|
-
class
|
|
11591
|
+
class uA extends K {
|
|
11840
11592
|
constructor() {
|
|
11841
11593
|
super(...arguments), this._any = !0;
|
|
11842
11594
|
}
|
|
11843
11595
|
_parse(A) {
|
|
11844
|
-
return
|
|
11596
|
+
return X(A.data);
|
|
11845
11597
|
}
|
|
11846
11598
|
}
|
|
11847
|
-
|
|
11599
|
+
uA.create = (g) => new uA({
|
|
11848
11600
|
typeName: J.ZodAny,
|
|
11849
11601
|
...M(g)
|
|
11850
11602
|
});
|
|
11851
|
-
class
|
|
11603
|
+
class RA extends K {
|
|
11852
11604
|
constructor() {
|
|
11853
11605
|
super(...arguments), this._unknown = !0;
|
|
11854
11606
|
}
|
|
11855
11607
|
_parse(A) {
|
|
11856
|
-
return
|
|
11608
|
+
return X(A.data);
|
|
11857
11609
|
}
|
|
11858
11610
|
}
|
|
11859
|
-
|
|
11611
|
+
RA.create = (g) => new RA({
|
|
11860
11612
|
typeName: J.ZodUnknown,
|
|
11861
11613
|
...M(g)
|
|
11862
11614
|
});
|
|
11863
|
-
class
|
|
11615
|
+
class tA extends K {
|
|
11864
11616
|
_parse(A) {
|
|
11865
11617
|
const I = this._getOrReturnCtx(A);
|
|
11866
11618
|
return F(I, {
|
|
@@ -11870,7 +11622,7 @@ class yA extends K {
|
|
|
11870
11622
|
}), d;
|
|
11871
11623
|
}
|
|
11872
11624
|
}
|
|
11873
|
-
|
|
11625
|
+
tA.create = (g) => new tA({
|
|
11874
11626
|
typeName: J.ZodNever,
|
|
11875
11627
|
...M(g)
|
|
11876
11628
|
});
|
|
@@ -11884,14 +11636,14 @@ class lI extends K {
|
|
|
11884
11636
|
received: B.parsedType
|
|
11885
11637
|
}), d;
|
|
11886
11638
|
}
|
|
11887
|
-
return
|
|
11639
|
+
return X(A.data);
|
|
11888
11640
|
}
|
|
11889
11641
|
}
|
|
11890
11642
|
lI.create = (g) => new lI({
|
|
11891
11643
|
typeName: J.ZodVoid,
|
|
11892
11644
|
...M(g)
|
|
11893
11645
|
});
|
|
11894
|
-
class
|
|
11646
|
+
class CA extends K {
|
|
11895
11647
|
_parse(A) {
|
|
11896
11648
|
const { ctx: I, status: B } = this._processInputParams(A), C = this._def;
|
|
11897
11649
|
if (I.parsedType !== S.array)
|
|
@@ -11927,27 +11679,27 @@ class QA extends K {
|
|
|
11927
11679
|
exact: !1,
|
|
11928
11680
|
message: C.maxLength.message
|
|
11929
11681
|
}), B.dirty()), I.common.async)
|
|
11930
|
-
return Promise.all([...I.data].map((E, i) => C.type._parseAsync(new
|
|
11931
|
-
const Q = [...I.data].map((E, i) => C.type._parseSync(new
|
|
11932
|
-
return
|
|
11682
|
+
return Promise.all([...I.data].map((E, i) => C.type._parseAsync(new aA(I, E, I.path, i)))).then((E) => v.mergeArray(B, E));
|
|
11683
|
+
const Q = [...I.data].map((E, i) => C.type._parseSync(new aA(I, E, I.path, i)));
|
|
11684
|
+
return v.mergeArray(B, Q);
|
|
11933
11685
|
}
|
|
11934
11686
|
get element() {
|
|
11935
11687
|
return this._def.type;
|
|
11936
11688
|
}
|
|
11937
11689
|
min(A, I) {
|
|
11938
|
-
return new
|
|
11690
|
+
return new CA({
|
|
11939
11691
|
...this._def,
|
|
11940
11692
|
minLength: { value: A, message: N.toString(I) }
|
|
11941
11693
|
});
|
|
11942
11694
|
}
|
|
11943
11695
|
max(A, I) {
|
|
11944
|
-
return new
|
|
11696
|
+
return new CA({
|
|
11945
11697
|
...this._def,
|
|
11946
11698
|
maxLength: { value: A, message: N.toString(I) }
|
|
11947
11699
|
});
|
|
11948
11700
|
}
|
|
11949
11701
|
length(A, I) {
|
|
11950
|
-
return new
|
|
11702
|
+
return new CA({
|
|
11951
11703
|
...this._def,
|
|
11952
11704
|
exactLength: { value: A, message: N.toString(I) }
|
|
11953
11705
|
});
|
|
@@ -11956,7 +11708,7 @@ class QA extends K {
|
|
|
11956
11708
|
return this.min(1, A);
|
|
11957
11709
|
}
|
|
11958
11710
|
}
|
|
11959
|
-
|
|
11711
|
+
CA.create = (g, A) => new CA({
|
|
11960
11712
|
type: g,
|
|
11961
11713
|
minLength: null,
|
|
11962
11714
|
maxLength: null,
|
|
@@ -11964,21 +11716,21 @@ QA.create = (g, A) => new QA({
|
|
|
11964
11716
|
typeName: J.ZodArray,
|
|
11965
11717
|
...M(A)
|
|
11966
11718
|
});
|
|
11967
|
-
function
|
|
11719
|
+
function dA(g) {
|
|
11968
11720
|
if (g instanceof u) {
|
|
11969
11721
|
const A = {};
|
|
11970
11722
|
for (const I in g.shape) {
|
|
11971
11723
|
const B = g.shape[I];
|
|
11972
|
-
A[I] =
|
|
11724
|
+
A[I] = oA.create(dA(B));
|
|
11973
11725
|
}
|
|
11974
11726
|
return new u({
|
|
11975
11727
|
...g._def,
|
|
11976
11728
|
shape: () => A
|
|
11977
11729
|
});
|
|
11978
|
-
} else return g instanceof
|
|
11730
|
+
} else return g instanceof CA ? new CA({
|
|
11979
11731
|
...g._def,
|
|
11980
|
-
type:
|
|
11981
|
-
}) : g instanceof
|
|
11732
|
+
type: dA(g.element)
|
|
11733
|
+
}) : g instanceof oA ? oA.create(dA(g.unwrap())) : g instanceof nA ? nA.create(dA(g.unwrap())) : g instanceof sA ? sA.create(g.items.map((A) => dA(A))) : g;
|
|
11982
11734
|
}
|
|
11983
11735
|
class u extends K {
|
|
11984
11736
|
constructor() {
|
|
@@ -12000,7 +11752,7 @@ class u extends K {
|
|
|
12000
11752
|
}), d;
|
|
12001
11753
|
}
|
|
12002
11754
|
const { status: B, ctx: C } = this._processInputParams(A), { shape: Q, keys: E } = this._getCached(), i = [];
|
|
12003
|
-
if (!(this._def.catchall instanceof
|
|
11755
|
+
if (!(this._def.catchall instanceof tA && this._def.unknownKeys === "strip"))
|
|
12004
11756
|
for (const a in C.data)
|
|
12005
11757
|
E.includes(a) || i.push(a);
|
|
12006
11758
|
const o = [];
|
|
@@ -12008,11 +11760,11 @@ class u extends K {
|
|
|
12008
11760
|
const s = Q[a], h = C.data[a];
|
|
12009
11761
|
o.push({
|
|
12010
11762
|
key: { status: "valid", value: a },
|
|
12011
|
-
value: s._parse(new
|
|
11763
|
+
value: s._parse(new aA(C, h, C.path, a)),
|
|
12012
11764
|
alwaysSet: a in C.data
|
|
12013
11765
|
});
|
|
12014
11766
|
}
|
|
12015
|
-
if (this._def.catchall instanceof
|
|
11767
|
+
if (this._def.catchall instanceof tA) {
|
|
12016
11768
|
const a = this._def.unknownKeys;
|
|
12017
11769
|
if (a === "passthrough")
|
|
12018
11770
|
for (const s of i)
|
|
@@ -12033,7 +11785,7 @@ class u extends K {
|
|
|
12033
11785
|
o.push({
|
|
12034
11786
|
key: { status: "valid", value: s },
|
|
12035
11787
|
value: a._parse(
|
|
12036
|
-
new
|
|
11788
|
+
new aA(C, h, C.path, s)
|
|
12037
11789
|
//, ctx.child(key), value, getParsedType(value)
|
|
12038
11790
|
),
|
|
12039
11791
|
alwaysSet: s in C.data
|
|
@@ -12051,7 +11803,7 @@ class u extends K {
|
|
|
12051
11803
|
});
|
|
12052
11804
|
}
|
|
12053
11805
|
return a;
|
|
12054
|
-
}).then((a) =>
|
|
11806
|
+
}).then((a) => v.mergeObjectSync(B, a)) : v.mergeObjectSync(B, o);
|
|
12055
11807
|
}
|
|
12056
11808
|
get shape() {
|
|
12057
11809
|
return this._def.shape();
|
|
@@ -12214,7 +11966,7 @@ class u extends K {
|
|
|
12214
11966
|
* @deprecated
|
|
12215
11967
|
*/
|
|
12216
11968
|
deepPartial() {
|
|
12217
|
-
return
|
|
11969
|
+
return dA(this);
|
|
12218
11970
|
}
|
|
12219
11971
|
partial(A) {
|
|
12220
11972
|
const I = {};
|
|
@@ -12233,7 +11985,7 @@ class u extends K {
|
|
|
12233
11985
|
I[B] = this.shape[B];
|
|
12234
11986
|
else {
|
|
12235
11987
|
let Q = this.shape[B];
|
|
12236
|
-
for (; Q instanceof
|
|
11988
|
+
for (; Q instanceof oA; )
|
|
12237
11989
|
Q = Q._def.innerType;
|
|
12238
11990
|
I[B] = Q;
|
|
12239
11991
|
}
|
|
@@ -12249,25 +12001,25 @@ class u extends K {
|
|
|
12249
12001
|
u.create = (g, A) => new u({
|
|
12250
12002
|
shape: () => g,
|
|
12251
12003
|
unknownKeys: "strip",
|
|
12252
|
-
catchall:
|
|
12004
|
+
catchall: tA.create(),
|
|
12253
12005
|
typeName: J.ZodObject,
|
|
12254
12006
|
...M(A)
|
|
12255
12007
|
});
|
|
12256
12008
|
u.strictCreate = (g, A) => new u({
|
|
12257
12009
|
shape: () => g,
|
|
12258
12010
|
unknownKeys: "strict",
|
|
12259
|
-
catchall:
|
|
12011
|
+
catchall: tA.create(),
|
|
12260
12012
|
typeName: J.ZodObject,
|
|
12261
12013
|
...M(A)
|
|
12262
12014
|
});
|
|
12263
12015
|
u.lazycreate = (g, A) => new u({
|
|
12264
12016
|
shape: g,
|
|
12265
12017
|
unknownKeys: "strip",
|
|
12266
|
-
catchall:
|
|
12018
|
+
catchall: tA.create(),
|
|
12267
12019
|
typeName: J.ZodObject,
|
|
12268
12020
|
...M(A)
|
|
12269
12021
|
});
|
|
12270
|
-
class
|
|
12022
|
+
class CI extends K {
|
|
12271
12023
|
_parse(A) {
|
|
12272
12024
|
const { ctx: I } = this._processInputParams(A), B = this._def.options;
|
|
12273
12025
|
function C(Q) {
|
|
@@ -12277,7 +12029,7 @@ class QI extends K {
|
|
|
12277
12029
|
for (const i of Q)
|
|
12278
12030
|
if (i.result.status === "dirty")
|
|
12279
12031
|
return I.common.issues.push(...i.ctx.common.issues), i.result;
|
|
12280
|
-
const E = Q.map((i) => new
|
|
12032
|
+
const E = Q.map((i) => new _(i.ctx.common.issues));
|
|
12281
12033
|
return F(I, {
|
|
12282
12034
|
code: e.invalid_union,
|
|
12283
12035
|
unionErrors: E
|
|
@@ -12324,7 +12076,7 @@ class QI extends K {
|
|
|
12324
12076
|
}
|
|
12325
12077
|
if (Q)
|
|
12326
12078
|
return I.common.issues.push(...Q.ctx.common.issues), Q.result;
|
|
12327
|
-
const i = E.map((o) => new
|
|
12079
|
+
const i = E.map((o) => new _(o));
|
|
12328
12080
|
return F(I, {
|
|
12329
12081
|
code: e.invalid_union,
|
|
12330
12082
|
unionErrors: i
|
|
@@ -12335,12 +12087,12 @@ class QI extends K {
|
|
|
12335
12087
|
return this._def.options;
|
|
12336
12088
|
}
|
|
12337
12089
|
}
|
|
12338
|
-
|
|
12090
|
+
CI.create = (g, A) => new CI({
|
|
12339
12091
|
options: g,
|
|
12340
12092
|
typeName: J.ZodUnion,
|
|
12341
12093
|
...M(A)
|
|
12342
12094
|
});
|
|
12343
|
-
const
|
|
12095
|
+
const DA = (g) => g instanceof iI ? DA(g.schema) : g instanceof QA ? DA(g.innerType()) : g instanceof oI ? [g.value] : g instanceof GA ? g.options : g instanceof aI ? H.objectValues(g.enum) : g instanceof sI ? DA(g._def.innerType) : g instanceof gI ? [void 0] : g instanceof BI ? [null] : g instanceof oA ? [void 0, ...DA(g.unwrap())] : g instanceof nA ? [null, ...DA(g.unwrap())] : g instanceof fg || g instanceof hI ? DA(g.unwrap()) : g instanceof DI ? DA(g._def.innerType) : [];
|
|
12344
12096
|
class bI extends K {
|
|
12345
12097
|
_parse(A) {
|
|
12346
12098
|
const { ctx: I } = this._processInputParams(A);
|
|
@@ -12385,7 +12137,7 @@ class bI extends K {
|
|
|
12385
12137
|
static create(A, I, B) {
|
|
12386
12138
|
const C = /* @__PURE__ */ new Map();
|
|
12387
12139
|
for (const Q of I) {
|
|
12388
|
-
const E =
|
|
12140
|
+
const E = DA(Q.shape[A]);
|
|
12389
12141
|
if (!E.length)
|
|
12390
12142
|
throw new Error(`A discriminator value for key \`${A}\` could not be extracted from all schema options`);
|
|
12391
12143
|
for (const i of E) {
|
|
@@ -12404,7 +12156,7 @@ class bI extends K {
|
|
|
12404
12156
|
}
|
|
12405
12157
|
}
|
|
12406
12158
|
function tg(g, A) {
|
|
12407
|
-
const I =
|
|
12159
|
+
const I = hA(g), B = hA(A);
|
|
12408
12160
|
if (g === A)
|
|
12409
12161
|
return { valid: !0, data: g };
|
|
12410
12162
|
if (I === S.object && B === S.object) {
|
|
@@ -12429,7 +12181,7 @@ function tg(g, A) {
|
|
|
12429
12181
|
return { valid: !0, data: C };
|
|
12430
12182
|
} else return I === S.date && B === S.date && +g == +A ? { valid: !0, data: g } : { valid: !1 };
|
|
12431
12183
|
}
|
|
12432
|
-
class
|
|
12184
|
+
class QI extends K {
|
|
12433
12185
|
_parse(A) {
|
|
12434
12186
|
const { status: I, ctx: B } = this._processInputParams(A), C = (Q, E) => {
|
|
12435
12187
|
if (Dg(Q) || Dg(E))
|
|
@@ -12461,13 +12213,13 @@ class EI extends K {
|
|
|
12461
12213
|
}));
|
|
12462
12214
|
}
|
|
12463
12215
|
}
|
|
12464
|
-
|
|
12216
|
+
QI.create = (g, A, I) => new QI({
|
|
12465
12217
|
left: g,
|
|
12466
12218
|
right: A,
|
|
12467
12219
|
typeName: J.ZodIntersection,
|
|
12468
12220
|
...M(I)
|
|
12469
12221
|
});
|
|
12470
|
-
class
|
|
12222
|
+
class sA extends K {
|
|
12471
12223
|
_parse(A) {
|
|
12472
12224
|
const { status: I, ctx: B } = this._processInputParams(A);
|
|
12473
12225
|
if (B.parsedType !== S.array)
|
|
@@ -12493,31 +12245,31 @@ class DA extends K {
|
|
|
12493
12245
|
}), I.dirty());
|
|
12494
12246
|
const Q = [...B.data].map((E, i) => {
|
|
12495
12247
|
const o = this._def.items[i] || this._def.rest;
|
|
12496
|
-
return o ? o._parse(new
|
|
12248
|
+
return o ? o._parse(new aA(B, E, B.path, i)) : null;
|
|
12497
12249
|
}).filter((E) => !!E);
|
|
12498
|
-
return B.common.async ? Promise.all(Q).then((E) =>
|
|
12250
|
+
return B.common.async ? Promise.all(Q).then((E) => v.mergeArray(I, E)) : v.mergeArray(I, Q);
|
|
12499
12251
|
}
|
|
12500
12252
|
get items() {
|
|
12501
12253
|
return this._def.items;
|
|
12502
12254
|
}
|
|
12503
12255
|
rest(A) {
|
|
12504
|
-
return new
|
|
12256
|
+
return new sA({
|
|
12505
12257
|
...this._def,
|
|
12506
12258
|
rest: A
|
|
12507
12259
|
});
|
|
12508
12260
|
}
|
|
12509
12261
|
}
|
|
12510
|
-
|
|
12262
|
+
sA.create = (g, A) => {
|
|
12511
12263
|
if (!Array.isArray(g))
|
|
12512
12264
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
12513
|
-
return new
|
|
12265
|
+
return new sA({
|
|
12514
12266
|
items: g,
|
|
12515
12267
|
typeName: J.ZodTuple,
|
|
12516
12268
|
rest: null,
|
|
12517
12269
|
...M(A)
|
|
12518
12270
|
});
|
|
12519
12271
|
};
|
|
12520
|
-
class
|
|
12272
|
+
class EI extends K {
|
|
12521
12273
|
get keySchema() {
|
|
12522
12274
|
return this._def.keyType;
|
|
12523
12275
|
}
|
|
@@ -12535,23 +12287,23 @@ class iI extends K {
|
|
|
12535
12287
|
const C = [], Q = this._def.keyType, E = this._def.valueType;
|
|
12536
12288
|
for (const i in B.data)
|
|
12537
12289
|
C.push({
|
|
12538
|
-
key: Q._parse(new
|
|
12539
|
-
value: E._parse(new
|
|
12290
|
+
key: Q._parse(new aA(B, i, B.path, i)),
|
|
12291
|
+
value: E._parse(new aA(B, B.data[i], B.path, i)),
|
|
12540
12292
|
alwaysSet: i in B.data
|
|
12541
12293
|
});
|
|
12542
|
-
return B.common.async ?
|
|
12294
|
+
return B.common.async ? v.mergeObjectAsync(I, C) : v.mergeObjectSync(I, C);
|
|
12543
12295
|
}
|
|
12544
12296
|
get element() {
|
|
12545
12297
|
return this._def.valueType;
|
|
12546
12298
|
}
|
|
12547
12299
|
static create(A, I, B) {
|
|
12548
|
-
return I instanceof K ? new
|
|
12300
|
+
return I instanceof K ? new EI({
|
|
12549
12301
|
keyType: A,
|
|
12550
12302
|
valueType: I,
|
|
12551
12303
|
typeName: J.ZodRecord,
|
|
12552
12304
|
...M(B)
|
|
12553
|
-
}) : new
|
|
12554
|
-
keyType:
|
|
12305
|
+
}) : new EI({
|
|
12306
|
+
keyType: IA.create(),
|
|
12555
12307
|
valueType: A,
|
|
12556
12308
|
typeName: J.ZodRecord,
|
|
12557
12309
|
...M(I)
|
|
@@ -12574,8 +12326,8 @@ class fI extends K {
|
|
|
12574
12326
|
received: B.parsedType
|
|
12575
12327
|
}), d;
|
|
12576
12328
|
const C = this._def.keyType, Q = this._def.valueType, E = [...B.data.entries()].map(([i, o], a) => ({
|
|
12577
|
-
key: C._parse(new
|
|
12578
|
-
value: Q._parse(new
|
|
12329
|
+
key: C._parse(new aA(B, i, B.path, [a, "key"])),
|
|
12330
|
+
value: Q._parse(new aA(B, o, B.path, [a, "value"]))
|
|
12579
12331
|
}));
|
|
12580
12332
|
if (B.common.async) {
|
|
12581
12333
|
const i = /* @__PURE__ */ new Map();
|
|
@@ -12606,7 +12358,7 @@ fI.create = (g, A, I) => new fI({
|
|
|
12606
12358
|
typeName: J.ZodMap,
|
|
12607
12359
|
...M(I)
|
|
12608
12360
|
});
|
|
12609
|
-
class
|
|
12361
|
+
class JA extends K {
|
|
12610
12362
|
_parse(A) {
|
|
12611
12363
|
const { status: I, ctx: B } = this._processInputParams(A);
|
|
12612
12364
|
if (B.parsedType !== S.set)
|
|
@@ -12641,17 +12393,17 @@ class YA extends K {
|
|
|
12641
12393
|
}
|
|
12642
12394
|
return { status: I.value, value: a };
|
|
12643
12395
|
}
|
|
12644
|
-
const i = [...B.data.values()].map((o, a) => Q._parse(new
|
|
12396
|
+
const i = [...B.data.values()].map((o, a) => Q._parse(new aA(B, o, B.path, a)));
|
|
12645
12397
|
return B.common.async ? Promise.all(i).then((o) => E(o)) : E(i);
|
|
12646
12398
|
}
|
|
12647
12399
|
min(A, I) {
|
|
12648
|
-
return new
|
|
12400
|
+
return new JA({
|
|
12649
12401
|
...this._def,
|
|
12650
12402
|
minSize: { value: A, message: N.toString(I) }
|
|
12651
12403
|
});
|
|
12652
12404
|
}
|
|
12653
12405
|
max(A, I) {
|
|
12654
|
-
return new
|
|
12406
|
+
return new JA({
|
|
12655
12407
|
...this._def,
|
|
12656
12408
|
maxSize: { value: A, message: N.toString(I) }
|
|
12657
12409
|
});
|
|
@@ -12663,14 +12415,14 @@ class YA extends K {
|
|
|
12663
12415
|
return this.min(1, A);
|
|
12664
12416
|
}
|
|
12665
12417
|
}
|
|
12666
|
-
|
|
12418
|
+
JA.create = (g, A) => new JA({
|
|
12667
12419
|
valueType: g,
|
|
12668
12420
|
minSize: null,
|
|
12669
12421
|
maxSize: null,
|
|
12670
12422
|
typeName: J.ZodSet,
|
|
12671
12423
|
...M(A)
|
|
12672
12424
|
});
|
|
12673
|
-
class
|
|
12425
|
+
class HA extends K {
|
|
12674
12426
|
constructor() {
|
|
12675
12427
|
super(...arguments), this.validate = this.implement;
|
|
12676
12428
|
}
|
|
@@ -12690,7 +12442,7 @@ class qA extends K {
|
|
|
12690
12442
|
I.common.contextualErrorMap,
|
|
12691
12443
|
I.schemaErrorMap,
|
|
12692
12444
|
MI(),
|
|
12693
|
-
|
|
12445
|
+
mA
|
|
12694
12446
|
].filter((a) => !!a),
|
|
12695
12447
|
issueData: {
|
|
12696
12448
|
code: e.invalid_arguments,
|
|
@@ -12706,7 +12458,7 @@ class qA extends K {
|
|
|
12706
12458
|
I.common.contextualErrorMap,
|
|
12707
12459
|
I.schemaErrorMap,
|
|
12708
12460
|
MI(),
|
|
12709
|
-
|
|
12461
|
+
mA
|
|
12710
12462
|
].filter((a) => !!a),
|
|
12711
12463
|
issueData: {
|
|
12712
12464
|
code: e.invalid_return_type,
|
|
@@ -12715,10 +12467,10 @@ class qA extends K {
|
|
|
12715
12467
|
});
|
|
12716
12468
|
}
|
|
12717
12469
|
const Q = { errorMap: I.common.contextualErrorMap }, E = I.data;
|
|
12718
|
-
if (this._def.returns instanceof
|
|
12470
|
+
if (this._def.returns instanceof TA) {
|
|
12719
12471
|
const i = this;
|
|
12720
|
-
return
|
|
12721
|
-
const a = new
|
|
12472
|
+
return X(async function(...o) {
|
|
12473
|
+
const a = new _([]), s = await i._def.args.parseAsync(o, Q).catch((y) => {
|
|
12722
12474
|
throw a.addIssue(B(o, y)), a;
|
|
12723
12475
|
}), h = await Reflect.apply(E, this, s);
|
|
12724
12476
|
return await i._def.returns._def.type.parseAsync(h, Q).catch((y) => {
|
|
@@ -12727,13 +12479,13 @@ class qA extends K {
|
|
|
12727
12479
|
});
|
|
12728
12480
|
} else {
|
|
12729
12481
|
const i = this;
|
|
12730
|
-
return
|
|
12482
|
+
return X(function(...o) {
|
|
12731
12483
|
const a = i._def.args.safeParse(o, Q);
|
|
12732
12484
|
if (!a.success)
|
|
12733
|
-
throw new
|
|
12485
|
+
throw new _([B(o, a.error)]);
|
|
12734
12486
|
const s = Reflect.apply(E, this, a.data), h = i._def.returns.safeParse(s, Q);
|
|
12735
12487
|
if (!h.success)
|
|
12736
|
-
throw new
|
|
12488
|
+
throw new _([C(s, h.error)]);
|
|
12737
12489
|
return h.data;
|
|
12738
12490
|
});
|
|
12739
12491
|
}
|
|
@@ -12745,13 +12497,13 @@ class qA extends K {
|
|
|
12745
12497
|
return this._def.returns;
|
|
12746
12498
|
}
|
|
12747
12499
|
args(...A) {
|
|
12748
|
-
return new
|
|
12500
|
+
return new HA({
|
|
12749
12501
|
...this._def,
|
|
12750
|
-
args:
|
|
12502
|
+
args: sA.create(A).rest(RA.create())
|
|
12751
12503
|
});
|
|
12752
12504
|
}
|
|
12753
12505
|
returns(A) {
|
|
12754
|
-
return new
|
|
12506
|
+
return new HA({
|
|
12755
12507
|
...this._def,
|
|
12756
12508
|
returns: A
|
|
12757
12509
|
});
|
|
@@ -12763,15 +12515,15 @@ class qA extends K {
|
|
|
12763
12515
|
return this.parse(A);
|
|
12764
12516
|
}
|
|
12765
12517
|
static create(A, I, B) {
|
|
12766
|
-
return new
|
|
12767
|
-
args: A ||
|
|
12768
|
-
returns: I ||
|
|
12518
|
+
return new HA({
|
|
12519
|
+
args: A || sA.create([]).rest(RA.create()),
|
|
12520
|
+
returns: I || RA.create(),
|
|
12769
12521
|
typeName: J.ZodFunction,
|
|
12770
12522
|
...M(B)
|
|
12771
12523
|
});
|
|
12772
12524
|
}
|
|
12773
12525
|
}
|
|
12774
|
-
class
|
|
12526
|
+
class iI extends K {
|
|
12775
12527
|
get schema() {
|
|
12776
12528
|
return this._def.getter();
|
|
12777
12529
|
}
|
|
@@ -12780,12 +12532,12 @@ class oI extends K {
|
|
|
12780
12532
|
return this._def.getter()._parse({ data: I.data, path: I.path, parent: I });
|
|
12781
12533
|
}
|
|
12782
12534
|
}
|
|
12783
|
-
|
|
12535
|
+
iI.create = (g, A) => new iI({
|
|
12784
12536
|
getter: g,
|
|
12785
12537
|
typeName: J.ZodLazy,
|
|
12786
12538
|
...M(A)
|
|
12787
12539
|
});
|
|
12788
|
-
class
|
|
12540
|
+
class oI extends K {
|
|
12789
12541
|
_parse(A) {
|
|
12790
12542
|
if (A.data !== this._def.value) {
|
|
12791
12543
|
const I = this._getOrReturnCtx(A);
|
|
@@ -12801,21 +12553,21 @@ class aI extends K {
|
|
|
12801
12553
|
return this._def.value;
|
|
12802
12554
|
}
|
|
12803
12555
|
}
|
|
12804
|
-
|
|
12556
|
+
oI.create = (g, A) => new oI({
|
|
12805
12557
|
value: g,
|
|
12806
12558
|
typeName: J.ZodLiteral,
|
|
12807
12559
|
...M(A)
|
|
12808
12560
|
});
|
|
12809
12561
|
function BC(g, A) {
|
|
12810
|
-
return new
|
|
12562
|
+
return new GA({
|
|
12811
12563
|
values: g,
|
|
12812
12564
|
typeName: J.ZodEnum,
|
|
12813
12565
|
...M(A)
|
|
12814
12566
|
});
|
|
12815
12567
|
}
|
|
12816
|
-
class
|
|
12568
|
+
class GA extends K {
|
|
12817
12569
|
constructor() {
|
|
12818
|
-
super(...arguments),
|
|
12570
|
+
super(...arguments), OA.set(this, void 0);
|
|
12819
12571
|
}
|
|
12820
12572
|
_parse(A) {
|
|
12821
12573
|
if (typeof A.data != "string") {
|
|
@@ -12826,7 +12578,7 @@ class nA extends K {
|
|
|
12826
12578
|
code: e.invalid_type
|
|
12827
12579
|
}), d;
|
|
12828
12580
|
}
|
|
12829
|
-
if (HI(this,
|
|
12581
|
+
if (HI(this, OA) || $B(this, OA, new Set(this._def.values)), !HI(this, OA).has(A.data)) {
|
|
12830
12582
|
const I = this._getOrReturnCtx(A), B = this._def.values;
|
|
12831
12583
|
return F(I, {
|
|
12832
12584
|
received: I.data,
|
|
@@ -12834,7 +12586,7 @@ class nA extends K {
|
|
|
12834
12586
|
options: B
|
|
12835
12587
|
}), d;
|
|
12836
12588
|
}
|
|
12837
|
-
return
|
|
12589
|
+
return X(A.data);
|
|
12838
12590
|
}
|
|
12839
12591
|
get options() {
|
|
12840
12592
|
return this._def.values;
|
|
@@ -12858,23 +12610,23 @@ class nA extends K {
|
|
|
12858
12610
|
return A;
|
|
12859
12611
|
}
|
|
12860
12612
|
extract(A, I = this._def) {
|
|
12861
|
-
return
|
|
12613
|
+
return GA.create(A, {
|
|
12862
12614
|
...this._def,
|
|
12863
12615
|
...I
|
|
12864
12616
|
});
|
|
12865
12617
|
}
|
|
12866
12618
|
exclude(A, I = this._def) {
|
|
12867
|
-
return
|
|
12619
|
+
return GA.create(this.options.filter((B) => !A.includes(B)), {
|
|
12868
12620
|
...this._def,
|
|
12869
12621
|
...I
|
|
12870
12622
|
});
|
|
12871
12623
|
}
|
|
12872
12624
|
}
|
|
12873
|
-
|
|
12874
|
-
|
|
12875
|
-
class
|
|
12625
|
+
OA = /* @__PURE__ */ new WeakMap();
|
|
12626
|
+
GA.create = BC;
|
|
12627
|
+
class aI extends K {
|
|
12876
12628
|
constructor() {
|
|
12877
|
-
super(...arguments),
|
|
12629
|
+
super(...arguments), VA.set(this, void 0);
|
|
12878
12630
|
}
|
|
12879
12631
|
_parse(A) {
|
|
12880
12632
|
const I = H.getValidEnumValues(this._def.values), B = this._getOrReturnCtx(A);
|
|
@@ -12886,7 +12638,7 @@ class sI extends K {
|
|
|
12886
12638
|
code: e.invalid_type
|
|
12887
12639
|
}), d;
|
|
12888
12640
|
}
|
|
12889
|
-
if (HI(this,
|
|
12641
|
+
if (HI(this, VA) || $B(this, VA, new Set(H.getValidEnumValues(this._def.values))), !HI(this, VA).has(A.data)) {
|
|
12890
12642
|
const C = H.objectValues(I);
|
|
12891
12643
|
return F(B, {
|
|
12892
12644
|
received: B.data,
|
|
@@ -12894,19 +12646,19 @@ class sI extends K {
|
|
|
12894
12646
|
options: C
|
|
12895
12647
|
}), d;
|
|
12896
12648
|
}
|
|
12897
|
-
return
|
|
12649
|
+
return X(A.data);
|
|
12898
12650
|
}
|
|
12899
12651
|
get enum() {
|
|
12900
12652
|
return this._def.values;
|
|
12901
12653
|
}
|
|
12902
12654
|
}
|
|
12903
|
-
|
|
12904
|
-
|
|
12655
|
+
VA = /* @__PURE__ */ new WeakMap();
|
|
12656
|
+
aI.create = (g, A) => new aI({
|
|
12905
12657
|
values: g,
|
|
12906
12658
|
typeName: J.ZodNativeEnum,
|
|
12907
12659
|
...M(A)
|
|
12908
12660
|
});
|
|
12909
|
-
class
|
|
12661
|
+
class TA extends K {
|
|
12910
12662
|
unwrap() {
|
|
12911
12663
|
return this._def.type;
|
|
12912
12664
|
}
|
|
@@ -12919,18 +12671,18 @@ class xA extends K {
|
|
|
12919
12671
|
received: I.parsedType
|
|
12920
12672
|
}), d;
|
|
12921
12673
|
const B = I.parsedType === S.promise ? I.data : Promise.resolve(I.data);
|
|
12922
|
-
return
|
|
12674
|
+
return X(B.then((C) => this._def.type.parseAsync(C, {
|
|
12923
12675
|
path: I.path,
|
|
12924
12676
|
errorMap: I.common.contextualErrorMap
|
|
12925
12677
|
})));
|
|
12926
12678
|
}
|
|
12927
12679
|
}
|
|
12928
|
-
|
|
12680
|
+
TA.create = (g, A) => new TA({
|
|
12929
12681
|
type: g,
|
|
12930
12682
|
typeName: J.ZodPromise,
|
|
12931
12683
|
...M(A)
|
|
12932
12684
|
});
|
|
12933
|
-
class
|
|
12685
|
+
class QA extends K {
|
|
12934
12686
|
innerType() {
|
|
12935
12687
|
return this._def.schema;
|
|
12936
12688
|
}
|
|
@@ -12957,7 +12709,7 @@ class EA extends K {
|
|
|
12957
12709
|
path: B.path,
|
|
12958
12710
|
parent: B
|
|
12959
12711
|
});
|
|
12960
|
-
return o.status === "aborted" ? d : o.status === "dirty" || I.value === "dirty" ?
|
|
12712
|
+
return o.status === "aborted" ? d : o.status === "dirty" || I.value === "dirty" ? MA(o.value) : o;
|
|
12961
12713
|
});
|
|
12962
12714
|
{
|
|
12963
12715
|
if (I.value === "aborted")
|
|
@@ -12967,7 +12719,7 @@ class EA extends K {
|
|
|
12967
12719
|
path: B.path,
|
|
12968
12720
|
parent: B
|
|
12969
12721
|
});
|
|
12970
|
-
return i.status === "aborted" ? d : i.status === "dirty" || I.value === "dirty" ?
|
|
12722
|
+
return i.status === "aborted" ? d : i.status === "dirty" || I.value === "dirty" ? MA(i.value) : i;
|
|
12971
12723
|
}
|
|
12972
12724
|
}
|
|
12973
12725
|
if (C.type === "refinement") {
|
|
@@ -12996,56 +12748,56 @@ class EA extends K {
|
|
|
12996
12748
|
path: B.path,
|
|
12997
12749
|
parent: B
|
|
12998
12750
|
});
|
|
12999
|
-
if (!
|
|
12751
|
+
if (!kA(E))
|
|
13000
12752
|
return E;
|
|
13001
12753
|
const i = C.transform(E.value, Q);
|
|
13002
12754
|
if (i instanceof Promise)
|
|
13003
12755
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
13004
12756
|
return { status: I.value, value: i };
|
|
13005
12757
|
} else
|
|
13006
|
-
return this._def.schema._parseAsync({ data: B.data, path: B.path, parent: B }).then((E) =>
|
|
12758
|
+
return this._def.schema._parseAsync({ data: B.data, path: B.path, parent: B }).then((E) => kA(E) ? Promise.resolve(C.transform(E.value, Q)).then((i) => ({ status: I.value, value: i })) : E);
|
|
13007
12759
|
H.assertNever(C);
|
|
13008
12760
|
}
|
|
13009
12761
|
}
|
|
13010
|
-
|
|
12762
|
+
QA.create = (g, A, I) => new QA({
|
|
13011
12763
|
schema: g,
|
|
13012
12764
|
typeName: J.ZodEffects,
|
|
13013
12765
|
effect: A,
|
|
13014
12766
|
...M(I)
|
|
13015
12767
|
});
|
|
13016
|
-
|
|
12768
|
+
QA.createWithPreprocess = (g, A, I) => new QA({
|
|
13017
12769
|
schema: A,
|
|
13018
12770
|
effect: { type: "preprocess", transform: g },
|
|
13019
12771
|
typeName: J.ZodEffects,
|
|
13020
12772
|
...M(I)
|
|
13021
12773
|
});
|
|
13022
|
-
class
|
|
12774
|
+
class oA extends K {
|
|
13023
12775
|
_parse(A) {
|
|
13024
|
-
return this._getType(A) === S.undefined ?
|
|
12776
|
+
return this._getType(A) === S.undefined ? X(void 0) : this._def.innerType._parse(A);
|
|
13025
12777
|
}
|
|
13026
12778
|
unwrap() {
|
|
13027
12779
|
return this._def.innerType;
|
|
13028
12780
|
}
|
|
13029
12781
|
}
|
|
13030
|
-
|
|
12782
|
+
oA.create = (g, A) => new oA({
|
|
13031
12783
|
innerType: g,
|
|
13032
12784
|
typeName: J.ZodOptional,
|
|
13033
12785
|
...M(A)
|
|
13034
12786
|
});
|
|
13035
|
-
class
|
|
12787
|
+
class nA extends K {
|
|
13036
12788
|
_parse(A) {
|
|
13037
|
-
return this._getType(A) === S.null ?
|
|
12789
|
+
return this._getType(A) === S.null ? X(null) : this._def.innerType._parse(A);
|
|
13038
12790
|
}
|
|
13039
12791
|
unwrap() {
|
|
13040
12792
|
return this._def.innerType;
|
|
13041
12793
|
}
|
|
13042
12794
|
}
|
|
13043
|
-
|
|
12795
|
+
nA.create = (g, A) => new nA({
|
|
13044
12796
|
innerType: g,
|
|
13045
12797
|
typeName: J.ZodNullable,
|
|
13046
12798
|
...M(A)
|
|
13047
12799
|
});
|
|
13048
|
-
class
|
|
12800
|
+
class sI extends K {
|
|
13049
12801
|
_parse(A) {
|
|
13050
12802
|
const { ctx: I } = this._processInputParams(A);
|
|
13051
12803
|
let B = I.data;
|
|
@@ -13059,13 +12811,13 @@ class DI extends K {
|
|
|
13059
12811
|
return this._def.innerType;
|
|
13060
12812
|
}
|
|
13061
12813
|
}
|
|
13062
|
-
|
|
12814
|
+
sI.create = (g, A) => new sI({
|
|
13063
12815
|
innerType: g,
|
|
13064
12816
|
typeName: J.ZodDefault,
|
|
13065
12817
|
defaultValue: typeof A.default == "function" ? A.default : () => A.default,
|
|
13066
12818
|
...M(A)
|
|
13067
12819
|
});
|
|
13068
|
-
class
|
|
12820
|
+
class DI extends K {
|
|
13069
12821
|
_parse(A) {
|
|
13070
12822
|
const { ctx: I } = this._processInputParams(A), B = {
|
|
13071
12823
|
...I,
|
|
@@ -13080,11 +12832,11 @@ class hI extends K {
|
|
|
13080
12832
|
...B
|
|
13081
12833
|
}
|
|
13082
12834
|
});
|
|
13083
|
-
return
|
|
12835
|
+
return AI(C) ? C.then((Q) => ({
|
|
13084
12836
|
status: "valid",
|
|
13085
12837
|
value: Q.status === "valid" ? Q.value : this._def.catchValue({
|
|
13086
12838
|
get error() {
|
|
13087
|
-
return new
|
|
12839
|
+
return new _(B.common.issues);
|
|
13088
12840
|
},
|
|
13089
12841
|
input: B.data
|
|
13090
12842
|
})
|
|
@@ -13092,7 +12844,7 @@ class hI extends K {
|
|
|
13092
12844
|
status: "valid",
|
|
13093
12845
|
value: C.status === "valid" ? C.value : this._def.catchValue({
|
|
13094
12846
|
get error() {
|
|
13095
|
-
return new
|
|
12847
|
+
return new _(B.common.issues);
|
|
13096
12848
|
},
|
|
13097
12849
|
input: B.data
|
|
13098
12850
|
})
|
|
@@ -13102,7 +12854,7 @@ class hI extends K {
|
|
|
13102
12854
|
return this._def.innerType;
|
|
13103
12855
|
}
|
|
13104
12856
|
}
|
|
13105
|
-
|
|
12857
|
+
DI.create = (g, A) => new DI({
|
|
13106
12858
|
innerType: g,
|
|
13107
12859
|
typeName: J.ZodCatch,
|
|
13108
12860
|
catchValue: typeof A.catch == "function" ? A.catch : () => A.catch,
|
|
@@ -13139,7 +12891,7 @@ class fg extends K {
|
|
|
13139
12891
|
return this._def.type;
|
|
13140
12892
|
}
|
|
13141
12893
|
}
|
|
13142
|
-
class
|
|
12894
|
+
class wI extends K {
|
|
13143
12895
|
_parse(A) {
|
|
13144
12896
|
const { status: I, ctx: B } = this._processInputParams(A);
|
|
13145
12897
|
if (B.common.async)
|
|
@@ -13149,7 +12901,7 @@ class FI extends K {
|
|
|
13149
12901
|
path: B.path,
|
|
13150
12902
|
parent: B
|
|
13151
12903
|
});
|
|
13152
|
-
return Q.status === "aborted" ? d : Q.status === "dirty" ? (I.dirty(),
|
|
12904
|
+
return Q.status === "aborted" ? d : Q.status === "dirty" ? (I.dirty(), MA(Q.value)) : this._def.out._parseAsync({
|
|
13153
12905
|
data: Q.value,
|
|
13154
12906
|
path: B.path,
|
|
13155
12907
|
parent: B
|
|
@@ -13172,23 +12924,23 @@ class FI extends K {
|
|
|
13172
12924
|
}
|
|
13173
12925
|
}
|
|
13174
12926
|
static create(A, I) {
|
|
13175
|
-
return new
|
|
12927
|
+
return new wI({
|
|
13176
12928
|
in: A,
|
|
13177
12929
|
out: I,
|
|
13178
12930
|
typeName: J.ZodPipeline
|
|
13179
12931
|
});
|
|
13180
12932
|
}
|
|
13181
12933
|
}
|
|
13182
|
-
class
|
|
12934
|
+
class hI extends K {
|
|
13183
12935
|
_parse(A) {
|
|
13184
|
-
const I = this._def.innerType._parse(A), B = (C) => (
|
|
13185
|
-
return
|
|
12936
|
+
const I = this._def.innerType._parse(A), B = (C) => (kA(C) && (C.value = Object.freeze(C.value)), C);
|
|
12937
|
+
return AI(I) ? I.then((C) => B(C)) : B(I);
|
|
13186
12938
|
}
|
|
13187
12939
|
unwrap() {
|
|
13188
12940
|
return this._def.innerType;
|
|
13189
12941
|
}
|
|
13190
12942
|
}
|
|
13191
|
-
|
|
12943
|
+
hI.create = (g, A) => new hI({
|
|
13192
12944
|
innerType: g,
|
|
13193
12945
|
typeName: J.ZodReadonly,
|
|
13194
12946
|
...M(A)
|
|
@@ -13198,7 +12950,7 @@ function kB(g, A) {
|
|
|
13198
12950
|
return typeof I == "string" ? { message: I } : I;
|
|
13199
12951
|
}
|
|
13200
12952
|
function CC(g, A = {}, I) {
|
|
13201
|
-
return g ?
|
|
12953
|
+
return g ? uA.create().superRefine((B, C) => {
|
|
13202
12954
|
var Q, E;
|
|
13203
12955
|
const i = g(B);
|
|
13204
12956
|
if (i instanceof Promise)
|
|
@@ -13213,7 +12965,7 @@ function CC(g, A = {}, I) {
|
|
|
13213
12965
|
const o = kB(A, B), a = (E = (Q = o.fatal) !== null && Q !== void 0 ? Q : I) !== null && E !== void 0 ? E : !0;
|
|
13214
12966
|
C.addIssue({ code: "custom", ...o, fatal: a });
|
|
13215
12967
|
}
|
|
13216
|
-
}) :
|
|
12968
|
+
}) : uA.create();
|
|
13217
12969
|
}
|
|
13218
12970
|
const Hi = {
|
|
13219
12971
|
object: u.lazycreate
|
|
@@ -13224,32 +12976,32 @@ var J;
|
|
|
13224
12976
|
})(J || (J = {}));
|
|
13225
12977
|
const qi = (g, A = {
|
|
13226
12978
|
message: `Input not instance of ${g.name}`
|
|
13227
|
-
}) => CC((I) => I instanceof g, A), QC =
|
|
13228
|
-
string: (g) =>
|
|
13229
|
-
number: (g) =>
|
|
13230
|
-
boolean: (g) =>
|
|
12979
|
+
}) => CC((I) => I instanceof g, A), QC = IA.create, EC = yA.create, li = pI.create, fi = eA.create, iC = II.create, pi = LA.create, mi = qI.create, ui = gI.create, Ti = BI.create, xi = uA.create, Wi = RA.create, bi = tA.create, Zi = lI.create, Pi = CA.create, Oi = u.create, Vi = u.strictCreate, vi = CI.create, Xi = bI.create, ji = QI.create, zi = sA.create, _i = EI.create, $i = fI.create, Ao = JA.create, Io = HA.create, go = iI.create, Bo = oI.create, Co = GA.create, Qo = aI.create, Eo = TA.create, LB = QA.create, io = oA.create, oo = nA.create, ao = QA.createWithPreprocess, so = wI.create, Do = () => QC().optional(), ho = () => EC().optional(), to = () => iC().optional(), yo = {
|
|
12980
|
+
string: (g) => IA.create({ ...g, coerce: !0 }),
|
|
12981
|
+
number: (g) => yA.create({ ...g, coerce: !0 }),
|
|
12982
|
+
boolean: (g) => II.create({
|
|
13231
12983
|
...g,
|
|
13232
12984
|
coerce: !0
|
|
13233
12985
|
}),
|
|
13234
|
-
bigint: (g) =>
|
|
13235
|
-
date: (g) =>
|
|
12986
|
+
bigint: (g) => eA.create({ ...g, coerce: !0 }),
|
|
12987
|
+
date: (g) => LA.create({ ...g, coerce: !0 })
|
|
13236
12988
|
}, eo = d;
|
|
13237
12989
|
var D = /* @__PURE__ */ Object.freeze({
|
|
13238
12990
|
__proto__: null,
|
|
13239
|
-
defaultErrorMap:
|
|
12991
|
+
defaultErrorMap: mA,
|
|
13240
12992
|
setErrorMap: ai,
|
|
13241
12993
|
getErrorMap: MI,
|
|
13242
12994
|
makeIssue: KI,
|
|
13243
12995
|
EMPTY_PATH: si,
|
|
13244
12996
|
addIssueToContext: F,
|
|
13245
|
-
ParseStatus:
|
|
12997
|
+
ParseStatus: v,
|
|
13246
12998
|
INVALID: d,
|
|
13247
|
-
DIRTY:
|
|
13248
|
-
OK:
|
|
12999
|
+
DIRTY: MA,
|
|
13000
|
+
OK: X,
|
|
13249
13001
|
isAborted: Dg,
|
|
13250
13002
|
isDirty: hg,
|
|
13251
|
-
isValid:
|
|
13252
|
-
isAsync:
|
|
13003
|
+
isValid: kA,
|
|
13004
|
+
isAsync: AI,
|
|
13253
13005
|
get util() {
|
|
13254
13006
|
return H;
|
|
13255
13007
|
},
|
|
@@ -13257,47 +13009,47 @@ var D = /* @__PURE__ */ Object.freeze({
|
|
|
13257
13009
|
return sg;
|
|
13258
13010
|
},
|
|
13259
13011
|
ZodParsedType: S,
|
|
13260
|
-
getParsedType:
|
|
13012
|
+
getParsedType: hA,
|
|
13261
13013
|
ZodType: K,
|
|
13262
13014
|
datetimeRegex: gC,
|
|
13263
|
-
ZodString:
|
|
13264
|
-
ZodNumber:
|
|
13265
|
-
ZodBigInt:
|
|
13266
|
-
ZodBoolean:
|
|
13267
|
-
ZodDate:
|
|
13015
|
+
ZodString: IA,
|
|
13016
|
+
ZodNumber: yA,
|
|
13017
|
+
ZodBigInt: eA,
|
|
13018
|
+
ZodBoolean: II,
|
|
13019
|
+
ZodDate: LA,
|
|
13268
13020
|
ZodSymbol: qI,
|
|
13269
|
-
ZodUndefined:
|
|
13270
|
-
ZodNull:
|
|
13271
|
-
ZodAny:
|
|
13272
|
-
ZodUnknown:
|
|
13273
|
-
ZodNever:
|
|
13021
|
+
ZodUndefined: gI,
|
|
13022
|
+
ZodNull: BI,
|
|
13023
|
+
ZodAny: uA,
|
|
13024
|
+
ZodUnknown: RA,
|
|
13025
|
+
ZodNever: tA,
|
|
13274
13026
|
ZodVoid: lI,
|
|
13275
|
-
ZodArray:
|
|
13027
|
+
ZodArray: CA,
|
|
13276
13028
|
ZodObject: u,
|
|
13277
|
-
ZodUnion:
|
|
13029
|
+
ZodUnion: CI,
|
|
13278
13030
|
ZodDiscriminatedUnion: bI,
|
|
13279
|
-
ZodIntersection:
|
|
13280
|
-
ZodTuple:
|
|
13281
|
-
ZodRecord:
|
|
13031
|
+
ZodIntersection: QI,
|
|
13032
|
+
ZodTuple: sA,
|
|
13033
|
+
ZodRecord: EI,
|
|
13282
13034
|
ZodMap: fI,
|
|
13283
|
-
ZodSet:
|
|
13284
|
-
ZodFunction:
|
|
13285
|
-
ZodLazy:
|
|
13286
|
-
ZodLiteral:
|
|
13287
|
-
ZodEnum:
|
|
13288
|
-
ZodNativeEnum:
|
|
13289
|
-
ZodPromise:
|
|
13290
|
-
ZodEffects:
|
|
13291
|
-
ZodTransformer:
|
|
13292
|
-
ZodOptional:
|
|
13293
|
-
ZodNullable:
|
|
13294
|
-
ZodDefault:
|
|
13295
|
-
ZodCatch:
|
|
13035
|
+
ZodSet: JA,
|
|
13036
|
+
ZodFunction: HA,
|
|
13037
|
+
ZodLazy: iI,
|
|
13038
|
+
ZodLiteral: oI,
|
|
13039
|
+
ZodEnum: GA,
|
|
13040
|
+
ZodNativeEnum: aI,
|
|
13041
|
+
ZodPromise: TA,
|
|
13042
|
+
ZodEffects: QA,
|
|
13043
|
+
ZodTransformer: QA,
|
|
13044
|
+
ZodOptional: oA,
|
|
13045
|
+
ZodNullable: nA,
|
|
13046
|
+
ZodDefault: sI,
|
|
13047
|
+
ZodCatch: DI,
|
|
13296
13048
|
ZodNaN: pI,
|
|
13297
13049
|
BRAND: Ki,
|
|
13298
13050
|
ZodBranded: fg,
|
|
13299
|
-
ZodPipeline:
|
|
13300
|
-
ZodReadonly:
|
|
13051
|
+
ZodPipeline: wI,
|
|
13052
|
+
ZodReadonly: hI,
|
|
13301
13053
|
custom: CC,
|
|
13302
13054
|
Schema: K,
|
|
13303
13055
|
ZodSchema: K,
|
|
@@ -13348,7 +13100,7 @@ var D = /* @__PURE__ */ Object.freeze({
|
|
|
13348
13100
|
NEVER: eo,
|
|
13349
13101
|
ZodIssueCode: e,
|
|
13350
13102
|
quotelessJson: oi,
|
|
13351
|
-
ZodError:
|
|
13103
|
+
ZodError: _
|
|
13352
13104
|
});
|
|
13353
13105
|
const Go = D.object({
|
|
13354
13106
|
/**The multiscale datasets for this image*/
|
|
@@ -13773,7 +13525,7 @@ function pg(g) {
|
|
|
13773
13525
|
const A = co(g);
|
|
13774
13526
|
return A === void 0 ? "0.4" : A;
|
|
13775
13527
|
}
|
|
13776
|
-
function
|
|
13528
|
+
function xA(g) {
|
|
13777
13529
|
if (g !== void 0)
|
|
13778
13530
|
switch (g) {
|
|
13779
13531
|
case "0.4":
|
|
@@ -13787,7 +13539,7 @@ function oC(g, A) {
|
|
|
13787
13539
|
return delete I[A], I;
|
|
13788
13540
|
}
|
|
13789
13541
|
async function Oo(g, A) {
|
|
13790
|
-
const I = new
|
|
13542
|
+
const I = new ZA(g), B = new j(I), C = xA(A), Q = await nI(B, C);
|
|
13791
13543
|
try {
|
|
13792
13544
|
return Uo(Q.attrs);
|
|
13793
13545
|
} catch {
|
|
@@ -13846,7 +13598,7 @@ function Jo(g) {
|
|
|
13846
13598
|
}
|
|
13847
13599
|
}
|
|
13848
13600
|
async function Vo(g, A, I) {
|
|
13849
|
-
const B = g + "/" + A, C = new
|
|
13601
|
+
const B = g + "/" + A, C = new ZA(B), Q = new j(C), E = xA(I), i = await nI(Q, E);
|
|
13850
13602
|
try {
|
|
13851
13603
|
return Jo(i.attrs);
|
|
13852
13604
|
} catch {
|
|
@@ -13857,11 +13609,11 @@ ${JSON.stringify(i.attrs)}`
|
|
|
13857
13609
|
}
|
|
13858
13610
|
}
|
|
13859
13611
|
async function vo(g) {
|
|
13860
|
-
const A =
|
|
13612
|
+
const A = xA(g.version), I = await nI(g.location, A);
|
|
13861
13613
|
return mg(I.attrs).omero?.channels ?? [];
|
|
13862
13614
|
}
|
|
13863
13615
|
async function Xo(g) {
|
|
13864
|
-
const A =
|
|
13616
|
+
const A = xA(g.version), I = await nI(g.location, A);
|
|
13865
13617
|
return mg(I.attrs).omero?.rdefs;
|
|
13866
13618
|
}
|
|
13867
13619
|
function Yo(g) {
|
|
@@ -13902,8 +13654,8 @@ class NI {
|
|
|
13902
13654
|
this.location = A.location, this.version = A.version;
|
|
13903
13655
|
}
|
|
13904
13656
|
async open() {
|
|
13905
|
-
let A =
|
|
13906
|
-
const I = await
|
|
13657
|
+
let A = xA(this.version);
|
|
13658
|
+
const I = await nI(this.location, A), B = mg(I.attrs), C = B.multiscales;
|
|
13907
13659
|
if (C.length !== 1)
|
|
13908
13660
|
throw new Error(
|
|
13909
13661
|
`Exactly one multiscale image is supported. Found ${C.length} images.`
|
|
@@ -13911,7 +13663,7 @@ class NI {
|
|
|
13911
13663
|
const Q = C[0];
|
|
13912
13664
|
if (Q.datasets.length === 0)
|
|
13913
13665
|
throw new Error("No datasets found in the multiscale image.");
|
|
13914
|
-
A || (A =
|
|
13666
|
+
A || (A = xA(B.originalVersion));
|
|
13915
13667
|
const E = Q.datasets.map(
|
|
13916
13668
|
(s) => XE(this.location, s.path, A)
|
|
13917
13669
|
), i = await Promise.all(
|
|
@@ -13934,9 +13686,9 @@ class NI {
|
|
|
13934
13686
|
* @param version OME-Zarr version
|
|
13935
13687
|
*/
|
|
13936
13688
|
static fromHttp(A) {
|
|
13937
|
-
const I = new
|
|
13689
|
+
const I = new ZA(A.url);
|
|
13938
13690
|
return new NI({
|
|
13939
|
-
location: new
|
|
13691
|
+
location: new j(I),
|
|
13940
13692
|
version: A.version
|
|
13941
13693
|
});
|
|
13942
13694
|
}
|
|
@@ -13953,7 +13705,7 @@ class NI {
|
|
|
13953
13705
|
static fromS3(A) {
|
|
13954
13706
|
const I = new lg(A);
|
|
13955
13707
|
return new NI({
|
|
13956
|
-
location: new
|
|
13708
|
+
location: new j(I),
|
|
13957
13709
|
version: A.version
|
|
13958
13710
|
});
|
|
13959
13711
|
}
|
|
@@ -13969,7 +13721,7 @@ class NI {
|
|
|
13969
13721
|
static fromFileSystem(A) {
|
|
13970
13722
|
const I = new qg(A.directory);
|
|
13971
13723
|
return new NI({
|
|
13972
|
-
location: new
|
|
13724
|
+
location: new j(I, A.path),
|
|
13973
13725
|
version: A.version
|
|
13974
13726
|
});
|
|
13975
13727
|
}
|
|
@@ -14067,7 +13819,7 @@ function Tg(g, A = {}) {
|
|
|
14067
13819
|
priorityOrder: A.priorityOrder ?? g.priorityOrder
|
|
14068
13820
|
};
|
|
14069
13821
|
}
|
|
14070
|
-
class $o extends
|
|
13822
|
+
class $o extends bA {
|
|
14071
13823
|
atlas_;
|
|
14072
13824
|
constructor(A, I) {
|
|
14073
13825
|
super(), this.programName = "points", this.atlas_ = I, A.forEach((Q) => {
|
|
@@ -14087,7 +13839,7 @@ class $o extends ZA {
|
|
|
14087
13839
|
Q.color.a,
|
|
14088
13840
|
Q.size,
|
|
14089
13841
|
Q.markerIndex
|
|
14090
|
-
]), C = new
|
|
13842
|
+
]), C = new WA(B, [], "points");
|
|
14091
13843
|
C.addAttribute({
|
|
14092
13844
|
type: "position",
|
|
14093
13845
|
itemSize: 3,
|
|
@@ -14112,8 +13864,8 @@ class $o extends ZA {
|
|
|
14112
13864
|
}
|
|
14113
13865
|
export {
|
|
14114
13866
|
mo as AxesLayer,
|
|
14115
|
-
|
|
14116
|
-
|
|
13867
|
+
$ as Box2,
|
|
13868
|
+
SA as Box3,
|
|
14117
13869
|
uB as ChunkedImageLayer,
|
|
14118
13870
|
l as Color,
|
|
14119
13871
|
RQ as Frustum,
|
|
@@ -14121,19 +13873,19 @@ export {
|
|
|
14121
13873
|
Wo as ImageLayer,
|
|
14122
13874
|
Zo as ImageSeriesLayer,
|
|
14123
13875
|
bo as LabelImageLayer,
|
|
14124
|
-
|
|
13876
|
+
wA as Layer,
|
|
14125
13877
|
hQ as LayerManager,
|
|
14126
13878
|
NI as OmeZarrImageSource,
|
|
14127
13879
|
po as OrbitControls,
|
|
14128
13880
|
qo as OrthographicCamera,
|
|
14129
13881
|
fo as PanZoomControls,
|
|
14130
13882
|
lo as PerspectiveCamera,
|
|
14131
|
-
|
|
13883
|
+
YA as Plane,
|
|
14132
13884
|
$o as Points,
|
|
14133
13885
|
uo as ProjectedLineLayer,
|
|
14134
13886
|
gB as Spherical,
|
|
14135
|
-
|
|
14136
|
-
|
|
13887
|
+
tI as Texture2DArray,
|
|
13888
|
+
XA as Texture3D,
|
|
14137
13889
|
To as TracksLayer,
|
|
14138
13890
|
GQ as Viewport,
|
|
14139
13891
|
xo as VolumeLayer,
|