@idetik/core 0.36.1 → 0.36.2

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
@@ -1,4 +1,4 @@
1
- class NC {
1
+ class cC {
2
2
  canvas_;
3
3
  width_ = 0;
4
4
  height_ = 0;
@@ -27,7 +27,7 @@ class NC {
27
27
  return this.renderedObjects_;
28
28
  }
29
29
  }
30
- var cC = `#version 300 es
30
+ var UC = `#version 300 es
31
31
 
32
32
  layout (location = 0) in vec3 a_position;
33
33
  layout (location = 3) in vec3 a_prevPosition;
@@ -87,7 +87,7 @@ void main() {
87
87
 
88
88
 
89
89
  gl_PointSize = 5.0;
90
- }`, UC = `#version 300 es
90
+ }`, kC = `#version 300 es
91
91
 
92
92
  precision mediump float;
93
93
 
@@ -98,7 +98,7 @@ uniform float u_opacity;
98
98
 
99
99
  void main() {
100
100
  fragColor = vec4(u_lineColor, u_opacity);
101
- }`, WA = `#version 300 es
101
+ }`, xA = `#version 300 es
102
102
 
103
103
  layout (location = 0) in vec3 a_position;
104
104
  layout (location = 1) in vec3 a_normal;
@@ -113,7 +113,7 @@ out vec3 v_texCoords;
113
113
  void main() {
114
114
  v_texCoords = (u_worldToTexCoord * u_model * vec4(a_position, 1.0)).xyz;
115
115
  gl_Position = u_projection * u_modelView * vec4(a_position, 1.0);
116
- }`, HI = `#version 300 es
116
+ }`, qI = `#version 300 es
117
117
  #pragma inject_defines
118
118
 
119
119
  precision highp float;
@@ -139,7 +139,7 @@ void main() {
139
139
  float texel = float(texture(u_imageSampler, v_texCoords).r);
140
140
  float value = (texel + u_valueOffset) * u_valueScale;
141
141
  fragColor = vec4(value * u_color, u_opacity);
142
- }`, kC = `#version 300 es
142
+ }`, LC = `#version 300 es
143
143
 
144
144
  precision mediump float;
145
145
 
@@ -159,7 +159,7 @@ void main() {
159
159
  gl_PointSize = a_size;
160
160
  v_color = a_color;
161
161
  v_marker = uint(a_marker);
162
- }`, LC = `#version 300 es
162
+ }`, JC = `#version 300 es
163
163
 
164
164
  precision mediump float;
165
165
 
@@ -179,7 +179,7 @@ void main() {
179
179
  discard;
180
180
  }
181
181
  fragColor = vec4(v_color.rgb, u_opacity * alpha * v_color.a);
182
- }`, JC = `#version 300 es
182
+ }`, YC = `#version 300 es
183
183
 
184
184
  layout (location = 0) in vec3 a_position;
185
185
  layout (location = 1) in vec3 a_normal;
@@ -189,7 +189,7 @@ uniform mat4 u_modelView;
189
189
 
190
190
  void main() {
191
191
  gl_Position = u_projection * u_modelView * vec4(a_position, 1.0);
192
- }`, YC = `#version 300 es
192
+ }`, MC = `#version 300 es
193
193
 
194
194
  precision mediump float;
195
195
 
@@ -200,7 +200,7 @@ uniform vec3 u_color;
200
200
 
201
201
  void main() {
202
202
  fragColor = vec4(u_color, u_opacity);
203
- }`, qI = `#version 300 es
203
+ }`, lI = `#version 300 es
204
204
 
205
205
  precision highp float;
206
206
 
@@ -213,7 +213,7 @@ out highp vec3 v_positionModel;
213
213
  void main() {
214
214
  v_positionModel = a_position;
215
215
  gl_Position = u_projection * u_modelView * vec4(a_position, 1.0);
216
- }`, lI = `#version 300 es
216
+ }`, fI = `#version 300 es
217
217
  #pragma inject_defines
218
218
  precision highp float;
219
219
 
@@ -454,54 +454,54 @@ void main() {
454
454
 
455
455
  fragColor = vec4(color.rgb, alpha);
456
456
  }`;
457
- const MC = {
457
+ const dC = {
458
458
  projectedLine: {
459
- vertex: cC,
460
- fragment: UC
459
+ vertex: UC,
460
+ fragment: kC
461
461
  },
462
462
  points: {
463
- vertex: kC,
464
- fragment: LC
463
+ vertex: LC,
464
+ fragment: JC
465
465
  },
466
466
  wireframe: {
467
- vertex: JC,
468
- fragment: YC
467
+ vertex: YC,
468
+ fragment: MC
469
469
  },
470
470
  floatScalarImage: {
471
- vertex: WA,
472
- fragment: HI
471
+ vertex: xA,
472
+ fragment: qI
473
473
  },
474
474
  intScalarImage: {
475
- vertex: WA,
476
- fragment: HI,
475
+ vertex: xA,
476
+ fragment: qI,
477
477
  fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
478
478
  },
479
479
  uintScalarImage: {
480
- vertex: WA,
481
- fragment: HI,
480
+ vertex: xA,
481
+ fragment: qI,
482
482
  fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
483
483
  },
484
484
  labelImage: {
485
- vertex: WA,
485
+ vertex: xA,
486
486
  fragment: Zg
487
487
  },
488
488
  intLabelImage: {
489
- vertex: WA,
489
+ vertex: xA,
490
490
  fragment: Zg,
491
491
  fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
492
492
  },
493
493
  floatVolume: {
494
- vertex: qI,
495
- fragment: lI
494
+ vertex: lI,
495
+ fragment: fI
496
496
  },
497
497
  intVolume: {
498
- vertex: qI,
499
- fragment: lI,
498
+ vertex: lI,
499
+ fragment: fI,
500
500
  fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
501
501
  },
502
502
  uintVolume: {
503
- vertex: qI,
504
- fragment: lI,
503
+ vertex: lI,
504
+ fragment: fI,
505
505
  fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
506
506
  }
507
507
  }, Pg = {
@@ -509,7 +509,7 @@ const MC = {
509
509
  info: 20,
510
510
  warn: 30,
511
511
  error: 40
512
- }, dC = {
512
+ }, KC = {
513
513
  debug: "\x1B[90m",
514
514
  // gray
515
515
  info: "\x1B[36m",
@@ -519,7 +519,7 @@ const MC = {
519
519
  error: "\x1B[31m"
520
520
  // red
521
521
  };
522
- function KC() {
522
+ function HC() {
523
523
  const g = typeof process < "u" && typeof process.env?.NODE_ENV == "string" ? process.env.NODE_ENV : void 0;
524
524
  if (g === "production" || g === "development" || g === "test")
525
525
  return g;
@@ -531,7 +531,7 @@ function KC() {
531
531
  return "development";
532
532
  }
533
533
  class k {
534
- static logLevel_ = KC() === "production" ? "warn" : "debug";
534
+ static logLevel_ = HC() === "production" ? "warn" : "debug";
535
535
  static setLogLevel(A) {
536
536
  k.logLevel_ = A;
537
537
  }
@@ -549,7 +549,7 @@ class k {
549
549
  }
550
550
  static log(A, I, B, ...C) {
551
551
  if (Pg[A] < Pg[k.logLevel_]) return;
552
- const Q = (/* @__PURE__ */ new Date()).toISOString(), E = dC[A], i = `[${Q}][${A.toUpperCase()}][${I}]`, o = [`${E}${i}`, B, ...C];
552
+ const Q = (/* @__PURE__ */ new Date()).toISOString(), E = KC[A], i = `[${Q}][${A.toUpperCase()}][${I}]`, o = [`${E}${i}`, B, ...C];
553
553
  switch (A) {
554
554
  case "debug":
555
555
  console.debug(...o);
@@ -566,7 +566,7 @@ class k {
566
566
  }
567
567
  }
568
568
  }
569
- class HC {
569
+ class qC {
570
570
  gl_;
571
571
  program_;
572
572
  uniformInfo_ = /* @__PURE__ */ new Map();
@@ -648,7 +648,7 @@ class HC {
648
648
  for (let I = 0; I < A; I++) {
649
649
  const B = this.gl_.getActiveUniform(this.program_, I);
650
650
  if (B) {
651
- if (!lC.has(B.type))
651
+ if (!fC.has(B.type))
652
652
  throw new Error(
653
653
  `Unsupported uniform type "${B.type}" (GLenum) found in shader program for uniform "${B.name}"`
654
654
  );
@@ -689,7 +689,7 @@ class HC {
689
689
  return Array.from(this.uniformInfo_.keys());
690
690
  }
691
691
  }
692
- const qC = typeof window < "u" ? [
692
+ const lC = typeof window < "u" ? [
693
693
  WebGL2RenderingContext.BOOL,
694
694
  WebGL2RenderingContext.FLOAT,
695
695
  WebGL2RenderingContext.INT,
@@ -714,10 +714,10 @@ const qC = typeof window < "u" ? [
714
714
  WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_3D,
715
715
  WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_CUBE,
716
716
  WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_2D_ARRAY
717
- ] : [], lC = new Set(
718
- qC
719
- ), fI = "#pragma inject_defines";
720
- class fC {
717
+ ] : [], fC = new Set(
718
+ lC
719
+ ), pI = "#pragma inject_defines";
720
+ class pC {
721
721
  gl_;
722
722
  programs_ = /* @__PURE__ */ new Map();
723
723
  constructor(A) {
@@ -726,14 +726,14 @@ class fC {
726
726
  use(A) {
727
727
  let I = this.programs_.get(A);
728
728
  if (I === void 0) {
729
- const B = MC[A], C = Og(
729
+ const B = dC[A], C = Og(
730
730
  B.vertex,
731
731
  B.vertexDefines
732
732
  ), Q = Og(
733
733
  B.fragment,
734
734
  B.fragmentDefines
735
735
  );
736
- I = new HC(
736
+ I = new qC(
737
737
  this.gl_,
738
738
  C,
739
739
  Q
@@ -749,35 +749,35 @@ class fC {
749
749
  }
750
750
  function Og(g, A) {
751
751
  if (A === void 0 || A.size == 0) return g;
752
- if (!g.includes(fI))
752
+ if (!g.includes(pI))
753
753
  throw new Error(
754
- `Shader source does not contain "${fI}" directive`
754
+ `Shader source does not contain "${pI}" directive`
755
755
  );
756
756
  const I = Array.from(A.entries()).map(([E, i]) => `#define ${E} ${i}`).join(`
757
757
  `), C = `#line __LINE__ + ${1 - A.size}`, Q = `${I}
758
758
  ${C}`;
759
- return g.replace(fI, Q);
759
+ return g.replace(pI, Q);
760
760
  }
761
761
  const CI = {};
762
762
  function ZB(g) {
763
763
  const A = g ?? "";
764
764
  return CI[A] = (CI[A] ?? 0) + 1, g ? `${g}-${CI[A]}` : String(CI[A]);
765
765
  }
766
- class hg {
766
+ class LI {
767
767
  id = ZB();
768
768
  }
769
- var T = 1e-6, X = typeof Float32Array < "u" ? Float32Array : Array, pC = Math.PI / 180;
770
- function mC(g) {
771
- return g * pC;
769
+ var T = 1e-6, X = typeof Float32Array < "u" ? Float32Array : Array, mC = Math.PI / 180;
770
+ function uC(g) {
771
+ return g * mC;
772
772
  }
773
773
  function PB() {
774
774
  var g = new X(9);
775
775
  return X != 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;
776
776
  }
777
- function uC(g, A) {
777
+ function TC(g, A) {
778
778
  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;
779
779
  }
780
- function TC(g, A, I, B, C, Q, E, i, o) {
780
+ function xC(g, A, I, B, C, Q, E, i, o) {
781
781
  var a = new X(9);
782
782
  return a[0] = g, a[1] = A, a[2] = I, a[3] = B, a[4] = C, a[5] = Q, a[6] = E, a[7] = i, a[8] = o, a;
783
783
  }
@@ -785,26 +785,26 @@ function $() {
785
785
  var g = new X(16);
786
786
  return X != Float32Array && (g[1] = 0, g[2] = 0, g[3] = 0, g[4] = 0, g[6] = 0, g[7] = 0, g[8] = 0, g[9] = 0, g[11] = 0, g[12] = 0, g[13] = 0, g[14] = 0), g[0] = 1, g[5] = 1, g[10] = 1, g[15] = 1, g;
787
787
  }
788
- function LI(g, A) {
788
+ function JI(g, A) {
789
789
  var I = A[0], B = A[1], C = A[2], Q = A[3], E = A[4], i = A[5], o = A[6], a = A[7], D = A[8], s = A[9], h = A[10], t = A[11], y = A[12], n = A[13], F = A[14], G = A[15], J = I * i - B * E, U = I * o - C * E, S = I * a - Q * E, r = B * o - C * i, c = B * a - Q * i, f = C * a - Q * o, Z = D * n - s * y, j = D * F - h * y, b = D * G - t * y, z = s * F - h * n, iA = s * G - t * n, oA = h * G - t * F, P = J * oA - U * iA + S * z + r * b - c * j + f * Z;
790
790
  return P ? (P = 1 / P, g[0] = (i * oA - o * iA + a * z) * P, g[1] = (C * iA - B * oA - Q * z) * P, g[2] = (n * f - F * c + G * r) * P, g[3] = (h * c - s * f - t * r) * P, g[4] = (o * b - E * oA - a * j) * P, g[5] = (I * oA - C * b + Q * j) * P, g[6] = (F * S - y * f - G * U) * P, g[7] = (D * f - h * S + t * U) * P, g[8] = (E * iA - i * b + a * Z) * P, g[9] = (B * b - I * iA - Q * Z) * P, g[10] = (y * c - n * S + G * J) * P, g[11] = (s * S - D * c - t * J) * P, g[12] = (i * j - E * z - o * Z) * P, g[13] = (I * z - B * j + C * Z) * P, g[14] = (n * U - y * r - F * J) * P, g[15] = (D * r - s * U + h * J) * P, g) : null;
791
791
  }
792
- function vI(g, A, I) {
792
+ function XI(g, A, I) {
793
793
  var B = A[0], C = A[1], Q = A[2], E = A[3], i = A[4], o = A[5], a = A[6], D = A[7], s = A[8], h = A[9], t = A[10], y = A[11], n = A[12], F = A[13], G = A[14], J = A[15], U = I[0], S = I[1], r = I[2], c = I[3];
794
794
  return g[0] = U * B + S * i + r * s + c * n, g[1] = U * C + S * o + r * h + c * F, g[2] = U * Q + S * a + r * t + c * G, g[3] = U * E + S * D + r * y + c * J, U = I[4], S = I[5], r = I[6], c = I[7], g[4] = U * B + S * i + r * s + c * n, g[5] = U * C + S * o + r * h + c * F, g[6] = U * Q + S * a + r * t + c * G, g[7] = U * E + S * D + r * y + c * J, U = I[8], S = I[9], r = I[10], c = I[11], g[8] = U * B + S * i + r * s + c * n, g[9] = U * C + S * o + r * h + c * F, g[10] = U * Q + S * a + r * t + c * G, g[11] = U * E + S * D + r * y + c * J, U = I[12], S = I[13], r = I[14], c = I[15], g[12] = U * B + S * i + r * s + c * n, g[13] = U * C + S * o + r * h + c * F, g[14] = U * Q + S * a + r * t + c * G, g[15] = U * E + S * D + r * y + c * J, g;
795
795
  }
796
- function xC(g, A, I) {
796
+ function WC(g, A, I) {
797
797
  var B = I[0], C = I[1], Q = I[2], E, i, o, a, D, s, h, t, y, n, F, G;
798
798
  return A === g ? (g[12] = A[0] * B + A[4] * C + A[8] * Q + A[12], g[13] = A[1] * B + A[5] * C + A[9] * Q + A[13], g[14] = A[2] * B + A[6] * C + A[10] * Q + A[14], g[15] = A[3] * B + A[7] * C + A[11] * Q + A[15]) : (E = A[0], i = A[1], o = A[2], a = A[3], D = A[4], s = A[5], h = A[6], t = A[7], y = A[8], n = A[9], F = A[10], G = A[11], g[0] = E, g[1] = i, g[2] = o, g[3] = a, g[4] = D, g[5] = s, g[6] = h, g[7] = t, g[8] = y, g[9] = n, g[10] = F, g[11] = G, g[12] = E * B + D * C + y * Q + A[12], g[13] = i * B + s * C + n * Q + A[13], g[14] = o * B + h * C + F * Q + A[14], g[15] = a * B + t * C + G * Q + A[15]), g;
799
799
  }
800
800
  function OB(g, A) {
801
801
  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;
802
802
  }
803
- function WC(g, A, I, B) {
803
+ function bC(g, A, I, B) {
804
804
  var C = A[0], Q = A[1], E = A[2], i = A[3], o = C + C, a = Q + Q, D = E + E, s = C * o, h = C * a, t = C * D, y = Q * a, n = Q * D, F = E * D, G = i * o, J = i * a, U = i * D, S = B[0], r = B[1], c = B[2];
805
805
  return g[0] = (1 - (y + F)) * S, g[1] = (h + U) * S, g[2] = (t - J) * S, g[3] = 0, g[4] = (h - U) * r, g[5] = (1 - (s + F)) * r, g[6] = (n + G) * r, g[7] = 0, g[8] = (t + J) * c, g[9] = (n - G) * c, g[10] = (1 - (s + y)) * c, g[11] = 0, g[12] = I[0], g[13] = I[1], g[14] = I[2], g[15] = 1, g;
806
806
  }
807
- function bC(g, A, I, B, C) {
807
+ function ZC(g, A, I, B, C) {
808
808
  var Q = 1 / Math.tan(A / 2);
809
809
  if (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) {
810
810
  var E = 1 / (B - C);
@@ -813,19 +813,19 @@ function bC(g, A, I, B, C) {
813
813
  g[10] = -1, g[14] = -2 * B;
814
814
  return g;
815
815
  }
816
- var ZC = bC;
817
- function PC(g, A, I, B, C, Q, E) {
816
+ var PC = ZC;
817
+ function OC(g, A, I, B, C, Q, E) {
818
818
  var i = 1 / (A - I), o = 1 / (B - C), a = 1 / (Q - E);
819
819
  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;
820
820
  }
821
- var OC = PC;
822
- function VC(g, A, I, B) {
821
+ var VC = OC;
822
+ function vC(g, A, I, B) {
823
823
  var C = A[0], Q = A[1], E = A[2], i = B[0], o = B[1], a = B[2], D = C - I[0], s = Q - I[1], h = E - I[2], t = D * D + s * s + h * h;
824
824
  t > 0 && (t = 1 / Math.sqrt(t), D *= t, s *= t, h *= t);
825
825
  var y = o * h - a * s, n = a * D - i * h, F = i * s - o * D;
826
826
  return t = y * y + n * n + F * F, t > 0 && (t = 1 / Math.sqrt(t), y *= t, n *= t, F *= t), g[0] = y, g[1] = n, g[2] = F, g[3] = 0, g[4] = s * F - h * n, g[5] = h * y - D * F, g[6] = D * n - s * y, g[7] = 0, g[8] = D, g[9] = s, g[10] = h, g[11] = 0, g[12] = C, g[13] = Q, g[14] = E, g[15] = 1, g;
827
827
  }
828
- function vC(g, A) {
828
+ function XC(g, A) {
829
829
  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], D = g[8], s = g[9], h = g[10], t = g[11], y = g[12], n = g[13], F = g[14], G = g[15], J = A[0], U = A[1], S = A[2], r = A[3], c = A[4], f = A[5], Z = A[6], j = A[7], b = A[8], z = A[9], iA = A[10], oA = A[11], P = A[12], xg = A[13], Wg = A[14], bg = A[15];
830
830
  return Math.abs(I - J) <= T * Math.max(1, Math.abs(I), Math.abs(J)) && Math.abs(B - U) <= T * Math.max(1, Math.abs(B), Math.abs(U)) && Math.abs(C - S) <= T * Math.max(1, Math.abs(C), Math.abs(S)) && Math.abs(Q - r) <= T * Math.max(1, Math.abs(Q), Math.abs(r)) && Math.abs(E - c) <= T * Math.max(1, Math.abs(E), Math.abs(c)) && Math.abs(i - f) <= T * Math.max(1, Math.abs(i), Math.abs(f)) && Math.abs(o - Z) <= T * Math.max(1, Math.abs(o), Math.abs(Z)) && Math.abs(a - j) <= T * Math.max(1, Math.abs(a), Math.abs(j)) && Math.abs(D - b) <= T * Math.max(1, Math.abs(D), Math.abs(b)) && Math.abs(s - z) <= T * Math.max(1, Math.abs(s), Math.abs(z)) && Math.abs(h - iA) <= T * Math.max(1, Math.abs(h), Math.abs(iA)) && Math.abs(t - oA) <= T * Math.max(1, Math.abs(t), Math.abs(oA)) && Math.abs(y - P) <= T * Math.max(1, Math.abs(y), Math.abs(P)) && Math.abs(n - xg) <= T * Math.max(1, Math.abs(n), Math.abs(xg)) && Math.abs(F - Wg) <= T * Math.max(1, Math.abs(F), Math.abs(Wg)) && Math.abs(G - bg) <= T * Math.max(1, Math.abs(G), Math.abs(bg));
831
831
  }
@@ -845,7 +845,7 @@ function p(g, A, I) {
845
845
  var B = new X(3);
846
846
  return B[0] = g, B[1] = A, B[2] = I, B;
847
847
  }
848
- function XI(g, A) {
848
+ function jI(g, A) {
849
849
  return g[0] = A[0], g[1] = A[1], g[2] = A[2], g;
850
850
  }
851
851
  function rA(g, A, I, B) {
@@ -857,13 +857,13 @@ function JA(g, A, I) {
857
857
  function yg(g, A, I) {
858
858
  return g[0] = A[0] - I[0], g[1] = A[1] - I[1], g[2] = A[2] - I[2], g;
859
859
  }
860
- function XC(g, A, I) {
860
+ function jC(g, A, I) {
861
861
  return g[0] = A[0] * I[0], g[1] = A[1] * I[1], g[2] = A[2] * I[2], g;
862
862
  }
863
- function vA(g, A, I) {
863
+ function VA(g, A, I) {
864
864
  return g[0] = A[0] * I, g[1] = A[1] * I, g[2] = A[2] * I, g;
865
865
  }
866
- function jI(g, A, I, B) {
866
+ function zI(g, A, I, B) {
867
867
  return g[0] = A[0] + I[0] * B, g[1] = A[1] + I[1] * B, g[2] = A[2] + I[2] * B, g;
868
868
  }
869
869
  function Vg(g, A) {
@@ -889,14 +889,14 @@ function vB(g, A, I) {
889
889
  var B = I[0], C = I[1], Q = I[2], E = I[3], i = A[0], o = A[1], a = A[2], D = C * a - Q * o, s = Q * i - B * a, h = B * o - C * i;
890
890
  return D = D + D, s = s + s, h = h + h, g[0] = i + E * D + C * h - Q * s, g[1] = o + E * s + Q * D - B * h, g[2] = a + E * h + B * s - C * D, g;
891
891
  }
892
- function jC(g) {
892
+ function zC(g) {
893
893
  return g[0] = 0, g[1] = 0, g[2] = 0, g;
894
894
  }
895
895
  function ng(g, A) {
896
896
  var I = g[0], B = g[1], C = g[2], Q = A[0], E = A[1], i = A[2];
897
897
  return Math.abs(I - Q) <= T * Math.max(1, Math.abs(I), Math.abs(Q)) && Math.abs(B - E) <= T * Math.max(1, Math.abs(B), Math.abs(E)) && Math.abs(C - i) <= T * Math.max(1, Math.abs(C), Math.abs(i));
898
898
  }
899
- var zI = yg, zC = tg;
899
+ var _I = yg, _C = tg;
900
900
  (function() {
901
901
  var g = d();
902
902
  return function(A, I, B, C, Q, E) {
@@ -910,7 +910,7 @@ function YA() {
910
910
  var g = new X(4);
911
911
  return X != Float32Array && (g[0] = 0, g[1] = 0, g[2] = 0, g[3] = 0), g;
912
912
  }
913
- function _C(g) {
913
+ function $C(g) {
914
914
  var A = new X(4);
915
915
  return A[0] = g[0], A[1] = g[1], A[2] = g[2], A[3] = g[3], A;
916
916
  }
@@ -918,17 +918,17 @@ function DI(g, A, I, B) {
918
918
  var C = new X(4);
919
919
  return C[0] = g, C[1] = A, C[2] = I, C[3] = B, C;
920
920
  }
921
- function $C(g, A) {
921
+ function AQ(g, A) {
922
922
  return g[0] = A[0], g[1] = A[1], g[2] = A[2], g[3] = A[3], g;
923
923
  }
924
- function AQ(g, A, I) {
924
+ function IQ(g, A, I) {
925
925
  return g[0] = A[0] * I, g[1] = A[1] * I, g[2] = A[2] * I, g[3] = A[3] * I, g;
926
926
  }
927
- function IQ(g, A) {
927
+ function gQ(g, A) {
928
928
  var I = A[0], B = A[1], C = A[2], Q = A[3], E = I * I + B * B + C * C + Q * Q;
929
929
  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;
930
930
  }
931
- function XA(g, A, I) {
931
+ function vA(g, A, I) {
932
932
  var B = A[0], C = A[1], Q = A[2], E = A[3];
933
933
  return g[0] = I[0] * B + I[4] * C + I[8] * Q + I[12] * E, g[1] = I[1] * B + I[5] * C + I[9] * Q + I[13] * E, g[2] = I[2] * B + I[6] * C + I[10] * Q + I[14] * E, g[3] = I[3] * B + I[7] * C + I[11] * Q + I[15] * E, g;
934
934
  }
@@ -945,16 +945,16 @@ function sI() {
945
945
  var g = new X(4);
946
946
  return X != Float32Array && (g[0] = 0, g[1] = 0, g[2] = 0), g[3] = 1, g;
947
947
  }
948
- function gQ(g, A, I) {
948
+ function BQ(g, A, I) {
949
949
  I = I * 0.5;
950
950
  var B = Math.sin(I);
951
951
  return g[0] = B * A[0], g[1] = B * A[1], g[2] = B * A[2], g[3] = Math.cos(I), g;
952
952
  }
953
- function BQ(g, A, I) {
953
+ function CQ(g, A, I) {
954
954
  var B = A[0], C = A[1], Q = A[2], E = A[3], i = I[0], o = I[1], a = I[2], D = I[3];
955
955
  return g[0] = B * D + E * i + C * a - Q * o, g[1] = C * D + E * o + Q * i - B * a, g[2] = Q * D + E * a + B * o - C * i, g[3] = E * D - B * i - C * o - Q * a, g;
956
956
  }
957
- function pI(g, A, I, B) {
957
+ function mI(g, A, I, B) {
958
958
  var C = A[0], Q = A[1], E = A[2], i = A[3], o = I[0], a = I[1], D = I[2], s = I[3], h, t, y, n, F;
959
959
  return t = C * o + Q * a + E * D + i * s, t < 0 && (t = -t, o = -o, a = -a, D = -D, s = -s), 1 - t > T ? (h = Math.acos(t), y = Math.sin(h), n = Math.sin((1 - B) * h) / y, F = Math.sin(B * h) / y) : (n = 1 - B, F = B), g[0] = n * C + F * o, g[1] = n * Q + F * a, g[2] = n * E + F * D, g[3] = n * i + F * s, g;
960
960
  }
@@ -970,24 +970,24 @@ function Gg(g, A) {
970
970
  }
971
971
  return g;
972
972
  }
973
- var CQ = _C, QQ = $C, JI = IQ;
973
+ var QQ = $C, EQ = AQ, YI = gQ;
974
974
  (function() {
975
975
  var g = d(), A = p(1, 0, 0), I = p(0, 1, 0);
976
976
  return function(B, C, Q) {
977
977
  var E = aI(C, Q);
978
- return E < -0.999999 ? (EI(g, A, C), zC(g) < 1e-6 && EI(g, I, C), VB(g, g), gQ(B, g, Math.PI), B) : E > 0.999999 ? (B[0] = 0, B[1] = 0, B[2] = 0, B[3] = 1, B) : (EI(g, C, Q), B[0] = g[0], B[1] = g[1], B[2] = g[2], B[3] = 1 + E, JI(B, B));
978
+ return E < -0.999999 ? (EI(g, A, C), _C(g) < 1e-6 && EI(g, I, C), VB(g, g), BQ(B, g, Math.PI), B) : E > 0.999999 ? (B[0] = 0, B[1] = 0, B[2] = 0, B[3] = 1, B) : (EI(g, C, Q), B[0] = g[0], B[1] = g[1], B[2] = g[2], B[3] = 1 + E, YI(B, B));
979
979
  };
980
980
  })();
981
981
  (function() {
982
982
  var g = sI(), A = sI();
983
983
  return function(I, B, C, Q, E, i) {
984
- return pI(g, B, E, i), pI(A, C, Q, i), pI(I, g, A, 2 * i * (1 - i)), I;
984
+ return mI(g, B, E, i), mI(A, C, Q, i), mI(I, g, A, 2 * i * (1 - i)), I;
985
985
  };
986
986
  })();
987
987
  (function() {
988
988
  var g = PB();
989
989
  return function(A, I, B, C) {
990
- return g[0] = B[0], g[3] = B[1], g[6] = B[2], g[1] = C[0], g[4] = C[1], g[7] = C[2], g[2] = -I[0], g[5] = -I[1], g[8] = -I[2], JI(A, Gg(A, g));
990
+ return g[0] = B[0], g[3] = B[1], g[6] = B[2], g[1] = C[0], g[4] = C[1], g[7] = C[2], g[2] = -I[0], g[5] = -I[1], g[8] = -I[2], YI(A, Gg(A, g));
991
991
  };
992
992
  })();
993
993
  function XB() {
@@ -1002,22 +1002,22 @@ function V(g, A) {
1002
1002
  var I = new X(2);
1003
1003
  return I[0] = g, I[1] = A, I;
1004
1004
  }
1005
- function EQ(g, A) {
1005
+ function iQ(g, A) {
1006
1006
  var I = A[0] - g[0], B = A[1] - g[1];
1007
1007
  return Math.sqrt(I * I + B * B);
1008
1008
  }
1009
- function iQ(g) {
1009
+ function oQ(g) {
1010
1010
  var A = g[0], I = g[1];
1011
1011
  return A * A + I * I;
1012
1012
  }
1013
- function oQ(g, A, I, B) {
1013
+ function aQ(g, A, I, B) {
1014
1014
  var C = A[0], Q = A[1];
1015
1015
  return g[0] = C + B * (I[0] - C), g[1] = Q + B * (I[1] - Q), g;
1016
1016
  }
1017
1017
  function Xg(g, A) {
1018
1018
  return g[0] === A[0] && g[1] === A[1];
1019
1019
  }
1020
- function mI(g, A) {
1020
+ function uI(g, A) {
1021
1021
  var I = g[0], B = g[1], C = A[0], Q = A[1];
1022
1022
  return Math.abs(I - C) <= T * Math.max(1, Math.abs(I), Math.abs(C)) && Math.abs(B - Q) <= T * Math.max(1, Math.abs(B), Math.abs(Q));
1023
1023
  }
@@ -1072,7 +1072,7 @@ class SA {
1072
1072
  eg(Q, E, A), this.expandWithPoint(Q);
1073
1073
  }
1074
1074
  }
1075
- const aQ = {
1075
+ const DQ = {
1076
1076
  position: 0,
1077
1077
  normal: 1,
1078
1078
  uv: 2,
@@ -1083,7 +1083,7 @@ const aQ = {
1083
1083
  size: 7,
1084
1084
  marker: 8
1085
1085
  };
1086
- class mA extends hg {
1086
+ class mA extends LI {
1087
1087
  boundingBox_ = null;
1088
1088
  primitive_;
1089
1089
  attributes_;
@@ -1135,7 +1135,7 @@ class mA extends hg {
1135
1135
  return this.attributes_.find((I) => I.type === A);
1136
1136
  }
1137
1137
  }
1138
- class DQ {
1138
+ class sQ {
1139
1139
  gl_;
1140
1140
  buffers_ = /* @__PURE__ */ new Map();
1141
1141
  currentGeometry_ = null;
@@ -1171,7 +1171,7 @@ class DQ {
1171
1171
  this.gl_.bindBuffer(C, Q), this.gl_.bufferData(C, B, this.gl_.STATIC_DRAW);
1172
1172
  const { attributes: E, strideBytes: i } = A;
1173
1173
  E.forEach((D) => {
1174
- const s = aQ[D.type];
1174
+ const s = DQ[D.type];
1175
1175
  this.gl_.vertexAttribPointer(
1176
1176
  s,
1177
1177
  D.itemSize,
@@ -1190,7 +1190,7 @@ class DQ {
1190
1190
  this.buffers_.set(A, o), this.gl_.bindVertexArray(null);
1191
1191
  }
1192
1192
  }
1193
- function sQ(g) {
1193
+ function hQ(g) {
1194
1194
  return g === 1 || g === 2 || g === 4 || g === 8;
1195
1195
  }
1196
1196
  function wg(g) {
@@ -1210,7 +1210,7 @@ function wg(g) {
1210
1210
  return "float";
1211
1211
  throw new Error("Unsupported buffer type.");
1212
1212
  }
1213
- function hQ(g) {
1213
+ function tQ(g) {
1214
1214
  switch (g.dataFormat) {
1215
1215
  case "scalar":
1216
1216
  return 1;
@@ -1220,7 +1220,7 @@ function hQ(g) {
1220
1220
  return 4;
1221
1221
  }
1222
1222
  }
1223
- function tQ(g) {
1223
+ function yQ(g) {
1224
1224
  switch (g.dataType) {
1225
1225
  case "byte":
1226
1226
  case "unsigned_byte":
@@ -1234,14 +1234,14 @@ function tQ(g) {
1234
1234
  return 4;
1235
1235
  }
1236
1236
  }
1237
- function _I(g) {
1238
- const A = hQ(g) * tQ(g), I = Math.max(1, g.mipmapLevels);
1237
+ function $I(g) {
1238
+ const A = tQ(g) * yQ(g), I = Math.max(1, g.mipmapLevels);
1239
1239
  let B = Math.max(1, g.width), C = Math.max(1, g.height), Q = Math.max(1, g.depth), E = 0;
1240
1240
  for (let i = 0; i < I; ++i)
1241
1241
  E += A * Q * B * C, B = Math.max(1, B >> 1), C = Math.max(1, C >> 1), g.type === "Texture3D" && (Q = Math.max(1, Q >> 1));
1242
1242
  return E;
1243
1243
  }
1244
- function yQ(g) {
1244
+ function eQ(g) {
1245
1245
  if (g.dataFormat === "rgb" || g.dataFormat === "rgba")
1246
1246
  return [0, 1];
1247
1247
  switch (g.dataType) {
@@ -1261,7 +1261,7 @@ function yQ(g) {
1261
1261
  return [0, 1];
1262
1262
  }
1263
1263
  }
1264
- class Fg extends hg {
1264
+ class Fg extends LI {
1265
1265
  dataFormat = "rgba";
1266
1266
  dataType = "unsigned_byte";
1267
1267
  maxFilter = "nearest";
@@ -1292,7 +1292,7 @@ class Fg extends hg {
1292
1292
  return "Texture";
1293
1293
  }
1294
1294
  }
1295
- class eQ {
1295
+ class nQ {
1296
1296
  gl_;
1297
1297
  textures_ = /* @__PURE__ */ new Map();
1298
1298
  currentTexture_ = null;
@@ -1370,7 +1370,7 @@ class eQ {
1370
1370
  const I = this.textures_.get(A);
1371
1371
  if (I) {
1372
1372
  this.gl_.deleteTexture(I), this.textures_.delete(A), A.readTexel = void 0, this.currentTexture_ === A && (this.currentTexture_ = null);
1373
- const B = _I(A);
1373
+ const B = $I(A);
1374
1374
  this.gpuTextureBytes_ = Math.max(0, this.gpuTextureBytes_ - B), this.textureCount_ = Math.max(0, this.textureCount_ - 1);
1375
1375
  }
1376
1376
  }
@@ -1404,7 +1404,7 @@ class eQ {
1404
1404
  );
1405
1405
  else
1406
1406
  throw new Error(`Unknown texture type ${A.type}`);
1407
- this.gpuTextureBytes_ += _I(A), this.textureCount_ += 1, this.textures_.set(A, C), this.gl_.bindTexture(B, null), A.readTexel = (Q, E, i) => Promise.resolve(this.readTexel(A, Q, E, i));
1407
+ this.gpuTextureBytes_ += $I(A), this.textureCount_ += 1, this.textures_.set(A, C), this.gl_.bindTexture(B, null), A.readTexel = (Q, E, i) => Promise.resolve(this.readTexel(A, Q, E, i));
1408
1408
  }
1409
1409
  configureTextureParameters(A, I) {
1410
1410
  const B = this.gl_, C = this.getFilter(A.minFilter, A), Q = this.getFilter(A.maxFilter, A);
@@ -1590,7 +1590,7 @@ class AA {
1590
1590
  return { x: A, y: I, width: B, height: C };
1591
1591
  }
1592
1592
  }
1593
- class nQ {
1593
+ class GQ {
1594
1594
  gl_;
1595
1595
  enabledCapabilities_ = /* @__PURE__ */ new Map();
1596
1596
  depthMaskEnabled_ = null;
@@ -1696,8 +1696,8 @@ class nQ {
1696
1696
  (this.stencilFunc_ !== A || this.stencilRef_ !== I || this.stencilFuncMask_ !== B) && (this.gl_.stencilFunc(A, I, B), this.stencilFunc_ = A, this.stencilRef_ = I, this.stencilFuncMask_ = B);
1697
1697
  }
1698
1698
  }
1699
- const GQ = OB($(), [1, -1, 1]);
1700
- class wQ extends NC {
1699
+ const wQ = OB($(), [1, -1, 1]);
1700
+ class FQ extends cC {
1701
1701
  gl_;
1702
1702
  programs_;
1703
1703
  bindings_;
@@ -1718,7 +1718,7 @@ class wQ extends NC {
1718
1718
  this.gl_ = I, k.info(
1719
1719
  "WebGLRenderer",
1720
1720
  `WebGL version ${I.getParameter(I.VERSION)}`
1721
- ), I.getExtension("EXT_color_buffer_float"), this.programs_ = new fC(I), this.bindings_ = new DQ(I), this.textures_ = new eQ(I), this.state_ = new nQ(I), this.initStencil(), this.resize(this.canvas.width, this.canvas.height);
1721
+ ), I.getExtension("EXT_color_buffer_float"), this.programs_ = new pC(I), this.bindings_ = new sQ(I), this.textures_ = new nQ(I), this.state_ = new GQ(I), this.initStencil(), this.resize(this.canvas.width, this.canvas.height);
1722
1722
  }
1723
1723
  get gpuTextureBytes() {
1724
1724
  return this.textures_.gpuTextureBytes;
@@ -1799,13 +1799,13 @@ class wQ extends NC {
1799
1799
  }
1800
1800
  }
1801
1801
  drawGeometry(A, I, B, C, Q) {
1802
- const E = vI(
1802
+ const E = XI(
1803
1803
  $(),
1804
1804
  Q.viewMatrix,
1805
1805
  I.transform.matrix
1806
- ), i = vI(
1806
+ ), i = XI(
1807
1807
  $(),
1808
- GQ,
1808
+ wQ,
1809
1809
  Q.projectionMatrix
1810
1810
  ), o = this.currentViewportSize_, a = I.getUniforms(), s = {
1811
1811
  ...B.getUniforms(),
@@ -1832,7 +1832,7 @@ class wQ extends NC {
1832
1832
  );
1833
1833
  break;
1834
1834
  case "u_cameraPositionModel": {
1835
- const n = LI($(), E), F = DI(0, 0, 0, 1), G = XA(
1835
+ const n = JI($(), E), F = DI(0, 0, 0, 1), G = vA(
1836
1836
  YA(),
1837
1837
  F,
1838
1838
  n
@@ -1886,11 +1886,11 @@ class wQ extends NC {
1886
1886
  ), this.state_.setDepthTesting(!0), this.gl_.depthFunc(this.gl_.LEQUAL);
1887
1887
  }
1888
1888
  }
1889
- function ZA(g, A) {
1889
+ function bA(g, A) {
1890
1890
  const I = g.priority ?? Number.MAX_SAFE_INTEGER, B = A.priority ?? Number.MAX_SAFE_INTEGER;
1891
1891
  return I === B ? (g.orderKey ?? Number.MAX_SAFE_INTEGER) - (A.orderKey ?? Number.MAX_SAFE_INTEGER) : I - B;
1892
1892
  }
1893
- class FQ {
1893
+ class rQ {
1894
1894
  maxConcurrent_;
1895
1895
  pending_ = [];
1896
1896
  running_ = /* @__PURE__ */ new Map();
@@ -1920,7 +1920,7 @@ class FQ {
1920
1920
  }
1921
1921
  pump() {
1922
1922
  if (!(this.running_.size >= this.maxConcurrent_ || this.pending_.length === 0))
1923
- for (this.pending_.sort((A, I) => ZA(A.chunk, I.chunk)); this.running_.size < this.maxConcurrent_ && this.pending_.length > 0; )
1923
+ for (this.pending_.sort((A, I) => bA(A.chunk, I.chunk)); this.running_.size < this.maxConcurrent_ && this.pending_.length > 0; )
1924
1924
  this.start(this.pending_.shift());
1925
1925
  }
1926
1926
  start(A) {
@@ -1940,13 +1940,13 @@ class FQ {
1940
1940
  }
1941
1941
  }
1942
1942
  let hI = 0, tI = 0;
1943
- function rQ(g, A) {
1943
+ function SQ(g, A) {
1944
1944
  g.data && (hI -= g.data.byteLength, tI -= 1), g.data = A, hI += A.byteLength, tI += 1;
1945
1945
  }
1946
1946
  function jg(g) {
1947
1947
  g.data && (hI -= g.data.byteLength, tI -= 1), g.data = void 0, g.texture?.releaseCpuData();
1948
1948
  }
1949
- function SQ() {
1949
+ function RQ() {
1950
1950
  return { cpuChunkBytes: hI, cpuChunkCount: tI };
1951
1951
  }
1952
1952
  function zg(g, A, I = 1e-6) {
@@ -1970,7 +1970,7 @@ function MA(g) {
1970
1970
  function dA(g) {
1971
1971
  const A = d(), I = d();
1972
1972
  A[W[g.u]] = 1, I[W[g.v]] = 1;
1973
- const B = EI(d(), A, I), C = TC(
1973
+ const B = EI(d(), A, I), C = xC(
1974
1974
  A[0],
1975
1975
  A[1],
1976
1976
  A[2],
@@ -1981,7 +1981,7 @@ function dA(g) {
1981
1981
  B[1],
1982
1982
  B[2]
1983
1983
  ), Q = Gg(sI(), C);
1984
- return JI(Q, Q);
1984
+ return YI(Q, Q);
1985
1985
  }
1986
1986
  const _g = [
1987
1987
  Int8Array,
@@ -1992,7 +1992,7 @@ const _g = [
1992
1992
  Uint32Array,
1993
1993
  Float32Array
1994
1994
  ];
1995
- function RQ(g) {
1995
+ function NQ(g) {
1996
1996
  if (_g.some((I) => g instanceof I))
1997
1997
  return !0;
1998
1998
  const A = _g.map((I) => I.name);
@@ -2001,7 +2001,7 @@ function RQ(g) {
2001
2001
  `Unsupported chunk data type: ${g}. Supported data types: ${A}`
2002
2002
  ), !1;
2003
2003
  }
2004
- function NQ(g, A) {
2004
+ function cQ(g, A) {
2005
2005
  return Math.round((A - g.translation) / g.scale);
2006
2006
  }
2007
2007
  function jB(g, A) {
@@ -2011,13 +2011,13 @@ function jB(g, A) {
2011
2011
  I[i] = 1 / (g.scale[Q] * g.shape[Q]), B[i] = E - g.offset[Q];
2012
2012
  }
2013
2013
  const C = OB($(), I);
2014
- return xC(C, C, B);
2014
+ return WC(C, C, B);
2015
2015
  }
2016
2016
  function hA(g, A, I) {
2017
2017
  return Math.max(A, Math.min(I, g));
2018
2018
  }
2019
- const YI = Symbol("INTERNAL_POLICY_KEY");
2020
- class cQ {
2019
+ const MI = Symbol("INTERNAL_POLICY_KEY");
2020
+ class UQ {
2021
2021
  store_;
2022
2022
  policy_;
2023
2023
  policyChanged_ = !1;
@@ -2044,7 +2044,7 @@ class cQ {
2044
2044
  `Source is missing dimensions for slice plane axes "${this.axes_.u}" and "${this.axes_.v}"`
2045
2045
  );
2046
2046
  const i = Q.lods[0], o = E.lods[0];
2047
- this.scale0_ = i.scale, this.sourceMaxSquareDistance2D_ = iQ(
2047
+ this.scale0_ = i.scale, this.sourceMaxSquareDistance2D_ = oQ(
2048
2048
  V(i.size * i.scale, o.size * o.scale)
2049
2049
  );
2050
2050
  }
@@ -2084,13 +2084,13 @@ class cQ {
2084
2084
  k.warn(
2085
2085
  "ChunkStoreView",
2086
2086
  "updateChunkViewStates called with no chunks initialized"
2087
- ), this.chunkViewStates_.forEach(bA);
2087
+ ), this.chunkViewStates_.forEach(WA);
2088
2088
  return;
2089
2089
  }
2090
2090
  const s = XB();
2091
- oQ(s, B.min, B.max, 0.5);
2091
+ aQ(s, B.min, B.max, 0.5);
2092
2092
  const h = this.makeViewBounds3D(B, o);
2093
- this.chunkViewStates_.forEach(bA);
2093
+ this.chunkViewStates_.forEach(WA);
2094
2094
  const t = this.channelsOfInterest(A), y = this.fallbackLOD(), n = this.getPaddedBounds(h), F = this.currentLOD_ === y ? [this.currentLOD_] : [this.currentLOD_, y];
2095
2095
  for (const G of F) {
2096
2096
  const J = G === this.currentLOD_, U = G === y;
@@ -2130,10 +2130,10 @@ class cQ {
2130
2130
  k.warn(
2131
2131
  "ChunkStoreView",
2132
2132
  "updateChunksForVolume called with no chunks initialized"
2133
- ), this.chunkViewStates_.forEach(bA);
2133
+ ), this.chunkViewStates_.forEach(WA);
2134
2134
  return;
2135
2135
  }
2136
- this.currentLOD_ = this.policy_.lod.min, this.chunkViewStates_.forEach(bA);
2136
+ this.currentLOD_ = this.policy_.lod.min, this.chunkViewStates_.forEach(WA);
2137
2137
  const Q = this.channelsOfInterest(A), E = this.fallbackLOD(), i = (o) => {
2138
2138
  const a = o.lod === E, D = o.lod === this.currentLOD_, s = this.computePriority(
2139
2139
  a,
@@ -2177,10 +2177,10 @@ class cQ {
2177
2177
  I && (I.visible || I.prefetch || I.priority !== null) || this.chunkViewStates_.delete(A);
2178
2178
  }
2179
2179
  dispose() {
2180
- this.isDisposed_ = !0, this.chunkViewStates_.forEach(bA);
2180
+ this.isDisposed_ = !0, this.chunkViewStates_.forEach(WA);
2181
2181
  }
2182
2182
  setImageSourcePolicy(A, I) {
2183
- if (I !== YI)
2183
+ if (I !== MI)
2184
2184
  throw new Error("Unauthorized policy mutation");
2185
2185
  this.policy_ !== A && (this.policy_ = A, this.policyChanged_ = !0, k.info(
2186
2186
  "ChunkStoreView",
@@ -2298,7 +2298,7 @@ class cQ {
2298
2298
  }
2299
2299
  timeIndex(A) {
2300
2300
  const I = this.store_.dimensions.t;
2301
- return A.t === void 0 || I === void 0 ? 0 : NQ(I.lods[0], A.t);
2301
+ return A.t === void 0 || I === void 0 ? 0 : cQ(I.lods[0], A.t);
2302
2302
  }
2303
2303
  getSliceAxisBounds(A) {
2304
2304
  const I = this.store_.dimensions[this.axes_.w];
@@ -2323,13 +2323,13 @@ class cQ {
2323
2323
  return B[W[this.axes_.u]] = A.min[0], C[W[this.axes_.u]] = A.max[0], B[W[this.axes_.v]] = A.min[1], C[W[this.axes_.v]] = A.max[1], B[W[this.axes_.w]] = I[0], C[W[this.axes_.w]] = I[1], new SA(B, C);
2324
2324
  }
2325
2325
  viewBounds2DChanged(A) {
2326
- return this.lastViewBounds2D_ === null || !mI(this.lastViewBounds2D_.min, A.min) || !mI(this.lastViewBounds2D_.max, A.max);
2326
+ return this.lastViewBounds2D_ === null || !uI(this.lastViewBounds2D_.min, A.min) || !uI(this.lastViewBounds2D_.max, A.max);
2327
2327
  }
2328
2328
  hasViewProjectionChanged(A) {
2329
- return this.lastViewProjection_ === null || !vC(this.lastViewProjection_, A);
2329
+ return this.lastViewProjection_ === null || !XC(this.lastViewProjection_, A);
2330
2330
  }
2331
2331
  sliceBoundsChanged(A) {
2332
- return !this.lastSliceBounds_ || !mI(this.lastSliceBounds_, A);
2332
+ return !this.lastSliceBounds_ || !uI(this.lastSliceBounds_, A);
2333
2333
  }
2334
2334
  cCoordsChanged(A) {
2335
2335
  return !this.lastCCoords_ && !A ? !1 : !this.lastCCoords_ || !A || this.lastCCoords_.length !== A.length ? !0 : !this.lastCCoords_.every((I, B) => I === A[B]);
@@ -2349,10 +2349,10 @@ class cQ {
2349
2349
  return E * E + i * i;
2350
2350
  }
2351
2351
  }
2352
- function bA(g) {
2352
+ function WA(g) {
2353
2353
  g.visible = !1, g.prefetch = !1, g.priority = null, g.orderKey = null;
2354
2354
  }
2355
- class UQ {
2355
+ class kQ {
2356
2356
  // Chunks indexed as chunks_[lod][t][c][z][y][x].
2357
2357
  chunks_;
2358
2358
  lowestResLOD_;
@@ -2432,7 +2432,7 @@ class UQ {
2432
2432
  return this.lowestResLOD_;
2433
2433
  }
2434
2434
  addView(A, I) {
2435
- const B = new cQ(this, A, I);
2435
+ const B = new UQ(this, A, I);
2436
2436
  return this.views_.push(B), this.hasHadViews_ = !0, B;
2437
2437
  }
2438
2438
  get views() {
@@ -2546,8 +2546,8 @@ class rg extends Fg {
2546
2546
  return B.unpackAlignment = A.rowAlignmentBytes, B;
2547
2547
  }
2548
2548
  }
2549
- const kQ = 8, LQ = 4;
2550
- class JQ {
2549
+ const LQ = 8, JQ = 4;
2550
+ class YQ {
2551
2551
  stores_ = [];
2552
2552
  queue_;
2553
2553
  uploadTexture_;
@@ -2556,8 +2556,8 @@ class JQ {
2556
2556
  memoryLimitBytes_;
2557
2557
  maxGpuUploadsPerUpdate_;
2558
2558
  resident_ = /* @__PURE__ */ new Set();
2559
- constructor(A, I, B = () => 0, C = 1 / 0, Q = kQ, E = LQ) {
2560
- this.uploadTexture_ = A, this.disposeTexture_ = I, this.getGpuResidentBytes_ = B, this.memoryLimitBytes_ = C, this.maxGpuUploadsPerUpdate_ = Math.max(1, E), this.queue_ = new FQ(Q);
2559
+ constructor(A, I, B = () => 0, C = 1 / 0, Q = LQ, E = JQ) {
2560
+ this.uploadTexture_ = A, this.disposeTexture_ = I, this.getGpuResidentBytes_ = B, this.memoryLimitBytes_ = C, this.maxGpuUploadsPerUpdate_ = Math.max(1, E), this.queue_ = new rQ(Q);
2561
2561
  }
2562
2562
  get memoryLimitBytes() {
2563
2563
  return this.memoryLimitBytes_;
@@ -2572,11 +2572,11 @@ class JQ {
2572
2572
  };
2573
2573
  }
2574
2574
  get memoryStats() {
2575
- return SQ();
2575
+ return RQ();
2576
2576
  }
2577
2577
  addView(A, I, B) {
2578
2578
  let C = this.stores_.find((Q) => Q.source === A)?.store;
2579
- return C || (C = new UQ(A.loader.getSourceDimensionMap()), this.stores_.push({ source: A, store: C })), C.addView(I, B);
2579
+ return C || (C = new kQ(A.loader.getSourceDimensionMap()), this.stores_.push({ source: A, store: C })), C.addView(I, B);
2580
2580
  }
2581
2581
  update() {
2582
2582
  const A = [];
@@ -2599,7 +2599,7 @@ class JQ {
2599
2599
  }
2600
2600
  enqueueWithinBudget(A) {
2601
2601
  if (A.length === 0) return;
2602
- A.sort((C, Q) => ZA(C.chunk, Q.chunk));
2602
+ A.sort((C, Q) => bA(C.chunk, Q.chunk));
2603
2603
  let I = this.getGpuResidentBytes_(), B = null;
2604
2604
  for (const { source: C, chunk: Q } of A) {
2605
2605
  const E = this.chunkBytes(C, Q);
@@ -2619,14 +2619,14 @@ class JQ {
2619
2619
  for (const I of this.resident_)
2620
2620
  I.visible || A.push(I);
2621
2621
  return A.sort((I, B) => {
2622
- const C = -ZA(I, B);
2622
+ const C = -bA(I, B);
2623
2623
  return C !== 0 ? C : (I.releasedAt ?? 0) - (B.releasedAt ?? 0);
2624
2624
  });
2625
2625
  }
2626
2626
  evictWorseChunks(A, I, B, C) {
2627
- for (; A + I > this.memoryLimitBytes_ && C.length > 0 && ZA(C[0], B) > 0; ) {
2627
+ for (; A + I > this.memoryLimitBytes_ && C.length > 0 && bA(C[0], B) > 0; ) {
2628
2628
  const Q = C.shift();
2629
- Q.texture !== void 0 && (A -= _I(Q.texture), this.disposeChunkTexture(Q), Q.state = "unloaded", Q.releasedAt = void 0);
2629
+ Q.texture !== void 0 && (A -= $I(Q.texture), this.disposeChunkTexture(Q), Q.state = "unloaded", Q.releasedAt = void 0);
2630
2630
  }
2631
2631
  return A;
2632
2632
  }
@@ -2640,7 +2640,7 @@ class JQ {
2640
2640
  for (const C of A)
2641
2641
  C.state === "loaded" && C.texture === void 0 && I.push(C);
2642
2642
  if (I.length === 0) return;
2643
- I.sort(ZA);
2643
+ I.sort(bA);
2644
2644
  const B = Math.min(I.length, this.maxGpuUploadsPerUpdate_);
2645
2645
  for (let C = 0; C < B; C++) {
2646
2646
  const Q = I[C], E = rg.createWithChunk(Q);
@@ -2651,7 +2651,7 @@ class JQ {
2651
2651
  this.disposeTexture_ && A.texture !== void 0 && (this.disposeTexture_(A.texture), A.texture = void 0, this.resident_.delete(A));
2652
2652
  }
2653
2653
  }
2654
- var VA = function(g = 1) {
2654
+ var OA = function(g = 1) {
2655
2655
  var A = 0, I = document.createElement("div");
2656
2656
  I.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", I.addEventListener("click", function(s) {
2657
2657
  s.preventDefault(), C(++A % I.children.length);
@@ -2664,9 +2664,9 @@ var VA = function(g = 1) {
2664
2664
  I.children[h].style.display = h === s ? "block" : "none";
2665
2665
  A = s;
2666
2666
  }
2667
- var Q = (performance || Date).now(), E = Q, i = 0, o = B(new VA.Panel("FPS", "#0ff", "#002", g)), a = B(new VA.Panel("MS", "#0f0", "#020", g));
2667
+ var Q = (performance || Date).now(), E = Q, i = 0, o = B(new OA.Panel("FPS", "#0ff", "#002", g)), a = B(new OA.Panel("MS", "#0f0", "#020", g));
2668
2668
  if (self.performance && self.performance.memory)
2669
- var D = B(new VA.Panel("MB", "#f08", "#201", g));
2669
+ var D = B(new OA.Panel("MB", "#f08", "#201", g));
2670
2670
  return C(0), {
2671
2671
  REVISION: 16,
2672
2672
  dom: I,
@@ -2692,7 +2692,7 @@ var VA = function(g = 1) {
2692
2692
  setMode: C
2693
2693
  };
2694
2694
  };
2695
- VA.Panel = function(g, A, I, B) {
2695
+ OA.Panel = function(g, A, I, B) {
2696
2696
  var C = 1 / 0, Q = 0, E = Math.round, i = E(window.devicePixelRatio || 1), o = E(80 * i * B), a = E(48 * i * B), D = E(3 * i * B), s = E(2 * i * B), h = E(3 * i * B), t = E(15 * i * B), y = E(74 * i * B), n = E(30 * i * B), F = document.createElement("canvas");
2697
2697
  F.width = o, F.height = a, F.style.cssText = `width:${E(B * 80)}px;height:${E(B * 48)}px`;
2698
2698
  var G = F.getContext("2d");
@@ -2703,24 +2703,24 @@ VA.Panel = function(g, A, I, B) {
2703
2703
  }
2704
2704
  };
2705
2705
  };
2706
- function YQ({ scale: g } = { scale: 1.5 }) {
2707
- const A = new VA(g);
2706
+ function MQ({ scale: g } = { scale: 1.5 }) {
2707
+ const A = new OA(g);
2708
2708
  return A.showPanel(
2709
2709
  0
2710
2710
  /* 0 = fps, 1 = ms, 2 = mb */
2711
2711
  ), document.body.appendChild(A.dom), A;
2712
2712
  }
2713
- const $I = [
2713
+ const Ag = [
2714
2714
  "pointerdown",
2715
2715
  "pointermove",
2716
2716
  "pointerup",
2717
2717
  "pointercancel",
2718
2718
  "wheel"
2719
2719
  ];
2720
- function MQ(g) {
2721
- return $I.includes(g);
2720
+ function dQ(g) {
2721
+ return Ag.includes(g);
2722
2722
  }
2723
- class dQ {
2723
+ class KQ {
2724
2724
  propagationStopped_ = !1;
2725
2725
  type;
2726
2726
  event;
@@ -2737,7 +2737,7 @@ class dQ {
2737
2737
  this.propagationStopped_ = !0;
2738
2738
  }
2739
2739
  }
2740
- class KQ {
2740
+ class HQ {
2741
2741
  listeners_ = [];
2742
2742
  element_;
2743
2743
  isConnected_ = !1;
@@ -2762,7 +2762,7 @@ class KQ {
2762
2762
  );
2763
2763
  return;
2764
2764
  }
2765
- this.isConnected_ = !0, $I.forEach((A) => {
2765
+ this.isConnected_ = !0, Ag.forEach((A) => {
2766
2766
  this.element_.addEventListener(A, this.handleEvent, {
2767
2767
  passive: !1
2768
2768
  });
@@ -2777,22 +2777,22 @@ class KQ {
2777
2777
  );
2778
2778
  return;
2779
2779
  }
2780
- this.isConnected_ = !1, $I.forEach((A) => {
2780
+ this.isConnected_ = !1, Ag.forEach((A) => {
2781
2781
  this.element_.removeEventListener(A, this.handleEvent);
2782
2782
  });
2783
2783
  }
2784
2784
  handleEvent = (A) => {
2785
- if (!MQ(A.type)) {
2785
+ if (!dQ(A.type)) {
2786
2786
  k.error("EventDispatcher", `Unsupported event type ${A.type}`);
2787
2787
  return;
2788
2788
  }
2789
- const I = new dQ(A.type, A);
2789
+ const I = new KQ(A.type, A);
2790
2790
  for (const B of this.listeners_)
2791
2791
  if (B(I), I.propagationStopped) break;
2792
2792
  };
2793
2793
  }
2794
- const HQ = 1e-12;
2795
- class qQ {
2794
+ const qQ = 1e-12;
2795
+ class lQ {
2796
2796
  origin;
2797
2797
  direction;
2798
2798
  constructor(A, I) {
@@ -2800,13 +2800,13 @@ class qQ {
2800
2800
  }
2801
2801
  intersectWithPlane(A) {
2802
2802
  const I = aI(this.direction, A.normal);
2803
- if (Math.abs(I) < HQ)
2803
+ if (Math.abs(I) < qQ)
2804
2804
  return null;
2805
2805
  const B = -A.signedDistanceToPoint(this.origin) / I;
2806
- return jI(d(), this.origin, this.direction, B);
2806
+ return zI(d(), this.origin, this.direction, B);
2807
2807
  }
2808
2808
  }
2809
- class lQ {
2809
+ class fQ {
2810
2810
  id;
2811
2811
  element;
2812
2812
  camera;
@@ -2818,12 +2818,12 @@ class lQ {
2818
2818
  context_;
2819
2819
  layers_ = [];
2820
2820
  constructor(A) {
2821
- this.id = A.id, this.element = A.element, this.camera = A.camera, this.context_ = A.context, this.cameraControls = A.cameraControls, this.updateAspectRatio(), this.events = new KQ(this.element), this.events.addEventListener((I) => {
2821
+ this.id = A.id, this.element = A.element, this.camera = A.camera, this.context_ = A.context, this.cameraControls = A.cameraControls, this.updateAspectRatio(), this.events = new HQ(this.element), this.events.addEventListener((I) => {
2822
2822
  if (I.event instanceof PointerEvent || I.event instanceof WheelEvent) {
2823
2823
  const { clientX: B, clientY: C } = I.event, Q = V(B, C);
2824
2824
  I.clipPos = this.clientToClip(Q, 0), I.worldPos = this.camera.clipToWorld(I.clipPos);
2825
2825
  const E = this.camera.clipToWorld(this.clientToClip(Q, -1)), i = this.camera.clipToWorld(this.clientToClip(Q, 1));
2826
- I.worldRay = new qQ(E, yg(d(), i, E));
2826
+ I.worldRay = new lQ(E, yg(d(), i, E));
2827
2827
  }
2828
2828
  for (const B of this.layers_)
2829
2829
  if (B.onEvent(I), I.propagationStopped) return;
@@ -2908,7 +2908,7 @@ function zB(g, A) {
2908
2908
  }
2909
2909
  }
2910
2910
  }
2911
- function fQ(g) {
2911
+ function pQ(g) {
2912
2912
  for (let A = 0; A < g.length; A++)
2913
2913
  zB(g[A], g.slice(0, A));
2914
2914
  }
@@ -2922,9 +2922,9 @@ function $g(g, A, I) {
2922
2922
  context: I
2923
2923
  };
2924
2924
  });
2925
- return fQ(B), B.map((C) => new lQ(C));
2925
+ return pQ(B), B.map((C) => new fQ(C));
2926
2926
  }
2927
- class pQ {
2927
+ class mQ {
2928
2928
  elements_;
2929
2929
  resizeObserver_;
2930
2930
  mediaQuery_;
@@ -2983,7 +2983,7 @@ class pQ {
2983
2983
  this.elements_.splice(I, 1), this.resizeObserver_ && this.resizeObserver_.unobserve(A);
2984
2984
  }
2985
2985
  }
2986
- const mQ = 2048;
2986
+ const uQ = 2048;
2987
2987
  class to {
2988
2988
  chunkManager_;
2989
2989
  context_;
@@ -3044,9 +3044,9 @@ class to {
3044
3044
  * @throws {Error} If viewports have duplicate IDs or shared elements
3045
3045
  */
3046
3046
  constructor(A) {
3047
- this.canvas = A.canvas, this.renderer_ = new wQ(this.canvas);
3048
- const B = (A.memoryLimitMB ?? mQ) * 1024 * 1024;
3049
- this.chunkManager_ = new JQ(
3047
+ this.canvas = A.canvas, this.renderer_ = new FQ(this.canvas);
3048
+ const B = (A.memoryLimitMB ?? uQ) * 1024 * 1024;
3049
+ this.chunkManager_ = new YQ(
3050
3050
  (Q) => this.renderer_.uploadTexture(Q),
3051
3051
  (Q) => this.renderer_.disposeTexture(Q),
3052
3052
  () => this.renderer_.gpuTextureBytes,
@@ -3059,11 +3059,11 @@ class to {
3059
3059
  A.viewports ?? [],
3060
3060
  this.canvas,
3061
3061
  this.context_
3062
- ), this.overlays = [...A.overlays ?? []], A.showStats && (this.stats_ = YQ());
3062
+ ), this.overlays = [...A.overlays ?? []], A.showStats && (this.stats_ = MQ());
3063
3063
  const C = [this.canvas];
3064
3064
  for (const Q of this.viewports_)
3065
3065
  Q.element !== this.canvas && C.push(Q.element);
3066
- this.sizeObserver_ = new pQ(C, () => {
3066
+ this.sizeObserver_ = new mQ(C, () => {
3067
3067
  this.renderer_.updateSize(), this.renderer_.beginFrame();
3068
3068
  for (const Q of this.viewports_)
3069
3069
  Q.updateSize(), this.renderer_.render(Q);
@@ -3157,7 +3157,7 @@ class to {
3157
3157
  }
3158
3158
  }
3159
3159
  }
3160
- function uQ(g, A) {
3160
+ function TQ(g, A) {
3161
3161
  return {
3162
3162
  ...g,
3163
3163
  ...A,
@@ -3180,7 +3180,7 @@ async function IB(g) {
3180
3180
  throw new Error(`Unexpected response status ${g.status} ${g.statusText}`);
3181
3181
  }
3182
3182
  }
3183
- class $A {
3183
+ class _A {
3184
3184
  url;
3185
3185
  #A;
3186
3186
  #I;
@@ -3189,7 +3189,7 @@ class $A {
3189
3189
  this.url = A, this.#A = I.fetch ?? ((B) => fetch(B)), this.#I = I.overrides ?? {}, this.#g = I.useSuffixRequest ?? !1;
3190
3190
  }
3191
3191
  #B(A, I) {
3192
- return new Request(A, uQ(this.#I, I));
3192
+ return new Request(A, TQ(this.#I, I));
3193
3193
  }
3194
3194
  async get(A, I = {}) {
3195
3195
  let B = AB(this.url, A).href, C = this.#B(B, I), Q = await this.#A(C);
@@ -3235,9 +3235,9 @@ class $A {
3235
3235
  return this.#A(this.#B(A, a));
3236
3236
  }
3237
3237
  }
3238
- class AI extends Error {
3238
+ class $A extends Error {
3239
3239
  }
3240
- class uA extends AI {
3240
+ class uA extends $A {
3241
3241
  _tag = "NotFoundError";
3242
3242
  name = "NotFoundError";
3243
3243
  path;
@@ -3246,7 +3246,7 @@ class uA extends AI {
3246
3246
  super(`Not found: ${A}`, { cause: I.cause }), this.path = I.path, this.found = I.found;
3247
3247
  }
3248
3248
  }
3249
- class v extends AI {
3249
+ class v extends $A {
3250
3250
  _tag = "InvalidMetadataError";
3251
3251
  name = "InvalidMetadataError";
3252
3252
  path;
@@ -3254,7 +3254,7 @@ class v extends AI {
3254
3254
  super(A, { cause: I.cause }), this.path = I.path;
3255
3255
  }
3256
3256
  }
3257
- class TQ extends AI {
3257
+ class xQ extends $A {
3258
3258
  _tag = "UnknownCodecError";
3259
3259
  name = "UnknownCodecError";
3260
3260
  codec;
@@ -3262,7 +3262,7 @@ class TQ extends AI {
3262
3262
  super(`Unknown codec: ${A}`), this.codec = A;
3263
3263
  }
3264
3264
  }
3265
- class xQ extends AI {
3265
+ class WQ extends $A {
3266
3266
  _tag = "CodecPipelineError";
3267
3267
  name = "CodecPipelineError";
3268
3268
  direction;
@@ -3277,7 +3277,7 @@ class xQ extends AI {
3277
3277
  super(I.join(" "), { cause: A.cause }), this.direction = A.direction, this.codec = A.codec, this.chunkPath = A.chunkPath;
3278
3278
  }
3279
3279
  }
3280
- class Sg extends AI {
3280
+ class Sg extends $A {
3281
3281
  _tag = "UnsupportedError";
3282
3282
  name = "UnsupportedError";
3283
3283
  feature;
@@ -3396,7 +3396,7 @@ class Ng {
3396
3396
  yield this.get(A);
3397
3397
  }
3398
3398
  }
3399
- class II {
3399
+ class AI {
3400
3400
  #A;
3401
3401
  chars;
3402
3402
  constructor(A, I, B, C) {
@@ -3405,7 +3405,7 @@ class II {
3405
3405
  else if (Rg(I))
3406
3406
  C && (C *= A), this.#A = new Int32Array(I, B, C);
3407
3407
  else {
3408
- const Q = I, E = new II(A, 1);
3408
+ const Q = I, E = new AI(A, 1);
3409
3409
  this.#A = new Int32Array((function* () {
3410
3410
  for (let i of Q)
3411
3411
  E.set(0, i), yield* E.#A;
@@ -3451,14 +3451,14 @@ class II {
3451
3451
  yield this.get(A);
3452
3452
  }
3453
3453
  }
3454
- function WQ() {
3454
+ function bQ() {
3455
3455
  if (typeof SharedArrayBuffer > "u")
3456
3456
  throw new Error("SharedArrayBuffer is not available. In browsers, this requires Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy headers to be set.");
3457
3457
  }
3458
- function bQ(g, A) {
3458
+ function ZQ(g, A) {
3459
3459
  return new SharedArrayBuffer(g);
3460
3460
  }
3461
- function gI(g) {
3461
+ function II(g) {
3462
3462
  const A = new TextDecoder().decode(g);
3463
3463
  try {
3464
3464
  return JSON.parse(A);
@@ -3479,7 +3479,7 @@ function TA(g) {
3479
3479
  let A = g.match(/v2:([US])(\d+)/);
3480
3480
  if (A) {
3481
3481
  let [, B, C] = A;
3482
- return (B === "U" ? II : Ng).bind(null, Number(C));
3482
+ return (B === "U" ? AI : Ng).bind(null, Number(C));
3483
3483
  }
3484
3484
  if (g === "string")
3485
3485
  return globalThis.Array;
@@ -3509,7 +3509,7 @@ function RA(g, A) {
3509
3509
  C[A[Q]] = B, B *= g[A[Q]];
3510
3510
  return C;
3511
3511
  }
3512
- function ZQ({ name: g, configuration: A }) {
3512
+ function PQ({ name: g, configuration: A }) {
3513
3513
  if (g === "default") {
3514
3514
  const I = A?.separator ?? "/";
3515
3515
  return (B) => ["c", ...B].join(I);
@@ -3544,15 +3544,15 @@ function BB(g) {
3544
3544
  throw new v(`Unsupported or unknown dtype: ${g}`);
3545
3545
  return I === "|" ? { dataType: C } : { dataType: C, endian: I === "<" ? "little" : "big" };
3546
3546
  }
3547
- function PQ(g) {
3547
+ function OQ(g) {
3548
3548
  return (g.id === "fixedscaleoffset" || g.id === "numcodecs.fixedscaleoffset") && typeof g.scale == "number" && typeof g.offset == "number" && (g.astype === void 0 || typeof g.astype == "string") && (g.dtype === void 0 || typeof g.dtype == "string");
3549
3549
  }
3550
- function OQ(g, A = {}) {
3550
+ function VQ(g, A = {}) {
3551
3551
  let I = [], B = BB(g.dtype);
3552
3552
  g.order === "F" && I.push({ name: "transpose", configuration: { order: "F" } });
3553
3553
  for (let Q of g.filters ?? []) {
3554
3554
  if (Q.id === "fixedscaleoffset" || Q.id === "numcodecs.fixedscaleoffset") {
3555
- if (!PQ(Q))
3555
+ if (!OQ(Q))
3556
3556
  throw new v(`Invalid fixedscaleoffset filter: ${JSON.stringify(Q)}`);
3557
3557
  I.push({
3558
3558
  name: "scale_offset",
@@ -3564,7 +3564,7 @@ function OQ(g, A = {}) {
3564
3564
  let o = Q.astype ?? Q.dtype;
3565
3565
  if (o !== void 0 && o !== g.dtype) {
3566
3566
  let a = BB(o).dataType;
3567
- if (!Ag(a, "number") && !Ag(a, "bigint"))
3567
+ if (!Ig(a, "number") && !Ig(a, "bigint"))
3568
3568
  throw new v(`fixedscaleoffset astype must be a numeric data type, got ${o}`);
3569
3569
  I.push({
3570
3570
  name: "cast_value",
@@ -3610,14 +3610,14 @@ function OQ(g, A = {}) {
3610
3610
  attributes: A
3611
3611
  };
3612
3612
  }
3613
- function VQ(g, A = {}) {
3613
+ function vQ(g, A = {}) {
3614
3614
  return {
3615
3615
  zarr_format: 3,
3616
3616
  node_type: "group",
3617
3617
  attributes: A
3618
3618
  };
3619
3619
  }
3620
- function Ag(g, A) {
3620
+ function Ig(g, A) {
3621
3621
  if (A !== "number" && A !== "bigint" && A !== "boolean" && A !== "object" && A !== "string")
3622
3622
  return g === A;
3623
3623
  let I = g === "bool";
@@ -3632,7 +3632,7 @@ function Ag(g, A) {
3632
3632
  let Q = g === "v2:object";
3633
3633
  return A === "object" ? Q : !B && !C && !I && !Q;
3634
3634
  }
3635
- function vQ(g) {
3635
+ function XQ(g) {
3636
3636
  return g?.name === "sharding_indexed";
3637
3637
  }
3638
3638
  function $B(g) {
@@ -3673,15 +3673,15 @@ async function IC(g, { format: A, signal: I }) {
3673
3673
  throw I?.throwIfAborted(), new Error(`Failed to decode ${A}`);
3674
3674
  }
3675
3675
  }
3676
- const CB = XQ();
3677
- function XQ() {
3676
+ const CB = jQ();
3677
+ function jQ() {
3678
3678
  const g = new Uint32Array([305419896]);
3679
3679
  return new Uint8Array(g.buffer, g.byteOffset, g.byteLength)[0] !== 18;
3680
3680
  }
3681
3681
  function QB(g) {
3682
3682
  return "BYTES_PER_ELEMENT" in g ? g.BYTES_PER_ELEMENT : 4;
3683
3683
  }
3684
- class MI {
3684
+ class dI {
3685
3685
  kind = "array_to_bytes";
3686
3686
  #A;
3687
3687
  #I;
@@ -3694,7 +3694,7 @@ class MI {
3694
3694
  this.#g = B.BYTES_PER_ELEMENT;
3695
3695
  }
3696
3696
  static fromConfig(A, I) {
3697
- return new MI(A, I);
3697
+ return new dI(A, I);
3698
3698
  }
3699
3699
  encode(A) {
3700
3700
  let I = new Uint8Array(A.data.buffer);
@@ -3723,10 +3723,10 @@ const EB = {
3723
3723
  function eI(g) {
3724
3724
  return g in gC;
3725
3725
  }
3726
- function Ig(g) {
3726
+ function gg(g) {
3727
3727
  return g === "int64" || g === "uint64";
3728
3728
  }
3729
- function jQ(g, A) {
3729
+ function zQ(g, A) {
3730
3730
  const I = BigInt(g), B = new ArrayBuffer(A), C = new DataView(B);
3731
3731
  if (A === 2) {
3732
3732
  if (typeof C.getFloat16 != "function")
@@ -3736,7 +3736,7 @@ function jQ(g, A) {
3736
3736
  return A === 4 ? (C.setUint32(0, Number(I)), C.getFloat32(0)) : (C.setBigUint64(0, I), C.getFloat64(0));
3737
3737
  }
3738
3738
  function nI(g, A) {
3739
- if (Ig(g)) {
3739
+ if (gg(g)) {
3740
3740
  if (typeof A != "number" || !Number.isInteger(A))
3741
3741
  throw new v(`Expected an integer value for data type "${g}", got ${JSON.stringify(A)}`);
3742
3742
  return BigInt(A);
@@ -3748,7 +3748,7 @@ function nI(g, A) {
3748
3748
  }
3749
3749
  if (!eI(g))
3750
3750
  throw new v(`String-encoded scalar "${A}" is not valid for non-float data type "${g}"`);
3751
- return A in EB ? EB[A] : jQ(A, gC[g]);
3751
+ return A in EB ? EB[A] : zQ(A, gC[g]);
3752
3752
  }
3753
3753
  const iB = /* @__PURE__ */ new Set([
3754
3754
  "int8",
@@ -3762,14 +3762,14 @@ const iB = /* @__PURE__ */ new Set([
3762
3762
  "float16",
3763
3763
  "float32",
3764
3764
  "float64"
3765
- ]), uI = {
3765
+ ]), TI = {
3766
3766
  int8: [-128, 2 ** 7 - 1],
3767
3767
  uint8: [0, 2 ** 8 - 1],
3768
3768
  int16: [-32768, 2 ** 15 - 1],
3769
3769
  uint16: [0, 2 ** 16 - 1],
3770
3770
  int32: [-2147483648, 2 ** 31 - 1],
3771
3771
  uint32: [0, 2 ** 32 - 1]
3772
- }, TI = {
3772
+ }, xI = {
3773
3773
  int64: [-(2n ** 63n), 2n ** 63n - 1n],
3774
3774
  uint64: [0n, 2n ** 64n - 1n]
3775
3775
  };
@@ -3779,7 +3779,7 @@ function oB(g, A, I) {
3779
3779
  tgt: nI(I, C)
3780
3780
  }));
3781
3781
  }
3782
- function zQ(g, A) {
3782
+ function _Q(g, A) {
3783
3783
  for (const I of A)
3784
3784
  if (typeof I.src == "number" && Number.isNaN(I.src)) {
3785
3785
  if (typeof g == "number" && Number.isNaN(g))
@@ -3787,7 +3787,7 @@ function zQ(g, A) {
3787
3787
  } else if (g === I.src)
3788
3788
  return I.tgt;
3789
3789
  }
3790
- function _Q(g) {
3790
+ function $Q(g) {
3791
3791
  if (!Number.isFinite(g))
3792
3792
  return g;
3793
3793
  if (Math.abs(g - Math.trunc(g)) === 0.5) {
@@ -3796,13 +3796,13 @@ function _Q(g) {
3796
3796
  }
3797
3797
  return Math.round(g);
3798
3798
  }
3799
- function $Q(g) {
3799
+ function AE(g) {
3800
3800
  return Math.sign(g) * Math.floor(Math.abs(g) + 0.5);
3801
3801
  }
3802
3802
  function aB(g) {
3803
3803
  switch (g) {
3804
3804
  case "nearest-even":
3805
- return _Q;
3805
+ return $Q;
3806
3806
  case "towards-zero":
3807
3807
  return Math.trunc;
3808
3808
  case "towards-positive":
@@ -3810,10 +3810,10 @@ function aB(g) {
3810
3810
  case "towards-negative":
3811
3811
  return Math.floor;
3812
3812
  case "nearest-away":
3813
- return $Q;
3813
+ return AE;
3814
3814
  }
3815
3815
  }
3816
- function xI(g, A, I) {
3816
+ function WI(g, A, I) {
3817
3817
  const B = A - g + 1;
3818
3818
  switch (I) {
3819
3819
  case "clamp":
@@ -3828,7 +3828,7 @@ function xI(g, A, I) {
3828
3828
  };
3829
3829
  }
3830
3830
  }
3831
- function WI(g, A, I) {
3831
+ function bI(g, A, I) {
3832
3832
  const B = A - g + 1n;
3833
3833
  switch (I) {
3834
3834
  case "clamp":
@@ -3875,21 +3875,21 @@ class cg {
3875
3875
  }
3876
3876
  }
3877
3877
  function DB(g, A, I, B, C) {
3878
- const Q = eI(g), E = Ig(g), i = eI(A), o = Ig(A);
3878
+ const Q = eI(g), E = gg(g), i = eI(A), o = gg(A);
3879
3879
  let a;
3880
3880
  if (Q && i) {
3881
3881
  if (I !== "nearest-even")
3882
3882
  throw new v(`cast_value float -> float only supports "nearest-even" rounding, got "${I}"`);
3883
3883
  a = (s) => s;
3884
3884
  } else if (Q && !i && !o) {
3885
- const s = aB(I), h = xI(...uI[A], B);
3885
+ const s = aB(I), h = WI(...TI[A], B);
3886
3886
  a = (t) => {
3887
3887
  if (!Number.isFinite(t))
3888
3888
  throw new Error(`Cannot cast ${t} to integer type without scalar_map`);
3889
3889
  return h(s(t));
3890
3890
  };
3891
3891
  } else if (Q && o) {
3892
- const s = aB(I), h = WI(...TI[A], B);
3892
+ const s = aB(I), h = bI(...xI[A], B);
3893
3893
  a = (t) => {
3894
3894
  if (!Number.isFinite(t))
3895
3895
  throw new Error(`Cannot cast ${t} to integer type without scalar_map`);
@@ -3900,19 +3900,19 @@ function DB(g, A, I, B, C) {
3900
3900
  else if (E && i)
3901
3901
  a = (s) => Number(s);
3902
3902
  else if (!Q && !E && !i && !o)
3903
- a = xI(...uI[A], B);
3903
+ a = WI(...TI[A], B);
3904
3904
  else if (!Q && !E && o) {
3905
- const s = WI(...TI[A], B);
3905
+ const s = bI(...xI[A], B);
3906
3906
  a = (h) => s(BigInt(h));
3907
3907
  } else if (E && !i && !o) {
3908
- const s = xI(...uI[A], B);
3908
+ const s = WI(...TI[A], B);
3909
3909
  a = (h) => s(Number(h));
3910
3910
  } else if (E && o)
3911
- a = WI(...TI[A], B);
3911
+ a = bI(...xI[A], B);
3912
3912
  else
3913
3913
  throw new Error(`Unhandled type combination: ${g} -> ${A}`);
3914
3914
  return C.length === 0 ? a : (s) => {
3915
- const h = zQ(s, C);
3915
+ const h = _Q(s, C);
3916
3916
  return h !== void 0 ? h : a(s);
3917
3917
  };
3918
3918
  }
@@ -3929,7 +3929,7 @@ class Ug {
3929
3929
  return A + 4;
3930
3930
  }
3931
3931
  }
3932
- const AE = /* @__PURE__ */ new Set([
3932
+ const IE = /* @__PURE__ */ new Set([
3933
3933
  "int8",
3934
3934
  "uint8",
3935
3935
  "int16",
@@ -3962,7 +3962,7 @@ class kg {
3962
3962
  this.#A = A;
3963
3963
  }
3964
3964
  static fromConfig(A, I) {
3965
- if (!AE.has(I.dataType))
3965
+ if (!IE.has(I.dataType))
3966
3966
  throw new v(`Delta codec does not support data type: ${I.dataType}`);
3967
3967
  return new kg(TA(I.dataType));
3968
3968
  }
@@ -3994,10 +3994,10 @@ class Lg {
3994
3994
  return new Uint8Array(I);
3995
3995
  }
3996
3996
  }
3997
- function IE(g, A) {
3997
+ function gE(g, A) {
3998
3998
  return IA(!Number.isNaN(A), "JsonCodec allow_nan is false but NaN was encountered during encoding."), IA(A !== Number.POSITIVE_INFINITY, "JsonCodec allow_nan is false but Infinity was encountered during encoding."), IA(A !== Number.NEGATIVE_INFINITY, "JsonCodec allow_nan is false but -Infinity was encountered during encoding."), A;
3999
3999
  }
4000
- function gE(g, A) {
4000
+ function BE(g, A) {
4001
4001
  return A instanceof Object && !Array.isArray(A) ? Object.keys(A).sort().reduce((I, B) => (I[B] = A[B], I), {}) : A;
4002
4002
  }
4003
4003
  class GI {
@@ -4027,7 +4027,7 @@ class GI {
4027
4027
  const { indent: I, encoding: B, ensure_ascii: C, check_circular: Q, allow_nan: E, sort_keys: i } = this.#A;
4028
4028
  IA(B === "utf-8", "JsonCodec does not yet support non-utf-8 encoding.");
4029
4029
  const o = [];
4030
- IA(Q, "JsonCodec does not yet support skipping the check for circular references during encoding."), E || o.push(IE), i && o.push(gE);
4030
+ IA(Q, "JsonCodec does not yet support skipping the check for circular references during encoding."), E || o.push(gE), i && o.push(BE);
4031
4031
  const a = Array.from(A.data);
4032
4032
  a.push("|O"), a.push(A.shape);
4033
4033
  let D;
@@ -4046,13 +4046,13 @@ class GI {
4046
4046
  decode(A) {
4047
4047
  const { strict: I } = this.#I;
4048
4048
  IA(I, "JsonCodec does not yet support non-strict decoding.");
4049
- const B = gI(A), C = B.pop();
4049
+ const B = II(A), C = B.pop();
4050
4050
  B.pop(), IA(C, "0D not implemented for JsonCodec.");
4051
4051
  const Q = RA(C, "C");
4052
4052
  return { data: B, shape: C, stride: Q };
4053
4053
  }
4054
4054
  }
4055
- const BE = /* @__PURE__ */ new Set([
4055
+ const CE = /* @__PURE__ */ new Set([
4056
4056
  "int8",
4057
4057
  "uint8",
4058
4058
  "int16",
@@ -4074,7 +4074,7 @@ class Jg {
4074
4074
  this.#I = A, this.#g = I, this.#A = B;
4075
4075
  }
4076
4076
  static fromConfig(A, I) {
4077
- if (!BE.has(I.dataType))
4077
+ if (!CE.has(I.dataType))
4078
4078
  throw new v(`scale_offset codec does not support data type: ${I.dataType}`);
4079
4079
  return new Jg(nI(I.dataType, A.scale ?? 1), nI(I.dataType, A.offset ?? 0), TA(I.dataType));
4080
4080
  }
@@ -4100,20 +4100,20 @@ class Yg {
4100
4100
  return new Yg(A, I);
4101
4101
  }
4102
4102
  encode(A) {
4103
- return CE(A, this.#A);
4103
+ return QE(A, this.#A);
4104
4104
  }
4105
4105
  decode(A) {
4106
- return QE(A, this.#A);
4106
+ return EE(A, this.#A);
4107
4107
  }
4108
4108
  }
4109
- function CE(g, A) {
4109
+ function QE(g, A) {
4110
4110
  let I = g.length, B = Math.floor(I / A), C = new Uint8Array(I);
4111
4111
  for (let Q = 0; Q < A; Q++)
4112
4112
  for (let E = 0; E < B; E++)
4113
4113
  C[Q * B + E] = g[E * A + Q];
4114
4114
  return C;
4115
4115
  }
4116
- function QE(g, A) {
4116
+ function EE(g, A) {
4117
4117
  let I = g.length, B = Math.floor(I / A), C = new Uint8Array(I);
4118
4118
  for (let Q = 0; Q < A; Q++)
4119
4119
  for (let E = 0; E < B; E++)
@@ -4121,7 +4121,7 @@ function QE(g, A) {
4121
4121
  return C;
4122
4122
  }
4123
4123
  function hB(g) {
4124
- return g instanceof _B || g instanceof Ng || g instanceof II ? new Proxy(g, {
4124
+ return g instanceof _B || g instanceof Ng || g instanceof AI ? new Proxy(g, {
4125
4125
  get(I, B) {
4126
4126
  return I.get(Number(B));
4127
4127
  },
@@ -4130,9 +4130,9 @@ function hB(g) {
4130
4130
  }
4131
4131
  }) : g;
4132
4132
  }
4133
- function EE(g, A) {
4133
+ function iE(g, A) {
4134
4134
  let I;
4135
- return g.data instanceof Ng || g.data instanceof II ? I = new g.constructor(
4135
+ return g.data instanceof Ng || g.data instanceof AI ? I = new g.constructor(
4136
4136
  // @ts-expect-error
4137
4137
  g.data.length,
4138
4138
  g.data.chars
@@ -4142,8 +4142,8 @@ function EE(g, A) {
4142
4142
  stride: RA(g.shape, A)
4143
4143
  };
4144
4144
  }
4145
- function iE(g, A) {
4146
- let I = EE(g, A), B = g.shape.length, C = g.data.length, Q = Array(B).fill(0), E = hB(g.data), i = hB(I.data);
4145
+ function oE(g, A) {
4146
+ let I = iE(g, A), B = g.shape.length, C = g.data.length, Q = Array(B).fill(0), E = hB(g.data), i = hB(I.data);
4147
4147
  for (let o = 0; o < C; o++) {
4148
4148
  let a = 0;
4149
4149
  for (let D = 0; D < B; D++)
@@ -4158,12 +4158,12 @@ function iE(g, A) {
4158
4158
  }
4159
4159
  return I;
4160
4160
  }
4161
- function oE(g) {
4161
+ function aE(g) {
4162
4162
  let A = g.shape.length;
4163
4163
  return IA(A === g.stride.length, "Shape and stride must have the same length."), g.stride.map((I, B) => ({ stride: I, index: B })).sort((I, B) => B.stride - I.stride).map((I) => I.index);
4164
4164
  }
4165
- function aE(g, A) {
4166
- let I = oE(g);
4165
+ function DE(g, A) {
4166
+ let I = aE(g);
4167
4167
  return IA(I.length === A.length, "Orders must match"), I.every((B, C) => B === A[C]);
4168
4168
  }
4169
4169
  class Mg {
@@ -4188,7 +4188,7 @@ class Mg {
4188
4188
  return new Mg(A, I);
4189
4189
  }
4190
4190
  encode(A) {
4191
- return aE(A, this.#I) ? A : iE(A, this.#I);
4191
+ return DE(A, this.#I) ? A : oE(A, this.#I);
4192
4192
  }
4193
4193
  decode(A) {
4194
4194
  return {
@@ -4229,21 +4229,21 @@ class dg {
4229
4229
  return new Uint8Array(I);
4230
4230
  }
4231
4231
  }
4232
- function DE() {
4232
+ function sE() {
4233
4233
  let g = () => import("./blosc-D1xNXZJs.js").then((Q) => Q.default), A = () => import("./lz4-1Ws5oVWR.js").then((Q) => Q.default), I = () => import("./zstd-C4EcZnjq.js").then((Q) => Q.default), B = () => Lg, C = () => dg;
4234
- return (/* @__PURE__ */ new Map()).set("blosc", g).set("lz4", A).set("zstd", I).set("gzip", B).set("zlib", C).set("transpose", () => Mg).set("bytes", () => MI).set("crc32c", () => Ug).set("vlen-utf8", () => wI).set("json2", () => GI).set("bitround", () => yI).set("cast_value", () => cg).set("scale_offset", () => Jg).set("numcodecs.blosc", g).set("numcodecs.lz4", A).set("numcodecs.zstd", I).set("numcodecs.gzip", B).set("numcodecs.zlib", C).set("numcodecs.vlen-utf8", () => wI).set("numcodecs.shuffle", () => Yg).set("numcodecs.delta", () => kg).set("numcodecs.bitround", () => yI).set("numcodecs.json2", () => GI);
4234
+ return (/* @__PURE__ */ new Map()).set("blosc", g).set("lz4", A).set("zstd", I).set("gzip", B).set("zlib", C).set("transpose", () => Mg).set("bytes", () => dI).set("crc32c", () => Ug).set("vlen-utf8", () => wI).set("json2", () => GI).set("bitround", () => yI).set("cast_value", () => cg).set("scale_offset", () => Jg).set("numcodecs.blosc", g).set("numcodecs.lz4", A).set("numcodecs.zstd", I).set("numcodecs.gzip", B).set("numcodecs.zlib", C).set("numcodecs.vlen-utf8", () => wI).set("numcodecs.shuffle", () => Yg).set("numcodecs.delta", () => kg).set("numcodecs.bitround", () => yI).set("numcodecs.json2", () => GI);
4235
4235
  }
4236
- const sE = DE();
4237
- function gg(g) {
4236
+ const hE = sE();
4237
+ function Bg(g) {
4238
4238
  let A;
4239
4239
  function I() {
4240
- return A || (A = hE(g)), A;
4240
+ return A || (A = tE(g)), A;
4241
4241
  }
4242
4242
  async function B(C, Q, E) {
4243
4243
  try {
4244
4244
  return await E();
4245
4245
  } catch (i) {
4246
- throw new xQ({ direction: C, codec: Q, cause: i });
4246
+ throw new WQ({ direction: C, codec: Q, cause: i });
4247
4247
  }
4248
4248
  }
4249
4249
  return {
@@ -4282,11 +4282,11 @@ function tB(g, A, I) {
4282
4282
  throw new v(`Codec "${g}" cannot compute its encoded size; it is not a fixed-size codec and cannot be used in a sharding index pipeline`);
4283
4283
  return A.computeEncodedSize(I);
4284
4284
  }
4285
- async function hE(g) {
4285
+ async function tE(g) {
4286
4286
  let A = g.codecs.map(async (E) => {
4287
- let i = await sE.get(E.name)?.();
4287
+ let i = await hE.get(E.name)?.();
4288
4288
  if (!i)
4289
- throw new TQ(E.name);
4289
+ throw new xQ(E.name);
4290
4290
  return { Codec: i, meta: E };
4291
4291
  }), I = [], B, C = [], Q = { ...g };
4292
4292
  for await (let { Codec: E, meta: i } of A) {
@@ -4312,11 +4312,11 @@ async function hE(g) {
4312
4312
  }
4313
4313
  }
4314
4314
  if (!B) {
4315
- if (!tE(Q))
4315
+ if (!yE(Q))
4316
4316
  throw new v(`Cannot encode ${Q.dataType} to bytes without a codec`);
4317
4317
  B = {
4318
4318
  name: "bytes",
4319
- codec: MI.fromConfig({ endian: "little" }, Q)
4319
+ codec: dI.fromConfig({ endian: "little" }, Q)
4320
4320
  };
4321
4321
  }
4322
4322
  return {
@@ -4325,14 +4325,14 @@ async function hE(g) {
4325
4325
  bytesToBytes: C
4326
4326
  };
4327
4327
  }
4328
- function tE(g) {
4328
+ function yE(g) {
4329
4329
  return g.dataType !== "v2:object" && g.dataType !== "string";
4330
4330
  }
4331
4331
  const yB = 18446744073709551615n;
4332
- function yE(g, A, I, B) {
4332
+ function eE(g, A, I, B) {
4333
4333
  if (!g.store.getRange)
4334
4334
  throw new Sg("sharding requires a store with getRange");
4335
- let C = g.store.getRange.bind(g.store), Q = A.map((a, D) => a / B.chunk_shape[D]), E = gg({
4335
+ let C = g.store.getRange.bind(g.store), Q = A.map((a, D) => a / B.chunk_shape[D]), E = Bg({
4336
4336
  dataType: "uint64",
4337
4337
  shape: [...Q, 2],
4338
4338
  codecs: B.index_codecs,
@@ -4382,9 +4382,9 @@ function eB(g) {
4382
4382
  return g.find((I) => I.name === "transpose")?.configuration?.order ?? "C";
4383
4383
  }
4384
4384
  const QI = Symbol("zarrita.context");
4385
- function eE(g, A) {
4386
- let { configuration: I } = A.codecs.find(vQ) ?? {}, B = {
4387
- encodeChunkKey: ZQ(A.chunk_key_encoding),
4385
+ function nE(g, A) {
4386
+ let { configuration: I } = A.codecs.find(XQ) ?? {}, B = {
4387
+ encodeChunkKey: PQ(A.chunk_key_encoding),
4388
4388
  TypedArray: TA(A.data_type),
4389
4389
  fillValue: A.fill_value
4390
4390
  };
@@ -4394,7 +4394,7 @@ function eE(g, A) {
4394
4394
  ...B,
4395
4395
  kind: "sharded",
4396
4396
  chunkShape: I.chunk_shape,
4397
- codec: gg({
4397
+ codec: Bg({
4398
4398
  dataType: A.data_type,
4399
4399
  shape: I.chunk_shape,
4400
4400
  codecs: I.codecs,
@@ -4403,7 +4403,7 @@ function eE(g, A) {
4403
4403
  getStrides(E) {
4404
4404
  return RA(E, Q);
4405
4405
  },
4406
- getChunkBytes: yE(g, A.chunk_grid.configuration.chunk_shape, B.encodeChunkKey, I)
4406
+ getChunkBytes: eE(g, A.chunk_grid.configuration.chunk_shape, B.encodeChunkKey, I)
4407
4407
  };
4408
4408
  }
4409
4409
  let C = eB(A.codecs);
@@ -4411,7 +4411,7 @@ function eE(g, A) {
4411
4411
  ...B,
4412
4412
  kind: "regular",
4413
4413
  chunkShape: A.chunk_grid.configuration.chunk_shape,
4414
- codec: gg({
4414
+ codec: Bg({
4415
4415
  dataType: A.data_type,
4416
4416
  shape: A.chunk_grid.configuration.chunk_shape,
4417
4417
  codecs: A.codecs,
@@ -4434,7 +4434,7 @@ let FI = class extends CA {
4434
4434
  super(A, I), this.#A = {
4435
4435
  ...B,
4436
4436
  fill_value: $B(B)
4437
- }, this[QI] = eE(this, this.#A);
4437
+ }, this[QI] = nE(this, this.#A);
4438
4438
  }
4439
4439
  get attrs() {
4440
4440
  return this.#A.attributes;
@@ -4455,7 +4455,7 @@ let FI = class extends CA {
4455
4455
  return this.#A.data_type;
4456
4456
  }
4457
4457
  async getChunk(A, I, B) {
4458
- B?.useSharedArrayBuffer && WQ();
4458
+ B?.useSharedArrayBuffer && bQ();
4459
4459
  let C = this[QI], Q = await C.getChunkBytes(A, I);
4460
4460
  if (!Q) {
4461
4461
  let E = C.chunkShape.reduce((o, a) => o * a, 1), i;
@@ -4464,7 +4464,7 @@ let FI = class extends CA {
4464
4464
  if (!("BYTES_PER_ELEMENT" in o))
4465
4465
  console.warn("zarrita: useSharedArrayBuffer is not supported for non-buffer-backed data types."), i = new C.TypedArray(E);
4466
4466
  else {
4467
- let a = bQ(E * o.BYTES_PER_ELEMENT);
4467
+ let a = ZQ(E * o.BYTES_PER_ELEMENT);
4468
4468
  i = new C.TypedArray(a, 0, E);
4469
4469
  }
4470
4470
  } else
@@ -4495,24 +4495,24 @@ let FI = class extends CA {
4495
4495
  * ```
4496
4496
  */
4497
4497
  is(A) {
4498
- return Ag(this.dtype, A);
4498
+ return Ig(this.dtype, A);
4499
4499
  }
4500
4500
  };
4501
- function nE(g, A) {
4501
+ function GE(g, A) {
4502
4502
  let I = g;
4503
4503
  for (let B of A)
4504
4504
  I instanceof Promise ? I = I.then((C) => B(C)) : I = B(I);
4505
4505
  return I;
4506
4506
  }
4507
- function GE(g, ...A) {
4508
- return nE(g, A);
4507
+ function wE(g, ...A) {
4508
+ return GE(g, A);
4509
4509
  }
4510
4510
  async function BC(g) {
4511
4511
  let A = g.store.arrayExtensions;
4512
- return A?.length ? await GE(g, ...A) : g;
4512
+ return A?.length ? await wE(g, ...A) : g;
4513
4513
  }
4514
- let dI = wE();
4515
- function wE() {
4514
+ let KI = FE();
4515
+ function FE() {
4516
4516
  let g = /* @__PURE__ */ new WeakMap();
4517
4517
  function A(I) {
4518
4518
  let B = g.get(I) ?? { v2: 0, v3: 0 };
@@ -4528,38 +4528,38 @@ function wE() {
4528
4528
  }
4529
4529
  };
4530
4530
  }
4531
- async function FE(g, A) {
4531
+ async function rE(g, A) {
4532
4532
  let I = await g.store.get(g.resolve(".zattrs").path, {
4533
4533
  signal: A
4534
4534
  });
4535
- return I ? gI(I) : {};
4535
+ return I ? II(I) : {};
4536
4536
  }
4537
- async function rE(g, A = {}) {
4537
+ async function SE(g, A = {}) {
4538
4538
  let I = "store" in g ? g : new CA(g), { signal: B } = A, C = {};
4539
- return (A.attrs ?? !0) && (C = await FE(I, B)), B?.throwIfAborted(), A.kind === "array" ? nB(I, C, B) : A.kind === "group" ? GB(I, C, B) : nB(I, C, B).catch((Q) => (AC(Q, uA, v), GB(I, C, B)));
4539
+ return (A.attrs ?? !0) && (C = await rE(I, B)), B?.throwIfAborted(), A.kind === "array" ? nB(I, C, B) : A.kind === "group" ? GB(I, C, B) : nB(I, C, B).catch((Q) => (AC(Q, uA, v), GB(I, C, B)));
4540
4540
  }
4541
4541
  async function nB(g, A, I) {
4542
4542
  let { path: B } = g.resolve(".zarray"), C = await g.store.get(B, { signal: I });
4543
4543
  if (!C)
4544
4544
  throw new uA("v2 array", { path: B });
4545
- return dI.increment(g.store, "v2"), BC(new FI(g.store, g.path, OQ(gI(C), A)));
4545
+ return KI.increment(g.store, "v2"), BC(new FI(g.store, g.path, VQ(II(C), A)));
4546
4546
  }
4547
4547
  async function GB(g, A, I) {
4548
4548
  let { path: B } = g.resolve(".zgroup"), C = await g.store.get(B, { signal: I });
4549
4549
  if (!C)
4550
4550
  throw new uA("v2 group", { path: B });
4551
- return dI.increment(g.store, "v2"), new Kg(g.store, g.path, VQ(gI(C), A));
4551
+ return KI.increment(g.store, "v2"), new Kg(g.store, g.path, vQ(II(C), A));
4552
4552
  }
4553
- async function SE(g, A) {
4553
+ async function RE(g, A) {
4554
4554
  let { store: I, path: B } = g.resolve("zarr.json"), C = await g.store.get(B, { signal: A });
4555
4555
  if (!C)
4556
4556
  throw new uA("v3 array or group", { path: B });
4557
- let Q = gI(C);
4557
+ let Q = II(C);
4558
4558
  return Q.node_type === "array" && (Q.fill_value = $B(Q)), Q.node_type === "array" ? BC(new FI(I, g.path, Q)) : new Kg(I, g.path, Q);
4559
4559
  }
4560
- async function RE(g, A = {}) {
4561
- let I = "store" in g ? g : new CA(g), B = await SE(I, A.signal);
4562
- if (dI.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && B instanceof FI || A.kind === "group" && B instanceof Kg)
4560
+ async function NE(g, A = {}) {
4561
+ let I = "store" in g ? g : new CA(g), B = await RE(I, A.signal);
4562
+ if (KI.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && B instanceof FI || A.kind === "group" && B instanceof Kg)
4563
4563
  return B;
4564
4564
  let C = B instanceof FI ? "array" : "group";
4565
4565
  throw new uA(`${A.kind} at ${I.path}`, {
@@ -4568,12 +4568,12 @@ async function RE(g, A = {}) {
4568
4568
  });
4569
4569
  }
4570
4570
  async function BA(g, A = {}) {
4571
- let I = "store" in g ? g.store : g, B = dI.versionMax(I), C = B === "v2" ? BA.v2 : BA.v3, Q = B === "v2" ? BA.v3 : BA.v2;
4571
+ let I = "store" in g ? g.store : g, B = KI.versionMax(I), C = B === "v2" ? BA.v2 : BA.v3, Q = B === "v2" ? BA.v3 : BA.v2;
4572
4572
  return C(g, A).catch((E) => (AC(E, uA, v), Q(g, A)));
4573
4573
  }
4574
- BA.v2 = rE;
4575
- BA.v3 = RE;
4576
- async function NE(g, A) {
4574
+ BA.v2 = SE;
4575
+ BA.v3 = NE;
4576
+ async function cE(g, A) {
4577
4577
  const I = A.split("/"), B = I.pop();
4578
4578
  if (!B)
4579
4579
  throw new Error("Invalid path");
@@ -4590,7 +4590,7 @@ class Hg {
4590
4590
  return this.#A;
4591
4591
  }
4592
4592
  async get(A) {
4593
- const I = await NE(this.#A, A.slice(1)).catch(
4593
+ const I = await cE(this.#A, A.slice(1)).catch(
4594
4594
  () => {
4595
4595
  }
4596
4596
  );
@@ -4600,7 +4600,7 @@ class Hg {
4600
4600
  return new Uint8Array(C);
4601
4601
  }
4602
4602
  }
4603
- async function BI(g, A) {
4603
+ async function gI(g, A) {
4604
4604
  if (A === "v2")
4605
4605
  try {
4606
4606
  return BA.v2(g, { kind: "group", attrs: !0 });
@@ -4619,7 +4619,7 @@ async function BI(g, A) {
4619
4619
  throw new Error(`Failed to open Zarr group at ${g}`);
4620
4620
  }
4621
4621
  }
4622
- async function cE(g, A) {
4622
+ async function UE(g, A) {
4623
4623
  if (A === "v2")
4624
4624
  try {
4625
4625
  return BA.v2(g, { kind: "array", attrs: !1 });
@@ -4638,11 +4638,11 @@ async function cE(g, A) {
4638
4638
  throw new Error(`Failed to open Zarr array at ${g}`);
4639
4639
  }
4640
4640
  }
4641
- async function UE(g) {
4641
+ async function kE(g) {
4642
4642
  let A;
4643
4643
  switch (g.type) {
4644
4644
  case "fetch": {
4645
- const B = new $A(g.url);
4645
+ const B = new _A(g.url);
4646
4646
  A = new CA(B);
4647
4647
  break;
4648
4648
  }
@@ -4659,10 +4659,10 @@ async function UE(g) {
4659
4659
  }
4660
4660
  }
4661
4661
  const I = g.arrayPath ? A.resolve(g.arrayPath) : A;
4662
- return cE(I, g.zarrVersion);
4662
+ return UE(I, g.zarrVersion);
4663
4663
  }
4664
- function kE(g, A, I) {
4665
- if (g.store instanceof $A)
4664
+ function LE(g, A, I) {
4665
+ if (g.store instanceof _A)
4666
4666
  return {
4667
4667
  type: "fetch",
4668
4668
  arrayPath: A,
@@ -4681,10 +4681,10 @@ function kE(g, A, I) {
4681
4681
  `Unsupported store type: ${g.store.constructor.name}`
4682
4682
  );
4683
4683
  }
4684
- function LE(g, A, I, B) {
4685
- return JE(g, A, I, B);
4686
- }
4687
4684
  function JE(g, A, I, B) {
4685
+ return YE(g, A, I, B);
4686
+ }
4687
+ function YE(g, A, I, B) {
4688
4688
  const { targetShape: C, chunkIndex: Q, dimIndices: E } = B;
4689
4689
  let i = 1;
4690
4690
  for (let r = A.length - 1; r >= 0; r--) {
@@ -8374,7 +8374,7 @@ return ret;
8374
8374
  });
8375
8375
  //# sourceMappingURL=worker_kernel-CBlE4MBI.js.map
8376
8376
  `, wB = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", CC], { type: "text/javascript;charset=utf-8" });
8377
- function YE(g) {
8377
+ function ME(g) {
8378
8378
  let A;
8379
8379
  try {
8380
8380
  if (A = wB && (self.URL || self.webkitURL).createObjectURL(wB), !A) throw "";
@@ -8395,8 +8395,8 @@ function YE(g) {
8395
8395
  );
8396
8396
  }
8397
8397
  }
8398
- const ME = Math.max(1, navigator.hardwareConcurrency - 2);
8399
- let EA = [], dE = 0, QC = 0;
8398
+ const dE = Math.max(1, navigator.hardwareConcurrency - 2);
8399
+ let EA = [], KE = 0, QC = 0;
8400
8400
  const NA = /* @__PURE__ */ new Map(), rI = /* @__PURE__ */ new Set();
8401
8401
  function EC(g) {
8402
8402
  const A = EA.find((I) => I.worker === g);
@@ -8405,7 +8405,7 @@ function EC(g) {
8405
8405
  "Worker not found in pool - this should not happen"
8406
8406
  ), A;
8407
8407
  }
8408
- function KE(g, A) {
8408
+ function HE(g, A) {
8409
8409
  const { id: I, success: B } = g.data, C = NA.get(I);
8410
8410
  if (!C) {
8411
8411
  rI.has(I) ? rI.delete(I) : k.warn(
@@ -8456,20 +8456,20 @@ function FB(g, A) {
8456
8456
  }
8457
8457
  }
8458
8458
  function iC() {
8459
- const g = new YE();
8460
- return g.addEventListener("message", (A) => KE(A, g)), g.addEventListener("error", (A) => FB(A, g)), g.addEventListener(
8459
+ const g = new ME();
8460
+ return g.addEventListener("message", (A) => HE(A, g)), g.addEventListener("error", (A) => FB(A, g)), g.addEventListener(
8461
8461
  "messageerror",
8462
8462
  (A) => FB(A, g)
8463
8463
  ), g;
8464
8464
  }
8465
- function HE() {
8465
+ function qE() {
8466
8466
  if (EA.length === 0)
8467
8467
  throw new Error("Worker pool is not initialized");
8468
8468
  return EA.sort((g, A) => g.pendingCount - A.pendingCount)[0];
8469
8469
  }
8470
- async function qE(g, A, I, B) {
8470
+ async function lE(g, A, I, B) {
8471
8471
  return new Promise((C, Q) => {
8472
- const E = HE(), i = dE++, o = {
8472
+ const E = qE(), i = KE++, o = {
8473
8473
  resolve: C,
8474
8474
  reject: Q,
8475
8475
  workerId: E.workerId
@@ -8496,10 +8496,10 @@ async function qE(g, A, I, B) {
8496
8496
  });
8497
8497
  });
8498
8498
  }
8499
- function lE() {
8499
+ function fE() {
8500
8500
  if (!(EA.length > 0))
8501
8501
  try {
8502
- for (let g = 0; g < ME; g++) {
8502
+ for (let g = 0; g < dE; g++) {
8503
8503
  const A = iC();
8504
8504
  EA.push({
8505
8505
  worker: A,
@@ -8512,14 +8512,14 @@ function lE() {
8512
8512
  `Initialized worker pool with ${EA.length} workers`
8513
8513
  );
8514
8514
  } catch {
8515
- k.warn("ZarrWorker", "Failed to create workers - clearing pool"), pE();
8515
+ k.warn("ZarrWorker", "Failed to create workers - clearing pool"), mE();
8516
8516
  return;
8517
8517
  }
8518
8518
  }
8519
- async function fE(g, A, I, B, C) {
8520
- lE();
8519
+ async function pE(g, A, I, B, C) {
8520
+ fE();
8521
8521
  try {
8522
- return await qE(
8522
+ return await lE(
8523
8523
  A,
8524
8524
  I,
8525
8525
  B,
@@ -8530,11 +8530,11 @@ async function fE(g, A, I, B, C) {
8530
8530
  throw Q;
8531
8531
  k.warn("ZarrWorker", "Falling back to main thread", Q);
8532
8532
  const E = await g.getChunk(I, C);
8533
- if (!RQ(E.data))
8533
+ if (!NQ(E.data))
8534
8534
  throw new Error(
8535
8535
  `Unsupported chunk data type: ${E.data.constructor.name}`
8536
8536
  );
8537
- return LE(
8537
+ return JE(
8538
8538
  E.data,
8539
8539
  E.shape,
8540
8540
  E.stride,
@@ -8542,19 +8542,19 @@ async function fE(g, A, I, B, C) {
8542
8542
  );
8543
8543
  }
8544
8544
  }
8545
- function pE() {
8545
+ function mE() {
8546
8546
  for (const g of EA)
8547
8547
  g.worker.terminate();
8548
8548
  EA = [], NA.clear();
8549
8549
  }
8550
- class mE {
8550
+ class uE {
8551
8551
  metadata_;
8552
8552
  arrays_;
8553
8553
  arrayParams_;
8554
8554
  dimensions_;
8555
8555
  bytesPerElement_;
8556
8556
  constructor(A) {
8557
- this.metadata_ = A.metadata, this.arrays_ = A.arrays, this.arrayParams_ = A.arrayParams, this.dimensions_ = TE(this.metadata_, this.arrays_), this.bytesPerElement_ = uE(this.arrays_[0].dtype);
8557
+ this.metadata_ = A.metadata, this.arrays_ = A.arrays, this.arrayParams_ = A.arrayParams, this.dimensions_ = xE(this.metadata_, this.arrays_), this.bytesPerElement_ = TE(this.arrays_[0].dtype);
8558
8558
  }
8559
8559
  getSourceDimensionMap() {
8560
8560
  return this.dimensions_;
@@ -8588,18 +8588,18 @@ class mE {
8588
8588
  },
8589
8589
  cChunkSize: E?.chunkSize,
8590
8590
  tChunkSize: i?.chunkSize
8591
- }, a = await fE(
8591
+ }, a = await pE(
8592
8592
  C,
8593
8593
  Q,
8594
8594
  B,
8595
8595
  o,
8596
8596
  { signal: I }
8597
8597
  ), D = a.BYTES_PER_ELEMENT;
8598
- if (!sQ(D))
8598
+ if (!hQ(D))
8599
8599
  throw new Error(
8600
8600
  "Invalid row alignment value. Possible values are 1, 2, 4, or 8"
8601
8601
  );
8602
- A.rowAlignmentBytes = D, rQ(A, a);
8602
+ A.rowAlignmentBytes = D, SQ(A, a);
8603
8603
  }
8604
8604
  }
8605
8605
  const rB = {
@@ -8611,7 +8611,7 @@ const rB = {
8611
8611
  uint32: 4,
8612
8612
  float32: 4
8613
8613
  };
8614
- function uE(g) {
8614
+ function TE(g) {
8615
8615
  const A = rB[g];
8616
8616
  if (A === void 0)
8617
8617
  throw new Error(
@@ -8619,7 +8619,7 @@ function uE(g) {
8619
8619
  );
8620
8620
  return A;
8621
8621
  }
8622
- function TE(g, A) {
8622
+ function xE(g, A) {
8623
8623
  const I = g.axes.map((s) => s.name), B = g.axes.length, C = SB(I, "x"), Q = SB(I, "y"), E = (s, h) => {
8624
8624
  const t = [];
8625
8625
  for (let y = 0; y < g.datasets.length; y++) {
@@ -8631,7 +8631,7 @@ function TE(g, A) {
8631
8631
  translation: J[h]
8632
8632
  });
8633
8633
  }
8634
- if (g.axes[h].type === "space" && WE(t))
8634
+ if (g.axes[h].type === "space" && bE(t))
8635
8635
  for (const y of t) y.translation -= 0.5 * y.scale;
8636
8636
  return {
8637
8637
  name: s,
@@ -8650,7 +8650,7 @@ function TE(g, A) {
8650
8650
  const D = iI(I, "t");
8651
8651
  return D !== -1 && (i.t = E(I[D], D)), i;
8652
8652
  }
8653
- function xE(g, A) {
8653
+ function WE(g, A) {
8654
8654
  return g.toLowerCase() === A.toLowerCase();
8655
8655
  }
8656
8656
  function SB(g, A) {
@@ -8662,9 +8662,9 @@ function SB(g, A) {
8662
8662
  return I;
8663
8663
  }
8664
8664
  function iI(g, A) {
8665
- return g.findIndex((I) => xE(I, A));
8665
+ return g.findIndex((I) => WE(I, A));
8666
8666
  }
8667
- function WE(g) {
8667
+ function bE(g) {
8668
8668
  if (g.length <= 1) return !1;
8669
8669
  for (let A = 1; A < g.length; A++) {
8670
8670
  const I = 0.5 * (g[A].scale - g[A - 1].scale), B = g[A].translation - g[A - 1].translation;
@@ -8841,7 +8841,7 @@ class tA extends Error {
8841
8841
  }
8842
8842
  }
8843
8843
  tA.create = (g) => new tA(g);
8844
- const Bg = (g, A) => {
8844
+ const Cg = (g, A) => {
8845
8845
  let I;
8846
8846
  switch (g.code) {
8847
8847
  case e.invalid_type:
@@ -8897,11 +8897,11 @@ const Bg = (g, A) => {
8897
8897
  }
8898
8898
  return { message: I };
8899
8899
  };
8900
- let bE = Bg;
8901
- function ZE() {
8902
- return bE;
8900
+ let ZE = Cg;
8901
+ function PE() {
8902
+ return ZE;
8903
8903
  }
8904
- const PE = (g) => {
8904
+ const OE = (g) => {
8905
8905
  const { data: A, path: I, errorMaps: B, issueData: C } = g, Q = [...I, ...C.path || []], E = {
8906
8906
  ...C,
8907
8907
  path: Q
@@ -8923,7 +8923,7 @@ const PE = (g) => {
8923
8923
  };
8924
8924
  };
8925
8925
  function w(g, A) {
8926
- const I = ZE(), B = PE({
8926
+ const I = PE(), B = OE({
8927
8927
  issueData: A,
8928
8928
  data: g.data,
8929
8929
  path: g.path,
@@ -8934,7 +8934,7 @@ function w(g, A) {
8934
8934
  // then schema-bound map if available
8935
8935
  I,
8936
8936
  // then global override map
8937
- I === Bg ? void 0 : Bg
8937
+ I === Cg ? void 0 : Cg
8938
8938
  // then global default map
8939
8939
  ].filter((C) => !!C)
8940
8940
  });
@@ -8983,7 +8983,7 @@ class gA {
8983
8983
  }
8984
8984
  const Y = Object.freeze({
8985
8985
  status: "aborted"
8986
- }), PA = (g) => ({ status: "dirty", value: g }), QA = (g) => ({ status: "valid", value: g }), NB = (g) => g.status === "aborted", cB = (g) => g.status === "dirty", KA = (g) => g.status === "valid", SI = (g) => typeof Promise < "u" && g instanceof Promise;
8986
+ }), ZA = (g) => ({ status: "dirty", value: g }), QA = (g) => ({ status: "valid", value: g }), NB = (g) => g.status === "aborted", cB = (g) => g.status === "dirty", KA = (g) => g.status === "valid", SI = (g) => typeof Promise < "u" && g instanceof Promise;
8987
8987
  var N;
8988
8988
  (function(g) {
8989
8989
  g.errToObj = (A) => typeof A == "string" ? { message: A } : A || {}, g.toString = (A) => typeof A == "string" ? A : A?.message;
@@ -9197,7 +9197,7 @@ class q {
9197
9197
  }
9198
9198
  default(A) {
9199
9199
  const I = typeof A == "function" ? A : () => A;
9200
- return new og({
9200
+ return new ag({
9201
9201
  ...K(this._def),
9202
9202
  innerType: this,
9203
9203
  defaultValue: I,
@@ -9205,7 +9205,7 @@ class q {
9205
9205
  });
9206
9206
  }
9207
9207
  brand() {
9208
- return new yi({
9208
+ return new ei({
9209
9209
  typeName: M.ZodBranded,
9210
9210
  type: this,
9211
9211
  ...K(this._def)
@@ -9213,7 +9213,7 @@ class q {
9213
9213
  }
9214
9214
  catch(A) {
9215
9215
  const I = typeof A == "function" ? A : () => A;
9216
- return new ag({
9216
+ return new Dg({
9217
9217
  ...K(this._def),
9218
9218
  innerType: this,
9219
9219
  catchValue: I,
@@ -9231,7 +9231,7 @@ class q {
9231
9231
  return qg.create(this, A);
9232
9232
  }
9233
9233
  readonly() {
9234
- return Dg.create(this);
9234
+ return sg.create(this);
9235
9235
  }
9236
9236
  isOptional() {
9237
9237
  return this.safeParse(void 0).success;
@@ -9240,28 +9240,28 @@ class q {
9240
9240
  return this.safeParse(null).success;
9241
9241
  }
9242
9242
  }
9243
- const OE = /^c[^\s-]{8,}$/i, VE = /^[0-9a-z]+$/, vE = /^[0-9A-HJKMNP-TV-Z]{26}$/i, XE = /^[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, jE = /^[a-z0-9_-]{21}$/i, zE = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, _E = /^[-+]?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)?)??$/, $E = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ai = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
9244
- let bI;
9245
- const Ii = /^(?:(?: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])$/, gi = /^(?:(?: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])$/, Bi = /^(([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])$/, Qi = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Ei = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, oC = "((\\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])))", ii = new RegExp(`^${oC}$`);
9243
+ const VE = /^c[^\s-]{8,}$/i, vE = /^[0-9a-z]+$/, XE = /^[0-9A-HJKMNP-TV-Z]{26}$/i, jE = /^[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, zE = /^[a-z0-9_-]{21}$/i, _E = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, $E = /^[-+]?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)?)??$/, Ai = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ii = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
9244
+ let ZI;
9245
+ const gi = /^(?:(?: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])$/, Bi = /^(?:(?: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])$/, 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]))$/, Qi = /^(([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])$/, Ei = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, ii = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, oC = "((\\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])))", oi = new RegExp(`^${oC}$`);
9246
9246
  function aC(g) {
9247
9247
  let A = "[0-5]\\d";
9248
9248
  g.precision ? A = `${A}\\.\\d{${g.precision}}` : g.precision == null && (A = `${A}(\\.\\d+)?`);
9249
9249
  const I = g.precision ? "+" : "?";
9250
9250
  return `([01]\\d|2[0-3]):[0-5]\\d(:${A})${I}`;
9251
9251
  }
9252
- function oi(g) {
9252
+ function ai(g) {
9253
9253
  return new RegExp(`^${aC(g)}$`);
9254
9254
  }
9255
- function ai(g) {
9255
+ function Di(g) {
9256
9256
  let A = `${oC}T${aC(g)}`;
9257
9257
  const I = [];
9258
9258
  return I.push(g.local ? "Z?" : "Z"), g.offset && I.push("([+-]\\d{2}:?\\d{2})"), A = `${A}(${I.join("|")})`, new RegExp(`^${A}$`);
9259
9259
  }
9260
- function Di(g, A) {
9261
- return !!((A === "v4" || !A) && Ii.test(g) || (A === "v6" || !A) && Bi.test(g));
9262
- }
9263
9260
  function si(g, A) {
9264
- if (!zE.test(g))
9261
+ return !!((A === "v4" || !A) && gi.test(g) || (A === "v6" || !A) && Ci.test(g));
9262
+ }
9263
+ function hi(g, A) {
9264
+ if (!_E.test(g))
9265
9265
  return !1;
9266
9266
  try {
9267
9267
  const [I] = g.split(".");
@@ -9273,8 +9273,8 @@ function si(g, A) {
9273
9273
  return !1;
9274
9274
  }
9275
9275
  }
9276
- function hi(g, A) {
9277
- return !!((A === "v4" || !A) && gi.test(g) || (A === "v6" || !A) && Ci.test(g));
9276
+ function ti(g, A) {
9277
+ return !!((A === "v4" || !A) && Bi.test(g) || (A === "v6" || !A) && Qi.test(g));
9278
9278
  }
9279
9279
  class eA extends q {
9280
9280
  _parse(A) {
@@ -9325,43 +9325,43 @@ class eA extends q {
9325
9325
  message: Q.message
9326
9326
  }), B.dirty());
9327
9327
  } else if (Q.kind === "email")
9328
- $E.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9328
+ Ai.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9329
9329
  validation: "email",
9330
9330
  code: e.invalid_string,
9331
9331
  message: Q.message
9332
9332
  }), B.dirty());
9333
9333
  else if (Q.kind === "emoji")
9334
- bI || (bI = new RegExp(Ai, "u")), bI.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9334
+ ZI || (ZI = new RegExp(Ii, "u")), ZI.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9335
9335
  validation: "emoji",
9336
9336
  code: e.invalid_string,
9337
9337
  message: Q.message
9338
9338
  }), B.dirty());
9339
9339
  else if (Q.kind === "uuid")
9340
- XE.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9340
+ jE.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9341
9341
  validation: "uuid",
9342
9342
  code: e.invalid_string,
9343
9343
  message: Q.message
9344
9344
  }), B.dirty());
9345
9345
  else if (Q.kind === "nanoid")
9346
- jE.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9346
+ zE.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9347
9347
  validation: "nanoid",
9348
9348
  code: e.invalid_string,
9349
9349
  message: Q.message
9350
9350
  }), B.dirty());
9351
9351
  else if (Q.kind === "cuid")
9352
- OE.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9352
+ VE.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9353
9353
  validation: "cuid",
9354
9354
  code: e.invalid_string,
9355
9355
  message: Q.message
9356
9356
  }), B.dirty());
9357
9357
  else if (Q.kind === "cuid2")
9358
- VE.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9358
+ vE.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9359
9359
  validation: "cuid2",
9360
9360
  code: e.invalid_string,
9361
9361
  message: Q.message
9362
9362
  }), B.dirty());
9363
9363
  else if (Q.kind === "ulid")
9364
- vE.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9364
+ XE.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9365
9365
  validation: "ulid",
9366
9366
  code: e.invalid_string,
9367
9367
  message: Q.message
@@ -9392,39 +9392,39 @@ class eA extends q {
9392
9392
  code: e.invalid_string,
9393
9393
  validation: { endsWith: Q.value },
9394
9394
  message: Q.message
9395
- }), B.dirty()) : Q.kind === "datetime" ? ai(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9395
+ }), B.dirty()) : Q.kind === "datetime" ? Di(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9396
9396
  code: e.invalid_string,
9397
9397
  validation: "datetime",
9398
9398
  message: Q.message
9399
- }), B.dirty()) : Q.kind === "date" ? ii.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9399
+ }), B.dirty()) : Q.kind === "date" ? oi.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9400
9400
  code: e.invalid_string,
9401
9401
  validation: "date",
9402
9402
  message: Q.message
9403
- }), B.dirty()) : Q.kind === "time" ? oi(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9403
+ }), B.dirty()) : Q.kind === "time" ? ai(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9404
9404
  code: e.invalid_string,
9405
9405
  validation: "time",
9406
9406
  message: Q.message
9407
- }), B.dirty()) : Q.kind === "duration" ? _E.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9407
+ }), B.dirty()) : Q.kind === "duration" ? $E.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9408
9408
  validation: "duration",
9409
9409
  code: e.invalid_string,
9410
9410
  message: Q.message
9411
- }), B.dirty()) : Q.kind === "ip" ? Di(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), w(C, {
9411
+ }), B.dirty()) : Q.kind === "ip" ? si(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), w(C, {
9412
9412
  validation: "ip",
9413
9413
  code: e.invalid_string,
9414
9414
  message: Q.message
9415
- }), B.dirty()) : Q.kind === "jwt" ? si(A.data, Q.alg) || (C = this._getOrReturnCtx(A, C), w(C, {
9415
+ }), B.dirty()) : Q.kind === "jwt" ? hi(A.data, Q.alg) || (C = this._getOrReturnCtx(A, C), w(C, {
9416
9416
  validation: "jwt",
9417
9417
  code: e.invalid_string,
9418
9418
  message: Q.message
9419
- }), B.dirty()) : Q.kind === "cidr" ? hi(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), w(C, {
9419
+ }), B.dirty()) : Q.kind === "cidr" ? ti(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), w(C, {
9420
9420
  validation: "cidr",
9421
9421
  code: e.invalid_string,
9422
9422
  message: Q.message
9423
- }), B.dirty()) : Q.kind === "base64" ? Qi.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9423
+ }), B.dirty()) : Q.kind === "base64" ? Ei.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9424
9424
  validation: "base64",
9425
9425
  code: e.invalid_string,
9426
9426
  message: Q.message
9427
- }), B.dirty()) : Q.kind === "base64url" ? Ei.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9427
+ }), B.dirty()) : Q.kind === "base64url" ? ii.test(A.data) || (C = this._getOrReturnCtx(A, C), w(C, {
9428
9428
  validation: "base64url",
9429
9429
  code: e.invalid_string,
9430
9430
  message: Q.message
@@ -9659,7 +9659,7 @@ eA.create = (g) => new eA({
9659
9659
  coerce: g?.coerce ?? !1,
9660
9660
  ...K(g)
9661
9661
  });
9662
- function ti(g, A) {
9662
+ function yi(g, A) {
9663
9663
  const I = (g.toString().split(".")[1] || "").length, B = (A.toString().split(".")[1] || "").length, C = I > B ? I : B, Q = Number.parseInt(g.toFixed(C).replace(".", "")), E = Number.parseInt(A.toFixed(C).replace(".", ""));
9664
9664
  return Q % E / 10 ** C;
9665
9665
  }
@@ -9698,7 +9698,7 @@ class HA extends q {
9698
9698
  inclusive: Q.inclusive,
9699
9699
  exact: !1,
9700
9700
  message: Q.message
9701
- }), C.dirty()) : Q.kind === "multipleOf" ? ti(A.data, Q.value) !== 0 && (B = this._getOrReturnCtx(A, B), w(B, {
9701
+ }), C.dirty()) : Q.kind === "multipleOf" ? yi(A.data, Q.value) !== 0 && (B = this._getOrReturnCtx(A, B), w(B, {
9702
9702
  code: e.not_multiple_of,
9703
9703
  multipleOf: Q.value,
9704
9704
  message: Q.message
@@ -9835,7 +9835,7 @@ HA.create = (g) => new HA({
9835
9835
  coerce: g?.coerce || !1,
9836
9836
  ...K(g)
9837
9837
  });
9838
- class jA extends q {
9838
+ class XA extends q {
9839
9839
  constructor() {
9840
9840
  super(...arguments), this.min = this.gte, this.max = this.lte;
9841
9841
  }
@@ -9891,7 +9891,7 @@ class jA extends q {
9891
9891
  return this.setLimit("max", A, !1, N.toString(I));
9892
9892
  }
9893
9893
  setLimit(A, I, B, C) {
9894
- return new jA({
9894
+ return new XA({
9895
9895
  ...this._def,
9896
9896
  checks: [
9897
9897
  ...this._def.checks,
@@ -9905,7 +9905,7 @@ class jA extends q {
9905
9905
  });
9906
9906
  }
9907
9907
  _addCheck(A) {
9908
- return new jA({
9908
+ return new XA({
9909
9909
  ...this._def,
9910
9910
  checks: [...this._def.checks, A]
9911
9911
  });
@@ -9962,13 +9962,13 @@ class jA extends q {
9962
9962
  return A;
9963
9963
  }
9964
9964
  }
9965
- jA.create = (g) => new jA({
9965
+ XA.create = (g) => new XA({
9966
9966
  checks: [],
9967
9967
  typeName: M.ZodBigInt,
9968
9968
  coerce: g?.coerce ?? !1,
9969
9969
  ...K(g)
9970
9970
  });
9971
- class Cg extends q {
9971
+ class Qg extends q {
9972
9972
  _parse(A) {
9973
9973
  if (this._def.coerce && (A.data = !!A.data), this._getType(A) !== R.boolean) {
9974
9974
  const B = this._getOrReturnCtx(A);
@@ -9981,7 +9981,7 @@ class Cg extends q {
9981
9981
  return QA(A.data);
9982
9982
  }
9983
9983
  }
9984
- Cg.create = (g) => new Cg({
9984
+ Qg.create = (g) => new Qg({
9985
9985
  typeName: M.ZodBoolean,
9986
9986
  coerce: g?.coerce || !1,
9987
9987
  ...K(g)
@@ -10115,7 +10115,7 @@ JB.create = (g) => new JB({
10115
10115
  typeName: M.ZodNull,
10116
10116
  ...K(g)
10117
10117
  });
10118
- class Qg extends q {
10118
+ class Eg extends q {
10119
10119
  constructor() {
10120
10120
  super(...arguments), this._any = !0;
10121
10121
  }
@@ -10123,7 +10123,7 @@ class Qg extends q {
10123
10123
  return QA(A.data);
10124
10124
  }
10125
10125
  }
10126
- Qg.create = (g) => new Qg({
10126
+ Eg.create = (g) => new Eg({
10127
10127
  typeName: M.ZodAny,
10128
10128
  ...K(g)
10129
10129
  });
@@ -10619,14 +10619,14 @@ NI.create = (g, A) => new NI({
10619
10619
  typeName: M.ZodUnion,
10620
10620
  ...K(A)
10621
10621
  });
10622
- function Eg(g, A) {
10622
+ function ig(g, A) {
10623
10623
  const I = yA(g), B = yA(A);
10624
10624
  if (g === A)
10625
10625
  return { valid: !0, data: g };
10626
10626
  if (I === R.object && B === R.object) {
10627
10627
  const C = l.objectKeys(A), Q = l.objectKeys(g).filter((i) => C.indexOf(i) !== -1), E = { ...g, ...A };
10628
10628
  for (const i of Q) {
10629
- const o = Eg(g[i], A[i]);
10629
+ const o = ig(g[i], A[i]);
10630
10630
  if (!o.valid)
10631
10631
  return { valid: !1 };
10632
10632
  E[i] = o.data;
@@ -10637,7 +10637,7 @@ function Eg(g, A) {
10637
10637
  return { valid: !1 };
10638
10638
  const C = [];
10639
10639
  for (let Q = 0; Q < g.length; Q++) {
10640
- const E = g[Q], i = A[Q], o = Eg(E, i);
10640
+ const E = g[Q], i = A[Q], o = ig(E, i);
10641
10641
  if (!o.valid)
10642
10642
  return { valid: !1 };
10643
10643
  C.push(o.data);
@@ -10650,7 +10650,7 @@ class cI extends q {
10650
10650
  const { status: I, ctx: B } = this._processInputParams(A), C = (Q, E) => {
10651
10651
  if (NB(Q) || NB(E))
10652
10652
  return Y;
10653
- const i = Eg(Q.value, E.value);
10653
+ const i = ig(Q.value, E.value);
10654
10654
  return i.valid ? ((cB(Q) || cB(E)) && I.dirty(), { status: I.value, value: i.data }) : (w(B, {
10655
10655
  code: e.invalid_intersection_types
10656
10656
  }), Y);
@@ -10781,7 +10781,7 @@ dB.create = (g, A, I) => new dB({
10781
10781
  typeName: M.ZodMap,
10782
10782
  ...K(I)
10783
10783
  });
10784
- class zA extends q {
10784
+ class jA extends q {
10785
10785
  _parse(A) {
10786
10786
  const { status: I, ctx: B } = this._processInputParams(A);
10787
10787
  if (B.parsedType !== R.set)
@@ -10820,13 +10820,13 @@ class zA extends q {
10820
10820
  return B.common.async ? Promise.all(i).then((o) => E(o)) : E(i);
10821
10821
  }
10822
10822
  min(A, I) {
10823
- return new zA({
10823
+ return new jA({
10824
10824
  ...this._def,
10825
10825
  minSize: { value: A, message: N.toString(I) }
10826
10826
  });
10827
10827
  }
10828
10828
  max(A, I) {
10829
- return new zA({
10829
+ return new jA({
10830
10830
  ...this._def,
10831
10831
  maxSize: { value: A, message: N.toString(I) }
10832
10832
  });
@@ -10838,7 +10838,7 @@ class zA extends q {
10838
10838
  return this.min(1, A);
10839
10839
  }
10840
10840
  }
10841
- zA.create = (g, A) => new zA({
10841
+ jA.create = (g, A) => new jA({
10842
10842
  valueType: g,
10843
10843
  minSize: null,
10844
10844
  maxSize: null,
@@ -10859,7 +10859,7 @@ KB.create = (g, A) => new KB({
10859
10859
  typeName: M.ZodLazy,
10860
10860
  ...K(A)
10861
10861
  });
10862
- class ig extends q {
10862
+ class og extends q {
10863
10863
  _parse(A) {
10864
10864
  if (A.data !== this._def.value) {
10865
10865
  const I = this._getOrReturnCtx(A);
@@ -10875,7 +10875,7 @@ class ig extends q {
10875
10875
  return this._def.value;
10876
10876
  }
10877
10877
  }
10878
- ig.create = (g, A) => new ig({
10878
+ og.create = (g, A) => new og({
10879
10879
  value: g,
10880
10880
  typeName: M.ZodLiteral,
10881
10881
  ...K(A)
@@ -11023,7 +11023,7 @@ class lA extends q {
11023
11023
  path: B.path,
11024
11024
  parent: B
11025
11025
  });
11026
- return o.status === "aborted" ? Y : o.status === "dirty" || I.value === "dirty" ? PA(o.value) : o;
11026
+ return o.status === "aborted" ? Y : o.status === "dirty" || I.value === "dirty" ? ZA(o.value) : o;
11027
11027
  });
11028
11028
  {
11029
11029
  if (I.value === "aborted")
@@ -11033,7 +11033,7 @@ class lA extends q {
11033
11033
  path: B.path,
11034
11034
  parent: B
11035
11035
  });
11036
- return i.status === "aborted" ? Y : i.status === "dirty" || I.value === "dirty" ? PA(i.value) : i;
11036
+ return i.status === "aborted" ? Y : i.status === "dirty" || I.value === "dirty" ? ZA(i.value) : i;
11037
11037
  }
11038
11038
  }
11039
11039
  if (C.type === "refinement") {
@@ -11114,7 +11114,7 @@ fA.create = (g, A) => new fA({
11114
11114
  typeName: M.ZodNullable,
11115
11115
  ...K(A)
11116
11116
  });
11117
- class og extends q {
11117
+ class ag extends q {
11118
11118
  _parse(A) {
11119
11119
  const { ctx: I } = this._processInputParams(A);
11120
11120
  let B = I.data;
@@ -11128,13 +11128,13 @@ class og extends q {
11128
11128
  return this._def.innerType;
11129
11129
  }
11130
11130
  }
11131
- og.create = (g, A) => new og({
11131
+ ag.create = (g, A) => new ag({
11132
11132
  innerType: g,
11133
11133
  typeName: M.ZodDefault,
11134
11134
  defaultValue: typeof A.default == "function" ? A.default : () => A.default,
11135
11135
  ...K(A)
11136
11136
  });
11137
- class ag extends q {
11137
+ class Dg extends q {
11138
11138
  _parse(A) {
11139
11139
  const { ctx: I } = this._processInputParams(A), B = {
11140
11140
  ...I,
@@ -11171,7 +11171,7 @@ class ag extends q {
11171
11171
  return this._def.innerType;
11172
11172
  }
11173
11173
  }
11174
- ag.create = (g, A) => new ag({
11174
+ Dg.create = (g, A) => new Dg({
11175
11175
  innerType: g,
11176
11176
  typeName: M.ZodCatch,
11177
11177
  catchValue: typeof A.catch == "function" ? A.catch : () => A.catch,
@@ -11194,7 +11194,7 @@ qB.create = (g) => new qB({
11194
11194
  typeName: M.ZodNaN,
11195
11195
  ...K(g)
11196
11196
  });
11197
- class yi extends q {
11197
+ class ei extends q {
11198
11198
  _parse(A) {
11199
11199
  const { ctx: I } = this._processInputParams(A), B = I.data;
11200
11200
  return this._def.type._parse({
@@ -11217,7 +11217,7 @@ class qg extends q {
11217
11217
  path: B.path,
11218
11218
  parent: B
11219
11219
  });
11220
- return Q.status === "aborted" ? Y : Q.status === "dirty" ? (I.dirty(), PA(Q.value)) : this._def.out._parseAsync({
11220
+ return Q.status === "aborted" ? Y : Q.status === "dirty" ? (I.dirty(), ZA(Q.value)) : this._def.out._parseAsync({
11221
11221
  data: Q.value,
11222
11222
  path: B.path,
11223
11223
  parent: B
@@ -11247,7 +11247,7 @@ class qg extends q {
11247
11247
  });
11248
11248
  }
11249
11249
  }
11250
- class Dg extends q {
11250
+ class sg extends q {
11251
11251
  _parse(A) {
11252
11252
  const I = this._def.innerType._parse(A), B = (C) => (KA(C) && (C.value = Object.freeze(C.value)), C);
11253
11253
  return SI(I) ? I.then((C) => B(C)) : B(I);
@@ -11256,7 +11256,7 @@ class Dg extends q {
11256
11256
  return this._def.innerType;
11257
11257
  }
11258
11258
  }
11259
- Dg.create = (g, A) => new Dg({
11259
+ sg.create = (g, A) => new sg({
11260
11260
  innerType: g,
11261
11261
  typeName: M.ZodReadonly,
11262
11262
  ...K(A)
@@ -11265,17 +11265,17 @@ var M;
11265
11265
  (function(g) {
11266
11266
  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";
11267
11267
  })(M || (M = {}));
11268
- const u = eA.create, H = HA.create, sC = Cg.create, nA = Qg.create;
11268
+ const u = eA.create, H = HA.create, sC = Qg.create, nA = Eg.create;
11269
11269
  FA.create;
11270
11270
  const m = sA.create, L = O.create;
11271
11271
  NI.create;
11272
11272
  cI.create;
11273
11273
  cA.create;
11274
- const _ = ig.create, LA = qA.create;
11274
+ const _ = og.create, LA = qA.create;
11275
11275
  UI.create;
11276
11276
  GA.create;
11277
11277
  fA.create;
11278
- const ei = L({
11278
+ const ni = L({
11279
11279
  /**The multiscale datasets for this image*/
11280
11280
  multiscales: m(
11281
11281
  L({
@@ -11403,7 +11403,7 @@ const ei = L({
11403
11403
  projection: u().optional()
11404
11404
  }).optional()
11405
11405
  }).optional()
11406
- }).describe("JSON from OME-NGFF .zattrs"), ni = L({
11406
+ }).describe("JSON from OME-NGFF .zattrs"), Gi = L({
11407
11407
  plate: L({
11408
11408
  /**The acquisitions for this plate*/
11409
11409
  acquisitions: m(
@@ -11462,7 +11462,7 @@ const ei = L({
11462
11462
  })
11463
11463
  ).min(1).describe("The wells of the plate")
11464
11464
  }).optional()
11465
- }).describe("JSON from OME-NGFF .zattrs"), Gi = L({
11465
+ }).describe("JSON from OME-NGFF .zattrs"), wi = L({
11466
11466
  well: L({
11467
11467
  /**The fields of view for this well*/
11468
11468
  images: m(
@@ -11476,7 +11476,7 @@ const ei = L({
11476
11476
  /**The version of the specification*/
11477
11477
  version: _("0.4").describe("The version of the specification").optional()
11478
11478
  }).optional()
11479
- }).describe("JSON from OME-NGFF .zattrs"), wi = L({
11479
+ }).describe("JSON from OME-NGFF .zattrs"), Fi = L({
11480
11480
  /**The versioned OME-Zarr Metadata namespace*/
11481
11481
  ome: L({
11482
11482
  /**The multiscale datasets for this image*/
@@ -11606,7 +11606,7 @@ const ei = L({
11606
11606
  /**The version of the OME-Zarr Metadata*/
11607
11607
  version: _("0.5").describe("The version of the OME-Zarr Metadata")
11608
11608
  }).describe("The versioned OME-Zarr Metadata namespace")
11609
- }).describe("The zarr.json attributes key"), Fi = L({
11609
+ }).describe("The zarr.json attributes key"), ri = L({
11610
11610
  /**The versioned OME-Zarr Metadata namespace*/
11611
11611
  ome: L({
11612
11612
  plate: L({
@@ -11668,7 +11668,7 @@ const ei = L({
11668
11668
  /**The version of the OME-Zarr Metadata*/
11669
11669
  version: _("0.5").describe("The version of the OME-Zarr Metadata")
11670
11670
  }).describe("The versioned OME-Zarr Metadata namespace")
11671
- }).describe("The zarr.json attributes key"), ri = L({
11671
+ }).describe("The zarr.json attributes key"), Si = L({
11672
11672
  /**The versioned OME-Zarr Metadata namespace*/
11673
11673
  ome: L({
11674
11674
  well: L({
@@ -11687,15 +11687,15 @@ const ei = L({
11687
11687
  /**The version of the OME-Zarr Metadata*/
11688
11688
  version: _("0.5").describe("The version of the OME-Zarr Metadata")
11689
11689
  }).describe("The versioned OME-Zarr Metadata namespace")
11690
- }).describe("JSON from OME-Zarr zarr.json"), Si = ["0.4", "0.5"], Ri = new Set(Si);
11691
- function Ni(g) {
11690
+ }).describe("JSON from OME-Zarr zarr.json"), Ri = ["0.4", "0.5"], Ni = new Set(Ri);
11691
+ function ci(g) {
11692
11692
  if (!("ome" in g) || !(g.ome instanceof Object)) return;
11693
11693
  const A = g.ome;
11694
- if ("version" in A && typeof A.version == "string" && Ri.has(A.version))
11694
+ if ("version" in A && typeof A.version == "string" && Ni.has(A.version))
11695
11695
  return A.version;
11696
11696
  }
11697
11697
  function lg(g) {
11698
- const A = Ni(g);
11698
+ const A = ci(g);
11699
11699
  return A === void 0 ? "0.4" : A;
11700
11700
  }
11701
11701
  function pA(g) {
@@ -11712,9 +11712,9 @@ function hC(g, A) {
11712
11712
  return delete I[A], I;
11713
11713
  }
11714
11714
  async function eo(g, A) {
11715
- const I = new $A(g), B = new CA(I), C = pA(A), Q = await BI(B, C);
11715
+ const I = new _A(g), B = new CA(I), C = pA(A), Q = await gI(B, C);
11716
11716
  try {
11717
- return ci(Q.attrs);
11717
+ return Ui(Q.attrs);
11718
11718
  } catch {
11719
11719
  throw Error(
11720
11720
  `Failed to parse OME-Zarr plate:
@@ -11722,21 +11722,21 @@ ${JSON.stringify(Q.attrs)}`
11722
11722
  );
11723
11723
  }
11724
11724
  }
11725
- function ci(g) {
11725
+ function Ui(g) {
11726
11726
  switch (lg(g)) {
11727
11727
  case "0.5":
11728
11728
  return {
11729
- ...Fi.parse(g).ome,
11729
+ ...ri.parse(g).ome,
11730
11730
  originalVersion: "0.5"
11731
11731
  };
11732
11732
  case "0.4":
11733
11733
  return {
11734
- ...Ui(ni.parse(g)).ome,
11734
+ ...ki(Gi.parse(g)).ome,
11735
11735
  originalVersion: "0.4"
11736
11736
  };
11737
11737
  }
11738
11738
  }
11739
- function Ui(g) {
11739
+ function ki(g) {
11740
11740
  if (g.plate === void 0)
11741
11741
  throw new Error("Plate metadata is missing in OME-Zarr v0.4 plate");
11742
11742
  return {
@@ -11746,7 +11746,7 @@ function Ui(g) {
11746
11746
  }
11747
11747
  };
11748
11748
  }
11749
- function ki(g) {
11749
+ function Li(g) {
11750
11750
  if (g.well === void 0)
11751
11751
  throw new Error("Well metadata is missing in OME-Zarr v0.4 well");
11752
11752
  return {
@@ -11756,24 +11756,24 @@ function ki(g) {
11756
11756
  }
11757
11757
  };
11758
11758
  }
11759
- function Li(g) {
11759
+ function Ji(g) {
11760
11760
  switch (lg(g)) {
11761
11761
  case "0.5":
11762
11762
  return {
11763
- ...ri.parse(g).ome,
11763
+ ...Si.parse(g).ome,
11764
11764
  originalVersion: "0.5"
11765
11765
  };
11766
11766
  case "0.4":
11767
11767
  return {
11768
- ...ki(Gi.parse(g)).ome,
11768
+ ...Li(wi.parse(g)).ome,
11769
11769
  originalVersion: "0.4"
11770
11770
  };
11771
11771
  }
11772
11772
  }
11773
11773
  async function no(g, A, I) {
11774
- const B = g + "/" + A, C = new $A(B), Q = new CA(C), E = pA(I), i = await BI(Q, E);
11774
+ const B = g + "/" + A, C = new _A(B), Q = new CA(C), E = pA(I), i = await gI(Q, E);
11775
11775
  try {
11776
- return Li(i.attrs);
11776
+ return Ji(i.attrs);
11777
11777
  } catch {
11778
11778
  throw Error(
11779
11779
  `Failed to parse OME-Zarr well:
@@ -11782,14 +11782,14 @@ ${JSON.stringify(i.attrs)}`
11782
11782
  }
11783
11783
  }
11784
11784
  async function Go(g) {
11785
- const A = pA(g.version), I = await BI(g.location, A);
11785
+ const A = pA(g.version), I = await gI(g.location, A);
11786
11786
  return fg(I.attrs).omero?.channels ?? [];
11787
11787
  }
11788
11788
  async function wo(g) {
11789
- const A = pA(g.version), I = await BI(g.location, A);
11789
+ const A = pA(g.version), I = await gI(g.location, A);
11790
11790
  return fg(I.attrs).omero?.rdefs;
11791
11791
  }
11792
- function Ji(g) {
11792
+ function Yi(g) {
11793
11793
  return {
11794
11794
  ome: {
11795
11795
  multiscales: g.multiscales,
@@ -11798,29 +11798,29 @@ function Ji(g) {
11798
11798
  }
11799
11799
  };
11800
11800
  }
11801
- function Yi(g) {
11801
+ function Mi(g) {
11802
11802
  switch (lg(g)) {
11803
11803
  case "0.5":
11804
11804
  return {
11805
- ...wi.parse(g).ome,
11805
+ ...Fi.parse(g).ome,
11806
11806
  originalVersion: "0.5"
11807
11807
  };
11808
11808
  case "0.4":
11809
11809
  return {
11810
- ...Ji(ei.parse(g)).ome,
11810
+ ...Yi(ni.parse(g)).ome,
11811
11811
  originalVersion: "0.4"
11812
11812
  };
11813
11813
  }
11814
11814
  }
11815
11815
  function fg(g) {
11816
11816
  try {
11817
- return Yi(g);
11817
+ return Mi(g);
11818
11818
  } catch {
11819
11819
  throw Error(`Failed to parse OME-Zarr image:
11820
11820
  ${JSON.stringify(g)}`);
11821
11821
  }
11822
11822
  }
11823
- class OA {
11823
+ class PA {
11824
11824
  location;
11825
11825
  version;
11826
11826
  loader_;
@@ -11829,7 +11829,7 @@ class OA {
11829
11829
  }
11830
11830
  static async openLoader(A, I) {
11831
11831
  let B = pA(I);
11832
- const C = await BI(A, B), Q = fg(C.attrs), E = Q.multiscales;
11832
+ const C = await gI(A, B), Q = fg(C.attrs), E = Q.multiscales;
11833
11833
  if (E.length !== 1)
11834
11834
  throw new Error(
11835
11835
  `Exactly one multiscale image is supported. Found ${E.length} images.`
@@ -11839,15 +11839,15 @@ class OA {
11839
11839
  throw new Error("No datasets found in the multiscale image.");
11840
11840
  B || (B = pA(Q.originalVersion));
11841
11841
  const o = i.datasets.map(
11842
- (h) => kE(A, h.path, B)
11842
+ (h) => LE(A, h.path, B)
11843
11843
  ), a = await Promise.all(
11844
- o.map((h) => UE(h))
11844
+ o.map((h) => kE(h))
11845
11845
  ), D = a[0].shape, s = i.axes;
11846
11846
  if (s.length !== D.length)
11847
11847
  throw new Error(
11848
11848
  `Mismatch between number of axes (${s.length}) and array shape (${D.length})`
11849
11849
  );
11850
- return new mE({ metadata: i, arrays: a, arrayParams: o });
11850
+ return new uE({ metadata: i, arrays: a, arrayParams: o });
11851
11851
  }
11852
11852
  getDimensions() {
11853
11853
  return this.loader_.getSourceDimensionMap();
@@ -11865,8 +11865,8 @@ class OA {
11865
11865
  * @param props.version OME-Zarr version
11866
11866
  */
11867
11867
  static async fromHttp(A) {
11868
- const I = new CA(new $A(A.url)), B = await OA.openLoader(I, A.version);
11869
- return new OA({ location: I, version: A.version, loader: B });
11868
+ const I = new CA(new _A(A.url)), B = await PA.openLoader(I, A.version);
11869
+ return new PA({ location: I, version: A.version, loader: B });
11870
11870
  }
11871
11871
  /**
11872
11872
  * Creates and opens an OmeZarrImageSource from a local filesystem directory.
@@ -11881,11 +11881,11 @@ class OA {
11881
11881
  const I = new CA(
11882
11882
  new Hg(A.directory),
11883
11883
  A.path
11884
- ), B = await OA.openLoader(I, A.version);
11885
- return new OA({ location: I, version: A.version, loader: B });
11884
+ ), B = await PA.openLoader(I, A.version);
11885
+ return new PA({ location: I, version: A.version, loader: B });
11886
11886
  }
11887
11887
  }
11888
- class KI {
11888
+ class HI {
11889
11889
  coverageGroups_ = /* @__PURE__ */ new Map();
11890
11890
  state_ = "initialized";
11891
11891
  attached_ = !1;
@@ -11954,7 +11954,7 @@ class KI {
11954
11954
  return {};
11955
11955
  }
11956
11956
  }
11957
- class Mi extends mA {
11957
+ class di extends mA {
11958
11958
  // this creates the geometry for a screen-space projected line
11959
11959
  // each point on the input path is split into two vertices
11960
11960
  // these are pushed in opposite directions in screen-space to create width
@@ -12003,7 +12003,7 @@ class Mi extends mA {
12003
12003
  return I;
12004
12004
  }
12005
12005
  }
12006
- class di extends mA {
12006
+ class Ki extends mA {
12007
12007
  constructor(A) {
12008
12008
  if (super(), A.primitive != "triangles") {
12009
12009
  k.warn("WireframeGeometry", "Only indexed geometries are supported");
@@ -12028,41 +12028,41 @@ class di extends mA {
12028
12028
  this.indexData_ = new Uint32Array(B);
12029
12029
  }
12030
12030
  }
12031
- const Ki = p(0, 1, 0);
12032
- class Hi {
12031
+ const Hi = p(0, 1, 0);
12032
+ class tC {
12033
12033
  dirty_ = !0;
12034
12034
  matrix_ = $();
12035
12035
  rotation_ = sI();
12036
12036
  translation_ = d();
12037
12037
  scale_ = p(1, 1, 1);
12038
12038
  addRotation(A) {
12039
- BQ(this.rotation_, this.rotation_, A), this.dirty_ = !0;
12039
+ CQ(this.rotation_, this.rotation_, A), this.dirty_ = !0;
12040
12040
  }
12041
12041
  setRotation(A) {
12042
- QQ(this.rotation_, A), this.dirty_ = !0;
12042
+ EQ(this.rotation_, A), this.dirty_ = !0;
12043
12043
  }
12044
12044
  get rotation() {
12045
- return CQ(this.rotation_);
12045
+ return QQ(this.rotation_);
12046
12046
  }
12047
12047
  addTranslation(A) {
12048
12048
  JA(this.translation_, this.translation_, A), this.dirty_ = !0;
12049
12049
  }
12050
12050
  setTranslation(A) {
12051
- XI(this.translation_, A), this.dirty_ = !0;
12051
+ jI(this.translation_, A), this.dirty_ = !0;
12052
12052
  }
12053
12053
  get translation() {
12054
12054
  return DA(this.translation_);
12055
12055
  }
12056
12056
  addScale(A) {
12057
- XC(this.scale_, this.scale_, A), this.dirty_ = !0;
12057
+ jC(this.scale_, this.scale_, A), this.dirty_ = !0;
12058
12058
  }
12059
12059
  setScale(A) {
12060
- XI(this.scale_, A), this.dirty_ = !0;
12060
+ jI(this.scale_, A), this.dirty_ = !0;
12061
12061
  }
12062
12062
  targetTo(A) {
12063
12063
  ng(this.translation_, A) && (A = DA(A), A[2] += T);
12064
- const I = VC($(), this.translation_, A, Ki), B = uC(PB(), I);
12065
- Gg(this.rotation_, B), JI(this.rotation_, this.rotation_), this.dirty_ = !0;
12064
+ const I = vC($(), this.translation_, A, Hi), B = TC(PB(), I);
12065
+ Gg(this.rotation_, B), YI(this.rotation_, this.rotation_), this.dirty_ = !0;
12066
12066
  }
12067
12067
  get scale() {
12068
12068
  return DA(this.scale_);
@@ -12071,10 +12071,10 @@ class Hi {
12071
12071
  return this.dirty_ && (this.computeMatrix(), this.dirty_ = !1), this.matrix_;
12072
12072
  }
12073
12073
  get inverse() {
12074
- return LI($(), this.matrix);
12074
+ return JI($(), this.matrix);
12075
12075
  }
12076
12076
  computeMatrix() {
12077
- WC(
12077
+ bC(
12078
12078
  this.matrix_,
12079
12079
  this.rotation_,
12080
12080
  this.translation_,
@@ -12150,13 +12150,13 @@ class x {
12150
12150
  return I.length === 1 ? "0" + I : I;
12151
12151
  }
12152
12152
  }
12153
- class xA extends hg {
12153
+ class BI extends LI {
12154
12154
  wireframeEnabled = !1;
12155
12155
  wireframeColor = x.WHITE;
12156
12156
  depthTest = !0;
12157
12157
  textures_ = [];
12158
12158
  staleTextures_ = [];
12159
- transform_ = new Hi();
12159
+ transform_ = new tC();
12160
12160
  geometry_ = new mA();
12161
12161
  wireframeGeometry_ = null;
12162
12162
  programName_ = null;
@@ -12178,7 +12178,7 @@ class xA extends hg {
12178
12178
  return this.geometry_;
12179
12179
  }
12180
12180
  get wireframeGeometry() {
12181
- return this.wireframeGeometry_ ??= new di(this.geometry), this.wireframeGeometry_;
12181
+ return this.wireframeGeometry_ ??= new Ki(this.geometry), this.wireframeGeometry_;
12182
12182
  }
12183
12183
  get textures() {
12184
12184
  return this.textures_;
@@ -12213,7 +12213,7 @@ class xA extends hg {
12213
12213
  return {};
12214
12214
  }
12215
12215
  }
12216
- class qi extends xA {
12216
+ class qi extends BI {
12217
12217
  color_;
12218
12218
  width_;
12219
12219
  constructor({ geometry: A, color: I, width: B }) {
@@ -12241,25 +12241,25 @@ class qi extends xA {
12241
12241
  };
12242
12242
  }
12243
12243
  }
12244
- class Fo extends KI {
12244
+ class Fo extends HI {
12245
12245
  type = "AxesLayer";
12246
12246
  constructor(A) {
12247
12247
  super();
12248
12248
  const { length: I, width: B } = A;
12249
12249
  this.addObject(
12250
- ZI({
12250
+ PI({
12251
12251
  end: [I, 0, 0],
12252
12252
  width: B,
12253
12253
  color: [1, 0, 0]
12254
12254
  })
12255
12255
  ), this.addObject(
12256
- ZI({
12256
+ PI({
12257
12257
  end: [0, I, 0],
12258
12258
  width: B,
12259
12259
  color: [0, 1, 0]
12260
12260
  })
12261
12261
  ), this.addObject(
12262
- ZI({
12262
+ PI({
12263
12263
  end: [0, 0, I],
12264
12264
  width: B,
12265
12265
  color: [0, 0, 1]
@@ -12269,15 +12269,15 @@ class Fo extends KI {
12269
12269
  update() {
12270
12270
  }
12271
12271
  }
12272
- function ZI(g) {
12273
- const { end: A, width: I, color: B } = g, C = new Mi([[0, 0, 0], A]);
12272
+ function PI(g) {
12273
+ const { end: A, width: I, color: B } = g, C = new di([[0, 0, 0], A]);
12274
12274
  return new qi({
12275
12275
  geometry: C,
12276
12276
  color: B,
12277
12277
  width: I
12278
12278
  });
12279
12279
  }
12280
- const tC = [
12280
+ const yC = [
12281
12281
  "fallbackVisible",
12282
12282
  "prefetchTime",
12283
12283
  "visibleCurrent",
@@ -12292,7 +12292,7 @@ function pg(g) {
12292
12292
  z: g.prefetch.z ?? 0,
12293
12293
  t: g.prefetch.t ?? 0
12294
12294
  }, I = Object.freeze(
12295
- tC.reduce(
12295
+ yC.reduce(
12296
12296
  (Q, E) => {
12297
12297
  const i = g.priorityOrder.indexOf(E);
12298
12298
  return Q[E] = i, Q;
@@ -12359,7 +12359,7 @@ function li(g) {
12359
12359
  if (A?.min !== void 0 && A?.max !== void 0 && A.min > A.max)
12360
12360
  throw new Error("lod.min must be <= lod.max");
12361
12361
  const I = g.priorityOrder;
12362
- if (I.length !== tC.length || new Set(I).size !== I.length)
12362
+ if (I.length !== yC.length || new Set(I).size !== I.length)
12363
12363
  throw new Error("priorityOrder must include all categories exactly once");
12364
12364
  }
12365
12365
  function ug(g, A = {}) {
@@ -12371,7 +12371,7 @@ function ug(g, A = {}) {
12371
12371
  };
12372
12372
  }
12373
12373
  const lB = 32;
12374
- function _A(g, { visible: A, color: I, contrastLimits: B, opacity: C }) {
12374
+ function zA(g, { visible: A, color: I, contrastLimits: B, opacity: C }) {
12375
12375
  return A ??= !0, I = I === void 0 ? x.WHITE : x.from(I), C = C === void 0 ? 1 : hA(C, 0, 1), g !== null ? B = fi(B, g) : B === void 0 && (k.debug(
12376
12376
  "Channel",
12377
12377
  "No texture provided, defaulting channel contrast limits to [0, 1]."
@@ -12382,12 +12382,12 @@ function _A(g, { visible: A, color: I, contrastLimits: B, opacity: C }) {
12382
12382
  opacity: C
12383
12383
  };
12384
12384
  }
12385
- function sg(g, A) {
12385
+ function hg(g, A) {
12386
12386
  if (A.length > lB)
12387
12387
  throw new Error(`Maximum number of channels is ${lB}`);
12388
- return A.map((I) => _A(g, I));
12388
+ return A.map((I) => zA(g, I));
12389
12389
  }
12390
- function yC(g, A) {
12390
+ function eC(g, A) {
12391
12391
  if (g && g.length !== A)
12392
12392
  throw new Error(
12393
12393
  `channelProps length (${g.length}) must match source channel count (${A}).`
@@ -12395,14 +12395,14 @@ function yC(g, A) {
12395
12395
  }
12396
12396
  function fi(g, A) {
12397
12397
  if (g === void 0)
12398
- return yQ(A);
12398
+ return eQ(A);
12399
12399
  if (g[1] <= g[0])
12400
12400
  throw new Error(
12401
12401
  `Contrast limits must be strictly increasing: ${g}.`
12402
12402
  );
12403
12403
  return g;
12404
12404
  }
12405
- class eC extends mA {
12405
+ class nC extends mA {
12406
12406
  constructor(A, I, B, C) {
12407
12407
  super();
12408
12408
  const Q = [], E = [], i = B, o = C, a = i + 1, D = o + 1, s = A / i, h = I / o;
@@ -12433,7 +12433,7 @@ class eC extends mA {
12433
12433
  });
12434
12434
  }
12435
12435
  }
12436
- class pi extends xA {
12436
+ class pi extends BI {
12437
12437
  channels_;
12438
12438
  worldToTexCoord = $();
12439
12439
  constructor({
@@ -12442,16 +12442,16 @@ class pi extends xA {
12442
12442
  texture: B,
12443
12443
  channelProps: C = []
12444
12444
  }) {
12445
- super(), this.geometry = new eC(A, I, 1, 1), this.setTexture(0, B), this.channels_ = sg(B, C), this.programName = mi(B);
12445
+ super(), this.geometry = new nC(A, I, 1, 1), this.setTexture(0, B), this.channels_ = hg(B, C), this.programName = mi(B);
12446
12446
  }
12447
12447
  get type() {
12448
12448
  return "ImageRenderable";
12449
12449
  }
12450
12450
  setChannelProps(A) {
12451
- this.channels_ = sg(this.textures[0], A);
12451
+ this.channels_ = hg(this.textures[0], A);
12452
12452
  }
12453
12453
  setChannelProperty(A, I, B) {
12454
- const C = _A(this.textures[0], {
12454
+ const C = zA(this.textures[0], {
12455
12455
  ...this.channels_[A],
12456
12456
  [I]: B
12457
12457
  });
@@ -12461,7 +12461,7 @@ class pi extends xA {
12461
12461
  const A = this.textures[0];
12462
12462
  if (!A)
12463
12463
  throw new Error("No texture set");
12464
- const { color: I, contrastLimits: B, opacity: C } = this.channels_[0] ?? _A(A, {});
12464
+ const { color: I, contrastLimits: B, opacity: C } = this.channels_[0] ?? zA(A, {});
12465
12465
  return {
12466
12466
  u_imageSampler: 0,
12467
12467
  u_color: I.rgb,
@@ -12505,11 +12505,11 @@ class aA {
12505
12505
  const A = tg(this.normal);
12506
12506
  if (A > 0) {
12507
12507
  const I = 1 / A;
12508
- vA(this.normal, this.normal, I), this.signedDistance *= I;
12508
+ VA(this.normal, this.normal, I), this.signedDistance *= I;
12509
12509
  }
12510
12510
  }
12511
12511
  }
12512
- function nC(g, A, I, B, C = 3) {
12512
+ function GC(g, A, I, B, C = 3) {
12513
12513
  switch (g.type) {
12514
12514
  case "pointerdown": {
12515
12515
  const Q = g.event;
@@ -12518,7 +12518,7 @@ function nC(g, A, I, B, C = 3) {
12518
12518
  case "pointerup": {
12519
12519
  if (!A) return A;
12520
12520
  const Q = g.event, E = V(Q.clientX, Q.clientY);
12521
- if (EQ(A, E) < C) {
12521
+ if (iQ(A, E) < C) {
12522
12522
  if (!B) return null;
12523
12523
  const o = g.worldRay;
12524
12524
  return o && I(o).then((a) => {
@@ -12550,7 +12550,7 @@ class Tg {
12550
12550
  this.bins_.clear();
12551
12551
  }
12552
12552
  }
12553
- class GC extends KI {
12553
+ class wC extends HI {
12554
12554
  type = "ImageLayer";
12555
12555
  source_;
12556
12556
  sliceCoords_;
@@ -12594,7 +12594,7 @@ class GC extends KI {
12594
12594
  this.source_,
12595
12595
  this.policy_,
12596
12596
  this.axes_
12597
- ), yC(
12597
+ ), eC(
12598
12598
  this.channelProps_,
12599
12599
  this.chunkStoreView_.channelCount
12600
12600
  );
@@ -12657,10 +12657,10 @@ class GC extends KI {
12657
12657
  return this.lastPresentationTimeCoord_;
12658
12658
  }
12659
12659
  isPresentationStale() {
12660
- return this.lastPresentationTimeStamp_ === void 0 ? !1 : performance.now() - this.lastPresentationTimeStamp_ > GC.STALE_PRESENTATION_MS_;
12660
+ return this.lastPresentationTimeStamp_ === void 0 ? !1 : performance.now() - this.lastPresentationTimeStamp_ > wC.STALE_PRESENTATION_MS_;
12661
12661
  }
12662
12662
  onEvent(A) {
12663
- this.pointerDownPos_ = nC(
12663
+ this.pointerDownPos_ = GC(
12664
12664
  A,
12665
12665
  this.pointerDownPos_,
12666
12666
  (I) => this.pickAtRay(I),
@@ -12695,7 +12695,7 @@ class GC extends KI {
12695
12695
  set imageSourcePolicy(A) {
12696
12696
  this.policy_ !== A && (this.policy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
12697
12697
  A,
12698
- YI
12698
+ MI
12699
12699
  ));
12700
12700
  }
12701
12701
  getImageForChunk(A, I) {
@@ -12847,7 +12847,7 @@ class ui extends mA {
12847
12847
  }
12848
12848
  }
12849
12849
  }
12850
- class Ti extends xA {
12850
+ class Ti extends BI {
12851
12851
  voxelScale = p(1, 1, 1);
12852
12852
  channels_;
12853
12853
  loadedChannels_ = /* @__PURE__ */ new Set();
@@ -12903,7 +12903,7 @@ class Ti extends xA {
12903
12903
  for (let o = 0; o < i && E.length < 4; o++) {
12904
12904
  const a = this.channelToTextureIndex_.get(o);
12905
12905
  if (a === void 0 || !this.loadedChannels_.has(o)) continue;
12906
- const D = this.textures[a], s = _A(D, this.channels_[o] || {});
12906
+ const D = this.textures[a], s = zA(D, this.channels_[o] || {});
12907
12907
  if (!s.visible) continue;
12908
12908
  const h = E.length;
12909
12909
  I[h * 3] = s.color.rgb[0], I[h * 3 + 1] = s.color.rgb[1], I[h * 3 + 2] = s.color.rgb[2], E.push(a), B[h] = -s.contrastLimits[0], C[h] = 1 / (s.contrastLimits[1] - s.contrastLimits[0]), A[h] = 1, Q[h] = s.opacity;
@@ -12936,13 +12936,13 @@ class Ti extends xA {
12936
12936
  return I !== void 0 ? this.textures[I] : null;
12937
12937
  }
12938
12938
  setChannelProps(A) {
12939
- this.channels_ = sg(
12939
+ this.channels_ = hg(
12940
12940
  this.getAvailableChannelTexture(),
12941
12941
  A
12942
12942
  );
12943
12943
  }
12944
12944
  setChannelProperty(A, I, B) {
12945
- const C = _A(
12945
+ const C = zA(
12946
12946
  this.getAvailableChannelTexture(A),
12947
12947
  {
12948
12948
  ...this.channels_[A],
@@ -12969,13 +12969,13 @@ function xi(g) {
12969
12969
  function Wi(g, A) {
12970
12970
  const I = A.position, B = d(), C = d();
12971
12971
  return g.sort((Q, E) => {
12972
- JA(B, Q.boundingBox.max, Q.boundingBox.min), vA(B, B, 0.5), JA(C, E.boundingBox.max, E.boundingBox.min), vA(C, C, 0.5);
12972
+ JA(B, Q.boundingBox.max, Q.boundingBox.min), VA(B, B, 0.5), JA(C, E.boundingBox.max, E.boundingBox.min), VA(C, C, 0.5);
12973
12973
  const i = Vg(I, B), o = Vg(I, C);
12974
12974
  return i - o;
12975
12975
  }), g;
12976
12976
  }
12977
12977
  const bi = 2;
12978
- class Ro extends KI {
12978
+ class Ro extends HI {
12979
12979
  type = "VolumeLayer";
12980
12980
  source_;
12981
12981
  sliceCoords_;
@@ -13009,7 +13009,7 @@ class Ro extends KI {
13009
13009
  set imageSourcePolicy(A) {
13010
13010
  this.policy_ !== A && (this.policy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
13011
13011
  A,
13012
- YI
13012
+ MI
13013
13013
  ));
13014
13014
  }
13015
13015
  setChannelProps(A) {
@@ -13053,7 +13053,7 @@ class Ro extends KI {
13053
13053
  this.chunkStoreView_ = A.chunkManager.addView(
13054
13054
  this.source_,
13055
13055
  this.policy_
13056
- ), yC(
13056
+ ), eC(
13057
13057
  this.channelProps_,
13058
13058
  this.chunkStoreView_.channelCount
13059
13059
  );
@@ -13184,7 +13184,7 @@ class pB {
13184
13184
  this.lookupTable = vi(A.lookupTable), this.cycle = Xi(A.cycle);
13185
13185
  }
13186
13186
  }
13187
- const wC = /* @__PURE__ */ new Set(["byte", "short", "int"]), ji = /* @__PURE__ */ new Set([
13187
+ const FC = /* @__PURE__ */ new Set(["byte", "short", "int"]), ji = /* @__PURE__ */ new Set([
13188
13188
  "unsigned_byte",
13189
13189
  "unsigned_short",
13190
13190
  "unsigned_int"
@@ -13194,21 +13194,21 @@ function zi(g) {
13194
13194
  throw new Error(
13195
13195
  `Image data format must be scalar, instead found: ${g.dataFormat}`
13196
13196
  );
13197
- if (!wC.has(g.dataType) && !ji.has(g.dataType))
13197
+ if (!FC.has(g.dataType) && !ji.has(g.dataType))
13198
13198
  throw new Error(
13199
13199
  `Image data type must be an integer, instead found: ${g.dataType}`
13200
13200
  );
13201
13201
  return g;
13202
13202
  }
13203
13203
  function _i(g) {
13204
- return wC.has(g.dataType) ? "intLabelImage" : "labelImage";
13204
+ return FC.has(g.dataType) ? "intLabelImage" : "labelImage";
13205
13205
  }
13206
- class $i extends xA {
13206
+ class $i extends BI {
13207
13207
  outlineSelected_;
13208
13208
  selectedValue_;
13209
13209
  worldToTexCoord = $();
13210
13210
  constructor(A) {
13211
- super(), this.geometry = new eC(A.width, A.height, 1, 1), this.setTexture(0, zi(A.imageData));
13211
+ super(), this.geometry = new nC(A.width, A.height, 1, 1), this.setTexture(0, zi(A.imageData));
13212
13212
  const I = this.makeColorCycleTexture(A.colorMap.cycle);
13213
13213
  this.setTexture(1, I);
13214
13214
  const B = this.makeColorLookupTableTexture(
@@ -13247,7 +13247,7 @@ class $i extends xA {
13247
13247
  return Q.set(I, 0), Q.set(B, C), new fB(Q, C, 2);
13248
13248
  }
13249
13249
  }
13250
- class FC extends KI {
13250
+ class rC extends HI {
13251
13251
  type = "LabelLayer";
13252
13252
  source_;
13253
13253
  sliceCoords_;
@@ -13335,10 +13335,10 @@ class FC extends KI {
13335
13335
  }
13336
13336
  }
13337
13337
  isPresentationStale() {
13338
- return this.lastPresentationTimeStamp_ === void 0 ? !1 : performance.now() - this.lastPresentationTimeStamp_ > FC.STALE_PRESENTATION_MS_;
13338
+ return this.lastPresentationTimeStamp_ === void 0 ? !1 : performance.now() - this.lastPresentationTimeStamp_ > rC.STALE_PRESENTATION_MS_;
13339
13339
  }
13340
13340
  onEvent(A) {
13341
- this.pointerDownPos_ = nC(
13341
+ this.pointerDownPos_ = GC(
13342
13342
  A,
13343
13343
  this.pointerDownPos_,
13344
13344
  (I) => this.pickAtRay(I),
@@ -13384,7 +13384,7 @@ class FC extends KI {
13384
13384
  set imageSourcePolicy(A) {
13385
13385
  this.policy_ !== A && (this.policy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
13386
13386
  A,
13387
- YI
13387
+ MI
13388
13388
  ));
13389
13389
  }
13390
13390
  // exposed for use in chunk info overlay
@@ -13476,12 +13476,12 @@ class Ao extends Fg {
13476
13476
  return this.depth_;
13477
13477
  }
13478
13478
  }
13479
- const rC = {
13479
+ const SC = {
13480
13480
  circle: 0,
13481
13481
  square: 1,
13482
13482
  triangle: 2
13483
13483
  };
13484
- class No extends xA {
13484
+ class No extends BI {
13485
13485
  constructor(A) {
13486
13486
  super(), this.programName = "points";
13487
13487
  const I = A.flatMap((C) => {
@@ -13495,7 +13495,7 @@ class No extends xA {
13495
13495
  Q.b,
13496
13496
  Q.a,
13497
13497
  C.size,
13498
- rC[C.marker]
13498
+ SC[C.marker]
13499
13499
  ];
13500
13500
  }), B = new mA(I, [], "points");
13501
13501
  B.addAttribute({
@@ -13520,9 +13520,9 @@ class No extends xA {
13520
13520
  return "PointsRenderable";
13521
13521
  }
13522
13522
  }
13523
- let PI;
13523
+ let OI;
13524
13524
  function Io() {
13525
- return PI || (PI = go()), PI;
13525
+ return OI || (OI = go()), OI;
13526
13526
  }
13527
13527
  function go() {
13528
13528
  const g = (a) => {
@@ -13546,7 +13546,7 @@ function go() {
13546
13546
  triangle: I(256)
13547
13547
  }, E = Object.keys(Q).length, i = new Float32Array(E * 65536);
13548
13548
  for (const [a, D] of Object.entries(Q))
13549
- i.set(D, rC[a] * 65536);
13549
+ i.set(D, SC[a] * 65536);
13550
13550
  const o = new Ao(i, 256, 256);
13551
13551
  return o.wrapR = "clamp_to_edge", o.wrapS = "clamp_to_edge", o.wrapT = "clamp_to_edge", o;
13552
13552
  }
@@ -13566,7 +13566,7 @@ class mB {
13566
13566
  );
13567
13567
  }
13568
13568
  }
13569
- const OI = -1, uB = 0, Bo = 1, TB = 9e-3, Co = 1e-3, Qo = 9e-4, Eo = 0.5, io = 60;
13569
+ const VI = -1, uB = 0, Bo = 1, TB = 9e-3, Co = 1e-3, Qo = 9e-4, Eo = 0.5, io = 60;
13570
13570
  class co {
13571
13571
  camera_;
13572
13572
  orbitVelocity_ = new mB(0, 0, 0);
@@ -13574,13 +13574,13 @@ class co {
13574
13574
  currPos_;
13575
13575
  currCenter_ = d();
13576
13576
  dampingFactor_;
13577
- currMouseButton_ = OI;
13577
+ currMouseButton_ = VI;
13578
13578
  constructor(A, I) {
13579
13579
  this.camera_ = A, this.currPos_ = new mB(
13580
13580
  I?.radius ?? 1,
13581
13581
  I?.yaw ?? 0,
13582
13582
  I?.pitch ?? 0
13583
- ), I?.target && XI(this.currCenter_, I.target), this.dampingFactor_ = hA(
13583
+ ), I?.target && jI(this.currCenter_, I.target), this.dampingFactor_ = hA(
13584
13584
  I?.dampingFactor ?? Eo,
13585
13585
  0,
13586
13586
  1
@@ -13613,14 +13613,14 @@ class co {
13613
13613
  const I = Math.PI / 2 - T;
13614
13614
  this.currPos_.theta = hA(this.currPos_.theta, -I, I), this.currPos_.radius = Math.max(0.01, this.currPos_.radius), this.updateCamera();
13615
13615
  const B = Math.pow(1 - this.dampingFactor_, A * io);
13616
- this.orbitVelocity_.phi *= B, this.orbitVelocity_.theta *= B, this.orbitVelocity_.radius *= B, vA(this.panVelocity_, this.panVelocity_, B), this.cutoffLowVelocity();
13616
+ this.orbitVelocity_.phi *= B, this.orbitVelocity_.theta *= B, this.orbitVelocity_.radius *= B, VA(this.panVelocity_, this.panVelocity_, B), this.cutoffLowVelocity();
13617
13617
  }
13618
13618
  onPointerDown(A) {
13619
13619
  const I = A.event;
13620
13620
  this.currMouseButton_ = I.button, I.target?.setPointerCapture?.(I.pointerId);
13621
13621
  }
13622
13622
  onPointerMove(A) {
13623
- if (this.currMouseButton_ == OI) return;
13623
+ if (this.currMouseButton_ == VI) return;
13624
13624
  const I = A.event, B = I.movementX ?? 0, C = I.movementY ?? 0, Q = this.currMouseButton_ === uB && !I.shiftKey, E = this.currMouseButton_ === uB && I.shiftKey || this.currMouseButton_ === Bo;
13625
13625
  Q && this.orbit(B, C), E && this.pan(B, C);
13626
13626
  }
@@ -13631,7 +13631,7 @@ class co {
13631
13631
  this.zoom(B);
13632
13632
  }
13633
13633
  onPointerEnd(A) {
13634
- this.currMouseButton_ = OI;
13634
+ this.currMouseButton_ = VI;
13635
13635
  const I = A.event;
13636
13636
  I.target?.releasePointerCapture?.(I.pointerId);
13637
13637
  }
@@ -13640,7 +13640,7 @@ class co {
13640
13640
  }
13641
13641
  pan(A, I) {
13642
13642
  const B = this.currPos_.radius * Co, C = d();
13643
- jI(C, C, this.camera_.right, A), jI(C, C, this.camera_.up, I), vA(C, C, B), zI(this.panVelocity_, this.panVelocity_, C);
13643
+ zI(C, C, this.camera_.right, A), zI(C, C, this.camera_.up, I), VA(C, C, B), _I(this.panVelocity_, this.panVelocity_, C);
13644
13644
  }
13645
13645
  zoom(A) {
13646
13646
  this.orbitVelocity_.radius += A * Qo;
@@ -13650,7 +13650,7 @@ class co {
13650
13650
  this.camera_.transform.setTranslation(A), this.camera_.transform.targetTo(this.currCenter_);
13651
13651
  }
13652
13652
  cutoffLowVelocity() {
13653
- Math.abs(this.orbitVelocity_.phi) < T && (this.orbitVelocity_.phi = 0), Math.abs(this.orbitVelocity_.theta) < T && (this.orbitVelocity_.theta = 0), Math.abs(this.orbitVelocity_.radius) < T && (this.orbitVelocity_.radius = 0), tg(this.panVelocity_) < T && jC(this.panVelocity_);
13653
+ Math.abs(this.orbitVelocity_.phi) < T && (this.orbitVelocity_.phi = 0), Math.abs(this.orbitVelocity_.theta) < T && (this.orbitVelocity_.theta = 0), Math.abs(this.orbitVelocity_.radius) < T && (this.orbitVelocity_.radius = 0), tg(this.panVelocity_) < T && zC(this.panVelocity_);
13654
13654
  }
13655
13655
  }
13656
13656
  class oo {
@@ -13699,7 +13699,8 @@ class oo {
13699
13699
  return !0;
13700
13700
  }
13701
13701
  }
13702
- class SC extends xA {
13702
+ class RC extends LI {
13703
+ transform_ = new tC();
13703
13704
  projectionMatrix_ = $();
13704
13705
  near_ = 0;
13705
13706
  far_ = 0;
@@ -13709,6 +13710,9 @@ class SC extends xA {
13709
13710
  get projectionMatrix() {
13710
13711
  return this.projectionMatrix_;
13711
13712
  }
13713
+ get transform() {
13714
+ return this.transform_;
13715
+ }
13712
13716
  get viewMatrix() {
13713
13717
  return this.transform.inverse;
13714
13718
  }
@@ -13721,7 +13725,7 @@ class SC extends xA {
13721
13725
  return p(A[4], A[5], A[6]);
13722
13726
  }
13723
13727
  getViewProjection() {
13724
- return vI($(), this.projectionMatrix, this.viewMatrix);
13728
+ return XI($(), this.projectionMatrix, this.viewMatrix);
13725
13729
  }
13726
13730
  get frustum() {
13727
13731
  return new oo(this.getViewProjection());
@@ -13733,16 +13737,16 @@ class SC extends xA {
13733
13737
  return this.transform.translation;
13734
13738
  }
13735
13739
  clipToWorld(A) {
13736
- const I = DI(A[0], A[1], A[2], 1), B = LI(
13740
+ const I = DI(A[0], A[1], A[2], 1), B = JI(
13737
13741
  $(),
13738
13742
  this.projectionMatrix_
13739
- ), C = XA(
13743
+ ), C = vA(
13740
13744
  YA(),
13741
13745
  I,
13742
13746
  B
13743
13747
  );
13744
- AQ(C, C, 1 / C[3]);
13745
- const Q = XA(
13748
+ IQ(C, C, 1 / C[3]);
13749
+ const Q = vA(
13746
13750
  YA(),
13747
13751
  C,
13748
13752
  this.transform.matrix
@@ -13750,12 +13754,12 @@ class SC extends xA {
13750
13754
  return p(Q[0], Q[1], Q[2]);
13751
13755
  }
13752
13756
  }
13753
- const RC = 1.77, xB = 128, WB = 128 / RC, ao = -1e6, Do = 1e6;
13754
- class Uo extends SC {
13757
+ const NC = 1.77, xB = 128, WB = 128 / NC, ao = -1e6, Do = 1e6;
13758
+ class Uo extends RC {
13755
13759
  // width_ and height_ should always be defined by constructor (see setFrame)
13756
13760
  width_ = xB;
13757
13761
  height_ = WB;
13758
- viewportAspectRatio_ = RC;
13762
+ viewportAspectRatio_ = NC;
13759
13763
  viewportSize_ = [xB, WB];
13760
13764
  axes_;
13761
13765
  rotation_;
@@ -13808,8 +13812,8 @@ class Uo extends SC {
13808
13812
  }
13809
13813
  getWorldViewRect() {
13810
13814
  let A = DI(-1, -1, 0, 1), I = DI(1, 1, 0, 1);
13811
- const B = LI($(), this.getViewProjection());
13812
- A = XA(YA(), A, B), I = XA(YA(), I, B);
13815
+ const B = JI($(), this.getViewProjection());
13816
+ A = vA(YA(), A, B), I = vA(YA(), I, B);
13813
13817
  const C = W[this.axes_.u], Q = W[this.axes_.v];
13814
13818
  return new AA(
13815
13819
  V(A[C], A[Q]),
@@ -13819,7 +13823,7 @@ class Uo extends SC {
13819
13823
  updateProjectionMatrix() {
13820
13824
  const A = this.width_, I = this.height_, B = A / I;
13821
13825
  let C = 0.5 * A, Q = 0.5 * I;
13822
- this.viewportAspectRatio_ > B ? C *= this.viewportAspectRatio_ / B : Q *= B / this.viewportAspectRatio_, this.viewportSize_ = [2 * C, 2 * Q], OC(
13826
+ this.viewportAspectRatio_ > B ? C *= this.viewportAspectRatio_ / B : Q *= B / this.viewportAspectRatio_, this.viewportSize_ = [2 * C, 2 * Q], VC(
13823
13827
  this.projectionMatrix_,
13824
13828
  -C,
13825
13829
  C,
@@ -13866,7 +13870,7 @@ class ko {
13866
13870
  I.preventDefault();
13867
13871
  const B = DA(A.worldPos), C = I.deltaY < 0 ? 1.05 : 0.95;
13868
13872
  this.camera_.zoom(C);
13869
- const Q = this.camera_.clipToWorld(A.clipPos), E = zI(d(), B, Q);
13873
+ const Q = this.camera_.clipToWorld(A.clipPos), E = _I(d(), B, Q);
13870
13874
  this.camera_.pan(E);
13871
13875
  }
13872
13876
  onPointerDown(A) {
@@ -13875,7 +13879,7 @@ class ko {
13875
13879
  }
13876
13880
  onPointerMove(A) {
13877
13881
  if (!this.dragActive_ || !A.worldPos) return;
13878
- const I = zI(d(), this.dragStart_, A.worldPos);
13882
+ const I = _I(d(), this.dragStart_, A.worldPos);
13879
13883
  this.camera_.pan(I);
13880
13884
  }
13881
13885
  onPointerEnd(A) {
@@ -13883,8 +13887,8 @@ class ko {
13883
13887
  !this.dragActive_ || I.button !== bB || (this.dragActive_ = !1, I.target?.releasePointerCapture?.(I.pointerId));
13884
13888
  }
13885
13889
  }
13886
- const so = 60, ho = 1.77, oI = 0.1, VI = 180 - oI;
13887
- class Lo extends SC {
13890
+ const so = 60, ho = 1.77, oI = 0.1, vI = 180 - oI;
13891
+ class Lo extends RC {
13888
13892
  fov_;
13889
13893
  aspectRatio_;
13890
13894
  constructor(A = {}) {
@@ -13895,9 +13899,9 @@ class Lo extends SC {
13895
13899
  far: Q = 1e4,
13896
13900
  position: E = p(0, 0, 0)
13897
13901
  } = A;
13898
- if (I < oI || I > VI)
13902
+ if (I < oI || I > vI)
13899
13903
  throw new Error(
13900
- `Invalid field of view: ${I}, must be in [${oI}, ${VI}] degrees`
13904
+ `Invalid field of view: ${I}, must be in [${oI}, ${vI}] degrees`
13901
13905
  );
13902
13906
  super(), this.fov_ = I, this.aspectRatio_ = B, this.near_ = C, this.far_ = Q, this.transform.setTranslation(E), this.updateProjectionMatrix();
13903
13907
  }
@@ -13913,12 +13917,12 @@ class Lo extends SC {
13913
13917
  zoom(A) {
13914
13918
  if (A <= 0)
13915
13919
  throw new Error(`Invalid zoom factor: ${A}`);
13916
- this.fov_ = Math.max(oI, Math.min(VI, this.fov_ / A)), this.updateProjectionMatrix();
13920
+ this.fov_ = Math.max(oI, Math.min(vI, this.fov_ / A)), this.updateProjectionMatrix();
13917
13921
  }
13918
13922
  updateProjectionMatrix() {
13919
- ZC(
13923
+ PC(
13920
13924
  this.projectionMatrix_,
13921
- mC(this.fov),
13925
+ uC(this.fov),
13922
13926
  this.aspectRatio_,
13923
13927
  this.near_,
13924
13928
  this.far_
@@ -13929,13 +13933,13 @@ export {
13929
13933
  Fo as AxesLayer,
13930
13934
  x as Color,
13931
13935
  to as Idetik,
13932
- GC as ImageLayer,
13936
+ wC as ImageLayer,
13933
13937
  pi as ImageRenderable,
13934
13938
  pB as LabelColorMap,
13935
13939
  $i as LabelImageRenderable,
13936
- FC as LabelLayer,
13937
- KI as Layer,
13938
- OA as OmeZarrImageSource,
13940
+ rC as LabelLayer,
13941
+ HI as Layer,
13942
+ PA as OmeZarrImageSource,
13939
13943
  co as OrbitControls,
13940
13944
  Uo as OrthographicCamera,
13941
13945
  ko as PanZoomControls,