@idetik/core 0.47.0 → 0.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -835,23 +835,23 @@ function IB(g, A) {
835
835
  return g[0] = A[0], g[1] = A[1], g[2] = A[2], g[3] = A[3], g[4] = A[4], g[5] = A[5], g[6] = A[6], g[7] = A[7], g[8] = A[8], g[9] = A[9], g[10] = A[10], g[11] = A[11], g[12] = A[12], g[13] = A[13], g[14] = A[14], g[15] = A[15], g;
836
836
  }
837
837
  function PA(g, A) {
838
- 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], D = A[9], t = A[10], h = A[11], e = A[12], n = A[13], r = A[14], G = A[15], L = I * i - B * E, N = I * o - C * E, S = I * a - Q * E, F = B * o - C * i, U = B * a - Q * i, l = C * a - Q * o, Z = s * n - D * e, O = s * r - t * e, b = s * G - h * e, z = D * r - t * n, oA = D * G - h * n, aA = t * G - h * r, P = L * aA - N * oA + S * z + F * b - U * O + l * Z;
839
- return P ? (P = 1 / P, g[0] = (i * aA - o * oA + a * z) * P, g[1] = (C * oA - B * aA - Q * z) * P, g[2] = (n * l - r * U + G * F) * P, g[3] = (t * U - D * l - h * F) * P, g[4] = (o * b - E * aA - a * O) * P, g[5] = (I * aA - C * b + Q * O) * P, g[6] = (r * S - e * l - G * N) * P, g[7] = (s * l - t * S + h * N) * P, g[8] = (E * oA - i * b + a * Z) * P, g[9] = (B * b - I * oA - Q * Z) * P, g[10] = (e * U - n * S + G * L) * P, g[11] = (D * S - s * U - h * L) * P, g[12] = (i * O - E * z - o * Z) * P, g[13] = (I * z - B * O + C * Z) * P, g[14] = (n * N - e * F - r * L) * P, g[15] = (s * F - D * N + t * L) * P, g) : null;
838
+ 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], D = A[9], t = A[10], h = A[11], y = A[12], n = A[13], r = A[14], G = A[15], L = I * i - B * E, N = I * o - C * E, S = I * a - Q * E, F = B * o - C * i, U = B * a - Q * i, l = C * a - Q * o, Z = s * n - D * y, O = s * r - t * y, b = s * G - h * y, z = D * r - t * n, oA = D * G - h * n, aA = t * G - h * r, P = L * aA - N * oA + S * z + F * b - U * O + l * Z;
839
+ return P ? (P = 1 / P, g[0] = (i * aA - o * oA + a * z) * P, g[1] = (C * oA - B * aA - Q * z) * P, g[2] = (n * l - r * U + G * F) * P, g[3] = (t * U - D * l - h * F) * P, g[4] = (o * b - E * aA - a * O) * P, g[5] = (I * aA - C * b + Q * O) * P, g[6] = (r * S - y * l - G * N) * P, g[7] = (s * l - t * S + h * N) * P, g[8] = (E * oA - i * b + a * Z) * P, g[9] = (B * b - I * oA - Q * Z) * P, g[10] = (y * U - n * S + G * L) * P, g[11] = (D * S - s * U - h * L) * P, g[12] = (i * O - E * z - o * Z) * P, g[13] = (I * z - B * O + C * Z) * P, g[14] = (n * N - y * F - r * L) * P, g[15] = (s * F - D * N + t * L) * P, g) : null;
840
840
  }
841
841
  function QI(g, A, I) {
842
- 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], D = A[8], t = A[9], h = A[10], e = A[11], n = A[12], r = A[13], G = A[14], L = A[15], N = I[0], S = I[1], F = I[2], U = I[3];
843
- return g[0] = N * B + S * i + F * D + U * n, g[1] = N * C + S * o + F * t + U * r, g[2] = N * Q + S * a + F * h + U * G, g[3] = N * E + S * s + F * e + U * L, N = I[4], S = I[5], F = I[6], U = I[7], g[4] = N * B + S * i + F * D + U * n, g[5] = N * C + S * o + F * t + U * r, g[6] = N * Q + S * a + F * h + U * G, g[7] = N * E + S * s + F * e + U * L, N = I[8], S = I[9], F = I[10], U = I[11], g[8] = N * B + S * i + F * D + U * n, g[9] = N * C + S * o + F * t + U * r, g[10] = N * Q + S * a + F * h + U * G, g[11] = N * E + S * s + F * e + U * L, N = I[12], S = I[13], F = I[14], U = I[15], g[12] = N * B + S * i + F * D + U * n, g[13] = N * C + S * o + F * t + U * r, g[14] = N * Q + S * a + F * h + U * G, g[15] = N * E + S * s + F * e + U * L, g;
842
+ 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], D = A[8], t = A[9], h = A[10], y = A[11], n = A[12], r = A[13], G = A[14], L = A[15], N = I[0], S = I[1], F = I[2], U = I[3];
843
+ return g[0] = N * B + S * i + F * D + U * n, g[1] = N * C + S * o + F * t + U * r, g[2] = N * Q + S * a + F * h + U * G, g[3] = N * E + S * s + F * y + U * L, N = I[4], S = I[5], F = I[6], U = I[7], g[4] = N * B + S * i + F * D + U * n, g[5] = N * C + S * o + F * t + U * r, g[6] = N * Q + S * a + F * h + U * G, g[7] = N * E + S * s + F * y + U * L, N = I[8], S = I[9], F = I[10], U = I[11], g[8] = N * B + S * i + F * D + U * n, g[9] = N * C + S * o + F * t + U * r, g[10] = N * Q + S * a + F * h + U * G, g[11] = N * E + S * s + F * y + U * L, N = I[12], S = I[13], F = I[14], U = I[15], g[12] = N * B + S * i + F * D + U * n, g[13] = N * C + S * o + F * t + U * r, g[14] = N * Q + S * a + F * h + U * G, g[15] = N * E + S * s + F * y + U * L, g;
844
844
  }
845
845
  function XC(g, A, I) {
846
- var B = I[0], C = I[1], Q = I[2], E, i, o, a, s, D, t, h, e, n, r, G;
847
- return A === g ? (g[12] = A[0] * B + A[4] * C + A[8] * Q + A[12], g[13] = A[1] * B + A[5] * C + A[9] * Q + A[13], g[14] = A[2] * B + A[6] * C + A[10] * Q + A[14], g[15] = A[3] * B + A[7] * C + A[11] * Q + A[15]) : (E = A[0], i = A[1], o = A[2], a = A[3], s = A[4], D = A[5], t = A[6], h = A[7], e = A[8], n = A[9], r = A[10], G = A[11], g[0] = E, g[1] = i, g[2] = o, g[3] = a, g[4] = s, g[5] = D, g[6] = t, g[7] = h, g[8] = e, g[9] = n, g[10] = r, g[11] = G, g[12] = E * B + s * C + e * Q + A[12], g[13] = i * B + D * C + n * Q + A[13], g[14] = o * B + t * C + r * Q + A[14], g[15] = a * B + h * C + G * Q + A[15]), g;
846
+ var B = I[0], C = I[1], Q = I[2], E, i, o, a, s, D, t, h, y, n, r, G;
847
+ return A === g ? (g[12] = A[0] * B + A[4] * C + A[8] * Q + A[12], g[13] = A[1] * B + A[5] * C + A[9] * Q + A[13], g[14] = A[2] * B + A[6] * C + A[10] * Q + A[14], g[15] = A[3] * B + A[7] * C + A[11] * Q + A[15]) : (E = A[0], i = A[1], o = A[2], a = A[3], s = A[4], D = A[5], t = A[6], h = A[7], y = A[8], n = A[9], r = A[10], G = A[11], g[0] = E, g[1] = i, g[2] = o, g[3] = a, g[4] = s, g[5] = D, g[6] = t, g[7] = h, g[8] = y, g[9] = n, g[10] = r, g[11] = G, g[12] = E * B + s * C + y * Q + A[12], g[13] = i * B + D * C + n * Q + A[13], g[14] = o * B + t * C + r * Q + A[14], g[15] = a * B + h * C + G * Q + A[15]), g;
848
848
  }
849
849
  function gC(g, A) {
850
850
  return g[0] = A[0], g[1] = 0, g[2] = 0, g[3] = 0, g[4] = 0, g[5] = A[1], g[6] = 0, g[7] = 0, g[8] = 0, g[9] = 0, g[10] = A[2], g[11] = 0, g[12] = 0, g[13] = 0, g[14] = 0, g[15] = 1, g;
851
851
  }
852
852
  function jC(g, A, I, B) {
853
- var C = A[0], Q = A[1], E = A[2], i = A[3], o = C + C, a = Q + Q, s = E + E, D = C * o, t = C * a, h = C * s, e = Q * a, n = Q * s, r = E * s, G = i * o, L = i * a, N = i * s, S = B[0], F = B[1], U = B[2];
854
- return g[0] = (1 - (e + r)) * S, g[1] = (t + N) * S, g[2] = (h - L) * S, g[3] = 0, g[4] = (t - N) * F, g[5] = (1 - (D + r)) * F, g[6] = (n + G) * F, g[7] = 0, g[8] = (h + L) * U, g[9] = (n - G) * U, g[10] = (1 - (D + e)) * U, g[11] = 0, g[12] = I[0], g[13] = I[1], g[14] = I[2], g[15] = 1, g;
853
+ var C = A[0], Q = A[1], E = A[2], i = A[3], o = C + C, a = Q + Q, s = E + E, D = C * o, t = C * a, h = C * s, y = Q * a, n = Q * s, r = E * s, G = i * o, L = i * a, N = i * s, S = B[0], F = B[1], U = B[2];
854
+ return g[0] = (1 - (y + r)) * S, g[1] = (t + N) * S, g[2] = (h - L) * S, g[3] = 0, g[4] = (t - N) * F, g[5] = (1 - (D + r)) * F, g[6] = (n + G) * F, g[7] = 0, g[8] = (h + L) * U, g[9] = (n - G) * U, g[10] = (1 - (D + y)) * U, g[11] = 0, g[12] = I[0], g[13] = I[1], g[14] = I[2], g[15] = 1, g;
855
855
  }
856
856
  function zC(g, A, I, B, C) {
857
857
  var Q = 1 / Math.tan(A / 2);
@@ -871,15 +871,15 @@ var AQ = $C;
871
871
  function IQ(g, A, I, B) {
872
872
  var C = A[0], Q = A[1], E = A[2], i = B[0], o = B[1], a = B[2], s = C - I[0], D = Q - I[1], t = E - I[2], h = s * s + D * D + t * t;
873
873
  h > 0 && (h = 1 / Math.sqrt(h), s *= h, D *= h, t *= h);
874
- var e = o * t - a * D, n = a * s - i * t, r = i * D - o * s;
875
- return h = e * e + n * n + r * r, h > 0 && (h = 1 / Math.sqrt(h), e *= h, n *= h, r *= h), g[0] = e, g[1] = n, g[2] = r, g[3] = 0, g[4] = D * r - t * n, g[5] = t * e - s * r, g[6] = s * n - D * e, g[7] = 0, g[8] = s, g[9] = D, g[10] = t, g[11] = 0, g[12] = C, g[13] = Q, g[14] = E, g[15] = 1, g;
874
+ var y = o * t - a * D, n = a * s - i * t, r = i * D - o * s;
875
+ return h = y * y + n * n + r * r, h > 0 && (h = 1 / Math.sqrt(h), y *= h, n *= h, r *= h), g[0] = y, g[1] = n, g[2] = r, g[3] = 0, g[4] = D * r - t * n, g[5] = t * y - s * r, g[6] = s * n - D * y, g[7] = 0, g[8] = s, g[9] = D, g[10] = t, g[11] = 0, g[12] = C, g[13] = Q, g[14] = E, g[15] = 1, g;
876
876
  }
877
877
  function gB(g, A) {
878
878
  return g[0] === A[0] && g[1] === A[1] && g[2] === A[2] && g[3] === A[3] && g[4] === A[4] && g[5] === A[5] && g[6] === A[6] && g[7] === A[7] && g[8] === A[8] && g[9] === A[9] && g[10] === A[10] && g[11] === A[11] && g[12] === A[12] && g[13] === A[13] && g[14] === A[14] && g[15] === A[15];
879
879
  }
880
880
  function gQ(g, A) {
881
- 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], D = g[9], t = g[10], h = g[11], e = g[12], n = g[13], r = g[14], G = g[15], L = A[0], N = A[1], S = A[2], F = A[3], U = A[4], l = A[5], Z = A[6], O = A[7], b = A[8], z = A[9], oA = A[10], aA = A[11], P = A[12], Og = A[13], Vg = A[14], vg = A[15];
882
- return Math.abs(I - L) <= m * Math.max(1, Math.abs(I), Math.abs(L)) && Math.abs(B - N) <= m * Math.max(1, Math.abs(B), Math.abs(N)) && Math.abs(C - S) <= m * Math.max(1, Math.abs(C), Math.abs(S)) && Math.abs(Q - F) <= m * Math.max(1, Math.abs(Q), Math.abs(F)) && Math.abs(E - U) <= m * Math.max(1, Math.abs(E), Math.abs(U)) && Math.abs(i - l) <= m * Math.max(1, Math.abs(i), Math.abs(l)) && Math.abs(o - Z) <= m * Math.max(1, Math.abs(o), Math.abs(Z)) && Math.abs(a - O) <= m * Math.max(1, Math.abs(a), Math.abs(O)) && Math.abs(s - b) <= m * Math.max(1, Math.abs(s), Math.abs(b)) && Math.abs(D - z) <= m * Math.max(1, Math.abs(D), Math.abs(z)) && Math.abs(t - oA) <= m * Math.max(1, Math.abs(t), Math.abs(oA)) && Math.abs(h - aA) <= m * Math.max(1, Math.abs(h), Math.abs(aA)) && Math.abs(e - P) <= m * Math.max(1, Math.abs(e), Math.abs(P)) && Math.abs(n - Og) <= m * Math.max(1, Math.abs(n), Math.abs(Og)) && Math.abs(r - Vg) <= m * Math.max(1, Math.abs(r), Math.abs(Vg)) && Math.abs(G - vg) <= m * Math.max(1, Math.abs(G), Math.abs(vg));
881
+ 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], D = g[9], t = g[10], h = g[11], y = g[12], n = g[13], r = g[14], G = g[15], L = A[0], N = A[1], S = A[2], F = A[3], U = A[4], l = A[5], Z = A[6], O = A[7], b = A[8], z = A[9], oA = A[10], aA = A[11], P = A[12], Og = A[13], Vg = A[14], vg = A[15];
882
+ return Math.abs(I - L) <= m * Math.max(1, Math.abs(I), Math.abs(L)) && Math.abs(B - N) <= m * Math.max(1, Math.abs(B), Math.abs(N)) && Math.abs(C - S) <= m * Math.max(1, Math.abs(C), Math.abs(S)) && Math.abs(Q - F) <= m * Math.max(1, Math.abs(Q), Math.abs(F)) && Math.abs(E - U) <= m * Math.max(1, Math.abs(E), Math.abs(U)) && Math.abs(i - l) <= m * Math.max(1, Math.abs(i), Math.abs(l)) && Math.abs(o - Z) <= m * Math.max(1, Math.abs(o), Math.abs(Z)) && Math.abs(a - O) <= m * Math.max(1, Math.abs(a), Math.abs(O)) && Math.abs(s - b) <= m * Math.max(1, Math.abs(s), Math.abs(b)) && Math.abs(D - z) <= m * Math.max(1, Math.abs(D), Math.abs(z)) && Math.abs(t - oA) <= m * Math.max(1, Math.abs(t), Math.abs(oA)) && Math.abs(h - aA) <= m * Math.max(1, Math.abs(h), Math.abs(aA)) && Math.abs(y - P) <= m * Math.max(1, Math.abs(y), Math.abs(P)) && Math.abs(n - Og) <= m * Math.max(1, Math.abs(n), Math.abs(Og)) && Math.abs(r - Vg) <= m * Math.max(1, Math.abs(r), Math.abs(Vg)) && Math.abs(G - vg) <= m * Math.max(1, Math.abs(G), Math.abs(vg));
883
883
  }
884
884
  function M() {
885
885
  var g = new j(3);
@@ -1007,8 +1007,8 @@ function tQ(g, A, I) {
1007
1007
  return g[0] = B * s + E * i + C * a - Q * o, g[1] = C * s + E * o + Q * i - B * a, g[2] = Q * s + E * a + B * o - C * i, g[3] = E * s - B * i - C * o - Q * a, g;
1008
1008
  }
1009
1009
  function mI(g, A, I, B) {
1010
- var C = A[0], Q = A[1], E = A[2], i = A[3], o = I[0], a = I[1], s = I[2], D = I[3], t, h, e, n, r;
1011
- return h = C * o + Q * a + E * s + i * D, h < 0 && (h = -h, o = -o, a = -a, s = -s, D = -D), 1 - h > m ? (t = Math.acos(h), e = Math.sin(t), n = Math.sin((1 - B) * t) / e, r = Math.sin(B * t) / e) : (n = 1 - B, r = B), g[0] = n * C + r * o, g[1] = n * Q + r * a, g[2] = n * E + r * s, g[3] = n * i + r * D, g;
1010
+ var C = A[0], Q = A[1], E = A[2], i = A[3], o = I[0], a = I[1], s = I[2], D = I[3], t, h, y, n, r;
1011
+ return h = C * o + Q * a + E * s + i * D, h < 0 && (h = -h, o = -o, a = -a, s = -s, D = -D), 1 - h > m ? (t = Math.acos(h), y = Math.sin(t), n = Math.sin((1 - B) * t) / y, r = Math.sin(B * t) / y) : (n = 1 - B, r = B), g[0] = n * C + r * o, g[1] = n * Q + r * a, g[2] = n * E + r * s, g[3] = n * i + r * D, g;
1012
1012
  }
1013
1013
  function Fg(g, A) {
1014
1014
  var I = A[0] + A[4] + A[8], B;
@@ -1022,7 +1022,7 @@ function Fg(g, A) {
1022
1022
  }
1023
1023
  return g;
1024
1024
  }
1025
- var hQ = iQ, yQ = oQ, YI = sQ;
1025
+ var hQ = iQ, eQ = oQ, YI = sQ;
1026
1026
  (function() {
1027
1027
  var g = M(), A = x(1, 0, 0), I = x(0, 1, 0);
1028
1028
  return function(B, C, Q) {
@@ -1054,7 +1054,7 @@ function v(g, A) {
1054
1054
  var I = new j(2);
1055
1055
  return I[0] = g, I[1] = A, I;
1056
1056
  }
1057
- function eQ(g, A) {
1057
+ function yQ(g, A) {
1058
1058
  var I = A[0] - g[0], B = A[1] - g[1];
1059
1059
  return Math.sqrt(I * I + B * B);
1060
1060
  }
@@ -1296,7 +1296,7 @@ function SQ(g) {
1296
1296
  return 4;
1297
1297
  }
1298
1298
  }
1299
- function RQ(g) {
1299
+ function cQ(g) {
1300
1300
  switch (g.dataType) {
1301
1301
  case "byte":
1302
1302
  case "unsigned_byte":
@@ -1311,13 +1311,13 @@ function RQ(g) {
1311
1311
  }
1312
1312
  }
1313
1313
  function gg(g) {
1314
- const A = SQ(g) * RQ(g), I = Math.max(1, g.mipmapLevels);
1314
+ const A = SQ(g) * cQ(g), I = Math.max(1, g.mipmapLevels);
1315
1315
  let B = Math.max(1, g.width), C = Math.max(1, g.height), Q = Math.max(1, g.depth), E = 0;
1316
1316
  for (let i = 0; i < I; ++i)
1317
1317
  E += A * Q * B * C, B = Math.max(1, B >> 1), C = Math.max(1, C >> 1), g.type === "Texture3D" && (Q = Math.max(1, Q >> 1));
1318
1318
  return E;
1319
1319
  }
1320
- function cQ(g) {
1320
+ function RQ(g) {
1321
1321
  if (g.dataFormat === "rgb" || g.dataFormat === "rgba")
1322
1322
  return [0, 1];
1323
1323
  switch (g.dataType) {
@@ -1337,7 +1337,7 @@ function cQ(g) {
1337
1337
  return [0, 1];
1338
1338
  }
1339
1339
  }
1340
- class Rg extends dI {
1340
+ class cg extends dI {
1341
1341
  dataFormat = "rgba";
1342
1342
  dataType = "unsigned_byte";
1343
1343
  maxFilter = "nearest";
@@ -2138,18 +2138,18 @@ class dQ extends KC {
2138
2138
  default:
2139
2139
  n in D && C.setUniform(n, D[n]);
2140
2140
  }
2141
- const t = this.glGetPrimitive(A.primitive), h = A.indexData, { instanceCount: e } = A;
2142
- e !== null ? h.length ? this.gl_.drawElementsInstanced(
2141
+ const t = this.glGetPrimitive(A.primitive), h = A.indexData, { instanceCount: y } = A;
2142
+ y !== null ? h.length ? this.gl_.drawElementsInstanced(
2143
2143
  t,
2144
2144
  h.length,
2145
2145
  this.gl_.UNSIGNED_INT,
2146
2146
  0,
2147
- e
2147
+ y
2148
2148
  ) : this.gl_.drawArraysInstanced(
2149
2149
  t,
2150
2150
  0,
2151
2151
  A.vertexCount,
2152
- e
2152
+ y
2153
2153
  ) : h.length ? this.gl_.drawElements(t, h.length, this.gl_.UNSIGNED_INT, 0) : this.gl_.drawArrays(t, 0, A.vertexCount);
2154
2154
  }
2155
2155
  uploadTexture(A) {
@@ -2241,15 +2241,15 @@ class YQ {
2241
2241
  this.running_.set(I, { controller: C, promise: Q });
2242
2242
  }
2243
2243
  }
2244
- let hI = 0, yI = 0;
2244
+ let hI = 0, eI = 0;
2245
2245
  function MQ(g, A) {
2246
- g.data && (hI -= g.data.byteLength, yI -= 1), g.data = A, hI += A.byteLength, yI += 1;
2246
+ g.data && (hI -= g.data.byteLength, eI -= 1), g.data = A, hI += A.byteLength, eI += 1;
2247
2247
  }
2248
2248
  function EB(g) {
2249
- g.data && (hI -= g.data.byteLength, yI -= 1), g.data = void 0, g.texture?.releaseCpuData();
2249
+ g.data && (hI -= g.data.byteLength, eI -= 1), g.data = void 0, g.texture?.releaseCpuData();
2250
2250
  }
2251
2251
  function KQ() {
2252
- return { cpuChunkBytes: hI, cpuChunkCount: yI };
2252
+ return { cpuChunkBytes: hI, cpuChunkCount: eI };
2253
2253
  }
2254
2254
  function iB(g, A, I = 1e-6) {
2255
2255
  return Math.abs(g - A) <= I;
@@ -2411,14 +2411,14 @@ class lQ {
2411
2411
  GQ(D, B.min, B.max, 0.5);
2412
2412
  const t = this.makeViewBounds3D(B, o);
2413
2413
  this.chunkViewStates_.forEach(TA);
2414
- const h = this.channelsOfInterest(A.c), e = this.lodRange().max, n = this.getPaddedBounds(t), r = new aB(
2414
+ const h = this.channelsOfInterest(A.c), y = this.lodRange().max, n = this.getPaddedBounds(t), r = new aB(
2415
2415
  this.axes_,
2416
2416
  A[this.axes_.w],
2417
2417
  B,
2418
2418
  this.store_.dimensions[this.axes_.w]
2419
- ), G = this.currentLOD, L = G === e ? [G] : [G, e];
2419
+ ), G = this.currentLOD, L = G === y ? [G] : [G, y];
2420
2420
  for (const N of L) {
2421
- const S = N === G, F = N === e;
2421
+ const S = N === G, F = N === y;
2422
2422
  this.iterateChunksInBox(
2423
2423
  s,
2424
2424
  N,
@@ -2537,12 +2537,12 @@ class lQ {
2537
2537
  t / this.sourceMaxSquareDistance2D_,
2538
2538
  0,
2539
2539
  1 - Number.EPSILON
2540
- ), e = a + h;
2540
+ ), y = a + h;
2541
2541
  this.chunkViewStates_.set(D, {
2542
2542
  visible: !1,
2543
2543
  prefetch: !0,
2544
2544
  priority: i,
2545
- orderKey: e
2545
+ orderKey: y
2546
2546
  });
2547
2547
  }
2548
2548
  );
@@ -2574,7 +2574,7 @@ class lQ {
2574
2574
  // Half-open chunk-index range [min, max) at a given LOD that covers `bounds`.
2575
2575
  // Returns null if the bounds don't overlap the data grid.
2576
2576
  chunkIndexRange(A, I) {
2577
- const B = this.store_.dimensions, C = B.x.lods[I], Q = B.y.lods[I], E = B.z?.lods[I], i = Math.ceil(C.size / C.chunkSize), o = Math.ceil(Q.size / Q.chunkSize), a = E ? Math.ceil(E.size / E.chunkSize) : 1, s = C.chunkSize * C.scale, D = Q.chunkSize * Q.scale, t = E ? E.chunkSize * E.scale : 1, h = C.translation, e = Q.translation, n = E?.translation ?? 0, r = Math.max(0, TI((A.min[0] - h) / s)), G = Math.min(i, xI((A.max[0] - h) / s)), L = Math.max(0, TI((A.min[1] - e) / D)), N = Math.min(o, xI((A.max[1] - e) / D)), S = E ? Math.max(0, TI((A.min[2] - n) / t)) : 0, F = E ? Math.min(a, xI((A.max[2] - n) / t)) : 1;
2577
+ const B = this.store_.dimensions, C = B.x.lods[I], Q = B.y.lods[I], E = B.z?.lods[I], i = Math.ceil(C.size / C.chunkSize), o = Math.ceil(Q.size / Q.chunkSize), a = E ? Math.ceil(E.size / E.chunkSize) : 1, s = C.chunkSize * C.scale, D = Q.chunkSize * Q.scale, t = E ? E.chunkSize * E.scale : 1, h = C.translation, y = Q.translation, n = E?.translation ?? 0, r = Math.max(0, TI((A.min[0] - h) / s)), G = Math.min(i, xI((A.max[0] - h) / s)), L = Math.max(0, TI((A.min[1] - y) / D)), N = Math.min(o, xI((A.max[1] - y) / D)), S = E ? Math.max(0, TI((A.min[2] - n) / t)) : 0, F = E ? Math.min(a, xI((A.max[2] - n) / t)) : 1;
2578
2578
  return r >= G || L >= N || S >= F ? null : { xMin: r, xMax: G, yMin: L, yMax: N, zMin: S, zMax: F };
2579
2579
  }
2580
2580
  iterateChunksInBox(A, I, B, C, Q) {
@@ -2588,8 +2588,8 @@ class lQ {
2588
2588
  for (let D = E.yMin; D < E.yMax; ++D) {
2589
2589
  const t = s[D];
2590
2590
  for (let h = E.xMin; h < E.xMax; ++h) {
2591
- const e = t[h];
2592
- Q(e);
2591
+ const y = t[h];
2592
+ Q(y);
2593
2593
  }
2594
2594
  }
2595
2595
  }
@@ -2703,15 +2703,15 @@ class fQ {
2703
2703
  const { size: I } = this.getAndValidateTimeDimension(), { size: B } = this.getAndValidateChannelDimension(), C = this.dimensions_.numLods;
2704
2704
  this.chunks_ = new Array(C);
2705
2705
  for (let Q = 0; Q < C; ++Q) {
2706
- const E = this.dimensions_.x.lods[Q], i = this.dimensions_.y.lods[Q], o = this.dimensions_.z?.lods[Q], a = E.chunkSize, s = i.chunkSize, D = o?.chunkSize ?? 1, t = Math.ceil(E.size / a), h = Math.ceil(i.size / s), e = o ? Math.ceil(o.size / D) : 1, n = new Array(I);
2706
+ const E = this.dimensions_.x.lods[Q], i = this.dimensions_.y.lods[Q], o = this.dimensions_.z?.lods[Q], a = E.chunkSize, s = i.chunkSize, D = o?.chunkSize ?? 1, t = Math.ceil(E.size / a), h = Math.ceil(i.size / s), y = o ? Math.ceil(o.size / D) : 1, n = new Array(I);
2707
2707
  this.chunks_[Q] = n;
2708
2708
  for (let r = 0; r < I; ++r) {
2709
2709
  const G = new Array(B);
2710
2710
  n[r] = G;
2711
2711
  for (let L = 0; L < B; ++L) {
2712
- const N = new Array(e);
2712
+ const N = new Array(y);
2713
2713
  G[L] = N;
2714
- for (let S = 0; S < e; ++S) {
2714
+ for (let S = 0; S < y; ++S) {
2715
2715
  const F = o !== void 0 ? o.translation + S * D * o.scale : 0, U = new Array(h);
2716
2716
  N[S] = U;
2717
2717
  for (let l = 0; l < h; ++l) {
@@ -2896,7 +2896,7 @@ function mQ(g, A) {
2896
2896
  }
2897
2897
  return { viewportId: g, requested: I, resident: B, current: C };
2898
2898
  }
2899
- class cg extends Rg {
2899
+ class Rg extends cg {
2900
2900
  width_;
2901
2901
  height_;
2902
2902
  depth_;
@@ -2921,7 +2921,7 @@ class cg extends Rg {
2921
2921
  throw new Error(
2922
2922
  "Unable to create texture, chunk data is not initialized."
2923
2923
  );
2924
- const B = new cg(
2924
+ const B = new Rg(
2925
2925
  I,
2926
2926
  A.shape.x,
2927
2927
  A.shape.y,
@@ -3044,7 +3044,7 @@ class WQ {
3044
3044
  B.sort(xA);
3045
3045
  const C = Math.min(B.length, this.maxGpuUploadsPerUpdate_);
3046
3046
  for (let Q = 0; Q < C; Q++) {
3047
- const E = B[Q], i = cg.createWithChunk(E);
3047
+ const E = B[Q], i = Rg.createWithChunk(E);
3048
3048
  this.uploadTexture_(i), A.setChunkTexture(E, i), EB(E);
3049
3049
  }
3050
3050
  }
@@ -3462,7 +3462,7 @@ function aC(g, A) {
3462
3462
  }
3463
3463
  function ZQ(g, A) {
3464
3464
  if (g === void 0)
3465
- return cQ(A);
3465
+ return RQ(A);
3466
3466
  if (g[1] <= g[0])
3467
3467
  throw new Error(
3468
3468
  `Contrast limits must be strictly increasing: ${g}.`
@@ -3515,7 +3515,7 @@ class sC {
3515
3515
  * @param q - The new rotation.
3516
3516
  */
3517
3517
  setRotation(A) {
3518
- yQ(this.rotation_, A), this.dirty_ = !0;
3518
+ eQ(this.rotation_, A), this.dirty_ = !0;
3519
3519
  }
3520
3520
  /** A copy of the rotation quaternion. */
3521
3521
  get rotation() {
@@ -3738,15 +3738,15 @@ class DC extends pA {
3738
3738
  super();
3739
3739
  const Q = [], E = [], i = B, o = C, a = i + 1, s = o + 1, D = A / i, t = I / o;
3740
3740
  for (let h = 0; h < s; ++h) {
3741
- const e = h * t;
3741
+ const y = h * t;
3742
3742
  for (let n = 0; n < a; ++n) {
3743
- const r = n * D, G = n / i, L = h / o, N = [r, e, 0], S = [0, 0, 1], F = [G, L];
3743
+ const r = n * D, G = n / i, L = h / o, N = [r, y, 0], S = [0, 0, 1], F = [G, L];
3744
3744
  Q.push(...N, ...S, ...F);
3745
3745
  }
3746
3746
  }
3747
3747
  for (let h = 0; h < o; ++h)
3748
- for (let e = 0; e < i; ++e) {
3749
- const n = e + a * h, r = e + a * (h + 1), G = e + 1 + a * (h + 1), L = e + 1 + a * h;
3748
+ for (let y = 0; y < i; ++y) {
3749
+ const n = y + a * h, r = y + a * (h + 1), G = y + 1 + a * (h + 1), L = y + 1 + a * h;
3750
3750
  E.push(n, r, L), E.push(r, G, L);
3751
3751
  }
3752
3752
  this.vertexData_ = new Float32Array(Q), this.indexData_ = new Uint32Array(E), this.addAttribute({
@@ -3878,7 +3878,7 @@ function tC(g, A, I, B, C = 3) {
3878
3878
  case "pointerup": {
3879
3879
  if (!A) return A;
3880
3880
  const Q = g.event, E = v(Q.clientX, Q.clientY);
3881
- if (eQ(A, E) < C) {
3881
+ if (yQ(A, E) < C) {
3882
3882
  if (!B) return null;
3883
3883
  const o = g.worldRay;
3884
3884
  return o && I(o).then((a) => {
@@ -3921,6 +3921,7 @@ class Jg extends KI {
3921
3921
  onPickValue_;
3922
3922
  visibleChunks_ = /* @__PURE__ */ new Map();
3923
3923
  orderedChunks_ = [];
3924
+ lastSliceCoord_;
3924
3925
  pool_ = new Lg();
3925
3926
  initialChannelProps_;
3926
3927
  channelChangeCallbacks_ = [];
@@ -3976,15 +3977,19 @@ class Jg extends KI {
3976
3977
  * @param viewport - The viewport being rendered.
3977
3978
  */
3978
3979
  update(A) {
3979
- if (!A || !this.chunkStoreView_) return !0;
3980
+ if (!A || !this.chunkStoreView_) return !1;
3980
3981
  const I = A.camera, B = I.type === "OrthographicCamera" ? I.getWorldViewRect() : this.chunkStoreView_.getWholePlaneRect();
3981
3982
  this.chunkStoreView_.updateChunksForImage(this.sliceCoords_, {
3982
3983
  worldViewRect: B,
3983
3984
  bufferWidthPx: A.getBufferRect().width
3984
- }), this.updateChunks();
3985
- for (const [C, Q] of this.visibleChunks_)
3986
- this.updateSlicePosition(Q, C);
3987
- return !0;
3985
+ });
3986
+ const C = this.updateChunks(), Q = this.sliceCoords_[this.axes_.w], E = Q !== this.lastSliceCoord_;
3987
+ if (E) {
3988
+ for (const [i, o] of this.visibleChunks_)
3989
+ this.updateSlicePosition(o, i);
3990
+ this.lastSliceCoord_ = Q;
3991
+ }
3992
+ return C || E;
3988
3993
  }
3989
3994
  /** The slice plane the layer displays. */
3990
3995
  get orientation() {
@@ -3998,31 +4003,34 @@ class Jg extends KI {
3998
4003
  * @param orientation - The new slice plane.
3999
4004
  */
4000
4005
  setOrientation(A) {
4001
- A !== this.orientation_ && (this.releaseAndRemoveChunks(this.visibleChunks_.keys()), this.orderedChunks_ = [], this.clearObjects(), this.chunkStoreView_?.dispose(), this.lastPresentationTimeStamp_ = void 0, this.lastPresentationTimeCoord_ = void 0, this.orientation_ = A, this.axes_ = dA(A), this.planeRotation_ = YA(this.axes_), this.context_ && (this.chunkStoreView_ = this.context_.chunkManager.addView(
4006
+ A !== this.orientation_ && (this.releaseAndRemoveChunks(this.visibleChunks_.keys()), this.orderedChunks_ = [], this.clearObjects(), this.chunkStoreView_?.dispose(), this.lastPresentationTimeStamp_ = void 0, this.lastPresentationTimeCoord_ = void 0, this.orientation_ = A, this.axes_ = dA(A), this.planeRotation_ = YA(this.axes_), this.invalidate(), this.context_ && (this.chunkStoreView_ = this.context_.chunkManager.addView(
4002
4007
  this.source_,
4003
4008
  this.policy_,
4004
4009
  this.axes_
4005
4010
  )));
4006
4011
  }
4007
4012
  updateChunks() {
4008
- if (!this.chunkStoreView_) return;
4013
+ if (!this.chunkStoreView_)
4014
+ return !1;
4009
4015
  this.state !== "ready" && this.setState("ready");
4010
4016
  const A = Array.from(this.visibleChunks_.keys()).every(
4011
- (Q) => Q.texture !== void 0
4012
- );
4013
- if (this.visibleChunks_.size > 0 && A && !this.chunkStoreView_.hasCompleteVisibleLOD() && !this.isPresentationStale())
4014
- return;
4015
- this.lastPresentationTimeStamp_ = performance.now(), this.lastPresentationTimeCoord_ = this.sliceCoords_.t;
4016
- const I = this.chunkStoreView_.getChunksToRender(), B = new Set(I), C = Array.from(this.visibleChunks_.keys()).filter(
4017
- (Q) => !B.has(Q)
4017
+ (i) => i.texture !== void 0
4018
+ ), I = this.visibleChunks_.size > 0 && A && !this.chunkStoreView_.hasCompleteVisibleLOD() && !this.isPresentationStale();
4019
+ I || (this.lastPresentationTimeStamp_ = performance.now(), this.lastPresentationTimeCoord_ = this.sliceCoords_.t);
4020
+ const B = I ? this.orderedChunks_ : this.chunkStoreView_.getChunksToRender();
4021
+ if (!(B.length !== this.orderedChunks_.length || B.some(
4022
+ (i, o) => i !== this.orderedChunks_[o] || i.texture !== this.visibleChunks_.get(i)?.textures[0]
4023
+ ))) return !1;
4024
+ const Q = new Set(B), E = Array.from(this.visibleChunks_.keys()).filter(
4025
+ (i) => !Q.has(i)
4018
4026
  );
4019
- this.releaseAndRemoveChunks(C);
4020
- for (const Q of I)
4027
+ this.releaseAndRemoveChunks(E);
4028
+ for (const i of B)
4021
4029
  this.visibleChunks_.set(
4022
- Q,
4023
- this.getImageForChunk(Q, Q.texture)
4030
+ i,
4031
+ this.getImageForChunk(i, i.texture)
4024
4032
  );
4025
- this.orderedChunks_ = I, this.rebuildRenderGroups();
4033
+ return this.orderedChunks_ = B, this.rebuildRenderGroups(), !0;
4026
4034
  }
4027
4035
  rebuildRenderGroups() {
4028
4036
  this.clearObjects();
@@ -4096,9 +4104,10 @@ class Jg extends KI {
4096
4104
  }
4097
4105
  getImageForChunk(A, I) {
4098
4106
  const B = this.visibleChunks_.get(A);
4099
- if (B) return B;
4107
+ if (B)
4108
+ return B.setTexture(0, I), B;
4100
4109
  const C = this.pool_.acquire(
4101
- eI(A, this.axes_)
4110
+ yI(A, this.axes_)
4102
4111
  );
4103
4112
  return C ? (C.setTexture(0, I), C.setChannelProps(this.getChannelPropsForChunk(A)), this.updateImageChunk(C, A), C) : this.createImage(A, I);
4104
4113
  }
@@ -4165,9 +4174,9 @@ class Jg extends KI {
4165
4174
  }
4166
4175
  /** @param debug - Whether to draw chunk wireframes. */
4167
4176
  set debugMode(A) {
4168
- this.debugMode_ = A, this.visibleChunks_.forEach((I, B) => {
4177
+ A !== this.debugMode_ && (this.debugMode_ = A, this.visibleChunks_.forEach((I, B) => {
4169
4178
  I.wireframeEnabled = this.debugMode_, this.debugMode_ && (I.wireframeColor = this.wireframeColors_[B.lod % this.wireframeColors_.length]);
4170
- });
4179
+ }), this.invalidate());
4171
4180
  }
4172
4181
  /** The current per-channel appearance settings. */
4173
4182
  get channelProps() {
@@ -4182,7 +4191,7 @@ class Jg extends KI {
4182
4191
  setChannelProps(A) {
4183
4192
  this.channelProps_ = A, this.visibleChunks_.forEach((I, B) => {
4184
4193
  I.setChannelProps(this.getChannelPropsForChunk(B));
4185
- }), this.rebuildRenderGroups(), this.channelChangeCallbacks_.forEach((I) => {
4194
+ }), this.rebuildRenderGroups(), this.invalidate(), this.channelChangeCallbacks_.forEach((I) => {
4186
4195
  I();
4187
4196
  });
4188
4197
  }
@@ -4212,11 +4221,11 @@ class Jg extends KI {
4212
4221
  releaseAndRemoveChunks(A) {
4213
4222
  for (const I of A) {
4214
4223
  const B = this.visibleChunks_.get(I);
4215
- B && (this.pool_.release(eI(I, this.axes_), B), this.visibleChunks_.delete(I));
4224
+ B && (this.pool_.release(yI(I, this.axes_), B), this.visibleChunks_.delete(I));
4216
4225
  }
4217
4226
  }
4218
4227
  }
4219
- function eI(g, A) {
4228
+ function yI(g, A) {
4220
4229
  return [
4221
4230
  `plane${A.u}${A.v}`,
4222
4231
  `lod${g.lod}`,
@@ -4224,7 +4233,7 @@ function eI(g, A) {
4224
4233
  `align${g.rowAlignmentBytes}`
4225
4234
  ].join(":");
4226
4235
  }
4227
- class DB extends Rg {
4236
+ class DB extends cg {
4228
4237
  width_;
4229
4238
  height_;
4230
4239
  constructor(A, I, B) {
@@ -4364,6 +4373,8 @@ class dg extends KI {
4364
4373
  onPickValue_;
4365
4374
  outlineSelected_;
4366
4375
  visibleChunks_ = /* @__PURE__ */ new Map();
4376
+ orderedChunks_ = [];
4377
+ lastSliceCoord_;
4367
4378
  pool_ = new Lg();
4368
4379
  colorMap_;
4369
4380
  selectedValue_ = null;
@@ -4404,7 +4415,7 @@ class dg extends KI {
4404
4415
  }
4405
4416
  /** @hidden */
4406
4417
  detach(A) {
4407
- this.releaseAndRemoveChunks(this.visibleChunks_.keys()), this.clearObjects(), this.chunkStoreView_?.dispose(), this.chunkStoreView_ = void 0, this.context_ = void 0;
4418
+ this.releaseAndRemoveChunks(this.visibleChunks_.keys()), this.orderedChunks_ = [], this.clearObjects(), this.chunkStoreView_?.dispose(), this.chunkStoreView_ = void 0, this.context_ = void 0;
4408
4419
  }
4409
4420
  /**
4410
4421
  * Streams chunks for the current view and refreshes the visible slice.
@@ -4413,15 +4424,19 @@ class dg extends KI {
4413
4424
  * @param viewport - The viewport being rendered.
4414
4425
  */
4415
4426
  update(A) {
4416
- if (!A || !this.chunkStoreView_) return !0;
4427
+ if (!A || !this.chunkStoreView_) return !1;
4417
4428
  const I = A.camera, B = I.type === "OrthographicCamera" ? I.getWorldViewRect() : this.chunkStoreView_.getWholePlaneRect();
4418
4429
  this.chunkStoreView_.updateChunksForImage(this.sliceCoords_, {
4419
4430
  worldViewRect: B,
4420
4431
  bufferWidthPx: A.getBufferRect().width
4421
- }), this.updateChunks();
4422
- for (const [C, Q] of this.visibleChunks_)
4423
- this.updateSlicePosition(Q, C);
4424
- return !0;
4432
+ });
4433
+ const C = this.updateChunks(), Q = this.sliceCoords_[this.axes_.w], E = Q !== this.lastSliceCoord_;
4434
+ if (E) {
4435
+ for (const [i, o] of this.visibleChunks_)
4436
+ this.updateSlicePosition(o, i);
4437
+ this.lastSliceCoord_ = Q;
4438
+ }
4439
+ return C || E;
4425
4440
  }
4426
4441
  /** The slice plane the layer displays. */
4427
4442
  get orientation() {
@@ -4435,29 +4450,33 @@ class dg extends KI {
4435
4450
  * @param orientation - The new slice plane.
4436
4451
  */
4437
4452
  setOrientation(A) {
4438
- A !== this.orientation_ && (this.releaseAndRemoveChunks(this.visibleChunks_.keys()), this.clearObjects(), this.chunkStoreView_?.dispose(), this.lastPresentationTimeStamp_ = void 0, this.lastPresentationTimeCoord_ = void 0, this.orientation_ = A, this.axes_ = dA(A), this.planeRotation_ = YA(this.axes_), this.context_ && (this.chunkStoreView_ = this.context_.chunkManager.addView(
4453
+ A !== this.orientation_ && (this.releaseAndRemoveChunks(this.visibleChunks_.keys()), this.orderedChunks_ = [], this.clearObjects(), this.chunkStoreView_?.dispose(), this.lastPresentationTimeStamp_ = void 0, this.lastPresentationTimeCoord_ = void 0, this.orientation_ = A, this.axes_ = dA(A), this.planeRotation_ = YA(this.axes_), this.invalidate(), this.context_ && (this.chunkStoreView_ = this.context_.chunkManager.addView(
4439
4454
  this.source_,
4440
4455
  this.policy_,
4441
4456
  this.axes_
4442
4457
  )));
4443
4458
  }
4444
4459
  updateChunks() {
4445
- if (!this.chunkStoreView_) return;
4460
+ if (!this.chunkStoreView_)
4461
+ return !1;
4446
4462
  this.state !== "ready" && this.setState("ready");
4447
4463
  const A = Array.from(this.visibleChunks_.keys()).every(
4448
- (Q) => Q.texture !== void 0
4464
+ (i) => i.texture !== void 0
4465
+ ), I = this.visibleChunks_.size > 0 && A && !this.chunkStoreView_.hasCompleteVisibleLOD() && !this.isPresentationStale();
4466
+ I || (this.lastPresentationTimeStamp_ = performance.now(), this.lastPresentationTimeCoord_ = this.sliceCoords_.t);
4467
+ const B = I ? this.orderedChunks_ : this.chunkStoreView_.getChunksToRender();
4468
+ if (!(B.length !== this.orderedChunks_.length || B.some(
4469
+ (i, o) => i !== this.orderedChunks_[o] || i.texture !== this.visibleChunks_.get(i)?.textures[0]
4470
+ ))) return !1;
4471
+ const Q = new Set(B), E = Array.from(this.visibleChunks_.keys()).filter(
4472
+ (i) => !Q.has(i)
4449
4473
  );
4450
- if (this.visibleChunks_.size > 0 && A && !this.chunkStoreView_.hasCompleteVisibleLOD() && !this.isPresentationStale())
4451
- return;
4452
- this.lastPresentationTimeStamp_ = performance.now(), this.lastPresentationTimeCoord_ = this.sliceCoords_.t;
4453
- const I = this.chunkStoreView_.getChunksToRender(), B = new Set(I), C = Array.from(this.visibleChunks_.keys()).filter(
4454
- (Q) => !B.has(Q)
4455
- );
4456
- this.releaseAndRemoveChunks(C), this.clearObjects();
4457
- for (const Q of I) {
4458
- const E = this.getLabelForChunk(Q, Q.texture);
4459
- this.visibleChunks_.set(Q, E), this.addObject(E, 0);
4474
+ this.releaseAndRemoveChunks(E), this.clearObjects();
4475
+ for (const i of B) {
4476
+ const o = this.getLabelForChunk(i, i.texture);
4477
+ this.visibleChunks_.set(i, o), this.addObject(o, 0);
4460
4478
  }
4479
+ return this.orderedChunks_ = B, !0;
4461
4480
  }
4462
4481
  isPresentationStale() {
4463
4482
  return this.lastPresentationTimeStamp_ === void 0 ? !1 : performance.now() - this.lastPresentationTimeStamp_ > dg.STALE_PRESENTATION_MS_;
@@ -4503,7 +4522,7 @@ class dg extends KI {
4503
4522
  setColorMap(A) {
4504
4523
  this.colorMap_ = nI(A), this.visibleChunks_.forEach((I) => {
4505
4524
  I.setColorMap(this.colorMap_);
4506
- });
4525
+ }), this.invalidate();
4507
4526
  }
4508
4527
  /**
4509
4528
  * Sets the label value drawn as selected or `null` to clear the
@@ -4512,9 +4531,9 @@ class dg extends KI {
4512
4531
  * @param value - The label value to select.
4513
4532
  */
4514
4533
  setSelectedValue(A) {
4515
- this.selectedValue_ = A, this.visibleChunks_.forEach((I) => {
4534
+ A !== this.selectedValue_ && (this.selectedValue_ = A, this.visibleChunks_.forEach((I) => {
4516
4535
  I.setSelectedValue(this.selectedValue_);
4517
- });
4536
+ }), this.invalidate());
4518
4537
  }
4519
4538
  /**
4520
4539
  * The slice coordinates the layer displays. This is the object passed
@@ -4581,9 +4600,10 @@ class dg extends KI {
4581
4600
  }
4582
4601
  getLabelForChunk(A, I) {
4583
4602
  const B = this.visibleChunks_.get(A);
4584
- if (B) return B;
4603
+ if (B)
4604
+ return B.setTexture(0, I), B;
4585
4605
  const C = this.pool_.acquire(
4586
- eI(A, this.axes_)
4606
+ yI(A, this.axes_)
4587
4607
  );
4588
4608
  return C ? (C.setTexture(0, I), C.setColorMap(this.colorMap_), C.setSelectedValue(this.selectedValue_), this.updateLabelChunk(C, A), C) : this.createLabel(A, I);
4589
4609
  }
@@ -4616,7 +4636,7 @@ class dg extends KI {
4616
4636
  releaseAndRemoveChunks(A) {
4617
4637
  for (const I of A) {
4618
4638
  const B = this.visibleChunks_.get(I);
4619
- B && (this.pool_.release(eI(I, this.axes_), B), this.visibleChunks_.delete(I));
4639
+ B && (this.pool_.release(yI(I, this.axes_), B), this.visibleChunks_.delete(I));
4620
4640
  }
4621
4641
  }
4622
4642
  }
@@ -4639,11 +4659,11 @@ class gE extends pA {
4639
4659
  });
4640
4660
  }
4641
4661
  buildFace(A, I, B, C, Q, E, i, o, a, s, D, t, h) {
4642
- const e = E / a, n = i / s, r = E / 2, G = i / 2, L = o / 2 * D, N = a + 1, S = s + 1, F = t.length / 8;
4662
+ const y = E / a, n = i / s, r = E / 2, G = i / 2, L = o / 2 * D, N = a + 1, S = s + 1, F = t.length / 8;
4643
4663
  for (let U = 0; U < S; U++) {
4644
4664
  const l = -G + U * n;
4645
4665
  for (let Z = 0; Z < N; Z++) {
4646
- const O = -r + Z * e, b = { x: 0, y: 0, z: 0 };
4666
+ const O = -r + Z * y, b = { x: 0, y: 0, z: 0 };
4647
4667
  b[A] = O * C, b[I] = l * Q, b[B] = L;
4648
4668
  const z = { x: 0, y: 0, z: 0 };
4649
4669
  z[B] = D;
@@ -4848,6 +4868,7 @@ class EE extends KI {
4848
4868
  source_;
4849
4869
  sliceCoords_;
4850
4870
  currentVolumes_ = /* @__PURE__ */ new Map();
4871
+ renderedChunks_ = [];
4851
4872
  volumeToPoolKey_ = /* @__PURE__ */ new Map();
4852
4873
  pool_ = new Lg();
4853
4874
  initialChannelProps_;
@@ -4855,9 +4876,13 @@ class EE extends KI {
4855
4876
  policy_;
4856
4877
  chunkStoreView_;
4857
4878
  channelProps_;
4858
- lastLoadedTime_ = void 0;
4859
- lastNumRenderedChannelChunks_ = void 0;
4860
4879
  interactiveStepSizeScale_ = 1;
4880
+ previousAppearanceState_ = {
4881
+ debugShowDegenerateRays: this.debugShowDegenerateRays,
4882
+ relativeStepSize: this.relativeStepSize,
4883
+ opacityMultiplier: this.opacityMultiplier,
4884
+ earlyTerminationAlpha: this.earlyTerminationAlpha
4885
+ };
4861
4886
  // TODO: Make a debug config object to manage debug options
4862
4887
  debugShowWireframes_ = !1;
4863
4888
  /** Whether chunk bounding wireframes are drawn for debugging. */
@@ -4869,7 +4894,7 @@ class EE extends KI {
4869
4894
  if (this.debugShowWireframes_ !== A) {
4870
4895
  for (const I of this.currentVolumes_.values())
4871
4896
  I.wireframeEnabled = A;
4872
- this.debugShowWireframes_ = A;
4897
+ this.debugShowWireframes_ = A, this.invalidate();
4873
4898
  }
4874
4899
  }
4875
4900
  /**
@@ -4894,7 +4919,7 @@ class EE extends KI {
4894
4919
  this.channelProps_ = A;
4895
4920
  for (const I of this.currentVolumes_.values())
4896
4921
  I.setChannelProps(A);
4897
- this.channelChangeCallbacks_.forEach((I) => {
4922
+ this.invalidate(), this.channelChangeCallbacks_.forEach((I) => {
4898
4923
  I();
4899
4924
  });
4900
4925
  }
@@ -4958,21 +4983,27 @@ class EE extends KI {
4958
4983
  detach(A) {
4959
4984
  for (const I of this.currentVolumes_.values())
4960
4985
  this.releaseAndRemoveVolume(I);
4961
- this.currentVolumes_.clear(), this.clearObjects(), this.chunkStoreView_?.dispose(), this.chunkStoreView_ = void 0;
4986
+ this.currentVolumes_.clear(), this.renderedChunks_ = [], this.clearObjects(), this.chunkStoreView_?.dispose(), this.chunkStoreView_ = void 0;
4962
4987
  }
4963
4988
  updateChunks() {
4964
- if (!this.chunkStoreView_) return;
4989
+ if (!this.chunkStoreView_)
4990
+ return !1;
4965
4991
  this.state !== "ready" && this.setState("ready");
4966
- const A = this.chunkStoreView_.getChunksToRender(), I = this.sliceCoords_.t ?? -1, B = oE(A);
4967
- if (this.lastLoadedTime_ !== I || B.size !== this.currentVolumes_.size || this.lastNumRenderedChannelChunks_ !== A.length) {
4968
- for (const [Q, E] of this.currentVolumes_)
4969
- B.has(Q) || (this.releaseAndRemoveVolume(E), this.currentVolumes_.delete(Q));
4970
- for (const [Q, E] of B) {
4971
- const i = this.getOrCreateVolume(Q, E);
4972
- i.wireframeEnabled = this.debugShowWireframes, this.currentVolumes_.set(Q, i);
4973
- }
4974
- this.lastLoadedTime_ = I, this.lastNumRenderedChannelChunks_ = A.length;
4975
- }
4992
+ const A = this.chunkStoreView_.getChunksToRender();
4993
+ if (!(A.length !== this.renderedChunks_.length || A.some(
4994
+ (C, Q) => C !== this.renderedChunks_[Q].chunk || C.texture !== this.renderedChunks_[Q].texture
4995
+ ))) return !1;
4996
+ const B = oE(A);
4997
+ for (const [C, Q] of this.currentVolumes_)
4998
+ B.has(C) || (this.releaseAndRemoveVolume(Q), this.currentVolumes_.delete(C));
4999
+ for (const [C, Q] of B) {
5000
+ const E = this.getOrCreateVolume(C, Q);
5001
+ E.wireframeEnabled = this.debugShowWireframes, this.currentVolumes_.set(C, E);
5002
+ }
5003
+ return this.renderedChunks_ = A.map((C) => ({
5004
+ chunk: C,
5005
+ texture: C.texture
5006
+ })), !0;
4976
5007
  }
4977
5008
  updateVolumeTransform(A, I) {
4978
5009
  const B = {
@@ -5002,19 +5033,35 @@ class EE extends KI {
5002
5033
  * @param viewport - The viewport being rendered.
5003
5034
  */
5004
5035
  update(A) {
5005
- if (!A || !this.chunkStoreView_) return !0;
5036
+ if (!A || !this.chunkStoreView_)
5037
+ return !1;
5006
5038
  this.chunkStoreView_.updateChunksForVolume(
5007
5039
  this.sliceCoords_,
5008
5040
  A.camera.getViewProjection()
5009
5041
  );
5010
- const I = A.cameraControls?.isMoving ?? !1;
5011
- return this.interactiveStepSizeScale_ = I ? QE : 1, this.updateChunks(), this.rebuildObjects(A.camera), !0;
5042
+ const B = A.cameraControls?.isMoving ?? !1 ? QE : 1, C = B !== this.interactiveStepSizeScale_;
5043
+ this.interactiveStepSizeScale_ = B;
5044
+ const Q = this.updateChunks(), E = this.rebuildObjects(A.camera), i = this.updateAppearanceState();
5045
+ return Q || E || C || i;
5046
+ }
5047
+ updateAppearanceState() {
5048
+ const A = this.previousAppearanceState_;
5049
+ return this.debugShowDegenerateRays !== A.debugShowDegenerateRays || this.relativeStepSize !== A.relativeStepSize || this.opacityMultiplier !== A.opacityMultiplier || this.earlyTerminationAlpha !== A.earlyTerminationAlpha ? (this.previousAppearanceState_ = {
5050
+ debugShowDegenerateRays: this.debugShowDegenerateRays,
5051
+ relativeStepSize: this.relativeStepSize,
5052
+ opacityMultiplier: this.opacityMultiplier,
5053
+ earlyTerminationAlpha: this.earlyTerminationAlpha
5054
+ }, !0) : !1;
5012
5055
  }
5013
5056
  rebuildObjects(A) {
5014
5057
  const I = Array.from(this.currentVolumes_.values());
5015
- sE(I, A), this.clearObjects();
5016
- for (const B of I)
5017
- this.addObject(B);
5058
+ sE(I, A);
5059
+ const B = this.coverageGroups.get(null) ?? [];
5060
+ if (!(I.length !== B.length || I.some((Q, E) => Q !== B[E]))) return !1;
5061
+ this.clearObjects();
5062
+ for (const Q of I)
5063
+ this.addObject(Q);
5064
+ return !0;
5018
5065
  }
5019
5066
  /** @hidden */
5020
5067
  get chunkStoreView() {
@@ -5189,13 +5236,13 @@ var ZA = function(g = 1) {
5189
5236
  };
5190
5237
  };
5191
5238
  ZA.Panel = function(g, A, I, B) {
5192
- 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), D = E(2 * i * B), t = E(3 * i * B), h = E(15 * i * B), e = E(74 * i * B), n = E(30 * i * B), r = document.createElement("canvas");
5239
+ 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), D = E(2 * i * B), t = E(3 * i * B), h = E(15 * i * B), y = E(74 * i * B), n = E(30 * i * B), r = document.createElement("canvas");
5193
5240
  r.width = o, r.height = a, r.style.cssText = `width:${E(B * 80)}px;height:${E(B * 48)}px`;
5194
5241
  var G = r.getContext("2d");
5195
- return G.font = "bold " + E(9 * i * B) + "px Helvetica,Arial,sans-serif", G.textBaseline = "top", G.fillStyle = I, G.fillRect(0, 0, o, a), G.fillStyle = A, G.fillText(g, s, D), G.fillRect(t, h, e, n), G.fillStyle = I, G.globalAlpha = 0.9, G.fillRect(t, h, e, n), {
5242
+ return G.font = "bold " + E(9 * i * B) + "px Helvetica,Arial,sans-serif", G.textBaseline = "top", G.fillStyle = I, G.fillRect(0, 0, o, a), G.fillStyle = A, G.fillText(g, s, D), G.fillRect(t, h, y, n), G.fillStyle = I, G.globalAlpha = 0.9, G.fillRect(t, h, y, n), {
5196
5243
  dom: r,
5197
5244
  update: function(L, N) {
5198
- C = Math.min(C, L), Q = Math.max(Q, L), G.fillStyle = I, G.globalAlpha = 1, G.fillRect(0, 0, o, h), G.fillStyle = A, G.fillText(E(L) + " " + g + " (" + E(C) + "-" + E(Q) + ")", s, D), G.drawImage(r, t + i, h, e - i, n, t, h, e - i, n), G.fillRect(t + e - i, h, i, n), G.fillStyle = I, G.globalAlpha = 0.9, G.fillRect(t + e - i, h, i, E((1 - L / N) * n));
5245
+ C = Math.min(C, L), Q = Math.max(Q, L), G.fillStyle = I, G.globalAlpha = 1, G.fillRect(0, 0, o, h), G.fillStyle = A, G.fillText(E(L) + " " + g + " (" + E(C) + "-" + E(Q) + ")", s, D), G.drawImage(r, t + i, h, y - i, n, t, h, y - i, n), G.fillRect(t + y - i, h, i, n), G.fillStyle = I, G.globalAlpha = 0.9, G.fillRect(t + y - i, h, i, E((1 - L / N) * n));
5199
5246
  }
5200
5247
  };
5201
5248
  };
@@ -5265,7 +5312,7 @@ class hE {
5265
5312
  this.elements_.splice(I, 1), this.resizeObserver_ && this.resizeObserver_.unobserve(A);
5266
5313
  }
5267
5314
  }
5268
- const yE = 2048;
5315
+ const eE = 2048;
5269
5316
  function tB(g, A) {
5270
5317
  for (const B of A) {
5271
5318
  if (B.id === g.id)
@@ -5313,7 +5360,7 @@ class Yo {
5313
5360
  */
5314
5361
  constructor(A) {
5315
5362
  this.canvas = A.canvas, this.renderer_ = new dQ(this.canvas);
5316
- const B = (A.memoryLimitMB ?? yE) * 1024 * 1024;
5363
+ const B = (A.memoryLimitMB ?? eE) * 1024 * 1024;
5317
5364
  this.chunkManager_ = new WQ(
5318
5365
  (Q) => this.renderer_.uploadTexture(Q),
5319
5366
  (Q) => this.renderer_.disposeTexture(Q),
@@ -5503,7 +5550,7 @@ const Cg = [
5503
5550
  "pointercancel",
5504
5551
  "wheel"
5505
5552
  ];
5506
- function eE(g) {
5553
+ function yE(g) {
5507
5554
  return Cg.includes(g);
5508
5555
  }
5509
5556
  class nE {
@@ -5568,7 +5615,7 @@ class GE {
5568
5615
  });
5569
5616
  }
5570
5617
  handleEvent = (A) => {
5571
- if (!eE(A.type)) {
5618
+ if (!yE(A.type)) {
5572
5619
  k.error("EventDispatcher", `Unsupported event type ${A.type}`);
5573
5620
  return;
5574
5621
  }
@@ -5752,7 +5799,7 @@ function hB(g, A) {
5752
5799
  const B = new URL(A.slice(1), I);
5753
5800
  return B.search = I.search, B;
5754
5801
  }
5755
- async function yB(g) {
5802
+ async function eB(g) {
5756
5803
  if (g.status !== 404) {
5757
5804
  if (g.status === 200 || g.status === 206)
5758
5805
  return new Uint8Array(await g.arrayBuffer());
@@ -5772,7 +5819,7 @@ class _A {
5772
5819
  }
5773
5820
  async get(A, I = {}) {
5774
5821
  let B = hB(this.url, A).href, C = this.#B(B, I), Q = await this.#A(C);
5775
- return yB(Q);
5822
+ return eB(Q);
5776
5823
  }
5777
5824
  async getRange(A, I, B = {}) {
5778
5825
  let C = hB(this.url, A), Q;
@@ -5788,7 +5835,7 @@ class _A {
5788
5835
  }, i = this.#B(C, E);
5789
5836
  Q = await this.#A(i);
5790
5837
  }
5791
- return yB(Q);
5838
+ return eB(Q);
5792
5839
  }
5793
5840
  async #C(A, I, B) {
5794
5841
  if (this.#g) {
@@ -5841,7 +5888,7 @@ class SE extends $A {
5841
5888
  super(`Unknown codec: ${A}`), this.codec = A;
5842
5889
  }
5843
5890
  }
5844
- class RE extends $A {
5891
+ class cE extends $A {
5845
5892
  _tag = "CodecPipelineError";
5846
5893
  name = "CodecPipelineError";
5847
5894
  direction;
@@ -5891,7 +5938,7 @@ class GI {
5891
5938
  function Mg(g) {
5892
5939
  return g instanceof ArrayBuffer || g instanceof SharedArrayBuffer;
5893
5940
  }
5894
- class yC {
5941
+ class eC {
5895
5942
  #A;
5896
5943
  constructor(A, I, B) {
5897
5944
  typeof A == "number" ? this.#A = new Uint8Array(A) : Mg(A) ? this.#A = new Uint8Array(A, I, B) : this.#A = new Uint8Array(Array.from(A, (C) => C ? 1 : 0));
@@ -6030,7 +6077,7 @@ class AI {
6030
6077
  yield this.get(A);
6031
6078
  }
6032
6079
  }
6033
- function cE() {
6080
+ function RE() {
6034
6081
  if (typeof SharedArrayBuffer > "u")
6035
6082
  throw new Error("SharedArrayBuffer is not available. In browsers, this requires Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy headers to be set.");
6036
6083
  }
@@ -6045,7 +6092,7 @@ function II(g) {
6045
6092
  throw new X("Failed to decode JSON", { cause: I });
6046
6093
  }
6047
6094
  }
6048
- function eB(g, A) {
6095
+ function yB(g, A) {
6049
6096
  const I = A / 2, B = A - 1;
6050
6097
  let C = 0;
6051
6098
  for (let Q = 0; Q < g.length; Q += A)
@@ -6074,7 +6121,7 @@ function mA(g) {
6074
6121
  float16: globalThis.Float16Array,
6075
6122
  float32: Float32Array,
6076
6123
  float64: Float64Array,
6077
- bool: yC
6124
+ bool: eC
6078
6125
  }[g];
6079
6126
  if (!I)
6080
6127
  throw new X(`Unknown or unsupported dataType: ${g}`);
@@ -6214,7 +6261,7 @@ function Qg(g, A) {
6214
6261
  function dE(g) {
6215
6262
  return g?.name === "sharding_indexed";
6216
6263
  }
6217
- function eC(g) {
6264
+ function yC(g) {
6218
6265
  if ((g.data_type === "uint64" || g.data_type === "int64") && g.fill_value != null)
6219
6266
  return BigInt(g.fill_value);
6220
6267
  let A = g.data_type === "float16" || g.data_type === "float32" || g.data_type === "float64";
@@ -6277,13 +6324,13 @@ class HI {
6277
6324
  }
6278
6325
  encode(A) {
6279
6326
  let I = new Uint8Array(A.data.buffer);
6280
- return GB && this.#C === "big" && eB(I, wB(this.#I)), I;
6327
+ return GB && this.#C === "big" && yB(I, wB(this.#I)), I;
6281
6328
  }
6282
6329
  computeEncodedSize(A) {
6283
6330
  return A;
6284
6331
  }
6285
6332
  decode(A) {
6286
- return GB && this.#C === "big" && eB(A, wB(this.#I)), {
6333
+ return GB && this.#C === "big" && yB(A, wB(this.#I)), {
6287
6334
  data: new this.#I(A.buffer, A.byteOffset, A.byteLength / this.#g),
6288
6335
  shape: this.#B,
6289
6336
  stride: this.#A
@@ -6378,7 +6425,7 @@ function HE(g) {
6378
6425
  function qE(g) {
6379
6426
  return Math.sign(g) * Math.floor(Math.abs(g) + 0.5);
6380
6427
  }
6381
- function RB(g) {
6428
+ function cB(g) {
6382
6429
  switch (g) {
6383
6430
  case "nearest-even":
6384
6431
  return HE;
@@ -6429,7 +6476,7 @@ class Hg {
6429
6476
  #g;
6430
6477
  #B;
6431
6478
  constructor(A, I, B, C, Q, E) {
6432
- this.#A = I, this.#I = mA(A), this.#g = cB(I, A, B, C, Q), this.#B = cB(A, I, B, C, E);
6479
+ this.#A = I, this.#I = mA(A), this.#g = RB(I, A, B, C, Q), this.#B = RB(A, I, B, C, E);
6433
6480
  }
6434
6481
  /** Return updated metadata reflecting the type and fill value after encoding. */
6435
6482
  getEncodedMeta(A) {
@@ -6453,7 +6500,7 @@ class Hg {
6453
6500
  return { data: B, shape: A.shape, stride: A.stride };
6454
6501
  }
6455
6502
  }
6456
- function cB(g, A, I, B, C) {
6503
+ function RB(g, A, I, B, C) {
6457
6504
  const Q = wI(g), E = Eg(g), i = wI(A), o = Eg(A);
6458
6505
  let a;
6459
6506
  if (Q && i) {
@@ -6461,14 +6508,14 @@ function cB(g, A, I, B, C) {
6461
6508
  throw new X(`cast_value float -> float only supports "nearest-even" rounding, got "${I}"`);
6462
6509
  a = (D) => D;
6463
6510
  } else if (Q && !i && !o) {
6464
- const D = RB(I), t = PI(...bI[A], B);
6511
+ const D = cB(I), t = PI(...bI[A], B);
6465
6512
  a = (h) => {
6466
6513
  if (!Number.isFinite(h))
6467
6514
  throw new Error(`Cannot cast ${h} to integer type without scalar_map`);
6468
6515
  return t(D(h));
6469
6516
  };
6470
6517
  } else if (Q && o) {
6471
- const D = RB(I), t = OI(...ZI[A], B);
6518
+ const D = cB(I), t = OI(...ZI[A], B);
6472
6519
  a = (h) => {
6473
6520
  if (!Number.isFinite(h))
6474
6521
  throw new Error(`Cannot cast ${h} to integer type without scalar_map`);
@@ -6611,10 +6658,10 @@ class FI {
6611
6658
  a.push("|O"), a.push(A.shape);
6612
6659
  let s;
6613
6660
  o.length && (s = (t, h) => {
6614
- let e = h;
6661
+ let y = h;
6615
6662
  for (let n of o)
6616
- e = n(t, e);
6617
- return e;
6663
+ y = n(t, y);
6664
+ return y;
6618
6665
  });
6619
6666
  let D = JSON.stringify(a, s, I);
6620
6667
  return C && (D = D.replace(/[\u007F-\uFFFF]/g, (t) => {
@@ -6700,7 +6747,7 @@ function TE(g, A) {
6700
6747
  return C;
6701
6748
  }
6702
6749
  function UB(g) {
6703
- return g instanceof yC || g instanceof Kg || g instanceof AI ? new Proxy(g, {
6750
+ return g instanceof eC || g instanceof Kg || g instanceof AI ? new Proxy(g, {
6704
6751
  get(I, B) {
6705
6752
  return I.get(Number(B));
6706
6753
  },
@@ -6822,7 +6869,7 @@ function ig(g) {
6822
6869
  try {
6823
6870
  return await E();
6824
6871
  } catch (i) {
6825
- throw new RE({ direction: C, codec: Q, cause: i });
6872
+ throw new cE({ direction: C, codec: Q, cause: i });
6826
6873
  }
6827
6874
  }
6828
6875
  return {
@@ -6928,7 +6975,7 @@ function XE(g, A, I, B) {
6928
6975
  let h = await o[t];
6929
6976
  if (h === null)
6930
6977
  return;
6931
- let { data: e, shape: n, stride: r } = h, G = a.map((S, F) => S % n[F]).reduce((S, F, U) => S + F * r[U], 0), L = e[G], N = e[G + 1];
6978
+ let { data: y, shape: n, stride: r } = h, G = a.map((S, F) => S % n[F]).reduce((S, F, U) => S + F * r[U], 0), L = y[G], N = y[G + 1];
6932
6979
  if (!(L === LB && N === LB))
6933
6980
  return C(t, {
6934
6981
  offset: Number(L),
@@ -7005,14 +7052,14 @@ function jE(g, A) {
7005
7052
  }
7006
7053
  };
7007
7054
  }
7008
- let RI = class extends CA {
7055
+ let cI = class extends CA {
7009
7056
  kind = "array";
7010
7057
  #A;
7011
7058
  [CI];
7012
7059
  constructor(A, I, B) {
7013
7060
  super(A, I), this.#A = {
7014
7061
  ...B,
7015
- fill_value: eC(B)
7062
+ fill_value: yC(B)
7016
7063
  }, this[CI] = jE(this, this.#A);
7017
7064
  }
7018
7065
  get attrs() {
@@ -7034,7 +7081,7 @@ let RI = class extends CA {
7034
7081
  return this.#A.data_type;
7035
7082
  }
7036
7083
  async getChunk(A, I, B) {
7037
- B?.useSharedArrayBuffer && cE();
7084
+ B?.useSharedArrayBuffer && RE();
7038
7085
  let C = this[CI], Q = await C.getChunkBytes(A, I);
7039
7086
  if (!Q) {
7040
7087
  let E = C.chunkShape.reduce((o, a) => o * a, 1), i;
@@ -7121,7 +7168,7 @@ async function dB(g, A, I) {
7121
7168
  let { path: B } = g.resolve(".zarray"), C = await g.store.get(B, { signal: I });
7122
7169
  if (!C)
7123
7170
  throw new uA("v2 array", { path: B });
7124
- return qI.increment(g.store, "v2"), rC(new RI(g.store, g.path, LE(II(C), A)));
7171
+ return qI.increment(g.store, "v2"), rC(new cI(g.store, g.path, LE(II(C), A)));
7125
7172
  }
7126
7173
  async function YB(g, A, I) {
7127
7174
  let { path: B } = g.resolve(".zgroup"), C = await g.store.get(B, { signal: I });
@@ -7134,13 +7181,13 @@ async function gi(g, A) {
7134
7181
  if (!C)
7135
7182
  throw new uA("v3 array or group", { path: B });
7136
7183
  let Q = II(C);
7137
- return Q.node_type === "array" && (Q.fill_value = eC(Q)), Q.node_type === "array" ? rC(new RI(I, g.path, Q)) : new xg(I, g.path, Q);
7184
+ return Q.node_type === "array" && (Q.fill_value = yC(Q)), Q.node_type === "array" ? rC(new cI(I, g.path, Q)) : new xg(I, g.path, Q);
7138
7185
  }
7139
7186
  async function Bi(g, A = {}) {
7140
7187
  let I = "store" in g ? g : new CA(g), B = await gi(I, A.signal);
7141
- if (qI.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && B instanceof RI || A.kind === "group" && B instanceof xg)
7188
+ if (qI.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && B instanceof cI || A.kind === "group" && B instanceof xg)
7142
7189
  return B;
7143
- let C = B instanceof RI ? "array" : "group";
7190
+ let C = B instanceof cI ? "array" : "group";
7144
7191
  throw new uA(`${A.kind} at ${I.path}`, {
7145
7192
  path: I.path,
7146
7193
  found: C
@@ -7282,15 +7329,15 @@ function ai(g, A, I, B) {
7282
7329
  throw new Error(
7283
7330
  `Received chunk too small: expected ${JSON.stringify(C)}, got ${JSON.stringify(o)}`
7284
7331
  );
7285
- const a = B.cChunkSize ? Q.c % B.cChunkSize : 0, s = B.tChunkSize ? Q.t % B.tChunkSize : 0, D = C.x * C.y * C.z, t = E.c !== void 0 ? I[E.c] : 0, h = E.t !== void 0 ? I[E.t] : 0, e = s * h + a * t, n = o.x === C.x && o.y === C.y && o.z === C.z;
7286
- if (e === 0 && g.length === D && n)
7332
+ const a = B.cChunkSize ? Q.c % B.cChunkSize : 0, s = B.tChunkSize ? Q.t % B.tChunkSize : 0, D = C.x * C.y * C.z, t = E.c !== void 0 ? I[E.c] : 0, h = E.t !== void 0 ? I[E.t] : 0, y = s * h + a * t, n = o.x === C.x && o.y === C.y && o.z === C.z;
7333
+ if (y === 0 && g.length === D && n)
7287
7334
  return g;
7288
7335
  const G = new g.constructor(
7289
7336
  D
7290
7337
  ), L = E.z !== void 0 ? I[E.z] : 0, N = I[E.y];
7291
7338
  let S = 0;
7292
7339
  for (let F = 0; F < C.z; F++) {
7293
- const U = e + F * L;
7340
+ const U = y + F * L;
7294
7341
  for (let l = 0; l < C.y; l++) {
7295
7342
  const Z = U + l * N, O = Z + C.x;
7296
7343
  G.set(g.subarray(Z, O), S), S += C.x;
@@ -10976,8 +11023,8 @@ function si(g) {
10976
11023
  }
10977
11024
  const Di = Math.max(1, navigator.hardwareConcurrency - 2);
10978
11025
  let iA = [], ti = 0, SC = 0;
10979
- const RA = /* @__PURE__ */ new Map(), cI = /* @__PURE__ */ new Set();
10980
- function RC(g) {
11026
+ const cA = /* @__PURE__ */ new Map(), RI = /* @__PURE__ */ new Set();
11027
+ function cC(g) {
10981
11028
  const A = iA.find((I) => I.worker === g);
10982
11029
  return A || k.error(
10983
11030
  "ZarrWorker",
@@ -10985,17 +11032,17 @@ function RC(g) {
10985
11032
  ), A;
10986
11033
  }
10987
11034
  function hi(g, A) {
10988
- const { id: I, success: B } = g.data, C = RA.get(I);
11035
+ const { id: I, success: B } = g.data, C = cA.get(I);
10989
11036
  if (!C) {
10990
- cI.has(I) ? cI.delete(I) : k.warn(
11037
+ RI.has(I) ? RI.delete(I) : k.warn(
10991
11038
  "ZarrWorker",
10992
11039
  `Received response for unknown message ID ${I}:`,
10993
11040
  g.data
10994
11041
  );
10995
11042
  return;
10996
11043
  }
10997
- RA.delete(I), C.abortListener && C.abortSignal && C.abortSignal.removeEventListener("abort", C.abortListener);
10998
- const Q = RC(A);
11044
+ cA.delete(I), C.abortListener && C.abortSignal && C.abortSignal.removeEventListener("abort", C.abortListener);
11045
+ const Q = cC(A);
10999
11046
  Q && Q.pendingCount > 0 ? Q.pendingCount-- : Q && k.error(
11000
11047
  "ZarrWorker",
11001
11048
  "Received message but no pending tasks - this should not happen"
@@ -11014,17 +11061,17 @@ function KB(g, A) {
11014
11061
  "Worker failed - replacing worker and canceling its in-flight messages",
11015
11062
  g.message
11016
11063
  );
11017
- const I = RC(A);
11064
+ const I = cC(A);
11018
11065
  if (I) {
11019
11066
  const C = iA.indexOf(I);
11020
11067
  iA.splice(C, 1);
11021
11068
  }
11022
11069
  const B = I?.workerId;
11023
11070
  if (B !== void 0)
11024
- for (const [C, Q] of RA.entries())
11025
- Q.workerId === B && (Q.reject(new Error(`Worker error: ${g.message}`)), RA.delete(C));
11071
+ for (const [C, Q] of cA.entries())
11072
+ Q.workerId === B && (Q.reject(new Error(`Worker error: ${g.message}`)), cA.delete(C));
11026
11073
  try {
11027
- const C = cC();
11074
+ const C = RC();
11028
11075
  iA.push({
11029
11076
  worker: C,
11030
11077
  pendingCount: 0,
@@ -11034,34 +11081,34 @@ function KB(g, A) {
11034
11081
  k.error("ZarrWorker", "Failed to create replacement worker", C);
11035
11082
  }
11036
11083
  }
11037
- function cC() {
11084
+ function RC() {
11038
11085
  const g = new si();
11039
11086
  return g.addEventListener("message", (A) => hi(A, g)), g.addEventListener("error", (A) => KB(A, g)), g.addEventListener(
11040
11087
  "messageerror",
11041
11088
  (A) => KB(A, g)
11042
11089
  ), g;
11043
11090
  }
11044
- function yi() {
11091
+ function ei() {
11045
11092
  if (iA.length === 0)
11046
11093
  throw new Error("Worker pool is not initialized");
11047
11094
  return iA.sort((g, A) => g.pendingCount - A.pendingCount)[0];
11048
11095
  }
11049
- async function ei(g, A, I, B) {
11096
+ async function yi(g, A, I, B) {
11050
11097
  return new Promise((C, Q) => {
11051
- const E = yi(), i = ti++, o = {
11098
+ const E = ei(), i = ti++, o = {
11052
11099
  resolve: C,
11053
11100
  reject: Q,
11054
11101
  workerId: E.workerId
11055
11102
  };
11056
- if (RA.set(i, o), B?.signal) {
11103
+ if (cA.set(i, o), B?.signal) {
11057
11104
  const a = () => {
11058
11105
  E.worker.postMessage({
11059
11106
  id: i,
11060
11107
  type: "cancel"
11061
- }), RA.delete(i), cI.add(i), E.pendingCount--, Q(new DOMException("Operation was aborted", "AbortError"));
11108
+ }), cA.delete(i), RI.add(i), E.pendingCount--, Q(new DOMException("Operation was aborted", "AbortError"));
11062
11109
  };
11063
11110
  if (B.signal.aborted) {
11064
- a(), cI.delete(i);
11111
+ a(), RI.delete(i);
11065
11112
  return;
11066
11113
  }
11067
11114
  B.signal.addEventListener("abort", a, { once: !0 }), o.abortListener = a, o.abortSignal = B.signal;
@@ -11079,7 +11126,7 @@ function ni() {
11079
11126
  if (!(iA.length > 0))
11080
11127
  try {
11081
11128
  for (let g = 0; g < Di; g++) {
11082
- const A = cC();
11129
+ const A = RC();
11083
11130
  iA.push({
11084
11131
  worker: A,
11085
11132
  pendingCount: 0,
@@ -11098,7 +11145,7 @@ function ni() {
11098
11145
  async function Gi(g, A, I, B, C) {
11099
11146
  ni();
11100
11147
  try {
11101
- return await ei(
11148
+ return await yi(
11102
11149
  A,
11103
11150
  I,
11104
11151
  B,
@@ -11124,7 +11171,7 @@ async function Gi(g, A, I, B, C) {
11124
11171
  function wi() {
11125
11172
  for (const g of iA)
11126
11173
  g.worker.terminate();
11127
- iA = [], RA.clear();
11174
+ iA = [], cA.clear();
11128
11175
  }
11129
11176
  class ri {
11130
11177
  metadata_;
@@ -11201,8 +11248,8 @@ function Fi(g) {
11201
11248
  function Si(g, A) {
11202
11249
  const I = g.axes.map((D) => D.name), B = g.axes.length, C = qB(I, "x"), Q = qB(I, "y"), E = (D, t) => {
11203
11250
  const h = [];
11204
- for (let e = 0; e < g.datasets.length; e++) {
11205
- const n = g.datasets[e], r = A[e], G = n.coordinateTransformations[0].scale, L = n.coordinateTransformations.length === 2 ? n.coordinateTransformations[1].translation : new Array(B).fill(0);
11251
+ for (let y = 0; y < g.datasets.length; y++) {
11252
+ const n = g.datasets[y], r = A[y], G = n.coordinateTransformations[0].scale, L = n.coordinateTransformations.length === 2 ? n.coordinateTransformations[1].translation : new Array(B).fill(0);
11206
11253
  h.push({
11207
11254
  size: r.shape[t],
11208
11255
  chunkSize: r.chunks[t],
@@ -11210,8 +11257,8 @@ function Si(g, A) {
11210
11257
  translation: L[t]
11211
11258
  });
11212
11259
  }
11213
- if (g.axes[t].type === "space" && ci(h))
11214
- for (const e of h) e.translation -= 0.5 * e.scale;
11260
+ if (g.axes[t].type === "space" && Ri(h))
11261
+ for (const y of h) y.translation -= 0.5 * y.scale;
11215
11262
  return {
11216
11263
  name: D,
11217
11264
  index: t,
@@ -11229,7 +11276,7 @@ function Si(g, A) {
11229
11276
  const s = iI(I, "t");
11230
11277
  return s !== -1 && (i.t = E(I[s], s)), i;
11231
11278
  }
11232
- function Ri(g, A) {
11279
+ function ci(g, A) {
11233
11280
  return g.toLowerCase() === A.toLowerCase();
11234
11281
  }
11235
11282
  function qB(g, A) {
@@ -11241,9 +11288,9 @@ function qB(g, A) {
11241
11288
  return I;
11242
11289
  }
11243
11290
  function iI(g, A) {
11244
- return g.findIndex((I) => Ri(I, A));
11291
+ return g.findIndex((I) => ci(I, A));
11245
11292
  }
11246
- function ci(g) {
11293
+ function Ri(g) {
11247
11294
  if (g.length <= 1) return !1;
11248
11295
  for (let A = 1; A < g.length; A++) {
11249
11296
  const I = 0.5 * (g[A].scale - g[A - 1].scale), B = g[A].translation - g[A - 1].translation;
@@ -11296,7 +11343,7 @@ var lB;
11296
11343
  // second overwrites first
11297
11344
  });
11298
11345
  })(lB || (lB = {}));
11299
- const R = f.arrayToEnum([
11346
+ const c = f.arrayToEnum([
11300
11347
  "string",
11301
11348
  "nan",
11302
11349
  "number",
@@ -11317,28 +11364,28 @@ const R = f.arrayToEnum([
11317
11364
  "never",
11318
11365
  "map",
11319
11366
  "set"
11320
- ]), yA = (g) => {
11367
+ ]), eA = (g) => {
11321
11368
  switch (typeof g) {
11322
11369
  case "undefined":
11323
- return R.undefined;
11370
+ return c.undefined;
11324
11371
  case "string":
11325
- return R.string;
11372
+ return c.string;
11326
11373
  case "number":
11327
- return Number.isNaN(g) ? R.nan : R.number;
11374
+ return Number.isNaN(g) ? c.nan : c.number;
11328
11375
  case "boolean":
11329
- return R.boolean;
11376
+ return c.boolean;
11330
11377
  case "function":
11331
- return R.function;
11378
+ return c.function;
11332
11379
  case "bigint":
11333
- return R.bigint;
11380
+ return c.bigint;
11334
11381
  case "symbol":
11335
- return R.symbol;
11382
+ return c.symbol;
11336
11383
  case "object":
11337
- return Array.isArray(g) ? R.array : g === null ? R.null : g.then && typeof g.then == "function" && g.catch && typeof g.catch == "function" ? R.promise : typeof Map < "u" && g instanceof Map ? R.map : typeof Set < "u" && g instanceof Set ? R.set : typeof Date < "u" && g instanceof Date ? R.date : R.object;
11384
+ return Array.isArray(g) ? c.array : g === null ? c.null : g.then && typeof g.then == "function" && g.catch && typeof g.catch == "function" ? c.promise : typeof Map < "u" && g instanceof Map ? c.map : typeof Set < "u" && g instanceof Set ? c.set : typeof Date < "u" && g instanceof Date ? c.date : c.object;
11338
11385
  default:
11339
- return R.unknown;
11386
+ return c.unknown;
11340
11387
  }
11341
- }, y = f.arrayToEnum([
11388
+ }, e = f.arrayToEnum([
11342
11389
  "invalid_type",
11343
11390
  "invalid_literal",
11344
11391
  "custom",
@@ -11423,52 +11470,52 @@ hA.create = (g) => new hA(g);
11423
11470
  const og = (g, A) => {
11424
11471
  let I;
11425
11472
  switch (g.code) {
11426
- case y.invalid_type:
11427
- g.received === R.undefined ? I = "Required" : I = `Expected ${g.expected}, received ${g.received}`;
11473
+ case e.invalid_type:
11474
+ g.received === c.undefined ? I = "Required" : I = `Expected ${g.expected}, received ${g.received}`;
11428
11475
  break;
11429
- case y.invalid_literal:
11476
+ case e.invalid_literal:
11430
11477
  I = `Invalid literal value, expected ${JSON.stringify(g.expected, f.jsonStringifyReplacer)}`;
11431
11478
  break;
11432
- case y.unrecognized_keys:
11479
+ case e.unrecognized_keys:
11433
11480
  I = `Unrecognized key(s) in object: ${f.joinValues(g.keys, ", ")}`;
11434
11481
  break;
11435
- case y.invalid_union:
11482
+ case e.invalid_union:
11436
11483
  I = "Invalid input";
11437
11484
  break;
11438
- case y.invalid_union_discriminator:
11485
+ case e.invalid_union_discriminator:
11439
11486
  I = `Invalid discriminator value. Expected ${f.joinValues(g.options)}`;
11440
11487
  break;
11441
- case y.invalid_enum_value:
11488
+ case e.invalid_enum_value:
11442
11489
  I = `Invalid enum value. Expected ${f.joinValues(g.options)}, received '${g.received}'`;
11443
11490
  break;
11444
- case y.invalid_arguments:
11491
+ case e.invalid_arguments:
11445
11492
  I = "Invalid function arguments";
11446
11493
  break;
11447
- case y.invalid_return_type:
11494
+ case e.invalid_return_type:
11448
11495
  I = "Invalid function return type";
11449
11496
  break;
11450
- case y.invalid_date:
11497
+ case e.invalid_date:
11451
11498
  I = "Invalid date";
11452
11499
  break;
11453
- case y.invalid_string:
11500
+ case e.invalid_string:
11454
11501
  typeof g.validation == "object" ? "includes" in g.validation ? (I = `Invalid input: must include "${g.validation.includes}"`, typeof g.validation.position == "number" && (I = `${I} at one or more positions greater than or equal to ${g.validation.position}`)) : "startsWith" in g.validation ? I = `Invalid input: must start with "${g.validation.startsWith}"` : "endsWith" in g.validation ? I = `Invalid input: must end with "${g.validation.endsWith}"` : f.assertNever(g.validation) : g.validation !== "regex" ? I = `Invalid ${g.validation}` : I = "Invalid";
11455
11502
  break;
11456
- case y.too_small:
11503
+ case e.too_small:
11457
11504
  g.type === "array" ? I = `Array must contain ${g.exact ? "exactly" : g.inclusive ? "at least" : "more than"} ${g.minimum} element(s)` : g.type === "string" ? I = `String must contain ${g.exact ? "exactly" : g.inclusive ? "at least" : "over"} ${g.minimum} character(s)` : g.type === "number" ? I = `Number must be ${g.exact ? "exactly equal to " : g.inclusive ? "greater than or equal to " : "greater than "}${g.minimum}` : g.type === "bigint" ? I = `Number must be ${g.exact ? "exactly equal to " : g.inclusive ? "greater than or equal to " : "greater than "}${g.minimum}` : g.type === "date" ? I = `Date must be ${g.exact ? "exactly equal to " : g.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(g.minimum))}` : I = "Invalid input";
11458
11505
  break;
11459
- case y.too_big:
11506
+ case e.too_big:
11460
11507
  g.type === "array" ? I = `Array must contain ${g.exact ? "exactly" : g.inclusive ? "at most" : "less than"} ${g.maximum} element(s)` : g.type === "string" ? I = `String must contain ${g.exact ? "exactly" : g.inclusive ? "at most" : "under"} ${g.maximum} character(s)` : g.type === "number" ? I = `Number must be ${g.exact ? "exactly" : g.inclusive ? "less than or equal to" : "less than"} ${g.maximum}` : g.type === "bigint" ? I = `BigInt must be ${g.exact ? "exactly" : g.inclusive ? "less than or equal to" : "less than"} ${g.maximum}` : g.type === "date" ? I = `Date must be ${g.exact ? "exactly" : g.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(g.maximum))}` : I = "Invalid input";
11461
11508
  break;
11462
- case y.custom:
11509
+ case e.custom:
11463
11510
  I = "Invalid input";
11464
11511
  break;
11465
- case y.invalid_intersection_types:
11512
+ case e.invalid_intersection_types:
11466
11513
  I = "Intersection results could not be merged";
11467
11514
  break;
11468
- case y.not_multiple_of:
11515
+ case e.not_multiple_of:
11469
11516
  I = `Number must be a multiple of ${g.multipleOf}`;
11470
11517
  break;
11471
- case y.not_finite:
11518
+ case e.not_finite:
11472
11519
  I = "Number must be finite";
11473
11520
  break;
11474
11521
  default:
@@ -11563,10 +11610,10 @@ class gA {
11563
11610
  const d = Object.freeze({
11564
11611
  status: "aborted"
11565
11612
  }), WA = (g) => ({ status: "dirty", value: g }), QA = (g) => ({ status: "valid", value: g }), fB = (g) => g.status === "aborted", pB = (g) => g.status === "dirty", MA = (g) => g.status === "valid", NI = (g) => typeof Promise < "u" && g instanceof Promise;
11566
- var c;
11613
+ var R;
11567
11614
  (function(g) {
11568
11615
  g.errToObj = (A) => typeof A == "string" ? { message: A } : A || {}, g.toString = (A) => typeof A == "string" ? A : A?.message;
11569
- })(c || (c = {}));
11616
+ })(R || (R = {}));
11570
11617
  class wA {
11571
11618
  constructor(A, I, B, C) {
11572
11619
  this._cachedPath = [], this.parent = A, this.data = I, this._path = B, this._key = C;
@@ -11606,13 +11653,13 @@ class q {
11606
11653
  return this._def.description;
11607
11654
  }
11608
11655
  _getType(A) {
11609
- return yA(A.data);
11656
+ return eA(A.data);
11610
11657
  }
11611
11658
  _getOrReturnCtx(A, I) {
11612
11659
  return I || {
11613
11660
  common: A.parent.common,
11614
11661
  data: A.data,
11615
- parsedType: yA(A.data),
11662
+ parsedType: eA(A.data),
11616
11663
  schemaErrorMap: this._def.errorMap,
11617
11664
  path: A.path,
11618
11665
  parent: A.parent
@@ -11624,7 +11671,7 @@ class q {
11624
11671
  ctx: {
11625
11672
  common: A.parent.common,
11626
11673
  data: A.data,
11627
- parsedType: yA(A.data),
11674
+ parsedType: eA(A.data),
11628
11675
  schemaErrorMap: this._def.errorMap,
11629
11676
  path: A.path,
11630
11677
  parent: A.parent
@@ -11658,7 +11705,7 @@ class q {
11658
11705
  schemaErrorMap: this._def.errorMap,
11659
11706
  parent: null,
11660
11707
  data: A,
11661
- parsedType: yA(A)
11708
+ parsedType: eA(A)
11662
11709
  }, C = this._parseSync({ data: A, path: B.path, parent: B });
11663
11710
  return uB(B, C);
11664
11711
  }
@@ -11672,7 +11719,7 @@ class q {
11672
11719
  schemaErrorMap: this._def.errorMap,
11673
11720
  parent: null,
11674
11721
  data: A,
11675
- parsedType: yA(A)
11722
+ parsedType: eA(A)
11676
11723
  };
11677
11724
  if (!this["~standard"].async)
11678
11725
  try {
@@ -11711,7 +11758,7 @@ class q {
11711
11758
  schemaErrorMap: this._def.errorMap,
11712
11759
  parent: null,
11713
11760
  data: A,
11714
- parsedType: yA(A)
11761
+ parsedType: eA(A)
11715
11762
  }, C = this._parse({ data: A, path: B.path, parent: B }), Q = await (NI(C) ? C : Promise.resolve(C));
11716
11763
  return uB(B, Q);
11717
11764
  }
@@ -11719,7 +11766,7 @@ class q {
11719
11766
  const B = (C) => typeof I == "string" || typeof I > "u" ? { message: I } : typeof I == "function" ? I(C) : I;
11720
11767
  return this._refinement((C, Q) => {
11721
11768
  const E = A(C), i = () => Q.addIssue({
11722
- code: y.custom,
11769
+ code: e.custom,
11723
11770
  ...B(C)
11724
11771
  });
11725
11772
  return typeof Promise < "u" && E instanceof Promise ? E.then((o) => o ? !0 : (i(), !1)) : E ? !0 : (i(), !1);
@@ -11792,7 +11839,7 @@ class q {
11792
11839
  }
11793
11840
  catch(A) {
11794
11841
  const I = typeof A == "function" ? A : () => A;
11795
- return new yg({
11842
+ return new eg({
11796
11843
  ...K(this._def),
11797
11844
  innerType: this,
11798
11845
  catchValue: I,
@@ -11810,7 +11857,7 @@ class q {
11810
11857
  return bg.create(this, A);
11811
11858
  }
11812
11859
  readonly() {
11813
- return eg.create(this);
11860
+ return yg.create(this);
11814
11861
  }
11815
11862
  isOptional() {
11816
11863
  return this.safeParse(void 0).success;
@@ -11855,13 +11902,13 @@ function Oi(g, A) {
11855
11902
  function Vi(g, A) {
11856
11903
  return !!((A === "v4" || !A) && pi.test(g) || (A === "v6" || !A) && mi.test(g));
11857
11904
  }
11858
- class eA extends q {
11905
+ class yA extends q {
11859
11906
  _parse(A) {
11860
- if (this._def.coerce && (A.data = String(A.data)), this._getType(A) !== R.string) {
11907
+ if (this._def.coerce && (A.data = String(A.data)), this._getType(A) !== c.string) {
11861
11908
  const Q = this._getOrReturnCtx(A);
11862
11909
  return w(Q, {
11863
- code: y.invalid_type,
11864
- expected: R.string,
11910
+ code: e.invalid_type,
11911
+ expected: c.string,
11865
11912
  received: Q.parsedType
11866
11913
  }), d;
11867
11914
  }
@@ -11870,7 +11917,7 @@ class eA extends q {
11870
11917
  for (const Q of this._def.checks)
11871
11918
  if (Q.kind === "min")
11872
11919
  A.data.length < Q.value && (C = this._getOrReturnCtx(A, C), w(C, {
11873
- code: y.too_small,
11920
+ code: e.too_small,
11874
11921
  minimum: Q.value,
11875
11922
  type: "string",
11876
11923
  inclusive: !0,
@@ -11879,7 +11926,7 @@ class eA extends q {
11879
11926
  }), B.dirty());
11880
11927
  else if (Q.kind === "max")
11881
11928
  A.data.length > Q.value && (C = this._getOrReturnCtx(A, C), w(C, {
11882
- code: y.too_big,
11929
+ code: e.too_big,
11883
11930
  maximum: Q.value,
11884
11931
  type: "string",
11885
11932
  inclusive: !0,
@@ -11889,14 +11936,14 @@ class eA extends q {
11889
11936
  else if (Q.kind === "length") {
11890
11937
  const E = A.data.length > Q.value, i = A.data.length < Q.value;
11891
11938
  (E || i) && (C = this._getOrReturnCtx(A, C), E ? w(C, {
11892
- code: y.too_big,
11939
+ code: e.too_big,
11893
11940
  maximum: Q.value,
11894
11941
  type: "string",
11895
11942
  inclusive: !0,
11896
11943
  exact: !0,
11897
11944
  message: Q.message
11898
11945
  }) : i && w(C, {
11899
- code: y.too_small,
11946
+ code: e.too_small,
11900
11947
  minimum: Q.value,
11901
11948
  type: "string",
11902
11949
  inclusive: !0,
@@ -11906,43 +11953,43 @@ class eA extends q {
11906
11953
  } else if (Q.kind === "email")
11907
11954
  qi.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11908
11955
  validation: "email",
11909
- code: y.invalid_string,
11956
+ code: e.invalid_string,
11910
11957
  message: Q.message
11911
11958
  }), B.dirty());
11912
11959
  else if (Q.kind === "emoji")
11913
11960
  VI || (VI = new RegExp(li, "u")), VI.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11914
11961
  validation: "emoji",
11915
- code: y.invalid_string,
11962
+ code: e.invalid_string,
11916
11963
  message: Q.message
11917
11964
  }), B.dirty());
11918
11965
  else if (Q.kind === "uuid")
11919
11966
  Yi.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11920
11967
  validation: "uuid",
11921
- code: y.invalid_string,
11968
+ code: e.invalid_string,
11922
11969
  message: Q.message
11923
11970
  }), B.dirty());
11924
11971
  else if (Q.kind === "nanoid")
11925
11972
  Mi.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11926
11973
  validation: "nanoid",
11927
- code: y.invalid_string,
11974
+ code: e.invalid_string,
11928
11975
  message: Q.message
11929
11976
  }), B.dirty());
11930
11977
  else if (Q.kind === "cuid")
11931
11978
  Li.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11932
11979
  validation: "cuid",
11933
- code: y.invalid_string,
11980
+ code: e.invalid_string,
11934
11981
  message: Q.message
11935
11982
  }), B.dirty());
11936
11983
  else if (Q.kind === "cuid2")
11937
11984
  Ji.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11938
11985
  validation: "cuid2",
11939
- code: y.invalid_string,
11986
+ code: e.invalid_string,
11940
11987
  message: Q.message
11941
11988
  }), B.dirty());
11942
11989
  else if (Q.kind === "ulid")
11943
11990
  di.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11944
11991
  validation: "ulid",
11945
- code: y.invalid_string,
11992
+ code: e.invalid_string,
11946
11993
  message: Q.message
11947
11994
  }), B.dirty());
11948
11995
  else if (Q.kind === "url")
@@ -11951,61 +11998,61 @@ class eA extends q {
11951
11998
  } catch {
11952
11999
  C = this._getOrReturnCtx(A, C), w(C, {
11953
12000
  validation: "url",
11954
- code: y.invalid_string,
12001
+ code: e.invalid_string,
11955
12002
  message: Q.message
11956
12003
  }), B.dirty();
11957
12004
  }
11958
12005
  else Q.kind === "regex" ? (Q.regex.lastIndex = 0, Q.regex.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11959
12006
  validation: "regex",
11960
- code: y.invalid_string,
12007
+ code: e.invalid_string,
11961
12008
  message: Q.message
11962
12009
  }), B.dirty())) : Q.kind === "trim" ? A.data = A.data.trim() : Q.kind === "includes" ? A.data.includes(Q.value, Q.position) || (C = this._getOrReturnCtx(A, C), w(C, {
11963
- code: y.invalid_string,
12010
+ code: e.invalid_string,
11964
12011
  validation: { includes: Q.value, position: Q.position },
11965
12012
  message: Q.message
11966
12013
  }), B.dirty()) : Q.kind === "toLowerCase" ? A.data = A.data.toLowerCase() : Q.kind === "toUpperCase" ? A.data = A.data.toUpperCase() : Q.kind === "startsWith" ? A.data.startsWith(Q.value) || (C = this._getOrReturnCtx(A, C), w(C, {
11967
- code: y.invalid_string,
12014
+ code: e.invalid_string,
11968
12015
  validation: { startsWith: Q.value },
11969
12016
  message: Q.message
11970
12017
  }), B.dirty()) : Q.kind === "endsWith" ? A.data.endsWith(Q.value) || (C = this._getOrReturnCtx(A, C), w(C, {
11971
- code: y.invalid_string,
12018
+ code: e.invalid_string,
11972
12019
  validation: { endsWith: Q.value },
11973
12020
  message: Q.message
11974
12021
  }), B.dirty()) : Q.kind === "datetime" ? Zi(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11975
- code: y.invalid_string,
12022
+ code: e.invalid_string,
11976
12023
  validation: "datetime",
11977
12024
  message: Q.message
11978
12025
  }), B.dirty()) : Q.kind === "date" ? Wi.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11979
- code: y.invalid_string,
12026
+ code: e.invalid_string,
11980
12027
  validation: "date",
11981
12028
  message: Q.message
11982
12029
  }), B.dirty()) : Q.kind === "time" ? bi(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11983
- code: y.invalid_string,
12030
+ code: e.invalid_string,
11984
12031
  validation: "time",
11985
12032
  message: Q.message
11986
12033
  }), B.dirty()) : Q.kind === "duration" ? Hi.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11987
12034
  validation: "duration",
11988
- code: y.invalid_string,
12035
+ code: e.invalid_string,
11989
12036
  message: Q.message
11990
12037
  }), B.dirty()) : Q.kind === "ip" ? Pi(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), w(C, {
11991
12038
  validation: "ip",
11992
- code: y.invalid_string,
12039
+ code: e.invalid_string,
11993
12040
  message: Q.message
11994
12041
  }), B.dirty()) : Q.kind === "jwt" ? Oi(A.data, Q.alg) || (C = this._getOrReturnCtx(A, C), w(C, {
11995
12042
  validation: "jwt",
11996
- code: y.invalid_string,
12043
+ code: e.invalid_string,
11997
12044
  message: Q.message
11998
12045
  }), B.dirty()) : Q.kind === "cidr" ? Vi(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), w(C, {
11999
12046
  validation: "cidr",
12000
- code: y.invalid_string,
12047
+ code: e.invalid_string,
12001
12048
  message: Q.message
12002
12049
  }), B.dirty()) : Q.kind === "base64" ? Ti.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
12003
12050
  validation: "base64",
12004
- code: y.invalid_string,
12051
+ code: e.invalid_string,
12005
12052
  message: Q.message
12006
12053
  }), B.dirty()) : Q.kind === "base64url" ? xi.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
12007
12054
  validation: "base64url",
12008
- code: y.invalid_string,
12055
+ code: e.invalid_string,
12009
12056
  message: Q.message
12010
12057
  }), B.dirty()) : f.assertNever(Q);
12011
12058
  return { status: B.value, value: A.data };
@@ -12013,57 +12060,57 @@ class eA extends q {
12013
12060
  _regex(A, I, B) {
12014
12061
  return this.refinement((C) => A.test(C), {
12015
12062
  validation: I,
12016
- code: y.invalid_string,
12017
- ...c.errToObj(B)
12063
+ code: e.invalid_string,
12064
+ ...R.errToObj(B)
12018
12065
  });
12019
12066
  }
12020
12067
  _addCheck(A) {
12021
- return new eA({
12068
+ return new yA({
12022
12069
  ...this._def,
12023
12070
  checks: [...this._def.checks, A]
12024
12071
  });
12025
12072
  }
12026
12073
  email(A) {
12027
- return this._addCheck({ kind: "email", ...c.errToObj(A) });
12074
+ return this._addCheck({ kind: "email", ...R.errToObj(A) });
12028
12075
  }
12029
12076
  url(A) {
12030
- return this._addCheck({ kind: "url", ...c.errToObj(A) });
12077
+ return this._addCheck({ kind: "url", ...R.errToObj(A) });
12031
12078
  }
12032
12079
  emoji(A) {
12033
- return this._addCheck({ kind: "emoji", ...c.errToObj(A) });
12080
+ return this._addCheck({ kind: "emoji", ...R.errToObj(A) });
12034
12081
  }
12035
12082
  uuid(A) {
12036
- return this._addCheck({ kind: "uuid", ...c.errToObj(A) });
12083
+ return this._addCheck({ kind: "uuid", ...R.errToObj(A) });
12037
12084
  }
12038
12085
  nanoid(A) {
12039
- return this._addCheck({ kind: "nanoid", ...c.errToObj(A) });
12086
+ return this._addCheck({ kind: "nanoid", ...R.errToObj(A) });
12040
12087
  }
12041
12088
  cuid(A) {
12042
- return this._addCheck({ kind: "cuid", ...c.errToObj(A) });
12089
+ return this._addCheck({ kind: "cuid", ...R.errToObj(A) });
12043
12090
  }
12044
12091
  cuid2(A) {
12045
- return this._addCheck({ kind: "cuid2", ...c.errToObj(A) });
12092
+ return this._addCheck({ kind: "cuid2", ...R.errToObj(A) });
12046
12093
  }
12047
12094
  ulid(A) {
12048
- return this._addCheck({ kind: "ulid", ...c.errToObj(A) });
12095
+ return this._addCheck({ kind: "ulid", ...R.errToObj(A) });
12049
12096
  }
12050
12097
  base64(A) {
12051
- return this._addCheck({ kind: "base64", ...c.errToObj(A) });
12098
+ return this._addCheck({ kind: "base64", ...R.errToObj(A) });
12052
12099
  }
12053
12100
  base64url(A) {
12054
12101
  return this._addCheck({
12055
12102
  kind: "base64url",
12056
- ...c.errToObj(A)
12103
+ ...R.errToObj(A)
12057
12104
  });
12058
12105
  }
12059
12106
  jwt(A) {
12060
- return this._addCheck({ kind: "jwt", ...c.errToObj(A) });
12107
+ return this._addCheck({ kind: "jwt", ...R.errToObj(A) });
12061
12108
  }
12062
12109
  ip(A) {
12063
- return this._addCheck({ kind: "ip", ...c.errToObj(A) });
12110
+ return this._addCheck({ kind: "ip", ...R.errToObj(A) });
12064
12111
  }
12065
12112
  cidr(A) {
12066
- return this._addCheck({ kind: "cidr", ...c.errToObj(A) });
12113
+ return this._addCheck({ kind: "cidr", ...R.errToObj(A) });
12067
12114
  }
12068
12115
  datetime(A) {
12069
12116
  return typeof A == "string" ? this._addCheck({
@@ -12077,7 +12124,7 @@ class eA extends q {
12077
12124
  precision: typeof A?.precision > "u" ? null : A?.precision,
12078
12125
  offset: A?.offset ?? !1,
12079
12126
  local: A?.local ?? !1,
12080
- ...c.errToObj(A?.message)
12127
+ ...R.errToObj(A?.message)
12081
12128
  });
12082
12129
  }
12083
12130
  date(A) {
@@ -12091,17 +12138,17 @@ class eA extends q {
12091
12138
  }) : this._addCheck({
12092
12139
  kind: "time",
12093
12140
  precision: typeof A?.precision > "u" ? null : A?.precision,
12094
- ...c.errToObj(A?.message)
12141
+ ...R.errToObj(A?.message)
12095
12142
  });
12096
12143
  }
12097
12144
  duration(A) {
12098
- return this._addCheck({ kind: "duration", ...c.errToObj(A) });
12145
+ return this._addCheck({ kind: "duration", ...R.errToObj(A) });
12099
12146
  }
12100
12147
  regex(A, I) {
12101
12148
  return this._addCheck({
12102
12149
  kind: "regex",
12103
12150
  regex: A,
12104
- ...c.errToObj(I)
12151
+ ...R.errToObj(I)
12105
12152
  });
12106
12153
  }
12107
12154
  includes(A, I) {
@@ -12109,64 +12156,64 @@ class eA extends q {
12109
12156
  kind: "includes",
12110
12157
  value: A,
12111
12158
  position: I?.position,
12112
- ...c.errToObj(I?.message)
12159
+ ...R.errToObj(I?.message)
12113
12160
  });
12114
12161
  }
12115
12162
  startsWith(A, I) {
12116
12163
  return this._addCheck({
12117
12164
  kind: "startsWith",
12118
12165
  value: A,
12119
- ...c.errToObj(I)
12166
+ ...R.errToObj(I)
12120
12167
  });
12121
12168
  }
12122
12169
  endsWith(A, I) {
12123
12170
  return this._addCheck({
12124
12171
  kind: "endsWith",
12125
12172
  value: A,
12126
- ...c.errToObj(I)
12173
+ ...R.errToObj(I)
12127
12174
  });
12128
12175
  }
12129
12176
  min(A, I) {
12130
12177
  return this._addCheck({
12131
12178
  kind: "min",
12132
12179
  value: A,
12133
- ...c.errToObj(I)
12180
+ ...R.errToObj(I)
12134
12181
  });
12135
12182
  }
12136
12183
  max(A, I) {
12137
12184
  return this._addCheck({
12138
12185
  kind: "max",
12139
12186
  value: A,
12140
- ...c.errToObj(I)
12187
+ ...R.errToObj(I)
12141
12188
  });
12142
12189
  }
12143
12190
  length(A, I) {
12144
12191
  return this._addCheck({
12145
12192
  kind: "length",
12146
12193
  value: A,
12147
- ...c.errToObj(I)
12194
+ ...R.errToObj(I)
12148
12195
  });
12149
12196
  }
12150
12197
  /**
12151
12198
  * Equivalent to `.min(1)`
12152
12199
  */
12153
12200
  nonempty(A) {
12154
- return this.min(1, c.errToObj(A));
12201
+ return this.min(1, R.errToObj(A));
12155
12202
  }
12156
12203
  trim() {
12157
- return new eA({
12204
+ return new yA({
12158
12205
  ...this._def,
12159
12206
  checks: [...this._def.checks, { kind: "trim" }]
12160
12207
  });
12161
12208
  }
12162
12209
  toLowerCase() {
12163
- return new eA({
12210
+ return new yA({
12164
12211
  ...this._def,
12165
12212
  checks: [...this._def.checks, { kind: "toLowerCase" }]
12166
12213
  });
12167
12214
  }
12168
12215
  toUpperCase() {
12169
- return new eA({
12216
+ return new yA({
12170
12217
  ...this._def,
12171
12218
  checks: [...this._def.checks, { kind: "toUpperCase" }]
12172
12219
  });
@@ -12232,7 +12279,7 @@ class eA extends q {
12232
12279
  return A;
12233
12280
  }
12234
12281
  }
12235
- eA.create = (g) => new eA({
12282
+ yA.create = (g) => new yA({
12236
12283
  checks: [],
12237
12284
  typeName: Y.ZodString,
12238
12285
  coerce: g?.coerce ?? !1,
@@ -12247,11 +12294,11 @@ class KA extends q {
12247
12294
  super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
12248
12295
  }
12249
12296
  _parse(A) {
12250
- if (this._def.coerce && (A.data = Number(A.data)), this._getType(A) !== R.number) {
12297
+ if (this._def.coerce && (A.data = Number(A.data)), this._getType(A) !== c.number) {
12251
12298
  const Q = this._getOrReturnCtx(A);
12252
12299
  return w(Q, {
12253
- code: y.invalid_type,
12254
- expected: R.number,
12300
+ code: e.invalid_type,
12301
+ expected: c.number,
12255
12302
  received: Q.parsedType
12256
12303
  }), d;
12257
12304
  }
@@ -12259,45 +12306,45 @@ class KA extends q {
12259
12306
  const C = new gA();
12260
12307
  for (const Q of this._def.checks)
12261
12308
  Q.kind === "int" ? f.isInteger(A.data) || (B = this._getOrReturnCtx(A, B), w(B, {
12262
- code: y.invalid_type,
12309
+ code: e.invalid_type,
12263
12310
  expected: "integer",
12264
12311
  received: "float",
12265
12312
  message: Q.message
12266
12313
  }), C.dirty()) : Q.kind === "min" ? (Q.inclusive ? A.data < Q.value : A.data <= Q.value) && (B = this._getOrReturnCtx(A, B), w(B, {
12267
- code: y.too_small,
12314
+ code: e.too_small,
12268
12315
  minimum: Q.value,
12269
12316
  type: "number",
12270
12317
  inclusive: Q.inclusive,
12271
12318
  exact: !1,
12272
12319
  message: Q.message
12273
12320
  }), C.dirty()) : Q.kind === "max" ? (Q.inclusive ? A.data > Q.value : A.data >= Q.value) && (B = this._getOrReturnCtx(A, B), w(B, {
12274
- code: y.too_big,
12321
+ code: e.too_big,
12275
12322
  maximum: Q.value,
12276
12323
  type: "number",
12277
12324
  inclusive: Q.inclusive,
12278
12325
  exact: !1,
12279
12326
  message: Q.message
12280
12327
  }), C.dirty()) : Q.kind === "multipleOf" ? vi(A.data, Q.value) !== 0 && (B = this._getOrReturnCtx(A, B), w(B, {
12281
- code: y.not_multiple_of,
12328
+ code: e.not_multiple_of,
12282
12329
  multipleOf: Q.value,
12283
12330
  message: Q.message
12284
12331
  }), C.dirty()) : Q.kind === "finite" ? Number.isFinite(A.data) || (B = this._getOrReturnCtx(A, B), w(B, {
12285
- code: y.not_finite,
12332
+ code: e.not_finite,
12286
12333
  message: Q.message
12287
12334
  }), C.dirty()) : f.assertNever(Q);
12288
12335
  return { status: C.value, value: A.data };
12289
12336
  }
12290
12337
  gte(A, I) {
12291
- return this.setLimit("min", A, !0, c.toString(I));
12338
+ return this.setLimit("min", A, !0, R.toString(I));
12292
12339
  }
12293
12340
  gt(A, I) {
12294
- return this.setLimit("min", A, !1, c.toString(I));
12341
+ return this.setLimit("min", A, !1, R.toString(I));
12295
12342
  }
12296
12343
  lte(A, I) {
12297
- return this.setLimit("max", A, !0, c.toString(I));
12344
+ return this.setLimit("max", A, !0, R.toString(I));
12298
12345
  }
12299
12346
  lt(A, I) {
12300
- return this.setLimit("max", A, !1, c.toString(I));
12347
+ return this.setLimit("max", A, !1, R.toString(I));
12301
12348
  }
12302
12349
  setLimit(A, I, B, C) {
12303
12350
  return new KA({
@@ -12308,7 +12355,7 @@ class KA extends q {
12308
12355
  kind: A,
12309
12356
  value: I,
12310
12357
  inclusive: B,
12311
- message: c.toString(C)
12358
+ message: R.toString(C)
12312
12359
  }
12313
12360
  ]
12314
12361
  });
@@ -12322,7 +12369,7 @@ class KA extends q {
12322
12369
  int(A) {
12323
12370
  return this._addCheck({
12324
12371
  kind: "int",
12325
- message: c.toString(A)
12372
+ message: R.toString(A)
12326
12373
  });
12327
12374
  }
12328
12375
  positive(A) {
@@ -12330,7 +12377,7 @@ class KA extends q {
12330
12377
  kind: "min",
12331
12378
  value: 0,
12332
12379
  inclusive: !1,
12333
- message: c.toString(A)
12380
+ message: R.toString(A)
12334
12381
  });
12335
12382
  }
12336
12383
  negative(A) {
@@ -12338,7 +12385,7 @@ class KA extends q {
12338
12385
  kind: "max",
12339
12386
  value: 0,
12340
12387
  inclusive: !1,
12341
- message: c.toString(A)
12388
+ message: R.toString(A)
12342
12389
  });
12343
12390
  }
12344
12391
  nonpositive(A) {
@@ -12346,7 +12393,7 @@ class KA extends q {
12346
12393
  kind: "max",
12347
12394
  value: 0,
12348
12395
  inclusive: !0,
12349
- message: c.toString(A)
12396
+ message: R.toString(A)
12350
12397
  });
12351
12398
  }
12352
12399
  nonnegative(A) {
@@ -12354,20 +12401,20 @@ class KA extends q {
12354
12401
  kind: "min",
12355
12402
  value: 0,
12356
12403
  inclusive: !0,
12357
- message: c.toString(A)
12404
+ message: R.toString(A)
12358
12405
  });
12359
12406
  }
12360
12407
  multipleOf(A, I) {
12361
12408
  return this._addCheck({
12362
12409
  kind: "multipleOf",
12363
12410
  value: A,
12364
- message: c.toString(I)
12411
+ message: R.toString(I)
12365
12412
  });
12366
12413
  }
12367
12414
  finite(A) {
12368
12415
  return this._addCheck({
12369
12416
  kind: "finite",
12370
- message: c.toString(A)
12417
+ message: R.toString(A)
12371
12418
  });
12372
12419
  }
12373
12420
  safe(A) {
@@ -12375,12 +12422,12 @@ class KA extends q {
12375
12422
  kind: "min",
12376
12423
  inclusive: !0,
12377
12424
  value: Number.MIN_SAFE_INTEGER,
12378
- message: c.toString(A)
12425
+ message: R.toString(A)
12379
12426
  })._addCheck({
12380
12427
  kind: "max",
12381
12428
  inclusive: !0,
12382
12429
  value: Number.MAX_SAFE_INTEGER,
12383
- message: c.toString(A)
12430
+ message: R.toString(A)
12384
12431
  });
12385
12432
  }
12386
12433
  get minValue() {
@@ -12425,25 +12472,25 @@ class XA extends q {
12425
12472
  } catch {
12426
12473
  return this._getInvalidInput(A);
12427
12474
  }
12428
- if (this._getType(A) !== R.bigint)
12475
+ if (this._getType(A) !== c.bigint)
12429
12476
  return this._getInvalidInput(A);
12430
12477
  let B;
12431
12478
  const C = new gA();
12432
12479
  for (const Q of this._def.checks)
12433
12480
  Q.kind === "min" ? (Q.inclusive ? A.data < Q.value : A.data <= Q.value) && (B = this._getOrReturnCtx(A, B), w(B, {
12434
- code: y.too_small,
12481
+ code: e.too_small,
12435
12482
  type: "bigint",
12436
12483
  minimum: Q.value,
12437
12484
  inclusive: Q.inclusive,
12438
12485
  message: Q.message
12439
12486
  }), C.dirty()) : Q.kind === "max" ? (Q.inclusive ? A.data > Q.value : A.data >= Q.value) && (B = this._getOrReturnCtx(A, B), w(B, {
12440
- code: y.too_big,
12487
+ code: e.too_big,
12441
12488
  type: "bigint",
12442
12489
  maximum: Q.value,
12443
12490
  inclusive: Q.inclusive,
12444
12491
  message: Q.message
12445
12492
  }), C.dirty()) : Q.kind === "multipleOf" ? A.data % Q.value !== BigInt(0) && (B = this._getOrReturnCtx(A, B), w(B, {
12446
- code: y.not_multiple_of,
12493
+ code: e.not_multiple_of,
12447
12494
  multipleOf: Q.value,
12448
12495
  message: Q.message
12449
12496
  }), C.dirty()) : f.assertNever(Q);
@@ -12452,22 +12499,22 @@ class XA extends q {
12452
12499
  _getInvalidInput(A) {
12453
12500
  const I = this._getOrReturnCtx(A);
12454
12501
  return w(I, {
12455
- code: y.invalid_type,
12456
- expected: R.bigint,
12502
+ code: e.invalid_type,
12503
+ expected: c.bigint,
12457
12504
  received: I.parsedType
12458
12505
  }), d;
12459
12506
  }
12460
12507
  gte(A, I) {
12461
- return this.setLimit("min", A, !0, c.toString(I));
12508
+ return this.setLimit("min", A, !0, R.toString(I));
12462
12509
  }
12463
12510
  gt(A, I) {
12464
- return this.setLimit("min", A, !1, c.toString(I));
12511
+ return this.setLimit("min", A, !1, R.toString(I));
12465
12512
  }
12466
12513
  lte(A, I) {
12467
- return this.setLimit("max", A, !0, c.toString(I));
12514
+ return this.setLimit("max", A, !0, R.toString(I));
12468
12515
  }
12469
12516
  lt(A, I) {
12470
- return this.setLimit("max", A, !1, c.toString(I));
12517
+ return this.setLimit("max", A, !1, R.toString(I));
12471
12518
  }
12472
12519
  setLimit(A, I, B, C) {
12473
12520
  return new XA({
@@ -12478,7 +12525,7 @@ class XA extends q {
12478
12525
  kind: A,
12479
12526
  value: I,
12480
12527
  inclusive: B,
12481
- message: c.toString(C)
12528
+ message: R.toString(C)
12482
12529
  }
12483
12530
  ]
12484
12531
  });
@@ -12494,7 +12541,7 @@ class XA extends q {
12494
12541
  kind: "min",
12495
12542
  value: BigInt(0),
12496
12543
  inclusive: !1,
12497
- message: c.toString(A)
12544
+ message: R.toString(A)
12498
12545
  });
12499
12546
  }
12500
12547
  negative(A) {
@@ -12502,7 +12549,7 @@ class XA extends q {
12502
12549
  kind: "max",
12503
12550
  value: BigInt(0),
12504
12551
  inclusive: !1,
12505
- message: c.toString(A)
12552
+ message: R.toString(A)
12506
12553
  });
12507
12554
  }
12508
12555
  nonpositive(A) {
@@ -12510,7 +12557,7 @@ class XA extends q {
12510
12557
  kind: "max",
12511
12558
  value: BigInt(0),
12512
12559
  inclusive: !0,
12513
- message: c.toString(A)
12560
+ message: R.toString(A)
12514
12561
  });
12515
12562
  }
12516
12563
  nonnegative(A) {
@@ -12518,14 +12565,14 @@ class XA extends q {
12518
12565
  kind: "min",
12519
12566
  value: BigInt(0),
12520
12567
  inclusive: !0,
12521
- message: c.toString(A)
12568
+ message: R.toString(A)
12522
12569
  });
12523
12570
  }
12524
12571
  multipleOf(A, I) {
12525
12572
  return this._addCheck({
12526
12573
  kind: "multipleOf",
12527
12574
  value: A,
12528
- message: c.toString(I)
12575
+ message: R.toString(I)
12529
12576
  });
12530
12577
  }
12531
12578
  get minValue() {
@@ -12549,11 +12596,11 @@ XA.create = (g) => new XA({
12549
12596
  });
12550
12597
  class ag extends q {
12551
12598
  _parse(A) {
12552
- if (this._def.coerce && (A.data = !!A.data), this._getType(A) !== R.boolean) {
12599
+ if (this._def.coerce && (A.data = !!A.data), this._getType(A) !== c.boolean) {
12553
12600
  const B = this._getOrReturnCtx(A);
12554
12601
  return w(B, {
12555
- code: y.invalid_type,
12556
- expected: R.boolean,
12602
+ code: e.invalid_type,
12603
+ expected: c.boolean,
12557
12604
  received: B.parsedType
12558
12605
  }), d;
12559
12606
  }
@@ -12567,32 +12614,32 @@ ag.create = (g) => new ag({
12567
12614
  });
12568
12615
  class UI extends q {
12569
12616
  _parse(A) {
12570
- if (this._def.coerce && (A.data = new Date(A.data)), this._getType(A) !== R.date) {
12617
+ if (this._def.coerce && (A.data = new Date(A.data)), this._getType(A) !== c.date) {
12571
12618
  const Q = this._getOrReturnCtx(A);
12572
12619
  return w(Q, {
12573
- code: y.invalid_type,
12574
- expected: R.date,
12620
+ code: e.invalid_type,
12621
+ expected: c.date,
12575
12622
  received: Q.parsedType
12576
12623
  }), d;
12577
12624
  }
12578
12625
  if (Number.isNaN(A.data.getTime())) {
12579
12626
  const Q = this._getOrReturnCtx(A);
12580
12627
  return w(Q, {
12581
- code: y.invalid_date
12628
+ code: e.invalid_date
12582
12629
  }), d;
12583
12630
  }
12584
12631
  const B = new gA();
12585
12632
  let C;
12586
12633
  for (const Q of this._def.checks)
12587
12634
  Q.kind === "min" ? A.data.getTime() < Q.value && (C = this._getOrReturnCtx(A, C), w(C, {
12588
- code: y.too_small,
12635
+ code: e.too_small,
12589
12636
  message: Q.message,
12590
12637
  inclusive: !0,
12591
12638
  exact: !1,
12592
12639
  minimum: Q.value,
12593
12640
  type: "date"
12594
12641
  }), B.dirty()) : Q.kind === "max" ? A.data.getTime() > Q.value && (C = this._getOrReturnCtx(A, C), w(C, {
12595
- code: y.too_big,
12642
+ code: e.too_big,
12596
12643
  message: Q.message,
12597
12644
  inclusive: !0,
12598
12645
  exact: !1,
@@ -12614,14 +12661,14 @@ class UI extends q {
12614
12661
  return this._addCheck({
12615
12662
  kind: "min",
12616
12663
  value: A.getTime(),
12617
- message: c.toString(I)
12664
+ message: R.toString(I)
12618
12665
  });
12619
12666
  }
12620
12667
  max(A, I) {
12621
12668
  return this._addCheck({
12622
12669
  kind: "max",
12623
12670
  value: A.getTime(),
12624
- message: c.toString(I)
12671
+ message: R.toString(I)
12625
12672
  });
12626
12673
  }
12627
12674
  get minDate() {
@@ -12645,11 +12692,11 @@ UI.create = (g) => new UI({
12645
12692
  });
12646
12693
  class mB extends q {
12647
12694
  _parse(A) {
12648
- if (this._getType(A) !== R.symbol) {
12695
+ if (this._getType(A) !== c.symbol) {
12649
12696
  const B = this._getOrReturnCtx(A);
12650
12697
  return w(B, {
12651
- code: y.invalid_type,
12652
- expected: R.symbol,
12698
+ code: e.invalid_type,
12699
+ expected: c.symbol,
12653
12700
  received: B.parsedType
12654
12701
  }), d;
12655
12702
  }
@@ -12662,11 +12709,11 @@ mB.create = (g) => new mB({
12662
12709
  });
12663
12710
  class TB extends q {
12664
12711
  _parse(A) {
12665
- if (this._getType(A) !== R.undefined) {
12712
+ if (this._getType(A) !== c.undefined) {
12666
12713
  const B = this._getOrReturnCtx(A);
12667
12714
  return w(B, {
12668
- code: y.invalid_type,
12669
- expected: R.undefined,
12715
+ code: e.invalid_type,
12716
+ expected: c.undefined,
12670
12717
  received: B.parsedType
12671
12718
  }), d;
12672
12719
  }
@@ -12679,11 +12726,11 @@ TB.create = (g) => new TB({
12679
12726
  });
12680
12727
  class xB extends q {
12681
12728
  _parse(A) {
12682
- if (this._getType(A) !== R.null) {
12729
+ if (this._getType(A) !== c.null) {
12683
12730
  const B = this._getOrReturnCtx(A);
12684
12731
  return w(B, {
12685
- code: y.invalid_type,
12686
- expected: R.null,
12732
+ code: e.invalid_type,
12733
+ expected: c.null,
12687
12734
  received: B.parsedType
12688
12735
  }), d;
12689
12736
  }
@@ -12722,8 +12769,8 @@ class rA extends q {
12722
12769
  _parse(A) {
12723
12770
  const I = this._getOrReturnCtx(A);
12724
12771
  return w(I, {
12725
- code: y.invalid_type,
12726
- expected: R.never,
12772
+ code: e.invalid_type,
12773
+ expected: c.never,
12727
12774
  received: I.parsedType
12728
12775
  }), d;
12729
12776
  }
@@ -12734,11 +12781,11 @@ rA.create = (g) => new rA({
12734
12781
  });
12735
12782
  class bB extends q {
12736
12783
  _parse(A) {
12737
- if (this._getType(A) !== R.undefined) {
12784
+ if (this._getType(A) !== c.undefined) {
12738
12785
  const B = this._getOrReturnCtx(A);
12739
12786
  return w(B, {
12740
- code: y.invalid_type,
12741
- expected: R.void,
12787
+ code: e.invalid_type,
12788
+ expected: c.void,
12742
12789
  received: B.parsedType
12743
12790
  }), d;
12744
12791
  }
@@ -12752,16 +12799,16 @@ bB.create = (g) => new bB({
12752
12799
  class DA extends q {
12753
12800
  _parse(A) {
12754
12801
  const { ctx: I, status: B } = this._processInputParams(A), C = this._def;
12755
- if (I.parsedType !== R.array)
12802
+ if (I.parsedType !== c.array)
12756
12803
  return w(I, {
12757
- code: y.invalid_type,
12758
- expected: R.array,
12804
+ code: e.invalid_type,
12805
+ expected: c.array,
12759
12806
  received: I.parsedType
12760
12807
  }), d;
12761
12808
  if (C.exactLength !== null) {
12762
12809
  const E = I.data.length > C.exactLength.value, i = I.data.length < C.exactLength.value;
12763
12810
  (E || i) && (w(I, {
12764
- code: E ? y.too_big : y.too_small,
12811
+ code: E ? e.too_big : e.too_small,
12765
12812
  minimum: i ? C.exactLength.value : void 0,
12766
12813
  maximum: E ? C.exactLength.value : void 0,
12767
12814
  type: "array",
@@ -12771,14 +12818,14 @@ class DA extends q {
12771
12818
  }), B.dirty());
12772
12819
  }
12773
12820
  if (C.minLength !== null && I.data.length < C.minLength.value && (w(I, {
12774
- code: y.too_small,
12821
+ code: e.too_small,
12775
12822
  minimum: C.minLength.value,
12776
12823
  type: "array",
12777
12824
  inclusive: !0,
12778
12825
  exact: !1,
12779
12826
  message: C.minLength.message
12780
12827
  }), B.dirty()), C.maxLength !== null && I.data.length > C.maxLength.value && (w(I, {
12781
- code: y.too_big,
12828
+ code: e.too_big,
12782
12829
  maximum: C.maxLength.value,
12783
12830
  type: "array",
12784
12831
  inclusive: !0,
@@ -12795,19 +12842,19 @@ class DA extends q {
12795
12842
  min(A, I) {
12796
12843
  return new DA({
12797
12844
  ...this._def,
12798
- minLength: { value: A, message: c.toString(I) }
12845
+ minLength: { value: A, message: R.toString(I) }
12799
12846
  });
12800
12847
  }
12801
12848
  max(A, I) {
12802
12849
  return new DA({
12803
12850
  ...this._def,
12804
- maxLength: { value: A, message: c.toString(I) }
12851
+ maxLength: { value: A, message: R.toString(I) }
12805
12852
  });
12806
12853
  }
12807
12854
  length(A, I) {
12808
12855
  return new DA({
12809
12856
  ...this._def,
12810
- exactLength: { value: A, message: c.toString(I) }
12857
+ exactLength: { value: A, message: R.toString(I) }
12811
12858
  });
12812
12859
  }
12813
12860
  nonempty(A) {
@@ -12836,7 +12883,7 @@ function kA(g) {
12836
12883
  } else return g instanceof DA ? new DA({
12837
12884
  ...g._def,
12838
12885
  type: kA(g.element)
12839
- }) : g instanceof GA ? GA.create(kA(g.unwrap())) : g instanceof lA ? lA.create(kA(g.unwrap())) : g instanceof cA ? cA.create(g.items.map((A) => kA(A))) : g;
12886
+ }) : g instanceof GA ? GA.create(kA(g.unwrap())) : g instanceof lA ? lA.create(kA(g.unwrap())) : g instanceof RA ? RA.create(g.items.map((A) => kA(A))) : g;
12840
12887
  }
12841
12888
  class V extends q {
12842
12889
  constructor() {
@@ -12849,11 +12896,11 @@ class V extends q {
12849
12896
  return this._cached = { shape: A, keys: I }, this._cached;
12850
12897
  }
12851
12898
  _parse(A) {
12852
- if (this._getType(A) !== R.object) {
12899
+ if (this._getType(A) !== c.object) {
12853
12900
  const a = this._getOrReturnCtx(A);
12854
12901
  return w(a, {
12855
- code: y.invalid_type,
12856
- expected: R.object,
12902
+ code: e.invalid_type,
12903
+ expected: c.object,
12857
12904
  received: a.parsedType
12858
12905
  }), d;
12859
12906
  }
@@ -12880,7 +12927,7 @@ class V extends q {
12880
12927
  });
12881
12928
  else if (a === "strict")
12882
12929
  i.length > 0 && (w(C, {
12883
- code: y.unrecognized_keys,
12930
+ code: e.unrecognized_keys,
12884
12931
  keys: i
12885
12932
  }), B.dirty());
12886
12933
  else if (a !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
@@ -12915,14 +12962,14 @@ class V extends q {
12915
12962
  return this._def.shape();
12916
12963
  }
12917
12964
  strict(A) {
12918
- return c.errToObj, new V({
12965
+ return R.errToObj, new V({
12919
12966
  ...this._def,
12920
12967
  unknownKeys: "strict",
12921
12968
  ...A !== void 0 ? {
12922
12969
  errorMap: (I, B) => {
12923
12970
  const C = this._def.errorMap?.(I, B).message ?? B.defaultError;
12924
12971
  return I.code === "unrecognized_keys" ? {
12925
- message: c.errToObj(A).message ?? C
12972
+ message: R.errToObj(A).message ?? C
12926
12973
  } : {
12927
12974
  message: C
12928
12975
  };
@@ -13137,7 +13184,7 @@ class kI extends q {
13137
13184
  return I.common.issues.push(...i.ctx.common.issues), i.result;
13138
13185
  const E = Q.map((i) => new hA(i.ctx.common.issues));
13139
13186
  return w(I, {
13140
- code: y.invalid_union,
13187
+ code: e.invalid_union,
13141
13188
  unionErrors: E
13142
13189
  }), d;
13143
13190
  }
@@ -13184,7 +13231,7 @@ class kI extends q {
13184
13231
  return I.common.issues.push(...Q.ctx.common.issues), Q.result;
13185
13232
  const i = E.map((o) => new hA(o));
13186
13233
  return w(I, {
13187
- code: y.invalid_union,
13234
+ code: e.invalid_union,
13188
13235
  unionErrors: i
13189
13236
  }), d;
13190
13237
  }
@@ -13199,10 +13246,10 @@ kI.create = (g, A) => new kI({
13199
13246
  ...K(A)
13200
13247
  });
13201
13248
  function Dg(g, A) {
13202
- const I = yA(g), B = yA(A);
13249
+ const I = eA(g), B = eA(A);
13203
13250
  if (g === A)
13204
13251
  return { valid: !0, data: g };
13205
- if (I === R.object && B === R.object) {
13252
+ if (I === c.object && B === c.object) {
13206
13253
  const C = f.objectKeys(A), Q = f.objectKeys(g).filter((i) => C.indexOf(i) !== -1), E = { ...g, ...A };
13207
13254
  for (const i of Q) {
13208
13255
  const o = Dg(g[i], A[i]);
@@ -13211,7 +13258,7 @@ function Dg(g, A) {
13211
13258
  E[i] = o.data;
13212
13259
  }
13213
13260
  return { valid: !0, data: E };
13214
- } else if (I === R.array && B === R.array) {
13261
+ } else if (I === c.array && B === c.array) {
13215
13262
  if (g.length !== A.length)
13216
13263
  return { valid: !1 };
13217
13264
  const C = [];
@@ -13222,7 +13269,7 @@ function Dg(g, A) {
13222
13269
  C.push(o.data);
13223
13270
  }
13224
13271
  return { valid: !0, data: C };
13225
- } else return I === R.date && B === R.date && +g == +A ? { valid: !0, data: g } : { valid: !1 };
13272
+ } else return I === c.date && B === c.date && +g == +A ? { valid: !0, data: g } : { valid: !1 };
13226
13273
  }
13227
13274
  class LI extends q {
13228
13275
  _parse(A) {
@@ -13231,7 +13278,7 @@ class LI extends q {
13231
13278
  return d;
13232
13279
  const i = Dg(Q.value, E.value);
13233
13280
  return i.valid ? ((pB(Q) || pB(E)) && I.dirty(), { status: I.value, value: i.data }) : (w(B, {
13234
- code: y.invalid_intersection_types
13281
+ code: e.invalid_intersection_types
13235
13282
  }), d);
13236
13283
  };
13237
13284
  return B.common.async ? Promise.all([
@@ -13262,25 +13309,25 @@ LI.create = (g, A, I) => new LI({
13262
13309
  typeName: Y.ZodIntersection,
13263
13310
  ...K(I)
13264
13311
  });
13265
- class cA extends q {
13312
+ class RA extends q {
13266
13313
  _parse(A) {
13267
13314
  const { status: I, ctx: B } = this._processInputParams(A);
13268
- if (B.parsedType !== R.array)
13315
+ if (B.parsedType !== c.array)
13269
13316
  return w(B, {
13270
- code: y.invalid_type,
13271
- expected: R.array,
13317
+ code: e.invalid_type,
13318
+ expected: c.array,
13272
13319
  received: B.parsedType
13273
13320
  }), d;
13274
13321
  if (B.data.length < this._def.items.length)
13275
13322
  return w(B, {
13276
- code: y.too_small,
13323
+ code: e.too_small,
13277
13324
  minimum: this._def.items.length,
13278
13325
  inclusive: !0,
13279
13326
  exact: !1,
13280
13327
  type: "array"
13281
13328
  }), d;
13282
13329
  !this._def.rest && B.data.length > this._def.items.length && (w(B, {
13283
- code: y.too_big,
13330
+ code: e.too_big,
13284
13331
  maximum: this._def.items.length,
13285
13332
  inclusive: !0,
13286
13333
  exact: !1,
@@ -13296,16 +13343,16 @@ class cA extends q {
13296
13343
  return this._def.items;
13297
13344
  }
13298
13345
  rest(A) {
13299
- return new cA({
13346
+ return new RA({
13300
13347
  ...this._def,
13301
13348
  rest: A
13302
13349
  });
13303
13350
  }
13304
13351
  }
13305
- cA.create = (g, A) => {
13352
+ RA.create = (g, A) => {
13306
13353
  if (!Array.isArray(g))
13307
13354
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
13308
- return new cA({
13355
+ return new RA({
13309
13356
  items: g,
13310
13357
  typeName: Y.ZodTuple,
13311
13358
  rest: null,
@@ -13321,10 +13368,10 @@ class ZB extends q {
13321
13368
  }
13322
13369
  _parse(A) {
13323
13370
  const { status: I, ctx: B } = this._processInputParams(A);
13324
- if (B.parsedType !== R.map)
13371
+ if (B.parsedType !== c.map)
13325
13372
  return w(B, {
13326
- code: y.invalid_type,
13327
- expected: R.map,
13373
+ code: e.invalid_type,
13374
+ expected: c.map,
13328
13375
  received: B.parsedType
13329
13376
  }), d;
13330
13377
  const C = this._def.keyType, Q = this._def.valueType, E = [...B.data.entries()].map(([i, o], a) => ({
@@ -13363,22 +13410,22 @@ ZB.create = (g, A, I) => new ZB({
13363
13410
  class jA extends q {
13364
13411
  _parse(A) {
13365
13412
  const { status: I, ctx: B } = this._processInputParams(A);
13366
- if (B.parsedType !== R.set)
13413
+ if (B.parsedType !== c.set)
13367
13414
  return w(B, {
13368
- code: y.invalid_type,
13369
- expected: R.set,
13415
+ code: e.invalid_type,
13416
+ expected: c.set,
13370
13417
  received: B.parsedType
13371
13418
  }), d;
13372
13419
  const C = this._def;
13373
13420
  C.minSize !== null && B.data.size < C.minSize.value && (w(B, {
13374
- code: y.too_small,
13421
+ code: e.too_small,
13375
13422
  minimum: C.minSize.value,
13376
13423
  type: "set",
13377
13424
  inclusive: !0,
13378
13425
  exact: !1,
13379
13426
  message: C.minSize.message
13380
13427
  }), I.dirty()), C.maxSize !== null && B.data.size > C.maxSize.value && (w(B, {
13381
- code: y.too_big,
13428
+ code: e.too_big,
13382
13429
  maximum: C.maxSize.value,
13383
13430
  type: "set",
13384
13431
  inclusive: !0,
@@ -13401,13 +13448,13 @@ class jA extends q {
13401
13448
  min(A, I) {
13402
13449
  return new jA({
13403
13450
  ...this._def,
13404
- minSize: { value: A, message: c.toString(I) }
13451
+ minSize: { value: A, message: R.toString(I) }
13405
13452
  });
13406
13453
  }
13407
13454
  max(A, I) {
13408
13455
  return new jA({
13409
13456
  ...this._def,
13410
- maxSize: { value: A, message: c.toString(I) }
13457
+ maxSize: { value: A, message: R.toString(I) }
13411
13458
  });
13412
13459
  }
13413
13460
  size(A, I) {
@@ -13444,7 +13491,7 @@ class tg extends q {
13444
13491
  const I = this._getOrReturnCtx(A);
13445
13492
  return w(I, {
13446
13493
  received: I.data,
13447
- code: y.invalid_literal,
13494
+ code: e.invalid_literal,
13448
13495
  expected: this._def.value
13449
13496
  }), d;
13450
13497
  }
@@ -13473,14 +13520,14 @@ class HA extends q {
13473
13520
  return w(I, {
13474
13521
  expected: f.joinValues(B),
13475
13522
  received: I.parsedType,
13476
- code: y.invalid_type
13523
+ code: e.invalid_type
13477
13524
  }), d;
13478
13525
  }
13479
13526
  if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(A.data)) {
13480
13527
  const I = this._getOrReturnCtx(A), B = this._def.values;
13481
13528
  return w(I, {
13482
13529
  received: I.data,
13483
- code: y.invalid_enum_value,
13530
+ code: e.invalid_enum_value,
13484
13531
  options: B
13485
13532
  }), d;
13486
13533
  }
@@ -13524,19 +13571,19 @@ HA.create = kC;
13524
13571
  class OB extends q {
13525
13572
  _parse(A) {
13526
13573
  const I = f.getValidEnumValues(this._def.values), B = this._getOrReturnCtx(A);
13527
- if (B.parsedType !== R.string && B.parsedType !== R.number) {
13574
+ if (B.parsedType !== c.string && B.parsedType !== c.number) {
13528
13575
  const C = f.objectValues(I);
13529
13576
  return w(B, {
13530
13577
  expected: f.joinValues(C),
13531
13578
  received: B.parsedType,
13532
- code: y.invalid_type
13579
+ code: e.invalid_type
13533
13580
  }), d;
13534
13581
  }
13535
13582
  if (this._cache || (this._cache = new Set(f.getValidEnumValues(this._def.values))), !this._cache.has(A.data)) {
13536
13583
  const C = f.objectValues(I);
13537
13584
  return w(B, {
13538
13585
  received: B.data,
13539
- code: y.invalid_enum_value,
13586
+ code: e.invalid_enum_value,
13540
13587
  options: C
13541
13588
  }), d;
13542
13589
  }
@@ -13557,13 +13604,13 @@ class JI extends q {
13557
13604
  }
13558
13605
  _parse(A) {
13559
13606
  const { ctx: I } = this._processInputParams(A);
13560
- if (I.parsedType !== R.promise && I.common.async === !1)
13607
+ if (I.parsedType !== c.promise && I.common.async === !1)
13561
13608
  return w(I, {
13562
- code: y.invalid_type,
13563
- expected: R.promise,
13609
+ code: e.invalid_type,
13610
+ expected: c.promise,
13564
13611
  received: I.parsedType
13565
13612
  }), d;
13566
- const B = I.parsedType === R.promise ? I.data : Promise.resolve(I.data);
13613
+ const B = I.parsedType === c.promise ? I.data : Promise.resolve(I.data);
13567
13614
  return QA(B.then((C) => this._def.type.parseAsync(C, {
13568
13615
  path: I.path,
13569
13616
  errorMap: I.common.contextualErrorMap
@@ -13669,7 +13716,7 @@ qA.createWithPreprocess = (g, A, I) => new qA({
13669
13716
  });
13670
13717
  class GA extends q {
13671
13718
  _parse(A) {
13672
- return this._getType(A) === R.undefined ? QA(void 0) : this._def.innerType._parse(A);
13719
+ return this._getType(A) === c.undefined ? QA(void 0) : this._def.innerType._parse(A);
13673
13720
  }
13674
13721
  unwrap() {
13675
13722
  return this._def.innerType;
@@ -13682,7 +13729,7 @@ GA.create = (g, A) => new GA({
13682
13729
  });
13683
13730
  class lA extends q {
13684
13731
  _parse(A) {
13685
- return this._getType(A) === R.null ? QA(null) : this._def.innerType._parse(A);
13732
+ return this._getType(A) === c.null ? QA(null) : this._def.innerType._parse(A);
13686
13733
  }
13687
13734
  unwrap() {
13688
13735
  return this._def.innerType;
@@ -13697,7 +13744,7 @@ class hg extends q {
13697
13744
  _parse(A) {
13698
13745
  const { ctx: I } = this._processInputParams(A);
13699
13746
  let B = I.data;
13700
- return I.parsedType === R.undefined && (B = this._def.defaultValue()), this._def.innerType._parse({
13747
+ return I.parsedType === c.undefined && (B = this._def.defaultValue()), this._def.innerType._parse({
13701
13748
  data: B,
13702
13749
  path: I.path,
13703
13750
  parent: I
@@ -13713,7 +13760,7 @@ hg.create = (g, A) => new hg({
13713
13760
  defaultValue: typeof A.default == "function" ? A.default : () => A.default,
13714
13761
  ...K(A)
13715
13762
  });
13716
- class yg extends q {
13763
+ class eg extends q {
13717
13764
  _parse(A) {
13718
13765
  const { ctx: I } = this._processInputParams(A), B = {
13719
13766
  ...I,
@@ -13750,7 +13797,7 @@ class yg extends q {
13750
13797
  return this._def.innerType;
13751
13798
  }
13752
13799
  }
13753
- yg.create = (g, A) => new yg({
13800
+ eg.create = (g, A) => new eg({
13754
13801
  innerType: g,
13755
13802
  typeName: Y.ZodCatch,
13756
13803
  catchValue: typeof A.catch == "function" ? A.catch : () => A.catch,
@@ -13758,11 +13805,11 @@ yg.create = (g, A) => new yg({
13758
13805
  });
13759
13806
  class VB extends q {
13760
13807
  _parse(A) {
13761
- if (this._getType(A) !== R.nan) {
13808
+ if (this._getType(A) !== c.nan) {
13762
13809
  const B = this._getOrReturnCtx(A);
13763
13810
  return w(B, {
13764
- code: y.invalid_type,
13765
- expected: R.nan,
13811
+ code: e.invalid_type,
13812
+ expected: c.nan,
13766
13813
  received: B.parsedType
13767
13814
  }), d;
13768
13815
  }
@@ -13826,7 +13873,7 @@ class bg extends q {
13826
13873
  });
13827
13874
  }
13828
13875
  }
13829
- class eg extends q {
13876
+ class yg extends q {
13830
13877
  _parse(A) {
13831
13878
  const I = this._def.innerType._parse(A), B = (C) => (MA(C) && (C.value = Object.freeze(C.value)), C);
13832
13879
  return NI(I) ? I.then((C) => B(C)) : B(I);
@@ -13835,7 +13882,7 @@ class eg extends q {
13835
13882
  return this._def.innerType;
13836
13883
  }
13837
13884
  }
13838
- eg.create = (g, A) => new eg({
13885
+ yg.create = (g, A) => new yg({
13839
13886
  innerType: g,
13840
13887
  typeName: Y.ZodReadonly,
13841
13888
  ...K(A)
@@ -13844,12 +13891,12 @@ var Y;
13844
13891
  (function(g) {
13845
13892
  g.ZodString = "ZodString", g.ZodNumber = "ZodNumber", g.ZodNaN = "ZodNaN", g.ZodBigInt = "ZodBigInt", g.ZodBoolean = "ZodBoolean", g.ZodDate = "ZodDate", g.ZodSymbol = "ZodSymbol", g.ZodUndefined = "ZodUndefined", g.ZodNull = "ZodNull", g.ZodAny = "ZodAny", g.ZodUnknown = "ZodUnknown", g.ZodNever = "ZodNever", g.ZodVoid = "ZodVoid", g.ZodArray = "ZodArray", g.ZodObject = "ZodObject", g.ZodUnion = "ZodUnion", g.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", g.ZodIntersection = "ZodIntersection", g.ZodTuple = "ZodTuple", g.ZodRecord = "ZodRecord", g.ZodMap = "ZodMap", g.ZodSet = "ZodSet", g.ZodFunction = "ZodFunction", g.ZodLazy = "ZodLazy", g.ZodLiteral = "ZodLiteral", g.ZodEnum = "ZodEnum", g.ZodEffects = "ZodEffects", g.ZodNativeEnum = "ZodNativeEnum", g.ZodOptional = "ZodOptional", g.ZodNullable = "ZodNullable", g.ZodDefault = "ZodDefault", g.ZodCatch = "ZodCatch", g.ZodPromise = "ZodPromise", g.ZodBranded = "ZodBranded", g.ZodPipeline = "ZodPipeline", g.ZodReadonly = "ZodReadonly";
13846
13893
  })(Y || (Y = {}));
13847
- const u = eA.create, H = KA.create, LC = ag.create, nA = sg.create;
13894
+ const u = yA.create, H = KA.create, LC = ag.create, nA = sg.create;
13848
13895
  rA.create;
13849
13896
  const p = DA.create, J = V.create;
13850
13897
  kI.create;
13851
13898
  LI.create;
13852
- cA.create;
13899
+ RA.create;
13853
13900
  const $ = tg.create, LA = HA.create;
13854
13901
  JI.create;
13855
13902
  GA.create;
@@ -14599,7 +14646,7 @@ class po extends KI {
14599
14646
  }
14600
14647
  /** Performs no per-frame work. The axes are built at construction. */
14601
14648
  update() {
14602
- return !0;
14649
+ return !1;
14603
14650
  }
14604
14651
  }
14605
14652
  function vI(g) {
@@ -14610,7 +14657,7 @@ function vI(g) {
14610
14657
  width: I
14611
14658
  });
14612
14659
  }
14613
- class ho extends Rg {
14660
+ class ho extends cg {
14614
14661
  width_;
14615
14662
  height_;
14616
14663
  depth_;
@@ -14673,7 +14720,7 @@ class uo extends zA {
14673
14720
  type: "marker",
14674
14721
  itemSize: 1,
14675
14722
  offset: B.strideBytes
14676
- }), this.geometry = B, this.setTexture(0, yo());
14723
+ }), this.geometry = B, this.setTexture(0, eo());
14677
14724
  }
14678
14725
  /** Identifies the renderable type as `PointsRenderable`. */
14679
14726
  get type() {
@@ -14681,10 +14728,10 @@ class uo extends zA {
14681
14728
  }
14682
14729
  }
14683
14730
  let XI;
14684
- function yo() {
14685
- return XI || (XI = eo()), XI;
14686
- }
14687
14731
  function eo() {
14732
+ return XI || (XI = yo()), XI;
14733
+ }
14734
+ function yo() {
14688
14735
  const g = (a) => {
14689
14736
  const s = new Float32Array(a * a);
14690
14737
  return s.fill(1), s;
@@ -14996,7 +15043,7 @@ class mo {
14996
15043
  Math.abs(this.orbitVelocity_.phi) < m && (this.orbitVelocity_.phi = 0), Math.abs(this.orbitVelocity_.theta) < m && (this.orbitVelocity_.theta = 0), Math.abs(this.orbitVelocity_.radius) < m && (this.orbitVelocity_.radius = 0), ng(this.panVelocity_) < m && QQ(this.panVelocity_);
14997
15044
  }
14998
15045
  }
14999
- const MC = 1.77, zB = 128, _B = 128 / MC, Ro = -1e6, co = 1e6;
15046
+ const MC = 1.77, zB = 128, _B = 128 / MC, co = -1e6, Ro = 1e6;
15000
15047
  class To extends YC {
15001
15048
  // width_ and height_ should always be defined by constructor (see setFrame)
15002
15049
  width_ = zB;
@@ -15012,7 +15059,7 @@ class To extends YC {
15012
15059
  * @param props - Initialization properties.
15013
15060
  */
15014
15061
  constructor(A) {
15015
- super(), this.near_ = A.near ?? Ro, this.far_ = A.far ?? co, this.orientation_ = A.orientation ?? "XY", this.axes_ = dA(this.orientation_), this.rotation_ = YA(this.axes_), this.setFrame(A), this.updateProjectionMatrix();
15062
+ super(), this.near_ = A.near ?? co, this.far_ = A.far ?? Ro, this.orientation_ = A.orientation ?? "XY", this.axes_ = dA(this.orientation_), this.rotation_ = YA(this.axes_), this.setFrame(A), this.updateProjectionMatrix();
15016
15063
  }
15017
15064
  /**
15018
15065
  * The world-space size of the rendered view as `[width, height]`.