@idetik/core 0.17.3 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -66,7 +66,7 @@ class l {
66
66
  return I.length === 1 ? "0" + I : I;
67
67
  }
68
68
  }
69
- class DC {
69
+ class hC {
70
70
  canvas_;
71
71
  width_ = 0;
72
72
  height_ = 0;
@@ -100,7 +100,7 @@ class DC {
100
100
  this.backgroundColor_ = l.from(A);
101
101
  }
102
102
  }
103
- var hC = `#version 300 es
103
+ var tC = `#version 300 es
104
104
 
105
105
  const float PI = 3.14159265;
106
106
 
@@ -166,7 +166,7 @@ void main() {
166
166
 
167
167
 
168
168
  gl_PointSize = 5.0;
169
- }`, tC = `#version 300 es
169
+ }`, yC = `#version 300 es
170
170
 
171
171
  precision mediump float;
172
172
 
@@ -253,7 +253,7 @@ void main() {
253
253
  rgbColor += value * Color[i];
254
254
  }
255
255
  fragColor = vec4(rgbColor, u_opacity);
256
- }`, yC = `#version 300 es
256
+ }`, eC = `#version 300 es
257
257
 
258
258
  precision mediump float;
259
259
 
@@ -273,7 +273,7 @@ void main() {
273
273
  gl_PointSize = inSize;
274
274
  color = inColor;
275
275
  marker = uint(inMarker);
276
- }`, eC = `#version 300 es
276
+ }`, GC = `#version 300 es
277
277
 
278
278
  precision mediump float;
279
279
 
@@ -293,7 +293,7 @@ void main() {
293
293
  discard;
294
294
  }
295
295
  fragColor = vec4(color.rgb, u_opacity * alpha * color.a);
296
- }`, GC = `#version 300 es
296
+ }`, nC = `#version 300 es
297
297
 
298
298
  layout (location = 0) in vec3 inPosition;
299
299
  layout (location = 1) in vec3 inNormal;
@@ -303,7 +303,7 @@ uniform mat4 ModelView;
303
303
 
304
304
  void main() {
305
305
  gl_Position = Projection * ModelView * vec4(inPosition, 1.0);
306
- }`, nC = `#version 300 es
306
+ }`, wC = `#version 300 es
307
307
 
308
308
  precision mediump float;
309
309
 
@@ -468,7 +468,7 @@ void main() {
468
468
  }
469
469
 
470
470
  fragColor = accumulatedColor;
471
- }`, wC = `#version 300 es
471
+ }`, FC = `#version 300 es
472
472
 
473
473
  precision mediump float;
474
474
  precision highp int;
@@ -558,18 +558,18 @@ void main() {
558
558
 
559
559
  fragColor = vec4(color.rgb, alpha);
560
560
  }`;
561
- const FC = {
561
+ const rC = {
562
562
  projectedLine: {
563
- vertex: hC,
564
- fragment: tC
563
+ vertex: tC,
564
+ fragment: yC
565
565
  },
566
566
  points: {
567
- vertex: yC,
568
- fragment: eC
567
+ vertex: eC,
568
+ fragment: GC
569
569
  },
570
570
  wireframe: {
571
- vertex: GC,
572
- fragment: nC
571
+ vertex: nC,
572
+ fragment: wC
573
573
  },
574
574
  floatScalarImage: {
575
575
  vertex: FA,
@@ -601,7 +601,7 @@ const FC = {
601
601
  },
602
602
  labelImage: {
603
603
  vertex: FA,
604
- fragment: wC
604
+ fragment: FC
605
605
  },
606
606
  floatVolume: {
607
607
  vertex: OI,
@@ -622,7 +622,7 @@ const FC = {
622
622
  info: 20,
623
623
  warn: 30,
624
624
  error: 40
625
- }, rC = {
625
+ }, SC = {
626
626
  debug: "\x1B[90m",
627
627
  // gray
628
628
  info: "\x1B[36m",
@@ -632,7 +632,7 @@ const FC = {
632
632
  error: "\x1B[31m"
633
633
  // red
634
634
  };
635
- function SC() {
635
+ function RC() {
636
636
  const g = typeof process < "u" && typeof process.env?.NODE_ENV == "string" ? process.env.NODE_ENV : void 0;
637
637
  if (g === "production" || g === "development" || g === "test")
638
638
  return g;
@@ -644,7 +644,7 @@ function SC() {
644
644
  return "development";
645
645
  }
646
646
  class U {
647
- static logLevel_ = SC() === "production" ? "warn" : "debug";
647
+ static logLevel_ = RC() === "production" ? "warn" : "debug";
648
648
  static setLogLevel(A) {
649
649
  U.logLevel_ = A;
650
650
  }
@@ -662,7 +662,7 @@ class U {
662
662
  }
663
663
  static log(A, I, B, ...C) {
664
664
  if (Zg[A] < Zg[U.logLevel_]) return;
665
- const Q = (/* @__PURE__ */ new Date()).toISOString(), E = rC[A], i = `[${Q}][${A.toUpperCase()}][${I}]`, o = [`${E}${i}`, B, ...C];
665
+ const Q = (/* @__PURE__ */ new Date()).toISOString(), E = SC[A], i = `[${Q}][${A.toUpperCase()}][${I}]`, o = [`${E}${i}`, B, ...C];
666
666
  switch (A) {
667
667
  case "debug":
668
668
  console.debug(...o);
@@ -679,7 +679,7 @@ class U {
679
679
  }
680
680
  }
681
681
  }
682
- class RC {
682
+ class NC {
683
683
  gl_;
684
684
  program_;
685
685
  uniformInfo_ = /* @__PURE__ */ new Map();
@@ -761,7 +761,7 @@ class RC {
761
761
  for (let I = 0; I < A; I++) {
762
762
  const B = this.gl_.getActiveUniform(this.program_, I);
763
763
  if (B) {
764
- if (!cC.has(B.type))
764
+ if (!UC.has(B.type))
765
765
  throw new Error(
766
766
  `Unsupported uniform type "${B.type}" (GLenum) found in shader program for uniform "${B.name}"`
767
767
  );
@@ -802,7 +802,7 @@ class RC {
802
802
  return Array.from(this.uniformInfo_.keys());
803
803
  }
804
804
  }
805
- const NC = typeof window < "u" ? [
805
+ const cC = typeof window < "u" ? [
806
806
  WebGL2RenderingContext.BOOL,
807
807
  WebGL2RenderingContext.FLOAT,
808
808
  WebGL2RenderingContext.INT,
@@ -827,10 +827,10 @@ const NC = typeof window < "u" ? [
827
827
  WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_3D,
828
828
  WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_CUBE,
829
829
  WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_2D_ARRAY
830
- ] : [], cC = new Set(
831
- NC
830
+ ] : [], UC = new Set(
831
+ cC
832
832
  ), vI = "#pragma inject_defines";
833
- class UC {
833
+ class kC {
834
834
  gl_;
835
835
  programs_ = /* @__PURE__ */ new Map();
836
836
  constructor(A) {
@@ -839,14 +839,14 @@ class UC {
839
839
  use(A) {
840
840
  let I = this.programs_.get(A);
841
841
  if (I === void 0) {
842
- const B = FC[A], C = Pg(
842
+ const B = rC[A], C = Pg(
843
843
  B.vertex,
844
844
  B.vertexDefines
845
845
  ), Q = Pg(
846
846
  B.fragment,
847
847
  B.fragmentDefines
848
848
  );
849
- I = new RC(
849
+ I = new NC(
850
850
  this.gl_,
851
851
  C,
852
852
  Q
@@ -879,9 +879,9 @@ function JB(g) {
879
879
  class yg {
880
880
  id = JB();
881
881
  }
882
- var p = 1e-6, P = typeof Float32Array < "u" ? Float32Array : Array, kC = Math.PI / 180;
883
- function LC(g) {
884
- return g * kC;
882
+ var p = 1e-6, P = typeof Float32Array < "u" ? Float32Array : Array, LC = Math.PI / 180;
883
+ function JC(g) {
884
+ return g * LC;
885
885
  }
886
886
  Math.hypot || (Math.hypot = function() {
887
887
  for (var g = 0, A = arguments.length; A--; )
@@ -892,7 +892,7 @@ function YB() {
892
892
  var g = new P(9);
893
893
  return P != Float32Array && (g[1] = 0, g[2] = 0, g[3] = 0, g[5] = 0, g[6] = 0, g[7] = 0), g[0] = 1, g[4] = 1, g[8] = 1, g;
894
894
  }
895
- function JC(g, A) {
895
+ function YC(g, A) {
896
896
  return g[0] = A[0], g[1] = A[1], g[2] = A[2], g[3] = A[4], g[4] = A[5], g[5] = A[6], g[6] = A[8], g[7] = A[9], g[8] = A[10], g;
897
897
  }
898
898
  function z() {
@@ -907,30 +907,30 @@ function jA(g, A, I) {
907
907
  var B = A[0], C = A[1], Q = A[2], E = A[3], i = A[4], o = A[5], a = A[6], s = A[7], h = A[8], t = A[9], y = A[10], n = A[11], w = A[12], r = A[13], G = A[14], c = A[15], R = I[0], Y = I[1], k = I[2], L = I[3];
908
908
  return g[0] = R * B + Y * i + k * h + L * w, g[1] = R * C + Y * o + k * t + L * r, g[2] = R * Q + Y * a + k * y + L * G, g[3] = R * E + Y * s + k * n + L * c, R = I[4], Y = I[5], k = I[6], L = I[7], g[4] = R * B + Y * i + k * h + L * w, g[5] = R * C + Y * o + k * t + L * r, g[6] = R * Q + Y * a + k * y + L * G, g[7] = R * E + Y * s + k * n + L * c, R = I[8], Y = I[9], k = I[10], L = I[11], g[8] = R * B + Y * i + k * h + L * w, g[9] = R * C + Y * o + k * t + L * r, g[10] = R * Q + Y * a + k * y + L * G, g[11] = R * E + Y * s + k * n + L * c, R = I[12], Y = I[13], k = I[14], L = I[15], g[12] = R * B + Y * i + k * h + L * w, g[13] = R * C + Y * o + k * t + L * r, g[14] = R * Q + Y * a + k * y + L * G, g[15] = R * E + Y * s + k * n + L * c, g;
909
909
  }
910
- function YC(g, A) {
910
+ function dC(g, A) {
911
911
  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;
912
912
  }
913
- function dC(g, A, I, B) {
913
+ function MC(g, A, I, B) {
914
914
  var C = A[0], Q = A[1], E = A[2], i = A[3], o = C + C, a = Q + Q, s = E + E, h = C * o, t = C * a, y = C * s, n = Q * a, w = Q * s, r = E * s, G = i * o, c = i * a, R = i * s, Y = B[0], k = B[1], L = B[2];
915
915
  return g[0] = (1 - (n + r)) * Y, g[1] = (t + R) * Y, g[2] = (y - c) * Y, g[3] = 0, g[4] = (t - R) * k, g[5] = (1 - (h + r)) * k, g[6] = (w + G) * k, g[7] = 0, g[8] = (y + c) * L, g[9] = (w - G) * L, g[10] = (1 - (h + n)) * L, g[11] = 0, g[12] = I[0], g[13] = I[1], g[14] = I[2], g[15] = 1, g;
916
916
  }
917
- function MC(g, A, I, B, C) {
917
+ function KC(g, A, I, B, C) {
918
918
  var Q = 1 / Math.tan(A / 2), E;
919
919
  return g[0] = Q / I, g[1] = 0, g[2] = 0, g[3] = 0, g[4] = 0, g[5] = Q, g[6] = 0, g[7] = 0, g[8] = 0, g[9] = 0, g[11] = -1, g[12] = 0, g[13] = 0, g[15] = 0, C != null && C !== 1 / 0 ? (E = 1 / (B - C), g[10] = (C + B) * E, g[14] = 2 * C * B * E) : (g[10] = -1, g[14] = -2 * B), g;
920
920
  }
921
- var KC = MC;
922
- function HC(g, A, I, B, C, Q, E) {
921
+ var HC = KC;
922
+ function qC(g, A, I, B, C, Q, E) {
923
923
  var i = 1 / (A - I), o = 1 / (B - C), a = 1 / (Q - E);
924
924
  return g[0] = -2 * i, g[1] = 0, g[2] = 0, g[3] = 0, g[4] = 0, g[5] = -2 * o, g[6] = 0, g[7] = 0, g[8] = 0, g[9] = 0, g[10] = 2 * a, g[11] = 0, g[12] = (A + I) * i, g[13] = (C + B) * o, g[14] = (E + Q) * a, g[15] = 1, g;
925
925
  }
926
- var qC = HC;
927
- function lC(g, A, I, B) {
926
+ var lC = qC;
927
+ function fC(g, A, I, B) {
928
928
  var C = A[0], Q = A[1], E = A[2], i = B[0], o = B[1], a = B[2], s = C - I[0], h = Q - I[1], t = E - I[2], y = s * s + h * h + t * t;
929
929
  y > 0 && (y = 1 / Math.sqrt(y), s *= y, h *= y, t *= y);
930
930
  var n = o * t - a * h, w = a * s - i * t, r = i * h - o * s;
931
931
  return y = n * n + w * w + r * r, y > 0 && (y = 1 / Math.sqrt(y), n *= y, w *= y, r *= y), g[0] = n, g[1] = w, g[2] = r, g[3] = 0, g[4] = h * r - t * w, g[5] = t * n - s * r, g[6] = s * w - h * n, g[7] = 0, g[8] = s, g[9] = h, g[10] = t, g[11] = 0, g[12] = C, g[13] = Q, g[14] = E, g[15] = 1, g;
932
932
  }
933
- function fC(g, A) {
933
+ function pC(g, A) {
934
934
  var I = g[0], B = g[1], C = g[2], Q = g[3], E = g[4], i = g[5], o = g[6], a = g[7], s = g[8], h = g[9], t = g[10], y = g[11], n = g[12], w = g[13], r = g[14], G = g[15], c = A[0], R = A[1], Y = A[2], k = A[3], L = A[4], m = A[5], x = A[6], b = A[7], O = A[8], V = A[9], EA = A[10], iA = A[11], T = A[12], xg = A[13], Wg = A[14], bg = A[15];
935
935
  return Math.abs(I - c) <= p * Math.max(1, Math.abs(I), Math.abs(c)) && Math.abs(B - R) <= p * Math.max(1, Math.abs(B), Math.abs(R)) && Math.abs(C - Y) <= p * Math.max(1, Math.abs(C), Math.abs(Y)) && Math.abs(Q - k) <= p * Math.max(1, Math.abs(Q), Math.abs(k)) && Math.abs(E - L) <= p * Math.max(1, Math.abs(E), Math.abs(L)) && Math.abs(i - m) <= p * Math.max(1, Math.abs(i), Math.abs(m)) && Math.abs(o - x) <= p * Math.max(1, Math.abs(o), Math.abs(x)) && Math.abs(a - b) <= p * Math.max(1, Math.abs(a), Math.abs(b)) && Math.abs(s - O) <= p * Math.max(1, Math.abs(s), Math.abs(O)) && Math.abs(h - V) <= p * Math.max(1, Math.abs(h), Math.abs(V)) && Math.abs(t - EA) <= p * Math.max(1, Math.abs(t), Math.abs(EA)) && Math.abs(y - iA) <= p * Math.max(1, Math.abs(y), Math.abs(iA)) && Math.abs(n - T) <= p * Math.max(1, Math.abs(n), Math.abs(T)) && Math.abs(w - xg) <= p * Math.max(1, Math.abs(w), Math.abs(xg)) && Math.abs(r - Wg) <= p * Math.max(1, Math.abs(r), Math.abs(Wg)) && Math.abs(G - bg) <= p * Math.max(1, Math.abs(G), Math.abs(bg));
936
936
  }
@@ -959,10 +959,10 @@ function rA(g, A, I, B) {
959
959
  function qA(g, A, I) {
960
960
  return g[0] = A[0] + I[0], g[1] = A[1] + I[1], g[2] = A[2] + I[2], g;
961
961
  }
962
- function pC(g, A, I) {
962
+ function mC(g, A, I) {
963
963
  return g[0] = A[0] - I[0], g[1] = A[1] - I[1], g[2] = A[2] - I[2], g;
964
964
  }
965
- function mC(g, A, I) {
965
+ function uC(g, A, I) {
966
966
  return g[0] = A[0] * I[0], g[1] = A[1] * I[1], g[2] = A[2] * I[2], g;
967
967
  }
968
968
  function lA(g, A, I) {
@@ -979,7 +979,7 @@ function Vg(g, A) {
979
979
  var I = A[0] - g[0], B = A[1] - g[1], C = A[2] - g[2];
980
980
  return I * I + B * B + C * C;
981
981
  }
982
- function uC(g, A) {
982
+ function TC(g, A) {
983
983
  var I = A[0], B = A[1], C = A[2], Q = I * I + B * B + C * C;
984
984
  return Q > 0 && (Q = 1 / Math.sqrt(Q)), g[0] = A[0] * Q, g[1] = A[1] * Q, g[2] = A[2] * Q, g;
985
985
  }
@@ -990,7 +990,7 @@ function XI(g, A, I) {
990
990
  var B = A[0], C = A[1], Q = A[2], E = I[0], i = I[1], o = I[2];
991
991
  return g[0] = C * o - Q * i, g[1] = Q * E - B * o, g[2] = B * i - C * E, g;
992
992
  }
993
- function TC(g, A, I, B, C, Q) {
993
+ function xC(g, A, I, B, C, Q) {
994
994
  var E = 1 - Q, i = E * E, o = Q * Q, a = i * E, s = 3 * Q * i, h = 3 * o * E, t = o * Q;
995
995
  return g[0] = A[0] * a + I[0] * s + B[0] * h + C[0] * t, g[1] = A[1] * a + I[1] * s + B[1] * h + C[1] * t, g[2] = A[2] * a + I[2] * s + B[2] * h + C[2] * t, g;
996
996
  }
@@ -998,14 +998,14 @@ function uI(g, A, I) {
998
998
  var B = A[0], C = A[1], Q = A[2], E = I[3] * B + I[7] * C + I[11] * Q + I[15];
999
999
  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;
1000
1000
  }
1001
- function xC(g) {
1001
+ function WC(g) {
1002
1002
  return g[0] = 0, g[1] = 0, g[2] = 0, g;
1003
1003
  }
1004
1004
  function MB(g, A) {
1005
1005
  var I = g[0], B = g[1], C = g[2], Q = A[0], E = A[1], i = A[2];
1006
1006
  return Math.abs(I - Q) <= p * Math.max(1, Math.abs(I), Math.abs(Q)) && Math.abs(B - E) <= p * Math.max(1, Math.abs(B), Math.abs(E)) && Math.abs(C - i) <= p * Math.max(1, Math.abs(C), Math.abs(i));
1007
1007
  }
1008
- var UI = pC, WC = eg;
1008
+ var UI = mC, bC = eg;
1009
1009
  (function() {
1010
1010
  var g = f();
1011
1011
  return function(A, I, B, C, Q, E) {
@@ -1019,7 +1019,7 @@ function fA() {
1019
1019
  var g = new P(4);
1020
1020
  return P != Float32Array && (g[0] = 0, g[1] = 0, g[2] = 0, g[3] = 0), g;
1021
1021
  }
1022
- function bC(g) {
1022
+ function ZC(g) {
1023
1023
  var A = new P(4);
1024
1024
  return A[0] = g[0], A[1] = g[1], A[2] = g[2], A[3] = g[3], A;
1025
1025
  }
@@ -1027,13 +1027,13 @@ function kI(g, A, I, B) {
1027
1027
  var C = new P(4);
1028
1028
  return C[0] = g, C[1] = A, C[2] = I, C[3] = B, C;
1029
1029
  }
1030
- function ZC(g, A) {
1030
+ function PC(g, A) {
1031
1031
  return g[0] = A[0], g[1] = A[1], g[2] = A[2], g[3] = A[3], g;
1032
1032
  }
1033
- function PC(g, A, I) {
1033
+ function OC(g, A, I) {
1034
1034
  return g[0] = A[0] * I, g[1] = A[1] * I, g[2] = A[2] * I, g[3] = A[3] * I, g;
1035
1035
  }
1036
- function OC(g, A) {
1036
+ function VC(g, A) {
1037
1037
  var I = A[0], B = A[1], C = A[2], Q = A[3], E = I * I + B * B + C * C + Q * Q;
1038
1038
  return E > 0 && (E = 1 / Math.sqrt(E)), g[0] = I * E, g[1] = B * E, g[2] = C * E, g[3] = Q * E, g;
1039
1039
  }
@@ -1054,12 +1054,12 @@ function Cg() {
1054
1054
  var g = new P(4);
1055
1055
  return P != Float32Array && (g[0] = 0, g[1] = 0, g[2] = 0), g[3] = 1, g;
1056
1056
  }
1057
- function VC(g, A, I) {
1057
+ function vC(g, A, I) {
1058
1058
  I = I * 0.5;
1059
1059
  var B = Math.sin(I);
1060
1060
  return g[0] = B * A[0], g[1] = B * A[1], g[2] = B * A[2], g[3] = Math.cos(I), g;
1061
1061
  }
1062
- function vC(g, A, I) {
1062
+ function XC(g, A, I) {
1063
1063
  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];
1064
1064
  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;
1065
1065
  }
@@ -1079,12 +1079,12 @@ function KB(g, A) {
1079
1079
  }
1080
1080
  return g;
1081
1081
  }
1082
- var XC = bC, jC = ZC, Gg = OC;
1082
+ var jC = ZC, zC = PC, Gg = VC;
1083
1083
  (function() {
1084
1084
  var g = f(), A = q(1, 0, 0), I = q(0, 1, 0);
1085
1085
  return function(B, C, Q) {
1086
1086
  var E = dB(C, Q);
1087
- return E < -0.999999 ? (XI(g, A, C), WC(g) < 1e-6 && XI(g, I, C), uC(g, g), VC(B, g, Math.PI), B) : E > 0.999999 ? (B[0] = 0, B[1] = 0, B[2] = 0, B[3] = 1, B) : (XI(g, C, Q), B[0] = g[0], B[1] = g[1], B[2] = g[2], B[3] = 1 + E, Gg(B, B));
1087
+ return E < -0.999999 ? (XI(g, A, C), bC(g) < 1e-6 && XI(g, I, C), TC(g, g), vC(B, g, Math.PI), B) : E > 0.999999 ? (B[0] = 0, B[1] = 0, B[2] = 0, B[3] = 1, B) : (XI(g, C, Q), B[0] = g[0], B[1] = g[1], B[2] = g[2], B[3] = 1 + E, Gg(B, B));
1088
1088
  };
1089
1089
  })();
1090
1090
  (function() {
@@ -1111,15 +1111,15 @@ function Z(g, A) {
1111
1111
  var I = new P(2);
1112
1112
  return I[0] = g, I[1] = A, I;
1113
1113
  }
1114
- function zC(g, A) {
1114
+ function _C(g, A) {
1115
1115
  var I = A[0] - g[0], B = A[1] - g[1];
1116
1116
  return Math.hypot(I, B);
1117
1117
  }
1118
- function _C(g) {
1118
+ function $C(g) {
1119
1119
  var A = g[0], I = g[1];
1120
1120
  return A * A + I * I;
1121
1121
  }
1122
- function $C(g, A, I, B) {
1122
+ function AQ(g, A, I, B) {
1123
1123
  var C = A[0], Q = A[1];
1124
1124
  return g[0] = C + B * (I[0] - C), g[1] = Q + B * (I[1] - Q), g;
1125
1125
  }
@@ -1181,7 +1181,7 @@ class SA {
1181
1181
  uI(Q, E, A), this.expandWithPoint(Q);
1182
1182
  }
1183
1183
  }
1184
- const AQ = {
1184
+ const IQ = {
1185
1185
  position: 0,
1186
1186
  normal: 1,
1187
1187
  uv: 2,
@@ -1245,7 +1245,7 @@ class WA extends yg {
1245
1245
  return this.attributes_.find((I) => I.type === A);
1246
1246
  }
1247
1247
  }
1248
- class IQ {
1248
+ class gQ {
1249
1249
  gl_;
1250
1250
  buffers_ = /* @__PURE__ */ new Map();
1251
1251
  currentGeometry_ = null;
@@ -1281,7 +1281,7 @@ class IQ {
1281
1281
  this.gl_.bindBuffer(C, Q), this.gl_.bufferData(C, B, this.gl_.STATIC_DRAW);
1282
1282
  const { attributes: E, strideBytes: i } = A;
1283
1283
  E.forEach((s) => {
1284
- const h = AQ[s.type];
1284
+ const h = IQ[s.type];
1285
1285
  this.gl_.vertexAttribPointer(
1286
1286
  h,
1287
1287
  s.itemSize,
@@ -1300,7 +1300,7 @@ class IQ {
1300
1300
  this.buffers_.set(A, o), this.gl_.bindVertexArray(null);
1301
1301
  }
1302
1302
  }
1303
- class gQ {
1303
+ class BQ {
1304
1304
  gl_;
1305
1305
  textures_ = /* @__PURE__ */ new Map();
1306
1306
  currentTexture_ = null;
@@ -1580,7 +1580,7 @@ class $ {
1580
1580
  return { x: A, y: I, width: B, height: C };
1581
1581
  }
1582
1582
  }
1583
- class BQ {
1583
+ class CQ {
1584
1584
  gl_;
1585
1585
  enabledCapabilities_ = /* @__PURE__ */ new Map();
1586
1586
  depthMaskEnabled_ = null;
@@ -1680,8 +1680,8 @@ class BQ {
1680
1680
  A ? this.enable(this.gl_.STENCIL_TEST) : this.disable(this.gl_.STENCIL_TEST);
1681
1681
  }
1682
1682
  }
1683
- const CQ = YC(z(), [1, -1, 1]);
1684
- class QQ extends DC {
1683
+ const QQ = dC(z(), [1, -1, 1]);
1684
+ class EQ extends hC {
1685
1685
  gl_;
1686
1686
  programs_;
1687
1687
  bindings_;
@@ -1700,7 +1700,7 @@ class QQ extends DC {
1700
1700
  this.gl_ = I, U.info(
1701
1701
  "WebGLRenderer",
1702
1702
  `WebGL version ${I.getParameter(I.VERSION)}`
1703
- ), this.programs_ = new UC(I), this.bindings_ = new IQ(I), this.textures_ = new gQ(I), this.state_ = new BQ(I), this.initStencil(), this.resize(this.canvas.width, this.canvas.height);
1703
+ ), this.programs_ = new kC(I), this.bindings_ = new gQ(I), this.textures_ = new BQ(I), this.state_ = new CQ(I), this.initStencil(), this.resize(this.canvas.width, this.canvas.height);
1704
1704
  }
1705
1705
  render(A) {
1706
1706
  let I = getComputedStyle(A.element).visibility !== "hidden";
@@ -1764,7 +1764,7 @@ class QQ extends DC {
1764
1764
  I.transform.matrix
1765
1765
  ), i = jA(
1766
1766
  z(),
1767
- CQ,
1767
+ QQ,
1768
1768
  Q.projectionMatrix
1769
1769
  ), o = [this.canvas.width, this.canvas.height], a = I.getUniforms(), h = {
1770
1770
  ...B.getUniforms(),
@@ -1831,12 +1831,12 @@ class QQ extends DC {
1831
1831
  this.gl_.clearColor(...this.backgroundColor.rgba), this.gl_.clear(this.gl_.COLOR_BUFFER_BIT | this.gl_.DEPTH_BUFFER_BIT), this.state_.setDepthTesting(!0), this.gl_.depthFunc(this.gl_.LEQUAL);
1832
1832
  }
1833
1833
  }
1834
- const EQ = 8;
1835
- class iQ {
1834
+ const iQ = 8;
1835
+ class oQ {
1836
1836
  maxConcurrent_;
1837
1837
  pending_ = [];
1838
1838
  running_ = /* @__PURE__ */ new Map();
1839
- constructor(A = EQ) {
1839
+ constructor(A = iQ) {
1840
1840
  this.maxConcurrent_ = Math.max(1, A);
1841
1841
  }
1842
1842
  enqueue(A, I) {
@@ -1902,7 +1902,24 @@ function zg(g) {
1902
1902
  `Unsupported chunk data type: ${g}. Supported data types: ${A}`
1903
1903
  ), !1;
1904
1904
  }
1905
- function oQ(g, A) {
1905
+ function aQ(g) {
1906
+ let A = 1 / 0, I = -1 / 0;
1907
+ for (let B = 0; B < g.length; B++) {
1908
+ const C = g[B];
1909
+ C < A && (A = C), C > I && (I = C);
1910
+ }
1911
+ return { min: A, max: I };
1912
+ }
1913
+ function qB(g) {
1914
+ const A = {};
1915
+ for (const I of g) {
1916
+ if (!I.dataRange) continue;
1917
+ const B = I.chunkIndex.c, C = A[B];
1918
+ C ? (C.min = Math.min(C.min, I.dataRange.min), C.max = Math.max(C.max, I.dataRange.max)) : A[B] = { min: I.dataRange.min, max: I.dataRange.max };
1919
+ }
1920
+ return A;
1921
+ }
1922
+ function sQ(g, A) {
1906
1923
  return Math.round((A - g.translation) / g.scale);
1907
1924
  }
1908
1925
  function Qg(g, A, I = 1e-6) {
@@ -1912,7 +1929,7 @@ function NA(g, A, I) {
1912
1929
  return Math.max(A, Math.min(I, g));
1913
1930
  }
1914
1931
  const ng = Symbol("INTERNAL_POLICY_KEY");
1915
- class aQ {
1932
+ class DQ {
1916
1933
  store_;
1917
1934
  policy_;
1918
1935
  policyChanged_ = !1;
@@ -1932,7 +1949,7 @@ class aQ {
1932
1949
  this.policy_.profile
1933
1950
  );
1934
1951
  const B = this.store_.dimensions, C = B.x.lods[0], Q = B.y.lods[0];
1935
- this.sourceMaxSquareDistance2D_ = _C(
1952
+ this.sourceMaxSquareDistance2D_ = $C(
1936
1953
  Z(C.size * C.scale, Q.size * Q.scale)
1937
1954
  );
1938
1955
  }
@@ -1985,7 +2002,7 @@ class aQ {
1985
2002
  return;
1986
2003
  }
1987
2004
  const w = HB();
1988
- $C(w, Q.min, Q.max, 0.5);
2005
+ AQ(w, Q.min, Q.max, 0.5);
1989
2006
  const [r, G] = this.getZBounds(A), c = new SA(
1990
2007
  q(Q.min[0], Q.min[1], r),
1991
2008
  q(Q.max[0], Q.max[1], G)
@@ -2183,7 +2200,7 @@ class aQ {
2183
2200
  return this.lastViewBounds2D_ === null || !zI(this.lastViewBounds2D_.min, A.min) || !zI(this.lastViewBounds2D_.max, A.max);
2184
2201
  }
2185
2202
  hasViewProjectionChanged(A) {
2186
- return this.lastViewProjection_ === null || !fC(this.lastViewProjection_, A);
2203
+ return this.lastViewProjection_ === null || !pC(this.lastViewProjection_, A);
2187
2204
  }
2188
2205
  zBoundsChanged(A) {
2189
2206
  return !this.lastZBounds_ || !zI(this.lastZBounds_, A);
@@ -2218,7 +2235,7 @@ class aQ {
2218
2235
  function _I(g) {
2219
2236
  g.visible = !1, g.prefetch = !1, g.priority = null, g.orderKey = null;
2220
2237
  }
2221
- class sQ {
2238
+ class hQ {
2222
2239
  chunks_;
2223
2240
  loader_;
2224
2241
  lowestResLOD_;
@@ -2276,7 +2293,7 @@ class sQ {
2276
2293
  return this.chunks_[A];
2277
2294
  }
2278
2295
  getTimeIndex(A) {
2279
- return A.t === void 0 || this.dimensions_.t === void 0 ? 0 : oQ(this.dimensions_.t.lods[0], A.t);
2296
+ return A.t === void 0 || this.dimensions_.t === void 0 ? 0 : sQ(this.dimensions_.t.lods[0], A.t);
2280
2297
  }
2281
2298
  get lodCount() {
2282
2299
  return this.lowestResLOD_ + 1;
@@ -2294,7 +2311,7 @@ class sQ {
2294
2311
  return this.loader_.loadChunkData(A, I);
2295
2312
  }
2296
2313
  createView(A) {
2297
- const I = new aQ(this, A);
2314
+ const I = new DQ(this, A);
2298
2315
  return this.views_.push(I), this.hasHadViews_ = !0, I;
2299
2316
  }
2300
2317
  get views() {
@@ -2387,10 +2404,10 @@ class sQ {
2387
2404
  };
2388
2405
  }
2389
2406
  }
2390
- class DQ {
2407
+ class tQ {
2391
2408
  stores_ = /* @__PURE__ */ new Map();
2392
2409
  pendingStores_ = /* @__PURE__ */ new Map();
2393
- queue_ = new iQ();
2410
+ queue_ = new oQ();
2394
2411
  get queueStats() {
2395
2412
  return {
2396
2413
  pending: this.queue_.pendingCount,
@@ -2409,7 +2426,7 @@ class DQ {
2409
2426
  return B;
2410
2427
  const Q = (async () => {
2411
2428
  const i = await A.open();
2412
- return new sQ(i);
2429
+ return new hQ(i);
2413
2430
  })();
2414
2431
  this.pendingStores_.set(A, Q);
2415
2432
  const E = await Q;
@@ -2481,14 +2498,14 @@ vA.Panel = function(g, A, I, B) {
2481
2498
  }
2482
2499
  };
2483
2500
  };
2484
- function hQ({ scale: g } = { scale: 1.5 }) {
2501
+ function yQ({ scale: g } = { scale: 1.5 }) {
2485
2502
  const A = new vA(g);
2486
2503
  return A.showPanel(
2487
2504
  0
2488
2505
  /* 0 = fps, 1 = ms, 2 = mb */
2489
2506
  ), document.body.appendChild(A.dom), A;
2490
2507
  }
2491
- class tQ {
2508
+ class eQ {
2492
2509
  layers_ = [];
2493
2510
  callbacks_ = [];
2494
2511
  context_;
@@ -2545,10 +2562,10 @@ const Eg = [
2545
2562
  "pointercancel",
2546
2563
  "wheel"
2547
2564
  ];
2548
- function yQ(g) {
2565
+ function GQ(g) {
2549
2566
  return Eg.includes(g);
2550
2567
  }
2551
- class eQ {
2568
+ class nQ {
2552
2569
  propagationStopped_ = !1;
2553
2570
  type;
2554
2571
  event;
@@ -2564,7 +2581,7 @@ class eQ {
2564
2581
  this.propagationStopped_ = !0;
2565
2582
  }
2566
2583
  }
2567
- class GQ {
2584
+ class wQ {
2568
2585
  listeners_ = [];
2569
2586
  element_;
2570
2587
  isConnected_ = !1;
@@ -2603,16 +2620,16 @@ class GQ {
2603
2620
  });
2604
2621
  }
2605
2622
  handleEvent = (A) => {
2606
- if (!yQ(A.type)) {
2623
+ if (!GQ(A.type)) {
2607
2624
  U.error("EventDispatcher", `Unsupported event type ${A.type}`);
2608
2625
  return;
2609
2626
  }
2610
- const I = new eQ(A.type, A);
2627
+ const I = new nQ(A.type, A);
2611
2628
  for (const B of this.listeners_)
2612
2629
  if (B(I), I.propagationStopped) break;
2613
2630
  };
2614
2631
  }
2615
- class nQ {
2632
+ class FQ {
2616
2633
  id;
2617
2634
  element;
2618
2635
  camera;
@@ -2620,7 +2637,7 @@ class nQ {
2620
2637
  events;
2621
2638
  cameraControls;
2622
2639
  constructor(A) {
2623
- this.id = A.id, this.element = A.element, this.camera = A.camera, this.layerManager = A.layerManager, this.cameraControls = A.cameraControls, this.updateAspectRatio(), this.events = new GQ(this.element), this.events.addEventListener((I) => {
2640
+ this.id = A.id, this.element = A.element, this.camera = A.camera, this.layerManager = A.layerManager, this.cameraControls = A.cameraControls, this.updateAspectRatio(), this.events = new wQ(this.element), this.events.addEventListener((I) => {
2624
2641
  if (I.event instanceof PointerEvent || I.event instanceof WheelEvent) {
2625
2642
  const { clientX: B, clientY: C } = I.event, Q = Z(B, C);
2626
2643
  I.clipPos = this.clientToClip(Q, 0), I.worldPos = this.camera.clipToWorld(I.clipPos);
@@ -2674,7 +2691,7 @@ class nQ {
2674
2691
  this.camera.setAspectRatio(B);
2675
2692
  }
2676
2693
  }
2677
- function qB(g, A) {
2694
+ function lB(g, A) {
2678
2695
  for (const I of A) {
2679
2696
  if (I.id === g.id)
2680
2697
  throw new Error(
@@ -2688,9 +2705,9 @@ function qB(g, A) {
2688
2705
  }
2689
2706
  }
2690
2707
  }
2691
- function wQ(g) {
2708
+ function rQ(g) {
2692
2709
  for (let A = 0; A < g.length; A++)
2693
- qB(g[A], g.slice(0, A));
2710
+ lB(g[A], g.slice(0, A));
2694
2711
  }
2695
2712
  function _g(g, A, I) {
2696
2713
  const B = g.map((C) => {
@@ -2699,12 +2716,12 @@ function _g(g, A, I) {
2699
2716
  ...C,
2700
2717
  element: Q,
2701
2718
  id: C.id ?? Q.id ?? JB("viewport"),
2702
- layerManager: new tQ(I)
2719
+ layerManager: new eQ(I)
2703
2720
  };
2704
2721
  });
2705
- return wQ(B), B.map((C) => new nQ(C));
2722
+ return rQ(B), B.map((C) => new FQ(C));
2706
2723
  }
2707
- class FQ {
2724
+ class SQ {
2708
2725
  elements_;
2709
2726
  resizeObserver_;
2710
2727
  mediaQuery_;
@@ -2763,7 +2780,7 @@ class FQ {
2763
2780
  this.elements_.splice(I, 1), this.resizeObserver_ && this.resizeObserver_.unobserve(A);
2764
2781
  }
2765
2782
  }
2766
- class qo {
2783
+ class fo {
2767
2784
  chunkManager_;
2768
2785
  context_;
2769
2786
  renderer_;
@@ -2823,17 +2840,17 @@ class qo {
2823
2840
  * @throws {Error} If viewports have duplicate IDs or shared elements
2824
2841
  */
2825
2842
  constructor(A) {
2826
- this.canvas = A.canvas, this.renderer_ = new QQ(this.canvas), this.chunkManager_ = new DQ(), this.context_ = {
2843
+ this.canvas = A.canvas, this.renderer_ = new EQ(this.canvas), this.chunkManager_ = new tQ(), this.context_ = {
2827
2844
  chunkManager: this.chunkManager_
2828
2845
  }, this.viewports_ = _g(
2829
2846
  A.viewports ?? [],
2830
2847
  this.canvas,
2831
2848
  this.context_
2832
- ), this.overlays = A.overlays ?? [], A.showStats && (this.stats_ = hQ());
2849
+ ), this.overlays = A.overlays ?? [], A.showStats && (this.stats_ = yQ());
2833
2850
  const I = [this.canvas];
2834
2851
  for (const B of this.viewports_)
2835
2852
  B.element !== this.canvas && I.push(B.element);
2836
- this.sizeObserver_ = new FQ(I, () => {
2853
+ this.sizeObserver_ = new SQ(I, () => {
2837
2854
  this.renderer_.updateSize();
2838
2855
  for (const B of this.viewports_)
2839
2856
  B.updateSize(), this.renderer_.render(B);
@@ -2869,7 +2886,7 @@ class qo {
2869
2886
  this.canvas,
2870
2887
  this.context_
2871
2888
  );
2872
- return qB(I, this.viewports_), this.viewports_.push(I), this.running && (I.events.connect(), I.element !== this.canvas && this.sizeObserver_.observe(I.element)), U.info("Idetik", `Added viewport "${I.id}"`), I;
2889
+ return lB(I, this.viewports_), this.viewports_.push(I), this.running && (I.events.connect(), I.element !== this.canvas && this.sizeObserver_.observe(I.element)), U.info("Idetik", `Added viewport "${I.id}"`), I;
2873
2890
  }
2874
2891
  removeViewport(A) {
2875
2892
  const I = this.viewports_.indexOf(A);
@@ -2914,7 +2931,7 @@ class qo {
2914
2931
  }
2915
2932
  }
2916
2933
  }
2917
- class rQ extends WA {
2934
+ class RQ extends WA {
2918
2935
  constructor(A) {
2919
2936
  if (super(), A.primitive != "triangles") {
2920
2937
  U.warn("WireframeGeometry", "Only indexed geometries are supported");
@@ -2939,21 +2956,21 @@ class rQ extends WA {
2939
2956
  this.indexData_ = new Uint32Array(B);
2940
2957
  }
2941
2958
  }
2942
- const SQ = q(0, 1, 0);
2943
- class RQ {
2959
+ const NQ = q(0, 1, 0);
2960
+ class cQ {
2944
2961
  dirty_ = !0;
2945
2962
  matrix_ = z();
2946
2963
  rotation_ = Cg();
2947
2964
  translation_ = f();
2948
2965
  scale_ = q(1, 1, 1);
2949
2966
  addRotation(A) {
2950
- vC(this.rotation_, this.rotation_, A), this.dirty_ = !0;
2967
+ XC(this.rotation_, this.rotation_, A), this.dirty_ = !0;
2951
2968
  }
2952
2969
  setRotation(A) {
2953
- jC(this.rotation_, A), this.dirty_ = !0;
2970
+ zC(this.rotation_, A), this.dirty_ = !0;
2954
2971
  }
2955
2972
  get rotation() {
2956
- return XC(this.rotation_);
2973
+ return jC(this.rotation_);
2957
2974
  }
2958
2975
  addTranslation(A) {
2959
2976
  qA(this.translation_, this.translation_, A), this.dirty_ = !0;
@@ -2965,14 +2982,14 @@ class RQ {
2965
2982
  return gA(this.translation_);
2966
2983
  }
2967
2984
  addScale(A) {
2968
- mC(this.scale_, this.scale_, A), this.dirty_ = !0;
2985
+ uC(this.scale_, this.scale_, A), this.dirty_ = !0;
2969
2986
  }
2970
2987
  setScale(A) {
2971
2988
  KA(this.scale_, A), this.dirty_ = !0;
2972
2989
  }
2973
2990
  targetTo(A) {
2974
2991
  MB(this.translation_, A) && (A = gA(A), A[2] += p);
2975
- const I = lC(z(), this.translation_, A, SQ), B = JC(YB(), I);
2992
+ const I = fC(z(), this.translation_, A, NQ), B = YC(YB(), I);
2976
2993
  KB(this.rotation_, B), Gg(this.rotation_, this.rotation_), this.dirty_ = !0;
2977
2994
  }
2978
2995
  get scale() {
@@ -2985,7 +3002,7 @@ class RQ {
2985
3002
  return mI(z(), this.matrix);
2986
3003
  }
2987
3004
  computeMatrix() {
2988
- dC(
3005
+ MC(
2989
3006
  this.matrix_,
2990
3007
  this.rotation_,
2991
3008
  this.translation_,
@@ -2999,7 +3016,7 @@ class bA extends yg {
2999
3016
  depthTest = !0;
3000
3017
  textures_ = [];
3001
3018
  staleTextures_ = [];
3002
- transform_ = new RQ();
3019
+ transform_ = new cQ();
3003
3020
  geometry_ = new WA();
3004
3021
  wireframeGeometry_ = null;
3005
3022
  programName_ = null;
@@ -3016,7 +3033,7 @@ class bA extends yg {
3016
3033
  return this.geometry_;
3017
3034
  }
3018
3035
  get wireframeGeometry() {
3019
- return this.wireframeGeometry_ ??= new rQ(this.geometry), this.wireframeGeometry_;
3036
+ return this.wireframeGeometry_ ??= new RQ(this.geometry), this.wireframeGeometry_;
3020
3037
  }
3021
3038
  get textures() {
3022
3039
  return this.textures_;
@@ -3071,7 +3088,7 @@ class YA {
3071
3088
  }
3072
3089
  }
3073
3090
  }
3074
- class NQ {
3091
+ class UQ {
3075
3092
  planes_;
3076
3093
  constructor(A) {
3077
3094
  this.planes_ = [
@@ -3117,7 +3134,7 @@ class NQ {
3117
3134
  return !0;
3118
3135
  }
3119
3136
  }
3120
- class lB extends bA {
3137
+ class fB extends bA {
3121
3138
  projectionMatrix_ = z();
3122
3139
  near_ = 0;
3123
3140
  far_ = 0;
@@ -3139,7 +3156,7 @@ class lB extends bA {
3139
3156
  return q(A[4], A[5], A[6]);
3140
3157
  }
3141
3158
  get frustum() {
3142
- return new NQ(
3159
+ return new UQ(
3143
3160
  jA(z(), this.projectionMatrix, this.viewMatrix)
3144
3161
  );
3145
3162
  }
@@ -3158,7 +3175,7 @@ class lB extends bA {
3158
3175
  I,
3159
3176
  B
3160
3177
  );
3161
- PC(C, C, 1 / C[3]);
3178
+ OC(C, C, 1 / C[3]);
3162
3179
  const Q = zA(
3163
3180
  fA(),
3164
3181
  C,
@@ -3167,12 +3184,12 @@ class lB extends bA {
3167
3184
  return q(Q[0], Q[1], Q[2]);
3168
3185
  }
3169
3186
  }
3170
- const fB = 1.77, $g = 128, AB = 128 / fB;
3171
- class lo extends lB {
3187
+ const pB = 1.77, $g = 128, AB = 128 / pB;
3188
+ class po extends fB {
3172
3189
  // width_ and height_ should always be defined by constructor (see setFrame)
3173
3190
  width_ = $g;
3174
3191
  height_ = AB;
3175
- viewportAspectRatio_ = fB;
3192
+ viewportAspectRatio_ = pB;
3176
3193
  viewportSize_ = [$g, AB];
3177
3194
  constructor(A, I, B, C, Q = 0, E = 100) {
3178
3195
  super(), this.near_ = Q, this.far_ = E, this.setFrame(A, I, C, B), this.updateProjectionMatrix();
@@ -3212,7 +3229,7 @@ class lo extends lB {
3212
3229
  updateProjectionMatrix() {
3213
3230
  const A = this.width_, I = this.height_, B = A / I;
3214
3231
  let C = 0.5 * A, Q = 0.5 * I;
3215
- this.viewportAspectRatio_ > B ? C *= this.viewportAspectRatio_ / B : Q *= B / this.viewportAspectRatio_, this.viewportSize_ = [2 * C, 2 * Q], qC(
3232
+ this.viewportAspectRatio_ > B ? C *= this.viewportAspectRatio_ / B : Q *= B / this.viewportAspectRatio_, this.viewportSize_ = [2 * C, 2 * Q], lC(
3216
3233
  this.projectionMatrix_,
3217
3234
  -C,
3218
3235
  C,
@@ -3223,14 +3240,14 @@ class lo extends lB {
3223
3240
  );
3224
3241
  }
3225
3242
  }
3226
- const cQ = 60, UQ = 1.77, rI = 0.1, $I = 180 - rI;
3227
- class fo extends lB {
3243
+ const kQ = 60, LQ = 1.77, rI = 0.1, $I = 180 - rI;
3244
+ class mo extends fB {
3228
3245
  fov_;
3229
3246
  aspectRatio_;
3230
3247
  constructor(A = {}) {
3231
3248
  const {
3232
- fov: I = cQ,
3233
- aspectRatio: B = UQ,
3249
+ fov: I = kQ,
3250
+ aspectRatio: B = LQ,
3234
3251
  near: C = 0.1,
3235
3252
  far: Q = 1e4,
3236
3253
  position: E = q(0, 0, 0)
@@ -3256,9 +3273,9 @@ class fo extends lB {
3256
3273
  this.fov_ = Math.max(rI, Math.min($I, this.fov_ / A)), this.updateProjectionMatrix();
3257
3274
  }
3258
3275
  updateProjectionMatrix() {
3259
- KC(
3276
+ HC(
3260
3277
  this.projectionMatrix_,
3261
- LC(this.fov),
3278
+ JC(this.fov),
3262
3279
  this.aspectRatio_,
3263
3280
  this.near_,
3264
3281
  this.far_
@@ -3266,7 +3283,7 @@ class fo extends lB {
3266
3283
  }
3267
3284
  }
3268
3285
  const IB = 0;
3269
- class po {
3286
+ class uo {
3270
3287
  camera_;
3271
3288
  dragActive_ = !1;
3272
3289
  dragStart_ = f();
@@ -3334,8 +3351,8 @@ class gB {
3334
3351
  );
3335
3352
  }
3336
3353
  }
3337
- const Ag = -1, BB = 0, kQ = 1, CB = 9e-3, LQ = 1e-3, JQ = 9e-4, YQ = 0.5, dQ = 60;
3338
- class mo {
3354
+ const Ag = -1, BB = 0, JQ = 1, CB = 9e-3, YQ = 1e-3, dQ = 9e-4, MQ = 0.5, KQ = 60;
3355
+ class To {
3339
3356
  camera_;
3340
3357
  orbitVelocity_ = new gB(0, 0, 0);
3341
3358
  panVelocity_ = f();
@@ -3349,7 +3366,7 @@ class mo {
3349
3366
  I?.yaw ?? 0,
3350
3367
  I?.pitch ?? 0
3351
3368
  ), I?.target && KA(this.currCenter_, I.target), this.dampingFactor_ = NA(
3352
- I?.dampingFactor ?? YQ,
3369
+ I?.dampingFactor ?? MQ,
3353
3370
  0,
3354
3371
  1
3355
3372
  ), this.updateCamera();
@@ -3380,7 +3397,7 @@ class mo {
3380
3397
  this.currPos_.phi += this.orbitVelocity_.phi, this.currPos_.theta += this.orbitVelocity_.theta, this.currPos_.radius += this.orbitVelocity_.radius * this.currPos_.radius, qA(this.currCenter_, this.currCenter_, this.panVelocity_);
3381
3398
  const I = Math.PI / 2 - p;
3382
3399
  this.currPos_.theta = NA(this.currPos_.theta, -I, I), this.currPos_.radius = Math.max(0.01, this.currPos_.radius), this.updateCamera();
3383
- const B = Math.pow(1 - this.dampingFactor_, A * dQ);
3400
+ const B = Math.pow(1 - this.dampingFactor_, A * KQ);
3384
3401
  this.orbitVelocity_.phi *= B, this.orbitVelocity_.theta *= B, this.orbitVelocity_.radius *= B, lA(this.panVelocity_, this.panVelocity_, B), this.cutoffLowVelocity();
3385
3402
  }
3386
3403
  onPointerDown(A) {
@@ -3389,7 +3406,7 @@ class mo {
3389
3406
  }
3390
3407
  onPointerMove(A) {
3391
3408
  if (this.currMouseButton_ == Ag) return;
3392
- const I = A.event, B = I.movementX ?? 0, C = I.movementY ?? 0, Q = this.currMouseButton_ === BB && !I.shiftKey, E = this.currMouseButton_ === BB && I.shiftKey || this.currMouseButton_ === kQ;
3409
+ const I = A.event, B = I.movementX ?? 0, C = I.movementY ?? 0, Q = this.currMouseButton_ === BB && !I.shiftKey, E = this.currMouseButton_ === BB && I.shiftKey || this.currMouseButton_ === JQ;
3393
3410
  Q && this.orbit(B, C), E && this.pan(B, C);
3394
3411
  }
3395
3412
  onWheel(A) {
@@ -3407,18 +3424,18 @@ class mo {
3407
3424
  this.orbitVelocity_.phi -= A * CB, this.orbitVelocity_.theta += I * CB;
3408
3425
  }
3409
3426
  pan(A, I) {
3410
- const B = this.currPos_.radius * LQ, C = f();
3427
+ const B = this.currPos_.radius * YQ, C = f();
3411
3428
  cI(C, C, this.camera_.right, A), cI(C, C, this.camera_.up, I), lA(C, C, B), UI(this.panVelocity_, this.panVelocity_, C);
3412
3429
  }
3413
3430
  zoom(A) {
3414
- this.orbitVelocity_.radius += A * JQ;
3431
+ this.orbitVelocity_.radius += A * dQ;
3415
3432
  }
3416
3433
  updateCamera() {
3417
3434
  const A = qA(f(), this.currCenter_, this.currPos_.toVec3());
3418
3435
  this.camera_.transform.setTranslation(A), this.camera_.transform.targetTo(this.currCenter_);
3419
3436
  }
3420
3437
  cutoffLowVelocity() {
3421
- Math.abs(this.orbitVelocity_.phi) < p && (this.orbitVelocity_.phi = 0), Math.abs(this.orbitVelocity_.theta) < p && (this.orbitVelocity_.theta = 0), Math.abs(this.orbitVelocity_.radius) < p && (this.orbitVelocity_.radius = 0), eg(this.panVelocity_) < p && xC(this.panVelocity_);
3438
+ Math.abs(this.orbitVelocity_.phi) < p && (this.orbitVelocity_.phi = 0), Math.abs(this.orbitVelocity_.theta) < p && (this.orbitVelocity_.theta = 0), Math.abs(this.orbitVelocity_.radius) < p && (this.orbitVelocity_.radius = 0), eg(this.panVelocity_) < p && WC(this.panVelocity_);
3422
3439
  }
3423
3440
  }
3424
3441
  class wA {
@@ -3603,7 +3620,7 @@ class wg extends bA {
3603
3620
  };
3604
3621
  }
3605
3622
  }
3606
- class uo extends wA {
3623
+ class xo extends wA {
3607
3624
  type = "AxesLayer";
3608
3625
  constructor(A) {
3609
3626
  super();
@@ -3639,7 +3656,7 @@ function Ig(g) {
3639
3656
  width: I
3640
3657
  });
3641
3658
  }
3642
- class To extends wA {
3659
+ class Wo extends wA {
3643
3660
  type = "ProjectedLineLayer";
3644
3661
  paths_ = [];
3645
3662
  constructor(A = []) {
@@ -3656,10 +3673,10 @@ class To extends wA {
3656
3673
  // TODO: this is temporary - we may want to generalize this to all layers
3657
3674
  // for now it is used to set the initial camera position to be centered on the tracks
3658
3675
  get extent() {
3659
- return MQ(this.paths_.flat());
3676
+ return HQ(this.paths_.flat());
3660
3677
  }
3661
3678
  }
3662
- function MQ(g) {
3679
+ function HQ(g) {
3663
3680
  function A(o) {
3664
3681
  const a = g.map((s) => s[o]);
3665
3682
  return [Math.min(...a), Math.max(...a)];
@@ -3667,7 +3684,7 @@ function MQ(g) {
3667
3684
  const [I, B] = A(0), [C, Q] = A(1), [E, i] = A(2);
3668
3685
  return { xMin: I, xMax: B, yMin: C, yMax: Q, zMin: E, zMax: i };
3669
3686
  }
3670
- class xo extends wA {
3687
+ class bo extends wA {
3671
3688
  type = "TracksLayer";
3672
3689
  tracks_ = [];
3673
3690
  constructor(A = []) {
@@ -3677,7 +3694,7 @@ class xo extends wA {
3677
3694
  this.tracks_.push(A);
3678
3695
  let I;
3679
3696
  if (A.interpolation) {
3680
- const i = HQ({
3697
+ const i = lQ({
3681
3698
  path: A.path,
3682
3699
  pointsPerSegment: A.interpolation.pointsPerSegment,
3683
3700
  tangentFactor: A.interpolation.tangentFactor
@@ -3708,10 +3725,10 @@ class xo extends wA {
3708
3725
  // for now it is used to set the initial camera position to be centered on the tracks
3709
3726
  get extent() {
3710
3727
  const A = this.tracks_.map((I) => I.path);
3711
- return KQ(A.flat());
3728
+ return qQ(A.flat());
3712
3729
  }
3713
3730
  }
3714
- function KQ(g) {
3731
+ function qQ(g) {
3715
3732
  function A(o) {
3716
3733
  const a = g.map((s) => s[o]);
3717
3734
  return [Math.min(...a), Math.max(...a)];
@@ -3719,12 +3736,12 @@ function KQ(g) {
3719
3736
  const [I, B] = A(0), [C, Q] = A(1), [E, i] = A(2);
3720
3737
  return { xMin: I, xMax: B, yMin: C, yMax: Q, zMin: E, zMax: i };
3721
3738
  }
3722
- function HQ({
3739
+ function lQ({
3723
3740
  path: g,
3724
3741
  pointsPerSegment: A,
3725
3742
  tangentFactor: I = 1 / 3
3726
3743
  }) {
3727
- const B = qQ(g), C = Array((g.length - 1) * A);
3744
+ const B = fQ(g), C = Array((g.length - 1) * A);
3728
3745
  for (let Q = 0; Q < g.length - 1; Q++) {
3729
3746
  const E = g[Q], i = g[Q + 1], o = gA(B[Q]);
3730
3747
  cI(o, E, o, I);
@@ -3732,12 +3749,12 @@ function HQ({
3732
3749
  cI(a, i, a, -I);
3733
3750
  for (let s = 0; s < A; s++) {
3734
3751
  const h = s / A, t = C[Q * A + s] = f();
3735
- TC(t, E, o, a, i, h);
3752
+ xC(t, E, o, a, i, h);
3736
3753
  }
3737
3754
  }
3738
3755
  return C;
3739
3756
  }
3740
- function qQ(g) {
3757
+ function fQ(g) {
3741
3758
  if (g.length < 2)
3742
3759
  throw new Error("Path must contain at least 2 points");
3743
3760
  const A = Array(g.length), I = f(), B = f();
@@ -3767,7 +3784,7 @@ function pA(g) {
3767
3784
  return "float";
3768
3785
  throw new Error("Unsupported buffer type.");
3769
3786
  }
3770
- function lQ(g) {
3787
+ function pQ(g) {
3771
3788
  if (g.dataFormat === "rgb" || g.dataFormat === "rgba")
3772
3789
  return [0, 1];
3773
3790
  switch (g.dataType) {
@@ -3804,7 +3821,7 @@ class Fg extends yg {
3804
3821
  }
3805
3822
  const EB = 32;
3806
3823
  function _A(g, { visible: A, color: I, contrastLimits: B }) {
3807
- return A === void 0 && (A = !0), I === void 0 ? I = l.WHITE : I = l.from(I), g !== null ? B = fQ(B, g) : B === void 0 && (U.debug(
3824
+ return A === void 0 && (A = !0), I === void 0 ? I = l.WHITE : I = l.from(I), g !== null ? B = mQ(B, g) : B === void 0 && (U.debug(
3808
3825
  "Channel",
3809
3826
  "No texture provided, defaulting channel contrast limits to [0, 1]."
3810
3827
  ), B = [0, 1]), {
@@ -3825,22 +3842,22 @@ function ig(g, A) {
3825
3842
  }
3826
3843
  return A.map((I) => _A(g, I));
3827
3844
  }
3828
- function pB(g, A) {
3845
+ function mB(g, A) {
3829
3846
  if (g && g.length !== A)
3830
3847
  throw new Error(
3831
3848
  `channelProps length (${g.length}) must match source channel count (${A}).`
3832
3849
  );
3833
3850
  }
3834
- function fQ(g, A) {
3851
+ function mQ(g, A) {
3835
3852
  if (g === void 0)
3836
- return lQ(A);
3853
+ return pQ(A);
3837
3854
  if (g[1] <= g[0])
3838
3855
  throw new Error(
3839
3856
  `Contrast limits must be strictly increasing: ${g}.`
3840
3857
  );
3841
3858
  return g;
3842
3859
  }
3843
- class mB extends WA {
3860
+ class uB extends WA {
3844
3861
  constructor(A, I, B, C) {
3845
3862
  super();
3846
3863
  const Q = [], E = [], i = B, o = C, a = i + 1, s = o + 1, h = A / i, t = I / o;
@@ -3874,7 +3891,7 @@ class mB extends WA {
3874
3891
  class rg extends bA {
3875
3892
  channels_;
3876
3893
  constructor(A, I, B, C = []) {
3877
- super(), this.geometry = new mB(A, I, 1, 1), this.setTexture(0, B), this.channels_ = ig(B, C), this.programName = pQ(B);
3894
+ super(), this.geometry = new uB(A, I, 1, 1), this.setTexture(0, B), this.channels_ = ig(B, C), this.programName = uQ(B);
3878
3895
  }
3879
3896
  get type() {
3880
3897
  return "ImageRenderable";
@@ -3919,14 +3936,14 @@ class rg extends bA {
3919
3936
  }
3920
3937
  }
3921
3938
  }
3922
- function pQ(g) {
3939
+ function uQ(g) {
3923
3940
  if (g.type === "Texture2D")
3924
- return mQ(g.dataType);
3941
+ return TQ(g.dataType);
3925
3942
  if (g.type === "Texture2DArray")
3926
- return uQ(g.dataType);
3943
+ return xQ(g.dataType);
3927
3944
  throw new Error(`Unsupported image texture type: ${g.type}`);
3928
3945
  }
3929
- function mQ(g) {
3946
+ function TQ(g) {
3930
3947
  switch (g) {
3931
3948
  case "byte":
3932
3949
  case "int":
@@ -3940,7 +3957,7 @@ function mQ(g) {
3940
3957
  return "floatScalarImage";
3941
3958
  }
3942
3959
  }
3943
- function uQ(g) {
3960
+ function xQ(g) {
3944
3961
  switch (g) {
3945
3962
  case "byte":
3946
3963
  case "int":
@@ -4011,7 +4028,7 @@ function Sg(g, A, I, B, C = 3) {
4011
4028
  case "pointerup": {
4012
4029
  if (!A) return A;
4013
4030
  const Q = g.event, E = Z(Q.clientX, Q.clientY);
4014
- if (zC(A, E) < C) {
4031
+ if (_C(A, E) < C) {
4015
4032
  if (!B) return null;
4016
4033
  const o = g.worldPos;
4017
4034
  if (o) {
@@ -4028,7 +4045,7 @@ function Sg(g, A, I, B, C = 3) {
4028
4045
  return A;
4029
4046
  }
4030
4047
  }
4031
- class uB {
4048
+ class TB {
4032
4049
  bins_ = /* @__PURE__ */ new Map();
4033
4050
  acquire(A) {
4034
4051
  const B = this.bins_.get(A)?.pop();
@@ -4043,13 +4060,13 @@ class uB {
4043
4060
  this.bins_.clear();
4044
4061
  }
4045
4062
  }
4046
- class TB extends wA {
4063
+ class xB extends wA {
4047
4064
  type = "ChunkedImageLayer";
4048
4065
  source_;
4049
4066
  sliceCoords_;
4050
4067
  onPickValue_;
4051
4068
  visibleChunks_ = /* @__PURE__ */ new Map();
4052
- pool_ = new uB();
4069
+ pool_ = new TB();
4053
4070
  initialChannelProps_;
4054
4071
  channelChangeCallbacks_ = [];
4055
4072
  policy_;
@@ -4087,7 +4104,7 @@ class TB extends wA {
4087
4104
  this.policy_
4088
4105
  );
4089
4106
  const I = this.chunkStoreView_.channelCount;
4090
- if (pB(this.channelProps_, I), I > 1 && this.sliceCoords_.c !== void 0 && this.sliceCoords_.c.length > 1)
4107
+ if (mB(this.channelProps_, I), I > 1 && this.sliceCoords_.c !== void 0 && this.sliceCoords_.c.length > 1)
4091
4108
  throw new Error(
4092
4109
  `ChunkedImageLayer requires exactly one channel in sliceCoords.c for multi-channel sources (found ${I} channels). Use one layer per channel.`
4093
4110
  );
@@ -4124,7 +4141,7 @@ class TB extends wA {
4124
4141
  return this.lastPresentationTimeCoord_;
4125
4142
  }
4126
4143
  isPresentationStale() {
4127
- return this.lastPresentationTimeStamp_ === void 0 ? !1 : performance.now() - this.lastPresentationTimeStamp_ > TB.STALE_PRESENTATION_MS_;
4144
+ return this.lastPresentationTimeStamp_ === void 0 ? !1 : performance.now() - this.lastPresentationTimeStamp_ > xB.STALE_PRESENTATION_MS_;
4128
4145
  }
4129
4146
  resliceIfZChanged() {
4130
4147
  const A = this.sliceCoords_.z;
@@ -4257,6 +4274,9 @@ class TB extends wA {
4257
4274
  throw new Error(`Callback to remove could not be found: ${A}`);
4258
4275
  this.channelChangeCallbacks_.splice(I, 1);
4259
4276
  }
4277
+ getVisibleDataRange() {
4278
+ return qB(this.visibleChunks_.keys());
4279
+ }
4260
4280
  releaseAndRemoveChunks(A) {
4261
4281
  for (const I of A) {
4262
4282
  const B = this.visibleChunks_.get(I);
@@ -4271,7 +4291,7 @@ function iB(g) {
4271
4291
  `align${g.rowAlignmentBytes}`
4272
4292
  ].join(":");
4273
4293
  }
4274
- class TQ extends WA {
4294
+ class WQ extends WA {
4275
4295
  constructor(A, I, B, C, Q, E) {
4276
4296
  super();
4277
4297
  const i = [], o = [], a = Math.floor(C), s = Math.floor(Q), h = Math.floor(E);
@@ -4371,13 +4391,13 @@ class XA extends Fg {
4371
4391
  return B.unpackAlignment = A.rowAlignmentBytes, B;
4372
4392
  }
4373
4393
  }
4374
- class xQ extends bA {
4394
+ class bQ extends bA {
4375
4395
  voxelScale = q(1, 1, 1);
4376
4396
  channels_;
4377
4397
  channelToTextureIndex_ = /* @__PURE__ */ new Map();
4378
4398
  loadedChannels_ = /* @__PURE__ */ new Set();
4379
4399
  constructor() {
4380
- super(), this.geometry = new TQ(1, 1, 1, 1, 1, 1), this.cullFaceMode = "front", this.depthTest = !1, this.channels_ = [];
4400
+ super(), this.geometry = new WQ(1, 1, 1, 1, 1, 1), this.cullFaceMode = "front", this.depthTest = !1, this.channels_ = [];
4381
4401
  }
4382
4402
  get type() {
4383
4403
  return "VolumeRenderable";
@@ -4389,7 +4409,7 @@ class xQ extends bA {
4389
4409
  addChannelTexture(A, I) {
4390
4410
  const B = XA.createWithChunk(I), C = this.textures.length;
4391
4411
  this.setTexture(C, B), this.channelToTextureIndex_.set(A, C);
4392
- const Q = WQ(B.dataType);
4412
+ const Q = ZQ(B.dataType);
4393
4413
  if (this.programName && this.programName !== Q)
4394
4414
  throw new Error(
4395
4415
  `Volume renderable does not support multiple channels with different data types. Existing program: ${this.programName}, new channel data type: ${B.dataType} and program: ${Q}`
@@ -4477,7 +4497,7 @@ class xQ extends bA {
4477
4497
  this.channels_[A] = C;
4478
4498
  }
4479
4499
  }
4480
- function WQ(g) {
4500
+ function ZQ(g) {
4481
4501
  switch (g) {
4482
4502
  case "byte":
4483
4503
  case "int":
@@ -4491,7 +4511,7 @@ function WQ(g) {
4491
4511
  return "floatVolume";
4492
4512
  }
4493
4513
  }
4494
- function bQ(g, A) {
4514
+ function PQ(g, A) {
4495
4515
  const I = A.position, B = f(), C = f();
4496
4516
  return g.sort((Q, E) => {
4497
4517
  qA(B, Q.boundingBox.max, Q.boundingBox.min), lA(B, B, 0.5), qA(C, E.boundingBox.max, E.boundingBox.min), lA(C, C, 0.5);
@@ -4499,19 +4519,20 @@ function bQ(g, A) {
4499
4519
  return i - o;
4500
4520
  }), g;
4501
4521
  }
4502
- const ZQ = 2;
4503
- class Wo extends wA {
4522
+ const OQ = 2;
4523
+ class Zo extends wA {
4504
4524
  type = "VolumeLayer";
4505
4525
  source_;
4506
4526
  sliceCoords_;
4507
4527
  currentVolumes_ = /* @__PURE__ */ new Map();
4508
4528
  volumeToPoolKey_ = /* @__PURE__ */ new Map();
4509
- pool_ = new uB();
4529
+ pool_ = new TB();
4510
4530
  initialChannelProps_;
4511
4531
  channelChangeCallbacks_ = [];
4512
4532
  sourcePolicy_;
4513
4533
  chunkStoreView_;
4514
4534
  channelProps_;
4535
+ visibleChunks_ = [];
4515
4536
  lastLoadedTime_ = void 0;
4516
4537
  lastNumRenderedChannelChunks_ = void 0;
4517
4538
  interactiveStepSizeScale_ = 1;
@@ -4560,6 +4581,9 @@ class Wo extends wA {
4560
4581
  throw new Error(`Callback to remove could not be found: ${A}`);
4561
4582
  this.channelChangeCallbacks_.splice(I, 1);
4562
4583
  }
4584
+ getVisibleDataRange() {
4585
+ return qB(this.visibleChunks_);
4586
+ }
4563
4587
  constructor({ source: A, sliceCoords: I, policy: B, channelProps: C }) {
4564
4588
  super({ transparent: !0, blendMode: "premultiplied" }), this.source_ = A, this.sliceCoords_ = I, this.sourcePolicy_ = B, this.initialChannelProps_ = C, this.channelProps_ = C, this.setState("initialized");
4565
4589
  }
@@ -4569,7 +4593,7 @@ class Wo extends wA {
4569
4593
  for (const E of I) B.updateVolumeWithChunk(E);
4570
4594
  return B;
4571
4595
  }
4572
- const C = VQ(I[0]), Q = this.pool_.acquire(C) ?? new xQ();
4596
+ const C = XQ(I[0]), Q = this.pool_.acquire(C) ?? new bQ();
4573
4597
  Q.setChannelProps(this.channelProps_ ?? []), this.volumeToPoolKey_.set(Q, C);
4574
4598
  for (const E of I) Q.updateVolumeWithChunk(E);
4575
4599
  return this.updateVolumeTransform(Q, I[0]), Q;
@@ -4578,7 +4602,7 @@ class Wo extends wA {
4578
4602
  this.chunkStoreView_ = await A.chunkManager.addView(
4579
4603
  this.source_,
4580
4604
  this.sourcePolicy_
4581
- ), pB(
4605
+ ), mB(
4582
4606
  this.channelProps_,
4583
4607
  this.chunkStoreView_.channelCount
4584
4608
  );
@@ -4594,7 +4618,9 @@ class Wo extends wA {
4594
4618
  if (!this.chunkStoreView_) return;
4595
4619
  const A = this.chunkStoreView_.getChunksToRender(
4596
4620
  this.sliceCoords_
4597
- ), I = this.sliceCoords_.t ?? -1, B = OQ(A);
4621
+ );
4622
+ this.visibleChunks_ = A;
4623
+ const I = this.sliceCoords_.t ?? -1, B = vQ(A);
4598
4624
  if (this.lastLoadedTime_ !== I || B.size !== this.currentVolumes_.size || this.lastNumRenderedChannelChunks_ !== A.length) {
4599
4625
  for (const [Q, E] of this.currentVolumes_)
4600
4626
  B.has(Q) || (this.releaseAndRemoveVolume(E), this.currentVolumes_.delete(Q));
@@ -4638,7 +4664,7 @@ class Wo extends wA {
4638
4664
  A.viewport
4639
4665
  );
4640
4666
  const I = A.viewport.cameraControls?.isMoving ?? !1;
4641
- this.interactiveStepSizeScale_ = I ? ZQ : 1, this.updateChunks(), bQ(this.objects, A.viewport.camera);
4667
+ this.interactiveStepSizeScale_ = I ? OQ : 1, this.updateChunks(), PQ(this.objects, A.viewport.camera);
4642
4668
  }
4643
4669
  getUniforms() {
4644
4670
  return {
@@ -4649,27 +4675,27 @@ class Wo extends wA {
4649
4675
  };
4650
4676
  }
4651
4677
  }
4652
- function PQ(g) {
4678
+ function VQ(g) {
4653
4679
  const { x: A, y: I, z: B, t: C } = g.chunkIndex;
4654
4680
  return `${A}:${I}:${B}:${C}`;
4655
4681
  }
4656
- function OQ(g) {
4682
+ function vQ(g) {
4657
4683
  const A = /* @__PURE__ */ new Map();
4658
4684
  for (const I of g) {
4659
- const B = PQ(I);
4685
+ const B = VQ(I);
4660
4686
  let C = A.get(B);
4661
4687
  C || (C = [], A.set(B, C)), C.push(I);
4662
4688
  }
4663
4689
  return A;
4664
4690
  }
4665
- function VQ(g) {
4691
+ function XQ(g) {
4666
4692
  return [
4667
4693
  `lod${g.lod}`,
4668
4694
  `shape${g.shape.x}x${g.shape.y}x${g.shape.z}`,
4669
4695
  `align${g.rowAlignmentBytes}`
4670
4696
  ].join(":");
4671
4697
  }
4672
- class bo extends wA {
4698
+ class Po extends wA {
4673
4699
  type = "ImageLayer";
4674
4700
  source_;
4675
4701
  region_;
@@ -4816,7 +4842,7 @@ class $A extends Fg {
4816
4842
  return C.unpackAlignment = A.rowAlignmentBytes, C;
4817
4843
  }
4818
4844
  }
4819
- const vQ = [
4845
+ const jQ = [
4820
4846
  [1, 0.5, 0.5],
4821
4847
  [0.5, 1, 0.5],
4822
4848
  [0.5, 0.5, 1],
@@ -4824,7 +4850,7 @@ const vQ = [
4824
4850
  [1, 0.5, 1],
4825
4851
  [1, 1, 0.5]
4826
4852
  ];
4827
- function XQ(g) {
4853
+ function zQ(g) {
4828
4854
  return g = g ?? /* @__PURE__ */ new Map(), new Map(
4829
4855
  Array.from(g.entries()).map(([A, I]) => [
4830
4856
  A,
@@ -4832,37 +4858,37 @@ function XQ(g) {
4832
4858
  ])
4833
4859
  );
4834
4860
  }
4835
- function jQ(g) {
4836
- return g = g ?? vQ, g.map(l.from);
4861
+ function _Q(g) {
4862
+ return g = g ?? jQ, g.map(l.from);
4837
4863
  }
4838
4864
  class oB {
4839
4865
  lookupTable;
4840
4866
  cycle;
4841
4867
  constructor(A = {}) {
4842
- this.lookupTable = XQ(A.lookupTable), this.cycle = jQ(A.cycle);
4868
+ this.lookupTable = zQ(A.lookupTable), this.cycle = _Q(A.cycle);
4843
4869
  }
4844
4870
  }
4845
- const zQ = /* @__PURE__ */ new Set([
4871
+ const $Q = /* @__PURE__ */ new Set([
4846
4872
  "unsigned_byte",
4847
4873
  "unsigned_short",
4848
4874
  "unsigned_int"
4849
4875
  ]);
4850
- function _Q(g) {
4876
+ function AE(g) {
4851
4877
  if (g.dataFormat !== "scalar")
4852
4878
  throw new Error(
4853
4879
  `Image data format must be scalar, instead found: ${g.dataFormat}`
4854
4880
  );
4855
- if (!zQ.has(g.dataType))
4881
+ if (!$Q.has(g.dataType))
4856
4882
  throw new Error(
4857
4883
  `Image data type must be unsigned, instead found: ${g.dataType}`
4858
4884
  );
4859
4885
  return g;
4860
4886
  }
4861
- class $Q extends bA {
4887
+ class IE extends bA {
4862
4888
  outlineSelected_;
4863
4889
  selectedValue_;
4864
4890
  constructor(A) {
4865
- super(), this.geometry = new mB(A.width, A.height, 1, 1), this.setTexture(0, _Q(A.imageData));
4891
+ super(), this.geometry = new uB(A.width, A.height, 1, 1), this.setTexture(0, AE(A.imageData));
4866
4892
  const I = this.makeColorCycleTexture(A.colorMap.cycle);
4867
4893
  this.setTexture(1, I);
4868
4894
  const B = this.makeColorLookupTableTexture(
@@ -4900,7 +4926,7 @@ class $Q extends bA {
4900
4926
  return Q.set(I, 0), Q.set(B, C), new $A(Q, C, 2);
4901
4927
  }
4902
4928
  }
4903
- class Zo extends wA {
4929
+ class Oo extends wA {
4904
4930
  type = "LabelImageLayer";
4905
4931
  source_;
4906
4932
  region_;
@@ -4965,7 +4991,7 @@ class Zo extends wA {
4965
4991
  }
4966
4992
  createImage(A) {
4967
4993
  this.imageChunk_ = A;
4968
- const I = new $Q({
4994
+ const I = new IE({
4969
4995
  width: A.shape.x,
4970
4996
  height: A.shape.y,
4971
4997
  imageData: $A.createWithChunk(A),
@@ -4994,7 +5020,7 @@ class TI extends Error {
4994
5020
  super(A), this.name = "AbortError", Object.setPrototypeOf(this, TI.prototype);
4995
5021
  }
4996
5022
  }
4997
- class AE {
5023
+ class gE {
4998
5024
  maxConcurrent_;
4999
5025
  pending_ = [];
5000
5026
  abortController_ = new AbortController();
@@ -5038,12 +5064,12 @@ class AE {
5038
5064
  return this.pending_.length;
5039
5065
  }
5040
5066
  }
5041
- class IE {
5067
+ class BE {
5042
5068
  source_;
5043
5069
  region_;
5044
5070
  seriesDimensionName_;
5045
5071
  seriesIndex_;
5046
- scheduler_ = new AE(16);
5072
+ scheduler_ = new gE(16);
5047
5073
  lod_;
5048
5074
  loader_ = null;
5049
5075
  seriesAttributes_;
@@ -5156,7 +5182,7 @@ class IE {
5156
5182
  return this.loader_ ??= await this.source_.open(), this.loader_;
5157
5183
  }
5158
5184
  }
5159
- class Po extends wA {
5185
+ class Vo extends wA {
5160
5186
  type = "ImageSeriesLayer";
5161
5187
  seriesLoader_;
5162
5188
  initialChannelProps_;
@@ -5173,7 +5199,7 @@ class Po extends wA {
5173
5199
  lod: Q,
5174
5200
  ...E
5175
5201
  }) {
5176
- super(E), this.setState("initialized"), this.channelProps_ = C, this.initialChannelProps_ = C, this.seriesLoader_ = new IE({
5202
+ super(E), this.setState("initialized"), this.channelProps_ = C, this.initialChannelProps_ = C, this.seriesLoader_ = new BE({
5177
5203
  source: A,
5178
5204
  region: I,
5179
5205
  seriesDimensionName: B,
@@ -5239,7 +5265,7 @@ class Po extends wA {
5239
5265
  return C.transform.setScale([A.scale.x, A.scale.y, 1]), C.transform.setTranslation([A.offset.x, A.offset.y, 0]), C;
5240
5266
  }
5241
5267
  }
5242
- function xB(g, A, I, B = {}) {
5268
+ function WB(g, A, I, B = {}) {
5243
5269
  return A !== void 0 && I !== void 0 && (B = {
5244
5270
  ...B,
5245
5271
  headers: {
@@ -5248,7 +5274,7 @@ function xB(g, A, I, B = {}) {
5248
5274
  }
5249
5275
  }), fetch(g, B);
5250
5276
  }
5251
- function gE(g, A) {
5277
+ function CE(g, A) {
5252
5278
  return {
5253
5279
  ...g,
5254
5280
  ...A,
@@ -5271,7 +5297,7 @@ async function sB(g) {
5271
5297
  throw new Error(`Unexpected response status ${g.status} ${g.statusText}`);
5272
5298
  }
5273
5299
  }
5274
- async function BE(g, A, I, B) {
5300
+ async function QE(g, A, I, B) {
5275
5301
  if (B)
5276
5302
  return fetch(g, {
5277
5303
  ...I,
@@ -5281,7 +5307,7 @@ async function BE(g, A, I, B) {
5281
5307
  if (!C.ok)
5282
5308
  return C;
5283
5309
  let Q = C.headers.get("Content-Length"), E = Number(Q);
5284
- return xB(g, E - A, E, I);
5310
+ return WB(g, E - A, E, I);
5285
5311
  }
5286
5312
  class ZA {
5287
5313
  url;
@@ -5291,7 +5317,7 @@ class ZA {
5291
5317
  this.url = A, this.#A = I.overrides ?? {}, this.#I = I.useSuffixRequest ?? !1;
5292
5318
  }
5293
5319
  #g(A) {
5294
- return gE(this.#A, A);
5320
+ return CE(this.#A, A);
5295
5321
  }
5296
5322
  async get(A, I = {}) {
5297
5323
  let B = aB(this.url, A).href, C = await fetch(B, this.#g(I));
@@ -5299,10 +5325,10 @@ class ZA {
5299
5325
  }
5300
5326
  async getRange(A, I, B = {}) {
5301
5327
  let C = aB(this.url, A), Q = this.#g(B), E;
5302
- return "suffixLength" in I ? E = await BE(C, I.suffixLength, Q, this.#I) : E = await xB(C, I.offset, I.length, Q), sB(E);
5328
+ return "suffixLength" in I ? E = await QE(C, I.suffixLength, Q, this.#I) : E = await WB(C, I.offset, I.length, Q), sB(E);
5303
5329
  }
5304
5330
  }
5305
- class WB {
5331
+ class bB {
5306
5332
  #A;
5307
5333
  constructor(A, I, B) {
5308
5334
  typeof A == "number" ? this.#A = new Uint8Array(A) : A instanceof ArrayBuffer ? this.#A = new Uint8Array(A, I, B) : this.#A = new Uint8Array(Array.from(A, (C) => C ? 1 : 0));
@@ -5452,7 +5478,7 @@ function DB(g, A) {
5452
5478
  for (let E = 0; E < I; E += 1)
5453
5479
  C = g[Q + E], g[Q + E] = g[Q + B - E], g[Q + B - E] = C;
5454
5480
  }
5455
- function bB(g) {
5481
+ function ZB(g) {
5456
5482
  if (g === "v2:object")
5457
5483
  return globalThis.Array;
5458
5484
  let A = g.match(/v2:([US])(\d+)/);
@@ -5472,7 +5498,7 @@ function bB(g) {
5472
5498
  float16: globalThis.Float16Array,
5473
5499
  float32: Float32Array,
5474
5500
  float64: Float64Array,
5475
- bool: WB
5501
+ bool: bB
5476
5502
  }[g];
5477
5503
  return W(I, `Unknown or unsupported data_type: ${g}`), I;
5478
5504
  }
@@ -5484,7 +5510,7 @@ function cA(g, A) {
5484
5510
  C[A[Q]] = B, B *= g[A[Q]];
5485
5511
  return C;
5486
5512
  }
5487
- function CE({ name: g, configuration: A }) {
5513
+ function EE({ name: g, configuration: A }) {
5488
5514
  if (g === "default") {
5489
5515
  const I = A?.separator ?? "/";
5490
5516
  return (B) => ["c", ...B].join(I);
@@ -5495,7 +5521,7 @@ function CE({ name: g, configuration: A }) {
5495
5521
  }
5496
5522
  throw new Error(`Unknown chunk key encoding: ${g}`);
5497
5523
  }
5498
- function QE(g) {
5524
+ function iE(g) {
5499
5525
  if (g === "|O")
5500
5526
  return { data_type: "v2:object" };
5501
5527
  let A = g.match(/^([<|>])(.*)$/);
@@ -5516,8 +5542,8 @@ function QE(g) {
5516
5542
  }[B] ?? (B.startsWith("S") || B.startsWith("U") ? `v2:${B}` : void 0);
5517
5543
  return W(C, `Unsupported or unknown dtype: ${g}`), I === "|" ? { data_type: C } : { data_type: C, endian: I === "<" ? "little" : "big" };
5518
5544
  }
5519
- function EE(g, A = {}) {
5520
- let I = [], B = QE(g.dtype);
5545
+ function oE(g, A = {}) {
5546
+ let I = [], B = iE(g.dtype);
5521
5547
  g.order === "F" && I.push({ name: "transpose", configuration: { order: "F" } }), "endian" in B && B.endian === "big" && I.push({ name: "bytes", configuration: { endian: "big" } });
5522
5548
  for (let { id: C, ...Q } of g.filters ?? [])
5523
5549
  I.push({ name: C, configuration: Q });
@@ -5547,14 +5573,14 @@ function EE(g, A = {}) {
5547
5573
  attributes: A
5548
5574
  };
5549
5575
  }
5550
- function iE(g, A = {}) {
5576
+ function aE(g, A = {}) {
5551
5577
  return {
5552
5578
  zarr_format: 3,
5553
5579
  node_type: "group",
5554
5580
  attributes: A
5555
5581
  };
5556
5582
  }
5557
- function oE(g, A) {
5583
+ function sE(g, A) {
5558
5584
  if (A !== "number" && A !== "bigint" && A !== "boolean" && A !== "object" && A !== "string")
5559
5585
  return g === A;
5560
5586
  let I = g === "bool";
@@ -5569,13 +5595,13 @@ function oE(g, A) {
5569
5595
  let Q = g === "v2:object";
5570
5596
  return A === "object" ? Q : !B && !C && !I && !Q;
5571
5597
  }
5572
- function aE(g) {
5598
+ function DE(g) {
5573
5599
  return g?.name === "sharding_indexed";
5574
5600
  }
5575
- function ZB(g) {
5601
+ function PB(g) {
5576
5602
  return (g.data_type === "uint64" || g.data_type === "int64") && g.fill_value != null ? BigInt(g.fill_value) : g.fill_value;
5577
5603
  }
5578
- function PB(g, ...A) {
5604
+ function OB(g, ...A) {
5579
5605
  if (!A.some((I) => g instanceof I))
5580
5606
  throw g;
5581
5607
  }
@@ -5583,7 +5609,7 @@ function W(g, A = "") {
5583
5609
  if (!g)
5584
5610
  throw new Error(A);
5585
5611
  }
5586
- async function OB(g, { format: A, signal: I }) {
5612
+ async function VB(g, { format: A, signal: I }) {
5587
5613
  const B = g instanceof Response ? g : new Response(g);
5588
5614
  W(B.body, "Response does not contain body.");
5589
5615
  try {
@@ -5616,8 +5642,8 @@ class Ng {
5616
5642
  return A;
5617
5643
  }
5618
5644
  }
5619
- const hB = sE();
5620
- function sE() {
5645
+ const hB = hE();
5646
+ function hE() {
5621
5647
  const g = new Uint32Array([305419896]);
5622
5648
  return new Uint8Array(g.buffer, g.byteOffset, g.byteLength)[0] !== 18;
5623
5649
  }
@@ -5632,7 +5658,7 @@ class xI {
5632
5658
  #C;
5633
5659
  #B;
5634
5660
  constructor(A, I) {
5635
- this.#B = A?.endian, this.#I = bB(I.data_type), this.#C = I.shape, this.#A = cA(I.shape, "C");
5661
+ this.#B = A?.endian, this.#I = ZB(I.data_type), this.#C = I.shape, this.#A = cA(I.shape, "C");
5636
5662
  const B = new this.#I(0);
5637
5663
  this.#g = B.BYTES_PER_ELEMENT;
5638
5664
  }
@@ -5672,14 +5698,14 @@ class Ug {
5672
5698
  throw new Error("Gzip encoding is not enabled by default. Please register a custom codec with `numcodecs/gzip`.");
5673
5699
  }
5674
5700
  async decode(A) {
5675
- const I = await OB(A, { format: "gzip" });
5701
+ const I = await VB(A, { format: "gzip" });
5676
5702
  return new Uint8Array(I);
5677
5703
  }
5678
5704
  }
5679
- function DE(g, A) {
5705
+ function tE(g, A) {
5680
5706
  return W(!Number.isNaN(A), "JsonCodec allow_nan is false but NaN was encountered during encoding."), W(A !== Number.POSITIVE_INFINITY, "JsonCodec allow_nan is false but Infinity was encountered during encoding."), W(A !== Number.NEGATIVE_INFINITY, "JsonCodec allow_nan is false but -Infinity was encountered during encoding."), A;
5681
5707
  }
5682
- function hE(g, A) {
5708
+ function yE(g, A) {
5683
5709
  return A instanceof Object && !Array.isArray(A) ? Object.keys(A).sort().reduce((I, B) => (I[B] = A[B], I), {}) : A;
5684
5710
  }
5685
5711
  class kg {
@@ -5709,7 +5735,7 @@ class kg {
5709
5735
  const { indent: I, encoding: B, ensure_ascii: C, check_circular: Q, allow_nan: E, sort_keys: i } = this.#A;
5710
5736
  W(B === "utf-8", "JsonCodec does not yet support non-utf-8 encoding.");
5711
5737
  const o = [];
5712
- W(Q, "JsonCodec does not yet support skipping the check for circular references during encoding."), E || o.push(DE), i && o.push(hE);
5738
+ W(Q, "JsonCodec does not yet support skipping the check for circular references during encoding."), E || o.push(tE), i && o.push(yE);
5713
5739
  const a = Array.from(A.data);
5714
5740
  a.push("|O"), a.push(A.shape);
5715
5741
  let s;
@@ -5735,7 +5761,7 @@ class kg {
5735
5761
  }
5736
5762
  }
5737
5763
  function yB(g) {
5738
- return g instanceof WB || g instanceof Rg || g instanceof yI ? new Proxy(g, {
5764
+ return g instanceof bB || g instanceof Rg || g instanceof yI ? new Proxy(g, {
5739
5765
  get(I, B) {
5740
5766
  return I.get(Number(B));
5741
5767
  },
@@ -5744,7 +5770,7 @@ function yB(g) {
5744
5770
  }
5745
5771
  }) : g;
5746
5772
  }
5747
- function tE(g, A) {
5773
+ function eE(g, A) {
5748
5774
  let I;
5749
5775
  return g.data instanceof Rg || g.data instanceof yI ? I = new g.constructor(
5750
5776
  // @ts-expect-error
@@ -5756,8 +5782,8 @@ function tE(g, A) {
5756
5782
  stride: cA(g.shape, A)
5757
5783
  };
5758
5784
  }
5759
- function yE(g, A) {
5760
- let I = tE(g, A), B = g.shape.length, C = g.data.length, Q = Array(B).fill(0), E = yB(g.data), i = yB(I.data);
5785
+ function GE(g, A) {
5786
+ let I = eE(g, A), B = g.shape.length, C = g.data.length, Q = Array(B).fill(0), E = yB(g.data), i = yB(I.data);
5761
5787
  for (let o = 0; o < C; o++) {
5762
5788
  let a = 0;
5763
5789
  for (let s = 0; s < B; s++)
@@ -5772,12 +5798,12 @@ function yE(g, A) {
5772
5798
  }
5773
5799
  return I;
5774
5800
  }
5775
- function eE(g) {
5801
+ function nE(g) {
5776
5802
  let A = g.shape.length;
5777
5803
  return W(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);
5778
5804
  }
5779
- function GE(g, A) {
5780
- let I = eE(g);
5805
+ function wE(g, A) {
5806
+ let I = nE(g);
5781
5807
  return W(I.length === A.length, "Orders must match"), I.every((B, C) => B === A[C]);
5782
5808
  }
5783
5809
  class Lg {
@@ -5802,7 +5828,7 @@ class Lg {
5802
5828
  return new Lg(A, I);
5803
5829
  }
5804
5830
  encode(A) {
5805
- return GE(A, this.#I) ? A : yE(A, this.#I);
5831
+ return wE(A, this.#I) ? A : GE(A, this.#I);
5806
5832
  }
5807
5833
  decode(A) {
5808
5834
  return {
@@ -5843,14 +5869,14 @@ class Yg {
5843
5869
  throw new Error("Zlib encoding is not enabled by default. Please register a codec with `numcodecs/zlib`.");
5844
5870
  }
5845
5871
  async decode(A) {
5846
- const I = await OB(A, { format: "deflate" });
5872
+ const I = await VB(A, { format: "deflate" });
5847
5873
  return new Uint8Array(I);
5848
5874
  }
5849
5875
  }
5850
- function nE() {
5876
+ function FE() {
5851
5877
  return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-BOWv2fO7.js").then((g) => g.default)).set("lz4", () => import("./lz4-DUlZKApi.js").then((g) => g.default)).set("zstd", () => import("./zstd-DnzmycJs.js").then((g) => g.default)).set("gzip", () => Ug).set("zlib", () => Yg).set("transpose", () => Lg).set("bytes", () => xI).set("crc32c", () => cg).set("vlen-utf8", () => Jg).set("json2", () => kg).set("bitround", () => Ng);
5852
5878
  }
5853
- const wE = nE();
5879
+ const rE = FE();
5854
5880
  function og(g) {
5855
5881
  let A;
5856
5882
  return {
@@ -5876,7 +5902,7 @@ function og(g) {
5876
5902
  }
5877
5903
  async function eB(g) {
5878
5904
  let A = g.codecs.map(async (Q) => {
5879
- let E = await wE.get(Q.name)?.();
5905
+ let E = await rE.get(Q.name)?.();
5880
5906
  return W(E, `Unknown codec: ${Q.name}`), { Codec: E, meta: Q };
5881
5907
  }), I = [], B, C = [];
5882
5908
  for await (let { Codec: Q, meta: E } of A) {
@@ -5892,9 +5918,9 @@ async function eB(g) {
5892
5918
  C.push(i);
5893
5919
  }
5894
5920
  }
5895
- return B || (W(FE(g), `Cannot encode ${g.data_type} to bytes without a codec`), B = xI.fromConfig({ endian: "little" }, g)), { array_to_array: I, array_to_bytes: B, bytes_to_bytes: C };
5921
+ return B || (W(SE(g), `Cannot encode ${g.data_type} to bytes without a codec`), B = xI.fromConfig({ endian: "little" }, g)), { array_to_array: I, array_to_bytes: B, bytes_to_bytes: C };
5896
5922
  }
5897
- function FE(g) {
5923
+ function SE(g) {
5898
5924
  return g.data_type !== "v2:object";
5899
5925
  }
5900
5926
  class GI extends Error {
@@ -5908,7 +5934,7 @@ class dg extends Error {
5908
5934
  }
5909
5935
  }
5910
5936
  const GB = 18446744073709551615n;
5911
- function rE(g, A, I, B) {
5937
+ function RE(g, A, I, B) {
5912
5938
  W(g.store.getRange, "Store does not support range requests");
5913
5939
  let C = g.store.getRange.bind(g.store), Q = A.map((o, a) => o / B.chunk_shape[a]), E = og({
5914
5940
  data_type: "uint64",
@@ -5960,13 +5986,13 @@ function nB(g) {
5960
5986
  return g.find((I) => I.name === "transpose")?.configuration?.order ?? "C";
5961
5987
  }
5962
5988
  const PA = Symbol("zarrita.context");
5963
- function SE(g) {
5989
+ function NE(g) {
5964
5990
  return g[PA];
5965
5991
  }
5966
- function RE(g, A) {
5967
- let { configuration: I } = A.codecs.find(aE) ?? {}, B = {
5968
- encode_chunk_key: CE(A.chunk_key_encoding),
5969
- TypedArray: bB(A.data_type),
5992
+ function cE(g, A) {
5993
+ let { configuration: I } = A.codecs.find(DE) ?? {}, B = {
5994
+ encode_chunk_key: EE(A.chunk_key_encoding),
5995
+ TypedArray: ZB(A.data_type),
5970
5996
  fill_value: A.fill_value
5971
5997
  };
5972
5998
  if (I) {
@@ -5983,7 +6009,7 @@ function RE(g, A) {
5983
6009
  get_strides(E) {
5984
6010
  return cA(E, Q);
5985
6011
  },
5986
- get_chunk_bytes: rE(g, A.chunk_grid.configuration.chunk_shape, B.encode_chunk_key, I)
6012
+ get_chunk_bytes: RE(g, A.chunk_grid.configuration.chunk_shape, B.encode_chunk_key, I)
5987
6013
  };
5988
6014
  }
5989
6015
  let C = nB(A.codecs);
@@ -6012,8 +6038,8 @@ let JI = class extends j {
6012
6038
  constructor(A, I, B) {
6013
6039
  super(A, I), this.#A = {
6014
6040
  ...B,
6015
- fill_value: ZB(B)
6016
- }, this[PA] = RE(this, B);
6041
+ fill_value: PB(B)
6042
+ }, this[PA] = cE(this, B);
6017
6043
  }
6018
6044
  get attrs() {
6019
6045
  return this.#A.attributes;
@@ -6057,15 +6083,15 @@ let JI = class extends j {
6057
6083
  * ```
6058
6084
  */
6059
6085
  is(A) {
6060
- return oE(this.dtype, A);
6086
+ return sE(this.dtype, A);
6061
6087
  }
6062
6088
  };
6063
- function* NE(g, A, I = 1) {
6089
+ function* UE(g, A, I = 1) {
6064
6090
  A === void 0 && (A = g, g = 0);
6065
6091
  for (let B = g; B < A; B += I)
6066
6092
  yield B;
6067
6093
  }
6068
- function* cE(...g) {
6094
+ function* kE(...g) {
6069
6095
  if (g.length === 0)
6070
6096
  return;
6071
6097
  const A = g.map((B) => B[Symbol.iterator]()), I = A.map((B) => B.next());
@@ -6080,7 +6106,7 @@ function* cE(...g) {
6080
6106
  I[B] = A[B].next();
6081
6107
  }
6082
6108
  }
6083
- function UE({ start: g, stop: A, step: I }, B) {
6109
+ function LE({ start: g, stop: A, step: I }, B) {
6084
6110
  if (I === 0)
6085
6111
  throw new Error("slice step cannot be zero");
6086
6112
  I = I ?? 1;
@@ -6094,7 +6120,7 @@ function YI(g, A, I = null) {
6094
6120
  step: I
6095
6121
  };
6096
6122
  }
6097
- function kE() {
6123
+ function JE() {
6098
6124
  const g = [];
6099
6125
  return {
6100
6126
  add: (A) => g.push(A()),
@@ -6106,28 +6132,28 @@ class Kg extends Error {
6106
6132
  super(A), this.name = "IndexError";
6107
6133
  }
6108
6134
  }
6109
- function LE(g, A) {
6135
+ function YE(g, A) {
6110
6136
  throw new Kg(`too many indicies for array; expected ${A.length}, got ${g.length}`);
6111
6137
  }
6112
- function JE(g) {
6138
+ function dE(g) {
6113
6139
  throw new Kg(`index out of bounds for dimension with length ${g}`);
6114
6140
  }
6115
- function YE() {
6141
+ function ME() {
6116
6142
  throw new Kg("only slices with step >= 1 are supported");
6117
6143
  }
6118
- function dE(g, A) {
6119
- g.length > A.length && LE(g, A);
6144
+ function KE(g, A) {
6145
+ g.length > A.length && YE(g, A);
6120
6146
  }
6121
- function ME(g, A) {
6122
- return g = Math.trunc(g), g < 0 && (g = A + g), (g >= A || g < 0) && JE(A), g;
6147
+ function HE(g, A) {
6148
+ return g = Math.trunc(g), g < 0 && (g = A + g), (g >= A || g < 0) && dE(A), g;
6123
6149
  }
6124
- class KE {
6150
+ class qE {
6125
6151
  dim_sel;
6126
6152
  dim_len;
6127
6153
  dim_chunk_len;
6128
6154
  nitems;
6129
6155
  constructor({ dim_sel: A, dim_len: I, dim_chunk_len: B }) {
6130
- A = ME(A, I), this.dim_sel = A, this.dim_len = I, this.dim_chunk_len = B, this.nitems = 1;
6156
+ A = HE(A, I), this.dim_sel = A, this.dim_len = I, this.dim_chunk_len = B, this.nitems = 1;
6131
6157
  }
6132
6158
  *[Symbol.iterator]() {
6133
6159
  const A = Math.floor(this.dim_sel / this.dim_chunk_len), I = A * this.dim_chunk_len, B = this.dim_sel - I;
@@ -6143,12 +6169,12 @@ class wB {
6143
6169
  nitems;
6144
6170
  nchunks;
6145
6171
  constructor({ dim_sel: A, dim_len: I, dim_chunk_len: B }) {
6146
- const [C, Q, E] = UE(A, I);
6147
- this.start = C, this.stop = Q, this.step = E, this.step < 1 && YE(), this.dim_len = I, this.dim_chunk_len = B, this.nitems = Math.max(0, Math.ceil((this.stop - this.start) / this.step)), this.nchunks = Math.ceil(this.dim_len / this.dim_chunk_len);
6172
+ const [C, Q, E] = LE(A, I);
6173
+ this.start = C, this.stop = Q, this.step = E, this.step < 1 && ME(), this.dim_len = I, this.dim_chunk_len = B, this.nitems = Math.max(0, Math.ceil((this.stop - this.start) / this.step)), this.nchunks = Math.ceil(this.dim_len / this.dim_chunk_len);
6148
6174
  }
6149
6175
  *[Symbol.iterator]() {
6150
6176
  const A = Math.floor(this.start / this.dim_chunk_len), I = Math.ceil(this.stop / this.dim_chunk_len);
6151
- for (const B of NE(A, I)) {
6177
+ for (const B of UE(A, I)) {
6152
6178
  const C = B * this.dim_chunk_len, Q = Math.min(this.dim_len, (B + 1) * this.dim_chunk_len), E = Q - C;
6153
6179
  let i = 0, o = 0;
6154
6180
  if (this.start < C) {
@@ -6169,15 +6195,15 @@ class wB {
6169
6195
  }
6170
6196
  }
6171
6197
  }
6172
- function HE(g, A) {
6198
+ function lE(g, A) {
6173
6199
  let I = [];
6174
- return g === null ? I = A.map((B) => YI(null)) : Array.isArray(g) && (I = g.map((B) => B ?? YI(null))), dE(I, A), I;
6200
+ return g === null ? I = A.map((B) => YI(null)) : Array.isArray(g) && (I = g.map((B) => B ?? YI(null))), KE(I, A), I;
6175
6201
  }
6176
- class qE {
6202
+ class fE {
6177
6203
  dim_indexers;
6178
6204
  shape;
6179
6205
  constructor({ selection: A, shape: I, chunk_shape: B }) {
6180
- this.dim_indexers = HE(A, I).map((C, Q) => new (typeof C == "number" ? KE : wB)({
6206
+ this.dim_indexers = lE(A, I).map((C, Q) => new (typeof C == "number" ? qE : wB)({
6181
6207
  // @ts-expect-error ts inference not strong enough to know correct chunk
6182
6208
  dim_sel: C,
6183
6209
  dim_len: I[Q],
@@ -6185,27 +6211,27 @@ class qE {
6185
6211
  })), this.shape = this.dim_indexers.filter((C) => C instanceof wB).map((C) => C.nitems);
6186
6212
  }
6187
6213
  *[Symbol.iterator]() {
6188
- for (const A of cE(...this.dim_indexers)) {
6214
+ for (const A of kE(...this.dim_indexers)) {
6189
6215
  const I = A.map((C) => C.dim_chunk_ix), B = A.map((C) => "dim_out_sel" in C ? { from: C.dim_chunk_sel, to: C.dim_out_sel } : { from: C.dim_chunk_sel, to: null });
6190
6216
  yield { chunk_coords: I, mapping: B };
6191
6217
  }
6192
6218
  }
6193
6219
  }
6194
- function lE(g, A) {
6220
+ function pE(g, A) {
6195
6221
  return "get" in g ? g.get(A) : g[A];
6196
6222
  }
6197
- async function fE(g, A, I, B) {
6198
- let C = SE(g), Q = new qE({
6223
+ async function mE(g, A, I, B) {
6224
+ let C = NE(g), Q = new fE({
6199
6225
  selection: A,
6200
6226
  shape: g.shape,
6201
6227
  chunk_shape: g.chunks
6202
- }), E = B.prepare(new C.TypedArray(Q.shape.reduce((o, a) => o * a, 1)), Q.shape, C.get_strides(Q.shape)), i = I.create_queue?.() ?? kE();
6228
+ }), E = B.prepare(new C.TypedArray(Q.shape.reduce((o, a) => o * a, 1)), Q.shape, C.get_strides(Q.shape)), i = I.create_queue?.() ?? JE();
6203
6229
  for (const { chunk_coords: o, mapping: a } of Q)
6204
6230
  i.add(async () => {
6205
6231
  let { data: s, shape: h, stride: t } = await g.getChunk(o, I.opts), y = B.prepare(s, h, t);
6206
6232
  B.set_from_chunk(E, y, a);
6207
6233
  });
6208
- return await i.onIdle(), Q.shape.length === 0 ? lE(E.data, 0) : E;
6234
+ return await i.onIdle(), Q.shape.length === 0 ? pE(E.data, 0) : E;
6209
6235
  }
6210
6236
  function Hg(g, A = 0, I) {
6211
6237
  let B = I ?? g.length - A;
@@ -6235,32 +6261,32 @@ function gg(g) {
6235
6261
  bytes_per_element: g.data.BYTES_PER_ELEMENT
6236
6262
  };
6237
6263
  }
6238
- function pE(g) {
6264
+ function uE(g) {
6239
6265
  return "chars" in g ? g.constructor.bind(null, g.chars) : g.constructor;
6240
6266
  }
6241
- function mE(g, A) {
6267
+ function TE(g, A) {
6242
6268
  if (globalThis.Array.isArray(g.data))
6243
6269
  return Hg([A]);
6244
- let I = pE(g.data), B = new I([A]);
6270
+ let I = uE(g.data), B = new I([A]);
6245
6271
  return new Uint8Array(B.buffer, B.byteOffset, B.byteLength);
6246
6272
  }
6247
- const uE = {
6273
+ const xE = {
6248
6274
  prepare(g, A, I) {
6249
6275
  return { data: g, shape: A, stride: I };
6250
6276
  },
6251
6277
  set_scalar(g, A, I) {
6252
6278
  let B = gg(g);
6253
- ag(B, A, mE(g, I), B.bytes_per_element);
6279
+ ag(B, A, TE(g, I), B.bytes_per_element);
6254
6280
  },
6255
6281
  set_from_chunk(g, A, I) {
6256
6282
  let B = gg(g);
6257
6283
  SI(B, gg(A), B.bytes_per_element, I);
6258
6284
  }
6259
6285
  };
6260
- async function TE(g, A = null, I = {}) {
6261
- return fE(g, A, I, uE);
6286
+ async function WE(g, A = null, I = {}) {
6287
+ return mE(g, A, I, xE);
6262
6288
  }
6263
- function VB(g, A, I) {
6289
+ function vB(g, A, I) {
6264
6290
  return I < 0 && A < g ? Math.floor((g - A - 1) / -I) + 1 : g < A ? Math.floor((A - g - 1) / I) + 1 : 0;
6265
6291
  }
6266
6292
  function ag(g, A, I, B) {
@@ -6274,7 +6300,7 @@ function ag(g, A, I, B) {
6274
6300
  ag({ data: t, stride: i }, Q, I, B);
6275
6301
  return;
6276
6302
  }
6277
- const [o, a, s] = C, h = VB(o, a, s);
6303
+ const [o, a, s] = C, h = vB(o, a, s);
6278
6304
  if (Q.length === 0) {
6279
6305
  for (let t = 0; t < h; t++)
6280
6306
  g.data.set(I, E * (o + s * t) * B);
@@ -6310,7 +6336,7 @@ function SI(g, A, I, B) {
6310
6336
  }, I, Q);
6311
6337
  return;
6312
6338
  }
6313
- const [s, h, t] = C.to, [y, n, w] = C.from, r = VB(s, h, t);
6339
+ const [s, h, t] = C.to, [y, n, w] = C.from, r = vB(s, h, t);
6314
6340
  if (Q.length === 0) {
6315
6341
  if (t === 1 && w === 1 && E === 1 && o === 1) {
6316
6342
  let G = y * I, c = r * I;
@@ -6332,8 +6358,8 @@ function SI(g, A, I, B) {
6332
6358
  stride: a
6333
6359
  }, I, Q);
6334
6360
  }
6335
- let WI = xE();
6336
- function xE() {
6361
+ let WI = bE();
6362
+ function bE() {
6337
6363
  let g = /* @__PURE__ */ new WeakMap();
6338
6364
  function A(I) {
6339
6365
  let B = g.get(I) ?? { v2: 0, v3: 0 };
@@ -6349,13 +6375,13 @@ function xE() {
6349
6375
  }
6350
6376
  };
6351
6377
  }
6352
- async function WE(g) {
6378
+ async function ZE(g) {
6353
6379
  let A = await g.store.get(g.resolve(".zattrs").path);
6354
6380
  return A ? eI(A) : {};
6355
6381
  }
6356
- async function bE(g, A = {}) {
6382
+ async function PE(g, A = {}) {
6357
6383
  let I = "store" in g ? g : new j(g), B = {};
6358
- return (A.attrs ?? !0) && (B = await WE(I)), A.kind === "array" ? FB(I, B) : A.kind === "group" ? rB(I, B) : FB(I, B).catch((C) => (PB(C, GI), rB(I, B)));
6384
+ return (A.attrs ?? !0) && (B = await ZE(I)), A.kind === "array" ? FB(I, B) : A.kind === "group" ? rB(I, B) : FB(I, B).catch((C) => (OB(C, GI), rB(I, B)));
6359
6385
  }
6360
6386
  async function FB(g, A) {
6361
6387
  let { path: I } = g.resolve(".zarray"), B = await g.store.get(I);
@@ -6363,7 +6389,7 @@ async function FB(g, A) {
6363
6389
  throw new GI("v2 array", {
6364
6390
  cause: new dg(I)
6365
6391
  });
6366
- return WI.increment(g.store, "v2"), new JI(g.store, g.path, EE(eI(B), A));
6392
+ return WI.increment(g.store, "v2"), new JI(g.store, g.path, oE(eI(B), A));
6367
6393
  }
6368
6394
  async function rB(g, A) {
6369
6395
  let { path: I } = g.resolve(".zgroup"), B = await g.store.get(I);
@@ -6371,19 +6397,19 @@ async function rB(g, A) {
6371
6397
  throw new GI("v2 group", {
6372
6398
  cause: new dg(I)
6373
6399
  });
6374
- return WI.increment(g.store, "v2"), new Mg(g.store, g.path, iE(eI(B), A));
6400
+ return WI.increment(g.store, "v2"), new Mg(g.store, g.path, aE(eI(B), A));
6375
6401
  }
6376
- async function ZE(g) {
6402
+ async function OE(g) {
6377
6403
  let { store: A, path: I } = g.resolve("zarr.json"), B = await g.store.get(I);
6378
6404
  if (!B)
6379
6405
  throw new GI("v3 array or group", {
6380
6406
  cause: new dg(I)
6381
6407
  });
6382
6408
  let C = eI(B);
6383
- return C.node_type === "array" && (C.fill_value = ZB(C)), C.node_type === "array" ? new JI(A, g.path, C) : new Mg(A, g.path, C);
6409
+ return C.node_type === "array" && (C.fill_value = PB(C)), C.node_type === "array" ? new JI(A, g.path, C) : new Mg(A, g.path, C);
6384
6410
  }
6385
- async function PE(g, A = {}) {
6386
- let I = "store" in g ? g : new j(g), B = await ZE(I);
6411
+ async function VE(g, A = {}) {
6412
+ let I = "store" in g ? g : new j(g), B = await OE(I);
6387
6413
  if (WI.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && B instanceof JI || A.kind === "group" && B instanceof Mg)
6388
6414
  return B;
6389
6415
  let C = B instanceof JI ? "array" : "group";
@@ -6391,11 +6417,11 @@ async function PE(g, A = {}) {
6391
6417
  }
6392
6418
  async function AA(g, A = {}) {
6393
6419
  let I = "store" in g ? g.store : g, B = WI.version_max(I), C = B === "v2" ? AA.v2 : AA.v3, Q = B === "v2" ? AA.v3 : AA.v2;
6394
- return C(g, A).catch((E) => (PB(E, GI), Q(g, A)));
6420
+ return C(g, A).catch((E) => (OB(E, GI), Q(g, A)));
6395
6421
  }
6396
- AA.v2 = bE;
6397
- AA.v3 = PE;
6398
- async function OE(g, A) {
6422
+ AA.v2 = PE;
6423
+ AA.v3 = VE;
6424
+ async function vE(g, A) {
6399
6425
  const I = A.split("/"), B = I.pop();
6400
6426
  if (!B)
6401
6427
  throw new Error("Invalid path");
@@ -6412,7 +6438,7 @@ class qg {
6412
6438
  return this.#A;
6413
6439
  }
6414
6440
  async get(A) {
6415
- const I = await OE(this.#A, A.slice(1)).catch(
6441
+ const I = await vE(this.#A, A.slice(1)).catch(
6416
6442
  () => {
6417
6443
  }
6418
6444
  );
@@ -6422,7 +6448,7 @@ class qg {
6422
6448
  return new Uint8Array(C);
6423
6449
  }
6424
6450
  }
6425
- function VE() {
6451
+ function XE() {
6426
6452
  if (typeof window > "u")
6427
6453
  return;
6428
6454
  const g = window.location.hostname;
@@ -6439,7 +6465,7 @@ class lg extends ZA {
6439
6465
  overrides;
6440
6466
  useSuffixRequest;
6441
6467
  constructor(A) {
6442
- VE(), super(A.url, {
6468
+ XE(), super(A.url, {
6443
6469
  overrides: A.overrides,
6444
6470
  useSuffixRequest: A.useSuffixRequest
6445
6471
  }), this.credentials = A.credentials, this.region = A.region, this.overrides = A.overrides, this.useSuffixRequest = A.useSuffixRequest;
@@ -6577,7 +6603,7 @@ async function nI(g, A) {
6577
6603
  throw new Error(`Failed to open Zarr group at ${g}`);
6578
6604
  }
6579
6605
  }
6580
- async function vE(g, A) {
6606
+ async function jE(g, A) {
6581
6607
  if (A === "v2")
6582
6608
  try {
6583
6609
  return AA.v2(g, { kind: "array", attrs: !1 });
@@ -6596,7 +6622,7 @@ async function vE(g, A) {
6596
6622
  throw new Error(`Failed to open Zarr array at ${g}`);
6597
6623
  }
6598
6624
  }
6599
- async function XE(g) {
6625
+ async function zE(g) {
6600
6626
  let A;
6601
6627
  switch (g.type) {
6602
6628
  case "fetch": {
@@ -6622,9 +6648,9 @@ async function XE(g) {
6622
6648
  }
6623
6649
  }
6624
6650
  const I = g.arrayPath ? A.resolve(g.arrayPath) : A;
6625
- return vE(I, g.zarrVersion);
6651
+ return jE(I, g.zarrVersion);
6626
6652
  }
6627
- function jE(g, A, I) {
6653
+ function _E(g, A, I) {
6628
6654
  if (g.store instanceof lg)
6629
6655
  return {
6630
6656
  type: "s3",
@@ -6655,7 +6681,7 @@ function jE(g, A, I) {
6655
6681
  `Unsupported store type: ${g.store.constructor.name}`
6656
6682
  );
6657
6683
  }
6658
- const vB = `function Bg(i, A, g, E = {}) {
6684
+ const XB = `function Bg(i, A, g, E = {}) {
6659
6685
  return A !== void 0 && g !== void 0 && (E = {
6660
6686
  ...E,
6661
6687
  headers: {
@@ -9798,8 +9824,8 @@ return ret;
9798
9824
  default: FB
9799
9825
  });
9800
9826
  //# sourceMappingURL=worker_kernel-uaRPnPAm.js.map
9801
- `, SB = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", vB], { type: "text/javascript;charset=utf-8" });
9802
- function zE(g) {
9827
+ `, SB = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", XB], { type: "text/javascript;charset=utf-8" });
9828
+ function $E(g) {
9803
9829
  let A;
9804
9830
  try {
9805
9831
  if (A = SB && (self.URL || self.webkitURL).createObjectURL(SB), !A) throw "";
@@ -9812,7 +9838,7 @@ function zE(g) {
9812
9838
  }), I;
9813
9839
  } catch {
9814
9840
  return new Worker(
9815
- "data:text/javascript;charset=utf-8," + encodeURIComponent(vB),
9841
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(XB),
9816
9842
  {
9817
9843
  type: "module",
9818
9844
  name: g?.name
@@ -9820,17 +9846,17 @@ function zE(g) {
9820
9846
  );
9821
9847
  }
9822
9848
  }
9823
- const _E = Math.min(navigator.hardwareConcurrency, 8);
9824
- let BA = [], $E = 0, XB = 0;
9849
+ const Ai = Math.min(navigator.hardwareConcurrency, 8);
9850
+ let BA = [], Ii = 0, jB = 0;
9825
9851
  const UA = /* @__PURE__ */ new Map(), dI = /* @__PURE__ */ new Set();
9826
- function jB(g) {
9852
+ function zB(g) {
9827
9853
  const A = BA.find((I) => I.worker === g);
9828
9854
  return A || U.error(
9829
9855
  "ZarrWorker",
9830
9856
  "Worker not found in pool - this should not happen"
9831
9857
  ), A;
9832
9858
  }
9833
- function Ai(g, A) {
9859
+ function gi(g, A) {
9834
9860
  const { id: I, success: B } = g.data, C = UA.get(I);
9835
9861
  if (!C) {
9836
9862
  dI.has(I) ? dI.delete(I) : U.warn(
@@ -9841,7 +9867,7 @@ function Ai(g, A) {
9841
9867
  return;
9842
9868
  }
9843
9869
  UA.delete(I), C.abortListener && C.abortSignal && C.abortSignal.removeEventListener("abort", C.abortListener);
9844
- const Q = jB(A);
9870
+ const Q = zB(A);
9845
9871
  Q && Q.pendingCount > 0 ? Q.pendingCount-- : Q && U.error(
9846
9872
  "ZarrWorker",
9847
9873
  "Received message but no pending tasks - this should not happen"
@@ -9860,7 +9886,7 @@ function RB(g, A) {
9860
9886
  "Worker failed - replacing worker and canceling its in-flight messages",
9861
9887
  g.message
9862
9888
  );
9863
- const I = jB(A);
9889
+ const I = zB(A);
9864
9890
  if (I) {
9865
9891
  const C = BA.indexOf(I);
9866
9892
  BA.splice(C, 1);
@@ -9870,31 +9896,31 @@ function RB(g, A) {
9870
9896
  for (const [C, Q] of UA.entries())
9871
9897
  Q.workerId === B && (Q.reject(new Error(`Worker error: ${g.message}`)), UA.delete(C));
9872
9898
  try {
9873
- const C = zB();
9899
+ const C = _B();
9874
9900
  BA.push({
9875
9901
  worker: C,
9876
9902
  pendingCount: 0,
9877
- workerId: XB++
9903
+ workerId: jB++
9878
9904
  }), U.debug("ZarrWorker", "Replacement worker created successfully");
9879
9905
  } catch (C) {
9880
9906
  U.error("ZarrWorker", "Failed to create replacement worker", C);
9881
9907
  }
9882
9908
  }
9883
- function zB() {
9884
- const g = new zE();
9885
- return g.addEventListener("message", (A) => Ai(A, g)), g.addEventListener("error", (A) => RB(A, g)), g.addEventListener(
9909
+ function _B() {
9910
+ const g = new $E();
9911
+ return g.addEventListener("message", (A) => gi(A, g)), g.addEventListener("error", (A) => RB(A, g)), g.addEventListener(
9886
9912
  "messageerror",
9887
9913
  (A) => RB(A, g)
9888
9914
  ), g;
9889
9915
  }
9890
- function Ii() {
9916
+ function Bi() {
9891
9917
  if (BA.length === 0)
9892
9918
  throw new Error("Worker pool is not initialized");
9893
9919
  return BA.sort((g, A) => g.pendingCount - A.pendingCount)[0];
9894
9920
  }
9895
- async function gi(g, A, I) {
9921
+ async function Ci(g, A, I) {
9896
9922
  return new Promise((B, C) => {
9897
- const Q = Ii(), E = $E++, i = {
9923
+ const Q = Bi(), E = Ii++, i = {
9898
9924
  resolve: B,
9899
9925
  reject: C,
9900
9926
  workerId: Q.workerId
@@ -9920,15 +9946,15 @@ async function gi(g, A, I) {
9920
9946
  });
9921
9947
  });
9922
9948
  }
9923
- function Bi() {
9949
+ function Qi() {
9924
9950
  if (!(BA.length > 0))
9925
9951
  try {
9926
- for (let g = 0; g < _E; g++) {
9927
- const A = zB();
9952
+ for (let g = 0; g < Ai; g++) {
9953
+ const A = _B();
9928
9954
  BA.push({
9929
9955
  worker: A,
9930
9956
  pendingCount: 0,
9931
- workerId: XB++
9957
+ workerId: jB++
9932
9958
  });
9933
9959
  }
9934
9960
  U.debug(
@@ -9936,26 +9962,26 @@ function Bi() {
9936
9962
  `Initialized worker pool with ${BA.length} workers`
9937
9963
  );
9938
9964
  } catch {
9939
- U.warn("ZarrWorker", "Failed to create workers - clearing pool"), Qi();
9965
+ U.warn("ZarrWorker", "Failed to create workers - clearing pool"), ii();
9940
9966
  return;
9941
9967
  }
9942
9968
  }
9943
- async function Ci(g, A, I, B) {
9944
- Bi();
9969
+ async function Ei(g, A, I, B) {
9970
+ Qi();
9945
9971
  try {
9946
- return await gi(A, I, B);
9972
+ return await Ci(A, I, B);
9947
9973
  } catch (C) {
9948
9974
  if (C instanceof DOMException && C.name === "AbortError")
9949
9975
  throw C;
9950
9976
  return U.warn("ZarrWorker", "Falling back to main thread", C), await g.getChunk(I, B);
9951
9977
  }
9952
9978
  }
9953
- function Qi() {
9979
+ function ii() {
9954
9980
  for (const g of BA)
9955
9981
  g.worker.terminate();
9956
9982
  BA = [], UA.clear();
9957
9983
  }
9958
- class Ei {
9984
+ class oi {
9959
9985
  promises_ = [];
9960
9986
  scheduler_;
9961
9987
  constructor(A) {
@@ -9968,13 +9994,13 @@ class Ei {
9968
9994
  return Promise.all(this.promises_.map((A) => this.scheduler_.submit(A)));
9969
9995
  }
9970
9996
  }
9971
- class ii {
9997
+ class ai {
9972
9998
  metadata_;
9973
9999
  arrays_;
9974
10000
  arrayParams_;
9975
10001
  dimensions_;
9976
10002
  constructor(A) {
9977
- this.metadata_ = A.metadata, this.arrays_ = A.arrays, this.arrayParams_ = A.arrayParams, this.dimensions_ = oi(this.metadata_, this.arrays_);
10003
+ this.metadata_ = A.metadata, this.arrays_ = A.arrays, this.arrayParams_ = A.arrayParams, this.dimensions_ = si(this.metadata_, this.arrays_);
9978
10004
  }
9979
10005
  getSourceDimensionMap() {
9980
10006
  return this.dimensions_;
@@ -9993,7 +10019,7 @@ class ii {
9993
10019
  A.chunkIndex.t / o.chunkSize
9994
10020
  );
9995
10021
  }
9996
- const C = this.arrays_[A.lod], Q = this.arrayParams_[A.lod], E = await Ci(C, Q, B, {
10022
+ const C = this.arrays_[A.lod], Q = this.arrayParams_[A.lod], E = await Ei(C, Q, B, {
9997
10023
  signal: I
9998
10024
  });
9999
10025
  A.data = this.sliceReceivedChunk(A, E);
@@ -10002,7 +10028,7 @@ class ii {
10002
10028
  throw new Error(
10003
10029
  "Invalid row alignment value. Possible values are 1, 2, 4, or 8"
10004
10030
  );
10005
- A.rowAlignmentBytes = i;
10031
+ A.rowAlignmentBytes = i, A.dataRange = aQ(A.data);
10006
10032
  }
10007
10033
  // trim any padding (XYZ padding for edge chunks)
10008
10034
  // and extract the channel/timepoint
@@ -10047,10 +10073,10 @@ class ii {
10047
10073
  const C = this.regionToIndices(A, I), Q = this.arrays_[I];
10048
10074
  let E = {};
10049
10075
  B !== void 0 && (E = {
10050
- create_queue: () => new Ei(B),
10076
+ create_queue: () => new oi(B),
10051
10077
  opts: { signal: B.abortSignal }
10052
10078
  });
10053
- const i = await TE(Q, C, E);
10079
+ const i = await WE(Q, C, E);
10054
10080
  if (!zg(i.data))
10055
10081
  throw new Error(
10056
10082
  `Subarray has an unsupported data type, data=${i.data.constructor.name}`
@@ -10098,7 +10124,7 @@ class ii {
10098
10124
  this.dimensions_.t
10099
10125
  ].filter((Q) => Q !== void 0).sort((Q, E) => Q.index - E.index), C = [];
10100
10126
  for (const Q of B) {
10101
- const E = A.find((s) => _B(s.dimension, Q.name));
10127
+ const E = A.find((s) => $B(s.dimension, Q.name));
10102
10128
  if (!E)
10103
10129
  throw new Error(`Region does not contain a slice for ${Q.name}`);
10104
10130
  const i = Q.lods[I];
@@ -10112,7 +10138,7 @@ class ii {
10112
10138
  return C;
10113
10139
  }
10114
10140
  }
10115
- function oi(g, A) {
10141
+ function si(g, A) {
10116
10142
  const I = g.axes.map((h) => h.name), B = g.axes.length, C = NB(I, "x"), Q = NB(I, "y"), E = (h, t) => {
10117
10143
  const y = [];
10118
10144
  for (let n = 0; n < g.datasets.length; n++) {
@@ -10141,7 +10167,7 @@ function oi(g, A) {
10141
10167
  const s = RI(I, "t");
10142
10168
  return s !== -1 && (i.t = E(I[s], s)), i;
10143
10169
  }
10144
- function _B(g, A) {
10170
+ function $B(g, A) {
10145
10171
  return g.toLowerCase() === A.toLowerCase();
10146
10172
  }
10147
10173
  function NB(g, A) {
@@ -10153,7 +10179,7 @@ function NB(g, A) {
10153
10179
  return I;
10154
10180
  }
10155
10181
  function RI(g, A) {
10156
- return g.findIndex((I) => _B(I, A));
10182
+ return g.findIndex((I) => $B(I, A));
10157
10183
  }
10158
10184
  function cB(g) {
10159
10185
  let A = 1;
@@ -10268,7 +10294,7 @@ const S = H.arrayToEnum([
10268
10294
  "invalid_intersection_types",
10269
10295
  "not_multiple_of",
10270
10296
  "not_finite"
10271
- ]), ai = (g) => JSON.stringify(g, null, 2).replace(/"([^"]+)":/g, "$1:");
10297
+ ]), Di = (g) => JSON.stringify(g, null, 2).replace(/"([^"]+)":/g, "$1:");
10272
10298
  class _ extends Error {
10273
10299
  get errors() {
10274
10300
  return this.issues;
@@ -10385,12 +10411,12 @@ const mA = (g, A) => {
10385
10411
  }
10386
10412
  return { message: I };
10387
10413
  };
10388
- let $B = mA;
10389
- function si(g) {
10390
- $B = g;
10414
+ let AC = mA;
10415
+ function hi(g) {
10416
+ AC = g;
10391
10417
  }
10392
10418
  function MI() {
10393
- return $B;
10419
+ return AC;
10394
10420
  }
10395
10421
  const KI = (g) => {
10396
10422
  const { data: A, path: I, errorMaps: B, issueData: C } = g, Q = [...I, ...C.path || []], E = {
@@ -10412,7 +10438,7 @@ const KI = (g) => {
10412
10438
  path: Q,
10413
10439
  message: i
10414
10440
  };
10415
- }, Di = [];
10441
+ }, ti = [];
10416
10442
  function F(g, A) {
10417
10443
  const I = MI(), B = KI({
10418
10444
  issueData: A,
@@ -10479,7 +10505,7 @@ function HI(g, A, I, B) {
10479
10505
  if (typeof A == "function" ? g !== A || !0 : !A.has(g)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10480
10506
  return A.get(g);
10481
10507
  }
10482
- function AC(g, A, I, B, C) {
10508
+ function IC(g, A, I, B, C) {
10483
10509
  if (typeof A == "function" ? g !== A || !0 : !A.has(g)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
10484
10510
  return A.set(g, I), I;
10485
10511
  }
@@ -10743,26 +10769,26 @@ class K {
10743
10769
  return this.safeParse(null).success;
10744
10770
  }
10745
10771
  }
10746
- const hi = /^c[^\s-]{8,}$/i, ti = /^[0-9a-z]+$/, yi = /^[0-9A-HJKMNP-TV-Z]{26}$/i, ei = /^[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, Gi = /^[a-z0-9_-]{21}$/i, ni = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, wi = /^[-+]?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)?)??$/, Fi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ri = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
10772
+ const yi = /^c[^\s-]{8,}$/i, ei = /^[0-9a-z]+$/, Gi = /^[0-9A-HJKMNP-TV-Z]{26}$/i, ni = /^[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, wi = /^[a-z0-9_-]{21}$/i, Fi = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, ri = /^[-+]?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)?)??$/, Si = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ri = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
10747
10773
  let Bg;
10748
- const Si = /^(?:(?: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])$/, Ri = /^(?:(?: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])$/, Ni = /^(([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]))$/, ci = /^(([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])$/, Ui = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, ki = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, IC = "((\\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])))", Li = new RegExp(`^${IC}$`);
10749
- function gC(g) {
10774
+ const Ni = /^(?:(?: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])$/, ci = /^(?:(?: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]))$/, ki = /^(([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])$/, Li = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Ji = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, gC = "((\\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])))", Yi = new RegExp(`^${gC}$`);
10775
+ function BC(g) {
10750
10776
  let A = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
10751
10777
  return g.precision ? A = `${A}\\.\\d{${g.precision}}` : g.precision == null && (A = `${A}(\\.\\d+)?`), A;
10752
10778
  }
10753
- function Ji(g) {
10754
- return new RegExp(`^${gC(g)}$`);
10779
+ function di(g) {
10780
+ return new RegExp(`^${BC(g)}$`);
10755
10781
  }
10756
- function BC(g) {
10757
- let A = `${IC}T${gC(g)}`;
10782
+ function CC(g) {
10783
+ let A = `${gC}T${BC(g)}`;
10758
10784
  const I = [];
10759
10785
  return I.push(g.local ? "Z?" : "Z"), g.offset && I.push("([+-]\\d{2}:?\\d{2})"), A = `${A}(${I.join("|")})`, new RegExp(`^${A}$`);
10760
10786
  }
10761
- function Yi(g, A) {
10762
- return !!((A === "v4" || !A) && Si.test(g) || (A === "v6" || !A) && Ni.test(g));
10787
+ function Mi(g, A) {
10788
+ return !!((A === "v4" || !A) && Ni.test(g) || (A === "v6" || !A) && Ui.test(g));
10763
10789
  }
10764
- function di(g, A) {
10765
- if (!ni.test(g))
10790
+ function Ki(g, A) {
10791
+ if (!Fi.test(g))
10766
10792
  return !1;
10767
10793
  try {
10768
10794
  const [I] = g.split("."), B = I.replace(/-/g, "+").replace(/_/g, "/").padEnd(I.length + (4 - I.length % 4) % 4, "="), C = JSON.parse(atob(B));
@@ -10771,8 +10797,8 @@ function di(g, A) {
10771
10797
  return !1;
10772
10798
  }
10773
10799
  }
10774
- function Mi(g, A) {
10775
- return !!((A === "v4" || !A) && Ri.test(g) || (A === "v6" || !A) && ci.test(g));
10800
+ function Hi(g, A) {
10801
+ return !!((A === "v4" || !A) && ci.test(g) || (A === "v6" || !A) && ki.test(g));
10776
10802
  }
10777
10803
  class IA extends K {
10778
10804
  _parse(A) {
@@ -10823,43 +10849,43 @@ class IA extends K {
10823
10849
  message: Q.message
10824
10850
  }), B.dirty());
10825
10851
  } else if (Q.kind === "email")
10826
- Fi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10852
+ Si.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10827
10853
  validation: "email",
10828
10854
  code: e.invalid_string,
10829
10855
  message: Q.message
10830
10856
  }), B.dirty());
10831
10857
  else if (Q.kind === "emoji")
10832
- Bg || (Bg = new RegExp(ri, "u")), Bg.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10858
+ Bg || (Bg = new RegExp(Ri, "u")), Bg.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10833
10859
  validation: "emoji",
10834
10860
  code: e.invalid_string,
10835
10861
  message: Q.message
10836
10862
  }), B.dirty());
10837
10863
  else if (Q.kind === "uuid")
10838
- ei.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10864
+ ni.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10839
10865
  validation: "uuid",
10840
10866
  code: e.invalid_string,
10841
10867
  message: Q.message
10842
10868
  }), B.dirty());
10843
10869
  else if (Q.kind === "nanoid")
10844
- Gi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10870
+ wi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10845
10871
  validation: "nanoid",
10846
10872
  code: e.invalid_string,
10847
10873
  message: Q.message
10848
10874
  }), B.dirty());
10849
10875
  else if (Q.kind === "cuid")
10850
- hi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10876
+ yi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10851
10877
  validation: "cuid",
10852
10878
  code: e.invalid_string,
10853
10879
  message: Q.message
10854
10880
  }), B.dirty());
10855
10881
  else if (Q.kind === "cuid2")
10856
- ti.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10882
+ ei.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10857
10883
  validation: "cuid2",
10858
10884
  code: e.invalid_string,
10859
10885
  message: Q.message
10860
10886
  }), B.dirty());
10861
10887
  else if (Q.kind === "ulid")
10862
- yi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10888
+ Gi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10863
10889
  validation: "ulid",
10864
10890
  code: e.invalid_string,
10865
10891
  message: Q.message
@@ -10890,39 +10916,39 @@ class IA extends K {
10890
10916
  code: e.invalid_string,
10891
10917
  validation: { endsWith: Q.value },
10892
10918
  message: Q.message
10893
- }), B.dirty()) : Q.kind === "datetime" ? BC(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10919
+ }), B.dirty()) : Q.kind === "datetime" ? CC(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10894
10920
  code: e.invalid_string,
10895
10921
  validation: "datetime",
10896
10922
  message: Q.message
10897
- }), B.dirty()) : Q.kind === "date" ? Li.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10923
+ }), B.dirty()) : Q.kind === "date" ? Yi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10898
10924
  code: e.invalid_string,
10899
10925
  validation: "date",
10900
10926
  message: Q.message
10901
- }), B.dirty()) : Q.kind === "time" ? Ji(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10927
+ }), B.dirty()) : Q.kind === "time" ? di(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10902
10928
  code: e.invalid_string,
10903
10929
  validation: "time",
10904
10930
  message: Q.message
10905
- }), B.dirty()) : Q.kind === "duration" ? wi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10931
+ }), B.dirty()) : Q.kind === "duration" ? ri.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10906
10932
  validation: "duration",
10907
10933
  code: e.invalid_string,
10908
10934
  message: Q.message
10909
- }), B.dirty()) : Q.kind === "ip" ? Yi(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), F(C, {
10935
+ }), B.dirty()) : Q.kind === "ip" ? Mi(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), F(C, {
10910
10936
  validation: "ip",
10911
10937
  code: e.invalid_string,
10912
10938
  message: Q.message
10913
- }), B.dirty()) : Q.kind === "jwt" ? di(A.data, Q.alg) || (C = this._getOrReturnCtx(A, C), F(C, {
10939
+ }), B.dirty()) : Q.kind === "jwt" ? Ki(A.data, Q.alg) || (C = this._getOrReturnCtx(A, C), F(C, {
10914
10940
  validation: "jwt",
10915
10941
  code: e.invalid_string,
10916
10942
  message: Q.message
10917
- }), B.dirty()) : Q.kind === "cidr" ? Mi(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), F(C, {
10943
+ }), B.dirty()) : Q.kind === "cidr" ? Hi(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), F(C, {
10918
10944
  validation: "cidr",
10919
10945
  code: e.invalid_string,
10920
10946
  message: Q.message
10921
- }), B.dirty()) : Q.kind === "base64" ? Ui.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10947
+ }), B.dirty()) : Q.kind === "base64" ? Li.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10922
10948
  validation: "base64",
10923
10949
  code: e.invalid_string,
10924
10950
  message: Q.message
10925
- }), B.dirty()) : Q.kind === "base64url" ? ki.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10951
+ }), B.dirty()) : Q.kind === "base64url" ? Ji.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10926
10952
  validation: "base64url",
10927
10953
  code: e.invalid_string,
10928
10954
  message: Q.message
@@ -11161,7 +11187,7 @@ IA.create = (g) => {
11161
11187
  ...M(g)
11162
11188
  });
11163
11189
  };
11164
- function Ki(g, A) {
11190
+ function qi(g, A) {
11165
11191
  const I = (g.toString().split(".")[1] || "").length, B = (A.toString().split(".")[1] || "").length, C = I > B ? I : B, Q = parseInt(g.toFixed(C).replace(".", "")), E = parseInt(A.toFixed(C).replace(".", ""));
11166
11192
  return Q % E / Math.pow(10, C);
11167
11193
  }
@@ -11200,7 +11226,7 @@ class yA extends K {
11200
11226
  inclusive: Q.inclusive,
11201
11227
  exact: !1,
11202
11228
  message: Q.message
11203
- }), C.dirty()) : Q.kind === "multipleOf" ? Ki(A.data, Q.value) !== 0 && (B = this._getOrReturnCtx(A, B), F(B, {
11229
+ }), C.dirty()) : Q.kind === "multipleOf" ? qi(A.data, Q.value) !== 0 && (B = this._getOrReturnCtx(A, B), F(B, {
11204
11230
  code: e.not_multiple_of,
11205
11231
  multipleOf: Q.value,
11206
11232
  message: Q.message
@@ -12027,7 +12053,7 @@ class u extends K {
12027
12053
  });
12028
12054
  }
12029
12055
  keyof() {
12030
- return CC(H.objectKeys(this.shape));
12056
+ return QC(H.objectKeys(this.shape));
12031
12057
  }
12032
12058
  }
12033
12059
  u.create = (g, A) => new u({
@@ -12590,7 +12616,7 @@ oI.create = (g, A) => new oI({
12590
12616
  typeName: J.ZodLiteral,
12591
12617
  ...M(A)
12592
12618
  });
12593
- function CC(g, A) {
12619
+ function QC(g, A) {
12594
12620
  return new GA({
12595
12621
  values: g,
12596
12622
  typeName: J.ZodEnum,
@@ -12610,7 +12636,7 @@ class GA extends K {
12610
12636
  code: e.invalid_type
12611
12637
  }), d;
12612
12638
  }
12613
- if (HI(this, OA) || AC(this, OA, new Set(this._def.values)), !HI(this, OA).has(A.data)) {
12639
+ if (HI(this, OA) || IC(this, OA, new Set(this._def.values)), !HI(this, OA).has(A.data)) {
12614
12640
  const I = this._getOrReturnCtx(A), B = this._def.values;
12615
12641
  return F(I, {
12616
12642
  received: I.data,
@@ -12655,7 +12681,7 @@ class GA extends K {
12655
12681
  }
12656
12682
  }
12657
12683
  OA = /* @__PURE__ */ new WeakMap();
12658
- GA.create = CC;
12684
+ GA.create = QC;
12659
12685
  class aI extends K {
12660
12686
  constructor() {
12661
12687
  super(...arguments), VA.set(this, void 0);
@@ -12670,7 +12696,7 @@ class aI extends K {
12670
12696
  code: e.invalid_type
12671
12697
  }), d;
12672
12698
  }
12673
- if (HI(this, VA) || AC(this, VA, new Set(H.getValidEnumValues(this._def.values))), !HI(this, VA).has(A.data)) {
12699
+ if (HI(this, VA) || IC(this, VA, new Set(H.getValidEnumValues(this._def.values))), !HI(this, VA).has(A.data)) {
12674
12700
  const C = H.objectValues(I);
12675
12701
  return F(B, {
12676
12702
  received: B.data,
@@ -12909,7 +12935,7 @@ pI.create = (g) => new pI({
12909
12935
  typeName: J.ZodNaN,
12910
12936
  ...M(g)
12911
12937
  });
12912
- const Hi = Symbol("zod_brand");
12938
+ const li = Symbol("zod_brand");
12913
12939
  class fg extends K {
12914
12940
  _parse(A) {
12915
12941
  const { ctx: I } = this._processInputParams(A), B = I.data;
@@ -12981,7 +13007,7 @@ function kB(g, A) {
12981
13007
  const I = typeof g == "function" ? g(A) : typeof g == "string" ? { message: g } : g;
12982
13008
  return typeof I == "string" ? { message: I } : I;
12983
13009
  }
12984
- function QC(g, A = {}, I) {
13010
+ function EC(g, A = {}, I) {
12985
13011
  return g ? uA.create().superRefine((B, C) => {
12986
13012
  var Q, E;
12987
13013
  const i = g(B);
@@ -12999,16 +13025,16 @@ function QC(g, A = {}, I) {
12999
13025
  }
13000
13026
  }) : uA.create();
13001
13027
  }
13002
- const qi = {
13028
+ const fi = {
13003
13029
  object: u.lazycreate
13004
13030
  };
13005
13031
  var J;
13006
13032
  (function(g) {
13007
13033
  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";
13008
13034
  })(J || (J = {}));
13009
- const li = (g, A = {
13035
+ const pi = (g, A = {
13010
13036
  message: `Input not instance of ${g.name}`
13011
- }) => QC((I) => I instanceof g, A), EC = IA.create, iC = yA.create, fi = pI.create, pi = eA.create, oC = II.create, mi = LA.create, ui = qI.create, Ti = gI.create, xi = BI.create, Wi = uA.create, bi = RA.create, Zi = tA.create, Pi = lI.create, Oi = CA.create, Vi = u.create, vi = u.strictCreate, Xi = CI.create, ji = bI.create, zi = QI.create, _i = sA.create, $i = EI.create, Ao = fI.create, Io = JA.create, go = HA.create, Bo = iI.create, Co = oI.create, Qo = GA.create, Eo = aI.create, io = TA.create, LB = QA.create, oo = oA.create, ao = nA.create, so = QA.createWithPreprocess, Do = wI.create, ho = () => EC().optional(), to = () => iC().optional(), yo = () => oC().optional(), eo = {
13037
+ }) => EC((I) => I instanceof g, A), iC = IA.create, oC = yA.create, mi = pI.create, ui = eA.create, aC = II.create, Ti = LA.create, xi = qI.create, Wi = gI.create, bi = BI.create, Zi = uA.create, Pi = RA.create, Oi = tA.create, Vi = lI.create, vi = CA.create, Xi = u.create, ji = u.strictCreate, zi = CI.create, _i = bI.create, $i = QI.create, Ao = sA.create, Io = EI.create, go = fI.create, Bo = JA.create, Co = HA.create, Qo = iI.create, Eo = oI.create, io = GA.create, oo = aI.create, ao = TA.create, LB = QA.create, so = oA.create, Do = nA.create, ho = QA.createWithPreprocess, to = wI.create, yo = () => iC().optional(), eo = () => oC().optional(), Go = () => aC().optional(), no = {
13012
13038
  string: (g) => IA.create({ ...g, coerce: !0 }),
13013
13039
  number: (g) => yA.create({ ...g, coerce: !0 }),
13014
13040
  boolean: (g) => II.create({
@@ -13017,14 +13043,14 @@ const li = (g, A = {
13017
13043
  }),
13018
13044
  bigint: (g) => eA.create({ ...g, coerce: !0 }),
13019
13045
  date: (g) => LA.create({ ...g, coerce: !0 })
13020
- }, Go = d;
13046
+ }, wo = d;
13021
13047
  var D = /* @__PURE__ */ Object.freeze({
13022
13048
  __proto__: null,
13023
13049
  defaultErrorMap: mA,
13024
- setErrorMap: si,
13050
+ setErrorMap: hi,
13025
13051
  getErrorMap: MI,
13026
13052
  makeIssue: KI,
13027
- EMPTY_PATH: Di,
13053
+ EMPTY_PATH: ti,
13028
13054
  addIssueToContext: F,
13029
13055
  ParseStatus: v,
13030
13056
  INVALID: d,
@@ -13043,7 +13069,7 @@ var D = /* @__PURE__ */ Object.freeze({
13043
13069
  ZodParsedType: S,
13044
13070
  getParsedType: hA,
13045
13071
  ZodType: K,
13046
- datetimeRegex: BC,
13072
+ datetimeRegex: CC,
13047
13073
  ZodString: IA,
13048
13074
  ZodNumber: yA,
13049
13075
  ZodBigInt: eA,
@@ -13078,63 +13104,63 @@ var D = /* @__PURE__ */ Object.freeze({
13078
13104
  ZodDefault: sI,
13079
13105
  ZodCatch: DI,
13080
13106
  ZodNaN: pI,
13081
- BRAND: Hi,
13107
+ BRAND: li,
13082
13108
  ZodBranded: fg,
13083
13109
  ZodPipeline: wI,
13084
13110
  ZodReadonly: hI,
13085
- custom: QC,
13111
+ custom: EC,
13086
13112
  Schema: K,
13087
13113
  ZodSchema: K,
13088
- late: qi,
13114
+ late: fi,
13089
13115
  get ZodFirstPartyTypeKind() {
13090
13116
  return J;
13091
13117
  },
13092
- coerce: eo,
13093
- any: Wi,
13094
- array: Oi,
13095
- bigint: pi,
13096
- boolean: oC,
13097
- date: mi,
13098
- discriminatedUnion: ji,
13118
+ coerce: no,
13119
+ any: Zi,
13120
+ array: vi,
13121
+ bigint: ui,
13122
+ boolean: aC,
13123
+ date: Ti,
13124
+ discriminatedUnion: _i,
13099
13125
  effect: LB,
13100
- enum: Qo,
13101
- function: go,
13102
- instanceof: li,
13103
- intersection: zi,
13104
- lazy: Bo,
13105
- literal: Co,
13106
- map: Ao,
13107
- nan: fi,
13108
- nativeEnum: Eo,
13109
- never: Zi,
13110
- null: xi,
13111
- nullable: ao,
13112
- number: iC,
13113
- object: Vi,
13114
- oboolean: yo,
13115
- onumber: to,
13116
- optional: oo,
13117
- ostring: ho,
13118
- pipeline: Do,
13119
- preprocess: so,
13120
- promise: io,
13121
- record: $i,
13122
- set: Io,
13123
- strictObject: vi,
13124
- string: EC,
13125
- symbol: ui,
13126
+ enum: io,
13127
+ function: Co,
13128
+ instanceof: pi,
13129
+ intersection: $i,
13130
+ lazy: Qo,
13131
+ literal: Eo,
13132
+ map: go,
13133
+ nan: mi,
13134
+ nativeEnum: oo,
13135
+ never: Oi,
13136
+ null: bi,
13137
+ nullable: Do,
13138
+ number: oC,
13139
+ object: Xi,
13140
+ oboolean: Go,
13141
+ onumber: eo,
13142
+ optional: so,
13143
+ ostring: yo,
13144
+ pipeline: to,
13145
+ preprocess: ho,
13146
+ promise: ao,
13147
+ record: Io,
13148
+ set: Bo,
13149
+ strictObject: ji,
13150
+ string: iC,
13151
+ symbol: xi,
13126
13152
  transformer: LB,
13127
- tuple: _i,
13128
- undefined: Ti,
13129
- union: Xi,
13130
- unknown: bi,
13131
- void: Pi,
13132
- NEVER: Go,
13153
+ tuple: Ao,
13154
+ undefined: Wi,
13155
+ union: zi,
13156
+ unknown: Pi,
13157
+ void: Vi,
13158
+ NEVER: wo,
13133
13159
  ZodIssueCode: e,
13134
- quotelessJson: ai,
13160
+ quotelessJson: Di,
13135
13161
  ZodError: _
13136
13162
  });
13137
- const no = D.object({
13163
+ const Fo = D.object({
13138
13164
  /**The multiscale datasets for this image*/
13139
13165
  multiscales: D.array(
13140
13166
  D.object({
@@ -13262,7 +13288,7 @@ const no = D.object({
13262
13288
  projection: D.string().optional()
13263
13289
  }).optional()
13264
13290
  }).optional()
13265
- }).describe("JSON from OME-NGFF .zattrs"), wo = D.object({
13291
+ }).describe("JSON from OME-NGFF .zattrs"), ro = D.object({
13266
13292
  plate: D.object({
13267
13293
  /**The acquisitions for this plate*/
13268
13294
  acquisitions: D.array(
@@ -13321,7 +13347,7 @@ const no = D.object({
13321
13347
  })
13322
13348
  ).min(1).describe("The wells of the plate")
13323
13349
  }).optional()
13324
- }).describe("JSON from OME-NGFF .zattrs"), Fo = D.object({
13350
+ }).describe("JSON from OME-NGFF .zattrs"), So = D.object({
13325
13351
  well: D.object({
13326
13352
  /**The fields of view for this well*/
13327
13353
  images: D.array(
@@ -13335,7 +13361,7 @@ const no = D.object({
13335
13361
  /**The version of the specification*/
13336
13362
  version: D.literal("0.4").describe("The version of the specification").optional()
13337
13363
  }).optional()
13338
- }).describe("JSON from OME-NGFF .zattrs"), ro = D.object({
13364
+ }).describe("JSON from OME-NGFF .zattrs"), Ro = D.object({
13339
13365
  /**The versioned OME-Zarr Metadata namespace*/
13340
13366
  ome: D.object({
13341
13367
  /**The multiscale datasets for this image*/
@@ -13465,7 +13491,7 @@ const no = D.object({
13465
13491
  /**The version of the OME-Zarr Metadata*/
13466
13492
  version: D.literal("0.5").describe("The version of the OME-Zarr Metadata")
13467
13493
  }).describe("The versioned OME-Zarr Metadata namespace")
13468
- }).describe("The zarr.json attributes key"), So = D.object({
13494
+ }).describe("The zarr.json attributes key"), No = D.object({
13469
13495
  /**The versioned OME-Zarr Metadata namespace*/
13470
13496
  ome: D.object({
13471
13497
  plate: D.object({
@@ -13527,7 +13553,7 @@ const no = D.object({
13527
13553
  /**The version of the OME-Zarr Metadata*/
13528
13554
  version: D.literal("0.5").describe("The version of the OME-Zarr Metadata")
13529
13555
  }).describe("The versioned OME-Zarr Metadata namespace")
13530
- }).describe("The zarr.json attributes key"), Ro = D.object({
13556
+ }).describe("The zarr.json attributes key"), co = D.object({
13531
13557
  /**The versioned OME-Zarr Metadata namespace*/
13532
13558
  ome: D.object({
13533
13559
  well: D.object({
@@ -13546,15 +13572,15 @@ const no = D.object({
13546
13572
  /**The version of the OME-Zarr Metadata*/
13547
13573
  version: D.literal("0.5").describe("The version of the OME-Zarr Metadata")
13548
13574
  }).describe("The versioned OME-Zarr Metadata namespace")
13549
- }).describe("JSON from OME-Zarr zarr.json"), No = ["0.4", "0.5"], co = new Set(No);
13550
- function Uo(g) {
13575
+ }).describe("JSON from OME-Zarr zarr.json"), Uo = ["0.4", "0.5"], ko = new Set(Uo);
13576
+ function Lo(g) {
13551
13577
  if (!("ome" in g) || !(g.ome instanceof Object)) return;
13552
13578
  const A = g.ome;
13553
- if ("version" in A && typeof A.version == "string" && co.has(A.version))
13579
+ if ("version" in A && typeof A.version == "string" && ko.has(A.version))
13554
13580
  return A.version;
13555
13581
  }
13556
13582
  function pg(g) {
13557
- const A = Uo(g);
13583
+ const A = Lo(g);
13558
13584
  return A === void 0 ? "0.4" : A;
13559
13585
  }
13560
13586
  function xA(g) {
@@ -13566,14 +13592,14 @@ function xA(g) {
13566
13592
  return "v3";
13567
13593
  }
13568
13594
  }
13569
- function aC(g, A) {
13595
+ function sC(g, A) {
13570
13596
  const I = { ...g };
13571
13597
  return delete I[A], I;
13572
13598
  }
13573
- async function Vo(g, A) {
13599
+ async function Xo(g, A) {
13574
13600
  const I = new ZA(g), B = new j(I), C = xA(A), Q = await nI(B, C);
13575
13601
  try {
13576
- return ko(Q.attrs);
13602
+ return Jo(Q.attrs);
13577
13603
  } catch {
13578
13604
  throw Error(
13579
13605
  `Failed to parse OME-Zarr plate:
@@ -13581,58 +13607,58 @@ ${JSON.stringify(Q.attrs)}`
13581
13607
  );
13582
13608
  }
13583
13609
  }
13584
- function ko(g) {
13610
+ function Jo(g) {
13585
13611
  switch (pg(g)) {
13586
13612
  case "0.5":
13587
13613
  return {
13588
- ...So.parse(g).ome,
13614
+ ...No.parse(g).ome,
13589
13615
  originalVersion: "0.5"
13590
13616
  };
13591
13617
  case "0.4":
13592
13618
  return {
13593
- ...Lo(wo.parse(g)).ome,
13619
+ ...Yo(ro.parse(g)).ome,
13594
13620
  originalVersion: "0.4"
13595
13621
  };
13596
13622
  }
13597
13623
  }
13598
- function Lo(g) {
13624
+ function Yo(g) {
13599
13625
  if (g.plate === void 0)
13600
13626
  throw new Error("Plate metadata is missing in OME-Zarr v0.4 plate");
13601
13627
  return {
13602
13628
  ome: {
13603
- plate: aC(g.plate, "version"),
13629
+ plate: sC(g.plate, "version"),
13604
13630
  version: "0.5"
13605
13631
  }
13606
13632
  };
13607
13633
  }
13608
- function Jo(g) {
13634
+ function Mo(g) {
13609
13635
  if (g.well === void 0)
13610
13636
  throw new Error("Well metadata is missing in OME-Zarr v0.4 well");
13611
13637
  return {
13612
13638
  ome: {
13613
- well: aC(g.well, "version"),
13639
+ well: sC(g.well, "version"),
13614
13640
  version: "0.5"
13615
13641
  }
13616
13642
  };
13617
13643
  }
13618
- function Yo(g) {
13644
+ function Ko(g) {
13619
13645
  switch (pg(g)) {
13620
13646
  case "0.5":
13621
13647
  return {
13622
- ...Ro.parse(g).ome,
13648
+ ...co.parse(g).ome,
13623
13649
  originalVersion: "0.5"
13624
13650
  };
13625
13651
  case "0.4":
13626
13652
  return {
13627
- ...Jo(Fo.parse(g)).ome,
13653
+ ...Mo(So.parse(g)).ome,
13628
13654
  originalVersion: "0.4"
13629
13655
  };
13630
13656
  }
13631
13657
  }
13632
- async function vo(g, A, I) {
13658
+ async function jo(g, A, I) {
13633
13659
  const B = g + "/" + A, C = new ZA(B), Q = new j(C), E = xA(I), i = await nI(Q, E);
13634
13660
  try {
13635
- return Yo(i.attrs);
13661
+ return Ko(i.attrs);
13636
13662
  } catch {
13637
13663
  throw Error(
13638
13664
  `Failed to parse OME-Zarr well:
@@ -13640,15 +13666,15 @@ ${JSON.stringify(i.attrs)}`
13640
13666
  );
13641
13667
  }
13642
13668
  }
13643
- async function Xo(g) {
13669
+ async function zo(g) {
13644
13670
  const A = xA(g.version), I = await nI(g.location, A);
13645
13671
  return mg(I.attrs).omero?.channels ?? [];
13646
13672
  }
13647
- async function jo(g) {
13673
+ async function _o(g) {
13648
13674
  const A = xA(g.version), I = await nI(g.location, A);
13649
13675
  return mg(I.attrs).omero?.rdefs;
13650
13676
  }
13651
- function Mo(g) {
13677
+ function Ho(g) {
13652
13678
  return {
13653
13679
  ome: {
13654
13680
  multiscales: g.multiscales,
@@ -13657,23 +13683,23 @@ function Mo(g) {
13657
13683
  }
13658
13684
  };
13659
13685
  }
13660
- function Ko(g) {
13686
+ function qo(g) {
13661
13687
  switch (pg(g)) {
13662
13688
  case "0.5":
13663
13689
  return {
13664
- ...ro.parse(g).ome,
13690
+ ...Ro.parse(g).ome,
13665
13691
  originalVersion: "0.5"
13666
13692
  };
13667
13693
  case "0.4":
13668
13694
  return {
13669
- ...Mo(no.parse(g)).ome,
13695
+ ...Ho(Fo.parse(g)).ome,
13670
13696
  originalVersion: "0.4"
13671
13697
  };
13672
13698
  }
13673
13699
  }
13674
13700
  function mg(g) {
13675
13701
  try {
13676
- return Ko(g);
13702
+ return qo(g);
13677
13703
  } catch {
13678
13704
  throw Error(`Failed to parse OME-Zarr image:
13679
13705
  ${JSON.stringify(g)}`);
@@ -13697,15 +13723,15 @@ class NI {
13697
13723
  throw new Error("No datasets found in the multiscale image.");
13698
13724
  A || (A = xA(B.originalVersion));
13699
13725
  const E = Q.datasets.map(
13700
- (s) => jE(this.location, s.path, A)
13726
+ (s) => _E(this.location, s.path, A)
13701
13727
  ), i = await Promise.all(
13702
- E.map((s) => XE(s))
13728
+ E.map((s) => zE(s))
13703
13729
  ), o = i[0].shape, a = Q.axes;
13704
13730
  if (a.length !== o.length)
13705
13731
  throw new Error(
13706
13732
  `Mismatch between number of axes (${a.length}) and array shape (${o.length})`
13707
13733
  );
13708
- return new ii({
13734
+ return new ai({
13709
13735
  metadata: Q,
13710
13736
  arrays: i,
13711
13737
  arrayParams: E
@@ -13758,7 +13784,7 @@ class NI {
13758
13784
  });
13759
13785
  }
13760
13786
  }
13761
- const sC = [
13787
+ const DC = [
13762
13788
  "fallbackVisible",
13763
13789
  "prefetchTime",
13764
13790
  "visibleCurrent",
@@ -13766,14 +13792,14 @@ const sC = [
13766
13792
  "prefetchSpace"
13767
13793
  ];
13768
13794
  function ug(g) {
13769
- Ho(g);
13795
+ lo(g);
13770
13796
  const A = {
13771
13797
  x: g.prefetch.x,
13772
13798
  y: g.prefetch.y,
13773
13799
  z: g.prefetch.z ?? 0,
13774
13800
  t: g.prefetch.t ?? 0
13775
13801
  }, I = Object.freeze(
13776
- sC.reduce(
13802
+ DC.reduce(
13777
13803
  (Q, E) => {
13778
13804
  const i = g.priorityOrder.indexOf(E);
13779
13805
  return Q[E] = i, Q;
@@ -13793,7 +13819,7 @@ function ug(g) {
13793
13819
  };
13794
13820
  return Object.freeze(C);
13795
13821
  }
13796
- function zo(g = {}) {
13822
+ function $o(g = {}) {
13797
13823
  return ug(Tg({
13798
13824
  profile: "exploration",
13799
13825
  prefetch: { x: 1, y: 1, z: 1, t: 0 },
@@ -13806,7 +13832,7 @@ function zo(g = {}) {
13806
13832
  ]
13807
13833
  }, g));
13808
13834
  }
13809
- function _o(g = {}) {
13835
+ function Aa(g = {}) {
13810
13836
  return ug(Tg({
13811
13837
  profile: "playback",
13812
13838
  prefetch: { x: 0, y: 0, z: 0, t: 20 },
@@ -13819,7 +13845,7 @@ function _o(g = {}) {
13819
13845
  ]
13820
13846
  }, g));
13821
13847
  }
13822
- function $o(g = {}) {
13848
+ function Ia(g = {}) {
13823
13849
  return ug(Tg({
13824
13850
  profile: "no-prefetch",
13825
13851
  prefetch: { x: 0, y: 0, z: 0, t: 0 },
@@ -13832,7 +13858,7 @@ function $o(g = {}) {
13832
13858
  ]
13833
13859
  }, g));
13834
13860
  }
13835
- function Ho(g) {
13861
+ function lo(g) {
13836
13862
  for (const [B, C] of Object.entries(g.prefetch))
13837
13863
  if (C !== void 0 && C < 0)
13838
13864
  throw new Error(`prefetch.${B} must be a non-negative number`);
@@ -13840,7 +13866,7 @@ function Ho(g) {
13840
13866
  if (A?.min !== void 0 && A?.max !== void 0 && A.min > A.max)
13841
13867
  throw new Error("lod.min must be <= lod.max");
13842
13868
  const I = g.priorityOrder;
13843
- if (I.length !== sC.length || new Set(I).size !== I.length)
13869
+ if (I.length !== DC.length || new Set(I).size !== I.length)
13844
13870
  throw new Error("priorityOrder must include all categories exactly once");
13845
13871
  }
13846
13872
  function Tg(g, A = {}) {
@@ -13851,7 +13877,7 @@ function Tg(g, A = {}) {
13851
13877
  priorityOrder: A.priorityOrder ?? g.priorityOrder
13852
13878
  };
13853
13879
  }
13854
- class Aa extends bA {
13880
+ class ga extends bA {
13855
13881
  atlas_;
13856
13882
  constructor(A, I) {
13857
13883
  super(), this.programName = "points", this.atlas_ = I, A.forEach((Q) => {
@@ -13895,42 +13921,42 @@ class Aa extends bA {
13895
13921
  }
13896
13922
  }
13897
13923
  export {
13898
- uo as AxesLayer,
13924
+ xo as AxesLayer,
13899
13925
  $ as Box2,
13900
13926
  SA as Box3,
13901
- TB as ChunkedImageLayer,
13927
+ xB as ChunkedImageLayer,
13902
13928
  l as Color,
13903
- NQ as Frustum,
13904
- qo as Idetik,
13905
- bo as ImageLayer,
13906
- Po as ImageSeriesLayer,
13907
- Zo as LabelImageLayer,
13929
+ UQ as Frustum,
13930
+ fo as Idetik,
13931
+ Po as ImageLayer,
13932
+ Vo as ImageSeriesLayer,
13933
+ Oo as LabelImageLayer,
13908
13934
  wA as Layer,
13909
- tQ as LayerManager,
13935
+ eQ as LayerManager,
13910
13936
  NI as OmeZarrImageSource,
13911
- mo as OrbitControls,
13912
- lo as OrthographicCamera,
13913
- po as PanZoomControls,
13914
- fo as PerspectiveCamera,
13937
+ To as OrbitControls,
13938
+ po as OrthographicCamera,
13939
+ uo as PanZoomControls,
13940
+ mo as PerspectiveCamera,
13915
13941
  YA as Plane,
13916
- Aa as Points,
13917
- To as ProjectedLineLayer,
13942
+ ga as Points,
13943
+ Wo as ProjectedLineLayer,
13918
13944
  gB as Spherical,
13919
13945
  tI as Texture2DArray,
13920
13946
  XA as Texture3D,
13921
- xo as TracksLayer,
13922
- nQ as Viewport,
13923
- Wo as VolumeLayer,
13924
- QQ as WebGLRenderer,
13925
- zo as createExplorationPolicy,
13947
+ bo as TracksLayer,
13948
+ FQ as Viewport,
13949
+ Zo as VolumeLayer,
13950
+ EQ as WebGLRenderer,
13951
+ $o as createExplorationPolicy,
13926
13952
  ug as createImageSourcePolicy,
13927
- $o as createNoPrefetchPolicy,
13928
- _o as createPlaybackPolicy,
13929
- Vo as loadOmeZarrPlate,
13930
- vo as loadOmeZarrWell,
13931
- Xo as loadOmeroChannels,
13932
- jo as loadOmeroDefaults,
13953
+ Ia as createNoPrefetchPolicy,
13954
+ Aa as createPlaybackPolicy,
13955
+ Xo as loadOmeZarrPlate,
13956
+ jo as loadOmeZarrWell,
13957
+ zo as loadOmeroChannels,
13958
+ _o as loadOmeroDefaults,
13933
13959
  _g as parseViewportConfigs,
13934
- qB as validateNewViewport
13960
+ lB as validateNewViewport
13935
13961
  };
13936
13962
  //# sourceMappingURL=index.js.map