@idetik/core 0.46.2 → 0.47.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
@@ -6,8 +6,6 @@ class KC {
6
6
  constructor(A) {
7
7
  this.canvas_ = A, this.updateRendererSize();
8
8
  }
9
- beginFrame() {
10
- }
11
9
  updateSize() {
12
10
  this.updateRendererSize(), this.resize(this.width_, this.height_);
13
11
  }
@@ -811,7 +809,7 @@ function AC(g) {
811
809
  const A = g ?? "";
812
810
  return BI[A] = (BI[A] ?? 0) + 1, g ? `${g}-${BI[A]}` : String(BI[A]);
813
811
  }
814
- class YI {
812
+ class dI {
815
813
  id = AC();
816
814
  }
817
815
  var m = 1e-6, j = typeof Float32Array < "u" ? Float32Array : Array, PC = Math.PI / 180;
@@ -837,23 +835,23 @@ function IB(g, A) {
837
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;
838
836
  }
839
837
  function PA(g, A) {
840
- 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], h = A[10], t = A[11], e = A[12], n = A[13], F = A[14], G = A[15], L = I * i - B * E, N = I * o - C * E, S = I * a - Q * E, r = B * o - C * i, U = B * a - Q * i, l = C * a - Q * o, Z = s * n - D * e, O = s * F - h * e, b = s * G - t * e, z = D * F - h * n, oA = D * G - t * n, aA = h * G - t * F, P = L * aA - N * oA + S * z + r * b - U * O + l * Z;
841
- 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 - F * U + G * r) * P, g[3] = (h * U - D * l - t * r) * P, g[4] = (o * b - E * aA - a * O) * P, g[5] = (I * aA - C * b + Q * O) * P, g[6] = (F * S - e * l - G * N) * P, g[7] = (s * l - h * S + t * 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 - t * 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 * r - F * L) * P, g[15] = (s * r - D * N + h * 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], 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;
842
840
  }
843
841
  function QI(g, A, I) {
844
- 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], h = A[9], t = A[10], e = A[11], n = A[12], F = A[13], G = A[14], L = A[15], N = I[0], S = I[1], r = I[2], U = I[3];
845
- return g[0] = N * B + S * i + r * D + U * n, g[1] = N * C + S * o + r * h + U * F, g[2] = N * Q + S * a + r * t + U * G, g[3] = N * E + S * s + r * e + U * L, N = I[4], S = I[5], r = I[6], U = I[7], g[4] = N * B + S * i + r * D + U * n, g[5] = N * C + S * o + r * h + U * F, g[6] = N * Q + S * a + r * t + U * G, g[7] = N * E + S * s + r * e + U * L, N = I[8], S = I[9], r = I[10], U = I[11], g[8] = N * B + S * i + r * D + U * n, g[9] = N * C + S * o + r * h + U * F, g[10] = N * Q + S * a + r * t + U * G, g[11] = N * E + S * s + r * e + U * L, N = I[12], S = I[13], r = I[14], U = I[15], g[12] = N * B + S * i + r * D + U * n, g[13] = N * C + S * o + r * h + U * F, g[14] = N * Q + S * a + r * t + U * G, g[15] = N * E + S * s + r * 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], 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;
846
844
  }
847
845
  function XC(g, A, I) {
848
- var B = I[0], C = I[1], Q = I[2], E, i, o, a, s, D, h, t, e, n, F, G;
849
- 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], h = A[6], t = A[7], e = A[8], n = A[9], F = 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] = h, g[7] = t, g[8] = e, g[9] = n, g[10] = F, 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 + h * C + F * Q + A[14], g[15] = a * B + t * 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, 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;
850
848
  }
851
849
  function gC(g, A) {
852
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;
853
851
  }
854
852
  function jC(g, A, I, B) {
855
- 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, h = C * a, t = C * s, e = Q * a, n = Q * s, F = E * s, G = i * o, L = i * a, N = i * s, S = B[0], r = B[1], U = B[2];
856
- return g[0] = (1 - (e + F)) * S, g[1] = (h + N) * S, g[2] = (t - L) * S, g[3] = 0, g[4] = (h - N) * r, g[5] = (1 - (D + F)) * r, g[6] = (n + G) * r, g[7] = 0, g[8] = (t + 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, 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;
857
855
  }
858
856
  function zC(g, A, I, B, C) {
859
857
  var Q = 1 / Math.tan(A / 2);
@@ -871,17 +869,17 @@ function $C(g, A, I, B, C, Q, E) {
871
869
  }
872
870
  var AQ = $C;
873
871
  function IQ(g, A, I, B) {
874
- 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], h = E - I[2], t = s * s + D * D + h * h;
875
- t > 0 && (t = 1 / Math.sqrt(t), s *= t, D *= t, h *= t);
876
- var e = o * h - a * D, n = a * s - i * h, F = i * D - o * s;
877
- return t = e * e + n * n + F * F, t > 0 && (t = 1 / Math.sqrt(t), e *= t, n *= t, F *= t), g[0] = e, g[1] = n, g[2] = F, g[3] = 0, g[4] = D * F - h * n, g[5] = h * e - s * F, g[6] = s * n - D * e, g[7] = 0, g[8] = s, g[9] = D, g[10] = h, g[11] = 0, g[12] = C, g[13] = Q, g[14] = E, g[15] = 1, g;
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
+ 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;
878
876
  }
879
877
  function gB(g, A) {
880
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];
881
879
  }
882
880
  function gQ(g, A) {
883
- 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], h = g[10], t = g[11], e = g[12], n = g[13], F = g[14], G = g[15], L = A[0], N = A[1], S = A[2], r = 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];
884
- 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 - r) <= m * Math.max(1, Math.abs(Q), Math.abs(r)) && 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(h - oA) <= m * Math.max(1, Math.abs(h), Math.abs(oA)) && Math.abs(t - aA) <= m * Math.max(1, Math.abs(t), 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(F - Vg) <= m * Math.max(1, Math.abs(F), 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], 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));
885
883
  }
886
884
  function M() {
887
885
  var g = new j(3);
@@ -902,7 +900,7 @@ function x(g, A, I) {
902
900
  function _I(g, A) {
903
901
  return g[0] = A[0], g[1] = A[1], g[2] = A[2], g;
904
902
  }
905
- function rA(g, A, I, B) {
903
+ function FA(g, A, I, B) {
906
904
  return g[0] = A, g[1] = I, g[2] = B, g;
907
905
  }
908
906
  function aI(g, A, I) {
@@ -940,13 +938,13 @@ function wg(g, A, I) {
940
938
  return E = E || 1, g[0] = (I[0] * B + I[4] * C + I[8] * Q + I[12]) / E, g[1] = (I[1] * B + I[5] * C + I[9] * Q + I[13]) / E, g[2] = (I[2] * B + I[6] * C + I[10] * Q + I[14]) / E, g;
941
939
  }
942
940
  function CC(g, A, I) {
943
- var B = I[0], C = I[1], Q = I[2], E = I[3], i = A[0], o = A[1], a = A[2], s = C * a - Q * o, D = Q * i - B * a, h = B * o - C * i;
944
- return s = s + s, D = D + D, h = h + h, g[0] = i + E * s + C * h - Q * D, g[1] = o + E * D + Q * s - B * h, g[2] = a + E * h + B * D - C * s, g;
941
+ var B = I[0], C = I[1], Q = I[2], E = I[3], i = A[0], o = A[1], a = A[2], s = C * a - Q * o, D = Q * i - B * a, t = B * o - C * i;
942
+ return s = s + s, D = D + D, t = t + t, g[0] = i + E * s + C * t - Q * D, g[1] = o + E * D + Q * s - B * t, g[2] = a + E * t + B * D - C * s, g;
945
943
  }
946
944
  function QQ(g) {
947
945
  return g[0] = 0, g[1] = 0, g[2] = 0, g;
948
946
  }
949
- function Fg(g, A) {
947
+ function rg(g, A) {
950
948
  var I = g[0], B = g[1], C = g[2], Q = A[0], E = A[1], i = A[2];
951
949
  return Math.abs(I - Q) <= m * Math.max(1, Math.abs(I), Math.abs(Q)) && Math.abs(B - E) <= m * Math.max(1, Math.abs(B), Math.abs(E)) && Math.abs(C - i) <= m * Math.max(1, Math.abs(C), Math.abs(i));
952
950
  }
@@ -995,7 +993,7 @@ function OA(g, A, I) {
995
993
  return A;
996
994
  };
997
995
  })();
998
- function hI() {
996
+ function tI() {
999
997
  var g = new j(4);
1000
998
  return j != Float32Array && (g[0] = 0, g[1] = 0, g[2] = 0), g[3] = 1, g;
1001
999
  }
@@ -1004,15 +1002,15 @@ function DQ(g, A, I) {
1004
1002
  var B = Math.sin(I);
1005
1003
  return g[0] = B * A[0], g[1] = B * A[1], g[2] = B * A[2], g[3] = Math.cos(I), g;
1006
1004
  }
1007
- function hQ(g, A, I) {
1005
+ function tQ(g, A, I) {
1008
1006
  var B = A[0], C = A[1], Q = A[2], E = A[3], i = I[0], o = I[1], a = I[2], s = I[3];
1009
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;
1010
1008
  }
1011
1009
  function mI(g, A, I, B) {
1012
- 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], h, t, e, n, F;
1013
- return t = C * o + Q * a + E * s + i * D, t < 0 && (t = -t, o = -o, a = -a, s = -s, D = -D), 1 - t > m ? (h = Math.acos(t), e = Math.sin(h), n = Math.sin((1 - B) * h) / e, F = Math.sin(B * h) / e) : (n = 1 - B, F = B), g[0] = n * C + F * o, g[1] = n * Q + F * a, g[2] = n * E + F * s, g[3] = n * i + F * 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, 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;
1014
1012
  }
1015
- function rg(g, A) {
1013
+ function Fg(g, A) {
1016
1014
  var I = A[0] + A[4] + A[8], B;
1017
1015
  if (I > 0)
1018
1016
  B = Math.sqrt(I + 1), g[3] = 0.5 * B, B = 0.5 / B, g[0] = (A[5] - A[7]) * B, g[1] = (A[6] - A[2]) * B, g[2] = (A[1] - A[3]) * B;
@@ -1024,16 +1022,16 @@ function rg(g, A) {
1024
1022
  }
1025
1023
  return g;
1026
1024
  }
1027
- var tQ = iQ, yQ = oQ, dI = sQ;
1025
+ var hQ = iQ, yQ = oQ, YI = sQ;
1028
1026
  (function() {
1029
1027
  var g = M(), A = x(1, 0, 0), I = x(0, 1, 0);
1030
1028
  return function(B, C, Q) {
1031
1029
  var E = sI(C, Q);
1032
- return E < -0.999999 ? (EI(g, A, C), EQ(g) < 1e-6 && EI(g, I, C), BC(g, g), DQ(B, g, Math.PI), B) : E > 0.999999 ? (B[0] = 0, B[1] = 0, B[2] = 0, B[3] = 1, B) : (EI(g, C, Q), B[0] = g[0], B[1] = g[1], B[2] = g[2], B[3] = 1 + E, dI(B, B));
1030
+ return E < -0.999999 ? (EI(g, A, C), EQ(g) < 1e-6 && EI(g, I, C), BC(g, g), DQ(B, g, Math.PI), B) : E > 0.999999 ? (B[0] = 0, B[1] = 0, B[2] = 0, B[3] = 1, B) : (EI(g, C, Q), B[0] = g[0], B[1] = g[1], B[2] = g[2], B[3] = 1 + E, YI(B, B));
1033
1031
  };
1034
1032
  })();
1035
1033
  (function() {
1036
- var g = hI(), A = hI();
1034
+ var g = tI(), A = tI();
1037
1035
  return function(I, B, C, Q, E, i) {
1038
1036
  return mI(g, B, E, i), mI(A, C, Q, i), mI(I, g, A, 2 * i * (1 - i)), I;
1039
1037
  };
@@ -1041,7 +1039,7 @@ var tQ = iQ, yQ = oQ, dI = sQ;
1041
1039
  (function() {
1042
1040
  var g = IC();
1043
1041
  return function(A, I, B, C) {
1044
- return g[0] = B[0], g[3] = B[1], g[6] = B[2], g[1] = C[0], g[4] = C[1], g[7] = C[2], g[2] = -I[0], g[5] = -I[1], g[8] = -I[2], dI(A, rg(A, g));
1042
+ return g[0] = B[0], g[3] = B[1], g[6] = B[2], g[1] = C[0], g[4] = C[1], g[7] = C[2], g[2] = -I[0], g[5] = -I[1], g[8] = -I[2], YI(A, Fg(A, g));
1045
1043
  };
1046
1044
  })();
1047
1045
  function QC() {
@@ -1160,7 +1158,7 @@ const wQ = {
1160
1158
  size: 7,
1161
1159
  marker: 8
1162
1160
  };
1163
- class pA extends YI {
1161
+ class pA extends dI {
1164
1162
  instanceCount = null;
1165
1163
  boundingBox_ = null;
1166
1164
  primitive_;
@@ -1213,7 +1211,7 @@ class pA extends YI {
1213
1211
  return this.attributes_.find((I) => I.type === A);
1214
1212
  }
1215
1213
  }
1216
- class FQ {
1214
+ class rQ {
1217
1215
  gl_;
1218
1216
  buffers_ = /* @__PURE__ */ new Map();
1219
1217
  currentGeometry_ = null;
@@ -1268,7 +1266,7 @@ class FQ {
1268
1266
  this.buffers_.set(A, o), this.gl_.bindVertexArray(null);
1269
1267
  }
1270
1268
  }
1271
- function rQ(g) {
1269
+ function FQ(g) {
1272
1270
  return g === 1 || g === 2 || g === 4 || g === 8;
1273
1271
  }
1274
1272
  function Sg(g) {
@@ -1339,7 +1337,7 @@ function cQ(g) {
1339
1337
  return [0, 1];
1340
1338
  }
1341
1339
  }
1342
- class Rg extends YI {
1340
+ class Rg extends dI {
1343
1341
  dataFormat = "rgba";
1344
1342
  dataType = "unsigned_byte";
1345
1343
  maxFilter = "nearest";
@@ -1646,6 +1644,66 @@ class NQ {
1646
1644
  return A.type === "Texture3D";
1647
1645
  }
1648
1646
  }
1647
+ class UQ {
1648
+ constructor(A) {
1649
+ this.gl_ = A, this.extension_ = A.getExtension("EXT_disjoint_timer_query_webgl2"), A.canvas.addEventListener("webglcontextlost", () => {
1650
+ this.extension_ = null, this.activeQuery_ = null, this.pendingQuery_ = null, this.lastSampleAt_ = void 0;
1651
+ }), A.canvas.addEventListener("webglcontextrestored", () => {
1652
+ this.extension_ = A.getExtension("EXT_disjoint_timer_query_webgl2");
1653
+ });
1654
+ }
1655
+ extension_;
1656
+ activeQuery_ = null;
1657
+ pendingQuery_ = null;
1658
+ samples_ = 0;
1659
+ totalMs_ = 0;
1660
+ lastSampleAt_;
1661
+ get timing() {
1662
+ return this.poll(), {
1663
+ supported: this.extension_ !== null && !this.gl_.isContextLost(),
1664
+ samples: this.samples_,
1665
+ totalMs: this.totalMs_,
1666
+ lastSampleAt: this.lastSampleAt_
1667
+ };
1668
+ }
1669
+ beginFrame() {
1670
+ if (this.discardActiveQuery(), this.poll(), !this.extension_ || this.gl_.isContextLost() || this.pendingQuery_)
1671
+ return;
1672
+ if (this.gl_.getParameter(this.extension_.GPU_DISJOINT_EXT)) {
1673
+ this.lastSampleAt_ = void 0;
1674
+ return;
1675
+ }
1676
+ const A = this.gl_.createQuery();
1677
+ A && (this.gl_.beginQuery(this.extension_.TIME_ELAPSED_EXT, A), this.activeQuery_ = A);
1678
+ }
1679
+ endFrame() {
1680
+ !this.activeQuery_ || !this.extension_ || (this.gl_.endQuery(this.extension_.TIME_ELAPSED_EXT), this.pendingQuery_ = {
1681
+ query: this.activeQuery_,
1682
+ submittedAt: performance.now()
1683
+ }, this.activeQuery_ = null);
1684
+ }
1685
+ reset() {
1686
+ this.discardActiveQuery(), this.discardPendingQuery(), this.lastSampleAt_ = void 0;
1687
+ }
1688
+ poll() {
1689
+ const A = this.pendingQuery_;
1690
+ if (!A || !this.extension_ || this.gl_.isContextLost()) return;
1691
+ if (this.gl_.getParameter(this.extension_.GPU_DISJOINT_EXT)) {
1692
+ this.discardPendingQuery(), this.lastSampleAt_ = void 0;
1693
+ return;
1694
+ }
1695
+ const { query: I, submittedAt: B } = A, C = this.gl_;
1696
+ if (!C.getQueryParameter(I, C.QUERY_RESULT_AVAILABLE)) return;
1697
+ const E = C.getQueryParameter(I, C.QUERY_RESULT);
1698
+ C.isContextLost() || (this.samples_ += 1, this.totalMs_ += E / 1e6, this.lastSampleAt_ = B), this.discardPendingQuery();
1699
+ }
1700
+ discardActiveQuery() {
1701
+ !this.activeQuery_ || !this.extension_ || (this.gl_.endQuery(this.extension_.TIME_ELAPSED_EXT), this.gl_.deleteQuery(this.activeQuery_), this.activeQuery_ = null);
1702
+ }
1703
+ discardPendingQuery() {
1704
+ this.pendingQuery_ && (this.gl_.deleteQuery(this.pendingQuery_.query), this.pendingQuery_ = null);
1705
+ }
1706
+ }
1649
1707
  class AA {
1650
1708
  /** Minimum corner of the box. */
1651
1709
  min;
@@ -1701,7 +1759,7 @@ class AA {
1701
1759
  return { x: A, y: I, width: B, height: C };
1702
1760
  }
1703
1761
  }
1704
- class UQ {
1762
+ class kQ {
1705
1763
  gl_;
1706
1764
  enabledCapabilities_ = /* @__PURE__ */ new Map();
1707
1765
  depthMaskEnabled_ = null;
@@ -1829,7 +1887,7 @@ class UQ {
1829
1887
  (this.stencilFunc_ !== A || this.stencilRef_ !== I || this.stencilFuncMask_ !== B) && (this.gl_.stencilFunc(A, I, B), this.stencilFunc_ = A, this.stencilRef_ = I, this.stencilFuncMask_ = B);
1830
1888
  }
1831
1889
  }
1832
- class kQ {
1890
+ class LQ {
1833
1891
  textureUnit;
1834
1892
  gl_;
1835
1893
  framebuffer_ = null;
@@ -1880,14 +1938,15 @@ class kQ {
1880
1938
  ), B.texParameteri(B.TEXTURE_2D, B.TEXTURE_MIN_FILTER, B.NEAREST), B.texParameteri(B.TEXTURE_2D, B.TEXTURE_MAG_FILTER, B.NEAREST), B.texParameteri(B.TEXTURE_2D, B.TEXTURE_WRAP_S, B.CLAMP_TO_EDGE), B.texParameteri(B.TEXTURE_2D, B.TEXTURE_WRAP_T, B.CLAMP_TO_EDGE), C;
1881
1939
  }
1882
1940
  }
1883
- const LQ = gC(_(), [1, -1, 1]);
1884
- class JQ extends KC {
1941
+ const JQ = gC(_(), [1, -1, 1]);
1942
+ class dQ extends KC {
1885
1943
  gl_;
1886
1944
  bindings_;
1887
1945
  depthTarget_;
1888
1946
  programs_;
1889
1947
  state_;
1890
1948
  textures_;
1949
+ timer_;
1891
1950
  renderedObjectsPerFrame_ = 0;
1892
1951
  stencilRef_ = 0;
1893
1952
  currentViewportSize_ = [0, 0];
@@ -1901,10 +1960,10 @@ class JQ extends KC {
1901
1960
  });
1902
1961
  if (!I)
1903
1962
  throw new Error("Failed to initialize WebGL2 context");
1904
- this.gl_ = I, k.info(
1963
+ this.gl_ = I, this.timer_ = new UQ(I), k.info(
1905
1964
  "WebGLRenderer",
1906
1965
  `WebGL version ${I.getParameter(I.VERSION)}`
1907
- ), I.getExtension("EXT_color_buffer_float"), this.programs_ = new ZC(I), this.bindings_ = new FQ(I), this.textures_ = new NQ(I), this.state_ = new UQ(I), this.depthTarget_ = new kQ(
1966
+ ), I.getExtension("EXT_color_buffer_float"), this.programs_ = new ZC(I), this.bindings_ = new rQ(I), this.textures_ = new NQ(I), this.state_ = new kQ(I), this.depthTarget_ = new LQ(
1908
1967
  I,
1909
1968
  this.textures_.reservePersistentUnit()
1910
1969
  ), this.resize(this.canvas.width, this.canvas.height);
@@ -1915,6 +1974,18 @@ class JQ extends KC {
1915
1974
  get gpuTextureCount() {
1916
1975
  return this.textures_.textureCount;
1917
1976
  }
1977
+ beginFrame() {
1978
+ this.timer_.beginFrame();
1979
+ }
1980
+ endFrame() {
1981
+ this.timer_.endFrame();
1982
+ }
1983
+ resetGpuTiming() {
1984
+ this.timer_.reset();
1985
+ }
1986
+ get gpuTiming() {
1987
+ return this.timer_.timing;
1988
+ }
1918
1989
  render(A) {
1919
1990
  if (this.renderedObjects_ = 0, this.renderedObjectsPerFrame_ = 0, this.stencilRef_ = 0, getComputedStyle(A.domElement).visibility === "hidden") return;
1920
1991
  const I = A.getBoxRelativeTo(this.canvas), B = new AA(
@@ -2006,7 +2077,7 @@ class JQ extends KC {
2006
2077
  I.transform.matrix
2007
2078
  ), i = QI(
2008
2079
  _(),
2009
- LQ,
2080
+ JQ,
2010
2081
  Q.projectionMatrix
2011
2082
  ), o = this.currentViewportSize_, a = I.getUniforms(), D = {
2012
2083
  ...B.getUniforms(),
@@ -2038,7 +2109,7 @@ class JQ extends KC {
2038
2109
  C.setUniform(n, this.depthTarget_.textureUnit);
2039
2110
  break;
2040
2111
  case "u_mvpInverse": {
2041
- const F = QI(_(), i, E), G = PA(_(), F);
2112
+ const r = QI(_(), i, E), G = PA(_(), r);
2042
2113
  C.setUniform(n, G);
2043
2114
  break;
2044
2115
  }
@@ -2049,10 +2120,10 @@ class JQ extends KC {
2049
2120
  );
2050
2121
  break;
2051
2122
  case "u_cameraPositionModel": {
2052
- const F = PA(_(), E), G = DI(0, 0, 0, 1), L = OA(
2123
+ const r = PA(_(), E), G = DI(0, 0, 0, 1), L = OA(
2053
2124
  JA(),
2054
2125
  G,
2055
- F
2126
+ r
2056
2127
  );
2057
2128
  C.setUniform(
2058
2129
  n,
@@ -2067,19 +2138,19 @@ class JQ extends KC {
2067
2138
  default:
2068
2139
  n in D && C.setUniform(n, D[n]);
2069
2140
  }
2070
- const h = this.glGetPrimitive(A.primitive), t = A.indexData, { instanceCount: e } = A;
2071
- e !== null ? t.length ? this.gl_.drawElementsInstanced(
2072
- h,
2073
- t.length,
2141
+ const t = this.glGetPrimitive(A.primitive), h = A.indexData, { instanceCount: e } = A;
2142
+ e !== null ? h.length ? this.gl_.drawElementsInstanced(
2143
+ t,
2144
+ h.length,
2074
2145
  this.gl_.UNSIGNED_INT,
2075
2146
  0,
2076
2147
  e
2077
2148
  ) : this.gl_.drawArraysInstanced(
2078
- h,
2149
+ t,
2079
2150
  0,
2080
2151
  A.vertexCount,
2081
2152
  e
2082
- ) : t.length ? this.gl_.drawElements(h, t.length, this.gl_.UNSIGNED_INT, 0) : this.gl_.drawArrays(h, 0, A.vertexCount);
2153
+ ) : h.length ? this.gl_.drawElements(t, h.length, this.gl_.UNSIGNED_INT, 0) : this.gl_.drawArrays(t, 0, A.vertexCount);
2083
2154
  }
2084
2155
  uploadTexture(A) {
2085
2156
  this.textures_.uploadTexture(A);
@@ -2170,15 +2241,15 @@ class YQ {
2170
2241
  this.running_.set(I, { controller: C, promise: Q });
2171
2242
  }
2172
2243
  }
2173
- let tI = 0, yI = 0;
2174
- function dQ(g, A) {
2175
- g.data && (tI -= g.data.byteLength, yI -= 1), g.data = A, tI += A.byteLength, yI += 1;
2244
+ let hI = 0, yI = 0;
2245
+ function MQ(g, A) {
2246
+ g.data && (hI -= g.data.byteLength, yI -= 1), g.data = A, hI += A.byteLength, yI += 1;
2176
2247
  }
2177
2248
  function EB(g) {
2178
- g.data && (tI -= g.data.byteLength, yI -= 1), g.data = void 0, g.texture?.releaseCpuData();
2249
+ g.data && (hI -= g.data.byteLength, yI -= 1), g.data = void 0, g.texture?.releaseCpuData();
2179
2250
  }
2180
- function MQ() {
2181
- return { cpuChunkBytes: tI, cpuChunkCount: yI };
2251
+ function KQ() {
2252
+ return { cpuChunkBytes: hI, cpuChunkCount: yI };
2182
2253
  }
2183
2254
  function iB(g, A, I = 1e-6) {
2184
2255
  return Math.abs(g - A) <= I;
@@ -2188,7 +2259,7 @@ const W = {
2188
2259
  y: 1,
2189
2260
  z: 2
2190
2261
  };
2191
- function YA(g) {
2262
+ function dA(g) {
2192
2263
  switch (g) {
2193
2264
  case "XY":
2194
2265
  return { u: "x", v: "y", w: "z" };
@@ -2198,7 +2269,7 @@ function YA(g) {
2198
2269
  return { u: "y", v: "z", w: "x" };
2199
2270
  }
2200
2271
  }
2201
- function dA(g) {
2272
+ function YA(g) {
2202
2273
  const A = M(), I = M();
2203
2274
  A[W[g.u]] = 1, I[W[g.v]] = 1;
2204
2275
  const B = EI(M(), A, I), C = vC(
@@ -2211,8 +2282,8 @@ function dA(g) {
2211
2282
  B[0],
2212
2283
  B[1],
2213
2284
  B[2]
2214
- ), Q = rg(hI(), C);
2215
- return dI(Q, Q);
2285
+ ), Q = Fg(tI(), C);
2286
+ return YI(Q, Q);
2216
2287
  }
2217
2288
  const oB = [
2218
2289
  Int8Array,
@@ -2223,7 +2294,7 @@ const oB = [
2223
2294
  Uint32Array,
2224
2295
  Float32Array
2225
2296
  ];
2226
- function KQ(g) {
2297
+ function HQ(g) {
2227
2298
  if (oB.some((I) => g instanceof I))
2228
2299
  return !0;
2229
2300
  const A = oB.map((I) => I.name);
@@ -2232,7 +2303,7 @@ function KQ(g) {
2232
2303
  `Unsupported chunk data type: ${g}. Supported data types: ${A}`
2233
2304
  ), !1;
2234
2305
  }
2235
- function HQ(g, A) {
2306
+ function qQ(g, A) {
2236
2307
  return Math.round((A - g.translation) / g.scale);
2237
2308
  }
2238
2309
  function EC(g, A) {
@@ -2244,11 +2315,11 @@ function EC(g, A) {
2244
2315
  const C = gC(_(), I);
2245
2316
  return XC(C, C, B);
2246
2317
  }
2247
- function hA(g, A, I) {
2318
+ function tA(g, A, I) {
2248
2319
  return Math.max(A, Math.min(I, g));
2249
2320
  }
2250
2321
  const MI = Symbol("INTERNAL_POLICY_KEY"), iC = 1e-6;
2251
- class qQ {
2322
+ class lQ {
2252
2323
  store_;
2253
2324
  policy_;
2254
2325
  policyChanged_ = !1;
@@ -2338,24 +2409,24 @@ class qQ {
2338
2409
  }
2339
2410
  const D = QC();
2340
2411
  GQ(D, B.min, B.max, 0.5);
2341
- const h = this.makeViewBounds3D(B, o);
2412
+ const t = this.makeViewBounds3D(B, o);
2342
2413
  this.chunkViewStates_.forEach(TA);
2343
- const t = this.channelsOfInterest(A.c), e = this.lodRange().max, n = this.getPaddedBounds(h), F = new aB(
2414
+ const h = this.channelsOfInterest(A.c), e = this.lodRange().max, n = this.getPaddedBounds(t), r = new aB(
2344
2415
  this.axes_,
2345
2416
  A[this.axes_.w],
2346
2417
  B,
2347
2418
  this.store_.dimensions[this.axes_.w]
2348
2419
  ), G = this.currentLOD, L = G === e ? [G] : [G, e];
2349
2420
  for (const N of L) {
2350
- const S = N === G, r = N === e;
2421
+ const S = N === G, F = N === e;
2351
2422
  this.iterateChunksInBox(
2352
2423
  s,
2353
2424
  N,
2354
- t,
2425
+ h,
2355
2426
  n,
2356
2427
  (U) => {
2357
- const l = F.contains(U), Z = S && !l, O = this.computePriority(
2358
- r,
2428
+ const l = r.contains(U), Z = S && !l, O = this.computePriority(
2429
+ F,
2359
2430
  S,
2360
2431
  l,
2361
2432
  Z,
@@ -2373,7 +2444,7 @@ class qQ {
2373
2444
  this.markTimeChunksForPrefetchImage(
2374
2445
  s,
2375
2446
  A,
2376
- h,
2447
+ t,
2377
2448
  D
2378
2449
  ), this.policyChanged_ = !1, this.mode_ = "image", this.lastViewBounds2D_ = B.clone(), this.lastSliceCoordW_ = A[this.axes_.w], this.lastTCoord_ = A.t, this.lastCCoords_ = A.c ? [...A.c] : void 0;
2379
2450
  }
@@ -2389,17 +2460,17 @@ class qQ {
2389
2460
  }
2390
2461
  this.targetLOD_ = this.policy_.lod.min, this.chunkViewStates_.forEach(TA);
2391
2462
  const Q = this.channelsOfInterest(A.c), E = this.lodRange().max, i = this.currentLOD, o = (a) => {
2392
- const s = a.lod === E, D = a.lod === i, h = this.computePriority(
2463
+ const s = a.lod === E, D = a.lod === i, t = this.computePriority(
2393
2464
  s,
2394
2465
  D,
2395
2466
  !0,
2396
2467
  !1,
2397
2468
  !0
2398
2469
  );
2399
- h !== null && this.chunkViewStates_.set(a, {
2470
+ t !== null && this.chunkViewStates_.set(a, {
2400
2471
  visible: !0,
2401
2472
  prefetch: !1,
2402
- priority: h,
2473
+ priority: t,
2403
2474
  orderKey: 0
2404
2475
  });
2405
2476
  };
@@ -2427,7 +2498,7 @@ class qQ {
2427
2498
  }
2428
2499
  get currentLOD() {
2429
2500
  const { min: A, max: I } = this.lodRange();
2430
- return hA(Math.round(this.targetLOD_), A, I);
2501
+ return tA(Math.round(this.targetLOD_), A, I);
2431
2502
  }
2432
2503
  maybeForgetChunk(A) {
2433
2504
  const I = this.chunkViewStates_.get(A);
@@ -2459,14 +2530,14 @@ class qQ {
2459
2530
  o,
2460
2531
  B,
2461
2532
  (D) => {
2462
- const h = this.squareDistance2D(
2533
+ const t = this.squareDistance2D(
2463
2534
  D,
2464
2535
  C
2465
- ), t = hA(
2466
- h / this.sourceMaxSquareDistance2D_,
2536
+ ), h = tA(
2537
+ t / this.sourceMaxSquareDistance2D_,
2467
2538
  0,
2468
2539
  1 - Number.EPSILON
2469
- ), e = a + t;
2540
+ ), e = a + h;
2470
2541
  this.chunkViewStates_.set(D, {
2471
2542
  visible: !1,
2472
2543
  prefetch: !0,
@@ -2503,8 +2574,8 @@ class qQ {
2503
2574
  // Half-open chunk-index range [min, max) at a given LOD that covers `bounds`.
2504
2575
  // Returns null if the bounds don't overlap the data grid.
2505
2576
  chunkIndexRange(A, I) {
2506
- 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, h = E ? E.chunkSize * E.scale : 1, t = C.translation, e = Q.translation, n = E?.translation ?? 0, F = Math.max(0, TI((A.min[0] - t) / s)), G = Math.min(i, xI((A.max[0] - t) / 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) / h)) : 0, r = E ? Math.min(a, xI((A.max[2] - n) / h)) : 1;
2507
- return F >= G || L >= N || S >= r ? null : { xMin: F, xMax: G, yMin: L, yMax: N, zMin: S, zMax: r };
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;
2578
+ return r >= G || L >= N || S >= F ? null : { xMin: r, xMax: G, yMin: L, yMax: N, zMin: S, zMax: F };
2508
2579
  }
2509
2580
  iterateChunksInBox(A, I, B, C, Q) {
2510
2581
  const E = this.chunkIndexRange(C, I);
@@ -2515,9 +2586,9 @@ class qQ {
2515
2586
  for (let a = E.zMin; a < E.zMax; ++a) {
2516
2587
  const s = o[a];
2517
2588
  for (let D = E.yMin; D < E.yMax; ++D) {
2518
- const h = s[D];
2519
- for (let t = E.xMin; t < E.xMax; ++t) {
2520
- const e = h[t];
2589
+ const t = s[D];
2590
+ for (let h = E.xMin; h < E.xMax; ++h) {
2591
+ const e = t[h];
2521
2592
  Q(e);
2522
2593
  }
2523
2594
  }
@@ -2540,7 +2611,7 @@ class qQ {
2540
2611
  }
2541
2612
  timeIndex(A) {
2542
2613
  const I = this.store_.dimensions.t;
2543
- return A === void 0 || I === void 0 ? 0 : HQ(I.lods[0], A);
2614
+ return A === void 0 || I === void 0 ? 0 : qQ(I.lods[0], A);
2544
2615
  }
2545
2616
  getSliceAxisBounds(A) {
2546
2617
  const I = this.store_.dimensions[this.axes_.w];
@@ -2595,7 +2666,7 @@ class aB {
2595
2666
  sliceCoordByLod_;
2596
2667
  constructor(A, I, B, C) {
2597
2668
  this.axes_ = A, this.viewRect_ = B, I !== void 0 && C !== void 0 && (this.sliceCoordByLod_ = C.lods.map(
2598
- (Q) => hA(
2669
+ (Q) => tA(
2599
2670
  I,
2600
2671
  Q.translation,
2601
2672
  Q.translation + (Q.size - 1) * Q.scale
@@ -2619,7 +2690,7 @@ function WI(g, A) {
2619
2690
  function TA(g) {
2620
2691
  g.visible = !1, g.prefetch = !1, g.priority = null, g.orderKey = null;
2621
2692
  }
2622
- class lQ {
2693
+ class fQ {
2623
2694
  // Chunks indexed as chunks_[lod][t][c][z][y][x].
2624
2695
  chunks_;
2625
2696
  lowestResLOD_;
@@ -2632,21 +2703,21 @@ class lQ {
2632
2703
  const { size: I } = this.getAndValidateTimeDimension(), { size: B } = this.getAndValidateChannelDimension(), C = this.dimensions_.numLods;
2633
2704
  this.chunks_ = new Array(C);
2634
2705
  for (let Q = 0; Q < C; ++Q) {
2635
- 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, h = Math.ceil(E.size / a), t = 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), e = o ? Math.ceil(o.size / D) : 1, n = new Array(I);
2636
2707
  this.chunks_[Q] = n;
2637
- for (let F = 0; F < I; ++F) {
2708
+ for (let r = 0; r < I; ++r) {
2638
2709
  const G = new Array(B);
2639
- n[F] = G;
2710
+ n[r] = G;
2640
2711
  for (let L = 0; L < B; ++L) {
2641
2712
  const N = new Array(e);
2642
2713
  G[L] = N;
2643
2714
  for (let S = 0; S < e; ++S) {
2644
- const r = o !== void 0 ? o.translation + S * D * o.scale : 0, U = new Array(t);
2715
+ const F = o !== void 0 ? o.translation + S * D * o.scale : 0, U = new Array(h);
2645
2716
  N[S] = U;
2646
- for (let l = 0; l < t; ++l) {
2647
- const Z = i.translation + l * s * i.scale, O = new Array(h);
2717
+ for (let l = 0; l < h; ++l) {
2718
+ const Z = i.translation + l * s * i.scale, O = new Array(t);
2648
2719
  U[l] = O;
2649
- for (let b = 0; b < h; ++b) {
2720
+ for (let b = 0; b < t; ++b) {
2650
2721
  const z = E.translation + b * a * E.scale;
2651
2722
  O[b] = {
2652
2723
  state: "unloaded",
@@ -2662,7 +2733,7 @@ class lQ {
2662
2733
  c: 1
2663
2734
  },
2664
2735
  rowAlignmentBytes: 1,
2665
- chunkIndex: { x: b, y: l, z: S, c: L, t: F },
2736
+ chunkIndex: { x: b, y: l, z: S, c: L, t: r },
2666
2737
  scale: {
2667
2738
  x: E.scale,
2668
2739
  y: i.scale,
@@ -2671,7 +2742,7 @@ class lQ {
2671
2742
  offset: {
2672
2743
  x: z,
2673
2744
  y: Z,
2674
- z: r
2745
+ z: F
2675
2746
  }
2676
2747
  };
2677
2748
  }
@@ -2700,7 +2771,7 @@ class lQ {
2700
2771
  return this.lowestResLOD_;
2701
2772
  }
2702
2773
  addView(A, I) {
2703
- const B = new qQ(this, A, I);
2774
+ const B = new lQ(this, A, I);
2704
2775
  return this.views_.push(B), this.hasHadViews_ = !0, B;
2705
2776
  }
2706
2777
  get views() {
@@ -2790,7 +2861,7 @@ class lQ {
2790
2861
  };
2791
2862
  }
2792
2863
  }
2793
- function fQ(g, A) {
2864
+ function pQ(g, A) {
2794
2865
  const I = A.dimensions.t?.lods[0].size ?? 1, B = {
2795
2866
  requested: new Uint32Array(I),
2796
2867
  resident: new Uint32Array(I)
@@ -2799,20 +2870,20 @@ function fQ(g, A) {
2799
2870
  const E = A.views;
2800
2871
  for (let i = 0; i < E.length; i++)
2801
2872
  for (const [o, a] of E[i].chunkViewStates) {
2802
- if (a.priority === null || pQ(o, E, i)) continue;
2873
+ if (a.priority === null || uQ(o, E, i)) continue;
2803
2874
  const s = o.chunkIndex.t;
2804
2875
  C += 1, B.requested[s] += 1, o.texture !== void 0 && (Q += 1, B.resident[s] += 1);
2805
2876
  }
2806
2877
  return { source: g, requested: C, resident: Q, timepoints: B };
2807
2878
  }
2808
- function pQ(g, A, I) {
2879
+ function uQ(g, A, I) {
2809
2880
  for (let B = 0; B < I; B++) {
2810
2881
  const C = A[B].chunkViewStates.get(g);
2811
2882
  if (C !== void 0 && C.priority !== null) return !0;
2812
2883
  }
2813
2884
  return !1;
2814
2885
  }
2815
- function uQ(g, A) {
2886
+ function mQ(g, A) {
2816
2887
  let I = 0, B = 0;
2817
2888
  const C = { requested: 0, resident: 0 };
2818
2889
  for (const Q of A) {
@@ -2859,8 +2930,8 @@ class cg extends Rg {
2859
2930
  return B.unpackAlignment = A.rowAlignmentBytes, B;
2860
2931
  }
2861
2932
  }
2862
- const mQ = 8, TQ = 4;
2863
- class xQ {
2933
+ const TQ = 8, xQ = 4;
2934
+ class WQ {
2864
2935
  stores_ = [];
2865
2936
  queue_;
2866
2937
  uploadTexture_;
@@ -2868,7 +2939,7 @@ class xQ {
2868
2939
  getGpuResidentBytes_;
2869
2940
  memoryLimitBytes_;
2870
2941
  maxGpuUploadsPerUpdate_;
2871
- constructor(A, I, B = () => 0, C = 1 / 0, Q = mQ, E = TQ) {
2942
+ constructor(A, I, B = () => 0, C = 1 / 0, Q = TQ, E = xQ) {
2872
2943
  this.uploadTexture_ = A, this.disposeTexture_ = I, this.getGpuResidentBytes_ = B, this.memoryLimitBytes_ = C, this.maxGpuUploadsPerUpdate_ = Math.max(1, E), this.queue_ = new YQ(Q);
2873
2944
  }
2874
2945
  get memoryLimitBytes() {
@@ -2884,16 +2955,16 @@ class xQ {
2884
2955
  };
2885
2956
  }
2886
2957
  get memoryStats() {
2887
- return MQ();
2958
+ return KQ();
2888
2959
  }
2889
2960
  get sourceChunkStats() {
2890
2961
  return this.stores_.map(
2891
- ({ source: A, store: I }) => fQ(A, I)
2962
+ ({ source: A, store: I }) => pQ(A, I)
2892
2963
  );
2893
2964
  }
2894
2965
  addView(A, I, B) {
2895
2966
  let C = this.stores_.find((Q) => Q.source === A)?.store;
2896
- return C || (C = new lQ(A.loader.getSourceDimensionMap()), this.stores_.push({ source: A, store: C })), C.addView(I, B);
2967
+ return C || (C = new fQ(A.loader.getSourceDimensionMap()), this.stores_.push({ source: A, store: C })), C.addView(I, B);
2897
2968
  }
2898
2969
  update() {
2899
2970
  const A = [];
@@ -3003,7 +3074,7 @@ class KI {
3003
3074
  blendMode: I = "none",
3004
3075
  occludes: B
3005
3076
  } = {}) {
3006
- this.opacity_ = hA(A, 0, 1), this.blendMode_ = I, this.occludes_ = B ?? I === "none";
3077
+ this.opacity_ = tA(A, 0, 1), this.blendMode_ = I, this.occludes_ = B ?? I === "none";
3007
3078
  }
3008
3079
  /**
3009
3080
  * Whether the layer's shaders read scene depth. When `true` the renderer
@@ -3048,7 +3119,7 @@ class KI {
3048
3119
  "Layer",
3049
3120
  `Opacity out of bounds: ${A} — clamping to [0.0, 1.0]`
3050
3121
  );
3051
- const I = hA(A, 0, 1);
3122
+ const I = tA(A, 0, 1);
3052
3123
  I !== this.opacity_ && (this.opacity_ = I, this.invalidate());
3053
3124
  }
3054
3125
  /**
@@ -3190,7 +3261,7 @@ function Ng(g = {}) {
3190
3261
  ]
3191
3262
  }, g));
3192
3263
  }
3193
- function Uo(g = {}) {
3264
+ function ko(g = {}) {
3194
3265
  return Ug(kg({
3195
3266
  profile: "playback",
3196
3267
  prefetch: { x: 0, y: 0, z: 0, t: 20 },
@@ -3203,7 +3274,7 @@ function Uo(g = {}) {
3203
3274
  ]
3204
3275
  }, g));
3205
3276
  }
3206
- function ko(g = {}) {
3277
+ function Lo(g = {}) {
3207
3278
  return Ug(kg({
3208
3279
  profile: "no-prefetch",
3209
3280
  prefetch: { x: 0, y: 0, z: 0, t: 0 },
@@ -3217,7 +3288,7 @@ function ko(g = {}) {
3217
3288
  }, g));
3218
3289
  }
3219
3290
  function Ug(g) {
3220
- WQ(g);
3291
+ bQ(g);
3221
3292
  const A = {
3222
3293
  x: g.prefetch.x,
3223
3294
  y: g.prefetch.y,
@@ -3244,7 +3315,7 @@ function Ug(g) {
3244
3315
  };
3245
3316
  return Object.freeze(C);
3246
3317
  }
3247
- function WQ(g) {
3318
+ function bQ(g) {
3248
3319
  for (const [B, C] of Object.entries(g.prefetch))
3249
3320
  if (C !== void 0 && C < 0)
3250
3321
  throw new Error(`prefetch.${B} must be a non-negative number`);
@@ -3368,7 +3439,7 @@ class T {
3368
3439
  }
3369
3440
  const sB = 32;
3370
3441
  function vA(g, { visible: A, color: I, contrastLimits: B, opacity: C }) {
3371
- return A ??= !0, I = I === void 0 ? T.WHITE : T.from(I), C = C === void 0 ? 1 : hA(C, 0, 1), g !== null ? B = bQ(B, g) : B === void 0 && (k.debug(
3442
+ return A ??= !0, I = I === void 0 ? T.WHITE : T.from(I), C = C === void 0 ? 1 : tA(C, 0, 1), g !== null ? B = ZQ(B, g) : B === void 0 && (k.debug(
3372
3443
  "Channel",
3373
3444
  "No texture provided, defaulting channel contrast limits to [0, 1]."
3374
3445
  ), B = [0, 1]), {
@@ -3389,7 +3460,7 @@ function aC(g, A) {
3389
3460
  `channelProps length (${g.length}) must match source channel count (${A}).`
3390
3461
  );
3391
3462
  }
3392
- function bQ(g, A) {
3463
+ function ZQ(g, A) {
3393
3464
  if (g === void 0)
3394
3465
  return cQ(A);
3395
3466
  if (g[1] <= g[0])
@@ -3398,7 +3469,7 @@ function bQ(g, A) {
3398
3469
  );
3399
3470
  return g;
3400
3471
  }
3401
- class ZQ extends pA {
3472
+ class PQ extends pA {
3402
3473
  constructor(A) {
3403
3474
  if (super(), A.primitive != "triangles") {
3404
3475
  k.warn("WireframeGeometry", "Only indexed geometries are supported");
@@ -3423,11 +3494,11 @@ class ZQ extends pA {
3423
3494
  this.indexData_ = new Uint32Array(B);
3424
3495
  }
3425
3496
  }
3426
- const PQ = x(0, 1, 0);
3497
+ const OQ = x(0, 1, 0);
3427
3498
  class sC {
3428
3499
  dirty_ = !0;
3429
3500
  matrix_ = _();
3430
- rotation_ = hI();
3501
+ rotation_ = tI();
3431
3502
  translation_ = M();
3432
3503
  scale_ = x(1, 1, 1);
3433
3504
  /**
@@ -3436,7 +3507,7 @@ class sC {
3436
3507
  * @param q - The rotation to apply.
3437
3508
  */
3438
3509
  addRotation(A) {
3439
- hQ(this.rotation_, this.rotation_, A), this.dirty_ = !0;
3510
+ tQ(this.rotation_, this.rotation_, A), this.dirty_ = !0;
3440
3511
  }
3441
3512
  /**
3442
3513
  * Replaces the rotation with the given quaternion.
@@ -3448,7 +3519,7 @@ class sC {
3448
3519
  }
3449
3520
  /** A copy of the rotation quaternion. */
3450
3521
  get rotation() {
3451
- return tQ(this.rotation_);
3522
+ return hQ(this.rotation_);
3452
3523
  }
3453
3524
  /**
3454
3525
  * Adds the given offset to the translation.
@@ -3493,9 +3564,9 @@ class sC {
3493
3564
  * @param target - The world-space point to face.
3494
3565
  */
3495
3566
  targetTo(A) {
3496
- Fg(this.translation_, A) && (A = EA(A), A[2] += m);
3497
- const I = IQ(_(), this.translation_, A, PQ), B = VC(IC(), I);
3498
- rg(this.rotation_, B), dI(this.rotation_, this.rotation_), this.dirty_ = !0;
3567
+ rg(this.translation_, A) && (A = EA(A), A[2] += m);
3568
+ const I = IQ(_(), this.translation_, A, OQ), B = VC(IC(), I);
3569
+ Fg(this.rotation_, B), YI(this.rotation_, this.rotation_), this.dirty_ = !0;
3499
3570
  }
3500
3571
  /** A copy of the scale vector. */
3501
3572
  get scale() {
@@ -3518,7 +3589,7 @@ class sC {
3518
3589
  );
3519
3590
  }
3520
3591
  }
3521
- class zA extends YI {
3592
+ class zA extends dI {
3522
3593
  /**
3523
3594
  * Draws the geometry's wireframe on top of the normal pass. Layers use
3524
3595
  * this as a chunk debugging aid. Defaults to `false`.
@@ -3589,7 +3660,7 @@ class zA extends YI {
3589
3660
  * changes.
3590
3661
  */
3591
3662
  get wireframeGeometry() {
3592
- return this.wireframeGeometry_ ??= new ZQ(this.geometry), this.wireframeGeometry_;
3663
+ return this.wireframeGeometry_ ??= new PQ(this.geometry), this.wireframeGeometry_;
3593
3664
  }
3594
3665
  /** The assigned textures indexed by texture unit. */
3595
3666
  get textures() {
@@ -3665,18 +3736,18 @@ class zA extends YI {
3665
3736
  class DC extends pA {
3666
3737
  constructor(A, I, B, C) {
3667
3738
  super();
3668
- const Q = [], E = [], i = B, o = C, a = i + 1, s = o + 1, D = A / i, h = I / o;
3669
- for (let t = 0; t < s; ++t) {
3670
- const e = t * h;
3739
+ const Q = [], E = [], i = B, o = C, a = i + 1, s = o + 1, D = A / i, t = I / o;
3740
+ for (let h = 0; h < s; ++h) {
3741
+ const e = h * t;
3671
3742
  for (let n = 0; n < a; ++n) {
3672
- const F = n * D, G = n / i, L = t / o, N = [F, e, 0], S = [0, 0, 1], r = [G, L];
3673
- Q.push(...N, ...S, ...r);
3743
+ const r = n * D, G = n / i, L = h / o, N = [r, e, 0], S = [0, 0, 1], F = [G, L];
3744
+ Q.push(...N, ...S, ...F);
3674
3745
  }
3675
3746
  }
3676
- for (let t = 0; t < o; ++t)
3747
+ for (let h = 0; h < o; ++h)
3677
3748
  for (let e = 0; e < i; ++e) {
3678
- const n = e + a * t, F = e + a * (t + 1), G = e + 1 + a * (t + 1), L = e + 1 + a * t;
3679
- E.push(n, F, L), E.push(F, G, L);
3749
+ const n = e + a * h, r = e + a * (h + 1), G = e + 1 + a * (h + 1), L = e + 1 + a * h;
3750
+ E.push(n, r, L), E.push(r, G, L);
3680
3751
  }
3681
3752
  this.vertexData_ = new Float32Array(Q), this.indexData_ = new Uint32Array(E), this.addAttribute({
3682
3753
  type: "position",
@@ -3693,7 +3764,7 @@ class DC extends pA {
3693
3764
  });
3694
3765
  }
3695
3766
  }
3696
- class OQ extends zA {
3767
+ class VQ extends zA {
3697
3768
  /**
3698
3769
  * A matrix mapping world space to the texture's normalized coordinate
3699
3770
  * space. Layers derive it from the chunk's offset, scale, and shape.
@@ -3712,7 +3783,7 @@ class OQ extends zA {
3712
3783
  texture: B,
3713
3784
  channelProps: C = []
3714
3785
  }) {
3715
- super(), this.geometry = new DC(A, I, 1, 1), this.setTexture(0, B), this.channels_ = Bg(B, C), this.programName = VQ(B), this.depthProgramName = "meshDepth";
3786
+ super(), this.geometry = new DC(A, I, 1, 1), this.setTexture(0, B), this.channels_ = Bg(B, C), this.programName = vQ(B), this.depthProgramName = "meshDepth";
3716
3787
  }
3717
3788
  /** Identifies the renderable type as `ImageRenderable`. */
3718
3789
  get type() {
@@ -3761,7 +3832,7 @@ class OQ extends zA {
3761
3832
  };
3762
3833
  }
3763
3834
  }
3764
- function VQ(g) {
3835
+ function vQ(g) {
3765
3836
  switch (g.dataType) {
3766
3837
  case "byte":
3767
3838
  case "int":
@@ -3798,7 +3869,7 @@ class sA {
3798
3869
  }
3799
3870
  }
3800
3871
  }
3801
- function hC(g, A, I, B, C = 3) {
3872
+ function tC(g, A, I, B, C = 3) {
3802
3873
  switch (g.type) {
3803
3874
  case "pointerdown": {
3804
3875
  const Q = g.event;
@@ -3882,7 +3953,7 @@ class Jg extends KI {
3882
3953
  onPickValue: E,
3883
3954
  ...i
3884
3955
  }) {
3885
- super({ blendMode: "additive", occludes: !0, ...i }), this.setState("initialized"), this.source_ = A, this.policy_ = B ?? Ng(), this.sliceCoords_ = I, this.orientation_ = C ?? "XY", this.axes_ = YA(this.orientation_), this.planeRotation_ = dA(this.axes_), this.channelProps_ = Q, this.initialChannelProps_ = Q, this.onPickValue_ = E;
3956
+ super({ blendMode: "additive", occludes: !0, ...i }), this.setState("initialized"), this.source_ = A, this.policy_ = B ?? Ng(), this.sliceCoords_ = I, this.orientation_ = C ?? "XY", this.axes_ = dA(this.orientation_), this.planeRotation_ = YA(this.axes_), this.channelProps_ = Q, this.initialChannelProps_ = Q, this.onPickValue_ = E;
3886
3957
  }
3887
3958
  /** @hidden */
3888
3959
  attach(A) {
@@ -3927,7 +3998,7 @@ class Jg extends KI {
3927
3998
  * @param orientation - The new slice plane.
3928
3999
  */
3929
4000
  setOrientation(A) {
3930
- 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_ = YA(A), this.planeRotation_ = dA(this.axes_), this.context_ && (this.chunkStoreView_ = this.context_.chunkManager.addView(
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(
3931
4002
  this.source_,
3932
4003
  this.policy_,
3933
4004
  this.axes_
@@ -3974,7 +4045,7 @@ class Jg extends KI {
3974
4045
  * @param event - The event with clip and world coordinates attached.
3975
4046
  */
3976
4047
  onEvent(A) {
3977
- this.pointerDownPos_ = hC(
4048
+ this.pointerDownPos_ = tC(
3978
4049
  A,
3979
4050
  this.pointerDownPos_,
3980
4051
  (I) => this.pickAtRay(I),
@@ -4035,7 +4106,7 @@ class Jg extends KI {
4035
4106
  return this.channelProps_ ? [this.channelProps_[A.chunkIndex.c] ?? {}] : [{}];
4036
4107
  }
4037
4108
  createImage(A, I) {
4038
- const B = new OQ({
4109
+ const B = new VQ({
4039
4110
  width: A.shape[this.axes_.u],
4040
4111
  height: A.shape[this.axes_.v],
4041
4112
  texture: I,
@@ -4052,7 +4123,7 @@ class Jg extends KI {
4052
4123
  if (B === void 0)
4053
4124
  return 0;
4054
4125
  const C = (B - A.offset[I]) / A.scale[I];
4055
- return hA(Math.round(C), 0, A.shape[I] - 1);
4126
+ return tA(Math.round(C), 0, A.shape[I] - 1);
4056
4127
  }
4057
4128
  updateImageChunk(A, I) {
4058
4129
  this.debugMode_ ? (A.wireframeEnabled = !0, A.wireframeColor = this.wireframeColors_[I.lod % this.wireframeColors_.length]) : A.wireframeEnabled = !1;
@@ -4169,7 +4240,7 @@ class DB extends Rg {
4169
4240
  return this.height_;
4170
4241
  }
4171
4242
  }
4172
- const vQ = [
4243
+ const XQ = [
4173
4244
  [1, 0.5, 0.5],
4174
4245
  [0.5, 1, 0.5],
4175
4246
  [0.5, 0.5, 1],
@@ -4177,7 +4248,7 @@ const vQ = [
4177
4248
  [1, 0.5, 1],
4178
4249
  [1, 1, 0.5]
4179
4250
  ];
4180
- function XQ(g) {
4251
+ function jQ(g) {
4181
4252
  return g = g ?? /* @__PURE__ */ new Map(), new Map(
4182
4253
  Array.from(g.entries()).map(([A, I]) => [
4183
4254
  A,
@@ -4185,35 +4256,35 @@ function XQ(g) {
4185
4256
  ])
4186
4257
  );
4187
4258
  }
4188
- function jQ(g) {
4189
- return g = g ?? vQ, g.map(T.from);
4259
+ function zQ(g) {
4260
+ return g = g ?? XQ, g.map(T.from);
4190
4261
  }
4191
4262
  function nI(g = {}) {
4192
4263
  return {
4193
- lookupTable: XQ(g.lookupTable),
4194
- cycle: jQ(g.cycle)
4264
+ lookupTable: jQ(g.lookupTable),
4265
+ cycle: zQ(g.cycle)
4195
4266
  };
4196
4267
  }
4197
- const tC = /* @__PURE__ */ new Set(["byte", "short", "int"]), zQ = /* @__PURE__ */ new Set([
4268
+ const hC = /* @__PURE__ */ new Set(["byte", "short", "int"]), _Q = /* @__PURE__ */ new Set([
4198
4269
  "unsigned_byte",
4199
4270
  "unsigned_short",
4200
4271
  "unsigned_int"
4201
4272
  ]);
4202
- function _Q(g) {
4273
+ function $Q(g) {
4203
4274
  if (g.dataFormat !== "scalar")
4204
4275
  throw new Error(
4205
4276
  `Image data format must be scalar, instead found: ${g.dataFormat}`
4206
4277
  );
4207
- if (!tC.has(g.dataType) && !zQ.has(g.dataType))
4278
+ if (!hC.has(g.dataType) && !_Q.has(g.dataType))
4208
4279
  throw new Error(
4209
4280
  `Image data type must be an integer, instead found: ${g.dataType}`
4210
4281
  );
4211
4282
  return g;
4212
4283
  }
4213
- function $Q(g) {
4214
- return tC.has(g.dataType) ? "intLabelImage" : "labelImage";
4284
+ function AE(g) {
4285
+ return hC.has(g.dataType) ? "intLabelImage" : "labelImage";
4215
4286
  }
4216
- class AE extends zA {
4287
+ class IE extends zA {
4217
4288
  /**
4218
4289
  * A matrix mapping world space to the texture's normalized coordinate
4219
4290
  * space. Layers derive it from the chunk's offset, scale, and shape.
@@ -4228,9 +4299,9 @@ class AE extends zA {
4228
4299
  * @param props - Initialization properties.
4229
4300
  */
4230
4301
  constructor(A) {
4231
- super(), this.geometry = new DC(A.width, A.height, 1, 1), this.setTexture(0, _Q(A.imageData));
4302
+ super(), this.geometry = new DC(A.width, A.height, 1, 1), this.setTexture(0, $Q(A.imageData));
4232
4303
  const I = nI(A.colorMap);
4233
- this.setTexture(1, this.makeColorCycleTexture(I.cycle)), this.setTexture(2, this.makeColorLookupTableTexture(I.lookupTable)), this.outlineSelected_ = A.outlineSelected ?? !1, this.selectedValue_ = A.selectedValue ?? null, this.programName = $Q(A.imageData), this.depthProgramName = "meshDepth";
4304
+ this.setTexture(1, this.makeColorCycleTexture(I.cycle)), this.setTexture(2, this.makeColorLookupTableTexture(I.lookupTable)), this.outlineSelected_ = A.outlineSelected ?? !1, this.selectedValue_ = A.selectedValue ?? null, this.programName = AE(A.imageData), this.depthProgramName = "meshDepth";
4234
4305
  }
4235
4306
  /** Identifies the renderable type as `LabelImageRenderable`. */
4236
4307
  get type() {
@@ -4282,7 +4353,7 @@ class AE extends zA {
4282
4353
  return Q.set(I, 0), Q.set(B, C), new DB(Q, C, 2);
4283
4354
  }
4284
4355
  }
4285
- class Yg extends KI {
4356
+ class dg extends KI {
4286
4357
  /** Identifies the layer type as `LabelLayer`. */
4287
4358
  type = "LabelLayer";
4288
4359
  source_;
@@ -4318,7 +4389,7 @@ class Yg extends KI {
4318
4389
  outlineSelected: i = !1,
4319
4390
  ...o
4320
4391
  }) {
4321
- super(o), this.setState("initialized"), this.source_ = A, this.policy_ = B ?? Ng(), this.sliceCoords_ = I, this.orientation_ = C ?? "XY", this.axes_ = YA(this.orientation_), this.planeRotation_ = dA(this.axes_), this.colorMap_ = nI(Q), this.onPickValue_ = E, this.outlineSelected_ = i;
4392
+ super(o), this.setState("initialized"), this.source_ = A, this.policy_ = B ?? Ng(), this.sliceCoords_ = I, this.orientation_ = C ?? "XY", this.axes_ = dA(this.orientation_), this.planeRotation_ = YA(this.axes_), this.colorMap_ = nI(Q), this.onPickValue_ = E, this.outlineSelected_ = i;
4322
4393
  }
4323
4394
  /** @hidden */
4324
4395
  attach(A) {
@@ -4364,7 +4435,7 @@ class Yg extends KI {
4364
4435
  * @param orientation - The new slice plane.
4365
4436
  */
4366
4437
  setOrientation(A) {
4367
- 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_ = YA(A), this.planeRotation_ = dA(this.axes_), this.context_ && (this.chunkStoreView_ = this.context_.chunkManager.addView(
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(
4368
4439
  this.source_,
4369
4440
  this.policy_,
4370
4441
  this.axes_
@@ -4389,7 +4460,7 @@ class Yg extends KI {
4389
4460
  }
4390
4461
  }
4391
4462
  isPresentationStale() {
4392
- return this.lastPresentationTimeStamp_ === void 0 ? !1 : performance.now() - this.lastPresentationTimeStamp_ > Yg.STALE_PRESENTATION_MS_;
4463
+ return this.lastPresentationTimeStamp_ === void 0 ? !1 : performance.now() - this.lastPresentationTimeStamp_ > dg.STALE_PRESENTATION_MS_;
4393
4464
  }
4394
4465
  /**
4395
4466
  * Handles click picking and selection outlining. Called automatically
@@ -4398,7 +4469,7 @@ class Yg extends KI {
4398
4469
  * @param event - The event with clip and world coordinates attached.
4399
4470
  */
4400
4471
  onEvent(A) {
4401
- this.pointerDownPos_ = hC(
4472
+ this.pointerDownPos_ = tC(
4402
4473
  A,
4403
4474
  this.pointerDownPos_,
4404
4475
  (I) => this.pickAtRay(I),
@@ -4517,7 +4588,7 @@ class Yg extends KI {
4517
4588
  return C ? (C.setTexture(0, I), C.setColorMap(this.colorMap_), C.setSelectedValue(this.selectedValue_), this.updateLabelChunk(C, A), C) : this.createLabel(A, I);
4518
4589
  }
4519
4590
  createLabel(A, I) {
4520
- const B = new AE({
4591
+ const B = new IE({
4521
4592
  width: A.shape[this.axes_.u],
4522
4593
  height: A.shape[this.axes_.v],
4523
4594
  imageData: I,
@@ -4536,7 +4607,7 @@ class Yg extends KI {
4536
4607
  if (B === void 0)
4537
4608
  return 0;
4538
4609
  const C = (B - A.offset[I]) / A.scale[I];
4539
- return hA(Math.round(C), 0, A.shape[I] - 1);
4610
+ return tA(Math.round(C), 0, A.shape[I] - 1);
4540
4611
  }
4541
4612
  updateLabelChunk(A, I) {
4542
4613
  const { u: B, v: C } = this.axes_;
@@ -4549,7 +4620,7 @@ class Yg extends KI {
4549
4620
  }
4550
4621
  }
4551
4622
  }
4552
- class IE extends pA {
4623
+ class gE extends pA {
4553
4624
  constructor(A, I, B, C, Q, E) {
4554
4625
  super();
4555
4626
  const i = [], o = [], a = Math.floor(C), s = Math.floor(Q), D = Math.floor(E);
@@ -4567,17 +4638,17 @@ class IE extends pA {
4567
4638
  offset: 6 * Float32Array.BYTES_PER_ELEMENT
4568
4639
  });
4569
4640
  }
4570
- buildFace(A, I, B, C, Q, E, i, o, a, s, D, h, t) {
4571
- const e = E / a, n = i / s, F = E / 2, G = i / 2, L = o / 2 * D, N = a + 1, S = s + 1, r = h.length / 8;
4641
+ 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;
4572
4643
  for (let U = 0; U < S; U++) {
4573
4644
  const l = -G + U * n;
4574
4645
  for (let Z = 0; Z < N; Z++) {
4575
- const O = -F + Z * e, b = { x: 0, y: 0, z: 0 };
4646
+ const O = -r + Z * e, b = { x: 0, y: 0, z: 0 };
4576
4647
  b[A] = O * C, b[I] = l * Q, b[B] = L;
4577
4648
  const z = { x: 0, y: 0, z: 0 };
4578
4649
  z[B] = D;
4579
4650
  const oA = Z / a, aA = 1 - U / s;
4580
- h.push(
4651
+ t.push(
4581
4652
  b.x,
4582
4653
  b.y,
4583
4654
  b.z,
@@ -4591,12 +4662,12 @@ class IE extends pA {
4591
4662
  }
4592
4663
  for (let U = 0; U < s; U++)
4593
4664
  for (let l = 0; l < a; l++) {
4594
- const Z = r + l + N * U, O = r + l + N * (U + 1), b = r + (l + 1) + N * (U + 1), z = r + (l + 1) + N * U;
4595
- t.push(Z, O, z, O, b, z);
4665
+ const Z = F + l + N * U, O = F + l + N * (U + 1), b = F + (l + 1) + N * (U + 1), z = F + (l + 1) + N * U;
4666
+ h.push(Z, O, z, O, b, z);
4596
4667
  }
4597
4668
  }
4598
4669
  }
4599
- class gE extends zA {
4670
+ class BE extends zA {
4600
4671
  /**
4601
4672
  * World size of a voxel along each axis. Layers set it from the chunk
4602
4673
  * scale so ray march steps account for anisotropic voxels. Defaults to
@@ -4612,7 +4683,7 @@ class gE extends zA {
4612
4683
  * @param props - Initialization properties.
4613
4684
  */
4614
4685
  constructor({ channelProps: A = [] } = {}) {
4615
- super(), this.geometry = new IE(1, 1, 1, 1, 1, 1), this.cullFaceMode = "front", this.depthTest = !1, this.channels_ = [], this.setChannelProps(A);
4686
+ super(), this.geometry = new gE(1, 1, 1, 1, 1, 1), this.cullFaceMode = "front", this.depthTest = !1, this.channels_ = [], this.setChannelProps(A);
4616
4687
  }
4617
4688
  /** Identifies the renderable type as `VolumeRenderable`. */
4618
4689
  get type() {
@@ -4634,7 +4705,7 @@ class gE extends zA {
4634
4705
  addChannelTexture(A, I) {
4635
4706
  const B = this.textures.length;
4636
4707
  this.setTexture(B, I), this.channelToTextureIndex_.set(A, B);
4637
- const C = BE(I.dataType);
4708
+ const C = CE(I.dataType);
4638
4709
  if (this.programName && this.programName !== C)
4639
4710
  throw new Error(
4640
4711
  `Volume renderable does not support multiple channels with different data types. Existing program: ${this.programName}, new channel data type: ${I.dataType} and program: ${C}`
@@ -4686,8 +4757,8 @@ class gE extends zA {
4686
4757
  if (a === void 0 || !this.loadedChannels_.has(o)) continue;
4687
4758
  const s = this.textures[a], D = vA(s, this.channels_[o] || {});
4688
4759
  if (!D.visible) continue;
4689
- const h = E.length;
4690
- I[h * 3] = D.color.rgb[0], I[h * 3 + 1] = D.color.rgb[1], I[h * 3 + 2] = D.color.rgb[2], E.push(a), B[h] = -D.contrastLimits[0], C[h] = 1 / (D.contrastLimits[1] - D.contrastLimits[0]), A[h] = 1, Q[h] = D.opacity;
4760
+ const t = E.length;
4761
+ I[t * 3] = D.color.rgb[0], I[t * 3 + 1] = D.color.rgb[1], I[t * 3 + 2] = D.color.rgb[2], E.push(a), B[t] = -D.contrastLimits[0], C[t] = 1 / (D.contrastLimits[1] - D.contrastLimits[0]), A[t] = 1, Q[t] = D.opacity;
4691
4762
  }
4692
4763
  return E.reduce(
4693
4764
  (o, a, s) => (o[`u_channel${s}Sampler`] = a, o),
@@ -4746,7 +4817,7 @@ class gE extends zA {
4746
4817
  this.channels_[A] = C;
4747
4818
  }
4748
4819
  }
4749
- function BE(g) {
4820
+ function CE(g) {
4750
4821
  switch (g) {
4751
4822
  case "byte":
4752
4823
  case "int":
@@ -4760,8 +4831,8 @@ function BE(g) {
4760
4831
  return "floatVolume";
4761
4832
  }
4762
4833
  }
4763
- const CE = 2;
4764
- class QE extends KI {
4834
+ const QE = 2;
4835
+ class EE extends KI {
4765
4836
  /** Identifies the layer type as `VolumeLayer`. */
4766
4837
  type = "VolumeLayer";
4767
4838
  /** Highlights rays of zero length for debugging. Defaults to `false`. */
@@ -4868,7 +4939,7 @@ class QE extends KI {
4868
4939
  for (const E of I) B.updateVolumeWithChunk(E);
4869
4940
  return B;
4870
4941
  }
4871
- const C = oE(I[0]), Q = this.pool_.acquire(C) ?? new gE();
4942
+ const C = aE(I[0]), Q = this.pool_.acquire(C) ?? new BE();
4872
4943
  Q.setChannelProps(this.channelProps_ ?? []), this.volumeToPoolKey_.set(Q, C);
4873
4944
  for (const E of I) Q.updateVolumeWithChunk(E);
4874
4945
  return this.updateVolumeTransform(Q, I[0]), Q;
@@ -4892,7 +4963,7 @@ class QE extends KI {
4892
4963
  updateChunks() {
4893
4964
  if (!this.chunkStoreView_) return;
4894
4965
  this.state !== "ready" && this.setState("ready");
4895
- const A = this.chunkStoreView_.getChunksToRender(), I = this.sliceCoords_.t ?? -1, B = iE(A);
4966
+ const A = this.chunkStoreView_.getChunksToRender(), I = this.sliceCoords_.t ?? -1, B = oE(A);
4896
4967
  if (this.lastLoadedTime_ !== I || B.size !== this.currentVolumes_.size || this.lastNumRenderedChannelChunks_ !== A.length) {
4897
4968
  for (const [Q, E] of this.currentVolumes_)
4898
4969
  B.has(Q) || (this.releaseAndRemoveVolume(E), this.currentVolumes_.delete(Q));
@@ -4909,7 +4980,7 @@ class QE extends KI {
4909
4980
  y: I.shape.y * I.scale.y,
4910
4981
  z: I.shape.z * I.scale.z
4911
4982
  };
4912
- A.transform.setScale([B.x, B.y, B.z]), rA(A.voxelScale, I.scale.x, I.scale.y, I.scale.z);
4983
+ A.transform.setScale([B.x, B.y, B.z]), FA(A.voxelScale, I.scale.x, I.scale.y, I.scale.z);
4913
4984
  const C = {
4914
4985
  x: I.shape.x * I.scale.x / 2,
4915
4986
  y: I.shape.y * I.scale.y / 2,
@@ -4937,11 +5008,11 @@ class QE extends KI {
4937
5008
  A.camera.getViewProjection()
4938
5009
  );
4939
5010
  const I = A.cameraControls?.isMoving ?? !1;
4940
- return this.interactiveStepSizeScale_ = I ? CE : 1, this.updateChunks(), this.rebuildObjects(A.camera), !0;
5011
+ return this.interactiveStepSizeScale_ = I ? QE : 1, this.updateChunks(), this.rebuildObjects(A.camera), !0;
4941
5012
  }
4942
5013
  rebuildObjects(A) {
4943
5014
  const I = Array.from(this.currentVolumes_.values());
4944
- aE(I, A), this.clearObjects();
5015
+ sE(I, A), this.clearObjects();
4945
5016
  for (const B of I)
4946
5017
  this.addObject(B);
4947
5018
  }
@@ -4959,27 +5030,27 @@ class QE extends KI {
4959
5030
  };
4960
5031
  }
4961
5032
  }
4962
- function EE(g) {
5033
+ function iE(g) {
4963
5034
  const { x: A, y: I, z: B, t: C } = g.chunkIndex;
4964
5035
  return `${A}:${I}:${B}:${C}`;
4965
5036
  }
4966
- function iE(g) {
5037
+ function oE(g) {
4967
5038
  const A = /* @__PURE__ */ new Map();
4968
5039
  for (const I of g) {
4969
- const B = EE(I);
5040
+ const B = iE(I);
4970
5041
  let C = A.get(B);
4971
5042
  C || (C = [], A.set(B, C)), C.push(I);
4972
5043
  }
4973
5044
  return A;
4974
5045
  }
4975
- function oE(g) {
5046
+ function aE(g) {
4976
5047
  return [
4977
5048
  `lod${g.lod}`,
4978
5049
  `shape${g.shape.x}x${g.shape.y}x${g.shape.z}`,
4979
5050
  `align${g.rowAlignmentBytes}`
4980
5051
  ].join(":");
4981
5052
  }
4982
- function aE(g, A) {
5053
+ function sE(g, A) {
4983
5054
  const I = A.position, B = /* @__PURE__ */ new Map();
4984
5055
  for (const C of g) {
4985
5056
  const Q = C.transform.translation;
@@ -4987,14 +5058,36 @@ function aE(g, A) {
4987
5058
  }
4988
5059
  g.sort((C, Q) => B.get(Q) - B.get(C));
4989
5060
  }
4990
- let sE = class {
5061
+ let DE = class {
4991
5062
  renderer_;
4992
5063
  chunkManager_;
4993
5064
  viewports_;
5065
+ runtime_ = {
5066
+ gpuTimingSupported: !1,
5067
+ renderedFramesPerSecond: 0
5068
+ };
5069
+ sampleStartedAt_ = performance.now();
5070
+ draws_ = 0;
5071
+ gpuSamples_ = 0;
5072
+ gpuMsAtWindowStart_ = 0;
4994
5073
  /** @hidden */
4995
5074
  constructor(A, I, B) {
4996
5075
  this.renderer_ = A, this.chunkManager_ = I, this.viewports_ = B;
4997
5076
  }
5077
+ /**
5078
+ * Drawing frequency and GPU cost, recalculated on read when at least one
5079
+ * second has passed since the last calculation or reset. Values cover that
5080
+ * entire interval, so less frequent reads produce longer-term averages.
5081
+ */
5082
+ get runtime() {
5083
+ this.sample();
5084
+ const A = this.renderer_.gpuTiming, I = A.supported && A.lastSampleAt !== void 0 && performance.now() - A.lastSampleAt < 3e3;
5085
+ return {
5086
+ ...this.runtime_,
5087
+ gpuTimingSupported: A.supported,
5088
+ gpuMsPerFrame: I ? this.runtime_.gpuMsPerFrame : void 0
5089
+ };
5090
+ }
4998
5091
  /**
4999
5092
  * CPU chunk memory shared across instances, this renderer's GPU texture
5000
5093
  * memory, and optional JS heap figures. Heap figures are not specific to
@@ -5024,8 +5117,8 @@ let sE = class {
5024
5117
  for (const I of this.viewports_) {
5025
5118
  const B = [];
5026
5119
  for (const C of I.layers)
5027
- !(C instanceof Jg) && !(C instanceof Yg) && !(C instanceof QE) || C.chunkStoreView && B.push(C.chunkStoreView);
5028
- B.length !== 0 && A.push(uQ(I.id, B));
5120
+ !(C instanceof Jg) && !(C instanceof dg) && !(C instanceof EE) || C.chunkStoreView && B.push(C.chunkStoreView);
5121
+ B.length !== 0 && A.push(mQ(I.id, B));
5029
5122
  }
5030
5123
  return { sources: this.chunkManager_.sourceChunkStats, viewports: A };
5031
5124
  }
@@ -5033,6 +5126,26 @@ let sE = class {
5033
5126
  get renderedObjects() {
5034
5127
  return this.renderer_.renderedObjects;
5035
5128
  }
5129
+ /** @hidden */
5130
+ recordDraw() {
5131
+ this.draws_ += 1;
5132
+ }
5133
+ /** @hidden */
5134
+ sample() {
5135
+ const A = performance.now(), I = (A - this.sampleStartedAt_) / 1e3;
5136
+ if (I < 1) return;
5137
+ this.runtime_.renderedFramesPerSecond = this.draws_ / I;
5138
+ const B = this.renderer_.gpuTiming, C = B.samples - this.gpuSamples_;
5139
+ B.supported && B.lastSampleAt !== void 0 && C > 0 ? this.runtime_.gpuMsPerFrame = (B.totalMs - this.gpuMsAtWindowStart_) / C : this.runtime_.gpuMsPerFrame = void 0, this.resetSample(A);
5140
+ }
5141
+ /** @hidden */
5142
+ resetRates() {
5143
+ this.renderer_.resetGpuTiming(), this.runtime_.renderedFramesPerSecond = 0, this.runtime_.gpuMsPerFrame = void 0, this.resetSample(performance.now());
5144
+ }
5145
+ resetSample(A) {
5146
+ const I = this.renderer_.gpuTiming;
5147
+ this.sampleStartedAt_ = A, this.draws_ = 0, this.gpuSamples_ = I.samples, this.gpuMsAtWindowStart_ = I.totalMs;
5148
+ }
5036
5149
  };
5037
5150
  var ZA = function(g = 1) {
5038
5151
  var A = 0, I = document.createElement("div");
@@ -5043,8 +5156,8 @@ var ZA = function(g = 1) {
5043
5156
  return I.appendChild(D.dom), D;
5044
5157
  }
5045
5158
  function C(D) {
5046
- for (var h = 0; h < I.children.length; h++)
5047
- I.children[h].style.display = h === D ? "block" : "none";
5159
+ for (var t = 0; t < I.children.length; t++)
5160
+ I.children[t].style.display = t === D ? "block" : "none";
5048
5161
  A = D;
5049
5162
  }
5050
5163
  var Q = (performance || Date).now(), E = Q, i = 0, o = B(new ZA.Panel("FPS", "#0ff", "#002", g)), a = B(new ZA.Panel("MS", "#0f0", "#020", g));
@@ -5062,8 +5175,8 @@ var ZA = function(g = 1) {
5062
5175
  i++;
5063
5176
  var D = (performance || Date).now();
5064
5177
  if (a.update(D - Q, 200), D >= E + 1e3 && (o.update(i * 1e3 / (D - E), 100), E = D, i = 0, s)) {
5065
- var h = performance.memory;
5066
- s.update(h.usedJSHeapSize / 1048576, h.jsHeapSizeLimit / 1048576);
5178
+ var t = performance.memory;
5179
+ s.update(t.usedJSHeapSize / 1048576, t.jsHeapSizeLimit / 1048576);
5067
5180
  }
5068
5181
  return D;
5069
5182
  },
@@ -5076,17 +5189,17 @@ var ZA = function(g = 1) {
5076
5189
  };
5077
5190
  };
5078
5191
  ZA.Panel = function(g, A, I, B) {
5079
- 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), h = E(3 * i * B), t = E(15 * i * B), e = E(74 * i * B), n = E(30 * i * B), F = document.createElement("canvas");
5080
- F.width = o, F.height = a, F.style.cssText = `width:${E(B * 80)}px;height:${E(B * 48)}px`;
5081
- var G = F.getContext("2d");
5082
- 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(h, t, e, n), G.fillStyle = I, G.globalAlpha = 0.9, G.fillRect(h, t, e, n), {
5083
- dom: F,
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");
5193
+ r.width = o, r.height = a, r.style.cssText = `width:${E(B * 80)}px;height:${E(B * 48)}px`;
5194
+ 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), {
5196
+ dom: r,
5084
5197
  update: function(L, N) {
5085
- C = Math.min(C, L), Q = Math.max(Q, L), G.fillStyle = I, G.globalAlpha = 1, G.fillRect(0, 0, o, t), G.fillStyle = A, G.fillText(E(L) + " " + g + " (" + E(C) + "-" + E(Q) + ")", s, D), G.drawImage(F, h + i, t, e - i, n, h, t, e - i, n), G.fillRect(h + e - i, t, i, n), G.fillStyle = I, G.globalAlpha = 0.9, G.fillRect(h + e - i, t, i, E((1 - L / N) * 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));
5086
5199
  }
5087
5200
  };
5088
5201
  };
5089
- function DE({ scale: g } = { scale: 1.5 }) {
5202
+ function tE({ scale: g } = { scale: 1.5 }) {
5090
5203
  const A = new ZA(g);
5091
5204
  return A.showPanel(
5092
5205
  0
@@ -5152,8 +5265,8 @@ class hE {
5152
5265
  this.elements_.splice(I, 1), this.resizeObserver_ && this.resizeObserver_.unobserve(A);
5153
5266
  }
5154
5267
  }
5155
- const tE = 2048;
5156
- function hB(g, A) {
5268
+ const yE = 2048;
5269
+ function tB(g, A) {
5157
5270
  for (const B of A) {
5158
5271
  if (B.id === g.id)
5159
5272
  throw new Error(
@@ -5175,12 +5288,12 @@ function hB(g, A) {
5175
5288
  `${B.type} cannot be shared by multiple viewports simultaneously.`
5176
5289
  );
5177
5290
  }
5178
- class Jo {
5291
+ class Yo {
5179
5292
  /** The canvas element the renderer draws into. */
5180
5293
  canvas;
5181
5294
  /** The registered overlays that update once per frame in order. */
5182
5295
  overlays;
5183
- /** Memory, queue, chunk, and rendered-object statistics. */
5296
+ /** Runtime, memory, queue, chunk, and rendered-object statistics. */
5184
5297
  stats;
5185
5298
  chunkManager_;
5186
5299
  context_;
@@ -5199,9 +5312,9 @@ class Jo {
5199
5312
  * @param params - Initialization properties.
5200
5313
  */
5201
5314
  constructor(A) {
5202
- this.canvas = A.canvas, this.renderer_ = new JQ(this.canvas);
5203
- const B = (A.memoryLimitMB ?? tE) * 1024 * 1024;
5204
- this.chunkManager_ = new xQ(
5315
+ this.canvas = A.canvas, this.renderer_ = new dQ(this.canvas);
5316
+ const B = (A.memoryLimitMB ?? yE) * 1024 * 1024;
5317
+ this.chunkManager_ = new WQ(
5205
5318
  (Q) => this.renderer_.uploadTexture(Q),
5206
5319
  (Q) => this.renderer_.disposeTexture(Q),
5207
5320
  () => this.renderer_.gpuTextureBytes,
@@ -5212,8 +5325,8 @@ class Jo {
5212
5325
  chunkManager: this.chunkManager_
5213
5326
  }, this.viewports_ = [];
5214
5327
  for (const Q of A.viewports ?? [])
5215
- hB(Q, this.viewports_), this.viewports_.push(Q);
5216
- this.overlays = [...A.overlays ?? []], this.stats = new sE(this.renderer_, this.chunkManager_, this.viewports_), A.showStats && (this.stats_ = DE());
5328
+ tB(Q, this.viewports_), this.viewports_.push(Q);
5329
+ this.overlays = [...A.overlays ?? []], this.stats = new DE(this.renderer_, this.chunkManager_, this.viewports_), A.showStats && (this.stats_ = tE());
5217
5330
  const C = [this.canvas];
5218
5331
  for (const Q of this.viewports_)
5219
5332
  Q.domElement !== this.canvas && C.push(Q.domElement);
@@ -5256,7 +5369,7 @@ class Jo {
5256
5369
  * @returns The added viewport.
5257
5370
  */
5258
5371
  addViewport(A) {
5259
- return hB(A, this.viewports_), A.updateSize(), this.viewports_.push(A), this.invalidate(), this.running && (A.events.connect(), A.domElement !== this.canvas && this.sizeObserver_.observe(A.domElement)), k.info("Idetik", `Added viewport "${A.id}"`), A;
5372
+ return tB(A, this.viewports_), A.updateSize(), this.viewports_.push(A), this.invalidate(), this.running && (A.events.connect(), A.domElement !== this.canvas && this.sizeObserver_.observe(A.domElement)), k.info("Idetik", `Added viewport "${A.id}"`), A;
5260
5373
  }
5261
5374
  /**
5262
5375
  * Removes a previously added viewport.
@@ -5318,7 +5431,7 @@ class Jo {
5318
5431
  if (k.info("Idetik", "Idetik runtime starting"), this.running)
5319
5432
  k.warn("Idetik", "Idetik runtime already started");
5320
5433
  else {
5321
- this.invalidate();
5434
+ this.invalidate(), this.stats.resetRates();
5322
5435
  for (const A of this.viewports_)
5323
5436
  A.events.connect();
5324
5437
  this.sizeObserver_.connect(), this.lastAnimationId_ = requestAnimationFrame((A) => {
@@ -5367,6 +5480,7 @@ class Jo {
5367
5480
  this.renderRequested_ = !1, this.renderInvalidated_ = !1, this.renderer_.beginFrame();
5368
5481
  for (const A of this.viewports_)
5369
5482
  this.renderer_.render(A);
5483
+ this.renderer_.endFrame(), this.stats.recordDraw();
5370
5484
  }
5371
5485
  /**
5372
5486
  * Stops the render loop and disconnects input handlers.
@@ -5378,7 +5492,7 @@ class Jo {
5378
5492
  this.sizeObserver_.disconnect();
5379
5493
  for (const A of this.viewports_)
5380
5494
  A.events.disconnect();
5381
- cancelAnimationFrame(this.lastAnimationId_), this.lastAnimationId_ = void 0;
5495
+ cancelAnimationFrame(this.lastAnimationId_), this.lastAnimationId_ = void 0, this.stats.resetRates();
5382
5496
  }
5383
5497
  }
5384
5498
  }
@@ -5389,10 +5503,10 @@ const Cg = [
5389
5503
  "pointercancel",
5390
5504
  "wheel"
5391
5505
  ];
5392
- function yE(g) {
5506
+ function eE(g) {
5393
5507
  return Cg.includes(g);
5394
5508
  }
5395
- class eE {
5509
+ class nE {
5396
5510
  propagationStopped_ = !1;
5397
5511
  type;
5398
5512
  event;
@@ -5409,7 +5523,7 @@ class eE {
5409
5523
  this.propagationStopped_ = !0;
5410
5524
  }
5411
5525
  }
5412
- class nE {
5526
+ class GE {
5413
5527
  listeners_ = [];
5414
5528
  element_;
5415
5529
  isConnected_ = !1;
@@ -5454,17 +5568,17 @@ class nE {
5454
5568
  });
5455
5569
  }
5456
5570
  handleEvent = (A) => {
5457
- if (!yE(A.type)) {
5571
+ if (!eE(A.type)) {
5458
5572
  k.error("EventDispatcher", `Unsupported event type ${A.type}`);
5459
5573
  return;
5460
5574
  }
5461
- const I = new eE(A.type, A);
5575
+ const I = new nE(A.type, A);
5462
5576
  for (const B of this.listeners_)
5463
5577
  if (B(I), I.propagationStopped) break;
5464
5578
  };
5465
5579
  }
5466
- const GE = 1e-12;
5467
- class wE {
5580
+ const wE = 1e-12;
5581
+ class rE {
5468
5582
  origin;
5469
5583
  direction;
5470
5584
  constructor(A, I) {
@@ -5472,13 +5586,13 @@ class wE {
5472
5586
  }
5473
5587
  intersectWithPlane(A) {
5474
5588
  const I = sI(this.direction, A.normal);
5475
- if (Math.abs(I) < GE)
5589
+ if (Math.abs(I) < wE)
5476
5590
  return null;
5477
5591
  const B = -A.signedDistanceToPoint(this.origin) / I;
5478
5592
  return Ag(M(), this.origin, this.direction, B);
5479
5593
  }
5480
5594
  }
5481
- class Yo {
5595
+ class Mo {
5482
5596
  /** The viewport's unique identifier. */
5483
5597
  id;
5484
5598
  /** The host element defining the viewport's area. */
@@ -5496,12 +5610,12 @@ class Yo {
5496
5610
  lastCameraTransform_ = _();
5497
5611
  lastProjection_ = _();
5498
5612
  constructor(A) {
5499
- this.id = A.id || A.domElement.id || AC("viewport"), this.domElement = A.domElement, this.camera = A.camera, this.cameraControls = A.cameraControls, this.updateAspectRatio(), this.events = new nE(this.domElement), this.events.addEventListener((I) => {
5613
+ this.id = A.id || A.domElement.id || AC("viewport"), this.domElement = A.domElement, this.camera = A.camera, this.cameraControls = A.cameraControls, this.updateAspectRatio(), this.events = new GE(this.domElement), this.events.addEventListener((I) => {
5500
5614
  if (I.event instanceof PointerEvent || I.event instanceof WheelEvent) {
5501
5615
  const { clientX: B, clientY: C } = I.event, Q = v(B, C);
5502
5616
  I.clipPos = this.clientToClip(Q, 0), I.worldPos = this.camera.clipToWorld(I.clipPos);
5503
5617
  const E = this.camera.clipToWorld(this.clientToClip(Q, -1)), i = this.camera.clipToWorld(this.clientToClip(Q, 1));
5504
- I.worldRay = new wE(E, Gg(M(), i, E));
5618
+ I.worldRay = new rE(E, Gg(M(), i, E));
5505
5619
  }
5506
5620
  for (const B of this.layers_)
5507
5621
  if (B.onEvent(I), I.propagationStopped) return;
@@ -5563,10 +5677,10 @@ class Yo {
5563
5677
  * @returns The viewport's box in the element's coordinate space.
5564
5678
  */
5565
5679
  getBoxRelativeTo(A) {
5566
- const I = this.getBox().toRect(), B = A.getBoundingClientRect(), C = window.devicePixelRatio || 1, Q = B.left * C, E = B.top * C, i = B.height * C, o = I.x - Q, a = I.y - E, s = Math.floor(o), D = Math.floor(i - a - I.height), h = Math.floor(I.width), t = Math.floor(I.height);
5680
+ const I = this.getBox().toRect(), B = A.getBoundingClientRect(), C = window.devicePixelRatio || 1, Q = B.left * C, E = B.top * C, i = B.height * C, o = I.x - Q, a = I.y - E, s = Math.floor(o), D = Math.floor(i - a - I.height), t = Math.floor(I.width), h = Math.floor(I.height);
5567
5681
  return new AA(
5568
5682
  v(s, D),
5569
- v(s + h, D + t)
5683
+ v(s + t, D + h)
5570
5684
  );
5571
5685
  }
5572
5686
  /**
@@ -5632,7 +5746,7 @@ function FE(g, A) {
5632
5746
  }
5633
5747
  };
5634
5748
  }
5635
- function tB(g, A) {
5749
+ function hB(g, A) {
5636
5750
  const I = typeof g == "string" ? new URL(g) : g;
5637
5751
  I.pathname.endsWith("/") || (I.pathname += "/");
5638
5752
  const B = new URL(A.slice(1), I);
@@ -5657,11 +5771,11 @@ class _A {
5657
5771
  return new Request(A, FE(this.#I, I));
5658
5772
  }
5659
5773
  async get(A, I = {}) {
5660
- let B = tB(this.url, A).href, C = this.#B(B, I), Q = await this.#A(C);
5774
+ let B = hB(this.url, A).href, C = this.#B(B, I), Q = await this.#A(C);
5661
5775
  return yB(Q);
5662
5776
  }
5663
5777
  async getRange(A, I, B = {}) {
5664
- let C = tB(this.url, A), Q;
5778
+ let C = hB(this.url, A), Q;
5665
5779
  if ("suffixLength" in I)
5666
5780
  Q = await this.#C(C, I.suffixLength, B);
5667
5781
  else {
@@ -5719,7 +5833,7 @@ class X extends $A {
5719
5833
  super(A, { cause: I.cause }), this.path = I.path;
5720
5834
  }
5721
5835
  }
5722
- class rE extends $A {
5836
+ class SE extends $A {
5723
5837
  _tag = "UnknownCodecError";
5724
5838
  name = "UnknownCodecError";
5725
5839
  codec;
@@ -5727,7 +5841,7 @@ class rE extends $A {
5727
5841
  super(`Unknown codec: ${A}`), this.codec = A;
5728
5842
  }
5729
5843
  }
5730
- class SE extends $A {
5844
+ class RE extends $A {
5731
5845
  _tag = "CodecPipelineError";
5732
5846
  name = "CodecPipelineError";
5733
5847
  direction;
@@ -5742,7 +5856,7 @@ class SE extends $A {
5742
5856
  super(I.join(" "), { cause: A.cause }), this.direction = A.direction, this.codec = A.codec, this.chunkPath = A.chunkPath;
5743
5857
  }
5744
5858
  }
5745
- class dg extends $A {
5859
+ class Yg extends $A {
5746
5860
  _tag = "UnsupportedError";
5747
5861
  name = "UnsupportedError";
5748
5862
  feature;
@@ -5752,7 +5866,7 @@ class dg extends $A {
5752
5866
  }
5753
5867
  function NA(g) {
5754
5868
  return () => {
5755
- throw new dg(`${g} encode`);
5869
+ throw new Yg(`${g} encode`);
5756
5870
  };
5757
5871
  }
5758
5872
  class GI {
@@ -5916,11 +6030,11 @@ class AI {
5916
6030
  yield this.get(A);
5917
6031
  }
5918
6032
  }
5919
- function RE() {
6033
+ function cE() {
5920
6034
  if (typeof SharedArrayBuffer > "u")
5921
6035
  throw new Error("SharedArrayBuffer is not available. In browsers, this requires Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy headers to be set.");
5922
6036
  }
5923
- function cE(g, A) {
6037
+ function NE(g, A) {
5924
6038
  return new SharedArrayBuffer(g);
5925
6039
  }
5926
6040
  function II(g) {
@@ -5974,7 +6088,7 @@ function SA(g, A) {
5974
6088
  C[A[Q]] = B, B *= g[A[Q]];
5975
6089
  return C;
5976
6090
  }
5977
- function NE({ name: g, configuration: A }) {
6091
+ function UE({ name: g, configuration: A }) {
5978
6092
  if (g === "default") {
5979
6093
  const I = A?.separator ?? "/";
5980
6094
  return (B) => ["c", ...B].join(I);
@@ -6009,15 +6123,15 @@ function nB(g) {
6009
6123
  throw new X(`Unsupported or unknown dtype: ${g}`);
6010
6124
  return I === "|" ? { dataType: C } : { dataType: C, endian: I === "<" ? "little" : "big" };
6011
6125
  }
6012
- function UE(g) {
6126
+ function kE(g) {
6013
6127
  return (g.id === "fixedscaleoffset" || g.id === "numcodecs.fixedscaleoffset") && typeof g.scale == "number" && typeof g.offset == "number" && (g.astype === void 0 || typeof g.astype == "string") && (g.dtype === void 0 || typeof g.dtype == "string");
6014
6128
  }
6015
- function kE(g, A = {}) {
6129
+ function LE(g, A = {}) {
6016
6130
  let I = [], B = nB(g.dtype);
6017
6131
  g.order === "F" && I.push({ name: "transpose", configuration: { order: "F" } });
6018
6132
  for (let Q of g.filters ?? []) {
6019
6133
  if (Q.id === "fixedscaleoffset" || Q.id === "numcodecs.fixedscaleoffset") {
6020
- if (!UE(Q))
6134
+ if (!kE(Q))
6021
6135
  throw new X(`Invalid fixedscaleoffset filter: ${JSON.stringify(Q)}`);
6022
6136
  I.push({
6023
6137
  name: "scale_offset",
@@ -6075,7 +6189,7 @@ function kE(g, A = {}) {
6075
6189
  attributes: A
6076
6190
  };
6077
6191
  }
6078
- function LE(g, A = {}) {
6192
+ function JE(g, A = {}) {
6079
6193
  return {
6080
6194
  zarr_format: 3,
6081
6195
  node_type: "group",
@@ -6097,7 +6211,7 @@ function Qg(g, A) {
6097
6211
  let Q = g === "v2:object";
6098
6212
  return A === "object" ? Q : !B && !C && !I && !Q;
6099
6213
  }
6100
- function JE(g) {
6214
+ function dE(g) {
6101
6215
  return g?.name === "sharding_indexed";
6102
6216
  }
6103
6217
  function eC(g) {
@@ -6176,7 +6290,7 @@ class HI {
6176
6290
  };
6177
6291
  }
6178
6292
  }
6179
- const FB = {
6293
+ const rB = {
6180
6294
  NaN: NaN,
6181
6295
  Infinity: 1 / 0,
6182
6296
  "-Infinity": -1 / 0
@@ -6191,16 +6305,16 @@ function wI(g) {
6191
6305
  function Eg(g) {
6192
6306
  return g === "int64" || g === "uint64";
6193
6307
  }
6194
- function dE(g, A) {
6308
+ function ME(g, A) {
6195
6309
  const I = BigInt(g), B = new ArrayBuffer(A), C = new DataView(B);
6196
6310
  if (A === 2) {
6197
6311
  if (typeof C.getFloat16 != "function")
6198
- throw new dg("float16 hex-encoded scalar decoding (requires DataView.prototype.getFloat16)");
6312
+ throw new Yg("float16 hex-encoded scalar decoding (requires DataView.prototype.getFloat16)");
6199
6313
  return C.setUint16(0, Number(I)), C.getFloat16(0);
6200
6314
  }
6201
6315
  return A === 4 ? (C.setUint32(0, Number(I)), C.getFloat32(0)) : (C.setBigUint64(0, I), C.getFloat64(0));
6202
6316
  }
6203
- function FI(g, A) {
6317
+ function rI(g, A) {
6204
6318
  if (Eg(g)) {
6205
6319
  if (typeof A != "number" || !Number.isInteger(A))
6206
6320
  throw new X(`Expected an integer value for data type "${g}", got ${JSON.stringify(A)}`);
@@ -6213,9 +6327,9 @@ function FI(g, A) {
6213
6327
  }
6214
6328
  if (!wI(g))
6215
6329
  throw new X(`String-encoded scalar "${A}" is not valid for non-float data type "${g}"`);
6216
- return A in FB ? FB[A] : dE(A, wC[g]);
6330
+ return A in rB ? rB[A] : ME(A, wC[g]);
6217
6331
  }
6218
- const rB = /* @__PURE__ */ new Set([
6332
+ const FB = /* @__PURE__ */ new Set([
6219
6333
  "int8",
6220
6334
  "uint8",
6221
6335
  "int16",
@@ -6240,11 +6354,11 @@ const rB = /* @__PURE__ */ new Set([
6240
6354
  };
6241
6355
  function SB(g, A, I) {
6242
6356
  return g.map(([B, C]) => ({
6243
- src: FI(A, B),
6244
- tgt: FI(I, C)
6357
+ src: rI(A, B),
6358
+ tgt: rI(I, C)
6245
6359
  }));
6246
6360
  }
6247
- function ME(g, A) {
6361
+ function KE(g, A) {
6248
6362
  for (const I of A)
6249
6363
  if (typeof I.src == "number" && Number.isNaN(I.src)) {
6250
6364
  if (typeof g == "number" && Number.isNaN(g))
@@ -6252,7 +6366,7 @@ function ME(g, A) {
6252
6366
  } else if (g === I.src)
6253
6367
  return I.tgt;
6254
6368
  }
6255
- function KE(g) {
6369
+ function HE(g) {
6256
6370
  if (!Number.isFinite(g))
6257
6371
  return g;
6258
6372
  if (Math.abs(g - Math.trunc(g)) === 0.5) {
@@ -6261,13 +6375,13 @@ function KE(g) {
6261
6375
  }
6262
6376
  return Math.round(g);
6263
6377
  }
6264
- function HE(g) {
6378
+ function qE(g) {
6265
6379
  return Math.sign(g) * Math.floor(Math.abs(g) + 0.5);
6266
6380
  }
6267
6381
  function RB(g) {
6268
6382
  switch (g) {
6269
6383
  case "nearest-even":
6270
- return KE;
6384
+ return HE;
6271
6385
  case "towards-zero":
6272
6386
  return Math.trunc;
6273
6387
  case "towards-positive":
@@ -6275,7 +6389,7 @@ function RB(g) {
6275
6389
  case "towards-negative":
6276
6390
  return Math.floor;
6277
6391
  case "nearest-away":
6278
- return HE;
6392
+ return qE;
6279
6393
  }
6280
6394
  }
6281
6395
  function PI(g, A, I) {
@@ -6324,9 +6438,9 @@ class Hg {
6324
6438
  }
6325
6439
  static fromConfig(A, I) {
6326
6440
  const B = I.dataType, C = A.data_type;
6327
- if (!rB.has(B))
6441
+ if (!FB.has(B))
6328
6442
  throw new X(`cast_value codec does not support array data type: ${B}`);
6329
- if (!rB.has(C))
6443
+ if (!FB.has(C))
6330
6444
  throw new X(`cast_value codec does not support encoded data type: ${C}`);
6331
6445
  const Q = A.rounding ?? "nearest-even", E = A.scalar_map?.decode ? SB(A.scalar_map.decode, C, B) : [], i = A.scalar_map?.encode ? SB(A.scalar_map.encode, B, C) : [];
6332
6446
  return new Hg(B, C, Q, A.out_of_range, E, i);
@@ -6347,18 +6461,18 @@ function cB(g, A, I, B, C) {
6347
6461
  throw new X(`cast_value float -> float only supports "nearest-even" rounding, got "${I}"`);
6348
6462
  a = (D) => D;
6349
6463
  } else if (Q && !i && !o) {
6350
- const D = RB(I), h = PI(...bI[A], B);
6351
- a = (t) => {
6352
- if (!Number.isFinite(t))
6353
- throw new Error(`Cannot cast ${t} to integer type without scalar_map`);
6354
- return h(D(t));
6464
+ const D = RB(I), t = PI(...bI[A], B);
6465
+ a = (h) => {
6466
+ if (!Number.isFinite(h))
6467
+ throw new Error(`Cannot cast ${h} to integer type without scalar_map`);
6468
+ return t(D(h));
6355
6469
  };
6356
6470
  } else if (Q && o) {
6357
- const D = RB(I), h = OI(...ZI[A], B);
6358
- a = (t) => {
6359
- if (!Number.isFinite(t))
6360
- throw new Error(`Cannot cast ${t} to integer type without scalar_map`);
6361
- return h(BigInt(D(t)));
6471
+ const D = RB(I), t = OI(...ZI[A], B);
6472
+ a = (h) => {
6473
+ if (!Number.isFinite(h))
6474
+ throw new Error(`Cannot cast ${h} to integer type without scalar_map`);
6475
+ return t(BigInt(D(h)));
6362
6476
  };
6363
6477
  } else if (!Q && !E && i)
6364
6478
  a = (D) => D;
@@ -6368,17 +6482,17 @@ function cB(g, A, I, B, C) {
6368
6482
  a = PI(...bI[A], B);
6369
6483
  else if (!Q && !E && o) {
6370
6484
  const D = OI(...ZI[A], B);
6371
- a = (h) => D(BigInt(h));
6485
+ a = (t) => D(BigInt(t));
6372
6486
  } else if (E && !i && !o) {
6373
6487
  const D = PI(...bI[A], B);
6374
- a = (h) => D(Number(h));
6488
+ a = (t) => D(Number(t));
6375
6489
  } else if (E && o)
6376
6490
  a = OI(...ZI[A], B);
6377
6491
  else
6378
6492
  throw new Error(`Unhandled type combination: ${g} -> ${A}`);
6379
6493
  return C.length === 0 ? a : (D) => {
6380
- const h = ME(D, C);
6381
- return h !== void 0 ? h : a(D);
6494
+ const t = KE(D, C);
6495
+ return t !== void 0 ? t : a(D);
6382
6496
  };
6383
6497
  }
6384
6498
  class qg {
@@ -6394,7 +6508,7 @@ class qg {
6394
6508
  return A + 4;
6395
6509
  }
6396
6510
  }
6397
- const qE = /* @__PURE__ */ new Set([
6511
+ const lE = /* @__PURE__ */ new Set([
6398
6512
  "int8",
6399
6513
  "uint8",
6400
6514
  "int16",
@@ -6427,7 +6541,7 @@ class lg {
6427
6541
  this.#A = A;
6428
6542
  }
6429
6543
  static fromConfig(A, I) {
6430
- if (!qE.has(I.dataType))
6544
+ if (!lE.has(I.dataType))
6431
6545
  throw new X(`Delta codec does not support data type: ${I.dataType}`);
6432
6546
  return new lg(mA(I.dataType));
6433
6547
  }
@@ -6459,13 +6573,13 @@ class fg {
6459
6573
  return new Uint8Array(I);
6460
6574
  }
6461
6575
  }
6462
- function lE(g, A) {
6576
+ function fE(g, A) {
6463
6577
  return IA(!Number.isNaN(A), "JsonCodec allow_nan is false but NaN was encountered during encoding."), IA(A !== Number.POSITIVE_INFINITY, "JsonCodec allow_nan is false but Infinity was encountered during encoding."), IA(A !== Number.NEGATIVE_INFINITY, "JsonCodec allow_nan is false but -Infinity was encountered during encoding."), A;
6464
6578
  }
6465
- function fE(g, A) {
6579
+ function pE(g, A) {
6466
6580
  return A instanceof Object && !Array.isArray(A) ? Object.keys(A).sort().reduce((I, B) => (I[B] = A[B], I), {}) : A;
6467
6581
  }
6468
- class rI {
6582
+ class FI {
6469
6583
  configuration;
6470
6584
  kind = "array_to_bytes";
6471
6585
  #A;
@@ -6486,26 +6600,26 @@ class rI {
6486
6600
  }, this.#I = { strict: a };
6487
6601
  }
6488
6602
  static fromConfig(A) {
6489
- return new rI(A);
6603
+ return new FI(A);
6490
6604
  }
6491
6605
  encode(A) {
6492
6606
  const { indent: I, encoding: B, ensure_ascii: C, check_circular: Q, allow_nan: E, sort_keys: i } = this.#A;
6493
6607
  IA(B === "utf-8", "JsonCodec does not yet support non-utf-8 encoding.");
6494
6608
  const o = [];
6495
- IA(Q, "JsonCodec does not yet support skipping the check for circular references during encoding."), E || o.push(lE), i && o.push(fE);
6609
+ IA(Q, "JsonCodec does not yet support skipping the check for circular references during encoding."), E || o.push(fE), i && o.push(pE);
6496
6610
  const a = Array.from(A.data);
6497
6611
  a.push("|O"), a.push(A.shape);
6498
6612
  let s;
6499
- o.length && (s = (h, t) => {
6500
- let e = t;
6613
+ o.length && (s = (t, h) => {
6614
+ let e = h;
6501
6615
  for (let n of o)
6502
- e = n(h, e);
6616
+ e = n(t, e);
6503
6617
  return e;
6504
6618
  });
6505
6619
  let D = JSON.stringify(a, s, I);
6506
- return C && (D = D.replace(/[\u007F-\uFFFF]/g, (h) => {
6507
- const t = `0000${h.charCodeAt(0).toString(16)}`;
6508
- return `\\u${t.substring(t.length - 4)}`;
6620
+ return C && (D = D.replace(/[\u007F-\uFFFF]/g, (t) => {
6621
+ const h = `0000${t.charCodeAt(0).toString(16)}`;
6622
+ return `\\u${h.substring(h.length - 4)}`;
6509
6623
  })), new TextEncoder().encode(D);
6510
6624
  }
6511
6625
  decode(A) {
@@ -6517,7 +6631,7 @@ class rI {
6517
6631
  return { data: B, shape: C, stride: Q };
6518
6632
  }
6519
6633
  }
6520
- const pE = /* @__PURE__ */ new Set([
6634
+ const uE = /* @__PURE__ */ new Set([
6521
6635
  "int8",
6522
6636
  "uint8",
6523
6637
  "int16",
@@ -6539,9 +6653,9 @@ class pg {
6539
6653
  this.#I = A, this.#g = I, this.#A = B;
6540
6654
  }
6541
6655
  static fromConfig(A, I) {
6542
- if (!pE.has(I.dataType))
6656
+ if (!uE.has(I.dataType))
6543
6657
  throw new X(`scale_offset codec does not support data type: ${I.dataType}`);
6544
- return new pg(FI(I.dataType, A.scale ?? 1), FI(I.dataType, A.offset ?? 0), mA(I.dataType));
6658
+ return new pg(rI(I.dataType, A.scale ?? 1), rI(I.dataType, A.offset ?? 0), mA(I.dataType));
6545
6659
  }
6546
6660
  encode = NA("scale_offset");
6547
6661
  decode(A) {
@@ -6565,20 +6679,20 @@ class ug {
6565
6679
  return new ug(A, I);
6566
6680
  }
6567
6681
  encode(A) {
6568
- return uE(A, this.#A);
6682
+ return mE(A, this.#A);
6569
6683
  }
6570
6684
  decode(A) {
6571
- return mE(A, this.#A);
6685
+ return TE(A, this.#A);
6572
6686
  }
6573
6687
  }
6574
- function uE(g, A) {
6688
+ function mE(g, A) {
6575
6689
  let I = g.length, B = Math.floor(I / A), C = new Uint8Array(I);
6576
6690
  for (let Q = 0; Q < A; Q++)
6577
6691
  for (let E = 0; E < B; E++)
6578
6692
  C[Q * B + E] = g[E * A + Q];
6579
6693
  return C;
6580
6694
  }
6581
- function mE(g, A) {
6695
+ function TE(g, A) {
6582
6696
  let I = g.length, B = Math.floor(I / A), C = new Uint8Array(I);
6583
6697
  for (let Q = 0; Q < A; Q++)
6584
6698
  for (let E = 0; E < B; E++)
@@ -6595,7 +6709,7 @@ function UB(g) {
6595
6709
  }
6596
6710
  }) : g;
6597
6711
  }
6598
- function TE(g, A) {
6712
+ function xE(g, A) {
6599
6713
  let I;
6600
6714
  return g.data instanceof Kg || g.data instanceof AI ? I = new g.constructor(
6601
6715
  // @ts-expect-error
@@ -6607,8 +6721,8 @@ function TE(g, A) {
6607
6721
  stride: SA(g.shape, A)
6608
6722
  };
6609
6723
  }
6610
- function xE(g, A) {
6611
- let I = TE(g, A), B = g.shape.length, C = g.data.length, Q = Array(B).fill(0), E = UB(g.data), i = UB(I.data);
6724
+ function WE(g, A) {
6725
+ let I = xE(g, A), B = g.shape.length, C = g.data.length, Q = Array(B).fill(0), E = UB(g.data), i = UB(I.data);
6612
6726
  for (let o = 0; o < C; o++) {
6613
6727
  let a = 0;
6614
6728
  for (let s = 0; s < B; s++)
@@ -6623,12 +6737,12 @@ function xE(g, A) {
6623
6737
  }
6624
6738
  return I;
6625
6739
  }
6626
- function WE(g) {
6740
+ function bE(g) {
6627
6741
  let A = g.shape.length;
6628
6742
  return IA(A === g.stride.length, "Shape and stride must have the same length."), g.stride.map((I, B) => ({ stride: I, index: B })).sort((I, B) => B.stride - I.stride).map((I) => I.index);
6629
6743
  }
6630
- function bE(g, A) {
6631
- let I = WE(g);
6744
+ function ZE(g, A) {
6745
+ let I = bE(g);
6632
6746
  return IA(I.length === A.length, "Orders must match"), I.every((B, C) => B === A[C]);
6633
6747
  }
6634
6748
  class mg {
@@ -6653,7 +6767,7 @@ class mg {
6653
6767
  return new mg(A, I);
6654
6768
  }
6655
6769
  encode(A) {
6656
- return bE(A, this.#I) ? A : xE(A, this.#I);
6770
+ return ZE(A, this.#I) ? A : WE(A, this.#I);
6657
6771
  }
6658
6772
  decode(A) {
6659
6773
  return {
@@ -6694,21 +6808,21 @@ class Tg {
6694
6808
  return new Uint8Array(I);
6695
6809
  }
6696
6810
  }
6697
- function ZE() {
6811
+ function PE() {
6698
6812
  let g = () => import("./blosc-D1xNXZJs.js").then((Q) => Q.default), A = () => import("./lz4-1Ws5oVWR.js").then((Q) => Q.default), I = () => import("./zstd-C4EcZnjq.js").then((Q) => Q.default), B = () => fg, C = () => Tg;
6699
- return (/* @__PURE__ */ new Map()).set("blosc", g).set("lz4", A).set("zstd", I).set("gzip", B).set("zlib", C).set("transpose", () => mg).set("bytes", () => HI).set("crc32c", () => qg).set("vlen-utf8", () => SI).set("json2", () => rI).set("bitround", () => GI).set("cast_value", () => Hg).set("scale_offset", () => pg).set("numcodecs.blosc", g).set("numcodecs.lz4", A).set("numcodecs.zstd", I).set("numcodecs.gzip", B).set("numcodecs.zlib", C).set("numcodecs.vlen-utf8", () => SI).set("numcodecs.shuffle", () => ug).set("numcodecs.delta", () => lg).set("numcodecs.bitround", () => GI).set("numcodecs.json2", () => rI);
6813
+ return (/* @__PURE__ */ new Map()).set("blosc", g).set("lz4", A).set("zstd", I).set("gzip", B).set("zlib", C).set("transpose", () => mg).set("bytes", () => HI).set("crc32c", () => qg).set("vlen-utf8", () => SI).set("json2", () => FI).set("bitround", () => GI).set("cast_value", () => Hg).set("scale_offset", () => pg).set("numcodecs.blosc", g).set("numcodecs.lz4", A).set("numcodecs.zstd", I).set("numcodecs.gzip", B).set("numcodecs.zlib", C).set("numcodecs.vlen-utf8", () => SI).set("numcodecs.shuffle", () => ug).set("numcodecs.delta", () => lg).set("numcodecs.bitround", () => GI).set("numcodecs.json2", () => FI);
6700
6814
  }
6701
- const PE = ZE();
6815
+ const OE = PE();
6702
6816
  function ig(g) {
6703
6817
  let A;
6704
6818
  function I() {
6705
- return A || (A = OE(g)), A;
6819
+ return A || (A = VE(g)), A;
6706
6820
  }
6707
6821
  async function B(C, Q, E) {
6708
6822
  try {
6709
6823
  return await E();
6710
6824
  } catch (i) {
6711
- throw new SE({ direction: C, codec: Q, cause: i });
6825
+ throw new RE({ direction: C, codec: Q, cause: i });
6712
6826
  }
6713
6827
  }
6714
6828
  return {
@@ -6747,11 +6861,11 @@ function kB(g, A, I) {
6747
6861
  throw new X(`Codec "${g}" cannot compute its encoded size; it is not a fixed-size codec and cannot be used in a sharding index pipeline`);
6748
6862
  return A.computeEncodedSize(I);
6749
6863
  }
6750
- async function OE(g) {
6864
+ async function VE(g) {
6751
6865
  let A = g.codecs.map(async (E) => {
6752
- let i = await PE.get(E.name)?.();
6866
+ let i = await OE.get(E.name)?.();
6753
6867
  if (!i)
6754
- throw new rE(E.name);
6868
+ throw new SE(E.name);
6755
6869
  return { Codec: i, meta: E };
6756
6870
  }), I = [], B, C = [], Q = { ...g };
6757
6871
  for await (let { Codec: E, meta: i } of A) {
@@ -6777,7 +6891,7 @@ async function OE(g) {
6777
6891
  }
6778
6892
  }
6779
6893
  if (!B) {
6780
- if (!VE(Q))
6894
+ if (!vE(Q))
6781
6895
  throw new X(`Cannot encode ${Q.dataType} to bytes without a codec`);
6782
6896
  B = {
6783
6897
  name: "bytes",
@@ -6790,13 +6904,13 @@ async function OE(g) {
6790
6904
  bytesToBytes: C
6791
6905
  };
6792
6906
  }
6793
- function VE(g) {
6907
+ function vE(g) {
6794
6908
  return g.dataType !== "v2:object" && g.dataType !== "string";
6795
6909
  }
6796
6910
  const LB = 18446744073709551615n;
6797
- function vE(g, A, I, B) {
6911
+ function XE(g, A, I, B) {
6798
6912
  if (!g.store.getRange)
6799
- throw new dg("sharding requires a store with getRange");
6913
+ throw new Yg("sharding requires a store with getRange");
6800
6914
  let C = g.store.getRange.bind(g.store), Q = A.map((a, s) => a / B.chunk_shape[s]), E = ig({
6801
6915
  dataType: "uint64",
6802
6916
  shape: [...Q, 2],
@@ -6804,19 +6918,19 @@ function vE(g, A, I, B) {
6804
6918
  fillValue: null
6805
6919
  }), i = 16 * Q.reduce((a, s) => a * s, 1), o = {};
6806
6920
  return async (a, s) => {
6807
- let D = a.map((S, r) => Math.floor(S / Q[r])), h = g.resolve(I(D)).path;
6808
- h in o || (o[h] = (async () => {
6809
- let S = await E.computeEncodedSize(i), r = await C(h, { suffixLength: S }, s);
6810
- return r ? await E.decode(r) : null;
6921
+ let D = a.map((S, F) => Math.floor(S / Q[F])), t = g.resolve(I(D)).path;
6922
+ t in o || (o[t] = (async () => {
6923
+ let S = await E.computeEncodedSize(i), F = await C(t, { suffixLength: S }, s);
6924
+ return F ? await E.decode(F) : null;
6811
6925
  })().catch((S) => {
6812
- throw delete o[h], S;
6926
+ throw delete o[t], S;
6813
6927
  }));
6814
- let t = await o[h];
6815
- if (t === null)
6928
+ let h = await o[t];
6929
+ if (h === null)
6816
6930
  return;
6817
- let { data: e, shape: n, stride: F } = t, G = a.map((S, r) => S % n[r]).reduce((S, r, U) => S + r * F[U], 0), L = e[G], N = e[G + 1];
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];
6818
6932
  if (!(L === LB && N === LB))
6819
- return C(h, {
6933
+ return C(t, {
6820
6934
  offset: Number(L),
6821
6935
  length: Number(N)
6822
6936
  }, s);
@@ -6847,9 +6961,9 @@ function JB(g) {
6847
6961
  return g.find((I) => I.name === "transpose")?.configuration?.order ?? "C";
6848
6962
  }
6849
6963
  const CI = Symbol("zarrita.context");
6850
- function XE(g, A) {
6851
- let { configuration: I } = A.codecs.find(JE) ?? {}, B = {
6852
- encodeChunkKey: NE(A.chunk_key_encoding),
6964
+ function jE(g, A) {
6965
+ let { configuration: I } = A.codecs.find(dE) ?? {}, B = {
6966
+ encodeChunkKey: UE(A.chunk_key_encoding),
6853
6967
  TypedArray: mA(A.data_type),
6854
6968
  fillValue: A.fill_value
6855
6969
  };
@@ -6868,7 +6982,7 @@ function XE(g, A) {
6868
6982
  getStrides(E) {
6869
6983
  return SA(E, Q);
6870
6984
  },
6871
- getChunkBytes: vE(g, A.chunk_grid.configuration.chunk_shape, B.encodeChunkKey, I)
6985
+ getChunkBytes: XE(g, A.chunk_grid.configuration.chunk_shape, B.encodeChunkKey, I)
6872
6986
  };
6873
6987
  }
6874
6988
  let C = JB(A.codecs);
@@ -6899,7 +7013,7 @@ let RI = class extends CA {
6899
7013
  super(A, I), this.#A = {
6900
7014
  ...B,
6901
7015
  fill_value: eC(B)
6902
- }, this[CI] = XE(this, this.#A);
7016
+ }, this[CI] = jE(this, this.#A);
6903
7017
  }
6904
7018
  get attrs() {
6905
7019
  return this.#A.attributes;
@@ -6920,7 +7034,7 @@ let RI = class extends CA {
6920
7034
  return this.#A.data_type;
6921
7035
  }
6922
7036
  async getChunk(A, I, B) {
6923
- B?.useSharedArrayBuffer && RE();
7037
+ B?.useSharedArrayBuffer && cE();
6924
7038
  let C = this[CI], Q = await C.getChunkBytes(A, I);
6925
7039
  if (!Q) {
6926
7040
  let E = C.chunkShape.reduce((o, a) => o * a, 1), i;
@@ -6929,7 +7043,7 @@ let RI = class extends CA {
6929
7043
  if (!("BYTES_PER_ELEMENT" in o))
6930
7044
  console.warn("zarrita: useSharedArrayBuffer is not supported for non-buffer-backed data types."), i = new C.TypedArray(E);
6931
7045
  else {
6932
- let a = cE(E * o.BYTES_PER_ELEMENT);
7046
+ let a = NE(E * o.BYTES_PER_ELEMENT);
6933
7047
  i = new C.TypedArray(a, 0, E);
6934
7048
  }
6935
7049
  } else
@@ -6963,21 +7077,21 @@ let RI = class extends CA {
6963
7077
  return Qg(this.dtype, A);
6964
7078
  }
6965
7079
  };
6966
- function jE(g, A) {
7080
+ function zE(g, A) {
6967
7081
  let I = g;
6968
7082
  for (let B of A)
6969
7083
  I instanceof Promise ? I = I.then((C) => B(C)) : I = B(I);
6970
7084
  return I;
6971
7085
  }
6972
- function zE(g, ...A) {
6973
- return jE(g, A);
7086
+ function _E(g, ...A) {
7087
+ return zE(g, A);
6974
7088
  }
6975
- async function FC(g) {
7089
+ async function rC(g) {
6976
7090
  let A = g.store.arrayExtensions;
6977
- return A?.length ? await zE(g, ...A) : g;
7091
+ return A?.length ? await _E(g, ...A) : g;
6978
7092
  }
6979
- let qI = _E();
6980
- function _E() {
7093
+ let qI = $E();
7094
+ function $E() {
6981
7095
  let g = /* @__PURE__ */ new WeakMap();
6982
7096
  function A(I) {
6983
7097
  let B = g.get(I) ?? { v2: 0, v3: 0 };
@@ -6993,37 +7107,37 @@ function _E() {
6993
7107
  }
6994
7108
  };
6995
7109
  }
6996
- async function $E(g, A) {
7110
+ async function Ai(g, A) {
6997
7111
  let I = await g.store.get(g.resolve(".zattrs").path, {
6998
7112
  signal: A
6999
7113
  });
7000
7114
  return I ? II(I) : {};
7001
7115
  }
7002
- async function Ai(g, A = {}) {
7116
+ async function Ii(g, A = {}) {
7003
7117
  let I = "store" in g ? g : new CA(g), { signal: B } = A, C = {};
7004
- return (A.attrs ?? !0) && (C = await $E(I, B)), B?.throwIfAborted(), A.kind === "array" ? YB(I, C, B) : A.kind === "group" ? dB(I, C, B) : YB(I, C, B).catch((Q) => (nC(Q, uA, X), dB(I, C, B)));
7118
+ return (A.attrs ?? !0) && (C = await Ai(I, B)), B?.throwIfAborted(), A.kind === "array" ? dB(I, C, B) : A.kind === "group" ? YB(I, C, B) : dB(I, C, B).catch((Q) => (nC(Q, uA, X), YB(I, C, B)));
7005
7119
  }
7006
- async function YB(g, A, I) {
7120
+ async function dB(g, A, I) {
7007
7121
  let { path: B } = g.resolve(".zarray"), C = await g.store.get(B, { signal: I });
7008
7122
  if (!C)
7009
7123
  throw new uA("v2 array", { path: B });
7010
- return qI.increment(g.store, "v2"), FC(new RI(g.store, g.path, kE(II(C), A)));
7124
+ return qI.increment(g.store, "v2"), rC(new RI(g.store, g.path, LE(II(C), A)));
7011
7125
  }
7012
- async function dB(g, A, I) {
7126
+ async function YB(g, A, I) {
7013
7127
  let { path: B } = g.resolve(".zgroup"), C = await g.store.get(B, { signal: I });
7014
7128
  if (!C)
7015
7129
  throw new uA("v2 group", { path: B });
7016
- return qI.increment(g.store, "v2"), new xg(g.store, g.path, LE(II(C), A));
7130
+ return qI.increment(g.store, "v2"), new xg(g.store, g.path, JE(II(C), A));
7017
7131
  }
7018
- async function Ii(g, A) {
7132
+ async function gi(g, A) {
7019
7133
  let { store: I, path: B } = g.resolve("zarr.json"), C = await g.store.get(B, { signal: A });
7020
7134
  if (!C)
7021
7135
  throw new uA("v3 array or group", { path: B });
7022
7136
  let Q = II(C);
7023
- return Q.node_type === "array" && (Q.fill_value = eC(Q)), Q.node_type === "array" ? FC(new RI(I, g.path, Q)) : new xg(I, g.path, Q);
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);
7024
7138
  }
7025
- async function gi(g, A = {}) {
7026
- let I = "store" in g ? g : new CA(g), B = await Ii(I, A.signal);
7139
+ async function Bi(g, A = {}) {
7140
+ let I = "store" in g ? g : new CA(g), B = await gi(I, A.signal);
7027
7141
  if (qI.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && B instanceof RI || A.kind === "group" && B instanceof xg)
7028
7142
  return B;
7029
7143
  let C = B instanceof RI ? "array" : "group";
@@ -7036,9 +7150,9 @@ async function BA(g, A = {}) {
7036
7150
  let I = "store" in g ? g.store : g, B = qI.versionMax(I), C = B === "v2" ? BA.v2 : BA.v3, Q = B === "v2" ? BA.v3 : BA.v2;
7037
7151
  return C(g, A).catch((E) => (nC(E, uA, X), Q(g, A)));
7038
7152
  }
7039
- BA.v2 = Ai;
7040
- BA.v3 = gi;
7041
- async function Bi(g, A) {
7153
+ BA.v2 = Ii;
7154
+ BA.v3 = Bi;
7155
+ async function Ci(g, A) {
7042
7156
  const I = A.split("/"), B = I.pop();
7043
7157
  if (!B)
7044
7158
  throw new Error("Invalid path");
@@ -7055,7 +7169,7 @@ class Wg {
7055
7169
  return this.#A;
7056
7170
  }
7057
7171
  async get(A) {
7058
- const I = await Bi(this.#A, A.slice(1)).catch(
7172
+ const I = await Ci(this.#A, A.slice(1)).catch(
7059
7173
  () => {
7060
7174
  }
7061
7175
  );
@@ -7084,7 +7198,7 @@ async function gI(g, A) {
7084
7198
  throw new Error(`Failed to open Zarr group at ${g}`);
7085
7199
  }
7086
7200
  }
7087
- async function Ci(g, A) {
7201
+ async function Qi(g, A) {
7088
7202
  if (A === "v2")
7089
7203
  try {
7090
7204
  return BA.v2(g, { kind: "array", attrs: !1 });
@@ -7103,7 +7217,7 @@ async function Ci(g, A) {
7103
7217
  throw new Error(`Failed to open Zarr array at ${g}`);
7104
7218
  }
7105
7219
  }
7106
- async function Qi(g) {
7220
+ async function Ei(g) {
7107
7221
  let A;
7108
7222
  switch (g.type) {
7109
7223
  case "fetch": {
@@ -7124,9 +7238,9 @@ async function Qi(g) {
7124
7238
  }
7125
7239
  }
7126
7240
  const I = g.arrayPath ? A.resolve(g.arrayPath) : A;
7127
- return Ci(I, g.zarrVersion);
7241
+ return Qi(I, g.zarrVersion);
7128
7242
  }
7129
- function Ei(g, A, I) {
7243
+ function ii(g, A, I) {
7130
7244
  if (g.store instanceof _A)
7131
7245
  return {
7132
7246
  type: "fetch",
@@ -7146,18 +7260,18 @@ function Ei(g, A, I) {
7146
7260
  `Unsupported store type: ${g.store.constructor.name}`
7147
7261
  );
7148
7262
  }
7149
- function ii(g, A, I, B) {
7150
- return oi(g, A, I, B);
7151
- }
7152
7263
  function oi(g, A, I, B) {
7264
+ return ai(g, A, I, B);
7265
+ }
7266
+ function ai(g, A, I, B) {
7153
7267
  const { targetShape: C, chunkIndex: Q, dimIndices: E } = B;
7154
7268
  let i = 1;
7155
- for (let r = A.length - 1; r >= 0; r--) {
7156
- if (I[r] !== i)
7269
+ for (let F = A.length - 1; F >= 0; F--) {
7270
+ if (I[F] !== i)
7157
7271
  throw new Error(
7158
7272
  `Chunk data is not tightly packed, stride=${JSON.stringify(I)}, shape=${JSON.stringify(A)}`
7159
7273
  );
7160
- i *= A[r];
7274
+ i *= A[F];
7161
7275
  }
7162
7276
  const o = {
7163
7277
  x: A[E.x],
@@ -7168,15 +7282,15 @@ function oi(g, A, I, B) {
7168
7282
  throw new Error(
7169
7283
  `Received chunk too small: expected ${JSON.stringify(C)}, got ${JSON.stringify(o)}`
7170
7284
  );
7171
- const a = B.cChunkSize ? Q.c % B.cChunkSize : 0, s = B.tChunkSize ? Q.t % B.tChunkSize : 0, D = C.x * C.y * C.z, h = E.c !== void 0 ? I[E.c] : 0, t = E.t !== void 0 ? I[E.t] : 0, e = s * t + a * h, n = o.x === C.x && o.y === C.y && o.z === C.z;
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;
7172
7286
  if (e === 0 && g.length === D && n)
7173
7287
  return g;
7174
7288
  const G = new g.constructor(
7175
7289
  D
7176
7290
  ), L = E.z !== void 0 ? I[E.z] : 0, N = I[E.y];
7177
7291
  let S = 0;
7178
- for (let r = 0; r < C.z; r++) {
7179
- const U = e + r * L;
7292
+ for (let F = 0; F < C.z; F++) {
7293
+ const U = e + F * L;
7180
7294
  for (let l = 0; l < C.y; l++) {
7181
7295
  const Z = U + l * N, O = Z + C.x;
7182
7296
  G.set(g.subarray(Z, O), S), S += C.x;
@@ -7184,7 +7298,7 @@ function oi(g, A, I, B) {
7184
7298
  }
7185
7299
  return G;
7186
7300
  }
7187
- const rC = `function xg(B, A) {
7301
+ const FC = `function xg(B, A) {
7188
7302
  return {
7189
7303
  ...B,
7190
7304
  ...A,
@@ -10838,8 +10952,8 @@ return ret;
10838
10952
  default: IQ
10839
10953
  });
10840
10954
  //# sourceMappingURL=worker_kernel-CBlE4MBI.js.map
10841
- `, MB = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", rC], { type: "text/javascript;charset=utf-8" });
10842
- function ai(g) {
10955
+ `, MB = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", FC], { type: "text/javascript;charset=utf-8" });
10956
+ function si(g) {
10843
10957
  let A;
10844
10958
  try {
10845
10959
  if (A = MB && (self.URL || self.webkitURL).createObjectURL(MB), !A) throw "";
@@ -10852,7 +10966,7 @@ function ai(g) {
10852
10966
  }), I;
10853
10967
  } catch {
10854
10968
  return new Worker(
10855
- "data:text/javascript;charset=utf-8," + encodeURIComponent(rC),
10969
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(FC),
10856
10970
  {
10857
10971
  type: "module",
10858
10972
  name: g?.name
@@ -10860,8 +10974,8 @@ function ai(g) {
10860
10974
  );
10861
10975
  }
10862
10976
  }
10863
- const si = Math.max(1, navigator.hardwareConcurrency - 2);
10864
- let iA = [], Di = 0, SC = 0;
10977
+ const Di = Math.max(1, navigator.hardwareConcurrency - 2);
10978
+ let iA = [], ti = 0, SC = 0;
10865
10979
  const RA = /* @__PURE__ */ new Map(), cI = /* @__PURE__ */ new Set();
10866
10980
  function RC(g) {
10867
10981
  const A = iA.find((I) => I.worker === g);
@@ -10921,20 +11035,20 @@ function KB(g, A) {
10921
11035
  }
10922
11036
  }
10923
11037
  function cC() {
10924
- const g = new ai();
11038
+ const g = new si();
10925
11039
  return g.addEventListener("message", (A) => hi(A, g)), g.addEventListener("error", (A) => KB(A, g)), g.addEventListener(
10926
11040
  "messageerror",
10927
11041
  (A) => KB(A, g)
10928
11042
  ), g;
10929
11043
  }
10930
- function ti() {
11044
+ function yi() {
10931
11045
  if (iA.length === 0)
10932
11046
  throw new Error("Worker pool is not initialized");
10933
11047
  return iA.sort((g, A) => g.pendingCount - A.pendingCount)[0];
10934
11048
  }
10935
- async function yi(g, A, I, B) {
11049
+ async function ei(g, A, I, B) {
10936
11050
  return new Promise((C, Q) => {
10937
- const E = ti(), i = Di++, o = {
11051
+ const E = yi(), i = ti++, o = {
10938
11052
  resolve: C,
10939
11053
  reject: Q,
10940
11054
  workerId: E.workerId
@@ -10961,10 +11075,10 @@ async function yi(g, A, I, B) {
10961
11075
  });
10962
11076
  });
10963
11077
  }
10964
- function ei() {
11078
+ function ni() {
10965
11079
  if (!(iA.length > 0))
10966
11080
  try {
10967
- for (let g = 0; g < si; g++) {
11081
+ for (let g = 0; g < Di; g++) {
10968
11082
  const A = cC();
10969
11083
  iA.push({
10970
11084
  worker: A,
@@ -10977,14 +11091,14 @@ function ei() {
10977
11091
  `Initialized worker pool with ${iA.length} workers`
10978
11092
  );
10979
11093
  } catch {
10980
- k.warn("ZarrWorker", "Failed to create workers - clearing pool"), Gi();
11094
+ k.warn("ZarrWorker", "Failed to create workers - clearing pool"), wi();
10981
11095
  return;
10982
11096
  }
10983
11097
  }
10984
- async function ni(g, A, I, B, C) {
10985
- ei();
11098
+ async function Gi(g, A, I, B, C) {
11099
+ ni();
10986
11100
  try {
10987
- return await yi(
11101
+ return await ei(
10988
11102
  A,
10989
11103
  I,
10990
11104
  B,
@@ -10995,11 +11109,11 @@ async function ni(g, A, I, B, C) {
10995
11109
  throw Q;
10996
11110
  k.warn("ZarrWorker", "Falling back to main thread", Q);
10997
11111
  const E = await g.getChunk(I, C);
10998
- if (!KQ(E.data))
11112
+ if (!HQ(E.data))
10999
11113
  throw new Error(
11000
11114
  `Unsupported chunk data type: ${E.data.constructor.name}`
11001
11115
  );
11002
- return ii(
11116
+ return oi(
11003
11117
  E.data,
11004
11118
  E.shape,
11005
11119
  E.stride,
@@ -11007,19 +11121,19 @@ async function ni(g, A, I, B, C) {
11007
11121
  );
11008
11122
  }
11009
11123
  }
11010
- function Gi() {
11124
+ function wi() {
11011
11125
  for (const g of iA)
11012
11126
  g.worker.terminate();
11013
11127
  iA = [], RA.clear();
11014
11128
  }
11015
- class wi {
11129
+ class ri {
11016
11130
  metadata_;
11017
11131
  arrays_;
11018
11132
  arrayParams_;
11019
11133
  dimensions_;
11020
11134
  bytesPerElement_;
11021
11135
  constructor(A) {
11022
- this.metadata_ = A.metadata, this.arrays_ = A.arrays, this.arrayParams_ = A.arrayParams, this.dimensions_ = ri(this.metadata_, this.arrays_), this.bytesPerElement_ = Fi(this.arrays_[0].dtype);
11136
+ this.metadata_ = A.metadata, this.arrays_ = A.arrays, this.arrayParams_ = A.arrayParams, this.dimensions_ = Si(this.metadata_, this.arrays_), this.bytesPerElement_ = Fi(this.arrays_[0].dtype);
11023
11137
  }
11024
11138
  getSourceDimensionMap() {
11025
11139
  return this.dimensions_;
@@ -11053,18 +11167,18 @@ class wi {
11053
11167
  },
11054
11168
  cChunkSize: E?.chunkSize,
11055
11169
  tChunkSize: i?.chunkSize
11056
- }, a = await ni(
11170
+ }, a = await Gi(
11057
11171
  C,
11058
11172
  Q,
11059
11173
  B,
11060
11174
  o,
11061
11175
  { signal: I }
11062
11176
  ), s = a.BYTES_PER_ELEMENT;
11063
- if (!rQ(s))
11177
+ if (!FQ(s))
11064
11178
  throw new Error(
11065
11179
  "Invalid row alignment value. Possible values are 1, 2, 4, or 8"
11066
11180
  );
11067
- A.rowAlignmentBytes = s, dQ(A, a);
11181
+ A.rowAlignmentBytes = s, MQ(A, a);
11068
11182
  }
11069
11183
  }
11070
11184
  const HB = {
@@ -11084,25 +11198,25 @@ function Fi(g) {
11084
11198
  );
11085
11199
  return A;
11086
11200
  }
11087
- function ri(g, A) {
11088
- const I = g.axes.map((D) => D.name), B = g.axes.length, C = qB(I, "x"), Q = qB(I, "y"), E = (D, h) => {
11089
- const t = [];
11201
+ function Si(g, A) {
11202
+ const I = g.axes.map((D) => D.name), B = g.axes.length, C = qB(I, "x"), Q = qB(I, "y"), E = (D, t) => {
11203
+ const h = [];
11090
11204
  for (let e = 0; e < g.datasets.length; e++) {
11091
- const n = g.datasets[e], F = A[e], G = n.coordinateTransformations[0].scale, L = n.coordinateTransformations.length === 2 ? n.coordinateTransformations[1].translation : new Array(B).fill(0);
11092
- t.push({
11093
- size: F.shape[h],
11094
- chunkSize: F.chunks[h],
11095
- scale: G[h],
11096
- translation: L[h]
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);
11206
+ h.push({
11207
+ size: r.shape[t],
11208
+ chunkSize: r.chunks[t],
11209
+ scale: G[t],
11210
+ translation: L[t]
11097
11211
  });
11098
11212
  }
11099
- if (g.axes[h].type === "space" && Ri(t))
11100
- for (const e of t) e.translation -= 0.5 * e.scale;
11213
+ if (g.axes[t].type === "space" && ci(h))
11214
+ for (const e of h) e.translation -= 0.5 * e.scale;
11101
11215
  return {
11102
11216
  name: D,
11103
- index: h,
11104
- unit: g.axes[h].unit,
11105
- lods: t
11217
+ index: t,
11218
+ unit: g.axes[t].unit,
11219
+ lods: h
11106
11220
  };
11107
11221
  }, i = {
11108
11222
  x: E(I[C], C),
@@ -11115,7 +11229,7 @@ function ri(g, A) {
11115
11229
  const s = iI(I, "t");
11116
11230
  return s !== -1 && (i.t = E(I[s], s)), i;
11117
11231
  }
11118
- function Si(g, A) {
11232
+ function Ri(g, A) {
11119
11233
  return g.toLowerCase() === A.toLowerCase();
11120
11234
  }
11121
11235
  function qB(g, A) {
@@ -11127,9 +11241,9 @@ function qB(g, A) {
11127
11241
  return I;
11128
11242
  }
11129
11243
  function iI(g, A) {
11130
- return g.findIndex((I) => Si(I, A));
11244
+ return g.findIndex((I) => Ri(I, A));
11131
11245
  }
11132
- function Ri(g) {
11246
+ function ci(g) {
11133
11247
  if (g.length <= 1) return !1;
11134
11248
  for (let A = 1; A < g.length; A++) {
11135
11249
  const I = 0.5 * (g[A].scale - g[A - 1].scale), B = g[A].translation - g[A - 1].translation;
@@ -11242,7 +11356,7 @@ const R = f.arrayToEnum([
11242
11356
  "not_multiple_of",
11243
11357
  "not_finite"
11244
11358
  ]);
11245
- class tA extends Error {
11359
+ class hA extends Error {
11246
11360
  get errors() {
11247
11361
  return this.issues;
11248
11362
  }
@@ -11279,7 +11393,7 @@ class tA extends Error {
11279
11393
  return C(this), B;
11280
11394
  }
11281
11395
  static assert(A) {
11282
- if (!(A instanceof tA))
11396
+ if (!(A instanceof hA))
11283
11397
  throw new Error(`Not a ZodError: ${A}`);
11284
11398
  }
11285
11399
  toString() {
@@ -11305,7 +11419,7 @@ class tA extends Error {
11305
11419
  return this.flatten();
11306
11420
  }
11307
11421
  }
11308
- tA.create = (g) => new tA(g);
11422
+ hA.create = (g) => new hA(g);
11309
11423
  const og = (g, A) => {
11310
11424
  let I;
11311
11425
  switch (g.code) {
@@ -11362,11 +11476,11 @@ const og = (g, A) => {
11362
11476
  }
11363
11477
  return { message: I };
11364
11478
  };
11365
- let ci = og;
11366
- function Ni() {
11367
- return ci;
11479
+ let Ni = og;
11480
+ function Ui() {
11481
+ return Ni;
11368
11482
  }
11369
- const Ui = (g) => {
11483
+ const ki = (g) => {
11370
11484
  const { data: A, path: I, errorMaps: B, issueData: C } = g, Q = [...I, ...C.path || []], E = {
11371
11485
  ...C,
11372
11486
  path: Q
@@ -11388,7 +11502,7 @@ const Ui = (g) => {
11388
11502
  };
11389
11503
  };
11390
11504
  function w(g, A) {
11391
- const I = Ni(), B = Ui({
11505
+ const I = Ui(), B = ki({
11392
11506
  issueData: A,
11393
11507
  data: g.data,
11394
11508
  path: g.path,
@@ -11419,7 +11533,7 @@ class gA {
11419
11533
  const B = [];
11420
11534
  for (const C of I) {
11421
11535
  if (C.status === "aborted")
11422
- return Y;
11536
+ return d;
11423
11537
  C.status === "dirty" && A.dirty(), B.push(C.value);
11424
11538
  }
11425
11539
  return { status: A.value, value: B };
@@ -11440,13 +11554,13 @@ class gA {
11440
11554
  for (const C of I) {
11441
11555
  const { key: Q, value: E } = C;
11442
11556
  if (Q.status === "aborted" || E.status === "aborted")
11443
- return Y;
11557
+ return d;
11444
11558
  Q.status === "dirty" && A.dirty(), E.status === "dirty" && A.dirty(), Q.value !== "__proto__" && (typeof E.value < "u" || C.alwaysSet) && (B[Q.value] = E.value);
11445
11559
  }
11446
11560
  return { status: A.value, value: B };
11447
11561
  }
11448
11562
  }
11449
- const Y = Object.freeze({
11563
+ const d = Object.freeze({
11450
11564
  status: "aborted"
11451
11565
  }), 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;
11452
11566
  var c;
@@ -11471,7 +11585,7 @@ const uB = (g, A) => {
11471
11585
  get error() {
11472
11586
  if (this._error)
11473
11587
  return this._error;
11474
- const I = new tA(g.common.issues);
11588
+ const I = new hA(g.common.issues);
11475
11589
  return this._error = I, this._error;
11476
11590
  }
11477
11591
  };
@@ -11617,7 +11731,7 @@ class q {
11617
11731
  _refinement(A) {
11618
11732
  return new qA({
11619
11733
  schema: this,
11620
- typeName: d.ZodEffects,
11734
+ typeName: Y.ZodEffects,
11621
11735
  effect: { type: "refinement", refinement: A }
11622
11736
  });
11623
11737
  }
@@ -11656,22 +11770,22 @@ class q {
11656
11770
  return new qA({
11657
11771
  ...K(this._def),
11658
11772
  schema: this,
11659
- typeName: d.ZodEffects,
11773
+ typeName: Y.ZodEffects,
11660
11774
  effect: { type: "transform", transform: A }
11661
11775
  });
11662
11776
  }
11663
11777
  default(A) {
11664
11778
  const I = typeof A == "function" ? A : () => A;
11665
- return new tg({
11779
+ return new hg({
11666
11780
  ...K(this._def),
11667
11781
  innerType: this,
11668
11782
  defaultValue: I,
11669
- typeName: d.ZodDefault
11783
+ typeName: Y.ZodDefault
11670
11784
  });
11671
11785
  }
11672
11786
  brand() {
11673
- return new vi({
11674
- typeName: d.ZodBranded,
11787
+ return new Xi({
11788
+ typeName: Y.ZodBranded,
11675
11789
  type: this,
11676
11790
  ...K(this._def)
11677
11791
  });
@@ -11682,7 +11796,7 @@ class q {
11682
11796
  ...K(this._def),
11683
11797
  innerType: this,
11684
11798
  catchValue: I,
11685
- typeName: d.ZodCatch
11799
+ typeName: Y.ZodCatch
11686
11800
  });
11687
11801
  }
11688
11802
  describe(A) {
@@ -11705,28 +11819,28 @@ class q {
11705
11819
  return this.safeParse(null).success;
11706
11820
  }
11707
11821
  }
11708
- const ki = /^c[^\s-]{8,}$/i, Li = /^[0-9a-z]+$/, Ji = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Yi = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, di = /^[a-z0-9_-]{21}$/i, Mi = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Ki = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Hi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, qi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
11822
+ const Li = /^c[^\s-]{8,}$/i, Ji = /^[0-9a-z]+$/, di = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Yi = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Mi = /^[a-z0-9_-]{21}$/i, Ki = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Hi = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, qi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, li = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
11709
11823
  let VI;
11710
- const li = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, fi = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, pi = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, ui = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, mi = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Ti = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, NC = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", xi = new RegExp(`^${NC}$`);
11824
+ const fi = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, pi = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, ui = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, mi = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ti = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, xi = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, NC = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Wi = new RegExp(`^${NC}$`);
11711
11825
  function UC(g) {
11712
11826
  let A = "[0-5]\\d";
11713
11827
  g.precision ? A = `${A}\\.\\d{${g.precision}}` : g.precision == null && (A = `${A}(\\.\\d+)?`);
11714
11828
  const I = g.precision ? "+" : "?";
11715
11829
  return `([01]\\d|2[0-3]):[0-5]\\d(:${A})${I}`;
11716
11830
  }
11717
- function Wi(g) {
11831
+ function bi(g) {
11718
11832
  return new RegExp(`^${UC(g)}$`);
11719
11833
  }
11720
- function bi(g) {
11834
+ function Zi(g) {
11721
11835
  let A = `${NC}T${UC(g)}`;
11722
11836
  const I = [];
11723
11837
  return I.push(g.local ? "Z?" : "Z"), g.offset && I.push("([+-]\\d{2}:?\\d{2})"), A = `${A}(${I.join("|")})`, new RegExp(`^${A}$`);
11724
11838
  }
11725
- function Zi(g, A) {
11726
- return !!((A === "v4" || !A) && li.test(g) || (A === "v6" || !A) && pi.test(g));
11727
- }
11728
11839
  function Pi(g, A) {
11729
- if (!Mi.test(g))
11840
+ return !!((A === "v4" || !A) && fi.test(g) || (A === "v6" || !A) && ui.test(g));
11841
+ }
11842
+ function Oi(g, A) {
11843
+ if (!Ki.test(g))
11730
11844
  return !1;
11731
11845
  try {
11732
11846
  const [I] = g.split(".");
@@ -11738,8 +11852,8 @@ function Pi(g, A) {
11738
11852
  return !1;
11739
11853
  }
11740
11854
  }
11741
- function Oi(g, A) {
11742
- return !!((A === "v4" || !A) && fi.test(g) || (A === "v6" || !A) && ui.test(g));
11855
+ function Vi(g, A) {
11856
+ return !!((A === "v4" || !A) && pi.test(g) || (A === "v6" || !A) && mi.test(g));
11743
11857
  }
11744
11858
  class eA extends q {
11745
11859
  _parse(A) {
@@ -11749,7 +11863,7 @@ class eA extends q {
11749
11863
  code: y.invalid_type,
11750
11864
  expected: R.string,
11751
11865
  received: Q.parsedType
11752
- }), Y;
11866
+ }), d;
11753
11867
  }
11754
11868
  const B = new gA();
11755
11869
  let C;
@@ -11790,13 +11904,13 @@ class eA extends q {
11790
11904
  message: Q.message
11791
11905
  }), B.dirty());
11792
11906
  } else if (Q.kind === "email")
11793
- Hi.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11907
+ qi.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11794
11908
  validation: "email",
11795
11909
  code: y.invalid_string,
11796
11910
  message: Q.message
11797
11911
  }), B.dirty());
11798
11912
  else if (Q.kind === "emoji")
11799
- VI || (VI = new RegExp(qi, "u")), VI.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11913
+ VI || (VI = new RegExp(li, "u")), VI.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11800
11914
  validation: "emoji",
11801
11915
  code: y.invalid_string,
11802
11916
  message: Q.message
@@ -11808,25 +11922,25 @@ class eA extends q {
11808
11922
  message: Q.message
11809
11923
  }), B.dirty());
11810
11924
  else if (Q.kind === "nanoid")
11811
- di.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11925
+ Mi.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11812
11926
  validation: "nanoid",
11813
11927
  code: y.invalid_string,
11814
11928
  message: Q.message
11815
11929
  }), B.dirty());
11816
11930
  else if (Q.kind === "cuid")
11817
- ki.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11931
+ Li.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11818
11932
  validation: "cuid",
11819
11933
  code: y.invalid_string,
11820
11934
  message: Q.message
11821
11935
  }), B.dirty());
11822
11936
  else if (Q.kind === "cuid2")
11823
- Li.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11937
+ Ji.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11824
11938
  validation: "cuid2",
11825
11939
  code: y.invalid_string,
11826
11940
  message: Q.message
11827
11941
  }), B.dirty());
11828
11942
  else if (Q.kind === "ulid")
11829
- Ji.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11943
+ di.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11830
11944
  validation: "ulid",
11831
11945
  code: y.invalid_string,
11832
11946
  message: Q.message
@@ -11857,39 +11971,39 @@ class eA extends q {
11857
11971
  code: y.invalid_string,
11858
11972
  validation: { endsWith: Q.value },
11859
11973
  message: Q.message
11860
- }), B.dirty()) : Q.kind === "datetime" ? bi(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11974
+ }), B.dirty()) : Q.kind === "datetime" ? Zi(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11861
11975
  code: y.invalid_string,
11862
11976
  validation: "datetime",
11863
11977
  message: Q.message
11864
- }), B.dirty()) : Q.kind === "date" ? xi.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11978
+ }), B.dirty()) : Q.kind === "date" ? Wi.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11865
11979
  code: y.invalid_string,
11866
11980
  validation: "date",
11867
11981
  message: Q.message
11868
- }), B.dirty()) : Q.kind === "time" ? Wi(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11982
+ }), B.dirty()) : Q.kind === "time" ? bi(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11869
11983
  code: y.invalid_string,
11870
11984
  validation: "time",
11871
11985
  message: Q.message
11872
- }), B.dirty()) : Q.kind === "duration" ? Ki.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11986
+ }), B.dirty()) : Q.kind === "duration" ? Hi.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11873
11987
  validation: "duration",
11874
11988
  code: y.invalid_string,
11875
11989
  message: Q.message
11876
- }), B.dirty()) : Q.kind === "ip" ? Zi(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), w(C, {
11990
+ }), B.dirty()) : Q.kind === "ip" ? Pi(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), w(C, {
11877
11991
  validation: "ip",
11878
11992
  code: y.invalid_string,
11879
11993
  message: Q.message
11880
- }), B.dirty()) : Q.kind === "jwt" ? Pi(A.data, Q.alg) || (C = this._getOrReturnCtx(A, C), w(C, {
11994
+ }), B.dirty()) : Q.kind === "jwt" ? Oi(A.data, Q.alg) || (C = this._getOrReturnCtx(A, C), w(C, {
11881
11995
  validation: "jwt",
11882
11996
  code: y.invalid_string,
11883
11997
  message: Q.message
11884
- }), B.dirty()) : Q.kind === "cidr" ? Oi(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), w(C, {
11998
+ }), B.dirty()) : Q.kind === "cidr" ? Vi(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), w(C, {
11885
11999
  validation: "cidr",
11886
12000
  code: y.invalid_string,
11887
12001
  message: Q.message
11888
- }), B.dirty()) : Q.kind === "base64" ? mi.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
12002
+ }), B.dirty()) : Q.kind === "base64" ? Ti.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11889
12003
  validation: "base64",
11890
12004
  code: y.invalid_string,
11891
12005
  message: Q.message
11892
- }), B.dirty()) : Q.kind === "base64url" ? Ti.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
12006
+ }), B.dirty()) : Q.kind === "base64url" ? xi.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
11893
12007
  validation: "base64url",
11894
12008
  code: y.invalid_string,
11895
12009
  message: Q.message
@@ -12120,11 +12234,11 @@ class eA extends q {
12120
12234
  }
12121
12235
  eA.create = (g) => new eA({
12122
12236
  checks: [],
12123
- typeName: d.ZodString,
12237
+ typeName: Y.ZodString,
12124
12238
  coerce: g?.coerce ?? !1,
12125
12239
  ...K(g)
12126
12240
  });
12127
- function Vi(g, A) {
12241
+ function vi(g, A) {
12128
12242
  const I = (g.toString().split(".")[1] || "").length, B = (A.toString().split(".")[1] || "").length, C = I > B ? I : B, Q = Number.parseInt(g.toFixed(C).replace(".", "")), E = Number.parseInt(A.toFixed(C).replace(".", ""));
12129
12243
  return Q % E / 10 ** C;
12130
12244
  }
@@ -12139,7 +12253,7 @@ class KA extends q {
12139
12253
  code: y.invalid_type,
12140
12254
  expected: R.number,
12141
12255
  received: Q.parsedType
12142
- }), Y;
12256
+ }), d;
12143
12257
  }
12144
12258
  let B;
12145
12259
  const C = new gA();
@@ -12163,7 +12277,7 @@ class KA extends q {
12163
12277
  inclusive: Q.inclusive,
12164
12278
  exact: !1,
12165
12279
  message: Q.message
12166
- }), C.dirty()) : Q.kind === "multipleOf" ? Vi(A.data, Q.value) !== 0 && (B = this._getOrReturnCtx(A, B), w(B, {
12280
+ }), C.dirty()) : Q.kind === "multipleOf" ? vi(A.data, Q.value) !== 0 && (B = this._getOrReturnCtx(A, B), w(B, {
12167
12281
  code: y.not_multiple_of,
12168
12282
  multipleOf: Q.value,
12169
12283
  message: Q.message
@@ -12296,7 +12410,7 @@ class KA extends q {
12296
12410
  }
12297
12411
  KA.create = (g) => new KA({
12298
12412
  checks: [],
12299
- typeName: d.ZodNumber,
12413
+ typeName: Y.ZodNumber,
12300
12414
  coerce: g?.coerce || !1,
12301
12415
  ...K(g)
12302
12416
  });
@@ -12341,7 +12455,7 @@ class XA extends q {
12341
12455
  code: y.invalid_type,
12342
12456
  expected: R.bigint,
12343
12457
  received: I.parsedType
12344
- }), Y;
12458
+ }), d;
12345
12459
  }
12346
12460
  gte(A, I) {
12347
12461
  return this.setLimit("min", A, !0, c.toString(I));
@@ -12429,7 +12543,7 @@ class XA extends q {
12429
12543
  }
12430
12544
  XA.create = (g) => new XA({
12431
12545
  checks: [],
12432
- typeName: d.ZodBigInt,
12546
+ typeName: Y.ZodBigInt,
12433
12547
  coerce: g?.coerce ?? !1,
12434
12548
  ...K(g)
12435
12549
  });
@@ -12441,13 +12555,13 @@ class ag extends q {
12441
12555
  code: y.invalid_type,
12442
12556
  expected: R.boolean,
12443
12557
  received: B.parsedType
12444
- }), Y;
12558
+ }), d;
12445
12559
  }
12446
12560
  return QA(A.data);
12447
12561
  }
12448
12562
  }
12449
12563
  ag.create = (g) => new ag({
12450
- typeName: d.ZodBoolean,
12564
+ typeName: Y.ZodBoolean,
12451
12565
  coerce: g?.coerce || !1,
12452
12566
  ...K(g)
12453
12567
  });
@@ -12459,13 +12573,13 @@ class UI extends q {
12459
12573
  code: y.invalid_type,
12460
12574
  expected: R.date,
12461
12575
  received: Q.parsedType
12462
- }), Y;
12576
+ }), d;
12463
12577
  }
12464
12578
  if (Number.isNaN(A.data.getTime())) {
12465
12579
  const Q = this._getOrReturnCtx(A);
12466
12580
  return w(Q, {
12467
12581
  code: y.invalid_date
12468
- }), Y;
12582
+ }), d;
12469
12583
  }
12470
12584
  const B = new gA();
12471
12585
  let C;
@@ -12526,7 +12640,7 @@ class UI extends q {
12526
12640
  UI.create = (g) => new UI({
12527
12641
  checks: [],
12528
12642
  coerce: g?.coerce || !1,
12529
- typeName: d.ZodDate,
12643
+ typeName: Y.ZodDate,
12530
12644
  ...K(g)
12531
12645
  });
12532
12646
  class mB extends q {
@@ -12537,13 +12651,13 @@ class mB extends q {
12537
12651
  code: y.invalid_type,
12538
12652
  expected: R.symbol,
12539
12653
  received: B.parsedType
12540
- }), Y;
12654
+ }), d;
12541
12655
  }
12542
12656
  return QA(A.data);
12543
12657
  }
12544
12658
  }
12545
12659
  mB.create = (g) => new mB({
12546
- typeName: d.ZodSymbol,
12660
+ typeName: Y.ZodSymbol,
12547
12661
  ...K(g)
12548
12662
  });
12549
12663
  class TB extends q {
@@ -12554,13 +12668,13 @@ class TB extends q {
12554
12668
  code: y.invalid_type,
12555
12669
  expected: R.undefined,
12556
12670
  received: B.parsedType
12557
- }), Y;
12671
+ }), d;
12558
12672
  }
12559
12673
  return QA(A.data);
12560
12674
  }
12561
12675
  }
12562
12676
  TB.create = (g) => new TB({
12563
- typeName: d.ZodUndefined,
12677
+ typeName: Y.ZodUndefined,
12564
12678
  ...K(g)
12565
12679
  });
12566
12680
  class xB extends q {
@@ -12571,13 +12685,13 @@ class xB extends q {
12571
12685
  code: y.invalid_type,
12572
12686
  expected: R.null,
12573
12687
  received: B.parsedType
12574
- }), Y;
12688
+ }), d;
12575
12689
  }
12576
12690
  return QA(A.data);
12577
12691
  }
12578
12692
  }
12579
12693
  xB.create = (g) => new xB({
12580
- typeName: d.ZodNull,
12694
+ typeName: Y.ZodNull,
12581
12695
  ...K(g)
12582
12696
  });
12583
12697
  class sg extends q {
@@ -12589,7 +12703,7 @@ class sg extends q {
12589
12703
  }
12590
12704
  }
12591
12705
  sg.create = (g) => new sg({
12592
- typeName: d.ZodAny,
12706
+ typeName: Y.ZodAny,
12593
12707
  ...K(g)
12594
12708
  });
12595
12709
  class WB extends q {
@@ -12601,21 +12715,21 @@ class WB extends q {
12601
12715
  }
12602
12716
  }
12603
12717
  WB.create = (g) => new WB({
12604
- typeName: d.ZodUnknown,
12718
+ typeName: Y.ZodUnknown,
12605
12719
  ...K(g)
12606
12720
  });
12607
- class FA extends q {
12721
+ class rA extends q {
12608
12722
  _parse(A) {
12609
12723
  const I = this._getOrReturnCtx(A);
12610
12724
  return w(I, {
12611
12725
  code: y.invalid_type,
12612
12726
  expected: R.never,
12613
12727
  received: I.parsedType
12614
- }), Y;
12728
+ }), d;
12615
12729
  }
12616
12730
  }
12617
- FA.create = (g) => new FA({
12618
- typeName: d.ZodNever,
12731
+ rA.create = (g) => new rA({
12732
+ typeName: Y.ZodNever,
12619
12733
  ...K(g)
12620
12734
  });
12621
12735
  class bB extends q {
@@ -12626,13 +12740,13 @@ class bB extends q {
12626
12740
  code: y.invalid_type,
12627
12741
  expected: R.void,
12628
12742
  received: B.parsedType
12629
- }), Y;
12743
+ }), d;
12630
12744
  }
12631
12745
  return QA(A.data);
12632
12746
  }
12633
12747
  }
12634
12748
  bB.create = (g) => new bB({
12635
- typeName: d.ZodVoid,
12749
+ typeName: Y.ZodVoid,
12636
12750
  ...K(g)
12637
12751
  });
12638
12752
  class DA extends q {
@@ -12643,7 +12757,7 @@ class DA extends q {
12643
12757
  code: y.invalid_type,
12644
12758
  expected: R.array,
12645
12759
  received: I.parsedType
12646
- }), Y;
12760
+ }), d;
12647
12761
  if (C.exactLength !== null) {
12648
12762
  const E = I.data.length > C.exactLength.value, i = I.data.length < C.exactLength.value;
12649
12763
  (E || i) && (w(I, {
@@ -12705,7 +12819,7 @@ DA.create = (g, A) => new DA({
12705
12819
  minLength: null,
12706
12820
  maxLength: null,
12707
12821
  exactLength: null,
12708
- typeName: d.ZodArray,
12822
+ typeName: Y.ZodArray,
12709
12823
  ...K(A)
12710
12824
  });
12711
12825
  function kA(g) {
@@ -12741,10 +12855,10 @@ class V extends q {
12741
12855
  code: y.invalid_type,
12742
12856
  expected: R.object,
12743
12857
  received: a.parsedType
12744
- }), Y;
12858
+ }), d;
12745
12859
  }
12746
12860
  const { status: B, ctx: C } = this._processInputParams(A), { shape: Q, keys: E } = this._getCached(), i = [];
12747
- if (!(this._def.catchall instanceof FA && this._def.unknownKeys === "strip"))
12861
+ if (!(this._def.catchall instanceof rA && this._def.unknownKeys === "strip"))
12748
12862
  for (const a in C.data)
12749
12863
  E.includes(a) || i.push(a);
12750
12864
  const o = [];
@@ -12756,7 +12870,7 @@ class V extends q {
12756
12870
  alwaysSet: a in C.data
12757
12871
  });
12758
12872
  }
12759
- if (this._def.catchall instanceof FA) {
12873
+ if (this._def.catchall instanceof rA) {
12760
12874
  const a = this._def.unknownKeys;
12761
12875
  if (a === "passthrough")
12762
12876
  for (const s of i)
@@ -12787,10 +12901,10 @@ class V extends q {
12787
12901
  return C.common.async ? Promise.resolve().then(async () => {
12788
12902
  const a = [];
12789
12903
  for (const s of o) {
12790
- const D = await s.key, h = await s.value;
12904
+ const D = await s.key, t = await s.value;
12791
12905
  a.push({
12792
12906
  key: D,
12793
- value: h,
12907
+ value: t,
12794
12908
  alwaysSet: s.alwaysSet
12795
12909
  });
12796
12910
  }
@@ -12867,7 +12981,7 @@ class V extends q {
12867
12981
  ...this._def.shape(),
12868
12982
  ...A._def.shape()
12869
12983
  }),
12870
- typeName: d.ZodObject
12984
+ typeName: Y.ZodObject
12871
12985
  });
12872
12986
  }
12873
12987
  // merge<
@@ -12993,22 +13107,22 @@ class V extends q {
12993
13107
  V.create = (g, A) => new V({
12994
13108
  shape: () => g,
12995
13109
  unknownKeys: "strip",
12996
- catchall: FA.create(),
12997
- typeName: d.ZodObject,
13110
+ catchall: rA.create(),
13111
+ typeName: Y.ZodObject,
12998
13112
  ...K(A)
12999
13113
  });
13000
13114
  V.strictCreate = (g, A) => new V({
13001
13115
  shape: () => g,
13002
13116
  unknownKeys: "strict",
13003
- catchall: FA.create(),
13004
- typeName: d.ZodObject,
13117
+ catchall: rA.create(),
13118
+ typeName: Y.ZodObject,
13005
13119
  ...K(A)
13006
13120
  });
13007
13121
  V.lazycreate = (g, A) => new V({
13008
13122
  shape: g,
13009
13123
  unknownKeys: "strip",
13010
- catchall: FA.create(),
13011
- typeName: d.ZodObject,
13124
+ catchall: rA.create(),
13125
+ typeName: Y.ZodObject,
13012
13126
  ...K(A)
13013
13127
  });
13014
13128
  class kI extends q {
@@ -13021,11 +13135,11 @@ class kI extends q {
13021
13135
  for (const i of Q)
13022
13136
  if (i.result.status === "dirty")
13023
13137
  return I.common.issues.push(...i.ctx.common.issues), i.result;
13024
- const E = Q.map((i) => new tA(i.ctx.common.issues));
13138
+ const E = Q.map((i) => new hA(i.ctx.common.issues));
13025
13139
  return w(I, {
13026
13140
  code: y.invalid_union,
13027
13141
  unionErrors: E
13028
- }), Y;
13142
+ }), d;
13029
13143
  }
13030
13144
  if (I.common.async)
13031
13145
  return Promise.all(B.map(async (Q) => {
@@ -13068,11 +13182,11 @@ class kI extends q {
13068
13182
  }
13069
13183
  if (Q)
13070
13184
  return I.common.issues.push(...Q.ctx.common.issues), Q.result;
13071
- const i = E.map((o) => new tA(o));
13185
+ const i = E.map((o) => new hA(o));
13072
13186
  return w(I, {
13073
13187
  code: y.invalid_union,
13074
13188
  unionErrors: i
13075
- }), Y;
13189
+ }), d;
13076
13190
  }
13077
13191
  }
13078
13192
  get options() {
@@ -13081,7 +13195,7 @@ class kI extends q {
13081
13195
  }
13082
13196
  kI.create = (g, A) => new kI({
13083
13197
  options: g,
13084
- typeName: d.ZodUnion,
13198
+ typeName: Y.ZodUnion,
13085
13199
  ...K(A)
13086
13200
  });
13087
13201
  function Dg(g, A) {
@@ -13114,11 +13228,11 @@ class LI extends q {
13114
13228
  _parse(A) {
13115
13229
  const { status: I, ctx: B } = this._processInputParams(A), C = (Q, E) => {
13116
13230
  if (fB(Q) || fB(E))
13117
- return Y;
13231
+ return d;
13118
13232
  const i = Dg(Q.value, E.value);
13119
13233
  return i.valid ? ((pB(Q) || pB(E)) && I.dirty(), { status: I.value, value: i.data }) : (w(B, {
13120
13234
  code: y.invalid_intersection_types
13121
- }), Y);
13235
+ }), d);
13122
13236
  };
13123
13237
  return B.common.async ? Promise.all([
13124
13238
  this._def.left._parseAsync({
@@ -13145,7 +13259,7 @@ class LI extends q {
13145
13259
  LI.create = (g, A, I) => new LI({
13146
13260
  left: g,
13147
13261
  right: A,
13148
- typeName: d.ZodIntersection,
13262
+ typeName: Y.ZodIntersection,
13149
13263
  ...K(I)
13150
13264
  });
13151
13265
  class cA extends q {
@@ -13156,7 +13270,7 @@ class cA extends q {
13156
13270
  code: y.invalid_type,
13157
13271
  expected: R.array,
13158
13272
  received: B.parsedType
13159
- }), Y;
13273
+ }), d;
13160
13274
  if (B.data.length < this._def.items.length)
13161
13275
  return w(B, {
13162
13276
  code: y.too_small,
@@ -13164,7 +13278,7 @@ class cA extends q {
13164
13278
  inclusive: !0,
13165
13279
  exact: !1,
13166
13280
  type: "array"
13167
- }), Y;
13281
+ }), d;
13168
13282
  !this._def.rest && B.data.length > this._def.items.length && (w(B, {
13169
13283
  code: y.too_big,
13170
13284
  maximum: this._def.items.length,
@@ -13193,7 +13307,7 @@ cA.create = (g, A) => {
13193
13307
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
13194
13308
  return new cA({
13195
13309
  items: g,
13196
- typeName: d.ZodTuple,
13310
+ typeName: Y.ZodTuple,
13197
13311
  rest: null,
13198
13312
  ...K(A)
13199
13313
  });
@@ -13212,7 +13326,7 @@ class ZB extends q {
13212
13326
  code: y.invalid_type,
13213
13327
  expected: R.map,
13214
13328
  received: B.parsedType
13215
- }), Y;
13329
+ }), d;
13216
13330
  const C = this._def.keyType, Q = this._def.valueType, E = [...B.data.entries()].map(([i, o], a) => ({
13217
13331
  key: C._parse(new wA(B, i, B.path, [a, "key"])),
13218
13332
  value: Q._parse(new wA(B, o, B.path, [a, "value"]))
@@ -13223,7 +13337,7 @@ class ZB extends q {
13223
13337
  for (const o of E) {
13224
13338
  const a = await o.key, s = await o.value;
13225
13339
  if (a.status === "aborted" || s.status === "aborted")
13226
- return Y;
13340
+ return d;
13227
13341
  (a.status === "dirty" || s.status === "dirty") && I.dirty(), i.set(a.value, s.value);
13228
13342
  }
13229
13343
  return { status: I.value, value: i };
@@ -13233,7 +13347,7 @@ class ZB extends q {
13233
13347
  for (const o of E) {
13234
13348
  const a = o.key, s = o.value;
13235
13349
  if (a.status === "aborted" || s.status === "aborted")
13236
- return Y;
13350
+ return d;
13237
13351
  (a.status === "dirty" || s.status === "dirty") && I.dirty(), i.set(a.value, s.value);
13238
13352
  }
13239
13353
  return { status: I.value, value: i };
@@ -13243,7 +13357,7 @@ class ZB extends q {
13243
13357
  ZB.create = (g, A, I) => new ZB({
13244
13358
  valueType: A,
13245
13359
  keyType: g,
13246
- typeName: d.ZodMap,
13360
+ typeName: Y.ZodMap,
13247
13361
  ...K(I)
13248
13362
  });
13249
13363
  class jA extends q {
@@ -13254,7 +13368,7 @@ class jA extends q {
13254
13368
  code: y.invalid_type,
13255
13369
  expected: R.set,
13256
13370
  received: B.parsedType
13257
- }), Y;
13371
+ }), d;
13258
13372
  const C = this._def;
13259
13373
  C.minSize !== null && B.data.size < C.minSize.value && (w(B, {
13260
13374
  code: y.too_small,
@@ -13276,7 +13390,7 @@ class jA extends q {
13276
13390
  const a = /* @__PURE__ */ new Set();
13277
13391
  for (const s of o) {
13278
13392
  if (s.status === "aborted")
13279
- return Y;
13393
+ return d;
13280
13394
  s.status === "dirty" && I.dirty(), a.add(s.value);
13281
13395
  }
13282
13396
  return { status: I.value, value: a };
@@ -13307,7 +13421,7 @@ jA.create = (g, A) => new jA({
13307
13421
  valueType: g,
13308
13422
  minSize: null,
13309
13423
  maxSize: null,
13310
- typeName: d.ZodSet,
13424
+ typeName: Y.ZodSet,
13311
13425
  ...K(A)
13312
13426
  });
13313
13427
  class PB extends q {
@@ -13321,10 +13435,10 @@ class PB extends q {
13321
13435
  }
13322
13436
  PB.create = (g, A) => new PB({
13323
13437
  getter: g,
13324
- typeName: d.ZodLazy,
13438
+ typeName: Y.ZodLazy,
13325
13439
  ...K(A)
13326
13440
  });
13327
- class hg extends q {
13441
+ class tg extends q {
13328
13442
  _parse(A) {
13329
13443
  if (A.data !== this._def.value) {
13330
13444
  const I = this._getOrReturnCtx(A);
@@ -13332,7 +13446,7 @@ class hg extends q {
13332
13446
  received: I.data,
13333
13447
  code: y.invalid_literal,
13334
13448
  expected: this._def.value
13335
- }), Y;
13449
+ }), d;
13336
13450
  }
13337
13451
  return { status: "valid", value: A.data };
13338
13452
  }
@@ -13340,15 +13454,15 @@ class hg extends q {
13340
13454
  return this._def.value;
13341
13455
  }
13342
13456
  }
13343
- hg.create = (g, A) => new hg({
13457
+ tg.create = (g, A) => new tg({
13344
13458
  value: g,
13345
- typeName: d.ZodLiteral,
13459
+ typeName: Y.ZodLiteral,
13346
13460
  ...K(A)
13347
13461
  });
13348
13462
  function kC(g, A) {
13349
13463
  return new HA({
13350
13464
  values: g,
13351
- typeName: d.ZodEnum,
13465
+ typeName: Y.ZodEnum,
13352
13466
  ...K(A)
13353
13467
  });
13354
13468
  }
@@ -13360,7 +13474,7 @@ class HA extends q {
13360
13474
  expected: f.joinValues(B),
13361
13475
  received: I.parsedType,
13362
13476
  code: y.invalid_type
13363
- }), Y;
13477
+ }), d;
13364
13478
  }
13365
13479
  if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(A.data)) {
13366
13480
  const I = this._getOrReturnCtx(A), B = this._def.values;
@@ -13368,7 +13482,7 @@ class HA extends q {
13368
13482
  received: I.data,
13369
13483
  code: y.invalid_enum_value,
13370
13484
  options: B
13371
- }), Y;
13485
+ }), d;
13372
13486
  }
13373
13487
  return QA(A.data);
13374
13488
  }
@@ -13416,7 +13530,7 @@ class OB extends q {
13416
13530
  expected: f.joinValues(C),
13417
13531
  received: B.parsedType,
13418
13532
  code: y.invalid_type
13419
- }), Y;
13533
+ }), d;
13420
13534
  }
13421
13535
  if (this._cache || (this._cache = new Set(f.getValidEnumValues(this._def.values))), !this._cache.has(A.data)) {
13422
13536
  const C = f.objectValues(I);
@@ -13424,7 +13538,7 @@ class OB extends q {
13424
13538
  received: B.data,
13425
13539
  code: y.invalid_enum_value,
13426
13540
  options: C
13427
- }), Y;
13541
+ }), d;
13428
13542
  }
13429
13543
  return QA(A.data);
13430
13544
  }
@@ -13434,7 +13548,7 @@ class OB extends q {
13434
13548
  }
13435
13549
  OB.create = (g, A) => new OB({
13436
13550
  values: g,
13437
- typeName: d.ZodNativeEnum,
13551
+ typeName: Y.ZodNativeEnum,
13438
13552
  ...K(A)
13439
13553
  });
13440
13554
  class JI extends q {
@@ -13448,7 +13562,7 @@ class JI extends q {
13448
13562
  code: y.invalid_type,
13449
13563
  expected: R.promise,
13450
13564
  received: I.parsedType
13451
- }), Y;
13565
+ }), d;
13452
13566
  const B = I.parsedType === R.promise ? I.data : Promise.resolve(I.data);
13453
13567
  return QA(B.then((C) => this._def.type.parseAsync(C, {
13454
13568
  path: I.path,
@@ -13458,7 +13572,7 @@ class JI extends q {
13458
13572
  }
13459
13573
  JI.create = (g, A) => new JI({
13460
13574
  type: g,
13461
- typeName: d.ZodPromise,
13575
+ typeName: Y.ZodPromise,
13462
13576
  ...K(A)
13463
13577
  });
13464
13578
  class qA extends q {
@@ -13466,7 +13580,7 @@ class qA extends q {
13466
13580
  return this._def.schema;
13467
13581
  }
13468
13582
  sourceType() {
13469
- return this._def.schema._def.typeName === d.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
13583
+ return this._def.schema._def.typeName === Y.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
13470
13584
  }
13471
13585
  _parse(A) {
13472
13586
  const { status: I, ctx: B } = this._processInputParams(A), C = this._def.effect || null, Q = {
@@ -13482,23 +13596,23 @@ class qA extends q {
13482
13596
  if (B.common.async)
13483
13597
  return Promise.resolve(E).then(async (i) => {
13484
13598
  if (I.value === "aborted")
13485
- return Y;
13599
+ return d;
13486
13600
  const o = await this._def.schema._parseAsync({
13487
13601
  data: i,
13488
13602
  path: B.path,
13489
13603
  parent: B
13490
13604
  });
13491
- return o.status === "aborted" ? Y : o.status === "dirty" || I.value === "dirty" ? WA(o.value) : o;
13605
+ return o.status === "aborted" ? d : o.status === "dirty" || I.value === "dirty" ? WA(o.value) : o;
13492
13606
  });
13493
13607
  {
13494
13608
  if (I.value === "aborted")
13495
- return Y;
13609
+ return d;
13496
13610
  const i = this._def.schema._parseSync({
13497
13611
  data: E,
13498
13612
  path: B.path,
13499
13613
  parent: B
13500
13614
  });
13501
- return i.status === "aborted" ? Y : i.status === "dirty" || I.value === "dirty" ? WA(i.value) : i;
13615
+ return i.status === "aborted" ? d : i.status === "dirty" || I.value === "dirty" ? WA(i.value) : i;
13502
13616
  }
13503
13617
  }
13504
13618
  if (C.type === "refinement") {
@@ -13516,9 +13630,9 @@ class qA extends q {
13516
13630
  path: B.path,
13517
13631
  parent: B
13518
13632
  });
13519
- return i.status === "aborted" ? Y : (i.status === "dirty" && I.dirty(), E(i.value), { status: I.value, value: i.value });
13633
+ return i.status === "aborted" ? d : (i.status === "dirty" && I.dirty(), E(i.value), { status: I.value, value: i.value });
13520
13634
  } else
13521
- return this._def.schema._parseAsync({ data: B.data, path: B.path, parent: B }).then((i) => i.status === "aborted" ? Y : (i.status === "dirty" && I.dirty(), E(i.value).then(() => ({ status: I.value, value: i.value }))));
13635
+ return this._def.schema._parseAsync({ data: B.data, path: B.path, parent: B }).then((i) => i.status === "aborted" ? d : (i.status === "dirty" && I.dirty(), E(i.value).then(() => ({ status: I.value, value: i.value }))));
13522
13636
  }
13523
13637
  if (C.type === "transform")
13524
13638
  if (B.common.async === !1) {
@@ -13528,7 +13642,7 @@ class qA extends q {
13528
13642
  parent: B
13529
13643
  });
13530
13644
  if (!MA(E))
13531
- return Y;
13645
+ return d;
13532
13646
  const i = C.transform(E.value, Q);
13533
13647
  if (i instanceof Promise)
13534
13648
  throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
@@ -13537,20 +13651,20 @@ class qA extends q {
13537
13651
  return this._def.schema._parseAsync({ data: B.data, path: B.path, parent: B }).then((E) => MA(E) ? Promise.resolve(C.transform(E.value, Q)).then((i) => ({
13538
13652
  status: I.value,
13539
13653
  value: i
13540
- })) : Y);
13654
+ })) : d);
13541
13655
  f.assertNever(C);
13542
13656
  }
13543
13657
  }
13544
13658
  qA.create = (g, A, I) => new qA({
13545
13659
  schema: g,
13546
- typeName: d.ZodEffects,
13660
+ typeName: Y.ZodEffects,
13547
13661
  effect: A,
13548
13662
  ...K(I)
13549
13663
  });
13550
13664
  qA.createWithPreprocess = (g, A, I) => new qA({
13551
13665
  schema: A,
13552
13666
  effect: { type: "preprocess", transform: g },
13553
- typeName: d.ZodEffects,
13667
+ typeName: Y.ZodEffects,
13554
13668
  ...K(I)
13555
13669
  });
13556
13670
  class GA extends q {
@@ -13563,7 +13677,7 @@ class GA extends q {
13563
13677
  }
13564
13678
  GA.create = (g, A) => new GA({
13565
13679
  innerType: g,
13566
- typeName: d.ZodOptional,
13680
+ typeName: Y.ZodOptional,
13567
13681
  ...K(A)
13568
13682
  });
13569
13683
  class lA extends q {
@@ -13576,10 +13690,10 @@ class lA extends q {
13576
13690
  }
13577
13691
  lA.create = (g, A) => new lA({
13578
13692
  innerType: g,
13579
- typeName: d.ZodNullable,
13693
+ typeName: Y.ZodNullable,
13580
13694
  ...K(A)
13581
13695
  });
13582
- class tg extends q {
13696
+ class hg extends q {
13583
13697
  _parse(A) {
13584
13698
  const { ctx: I } = this._processInputParams(A);
13585
13699
  let B = I.data;
@@ -13593,9 +13707,9 @@ class tg extends q {
13593
13707
  return this._def.innerType;
13594
13708
  }
13595
13709
  }
13596
- tg.create = (g, A) => new tg({
13710
+ hg.create = (g, A) => new hg({
13597
13711
  innerType: g,
13598
- typeName: d.ZodDefault,
13712
+ typeName: Y.ZodDefault,
13599
13713
  defaultValue: typeof A.default == "function" ? A.default : () => A.default,
13600
13714
  ...K(A)
13601
13715
  });
@@ -13618,7 +13732,7 @@ class yg extends q {
13618
13732
  status: "valid",
13619
13733
  value: Q.status === "valid" ? Q.value : this._def.catchValue({
13620
13734
  get error() {
13621
- return new tA(B.common.issues);
13735
+ return new hA(B.common.issues);
13622
13736
  },
13623
13737
  input: B.data
13624
13738
  })
@@ -13626,7 +13740,7 @@ class yg extends q {
13626
13740
  status: "valid",
13627
13741
  value: C.status === "valid" ? C.value : this._def.catchValue({
13628
13742
  get error() {
13629
- return new tA(B.common.issues);
13743
+ return new hA(B.common.issues);
13630
13744
  },
13631
13745
  input: B.data
13632
13746
  })
@@ -13638,7 +13752,7 @@ class yg extends q {
13638
13752
  }
13639
13753
  yg.create = (g, A) => new yg({
13640
13754
  innerType: g,
13641
- typeName: d.ZodCatch,
13755
+ typeName: Y.ZodCatch,
13642
13756
  catchValue: typeof A.catch == "function" ? A.catch : () => A.catch,
13643
13757
  ...K(A)
13644
13758
  });
@@ -13650,16 +13764,16 @@ class VB extends q {
13650
13764
  code: y.invalid_type,
13651
13765
  expected: R.nan,
13652
13766
  received: B.parsedType
13653
- }), Y;
13767
+ }), d;
13654
13768
  }
13655
13769
  return { status: "valid", value: A.data };
13656
13770
  }
13657
13771
  }
13658
13772
  VB.create = (g) => new VB({
13659
- typeName: d.ZodNaN,
13773
+ typeName: Y.ZodNaN,
13660
13774
  ...K(g)
13661
13775
  });
13662
- class vi extends q {
13776
+ class Xi extends q {
13663
13777
  _parse(A) {
13664
13778
  const { ctx: I } = this._processInputParams(A), B = I.data;
13665
13779
  return this._def.type._parse({
@@ -13682,7 +13796,7 @@ class bg extends q {
13682
13796
  path: B.path,
13683
13797
  parent: B
13684
13798
  });
13685
- return Q.status === "aborted" ? Y : Q.status === "dirty" ? (I.dirty(), WA(Q.value)) : this._def.out._parseAsync({
13799
+ return Q.status === "aborted" ? d : Q.status === "dirty" ? (I.dirty(), WA(Q.value)) : this._def.out._parseAsync({
13686
13800
  data: Q.value,
13687
13801
  path: B.path,
13688
13802
  parent: B
@@ -13694,7 +13808,7 @@ class bg extends q {
13694
13808
  path: B.path,
13695
13809
  parent: B
13696
13810
  });
13697
- return C.status === "aborted" ? Y : C.status === "dirty" ? (I.dirty(), {
13811
+ return C.status === "aborted" ? d : C.status === "dirty" ? (I.dirty(), {
13698
13812
  status: "dirty",
13699
13813
  value: C.value
13700
13814
  }) : this._def.out._parseSync({
@@ -13708,7 +13822,7 @@ class bg extends q {
13708
13822
  return new bg({
13709
13823
  in: A,
13710
13824
  out: I,
13711
- typeName: d.ZodPipeline
13825
+ typeName: Y.ZodPipeline
13712
13826
  });
13713
13827
  }
13714
13828
  }
@@ -13723,24 +13837,24 @@ class eg extends q {
13723
13837
  }
13724
13838
  eg.create = (g, A) => new eg({
13725
13839
  innerType: g,
13726
- typeName: d.ZodReadonly,
13840
+ typeName: Y.ZodReadonly,
13727
13841
  ...K(A)
13728
13842
  });
13729
- var d;
13843
+ var Y;
13730
13844
  (function(g) {
13731
13845
  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";
13732
- })(d || (d = {}));
13846
+ })(Y || (Y = {}));
13733
13847
  const u = eA.create, H = KA.create, LC = ag.create, nA = sg.create;
13734
- FA.create;
13848
+ rA.create;
13735
13849
  const p = DA.create, J = V.create;
13736
13850
  kI.create;
13737
13851
  LI.create;
13738
13852
  cA.create;
13739
- const $ = hg.create, LA = HA.create;
13853
+ const $ = tg.create, LA = HA.create;
13740
13854
  JI.create;
13741
13855
  GA.create;
13742
13856
  lA.create;
13743
- const Xi = J({
13857
+ const ji = J({
13744
13858
  /**The multiscale datasets for this image*/
13745
13859
  multiscales: p(
13746
13860
  J({
@@ -13868,7 +13982,7 @@ const Xi = J({
13868
13982
  projection: u().optional()
13869
13983
  }).optional()
13870
13984
  }).optional()
13871
- }).describe("JSON from OME-NGFF .zattrs"), ji = J({
13985
+ }).describe("JSON from OME-NGFF .zattrs"), zi = J({
13872
13986
  plate: J({
13873
13987
  /**The acquisitions for this plate*/
13874
13988
  acquisitions: p(
@@ -13927,7 +14041,7 @@ const Xi = J({
13927
14041
  })
13928
14042
  ).min(1).describe("The wells of the plate")
13929
14043
  }).optional()
13930
- }).describe("JSON from OME-NGFF .zattrs"), zi = J({
14044
+ }).describe("JSON from OME-NGFF .zattrs"), _i = J({
13931
14045
  well: J({
13932
14046
  /**The fields of view for this well*/
13933
14047
  images: p(
@@ -13941,7 +14055,7 @@ const Xi = J({
13941
14055
  /**The version of the specification*/
13942
14056
  version: $("0.4").describe("The version of the specification").optional()
13943
14057
  }).optional()
13944
- }).describe("JSON from OME-NGFF .zattrs"), _i = J({
14058
+ }).describe("JSON from OME-NGFF .zattrs"), $i = J({
13945
14059
  /**The versioned OME-Zarr Metadata namespace*/
13946
14060
  ome: J({
13947
14061
  /**The multiscale datasets for this image*/
@@ -14071,7 +14185,7 @@ const Xi = J({
14071
14185
  /**The version of the OME-Zarr Metadata*/
14072
14186
  version: $("0.5").describe("The version of the OME-Zarr Metadata")
14073
14187
  }).describe("The versioned OME-Zarr Metadata namespace")
14074
- }).describe("The zarr.json attributes key"), $i = J({
14188
+ }).describe("The zarr.json attributes key"), Ao = J({
14075
14189
  /**The versioned OME-Zarr Metadata namespace*/
14076
14190
  ome: J({
14077
14191
  plate: J({
@@ -14133,7 +14247,7 @@ const Xi = J({
14133
14247
  /**The version of the OME-Zarr Metadata*/
14134
14248
  version: $("0.5").describe("The version of the OME-Zarr Metadata")
14135
14249
  }).describe("The versioned OME-Zarr Metadata namespace")
14136
- }).describe("The zarr.json attributes key"), Ao = J({
14250
+ }).describe("The zarr.json attributes key"), Io = J({
14137
14251
  /**The versioned OME-Zarr Metadata namespace*/
14138
14252
  ome: J({
14139
14253
  well: J({
@@ -14152,15 +14266,15 @@ const Xi = J({
14152
14266
  /**The version of the OME-Zarr Metadata*/
14153
14267
  version: $("0.5").describe("The version of the OME-Zarr Metadata")
14154
14268
  }).describe("The versioned OME-Zarr Metadata namespace")
14155
- }).describe("JSON from OME-Zarr zarr.json"), Io = ["0.4", "0.5"], go = new Set(Io);
14156
- function Bo(g) {
14269
+ }).describe("JSON from OME-Zarr zarr.json"), go = ["0.4", "0.5"], Bo = new Set(go);
14270
+ function Co(g) {
14157
14271
  if (!("ome" in g) || !(g.ome instanceof Object)) return;
14158
14272
  const A = g.ome;
14159
- if ("version" in A && typeof A.version == "string" && go.has(A.version))
14273
+ if ("version" in A && typeof A.version == "string" && Bo.has(A.version))
14160
14274
  return A.version;
14161
14275
  }
14162
14276
  function Zg(g) {
14163
- const A = Bo(g);
14277
+ const A = Co(g);
14164
14278
  return A === void 0 ? "0.4" : A;
14165
14279
  }
14166
14280
  function fA(g) {
@@ -14176,10 +14290,10 @@ function JC(g, A) {
14176
14290
  const I = { ...g };
14177
14291
  return delete I[A], I;
14178
14292
  }
14179
- async function Ko(g, A) {
14293
+ async function Ho(g, A) {
14180
14294
  const I = new _A(g), B = new CA(I), C = fA(A), Q = await gI(B, C);
14181
14295
  try {
14182
- return Co(Q.attrs);
14296
+ return Qo(Q.attrs);
14183
14297
  } catch {
14184
14298
  throw Error(
14185
14299
  `Failed to parse OME-Zarr plate:
@@ -14187,21 +14301,21 @@ ${JSON.stringify(Q.attrs)}`
14187
14301
  );
14188
14302
  }
14189
14303
  }
14190
- function Co(g) {
14304
+ function Qo(g) {
14191
14305
  switch (Zg(g)) {
14192
14306
  case "0.5":
14193
14307
  return {
14194
- ...$i.parse(g).ome,
14308
+ ...Ao.parse(g).ome,
14195
14309
  originalVersion: "0.5"
14196
14310
  };
14197
14311
  case "0.4":
14198
14312
  return {
14199
- ...Qo(ji.parse(g)).ome,
14313
+ ...Eo(zi.parse(g)).ome,
14200
14314
  originalVersion: "0.4"
14201
14315
  };
14202
14316
  }
14203
14317
  }
14204
- function Qo(g) {
14318
+ function Eo(g) {
14205
14319
  if (g.plate === void 0)
14206
14320
  throw new Error("Plate metadata is missing in OME-Zarr v0.4 plate");
14207
14321
  return {
@@ -14211,7 +14325,7 @@ function Qo(g) {
14211
14325
  }
14212
14326
  };
14213
14327
  }
14214
- function Eo(g) {
14328
+ function io(g) {
14215
14329
  if (g.well === void 0)
14216
14330
  throw new Error("Well metadata is missing in OME-Zarr v0.4 well");
14217
14331
  return {
@@ -14221,24 +14335,24 @@ function Eo(g) {
14221
14335
  }
14222
14336
  };
14223
14337
  }
14224
- function io(g) {
14338
+ function oo(g) {
14225
14339
  switch (Zg(g)) {
14226
14340
  case "0.5":
14227
14341
  return {
14228
- ...Ao.parse(g).ome,
14342
+ ...Io.parse(g).ome,
14229
14343
  originalVersion: "0.5"
14230
14344
  };
14231
14345
  case "0.4":
14232
14346
  return {
14233
- ...Eo(zi.parse(g)).ome,
14347
+ ...io(_i.parse(g)).ome,
14234
14348
  originalVersion: "0.4"
14235
14349
  };
14236
14350
  }
14237
14351
  }
14238
- async function Ho(g, A, I) {
14352
+ async function qo(g, A, I) {
14239
14353
  const B = g + "/" + A, C = new _A(B), Q = new CA(C), E = fA(I), i = await gI(Q, E);
14240
14354
  try {
14241
- return io(i.attrs);
14355
+ return oo(i.attrs);
14242
14356
  } catch {
14243
14357
  throw Error(
14244
14358
  `Failed to parse OME-Zarr well:
@@ -14246,15 +14360,15 @@ ${JSON.stringify(i.attrs)}`
14246
14360
  );
14247
14361
  }
14248
14362
  }
14249
- async function qo(g) {
14363
+ async function lo(g) {
14250
14364
  const A = fA(g.version), I = await gI(g.location, A);
14251
14365
  return Pg(I.attrs).omero?.channels ?? [];
14252
14366
  }
14253
- async function lo(g) {
14367
+ async function fo(g) {
14254
14368
  const A = fA(g.version), I = await gI(g.location, A);
14255
14369
  return Pg(I.attrs).omero?.rdefs;
14256
14370
  }
14257
- function oo(g) {
14371
+ function ao(g) {
14258
14372
  return {
14259
14373
  ome: {
14260
14374
  multiscales: g.multiscales,
@@ -14263,23 +14377,23 @@ function oo(g) {
14263
14377
  }
14264
14378
  };
14265
14379
  }
14266
- function ao(g) {
14380
+ function so(g) {
14267
14381
  switch (Zg(g)) {
14268
14382
  case "0.5":
14269
14383
  return {
14270
- ..._i.parse(g).ome,
14384
+ ...$i.parse(g).ome,
14271
14385
  originalVersion: "0.5"
14272
14386
  };
14273
14387
  case "0.4":
14274
14388
  return {
14275
- ...oo(Xi.parse(g)).ome,
14389
+ ...ao(ji.parse(g)).ome,
14276
14390
  originalVersion: "0.4"
14277
14391
  };
14278
14392
  }
14279
14393
  }
14280
14394
  function Pg(g) {
14281
14395
  try {
14282
- return ao(g);
14396
+ return so(g);
14283
14397
  } catch {
14284
14398
  throw Error(`Failed to parse OME-Zarr image:
14285
14399
  ${JSON.stringify(g)}`);
@@ -14306,15 +14420,15 @@ class bA {
14306
14420
  throw new Error("No datasets found in the multiscale image.");
14307
14421
  B || (B = fA(Q.originalVersion));
14308
14422
  const o = i.datasets.map(
14309
- (h) => Ei(A, h.path, B)
14423
+ (t) => ii(A, t.path, B)
14310
14424
  ), a = await Promise.all(
14311
- o.map((h) => Qi(h))
14425
+ o.map((t) => Ei(t))
14312
14426
  ), s = a[0].shape, D = i.axes;
14313
14427
  if (D.length !== s.length)
14314
14428
  throw new Error(
14315
14429
  `Mismatch between number of axes (${D.length}) and array shape (${s.length})`
14316
14430
  );
14317
- return new wi({ metadata: i, arrays: a, arrayParams: o });
14431
+ return new ri({ metadata: i, arrays: a, arrayParams: o });
14318
14432
  }
14319
14433
  /**
14320
14434
  * Returns per-axis dimension metadata for the image.
@@ -14364,7 +14478,7 @@ class bA {
14364
14478
  return new bA({ location: I, version: A.version, loader: B });
14365
14479
  }
14366
14480
  }
14367
- class so extends pA {
14481
+ class Do extends pA {
14368
14482
  // this creates the geometry for a screen-space projected line
14369
14483
  // each point on the input path is split into two vertices
14370
14484
  // these are pushed in opposite directions in screen-space to create width
@@ -14392,7 +14506,7 @@ class so extends pA {
14392
14506
  });
14393
14507
  }
14394
14508
  createVertices(A) {
14395
- const I = new Float32Array(2 * A.length * 10), B = A.length >= 3 && Fg(A[0], A[A.length - 1]);
14509
+ const I = new Float32Array(2 * A.length * 10), B = A.length >= 3 && rg(A[0], A[A.length - 1]);
14396
14510
  let C = 0;
14397
14511
  for (const Q of [...Array(A.length).keys()])
14398
14512
  for (const E of [-1, 1]) {
@@ -14413,7 +14527,7 @@ class so extends pA {
14413
14527
  return I;
14414
14528
  }
14415
14529
  }
14416
- class Do extends zA {
14530
+ class to extends zA {
14417
14531
  color_;
14418
14532
  width_;
14419
14533
  /**
@@ -14452,7 +14566,7 @@ class Do extends zA {
14452
14566
  };
14453
14567
  }
14454
14568
  }
14455
- class fo extends KI {
14569
+ class po extends KI {
14456
14570
  /** Identifies the layer type as `AxesLayer`. */
14457
14571
  type = "AxesLayer";
14458
14572
  /**
@@ -14489,8 +14603,8 @@ class fo extends KI {
14489
14603
  }
14490
14604
  }
14491
14605
  function vI(g) {
14492
- const { end: A, width: I, color: B } = g, C = new so([[0, 0, 0], A]);
14493
- return new Do({
14606
+ const { end: A, width: I, color: B } = g, C = new Do([[0, 0, 0], A]);
14607
+ return new to({
14494
14608
  geometry: C,
14495
14609
  color: B,
14496
14610
  width: I
@@ -14516,12 +14630,12 @@ class ho extends Rg {
14516
14630
  return this.depth_;
14517
14631
  }
14518
14632
  }
14519
- const YC = {
14633
+ const dC = {
14520
14634
  circle: 0,
14521
14635
  square: 1,
14522
14636
  triangle: 2
14523
14637
  };
14524
- class po extends zA {
14638
+ class uo extends zA {
14525
14639
  /**
14526
14640
  * Creates a renderable drawing one marker per entry.
14527
14641
  *
@@ -14540,7 +14654,7 @@ class po extends zA {
14540
14654
  Q.b,
14541
14655
  Q.a,
14542
14656
  C.size,
14543
- YC[C.marker]
14657
+ dC[C.marker]
14544
14658
  ];
14545
14659
  }), B = new pA(I, [], "points");
14546
14660
  B.addAttribute({
@@ -14559,7 +14673,7 @@ class po extends zA {
14559
14673
  type: "marker",
14560
14674
  itemSize: 1,
14561
14675
  offset: B.strideBytes
14562
- }), this.geometry = B, this.setTexture(0, to());
14676
+ }), this.geometry = B, this.setTexture(0, yo());
14563
14677
  }
14564
14678
  /** Identifies the renderable type as `PointsRenderable`. */
14565
14679
  get type() {
@@ -14567,24 +14681,24 @@ class po extends zA {
14567
14681
  }
14568
14682
  }
14569
14683
  let XI;
14570
- function to() {
14571
- return XI || (XI = yo()), XI;
14572
- }
14573
14684
  function yo() {
14685
+ return XI || (XI = eo()), XI;
14686
+ }
14687
+ function eo() {
14574
14688
  const g = (a) => {
14575
14689
  const s = new Float32Array(a * a);
14576
14690
  return s.fill(1), s;
14577
14691
  }, A = (a) => {
14578
14692
  const s = new Float32Array(a * a);
14579
14693
  for (let D = 0; D < a; D++)
14580
- for (let h = 0; h < a; h++)
14581
- (D - a / 2) ** 2 + (h - a / 2) ** 2 < (a / 2) ** 2 && (s[D * a + h] = 1);
14694
+ for (let t = 0; t < a; t++)
14695
+ (D - a / 2) ** 2 + (t - a / 2) ** 2 < (a / 2) ** 2 && (s[D * a + t] = 1);
14582
14696
  return s;
14583
14697
  }, I = (a) => {
14584
14698
  const s = new Float32Array(a * a);
14585
14699
  for (let D = 0; D < a; D++)
14586
- for (let h = 0; h < a; h++)
14587
- h >= (a - D) / 2 && h <= (a + D) / 2 && (s[D * a + h] = 1);
14700
+ for (let t = 0; t < a; t++)
14701
+ t >= (a - D) / 2 && t <= (a + D) / 2 && (s[D * a + t] = 1);
14588
14702
  return s;
14589
14703
  }, Q = {
14590
14704
  circle: A(256),
@@ -14592,11 +14706,11 @@ function yo() {
14592
14706
  triangle: I(256)
14593
14707
  }, E = Object.keys(Q).length, i = new Float32Array(E * 65536);
14594
14708
  for (const [a, s] of Object.entries(Q))
14595
- i.set(s, YC[a] * 65536);
14709
+ i.set(s, dC[a] * 65536);
14596
14710
  const o = new ho(i, 256, 256);
14597
14711
  return o.wrapR = "clamp_to_edge", o.wrapS = "clamp_to_edge", o.wrapT = "clamp_to_edge", o;
14598
14712
  }
14599
- class eo {
14713
+ class no {
14600
14714
  planes_;
14601
14715
  /**
14602
14716
  * Creates a frustum from a view-projection matrix.
@@ -14623,22 +14737,22 @@ class eo {
14623
14737
  setWithViewProjection(A) {
14624
14738
  const I = M();
14625
14739
  this.planes_[0].set(
14626
- rA(I, A[3] + A[0], A[7] + A[4], A[11] + A[8]),
14740
+ FA(I, A[3] + A[0], A[7] + A[4], A[11] + A[8]),
14627
14741
  A[15] + A[12]
14628
14742
  ), this.planes_[1].set(
14629
- rA(I, A[3] - A[0], A[7] - A[4], A[11] - A[8]),
14743
+ FA(I, A[3] - A[0], A[7] - A[4], A[11] - A[8]),
14630
14744
  A[15] - A[12]
14631
14745
  ), this.planes_[2].set(
14632
- rA(I, A[3] - A[1], A[7] - A[5], A[11] - A[9]),
14746
+ FA(I, A[3] - A[1], A[7] - A[5], A[11] - A[9]),
14633
14747
  A[15] - A[13]
14634
14748
  ), this.planes_[3].set(
14635
- rA(I, A[3] + A[1], A[7] + A[5], A[11] + A[9]),
14749
+ FA(I, A[3] + A[1], A[7] + A[5], A[11] + A[9]),
14636
14750
  A[15] + A[13]
14637
14751
  ), this.planes_[4].set(
14638
- rA(I, A[3] + A[2], A[7] + A[6], A[11] + A[10]),
14752
+ FA(I, A[3] + A[2], A[7] + A[6], A[11] + A[10]),
14639
14753
  A[15] + A[14]
14640
14754
  ), this.planes_[5].set(
14641
- rA(I, A[3] - A[2], A[7] - A[6], A[11] - A[10]),
14755
+ FA(I, A[3] - A[2], A[7] - A[6], A[11] - A[10]),
14642
14756
  A[15] - A[14]
14643
14757
  );
14644
14758
  for (const B of this.planes_) B.normalize();
@@ -14660,7 +14774,7 @@ class eo {
14660
14774
  return !0;
14661
14775
  }
14662
14776
  }
14663
- class dC extends YI {
14777
+ class YC extends dI {
14664
14778
  transform_ = new sC();
14665
14779
  /** @hidden */
14666
14780
  projectionMatrix_ = _();
@@ -14704,7 +14818,7 @@ class dC extends YI {
14704
14818
  }
14705
14819
  /** The view frustum derived from the current view-projection. */
14706
14820
  get frustum() {
14707
- return new eo(this.getViewProjection());
14821
+ return new no(this.getViewProjection());
14708
14822
  }
14709
14823
  /**
14710
14824
  * Moves the camera by the given world-space offset.
@@ -14758,8 +14872,8 @@ class vB {
14758
14872
  );
14759
14873
  }
14760
14874
  }
14761
- const jI = -1, XB = 0, no = 1, jB = 9e-3, Go = 1e-3, wo = 9e-4, Fo = 0.5, ro = 60;
14762
- class uo {
14875
+ const jI = -1, XB = 0, Go = 1, jB = 9e-3, wo = 1e-3, ro = 9e-4, Fo = 0.5, So = 60;
14876
+ class mo {
14763
14877
  camera_;
14764
14878
  orbitVelocity_ = new vB(0, 0, 0);
14765
14879
  panVelocity_ = M();
@@ -14779,7 +14893,7 @@ class uo {
14779
14893
  I?.radius ?? 1,
14780
14894
  I?.yaw ?? 0,
14781
14895
  I?.pitch ?? 0
14782
- ), I?.target && _I(this.currCenter_, I.target), this.dampingFactor_ = hA(
14896
+ ), I?.target && _I(this.currCenter_, I.target), this.dampingFactor_ = tA(
14783
14897
  I?.dampingFactor ?? Fo,
14784
14898
  0,
14785
14899
  1
@@ -14835,12 +14949,12 @@ class uo {
14835
14949
  * @param dt - Time since the last frame in seconds.
14836
14950
  */
14837
14951
  onUpdate(A) {
14838
- if (this.orbitVelocity_.phi === 0 && this.orbitVelocity_.theta === 0 && this.orbitVelocity_.radius === 0 && Fg(this.panVelocity_, x(0, 0, 0)))
14952
+ if (this.orbitVelocity_.phi === 0 && this.orbitVelocity_.theta === 0 && this.orbitVelocity_.radius === 0 && rg(this.panVelocity_, x(0, 0, 0)))
14839
14953
  return;
14840
14954
  this.currPos_.phi += this.orbitVelocity_.phi, this.currPos_.theta += this.orbitVelocity_.theta, this.currPos_.radius += this.orbitVelocity_.radius * this.currPos_.radius, aI(this.currCenter_, this.currCenter_, this.panVelocity_);
14841
14955
  const I = Math.PI / 2 - m;
14842
- this.currPos_.theta = hA(this.currPos_.theta, -I, I), this.currPos_.radius = Math.max(0.01, this.currPos_.radius), this.updateCamera();
14843
- const B = Math.pow(1 - this.dampingFactor_, A * ro);
14956
+ this.currPos_.theta = tA(this.currPos_.theta, -I, I), this.currPos_.radius = Math.max(0.01, this.currPos_.radius), this.updateCamera();
14957
+ const B = Math.pow(1 - this.dampingFactor_, A * So);
14844
14958
  this.orbitVelocity_.phi *= B, this.orbitVelocity_.theta *= B, this.orbitVelocity_.radius *= B, $I(this.panVelocity_, this.panVelocity_, B), this.cutoffLowVelocity();
14845
14959
  }
14846
14960
  onPointerDown(A) {
@@ -14849,7 +14963,7 @@ class uo {
14849
14963
  }
14850
14964
  onPointerMove(A) {
14851
14965
  if (this.currMouseButton_ == jI) return;
14852
- const I = A.event, B = I.movementX ?? 0, C = I.movementY ?? 0, Q = this.currMouseButton_ === XB && !I.shiftKey, E = this.currMouseButton_ === XB && I.shiftKey || this.currMouseButton_ === no;
14966
+ const I = A.event, B = I.movementX ?? 0, C = I.movementY ?? 0, Q = this.currMouseButton_ === XB && !I.shiftKey, E = this.currMouseButton_ === XB && I.shiftKey || this.currMouseButton_ === Go;
14853
14967
  Q && this.orbit(B, C), E && this.pan(B, C);
14854
14968
  }
14855
14969
  onWheel(A) {
@@ -14868,11 +14982,11 @@ class uo {
14868
14982
  this.orbitVelocity_.phi -= A * jB, this.orbitVelocity_.theta += I * jB;
14869
14983
  }
14870
14984
  pan(A, I) {
14871
- const B = this.currPos_.radius * Go, C = M();
14985
+ const B = this.currPos_.radius * wo, C = M();
14872
14986
  Ag(C, C, this.camera_.right, A), Ag(C, C, this.camera_.up, I), $I(C, C, B), Ig(this.panVelocity_, this.panVelocity_, C);
14873
14987
  }
14874
14988
  zoom(A) {
14875
- this.orbitVelocity_.radius += A * wo;
14989
+ this.orbitVelocity_.radius += A * ro;
14876
14990
  }
14877
14991
  updateCamera() {
14878
14992
  const A = aI(M(), this.currCenter_, this.currPos_.toVec3());
@@ -14882,8 +14996,8 @@ class uo {
14882
14996
  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_);
14883
14997
  }
14884
14998
  }
14885
- const MC = 1.77, zB = 128, _B = 128 / MC, So = -1e6, Ro = 1e6;
14886
- class mo extends dC {
14999
+ const MC = 1.77, zB = 128, _B = 128 / MC, Ro = -1e6, co = 1e6;
15000
+ class To extends YC {
14887
15001
  // width_ and height_ should always be defined by constructor (see setFrame)
14888
15002
  width_ = zB;
14889
15003
  height_ = _B;
@@ -14898,7 +15012,7 @@ class mo extends dC {
14898
15012
  * @param props - Initialization properties.
14899
15013
  */
14900
15014
  constructor(A) {
14901
- super(), this.near_ = A.near ?? So, this.far_ = A.far ?? Ro, this.orientation_ = A.orientation ?? "XY", this.axes_ = YA(this.orientation_), this.rotation_ = dA(this.axes_), this.setFrame(A), this.updateProjectionMatrix();
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();
14902
15016
  }
14903
15017
  /**
14904
15018
  * The world-space size of the rendered view as `[width, height]`.
@@ -14951,7 +15065,7 @@ class mo extends dC {
14951
15065
  if (A === this.orientation_)
14952
15066
  return;
14953
15067
  const I = this.transform.translation[W[this.axes_.u]], B = this.transform.translation[W[this.axes_.v]];
14954
- this.orientation_ = A, this.axes_ = YA(A), this.rotation_ = dA(this.axes_);
15068
+ this.orientation_ = A, this.axes_ = dA(A), this.rotation_ = YA(this.axes_);
14955
15069
  const C = M();
14956
15070
  C[W[this.axes_.u]] = I, C[W[this.axes_.v]] = B, this.transform.setTranslation(C), this.transform.setRotation(this.rotation_);
14957
15071
  }
@@ -15000,7 +15114,7 @@ class mo extends dC {
15000
15114
  }
15001
15115
  }
15002
15116
  const $B = 0;
15003
- class To {
15117
+ class xo {
15004
15118
  camera_;
15005
15119
  scrollZoom_;
15006
15120
  dragActive_ = !1;
@@ -15072,8 +15186,8 @@ class To {
15072
15186
  !this.dragActive_ || I.button !== $B || (this.dragActive_ = !1, I.target?.releasePointerCapture?.(I.pointerId));
15073
15187
  }
15074
15188
  }
15075
- const co = 60, No = 1.77, oI = 0.1, zI = 180 - oI;
15076
- class xo extends dC {
15189
+ const No = 60, Uo = 1.77, oI = 0.1, zI = 180 - oI;
15190
+ class Wo extends YC {
15077
15191
  fov_;
15078
15192
  aspectRatio_;
15079
15193
  /**
@@ -15083,8 +15197,8 @@ class xo extends dC {
15083
15197
  */
15084
15198
  constructor(A = {}) {
15085
15199
  const {
15086
- fov: I = co,
15087
- aspectRatio: B = No,
15200
+ fov: I = No,
15201
+ aspectRatio: B = Uo,
15088
15202
  near: C = 0.1,
15089
15203
  far: Q = 1e4,
15090
15204
  position: E = x(0, 0, 0)
@@ -15140,38 +15254,38 @@ class xo extends dC {
15140
15254
  }
15141
15255
  }
15142
15256
  export {
15143
- fo as AxesLayer,
15257
+ po as AxesLayer,
15144
15258
  AA as Box2,
15145
15259
  VA as Box3,
15146
- dC as Camera,
15260
+ YC as Camera,
15147
15261
  T as Color,
15148
- eo as Frustum,
15149
- Jo as Idetik,
15262
+ no as Frustum,
15263
+ Yo as Idetik,
15150
15264
  Jg as ImageLayer,
15151
- OQ as ImageRenderable,
15152
- AE as LabelImageRenderable,
15153
- Yg as LabelLayer,
15265
+ VQ as ImageRenderable,
15266
+ IE as LabelImageRenderable,
15267
+ dg as LabelLayer,
15154
15268
  KI as Layer,
15155
15269
  bA as OmeZarrImageSource,
15156
- uo as OrbitControls,
15157
- mo as OrthographicCamera,
15158
- To as PanZoomControls,
15159
- xo as PerspectiveCamera,
15160
- po as PointsRenderable,
15161
- Do as ProjectedLineRenderable,
15270
+ mo as OrbitControls,
15271
+ To as OrthographicCamera,
15272
+ xo as PanZoomControls,
15273
+ Wo as PerspectiveCamera,
15274
+ uo as PointsRenderable,
15275
+ to as ProjectedLineRenderable,
15162
15276
  zA as RenderableObject,
15163
- sE as Stats,
15277
+ DE as Stats,
15164
15278
  sC as TrsTransform,
15165
- Yo as Viewport,
15166
- QE as VolumeLayer,
15167
- gE as VolumeRenderable,
15279
+ Mo as Viewport,
15280
+ EE as VolumeLayer,
15281
+ BE as VolumeRenderable,
15168
15282
  Ng as createExplorationPolicy,
15169
15283
  Ug as createImageSourcePolicy,
15170
- ko as createNoPrefetchPolicy,
15171
- Uo as createPlaybackPolicy,
15172
- Ko as loadOmeZarrPlate,
15173
- Ho as loadOmeZarrWell,
15174
- qo as loadOmeroChannels,
15175
- lo as loadOmeroDefaults
15284
+ Lo as createNoPrefetchPolicy,
15285
+ ko as createPlaybackPolicy,
15286
+ Ho as loadOmeZarrPlate,
15287
+ qo as loadOmeZarrWell,
15288
+ lo as loadOmeroChannels,
15289
+ fo as loadOmeroDefaults
15176
15290
  };
15177
15291
  //# sourceMappingURL=index.js.map